Browse Source

[CODE]: 修改财务从表、协议从表状态

maxianghua 4 years ago
parent
commit
68b7ce8f97

+ 10 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/finance/mapper/TFeeDoMapper.java

@@ -1,6 +1,7 @@
 package com.ruoyi.finance.mapper;
 
 import com.ruoyi.finance.domain.TFeeDo;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -60,4 +61,13 @@ public interface TFeeDoMapper {
     public int deleteTFeeDoByIds(Long[] fIds);
 
     int deleteByFPid(Long fId);
+
+    /**
+     *  根据主表id 更新主表对应状态
+     *
+     * @param fettle 对应状态
+     * @param fPid 主表id
+     * @return  结果
+     */
+    int tfeeDoFollowUpdate(@Param("fPid") Long fPid, @Param("fettle") Long fettle);
 }

+ 1 - 4
ruoyi-warehouse/src/main/java/com/ruoyi/finance/service/impl/TFeeServiceImpl.java

@@ -417,10 +417,7 @@ public class TFeeServiceImpl implements ITFeeService {
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
             return AjaxResult.error("更新财务明细状态失败,请联系管理员");
         }
-        TFeeDo tFeeDo =new TFeeDo();
-        tFeeDo.setfId(fPid);
-        tFeeDo.setfStatus(String.valueOf(fettle));
-        int itemUpdateResult = tFeeDoMapper.updateTFeeDo(tFeeDo);
+        int itemUpdateResult = tFeeDoMapper.tfeeDoFollowUpdate(fPid,fettle);
         if (itemUpdateResult <= 0) {
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
             return AjaxResult.error("更新财务明细状态失败,请联系管理员");

+ 9 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/mapper/TWarehouseAgreementitemsMapper.java

@@ -75,4 +75,13 @@ public interface TWarehouseAgreementitemsMapper {
     List<TWarehouseAgreementitems> getItemsBytWarehouseAgreementMsg(@Param("fCorpid") Long fCorpid,
                                                                     @Param("fGoodsid") Long fGoodsid,
                                                                     @Param("feeUnitid") Long feeUnitid);
+
+    /**
+     *  根据主表id 更新主表对应状态
+     *
+     * @param fettle 对应状态
+     * @param fPid 主表id
+     * @return  结果
+     */
+    int agreementitemsFollowUpdate(@Param("fPid") Long fPid, @Param("fettle") Long fettle);
 }

+ 1 - 4
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseAgreementServiceImpl.java

@@ -325,10 +325,7 @@ public class TWarehouseAgreementServiceImpl implements ITWarehouseAgreementServi
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
             return AjaxResult.error("更新协议明细状态失败,请联系管理员");
         }
-        TWarehouseAgreementitems tWarehouseAgreementitems = new TWarehouseAgreementitems();
-        tWarehouseAgreementitems.setfId(fPid);
-        tWarehouseAgreementitems.setfStatus(String.valueOf(fettle));
-        int itemUpdateResult = tWarehouseAgreementitemsMapper.updateTWarehouseAgreementitems(tWarehouseAgreementitems);
+        int itemUpdateResult = tWarehouseAgreementitemsMapper.agreementitemsFollowUpdate(fPid,fettle);
         if (itemUpdateResult <= 0) {
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
             return AjaxResult.error("更新协议明细状态失败,请联系管理员");

+ 8 - 0
ruoyi-warehouse/src/main/resources/mapper/finance/TFeeDoMapper.xml

@@ -127,4 +127,12 @@
         delete from t_fee_do where f_pid = #{fId}
     </delete>
 
+    <update id="tfeeDoFollowUpdate" parameterType="Long">
+        update
+            t_fee_do
+        set f_status = #{fettle}
+        where
+            f_pid = #{fPid}
+    </update>
+
 </mapper>

+ 8 - 0
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehouseAgreementitemsMapper.xml

@@ -209,4 +209,12 @@
         delete from t_warehouse_agreementitems where f_pid = #{fId}
     </delete>
 
+    <update id="agreementitemsFollowUpdate" parameterType="Long">
+        update
+            t_warehouse_agreementitems
+        set f_status = #{fettle}
+        where
+            f_pid = #{fPid}
+    </update>
+
 </mapper>