From 1a47d9eef4cfe9385ce66b791de84db54a5ba87c Mon Sep 17 00:00:00 2001
From: jiazx0107@163.com <jiazx0107@163.com>
Date: 星期日, 25 六月 2023 20:30:36 +0800
Subject: [PATCH] 出入库流程优化-入库详单优化

---
 igds-inout/src/main/resources/mapper/InoutRecordMapper.xml |   32 +++++++++++++++++---------------
 1 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/igds-inout/src/main/resources/mapper/InoutRecordMapper.xml b/igds-inout/src/main/resources/mapper/InoutRecordMapper.xml
index b240655..36bb4a0 100644
--- a/igds-inout/src/main/resources/mapper/InoutRecordMapper.xml
+++ b/igds-inout/src/main/resources/mapper/InoutRecordMapper.xml
@@ -83,7 +83,6 @@
             <if test="param.id != null and param.id != '' ">AND ID_ = #{param.id}</if>
             <if test="param.progress != null and param.progress != '' ">AND PROGRESS_ = #{param.progress}</if>
             AND PROGRESS_ != 'RECORD'
-            AND RECORD_STATUS_ != 'ERROR'
             AND RECORD_STATUS_ != 'DEL'
         </where>
     </select>
@@ -110,7 +109,6 @@
                 COMPLETE_TIME_ <![CDATA[ > ]]>#{param.start,jdbcType=TIMESTAMP}
             </if>
             AND PROGRESS_ = 'RECORD'
-            AND RECORD_STATUS_ != 'ERROR'
             AND RECORD_STATUS_ != 'DEL'
             ORDER BY COMPLETE_TIME_
         </where>
@@ -156,7 +154,6 @@
                 COMPLETE_TIME_ <![CDATA[ < ]]>#{param.end,jdbcType=TIMESTAMP}
             </if>
         </where>
-        AND RECORD_STATUS_ != 'ERROR'
         AND RECORD_STATUS_ != 'DEL'
         ORDER BY COMPLETE_TIME_ DESC
         LIMIT 1
@@ -171,7 +168,7 @@
             <if test="param.intelCard != null and param.plateNum != null">
                 AND ( INTEL_CARD_ = #{param.intelCard} OR PLATE_NUM_ = #{param.plateNum} )
             </if>
-            and PROGRESS_ &lt;&gt; 'RECORD' and RECORD_STATUS_ != 'DEL' and RECORD_STATUS_ != 'ERROR'
+            and PROGRESS_ &lt;&gt; 'RECORD' and RECORD_STATUS_ != 'DEL'
         </where>
     </select>
 
@@ -189,16 +186,16 @@
     <update id="inoutStop" parameterType="com.ld.igds.inout.dto.InoutParam">
         update D_INOUT_RECORD
         <set>
-            RECORD_STATUS_ ='ERROR',
             PROGRESS_ = 'RECORD',
+            <if test="param.recordStatus != null and param.recordStatus != '' ">RECORD_STATUS_ = #{param.recordStatus},</if>
             <if test="param.checkStatus != null and param.checkStatus != '' ">CHECK_STATUS_ = #{param.checkStatus},</if>
             <if test="param.msg != null and param.msg != '' ">REMARKS_ = concat(REMARKS_,#{param.msg})</if>
         </set>
-        <where>
-            <if test="param.companyId != null and param.companyId != '' ">COMPANY_ID_ = #{param.companyId}</if>
-            <if test="param.id != null and param.id != '' ">AND ID_ = #{param.id}</if>
-        </where>
 
+        <where>
+            COMPANY_ID_ = #{param.companyId},
+           AND ID_ = #{param.id}
+        </where>
     </update>
 
 
@@ -450,7 +447,16 @@
             <if test="param.checkStatus != null and param.checkStatus == 'NONE' ">AND CHECK_STATUS_ = 'NONE'</if>
 
         </where>
-        AND RECORD_STATUS_ != 'DEL'
+
+        <choose>
+            <when test="param.recordStatus != null and param.recordStatus == 'DEL' ">
+                AND RECORD_STATUS_ = 'DEL'
+            </when>
+            <otherwise>
+                AND RECORD_STATUS_ != 'DEL'
+            </otherwise>
+        </choose>
+
 
         <choose>
             <when test="param.orderTag != null and param.orderTag == 'ASC' ">
@@ -471,12 +477,11 @@
         set PROGRESS_ = #{param.progress},
         COMPLETE_TIME_ =#{param.completeTime},
         COMPLETE_USER_ = #{param.userId},
-        UPDATE_TIME_ = sysdate
+        UPDATE_TIME_ = #{param.updateTime}
         where ID_ = #{param.id}
         and TYPE_ = #{param.type}
         and COMPANY_ID_ = #{param.companyId}
         and RECORD_STATUS_ != 'DEL'
-        and RECORD_STATUS_ != 'ERROR'
     </update>
 
     <!-- 鏌ヨ娴佺▼鏈畬鎴愮殑娴佹按淇℃伅 -->
@@ -505,7 +510,6 @@
         AND RECORD_STATUS_ != 'DEL'
         AND PROGRESS_ != 'RECORD'
         AND PROGRESS_ != 'PAY'
-        AND RECORD_STATUS_ != 'ERROR'
     </select>
 
 
@@ -517,7 +521,6 @@
         where
         PROGRESS_ = 'RECORD'
         AND RECORD_STATUS_ != 'DEL'
-        AND RECORD_STATUS_ != 'ERROR'
         <if test="param.type != null and param.type != ''">AND TYPE_ = #{param.type}</if>
         <if test="param.companyId != null and param.companyId != ''">AND COMPANY_ID_ = #{param.companyId}</if>
         <if test="param.deptId != null and param.deptId != ''">AND DEPT_ID_ = #{param.deptId}</if>
@@ -542,7 +545,6 @@
         AND TYPE_ = #{param.type}
         AND (PLATE_NUM_ = #{param.plateNum} or INTEL_CARD_ = #{param.intelCard})
         AND PROGRESS_ != 'RECORD'
-        AND RECORD_STATUS_ != 'ERROR'
         AND RECORD_STATUS_ != 'DEL'
         <if test="param.start != null">
             AND REGISTER_TIME_  <![CDATA[ > ]]> #{param.start,jdbcType=TIMESTAMP}

--
Gitblit v1.9.3