ソースを参照

Merge remote-tracking branch 'origin/master'

wang.sq@aliyun.com 2 週間 前
コミット
94138b51ff

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

@@ -61,7 +61,6 @@ public class MesNoticeServiceImpl extends SuperServiceImpl<MesNoticeMapper, MesN
         }
 
         baseMapper.insert(model);
-
         return true;
     }
 

+ 3 - 21
imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/externalApi/MesNoticeMapper.xml

@@ -32,27 +32,9 @@
             SELECT
             m.*
             FROM
-            imcs_mes_notice m,
-            (
-            SELECT
-            MAX( m2.api_sort ) AS msort,
-            m2.order_no
-            FROM
-            imcs_mes_notice m2
-            WHERE
-            m2.`status` IN ( '0', '1', '2', '99' )
-            GROUP BY
-            m2.order_no
-            ) n
-            WHERE
-            m.`status` IN ( '0', '1', '2', '99' )
-            AND m.api_sort = n.msort
-            AND m.order_no = n.order_no
-            GROUP BY
-            m.order_no
-            ORDER BY
-            m.api_sort ASC,
-            m.STATUS DESC
+            imcs_mes_notice m where m.status in ('0','1','2','99')
+            order by m.create_time desc
+
         ) s ${ew.customSqlSegment}
     </select>
 

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

@@ -141,14 +141,9 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
         log.info("==============接受质检任务下发通知接口开始=================");
         ThreeCoordinateDto threeCoordinateDto = JSONObject.parseObject(data, ThreeCoordinateDto.class);
 
-        MesNotice mesNotice = MesNotice.builder().build();
-        mesNotice.setOrderNo(threeCoordinateDto.getOrderNumber());
-        mesNotice.setBuType("QUALITYTASK");
-        mesNotice.setLineCode("11111");
-        mesNotice.setStatus("0");
-        mesNotice.setSource("QUALITY");
-        mesNotice.setTargetSource("PRODUCTION_LINE");
-        mesNotice.setAcceptPar(data);
+        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();
+
         try {
             boolean b = baseService.addNotice(mesNotice);
         } catch (Exception e) {
@@ -180,23 +175,14 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
 
     @ApiOperation(value = "刀具需求下发给EOP", notes = "刀具需求下发给EOP")
     @PostMapping("/externalApi/cutter/sendCutterNeedToEop")
-    public  R sendCutterNeedToEop(@RequestBody CutterNeedDto data){
+    public  R sendCutterNeedToEop(@RequestBody String data){
         log.info("定时================发送刀具需求给Eop系统开始================");
-
-        MesNotice mesNotice = MesNotice.builder().build();
-        mesNotice.setOrderNo(data.getAUFNR());
-        mesNotice.setBuType("CUTTERNEED");
-        mesNotice.setLineCode("11111");
-        mesNotice.setStatus("1");
-        mesNotice.setSource("PRODUCTION_LINE");
-        mesNotice.setTargetSource("EOP");
-        mesNotice.setAcceptPar(JSONObject.toJSONString(data));
+        CutterNeedDto cutterNeedDto = JSONObject.parseObject(data, CutterNeedDto.class);
+        MesNotice mesNotice = MesNotice.builder().orderNo(cutterNeedDto.getAUFNR()).buType("TASKDISTRIBUTE").lineCode("11111")
+                .status("1").apiType("CUTTERNEED").source("PRODUCTION_LINE").targetSource("EOP").acceptPar(JSONObject.toJSONString(data)).build();
         try {
             boolean b = baseService.addNotice(mesNotice);
-
             // todo 发送远程地址,发送数据
-
-
         } catch (Exception e) {
             return R.fail(e.getMessage());
         }
@@ -289,10 +275,12 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
                 .eq(MesNotice::getBuType, mesNotice.getBuType()).ne(MesNotice::getStatus, "2");
         //page.setSize(10000L);
         baseService.pageList(page, wrapper);
+        /*
         page.getRecords().stream().forEach(item -> {
             List<MesNotice> childrens = baseService.list(new LbqWrapper<MesNotice>().eq(MesNotice::getOrderNo, item.getOrderNo()).ne(MesNotice::getId, item.getId()).eq(MesNotice::getStatus, "1").orderByDesc(MesNotice::getApiSort));
             item.setChildren(childrens);
         });
+         */
         //List<MesNotice> result = TreeUtil.buildTree(datas);
         //page.setRecords(result);
     }
@@ -687,6 +675,8 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
         JSONObject queryWorkProcess = new JSONObject();
         JSONObject queryWorkSources = new JSONObject();
         JSONObject queryConsumMaterial = new JSONObject();
+        JSONObject queryQualityTask = new JSONObject();
+        JSONObject queryCutterTask = new JSONObject();
 
         for (MesNotice item : mesNoticeList) {
             String returnData = msgUtil.httpForPost(item.getApiAddress(), jsonParam.toJSONString());
@@ -706,6 +696,12 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
                 case "ORDERGROUPCONSUMMATERIAL":
                     queryConsumMaterial = (JSONObject) JSONObject.parseObject(returnData);
                     break;
+                case "QUALITYTASK":
+                    queryQualityTask = (JSONObject) JSONObject.parseObject(returnData);
+                    break;
+                case "CUTTERNEED":
+                    queryCutterTask = (JSONObject) JSONObject.parseObject(returnData);
+                    break;
             }
         }
 

+ 1 - 0
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/operationManagementCenter/ToolbarController.java

@@ -805,5 +805,6 @@ public class ToolbarController {
     public R addOrderTask(@RequestBody Map data) {
         return stationUserController.addOrderTask(data);
     }
+
 }
 

+ 1 - 0
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/productionResourceCenter/StationUserController.java

@@ -471,4 +471,5 @@ public class StationUserController extends SuperController<StationUserService, L
         }
 
     }
+
 }

+ 4 - 1
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/externalApi/entity/MesNotice.java

@@ -126,7 +126,7 @@ public class MesNotice extends Entity<Long> {
 
 
     @Builder
-    public MesNotice(Long id, LocalDateTime createTime, Long createUser, LocalDateTime updateTime, Long updateUser, String buType, String lineCode, String apiAddress, String apiType, int apiSort, String orderNo, String status, String orderInfo) {
+    public MesNotice(Long id, LocalDateTime createTime, Long createUser, LocalDateTime updateTime, Long updateUser, String buType, String lineCode, String apiAddress, String apiType, int apiSort, String orderNo, String status, String orderInfo,String source, String targetSource, String acceptPar) {
         super(id, createTime, createUser, updateTime, updateUser);
         this.id = id;
         this.buType = buType;
@@ -137,5 +137,8 @@ public class MesNotice extends Entity<Long> {
         this.orderNo = orderNo;
         this.status = status;
         this.orderInfo = orderInfo;
+        this.source = source;
+        this.targetSource = targetSource;
+        this.acceptPar = acceptPar;
     }
 }