|
@@ -140,12 +140,17 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
|
|
|
@ApiOperation(value = "接受质检任务下发通知接口", notes = "接受质检任务下发通知接口")
|
|
|
@PostMapping("/externalApi/measuringTaskReceive")
|
|
|
public R addQualityToNotice(@RequestBody String data) {
|
|
|
- log.info("==============接受质检任务下发通知接口开始=================");
|
|
|
+ log.info("==============接受质检任务下发通知接口开始================={}", data);
|
|
|
ThreeCoordinateDto threeCoordinateDto = JSONObject.parseObject(data, ThreeCoordinateDto.class);
|
|
|
|
|
|
MesNotice mesNotice = MesNotice.builder().orderNo(threeCoordinateDto.getOrderNumber()).
|
|
|
- buType("TASKDISTRIBUTE").lineCode("11111").status("1").source("QUALITY").apiType("QUALITYTASK").apiAddress("http:// 192.168.26.201:8081/api/v1/MeasuringTaskReceive").targetSource("PRODUCTION_LINE").acceptPar(data).build();
|
|
|
-
|
|
|
+ buType("TASKDISTRIBUTE").
|
|
|
+ apiType("QUALITYTASK").
|
|
|
+ lineCode("11111").
|
|
|
+ status("0").
|
|
|
+ source("数字化检测系统").
|
|
|
+ targetSource("产线管控单元").
|
|
|
+ acceptPar(data).build();
|
|
|
try {
|
|
|
boolean b = baseService.addNotice(mesNotice);
|
|
|
} catch (Exception e) {
|
|
@@ -214,13 +219,13 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
|
|
|
@ApiOperation(value = "任务下发通知接口", notes = "任务下发通知接口")
|
|
|
@PostMapping("/externalApi/order/addMes")
|
|
|
public R addNotice(@RequestBody String data) {
|
|
|
- log.info("================接受上游系统的任务================");
|
|
|
+ log.info("================addMes接受上游系统的任务================");
|
|
|
|
|
|
- log.info("任务数据{}", JSONObject.toJSONString(data));
|
|
|
+ log.info("任务数据{}", data);
|
|
|
try {
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(data);
|
|
|
+// JSONObject jsonObject = JSONObject.parseObject(data);
|
|
|
|
|
|
- MesNotice mesNotice = MesNotice.builder().orderNo(jsonObject.getString("workOrderNo")).
|
|
|
+ MesNotice mesNotice = MesNotice.builder().orderNo(System.currentTimeMillis()+"").
|
|
|
buType("TASKDISTRIBUTE").lineCode("11111").status("1").source("QUALITY").apiType("TASKDISTRIBUTE")
|
|
|
.targetSource("PRODUCTION_LINE").acceptPar(data).build();
|
|
|
boolean b = baseService.addNotice(mesNotice);
|
|
@@ -313,7 +318,7 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
|
|
|
BaseContextHandler.setTenant("0000");
|
|
|
MesNotice mesNotice = baseService.updateStatus(model);
|
|
|
JSONObject ret = null;
|
|
|
- if (StringUtil.isNotEmpty(mesNotice.getApiAddress())) {
|
|
|
+ if (StringUtil.isNotEmpty(mesNotice.getApiAddress()) || StringUtil.isNotEmpty(mesNotice.getAcceptPar())) {
|
|
|
JSONArray jsonParam = new JSONArray();
|
|
|
jsonParam.add(mesNotice.getOrderNo());
|
|
|
if (mesNotice.getBuType().equals("TASKDISTRIBUTE")) {
|