盘点入库任务逻辑修改

This commit is contained in:
liuhanqing
2025-10-10 10:44:38 +08:00
parent 3c673d5c16
commit e6ab8b2ada
4 changed files with 30 additions and 21 deletions

View File

@@ -135,19 +135,19 @@ public class Floor1BothWayInSsjThread implements Runnable {
private void dispatch2(DeviceSsj ssj) {
if (ssj.getDw() == 1 && ssj.getTaskNo() > 0 && ssj.getTaskNo() < 1000 && ssj.getRkqq() == 1) {
//先检测有没有出库作业,有出库作业直接退回
MydoJob outMydoJob = mydoJobService.selectMydoJobByExitList(Collections.singletonList(exitRoadwayMap.get(ssj.getDeviceCode())));
String l2005WriteAddress = "DB501.20";
String l2012WriteAddress = "DB501.30";
MydoJob outMydoJob = mydoJobService.selectMydoJobByExitList(Collections.singletonList(ssj.getDeviceCode()));
String l2012WriteAddress = "DB501.20";
String l2013WriteAddress = "DB501.30";
if (ObjUtil.isNotNull(outMydoJob) || StrUtil.isEmpty(ssj.getTrayCode())) {
int i = 0;
//下发去向 和任务号
switch (ssj.getDeviceCode()) {
case "L2005":
i = writeToSsj(l2005WriteAddress,"0",2);
break;
case "L2012":
i = writeToSsj(l2012WriteAddress,"0",2);
break;
case "L2013":
i = writeToSsj(l2013WriteAddress,"0",2);
break;
}
if (i == 1) {
log.info("未检测到托盘码下发回退 rwh:{},qx:{},trayCode:{}", ssj.getTaskNo(), 1, ssj.getTrayCode());
@@ -157,18 +157,19 @@ public class Floor1BothWayInSsjThread implements Runnable {
MydoJob param = new MydoJob();
param.setStatus(TASK_STATUS_CREATE);
param.setExecutionPhase("0");
if ("L2005".equals(ssj.getDeviceCode())) {
param.setEntranceId("L2013");
} else {
param.setEntranceId("L2012");
}
param.setEntranceId(ssj.getDeviceCode());
List<MydoJob> mydoJobs = mydoJobService.selectMydoJobList(param);
MydoJob inJob = null;
if (CollUtil.isNotEmpty(mydoJobs)) {
inJob = mydoJobs.get(0);
} else {
//根据托盘码请求入库作业
AjaxResult result = apiService.requestEnterByEnterIdAndTrayCode();
HashMap<String, Object> paramMap = new HashMap<>();
paramMap.put("trayCode", ssj.getTrayCode());
paramMap.put("size", ssj.getTraySize());
paramMap.put("floor", "1");
paramMap.put("entranceId",ssj.getDeviceCode());
AjaxResult result = apiService.createInMydoJob(paramMap);
if (result.isSuccess()) {
inJob = (MydoJob) result.get("data");
mydoJobService.insertMydoJob(inJob);
@@ -180,12 +181,12 @@ public class Floor1BothWayInSsjThread implements Runnable {
int i = 0;
//下发去向 和任务号
switch (ssj.getDeviceCode()) {
case "L2005":
i = writeToSsj(l2005WriteAddress,inJob.getTaskNo(),1);
break;
case "L2012":
i = writeToSsj(l2012WriteAddress,inJob.getTaskNo(),1);
break;
case "L2013":
i = writeToSsj(l2013WriteAddress,inJob.getTaskNo(),1);
break;
}
if (i == 1) {
inJob.setStatus(TASK_STATUS_RUNNING);