Browse Source

Merge remote-tracking branch 'origin/mode-min-unit' into mode-min-unit

fangpy 11 tháng trước cách đây
mục cha
commit
ff279f040a

+ 17 - 0
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsProductionOrderServiceImpl.java

@@ -289,6 +289,23 @@ public class ApsProductionOrderServiceImpl extends ServiceImpl<ApsProductionOrde
 //            }
 //        }
 
+        /**
+         * 校验每个订单产品
+         * 如果订单产品暂不评审=否,并且坯料计划输出总重量 = 0,则错误提示:订单产品 {输入物料描述}坯料计划未填写
+         * 如果订单产品暂不评审=是,并且坯料计划输出总重量 > 0,则错误提示:订单产品 {输入物料描述}暂不评审,不应该填写坯料计划
+         */
+        for (ApsProductDetailVo apsProductDetailVo : apsProductDetailVoList) {
+            if (apsProductDetailVo.getDeleted().equals("0")) {
+                if (apsProductDetailVo.getNotyetreview().equals("否") && (ObjectUtil.isEmpty(apsProductDetailVo.getPlanout()) || apsProductDetailVo.getPlanout().toString().equals("0"))) {
+                    return R.error("订单产品 " + apsProductDetailVo.getInputmaterialdescription() + "坯料计划未填写");
+                }
+                if (apsProductDetailVo.getNotyetreview().equals("是") && ObjectUtil.isNotEmpty(apsProductDetailVo.getPlanout()) && !apsProductDetailVo.getPlanout().toString().equals("0")) {
+                    return R.error("订单产品 " + apsProductDetailVo.getInputmaterialdescription() + "暂不评审,不应该填写坯料计划");
+                }
+            }
+        }
+
+
         List<ApsProductDetailDo> productDetailDoList = BeanUtil.copyToList(apsProductDetailVoList, ApsProductDetailDo.class);
         //================循环校验坯料计划===============
         for (int i = 0; i < apsBlankOrderDoList.size(); i++) {

+ 5 - 0
cx-aps/cx-aps-entity/src/main/java/com/rongwei/bsentity/domain/ApsProductDetailDo.java

@@ -170,6 +170,11 @@ public class ApsProductDetailDo extends BaseDo {
      */
     private String rollnumberrequirement;
 
+    /**
+     * 暂不评审
+     */
+    private String notyetreview;
+
     private static final long serialVersionUID = 1L;
 }
 

+ 5 - 0
cx-aps/cx-aps-entity/src/main/java/com/rongwei/bsentity/domain/ApsProductDetailHistoryDo.java

@@ -170,6 +170,11 @@ public class ApsProductDetailHistoryDo extends BaseDo {
      */
     private String rollnumberrequirement;
 
+    /**
+     * 暂不评审
+     */
+    private String notyetreview;
+
     private static final long serialVersionUID = 1L;
 }
 

+ 10 - 10
cx-aps/cx-aps-server/src/main/java/com/rongwei/bsserver/controller/ApsBlankOrderController.java

@@ -2,18 +2,16 @@ package com.rongwei.bsserver.controller;
 
 
 import com.rongwei.bscommon.sys.service.ApsBlankOrderService;
+import com.rongwei.bscommon.sys.service.ApsService;
 import com.rongwei.bsentity.domain.ApsBlankOrderDo;
 import com.rongwei.bsentity.domain.ApsProductionTechnicalRequirementDo;
-import com.rongwei.bsentity.vo.ApsPlanVo;
-import com.rongwei.bsentity.vo.CheckAndSaveOrUpdateBlankReq;
-import com.rongwei.bsentity.vo.CheckScheduleReq;
-import com.rongwei.bsentity.vo.OrderLockVo;
+import com.rongwei.bsentity.vo.*;
 import com.rongwei.rwcommon.base.R;
-import lombok.SneakyThrows;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
@@ -33,6 +31,9 @@ public class ApsBlankOrderController {
     @Autowired
     private ApsBlankOrderService apsBlankOrderService;
 
+    @Autowired
+    private ApsService apsService;
+
     /**
      * 订单批量排程
      *
@@ -131,11 +132,10 @@ public class ApsBlankOrderController {
             R resData = apsBlankOrderService.insertOrder(params);
             if (resData.getCode().equals("200")) {
                 //重新排程
-                Thread thread = new Thread(new Runnable() {
-                    @SneakyThrows
-                    public void run() {
-                        apsBlankOrderService.apsReScheduling();
-                    }
+                Thread thread = new Thread(() -> {
+//                        apsBlankOrderService.apsReScheduling();
+                    List<ApsBlankOrderVo> apsBlankOrders = new ArrayList<>();
+                    apsService.apsSchedule(apsBlankOrders);
                 });
                 thread.start(); // 启动线程
                 return resData;

+ 4 - 25
cx-aps/cx-aps-server/src/main/java/com/rongwei/bsserver/controller/ApsProductionOrderController.java

@@ -6,7 +6,6 @@ import com.rongwei.bsentity.vo.CheckAndSaveOrUpdateOrderReq;
 import com.rongwei.bsentity.vo.DeleteOrderVo;
 import com.rongwei.bsentity.vo.OrderHaveBeChangedReq;
 import com.rongwei.rwcommon.base.R;
-import lombok.SneakyThrows;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -69,12 +68,7 @@ public class ApsProductionOrderController {
     @PostMapping("/orderOuttimeAudit")
     public R orderOuttimeAudit() {
         log.info("订单未及时评审提醒开始...");
-        Thread thread = new Thread(new Runnable() {
-            @SneakyThrows
-            public void run() {
-                apsProductionOrderService.orderOuttimeAudit();
-            }
-        });
+        Thread thread = new Thread(() -> apsProductionOrderService.orderOuttimeAudit());
         thread.start(); // 启动线程
         return R.ok();
     }
@@ -93,12 +87,7 @@ public class ApsProductionOrderController {
     @PostMapping("/auxiliaryMaterial")
     public R auxiliaryMaterial() {
         log.info("辅料申购提醒开始");
-        Thread thread = new Thread(new Runnable() {
-            @SneakyThrows
-            public void run() {
-                apsProductionOrderService.auxiliaryMaterial();
-            }
-        });
+        Thread thread = new Thread(() -> apsProductionOrderService.auxiliaryMaterial());
         thread.start(); // 启动线程
         return R.ok();
     }
@@ -109,12 +98,7 @@ public class ApsProductionOrderController {
     @PostMapping("/processDelay")
     public R processDelay() {
         log.info("作业延期提醒开始");
-        Thread thread = new Thread(new Runnable() {
-            @SneakyThrows
-            public void run() {
-                apsProductionOrderService.processDelay();
-            }
-        });
+        Thread thread = new Thread(() -> apsProductionOrderService.processDelay());
         thread.start(); // 启动线程
         return R.ok();
     }
@@ -133,12 +117,7 @@ public class ApsProductionOrderController {
     @PostMapping("/reportUnqualify")
     public R reportUnqualify() {
         log.info("报工不合格提醒开始");
-        Thread thread = new Thread(new Runnable() {
-            @SneakyThrows
-            public void run() {
-                apsProductionOrderService.reportUnqualify();
-            }
-        });
+        Thread thread = new Thread(() -> apsProductionOrderService.reportUnqualify());
         thread.start(); // 启动线程
         return R.ok();
     }