Explorar el Código

管理员修改报销

sangwenwei hace 1 año
padre
commit
5ad7a13bf6
Se han modificado 25 ficheros con 625 adiciones y 1 borrados
  1. 25 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementInfo/controller/ReimbursementInfoController.java
  2. 30 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementInfo/domain/ReimbursementInfoUpHi.java
  3. 13 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementInfo/mapper/ReimbursementInfoUpHiMapper.java
  4. 18 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementInfo/mapper/xml/ReimbursementInfoUpHiMapper.xml
  5. 39 1
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementInfo/service/ReimbursementInfoService.java
  6. 25 0
      jeeplus-modules/jeeplus-ccpm/src/main/java/com/jeeplus/ccpm/approvalInfo/controller/CcpmReimbursementInfoController.java
  7. 30 0
      jeeplus-modules/jeeplus-ccpm/src/main/java/com/jeeplus/ccpm/approvalInfo/domain/CcpmReimbursementInfoUpHi.java
  8. 13 0
      jeeplus-modules/jeeplus-ccpm/src/main/java/com/jeeplus/ccpm/approvalInfo/mapper/CcpmReimbursementInfoUpHiMapper.java
  9. 18 0
      jeeplus-modules/jeeplus-ccpm/src/main/java/com/jeeplus/ccpm/approvalInfo/mapper/xml/CcpmReimbursementInfoUpHiMapper.xml
  10. 40 0
      jeeplus-modules/jeeplus-ccpm/src/main/java/com/jeeplus/ccpm/approvalInfo/service/CcpmReimbursementInfoService.java
  11. 25 0
      jeeplus-modules/jeeplus-centrecareful/src/main/java/com/jeeplus/centrecareful/approvalInfo/controller/ZsReimbursementInfoController.java
  12. 30 0
      jeeplus-modules/jeeplus-centrecareful/src/main/java/com/jeeplus/centrecareful/approvalInfo/domain/ZsReimbursementInfoUpHi.java
  13. 13 0
      jeeplus-modules/jeeplus-centrecareful/src/main/java/com/jeeplus/centrecareful/approvalInfo/mapper/ZsReimbursementInfoUpHiMapper.java
  14. 18 0
      jeeplus-modules/jeeplus-centrecareful/src/main/java/com/jeeplus/centrecareful/approvalInfo/mapper/xml/ZsReimbursementInfoUpHiMapper.xml
  15. 39 0
      jeeplus-modules/jeeplus-centrecareful/src/main/java/com/jeeplus/centrecareful/approvalInfo/service/ZsReimbursementInfoService.java
  16. 24 0
      jeeplus-modules/jeeplus-consult/src/main/java/com/jeeplus/consultancy/approvalInfo/controller/ConsultancyReimbursementInfoController.java
  17. 30 0
      jeeplus-modules/jeeplus-consult/src/main/java/com/jeeplus/consultancy/approvalInfo/domain/ConsultancyReimbursementInfoUpHi.java
  18. 13 0
      jeeplus-modules/jeeplus-consult/src/main/java/com/jeeplus/consultancy/approvalInfo/mapper/ConsultancyReimbursementInfoUpHiMapper.java
  19. 18 0
      jeeplus-modules/jeeplus-consult/src/main/java/com/jeeplus/consultancy/approvalInfo/mapper/xml/ConsultancyReimbursementInfoUpHiMapper.xml
  20. 39 0
      jeeplus-modules/jeeplus-consult/src/main/java/com/jeeplus/consultancy/approvalInfo/service/ConsultancyReimbursementInfoService.java
  21. 25 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reimbursementApproval/approvalInfo/controller/CwReimbursementInfoController.java
  22. 30 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reimbursementApproval/approvalInfo/domain/CwReimbursementInfoUpHi.java
  23. 13 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reimbursementApproval/approvalInfo/mapper/CwReimbursementInfoUpHiMapper.java
  24. 18 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reimbursementApproval/approvalInfo/mapper/xml/CwReimbursementInfoUpHiMapper.xml
  25. 39 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reimbursementApproval/approvalInfo/service/CwReimbursementInfoService.java

+ 25 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementInfo/controller/ReimbursementInfoController.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.assess.projectRecords.Utils.EasyPoiUtil;
+import com.jeeplus.assess.reimbursement.reimbursementInfo.domain.ReimbursementInfoUpHi;
 import com.jeeplus.assess.reimbursement.reimbursementInfo.service.dto.*;
 import com.jeeplus.common.excel.ExcelOptions;
 import com.jeeplus.common.excel.ExportMode;
