From 706ebb998c15478872f034cb96786c33ca1ed6a4 Mon Sep 17 00:00:00 2001
From: huangjiayang <5265313@qq.com>
Date: 星期一, 12 五月 2025 19:57:21 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev

---
 aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlateStandardRequireServiceImpl.java               |   91 +++++++++++++++++++-----------
 aps-modules/aps-core/src/main/resources/mapper/core/ApsPlateStandardRequireBomOrderDetailMapper.xml                |    5 +
 aps-modules/aps-core/src/main/java/com/aps/core/mapper/ApsMaterialStorageManagementMapper.java                     |    3 +
 aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlateStandardRequireBomOrderDetailServiceImpl.java |    2 
 aps-modules/aps-core/src/main/resources/mapper/core/ApsPlateStandardRequireBomStockDetailMapper.xml                |    2 
 aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlateStandardRequireBomStockDetailServiceImpl.java |   13 +++-
 aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlatePlanServiceImpl.java                          |    5 +
 aps-modules/aps-core/src/main/resources/mapper/core/ApsMaterialStorageManagementMapper.xml                         |    7 ++
 aps-modules/aps-core/src/main/java/com/aps/core/service/IApsPlatePlanService.java                                  |    3 +
 aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsMaterialStorageManagementServiceImpl.java          |   19 ++++++
 aps-modules/aps-core/src/main/java/com/aps/core/service/IApsMaterialStorageManagementService.java                  |    8 ++
 11 files changed, 117 insertions(+), 41 deletions(-)

diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/mapper/ApsMaterialStorageManagementMapper.java b/aps-modules/aps-core/src/main/java/com/aps/core/mapper/ApsMaterialStorageManagementMapper.java
index 4bfad1e..3e29757 100644
--- a/aps-modules/aps-core/src/main/java/com/aps/core/mapper/ApsMaterialStorageManagementMapper.java
+++ b/aps-modules/aps-core/src/main/java/com/aps/core/mapper/ApsMaterialStorageManagementMapper.java
@@ -69,4 +69,7 @@
     * 鍒濆鍖栧墿浣欏簱瀛樻暟閲�
     * */
    int initRemainderStock();
+
+   int updateRemainderStock(String id, BigDecimal remainderStock, Integer version);
+
 }
diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/service/IApsMaterialStorageManagementService.java b/aps-modules/aps-core/src/main/java/com/aps/core/service/IApsMaterialStorageManagementService.java
index 807bac3..53e8c91 100644
--- a/aps-modules/aps-core/src/main/java/com/aps/core/service/IApsMaterialStorageManagementService.java
+++ b/aps-modules/aps-core/src/main/java/com/aps/core/service/IApsMaterialStorageManagementService.java
@@ -1,5 +1,9 @@
 package com.aps.core.service;
 
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Optional;
+
 import com.aps.core.domain.ApsMaterialStorageManagement;
 
 import java.util.List;
@@ -60,6 +64,8 @@
      */
     public int deleteApsMaterialStorageManagementById(String id);
 
+    Optional<ApsMaterialStorageManagement> getItemStorage(String plant, String itemNumber);
+
     ApsMaterialStorageManagement getRdsStorage(String plant, String itemCode);
 
 
@@ -68,4 +74,6 @@
      * @return
      */
     public boolean setStorageDataToRedis(String orgCode);
+
+    int  updateRemainderStock(String id, BigDecimal remainderStock, Integer version);
 }
diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/service/IApsPlatePlanService.java b/aps-modules/aps-core/src/main/java/com/aps/core/service/IApsPlatePlanService.java
index b7c74f7..bae0205 100644
--- a/aps-modules/aps-core/src/main/java/com/aps/core/service/IApsPlatePlanService.java
+++ b/aps-modules/aps-core/src/main/java/com/aps/core/service/IApsPlatePlanService.java
@@ -2,6 +2,7 @@
 
 import com.aps.core.domain.ApsPlatePlan;
 import com.aps.core.domain.ApsPlatePlanTemp;
+import com.aps.core.domain.ApsPlateStandardRequire;
 
 import java.util.List;
 
@@ -79,4 +80,6 @@
      * @return
      */
     public List<ApsPlatePlan> selectPlateRedundantOrderList(ApsPlatePlan apsPlatePlan);
