瀏覽代碼

处理逻辑:调整审批界面业务编号、财务管理申请业务编号、收费付费业务编号显示数据接口,调整撤销审批流任务数据是删除审批流任务从表数据~

nzf 3 年之前
父節點
當前提交
fa41348d6a

+ 1 - 4
ruoyi-warehouse/src/main/java/com/ruoyi/approvalFlow/service/impl/AuditItemsServiceImpl.java

@@ -1,9 +1,6 @@
 package com.ruoyi.approvalFlow.service.impl;
 
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
+import java.util.*;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;

+ 19 - 9
ruoyi-warehouse/src/main/java/com/ruoyi/approvalFlow/service/impl/AuditPathsServiceImpl.java

@@ -292,12 +292,10 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
             List<Map<String,Object>> auditItemsDoList = auditItemsDoMapper.selectByFPid(Long.valueOf(map.get("id").toString()));
             StringBuilder stringBuilder = new StringBuilder();
             for (Map<String,Object> auditItemsDo : auditItemsDoList) {
-                if (StringUtils.isNotNull(auditItemsDo)) {
-                    // 装载获取到的业务编号数据
+                if (StringUtils.isNotNull(auditItemsDo)) { // 有数据
                     stringBuilder.append(auditItemsDo.get("fBsno")).append(",");
                 }
             }
-            // map中存入业务编号数据
             map.put("fBsno",StringUtils.removeTheLastComma(stringBuilder));
             // 将 map 数据重新放入 list 中
             list.add(map);
@@ -987,6 +985,8 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
             }
             tWarehouseBillsMapper.warehouseApprovalUpdate(auditItems, fettle);
             tWarehousebillsfeesMapper.warehouseFeesFollowUpdate(auditItems.getBillId(), fettle, auditItems.getAuditItem());
+            // 撤销审批时删除审批流任务明细从表对应数据
+            revokeDeleteAID(auditItems.getActId(),auditItems.getBillId());
         } else if (auditItems.getActId() >= 210 && auditItems.getActId() <= 230) {
             fettle = 2L;
             // 查询财务状态
@@ -1002,12 +1002,8 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return AjaxResult.error("审批撤销失败: 更新审批状态失败");
             }
-            // 根据审批流任务明细活动号 + 业务id 获取审批流任务明细从表数据
-            List<Map<String,Object>> itemsDos = auditItemsDoMapper.selectByActIdAndBillId(auditItems.getActId(),auditItems.getBillId());
-            for (Map<String,Object> map : itemsDos) {
-                // 删除审批流任务明细从表
-                auditItemsDoMapper.deleteById(Long.valueOf(map.get("fId").toString()));
-            }
+            // 撤销审批时删除审批流任务明细从表对应数据
+            revokeDeleteAID(auditItems.getActId(),auditItems.getBillId());
         } else if (auditItems.getActId() >= 310 && auditItems.getActId() <= 320) {
             fettle = 2L;
             // 查询协议状态
@@ -1193,6 +1189,20 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
     }
 
     /**
+     * 撤销审批时连带删除审批流任务明细从表对应数据
+     * @param actId 活动号
+     * @param billId 业务id
+     */
+    public void revokeDeleteAID(Long actId,Long billId) {
+        // 根据审批流任务明细活动号 + 业务id 获取审批流任务明细从表数据
+        List<Map<String,Object>> itemsDos = auditItemsDoMapper.selectByActIdAndBillId(actId,billId);
+        for (Map<String,Object> map : itemsDos) {
+            // 删除审批流任务明细从表
+            auditItemsDoMapper.deleteById(Long.valueOf(map.get("fId").toString()));
+        }
+    }
+
+    /**
      * 仓库APP查看订单审批流
      *
      * @param auditItems 条件

+ 13 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/finance/domain/TFeeDo.java

@@ -53,6 +53,11 @@ public class TFeeDo extends BaseEntity {
     private String fSrcBillno;
 
     /**
+     * 业务编号(用于接收前台传递的业务编号参数)
+     */
+    private String fBillno;
+
+    /**
      * 来源行号
      */
     @Excel(name = "来源行号")