@@ -214,4 +215,28 @@ public class ReimbursementInfoController {
         }
         return map;
     }
+
+    /**
+     * 查询有无历史数据
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "查询有无历史数据")
+    @GetMapping("/findHistory")
+    public ResponseEntity<List<ReimbursementInfoUpHi>> findHistory(@RequestParam String id) throws Exception{
+        List<ReimbursementInfoUpHi> list=service.findHistory(id);
+        return ResponseEntity.ok(list);
+    }
+
+    /**
+     * 根据id查询历史数据
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "根据id查询历史数据")
+    @GetMapping("/findHiById")
+    public ResponseEntity<SaveInfoDto> findHiById(@RequestParam String id) throws Exception{
+        SaveInfoDto list=service.findHiById(id);
+        return ResponseEntity.ok(list);
+    }
 }

+ 30 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementInfo/domain/ReimbursementInfoUpHi.java

@@ -0,0 +1,30 @@
+package com.jeeplus.assess.reimbursement.reimbursementInfo.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+@Data
+@TableName("reimbursement_info_up_hi")
+public class ReimbursementInfoUpHi extends BaseEntity {
+
+    //报销id
+    private String infoId;
+
+    //json数据
+    private String jsonData;
+
+    @TableField(exist = false)
+    private String createName;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private Date createTime;
+
+
+}

+ 13 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementInfo/mapper/ReimbursementInfoUpHiMapper.java

@@ -0,0 +1,13 @@
+package com.jeeplus.assess.reimbursement.reimbursementInfo.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.assess.reimbursement.reimbursementInfo.domain.ReimbursementInfoUpHi;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface ReimbursementInfoUpHiMapper extends BaseMapper<ReimbursementInfoUpHi> {
+    List<ReimbursementInfoUpHi> findHistory(@Param("id") String id);
+}

+ 18 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementInfo/mapper/xml/ReimbursementInfoUpHiMapper.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.assess.reimbursement.reimbursementInfo.mapper.ReimbursementInfoUpHiMapper">
+
+    <select id="findHistory" resultType="com.jeeplus.assess.reimbursement.reimbursementInfo.domain.ReimbursementInfoUpHi">
+        select
+            a.id,
+            a.info_id,
+            a.create_time,
+            a.json_data,
+            su.name as createName
+        from reimbursement_info_up_hi a
+        left join sys_user su on su.id = a.create_by_id and su.del_flag = 0
+        where a.info_id = #{id} and a.del_flag = 0
+        order by a.create_time DESC
+    </select>
+
+</mapper>

+ 39 - 1
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementInfo/service/ReimbursementInfoService.java

@@ -89,6 +89,9 @@ public class ReimbursementInfoService {
 
     @Resource
     private ProgramReportNoMapper programReportNoMapper;
+
+    @Resource
+    private ReimbursementInfoUpHiMapper reimbursementInfoUpHiMapper;
     /**
      * 列表查询
      */
@@ -395,7 +398,17 @@ public class ReimbursementInfoService {
     }
 
     public ReimbursementInfo update(SaveInfoDto dto, UserDTO userDTO) throws Exception {
-
+        boolean admin = userDTO.isAdmin();
+        //判断当前登录人是否是管理员,管理员修改时需要生成一条历史记录
+        if (admin){
+            SaveInfoDto byId = this.findById(dto.getId());
+            String data=JSON.toJSONString(byId);
+            ReimbursementInfoUpHi cwReimbursementInfoUpHi = new ReimbursementInfoUpHi();
+            cwReimbursementInfoUpHi.setCreateTime(new Date());
+            cwReimbursementInfoUpHi.setInfoId(dto.getId());
+            cwReimbursementInfoUpHi.setJsonData(data);
+            reimbursementInfoUpHiMapper.insert(cwReimbursementInfoUpHi);
+        }
         // 生成编号
         //根据报销id 查询该报销信息是否存在报销编号
         String oldNumber = infoMapper.getNumberById(dto.getId());
@@ -1056,4 +1069,29 @@ public class ReimbursementInfoService {
         return list;
     }
 
+    /**
+     * 查询有无历史数据
+     * @param id
+     * @return
+     */
+    public List<ReimbursementInfoUpHi> findHistory(String id) {
+
+        List<ReimbursementInfoUpHi> list = reimbursementInfoUpHiMapper.findHistory(id);
+        return list;
+    }
+
+    /**
+     * 根据id查询历史数据
+     * @param id
+     * @return
+     */
+    public SaveInfoDto findHiById(String id) {
+        SaveInfoDto reimbursementInfoUpHi = new SaveInfoDto();
+        ReimbursementInfoUpHi cwReimbursementInfoUpHi = reimbursementInfoUpHiMapper.selectById(id);
+        if (ObjectUtil.isNotEmpty(cwReimbursementInfoUpHi) && StringUtils.isNotBlank(cwReimbursementInfoUpHi.getJsonData())){
+            reimbursementInfoUpHi = JSON.parseObject(cwReimbursementInfoUpHi.getJsonData(),SaveInfoDto.class);
+        }
+        return reimbursementInfoUpHi;
+    }
+
 }

