盘点入库任务逻辑修改
This commit is contained in:
@@ -122,9 +122,9 @@ public interface IApiService
|
|||||||
|
|
||||||
public AjaxResult selectMydoJobByNoTrayCode(Map<String, Object> param);
|
public AjaxResult selectMydoJobByNoTrayCode(Map<String, Object> param);
|
||||||
|
|
||||||
public AjaxResult requestEnterByEnterIdAndTrayCode();
|
|
||||||
|
|
||||||
AjaxResult receiveOutMydoJob(ReceiveJob receiveOutJob);
|
AjaxResult receiveOutMydoJob(ReceiveJob receiveOutJob);
|
||||||
|
|
||||||
AjaxResult receiveInMydoJob(ReceiveJob receiveInJob);
|
AjaxResult receiveInMydoJob(ReceiveJob receiveInJob);
|
||||||
|
|
||||||
|
AjaxResult requestEnterByEnterId(String enterId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -340,10 +340,6 @@ public class ApiServiceImpl implements IApiService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public AjaxResult requestEnterByEnterIdAndTrayCode() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult receiveOutMydoJob(ReceiveJob receiveOutJob) {
|
public AjaxResult receiveOutMydoJob(ReceiveJob receiveOutJob) {
|
||||||
@@ -372,6 +368,17 @@ public class ApiServiceImpl implements IApiService {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult requestEnterByEnterId(String enterId) {
|
||||||
|
RequestLog requestLog = requestLogService.getRequestLog(REQUEST_ENTER_URL, "入库请求", JSONUtil.toJsonStr(enterId));
|
||||||
|
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||||
|
InterfaceReceive bean = JSONUtil.toBean(requestLog.getResponseBody(), InterfaceReceive.class);
|
||||||
|
return AjaxResult.success(bean.getData());
|
||||||
|
} else {
|
||||||
|
return AjaxResult.error();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult selectMydoJobByNoTrayCode(Map<String, Object> param) {
|
public AjaxResult selectMydoJobByNoTrayCode(Map<String, Object> param) {
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ public class Constant {
|
|||||||
public static final String REQUEST_MYDO_JOB_URL = WMS_BASE_URL+"requestByNoTrayCode";
|
public static final String REQUEST_MYDO_JOB_URL = WMS_BASE_URL+"requestByNoTrayCode";
|
||||||
public static final String RE_ASSIGN_URL = WMS_BASE_URL+"reAssign";
|
public static final String RE_ASSIGN_URL = WMS_BASE_URL+"reAssign";
|
||||||
public static final String RE_MATERIAL_URL = WMS_BASE_URL+"reMaterial";
|
public static final String RE_MATERIAL_URL = WMS_BASE_URL+"reMaterial";
|
||||||
|
public static final String REQUEST_ENTER_URL = WMS_BASE_URL+"requestEnterByEnterId";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -135,19 +135,19 @@ public class Floor1BothWayInSsjThread implements Runnable {
|
|||||||
private void dispatch2(DeviceSsj ssj) {
|
private void dispatch2(DeviceSsj ssj) {
|
||||||
if (ssj.getDw() == 1 && ssj.getTaskNo() > 0 && ssj.getTaskNo() < 1000 && ssj.getRkqq() == 1) {
|
if (ssj.getDw() == 1 && ssj.getTaskNo() > 0 && ssj.getTaskNo() < 1000 && ssj.getRkqq() == 1) {
|
||||||
//先检测有没有出库作业,有出库作业直接退回
|
//先检测有没有出库作业,有出库作业直接退回
|
||||||
MydoJob outMydoJob = mydoJobService.selectMydoJobByExitList(Collections.singletonList(exitRoadwayMap.get(ssj.getDeviceCode())));
|
MydoJob outMydoJob = mydoJobService.selectMydoJobByExitList(Collections.singletonList(ssj.getDeviceCode()));
|
||||||
String l2005WriteAddress = "DB501.20";
|
String l2012WriteAddress = "DB501.20";
|
||||||
String l2012WriteAddress = "DB501.30";
|
String l2013WriteAddress = "DB501.30";
|
||||||
if (ObjUtil.isNotNull(outMydoJob) || StrUtil.isEmpty(ssj.getTrayCode())) {
|
if (ObjUtil.isNotNull(outMydoJob) || StrUtil.isEmpty(ssj.getTrayCode())) {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
//下发去向 和任务号
|
//下发去向 和任务号
|
||||||
switch (ssj.getDeviceCode()) {
|
switch (ssj.getDeviceCode()) {
|
||||||
case "L2005":
|
|
||||||
i = writeToSsj(l2005WriteAddress,"0",2);
|
|
||||||
break;
|
|
||||||
case "L2012":
|
case "L2012":
|
||||||
i = writeToSsj(l2012WriteAddress,"0",2);
|
i = writeToSsj(l2012WriteAddress,"0",2);
|
||||||
break;
|
break;
|
||||||
|
case "L2013":
|
||||||
|
i = writeToSsj(l2013WriteAddress,"0",2);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (i == 1) {
|
if (i == 1) {
|
||||||
log.info("未检测到托盘码下发回退 rwh:{},qx:{},trayCode:{}", ssj.getTaskNo(), 1, ssj.getTrayCode());
|
log.info("未检测到托盘码下发回退 rwh:{},qx:{},trayCode:{}", ssj.getTaskNo(), 1, ssj.getTrayCode());
|
||||||
@@ -157,18 +157,19 @@ public class Floor1BothWayInSsjThread implements Runnable {
|
|||||||
MydoJob param = new MydoJob();
|
MydoJob param = new MydoJob();
|
||||||
param.setStatus(TASK_STATUS_CREATE);
|
param.setStatus(TASK_STATUS_CREATE);
|
||||||
param.setExecutionPhase("0");
|
param.setExecutionPhase("0");
|
||||||
if ("L2005".equals(ssj.getDeviceCode())) {
|
param.setEntranceId(ssj.getDeviceCode());
|
||||||
param.setEntranceId("L2013");
|
|
||||||
} else {
|
|
||||||
param.setEntranceId("L2012");
|
|
||||||
}
|
|
||||||
List<MydoJob> mydoJobs = mydoJobService.selectMydoJobList(param);
|
List<MydoJob> mydoJobs = mydoJobService.selectMydoJobList(param);
|
||||||
MydoJob inJob = null;
|
MydoJob inJob = null;
|
||||||
if (CollUtil.isNotEmpty(mydoJobs)) {
|
if (CollUtil.isNotEmpty(mydoJobs)) {
|
||||||
inJob = mydoJobs.get(0);
|
inJob = mydoJobs.get(0);
|
||||||
} else {
|
} 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()) {
|
if (result.isSuccess()) {
|
||||||
inJob = (MydoJob) result.get("data");
|
inJob = (MydoJob) result.get("data");
|
||||||
mydoJobService.insertMydoJob(inJob);
|
mydoJobService.insertMydoJob(inJob);
|
||||||
@@ -180,12 +181,12 @@ public class Floor1BothWayInSsjThread implements Runnable {
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
//下发去向 和任务号
|
//下发去向 和任务号
|
||||||
switch (ssj.getDeviceCode()) {
|
switch (ssj.getDeviceCode()) {
|
||||||
case "L2005":
|
|
||||||
i = writeToSsj(l2005WriteAddress,inJob.getTaskNo(),1);
|
|
||||||
break;
|
|
||||||
case "L2012":
|
case "L2012":
|
||||||
i = writeToSsj(l2012WriteAddress,inJob.getTaskNo(),1);
|
i = writeToSsj(l2012WriteAddress,inJob.getTaskNo(),1);
|
||||||
break;
|
break;
|
||||||
|
case "L2013":
|
||||||
|
i = writeToSsj(l2013WriteAddress,inJob.getTaskNo(),1);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (i == 1) {
|
if (i == 1) {
|
||||||
inJob.setStatus(TASK_STATUS_RUNNING);
|
inJob.setStatus(TASK_STATUS_RUNNING);
|
||||||
|
|||||||
Reference in New Issue
Block a user