ソースを参照

fix:增加userdcode字段

wang.sq@aliyun.com 2 週間 前
コミット
90faed170c

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

@@ -18,11 +18,12 @@
         <result column="order_info" jdbcType="VARCHAR" property="orderInfo"/>
         <result column="source" jdbcType="VARCHAR" property="source"/>
         <result column="target_source" jdbcType="VARCHAR" property="targetSource"/>
+        <result column="user_code" jdbcType="VARCHAR" property="userCode"/>
     </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,source,target_source
+        id,business,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">

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

@@ -143,11 +143,12 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
         log.info("==============接受质检任务下发通知接口开始================={}", data);
         ThreeCoordinateDto threeCoordinateDto = JSONObject.parseObject(data, ThreeCoordinateDto.class);
 
-        MesNotice mesNotice = MesNotice.builder().orderNo(threeCoordinateDto.getAuidnr()).
+        MesNotice mesNotice = MesNotice.builder().orderNo(threeCoordinateDto.getOrderNumber()).
                 buType("TASKDISTRIBUTE").
                 apiType("QUALITYTASK").
                 lineCode("407109").
                 status("1").
+                userCode(threeCoordinateDto.getUserCode()).
                 source("数字化检测系统").
                 targetSource("产线管控单元").
                 acceptPar(data).build();
@@ -299,7 +300,8 @@ 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, "2");
+                .eq(MesNotice::getBuType, mesNotice.getBuType())
+                .ne(MesNotice::getStatus, "2");
         //page.setSize(10000L);
         baseService.pageList(page, wrapper);
         /*
@@ -741,7 +743,7 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
         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 qualityInfo = queryQualityTask.getObject("respBody", String.class)!=null ? queryQualityTask : null;
+        JSONObject qualityInfo = queryQualityTask.getObject("TaskCode", String.class)!=null ? queryQualityTask : null;
         JSONObject mesInfo = queryMesTask.getObject("auidnr", String.class)!=null ? queryMesTask : null;
 
         MMeterial mMeterial = null;
@@ -794,6 +796,7 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
                 String plmenge = dataInfo.getString("plmenge");
                 if(StringUtil.isEmpty(plmenge)) {
                     msgUtil.createWarnLog("Mes订单加工零件个数不允许为空","MESException");
+
                     return;
                 }
                 List<JSONObject> dataList = IntStream.range(0, (int)Float.parseFloat(plmenge)).mapToObj(i-> {

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

@@ -34,4 +34,6 @@ public class MesNoticePageDTO implements Serializable {
 
     private int apiSort;
 
+    private int userCode;
+
 }

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

@@ -3,6 +3,7 @@ package com.github.zuihou.business.externalApi.entity;
 import cn.afterturn.easypoi.excel.annotation.Excel;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.github.zuihou.authority.entity.auth.User;
 import com.github.zuihou.base.entity.Entity;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -33,6 +34,12 @@ public class MesNotice extends Entity<Long> {
     @TableField(exist = false)
     private List<MesNotice> children;
 
+    @ApiModelProperty(value = "用户编码")
+    @Length(max = 128, message = "业务类型长度不能超过128")
+    @TableField(value = "user_code", condition = LIKE)
+    @Excel(name = "用户编码")
+    private String userCode;
+
     /**
      * 订单编号
      */
@@ -126,7 +133,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,String source, String targetSource, String acceptPar) {
+    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, String  userCode) {
         super(id, createTime, createUser, updateTime, updateUser);
         this.id = id;
         this.buType = buType;
@@ -140,5 +147,6 @@ public class MesNotice extends Entity<Long> {
         this.source = source;
         this.targetSource = targetSource;
         this.acceptPar = acceptPar;
+        this.userCode = userCode;
     }
 }