oyq28 преди 3 седмици
родител
ревизия
4d6919f721

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

@@ -75,7 +75,7 @@ public class MesNoticeServiceImpl extends SuperServiceImpl<MesNoticeMapper, MesN
     @Override
     public boolean addNotice(MesNotice model) {
         BaseContextHandler.setTenant("0000");
-        Integer integer = baseMapper.selectCount(Wraps.<MesNotice>lbQ().eq(MesNotice::getOrderNo, model.getOrderNo()));
+        Integer integer = baseMapper.selectCount(Wraps.<MesNotice>lbQ().eq(MesNotice::getOrderNo, model.getOrderNo()).eq(MesNotice::getBuType, model.getBuType()));
         if (integer > 0) {
             throw new BizException("此订单已存在");
         }

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

@@ -145,18 +145,35 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
 
     @ApiOperation(value = "质检结果上报", notes = "质检结果上报")
     @PostMapping("/externalApi/qualityResultReport")
-    public R QualityResultReport(@RequestBody String data) {
+    public R QualityResultReport(@RequestBody Map<String, String> params) {
         log.info("定时================质检结果上报开始================");
         // 根据代办的质量任务,查询是否已经检测完成,是,进行上报
+        String instructionUrl="http://192.168.11.37:8080/apis/Schedule/PostBack420TaskCheckData";
+        ThreeCoordinateDto threeCoordinateDto = BeanUtil.mapToBean(params, ThreeCoordinateDto.class, true);
+        String data = JSONObject.toJSONString(threeCoordinateDto);
+        MesNotice mesNotice = MesNotice.builder().orderNo(threeCoordinateDto.getTaskCode()).
+                buType("TASKAPPLY").
+                apiType("QUALITYREPORT").
+                lineCode("407109").
+                status("1").
+                userCode(threeCoordinateDto.getUserCode()).
+                source("产线管控单元").
+                targetSource("数字化检测系统").
+                apiAddress(instructionUrl).
+                acceptPar(data).build();
         try {
-            MesNotice mesNotice = MesNotice.builder().build();
-            mesNotice.setSource("QUALITY");
-            baseService.QualityResultReport(mesNotice);
+            boolean b = baseService.addNotice(mesNotice);
         } catch (Exception e) {
             log.error("质检结果上报失败:" + e);
-
             return R.fail(e.getMessage());
         }
+        if(!autoPostEnable){
+            mesNotice.setStatus("0");
+            baseService.updateById(mesNotice);
+            String returnData = msgUtil.httpForPost(instructionUrl, data);
+            return R.success(returnData);
+        }
+
         log.info("定时================质检结果上报结束================");
         return R.success();
 
@@ -167,7 +184,7 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
     public R sendCutterNeedToEop(@RequestBody String data) {
         log.info("定时================发送刀具需求给Eop系统开始================");
         CutterNeedDto cutterNeedDto = JSONObject.parseObject(data, CutterNeedDto.class);
-        MesNotice mesNotice = MesNotice.builder().orderNo(cutterNeedDto.getAUFNR()).buType("TASKDISTRIBUTE").lineCode("11111")
+        MesNotice mesNotice = MesNotice.builder().orderNo(cutterNeedDto.getAUFNR()).buType("TASKDISTRIBUTE").lineCode("407109")
                 .status("1").apiType("CUTTERNEED").source("PRODUCTION_LINE").targetSource("EOP").acceptPar(JSONObject.toJSONString(data)).build();
         try {
             boolean b = baseService.addNotice(mesNotice);

+ 7 - 10
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/externalApi/dto/ThreeCoordinateDto.java

@@ -31,25 +31,25 @@ public class ThreeCoordinateDto implements Serializable {
     private Long id;
 
     @ApiModelProperty(value = "任务号")
-    private String taskCode;
+    private String TaskCode;
 
     @ApiModelProperty(value = "人员编号/工号")
-    private String userCode;
+    private String UserCode;
 
     @ApiModelProperty(value = "图号")
-    private String drawNumber;
+    private String DrawNumber;
 
     @ApiModelProperty(value = "订单号")
-    private String orderNumber;
+    private String OrderNumber;
 
     @ApiModelProperty(value = "工序号")
-    private String processCode;
+    private String ProcessCode;
 
     @ApiModelProperty(value = "批次号")
-    private String batchNo;
+    private String BatchNo;
 
     @ApiModelProperty(value = "零件编号")
-    private String partOrder;
+    private String PartOrder;
 
     @ApiModelProperty(value = "接受时间")
     private DateTime acceptTime;
@@ -60,7 +60,4 @@ public class ThreeCoordinateDto implements Serializable {
     @ApiModelProperty(value = "检测结果集合")
     private List resultList;
 
-    @ApiModelProperty(value = "订单编号")
-    private String auidnr;
-
 }