|
@@ -19,12 +19,18 @@ import com.github.zuihou.business.dispatchRecord.service.DispatchRecordService;
|
|
|
import com.github.zuihou.business.operationManagementCenter.entity.Order;
|
|
|
import com.github.zuihou.business.operationManagementCenter.entity.TWorkpiece;
|
|
|
import com.github.zuihou.business.operationManagementCenter.entity.TaskNode;
|
|
|
+import com.github.zuihou.business.operationManagementCenter.service.TaskNodeService;
|
|
|
import com.github.zuihou.business.operationManagementCenter.service.WorkpieceService;
|
|
|
import com.github.zuihou.business.productionReadyCenter.entity.AAutoNodeLog;
|
|
|
import com.github.zuihou.business.productionReadyCenter.service.AAutoNodeLogService;
|
|
|
+import com.github.zuihou.business.productionResourceCenter.dao.ZZoneProductionresourceMapper;
|
|
|
+import com.github.zuihou.business.productionResourceCenter.entity.ZZone;
|
|
|
+import com.github.zuihou.business.productionResourceCenter.entity.ZZoneProductionresource;
|
|
|
+import com.github.zuihou.business.productionResourceCenter.service.ZZoneService;
|
|
|
import com.github.zuihou.business.util.MsgUtil;
|
|
|
import com.github.zuihou.common.constant.CacheKey;
|
|
|
import com.github.zuihou.common.constant.DictionaryKey;
|
|
|
+import com.github.zuihou.common.constant.ParameterKey;
|
|
|
import com.github.zuihou.common.util.DateUtil;
|
|
|
import com.github.zuihou.context.BaseContextHandler;
|
|
|
import com.github.zuihou.database.mybatis.conditions.Wraps;
|
|
@@ -74,6 +80,15 @@ public class DispatchExceptionController extends SuperSimpleController<AAutoNode
|
|
|
@Autowired
|
|
|
private RestTemplate restTemplate;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TaskNodeService taskNodeService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ZZoneProductionresourceMapper zZoneProductionresourceMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ZZoneService zoneService;
|
|
|
+
|
|
|
@ApiOperation(value = "查询对话调度异常", notes = "查询对话调度异常")
|
|
|
@PostMapping("/page")
|
|
|
public R<IPage<AAutoNodeLog>> page(@RequestBody @Validated PageParams<AAutoNodeLog> params) {
|
|
@@ -168,11 +183,22 @@ public class DispatchExceptionController extends SuperSimpleController<AAutoNode
|
|
|
return R.fail("指令请求不存在");
|
|
|
}
|
|
|
|
|
|
+ TaskNode taskNode = taskNodeService.getById(taskNodeId);
|
|
|
+ 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());
|
|
|
+
|
|
|
+ // TODO 后续删除代码,目前条用模拟接口
|
|
|
+ plcUrl = plcUrl.replace("8081","8083");
|
|
|
+
|
|
|
HttpHeaders headers = new HttpHeaders();
|
|
|
headers.setContentType(MediaType.parseMediaType("application/json;charset=UTF-8"));
|
|
|
HttpEntity<String> formEntity = new HttpEntity<String>(jsonParam, headers);
|
|
|
|
|
|
- String instructionUrl = DictionaryKey.INSTRUCTION_URL +"/api/"+ autoNodeLog.getMethod().toString() ;
|
|
|
+ String instructionUrl = plcUrl +"/api/"+ autoNodeLog.getMethod().toString() ;
|
|
|
String returnData = restTemplate.postForObject(instructionUrl, formEntity, String.class);
|
|
|
JSONObject retJson = JSONObject.parseObject(returnData);
|
|
|
String code = retJson.getString("code").trim();
|