|
@@ -1,5 +1,6 @@
|
|
|
package com.ruoyi.ams.agv.ndc.service.impl;
|
|
|
|
|
|
+import cn.hutool.core.thread.ThreadUtil;
|
|
|
import com.ruoyi.ams.agv.ndc.domain.AmsTask;
|
|
|
import com.ruoyi.ams.agv.ndc.entity.CallbackResult;
|
|
|
import com.ruoyi.ams.agv.ndc.service.IAmsTaskService;
|
|
@@ -138,6 +139,41 @@ public class StatusUpdateServiceImpl implements StatusUpdateService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public synchronized void confirmAnalysis(String taskNo, Integer aciIndex, Integer carNo
|
|
|
+ , String updateLocation, String updateValue) {
|
|
|
+ AmsTask amsTask = new AmsTask();
|
|
|
+ amsTask.setTaskNo(taskNo);
|
|
|
+ amsTask = amsTaskService.selectAmsTaskByModel(amsTask);
|
|
|
+ if (amsTask != null) {
|
|
|
+ AmsTask addTaskForm = new AmsTask();
|
|
|
+ addTaskForm.setTaskNo(System.currentTimeMillis() + "");
|
|
|
+ addTaskForm.setBusinessType(Constant.TASK_BUSINESS_TYPE.TASK_m.getValue());
|
|
|
+ addTaskForm.setExt1(amsTask.getAciIndex().toString());
|
|
|
+ addTaskForm.setStFrom(998);
|
|
|
+ addTaskForm.setStTo(999);
|
|
|
+ addTaskForm.setPriority(1);
|
|
|
+ addTaskForm.setRemark(taskNo);
|
|
|
+ addTaskForm.setExt2(updateLocation);
|
|
|
+ addTaskForm.setExt3(updateValue);
|
|
|
+ //如果ams_task已经有此任务的待接收m消息,则不生成新的m消息
|
|
|
+ AmsTask amsTaskQuery = new AmsTask();
|
|
|
+ amsTaskQuery.setAciAccept(0);
|
|
|
+ amsTaskQuery.setIsDelete(0);
|
|
|
+ amsTaskQuery.setRemark(taskNo);
|
|
|
+ amsTaskQuery.setBusinessType(Constant.TASK_BUSINESS_TYPE.TASK_m.getValue());
|
|
|
+ amsTaskQuery.setExt2(addTaskForm.getExt2());
|
|
|
+ amsTaskQuery.setExt2(addTaskForm.getExt3());
|
|
|
+ List<AmsTask> undoneList = amsTaskService.selectAmsTaskList(amsTaskQuery);
|
|
|
+ if (undoneList.size() > 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // todo 现场测试
|
|
|
+ ThreadUtil.sleep(5000);
|
|
|
+ amsTaskService.insertAmsTask(addTaskForm);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public void feedbackTS(Integer doorNo) {
|
|
|
AmsTask addTaskForm = new AmsTask();
|
|
@@ -157,6 +193,7 @@ public class StatusUpdateServiceImpl implements StatusUpdateService {
|
|
|
amsTaskQuery.setIsDelete(0);
|
|
|
amsTaskQuery.setBusinessType(Constant.TASK_BUSINESS_TYPE.TASK_164.getValue());
|
|
|
amsTaskQuery.setExt2(addTaskForm.getExt2());
|
|
|
+ amsTaskQuery.setExt3(addTaskForm.getExt3());
|
|
|
List<AmsTask> undoneList = amsTaskService.selectAmsTaskList(amsTaskQuery);
|
|
|
if (undoneList.size() > 0) {
|
|
|
return;
|
|
@@ -172,8 +209,10 @@ public class StatusUpdateServiceImpl implements StatusUpdateService {
|
|
|
} else if (doorNo == 2) {
|
|
|
doorNum = AutoDoorClient.AUTO_DOOR_NO.C;
|
|
|
}
|
|
|
- Boolean isOpen = autoDoorClient.sendOpen(doorNum);
|
|
|
+// Boolean isOpen = autoDoorClient.sendOpen(doorNum);
|
|
|
+ Boolean isOpen = true;
|
|
|
if (isOpen) {
|
|
|
+ ThreadUtil.sleep(5000);
|
|
|
log.info("开门信号发送成功!门号:" + doorNo);
|
|
|
feedbackTS(doorNo);
|
|
|
}
|
|
@@ -187,11 +226,12 @@ public class StatusUpdateServiceImpl implements StatusUpdateService {
|
|
|
} else if (doorNo == 2) {
|
|
|
doorNum = AutoDoorClient.AUTO_DOOR_NO.C;
|
|
|
}
|
|
|
+// Boolean isClose = autoDoorClient.sendClose(doorNum);
|
|
|
Boolean isClose = autoDoorClient.sendClose(doorNum);
|
|
|
if (isClose) {
|
|
|
+ ThreadUtil.sleep(5000);
|
|
|
log.info("关门信号发送成功!门号:" + doorNo);
|
|
|
- // 不需要反馈
|
|
|
-// feedbackTS(doorNo);
|
|
|
+ feedbackTS(doorNo);
|
|
|
}
|
|
|
}
|
|
|
}
|