+ 25 - 0
jeeplus-modules/jeeplus-ccpm/src/main/java/com/jeeplus/ccpm/approvalInfo/controller/CcpmReimbursementInfoController.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.google.common.collect.Lists;
 import com.jeeplus.ccpm.approvalInfo.domain.CcpmProgramProjectListInfo;
 import com.jeeplus.ccpm.approvalInfo.domain.CcpmReimbursementInfo;
+import com.jeeplus.ccpm.approvalInfo.domain.CcpmReimbursementInfoUpHi;
 import com.jeeplus.ccpm.approvalInfo.service.CcpmReimbursementInfoService;
 import com.jeeplus.ccpm.approvalInfo.service.dto.*;
 import com.jeeplus.ccpm.approvalInfo.util.CcpmEasyPoiUtil;
@@ -238,4 +239,28 @@ public class CcpmReimbursementInfoController {
         return map;
     }
 
+    /**
+     * 查询有无历史数据
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "查询有无历史数据")
+    @GetMapping("/findHistory")
+    public ResponseEntity<List<CcpmReimbursementInfoUpHi>> findHistory(@RequestParam String id) throws Exception{
+        List<CcpmReimbursementInfoUpHi> list=service.findHistory(id);
+        return ResponseEntity.ok(list);
+    }
+
+    /**
+     * 根据id查询历史数据
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "根据id查询历史数据")
+    @GetMapping("/findHiById")
+    public ResponseEntity<CcpmSaveInfoDto> findHiById(@RequestParam String id) throws Exception{
+        CcpmSaveInfoDto list=service.findHiById(id);
+        return ResponseEntity.ok(list);
+    }
+
 }

+ 30 - 0
jeeplus-modules/jeeplus-ccpm/src/main/java/com/jeeplus/ccpm/approvalInfo/domain/CcpmReimbursementInfoUpHi.java

@@ -0,0 +1,30 @@
+package com.jeeplus.ccpm.approvalInfo.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+@Data
+@TableName("ccpm_reimbursement_info_up_hi")
+public class CcpmReimbursementInfoUpHi extends BaseEntity {
+
+    //报销id
+    private String infoId;
+
+    //json数据
+    private String jsonData;
+
+    @TableField(exist = false)
+    private String createName;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private Date createTime;
+
+
+}

+ 13 - 0
jeeplus-modules/jeeplus-ccpm/src/main/java/com/jeeplus/ccpm/approvalInfo/mapper/CcpmReimbursementInfoUpHiMapper.java

@@ -0,0 +1,13 @@
+package com.jeeplus.ccpm.approvalInfo.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.ccpm.approvalInfo.domain.CcpmReimbursementInfoUpHi;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface CcpmReimbursementInfoUpHiMapper extends BaseMapper<CcpmReimbursementInfoUpHi> {
+    List<CcpmReimbursementInfoUpHi> findHistory(@Param("id") String id);
+}

+ 18 - 0
jeeplus-modules/jeeplus-ccpm/src/main/java/com/jeeplus/ccpm/approvalInfo/mapper/xml/CcpmReimbursementInfoUpHiMapper.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.ccpm.approvalInfo.mapper.CcpmReimbursementInfoUpHiMapper">
+
+    <select id="findHistory" resultType="com.jeeplus.ccpm.approvalInfo.domain.CcpmReimbursementInfoUpHi">
+        select
+            a.id,
+            a.info_id,
+            a.create_time,
+            a.json_data,
+            su.name as createName
+        from ccpm_reimbursement_info_up_hi a
+        left join sys_user su on su.id = a.create_by_id and su.del_flag = 0
+        where a.info_id = #{id} and a.del_flag = 0
+        order by a.create_time DESC
+    </select>
+
+</mapper>

+ 40 - 0
jeeplus-modules/jeeplus-ccpm/src/main/java/com/jeeplus/ccpm/approvalInfo/service/CcpmReimbursementInfoService.java

@@ -2,6 +2,7 @@ package com.jeeplus.ccpm.approvalInfo.service;
 
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.extra.spring.SpringUtil;
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -61,6 +62,9 @@ public class CcpmReimbursementInfoService {
     @Resource
     private CcpmReimbursementAmountInfoMapper amountInfoMapper;
 
+    @Resource
+    private CcpmReimbursementInfoUpHiMapper reimbursementInfoUpHiMapper;
+
 //    @Resource
 //    private OssServiceMapper ossServiceMapper;
 
@@ -370,6 +374,17 @@ public class CcpmReimbursementInfoService {
     }
 
     public CcpmReimbursementInfo update(CcpmSaveInfoDto dto, UserDTO userDTO) {
+        boolean admin = userDTO.isAdmin();
+        //判断当前登录人是否是管理员,管理员修改时需要生成一条历史记录
+        if (admin){
+            CcpmSaveInfoDto byId = this.findById(dto.getId());
+            String data=JSON.toJSONString(byId);
+            CcpmReimbursementInfoUpHi cwReimbursementInfoUpHi = new CcpmReimbursementInfoUpHi();
+            cwReimbursementInfoUpHi.setCreateTime(new Date());
+            cwReimbursementInfoUpHi.setInfoId(dto.getId());
+            cwReimbursementInfoUpHi.setJsonData(data);
+            reimbursementInfoUpHiMapper.insert(cwReimbursementInfoUpHi);
+        }
         // 修改基础信息
         CcpmReimbursementInfo info = new CcpmReimbursementInfo();
         BeanUtils.copyProperties(dto, info);
@@ -804,4 +819,29 @@ public class CcpmReimbursementInfoService {
         return list;
     }
 
+    /**
+     * 查询有无历史数据
+     * @param id
+     * @return
+     */
+    public List<CcpmReimbursementInfoUpHi> findHistory(String id) {
+
+        List<CcpmReimbursementInfoUpHi> list = reimbursementInfoUpHiMapper.findHistory(id);
+        return list;
+    }
+
+    /**
+     * 根据id查询历史数据
+     * @param id
+     * @return
+     */
+    public CcpmSaveInfoDto findHiById(String id) {
+        CcpmSaveInfoDto reimbursementInfoUpHi = new CcpmSaveInfoDto();
+        CcpmReimbursementInfoUpHi cwReimbursementInfoUpHi = reimbursementInfoUpHiMapper.selectById(id);
+        if (ObjectUtil.isNotEmpty(cwReimbursementInfoUpHi) && org.apache.commons.lang3.StringUtils.isNotBlank(cwReimbursementInfoUpHi.getJsonData())){
+            reimbursementInfoUpHi = JSON.parseObject(cwReimbursementInfoUpHi.getJsonData(),CcpmSaveInfoDto.class);
+        }
+        return reimbursementInfoUpHi;
+    }
+
 }