+
+   // ApsPlatePlan selectUnMatchPlateSubPlan(ApsPlateStandardRequire require);
 }
diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsMaterialStorageManagementServiceImpl.java b/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsMaterialStorageManagementServiceImpl.java
index 47d6e6c..79015ad 100644
--- a/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsMaterialStorageManagementServiceImpl.java
+++ b/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsMaterialStorageManagementServiceImpl.java
@@ -1,5 +1,9 @@
 package com.aps.core.service.impl;
 
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Optional;
+
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
 import com.aps.common.core.utils.DateUtils;
@@ -105,7 +109,8 @@
     /**
      * 鑾峰彇鐗╂枡搴撳瓨淇℃伅
      * */
-    private Optional<ApsMaterialStorageManagement> getItemStorage(String plant, String itemNumber) {
+    @Override
+    public Optional<ApsMaterialStorageManagement> getItemStorage(String plant, String itemNumber) {
         ApsMaterialStorageManagement storageParam = new ApsMaterialStorageManagement();
         storageParam.setItemNumber(itemNumber);
         storageParam.setApplicableFactories(plant);
@@ -183,4 +188,16 @@
 //        }
         return true;
     }
+
+    /**
+     * 鏇存柊搴撳瓨淇℃伅
+     * */
+    public int updateMaterialStorageByVersion(String id, BigDecimal remainderStock, Integer version) {
+        return apsMaterialStorageManagementMapper.updateMaterialStorageByVersion(id, remainderStock, version);
+    }
+
+    @Override
+    public int  updateRemainderStock(String id, BigDecimal remainderStock, Integer version){
+        return apsMaterialStorageManagementMapper.updateRemainderStock(id, remainderStock, version);
+    }
 }
diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlatePlanServiceImpl.java b/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlatePlanServiceImpl.java
index 9da6195..6fda182 100644
--- a/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlatePlanServiceImpl.java
+++ b/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlatePlanServiceImpl.java
@@ -1,11 +1,15 @@
 package com.aps.core.service.impl;
 
 import cn.hutool.core.util.IdUtil;
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
 import com.aps.common.core.utils.DateUtils;
 import com.aps.common.core.utils.uuid.IdUtils;
 import com.aps.common.security.utils.DictUtils;
+import com.aps.core.domain.ApsMaterialStorageManagement;
 import com.aps.core.domain.ApsPlatePlan;
 import com.aps.core.domain.ApsPlatePlanTemp;
+import com.aps.core.domain.ApsPlateStandardRequire;
 import com.aps.core.mapper.ApsPartPlanTempMapper;
 import com.aps.core.mapper.ApsPlatePlanMapper;
 import com.aps.core.mapper.ApsPlatePlanTempMapper;
@@ -14,6 +18,7 @@
 import org.apache.logging.log4j.util.Strings;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlateStandardRequireBomOrderDetailServiceImpl.java b/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlateStandardRequireBomOrderDetailServiceImpl.java
index 4feac70..3f81161 100644
--- a/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlateStandardRequireBomOrderDetailServiceImpl.java
+++ b/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlateStandardRequireBomOrderDetailServiceImpl.java
@@ -127,6 +127,6 @@
         bomOrderDetail.setCreateBy(SecurityUtils.getUsername());
 
         orderDetailsList.add(bomOrderDetail);
-       // apsPlateStandardRequireBomOrderDetailMapper.insertApsPlateStandardRequireBomOrderDetail(bomOrderDetail);
+        apsPlateStandardRequireBomOrderDetailMapper.insertApsPlateStandardRequireBomOrderDetail(bomOrderDetail);
     }
 }
diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlateStandardRequireBomStockDetailServiceImpl.java b/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlateStandardRequireBomStockDetailServiceImpl.java
index 34616a5..82a379d 100644
--- a/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlateStandardRequireBomStockDetailServiceImpl.java
+++ b/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlateStandardRequireBomStockDetailServiceImpl.java
@@ -115,7 +115,8 @@
                                      String itemCode, String batchNum, BigDecimal deductionAmount,
                                      BigDecimal afterStockAmount,Long requireId
             ,List<ApsPlateStandardRequireBomStockDetail> stockDetailsList){
-        /*鏇存柊鐗╂枡鍓╀綑搴撳瓨*/
+
+
         itemStorageMapper.updateMaterialStorageByVersion(itemStorage.getId(), afterStockAmount,itemStorage.getVersion());
         /*璁板綍鎵e噺鏄庣粏*/
         ApsPlateStandardRequireBomStockDetail bomStockDetail = ApsPlateStandardRequireBomStockDetail.builder()
@@ -135,7 +136,13 @@
         bomStockDetail.setCreateTime(DateUtils.getNowDate());
 
         stockDetailsList.add(bomStockDetail);
-        //plateBomStockDetailMapper.insertApsPlateStandardRequireBomStockDetail(bomStockDetail);
-
+        plateBomStockDetailMapper.insertApsPlateStandardRequireBomStockDetail(bomStockDetail);
+        /*鏇存柊鍐呭瓨涓墿鏂欏墿浣欏簱瀛�*/
+        /*itemStorage.setRemainderStock(afterStockAmount);
+        if(null== itemStorage.getVersion()){
+            itemStorage.setVersion(1);
+        }else{
+            itemStorage.setVersion(itemStorage.getVersion()+1);
+        }*/
     }
 }
diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlateStandardRequireServiceImpl.java b/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlateStandardRequireServiceImpl.java
index f0c7cc8..dc8ed21 100644
--- a/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlateStandardRequireServiceImpl.java
+++ b/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlateStandardRequireServiceImpl.java
@@ -72,7 +72,7 @@
 
     @Resource
     IApsPlateStandardRequireBatchService requireBatchService;
-    @Autowired
+    @Resource
     private IApsMaterialStorageManagementService storageManagementService;
 
     /**
@@ -173,6 +173,8 @@
         String batchNum= requireBatchService.getNewBatchNumber();
         /*鑾峰彇閽i噾涓诲崟淇℃伅*/
         List<ApsPlatePlan> mainPlans = platePlanMapper.selectPlatePlanByPlantMajor(plantCode,mainOrderType);
+        Hashtable<String, ApsMaterialStorageManagement> usedStorage = new Hashtable<>();
+
         for (ApsPlatePlan mainPlan : mainPlans) {
             String itemNumber = mainPlan.getItemNumber();
             /*鏍规嵁鏂欏彿 鑾峰彇BOM Header */
@@ -183,7 +185,9 @@
             List<ApsPlateStandardRequireBomOrderDetail> orderDetailsList=new ArrayList<>();
 
 
-            getBomRequires(plantCode, "0","0",itemNumber,BigDecimal.ONE, batchNum, null, mainPlan, requiresList, 0L,stockDetailsList,orderDetailsList);
+            getBomRequires(plantCode, "0","0",itemNumber,BigDecimal.ONE, batchNum, null
+                    , mainPlan, requiresList, 0L,stockDetailsList,orderDetailsList,usedStorage
+            );
 
             // 鎵归噺鎻掑叆浠ユ彁楂樻�ц兘
             if (!requiresList.isEmpty()) {
@@ -195,23 +199,32 @@
                 }
             }
 
-            if(!stockDetailsList.isEmpty()){
-                int batchSize = 1000;
-                for (int i = 0; i < stockDetailsList.size(); i += batchSize) {
-                    int end = Math.min(i + batchSize, stockDetailsList.size());
-                    List<ApsPlateStandardRequireBomStockDetail> batch = stockDetailsList.subList(i, end);
-                    plateBomStockDetailMapper.batchInsert(batch);
-                }
-            }
+//            if(!stockDetailsList.isEmpty()){
+//                int batchSize = 1000;
+//                stockDetailsList.forEach(x->x.setId(IdUtil.getSnowflakeNextId()));
+//                for (int i = 0; i < stockDetailsList.size(); i += batchSize) {
+//                    int end = Math.min(i + batchSize, stockDetailsList.size());
+//                    List<ApsPlateStandardRequireBomStockDetail> batch = stockDetailsList.subList(i, end);
+//                    plateBomStockDetailMapper.batchInsert(batch);
+//                }
+//            }
+//
+//            if(!orderDetailsList.isEmpty()){
+//                int batchSize = 1000;
+//                orderDetailsList.forEach(x->x.setId(IdUtil.getSnowflakeNextId()));
+//                for (int i = 0; i < orderDetailsList.size(); i += batchSize) {
+//                    int end = Math.min(i + batchSize, orderDetailsList.size());
+//                    List<ApsPlateStandardRequireBomOrderDetail> batch = orderDetailsList.subList(i, end);
+//                    plateBomOrderDetailMapper.batchInsert(batch);
+//                }
+//            }
+            /*闆嗕腑淇濆瓨搴撳瓨淇℃伅*/
+           /* if(!usedStorage.isEmpty()){
+                usedStorage.forEach((key, sm) -> {
+                    storageManagementService.updateRemainderStock(sm.getId(),sm.getRemainderStock(),sm.getVersion());
+                });
+            }*/
 
