瀏覽代碼

20230413 17:45

wangzhuo 2 年之前
父節點
當前提交
764f07735a

+ 36 - 0
ruoyi-anpin/src/main/java/com/ruoyi/anpin/domain/TCostManagement.java

@@ -77,6 +77,18 @@ public class TCostManagement extends BaseEntity
     @Excel(name = "金额合计")
     private BigDecimal totalAmount;
 
+    /** 户头 */
+    @Excel(name = "户头")
+    private String account;
+
+    /** 开户行 */
+    @Excel(name = "开户行")
+    private String openingBank;
+
+    /** 账号 */
+    @Excel(name = "账号")
+    private String openingBankAccount;
+
     /**
      * 查询业务日期区间
      */
@@ -102,6 +114,30 @@ public class TCostManagement extends BaseEntity
      */
     private Long itemExpenseId;
 
+    public String getAccount() {
+        return account;
+    }
+
+    public void setAccount(String account) {
+        this.account = account;
+    }
+
+    public String getOpeningBank() {
+        return openingBank;
+    }
+
+    public void setOpeningBank(String openingBank) {
+        this.openingBank = openingBank;
+    }
+
+    public String getOpeningBankAccount() {
+        return openingBankAccount;
+    }
+
+    public void setOpeningBankAccount(String openingBankAccount) {
+        this.openingBankAccount = openingBankAccount;
+    }
+
     public String getBusinessTypeName() {
         return businessTypeName;
     }

+ 47 - 13
ruoyi-anpin/src/main/java/com/ruoyi/anpin/service/impl/TCostManagementServiceImpl.java

@@ -252,7 +252,7 @@ public class TCostManagementServiceImpl implements ITCostManagementService
         boolean isApprove = false;//是否开启审批流
         String key = "";//键
         long actId = 0L;//活动id
-        Long billStatus = null;
+        String billStatus = null;
         Integer i = null;
         Map<String, Object> map = new HashMap<>();
         if ("FYGL".equals(billType)) {
@@ -268,42 +268,65 @@ public class TCostManagementServiceImpl implements ITCostManagementService
             isApprove = true;
         }
         if (isApprove) {
-            billStatus = 1L;
+            billStatus = "1";
         } else {
-            billStatus = 3L;
+            billStatus = "4";
         }
         TCostManagement detailed = JSONArray.parseObject(tCostManagement, TCostManagement.class);
 
+        if (ObjectUtils.isEmpty(detailed.getDeptId())){
+            return AjaxResult.error("部门不能为空");
+        }
+        detailed.setDeptName(sysDeptMapper.selectDeptById(detailed.getDeptId()).getDeptName());//部门名称
+        detailed.setfStatus(billStatus);
         //保存主表信息
         if (StringUtils.isNull(detailed.getfId())) {// 如果是新数据
             // 业务编码
             String billNo = billnoSerialServiceImpl.getBillNo("FY", new Date());
             detailed.setfNo(billNo);
+            detailed.setCreateById(loginUser.getUser().getUserId());
             detailed.setCreateBy(loginUser.getUser().getUserName());
             detailed.setCreateTime(new Date());
             detailed.setCreateDept(String.valueOf(loginUser.getUser().getDeptId()));
-            tCostManagementMapper.insertTCostManagement(detailed);
+            detailed.setCreateDeptName(sysDeptMapper.selectDeptById(loginUser.getUser().getDeptId()).getDeptName());
+            i = tCostManagementMapper.insertTCostManagement(detailed);
         } else {
             detailed.setUpdateBy(loginUser.getUser().getUserName());
             detailed.setUpdateTime(new Date());
-            tCostManagementMapper.updateTCostManagement(detailed);
+            i = tCostManagementMapper.updateTCostManagement(detailed);
         }
         //获得明细信息并保存
         List<TCostManagementItem> itemList = new ArrayList<>();
         if (StringUtils.isNotNull(tCostManagementItem) && !"[]".equals(tCostManagementItem)) {
             JSONArray jsonDrArray = JSONArray.parseArray(tCostManagementItem);
             itemList = JSONObject.parseArray(jsonDrArray.toJSONString(), TCostManagementItem.class);
-
             for (TCostManagementItem item : itemList) {
+                if (ObjectUtils.isEmpty(item.getPersonnelId())){
+                    return AjaxResult.error("所属人员不能为空");
+                }else {
+                    item.setPersonnelName(userMapper.selectUserById(item.getPersonnelId()).getNickName());
+                }
+                if (ObjectUtils.isEmpty(item.getDepartmentId())){
+                    return AjaxResult.error("所属部门不能为空");
+                }
+                item.setDepartmentName(sysDeptMapper.selectDeptById(item.getDepartmentId()).getDeptName());//所属部门名称
+                if (ObjectUtils.isNotEmpty(item.getExpenseId())){//费用名称
+                    item.setExpenseName(tFeesMapper.selectTFeesById(item.getExpenseId()).getfName());
+                }
+                if (ObjectUtils.isNotEmpty(item.getBelongsProjectId())){//项目名称
+                    item.setBelongsProjectName(tCorpsMapper.selectTCorpsById(item.getBelongsProjectId()).getfName());
+                }
+
                 if (StringUtils.isNull(item.getfId())) {// 如果是新数据
+                    item.setfPid(detailed.getfId());
                     item.setCreateBy(loginUser.getUser().getUserName());
                     item.setCreateTime(new Date());
                     item.setCreateDept(String.valueOf(loginUser.getUser().getDeptId()));
-                    tCostManagementItemMapper.insertTCostManagementItem(item);
+                    i = tCostManagementItemMapper.insertTCostManagementItem(item);
                 } else {
                     item.setUpdateBy(loginUser.getUser().getUserName());
                     item.setUpdateTime(new Date());
-                    tCostManagementItemMapper.updateTCostManagementItem(item);
+                    i = tCostManagementItemMapper.updateTCostManagementItem(item);
                 }
             }
         }
