wang.sq@aliyun.com 2 nedēļas atpakaļ
vecāks
revīzija
bc1474dbc0

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

@@ -4,12 +4,16 @@ package com.github.zuihou.business.externalApi.service.impl;
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.zuihou.base.R;
 import com.github.zuihou.base.service.SuperServiceImpl;
 import com.github.zuihou.business.externalApi.dao.MesNoticeMapper;
 import com.github.zuihou.business.externalApi.dto.MesNoticeUpdateDTO;
 import com.github.zuihou.business.externalApi.entity.MesNotice;
 import com.github.zuihou.business.productionReadyCenter.service.MesNoticeService;
+import com.github.zuihou.context.BaseContextHandler;
+import com.github.zuihou.database.mybatis.conditions.Wraps;
 import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
+import com.github.zuihou.exception.BizException;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
@@ -22,20 +26,20 @@ public class MesNoticeServiceImpl extends SuperServiceImpl<MesNoticeMapper, MesN
 
     @Override
     public MesNotice updateStatus(MesNoticeUpdateDTO model) {
-        if(model.getId()==null || model.getOrderNo()==null) return null;
+        if (model.getId() == null || model.getOrderNo() == null) return null;
         Long id = model.getId();
         MesNotice mesNotice = baseMapper.selectById(id);
-        if(mesNotice.getBuType().equals("TASKDISTRIBUTE") && !mesNotice.getApiType().equals("QUERYWORKORDERRESOURCES")){
+        if (mesNotice.getBuType().equals("TASKDISTRIBUTE") && !mesNotice.getApiType().equals("QUERYWORKORDERRESOURCES")) {
             UpdateWrapper<MesNotice> updateWrapper = new UpdateWrapper<MesNotice>();
             List<Long> ids = baseMapper.selectList(new LbqWrapper<MesNotice>().eq(MesNotice::getOrderNo, model.getOrderNo()).ne(MesNotice::getApiType, "QUERYWORKORDERRESOURCES")).stream().map(MesNotice::getId).collect(Collectors.toList());
             updateWrapper.lambda().set(MesNotice::getStatus, "0").in(MesNotice::getId, ids);
             baseMapper.update(null, updateWrapper);
             MesNotice workFileNotice = baseMapper.selectOne(new LbqWrapper<MesNotice>().eq(MesNotice::getOrderNo, model.getOrderNo()).eq(MesNotice::getApiType, "QUERYWORKORDERRESOURCES"));
-            if(workFileNotice!=null) {
+            if (workFileNotice != null) {
                 workFileNotice.setStatus("2");
                 baseMapper.updateAllById(workFileNotice);
             }
-        }else{
+        } else {
             mesNotice.setStatus("0");
             baseMapper.updateAllById(mesNotice);
         }
@@ -44,6 +48,35 @@ public class MesNoticeServiceImpl extends SuperServiceImpl<MesNoticeMapper, MesN
 
     @Override
     public IPage<MesNotice> pageList(IPage page, Wrapper<MesNotice> queryWrapper) {
+        BaseContextHandler.setTenant("0000");
         return baseMapper.pageList(page, queryWrapper);
     }
+
+    @Override
+    public boolean addNotice(MesNotice model) {
+        BaseContextHandler.setTenant("0000");
+        Integer integer = baseMapper.selectCount(Wraps.<MesNotice>lbQ().eq(MesNotice::getOrderNo, model.getOrderNo()));
+        if (integer > 0) {
+            throw new BizException("此订单已存在");
+        }
+
+        baseMapper.insert(model);
+
+        return true;
+    }
+
+    @Override
+    public R QualityResultReport(MesNotice mesNotice) {
+        BaseContextHandler.setTenant("0000");
+
+        List<MesNotice> mesNotices = baseMapper.selectList(Wraps.<MesNotice>lbQ().eq(MesNotice::getSource, mesNotice.getSource()));
+        if (mesNotices.isEmpty() || mesNotices.size() == 0) {
+            return R.success("没有需要上报的数据");
+        }
+
+        // todo 查询反馈给质量的进行上报
+
+
+        return R.success();
+    }
 }

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

@@ -3,6 +3,7 @@ package com.github.zuihou.business.productionReadyCenter.service;
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Constants;
+import com.github.zuihou.base.R;
 import com.github.zuihou.base.service.SuperService;
 import com.github.zuihou.business.externalApi.dto.MesNoticeUpdateDTO;
 import com.github.zuihou.business.externalApi.entity.MesNotice;
@@ -10,10 +11,18 @@ import com.github.zuihou.business.operationManagementCenter.entity.Inspection;
 import com.github.zuihou.database.mybatis.auth.DataScope;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 
 public interface MesNoticeService extends SuperService<MesNotice> {
 
     MesNotice updateStatus(MesNoticeUpdateDTO model);
 
     IPage<MesNotice> pageList(IPage page, @Param(Constants.WRAPPER) Wrapper<MesNotice> queryWrapper);
+
+    //批量新增
+   boolean addNotice(MesNotice model);
+
+
+   R QualityResultReport(MesNotice mesNotice);
 }

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

@@ -16,35 +16,43 @@
         <result column="order_no" jdbcType="VARCHAR" property="orderNo"/>
         <result column="status" jdbcType="VARCHAR" property="status"/>
         <result column="order_info" jdbcType="VARCHAR" property="orderInfo"/>
+        <result column="source" jdbcType="VARCHAR" property="source"/>
+        <result column="target_source" jdbcType="VARCHAR" property="targetSource"/>
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id,bu_type,line_code,api_address,api_type,order_no,status,order_info,api_sort,create_time,create_user,update_time,update_user
+        id,bu_type,line_code,api_address,api_type,order_no,status,order_info,api_sort,create_time,create_user,update_time,update_user,source,target_source
     </sql>
 
     <select id="pageList" resultMap="BaseResultMap">
         select
         <include refid="Base_Column_List"/>
         from (
-        SELECT
-        m.*
-        FROM
-        zuihou_base_yj_0000.imcs_mes_notice m,
-        (
-        SELECT
-        MAX(m2.api_sort) AS msort,
-        m2.order_no
-        FROM
-        zuihou_base_yj_0000.imcs_mes_notice m2
-        WHERE m2.`status` in ('1','2')
-        GROUP BY
-        m2.order_no
-        ) n
-        WHERE
-        m.`status` in ('1','2')
-        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
+            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
         ) s ${ew.customSqlSegment}
     </select>
 

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

@@ -15,32 +15,29 @@ import com.github.zuihou.business.controller.operationManagementCenter.OrderCont
 import com.github.zuihou.business.controller.operationManagementCenter.PlanController;
 import com.github.zuihou.business.controller.operationManagementCenter.WorkpieceController;
 import com.github.zuihou.business.controller.productionReadyCenter.MMeterialController;
-import com.github.zuihou.business.externalApi.dto.MesNoticePageDTO;
-import com.github.zuihou.business.externalApi.dto.MesNoticeSaveDTO;
-import com.github.zuihou.business.externalApi.dto.MesNoticeUpdateDTO;
+import com.github.zuihou.business.externalApi.dto.*;
 import com.github.zuihou.business.externalApi.entity.MesAttachment;
 import com.github.zuihou.business.externalApi.entity.MesNotice;
 import com.github.zuihou.business.externalApi.service.MesAttachmentService;
-
 import com.github.zuihou.business.operationManagementCenter.entity.Order;
 import com.github.zuihou.business.operationManagementCenter.entity.OrderProduct;
 import com.github.zuihou.business.operationManagementCenter.service.OrderProductService;
 import com.github.zuihou.business.operationManagementCenter.service.OrderService;
 import com.github.zuihou.business.operationManagementCenter.service.PlanService;
-import com.github.zuihou.business.productionReadyCenter.entity.*;
+import com.github.zuihou.business.productionReadyCenter.entity.BBom;
+import com.github.zuihou.business.productionReadyCenter.entity.BomVersionInfo;
+import com.github.zuihou.business.productionReadyCenter.entity.MMeterial;
+import com.github.zuihou.business.productionReadyCenter.entity.MMeterialReceiveLog;
 import com.github.zuihou.business.productionReadyCenter.service.*;
 import com.github.zuihou.business.productionResourceCenter.entity.ZZone;
 import com.github.zuihou.business.productionResourceCenter.service.ZZoneService;
 import com.github.zuihou.business.util.MsgUtil;
-import com.github.zuihou.business.util.ZipFileUtils;
-import com.github.zuihou.common.constant.CodeRuleModule;
 import com.github.zuihou.common.util.DateUtil;
 import com.github.zuihou.common.util.StringUtil;
+import com.github.zuihou.database.mybatis.conditions.Wraps;
 import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
 import com.github.zuihou.database.mybatis.conditions.query.QueryWrap;
 import com.github.zuihou.file.biz.FileBiz;
-import com.github.zuihou.file.domain.FileDO;
-import com.github.zuihou.file.enumeration.DataType;
 import com.github.zuihou.file.service.AttachmentService;
 import com.github.zuihou.log.annotation.SysLog;
 import com.github.zuihou.tenant.service.CodeRuleService;
@@ -48,7 +45,6 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.compress.utils.IOUtils;
 import org.apache.commons.compress.utils.Lists;
 import org.apache.commons.io.FileUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -56,14 +52,10 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
 import java.io.File;
 import java.io.IOException;
-import java.io.InputStream;
 import java.net.URL;
 import java.util.*;
-import java.util.stream.Collectors;
 
 @Slf4j
 @Validated
@@ -142,6 +134,100 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
     @Value("${zuihou.file.storage-path}")
     private String storagePath;
 
+
+    @ApiOperation(value = "接受质检任务下发通知接口", notes = "接受质检任务下发通知接口")
+    @PostMapping("/externalApi/quality/measuringTaskReceive")
+    public R addQualityToNotice(@RequestBody String data) {
+        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);
+        try {
+            boolean b = baseService.addNotice(mesNotice);
+        } catch (Exception e) {
+            return R.fail(e.getMessage());
+        }
+
+        log.info("==============接受质检任务下发通知接口结束=================");
+        return R.success();
+    }
+
+    @ApiOperation(value = "质检结果上报", notes = "质检结果上报")
+    @PostMapping("/externalApi/quality/qualityResultReport")
+    public  R QualityResultReport(@RequestBody String data){
+        log.info("定时================质检结果上报开始================");
+        // 根据代办的质量任务,查询是否已经检测完成,是,进行上报
+        try {
+            MesNotice mesNotice = MesNotice.builder().build();
+            mesNotice.setSource("QUALITY");
+            baseService.QualityResultReport(mesNotice);
+        }catch ( Exception e) {
+            log.error("质检结果上报失败:" + e);
+
+            return R.fail(e.getMessage());
+        }
+        log.info("定时================质检结果上报结束================");
+        return R.success();
+
+    }
+
+    @ApiOperation(value = "刀具需求下发给EOP", notes = "刀具需求下发给EOP")
+    @PostMapping("/externalApi/cutter/sendCutterNeedToEop")
+    public  R sendCutterNeedToEop(@RequestBody CutterNeedDto 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));
+        try {
+            boolean b = baseService.addNotice(mesNotice);
+
+            // todo 发送远程地址,发送数据
+
+
+        } catch (Exception e) {
+            return R.fail(e.getMessage());
+        }
+        log.info("定时================发送刀具需求给Eop系统结束================");
+        return R.success();
+    }
+
+    @ApiOperation(value = "接受刀具分拣结果", notes = "接受刀具分拣结果")
+    @PostMapping("/externalApi/cutter/acceptSortingResult")
+    public  R acceptSortingResult(@RequestBody CutterNeedDto data){
+        log.info("定时================质检结果上报开始================");
+        // 根据代办的质量任务,查询是否已经检测完成,是,进行上报
+        try {
+            MesNotice mesNotice = MesNotice.builder().build();
+            mesNotice.setSource("QUALITY");
+            baseService.QualityResultReport(mesNotice);
+        }catch ( Exception e) {
+            log.error("质检结果上报失败:" + e);
+
+            return R.fail(e.getMessage());
+        }
+        log.info("定时================质检结果上报结束================");
+        return R.success();
+
+    }
+
+
+
+
+
+
     /*
     @ApiOperation(value = "任务下发通知接口", notes = "任务下发通知接口")
     @PostMapping("/order/addNotice")
@@ -200,10 +286,10 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
         LbqWrapper<MesNotice> wrapper = wrap.lambda();
         MesNotice mesNotice = BeanUtil.toBean(data, MesNotice.class);
         wrapper.eq(MesNotice::getOrderNo, mesNotice.getOrderNo())
-                .eq(MesNotice::getBuType, mesNotice.getBuType()).ne(MesNotice::getStatus,"0");
+                .eq(MesNotice::getBuType, mesNotice.getBuType()).ne(MesNotice::getStatus, "2");
         //page.setSize(10000L);
         baseService.pageList(page, wrapper);
-        page.getRecords().stream().forEach(item->{
+        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);
         });
@@ -216,19 +302,19 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
     public R<MesNotice> updateStatus(@RequestBody MesNoticeUpdateDTO model) {
         MesNotice mesNotice = baseService.updateStatus(model);
         JSONObject ret = null;
-        if(StringUtil.isNotEmpty(mesNotice.getApiAddress())) {
+        if (StringUtil.isNotEmpty(mesNotice.getApiAddress())) {
             JSONArray jsonParam = new JSONArray();
             jsonParam.add(mesNotice.getOrderNo());
-            if(mesNotice.getBuType().equals("TASKDISTRIBUTE")){
+            if (mesNotice.getBuType().equals("TASKDISTRIBUTE")) {
                 //处理推送订单
                 this.distributeHandle(mesNotice.getOrderNo(), mesNotice.getLineCode());
-            }else {
+            } else {
                 String returnData = msgUtil.httpForPost(mesNotice.getApiAddress(), jsonParam.toJSONString());
                 ret = JSONObject.parseObject(returnData);
                 //本地代码处理
                 this.handle(ret, mesNotice.getApiType(), mesNotice.getLineCode());
             }
-        }else{
+        } else {
             ret = new JSONObject();
             ret.put("orderNo", mesNotice.getOrderNo());
             ret.put("orderInfo", mesNotice.getOrderInfo());
@@ -238,8 +324,6 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
 
     /**
      * Mes附件下载
-     *
-     *
      */
     @ApiOperation(value = "下载附件", notes = "下载附件")
     @GetMapping(value = "/download")
