|
@@ -7,10 +7,12 @@ import com.ruoyi.ams.agv.ndc.service.IAmsTaskService;
|
|
import com.ruoyi.ams.agv.ndc.service.StatusUpdateService;
|
|
import com.ruoyi.ams.agv.ndc.service.StatusUpdateService;
|
|
import com.ruoyi.ams.business.BusinessServiceImpl;
|
|
import com.ruoyi.ams.business.BusinessServiceImpl;
|
|
import com.ruoyi.ams.business.IBusinessService;
|
|
import com.ruoyi.ams.business.IBusinessService;
|
|
|
|
+import com.ruoyi.ams.inv.service.IInvLotLocIdService;
|
|
import com.ruoyi.ams.task.service.IWcsTaskService;
|
|
import com.ruoyi.ams.task.service.IWcsTaskService;
|
|
import com.ruoyi.base.constant.Constant;
|
|
import com.ruoyi.base.constant.Constant;
|
|
import com.ruoyi.common.utils.uuid.SnowflakeIdWorker;
|
|
import com.ruoyi.common.utils.uuid.SnowflakeIdWorker;
|
|
import com.ruoyi.hard.modbus.tcp.AutoDoorClient;
|
|
import com.ruoyi.hard.modbus.tcp.AutoDoorClient;
|
|
|
|
+import com.ruoyi.hard.modbus.tcp.ModbusTcpWeigherClient;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
@@ -28,7 +30,9 @@ public class StatusUpdateServiceImpl implements StatusUpdateService {
|
|
@Autowired
|
|
@Autowired
|
|
private IBusinessService businessService;
|
|
private IBusinessService businessService;
|
|
@Autowired
|
|
@Autowired
|
|
- private AutoDoorClient autoDoorClient;
|
|
|
|
|
|
+ private ModbusTcpWeigherClient modbusTcpWeigherClient;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IInvLotLocIdService invLotLocIdService;
|
|
|
|
|
|
public enum AGV_ACTION {
|
|
public enum AGV_ACTION {
|
|
/***
|
|
/***
|
|
@@ -174,6 +178,43 @@ public class StatusUpdateServiceImpl implements StatusUpdateService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public synchronized void confirmAnalysisWeighing(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;
|
|
|
|
+ }
|
|
|
|
+ // 拿到称重数据
|
|
|
|
+ int weight = modbusTcpWeigherClient.readWeighing();
|
|
|
|
+ // 插入复称数据
|
|
|
|
+ invLotLocIdService.insertWeighingData(taskNo, weight);
|
|
|
|
+ amsTaskService.insertAmsTask(addTaskForm);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public void feedbackTS(Integer doorNo) {
|
|
public void feedbackTS(Integer doorNo) {
|
|
AmsTask addTaskForm = new AmsTask();
|
|
AmsTask addTaskForm = new AmsTask();
|