-            if(!orderDetailsList.isEmpty()){
-                int batchSize = 1000;
-                for (int i = 0; i < orderDetailsList.size(); i += batchSize) {
-                    int end = Math.min(i + batchSize, orderDetailsList.size());
-                    List<ApsPlateStandardRequireBomOrderDetail> batch = orderDetailsList.subList(i, end);
-                    plateBomOrderDetailMapper.batchInsert(batch);
-                }
-            }
         }
     }
 
@@ -234,8 +247,9 @@
     private void getBomRequires(String plant, String bomHeaderCode, String bomLineId,String itemCode,BigDecimal itemNum,
                                 String batchNum, Date upLevelStartDate, ApsPlatePlan plan,
                                 List<ApsPlateStandardRequire> allRequires,
-                                Long level,List<ApsPlateStandardRequireBomStockDetail> stockDetailsList
-                                ,List<ApsPlateStandardRequireBomOrderDetail> orderDetailsList
+                                Long level,List<ApsPlateStandardRequireBomStockDetail> stockDetailsList,
+                                List<ApsPlateStandardRequireBomOrderDetail> orderDetailsList,
+                                 Hashtable<String, ApsMaterialStorageManagement> usedStorage
     ) {
         /*鏋勫缓闇�姹備俊鎭�*/
         ApsPlateStandardRequire require = new ApsPlateStandardRequire();
@@ -260,14 +274,22 @@
             require.setBomUseAmount(itemNum.multiply(plan.getProductionQuantity()));
         }
         /*鏌ユ壘搴撳瓨锛岃绠楀噣闇�姹傦紝淇濆瓨鍓╀綑搴撳瓨锛屼繚瀛樺簱瀛樻墸鍑忔槑缁�*/
-        BigDecimal remainderStock = BigDecimal.ZERO;
         /*榛樿鍑�闇�姹備负BOM鐢ㄩ噺*/
         require.setNetRequirement(require.getBomUseAmount());
