From e50a43bb067adff10cd1dcc81349b1aafdfda882 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期四, 22 一月 2026 13:18:44 +0800
Subject: [PATCH] 业务管理:IFS域区分【ZTNS】和【KJNS】

---
 inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderServiceImpl.java |   27 ++++++++++++++++++++-------
 1 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderServiceImpl.java b/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderServiceImpl.java
index 4c474ec..5370f98 100644
--- a/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderServiceImpl.java
+++ b/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderServiceImpl.java
@@ -25,6 +25,7 @@
 import com.ruoyi.basic.pojo.StandardProductList;
 import com.ruoyi.basic.pojo.StructureItemParameter;
 import com.ruoyi.basic.pojo.StructureTestObject;
+import com.ruoyi.common.config.ifs.IfsProperties;
 import com.ruoyi.common.constant.InsOrderTypeConstants;
 import com.ruoyi.common.core.domain.Result;
 import com.ruoyi.common.core.domain.entity.User;
@@ -561,7 +562,7 @@
      */
     @Override
     public void getIfsOrder(Map<String, Object> map, Boolean isSplitOrder) {
-        List<Map<String, Object>> inventory = ifsApiUtils.getInventory(JSONUtil.toJsonStr(map));
+        List<Map<String, Object>> inventory = ifsApiUtils.getInventory(map);
         if (inventory.isEmpty()) {
             return;
         }
@@ -807,6 +808,8 @@
         ifsInventoryQuantity.setIsCopper(1);
         ifsInventoryQuantity.setIsQuarter(0);
         ifsInventoryQuantity.setInspectStatus(0);
+        ifsInventoryQuantity.setOrderType(OrderType.RAW.getValue());
+        ifsInventoryQuantity.setMaterialProp("01Cu");
 
         ifsInventoryQuantity.setQtyArrived(insOrder.getQtyArrived());
         ifsInventoryQuantity.setBuyUnitMeas(insOrder.getBuyUnitMeas());
@@ -1204,7 +1207,7 @@
             resultMap.put("SYSCODE", "LIMS");
             resultMap.put("SYSMODEL", "鐧昏閲囪喘妫�楠岀粨鏋�");
             resultMap.put("BATCH_INFO", resultList);
-            Result result = ifsApiUtils.getProcurementResults(JSONUtil.toJsonStr(resultMap));
+            Result result = ifsApiUtils.getProcurementResults(one.getContract(),JSONUtil.toJsonStr(resultMap));
             if (result.getCode() != 200) {
                 throw new ErrorException("IFS鐧昏閲囪喘妫�楠岀粨鏋滃け璐�: " + result.getMessage());
             }
@@ -1235,8 +1238,14 @@
          * TODO 鍚庣画闇�瑕佽皟鐢↖FS鐨勬帴鍙� 绉诲叆鐨勫簱浣嶅彿 toLocation
          */
         // 妫�楠屽悗绉诲簱
-        //1301:鍘熸潗鏂欏悎鏍煎簱锛孋P-02-001:鎴愬搧搴�
-        toLocation = StringUtils.equals(inventoryQuantity.getOrderType(), OrderType.RAW.getValue()) ? "1301" : "CP-02-001";
+        //1.鏍规嵁ifs鍩熻幏鍙栧搴斿簱浣嶉厤缃�
+        IfsProperties properties = ifsApiUtils.getPropByContract(one.getContract());
+        //2.鍒ゆ柇璁㈠崟绫诲瀷鏄惁涓哄師鏉愭枡
+        if(StringUtils.equals(inventoryQuantity.getOrderType(), OrderType.RAW.getValue())){
+            toLocation = properties.getRawQualifiedLocation();
+        }else{
+            toLocation = properties.getProductQualifiedLocation();
+        }
         Map<String, Object> moveResultMap = new HashMap<>();
         List<Map<String, Object>> moveResultList = new ArrayList<>();
         Map<String, Object> moveMap = new HashMap<>();
@@ -1259,7 +1268,7 @@
         moveResultMap.put("SYSMODEL", "妫�楠屽悗绉诲簱");
         moveResultMap.put("BATCH_INFO", moveResultList);
 
-        Result result1 = ifsApiUtils.moveReceipt(JSONUtil.toJsonStr(moveResultMap));
+        Result result1 = ifsApiUtils.moveReceipt(one.getContract(),JSONUtil.toJsonStr(moveResultMap));
         // 濡傛灉鏈夊繀椤讳负闆朵欢鎸囧畾鎵瑰彿鎶ラ敊闇�瑕侀噸鏂版彁浜ょЩ搴撲俊鎭幓鎸囧畾鎵瑰彿
         if (result1.getCode() != 200) {
             String message = result1.getMessage();
@@ -1269,6 +1278,10 @@
                 throw new ErrorException("IFS妫�楠屽悗绉诲簱澶辫触: " + result1.getMessage());
             }
         }
+        // 淇敼ifs璁㈠崟鏁版嵁涓哄凡妫�楠�
+        ifsInventoryQuantityMapper.update(null, new LambdaUpdateWrapper<IfsInventoryQuantity>()
+                .set(IfsInventoryQuantity::getState, 2)
+                .eq(IfsInventoryQuantity::getId, inventoryQuantity.getId()));
         return toLocation;
     }
 
@@ -1305,7 +1318,7 @@
             resultMap.put("SYSMODEL", "淇敼閲囪喘璁㈠崟鎵规鍙�");
             resultMap.put("BATCH_INFO", resultList);
 
-            Result result = ifsApiUtils.updateMoveReceiptLot(JSONUtil.toJsonStr(resultMap));
+            Result result = ifsApiUtils.updateMoveReceiptLot(one.getContract(),JSONUtil.toJsonStr(resultMap));
 
             if (result.getCode() != 200) {
                 throw new ErrorException("IFS淇敼鎵规鍙峰け璐�: " + result.getMessage());
@@ -1337,7 +1350,7 @@
         moveResultMap.put("SYSMODEL", "妫�楠屽悗绉诲簱");
         moveResultMap.put("BATCH_INFO", moveResultList);
 
-        Result result1 = ifsApiUtils.moveReceipt(JSONUtil.toJsonStr(moveResultMap));
+        Result result1 = ifsApiUtils.moveReceipt(one.getContract(),JSONUtil.toJsonStr(moveResultMap));
         if (result1.getCode() != 200) {
             throw new ErrorException("IFS妫�楠屽悗绉诲簱澶辫触: " + result1.getMessage());
         }

--
Gitblit v1.9.3