+ 25 - 0
jeeplus-modules/jeeplus-centrecareful/src/main/java/com/jeeplus/centrecareful/approvalInfo/controller/ZsReimbursementInfoController.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.google.common.collect.Lists;
 import com.jeeplus.centrecareful.approvalInfo.domain.ZSProgramProjectListInfo;
 import com.jeeplus.centrecareful.approvalInfo.domain.ZsReimbursementInfo;
+import com.jeeplus.centrecareful.approvalInfo.domain.ZsReimbursementInfoUpHi;
 import com.jeeplus.centrecareful.approvalInfo.service.ZsReimbursementInfoService;
 import com.jeeplus.centrecareful.approvalInfo.service.dto.*;
 import com.jeeplus.centrecareful.approvalInfo.util.ZSEasyPoiUtil;
@@ -236,4 +237,28 @@ public class ZsReimbursementInfoController {
         return map;
     }
 
+    /**
+     * 查询有无历史数据
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "查询有无历史数据")
+    @GetMapping("/findHistory")
+    public ResponseEntity<List<ZsReimbursementInfoUpHi>> findHistory(@RequestParam String id) throws Exception{
+        List<ZsReimbursementInfoUpHi> list=service.findHistory(id);
+        return ResponseEntity.ok(list);
+    }
+
+    /**
+     * 根据id查询历史数据
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "根据id查询历史数据")
+    @GetMapping("/findHiById")
+    public ResponseEntity<ZsSaveInfoDto> findHiById(@RequestParam String id) throws Exception{
+        ZsSaveInfoDto list=service.findHiById(id);
+        return ResponseEntity.ok(list);
+    }
+
 }

+ 30 - 0
jeeplus-modules/jeeplus-centrecareful/src/main/java/com/jeeplus/centrecareful/approvalInfo/domain/ZsReimbursementInfoUpHi.java

@@ -0,0 +1,30 @@
+package com.jeeplus.centrecareful.approvalInfo.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+@Data
+@TableName("zs_reimbursement_info_up_hi")
+public class ZsReimbursementInfoUpHi extends BaseEntity {
+
+    //报销id
+    private String infoId;
+
+    //json数据
+    private String jsonData;
+
+    @TableField(exist = false)
+    private String createName;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private Date createTime;
+
+
+}

+ 13 - 0
jeeplus-modules/jeeplus-centrecareful/src/main/java/com/jeeplus/centrecareful/approvalInfo/mapper/ZsReimbursementInfoUpHiMapper.java

@@ -0,0 +1,13 @@
+package com.jeeplus.centrecareful.approvalInfo.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.centrecareful.approvalInfo.domain.ZsReimbursementInfoUpHi;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface ZsReimbursementInfoUpHiMapper extends BaseMapper<ZsReimbursementInfoUpHi> {
+    List<ZsReimbursementInfoUpHi> findHistory(@Param("id") String id);
+}

+ 18 - 0
jeeplus-modules/jeeplus-centrecareful/src/main/java/com/jeeplus/centrecareful/approvalInfo/mapper/xml/ZsReimbursementInfoUpHiMapper.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.centrecareful.approvalInfo.mapper.ZsReimbursementInfoUpHiMapper">
+
+    <select id="findHistory" resultType="com.jeeplus.centrecareful.approvalInfo.domain.ZsReimbursementInfoUpHi">
+        select
+            a.id,
+            a.info_id,
+            a.create_time,
+            a.json_data,
+            su.name as createName
+        from zs_reimbursement_info_up_hi a
+        left join sys_user su on su.id = a.create_by_id and su.del_flag = 0
+        where a.info_id = #{id} and a.del_flag = 0
+        order by a.create_time DESC
+    </select>
+
+</mapper>

+ 39 - 0
jeeplus-modules/jeeplus-centrecareful/src/main/java/com/jeeplus/centrecareful/approvalInfo/service/ZsReimbursementInfoService.java

@@ -76,6 +76,9 @@ public class ZsReimbursementInfoService {
     @Resource
     private ZsReimbursementTypeService typeService;
 
+    @Resource
+    private ZsReimbursementInfoUpHiMapper reimbursementInfoUpHiMapper;
+
     /**
      * 报告号查询
      */