-        Optional<ApsMaterialStorageManagement> itemStorage = Optional.of(storageManagementService.getRdsStorage( plant,  itemCode));
-        if (itemStorage.isPresent()) {
-            ApsMaterialStorageManagement storage = itemStorage.get();
-            /*鍓╀綑搴撳瓨*/
-            remainderStock = storage.getRemainderStock();
+
+        /*璇诲彇搴撳瓨淇℃伅鐨勪紭鍏堢骇-> 鍐呭瓨銆乺edis銆乨b*/
+       /* ApsMaterialStorageManagement storage = usedStorage.get(itemCode);
+        if(storage==null){
+            storage = storageManagementService.getRdsStorage(plant, itemCode);
+            if(storage!=null){
+                *//*鍓╀綑搴撳瓨*//*
+                remainderStock = storage.getRemainderStock();
+            }
+        }*/
+        Optional<ApsMaterialStorageManagement> itemStorageOpt = storageManagementService.getItemStorage(plant, itemCode);
+        if (itemStorageOpt.isPresent()) {
+            ApsMaterialStorageManagement     itemStorage=itemStorageOpt.get();
+            BigDecimal remainderStock =itemStorage.getRemainderStock();
             /*璁$畻鍑�闇�姹� 榛樿=闇�姹傛暟閲�*/
             if (remainderStock.compareTo(BigDecimal.ZERO) == 0) {
                 require.setNetRequirement(require.getBomUseAmount());
@@ -286,9 +308,11 @@
                     require.setNetRequirement(BigDecimal.ZERO);
                 }
                 /*璁板綍搴撳瓨鍓╀綑鏁伴噺锛岃褰曞簱瀛樹娇鐢ㄨ褰�*/
-                bomStockDetailService.saveStorageAndDetail(storage, plan, bomLineId,itemCode, batchNum, deductionAmount
-                        , afterStockAmount,require.getId(),stockDetailsList
+                bomStockDetailService.saveStorageAndDetail(itemStorage, plan, bomLineId, itemCode, batchNum, deductionAmount
+                        , afterStockAmount, require.getId(), stockDetailsList
                 );
+                /*鏇存柊鍐呭瓨涓殑搴撳瓨浣跨敤淇℃伅*/
+               // usedStorage.put(itemCode, storage);
             }
         }
         /*鏈尮閰嶆暟閲忥紝榛樿涓哄噣闇�姹�*/
@@ -338,7 +362,6 @@
         require.setMatchState("宸插尮閰�");
         require.setMatchMode("搴撳瓨鍖归厤");
         if (require.getNetRequirement().compareTo(BigDecimal.ZERO) > 0) {
-            require.setMatchState("寰呭尮閰�");
             require.setMatchMode("宸ュ崟鍖归厤");
             /*浣跨敤瀛愪欢宸ュ崟杩涜闇�姹傚尮閰�*/
             matchRequireAndSubPlan(require,orderDetailsList);
@@ -352,7 +375,7 @@
                 bomLineList.forEach(line -> {
                     getBomRequires(plant, itemCode, line.getBomLineId(),line.getItemCode() ,line.getNum() , batchNum
                             , require.getStartDate(), plan, allRequires, nextLevel,stockDetailsList
-                            ,orderDetailsList
+                            ,orderDetailsList,usedStorage
                     );
                 });
             }
@@ -379,6 +402,7 @@
     private void matchRequireAndSubPlan(ApsPlateStandardRequire require, List<ApsPlateStandardRequireBomOrderDetail> orderDetailsList) {
         BigDecimal netRequirement = require.getNetRequirement();
         require.setMatchMode("宸ュ崟鍖归厤");
+        require.setMatchState("宸插尮閰�");
         if (netRequirement.compareTo(BigDecimal.ZERO) > 0) {
             ApsPlatePlan platePlan = apsPlatePlanMapper.selectUnMatchPlateSubPlan(require.getOrgCode(),  require.getBomLineCode());
             /*瀛愪欢宸ュ崟鐨勬湭鍖归厤鏁伴噺 浣滀负褰撳墠鐨勫簱瀛�*/
@@ -390,7 +414,7 @@
                     BigDecimal subtract = stock.subtract(netRequirement);
                     bomOrderDetailService.savePlastPlanAndBomOrderDetail(require, platePlan, subtract, stock, netRequirement,orderDetailsList);
                     netRequirement = BigDecimal.ZERO;
-                    require.setMatchState("宸插尮閰�");
+
                     require.setUnmatchedDemandAmount(BigDecimal.ZERO);
                     /*鍑�闇�姹傚凡缁忚婊¤冻锛屼笉闇�瑕佺户缁尮閰�*/
 
@@ -400,7 +424,7 @@
                     BigDecimal subtract = BigDecimal.ZERO;
                     bomOrderDetailService.savePlastPlanAndBomOrderDetail(require, platePlan, subtract, stock, netRequirement,orderDetailsList);
                     netRequirement = BigDecimal.ZERO;
-                    require.setMatchState("宸插尮閰�");
+
                     require.setUnmatchedDemandAmount(BigDecimal.ZERO);
                     /*鍑�闇�姹傚凡缁忚婊¤冻锛屼笉闇�瑕佺户缁尮閰�*/
                 }
@@ -408,7 +432,7 @@
                     /*闇�姹傚ぇ浜庡簱瀛�*/
                     /*鍑�闇�姹� 琚儴鍒嗘弧瓒� */
                     BigDecimal rest = netRequirement.subtract(stock);
-                    require.setMatchState("鍖归厤涓�");
+
                     /*宸ュ崟 鏈尮閰嶆暟閲忎负0 鍏ㄩ儴鐢ㄤ簬鍖归厤闇�姹�*/
                     bomOrderDetailService.savePlastPlanAndBomOrderDetail(require, platePlan, BigDecimal.ZERO, stock, netRequirement,orderDetailsList);
                     /*鍑�闇�姹傛湭琚弧瓒筹紝闇�瑕佺户缁尮閰�*/
@@ -418,6 +442,7 @@
                     require.setUnmatchedDemandAmount(rest);
                 }
             }
