Kaynağa Gözat

5.26功能修改开发

user5 3 yıl önce
ebeveyn
işleme
079c65a977
12 değiştirilmiş dosya ile 219 ekleme ve 11 silme
  1. 12 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/controller/ReimbursementSysController.java
  2. 27 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/controller/ReimbursementUserController.java
  3. 1 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/domain/dto/ReimbursementBusinessDTO.java
  4. 10 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/domain/dto/ReimbursementDTO.java
  5. 14 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/mapper/ReimbursementBusinessMapper.java
  6. 20 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/mapper/ReimbursementSysMapper.java
  7. 22 2
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/mapper/xml/ReimbursementBusinessMapper.xml
  8. 42 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/mapper/xml/ReimbursementSysMapper.xml
  9. 6 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/service/ReimbursementSysService.java
  10. 30 6
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/service/impl/ReimbursementBusinessServiceImpl.java
  11. 30 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/service/impl/ReimbursementSysServiceImpl.java
  12. 5 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/service/impl/ReimbursementUserServiceImpl.java

+ 12 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/controller/ReimbursementSysController.java

@@ -135,6 +135,18 @@ public class ReimbursementSysController {
         return ResponseEntity.ok("保存发票收款时间成功");
     }
 
+
+    /**
+     * 保存发票收款时间
+     * @return
+     */
+    @ApiLog("修改发票信息")
+    @PostMapping("modifyInvoice")
+    public ResponseEntity modifyInvoice(@Valid @RequestBody ReimbursementDTO reimbursementDTO) {
+        service.modifyInvoice(reimbursementDTO);
+        return ResponseEntity.ok("修改发票信息成功");
+    }
+
     /**
      * 批量删除
      * @param ids

+ 27 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/controller/ReimbursementUserController.java

@@ -8,6 +8,7 @@ import com.jeeplus.aop.logging.annotation.ApiLog;
 import com.jeeplus.common.beanvalidator.BeanValidators;
 import com.jeeplus.core.excel.utils.EasyPoiUtil;
 import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.sys.utils.DictUtils;
 import com.jeeplus.sys.utils.StringUtils;
 import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementBusinessReturnDTO;
 import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementUserDTO;
@@ -21,6 +22,7 @@ import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.ConstraintViolationException;
+import java.time.LocalDate;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -52,6 +54,31 @@ public class ReimbursementUserController {
         return ResponseEntity.ok (reimbursementDTO);
     }
 
+    /**
+     * 根据id报销人员信息
+     * @return
+     */
+    @ApiLog("查询字典中日报销额度和年度假日天数")
+    @PreAuthorize("hasAnyAuthority('reimbursementUser:add')")
+    @GetMapping("getReimbursementQuotaDay")
+    public ResponseEntity getReimbursementQuotaDay() {
+        ReimbursementUserDTO reimbursementDTO = new ReimbursementUserDTO();
+        //获取日报销额度
+        String reimbursementQuotaDay = DictUtils.getDictLabel("1", "reimbursement_quota_day", null);
+        //获取当年度的总天数
+        int yearDay = LocalDate.now().lengthOfYear();
+        //获取年度休假天数
+        String holidayDay = DictUtils.getDictLabel("1", "reimbursement_holiday_day", null);
+        Integer reimbursementAllDay = yearDay;
+        if(StringUtils.isNotBlank(holidayDay)){
+            int i = Integer.parseInt(holidayDay);
+            reimbursementAllDay = yearDay - Integer.parseInt(holidayDay);
+        }
+        reimbursementDTO.setReimbursementQuotaDay(reimbursementQuotaDay);
+        reimbursementDTO.setReimbursementAllDay(reimbursementAllDay);
+        return ResponseEntity.ok (reimbursementDTO);
+    }
+
 
     /**
      * 查询报销信息

+ 1 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/domain/dto/ReimbursementBusinessDTO.java

@@ -25,6 +25,7 @@ public class ReimbursementBusinessDTO extends BaseEntity {
     private String reimbursementQuota;  //年报销额度
     private String reimbursementQuotaDay;  //日报销额度
     private String reimbursementDay;  //报销天数
+    private String reimbursementType;  //报销类型(1:正常报销;2:补差)
     private String reimbursementAmount;  //报销额度
     private String remainReimbursementAmount;  //剩余报销额度
     private String remarks; //备注

+ 10 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/domain/dto/ReimbursementDTO.java

@@ -4,6 +4,7 @@ import cn.afterturn.easypoi.excel.annotation.Excel;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.jeeplus.core.domain.TreeEntity;
+import com.jeeplus.sys.utils.StringUtils;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import org.springframework.format.annotation.DateTimeFormat;
@@ -55,6 +56,9 @@ public class ReimbursementDTO extends TreeEntity<ReimbursementDTO> {
     private String allAlreadyReimbursementQuota;    //总报销额度
     private String canReimbursementAmount;    //可报销额度
     private String surplusReimbursementAmount;    //剩余报销额度
+    private String reimbursementType;    //报销比例
+    private String gatheringStatus;    //收款状态
+    private String reimbursementStatus;    //报销状态
     private List<String> idList;
 
     @DateTimeFormat(pattern =  "yyyy-MM-dd")
@@ -62,4 +66,10 @@ public class ReimbursementDTO extends TreeEntity<ReimbursementDTO> {
     private Date gatheringTime;     //收款日期
 
 
+    public String getReimbursementType() {
+        if(StringUtils.isBlank(this.reimbursementType)){
+            this.reimbursementType = "1";
+        }
+        return reimbursementType;
+    }
 }

+ 14 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/mapper/ReimbursementBusinessMapper.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementBusinessDTO;
+import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementDTO;
 import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementUserDTO;
 import org.apache.ibatis.annotations.Param;
 
@@ -102,4 +103,17 @@ public interface ReimbursementBusinessMapper extends BaseMapper<ReimbursementUse
      * @return
      */
     String getAlreadyReimbursementQuotaByBusinessCodeId(ReimbursementBusinessDTO reimbursementUser);
