新需求调整
This commit is contained in:
@@ -168,7 +168,9 @@ public class CwSiteDeviceDriver extends AbstractOpcDeviceDriver implements Devic
|
|||||||
request.setType("2");
|
request.setType("2");
|
||||||
acsToWmsService.notify(request);
|
acsToWmsService.notify(request);
|
||||||
resultSucess=true;
|
resultSucess=true;
|
||||||
}else if (move ==1 && this.getDeviceCode().startsWith("ZJBDJW") &&!resultSucess) {
|
}else if (move ==1 &&
|
||||||
|
(this.getDeviceCode().startsWith("ZJBDJW")||
|
||||||
|
this.getDeviceCode().startsWith("FJBKJDJW"))&&!resultSucess) {
|
||||||
//点位数量变更后通知lms
|
//点位数量变更后通知lms
|
||||||
FeedBackTaskStatusRequest request = new FeedBackTaskStatusRequest();
|
FeedBackTaskStatusRequest request = new FeedBackTaskStatusRequest();
|
||||||
request.setState("3");
|
request.setState("3");
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import org.nl.system.service.quartz.dao.SysQuartzJob;
|
|||||||
import org.nl.system.service.quartz.dao.SysQuartzLog;
|
import org.nl.system.service.quartz.dao.SysQuartzLog;
|
||||||
import org.nl.system.service.quartz.dao.mapper.SysQuartzLogMapper;
|
import org.nl.system.service.quartz.dao.mapper.SysQuartzLogMapper;
|
||||||
import org.nl.system.service.quartz.impl.SysQuartzJobServiceImpl;
|
import org.nl.system.service.quartz.impl.SysQuartzJobServiceImpl;
|
||||||
|
import org.quartz.DisallowConcurrentExecution;
|
||||||
import org.quartz.JobExecutionContext;
|
import org.quartz.JobExecutionContext;
|
||||||
import org.quartz.JobExecutionException;
|
import org.quartz.JobExecutionException;
|
||||||
import org.springframework.scheduling.annotation.Async;
|
import org.springframework.scheduling.annotation.Async;
|
||||||
@@ -28,6 +29,7 @@ import java.util.concurrent.ThreadPoolExecutor;
|
|||||||
@Async
|
@Async
|
||||||
@SuppressWarnings({"unchecked", "all"})
|
@SuppressWarnings({"unchecked", "all"})
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
@DisallowConcurrentExecution
|
||||||
public class ExecutionJob extends QuartzJobBean {
|
public class ExecutionJob extends QuartzJobBean {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -108,27 +108,31 @@ public class KGHJRKTask extends AbstractTask {
|
|||||||
* 判断目标点位
|
* 判断目标点位
|
||||||
* 1.A区的去A区缓存点,B区的去B区
|
* 1.A区的去A区缓存点,B区的去B区
|
||||||
* 2.倒叙查找,找到满足当前位置数量不足3的即可
|
* 2.倒叙查找,找到满足当前位置数量不足3的即可
|
||||||
|
* 3.负极板优先放到HCQ7,放满了再放到HCQ1
|
||||||
*/
|
*/
|
||||||
private SchBasePoint findNextPoint(SchBasePoint startPoint, String vehicleType) {
|
private SchBasePoint findNextPoint(SchBasePoint startPoint, String vehicleType) {
|
||||||
String regionCode = null;
|
String regionCode = null;
|
||||||
|
String regionCode2 = null;
|
||||||
if ("A1".equals(startPoint.getWorkshop_code())) {
|
if ("A1".equals(startPoint.getWorkshop_code())) {
|
||||||
//A1空架到HCQ1
|
//A1空架到HCQ1
|
||||||
regionCode = "HCQ1";
|
regionCode = "HCQ7";
|
||||||
|
regionCode2 ="HCQ1";
|
||||||
if ("1".equals(vehicleType)) {
|
if ("1".equals(vehicleType)) {
|
||||||
regionCode = "ZJBKGHJDJW";
|
regionCode = "ZJBKGHJDJW";
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if ("A2".equals(startPoint.getWorkshop_code())) {
|
} else if ("A2".equals(startPoint.getWorkshop_code())) {
|
||||||
//A1空架到KGHJ2
|
//A1空架到HCQ5
|
||||||
regionCode = "KGHJ2";
|
regionCode = "HCQ5";
|
||||||
}
|
}
|
||||||
List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode, "1");
|
List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode, "1");
|
||||||
|
//负极板优先放到HCQ7,放满了再放到HCQ1
|
||||||
//从前往后判断,直到发现点位有货,取前一个
|
//从前往后判断,直到发现点位有货,取前一个
|
||||||
SchBasePoint schBasePoint = null;
|
SchBasePoint schBasePoint = null;
|
||||||
if (!"ZJBKGHJDJW".equals(regionCode)) {
|
if (!"ZJBKGHJDJW".equals(regionCode)) {
|
||||||
for (int i = schBasePointList.size() - 1; i >= 0; i--) {
|
for (int i = schBasePointList.size() - 1; i >= 0; i--) {
|
||||||
SchBasePoint temp = schBasePointList.get(i);
|
SchBasePoint temp = schBasePointList.get(i);
|
||||||
if (temp.getVehicle_qty() == 1 &&
|
if (temp.getVehicle_qty() > 1 &&
|
||||||
ObjectUtil.isEmpty(temp.getIng_task_code())) {
|
ObjectUtil.isEmpty(temp.getIng_task_code())) {
|
||||||
if (schBasePoint != null) {
|
if (schBasePoint != null) {
|
||||||
log.info("空固化架放货找到当前点位有货:{},取上一个空位:{}", temp.getPoint_code(), schBasePoint.getPoint_code());
|
log.info("空固化架放货找到当前点位有货:{},取上一个空位:{}", temp.getPoint_code(), schBasePoint.getPoint_code());
|
||||||
@@ -139,6 +143,26 @@ public class KGHJRKTask extends AbstractTask {
|
|||||||
}
|
}
|
||||||
schBasePoint = temp;
|
schBasePoint = temp;
|
||||||
}
|
}
|
||||||
|
if(ObjectUtil.isEmpty(schBasePoint)){
|
||||||
|
schBasePointList = pointMapper.findPointByRegion(regionCode2, "1");
|
||||||
|
for (int i = schBasePointList.size() - 1; i >= 0; i--) {
|
||||||
|
SchBasePoint temp = schBasePointList.get(i);
|
||||||
|
//三拖一起放,如果不是01结尾直接跳过
|
||||||
|
if(!temp.getPoint_code().endsWith("01")){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (temp.getVehicle_qty() == 1 &&
|
||||||
|
ObjectUtil.isEmpty(temp.getIng_task_code())) {
|
||||||
|
if (schBasePoint != null) {
|
||||||
|
log.info("空固化架放货找到当前点位有货:{},取上一个空位:{}", temp.getPoint_code(), schBasePoint.getPoint_code());
|
||||||
|
} else {
|
||||||
|
log.info("当前区域:" + regionCode + "所有点位均已放满,暂时跳过");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
schBasePoint = temp;
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
for (int i = schBasePointList.size() - 1; i >= 0; i--) {
|
for (int i = schBasePointList.size() - 1; i >= 0; i--) {
|
||||||
SchBasePoint temp = schBasePointList.get(i);
|
SchBasePoint temp = schBasePointList.get(i);
|
||||||
@@ -181,11 +205,18 @@ public class KGHJRKTask extends AbstractTask {
|
|||||||
if (status.equals(TaskStatus.FINISHED)) { // 完成
|
if (status.equals(TaskStatus.FINISHED)) { // 完成
|
||||||
// 终点解锁,库存增加
|
// 终点解锁,库存增加
|
||||||
endPointObj.setIng_task_code("");
|
endPointObj.setIng_task_code("");
|
||||||
//正极板对接位通过plc信号同步,任务完成不增加
|
endPointObj.setVehicle_qty(1);
|
||||||
// if(!"ZJBKGHJDJW".equals(startPointObj.getRegion_code())) {
|
|
||||||
endPointObj.setVehicle_qty(startPointObj.getVehicle_qty() + 1);
|
|
||||||
// }
|
|
||||||
pointService.update(endPointObj);
|
pointService.update(endPointObj);
|
||||||
|
if("HCQ7".equals(endPointObj.getRegion_code())){
|
||||||
|
endPointObj = pointService.getById(endPoint.substring(0,endPoint.length()-1)+"2");
|
||||||
|
endPointObj.setIng_task_code("");
|
||||||
|
endPointObj.setVehicle_qty(1);
|
||||||
|
pointService.update(endPointObj);
|
||||||
|
endPointObj = pointService.getById(endPoint.substring(0,endPoint.length()-1)+"3");
|
||||||
|
endPointObj.setIng_task_code("");
|
||||||
|
endPointObj.setVehicle_qty(1);
|
||||||
|
pointService.update(endPointObj);
|
||||||
|
}
|
||||||
|
|
||||||
// 任务完成
|
// 任务完成
|
||||||
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
||||||
|
|||||||
@@ -113,15 +113,39 @@ public class TBXBKJTask extends AbstractTask {
|
|||||||
*/
|
*/
|
||||||
private SchBasePoint findNextPoint(SchBasePoint startPoint,SchBaseTask task) {
|
private SchBasePoint findNextPoint(SchBasePoint startPoint,SchBaseTask task) {
|
||||||
String regionCode = null;
|
String regionCode = null;
|
||||||
|
String regionCode2 = null;
|
||||||
if ("TBX1".equals(startPoint.getRegion_code())) {
|
if ("TBX1".equals(startPoint.getRegion_code())) {
|
||||||
//TBX1找A区
|
//TBX1找A区
|
||||||
regionCode = "HCQ1";
|
regionCode = "HCQ7";
|
||||||
|
regionCode2 ="HCQ1";
|
||||||
|
|
||||||
} else if ("TBX2".equals(startPoint.getRegion_code())) {
|
} else if ("TBX2".equals(startPoint.getRegion_code())) {
|
||||||
//TBX2找B区
|
//TBX2找B区
|
||||||
regionCode = "HCQ5";
|
regionCode = "HCQ5";
|
||||||
}
|
}
|
||||||
SchBasePoint temp = null;
|
SchBasePoint temp = null;
|
||||||
|
if(ObjectUtil.isNotEmpty(regionCode2)){
|
||||||
|
List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode2, "1");
|
||||||
|
for (int i = schBasePointList.size() - 1; i >= 0; i--) {
|
||||||
|
SchBasePoint schBasePoint = schBasePointList.get(i);
|
||||||
|
//如果当前任务已锁定则直接返回
|
||||||
|
if(task.getTask_code().equals(schBasePoint.getIng_task_code())){
|
||||||
|
return schBasePoint;
|
||||||
|
}
|
||||||
|
if (schBasePoint.getVehicle_qty() > 0 &&
|
||||||
|
(ObjectUtil.isEmpty(schBasePoint.getIng_task_code()))) {
|
||||||
|
if (temp == null ||
|
||||||
|
schBasePoint.getPoint_code().startsWith(temp.getPoint_code().substring(0, temp.getPoint_code().length() - 2))
|
||||||
|
&&schBasePoint.getPoint_code().compareTo(temp.getPoint_code())>0){
|
||||||
|
temp=schBasePoint;
|
||||||
|
log.info("涂板线补空架找到当前符合条件的点位{}", schBasePoint.getPoint_code());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(temp!=null){
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
}
|
||||||
List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode, "1");
|
List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode, "1");
|
||||||
for (SchBasePoint schBasePoint : schBasePointList) {
|
for (SchBasePoint schBasePoint : schBasePointList) {
|
||||||
//如果当前任务已锁定则直接返回
|
//如果当前任务已锁定则直接返回
|
||||||
|
|||||||
Reference in New Issue
Block a user