+
         }
     }
 
diff --git a/aps-modules/aps-core/src/main/resources/mapper/core/ApsMaterialStorageManagementMapper.xml b/aps-modules/aps-core/src/main/resources/mapper/core/ApsMaterialStorageManagementMapper.xml
index e1a4ec0..fe547a9 100644
--- a/aps-modules/aps-core/src/main/resources/mapper/core/ApsMaterialStorageManagementMapper.xml
+++ b/aps-modules/aps-core/src/main/resources/mapper/core/ApsMaterialStorageManagementMapper.xml
@@ -104,4 +104,11 @@
         set remainder_stock=num,version=0
         where 1=1
     </update>
+
+    <update id="updateRemainderStock" parameterType="ApsMaterialStorageManagement">
+        update aps_material_storage_management
+        set remainder_stock=#{remainderStock},version=#{version}
+        where id=#{id}
+    </update>
+
 </mapper>
\ No newline at end of file
diff --git a/aps-modules/aps-core/src/main/resources/mapper/core/ApsPlateStandardRequireBomOrderDetailMapper.xml b/aps-modules/aps-core/src/main/resources/mapper/core/ApsPlateStandardRequireBomOrderDetailMapper.xml
index 650ec9a..979e3c0 100644
--- a/aps-modules/aps-core/src/main/resources/mapper/core/ApsPlateStandardRequireBomOrderDetailMapper.xml
+++ b/aps-modules/aps-core/src/main/resources/mapper/core/ApsPlateStandardRequireBomOrderDetailMapper.xml
@@ -134,12 +134,13 @@
         insert into aps_plate_standard_require_bom_order_detail
         (id, require_id,require_track_id, bom_line_id, bom_line_code, doc_no,
          before_prod_amount, deduction_amount, after_prod_amount,
-         org_code, batch_number, del_flag, create_time, create_by,)
+         org_code, batch_number, del_flag, create_time, create_by)
         values
         <foreach collection="list" item="item" index="index" separator=",">
             (#{item.id}, #{item.requireId},#{item.requireTrackId}, #{item.bomLineId}, #{item.bomLineCode}, #{item.docNo},
              #{item.beforeProdAmount}, #{item.deductionAmount}, #{item.afterProdAmount},
-             #{item.orgCode}, #{item.batchNumber}, #{item.delFlag}, #{item.createTime}, #{item.createBy},)
+             #{item.orgCode}, #{item.batchNumber}, #{item.delFlag}, #{item.createTime}, #{item.createBy}
+            )
         </foreach>
     </insert>
 </mapper>
\ No newline at end of file
diff --git a/aps-modules/aps-core/src/main/resources/mapper/core/ApsPlateStandardRequireBomStockDetailMapper.xml b/aps-modules/aps-core/src/main/resources/mapper/core/ApsPlateStandardRequireBomStockDetailMapper.xml
index 8574f88..2f94f10 100644
--- a/aps-modules/aps-core/src/main/resources/mapper/core/ApsPlateStandardRequireBomStockDetailMapper.xml
+++ b/aps-modules/aps-core/src/main/resources/mapper/core/ApsPlateStandardRequireBomStockDetailMapper.xml
@@ -129,7 +129,7 @@
         , after_stock_amount, org_code, batch_number, del_flag, create_time, create_by)
         values
         <foreach item="item" index="index" collection="list" separator=",">
-            ( #{id}, #{item.requireId}, #{item.requireTrackId}, #{item.bomLineId}, #{item.bomLineCode}
+            ( #{item.id}, #{item.requireId}, #{item.requireTrackId}, #{item.bomLineId}, #{item.bomLineCode}
             , #{item.beforeStockAmount} , #{item.deductionAmount}, #{item.afterStockAmount}, #{item.orgCode}
             , #{item.batchNumber} , #{item.delFlag}, #{item.createTime}, #{item.createBy}
             )

--
Gitblit v1.9.3