@@ -247,7 +331,7 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
                       @RequestParam(value = "id") String id) {
         MesNotice mesNotice = mesNoticeService.getById(id);
         List<MesAttachment> mesAttachments = mesAttachmentService.list(new LbqWrapper<MesAttachment>().isNotNull(MesAttachment::getName).isNotNull(MesAttachment::getUrl).eq(MesAttachment::getProcedureNo, mesNotice.getOrderNo()).eq(MesAttachment::getStatus, "1"));
-        if (null==mesAttachments || mesAttachments.size() == 0) return R.fail("参数为空");
+        if (null == mesAttachments || mesAttachments.size() == 0) return R.fail("参数为空");
 
         //附件保存本地目录
         String targetPath = this.storagePath + "mes";
@@ -300,13 +384,13 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
      * @param apiType
      * @param lineCode
      */
-    public void handle(JSONObject returnData, String apiType, String lineCode){
+    public void handle(JSONObject returnData, String apiType, String lineCode) {
         JSONObject workOrder = null;
         ZZone zone = zoneService.getOne(new LambdaQueryWrapper<ZZone>().eq(ZZone::getRemark, lineCode));
         BBom bom = null;
         String orderNo = null;
         MMeterialReceiveLog mMeterialReceiveLog = null;
-        switch(apiType) {
+        switch (apiType) {
             case "QUERYWORKORDER":
                 workOrder = (JSONObject) returnData.getJSONArray("respBody").get(0);
                 List<Object> workPieceList = workOrder.getJSONArray("orderProductSeqList");
@@ -319,19 +403,19 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
                 //plan.setBomId(bom.getId());
 
                 Order order = Order.builder().build();
-                order.setOrderNo(workOrder.getString("workOrderNo")).setOrderTime(StringUtil.isNotEmpty(workOrder.getString("plannedStartTime"))?DateUtil.stringToDate3(workOrder.getString("plannedStartTime")):new Date()).setDeliveryTime(StringUtil.isNotEmpty(workOrder.getString("plannedEndTime"))?DateUtil.stringToDate3(workOrder.getString("plannedEndTime")): new Date()).setSource("2").setProductNum(workPieceList.size())
+                order.setOrderNo(workOrder.getString("workOrderNo")).setOrderTime(StringUtil.isNotEmpty(workOrder.getString("plannedStartTime")) ? DateUtil.stringToDate3(workOrder.getString("plannedStartTime")) : new Date()).setDeliveryTime(StringUtil.isNotEmpty(workOrder.getString("plannedEndTime")) ? DateUtil.stringToDate3(workOrder.getString("plannedEndTime")) : new Date()).setSource("2").setProductNum(workPieceList.size())
                         .setStatus("1").setSingleTaskFlag(0).setOrderStatus("1").setBatchNo(workOrder.getString("batchNo"));
                 //产品编码+生产类型编码(P/B P:按序列生产 B:按批次生产)+ 密级编码 + 批次号 + 工艺版本
-                String orderName = "MES_"+workOrder.getString("materialCode")+"_"+workOrder.getString("productPhase").toUpperCase()+"_"+ workOrder.getString("planSecretLevel").toUpperCase() + "_" + workOrder.getString("batchNo") + "_"+workOrder.getString("processRouteVersion");
+                String orderName = "MES_" + workOrder.getString("materialCode") + "_" + workOrder.getString("productPhase").toUpperCase() + "_" + workOrder.getString("planSecretLevel").toUpperCase() + "_" + workOrder.getString("batchNo") + "_" + workOrder.getString("processRouteVersion");
                 order.setCustId(0L).setOrderName(orderName).setZoneId(zone.getId());
                 orderService.save(order);
 
                 OrderProduct orderProduct = OrderProduct.builder().build();
                 orderProduct.setOrderId(order.getId()).setOrderNo(order.getOrderNo()).setBomId(bom.getId()).setBomName(bom.getName()).setBomNum(workPieceList.size()).setBomNo(bom.getNo()).setDeliveryTime(order.getDeliveryTime());
                 mMeterialReceiveLog = meterialReceiveLogService.getOne(new LambdaQueryWrapper<MMeterialReceiveLog>().eq(MMeterialReceiveLog::getMeterialId, bom.getMeterialId()).last("limit 1"));
-                if(null!= mMeterialReceiveLog) {
+                if (null != mMeterialReceiveLog) {
                     orderProduct.setMeterialReceiveId(mMeterialReceiveLog.getId());
-                }else{
+                } else {
                     MMeterialReceiveLog initData = MMeterialReceiveLog.builder().meterialId(bom.getMeterialId()).batchStand(100).bomBatchNo(workOrder.getString("batchNo")).furnaceBatchNo(workOrder.getString("orderNo")).meterialBatchNo(workOrder.getString("batchNo")).usedNum(0).factoryDate(new Date()).build();
                     meterialReceiveLogService.save(initData);
                     orderProduct.setMeterialReceiveId(initData.getId());
@@ -344,38 +428,37 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
                 break;
             case "QUERYWORKORDERMATERIAL":
                 JSONObject material = (JSONObject) returnData.getJSONArray("respBody").get(0);
-                if(material!=null){
+                if (material != null) {
                     //判断原材料是否存在
-                    String materialCode = material.containsKey("materialCode") && material.getString("materialCode")!="null" ? material.getString("materialCode") : material.getString("productCode");
-                    String materialName = material.containsKey("materialName") && material.getString("materialName")!="null" ? material.getString("materialName") : material.getString("productName");
+                    String materialCode = material.containsKey("materialCode") && material.getString("materialCode") != "null" ? material.getString("materialCode") : material.getString("productCode");
+                    String materialName = material.containsKey("materialName") && material.getString("materialName") != "null" ? material.getString("materialName") : material.getString("productName");
                     MMeterial mMeterial = materialService.getOne(new LbqWrapper<MMeterial>().eq(MMeterial::getTradeMark, materialName).eq(MMeterial::getMeterialCode, materialCode).last("limit 1"));
-                    if(null == mMeterial){
+                    if (null == mMeterial) {
                         MMeterial instance = MMeterial.builder().build();
                         instance.setStatus("1").setSpecification(material.getString("materialSpecification")).setMeterialCode(materialCode).setEquipmentName(materialName).setTradeMark(materialName).setHandleStatus(material.getString("materialFigureNo"));
-                        if(zone!=null){
+                        if (zone != null) {
                             instance.setZoneId(zone.getId());
                         }
                         materialService.save(instance);
                         mMeterial = instance;
-                    }
-                    else{
+                    } else {
                         Integer num = material.getInteger("requiredQuantity");
                         mMeterialReceiveLog = meterialReceiveLogService.getOne(new LambdaQueryWrapper<MMeterialReceiveLog>().eq(MMeterialReceiveLog::getMeterialId, mMeterial.getId()).last("limit 1"));
-                        Integer surplus = mMeterialReceiveLog.getUsedNum() ==null ? mMeterialReceiveLog.getBatchStand() : mMeterialReceiveLog.getBatchStand() - mMeterialReceiveLog.getUsedNum();
-                        if(null!=surplus && surplus < num) {
-                            msgUtil.createWarnLog(mMeterial.getTradeMark()+"毛坯不够", "MesSynDataWarn");
+                        Integer surplus = mMeterialReceiveLog.getUsedNum() == null ? mMeterialReceiveLog.getBatchStand() : mMeterialReceiveLog.getBatchStand() - mMeterialReceiveLog.getUsedNum();
+                        if (null != surplus && surplus < num) {
+                            msgUtil.createWarnLog(mMeterial.getTradeMark() + "毛坯不够", "MesSynDataWarn");
                             //return;
                         }
                     }
                     //保存工单零件信息
                     //String bomName = material.containsKey("processNo") ? material.getString("productName")+"V"+material.getString("processNo") : material.getString("productName")+"V"+material.getString("workOrderNo");
-                    String bomName = material.getString("productName")+"V"+material.getString("workOrderNo");
+                    String bomName = material.getString("productName") + "V" + material.getString("workOrderNo");
                     bom = bBomService.getOne(new LambdaQueryWrapper<BBom>().eq(BBom::getMeterialId, mMeterial.getId()).eq(BBom::getPartsNo, material.getString("productCode")).eq(BBom::getName, bomName).eq(BBom::getNo, material.getString("workOrderNo")).eq(BBom::getSynFlag, "1"));
-                    if(bom == null){
+                    if (bom == null) {
                         bom = BBom.builder().build();
                         bom.setPartsNo(material.getString("productCode")).setBomAlias(material.getString("productCode")).setPartsAlias(material.getString("productCode")).setBatchNo(material.getString("productCode")).setName(bomName).setStatus("1").setSynFlag("1").setImportantFlag("1").setKeyFlag("1").setNo(material.getString("workOrderNo"));
                         bom.setMeterialId(mMeterial.getId());
-                        if(zone!=null){
+                        if (zone != null) {
                             bom.setZoneId(zone.getId());
                         }
                         bBomService.save(bom);
@@ -385,24 +468,24 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
             case "QUERYWORKORDERPROESS":
                 workOrder = (JSONObject) returnData.getJSONArray("respBody").get(0);
                 List<Object> taskList = workOrder.getJSONArray("workOrderProcessStepList");
-                if(workOrder!=null){
+                if (workOrder != null) {
                     String version = workOrder.getString("version");
                     String productCode = workOrder.getString("productCode");
                     String workOrderNo = workOrder.getString("workOrderNo");
-                    String processNo= workOrder.getString("processNo");
+                    String processNo = workOrder.getString("processNo");
                     //String productName = workOrder.getString("productName");
                     //String bomName = productName + "V" + processNo;
                     bom = bBomService.getOne(new LambdaQueryWrapper<BBom>().eq(BBom::getPartsNo, productCode).eq(BBom::getNo, workOrderNo).eq(BBom::getSynFlag, "1").last("limit 1"));
-                    if(bom!=null && bom.getName().contains(workOrderNo)){
+                    if (bom != null && bom.getName().contains(workOrderNo)) {
                         //替换工艺工序名称
                         String processName = bom.getName().replace(workOrderNo, processNo);
                         BBom processBom = bBomService.getOne(new LbqWrapper<BBom>().eq(BBom::getName, processName).eq(BBom::getPartsNo, productCode).eq(BBom::getSynFlag, "1").last("limit 1"));
-                        if(null == processBom) {
+                        if (null == processBom) {
                             //更新本地标准零件名称数据
                             bom.setName(processName).setBrand(processNo);
                             bBomService.updateAllById(bom);
                             bom = bBomService.getById(bom.getId());
-                        }else{
+                        } else {
                             //为后续接口替换工单编号
                             processBom.setNo(workOrderNo).setBrand(processNo);
                             bBomService.updateAllById(processBom);
@@ -412,7 +495,7 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
                         }
                     }
 
-                    if(StringUtil.isNotEmpty(version)) {
+                    if (StringUtil.isNotEmpty(version)) {
                         Long versionId = null;
                         BomVersionInfo mesVersionInfo = bomVersionInfoService.getOne(new LambdaQueryWrapper<BomVersionInfo>().eq(BomVersionInfo::getBomId, bom.getId()).eq(BomVersionInfo::getVersion, version).eq(BomVersionInfo::getSource, "2").last("limit 1"));
                         if (null == mesVersionInfo) {
@@ -420,7 +503,7 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
                             bomVersionInfo.setVersion(version).setUseStatus("0").setAuditStatus("2");
                             //String no = codeRuleService.getBillCode(CodeRuleModule.CODE_RULE_VERSION);
                             bomVersionInfo.setNo(workOrderNo).setSource("2");
-                            if(zone!=null){
+                            if (zone != null) {
                                 bomVersionInfo.setZoneId(zone.getId());
                             }
                             bomVersionInfo.setBomId(bom.getId());
@@ -474,10 +557,10 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
 
                 List<MesAttachment> dataList = Lists.newArrayList();
                 //本地保存附件
-                if(workOrderFileList.size()>0){
-                    workOrderFileList.stream().forEach(item->{
+                if (workOrderFileList.size() > 0) {
+                    workOrderFileList.stream().forEach(item -> {
                         JSONObject jsonObject = (JSONObject) item;
-                        if(null!=jsonObject.getString("attachmentAddress") && jsonObject.getString("attachmentAddress")!="null") {
+                        if (null != jsonObject.getString("attachmentAddress") && jsonObject.getString("attachmentAddress") != "null") {
                             MesAttachment mesAttachment = MesAttachment.builder().build();
                             mesAttachment.setOrderNo(jsonObject.getString("orderNo")).setProcedureNo(jsonObject.getString("workOrderNo")).setVersion(jsonObject.getString("version")).setType(jsonObject.getString("refType"))
                                     .setUrl(jsonObject.getString("attachmentAddress")).setName(jsonObject.getString("attachmentName")).setStatus(1);
@@ -485,10 +568,10 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
                         }
                     });
                 }
-                if(workOrderDNCList.size()>0){
-                    workOrderDNCList.stream().forEach(item->{
+                if (workOrderDNCList.size() > 0) {
+                    workOrderDNCList.stream().forEach(item -> {
                         JSONObject jsonObject = (JSONObject) item;
-                        if(null!=jsonObject.getString("programAddress") && jsonObject.getString("programAddress")!="null") {
+                        if (null != jsonObject.getString("programAddress") && jsonObject.getString("programAddress") != "null") {
                             MesAttachment mesAttachment = MesAttachment.builder().build();
                             mesAttachment.setOrderNo(jsonObject.getString("orderNo")).setProcedureNo(jsonObject.getString("workOrderNo")).setVersion(jsonObject.getString("version")).setType(jsonObject.getString("refType"))
                                     .setUrl(jsonObject.getString("programAddress")).setName(jsonObject.getString("attachmentName")).setStatus(1);
@@ -497,61 +580,61 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
                     });
                 }
                 //工装托盘资源处理
-                if(workOrderToolingDtoList.size()>0){
+                if (workOrderToolingDtoList.size() > 0) {
 
                 }
                 //刀具和设备资源处理
-                if(workOrderToolList.size()>0 && workOrderDeviceList.size()>0){
+                if (workOrderToolList.size() > 0 && workOrderDeviceList.size() > 0) {
 
                 }
-                if(dataList.size()>0) {
+                if (dataList.size() > 0) {
                     mesAttachmentService.saveBatch(dataList);
                 }
                 break;
 
             case "ORDERGROUPCONSUMMATERIAL":
                 workOrder = (JSONObject) returnData.getJSONArray("respBody").get(0);
-                if(workOrder!=null){
+                if (workOrder != null) {
 
                 }
 
             case "TASKFREEZE":
-                orderNo  = returnData.getString("orderNo");
+                orderNo = returnData.getString("orderNo");
                 Order freezeOrder = orderService.getOne(new LambdaQueryWrapper<Order>().eq(Order::getOrderNo, orderNo).eq(Order::getSource, "2").last("limit 1"));
-                if(freezeOrder!=null){
+                if (freezeOrder != null) {
                     orderService.orderSuspend(freezeOrder);
                 }
                 break;
             case "TASKTHAW":
-                orderNo  = returnData.getString("orderNo");
+                orderNo = returnData.getString("orderNo");
                 Order enableOrder = orderService.getOne(new LambdaQueryWrapper<Order>().eq(Order::getOrderNo, orderNo).eq(Order::getSource, "2").last("limit 1"));
-                if(enableOrder!=null){
+                if (enableOrder != null) {
                     orderService.orderEnable(enableOrder);
                 }
                 break;
             case "TASKCANCELORDER":
-                orderNo  = returnData.getString("orderNo");
+                orderNo = returnData.getString("orderNo");
                 Order cancelOrder = orderService.getOne(new LambdaQueryWrapper<Order>().eq(Order::getOrderNo, orderNo).eq(Order::getSource, "2").last("limit 1"));
-                if(cancelOrder!=null){
+                if (cancelOrder != null) {
                     orderService.deleteOrder(cancelOrder);
                 }
                 break;
             case "TASKRECALLORDER":
-                orderNo  = returnData.getString("orderNo");
+                orderNo = returnData.getString("orderNo");
                 Order recallOrder = orderService.getOne(new LambdaQueryWrapper<Order>().eq(Order::getOrderNo, orderNo).eq(Order::getSource, "2").last("limit 1"));
-                if(recallOrder!=null){
+                if (recallOrder != null) {
                     orderService.deleteOrder(recallOrder);
                 }
                 break;
 
             case "TASKISSUEMATERIAL":
                 //orderNo  = returnData.getString("orderNo");
-                String orderInfo  = returnData.getString("orderInfo");
+                String orderInfo = returnData.getString("orderInfo");
                 JSONObject jsonObject = JSONObject.parseObject(orderInfo);
                 List<Object> items = jsonObject.getJSONArray("items");
                 JSONObject item = (JSONObject) items.get(0);
-                if(items!=null && item!=null) {
-                    String materialCode =  item.getString("materialCode");
+                if (items != null && item != null) {
+                    String materialCode = item.getString("materialCode");
                     if (jsonObject != null && StringUtil.isNotEmpty(materialCode)) {
                         //物料处理
                         MMeterial mMeterial = materialService.getOne(new LambdaQueryWrapper<MMeterial>().eq(MMeterial::getMeterialCode, materialCode));
@@ -575,7 +658,7 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
 
             case "EXCEPTIONHANDLINGPROGRESS":
                 //确认消息 无操作
-                String exceptInfo  = returnData.getString("orderInfo");
+                String exceptInfo = returnData.getString("orderInfo");
                 JSONObject jsonObject2 = JSONObject.parseObject(exceptInfo);
                 String anomalyNo = jsonObject2.getString("anomalyNo");
                 Map map = new HashMap();
@@ -592,7 +675,7 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
      * @param orderNo
      * @param lineCode
      */
-    public void distributeHandle(String orderNo, String lineCode){
+    public void distributeHandle(String orderNo, String lineCode) {
         // 步骤处理
         ZZone zone = zoneService.getOne(new LambdaQueryWrapper<ZZone>().eq(ZZone::getRemark, lineCode));
         List<MesNotice> mesNoticeList = mesNoticeService.list(new LbqWrapper<MesNotice>().eq(MesNotice::getOrderNo, orderNo).orderByAsc(MesNotice::getApiSort));
@@ -605,59 +688,68 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
         JSONObject queryWorkSources = new JSONObject();
         JSONObject queryConsumMaterial = new JSONObject();
 
-        for(MesNotice item : mesNoticeList){
+        for (MesNotice item : mesNoticeList) {
             String returnData = msgUtil.httpForPost(item.getApiAddress(), jsonParam.toJSONString());
-            switch(item.getApiType()){
-                case "QUERYWORKORDER": queryWorkOrder=(JSONObject)JSONObject.parseObject(returnData);  break;
-                case "QUERYWORKORDERMATERIAL":  queryWorkMaterial=(JSONObject)JSONObject.parseObject(returnData); break;
-                case "QUERYWORKORDERPROESS":   queryWorkProcess=(JSONObject)JSONObject.parseObject(returnData);break;
-                case "QUERYWORKORDERRESOURCES":  queryWorkSources=(JSONObject)JSONObject.parseObject(returnData); break;
-                case "ORDERGROUPCONSUMMATERIAL": queryConsumMaterial=(JSONObject)JSONObject.parseObject(returnData);break;
+            switch (item.getApiType()) {
+                case "QUERYWORKORDER":
+                    queryWorkOrder = (JSONObject) JSONObject.parseObject(returnData);
+                    break;
+                case "QUERYWORKORDERMATERIAL":
+                    queryWorkMaterial = (JSONObject) JSONObject.parseObject(returnData);
+                    break;
+                case "QUERYWORKORDERPROESS":
+                    queryWorkProcess = (JSONObject) JSONObject.parseObject(returnData);
+                    break;
+                case "QUERYWORKORDERRESOURCES":
+                    queryWorkSources = (JSONObject) JSONObject.parseObject(returnData);
+                    break;
+                case "ORDERGROUPCONSUMMATERIAL":
+                    queryConsumMaterial = (JSONObject) JSONObject.parseObject(returnData);
+                    break;
             }
         }
 
 
         //JSONObject material = queryWorkMaterial.getJSONArray("respBody")!=null?(JSONObject) queryWorkMaterial.getJSONArray("respBody").get(0): null;
         JSONObject material = null;
-        JSONObject workProcess = queryWorkProcess.getJSONArray("respBody")!=null ? (JSONObject) queryWorkProcess.getJSONArray("respBody").get(0) : null;
-        JSONObject workOrder = queryWorkOrder.getJSONArray("respBody")!=null ? (JSONObject) queryWorkOrder.getJSONArray("respBody").get(0) : null;
-        JSONObject workFiles = queryWorkSources.getJSONArray("respBody")!=null && queryWorkSources.getJSONArray("respBody").size()>0 ? (JSONObject) queryWorkSources.getJSONArray("respBody").get(0): null;
-        JSONObject consumMaterial = queryConsumMaterial.getJSONArray("respBody")!=null ? (JSONObject) queryConsumMaterial.getJSONArray("respBody").get(0) : null;
+        JSONObject workProcess = queryWorkProcess.getJSONArray("respBody") != null ? (JSONObject) queryWorkProcess.getJSONArray("respBody").get(0) : null;
+        JSONObject workOrder = queryWorkOrder.getJSONArray("respBody") != null ? (JSONObject) queryWorkOrder.getJSONArray("respBody").get(0) : null;
+        JSONObject workFiles = queryWorkSources.getJSONArray("respBody") != null && queryWorkSources.getJSONArray("respBody").size() > 0 ? (JSONObject) queryWorkSources.getJSONArray("respBody").get(0) : null;
+        JSONObject consumMaterial = queryConsumMaterial.getJSONArray("respBody") != null ? (JSONObject) queryConsumMaterial.getJSONArray("respBody").get(0) : null;
 
         MMeterial mMeterial = null;
 
-        if(null!=material){
+        if (null != material) {
             //处理物料信息
         }
-        if(null!=consumMaterial){
+        if (null != consumMaterial) {
             //处理原材料信息
             //判断原材料是否存在
-            String materialCode = consumMaterial.containsKey("materialCode") && consumMaterial.getString("materialCode")!="null" ? consumMaterial.getString("materialCode") : consumMaterial.getString("proMaterialCode");
-            String materialName = consumMaterial.containsKey("materialName") && consumMaterial.getString("materialName")!="null" ? consumMaterial.getString("materialName") : consumMaterial.getString("proMaterialName");
+            String materialCode = consumMaterial.containsKey("materialCode") && consumMaterial.getString("materialCode") != "null" ? consumMaterial.getString("materialCode") : consumMaterial.getString("proMaterialCode");
+            String materialName = consumMaterial.containsKey("materialName") && consumMaterial.getString("materialName") != "null" ? consumMaterial.getString("materialName") : consumMaterial.getString("proMaterialName");
             mMeterial = materialService.getOne(new LbqWrapper<MMeterial>().eq(MMeterial::getTradeMark, consumMaterial.getString("materialName")).eq(MMeterial::getMeterialCode, materialCode).last("limit 1"));
-            if(null == mMeterial){
+            if (null == mMeterial) {
                 MMeterial instance = MMeterial.builder().build();
                 instance.setStatus("1").setSpecification(materialCode).setMeterialCode(materialCode).setEquipmentName(materialName).setTradeMark(materialName).setHandleStatus("");
-                if(zone!=null){
+                if (zone != null) {
                     instance.setZoneId(zone.getId());
                 }
                 materialService.save(instance);
                 mMeterial = instance;
                 MMeterialReceiveLog mMeterialReceiveLog = MMeterialReceiveLog.builder().meterialId(mMeterial.getId()).meterialBatchNo(consumMaterial.getString("furnaceBatchNo")).bomBatchNo(consumMaterial.getString("batchNo")).furnaceBatchNo(consumMaterial.getString("furnaceBatchNo")).factoryDate(new Date()).batchStand(100).usedNum(0).build();
                 meterialReceiveLogService.save(mMeterialReceiveLog);
-            }
-            else{
+            } else {
                 Integer num = consumMaterial.getInteger("quantity");
                 MMeterialReceiveLog mMeterialReceiveLog = meterialReceiveLogService.getOne(new LambdaQueryWrapper<MMeterialReceiveLog>().eq(MMeterialReceiveLog::getMeterialId, mMeterial.getId()).last("limit 1"));
-                Integer surplus = mMeterialReceiveLog.getUsedNum() ==null ? mMeterialReceiveLog.getBatchStand() : mMeterialReceiveLog.getBatchStand() - mMeterialReceiveLog.getUsedNum();
-                if(null!=surplus && surplus < num) {
-                    msgUtil.createWarnLog(mMeterial.getTradeMark()+"毛坯不够", "MesNoticeWarn");
+                Integer surplus = mMeterialReceiveLog.getUsedNum() == null ? mMeterialReceiveLog.getBatchStand() : mMeterialReceiveLog.getBatchStand() - mMeterialReceiveLog.getUsedNum();
+                if (null != surplus && surplus < num) {
+                    msgUtil.createWarnLog(mMeterial.getTradeMark() + "毛坯不够", "MesNoticeWarn");
                 }
             }
 
         }
         //处理附件信息
-        if(null!= workFiles){
+        if (null != workFiles) {
             //图片
             List<Object> workOrderFileList = workFiles.getJSONArray("wrkOrderFileList");
             //加工设备
@@ -671,10 +763,10 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
 
             List<MesAttachment> dataList = Lists.newArrayList();
             //本地保存附件
-            if(workOrderFileList.size()>0){
-                workOrderFileList.stream().forEach(item->{
+            if (workOrderFileList.size() > 0) {
+                workOrderFileList.stream().forEach(item -> {
                     JSONObject jsonObject = (JSONObject) item;
-                    if(null!=jsonObject.getString("attachmentAddress") && jsonObject.getString("attachmentAddress")!="null") {
+                    if (null != jsonObject.getString("attachmentAddress") && jsonObject.getString("attachmentAddress") != "null") {
                         MesAttachment mesAttachment = MesAttachment.builder().build();
                         mesAttachment.setOrderNo(jsonObject.getString("orderNo")).setProcedureNo(jsonObject.getString("workOrderNo")).setVersion(jsonObject.getString("version")).setType(jsonObject.getString("refType"))
                                 .setUrl(jsonObject.getString("attachmentAddress")).setName(jsonObject.getString("attachmentName")).setStatus(1);
@@ -682,10 +774,10 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
                     }
                 });
             }
-            if(workOrderDNCList.size()>0){
-                workOrderDNCList.stream().forEach(item->{
+            if (workOrderDNCList.size() > 0) {
+                workOrderDNCList.stream().forEach(item -> {
                     JSONObject jsonObject = (JSONObject) item;
-                    if(null!=jsonObject.getString("programAddress") && jsonObject.getString("programAddress")!="null") {
+                    if (null != jsonObject.getString("programAddress") && jsonObject.getString("programAddress") != "null") {
                         MesAttachment mesAttachment = MesAttachment.builder().build();
                         mesAttachment.setOrderNo(jsonObject.getString("orderNo")).setProcedureNo(jsonObject.getString("workOrderNo")).setVersion(jsonObject.getString("version")).setType(jsonObject.getString("refType"))
                                 .setUrl(jsonObject.getString("programAddress")).setName(jsonObject.getString("attachmentName")).setStatus(1);
@@ -694,19 +786,19 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
                 });
             }
             //工装托盘资源处理
-            if(workOrderToolingDtoList.size()>0){
+            if (workOrderToolingDtoList.size() > 0) {
 
             }
             //刀具和设备资源处理
-            if(workOrderToolList.size()>0 && workOrderDeviceList.size()>0){
+            if (workOrderToolList.size() > 0 && workOrderDeviceList.size() > 0) {
 
             }
-            if(dataList.size()>0) {
+            if (dataList.size() > 0) {
                 mesAttachmentService.saveBatch(dataList);
             }
         }
-        if(workProcess == null || workOrder == null ) {
-            msgUtil.createWarnLog("产线"+lineCode+"推送工单"+orderNo+"数据推送有误","MesNoticeWarn");
+        if (workProcess == null || workOrder == null) {
+            msgUtil.createWarnLog("产线" + lineCode + "推送工单" + orderNo + "数据推送有误", "MesNoticeWarn");
             return;
         }
 
@@ -717,36 +809,36 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
         String version = workProcess.getString("version");
         String productCode = workProcess.getString("productCode");
         String workOrderNo = workProcess.getString("workOrderNo");
-        String processNo= workProcess.getString("processNo");
+        String processNo = workProcess.getString("processNo");
 
         String materialName = workOrder.getString("materialName");
         String materialCode = workOrder.getString("materialCode");
 
-        if(!materialCode.equals(productCode)){
-            msgUtil.createWarnLog("产线"+lineCode+"推送工单"+orderNo+"零件与工艺数据不匹配","MesNoticeWarn");
+        if (!materialCode.equals(productCode)) {
+            msgUtil.createWarnLog("产线" + lineCode + "推送工单" + orderNo + "零件与工艺数据不匹配", "MesNoticeWarn");
             return;
         }
-        if(mMeterial == null){
-            msgUtil.createWarnLog("产线"+lineCode+"推送工单"+orderNo+"原材料信息数据为空","MesNoticeWarn");
+        if (mMeterial == null) {
+            msgUtil.createWarnLog("产线" + lineCode + "推送工单" + orderNo + "原材料信息数据为空", "MesNoticeWarn");
             return;
         }
 
-        String bomName = materialName+ "V" + processNo;
+        String bomName = materialName + "V" + processNo;
         BBom bom = bBomService.getOne(new LambdaQueryWrapper<BBom>().eq(BBom::getMeterialId, mMeterial.getId()).eq(BBom::getPartsNo, mMeterial.getMeterialCode()).eq(BBom::getName, bomName).eq(BBom::getSynFlag, "1"));
-        if(bom == null){
+        if (bom == null) {
             bom = BBom.builder().build();
             bom.setPartsNo(mMeterial.getMeterialCode()).setBomAlias(mMeterial.getMeterialCode()).setPartsAlias(mMeterial.getMeterialCode()).setBatchNo(mMeterial.getMeterialCode()).setName(bomName).setStatus("1").setSynFlag("1").setImportantFlag("1").setKeyFlag("1").setNo(workOrderNo);
             bom.setMeterialId(mMeterial.getId()).setBrand(processNo);
-            if(zone!=null){
+            if (zone != null) {
                 bom.setZoneId(zone.getId());
             }
             bBomService.save(bom);
-        }else{
+        } else {
             bom.setNo(workOrderNo);
             bBomService.updateById(bom);
         }
-        if(StringUtil.isEmpty(version)){
-            msgUtil.createWarnLog("产线"+lineCode+"推送工单"+orderNo+"工艺版本数据为空","MesNoticeWarn");
+        if (StringUtil.isEmpty(version)) {
+            msgUtil.createWarnLog("产线" + lineCode + "推送工单" + orderNo + "工艺版本数据为空", "MesNoticeWarn");
             return;
         }
         Long versionId = null;
@@ -755,7 +847,7 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
             BomVersionInfo bomVersionInfo = BomVersionInfo.builder().build();
             bomVersionInfo.setVersion(version).setUseStatus("0").setAuditStatus("2");
             bomVersionInfo.setNo(workOrderNo).setSource("2");
-            if(zone!=null){
+            if (zone != null) {
                 bomVersionInfo.setZoneId(zone.getId());
             }
             bomVersionInfo.setBomId(bom.getId());
@@ -794,19 +886,19 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
 
         //处理工单信息
         Order order = Order.builder().build();
-        order.setOrderNo(workOrder.getString("workOrderNo")).setOrderTime(StringUtil.isNotEmpty(workOrder.getString("plannedStartTime"))?DateUtil.stringToDate3(workOrder.getString("plannedStartTime")):new Date()).setDeliveryTime(StringUtil.isNotEmpty(workOrder.getString("plannedEndTime"))?DateUtil.stringToDate3(workOrder.getString("plannedEndTime")): new Date()).setSource("2").setProductNum(workPieceList.size())
+        order.setOrderNo(workOrder.getString("workOrderNo")).setOrderTime(StringUtil.isNotEmpty(workOrder.getString("plannedStartTime")) ? DateUtil.stringToDate3(workOrder.getString("plannedStartTime")) : new Date()).setDeliveryTime(StringUtil.isNotEmpty(workOrder.getString("plannedEndTime")) ? DateUtil.stringToDate3(workOrder.getString("plannedEndTime")) : new Date()).setSource("2").setProductNum(workPieceList.size())
                 .setStatus("1").setSingleTaskFlag(0).setOrderStatus("1").setBatchNo(workOrder.getString("batchNo"));
         //产品编码+生产类型编码(P/B P:按序列生产 B:按批次生产)+ 密级编码 + 批次号 + 工艺版本
-        String orderName = "MES_"+workOrder.getString("materialCode")+"_"+workOrder.getString("productPhase").toUpperCase()+"_"+ workOrder.getString("planSecretLevel").toUpperCase() + "_" + workOrder.getString("batchNo") + "_"+workOrder.getString("processRouteVersion");
+        String orderName = "MES_" + workOrder.getString("materialCode") + "_" + workOrder.getString("productPhase").toUpperCase() + "_" + workOrder.getString("planSecretLevel").toUpperCase() + "_" + workOrder.getString("batchNo") + "_" + workOrder.getString("processRouteVersion");
         order.setCustId(0L).setOrderName(orderName).setZoneId(zone.getId());
         orderService.save(order);
 
         OrderProduct orderProduct = OrderProduct.builder().build();
         orderProduct.setOrderId(order.getId()).setOrderNo(order.getOrderNo()).setBomId(bom.getId()).setBomName(bom.getName()).setBomNum(workPieceList.size()).setBomNo(bom.getNo()).setDeliveryTime(order.getDeliveryTime());
         MMeterialReceiveLog mMeterialReceiveLog = meterialReceiveLogService.getOne(new LambdaQueryWrapper<MMeterialReceiveLog>().eq(MMeterialReceiveLog::getMeterialId, bom.getMeterialId()).last("limit 1"));
-        if(null!= mMeterialReceiveLog) {
+        if (null != mMeterialReceiveLog) {
             orderProduct.setMeterialReceiveId(mMeterialReceiveLog.getId());
-        }else{
+        } else {
             MMeterialReceiveLog initData = MMeterialReceiveLog.builder().meterialId(bom.getMeterialId()).batchStand(100).bomBatchNo(workOrder.getString("batchNo")).furnaceBatchNo(workOrder.getString("orderNo")).meterialBatchNo(workOrder.getString("batchNo")).usedNum(0).factoryDate(new Date()).build();
             meterialReceiveLogService.save(initData);
             orderProduct.setMeterialReceiveId(initData.getId());

+ 0 - 2
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/externalApi/ThreeDimensionalControl.java

@@ -68,8 +68,6 @@ public class ThreeDimensionalControl  extends SuperController<ThreeCoordinateSer
     @PostMapping(value = "/three-coordinate-test-results")
     @SysLog("接受三坐标检测数据")
     public R threeCoordinateTestResults(@RequestBody String json) throws Exception{
-        logger.error("1111111111111111");
-        logger.warn("2222222222222222222");
         log.info("====================接受三坐标数据===================={}",json);
 
         return R.success();

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

@@ -142,7 +142,7 @@ public class ToolController extends SuperController<ToolService, Long, Tool, Too
     private BBomService bBomService;
 
     //刀具定时任务处理
-    @Scheduled(cron = "0 0/2 * * * *")
+//    @Scheduled(cron = "0 0/2 * * * *")
     @ApiOperation(value = "同步刀具", notes = "同步刀具")
     @PostMapping("/synchronousTool")
     public R<Boolean> synchronousTool() throws Exception {

+ 68 - 0
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/externalApi/dto/CutterNeedDto.java

@@ -0,0 +1,68 @@
+package com.github.zuihou.business.externalApi.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.*;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @Project: imcs-admin-boot
+ * @Package: com.github.zuihou.business.externalApi.dto
+ * @Author: Lenovo
+ * @Time: 2025 - 06 - 17 09 : 28
+ * @Description:
+ */
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Accessors(chain = true)
+@ToString(callSuper = true)
+@EqualsAndHashCode(callSuper = false)
+@Builder
+@ApiModel(value = "CutterNeedDto", description = "外部刀具需求任务")
+public class CutterNeedDto implements Serializable {
+
+    private Long id;
+
+    @ApiModelProperty(value = "订单号")
+    private String AUFNR;
+
+    @ApiModelProperty(value = "工序操作码")
+    private String VORNR;
+
+    @ApiModelProperty(value = "工序号")
+    private String ZCODE;
+
+    @ApiModelProperty(value = "工名称")
+    private String LTXA1;
+
+    @ApiModelProperty(value = "零件物料号")
+    private String LMATNR;
+
+    @ApiModelProperty(value = "零件物料描述")
+    private String LJMAKTX;
+
+    @ApiModelProperty(value = "车间单位编码")
+    private String DEPTID;
+
+    @ApiModelProperty(value = "操作人编码")
+    private String USERCZZ;
+
+    @ApiModelProperty(value = "操作人名称")
+    private String C2ZNAME;
+
+    @ApiModelProperty(value = "设备号")
+    private String KAPA2;
+
+    @ApiModelProperty(value = "需求日期(可带时分秒)")
+    private String XQRQ;
+
+    @ApiModelProperty(value = "拣配工装明细(集合)")
+    private List<CutterNeedSubListDto> ItemData;
+
+
+}

+ 39 - 0
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/externalApi/dto/CutterNeedSubListDto.java

@@ -0,0 +1,39 @@
+package com.github.zuihou.business.externalApi.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.*;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * @Project: imcs-admin-boot
+ * @Package: com.github.zuihou.business.externalApi.dto
+ * @Author: Lenovo
+ * @Time: 2025 - 06 - 17 10 : 17
+ * @Description:
+ */
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Accessors(chain = true)
+@ToString(callSuper = true)
+@EqualsAndHashCode(callSuper = false)
+@Builder
+@ApiModel(value = "CutterNeedSubListDto", description = "外部刀具需求任务")
+public class CutterNeedSubListDto implements Serializable {
+
+    @ApiModelProperty(value = "物料号")
+    private String MATN;
+
+    @ApiModelProperty(value = "物料描述")
+    private String MAKI;
+
+    @ApiModelProperty(value = "数量")
+    private String QTY;
+
+    @ApiModelProperty(value = "库存地点")
+    private String LGORT;
+}

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

@@ -6,6 +6,7 @@ import lombok.*;
 import lombok.experimental.Accessors;
 import org.joda.time.DateTime;
 
+import java.io.Serializable;
 import java.util.List;
 
 /**
@@ -25,7 +26,7 @@ import java.util.List;
 @EqualsAndHashCode(callSuper = false)
 @Builder
 @ApiModel(value = "ExternalApiThreeCoordinateDto", description = "外部三坐标检测任务")
-public class ThreeCoordinateDto {
+public class ThreeCoordinateDto implements Serializable {
 
     private Long id;
 
@@ -39,7 +40,7 @@ public class ThreeCoordinateDto {
     private String drawNumber;
 
     @ApiModelProperty(value = "订单号")
-    private String orderCumber;
+    private String orderNumber;
 
     @ApiModelProperty(value = "工序号")
     private String processCode;

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

@@ -106,6 +106,24 @@ public class MesNotice extends Entity<Long> {
     @Excel(name = "订单详情")
     private String orderInfo;
 
+    @ApiModelProperty(value = "数据来源")
+    @Length(max = 512, message = "订单编号长度不能超过512")
+    @TableField(value = "source", condition = LIKE)
+    @Excel(name = "数据来源")
+    private String source;
+
+    @ApiModelProperty(value = "目的源")
+    @Length(max = 512, message = "订单编号长度不能超过512")
+    @TableField(value = "target_source", condition = LIKE)
+    @Excel(name = "目的源")
+    private String targetSource;
+
+    @ApiModelProperty(value = "接受任务数据")
+    @Length(max = 14000, message = "订单编号长度不能超过14000")
+    @TableField(value = "accept_par", condition = LIKE)
+    @Excel(name = "接受任务数据")
+    private String acceptPar;
+
 
     @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) {