@@ -320,14 +343,17 @@ public class TCostManagementServiceImpl implements ITCostManagementService
                     enclosure.setfLineno(lineNo);
                     enclosure.setCreateTime(new Date());
                     enclosure.setCreateBy(loginUser.getUser().getUserName());
-                    tEnclosureMapper.insertTEnclosure(enclosure);
+                    enclosure.setfMainType("CostManagement");
+                    i = tEnclosureMapper.insertTEnclosure(enclosure);
                 } else {
                     enclosure.setUpdateBy(loginUser.getUser().getUserName());
                     enclosure.setUpdateTime(new Date());
-                    tEnclosureMapper.updateTEnclosure(enclosure);
+                    enclosure.setfMainType("CostManagement");
+                    i = tEnclosureMapper.updateTEnclosure(enclosure);
                 }
             }
         }
+
         if (isApprove) {
             AuditItems auditItems = new AuditItems();
             auditItems.setLevelId(0L);
@@ -347,9 +373,8 @@ public class TCostManagementServiceImpl implements ITCostManagementService
             auditItems.setAuditMsg("提交");
             auditItems.setAuditStatus("O");
             AjaxResult approvalFlow = auditItemsService.createApprovalFlow(auditItems);
-//            Long code = Long.valueOf(String.valueOf(approvalFlow.get("code"))).longValue();
+
             String code = approvalFlow.get("code").toString();
-//                Long code = Long.valueOf(String.valueOf(ajaxResult.get("code"))).longValue();
             if ("500".equals(code)) {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
             }
@@ -359,7 +384,16 @@ public class TCostManagementServiceImpl implements ITCostManagementService
         map.put("tCostManagementItem", itemList);
         map.put("tEnclosure", enclosuresList);
 
-        return null;
+        if (i != null && i > 0) {
+            return AjaxResult.success("success", map);
+        } else {
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+            String error = null;
+            if (detailed.getfId() == null) {
+                error = "费用管理请核失败,请联系管理员";
+            }
+            return AjaxResult.error(error);
+        }
     }
 
     /**

+ 14 - 2
ruoyi-anpin/src/main/resources/mapper/anpin/TCostManagementMapper.xml

@@ -23,11 +23,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="expenseType"    column="expense_type"    />
         <result property="totalAmount"    column="total_amount"    />
         <result property="createById"    column="create_by_id"    />
+        <result property="account"    column="account"    />
+        <result property="openingBank"    column="opening_bank"    />
+        <result property="openingBankAccount"    column="opening_bank_account"    />
     </resultMap>
 
     <sql id="selectTCostManagementVo">
         select f_id, f_no, create_by, create_time, update_by, update_time, remark, del_flag, f_status, dept_id, dept_name,
-               create_dept, create_dept_name, business_time, business_type, expense_type, total_amount, create_by_id
+               create_dept, create_dept_name, business_time, business_type, expense_type, total_amount, create_by_id, account, opening_bank, opening_bank_account
         from t_cost_management
     </sql>
 
@@ -92,7 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectTCostManagementById" parameterType="Long" resultMap="TCostManagementResult">
         select TCM.f_id, TCM.f_no, TCM.create_by, TCM.create_time, TCM.update_by, TCM.update_time, TCM.remark, TCM.del_flag, TCM.f_status, TCM.dept_id, TCM.dept_name,
         TCM.create_dept, TCM.create_dept_name, TCM.business_time, TCM.business_type, TCM.expense_type, TCM.total_amount,
-        TCM.create_by_id,pro.dict_label AS businessTypeName, sd.dict_label AS expenseTypeName
+        TCM.create_by_id,pro.dict_label AS businessTypeName, sd.dict_label AS expenseTypeName, TCM.account, TCM.opening_bank, TCM.opening_bank_account
         from t_cost_management TCM
         LEFT JOIN sys_dict_data pro ON pro.dict_value = TCM.business_type AND pro.dict_type = 'expense_business_type'
         LEFT JOIN sys_dict_data sd ON sd.dict_value = TCM.expense_type AND sd.dict_type = 'reimbursement_method'
@@ -122,6 +125,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="totalAmount != null">total_amount,</if>
             <if test="createDeptName != null">create_dept_name,</if>
             <if test="createById != null">create_by_id,</if>
+            <if test="account != null">account,</if>
+            <if test="openingBank != null">opening_bank,</if>
+            <if test="openingBankAccount != null">opening_bank_account,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="fNo != null">#{fNo},</if>
@@ -141,6 +147,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="totalAmount != null">#{totalAmount},</if>
             <if test="createDeptName != null">#{createDeptName},</if>
             <if test="createById != null">#{createById},</if>
+            <if test="account != null">#{account},</if>
+            <if test="openingBank != null">#{openingBank},</if>
+            <if test="openingBankAccount != null">#{openingBankAccount},</if>
          </trim>
     </insert>
 
@@ -163,6 +172,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="expenseType != null">expense_type = #{expenseType},</if>
             <if test="totalAmount != null">total_amount = #{totalAmount},</if>
             <if test="createById != null">create_by_id = #{createById},</if>
+            <if test="account != null">account = #{account},</if>
+            <if test="openingBank != null">opening_bank = #{openingBank},</if>
+            <if test="openingBankAccount != null">opening_bank_account = #{openingBankAccount},</if>
         </trim>
         where f_id = #{fId}
     </update>

+ 1 - 1
ruoyi-warehouse/src/main/java/com/ruoyi/approvalFlow/service/IAuditPathsService.java

@@ -76,7 +76,7 @@ public interface IAuditPathsService {
      * @param auditItems 条件
      * @return 结果
      */