+
+    /**
+     * 根据业务id查询收款状态
+     * @param reimbursementUser
+     * @return
+     */
+    String getGatheringStatusById(ReimbursementBusinessDTO reimbursementUser);
+
+    /**
+     * 修改业务报销是否完成状态
+     * @param reimbursementDTO
+     */
+    void updateReimbursementInfo(ReimbursementDTO reimbursementDTO);
 }

+ 20 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/mapper/ReimbursementSysMapper.java

@@ -103,6 +103,13 @@ public interface ReimbursementSysMapper  extends BaseMapper<ReimbursementDTO> {
     Integer saveInvoice(ReimbursementDTO reimbursement);
 
     /**
+     * 修改发票信息
+     * @param reimbursement
+     * @return
+     */
+    Integer modifyInvoice(ReimbursementDTO reimbursement);
+
+    /**
      * 根据业务编码查询业务信息
      * @param businessCode
      * @return
@@ -152,5 +159,18 @@ public interface ReimbursementSysMapper  extends BaseMapper<ReimbursementDTO> {
      */
     List<ReimbursementDTO> getGatheringTimeInvoiceList(@Param("idList") List<String> idList);
 
+    /**
+     * 根据该条发票信息查询同业务编号下的没有收款的发票信息
+     * @param reimbursement
+     * @return
+     */
+    List<ReimbursementDTO> getNotGatheringTimeInvoice(ReimbursementDTO reimbursement);
+
     void updateGatheringTime(@Param("idList") List<String> idList, @Param("reimbursement") ReimbursementDTO reimbursement);
+
+    /**
+     * 根据id修改业务信息的收款状态
+     * @param id
+     */
+    void updateGatheringStatusById(String id);
 }

+ 22 - 2
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/mapper/xml/ReimbursementBusinessMapper.xml

@@ -30,6 +30,7 @@
         su.name as "userName",
         a.year AS "year",
         a.reimbursement_day as "reimbursementDay",
+        a.reimbursement_type AS "reimbursementType",
         a.reimbursement_amount as "reimbursementAmount"
     </sql>
 
@@ -106,7 +107,10 @@
             business_code_id,
             user_id,
             year,
-            reimbursement_day,
+            <if test="reimbursementDay != null and reimbursementDay != ''">
+                reimbursement_day,
+            </if>
+            reimbursement_type,
             reimbursement_amount
         )
         values
@@ -121,7 +125,10 @@
             #{businessCodeId},
             #{userId},
             #{year},
-            #{reimbursementDay},
+            <if test="reimbursementDay != null and reimbursementDay != ''">
+                #{reimbursementDay},
+            </if>
+            #{reimbursementType},
             #{reimbursementAmount}
         )
     </insert>
@@ -195,6 +202,13 @@
         and a.business_code_id= #{businessCodeId}
     </select>
 
+    <select id="getGatheringStatusById" resultType="java.lang.String">
+        select a.gathering_status
+        from zs_reimbursement_info a
+        where a.del_flag = 0
+        and a.id= #{businessCodeId}
+    </select>
+
 
 
     <select id="findListByBusinessCodeId" resultType="com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementBusinessDTO">
