Ver código fonte

凯和财务逻辑修改

lazhaoqian 3 anos atrás
pai
commit
ecf7ed70bb

+ 28 - 2
ruoyi-warehouse/src/main/java/com/ruoyi/approvalFlow/service/impl/AuditPathsServiceImpl.java

@@ -466,12 +466,12 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
                         if ("T".equals(at.getIffinalItem())) {
                             fettle = 6L;
                             // 更新费用明细
-                            AjaxResult ajaxResult = tFeeServiceImpl.billsfeesFollow(auditItems.getBillId());
+                            /*AjaxResult ajaxResult = tFeeServiceImpl.billsfeesFollow(auditItems.getBillId());
                             String code = ajaxResult.get("code").toString();
                             if ("500".equals(code)) {
                                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                                 return ajaxResult;
-                            }
+                            }*/
                         } else if ("F".equals(at.getIffinalItem())) {
                             fettle = 5L;
                         }
@@ -764,6 +764,12 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
             }
         } else if (auditItems.getActId() >= 430 && auditItems.getActId() <= 450) {
             fettle = 3L;
+            String fBillType = null;
+            if (auditItems.getActId() == 450 || auditItems.getActId() == 440){
+                fBillType = "DCRevoke";
+            }else if (auditItems.getActId() == 430){
+                fBillType = "KHDZRevoke";
+            }
             // 财务模块
             AjaxResult ajaxResult = tFeeServiceImpl.tfeeFollow(auditItems.getBillId(), fettle);
             String code = ajaxResult.get("code").toString();
@@ -771,6 +777,13 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return ajaxResult;
             }
+            // 更新费用明细
+            AjaxResult result = tFeeServiceImpl.updateMoney(auditItems.getBillId(),fBillType);
+            String message = result.get("code").toString();
+            if ("500".equals(message)) {
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                return result;
+            }
         } else if (auditItems.getActId() == 460) {
             fettle = 3L;
             Integer i = tWarehousebillsfeesMapper.warehouseFeesFollowUpdate(auditItems.getBillId(), fettle, auditItems.getAuditItem());
@@ -1000,6 +1013,12 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
             }
         } else if (auditItems.getActId() >= 430 && auditItems.getActId() <= 450) {
             fettle = 2L;
+            String fBillType = null;
+            if (auditItems.getActId() == 450 || auditItems.getActId() == 440){
+                fBillType = "DCRevoke";
+            }else if (auditItems.getActId() == 430){
+                fBillType = "KHDZRevoke";
+            }
             // 查询财务状态
             TFee tFee = tFeeMapper.selectTFeeById(auditItems.getBillId());
             if (!"4".equals(tFee.getfBillstatus())) {
@@ -1013,6 +1032,13 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return AjaxResult.error("审批撤销失败: 更新审批状态失败");
             }
+            // 更新费用明细
+            AjaxResult result = tFeeServiceImpl.updateMoney(auditItems.getBillId(),fBillType);
+            String message = result.get("code").toString();
+            if ("500".equals(message)) {
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                return result;
+            }
             /*//修改主订单费用信息
             if (auditItems.getActId() >= 440 && auditItems.getActId() <= 450) {
                 tWarehouseBillsService.updateMessage(auditItems.getBillId());

+ 41 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/finance/service/impl/TFeeServiceImpl.java

@@ -798,6 +798,15 @@ public class TFeeServiceImpl implements ITFeeService {
                 tFeeDoMapper.insertTFeeDo(tFeeDo);
             }
         }
+        //凯和收费提交审核时去掉钱
+        if (actId >= 430 && actId <= 450){
+            AjaxResult ajaxResult = this.billsfeesFollow(tFee.getfId());
+            String code = ajaxResult.get("code").toString();
+            if ("500".equals(code)) {
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                return ajaxResult;
+            }
+        }
         // 这里加个判断取系统参数来确定是否需要启用审批流
 
         if (isApprove) {
@@ -1172,6 +1181,38 @@ public class TFeeServiceImpl implements ITFeeService {
         return AjaxResult.success();
     }
 
+    /**
+     * 凯和撤销收费 付费 对账
+     * @param fPid
+     * @param fBillType
+     * @return
+     */
+    @Transactional
+    public  AjaxResult updateMoney(Long fPid,String fBillType) {
+        if (StringUtils.isNull(fPid)) {
+            return AjaxResult.error("费用明细更新状态未找到主表信息,请与管理员联系");
+        }
+        TFee tFee = tFeeMapper.selectTFeeById(fPid);
+        // 查询从表数据
+        TFeeDo tFeeDo = new TFeeDo();
+        tFeeDo.setfPid(fPid);
+        List<TFeeDo> tFeeDoList = tFeeDoMapper.selectTFeeDoList(tFeeDo);
+        for (TFeeDo tFeeDo1 : tFeeDoList) {
+         /*   // 跟新费用明细
+            Map<String, Object> map = this.judgeMoney(tFeeDo1.getfSrcid(), tFeeDo1.getfAmt(), tFee.getfBilltype(), tFeeDo1.getfFeeid());
+            if (!(Boolean) map.get("flag")) {
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                return AjaxResult.error(map.get("message").toString());
+            }*/
+            int m = updateBillsFees(fPid, tFeeDo1, fBillType);
+            if (m == 0) {
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                return AjaxResult.error("更新费用明细失败");
+            }
+        }
+        return AjaxResult.success();
+    }
+
     @Override
     @Transactional
     public AjaxResult revoke(String tfee, String tfeeDo, LoginUser loginUser, String fBilltype) {

+ 2 - 2
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsMapper.xml

@@ -2958,10 +2958,10 @@
                     <if test="fVoyid != null ">and tw.f_voyid = #{fVoyid}</if>
                     <if test="createBy != null  and createBy != ''">and tw.create_by = #{createBy}</if>
                     <if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
-                        and tw.f_bsdate &gt;= #{cLoadDate[0]}
+                        and tw.create_time &gt;= #{cLoadDate[0]}
                     </if>
                     <if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
-                        and tw.f_bsdate &lt;= #{cLoadDate[1]}
+                        and tw.create_time &lt;= #{cLoadDate[1]}
                     </if>
                     <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
                         and ty.f_ATD &gt;= #{timeInterval[0]}