@@ -367,6 +370,17 @@ public class ZsReimbursementInfoService {
     }
 
     public ZsReimbursementInfo update(ZsSaveInfoDto dto, UserDTO userDTO) {
+        boolean admin = userDTO.isAdmin();
+        //判断当前登录人是否是管理员,管理员修改时需要生成一条历史记录
+        if (admin){
+            ZsSaveInfoDto byId = this.findById(dto.getId());
+            String data=JSON.toJSONString(byId);
+            ZsReimbursementInfoUpHi cwReimbursementInfoUpHi = new ZsReimbursementInfoUpHi();
+            cwReimbursementInfoUpHi.setCreateTime(new Date());
+            cwReimbursementInfoUpHi.setInfoId(dto.getId());
+            cwReimbursementInfoUpHi.setJsonData(data);
+            reimbursementInfoUpHiMapper.insert(cwReimbursementInfoUpHi);
+        }
         // 修改基础信息
         ZsReimbursementInfo info = new ZsReimbursementInfo();
         BeanUtils.copyProperties(dto, info);
@@ -801,4 +815,29 @@ public class ZsReimbursementInfoService {
         return list;
     }
 
+    /**
+     * 查询有无历史数据
+     * @param id
+     * @return
+     */
+    public List<ZsReimbursementInfoUpHi> findHistory(String id) {
+
+        List<ZsReimbursementInfoUpHi> list = reimbursementInfoUpHiMapper.findHistory(id);
+        return list;
+    }
+
+    /**
+     * 根据id查询历史数据
+     * @param id
+     * @return
+     */
+    public ZsSaveInfoDto findHiById(String id) {
+        ZsSaveInfoDto reimbursementInfoUpHi = new ZsSaveInfoDto();
+        ZsReimbursementInfoUpHi cwReimbursementInfoUpHi = reimbursementInfoUpHiMapper.selectById(id);
+        if (ObjectUtil.isNotEmpty(cwReimbursementInfoUpHi) && org.apache.commons.lang3.StringUtils.isNotBlank(cwReimbursementInfoUpHi.getJsonData())){
+            reimbursementInfoUpHi = JSON.parseObject(cwReimbursementInfoUpHi.getJsonData(),ZsSaveInfoDto.class);
+        }
+        return reimbursementInfoUpHi;
+    }
+
 }

