lazhaoqian 4 роки тому
батько
коміт
be3a9d8a02

+ 10 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/mapper/TWarehousebillsfeesMapper.java

@@ -151,6 +151,16 @@ public interface TWarehousebillsfeesMapper extends BaseMapper<TWarehousebillsfee
     int anPinDeleteFeeUpdate(@Param("fIds") Long[] fIds, @Param("delFlag") String delFlag, @Param("updateBy") String updateBy, @Param("updateTime") Date updateTime);
 
     /**
+     * 删除从表数据
+     * @param fPid
+     * @param delFlag
+     * @param updateBy
+     * @param updateTime
+     * @return
+     */
+    int anPinDeleteFeeUpdateByfPid(@Param("fPid") Long[] fPid, @Param("delFlag") String delFlag, @Param("updateBy") String updateBy, @Param("updateTime") Date updateTime);
+
+    /**
      * 安品出入库统计
      * @param tWarehousebillsfees
      * @return

+ 9 - 1
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseBillsServiceImpl.java

@@ -1901,8 +1901,15 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
     }
 
     @Override
+    @Transactional
     public int anPinDeleteUpdate(Long[] fIds, LoginUser loginUser) {
-        return tWarehouseBillsMapper.anPinDeleteUpdate(fIds,"1",loginUser.getUser().getUserName(),new Date());
+        int i = 0;
+        i = tWarehouseBillsMapper.anPinDeleteUpdate(fIds,"1",loginUser.getUser().getUserName(),new Date());
+        i = tWarehousebillsfeesMapper.anPinDeleteFeeUpdateByfPid(fIds,"1",loginUser.getUser().getUserName(),new Date());
+        if (i == 0){
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+        }
+        return i;
     }
 
     @Override
@@ -1955,6 +1962,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                 warehousebillsfees.setUpdateBy(null);
                 warehousebillsfees.setUpdateTime(null);
                 warehousebillsfees.setfReviewDate(null);
+                warehousebillsfees.setfBilltype(tWarehousebills.getfBilltype());
                 i = tWarehousebillsfeesMapper.insertTWarehousebillsfees(warehousebillsfees);
             }
         }

+ 19 - 0
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsfeesMapper.xml

@@ -848,6 +848,19 @@
             #{fId}
         </foreach>
     </update>
+    <update id="anPinDeleteFeeUpdateByfPid">
+        update
+        t_warehousebillsfees
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where f_pid in
+        <foreach item="fId" collection="fPid" open="(" separator="," close=")">
+            #{fId}
+        </foreach>
+    </update>
     <select id="anPinTWarehousebillsfeesList" parameterType="TWarehousebillsfees"
             resultMap="TWarehousebillsfeesResult">
         select tw.f_id,
@@ -1032,6 +1045,7 @@
         AND std.dict_type = 'data_cost_attribute'
         <where>
             tw.del_flag = '0'
+            and ti.del_flag = '0'
             <if test="fBillstatus != null  and fBillstatus == 1">and tw.f_billstatus = 6</if>
             <if test="fBillstatus != null  and fBillstatus == 2">and tw.f_billstatus != 6</if>
             <if test="fCorpid != null ">and ti.f_corpid = #{fCorpid}</if>
@@ -1097,6 +1111,7 @@
         LEFT JOIN t_fees tf ON tw.f_feeid = tf.f_id
         WHERE
         tw.del_flag = '0'
+        AND tb.del_flag = '0'
         AND tw.f_billtype = 'XS'
         <if test="fBillstatus != null">and tw.f_billstatus = #{fBillstatus}</if>
         <if test="fGoodsid != null  and fGoodsid != ''">and tb.f_goodsid = #{fGoodsid}</if>
@@ -1164,6 +1179,7 @@
         WHERE
         tf.f_billtype = 'XS'
         AND tf.del_flag = '0'
+        AND tw.del_flag = '0'
         AND tf.f_billstatus = 6
         <if test="fGoodsid != null  and fGoodsid != ''">and tw.f_goodsid = #{fGoodsid}</if>
         <if test="fFeeType != null">and te.f_feetype = #{fFeeType}</if>
@@ -1195,6 +1211,7 @@
         WHERE
         tf.f_billtype = 'SQ'
         AND tf.del_flag = '0'
+        AND tw.del_flag = '0'
         AND tf.f_billstatus = 6
         <if test="fGoodsid != null  and fGoodsid != ''">and tw.f_goodsid = #{fGoodsid}</if>
         <if test="fFeeType != null">and te.f_feetype = #{fFeeType}</if>
@@ -1249,6 +1266,7 @@
         WHERE
         tf.f_billtype = 'SQ'
         AND tf.del_flag = '0'
+        AND tw.del_flag = '0'
         AND tf.f_billstatus = 6
         <if test="fGoodsid != null  and fGoodsid != ''">and tw.f_goodsid = #{fGoodsid}</if>
         <if test="fFeeType != null">and te.f_feetype = #{fFeeType}</if>
@@ -1280,6 +1298,7 @@
         WHERE
         tf.f_billtype = 'XS'
         AND tf.del_flag = '0'
+        AND tw.del_flag = '0'
         AND tf.f_billstatus = 6
         <if test="fGoodsid != null  and fGoodsid != ''">and tw.f_goodsid = #{fGoodsid}</if>
         <if test="fFeeType != null">and te.f_feetype = #{fFeeType}</if>

BIN
ruoyi-warehouse/target/classes/com/ruoyi/warehouseBusiness/mapper/TWarehousebillsfeesMapper.class


BIN
ruoyi-warehouse/target/classes/com/ruoyi/warehouseBusiness/service/impl/TWarehouseBillsServiceImpl.class


+ 19 - 0
ruoyi-warehouse/target/classes/mapper/warehouseBusiness/TWarehousebillsfeesMapper.xml

@@ -848,6 +848,19 @@
             #{fId}
         </foreach>
     </update>
+    <update id="anPinDeleteFeeUpdateByfPid">
+        update
+        t_warehousebillsfees
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where f_pid in
+        <foreach item="fId" collection="fPid" open="(" separator="," close=")">
+            #{fId}
+        </foreach>
+    </update>
     <select id="anPinTWarehousebillsfeesList" parameterType="TWarehousebillsfees"
             resultMap="TWarehousebillsfeesResult">
         select tw.f_id,
@@ -1032,6 +1045,7 @@
         AND std.dict_type = 'data_cost_attribute'
         <where>
             tw.del_flag = '0'
+            and ti.del_flag = '0'
             <if test="fBillstatus != null  and fBillstatus == 1">and tw.f_billstatus = 6</if>
             <if test="fBillstatus != null  and fBillstatus == 2">and tw.f_billstatus != 6</if>
             <if test="fCorpid != null ">and ti.f_corpid = #{fCorpid}</if>
@@ -1097,6 +1111,7 @@
         LEFT JOIN t_fees tf ON tw.f_feeid = tf.f_id
         WHERE
         tw.del_flag = '0'
+        AND tb.del_flag = '0'
         AND tw.f_billtype = 'XS'
         <if test="fBillstatus != null">and tw.f_billstatus = #{fBillstatus}</if>
         <if test="fGoodsid != null  and fGoodsid != ''">and tb.f_goodsid = #{fGoodsid}</if>
@@ -1164,6 +1179,7 @@
         WHERE
         tf.f_billtype = 'XS'
         AND tf.del_flag = '0'
+        AND tw.del_flag = '0'
         AND tf.f_billstatus = 6
         <if test="fGoodsid != null  and fGoodsid != ''">and tw.f_goodsid = #{fGoodsid}</if>
         <if test="fFeeType != null">and te.f_feetype = #{fFeeType}</if>
@@ -1195,6 +1211,7 @@
         WHERE
         tf.f_billtype = 'SQ'
         AND tf.del_flag = '0'
+        AND tw.del_flag = '0'
         AND tf.f_billstatus = 6
         <if test="fGoodsid != null  and fGoodsid != ''">and tw.f_goodsid = #{fGoodsid}</if>
         <if test="fFeeType != null">and te.f_feetype = #{fFeeType}</if>
@@ -1249,6 +1266,7 @@
         WHERE
         tf.f_billtype = 'SQ'
         AND tf.del_flag = '0'
+        AND tw.del_flag = '0'
         AND tf.f_billstatus = 6
         <if test="fGoodsid != null  and fGoodsid != ''">and tw.f_goodsid = #{fGoodsid}</if>
         <if test="fFeeType != null">and te.f_feetype = #{fFeeType}</if>
@@ -1280,6 +1298,7 @@
         WHERE
         tf.f_billtype = 'XS'
         AND tf.del_flag = '0'
+        AND tw.del_flag = '0'
         AND tf.f_billstatus = 6
         <if test="fGoodsid != null  and fGoodsid != ''">and tw.f_goodsid = #{fGoodsid}</if>
         <if test="fFeeType != null">and te.f_feetype = #{fFeeType}</if>