Bladeren bron

20221013
报销申请

sunruiqi 2 jaren geleden
bovenliggende
commit
ff04e5cb92
15 gewijzigde bestanden met toevoegingen van 423 en 51 verwijderingen
  1. 32 4
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursement/reimbursementInfo/controller/ReimbursementInfoController.java
  2. 5 3
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursement/reimbursementInfo/domain/ReimbursementAmountInfo.java
  3. 3 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursement/reimbursementInfo/domain/ReimbursementDetailInfo.java
  4. 2 2
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursement/reimbursementInfo/domain/ReimbursementInfo.java
  5. 13 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursement/reimbursementInfo/mapper/ReimbursementInfoMapper.java
  6. 76 2
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursement/reimbursementInfo/mapper/xml/ReimbursementInfoMapper.xml
  7. 121 26
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursement/reimbursementInfo/service/ReimbursementInfoService.java
  8. 1 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursement/reimbursementInfo/service/dto/QueryListDto.java
  9. 31 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursement/reimbursementInfo/service/dto/RetureListDto.java
  10. 3 3
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursement/reimbursementInfo/service/dto/SaveInfoDto.java
  11. 19 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursement/reimbursementInfo/service/dto/TreeUserDto.java
  12. 2 2
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursement/reimbursementType/controller/ReimbursementTypeController.java
  13. 3 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursement/reimbursementType/domain/ReimbursementTypeInfo.java
  14. 106 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursement/reimbursementType/service/ReimbursementTypeForTreeDataService.java
  15. 6 6
      jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/service/OfficeService.java

+ 32 - 4
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursement/reimbursementInfo/controller/ReimbursementInfoController.java

@@ -2,17 +2,22 @@ package com.jeeplus.test.reimbursement.reimbursementInfo.controller;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.common.utils.ResponseUtil;
+import com.jeeplus.core.excel.utils.EasyPoiUtil;
+import com.jeeplus.test.program.configuration.projectList.domain.ProgramProjectListInfo;
+import com.jeeplus.test.program.configuration.projectList.service.dto.ExportFileDto;
 import com.jeeplus.test.reimbursement.reimbursementInfo.service.ReimbursementInfoService;
 import com.jeeplus.test.reimbursement.reimbursementInfo.service.dto.QueryListDto;
 import com.jeeplus.test.reimbursement.reimbursementInfo.service.dto.RetureListDto;
 import com.jeeplus.test.reimbursement.reimbursementInfo.service.dto.SaveInfoDto;
-import com.jeeplus.test.workContract.domain.WorkContractInfo;
+import com.jeeplus.test.reimbursement.reimbursementInfo.service.dto.TreeUserDto;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
 import java.util.List;
 
 @RestController
