Przeglądaj źródła

Merge remote-tracking branch 'origin/master'

wang.sq@aliyun.com 1 miesiąc temu
rodzic
commit
c6a955ba3d

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

@@ -1980,7 +1980,9 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
                         orderMapper.updateAllById(order);
                         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");
+                            MesNoticeLog mesNoticeLog = mesNoticeLogService.getOne(new LbqWrapper<MesNoticeLog>().eq(MesNoticeLog::getStatus,"4").eq(MesNoticeLog::getNoticeId, mesNotice.getId()).orderByDesc(MesNoticeLog::getCreateTime).last("limit 1"));
+                            double plmenge =  Double.parseDouble(order.getProduceNum().toString());
+                            mesNotice.setStatus("3").setWorkReport(mesNoticeLog!=null? String.valueOf(plmenge - Double.parseDouble(mesNoticeLog.getOrderInfo())): String.valueOf(plmenge));
                             mesNoticeService.updateNoticeById(mesNotice);
                             //订单完成报工推送
                         }

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

@@ -17,6 +17,7 @@
         <result column="batch_no" jdbcType="VARCHAR" property="batchNo"/>
         <result column="status" jdbcType="VARCHAR" property="status"/>
         <result column="order_info" jdbcType="VARCHAR" property="orderInfo"/>
+        <result column="work_report" 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"/>
@@ -25,7 +26,7 @@
 
     <!-- 通用查询结果列 -->
     <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,accept_par,user_code,batch_no
+        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,accept_par,user_code,batch_no,work_report
     </sql>
 
     <select id="pageList" resultMap="BaseResultMap">

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

@@ -170,6 +170,8 @@ public class ScheduleUserDateController extends SuperController<ScheduleUserDate
             if(!scheduleUserDateUpdateDTO.isOnWork()){
                 String orderWorkStatistics = mesNoticeService.orderWorkStatistics(mesNotice.getId().toString());
                 mesNotice.setOrderInfo(orderWorkStatistics);
+                MesNoticeLog mesNoticeLog = mesNoticeLogService.getOne(new LbqWrapper<MesNoticeLog>().eq(MesNoticeLog::getStatus,"4").eq(MesNoticeLog::getNoticeId, mesNotice.getId()).orderByDesc(MesNoticeLog::getCreateTime).last("limit 1"));
+                mesNotice.setWorkReport(mesNoticeLog!=null? String.valueOf(Double.parseDouble(orderWorkStatistics)-Double.parseDouble(mesNoticeLog.getOrderInfo())) : orderWorkStatistics);
             }
             mesNoticeService.updateAllById(mesNotice);
             //同步更新日志

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

@@ -391,7 +391,7 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
         MesProcessReportDto mesProcessReportDto = MesProcessReportDto.builder().finr("407").kpf("109").auidnr(params.getString("auidnr")).status(params.getString("status")).afonr(bom.getNo()).pnr(params.getString("pnr")).kapaz(params.getString("kapaz")).plmenge(Double.parseDouble(order.getProduceNum().toString()))
                 .build();
         boolean status = params.getString("status").equals("JS")? true: false;
-        if(status){
+        if(!status){
             //默认处理
             mesProcessReportDto.setGutmenge(0.2).setAusschuss(0).setAussfinish(0);
         }
@@ -408,7 +408,10 @@ public class MesController extends SuperController<MesNoticeService, Long, MesNo
             return R.fail(e.getMessage());
         }
         if(autoPostEnable && bool){
-            String returnData = msgUtil.httpForPost(instructionUrl, data);
+            if(StringUtil.isNotEmpty(mesNotice.getWorkReport())){
+                mesProcessReportDto.setGutmenge(Double.parseDouble(mesNotice.getWorkReport()));
+            }
+            String returnData = msgUtil.httpForPost(instructionUrl, JSONObject.toJSONString(mesProcessReportDto));
             return R.success(returnData);
         }
         return R.success();

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

@@ -38,4 +38,6 @@ public class MesNoticePageDTO implements Serializable {
 
     private String batchNo;
 
+    private String workReport;
+
 }

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

@@ -105,7 +105,7 @@ public class MesNotice extends Entity<Long> {
     private String status;
 
     /**
-     * 订单编号
+     * 订单详情
      */
     @ApiModelProperty(value = "订单详情")
     @Length(max = 512, message = "订单编号长度不能超过512")
@@ -113,6 +113,15 @@ public class MesNotice extends Entity<Long> {
     @Excel(name = "订单详情")
     private String orderInfo;
 
+    /**
+     * 报工数量
+     */
+    @ApiModelProperty(value = "报工数量")
+    @Length(max = 255, message = "报工数量长度不能超过255")
+    @TableField(value = "work_report", condition = LIKE)
+    @Excel(name = "报工数量")
+    private String workReport;
+
     @ApiModelProperty(value = "数据来源")
     @Length(max = 512, message = "订单编号长度不能超过512")
     @TableField(value = "source", condition = LIKE)
@@ -142,7 +151,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, String  userCode, String batchNo) {
+    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, String batchNo, String workReport) {
         super(id, createTime, createUser, updateTime, updateUser);
         this.id = id;
         this.buType = buType;
@@ -158,5 +167,6 @@ public class MesNotice extends Entity<Long> {
         this.acceptPar = acceptPar;
         this.userCode = userCode;
         this.batchNo = batchNo;
+        this.workReport = workReport;
     }
 }

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

@@ -120,6 +120,15 @@ public class MesNoticeLog extends Entity<Long> {
     @Excel(name = "订单详情")
     private String orderInfo;
 
+    /**
+     * 报工数量
+     */
+    @ApiModelProperty(value = "报工数量")
+    @Length(max = 255, message = "报工数量长度不能超过255")
+    @TableField(value = "work_report", condition = LIKE)
+    @Excel(name = "报工数量")
+    private String workReport;
+
     @ApiModelProperty(value = "数据来源")
     @Length(max = 512, message = "订单编号长度不能超过512")
     @TableField(value = "source", condition = LIKE)