叠盘机上报处理

main
Comair 7 months ago
parent 1456af80df
commit f0493682f1
  1. 34
      shkj-wms/src/main/java/com/shkj/wcs/plc/PlcEventTask.java

@ -292,6 +292,11 @@ public class PlcEventTask {
} else if (pointType.equals("retInOutSwit")) { } else if (pointType.equals("retInOutSwit")) {
retInOutSwit = plcProperty.getAddress(); retInOutSwit = plcProperty.getAddress();
retInOutSwitVt = plcProperty.getPointType(); retInOutSwitVt = plcProperty.getPointType();
} else if (pointType.equals("stk")) {
stk = plcProperty.getAddress();
} else if (pointType.equals("retStk")) {
retStk = plcProperty.getAddress();
retStkVt = plcProperty.getPointType();
} }
} }
@ -432,9 +437,38 @@ public class PlcEventTask {
log.info("出入库切换时,写入的命令返回结果:"+inOutSwitBoolean.toString()); log.info("出入库切换时,写入的命令返回结果:"+inOutSwitBoolean.toString());
} }
//叠盘机
if (pointMap.containsKey(stk) && Boolean.valueOf(pointMap.get(stk).toString())) {
WcsIncomingTaskRequestBody body = new WcsIncomingTaskRequestBody();
body.setStation("叠盘机点位");
body.setTaskType(TaskTypeEnum.In.getValue());
body.setBussinessType(BusinTaskTypeEnum.stockIn.getValue());
body.setCreateDt(new Date().toString());
//调用agv接口查询库区状态
Object[] areaStatus = {};
body.setAreaStatus(areaStatus);
WcsResponseVo vo = wcsUtil.wcsIncomingTaskRequest(body);
log.info("空托申请wz-wcs返回:" + vo.getHeader());
Map<String, Object> allMap = new HashMap<>(1);
Map<String, Integer> reqMap = new HashMap<>(1);
if (Result.isOk(vo.getHeader().getMsgCode())) {
reqMap.put(retStkVt,1);
} else {
reqMap.put(retStkVt,0);
}
allMap.put(retStk, reqMap);
String allMapJson = JsonUtil.toJSONString(allMap);
log.info("叠盘机叠满上报时,给输送线写命令数据:{}",allMapJson);
Boolean bCR01Boolean = plcReadAndWrite.execWrite(plcOperate, allMapJson);
log.info("叠盘机叠满上报时,写入的命令返回结果:"+bCR01Boolean.toString());
}
} catch (Exception e) { } catch (Exception e) {
log.error("dpsRealTimeTask:" + e.getMessage()); log.error("dpsRealTimeTask:" + e.getMessage());
} }
} }
} }

Loading…
Cancel
Save