+ 24 - 0
jeeplus-modules/jeeplus-consult/src/main/java/com/jeeplus/consultancy/approvalInfo/controller/ConsultancyReimbursementInfoController.java

@@ -8,6 +8,7 @@ import com.jeeplus.common.excel.ExportMode;
 import com.jeeplus.common.utils.ResponseUtil;
 import com.jeeplus.consultancy.approvalInfo.domain.ConsultancyProgramProjectListInfo;
 import com.jeeplus.consultancy.approvalInfo.domain.ConsultancyReimbursementInfo;
+import com.jeeplus.consultancy.approvalInfo.domain.ConsultancyReimbursementInfoUpHi;
 import com.jeeplus.consultancy.approvalInfo.service.ConsultancyReimbursementInfoService;
 import com.jeeplus.consultancy.approvalInfo.service.dto.*;
 import com.jeeplus.consultancy.util.ConsultancyEasyPoiUtil;
@@ -238,4 +239,27 @@ public class ConsultancyReimbursementInfoController {
         return map;
     }
 
+    /**
+     * 查询有无历史数据
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "查询有无历史数据")
+    @GetMapping("/findHistory")
+    public ResponseEntity<List<ConsultancyReimbursementInfoUpHi>> findHistory(@RequestParam String id) throws Exception{
+        List<ConsultancyReimbursementInfoUpHi> list=service.findHistory(id);
+        return ResponseEntity.ok(list);
+    }
+
+    /**
+     * 根据id查询历史数据
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "根据id查询历史数据")
+    @GetMapping("/findHiById")
+    public ResponseEntity<ConsultancySaveInfoDto> findHiById(@RequestParam String id) throws Exception{
+        ConsultancySaveInfoDto list=service.findHiById(id);
+        return ResponseEntity.ok(list);
+    }
 }

+ 30 - 0
jeeplus-modules/jeeplus-consult/src/main/java/com/jeeplus/consultancy/approvalInfo/domain/ConsultancyReimbursementInfoUpHi.java

@@ -0,0 +1,30 @@
+package com.jeeplus.consultancy.approvalInfo.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+@Data
+@TableName("consultancy_reimbursement_info_up_hi")
+public class ConsultancyReimbursementInfoUpHi extends BaseEntity {
+
+    //报销id
+    private String infoId;
+
+    //json数据
+    private String jsonData;
+
+    @TableField(exist = false)
+    private String createName;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private Date createTime;
+
+
+}

+ 13 - 0
jeeplus-modules/jeeplus-consult/src/main/java/com/jeeplus/consultancy/approvalInfo/mapper/ConsultancyReimbursementInfoUpHiMapper.java

@@ -0,0 +1,13 @@
+package com.jeeplus.consultancy.approvalInfo.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.consultancy.approvalInfo.domain.ConsultancyReimbursementInfoUpHi;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface ConsultancyReimbursementInfoUpHiMapper extends BaseMapper<ConsultancyReimbursementInfoUpHi> {
+    List<ConsultancyReimbursementInfoUpHi> findHistory(@Param("id") String id);
+}

+ 18 - 0
jeeplus-modules/jeeplus-consult/src/main/java/com/jeeplus/consultancy/approvalInfo/mapper/xml/ConsultancyReimbursementInfoUpHiMapper.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.consultancy.approvalInfo.mapper.ConsultancyReimbursementInfoUpHiMapper">
+
+    <select id="findHistory" resultType="com.jeeplus.consultancy.approvalInfo.domain.ConsultancyReimbursementInfoUpHi">
+        select
+            a.id,
+            a.info_id,
+            a.create_time,
+            a.json_data,
+            su.name as createName
+        from consultancy_reimbursement_info_up_hi a
+        left join sys_user su on su.id = a.create_by_id and su.del_flag = 0
+        where a.info_id = #{id} and a.del_flag = 0
+        order by a.create_time DESC
+    </select>
+
+</mapper>

+ 39 - 0
jeeplus-modules/jeeplus-consult/src/main/java/com/jeeplus/consultancy/approvalInfo/service/ConsultancyReimbursementInfoService.java

@@ -2,6 +2,7 @@ package com.jeeplus.consultancy.approvalInfo.service;
 
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.extra.spring.SpringUtil;
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -79,6 +80,9 @@ public class ConsultancyReimbursementInfoService {
     @Resource
     private ConsultancyReimbursementTypeService typeService;
 
+    @Resource
+    private ConsultancyReimbursementInfoUpHiMapper reimbursementInfoUpHiMapper;
+
     /**
      * 报告号查询
      */
