wangzhuo пре 2 година
родитељ
комит
f690b26f3b

+ 0 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/cost/TCostManagementController.java

@@ -116,7 +116,6 @@ public class TCostManagementController extends BaseController
      * @param tEnclosure
      * @return
      */
-    @PreAuthorize("@ss.hasPermi('anpin:management:submitCostManagement')")
     @Log(title = "费用管理审批", businessType = BusinessType.INSERT)
     @PostMapping("/submitCostManagement")
     public AjaxResult submitCostManagement(@RequestParam("tCostManagement") String tCostManagement,

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

@@ -38,6 +38,11 @@ public class TCostManagement extends BaseEntity
     @Excel(name = "状态")
     private String fStatus;
 
+    /**
+     * 审核状态
+     */
+    private Integer fBillstatus;
+
     /** 部门id */
     @Excel(name = "部门id")
     private Long deptId;
@@ -89,6 +94,54 @@ public class TCostManagement extends BaseEntity
     @Excel(name = "账号")
     private String openingBankAccount;
 
+    /** 申请人id */
+    @Excel(name = "申请人id")
+    private Long applicantId;
+
+    /** 申请人名称 */
+    @Excel(name = "申请人名称")
+    private String applicantName;
+
+    /** 审核时间 */
+    @Excel(name = "审核时间")
+    private Date fReviewDate;
+
+    /** 状态名称 */
+    @Excel(name = "状态名称")
+    private String fStatusName;
+
+    public Long getApplicantId() {
+        return applicantId;
+    }
+
+    public void setApplicantId(Long applicantId) {
+        this.applicantId = applicantId;
+    }
+
+    public Date getfReviewDate() {
+        return fReviewDate;
+    }
+
+    public void setfReviewDate(Date fReviewDate) {
+        this.fReviewDate = fReviewDate;
+    }
+
+    public String getfStatusName() {
+        return fStatusName;
+    }
+
+    public void setfStatusName(String fStatusName) {
+        this.fStatusName = fStatusName;
+    }
+
+    public String getApplicantName() {
+        return applicantName;
+    }
+
+    public void setApplicantName(String applicantName) {
+        this.applicantName = applicantName;
+    }
+
     /**
      * 查询业务日期区间
      */
@@ -114,6 +167,14 @@ public class TCostManagement extends BaseEntity
      */
     private Long itemExpenseId;
 
+    public Integer getfBillstatus() {
+        return fBillstatus;
+    }
+
+    public void setfBillstatus(Integer fBillstatus) {
+        this.fBillstatus = fBillstatus;
+    }
+
     public String getAccount() {
         return account;
     }

+ 5 - 0
ruoyi-anpin/src/main/java/com/ruoyi/anpin/service/impl/TCostManagementServiceImpl.java

@@ -279,6 +279,10 @@ public class TCostManagementServiceImpl implements ITCostManagementService
         }
         detailed.setDeptName(sysDeptMapper.selectDeptById(detailed.getDeptId()).getDeptName());//部门名称
         detailed.setfStatus(billStatus);