@@ -44,7 +49,7 @@ public class ReimbursementInfoController {
     @PostMapping("/save")
     public ResponseEntity<String> save(@RequestBody SaveInfoDto dto) throws Exception{
         String s = service.save(dto);
-        return ResponseEntity.ok(s);
+        return ResponseUtil.newInstance().add("businessTable", "reimbursement_info").add("businessId", s).ok ("操作成功");
     }
 
     /**
@@ -53,7 +58,7 @@ public class ReimbursementInfoController {
      * @return
      */
     @ApiOperation(value = "删除")
-    @PostMapping("/remove")
+    @GetMapping("/remove")
     public ResponseEntity<String> remove(@RequestParam String id){
         String s = service.remove(id);
         return ResponseEntity.ok(s);
@@ -65,7 +70,7 @@ public class ReimbursementInfoController {
      * @return
      */
     @ApiOperation(value = "查询")
-    @PostMapping("/findById")
+    @GetMapping("/findById")
     public ResponseEntity<SaveInfoDto> findById(@RequestParam String id) throws Exception{
         SaveInfoDto dto = service.findById(id);
         return ResponseEntity.ok(dto);
@@ -77,4 +82,27 @@ public class ReimbursementInfoController {
         Boolean is = service.checkNumber(number);
         return ResponseEntity.ok(is);
     }
+
+    /**
+     * 根据id修改状态status
+     */
+    @ApiOperation(value = "根据id修改状态status")
+    @PostMapping(value = "updateStatusById")
+    public void updateStatusById(@RequestBody RetureListDto dto) {
+        service.updateStatusById(dto);
+    }
+
+    @ApiOperation(value = "用户树形")
+    @GetMapping(value = "/userTree")
+    public ResponseEntity<List<TreeUserDto>> userTree(@RequestParam String name) {
+        List<TreeUserDto> list = service.userTree(name);
+        return ResponseEntity.ok(list);
+    }
+
+    @ApiOperation(value = "文件下载")
+    @GetMapping(value = "/exportFile")
+    public void exportFileUploadList(QueryListDto dto, HttpServletResponse response) throws Exception {
+        List<RetureListDto> infos = service.exportList(dto);
+        EasyPoiUtil.exportExcel(infos, "报销申请列表信息",  "报销申请列表信息", RetureListDto.class, "", response );
+    }
 }

+ 5 - 3
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursement/reimbursementInfo/domain/ReimbursementAmountInfo.java

@@ -5,6 +5,8 @@ import com.jeeplus.core.domain.BaseEntity;
 import lombok.Data;
 import org.apache.poi.hpsf.Decimal;
 
+import java.math.BigDecimal;
+
 @Data
 @TableName(value = "reimbursement_amount_info")
 public class ReimbursementAmountInfo extends BaseEntity {
@@ -27,16 +29,16 @@ public class ReimbursementAmountInfo extends BaseEntity {
     /**
      * 金额
      */
-    private Decimal amount;
+    private BigDecimal amount;
 
     /**
      * 税额
      */
-    private Decimal taxAmount;
+    private BigDecimal taxAmount;
 
     /**
      * 价税合计
      */
-    private Decimal count;
+    private BigDecimal count;
 
 }

+ 3 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursement/reimbursementInfo/domain/ReimbursementDetailInfo.java

@@ -5,6 +5,8 @@ import com.jeeplus.core.domain.BaseEntity;
 import lombok.Data;
 import org.apache.poi.hpsf.Decimal;
 
+import java.math.BigDecimal;
+
 @Data
 @TableName(value = "reimbursement_detail_info")
 public class ReimbursementDetailInfo extends BaseEntity {
@@ -62,7 +64,7 @@ public class ReimbursementDetailInfo extends BaseEntity {
     /**
      * 费用(元)
      */
-    private Decimal number;
+    private BigDecimal number;
 
     /**
      * 收据张数

+ 2 - 2
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursement/reimbursementInfo/domain/ReimbursementInfo.java

@@ -37,7 +37,7 @@ public class ReimbursementInfo extends BaseEntity {
      */
     @DateTimeFormat(pattern = "yyyy-MM-dd")
     @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
-    private Date remiDate;
+    private Date reimDate;
 
     /**
      * 备注
@@ -57,5 +57,5 @@ public class ReimbursementInfo extends BaseEntity {
     /**
      *
      */
-    private String processInstanceId;
+    private String processDefinitionId;
 }

+ 13 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursement/reimbursementInfo/mapper/ReimbursementInfoMapper.java

@@ -7,10 +7,23 @@ import com.baomidou.mybatisplus.core.toolkit.Constants;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jeeplus.test.reimbursement.reimbursementInfo.domain.ReimbursementInfo;
 import com.jeeplus.test.reimbursement.reimbursementInfo.service.dto.RetureListDto;
+import com.jeeplus.test.reimbursement.reimbursementInfo.service.dto.TreeUserDto;
+import com.jeeplus.test.workContract.service.dto.WorkAttachmentDto;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 public interface ReimbursementInfoMapper extends BaseMapper<ReimbursementInfo> {
 
     IPage<RetureListDto> findList (Page<RetureListDto> page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper);
 
+    List<WorkAttachmentDto> findFiles(@Param("id") String id);
+
+    void updateStatusById(@Param("id") String id, @Param("type") String type);
+
+    List<TreeUserDto> findOfficeList();
+
+    List<TreeUserDto> findUserList(@Param("name") String name);
+
+    List<RetureListDto> findExportList (@Param(Constants.WRAPPER) QueryWrapper queryWrapper);
 }

+ 76 - 2
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursement/reimbursementInfo/mapper/xml/ReimbursementInfoMapper.xml

@@ -15,13 +15,87 @@
 			b.user_name AS `name`,
 			b.dept_name,
 			a.reim_date,
-			b.number
+			b.`number`,
+			a.type,
+			a.proc_ins_id,
+			a.process_definition_id,
+			d.ID_ AS task_id
 		FROM
 			reimbursement_info a
-			LEFT JOIN reimbursement_detail_info b ON a.id = b.info_id
+			LEFT JOIN reimbursement_detail_info b ON a.id = b.info_id AND b.del_flag = 0
 			LEFT JOIN sys_user c ON a.create_by =  c.id
+			LEFT JOIN act_ru_task d ON a.proc_ins_id = d.PROC_INST_ID_
 			${ew.customSqlSegment}
 		ORDER BY a.update_date DESC
 	</select>
 
+	<select id="findFiles" resultType="com.jeeplus.test.workContract.service.dto.WorkAttachmentDto">
+		SELECT
+			id,
+			url,
+			attachment_name AS `name`,
+			create_by AS `by`,
+			create_date
+		FROM
+			work_attachment
+		WHERE
+			del_flag = 0
+			AND attachment_id = #{id}
+	</select>
+
+	<update id="updateStatusById">
+		UPDATE reimbursement_info SET type = #{type}
+		<if test="type == '3'.toString">
+			, proc_ins_id = NULL, process_definition_id = NULL
+		</if>
+	    WHERE id = #{id}
+	</update>
+
+	<select id="findOfficeList" resultType="com.jeeplus.test.reimbursement.reimbursementInfo.service.dto.TreeUserDto">
+		SELECT id,`name`,parent_id FROM sys_office WHERE del_flag = 0
+	</select>
+
+	<select id="findUserList" resultType="com.jeeplus.test.reimbursement.reimbursementInfo.service.dto.TreeUserDto">
+		SELECT
+			a.id,
+			a.`name`,
+			a.office_id AS parent_id,
+			b.`name` AS office_name,
+			true AS is_user
+		FROM
+			sys_user a
+			LEFT JOIN sys_office b ON a.office_id = b.id
+		WHERE
+			a.del_flag = 0
+			<if test="name != null and name != ''">
+				a.`name` LIKE CONCAT ('%', #{name}, '%')
+			</if>
+	</select>
+
+	<select id="findExportList" resultType="com.jeeplus.test.reimbursement.reimbursementInfo.service.dto.RetureListDto">
+		SELECT
+			a.id,
+			a.`no`,
+			b.type_id,
+			b.type_name,
+			b.project_id,
+			b.project_name,
+			b.report_number,
+			a.user_name,
+			b.user_name AS `name`,
+			b.dept_name,
+			a.reim_date,
+			b.`number`,
+			a.type,
+			a.proc_ins_id,
+			a.process_definition_id,
+			d.ID_ AS task_id
+		FROM
+			reimbursement_info a
+			LEFT JOIN reimbursement_detail_info b ON a.id = b.info_id AND b.del_flag = 0
+			LEFT JOIN sys_user c ON a.create_by =  c.id
+			LEFT JOIN act_ru_task d ON a.proc_ins_id = d.PROC_INST_ID_
+			${ew.customSqlSegment}
+		ORDER BY a.update_date DESC
+	</select>
 </mapper>

+ 121 - 26
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursement/reimbursementInfo/service/ReimbursementInfoService.java

@@ -21,9 +21,11 @@ import com.jeeplus.test.reimbursement.reimbursementInfo.mapper.ReimbursementInfo
 import com.jeeplus.test.reimbursement.reimbursementInfo.service.dto.QueryListDto;
 import com.jeeplus.test.reimbursement.reimbursementInfo.service.dto.RetureListDto;
 import com.jeeplus.test.reimbursement.reimbursementInfo.service.dto.SaveInfoDto;
+import com.jeeplus.test.reimbursement.reimbursementInfo.service.dto.TreeUserDto;
 import com.jeeplus.test.workContract.service.WorkContractService;
 import com.jeeplus.test.workContract.service.dto.WorkAttachmentDto;
-import org.apache.commons.beanutils.BeanUtils;
+import com.jeeplus.test.workContract.service.dto.WorkContractInfoDto;
+import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -63,21 +65,22 @@ public class ReimbursementInfoService {
          * b表是reimbursementDetailInfo
          * c表是sysUser
          */
+        queryWrapper.eq("a.del_flag", 0);
         // 报销项目
         if (StringUtils.isNotEmpty(dto.getProject())) {
-            queryWrapper.eq("b.project_id", dto.getProject()).or().like("b.project_name", dto.getProject());
+            queryWrapper.apply("(b.project_id = {0} OR b.project_name LIKE {1})", dto.getProject(), "%" + dto.getProject() + "%");
         }
         // 报销时间
         if (dto.getDates() != null) {
-            queryWrapper.between("a.create_date", dto.getDates()[0], dto.getDates()[1]);
+            queryWrapper.between("a.reim_date", dto.getDates()[0], dto.getDates()[1]);
         }
         // 经办人
         if (StringUtils.isNotEmpty(dto.getHandled())) {
-            queryWrapper.eq("a.create_by", dto.getHandled()).or().like("c.user_name", dto.getHandled());
+            queryWrapper.apply("(a.create_by = {0} OR c.name LIKE {1})", dto.getHandled(), "%" + dto.getHandled() + "%");
         }
         // 报销人
-        if (StringUtils.isNotEmpty(dto.getRemiBy())) {
-            queryWrapper.eq("b.user_id", dto.getRemiBy()).or().like("b.user_name", dto.getRemiBy());
+        if (StringUtils.isNotEmpty(dto.getReimBy())) {
+            queryWrapper.apply("( b.user_id = {0} OR b.user_name LIKE {1} )", dto.getReimBy(), "%" + dto.getReimBy() + "%");
         }
         // 报销状态
         if (StringUtils.isNotEmpty(dto.getType())) {
@@ -85,11 +88,11 @@ public class ReimbursementInfoService {
         }
         // 报销部门
         if (StringUtils.isNotEmpty(dto.getDepartment())) {
-            queryWrapper.eq("b.dept_id", dto.getDepartment()).or().like("b.dept_name", dto.getDepartment());
+            queryWrapper.apply("( b.dept_id = {0} OR b.dept_name LIKE {1} )", dto.getDepartment(), "%" + dto.getDepartment() + "%");
         }
         // 报销类别
         if (StringUtils.isNotEmpty(dto.getRemiType())) {
-            queryWrapper.eq("b.type_id", dto.getRemiType()).or().like("b.type_name", dto.getRemiType());
+            queryWrapper.apply(" (b.type_id = {0} OR b.type_name LIKE {1}) ", dto.getRemiType(), "%" + dto.getRemiType() + "%");
         }
         // 报销金额
         if (dto.getAmounts() != null) {
@@ -126,6 +129,7 @@ public class ReimbursementInfoService {
         ReimbursementInfo info = new ReimbursementInfo();
         BeanUtils.copyProperties(dto, info);
         info.setId(id);
+        info.setNo(no);
         info.setCreateBy(userDTO.getId());
         info.setCreateDate(new Date());
         info.setUpdateBy(userDTO.getId());
@@ -165,13 +169,13 @@ public class ReimbursementInfoService {
             }
         }
         // 保存附件列表信息
-        if (CollectionUtils.isNotEmpty(dto.getWorkAttachments())) {
-            workContractService.saveFiles(dto.getWorkAttachments(), userDTO, id);
+        if (CollectionUtils.isNotEmpty(dto.getFiles())) {
+            workContractService.saveFiles(dto.getFiles(), userDTO, id);
         }
-        return "操作成功";
+        return id;
     }
 
-    public String update(SaveInfoDto dto, UserDTO userDTO) throws Exception{
+    public String update(SaveInfoDto dto, UserDTO userDTO) {
         // 修改基础信息
         ReimbursementInfo info = new ReimbursementInfo();
         BeanUtils.copyProperties(dto, info);
@@ -219,10 +223,10 @@ public class ReimbursementInfoService {
             }
         }
         // 修改附件信息列表
-        if (CollectionUtils.isNotEmpty(dto.getWorkAttachments())) {
-            workContractService.updateFiles(dto.getWorkAttachments(), userDTO, dto.getId());
+        if (CollectionUtils.isNotEmpty(dto.getFiles())) {
+            workContractService.updateFiles(dto.getFiles(), userDTO, dto.getId());
         }
-        return "操作成功";
+        return dto.getId();
     }
 
     public String remove(String id) {
@@ -243,7 +247,7 @@ public class ReimbursementInfoService {
         return "操作成功";
     }
 
-    public SaveInfoDto findById(String id) throws Exception{
+    public SaveInfoDto findById(String id) {
         SaveInfoDto dto = new SaveInfoDto();
         // 查询基础信息表
         ReimbursementInfo info = infoMapper.selectById(id);
@@ -259,17 +263,13 @@ public class ReimbursementInfoService {
         List<ReimbursementAmountInfo> amountInfos = amountInfoMapper.selectList(amountInfoLambdaQueryWrapper);
         dto.setAmountInfos(amountInfos);
         // 查询附件信息
-        LambdaQueryWrapper<WorkAttachment> wrapper = new LambdaQueryWrapper<>();
-        wrapper.eq(WorkAttachment::getAttachmentId, id);
-        List<WorkAttachment> workAttachments = ossServiceMapper.selectList(wrapper);
-        List<WorkAttachmentDto> dtos = new ArrayList<>();
-        for (WorkAttachment i : workAttachments) {
-            WorkAttachmentDto workAttachmentDto = new WorkAttachmentDto();
-            BeanUtils.copyProperties(i, workAttachmentDto);
-            workAttachmentDto.setCreateBy(UserUtils.get(i.getId()));
-            dtos.add(workAttachmentDto);
+        List<WorkAttachmentDto> files = infoMapper.findFiles(id);
+        if (CollectionUtils.isNotEmpty(files)) {
+            for (WorkAttachmentDto i : files) {
+                i.setCreateBy(UserUtils.get(i.getBy()));
+            }
         }
-        dto.setWorkAttachments(dtos);
+        dto.setFiles(files);
         return dto;
     }
 
@@ -282,4 +282,99 @@ public class ReimbursementInfoService {
         }
         return false;
     }
+
+    public void updateStatusById(RetureListDto dto) {
+        infoMapper.updateStatusById(dto.getId(), dto.getType());
+    }
+
+    //用户树形
+    public List<TreeUserDto> userTree(String name) {
+        List<TreeUserDto> list = new ArrayList<>();
+        // 查询部门
+        List<TreeUserDto> officeList = infoMapper.findOfficeList();
+        if (CollectionUtils.isNotEmpty(officeList)) {
+            list.addAll(officeList);
+        }
+        // 查询用户
+        List<TreeUserDto> userList = infoMapper.findUserList(name);
+        if (CollectionUtils.isNotEmpty(userList)) {
+            list.addAll(userList);
+        }
+        return list;
+    }
+
+    /**
+     * 下载列表查询
+     */
+    public List<RetureListDto> exportList(QueryListDto dto) throws Exception{
+        QueryWrapper<QueryListDto> queryWrapper = QueryWrapperGenerator.buildQueryCondition(dto, QueryListDto.class);
+        /**
+         * a表是reimbursementInfo
+         * b表是reimbursementDetailInfo
+         * c表是sysUser
+         */
+        queryWrapper.eq("a.del_flag", 0);
+        // 报销项目
+        if (StringUtils.isNotEmpty(dto.getProject())) {
+            queryWrapper.apply("(b.project_id = {0} OR b.project_name LIKE {1})", dto.getProject(), "%" + dto.getProject() + "%");
+        }
+        // 报销时间
+        if (dto.getDates() != null) {
+            queryWrapper.between("a.reim_date", dto.getDates()[0], dto.getDates()[1]);
+        }
+        // 经办人
+        if (StringUtils.isNotEmpty(dto.getHandled())) {
+            queryWrapper.apply("(a.create_by = {0} OR c.name LIKE {1})", dto.getHandled(), "%" + dto.getHandled() + "%");
+        }
+        // 报销人
+        if (StringUtils.isNotEmpty(dto.getReimBy())) {
+            queryWrapper.apply("( b.user_id = {0} OR b.user_name LIKE {1} )", dto.getReimBy(), "%" + dto.getReimBy() + "%");
+        }
+        // 报销状态
+        if (StringUtils.isNotEmpty(dto.getType())) {
+            queryWrapper.eq("a.type", dto.getType());
+        }
+        // 报销部门
+        if (StringUtils.isNotEmpty(dto.getDepartment())) {
+            queryWrapper.apply("( b.dept_id = {0} OR b.dept_name LIKE {1} )", dto.getDepartment(), "%" + dto.getDepartment() + "%");
+        }
+        // 报销类别
+        if (StringUtils.isNotEmpty(dto.getRemiType())) {
+            queryWrapper.apply(" (b.type_id = {0} OR b.type_name LIKE {1}) ", dto.getRemiType(), "%" + dto.getRemiType() + "%");
+        }
+        // 报销金额
+        if (dto.getAmounts() != null) {
+            if (StringUtils.isNotEmpty(dto.getAmounts()[0])) {
+                queryWrapper.ge("b.number", dto.getAmounts()[0]);
+            }
+            if (StringUtils.isNotEmpty(dto.getAmounts()[1])) {
+                queryWrapper.le("b.number", dto.getAmounts()[1]);
+            }
+        }
+        // 报告号
+        if (StringUtils.isNotEmpty(dto.getReportNumber())) {
+            queryWrapper.like("b.report_number", dto.getReportNumber());
+        }
+        List<RetureListDto> exportList = infoMapper.findExportList(queryWrapper);
+        if (CollectionUtils.isNotEmpty(exportList)) {
+            for (RetureListDto retureListDto : exportList) {
+                if ("1".equals(retureListDto.getType())) {
+                    retureListDto.setType("暂存");
+                }
+                if ("2".equals(retureListDto.getType())) {
+                    retureListDto.setType("审批中");
+                }
+                if ("3".equals(retureListDto.getType())) {
+                    retureListDto.setType("撤回");
+                }
+                if ("4".equals(retureListDto.getType())) {
+                    retureListDto.setType("驳回");
+                }
+                if ("5".equals(retureListDto.getType())) {
+                    retureListDto.setType("已完成");
+                }
+            }
+        }
+        return exportList;
+    }
 }

+ 1 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursement/reimbursementInfo/service/dto/QueryListDto.java

@@ -24,7 +24,7 @@ public class QueryListDto extends BaseEntity {
     /**
      * 报销人
      */
-    private String remiBy;
+    private String reimBy;
 
     /**
      * 报销状态

+ 31 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursement/reimbursementInfo/service/dto/RetureListDto.java

@@ -1,8 +1,11 @@
 package com.jeeplus.test.reimbursement.reimbursementInfo.service.dto;
 
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import org.apache.poi.hpsf.Decimal;
 
+import java.math.BigDecimal;
 import java.util.Date;
 
 @Data
@@ -16,6 +19,7 @@ public class RetureListDto {
     /**
      * 报销编号
      */
+    @Excel(name = "报销编号", width = 30, orderNum = "1")
     private String no;
 
     /**
@@ -26,6 +30,7 @@ public class RetureListDto {
     /**
      * 报销类别
      */
+    @Excel(name = "报销类别", width = 30, orderNum = "2")
     private String typeName;
 
     /**
@@ -36,36 +41,61 @@ public class RetureListDto {
     /**
      * 报销项目
      */
+    @Excel(name = "报销项目", width = 30, orderNum = "3")
     private String projectName;
 
     /**
      * 报告号
      */
+    @Excel(name = "报告号", width = 30, orderNum = "4")
     private String reportNumber;
 
     /**
      * 经办人
      */
+    @Excel(name = "经办人", width = 30, orderNum = "5")
     private String userName;
 
     /**
      * 报销人
      */
+    @Excel(name = "报销人", width = 30, orderNum = "6")
     private String name;
 
     /**
      * 报销部门
      */
+    @Excel(name = "报销部门", width = 30, orderNum = "7")
     private String deptName;
 
     /**
      * 报销日期
      */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "报销日期", width = 30, orderNum = "8")
     private Date reimDate;
 
     /**
      * 报销金额
      */
-    private Decimal amount;
+    @Excel(name = "报销金额", width = 30, orderNum = "9")
+    private BigDecimal number;
 
+    /**
+     * 报销状态
+     */
+    @Excel(name = "报销状态", width = 30, orderNum = "10")
+    private String type;
+
+    /**
+     * 流程id
+     */
+    private String procInsId;
+
+    /**
+     *
+     */
+    private String processDefinitionId;
+
+    private String taskId;
 }

+ 3 - 3
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursement/reimbursementInfo/service/dto/SaveInfoDto.java

@@ -16,7 +16,7 @@ import java.util.List;
 public class SaveInfoDto extends BaseEntity {
 
     //合同编号类型(字典值)
-    public static final String BIZ_CODE = "2";
+    public static final String BIZ_CODE = "5";
 
     /**
      * 经办人id
@@ -43,7 +43,7 @@ public class SaveInfoDto extends BaseEntity {
      */
     @DateTimeFormat(pattern = "yyyy-MM-dd")
     @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
-    private Date remiDate;
+    private Date reimDate;
 
     /**
      * 备注
@@ -69,6 +69,6 @@ public class SaveInfoDto extends BaseEntity {
 
     private List<ReimbursementAmountInfo> amountInfos;
 
-    private List<WorkAttachmentDto> workAttachments;
+    private List<WorkAttachmentDto> files;
 
 }

+ 19 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursement/reimbursementInfo/service/dto/TreeUserDto.java

@@ -0,0 +1,19 @@
+package com.jeeplus.test.reimbursement.reimbursementInfo.service.dto;
+
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+@Data
+public class TreeUserDto extends BaseEntity {
+
+    private String name;
+
+    private String parentId;
+
+    private String officeName;
+
+    private Boolean disable = false;
+
+    private Boolean isUser = false;
+
+}

+ 2 - 2
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursement/reimbursementType/controller/ReimbursementTypeController.java

@@ -81,8 +81,8 @@ public class ReimbursementTypeController {
      */
     @ApiOperation(value = "查询树形")
     @GetMapping("/treeData")
-    public ResponseEntity<List<ReimbursementTypeInfo>> treeData(@RequestParam(required = false) String extId) {
-        List<ReimbursementTypeInfo> infos = treeService.treeData(extId);
+    public ResponseEntity<List<ReimbursementTypeInfo>> treeData(@RequestParam(required = false) String extId, @RequestParam(required = false) String type) throws Exception{
+        List<ReimbursementTypeInfo> infos = treeService.treeDataForType(extId, type);
         return ResponseEntity.ok(infos);
     }
 

+ 3 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursement/reimbursementType/domain/ReimbursementTypeInfo.java

@@ -75,4 +75,7 @@ public class ReimbursementTypeInfo extends TreeEntity<ReimbursementTypeInfo> {
     private String parentId;
 
     private String parentIds;
+
+    @TableField(exist = false)
+    private Boolean disabled = false;
 }

+ 106 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursement/reimbursementType/service/ReimbursementTypeForTreeDataService.java

@@ -1,10 +1,116 @@
 package com.jeeplus.test.reimbursement.reimbursementType.service;
 
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
 import com.jeeplus.core.service.TreeService;
+import com.jeeplus.core.service.dto.TreeDTO;
 import com.jeeplus.test.reimbursement.reimbursementType.domain.ReimbursementTypeInfo;
 import com.jeeplus.test.reimbursement.reimbursementType.mapper.ReimbursementTypeMapper;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
 @Service
 public class ReimbursementTypeForTreeDataService extends TreeService<ReimbursementTypeMapper, ReimbursementTypeInfo> {
+
+    @Resource
+    private ReimbursementTypeMapper typeMapper;
+
+    /**
+     * 获取JSON树形数据。
+     *
+     * @param extId 排除的ID
+     * @param type 禁选类型
+     * @return
+     */
+    public List<ReimbursementTypeInfo> treeDataForType(String extId, String type) throws Exception{
+        List <ReimbursementTypeInfo> allList = super.list (new LambdaQueryWrapper<>( (Class <ReimbursementTypeInfo>) entityClass ).orderByAsc ( ReimbursementTypeInfo::getSort ));
+        ReimbursementTypeInfo root = entityClass.getConstructor ( ).newInstance ( );
+        root.setId ( TreeDTO.getRootId () );
+        List <ReimbursementTypeInfo> rootTree = this.formatListToTreeForType ( root, allList, extId, type );
+        return rootTree;
+    }
+
+    /**
+     * 以root为根节点, 将allList从线性列表转为树形列表
+     *
+     * @param root    根节点, 为空抛出空指针异常
+     * @param allList 所有需要参与构造为树的列表
+     * @param extId   需要排除在树之外的节点(子节点一并被排除)
+     * @return java.util.List<T>
+     * @Author 滕鑫源
+     * @Date 2020/10/23 17:04
+     **/
+    public List <ReimbursementTypeInfo> formatListToTreeForType (ReimbursementTypeInfo root, List <ReimbursementTypeInfo> allList, String extId, String type) {
+        String rootId = root.getId ( );
+        // 最终的树形态
+        List <ReimbursementTypeInfo> trees = Lists.newArrayList ( );
+
+        // 把需要构造树的所有列表, 根据以父id作为key, 整理为列表
+        Map<String, List <ReimbursementTypeInfo>> treeMap = Maps.newHashMap ( );
+        for (ReimbursementTypeInfo entity : allList) {
+            List <ReimbursementTypeInfo> entities = treeMap.get ( entity.getParentId ( ) );
+            if ( entities == null ) {
+                entities = Lists.newLinkedList ( );
+            }
+
+            // 剔除排除项, 构造treeMap, 转递归为线性操作
+            if ( StrUtil.isBlank ( extId ) || (!extId.equals ( entity.getId ( ) ) && entity.getParentIds ( ).indexOf ( "," + extId + "," ) == -1) ) {
+                entities.add ( entity );
+                treeMap.put ( entity.getParentId ( ), entities );
+            }
+
+            if (StringUtils.isNotEmpty(type)) {
+                //禁选类型设置disable值为true
+                if (type.contains(entity.getLevel())) {
+                    entity.setDisabled(true);
+                }
+            }
+        }
+
+        // 没有给定的子树, 返回空树
+        if ( treeMap.get ( rootId ) == null || treeMap.get ( rootId ).isEmpty ( ) ) {
+            return trees;
+        }
+
+        // 开始递归格式化
+        List <ReimbursementTypeInfo> children = treeMap.get ( rootId );
+        for (ReimbursementTypeInfo parent : children) {
+            formatFillChildren ( parent, treeMap );
+            trees.add ( parent );
+        }
+        if ( StrUtil.equals ( rootId, TreeDTO.getRootId () ) ) {
+            return children;
+        } else {
+            root.setChildren ( trees );
+            return Lists.newArrayList ( root );
+        }
+    }
+
+    /**
+     * 从treeMap中取出子节点填入parent, 并递归此操作
+     *
+     * @param parent
+     * @param treeMap
+     * @return void
+     * @Author 滕鑫源
+     * @Date 2020/9/30 16:33
+     **/
+    private void formatFillChildren(ReimbursementTypeInfo parent, Map <String, List <ReimbursementTypeInfo>> treeMap) {
+        List <ReimbursementTypeInfo> children = treeMap.get ( parent.getId ( ) );
+        parent.setChildren ( children );
+        if ( children != null && !children.isEmpty ( ) ) {
+            for (ReimbursementTypeInfo child : children) {
+                formatFillChildren ( child, treeMap );
+            }
+        }
+    }
+
 }

+ 6 - 6
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/service/OfficeService.java

@@ -185,10 +185,10 @@ public class OfficeService extends TreeService<OfficeMapper, Office> {
         String rootId = root.getId ();
 
         // type为1时,是选择公司,因此禁用type为2的部门节点
-        if(OfficeTypeEnum.COMPANY.getValue ().equals(type) && root.getType().equals(OfficeTypeEnum.OFFICE.getValue ())){
-            root.setDisabled(true);
-        }else {
+        if(OfficeTypeEnum.COMPANY.getValue ().equals(type) && root.getType().equals(OfficeTypeEnum.COMPANY.getValue ())){
             root.setDisabled(false);
+        }else {
+            root.setDisabled(true);
         }
         // 最终的树形态
         List<OfficeDTO> trees = Lists.newArrayList ();
@@ -203,10 +203,10 @@ public class OfficeService extends TreeService<OfficeMapper, Office> {
 
             if (this.isUseAble ( extId, type,root, showAll )){
                 // type为2时,是选择部门,因此禁用type为1的公司节点
-                if(OfficeTypeEnum.COMPANY.getValue ().equals(type) && entity.getType().equals(OfficeTypeEnum.OFFICE.getValue ())){
-                    entity.setDisabled(true);
-                }else {
+                if(OfficeTypeEnum.COMPANY.getValue ().equals(type) && entity.getType().equals(OfficeTypeEnum.COMPANY.getValue ())){
                     entity.setDisabled(false);
+                }else {
+                    entity.setDisabled(true);
                 }
                 offices.add (entity);
                 treeMap.put (entity.getParent ().getId (), offices);