@@ -370,6 +374,17 @@ public class ConsultancyReimbursementInfoService {
     }
 
     public ConsultancyReimbursementInfo update(ConsultancySaveInfoDto dto, UserDTO userDTO) {
+        boolean admin = userDTO.isAdmin();
+        //判断当前登录人是否是管理员,管理员修改时需要生成一条历史记录
+        if (admin){
+            ConsultancySaveInfoDto byId = this.findById(dto.getId());
+            String data=JSON.toJSONString(byId);
+            ConsultancyReimbursementInfoUpHi cwReimbursementInfoUpHi = new ConsultancyReimbursementInfoUpHi();
+            cwReimbursementInfoUpHi.setCreateTime(new Date());
+            cwReimbursementInfoUpHi.setInfoId(dto.getId());
+            cwReimbursementInfoUpHi.setJsonData(data);
+            reimbursementInfoUpHiMapper.insert(cwReimbursementInfoUpHi);
+        }
         // 修改基础信息
         ConsultancyReimbursementInfo info = new ConsultancyReimbursementInfo();
         BeanUtils.copyProperties(dto, info);
@@ -804,4 +819,28 @@ public class ConsultancyReimbursementInfoService {
         return list;
     }
 
+    /**
+     * 查询有无历史数据
+     * @param id
+     * @return
+     */
+    public List<ConsultancyReimbursementInfoUpHi> findHistory(String id) {
+
+        List<ConsultancyReimbursementInfoUpHi> list = reimbursementInfoUpHiMapper.findHistory(id);
+        return list;
+    }
+
+    /**
+     * 根据id查询历史数据
+     * @param id
+     * @return
+     */
+    public ConsultancySaveInfoDto findHiById(String id) {
+        ConsultancySaveInfoDto reimbursementInfoUpHi = new ConsultancySaveInfoDto();
+        ConsultancyReimbursementInfoUpHi cwReimbursementInfoUpHi = reimbursementInfoUpHiMapper.selectById(id);
+        if (ObjectUtil.isNotEmpty(cwReimbursementInfoUpHi) && org.apache.commons.lang3.StringUtils.isNotBlank(cwReimbursementInfoUpHi.getJsonData())){
+            reimbursementInfoUpHi = JSON.parseObject(cwReimbursementInfoUpHi.getJsonData(),ConsultancySaveInfoDto.class);
+        }
+        return reimbursementInfoUpHi;
+    }
 }

+ 25 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reimbursementApproval/approvalInfo/controller/CwReimbursementInfoController.java

@@ -9,6 +9,7 @@ import com.jeeplus.common.utils.ResponseUtil;
 import com.jeeplus.finance.invoice.util.EasyPoiUtil;
 import com.jeeplus.finance.projectRecords.domain.CwProjectRecords;
 import com.jeeplus.finance.reimbursementApproval.approvalInfo.domain.CwReimbursementInfo;
+import com.jeeplus.finance.reimbursementApproval.approvalInfo.domain.CwReimbursementInfoUpHi;
 import com.jeeplus.finance.reimbursementApproval.approvalInfo.domain.ProgramProjectListInfo;
 import com.jeeplus.finance.reimbursementApproval.approvalInfo.service.CwReimbursementInfoService;
 import com.jeeplus.finance.reimbursementApproval.approvalInfo.service.dto.*;
@@ -250,4 +251,28 @@ public class CwReimbursementInfoController {
         }
         return map;
     }
