From e4e498bd271942d95d40809028fa8f65354c8f2c Mon Sep 17 00:00:00 2001
From: sfd <sun.sunshine@163.com>
Date: 星期五, 09 五月 2025 17:18:32 +0800
Subject: [PATCH] 调用计算延期风险接口

---
 aps-modules/aps-core/src/main/resources/mapper/core/ApsPlatePlanMapper.xml |   33 ++++++++++++++++++++++++++++-----
 1 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/aps-modules/aps-core/src/main/resources/mapper/core/ApsPlatePlanMapper.xml b/aps-modules/aps-core/src/main/resources/mapper/core/ApsPlatePlanMapper.xml
index 84ab2b7..7d407f4 100644
--- a/aps-modules/aps-core/src/main/resources/mapper/core/ApsPlatePlanMapper.xml
+++ b/aps-modules/aps-core/src/main/resources/mapper/core/ApsPlatePlanMapper.xml
@@ -44,8 +44,11 @@
         <result property="opStatus"    column="op_status"    />
         <result property="nextOpName"    column="next_op_name"    />
         <result property="unmatchedQuantity"    column="unmatched_quantity"    />
+        <result property="productionBase"    column="production_base"    />
+        <result property="orderCreateTime"    column="order_create_time"    />
         <result property="professionalAffiliation"    column="professional_affiliation"    />
         <result property="requireId"    column="require_id"    />
+        <result property="version"    column="version"    />
     </resultMap>
 
     <sql id="selectApsPlatePlanVo">
@@ -55,7 +58,8 @@
                work_center, department, plan_start_day, plan_end_day, standby_number, standby_name,
                standby_stock, next_process_deparment, is_suspended, is_outsourcing, account, advanced_materials,
                advanced_document_number, advanced_requirement_day, is_plan_complete, is_stock_complete,
-               has_turnback, has_risk, std_op, op_status, next_op_name ,unmatched_quantity,professional_affiliation
+               has_turnback, has_risk, std_op, op_status, next_op_name ,unmatched_quantity,professional_affiliation,
+                   require_id, version,production_base, order_create_time
         from aps_plate_plan
     </sql>
 
@@ -266,7 +270,9 @@
     </update>
 
     <select id="selectPlatePlanByPlantMajor" parameterType="ApsPlatePlan" resultMap="ApsPlatePlanResult">
-        select  id,document_number,main_part_number,item_number,plant,professional_affiliation,production_quantity,require_id
+        select  id,document_number,main_part_number,item_number,plant,professional_affiliation,production_quantity,require_id,
+        unmatched_quantity,version, production_base,
+        (case   when custom_time is null then plan_end_day else custom_time end ) as plan_end_day
         from aps_plate_plan
         <where>
             <if test="plant != null "> and plant = #{plant}</if>
@@ -278,10 +284,11 @@
 
     <select id="selectUnMatchPlateSubPlan" parameterType="ApsPlatePlan" resultMap="ApsPlatePlanResult">
         select  id,document_number,main_part_number,item_number,plant,professional_affiliation,production_quantity,
-             ,unmatched_quantity
+             unmatched_quantity,version
         from aps_plate_plan
         where  del_flag='0' and professional_affiliation !='0' and unmatched_quantity > 0
-        <if test="plant != null  and plan !='' "> and plant = #{plant}</if>
+        <if test="plant != null  and plant !='' "> and plant = #{plant}</if>
+        <if test="itemNumber != null  and itemNumber !='' "> and item_number = #{itemNumber}</if>
         order by document_number asc,id asc
         limit 1
     </select>
@@ -289,7 +296,23 @@
 
     <update id="updatePlanUnMatchQtyByVersion" parameterType="ApsPlatePlan">
         update aps_plate_plan
-        set unmatched_quantity=#{unmatched_quantity},version=version+1
+        set unmatched_quantity=#{unmatchedQuantity},version=version+1
         where id=#{id} and version=#{version}
     </update>
+    <select id="selectPlateRedundantOrderList" parameterType="ApsPlatePlan" resultMap="ApsPlatePlanResult">
+        select document_number, item_number, production_quantity, unmatched_quantity, plant, production_base, plan_start_day, plan_end_day, order_create_time
+        from aps_plate_plan where unmatched_quantity>0 and professional_affiliation!='0'
+        <if test="documentNumber != null and documentNumber != ''">
+            and document_number like '%' || #{documentNumber} || '%'
+        </if>
+        <if test="itemNumber != null and itemNumber != ''">
+            and item_number like '%' || #{itemNumber} || '%'
+        </if>
+    </select>
+
+    <update id="initUnMatchQty" >
+        update aps_plate_plan
+            set unmatched_quantity=production_quantity, version=0,require_id=id
+        where   del_flag='0' and professional_affiliation !='0'
+    </update>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.3