Kaynağa Gözat

fix:更新三坐标参数字段

wang.sq@aliyun.com 1 hafta önce
ebeveyn
işleme
8222d878bb

+ 2 - 0
imcs-admin-boot/imcs-authority-biz/src/main/java/com/github/zuihou/authority/service/common/impl/OptLogServiceImpl.java

@@ -5,6 +5,7 @@ import com.github.zuihou.authority.dao.common.OptLogMapper;
 import com.github.zuihou.authority.entity.common.OptLog;
 import com.github.zuihou.authority.service.common.OptLogService;
 import com.github.zuihou.base.service.SuperServiceImpl;
+import com.github.zuihou.context.BaseContextHandler;
 import com.github.zuihou.log.entity.OptLogDTO;
 import com.github.zuihou.utils.BeanPlusUtil;
 import lombok.extern.slf4j.Slf4j;
@@ -28,6 +29,7 @@ public class OptLogServiceImpl extends SuperServiceImpl<OptLogMapper, OptLog> im
 
     @Override
     public boolean save(OptLogDTO entity) {
+        BaseContextHandler.setTenant("0000");
         return super.save(BeanPlusUtil.toBean(entity, OptLog.class));
     }
 

+ 3 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/impl/OrderServiceImpl.java

@@ -428,6 +428,9 @@ public class OrderServiceImpl extends SuperServiceImpl<OrderMapper, Order> imple
                             // 生成task表,因为工序定了以后不变,排产时只需更新预计开始时间和结束时间
                             Long bomId = planProduct.getBomId();
                             List<BomProcedure> bomProcedureList = bomProcedureMap.get(bomId);
+                            if(bomProcedureList == null || bomProcedureList.isEmpty()){
+                                throw new BizException("缺少工艺,请先补充工艺信息");
+                            }
                             Map<Long,BomProcedure> bpMap = bomProcedureList.stream().collect(Collectors.toMap(BomProcedure::getId, t->t));
                             //产品批次号,用于产品分解任务关联
                             String bomBatchNo = UUID.randomUUID().toString().replace("-", "");

+ 13 - 8
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/externalApi/MesController.java

@@ -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")) {