+
+    /**
+     * 查询有无历史数据
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "查询有无历史数据")
+    @GetMapping("/findHistory")
+    public ResponseEntity<List<CwReimbursementInfoUpHi>> findHistory(@RequestParam String id) throws Exception{
+        List<CwReimbursementInfoUpHi> list=service.findHistory(id);
+        return ResponseEntity.ok(list);
+    }
+
+    /**
+     * 根据id查询历史数据
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "根据id查询历史数据")
+    @GetMapping("/findHiById")
+    public ResponseEntity<SaveInfoDto> findHiById(@RequestParam String id) throws Exception{
+        SaveInfoDto list=service.findHiById(id);
+        return ResponseEntity.ok(list);
+    }
 }

+ 30 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reimbursementApproval/approvalInfo/domain/CwReimbursementInfoUpHi.java

@@ -0,0 +1,30 @@
+package com.jeeplus.finance.reimbursementApproval.approvalInfo.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+@Data
+@TableName("cw_reimbursement_info_up_hi")
+public class CwReimbursementInfoUpHi extends BaseEntity {
+
+    //报销id
+    private String infoId;
+
+    //json数据
+    private String jsonData;
+
+    @TableField(exist = false)
+    private String createName;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private Date createTime;
+
+
+}

+ 13 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reimbursementApproval/approvalInfo/mapper/CwReimbursementInfoUpHiMapper.java

@@ -0,0 +1,13 @@
+package com.jeeplus.finance.reimbursementApproval.approvalInfo.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.finance.reimbursementApproval.approvalInfo.domain.CwReimbursementInfoUpHi;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface CwReimbursementInfoUpHiMapper extends BaseMapper<CwReimbursementInfoUpHi> {
+    List<CwReimbursementInfoUpHi> findHistory(@Param("id") String id);
+}

+ 18 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reimbursementApproval/approvalInfo/mapper/xml/CwReimbursementInfoUpHiMapper.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.finance.reimbursementApproval.approvalInfo.mapper.CwReimbursementInfoUpHiMapper">
+
+    <select id="findHistory" resultType="com.jeeplus.finance.reimbursementApproval.approvalInfo.domain.CwReimbursementInfoUpHi">
+        select
+            a.id,
+            a.info_id,
+            a.create_time,
+            a.json_data,
+            su.name as createName
+        from cw_reimbursement_info_up_hi a
+        left join sys_user su on su.id = a.create_by_id and su.del_flag = 0
+        where a.info_id = #{id} and a.del_flag = 0
+        order by a.create_time DESC
+    </select>
+
+</mapper>

+ 39 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reimbursementApproval/approvalInfo/service/CwReimbursementInfoService.java

@@ -3,6 +3,7 @@ package com.jeeplus.finance.reimbursementApproval.approvalInfo.service;
 import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.extra.spring.SpringUtil;
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -82,6 +83,9 @@ public class CwReimbursementInfoService {
     @Resource
     private CwProjectRecordsService cwProjectRecordsService;
 
+    @Resource
+    private CwReimbursementInfoUpHiMapper cwReimbursementInfoUpHiMapper;
+
     /**
      * 报告号查询
      */
@@ -433,6 +437,17 @@ public class CwReimbursementInfoService {
     }
 
     public CwReimbursementInfo update(SaveInfoDto dto, UserDTO userDTO) {
+        boolean admin = userDTO.isAdmin();
+        //判断当前登录人是否是管理员,管理员修改时需要生成一条历史记录
+        if (admin){
+            SaveInfoDto byId = this.findById(dto.getId());
+            String data=JSON.toJSONString(byId);
+            CwReimbursementInfoUpHi cwReimbursementInfoUpHi = new CwReimbursementInfoUpHi();
+            cwReimbursementInfoUpHi.setCreateTime(new Date());
+            cwReimbursementInfoUpHi.setInfoId(dto.getId());
+            cwReimbursementInfoUpHi.setJsonData(data);
+            cwReimbursementInfoUpHiMapper.insert(cwReimbursementInfoUpHi);
+        }
         // 修改基础信息
         CwReimbursementInfo info = new CwReimbursementInfo();
         BeanUtils.copyProperties(dto, info);
@@ -936,4 +951,28 @@ public class CwReimbursementInfoService {
         return list;
     }
 
+    /**
+     * 查询有无历史数据
+     * @param id
+     * @return
+     */
+    public List<CwReimbursementInfoUpHi> findHistory(String id) {
+
+        List<CwReimbursementInfoUpHi> list = cwReimbursementInfoUpHiMapper.findHistory(id);
+        return list;
+    }
+
+    /**
+     * 根据id查询历史数据
+     * @param id
+     * @return
+     */
+    public SaveInfoDto findHiById(String id) {
+        SaveInfoDto reimbursementInfoUpHi = new SaveInfoDto();
+        CwReimbursementInfoUpHi cwReimbursementInfoUpHi = cwReimbursementInfoUpHiMapper.selectById(id);
+        if (ObjectUtil.isNotEmpty(cwReimbursementInfoUpHi) && StringUtils.isNotBlank(cwReimbursementInfoUpHi.getJsonData())){
+            reimbursementInfoUpHi = JSON.parseObject(cwReimbursementInfoUpHi.getJsonData(),SaveInfoDto.class);
+        }
+        return reimbursementInfoUpHi;
+    }
 }