@@ -224,4 +238,10 @@
         </where>
         order by a.update_date desc,a.year desc, a.user_id asc
     </select>
+
+    <update id="updateReimbursementInfo">
+        update zs_reimbursement_info
+        set reimbursement_status = #{reimbursementStatus}
+        where id = #{id}
+    </update>
 </mapper>

+ 42 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/mapper/xml/ReimbursementSysMapper.xml

@@ -25,7 +25,8 @@
         a.proposer AS "proposer",
         a.partner AS "partner",
         a.business_type AS "businessType",
-        a.reimbursement_ratio AS "reimbursementRatio"
+        a.reimbursement_ratio AS "reimbursementRatio",
+        a.reimbursement_status AS "reimbursementStatus"
     </sql>
 
     <select id="queryAllList" resultType="com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementDTO">
@@ -56,6 +57,12 @@
             <if test="invoiceNumber != null and invoiceNumber != ''">
                 and a.invoice_number like concat('%',#{invoiceNumber},'%')
             </if>
+            <if test="proposer != null and proposer != ''">
+                and a.proposer like concat('%',#{proposer},'%')
+            </if>
+            <if test="partner != null and partner != ''">
+                and a.partner like concat('%',#{partner},'%')
+            </if>
         </where>
         order by a.invoice_number
     </select>
@@ -251,6 +258,21 @@
             id = #{id} and del_flag = 0
     </update>
 
+    <update id="modifyInvoice">
+        update zs_reimbursement_invoice_info
+        set
+            update_by = #{updateBy},
+            update_date = #{updateDate}
+        <if test="proposer != null and proposer != ''">
+            ,proposer = #{proposer}
+        </if>
+        <if test="partner != null and partner != ''">
+            ,partner = #{partner}
+        </if>
+        where
+            id = #{id} and del_flag = 0
+    </update>
+
     <select id="getInfoByBusinessCode" resultType="com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementDTO">
         SELECT
         <include refid="reimbursementColumns"/>
@@ -356,6 +378,19 @@
         order by a.invoice_number
     </select>
 
+    <select id="getNotGatheringTimeInvoice" resultType="com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementDTO">
+        SELECT
+        <include refid="reimbursementColumns"/>
+        FROM zs_reimbursement_invoice_info a
+        <where>
+            a.del_flag = 0
+            and business_code = (
+            select business_code from zs_reimbursement_invoice_info where id = #{businessCode}
+            ) and gathering_time is null
+        </where>
+        order by a.invoice_number
+    </select>
+
     <update id="updateGatheringTime">
         <foreach collection="idList" item="id" index="index" open="" close="" separator=";">
             update zs_reimbursement_invoice_info
@@ -367,4 +402,10 @@
             where id = #{id}
         </foreach>
     </update>
+
+    <update id="updateGatheringStatusById">
+        update zs_reimbursement_info
+        set gathering_status = 1
+        where id = #{id}
+    </update>
 </mapper>

+ 6 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/service/ReimbursementSysService.java

@@ -56,6 +56,12 @@ public interface ReimbursementSysService {
     void saveInvoice(ReimbursementDTO reimbursement);
 
     /**
+     * 修改发票信息
+     * @param reimbursement
+     */
+    void modifyInvoice(ReimbursementDTO reimbursement);
+
+    /**
      * 批量删除(逻辑删除)
      * @param idList
      */

+ 30 - 6
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/service/impl/ReimbursementBusinessServiceImpl.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.google.common.collect.Lists;
 import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.sys.utils.DictUtils;
 import com.jeeplus.sys.utils.StringUtils;
 import com.jeeplus.sys.utils.UserUtils;
 import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementBusinessDTO;
@@ -129,10 +130,16 @@ public class ReimbursementBusinessServiceImpl implements ReimbursementBusinessSe
             map.put("message", "报销年份不正确,请重新填写!");
             return map;
         }
-        if(StringUtils.isBlank(reimbursementUser.getReimbursementDay()) || !StringUtils.isNumeric(reimbursementUser.getReimbursementDay())){
+        if(StringUtils.isBlank(reimbursementUser.getReimbursementType())){
             map.put("success", false);
-            map.put("message", "报销天数不正确,请重新填写!");
+            map.put("message", "请选择报销类型!");
             return map;
+        }else{
+            if("1".equals(reimbursementUser.getReimbursementType()) && (StringUtils.isBlank(reimbursementUser.getReimbursementDay()) || !StringUtils.isNumeric(reimbursementUser.getReimbursementDay()))){
+                map.put("success", false);
+                map.put("message", "报销天数不正确,请重新填写!");
+                return map;
+            }
         }
         //根据人员id和报销年份查询该年度的报销信息
         ReimbursementUserDTO reimbursementUserByUserIdAndYear = mapper.reimbursementUserByUserIdAndYear(reimbursementUser);
@@ -145,9 +152,16 @@ public class ReimbursementBusinessServiceImpl implements ReimbursementBusinessSe
         String alreadyReimbursementQuota = mapper.getAlreadyReimbursementQuotaByUserIdAndYear(reimbursementUser);
         //判断本地报销额度是否超过该年度所剩余报销额度,如果超过,则不允许报销,并抛出。否则进行报销并保存报销数据
         BigDecimal alreadyReimbursementQuotaB = new BigDecimal(alreadyReimbursementQuota);    //已报销额度
-        BigDecimal reimbursementQuotaDay = new BigDecimal(reimbursementUser.getReimbursementQuotaDay());    //日报销额度
-        BigDecimal reimbursementDay = new BigDecimal(reimbursementUser.getReimbursementDay());  //报销天数
-        BigDecimal reimbursementAmount = reimbursementQuotaDay.multiply(reimbursementDay).setScale(2, BigDecimal.ROUND_HALF_UP);    //报销额度
+        BigDecimal reimbursementAmount = null;
+        if("1".equals(reimbursementUser.getReimbursementType())){
+            BigDecimal reimbursementQuotaDay = new BigDecimal(reimbursementUser.getReimbursementQuotaDay());    //日报销额度
+            BigDecimal reimbursementDay = new BigDecimal(reimbursementUser.getReimbursementDay());  //报销天数
+            reimbursementAmount = reimbursementQuotaDay.multiply(reimbursementDay).setScale(2, BigDecimal.ROUND_HALF_UP);    //报销额度
+
+        }else{
+            reimbursementAmount = new BigDecimal(reimbursementUser.getReimbursementAmount());
+        }
+
         //往期加这次的总报销额度和当年的总报销额度进行比较,小于当年报销额度 则个人可以进行报销,否则,无法进行报销
         if(alreadyReimbursementQuotaB.add(reimbursementAmount).compareTo(new BigDecimal(reimbursementUser.getReimbursementQuota())) == 1){
             map.put("success", false);
@@ -174,12 +188,20 @@ public class ReimbursementBusinessServiceImpl implements ReimbursementBusinessSe
         BigDecimal canReimbursementAmount = income.multiply(reimbursementRatio).divide(new BigDecimal("100")).setScale(2, BigDecimal.ROUND_HALF_UP);    //该项目可报销额度计算
         //查询该业务总报销额度
         String alreadyReimbursementQuotaByBusinessCodeId = mapper.getAlreadyReimbursementQuotaByBusinessCodeId(reimbursementUser);
+        String gatheringStatus = mapper.getGatheringStatusById(reimbursementUser);
         BigDecimal allAlreadyReimbursementQuota = new BigDecimal(alreadyReimbursementQuotaByBusinessCodeId);    //总报销额度
         //往期加这次的总报销额度和当年的总报销额度进行比较,小于当年报销额度 则个人可以进行报销,否则,无法进行报销
         if(allAlreadyReimbursementQuota.add(reimbursementAmount).compareTo(canReimbursementAmount) == 1){
             map.put("success", false);
             map.put("message", "本次报销金额已超出该业务可报销额度所剩余额,无法进行报销");
             return map;
+        } else if (allAlreadyReimbursementQuota.add(reimbursementAmount).compareTo(canReimbursementAmount) == 0 && "1".equals(gatheringStatus)){
+            //如果报销额度和剩余报销额度相同
+            ReimbursementDTO reimbursementDTO = new ReimbursementDTO();
+            reimbursementDTO.setId(reimbursementUser.getBusinessCodeId());
+            reimbursementDTO.setReimbursementStatus("1");
+
+            mapper.updateReimbursementInfo(reimbursementDTO);
         }
 
 
@@ -217,7 +239,9 @@ public class ReimbursementBusinessServiceImpl implements ReimbursementBusinessSe
     @Override
     public ReimbursementBusinessReturnDTO findListByBusinessCodeId(ReimbursementBusinessDTO reimbursementBusiness) {
         List<ReimbursementBusinessDTO> list = mapper.findListByBusinessCodeId(reimbursementBusiness);
-
+        for (ReimbursementBusinessDTO info : list) {
+            info.setReimbursementType(DictUtils.getDictLabel(info.getReimbursementType(), "reimbursement_type", null));
+        }
         ReimbursementBusinessReturnDTO reimbursementBusinessReturnDTO = new ReimbursementBusinessReturnDTO();
         //获取业务报销信息
         ReimbursementDTO business = this.getBusinessById(reimbursementBusiness.getBusinessCodeId());

+ 30 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/service/impl/ReimbursementSysServiceImpl.java

@@ -42,7 +42,7 @@ public class ReimbursementSysServiceImpl implements ReimbursementSysService {
     public IPage<ReimbursementDTO> treeData(Page<ReimbursementDTO> page, ReimbursementDTO reimbursement) {
         IPage<ReimbursementDTO> pageList = new Page();
         //如果筛选项含有发票号码,则需先查询对应的发票信息
-        if(StringUtils.isNotBlank(reimbursement.getInvoiceNumber())){
+        if(StringUtils.isNotBlank(reimbursement.getInvoiceNumber()) || StringUtils.isNotBlank(reimbursement.getProposer()) || StringUtils.isNotBlank(reimbursement.getPartner())){
             List<ReimbursementDTO> invoiceList =  mapper.getInvoiceList(reimbursement);
             //如果存在发票信息,则根据发票的父节点查询对应的业务信息
             if(invoiceList.size()>0){
@@ -310,6 +310,21 @@ public class ReimbursementSysServiceImpl implements ReimbursementSysService {
         //修改发票收款时间
         reimbursement.preUpdate();
         mapper.updateGatheringTime(idList,reimbursement);
+
+        for (String id : idList) {
+            reimbursement.setBusinessCode(id);
+
+            //根据该条发票信息查询同业务编号下的没有收款的发票信息
+            List<ReimbursementDTO> notGatheringTimeInvoice = mapper.getNotGatheringTimeInvoice(reimbursement);
+            if(notGatheringTimeInvoice.size() == 0){
+                //查询该发票信息
+                ReimbursementDTO reimbursementDTO = mapper.queryInvoiceById(id);
+                //如果所有的发票均已收款,则将业务信息添加全部收款状态
+                mapper.updateGatheringStatusById(reimbursementDTO.getParentId());
+            }
+        }
+
+
         map.put("success",true);
         map.put("message","收款成功");
         return map;
@@ -319,6 +334,20 @@ public class ReimbursementSysServiceImpl implements ReimbursementSysService {
     public void saveInvoice(ReimbursementDTO reimbursement) {
         reimbursement.preUpdate();
         mapper.saveInvoice(reimbursement);
+        //根据该条发票信息查询同业务编号下的没有收款的发票信息
+        List<ReimbursementDTO> notGatheringTimeInvoice = mapper.getNotGatheringTimeInvoice(reimbursement);
+        if(notGatheringTimeInvoice.size() == 0){
+            //查询该发票信息
+            ReimbursementDTO reimbursementDTO = mapper.queryInvoiceById(reimbursement.getId());
+            //如果所有的发票均已收款,则将业务信息添加全部收款状态
+            mapper.updateGatheringStatusById(reimbursementDTO.getParentId());
+        }
+    }
+
+    @Override
+    public void modifyInvoice(ReimbursementDTO reimbursement) {
+        reimbursement.preUpdate();
+        mapper.modifyInvoice(reimbursement);
     }
 
     @Override

+ 5 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/service/impl/ReimbursementUserServiceImpl.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.google.common.collect.Lists;
 import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.sys.utils.DictUtils;
 import com.jeeplus.sys.utils.StringUtils;
 import com.jeeplus.sys.utils.UserUtils;
 import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementBusinessDTO;
@@ -174,7 +175,10 @@ public class ReimbursementUserServiceImpl implements ReimbursementUserService {
         for (ReimbursementBusinessDTO info : list) {
             BigDecimal bigDecimal = new BigDecimal(info.getReimbursementAmount());
             alreadyReimbursementAmount = alreadyReimbursementAmount.add(bigDecimal);
-            alreadyReimbursementDay = alreadyReimbursementDay.add(new BigDecimal(info.getReimbursementDay()));
+            if("1".equals(info.getReimbursementType())){
+                alreadyReimbursementDay = alreadyReimbursementDay.add(new BigDecimal(info.getReimbursementDay()));
+            }
+            info.setReimbursementType(DictUtils.getDictLabel(info.getReimbursementType(), "reimbursement_type", null));
         }
         //剩余报销额度
         reimbursementBusinessReturnDTO.setSurplusReimbursementAmount(new BigDecimal(reimbursementBusinessReturnDTO.getReimbursementQuota()).subtract(alreadyReimbursementAmount).toString());