From 0e5bddf6084d3dfb7bcad7217d4320898416eba3 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期四, 23 十月 2025 16:49:12 +0800
Subject: [PATCH] 拆分原材料和外购成品的业务流程(报检、下单、检验)

---
 inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java |   49 +++++++++++++++++++++++++------------------------
 1 files changed, 25 insertions(+), 24 deletions(-)

diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java b/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java
index 7f9701e..7f470f3 100644
--- a/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java
+++ b/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java
@@ -11,6 +11,7 @@
 import com.alibaba.fastjson.JSONObject;
 import com.aspose.words.License;
 import com.aspose.words.SaveFormat;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
@@ -168,9 +169,7 @@
     public IPage<InsOrderPlanVO> selectInsOrderPlanList(Page page, InsOrderPlanDTO insOrderPlanDTO) {
         // todo: 浠呯湅鑷繁鎴栬�呭疄楠屽
         //鑾峰彇褰撳墠浜烘墍灞炲疄楠屽id
-
         String laboratory = null;
-
         String userName = null;
         Integer userId = null;
         if (ObjectUtil.isNotEmpty(insOrderPlanDTO.getUserId())) {
@@ -181,8 +180,14 @@
         Integer isCheck = insOrderPlanDTO.getIsCheck();
         insOrderPlanDTO.setIsCheck(null);
         String sonLaboratory = insOrderPlanDTO.getSonLaboratory();//璇曢獙瀹�
+        QueryWrapper<InsOrderPlanDTO> queryWrapper = QueryWrappers.queryWrappers(insOrderPlanDTO);
+        if(ObjectUtils.isEmpty(insOrderPlanDTO.getTypeSource())){
+            queryWrapper.isNull("ifs_inventory_id");//濮旀墭璇曢獙鏌ヨ闈瀒fs鎶ユ璁㈠崟
+        }else{
+            queryWrapper.isNotNull("ifs_inventory_id");
+        }
         IPage<InsOrderPlanVO> insOrderPage = insSampleMapper.findInsSampleAndOrder(page,
-                QueryWrappers.queryWrappers(insOrderPlanDTO),
+                queryWrapper,
                 userName,
                 userId,
                 sonLaboratory,
@@ -919,24 +924,23 @@
         InsSample insSample = insSampleMapper.selectOne(Wrappers.<InsSample>lambdaQuery()
                 .eq(InsSample::getInsOrderId, orderId)
                 .last("limit 1"));
-//        threadPoolTaskExecutor.execute(() -> {
-//            String message = "";
-//            message += "鑰愪笣绯荤粺妫�楠屼换鍔″鏍搁�氱煡";
-//            message += "\n鎻愪氦浜�: " + userName;
-//            message += "\n濮旀墭缂栧彿: " + order.getEntrustCode();
-//            message += "\n鏍峰搧鍚嶇О: " + insSample.getModel();
-//            message += "\n瑙勬牸鍨嬪彿: " + order.getPartDetail();
-//            if (ifsInventoryQuantity != null) {
-//                message += "\n鎵规鍙�: " + ifsInventoryQuantity.getUpdateBatchNo();
-//            }
-//            //鍙戦�佷紒涓氬井淇℃秷鎭�氱煡  鎻愪氦澶嶆牳
-//            try {
-//                WxCpUtils.inform(sendUserAccount, message, null);
-//            } catch (Exception e) {
-//                throw new RuntimeException(e);
-//            }
-//        });
-
+        threadPoolTaskExecutor.execute(() -> {
+            String message = "";
+            message += "鑰愪笣绯荤粺妫�楠屼换鍔″鏍搁�氱煡";
+            message += "\n鎻愪氦浜�: " + userName;
+            message += "\n濮旀墭缂栧彿: " + order.getEntrustCode();
+            message += "\n鏍峰搧鍚嶇О: " + insSample.getModel();
+            message += "\n瑙勬牸鍨嬪彿: " + order.getPartDetail();
+            if (ifsInventoryQuantity != null) {
+                message += "\n鎵规鍙�: " + ifsInventoryQuantity.getUpdateBatchNo();
+            }
+            //鍙戦�佷紒涓氬井淇℃秷鎭�氱煡  鎻愪氦澶嶆牳
+            try {
+                WxCpUtils.inform(sendUserAccount, message, null);
+            } catch (Exception e) {
+                throw new RuntimeException(e);
+            }
+        });
         // 14.ifs绉诲簱(鍘熸潗鏂欓渶瑕佽繘琛岀Щ搴撴搷浣�) --> 鏈�鍚庢墽琛�,鍥犱负澶辫触鏃犳硶鍥炴粴
         if (ifsInventoryQuantity != null) {
             // 鐧昏妫�楠岀粨鏋�
@@ -950,8 +954,6 @@
                 // 娣诲姞鍒嗘瀽鏁版嵁
                 addAnalysis(productList, ifsInventoryQuantity, order, sendUserAccount);
             });
-
-
         } else {
             // 淇敼鎴愬搧鐘舵��
             // 鍒ゆ柇鏄惁鏈変笉鍚堟牸
@@ -966,7 +968,6 @@
                         .set(InsOrder::getInsResult, 0));
             }
         }
-
         return 1;
     }
 

--
Gitblit v1.9.3