Browse Source

fix:三坐标检测结果

wang.sq@aliyun.com 1 week ago
parent
commit
24699572d7

+ 24 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/externalApi/service/impl/MesNoticeServiceImpl.java

@@ -76,6 +76,30 @@ public class MesNoticeServiceImpl extends SuperServiceImpl<MesNoticeMapper, MesN
         return mesNotice1;
     }
 
+    @Override
+    public MesNotice updateNoticeById(MesNotice model) {
+        if (model.getId() == null || model.getOrderNo() == null) return null;
+
+        MesNotice mesNotice = baseMapper.selectById(model.getId());
+
+        model.setId(mesNotice.getId());
+        BeanUtils.copyProperties(model, mesNotice);
+        baseMapper.updateAllById(mesNotice);
+
+        // 新增到log日志界面
+        //int count = mesNoticeLogService.count(Wraps.<MesNoticeLog>lbQ().eq(MesNoticeLog::getNoticeId, mesNotice1.getId()).eq(MesNoticeLog::getStatus, mesNotice1.getStatus()));
+        MesNoticeLog mesNoticeLog = new MesNoticeLog();
+        BeanUtils.copyProperties(mesNotice,mesNoticeLog);
+        mesNoticeLog.setNoticeId(mesNotice.getId());
+        mesNoticeLog.setId(null);
+//        if(count<=0){
+//            mesNoticeLogService.save(mesNoticeLog);
+//        }
+        mesNoticeLogService.save(mesNoticeLog);
+
+        return mesNotice;
+    }
+
     @Override
     public IPage<MesNotice> pageList(IPage page, Wrapper<MesNotice> queryWrapper) {
         BaseContextHandler.setTenant("0000");

+ 1 - 4
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/impl/TaskNodeServiceImpl.java

@@ -1981,10 +1981,7 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
                         if(order.getSource().equals("2")){
                             MesNotice mesNotice = mesNoticeService.getOne(new LbqWrapper<MesNotice>().eq(MesNotice::getBatchNo, order.getBatchNo()).eq(MesNotice::getBuType, "TASKDISTRIBUTE").ne(MesNotice::getStatus, "3").last("limit 1"));
                             mesNotice.setStatus("3");
-                            mesNoticeService.updateAllById(mesNotice);
-                            MesNoticeLog mesNoticeLog = MesNoticeLog.builder().build();
-                            BeanUtil.copyProperties(mesNotice, mesNoticeLog);
-                            mesNoticeLogService.save(mesNoticeLog);
+                            mesNoticeService.updateNoticeById(mesNotice);
                         }
                     }
 

+ 3 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionReadyCenter/service/MesNoticeService.java

@@ -19,6 +19,9 @@ public interface MesNoticeService extends SuperService<MesNotice> {
 
     MesNotice updateStatus(MesNoticeUpdateDTO model);
 
+    MesNotice updateNoticeById(MesNotice model);
+
+
     IPage<MesNotice> pageList(IPage page, @Param(Constants.WRAPPER) Wrapper<MesNotice> queryWrapper);
 
     //批量新增

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

@@ -1158,7 +1158,7 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
                 .setStatus("1").setSingleTaskFlag(0).setOrderStatus("1").setBatchNo(workOrder.getString("batchNo"));
         //产品编码+ 密级编码 + 批次号 + 工艺版本
         String orderName = "MES_" + workOrder.getString("materialCode") + "_" + workOrder.getString("planSecretLevel").toUpperCase() + "_" + workOrder.getString("batchNo") + "_" + workOrder.getString("processRouteVersion");
-        order.setCustId(0L).setOrderName(orderName).setZoneId(zone.getId()).setAuditStatus("1");
+        order.setCustId(0L).setOrderName(orderName).setZoneId(zone.getId()).setAuditStatus("0");
         orderService.save(order);
 
         OrderProduct orderProduct = OrderProduct.builder().build();