|
@@ -182,34 +182,39 @@ public class DispatchExceptionController extends SuperSimpleController<AAutoNode
|
|
|
if(StringUtils.isEmpty(jsonParam)){
|
|
|
return R.fail("指令请求不存在");
|
|
|
}
|
|
|
-
|
|
|
TaskNode taskNode = taskNodeService.getById(taskNodeId);
|
|
|
//清除资源锁定
|
|
|
- if(taskNode.getInterfaceType().equals("3")){
|
|
|
- //AGV资源释放
|
|
|
-
|
|
|
- }else{
|
|
|
- taskNodeService.freeLock(taskNode.getCompleteBatchNo());
|
|
|
- }
|
|
|
+// if(taskNode.getInterfaceType().equals("3")){
|
|
|
+// //AGV资源释放
|
|
|
+//
|
|
|
+// }else{
|
|
|
+// taskNodeService.freeLock(taskNode.getCompleteBatchNo());
|
|
|
+// }
|
|
|
ZZoneProductionresource zoneProductionresource = zZoneProductionresourceMapper.selectOne(Wraps.<ZZoneProductionresource>lbQ().eq(ZZoneProductionresource::getResourceId,taskNode.getResourceId()));
|
|
|
ZZone zZone = zoneService.getById(zoneProductionresource.getZoneId());
|
|
|
- // 判断该节点使用那条线的plc
|
|
|
- Map<String, String> plcInfo = DictionaryKey.PLC_CATEGORY.get(zZone.getNo());
|
|
|
- String paramKey = zZone.getNo() + "_plc";
|
|
|
- String plcUrl = (null == msgUtil.redis_get(ParameterKey.PARAMETERS)? "": ((Map<String,String>)msgUtil.redis_get(ParameterKey.PARAMETERS)).get(paramKey).toString());
|
|
|
+ if(zZone.getRunMode().equals("2")){
|
|
|
+ return R.fail("指令模式必须在手动模式下才可以执行,请确认产线模式");
|
|
|
+ }
|
|
|
|
|
|
- // TODO 后续删除代码,目前条用模拟接口
|
|
|
- plcUrl = plcUrl.replace("8081","8083");
|
|
|
+ // 判断该节点使用那条线的plc
|
|
|
+// Map<String, String> plcInfo = DictionaryKey.PLC_CATEGORY.get(zZone.getNo());
|
|
|
+// String paramKey = zZone.getNo() + "_plc";
|
|
|
+// String plcUrl = (null == msgUtil.redis_get(ParameterKey.PARAMETERS)? "": ((Map<String,String>)msgUtil.redis_get(ParameterKey.PARAMETERS)).get(paramKey).toString());
|
|
|
+//
|
|
|
+// // TODO 后续删除代码,目前条用模拟接口
|
|
|
+// plcUrl = plcUrl.replace("8081","8083");
|
|
|
+ //String plcUrl =
|
|
|
+ //String plcUrl = conMap.get("instructionUrl") + "/api/" + conMap.get("method").toString();
|
|
|
|
|
|
HttpHeaders headers = new HttpHeaders();
|
|
|
headers.setContentType(MediaType.parseMediaType("application/json;charset=UTF-8"));
|
|
|
HttpEntity<String> formEntity = new HttpEntity<String>(jsonParam, headers);
|
|
|
|
|
|
- String instructionUrl = plcUrl +"/api/"+ autoNodeLog.getMethod().toString() ;
|
|
|
+ String instructionUrl = conMap.get("instructionUrl") +"/api/"+ autoNodeLog.getMethod().toString() ;
|
|
|
String returnData = restTemplate.postForObject(instructionUrl, formEntity, String.class);
|
|
|
JSONObject retJson = JSONObject.parseObject(returnData);
|
|
|
String code = retJson.getString("code").trim();
|
|
|
- if(code.equals("0")){
|
|
|
+ if(code.equals("false")){
|
|
|
autoNodeLog.setExeResult("0").setManual("1").setFeedback(retJson.getString("msg")).setExecuteTime(new Date());
|
|
|
aAutoNodeLogService.updateAllById(autoNodeLog);
|
|
|
return R.fail("指令重发失败");
|