|
@@ -24,6 +24,7 @@ import com.github.zuihou.business.externalApi.dao.AgvHikOrderInfoMapper;
|
|
|
import com.github.zuihou.business.externalApi.dto.ManualInfo;
|
|
import com.github.zuihou.business.externalApi.dto.ManualInfo;
|
|
|
import com.github.zuihou.business.externalApi.entity.AgvHikOrderDetailInfo;
|
|
import com.github.zuihou.business.externalApi.entity.AgvHikOrderDetailInfo;
|
|
|
import com.github.zuihou.business.externalApi.entity.AgvHikOrderInfo;
|
|
import com.github.zuihou.business.externalApi.entity.AgvHikOrderInfo;
|
|
|
|
|
+import com.github.zuihou.business.externalApi.entity.R2;
|
|
|
import com.github.zuihou.business.externalApi.service.AgvHikOrderDetailInfoService;
|
|
import com.github.zuihou.business.externalApi.service.AgvHikOrderDetailInfoService;
|
|
|
import com.github.zuihou.business.externalApi.service.AgvHikOrderInfoService;
|
|
import com.github.zuihou.business.externalApi.service.AgvHikOrderInfoService;
|
|
|
import com.github.zuihou.business.operationManagementCenter.dto.OrderUpdateDTO;
|
|
import com.github.zuihou.business.operationManagementCenter.dto.OrderUpdateDTO;
|
|
@@ -63,6 +64,7 @@ import org.apache.commons.lang.time.DateUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.poi.ss.formula.functions.T;
|
|
import org.apache.poi.ss.formula.functions.T;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
@@ -148,6 +150,9 @@ public class ToolbarController {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private AAutoNodeLogService aAutoNodeLogService;
|
|
private AAutoNodeLogService aAutoNodeLogService;
|
|
|
|
|
|
|
|
|
|
+ @Value("${imcs-to-ccs.enabled:true}")
|
|
|
|
|
+ private Boolean imcsTOccsEnable;
|
|
|
|
|
+
|
|
|
@ApiOperation(value = "更新库位位置", notes = "更新库位位置")
|
|
@ApiOperation(value = "更新库位位置", notes = "更新库位位置")
|
|
|
@PostMapping("/updateStorge")
|
|
@PostMapping("/updateStorge")
|
|
|
public R updateStorge(@RequestBody Map<String, String> data) {
|
|
public R updateStorge(@RequestBody Map<String, String> data) {
|
|
@@ -322,32 +327,51 @@ public class ToolbarController {
|
|
|
@ApiOperation(value = "复位重发指令", notes = "复位重发指令")
|
|
@ApiOperation(value = "复位重发指令", notes = "复位重发指令")
|
|
|
@PostMapping("/resend")
|
|
@PostMapping("/resend")
|
|
|
public R resend(@RequestBody Map<String, String> data) {
|
|
public R resend(@RequestBody Map<String, String> data) {
|
|
|
- R result = this.taskNodeHandle("/api/GetCallbackList", data);
|
|
|
|
|
- if (result.getIsError()) return fail("指令不存在");
|
|
|
|
|
|
|
+ JSONObject jsonObject = null;
|
|
|
String taskNodeId = data.get("taskNodeId").toString();
|
|
String taskNodeId = data.get("taskNodeId").toString();
|
|
|
String taskId = data.get("taskId").toString();
|
|
String taskId = data.get("taskId").toString();
|
|
|
- TTask task = taskService.getById(taskId);
|
|
|
|
|
TaskNode taskNode = taskNodeService.getById(taskNodeId);
|
|
TaskNode taskNode = taskNodeService.getById(taskNodeId);
|
|
|
- TaskNode nextNode = taskNodeService.getNextNTaskNode(taskNode, 1);
|
|
|
|
|
- if (task.getStatus().equals("3") || nextNode.getExeStatus().equals("3"))
|
|
|
|
|
- return fail("节点任务已经完成无须重发指令");
|
|
|
|
|
- JSONArray resultData = JSONArray.parseArray(result.getData().toString());
|
|
|
|
|
-
|
|
|
|
|
- if (resultData.size() == 0) return fail("回调数据不存在");
|
|
|
|
|
- JSONObject jsonObject = (JSONObject) resultData.get(resultData.size() - 1);
|
|
|
|
|
- if (jsonObject.containsKey("state") && jsonObject.getString("state").equals("true")) {
|
|
|
|
|
- return fail("没有需复位解决的回调数据");
|
|
|
|
|
- }
|
|
|
|
|
- if (jsonObject.containsKey("state") && jsonObject.getString("state").equals("false")) {
|
|
|
|
|
- //更改回调状态和更新cache缓存
|
|
|
|
|
- String hostSystemUrl = (null == msgUtil.redis_get(ParameterKey.PARAMETERS) ? "" : ((Map<String, String>) msgUtil.redis_get(ParameterKey.PARAMETERS)).get(ParameterKey.HOSTSYSTEMURL).toString());
|
|
|
|
|
- String updateReCallState = hostSystemUrl + "/api/UpdateReCallState";
|
|
|
|
|
- JSONObject params = new JSONObject();
|
|
|
|
|
- params.put("TaskNodeId", taskNodeId);
|
|
|
|
|
- params.put("TaskId", taskId);
|
|
|
|
|
- params.put("State", "0");
|
|
|
|
|
- msgUtil.httpForPost(updateReCallState, params.toJSONString());
|
|
|
|
|
|
|
+ if(StringUtils.isEmpty(taskNodeId) || StringUtils.isEmpty(taskId) || taskNode==null) return R2.fail("传参数据不允许为空");
|
|
|
|
|
+
|
|
|
|
|
+ if(imcsTOccsEnable){
|
|
|
|
|
+ R result = this.taskNodeHandle("/api/GetCallbackList", data);
|
|
|
|
|
+ if (result.getIsError()) return fail("指令不存在");
|
|
|
|
|
+
|
|
|
|
|
+ TTask task = taskService.getById(taskId);
|
|
|
|
|
+
|
|
|
|
|
+ TaskNode nextNode = taskNodeService.getNextNTaskNode(taskNode, 1);
|
|
|
|
|
+ if (task.getStatus().equals("3") || (nextNode!=null && nextNode.getExeStatus().equals("3")))
|
|
|
|
|
+ return fail("节点任务已经完成无须重发指令");
|
|
|
|
|
+ JSONArray resultData = JSONArray.parseArray(result.getData().toString());
|
|
|
|
|
+ if (resultData.size() == 0) return fail("回调数据不存在");
|
|
|
|
|
+ jsonObject = (JSONObject) resultData.get(resultData.size() - 1);
|
|
|
|
|
+ if (jsonObject.containsKey("state") && jsonObject.getString("state").equals("true")) {
|
|
|
|
|
+ return fail("没有需复位解决的回调数据");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (jsonObject.containsKey("state") && jsonObject.getString("state").equals("false")) {
|
|
|
|
|
+ //更改回调状态和更新cache缓存
|
|
|
|
|
+ String hostSystemUrl = (null == msgUtil.redis_get(ParameterKey.PARAMETERS) ? "" : ((Map<String, String>) msgUtil.redis_get(ParameterKey.PARAMETERS)).get(ParameterKey.HOSTSYSTEMURL).toString());
|
|
|
|
|
+ String updateReCallState = hostSystemUrl + "/api/UpdateReCallState";
|
|
|
|
|
+ JSONObject params = new JSONObject();
|
|
|
|
|
+ params.put("TaskNodeId", taskNodeId);
|
|
|
|
|
+ params.put("TaskId", taskId);
|
|
|
|
|
+ params.put("State", "0");
|
|
|
|
|
+ msgUtil.httpForPost(updateReCallState, params.toJSONString());
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+ //重发更新节点日志
|
|
|
|
|
+
|
|
|
|
|
+ //后台缓存处理
|
|
|
|
|
+ List object = msgUtil.redis_get_list(YunjianConstant.YUNJIAN_SCHEDULE_LIST);
|
|
|
|
|
+ List scheduleList = (object!=null)?msgUtil.redis_get_list(YunjianConstant.YUNJIAN_SCHEDULE_LIST): org.apache.commons.compress.utils.Lists.newArrayList();
|
|
|
|
|
+ if(scheduleList.contains(taskNodeId)){
|
|
|
|
|
+ String repeatKey = taskNode.getId().toString() + taskNode.getTaskId().toString();
|
|
|
|
|
+ String cacheUid = msgUtil.redis_get(repeatKey) == null ? "" : msgUtil.redis_get(repeatKey).toString();
|
|
|
|
|
+ if(StringUtils.isNotEmpty(cacheUid)){
|
|
|
|
|
+ msgUtil.redis_del(cacheUid);
|
|
|
|
|
+ }
|
|
|
|
|
+ msgUtil.redis_fuzzy_del(YunjianConstant.YUNJIAN_SCHEDULE_LIST, taskNodeId);
|
|
|
|
|
+ }
|
|
|
return success();
|
|
return success();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -446,6 +470,7 @@ public class ToolbarController {
|
|
|
if (StringUtils.isEmpty(taskNodeId) || StringUtils.isEmpty(taskId)) return fail("数据传参为空");
|
|
if (StringUtils.isEmpty(taskNodeId) || StringUtils.isEmpty(taskId)) return fail("数据传参为空");
|
|
|
TaskNode taskNode = taskNodeService.getById(taskNodeId);
|
|
TaskNode taskNode = taskNodeService.getById(taskNodeId);
|
|
|
if (null == taskNode) return fail("节点数据不存在");
|
|
if (null == taskNode) return fail("节点数据不存在");
|
|
|
|
|
+ msgUtil.createWarnLog(taskNodeId+"节点手动释放库位锁定", "RunningLockException");
|
|
|
taskNodeService.freeLock(taskNode.getCompleteBatchNo());
|
|
taskNodeService.freeLock(taskNode.getCompleteBatchNo());
|
|
|
return success();
|
|
return success();
|
|
|
}
|
|
}
|