@@ -152,6 +157,14 @@ public class TFeeDo extends BaseEntity {
      */
     private Integer updateMessage = 1;
 
+    public String getfBillno() {
+        return fBillno;
+    }
+
+    public void setfBillno(String fBillno) {
+        this.fBillno = fBillno;
+    }
+
     public Integer getUpdateMessage() {
         return updateMessage;
     }

+ 34 - 6
ruoyi-warehouse/src/main/java/com/ruoyi/finance/service/impl/TFeeServiceImpl.java

@@ -306,12 +306,36 @@ public class TFeeServiceImpl implements ITFeeService {
      */
     @Override
     public List<TFee> selectTFeeList(TFee tFee) {
-        return tFeeMapper.selectTFeeList(tFee);
+        List<TFee> list = tFeeMapper.selectTFeeList(tFee);
+        for (TFee tf : list) {
+            List<TFeeDo> fd = tFeeDoMapper.selectTFeeDoByfPid(tf.getfId());
+            StringBuilder strb = new StringBuilder();
+            for (TFeeDo tFeeDo : fd) {
+                if (StringUtils.isNotNull(tFeeDo.getfSrcBillno())) {
+                    strb.append(tFeeDo.getfSrcBillno()).append(",");
+                }
+            }
+            tf.setfSrcBillno(StringUtils.objToStr(StringUtils.removeTheLastComma(strb)));
+        }
+        return list;
     }
 
     @Override
     public List<Map<String, Object>> selectTFeeList1(TFee tFee) {
-        return tFeeMapper.selectTFeeList1(tFee);
+        List<Map<String,Object>> list = tFeeMapper.selectTFeeList1(tFee);
+        for (Map<String,Object> map : list) {
+            List<TFeeDo> tfd = tFeeDoMapper.selectTFeeDoByfPid(Long.valueOf(map.get("fId").toString()));
+            if (tfd.size()!=0) {
+                StringBuilder stringBuilder = new StringBuilder();
+                for (TFeeDo tFeeDo : tfd) {
+                    if (StringUtils.isNotNull(tFeeDo.getfSrcBillno())) {
+                        stringBuilder.append(tFeeDo.getfSrcBillno()).append(",");
+                    }
+                }
+                map.put("fSrcBillno",StringUtils.removeTheLastComma(stringBuilder));
+            }
+        }
+        return list;
     }
 
     @Override
@@ -411,6 +435,7 @@ public class TFeeServiceImpl implements ITFeeService {
                     tFeeDo.setfPid(fPid);
                     tFeeDo.setCreateBy(loginUser.getUser().getUserName());
                     tFeeDo.setCreateTime(new Date());
+                    tFeeDo.setfSrcBillno(tFeeDo.getfBillno());
                     tFeeDo.setfStatus("2");
                     tFeeDoMapper.insertTFeeDo(tFeeDo);
                 } else {
@@ -790,6 +815,7 @@ public class TFeeServiceImpl implements ITFeeService {
         // 删除从表
         tFeeDoMapper.deleteByFPid(tFee.getfId());
         messageMap.put("tFee", tFee);
+        // 声明业务编号 list
         List<String> fSrcBillnos = new ArrayList<>();
         //  财务从表
         if (StringUtils.isNotNull(tfeeDo) && !"[]".equals(tfeeDo)) {
@@ -805,13 +831,15 @@ public class TFeeServiceImpl implements ITFeeService {
                 tFeeDo.setCreateBy(loginUser.getUser().getUserName());
                 tFeeDo.setCreateTime(new Date());
                 tFeeDo.setfStatus(billstatus);
-                // 业务编号传递
-                fSrcBillnos.add(tFeeDo.getfSrcBillno());
                 tFeeDoMapper.insertTFeeDo(tFeeDo);
+                if (StringUtils.isNotNull(tFeeDo.getfSrcBillno())) { // 判断是否有来源单据编号(业务编号)
+                    // 装载业务编号传递
+                    fSrcBillnos.add(tFeeDo.getfSrcBillno());
+                }
             }
         }
         // 点击对账、收费、付费提交审核时去掉费用
-        if (actId >= 210 && actId <= 230) {
+        if (actId >= 210L && actId <= 230L) {
             AjaxResult ajaxResult = this.billsfeesFollow(tFee.getfId());
             String code = ajaxResult.get("code").toString();
             if ("500".equals(code)) {
@@ -850,7 +878,7 @@ public class TFeeServiceImpl implements ITFeeService {
             auditItems.setTimes(1L);// 第几次提交审批
             auditItems.setAuditMsg("提交");
             auditItems.setAuditStatus("O");// 提交状态
-            auditItems.setfSrcBillnos(fSrcBillnos);// 装载业务编号数据
+            auditItems.setfSrcBillnos(fSrcBillnos);// 装载业务编号数据(来源单据编号)
             AjaxResult approvalFlow = auditItemsService.createApprovalFlow(auditItems);// 生成审批流
             Long code = Long.valueOf(String.valueOf(approvalFlow.get("code"))).longValue();
             if (code.equals(500L)) {

+ 11 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseBillsServiceImpl.java

@@ -1539,6 +1539,10 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                 tEnclosureMapper.insertTEnclosure(enclosure);
             }
         }
+        // 声明业务编号 list
+        List<String> fSrcBillnos = new ArrayList<>();
+        // 装载业务编号传递
+        fSrcBillnos.add(warehouseBills.getfBillno());
         // 这里加个判断取系统参数来确定是否需要启用审批流
         if (isApprove) {
             AuditItems auditItems = new AuditItems();
@@ -1563,6 +1567,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             auditItems.setAuditStatus("O");
             auditItems.setFidStatus("f_billstatus");
             auditItems.setTimes(warehouseBills.getfTimes());
+            auditItems.setfSrcBillnos(fSrcBillnos);// 装载获取到的业务编号
             AjaxResult approvalFlow = auditItemsService.createApprovalFlow(auditItems);
 //            Long code = Long.valueOf(String.valueOf(approvalFlow.get("code"))).longValue();
             String code = approvalFlow.get("code").toString();
@@ -2628,6 +2633,11 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                 tEnclosureMapper.insertTEnclosure(enclosure);
             }
         }
+        // 创建业务编号 list
+        List<String> fSrcBillno = new ArrayList<>();
+        if (StringUtils.isNotNull(warehouseBills.getfBillno())){
+            fSrcBillno.add(warehouseBills.getfBillno());
+        }
         // 这里加个判断取系统参数来确定是否需要启用审批流
         if (isApprove) {
             AuditItems auditItems = new AuditItems();
@@ -2652,6 +2662,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             auditItems.setAuditStatus("O");
             auditItems.setFidStatus("warehouse_status");
             auditItems.setTimes(warehouseBills.getfTimes());
+            auditItems.setfSrcBillnos(fSrcBillno);// 加入业务编号数据
             AjaxResult approvalFlow = auditItemsService.createApprovalFlow(auditItems);
             String code = approvalFlow.get("code").toString();
             if ("500".equals(code)) {

+ 2 - 0
ruoyi-warehouse/src/main/resources/mapper/finance/TFeeMapper.xml

@@ -717,6 +717,7 @@
         w.f_id AS fSrcid,
         t.f_id AS fSrcpid,
         t.f_corpid AS fCorpid,
+        t.f_billno AS fBillno,
         c.f_name AS fName,
         c.f_id AS fId,
         c.f_name AS fFeesName,
@@ -2644,6 +2645,7 @@
             c.f_name AS fName,
             c.f_name AS fFeesName,
             t.f_bscorpno AS fBscorpno,
+            t.f_billno as fBillno,
             w.f_mblno AS fMblno,
             w.f_product_name AS fProductName,
             w.f_bsdate AS fBsdate,