-    AjaxResult projectEndQueryPendingVal(AuditItems auditItems);
+    AjaxResult  projectEndQueryPendingVal(AuditItems auditItems);
 
     /**
      *  查询首页待审人员

+ 39 - 3
ruoyi-warehouse/src/main/java/com/ruoyi/approvalFlow/service/impl/AuditPathsServiceImpl.java

@@ -283,7 +283,11 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
         }else if (auditItems.getActId() >= 510 && auditItems.getActId() <= 550 ){
             List<Map<String, Object>> mapList = auditItemsMapper.selectWarehouseApprover(auditItems);
             return AjaxResult.success(mapList);
+        }else if (auditItems.getActId() == 560){
+            List<Map<String, Object>> mapList = auditItemsMapper.selectWarehouseApprover(auditItems);
+            return AjaxResult.success(mapList);
         }
+
         return AjaxResult.success();
     }
 
@@ -537,7 +541,21 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
                             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                             return ajaxResult;
                         }
-                    } else if (auditItems.getActId() >= 520 && auditItems.getActId() <= 550) {
+                    } else if (auditItems.getActId()== 560 ){//费用管理审核通过
+                        String status = "";
+                        if ("T".equals(at.getIffinalItem())) {
+                            status = "4";
+                        } else if ("F".equals(at.getIffinalItem())) {
+                            status = "2";
+                        }
+                        //变更费用管理审核状态
+                        AjaxResult ajaxResult = tWarehouseBillsService.updateCostMessage(auditItems.getBillId(), status);
+                        String string = ajaxResult.get("code").toString();
+                        if ("500".equals(string)) {
+                            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                            return ajaxResult;
+                        }
+                    }else if (auditItems.getActId() >= 520 && auditItems.getActId() <= 550) {
                         if ("T".equals(at.getIffinalItem())) {
                             fettle = 6L;
                         } else if ("F".equals(at.getIffinalItem())) {
@@ -683,7 +701,16 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return ajaxResult;
             }
-        } else if (auditItems.getActId() >= 520 && auditItems.getActId() <= 550) {
+        }else if (auditItems.getActId()== 560L ){//费用管理驳回
+            String status = "0";
+            //变更费用管理审核状态
+            AjaxResult ajaxResult = tWarehouseBillsService.updateCostMessage(auditItems.getBillId(), status);
+            String string = ajaxResult.get("code").toString();
+            if ("500".equals(string)) {
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                return ajaxResult;
+            }
+        }else if (auditItems.getActId() >= 520 && auditItems.getActId() <= 550) {
             fettle = 3L;
             //变更入库审核状态
             Integer i = null;
@@ -715,7 +742,7 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
                     } else {
                         at.setAuditMsg(auditItems.getAuditMsg());
                     }
-                    //at.setAuditItem(new Date());
+                    at.setAuditItem(new Date());
                     at.setAuditOpTime(new Date());
                     at.setAuditUserId(au.getUserId());
                     int updateAuditItems = auditItemsMapper.updateAuditItems(at);
@@ -884,6 +911,15 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return AjaxResult.error("审核通过失败,请找管理员");
             }
+        }else if (auditItems.getActId()== 560L ){//费用管理撤销审批
+            String status = "0";
+            //变更费用管理审核状态
+            AjaxResult ajaxResult = tWarehouseBillsService.updateCostMessage(auditItems.getBillId(), status);
+            String string = ajaxResult.get("code").toString();
+            if ("500".equals(string)) {
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                return ajaxResult;
+            }
         }
         AuditItems item = new AuditItems();
         item.setBillId(auditItems.getId());

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

@@ -209,6 +209,15 @@ public interface TWarehouseBillsMapper extends BaseMapper<TWarehouseBills> {
     public int updateTProjectAudit(@Param("fId")Long fId,
                                    @Param("fBillstatus")Long fBillstatus,
                                    @Param("fAuditTime") Date fAuditTime);
+
+    /**
+     * 更新费用管理审核信息
+     * @param fId
+     * @param fBillstatus
+     * @return
+     */
+    public int updateCostMessage(@Param("fId")Long fId,
+                                   @Param("fBillstatus")String fBillstatus);
     /**
      * 更新项目审核信息
      * @param fPid

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

@@ -4620,6 +4620,24 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             return AjaxResult.error("更新项目审核状态失败请找管理员");
         }
     }
+
+    /**
+     * 更新费用管理审核信息
+     * @param fid
+     * @param fBillstatus
+     * @return
+     */
+    @Transactional
+    public AjaxResult updateCostMessage(Long fid, String fBillstatus){
+        Integer i = null;
+        i = tWarehouseBillsMapper.updateCostMessage(fid, fBillstatus);
+        if (i != null && i>0){
+            return AjaxResult.success();
+        }else {
+            return AjaxResult.error("更新费用管理审核状态失败请联系管理员");
+        }
+    }
+
     /**
      * 新增库存总账
      *

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

@@ -2640,6 +2640,13 @@
         <if test="fBillstatus != null and fBillstatus != 6">,f_audit_time = null</if>
         where f_id = #{fId}
     </update>
+
+    <update id="updateCostMessage">
+        update t_cost_management
+        set f_status = #{fBillstatus}
+        where f_id = #{fId}
+    </update>
+
     <update id="updateTProjectItemsAudit" parameterType="String">
         update t_project_items
         set f_billstatus = #{fBillstatus}

二進制
ruoyi-warehouse/target/classes/com/ruoyi/approvalFlow/service/impl/AuditPathsServiceImpl.class


二進制
ruoyi-warehouse/target/classes/com/ruoyi/warehouseBusiness/mapper/TWarehouseBillsMapper.class


二進制
ruoyi-warehouse/target/classes/com/ruoyi/warehouseBusiness/service/impl/TWarehouseBillsServiceImpl.class


+ 7 - 0
ruoyi-warehouse/target/classes/mapper/warehouseBusiness/TWarehousebillsMapper.xml

@@ -2640,6 +2640,13 @@
         <if test="fBillstatus != null and fBillstatus != 6">,f_audit_time = null</if>
         where f_id = #{fId}
     </update>
+
+    <update id="updateCostMessage">
+        update t_cost_management
+        set f_status = #{fBillstatus}
+        where f_id = #{fId}
+    </update>
+
     <update id="updateTProjectItemsAudit" parameterType="String">
         update t_project_items
         set f_billstatus = #{fBillstatus}