+        detailed.setfBillstatus(5);
+        detailed.setApplicantId(loginUser.getUser().getUserId());
+        detailed.setApplicantName(loginUser.getUser().getUserName());
+        detailed.setfReviewDate(new Date());
         //保存主表信息
         if (StringUtils.isNull(detailed.getfId())) {// 如果是新数据
             // 业务编码
@@ -362,6 +366,7 @@ public class TCostManagementServiceImpl implements ITCostManagementService
             auditItems.setIffinalItem("F");
             auditItems.setBillNo(detailed.getfNo());
             // 存储业务类型(业务类型)
+            auditItems.setRefno1(sysDeptMapper.selectDeptById(detailed.getDeptId()).getDeptName());
             auditItems.setRefno2(billType);
             auditItems.setRefno3(detailed.getfNo());
             auditItems.setSendUserId(loginUser.getUser().getUserId());

+ 41 - 3
ruoyi-anpin/src/main/resources/mapper/anpin/TCostManagementMapper.xml

@@ -26,11 +26,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="account"    column="account"    />
         <result property="openingBank"    column="opening_bank"    />
         <result property="openingBankAccount"    column="opening_bank_account"    />
+        <result property="fBillstatus"    column="f_billstatus"    />
+        <result property="applicantId"    column="applicant_id"    />
+        <result property="applicantName"    column="applicant_name"    />
+        <result property="fReviewDate"    column="f_review_date"    />
     </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, account, opening_bank, opening_bank_account
+               create_dept, create_dept_name, business_time, business_type, expense_type, total_amount, create_by_id, account, opening_bank, opening_bank_account,
+               f_billstatus, applicant_id, applicant_name, f_review_date
         from t_cost_management
     </sql>
 
@@ -58,6 +63,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             TCM.f_id,
             TCM.f_no,
             TCM.f_status,
+            CASE
+            WHEN TCM.f_status = '0' THEN '录入'
+            WHEN TCM.f_status = '1' THEN '请核'
+            WHEN TCM.f_status = '2' THEN '审批中'
+            WHEN TCM.f_status = '3' THEN '审批通过'
+            WHEN TCM.f_status = '4' THEN '完成'
+            END
+            AS fStatusName,
             TCM.dept_id,
             TCM.dept_name,
             TCM.create_by,
@@ -66,7 +79,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             TCM.business_time,
             TCM.create_time,
             TCM.total_amount,
-            TCM.remark
+            TCM.remark,
+            TCM.f_billstatus,
+            TCM.applicant_id,
+            TCM.applicant_name,
+            TCM.f_review_date
         from t_cost_management TCM
         LEFT JOIN t_cost_management_item TCMI ON TCMI.f_pid = TCM.f_id
         <where>
@@ -95,7 +112,16 @@ 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.account, TCM.opening_bank, TCM.opening_bank_account
+        TCM.create_by_id,pro.dict_label AS businessTypeName, sd.dict_label AS expenseTypeName, TCM.account, TCM.opening_bank, TCM.opening_bank_account, TCM.f_billstatus,TCM.applicant_id,
+        TCM.applicant_name,TCM.f_review_date,
+        CASE
+            WHEN TCM.f_status = '0' THEN '录入'
+            WHEN TCM.f_status = '1' THEN '请核'
+            WHEN TCM.f_status = '2' THEN '审批中'
+            WHEN TCM.f_status = '3' THEN '审批通过'
+            WHEN TCM.f_status = '4' THEN '完成'
+        END
+        AS fStatusName
         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'
@@ -128,6 +154,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="account != null">account,</if>
             <if test="openingBank != null">opening_bank,</if>
             <if test="openingBankAccount != null">opening_bank_account,</if>
+            <if test="fBillstatus != null">f_billstatus,</if>
+            <if test="applicantId != null">applicant_id,</if>
+            <if test="applicantName != null">applicant_name,</if>
+            <if test="fReviewDate != null">f_review_date,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="fNo != null">#{fNo},</if>
@@ -150,6 +180,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="account != null">#{account},</if>
             <if test="openingBank != null">#{openingBank},</if>
             <if test="openingBankAccount != null">#{openingBankAccount},</if>
+            <if test="fBillstatus != null">#{fBillstatus},</if>
+            <if test="applicantId != null">#{applicantId},</if>
+            <if test="applicantName != null">#{applicantName},</if>
+            <if test="fReviewDate != null">#{fReviewDate},</if>
          </trim>
     </insert>
 
@@ -175,6 +209,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="account != null">account = #{account},</if>
             <if test="openingBank != null">opening_bank = #{openingBank},</if>
             <if test="openingBankAccount != null">opening_bank_account = #{openingBankAccount},</if>
+            <if test="fBillstatus != null">f_billstatus = #{fBillstatus},</if>
+            <if test="applicantId != null">applicant_id = #{applicantId},</if>
+            <if test="applicantName != null">applicant_name = #{applicantName},</if>
+            <if test="fReviewDate != null">f_review_date = #{fReviewDate},</if>
         </trim>
         where f_id = #{fId}
     </update>

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

@@ -548,8 +548,9 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
                         } else if ("F".equals(at.getIffinalItem())) {
                             status = "2";
                         }
+                        Integer fBillstatus = 5;
                         //变更费用管理审核状态
-                        AjaxResult ajaxResult = tWarehouseBillsService.updateCostMessage(auditItems.getBillId(), status);
+                        AjaxResult ajaxResult = tWarehouseBillsService.updateCostMessage(auditItems.getBillId(), status, fBillstatus);
                         String string = ajaxResult.get("code").toString();
                         if ("500".equals(string)) {
                             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@@ -703,8 +704,9 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
             }
         }else if (auditItems.getActId()== 560L ){//费用管理驳回
             String status = "0";
+            Integer fBillstatus = 0;
             //变更费用管理审核状态
-            AjaxResult ajaxResult = tWarehouseBillsService.updateCostMessage(auditItems.getBillId(), status);
+            AjaxResult ajaxResult = tWarehouseBillsService.updateCostMessage(auditItems.getBillId(), status, fBillstatus);
             String string = ajaxResult.get("code").toString();
             if ("500".equals(string)) {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@@ -913,8 +915,9 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
             }
         }else if (auditItems.getActId()== 560L ){//费用管理撤销审批
             String status = "0";
+            Integer fBillstatus = 0;
             //变更费用管理审核状态
-            AjaxResult ajaxResult = tWarehouseBillsService.updateCostMessage(auditItems.getBillId(), status);
+            AjaxResult ajaxResult = tWarehouseBillsService.updateCostMessage(auditItems.getBillId(), status, fBillstatus);
             String string = ajaxResult.get("code").toString();
             if ("500".equals(string)) {
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();

+ 2 - 1
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/mapper/TWarehouseBillsMapper.java

@@ -217,7 +217,8 @@ public interface TWarehouseBillsMapper extends BaseMapper<TWarehouseBills> {
      * @return
      */
     public int updateCostMessage(@Param("fId")Long fId,
-                                   @Param("fBillstatus")String fBillstatus);
+                                   @Param("status")String status,
+                                 @Param("fBillstatus") Integer fBillstatus);
     /**
      * 更新项目审核信息
      * @param fPid

+ 3 - 2
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseBillsServiceImpl.java

@@ -4624,13 +4624,14 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
     /**
      * 更新费用管理审核信息
      * @param fid
+     * @param status
      * @param fBillstatus
      * @return
      */
     @Transactional
-    public AjaxResult updateCostMessage(Long fid, String fBillstatus){
+    public AjaxResult updateCostMessage(Long fid, String status, Integer fBillstatus){
         Integer i = null;
-        i = tWarehouseBillsMapper.updateCostMessage(fid, fBillstatus);
+        i = tWarehouseBillsMapper.updateCostMessage(fid, status, fBillstatus);
         if (i != null && i>0){
             return AjaxResult.success();
         }else {

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

@@ -2643,7 +2643,7 @@
 
     <update id="updateCostMessage">
         update t_cost_management
-        set f_status = #{fBillstatus}
+        set f_status = #{status},f_billstatus = #{fBillstatus}
         where f_id = #{fId}
     </update>