Bläddra i källkod

下载功能开发提交

user5 3 år sedan
förälder
incheckning
f59e9a29b8
43 ändrade filer med 1241 tillägg och 134 borttagningar
  1. 36 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/controller/AccountantReimbursementBusinessTwoController.java
  2. 34 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/controller/AccountantReimbursementSysController.java
  3. 36 2
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/controller/AccountantReimbursementUserController.java
  4. 8 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/domain/dto/AccountantReimbursementBusinessTwoDTO.java
  5. 14 11
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/domain/dto/AccountantReimbursementDTO.java
  6. 18 9
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/domain/dto/AccountantReimbursementUserDTO.java
  7. 1 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/mapper/xml/AccountantReimbursementBusinessTwoMapper.xml
  8. 5 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/mapper/xml/AccountantReimbursementUserMapper.xml
  9. 9 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/service/AccountantReimbursementSysService.java
  10. 92 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/service/impl/AccountantReimbursementSysServiceImpl.java
  11. 48 11
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAssess/controller/AssessReimbursementBusinessTwoController.java
  12. 34 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAssess/controller/AssessReimbursementSysController.java
  13. 36 2
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAssess/controller/AssessReimbursementUserController.java
  14. 8 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAssess/domain/dto/AssessReimbursementBusinessTwoDTO.java
  15. 14 11
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAssess/domain/dto/AssessReimbursementDTO.java
  16. 18 9
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAssess/domain/dto/AssessReimbursementUserDTO.java
  17. 1 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAssess/mapper/xml/AssessReimbursementBusinessTwoMapper.xml
  18. 5 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAssess/mapper/xml/AssessReimbursementUserMapper.xml
  19. 9 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAssess/service/AssessReimbursementSysService.java
  20. 93 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAssess/service/impl/AssessReimbursementSysServiceImpl.java
  21. 48 11
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementProject/controller/ProjectReimbursementBusinessTwoController.java
  22. 35 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementProject/controller/ProjectReimbursementSysController.java
  23. 36 2
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementProject/controller/ProjectReimbursementUserController.java
  24. 8 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementProject/domain/dto/ProjectReimbursementBusinessTwoDTO.java
  25. 14 11
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementProject/domain/dto/ProjectReimbursementDTO.java
  26. 18 9
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementProject/domain/dto/ProjectReimbursementUserDTO.java
  27. 1 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementProject/mapper/xml/ProjectReimbursementBusinessTwoMapper.xml
  28. 5 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementProject/mapper/xml/ProjectReimbursementUserMapper.xml
  29. 9 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementProject/service/ProjectReimbursementSysService.java
  30. 93 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementProject/service/impl/ProjectReimbursementSysServiceImpl.java
  31. 37 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/controller/ReimbursementSysController.java
  32. 38 2
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/controller/ReimbursementUserController.java
  33. 34 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/controller/WuHanReimbursementSysController.java
  34. 17 12
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/domain/dto/ReimbursementDTO.java
  35. 18 12
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/domain/dto/ReimbursementUserDTO.java
  36. 70 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/domain/dto/ReimbursementUserImportDTO.java
  37. 18 12
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/domain/dto/WuHanReimbursementDTO.java
  38. 5 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/mapper/xml/ReimbursementUserMapper.xml
  39. 8 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/service/ReimbursementSysService.java
  40. 3 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/service/WuHanReimbursementSysService.java
  41. 92 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/service/impl/ReimbursementSysServiceImpl.java
  42. 91 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/service/impl/WuHanReimbursementSysServiceImpl.java
  43. 24 0
      jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/controller/UserController.java

+ 36 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/controller/AccountantReimbursementBusinessTwoController.java

@@ -4,19 +4,26 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.google.common.collect.Lists;
 import com.jeeplus.aop.logging.annotation.ApiLog;
+import com.jeeplus.core.excel.ExcelOptions;
+import com.jeeplus.core.excel.ExportMode;
+import com.jeeplus.core.excel.utils.EasyPoiUtil;
 import com.jeeplus.sys.utils.StringUtils;
 import com.jeeplus.test.reimbursementAccountant.domain.dto.AccountantReimbursementBusinessTwoDTO;
 import com.jeeplus.test.reimbursementAccountant.domain.dto.AccountantReimbursementDTO;
 import com.jeeplus.test.reimbursementAccountant.service.AccountantReimbursementBusinessService;
 import com.jeeplus.test.reimbursementAccountant.service.AccountantReimbursementBusinessTwoService;
+import com.jeeplus.test.reimbursementProject.domain.dto.ProjectReimbursementBusinessTwoDTO;
+import io.swagger.annotations.ApiOperation;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletResponse;
 import java.math.BigDecimal;
 import java.util.Collections;
+import java.util.List;
 import java.util.stream.Collectors;
 
 @RestController
@@ -99,4 +106,33 @@ public class AccountantReimbursementBusinessTwoController {
     public ResponseEntity findSelectCodeListByYear(@PathVariable("year")String year){
         return ResponseEntity.ok(accountantReimbursementBusinessTwoService.findSelectCodeListByYear(year));
     }
+
+
+    /**
+     * 导出兴光会计无票报销信息数据
+     * @param reimbursementUserDTO
+     * @param page
+     * @param response
+     * @throws Exception
+     */
+    @ApiLog("导出兴光会计无票报销信息数据")
+    @GetMapping("export")
+    @ApiOperation(value = "导出兴光会计无票报销信息数据excel")
+    public void exportFile(AccountantReimbursementBusinessTwoDTO reimbursementUserDTO, Page <AccountantReimbursementBusinessTwoDTO> page, ExcelOptions options, HttpServletResponse response) {
+        String fileName = options.getFilename ( );
+
+        List<AccountantReimbursementBusinessTwoDTO> result;
+        if ( ExportMode.current.equals ( options.getMode ( ) ) ) {
+            result = accountantReimbursementBusinessTwoService.findListPage ( page, reimbursementUserDTO ).getRecords();
+        } else if ( ExportMode.selected.equals ( options.getMode ( ) ) ) {
+            result = accountantReimbursementBusinessTwoService.findListPage ( page, reimbursementUserDTO ).getRecords().stream ( ).filter ( reimbursement ->
+                    options.getSelectIds ( ).contains ( reimbursement.getId ( ) )
+            ).collect ( Collectors.toList ( ) );
+        } else {
+            page.setSize ( -1 );
+            page.setCurrent ( 0 );
+            result = accountantReimbursementBusinessTwoService.findListPage ( page, reimbursementUserDTO ).getRecords();
+        }
+        EasyPoiUtil.exportExcel ( result, "兴光会计无票报销信息数据",  options.getSheetName ( ), AccountantReimbursementBusinessTwoDTO.class, fileName, response );
+    }
 }

+ 34 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/controller/AccountantReimbursementSysController.java

@@ -5,12 +5,16 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.google.common.collect.Lists;
 import com.jeeplus.aop.demo.annotation.DemoMode;
 import com.jeeplus.aop.logging.annotation.ApiLog;
+import com.jeeplus.core.excel.ExcelOptions;
+import com.jeeplus.core.excel.ExportMode;
 import com.jeeplus.core.excel.utils.EasyPoiUtil;
 import com.jeeplus.sys.service.dto.RoleDTO;
 import com.jeeplus.sys.service.dto.UserDTO;
 import com.jeeplus.sys.utils.StringUtils;
 import com.jeeplus.test.reimbursementAccountant.domain.dto.AccountantReimbursementDTO;
 import com.jeeplus.test.reimbursementAccountant.service.AccountantReimbursementSysService;
+import com.jeeplus.test.reimbursementProject.domain.dto.ProjectReimbursementDTO;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -18,12 +22,14 @@ import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * @author li-peike
@@ -258,4 +264,32 @@ public class AccountantReimbursementSysController {
         service.addBatchReimbursement (invoiceIdList);
         return ResponseEntity.ok ("批量报销操作成功");
     }
+
+    /**
+     * 导出分所报销数据
+     * @param reimbursementDTO
+     * @param page
+     * @param response
+     * @throws Exception
+     */
+    @ApiLog("导出兴光会计报销数据")
+    @GetMapping("export")
+    @ApiOperation(value = "导出兴光会计报销数据excel")
+    public void exportFile(AccountantReimbursementDTO reimbursementDTO, Page <AccountantReimbursementDTO> page, ExcelOptions options, HttpServletResponse response) {
+        String fileName = options.getFilename ( );
+
+        List <AccountantReimbursementDTO> result;
+        if ( ExportMode.current.equals ( options.getMode ( ) ) ) {
+            result = service.findPage ( page, reimbursementDTO );
+        } else if ( ExportMode.selected.equals ( options.getMode ( ) ) ) {
+            result = service.findPage ( page, reimbursementDTO ).stream ( ).filter ( reimbursement ->
+                    options.getSelectIds ( ).contains ( reimbursement.getId ( ) )
+            ).collect ( Collectors.toList ( ) );
+        } else {
+            page.setSize ( -1 );
+            page.setCurrent ( 0 );
+            result = service.findPage ( page, reimbursementDTO );
+        }
+        EasyPoiUtil.exportExcel ( result, "兴光会计报销数据",  options.getSheetName ( ), AccountantReimbursementDTO.class, fileName, response );
+    }
 }

+ 36 - 2
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/controller/AccountantReimbursementUserController.java

@@ -6,6 +6,8 @@ import com.google.common.collect.Lists;
 import com.jeeplus.aop.demo.annotation.DemoMode;
 import com.jeeplus.aop.logging.annotation.ApiLog;
 import com.jeeplus.common.beanvalidator.BeanValidators;
+import com.jeeplus.core.excel.ExcelOptions;
+import com.jeeplus.core.excel.ExportMode;
 import com.jeeplus.core.excel.utils.EasyPoiUtil;
 import com.jeeplus.sys.service.dto.UserDTO;
 import com.jeeplus.sys.utils.DictUtils;
@@ -13,6 +15,8 @@ import com.jeeplus.sys.utils.StringUtils;
 import com.jeeplus.test.reimbursementAccountant.domain.dto.AccountantReimbursementBusinessReturnDTO;
 import com.jeeplus.test.reimbursementAccountant.domain.dto.AccountantReimbursementUserDTO;
 import com.jeeplus.test.reimbursementAccountant.service.AccountantReimbursementUserService;
+import com.jeeplus.test.reimbursementAssess.domain.dto.AssessReimbursementUserDTO;
+import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementUserImportDTO;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
@@ -26,6 +30,7 @@ import java.time.LocalDate;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * @author 徐滕
@@ -173,8 +178,8 @@ public class AccountantReimbursementUserController {
     @ApiOperation(value = "下载模板")
     public void importFileTemplate(HttpServletResponse response) {
         String fileName = "报销人员数据导入模板.xlsx";
-        List<AccountantReimbursementUserDTO> list = Lists.newArrayList();
-        EasyPoiUtil.exportExcel ( list, "报销人员数据",  "报销人员数据", AccountantReimbursementUserDTO.class, fileName, response );
+        List<ReimbursementUserImportDTO> list = Lists.newArrayList();
+        EasyPoiUtil.exportExcel ( list, "报销人员数据",  "报销人员数据", ReimbursementUserImportDTO.class, fileName, response );
     }
 
     /**
@@ -244,4 +249,33 @@ public class AccountantReimbursementUserController {
             return ResponseEntity.badRequest().body ( "导入员工报销数据失败!失败信息:" + e.getMessage ( ) );
         }
     }
+
+
+    /**
+     * 导出兴光会计人员信息数据
+     * @param reimbursementUserDTO
+     * @param page
+     * @param response
+     * @throws Exception
+     */
+    @ApiLog("导出兴光会计人员信息数据")
+    @GetMapping("export")
+    @ApiOperation(value = "导出兴光会计人员信息数据excel")
+    public void exportFile(AccountantReimbursementUserDTO reimbursementUserDTO, Page <AccountantReimbursementUserDTO> page, ExcelOptions options, HttpServletResponse response) {
+        String fileName = options.getFilename ( );
+
+        List <AccountantReimbursementUserDTO> result;
+        if ( ExportMode.current.equals ( options.getMode ( ) ) ) {
+            result = service.findList ( page, reimbursementUserDTO ).getRecords();
+        } else if ( ExportMode.selected.equals ( options.getMode ( ) ) ) {
+            result = service.findList ( page, reimbursementUserDTO ).getRecords().stream ( ).filter ( reimbursement ->
+                    options.getSelectIds ( ).contains ( reimbursement.getId ( ) )
+            ).collect ( Collectors.toList ( ) );
+        } else {
+            page.setSize ( -1 );
+            page.setCurrent ( 0 );
+            result = service.findList ( page, reimbursementUserDTO ).getRecords();
+        }
+        EasyPoiUtil.exportExcel ( result, "兴光会计人员信息数据",  options.getSheetName ( ), AccountantReimbursementUserDTO.class, fileName, response );
+    }
 }

+ 8 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/domain/dto/AccountantReimbursementBusinessTwoDTO.java

@@ -1,5 +1,6 @@
 package com.jeeplus.test.reimbursementAccountant.domain.dto;
 
+import cn.afterturn.easypoi.excel.annotation.Excel;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.jeeplus.core.domain.BaseEntity;
 import lombok.*;
@@ -18,13 +19,19 @@ public class AccountantReimbursementBusinessTwoDTO extends BaseEntity {
     private String businessCode;  //业务编号
     private String businessCodeId;  //业务编号Id
     private String userId;  //报销人id
+    @Excel(name = "报销人",width = 6)
     private String userName;  //报销人
+    @Excel(name = "报销年份",width = 6)
     private String year;    //报销年份
     private String reimbursementQuota;  //年报销额度
     private String reimbursementQuotaDay;  //日报销额度
-    private String reimbursementDay;  //报销天数
     private String surplusReimbursementDay;  //剩余报销天数
     private String reimbursementType;  //报销类型(1:正常报销;2:补差)
+    @Excel(name = "报销类型")
+    private String reimbursementTypeStr;  //报销类型(导出Str)
+    @Excel(name = "报销天数",type = 10)
+    private String reimbursementDay;  //报销天数
+    @Excel(name = "报销额度",type = 10)
     private String reimbursementAmount;  //报销额度
     private String remainReimbursementAmount;  //剩余报销额度
     private String remarks; //备注

+ 14 - 11
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/domain/dto/AccountantReimbursementDTO.java

@@ -29,19 +29,25 @@ public class AccountantReimbursementDTO extends TreeEntity<AccountantReimburseme
     private String invoiceCode;     //发票代码
     @Excel(name = "发票号码")
     private String invoiceNumber;   //发票号码
+    @Excel(name = "金额",type = 10)
+    private String money;       //金额
+    @Excel(name = "税额",type = 10)
+    private String tax;         //税额
+    @Excel(name = "收入",type = 10)
+    private String income;      //收入
+    //@Excel(name = "报销比例")
+    private String reimbursementRatio;    //报销比例
+    //@Excel(name = "已报金额",type = 10)
+    private String allAlreadyReimbursementQuota;    //总报销额度(已报金额)
+    //@Excel(name = "可报金额",type = 10)
+    private String canReimbursementAmount;    //可报销额度
     @Excel(name = "购方企业名称")
     private String firmName;        //购方企业名称
 
-    @Excel(name = "开票日期",importFormat = "yyyy-MM-dd",exportFormat = "yyyy-MM-dd")
+    @Excel(name = "开票日期",importFormat = "yyyy-MM-dd")
     private String makeTime;          //开票日期
     @Excel(name = "商品名称")
     private String name;     //商品名称
-    @Excel(name = "金额")
-    private String money;       //金额
-    @Excel(name = "税额")
-    private String tax;         //税额
-    @Excel(name = "收入")
-    private String income;      //收入
     @Excel(name = "申请人")
     private String proposer;        //申请人
     @Excel(name = "合伙人")
@@ -50,9 +56,6 @@ public class AccountantReimbursementDTO extends TreeEntity<AccountantReimburseme
     private String businessType;    //业务类型
     private String remarks;    //备注
     private Integer type;    //状态
-    private String reimbursementRatio;    //报销比例
-    private String allAlreadyReimbursementQuota;    //总报销额度(已报金额)
-    private String canReimbursementAmount;    //可报销额度
     private String surplusReimbursementAmount;    //剩余报销额度
     private String reimbursementType;    //报销比例
     private String gatheringStatus;    //收款状态
@@ -64,7 +67,7 @@ public class AccountantReimbursementDTO extends TreeEntity<AccountantReimburseme
     private String year;    //业务编码年份(相同的业务编码根据年份不同生成不同的数据列)(仅业务表中使用)
     private String randomBusinessCodeIndex;    //随即业务编码序号
 
-    @Excel(name = "收款日期",importFormat = "yyyy-MM-dd",exportFormat = "yyyy-MM-dd")
+    @Excel(name = "收款日期",importFormat = "yyyy-MM-dd")
     private String gatheringTime;     //收款日期
 
 

+ 18 - 9
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/domain/dto/AccountantReimbursementUserDTO.java

@@ -20,7 +20,7 @@ import javax.validation.constraints.NotNull;
 @TableName("zs_reimbursement_user_info")
 public class AccountantReimbursementUserDTO extends BaseEntity {
 
-    @Excel(name = "姓名")
+    @Excel(name = "姓名",width = 6)
     @Length(min = 1, max = 100)
     @NotNull(message = "姓名不能为空")
     private String userName;//员工姓名
@@ -29,6 +29,9 @@ public class AccountantReimbursementUserDTO extends BaseEntity {
     @NotNull(message = "部门不能为空")
     private String officeName;//部门名称
 
+    private String officeId;//部门id
+
+
     private String userId;  //报销人id
     private UserDTO user;   //报销人员信息
 
@@ -36,27 +39,33 @@ public class AccountantReimbursementUserDTO extends BaseEntity {
     @Length(min = 1, max = 100)
     @NotNull(message = "报销年份不能为空")
     private String year;    //报销年份
+    @Excel(name = "日报销额度")
+    @Length(min = 1, max = 100)
+    @NotNull(message = "日报销额度不能为空")
+    private String reimbursementQuotaDay;  //日报销额度
     @Excel(name = "年报销额度")
     @Length(min = 1, max = 100)
-    @NotNull(message = "年报销额度不能为空")
     private String reimbursementQuota;  //年报销额度
+    @Excel(name = "分所已报销额度", type = 10)
+    private String substationAlreadyReimbursementAmount;  //分所已报销额度
+    @Excel(name = "总所已报销额度", type = 10)
+    private String headquarterAlreadyReimbursementAmount;  //总所已报销额度
+    @Excel(name = "剩余额度", type = 10)
+    private String remainReimbursementAmount;  //剩余报销额度
+    @Excel(name = "已报天数")
+    private String alreadyReimbursementDay;  //已报销天数
+    @Excel(name = "剩余天数")
+    private String surplusReimbursementDay;  //剩余报销天数
 
     @Excel(name = "年可报销天数")
     @NotNull(message = "年可报销天数不能为空")
     private Integer reimbursementAllDay;  //年可报销天数
-    @Excel(name = "日报销额度")
-    @Length(min = 1, max = 100)
-    @NotNull(message = "日报销额度不能为空")
-    private String reimbursementQuotaDay;  //日报销额度
     private String reimbursementDay;  //报销天数
     private String reimbursementAmount;  //报销额度
-    private String remainReimbursementAmount;  //剩余报销额度
     private String alreadyReimbursementAmount;  //已报销额度
     private String remarks; //备注
 
 
-    private String alreadyReimbursementDay;  //已报销天数
-    private String surplusReimbursementDay;  //剩余报销天数
     private String surplusReimbursementAmount;  //剩余报销额度
     private String keyFlag; //用于判断使用
 

+ 1 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/mapper/xml/AccountantReimbursementBusinessTwoMapper.xml

@@ -30,6 +30,7 @@
         a.reimbursement_day as 'reimbursementDay',
         a.reimbursement_amount as 'reimbursementAmount',
         a.reimbursement_type as 'reimbursementType',
+        (case when a.reimbursement_type = '1' then '正常报销' when a.reimbursement_type = '2' then '补差' else '' end) as reimbursementTypeStr,
         su.name as 'userName'
     </sql>
     <sql id="reimbursementUserJoinColumns">

+ 5 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/mapper/xml/AccountantReimbursementUserMapper.xml

@@ -15,7 +15,8 @@
         a.reimbursement_all_day AS "reimbursementAllDay",
         a.reimbursement_quota_day AS "reimbursementQuotaDay",
         su.id as "user.id",
-        su.name as "user.name"
+        su.name as "user.name",
+        su.name as "userName"
     </sql>
 
     <sql id="reimbursementUserJoinColumns">
@@ -79,6 +80,9 @@
             <if test="reimbursementUser.userId != null and reimbursementUser.userId != ''">
                 and a.user_id = #{reimbursementUser.userId}
             </if>
+            <if test="reimbursementUser.officeId != null and reimbursementUser.officeId != ''">
+                and su.office_id in (select id from sys_office where del_flag = 0 and (id = #{reimbursementUser.officeId} or parent_ids like concat('%',#{reimbursementUser.officeId},'%')))
+            </if>
         </where>
         group by a.user_id,a.year
         order by a.update_date desc,a.year desc, a.user_id asc

+ 9 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/service/AccountantReimbursementSysService.java

@@ -3,6 +3,7 @@ package com.jeeplus.test.reimbursementAccountant.service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jeeplus.test.reimbursementAccountant.domain.dto.AccountantReimbursementDTO;
+import com.jeeplus.test.reimbursementProject.domain.dto.ProjectReimbursementDTO;
 
 import java.util.List;
 import java.util.Map;
@@ -37,6 +38,14 @@ public interface AccountantReimbursementSysService {
 
     IPage<AccountantReimbursementDTO> findList(Page<AccountantReimbursementDTO> page, AccountantReimbursementDTO reimbursement);
 
+    /**
+     * 导出数据获取
+     * @param page
+     * @param reimbursement
+     * @return
+     */
+    List<AccountantReimbursementDTO> findPage(Page<AccountantReimbursementDTO> page, AccountantReimbursementDTO reimbursement);
+
     IPage<AccountantReimbursementDTO> treeData(Page<AccountantReimbursementDTO> page, AccountantReimbursementDTO reimbursement);
 
     /**

+ 92 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/service/impl/AccountantReimbursementSysServiceImpl.java

@@ -9,7 +9,6 @@ import com.jeeplus.test.reimbursementAccountant.mapper.AccountantReimbursementSy
 import com.jeeplus.test.reimbursementAccountant.service.AccountantReimbursementBusinessService;
 import com.jeeplus.test.reimbursementAccountant.service.AccountantReimbursementSysService;
 import com.jeeplus.test.reimbursementAccountant.utils.MyBeanUtils;
-import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementDTO;
 import com.jeeplus.test.reimbursementsys.utils.PublicUtil;
 import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -68,6 +67,98 @@ public class AccountantReimbursementSysServiceImpl implements AccountantReimburs
         return list;
     }
 
+    @Override
+    public List<AccountantReimbursementDTO> findPage(Page<AccountantReimbursementDTO> page, AccountantReimbursementDTO reimbursement) {
+        IPage<AccountantReimbursementDTO> pageList = new Page();
+        List<AccountantReimbursementDTO> returnList =  Lists.newArrayList();
+        //如果筛选项含有发票号码,则需先查询对应的发票信息
+        if(StringUtils.isNotBlank(reimbursement.getInvoiceNumber()) ||
+                StringUtils.isNotBlank(reimbursement.getProposer()) ||
+                StringUtils.isNotBlank(reimbursement.getPartner()) ||
+                null != reimbursement.getBeginDate() ||
+                null != reimbursement.getEndDate() ||
+                StringUtils.isNotBlank(reimbursement.getBeginIncome()) ||
+                StringUtils.isNotBlank(reimbursement.getEndIncome()) ||
+                StringUtils.isNotBlank(reimbursement.getFirmName())){
+            List<AccountantReimbursementDTO> invoiceList =  mapper.getInvoiceList(reimbursement);
+            //如果存在发票信息,则根据发票的父节点查询对应的业务信息
+            if(invoiceList.size()>0){
+                Set<String> idSet = new HashSet<String>();
+                for (AccountantReimbursementDTO  info : invoiceList) {
+                    idSet.add(info.getParentId());
+                }
+                reimbursement.setIdList(new ArrayList<>(idSet));
+                pageList = mapper.queryAllList(page,reimbursement);
+
+                List<AccountantReimbursementDTO> list =  pageList.getRecords();
+                if(list.size()>0){
+                    //将子节点信息进行分组
+                    Map<String, List<AccountantReimbursementDTO>> invoiceListMap = dataMessageDispose(invoiceList);
+                    //将分组后的子节点信息通过遍历的方式添加到父节点中的children中
+                    for (AccountantReimbursementDTO info:list) {
+                        /*AccountantReimbursementDTO businessById = reimbursementBusinessService.getBusinessById(info.getId());
+                        if(null != businessById){
+                            info.setAllAlreadyReimbursementQuota(businessById.getAllAlreadyReimbursementQuota());
+                            info.setCanReimbursementAmount(businessById.getCanReimbursementAmount());
+                            info.setSurplusReimbursementAmount(businessById.getSurplusReimbursementAmount());
+                        }
+                        returnList.add(info);*/
+                        for (String key : invoiceListMap.keySet()) {
+                            if (info.getId().equals(key)) {
+                                List<AccountantReimbursementDTO> children = invoiceListMap.get(key);
+                                for (AccountantReimbursementDTO childrenInfo : children) {
+                                    childrenInfo.setBusinessCode(info.getBusinessCode());
+                                    returnList.add(childrenInfo);
+                                }
+                                info.setChildren(children);
+                            }
+                        }
+                    }
+                }
+            }else{
+                return page.getRecords();
+            }
+        }else{
+            pageList = mapper.queryAllList(page,reimbursement);
+            List<AccountantReimbursementDTO> list =  pageList.getRecords();
+            if(list.size()>0){
+                //获取所有发票信息表中的数据
+                List<String> parentIdList = Lists.newArrayList();
+                for (AccountantReimbursementDTO info:list) {
+                    parentIdList.add(info.getId());
+                }
+                //根据查询的父节点信息查询对应的子节点信息
+                List<AccountantReimbursementDTO> invoiceList =  mapper.getInvoiceByParentIdList(parentIdList);
+                if(list.size()>0){
+                    //将子节点信息进行分组
+                    Map<String, List<AccountantReimbursementDTO>> invoiceListMap = dataMessageDispose(invoiceList);
+                    //将分组后的子节点信息通过遍历的方式添加到父节点中的children中
+                    for (AccountantReimbursementDTO info:list) {
+                        /*AccountantReimbursementDTO businessById = reimbursementBusinessService.getBusinessById(info.getId());
+                        if(null != businessById){
+                            info.setAllAlreadyReimbursementQuota(businessById.getAllAlreadyReimbursementQuota());
+                            info.setCanReimbursementAmount(businessById.getCanReimbursementAmount());
+                            info.setSurplusReimbursementAmount(businessById.getSurplusReimbursementAmount());
+                        }
+                        returnList.add(info);*/
+                        for (String key : invoiceListMap.keySet()) {
+                            if (info.getId().equals(key)) {
+                                List<AccountantReimbursementDTO> children = invoiceListMap.get(key);
+                                for (AccountantReimbursementDTO childrenInfo : children) {
+                                    childrenInfo.setBusinessCode(info.getBusinessCode());
+                                    returnList.add(childrenInfo);
+                                }
+                                info.setChildren(children);
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+        return returnList;
+    }
+
 
     @Override
     public IPage<AccountantReimbursementDTO> treeData(Page<AccountantReimbursementDTO> page, AccountantReimbursementDTO reimbursement) {

+ 48 - 11
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAssess/controller/AssessReimbursementBusinessTwoController.java

@@ -4,30 +4,38 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.google.common.collect.Lists;
 import com.jeeplus.aop.logging.annotation.ApiLog;
+import com.jeeplus.core.excel.ExcelOptions;
+import com.jeeplus.core.excel.ExportMode;
+import com.jeeplus.core.excel.utils.EasyPoiUtil;
+import com.jeeplus.test.reimbursementAccountant.domain.dto.AccountantReimbursementBusinessTwoDTO;
 import com.jeeplus.test.reimbursementAssess.domain.dto.AssessReimbursementBusinessTwoDTO;
 import com.jeeplus.test.reimbursementAssess.domain.dto.AssessReimbursementDTO;
 import com.jeeplus.test.reimbursementAssess.service.AssessReimbursementBusinessService;
 import com.jeeplus.test.reimbursementAssess.service.AssessReimbursementBusinessTwoService;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletResponse;
 import java.math.BigDecimal;
+import java.util.List;
+import java.util.stream.Collectors;
 
 @RestController
 @RequestMapping("/assess/reimbursementBusinessTwo")
 public class AssessReimbursementBusinessTwoController {
 
     @Autowired
-    private AssessReimbursementBusinessTwoService AssessReimbursementBusinessTwoService;
+    private AssessReimbursementBusinessTwoService assessReimbursementBusinessTwoService;
     @Autowired
     private AssessReimbursementBusinessService reimbursementBusinessService;
 
     @ApiLog("查询无票报销列表")
     @RequestMapping("findListPage")
     public ResponseEntity findListPage(AssessReimbursementBusinessTwoDTO AssessReimbursementBusinessTwoDTO,Page<AssessReimbursementBusinessTwoDTO> page){
-        IPage<AssessReimbursementBusinessTwoDTO> listPage = AssessReimbursementBusinessTwoService.findListPage(page, AssessReimbursementBusinessTwoDTO);
+        IPage<AssessReimbursementBusinessTwoDTO> listPage = assessReimbursementBusinessTwoService.findListPage(page, AssessReimbursementBusinessTwoDTO);
         return ResponseEntity.ok(listPage);
     }
 
@@ -36,7 +44,7 @@ public class AssessReimbursementBusinessTwoController {
     @PreAuthorize("hasAuthority('assess:reimbursementBusinessTwo:del')")
     public ResponseEntity delById(@PathVariable("id")String ids){
         String idArray[] =ids.split(",");
-        AssessReimbursementBusinessTwoService.deleteByList ( Lists.newArrayList (idArray) );
+        assessReimbursementBusinessTwoService.deleteByList ( Lists.newArrayList (idArray) );
         return ResponseEntity.ok("删除成功!");
     }
 
@@ -44,14 +52,14 @@ public class AssessReimbursementBusinessTwoController {
     @RequestMapping("addData")
     @PreAuthorize("hasAuthority('assess:reimbursementBusinessTwo:add')")
     public ResponseEntity addData(@RequestBody AssessReimbursementBusinessTwoDTO AssessReimbursementBusinessTwoDTO){
-        AssessReimbursementBusinessTwoService.addData(AssessReimbursementBusinessTwoDTO);
+        assessReimbursementBusinessTwoService.addData(AssessReimbursementBusinessTwoDTO);
         return ResponseEntity.ok("添加成功");
     }
 
     @ApiLog("下拉列表")
     @RequestMapping("findSelectList")
     public ResponseEntity findSelectList(){
-        return ResponseEntity.ok(AssessReimbursementBusinessTwoService.findSelectList());
+        return ResponseEntity.ok(assessReimbursementBusinessTwoService.findSelectList());
     }
 
     @ApiLog("绑定")
@@ -62,11 +70,11 @@ public class AssessReimbursementBusinessTwoController {
         BigDecimal sum = new BigDecimal(0);
         if(split.length!=0){
             for (int i = 0; i < split.length; i++) {
-                AssessReimbursementBusinessTwoDTO dataById = AssessReimbursementBusinessTwoService.findDataById(split[i]);
+                AssessReimbursementBusinessTwoDTO dataById = assessReimbursementBusinessTwoService.findDataById(split[i]);
                 sum = sum.add(new BigDecimal(dataById.getReimbursementAmount()));
             }
         }else{
-            AssessReimbursementBusinessTwoDTO dataById = AssessReimbursementBusinessTwoService.findDataById(ids);
+            AssessReimbursementBusinessTwoDTO dataById = assessReimbursementBusinessTwoService.findDataById(ids);
             sum = new BigDecimal(dataById.getReimbursementAmount());
         }
         AssessReimbursementDTO businessById = reimbursementBusinessService.getBusinessById(businessCode);
@@ -75,10 +83,10 @@ public class AssessReimbursementBusinessTwoController {
         }
         if(split.length!=0){
             for (int i = 0; i < split.length; i++) {
-                AssessReimbursementBusinessTwoService.modifyBindCode(split[i],businessCode);
+                assessReimbursementBusinessTwoService.modifyBindCode(split[i],businessCode);
             }
         }else{
-            AssessReimbursementBusinessTwoService.modifyBindCode(ids,businessCode);
+            assessReimbursementBusinessTwoService.modifyBindCode(ids,businessCode);
         }
 
         return ResponseEntity.ok("成功");
@@ -87,12 +95,41 @@ public class AssessReimbursementBusinessTwoController {
     @ApiLog("展示下拉列表所有年份")
     @RequestMapping("findSelectYearList")
     public ResponseEntity findSelectYearList(){
-        return ResponseEntity.ok(AssessReimbursementBusinessTwoService.findSelectYearList());
+        return ResponseEntity.ok(assessReimbursementBusinessTwoService.findSelectYearList());
     }
 
     @ApiLog("根据年份展示所有编号")
     @RequestMapping("findSelectCodeListByYear/{year}")
     public ResponseEntity findSelectCodeListByYear(@PathVariable("year")String year){
-        return ResponseEntity.ok(AssessReimbursementBusinessTwoService.findSelectCodeListByYear(year));
+        return ResponseEntity.ok(assessReimbursementBusinessTwoService.findSelectCodeListByYear(year));
+    }
+
+
+    /**
+     * 导出兴光评估无票报销信息数据
+     * @param reimbursementUserDTO
+     * @param page
+     * @param response
+     * @throws Exception
+     */
+    @ApiLog("导出兴光评估无票报销信息数据")
+    @GetMapping("export")
+    @ApiOperation(value = "导出兴光评估无票报销信息数据excel")
+    public void exportFile(AssessReimbursementBusinessTwoDTO reimbursementUserDTO, Page <AssessReimbursementBusinessTwoDTO> page, ExcelOptions options, HttpServletResponse response) {
+        String fileName = options.getFilename ( );
+
+        List<AssessReimbursementBusinessTwoDTO> result;
+        if ( ExportMode.current.equals ( options.getMode ( ) ) ) {
+            result = assessReimbursementBusinessTwoService.findListPage ( page, reimbursementUserDTO ).getRecords();
+        } else if ( ExportMode.selected.equals ( options.getMode ( ) ) ) {
+            result = assessReimbursementBusinessTwoService.findListPage ( page, reimbursementUserDTO ).getRecords().stream ( ).filter ( reimbursement ->
+                    options.getSelectIds ( ).contains ( reimbursement.getId ( ) )
+            ).collect ( Collectors.toList ( ) );
+        } else {
+            page.setSize ( -1 );
+            page.setCurrent ( 0 );
+            result = assessReimbursementBusinessTwoService.findListPage ( page, reimbursementUserDTO ).getRecords();
+        }
+        EasyPoiUtil.exportExcel ( result, "兴光评估无票报销信息数据",  options.getSheetName ( ), AssessReimbursementBusinessTwoDTO.class, fileName, response );
     }
 }

+ 34 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAssess/controller/AssessReimbursementSysController.java

@@ -5,12 +5,16 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.google.common.collect.Lists;
 import com.jeeplus.aop.demo.annotation.DemoMode;
 import com.jeeplus.aop.logging.annotation.ApiLog;
+import com.jeeplus.core.excel.ExcelOptions;
+import com.jeeplus.core.excel.ExportMode;
 import com.jeeplus.core.excel.utils.EasyPoiUtil;
 import com.jeeplus.sys.service.dto.RoleDTO;
 import com.jeeplus.sys.service.dto.UserDTO;
 import com.jeeplus.sys.utils.StringUtils;
 import com.jeeplus.test.reimbursementAssess.domain.dto.AssessReimbursementDTO;
 import com.jeeplus.test.reimbursementAssess.service.AssessReimbursementSysService;
+import com.jeeplus.test.reimbursementProject.domain.dto.ProjectReimbursementDTO;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -18,12 +22,14 @@ import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * @author li-peike
@@ -258,4 +264,32 @@ public class AssessReimbursementSysController {
         service.addBatchReimbursement (invoiceIdList);
         return ResponseEntity.ok ("批量报销操作成功");
     }
+
+    /**
+     * 导出分所报销数据
+     * @param reimbursementDTO
+     * @param page
+     * @param response
+     * @throws Exception
+     */
+    @ApiLog("导出兴光评估报销数据")
+    @GetMapping("export")
+    @ApiOperation(value = "导出兴光评估报销数据excel")
+    public void exportFile(AssessReimbursementDTO reimbursementDTO, Page <AssessReimbursementDTO> page, ExcelOptions options, HttpServletResponse response) {
+        String fileName = options.getFilename ( );
+
+        List <AssessReimbursementDTO> result;
+        if ( ExportMode.current.equals ( options.getMode ( ) ) ) {
+            result = service.findPage ( page, reimbursementDTO );
+        } else if ( ExportMode.selected.equals ( options.getMode ( ) ) ) {
+            result = service.findPage ( page, reimbursementDTO ).stream ( ).filter ( reimbursement ->
+                    options.getSelectIds ( ).contains ( reimbursement.getId ( ) )
+            ).collect ( Collectors.toList ( ) );
+        } else {
+            page.setSize ( -1 );
+            page.setCurrent ( 0 );
+            result = service.findPage ( page, reimbursementDTO );
+        }
+        EasyPoiUtil.exportExcel ( result, "兴光评估报销数据",  options.getSheetName ( ), AssessReimbursementDTO.class, fileName, response );
+    }
 }

+ 36 - 2
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAssess/controller/AssessReimbursementUserController.java

@@ -6,6 +6,8 @@ import com.google.common.collect.Lists;
 import com.jeeplus.aop.demo.annotation.DemoMode;
 import com.jeeplus.aop.logging.annotation.ApiLog;
 import com.jeeplus.common.beanvalidator.BeanValidators;
+import com.jeeplus.core.excel.ExcelOptions;
+import com.jeeplus.core.excel.ExportMode;
 import com.jeeplus.core.excel.utils.EasyPoiUtil;
 import com.jeeplus.sys.service.dto.UserDTO;
 import com.jeeplus.sys.utils.DictUtils;
@@ -13,6 +15,8 @@ import com.jeeplus.sys.utils.StringUtils;
 import com.jeeplus.test.reimbursementAssess.domain.dto.AssessReimbursementBusinessReturnDTO;
 import com.jeeplus.test.reimbursementAssess.domain.dto.AssessReimbursementUserDTO;
 import com.jeeplus.test.reimbursementAssess.service.AssessReimbursementUserService;
+import com.jeeplus.test.reimbursementProject.domain.dto.ProjectReimbursementUserDTO;
+import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementUserImportDTO;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
@@ -26,6 +30,7 @@ import java.time.LocalDate;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * @author 徐滕
@@ -173,8 +178,8 @@ public class AssessReimbursementUserController {
     @ApiOperation(value = "下载模板")
     public void importFileTemplate(HttpServletResponse response) {
         String fileName = "报销人员数据导入模板.xlsx";
-        List<AssessReimbursementUserDTO> list = Lists.newArrayList();
-        EasyPoiUtil.exportExcel ( list, "报销人员数据",  "报销人员数据", AssessReimbursementUserDTO.class, fileName, response );
+        List<ReimbursementUserImportDTO> list = Lists.newArrayList();
+        EasyPoiUtil.exportExcel ( list, "报销人员数据",  "报销人员数据", ReimbursementUserImportDTO.class, fileName, response );
     }
 
     /**
@@ -244,4 +249,33 @@ public class AssessReimbursementUserController {
             return ResponseEntity.badRequest().body ( "导入员工报销数据失败!失败信息:" + e.getMessage ( ) );
         }
     }
+
+
+    /**
+     * 导出兴光评估人员信息数据
+     * @param reimbursementUserDTO
+     * @param page
+     * @param response
+     * @throws Exception
+     */
+    @ApiLog("导出兴光评估人员信息数据")
+    @GetMapping("export")
+    @ApiOperation(value = "导出兴光评估人员信息数据excel")
+    public void exportFile(AssessReimbursementUserDTO reimbursementUserDTO, Page <AssessReimbursementUserDTO> page, ExcelOptions options, HttpServletResponse response) {
+        String fileName = options.getFilename ( );
+
+        List <AssessReimbursementUserDTO> result;
+        if ( ExportMode.current.equals ( options.getMode ( ) ) ) {
+            result = service.findList ( page, reimbursementUserDTO ).getRecords();
+        } else if ( ExportMode.selected.equals ( options.getMode ( ) ) ) {
+            result = service.findList ( page, reimbursementUserDTO ).getRecords().stream ( ).filter ( reimbursement ->
+                    options.getSelectIds ( ).contains ( reimbursement.getId ( ) )
+            ).collect ( Collectors.toList ( ) );
+        } else {
+            page.setSize ( -1 );
+            page.setCurrent ( 0 );
+            result = service.findList ( page, reimbursementUserDTO ).getRecords();
+        }
+        EasyPoiUtil.exportExcel ( result, "兴光评估人员信息数据",  options.getSheetName ( ), AssessReimbursementUserDTO.class, fileName, response );
+    }
 }

+ 8 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAssess/domain/dto/AssessReimbursementBusinessTwoDTO.java

@@ -1,5 +1,6 @@
 package com.jeeplus.test.reimbursementAssess.domain.dto;
 
+import cn.afterturn.easypoi.excel.annotation.Excel;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.jeeplus.core.domain.BaseEntity;
 import lombok.*;
@@ -18,13 +19,19 @@ public class AssessReimbursementBusinessTwoDTO extends BaseEntity {
     private String businessCode;  //业务编号
     private String businessCodeId;  //业务编号Id
     private String userId;  //报销人id
+    @Excel(name = "报销人",width = 6)
     private String userName;  //报销人
+    @Excel(name = "报销年份",width = 6)
     private String year;    //报销年份
     private String reimbursementQuota;  //年报销额度
     private String reimbursementQuotaDay;  //日报销额度
-    private String reimbursementDay;  //报销天数
     private String surplusReimbursementDay;  //剩余报销天数
     private String reimbursementType;  //报销类型(1:正常报销;2:补差)
+    @Excel(name = "报销类型")
+    private String reimbursementTypeStr;  //报销类型(导出Str)
+    @Excel(name = "报销天数",type = 10)
+    private String reimbursementDay;  //报销天数
+    @Excel(name = "报销额度",type = 10)
     private String reimbursementAmount;  //报销额度
     private String remainReimbursementAmount;  //剩余报销额度
     private String remarks; //备注

+ 14 - 11
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAssess/domain/dto/AssessReimbursementDTO.java

@@ -27,19 +27,25 @@ public class AssessReimbursementDTO extends TreeEntity<AssessReimbursementDTO> {
     private String invoiceCode;     //发票代码
     @Excel(name = "发票号码")
     private String invoiceNumber;   //发票号码
+    @Excel(name = "金额",type = 10)
+    private String money;       //金额
+    @Excel(name = "税额",type = 10)
+    private String tax;         //税额
+    @Excel(name = "收入",type = 10)
+    private String income;      //收入
+    //@Excel(name = "报销比例")
+    private String reimbursementRatio;    //报销比例
+    //@Excel(name = "已报金额",type = 10)
+    private String allAlreadyReimbursementQuota;    //总报销额度(已报金额)
+    //@Excel(name = "可报金额",type = 10)
+    private String canReimbursementAmount;    //可报销额度
     @Excel(name = "购方企业名称")
     private String firmName;        //购方企业名称
 
-    @Excel(name = "开票日期",importFormat = "yyyy-MM-dd",exportFormat = "yyyy-MM-dd")
+    @Excel(name = "开票日期",importFormat = "yyyy-MM-dd")
     private String makeTime;          //开票日期
     @Excel(name = "商品名称")
     private String name;     //商品名称
-    @Excel(name = "金额")
-    private String money;       //金额
-    @Excel(name = "税额")
-    private String tax;         //税额
-    @Excel(name = "收入")
-    private String income;      //收入
     @Excel(name = "申请人")
     private String proposer;        //申请人
     @Excel(name = "合伙人")
@@ -48,9 +54,6 @@ public class AssessReimbursementDTO extends TreeEntity<AssessReimbursementDTO> {
     private String businessType;    //业务类型
     private String remarks;    //备注
     private Integer type;    //状态
-    private String reimbursementRatio;    //报销比例
-    private String allAlreadyReimbursementQuota;    //总报销额度(已报金额)
-    private String canReimbursementAmount;    //可报销额度
     private String surplusReimbursementAmount;    //剩余报销额度
     private String reimbursementType;    //报销比例
     private String gatheringStatus;    //收款状态
@@ -62,7 +65,7 @@ public class AssessReimbursementDTO extends TreeEntity<AssessReimbursementDTO> {
     private String year;    //业务编码年份(相同的业务编码根据年份不同生成不同的数据列)(仅业务表中使用)
     private String randomBusinessCodeIndex;    //随即业务编码序号
 
-    @Excel(name = "收款日期",importFormat = "yyyy-MM-dd",exportFormat = "yyyy-MM-dd")
+    @Excel(name = "收款日期",importFormat = "yyyy-MM-dd")
     private String gatheringTime;     //收款日期
 
 

+ 18 - 9
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAssess/domain/dto/AssessReimbursementUserDTO.java

@@ -20,7 +20,7 @@ import javax.validation.constraints.NotNull;
 @TableName("zs_reimbursement_user_info")
 public class AssessReimbursementUserDTO extends BaseEntity {
 
-    @Excel(name = "姓名")
+    @Excel(name = "姓名",width = 6)
     @Length(min = 1, max = 100)
     @NotNull(message = "姓名不能为空")
     private String userName;//员工姓名
@@ -29,6 +29,9 @@ public class AssessReimbursementUserDTO extends BaseEntity {
     @NotNull(message = "部门不能为空")
     private String officeName;//部门名称
 
+    private String officeId;//部门id
+
+
     private String userId;  //报销人id
     private UserDTO user;   //报销人员信息
 
@@ -36,27 +39,33 @@ public class AssessReimbursementUserDTO extends BaseEntity {
     @Length(min = 1, max = 100)
     @NotNull(message = "报销年份不能为空")
     private String year;    //报销年份
+    @Excel(name = "日报销额度")
+    @Length(min = 1, max = 100)
+    @NotNull(message = "日报销额度不能为空")
+    private String reimbursementQuotaDay;  //日报销额度
     @Excel(name = "年报销额度")
     @Length(min = 1, max = 100)
-    @NotNull(message = "年报销额度不能为空")
     private String reimbursementQuota;  //年报销额度
+    @Excel(name = "分所已报销额度", type = 10)
+    private String substationAlreadyReimbursementAmount;  //分所已报销额度
+    @Excel(name = "总所已报销额度", type = 10)
+    private String headquarterAlreadyReimbursementAmount;  //总所已报销额度
+    @Excel(name = "剩余额度", type = 10)
+    private String remainReimbursementAmount;  //剩余报销额度
+    @Excel(name = "已报天数")
+    private String alreadyReimbursementDay;  //已报销天数
+    @Excel(name = "剩余天数")
+    private String surplusReimbursementDay;  //剩余报销天数
 
     @Excel(name = "年可报销天数")
     @NotNull(message = "年可报销天数不能为空")
     private Integer reimbursementAllDay;  //年可报销天数
-    @Excel(name = "日报销额度")
-    @Length(min = 1, max = 100)
-    @NotNull(message = "日报销额度不能为空")
-    private String reimbursementQuotaDay;  //日报销额度
     private String reimbursementDay;  //报销天数
     private String reimbursementAmount;  //报销额度
-    private String remainReimbursementAmount;  //剩余报销额度
     private String alreadyReimbursementAmount;  //已报销额度
     private String remarks; //备注
 
 
-    private String alreadyReimbursementDay;  //已报销天数
-    private String surplusReimbursementDay;  //剩余报销天数
     private String surplusReimbursementAmount;  //剩余报销额度
     private String keyFlag; //用于判断使用
 

+ 1 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAssess/mapper/xml/AssessReimbursementBusinessTwoMapper.xml

@@ -30,6 +30,7 @@
         a.reimbursement_day as 'reimbursementDay',
         a.reimbursement_amount as 'reimbursementAmount',
         a.reimbursement_type as 'reimbursementType',
+        (case when a.reimbursement_type = '1' then '正常报销' when a.reimbursement_type = '2' then '补差' else '' end) as reimbursementTypeStr,
         su.name as 'userName'
     </sql>
     <sql id="reimbursementUserJoinColumns">

+ 5 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAssess/mapper/xml/AssessReimbursementUserMapper.xml

@@ -15,7 +15,8 @@
         a.reimbursement_all_day AS "reimbursementAllDay",
         a.reimbursement_quota_day AS "reimbursementQuotaDay",
         su.id as "user.id",
-        su.name as "user.name"
+        su.name as "user.name",
+        su.name as "userName"
     </sql>
 
     <sql id="reimbursementUserJoinColumns">
@@ -79,6 +80,9 @@
             <if test="reimbursementUser.userId != null and reimbursementUser.userId != ''">
                 and a.user_id = #{reimbursementUser.userId}
             </if>
+            <if test="reimbursementUser.officeId != null and reimbursementUser.officeId != ''">
+                and su.office_id in (select id from sys_office where del_flag = 0 and (id = #{reimbursementUser.officeId} or parent_ids like concat('%',#{reimbursementUser.officeId},'%')))
+            </if>
         </where>
         group by a.user_id,a.year
         order by a.update_date desc,a.year desc, a.user_id asc

+ 9 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAssess/service/AssessReimbursementSysService.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jeeplus.test.reimbursementAccountant.domain.dto.AccountantReimbursementDTO;
 import com.jeeplus.test.reimbursementAssess.domain.dto.AssessReimbursementDTO;
+import com.jeeplus.test.reimbursementProject.domain.dto.ProjectReimbursementDTO;
 
 import java.util.List;
 import java.util.Map;
@@ -38,6 +39,14 @@ public interface AssessReimbursementSysService {
 
     IPage<AssessReimbursementDTO> findList(Page<AssessReimbursementDTO> page, AssessReimbursementDTO reimbursement);
 
+    /**
+     * 导出数据获取
+     * @param page
+     * @param reimbursement
+     * @return
+     */
+    List<AssessReimbursementDTO> findPage(Page<AssessReimbursementDTO> page, AssessReimbursementDTO reimbursement);
+
     IPage<AssessReimbursementDTO> treeData(Page<AssessReimbursementDTO> page, AssessReimbursementDTO reimbursement);
 
     /**

+ 93 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAssess/service/impl/AssessReimbursementSysServiceImpl.java

@@ -9,6 +9,7 @@ import com.jeeplus.test.reimbursementAssess.mapper.AssessReimbursementSysMapper;
 import com.jeeplus.test.reimbursementAssess.service.AssessReimbursementBusinessService;
 import com.jeeplus.test.reimbursementAssess.service.AssessReimbursementSysService;
 import com.jeeplus.test.reimbursementAccountant.utils.MyBeanUtils;
+import com.jeeplus.test.reimbursementProject.domain.dto.ProjectReimbursementDTO;
 import com.jeeplus.test.reimbursementsys.utils.PublicUtil;
 import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -67,6 +68,98 @@ public class AssessReimbursementSysServiceImpl implements AssessReimbursementSys
         return list;
     }
 
+    @Override
+    public List<AssessReimbursementDTO> findPage(Page<AssessReimbursementDTO> page, AssessReimbursementDTO reimbursement) {
+        IPage<AssessReimbursementDTO> pageList = new Page();
+        List<AssessReimbursementDTO> returnList =  Lists.newArrayList();
+        //如果筛选项含有发票号码,则需先查询对应的发票信息
+        if(StringUtils.isNotBlank(reimbursement.getInvoiceNumber()) ||
+                StringUtils.isNotBlank(reimbursement.getProposer()) ||
+                StringUtils.isNotBlank(reimbursement.getPartner()) ||
+                null != reimbursement.getBeginDate() ||
+                null != reimbursement.getEndDate() ||
+                StringUtils.isNotBlank(reimbursement.getBeginIncome()) ||
+                StringUtils.isNotBlank(reimbursement.getEndIncome()) ||
+                StringUtils.isNotBlank(reimbursement.getFirmName())){
+            List<AssessReimbursementDTO> invoiceList =  mapper.getInvoiceList(reimbursement);
+            //如果存在发票信息,则根据发票的父节点查询对应的业务信息
+            if(invoiceList.size()>0){
+                Set<String> idSet = new HashSet<String>();
+                for (AssessReimbursementDTO  info : invoiceList) {
+                    idSet.add(info.getParentId());
+                }
+                reimbursement.setIdList(new ArrayList<>(idSet));
+                pageList = mapper.queryAllList(page,reimbursement);
+
+                List<AssessReimbursementDTO> list =  pageList.getRecords();
+                if(list.size()>0){
+                    //将子节点信息进行分组
+                    Map<String, List<AssessReimbursementDTO>> invoiceListMap = dataMessageDispose(invoiceList);
+                    //将分组后的子节点信息通过遍历的方式添加到父节点中的children中
+                    for (AssessReimbursementDTO info:list) {
+                        /*AssessReimbursementDTO businessById = reimbursementBusinessService.getBusinessById(info.getId());
+                        if(null != businessById){
+                            info.setAllAlreadyReimbursementQuota(businessById.getAllAlreadyReimbursementQuota());
+                            info.setCanReimbursementAmount(businessById.getCanReimbursementAmount());
+                            info.setSurplusReimbursementAmount(businessById.getSurplusReimbursementAmount());
+                        }
+                        returnList.add(info);*/
+                        for (String key : invoiceListMap.keySet()) {
+                            if (info.getId().equals(key)) {
+                                List<AssessReimbursementDTO> children = invoiceListMap.get(key);
+                                for (AssessReimbursementDTO childrenInfo : children) {
+                                    childrenInfo.setBusinessCode(info.getBusinessCode());
+                                    returnList.add(childrenInfo);
+                                }
+                                info.setChildren(children);
+                            }
+                        }
+                    }
+                }
+            }else{
+                return page.getRecords();
+            }
+        }else{
+            pageList = mapper.queryAllList(page,reimbursement);
+            List<AssessReimbursementDTO> list =  pageList.getRecords();
+            if(list.size()>0){
+                //获取所有发票信息表中的数据
+                List<String> parentIdList = Lists.newArrayList();
+                for (AssessReimbursementDTO info:list) {
+                    parentIdList.add(info.getId());
+                }
+                //根据查询的父节点信息查询对应的子节点信息
+                List<AssessReimbursementDTO> invoiceList =  mapper.getInvoiceByParentIdList(parentIdList);
+                if(list.size()>0){
+                    //将子节点信息进行分组
+                    Map<String, List<AssessReimbursementDTO>> invoiceListMap = dataMessageDispose(invoiceList);
+                    //将分组后的子节点信息通过遍历的方式添加到父节点中的children中
+                    for (AssessReimbursementDTO info:list) {
+                        /*AssessReimbursementDTO businessById = reimbursementBusinessService.getBusinessById(info.getId());
+                        if(null != businessById){
+                            info.setAllAlreadyReimbursementQuota(businessById.getAllAlreadyReimbursementQuota());
+                            info.setCanReimbursementAmount(businessById.getCanReimbursementAmount());
+                            info.setSurplusReimbursementAmount(businessById.getSurplusReimbursementAmount());
+                        }
+                        returnList.add(info);*/
+                        for (String key : invoiceListMap.keySet()) {
+                            if (info.getId().equals(key)) {
+                                List<AssessReimbursementDTO> children = invoiceListMap.get(key);
+                                for (AssessReimbursementDTO childrenInfo : children) {
+                                    childrenInfo.setBusinessCode(info.getBusinessCode());
+                                    returnList.add(childrenInfo);
+                                }
+                                info.setChildren(children);
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+        return returnList;
+    }
+
 
     @Override
     public IPage<AssessReimbursementDTO> treeData(Page<AssessReimbursementDTO> page, AssessReimbursementDTO reimbursement) {

+ 48 - 11
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementProject/controller/ProjectReimbursementBusinessTwoController.java

@@ -4,30 +4,38 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.google.common.collect.Lists;
 import com.jeeplus.aop.logging.annotation.ApiLog;
+import com.jeeplus.core.excel.ExcelOptions;
+import com.jeeplus.core.excel.ExportMode;
+import com.jeeplus.core.excel.utils.EasyPoiUtil;
 import com.jeeplus.test.reimbursementProject.domain.dto.ProjectReimbursementBusinessTwoDTO;
 import com.jeeplus.test.reimbursementProject.domain.dto.ProjectReimbursementDTO;
 import com.jeeplus.test.reimbursementProject.service.ProjectReimbursementBusinessService;
 import com.jeeplus.test.reimbursementProject.service.ProjectReimbursementBusinessTwoService;
+import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementUserDTO;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletResponse;
 import java.math.BigDecimal;
+import java.util.List;
+import java.util.stream.Collectors;
 
 @RestController
 @RequestMapping("/project/reimbursementBusinessTwo")
 public class ProjectReimbursementBusinessTwoController {
 
     @Autowired
-    private ProjectReimbursementBusinessTwoService ProjectReimbursementBusinessTwoService;
+    private ProjectReimbursementBusinessTwoService projectReimbursementBusinessTwoService;
     @Autowired
     private ProjectReimbursementBusinessService reimbursementBusinessService;
 
     @ApiLog("查询无票报销列表")
     @RequestMapping("findListPage")
     public ResponseEntity findListPage(ProjectReimbursementBusinessTwoDTO ProjectReimbursementBusinessTwoDTO,Page<ProjectReimbursementBusinessTwoDTO> page){
-        IPage<ProjectReimbursementBusinessTwoDTO> listPage = ProjectReimbursementBusinessTwoService.findListPage(page, ProjectReimbursementBusinessTwoDTO);
+        IPage<ProjectReimbursementBusinessTwoDTO> listPage = projectReimbursementBusinessTwoService.findListPage(page, ProjectReimbursementBusinessTwoDTO);
         return ResponseEntity.ok(listPage);
     }
 
@@ -36,7 +44,7 @@ public class ProjectReimbursementBusinessTwoController {
     @PreAuthorize("hasAuthority('project:reimbursementBusinessTwo:del')")
     public ResponseEntity delById(@PathVariable("id")String ids){
         String idArray[] =ids.split(",");
-        ProjectReimbursementBusinessTwoService.deleteByList ( Lists.newArrayList (idArray) );
+        projectReimbursementBusinessTwoService.deleteByList ( Lists.newArrayList (idArray) );
         return ResponseEntity.ok("删除成功!");
     }
 
@@ -44,14 +52,14 @@ public class ProjectReimbursementBusinessTwoController {
     @RequestMapping("addData")
     @PreAuthorize("hasAuthority('project:reimbursementBusinessTwo:add')")
     public ResponseEntity addData(@RequestBody ProjectReimbursementBusinessTwoDTO ProjectReimbursementBusinessTwoDTO){
-        ProjectReimbursementBusinessTwoService.addData(ProjectReimbursementBusinessTwoDTO);
+        projectReimbursementBusinessTwoService.addData(ProjectReimbursementBusinessTwoDTO);
         return ResponseEntity.ok("添加成功");
     }
 
     @ApiLog("下拉列表")
     @RequestMapping("findSelectList")
     public ResponseEntity findSelectList(){
-        return ResponseEntity.ok(ProjectReimbursementBusinessTwoService.findSelectList());
+        return ResponseEntity.ok(projectReimbursementBusinessTwoService.findSelectList());
     }
 
     @ApiLog("绑定")
@@ -62,11 +70,11 @@ public class ProjectReimbursementBusinessTwoController {
         BigDecimal sum = new BigDecimal(0);
         if(split.length!=0){
             for (int i = 0; i < split.length; i++) {
-                ProjectReimbursementBusinessTwoDTO dataById = ProjectReimbursementBusinessTwoService.findDataById(split[i]);
+                ProjectReimbursementBusinessTwoDTO dataById = projectReimbursementBusinessTwoService.findDataById(split[i]);
                 sum = sum.add(new BigDecimal(dataById.getReimbursementAmount()));
             }
         }else{
-            ProjectReimbursementBusinessTwoDTO dataById = ProjectReimbursementBusinessTwoService.findDataById(ids);
+            ProjectReimbursementBusinessTwoDTO dataById = projectReimbursementBusinessTwoService.findDataById(ids);
             sum = new BigDecimal(dataById.getReimbursementAmount());
         }
         ProjectReimbursementDTO businessById = reimbursementBusinessService.getBusinessById(businessCode);
@@ -75,10 +83,10 @@ public class ProjectReimbursementBusinessTwoController {
         }
         if(split.length!=0){
             for (int i = 0; i < split.length; i++) {
-                ProjectReimbursementBusinessTwoService.modifyBindCode(split[i],businessCode);
+                projectReimbursementBusinessTwoService.modifyBindCode(split[i],businessCode);
             }
         }else{
-            ProjectReimbursementBusinessTwoService.modifyBindCode(ids,businessCode);
+            projectReimbursementBusinessTwoService.modifyBindCode(ids,businessCode);
         }
 
         return ResponseEntity.ok("成功");
@@ -87,12 +95,41 @@ public class ProjectReimbursementBusinessTwoController {
     @ApiLog("展示下拉列表所有年份")
     @RequestMapping("findSelectYearList")
     public ResponseEntity findSelectYearList(){
-        return ResponseEntity.ok(ProjectReimbursementBusinessTwoService.findSelectYearList());
+        return ResponseEntity.ok(projectReimbursementBusinessTwoService.findSelectYearList());
     }
 
     @ApiLog("根据年份展示所有编号")
     @RequestMapping("findSelectCodeListByYear/{year}")
     public ResponseEntity findSelectCodeListByYear(@PathVariable("year")String year){
-        return ResponseEntity.ok(ProjectReimbursementBusinessTwoService.findSelectCodeListByYear(year));
+        return ResponseEntity.ok(projectReimbursementBusinessTwoService.findSelectCodeListByYear(year));
+    }
+
+
+    /**
+     * 导出兴光项目无票报销信息数据
+     * @param reimbursementUserDTO
+     * @param page
+     * @param response
+     * @throws Exception
+     */
+    @ApiLog("导出兴光项目无票报销信息数据")
+    @GetMapping("export")
+    @ApiOperation(value = "导出兴光项目无票报销信息数据excel")
+    public void exportFile(ProjectReimbursementBusinessTwoDTO reimbursementUserDTO, Page <ProjectReimbursementBusinessTwoDTO> page, ExcelOptions options, HttpServletResponse response) {
+        String fileName = options.getFilename ( );
+
+        List<ProjectReimbursementBusinessTwoDTO> result;
+        if ( ExportMode.current.equals ( options.getMode ( ) ) ) {
+            result = projectReimbursementBusinessTwoService.findListPage ( page, reimbursementUserDTO ).getRecords();
+        } else if ( ExportMode.selected.equals ( options.getMode ( ) ) ) {
+            result = projectReimbursementBusinessTwoService.findListPage ( page, reimbursementUserDTO ).getRecords().stream ( ).filter ( reimbursement ->
+                    options.getSelectIds ( ).contains ( reimbursement.getId ( ) )
+            ).collect ( Collectors.toList ( ) );
+        } else {
+            page.setSize ( -1 );
+            page.setCurrent ( 0 );
+            result = projectReimbursementBusinessTwoService.findListPage ( page, reimbursementUserDTO ).getRecords();
+        }
+        EasyPoiUtil.exportExcel ( result, "兴光项目无票报销信息数据",  options.getSheetName ( ), ProjectReimbursementBusinessTwoDTO.class, fileName, response );
     }
 }

+ 35 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementProject/controller/ProjectReimbursementSysController.java

@@ -5,12 +5,16 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.google.common.collect.Lists;
 import com.jeeplus.aop.demo.annotation.DemoMode;
 import com.jeeplus.aop.logging.annotation.ApiLog;
+import com.jeeplus.core.excel.ExcelOptions;
+import com.jeeplus.core.excel.ExportMode;
 import com.jeeplus.core.excel.utils.EasyPoiUtil;
 import com.jeeplus.sys.service.dto.RoleDTO;
 import com.jeeplus.sys.service.dto.UserDTO;
 import com.jeeplus.sys.utils.StringUtils;
 import com.jeeplus.test.reimbursementProject.domain.dto.ProjectReimbursementDTO;
 import com.jeeplus.test.reimbursementProject.service.ProjectReimbursementSysService;
+import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementDTO;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -18,12 +22,14 @@ import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * @author li-peike
@@ -258,4 +264,33 @@ public class ProjectReimbursementSysController {
         service.addBatchReimbursement (invoiceIdList);
         return ResponseEntity.ok ("批量报销操作成功");
     }
+
+
+    /**
+     * 导出分所报销数据
+     * @param reimbursementDTO
+     * @param page
+     * @param response
+     * @throws Exception
+     */
+    @ApiLog("导出兴光项目报销数据")
+    @GetMapping("export")
+    @ApiOperation(value = "导出兴光项目报销数据excel")
+    public void exportFile(ProjectReimbursementDTO reimbursementDTO, Page <ProjectReimbursementDTO> page, ExcelOptions options, HttpServletResponse response) {
+        String fileName = options.getFilename ( );
+
+        List <ProjectReimbursementDTO> result;
+        if ( ExportMode.current.equals ( options.getMode ( ) ) ) {
+            result = service.findPage ( page, reimbursementDTO );
+        } else if ( ExportMode.selected.equals ( options.getMode ( ) ) ) {
+            result = service.findPage ( page, reimbursementDTO ).stream ( ).filter ( reimbursement ->
+                    options.getSelectIds ( ).contains ( reimbursement.getId ( ) )
+            ).collect ( Collectors.toList ( ) );
+        } else {
+            page.setSize ( -1 );
+            page.setCurrent ( 0 );
+            result = service.findPage ( page, reimbursementDTO );
+        }
+        EasyPoiUtil.exportExcel ( result, "兴光项目报销数据",  options.getSheetName ( ), ProjectReimbursementDTO.class, fileName, response );
+    }
 }

+ 36 - 2
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementProject/controller/ProjectReimbursementUserController.java

@@ -6,6 +6,8 @@ import com.google.common.collect.Lists;
 import com.jeeplus.aop.demo.annotation.DemoMode;
 import com.jeeplus.aop.logging.annotation.ApiLog;
 import com.jeeplus.common.beanvalidator.BeanValidators;
+import com.jeeplus.core.excel.ExcelOptions;
+import com.jeeplus.core.excel.ExportMode;
 import com.jeeplus.core.excel.utils.EasyPoiUtil;
 import com.jeeplus.sys.service.dto.UserDTO;
 import com.jeeplus.sys.utils.DictUtils;
@@ -13,6 +15,8 @@ import com.jeeplus.sys.utils.StringUtils;
 import com.jeeplus.test.reimbursementProject.domain.dto.ProjectReimbursementBusinessReturnDTO;
 import com.jeeplus.test.reimbursementProject.domain.dto.ProjectReimbursementUserDTO;
 import com.jeeplus.test.reimbursementProject.service.ProjectReimbursementUserService;
+import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementUserDTO;
+import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementUserImportDTO;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
@@ -26,6 +30,7 @@ import java.time.LocalDate;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * @author 徐滕
@@ -173,8 +178,8 @@ public class ProjectReimbursementUserController {
     @ApiOperation(value = "下载模板")
     public void importFileTemplate(HttpServletResponse response) {
         String fileName = "报销人员数据导入模板.xlsx";
-        List<ProjectReimbursementUserDTO> list = Lists.newArrayList();
-        EasyPoiUtil.exportExcel ( list, "报销人员数据",  "报销人员数据", ProjectReimbursementUserDTO.class, fileName, response );
+        List<ReimbursementUserImportDTO> list = Lists.newArrayList();
+        EasyPoiUtil.exportExcel ( list, "报销人员数据",  "报销人员数据", ReimbursementUserImportDTO.class, fileName, response );
     }
 
     /**
@@ -244,4 +249,33 @@ public class ProjectReimbursementUserController {
             return ResponseEntity.badRequest().body ( "导入员工报销数据失败!失败信息:" + e.getMessage ( ) );
         }
     }
+
+
+    /**
+     * 导出兴光项目人员信息数据
+     * @param reimbursementUserDTO
+     * @param page
+     * @param response
+     * @throws Exception
+     */
+    @ApiLog("导出兴光项目人员信息数据")
+    @GetMapping("export")
+    @ApiOperation(value = "导出兴光项目人员信息数据excel")
+    public void exportFile(ProjectReimbursementUserDTO reimbursementUserDTO, Page <ProjectReimbursementUserDTO> page, ExcelOptions options, HttpServletResponse response) {
+        String fileName = options.getFilename ( );
+
+        List <ProjectReimbursementUserDTO> result;
+        if ( ExportMode.current.equals ( options.getMode ( ) ) ) {
+            result = service.findList ( page, reimbursementUserDTO ).getRecords();
+        } else if ( ExportMode.selected.equals ( options.getMode ( ) ) ) {
+            result = service.findList ( page, reimbursementUserDTO ).getRecords().stream ( ).filter ( reimbursement ->
+                    options.getSelectIds ( ).contains ( reimbursement.getId ( ) )
+            ).collect ( Collectors.toList ( ) );
+        } else {
+            page.setSize ( -1 );
+            page.setCurrent ( 0 );
+            result = service.findList ( page, reimbursementUserDTO ).getRecords();
+        }
+        EasyPoiUtil.exportExcel ( result, "兴光项目人员信息数据",  options.getSheetName ( ), ProjectReimbursementUserDTO.class, fileName, response );
+    }
 }

+ 8 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementProject/domain/dto/ProjectReimbursementBusinessTwoDTO.java

@@ -1,5 +1,6 @@
 package com.jeeplus.test.reimbursementProject.domain.dto;
 
+import cn.afterturn.easypoi.excel.annotation.Excel;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.jeeplus.core.domain.BaseEntity;
 import lombok.*;
@@ -18,13 +19,19 @@ public class ProjectReimbursementBusinessTwoDTO extends BaseEntity {
     private String businessCode;  //业务编号
     private String businessCodeId;  //业务编号Id
     private String userId;  //报销人id
+    @Excel(name = "报销人",width = 6)
     private String userName;  //报销人
+    @Excel(name = "报销年份",width = 6)
     private String year;    //报销年份
     private String reimbursementQuota;  //年报销额度
     private String reimbursementQuotaDay;  //日报销额度
-    private String reimbursementDay;  //报销天数
     private String surplusReimbursementDay;  //剩余报销天数
     private String reimbursementType;  //报销类型(1:正常报销;2:补差)
+    @Excel(name = "报销类型")
+    private String reimbursementTypeStr;  //报销类型(导出Str)
+    @Excel(name = "报销天数",type = 10)
+    private String reimbursementDay;  //报销天数
+    @Excel(name = "报销额度",type = 10)
     private String reimbursementAmount;  //报销额度
     private String remainReimbursementAmount;  //剩余报销额度
     private String remarks; //备注

+ 14 - 11
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementProject/domain/dto/ProjectReimbursementDTO.java

@@ -27,19 +27,25 @@ public class ProjectReimbursementDTO extends TreeEntity<ProjectReimbursementDTO>
     private String invoiceCode;     //发票代码
     @Excel(name = "发票号码")
     private String invoiceNumber;   //发票号码
+    @Excel(name = "金额",type = 10)
+    private String money;       //金额
+    @Excel(name = "税额",type = 10)
+    private String tax;         //税额
+    @Excel(name = "收入",type = 10)
+    private String income;      //收入
+    //@Excel(name = "报销比例")
+    private String reimbursementRatio;    //报销比例
+    //@Excel(name = "已报金额",type = 10)
+    private String allAlreadyReimbursementQuota;    //总报销额度(已报金额)
+    //@Excel(name = "可报金额",type = 10)
+    private String canReimbursementAmount;    //可报销额度
     @Excel(name = "购方企业名称")
     private String firmName;        //购方企业名称
 
-    @Excel(name = "开票日期",importFormat = "yyyy-MM-dd",exportFormat = "yyyy-MM-dd")
+    @Excel(name = "开票日期",importFormat = "yyyy-MM-dd")
     private String makeTime;          //开票日期
     @Excel(name = "商品名称")
     private String name;     //商品名称
-    @Excel(name = "金额")
-    private String money;       //金额
-    @Excel(name = "税额")
-    private String tax;         //税额
-    @Excel(name = "收入")
-    private String income;      //收入
     @Excel(name = "申请人")
     private String proposer;        //申请人
     @Excel(name = "合伙人")
@@ -48,9 +54,6 @@ public class ProjectReimbursementDTO extends TreeEntity<ProjectReimbursementDTO>
     private String businessType;    //业务类型
     private String remarks;    //备注
     private Integer type;    //状态
-    private String reimbursementRatio;    //报销比例
-    private String allAlreadyReimbursementQuota;    //总报销额度(已报金额)
-    private String canReimbursementAmount;    //可报销额度
     private String surplusReimbursementAmount;    //剩余报销额度
     private String reimbursementType;    //报销比例
     private String gatheringStatus;    //收款状态
@@ -62,7 +65,7 @@ public class ProjectReimbursementDTO extends TreeEntity<ProjectReimbursementDTO>
     private String year;    //业务编码年份(相同的业务编码根据年份不同生成不同的数据列)(仅业务表中使用)
     private String randomBusinessCodeIndex;    //随即业务编码序号
 
-    @Excel(name = "收款日期",importFormat = "yyyy-MM-dd",exportFormat = "yyyy-MM-dd")
+    @Excel(name = "收款日期",importFormat = "yyyy-MM-dd")
     private String gatheringTime;     //收款日期
 
 

+ 18 - 9
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementProject/domain/dto/ProjectReimbursementUserDTO.java

@@ -20,7 +20,7 @@ import javax.validation.constraints.NotNull;
 @TableName("zs_reimbursement_user_info")
 public class ProjectReimbursementUserDTO extends BaseEntity {
 
-    @Excel(name = "姓名")
+    @Excel(name = "姓名",width = 6)
     @Length(min = 1, max = 100)
     @NotNull(message = "姓名不能为空")
     private String userName;//员工姓名
@@ -29,6 +29,9 @@ public class ProjectReimbursementUserDTO extends BaseEntity {
     @NotNull(message = "部门不能为空")
     private String officeName;//部门名称
 
+    private String officeId;//部门id
+
+
     private String userId;  //报销人id
     private UserDTO user;   //报销人员信息
 
@@ -36,27 +39,33 @@ public class ProjectReimbursementUserDTO extends BaseEntity {
     @Length(min = 1, max = 100)
     @NotNull(message = "报销年份不能为空")
     private String year;    //报销年份
+    @Excel(name = "日报销额度")
+    @Length(min = 1, max = 100)
+    @NotNull(message = "日报销额度不能为空")
+    private String reimbursementQuotaDay;  //日报销额度
     @Excel(name = "年报销额度")
     @Length(min = 1, max = 100)
-    @NotNull(message = "年报销额度不能为空")
     private String reimbursementQuota;  //年报销额度
+    @Excel(name = "分所已报销额度", type = 10)
+    private String substationAlreadyReimbursementAmount;  //分所已报销额度
+    @Excel(name = "总所已报销额度", type = 10)
+    private String headquarterAlreadyReimbursementAmount;  //总所已报销额度
+    @Excel(name = "剩余额度", type = 10)
+    private String remainReimbursementAmount;  //剩余报销额度
+    @Excel(name = "已报天数")
+    private String alreadyReimbursementDay;  //已报销天数
+    @Excel(name = "剩余天数")
+    private String surplusReimbursementDay;  //剩余报销天数
 
     @Excel(name = "年可报销天数")
     @NotNull(message = "年可报销天数不能为空")
     private Integer reimbursementAllDay;  //年可报销天数
-    @Excel(name = "日报销额度")
-    @Length(min = 1, max = 100)
-    @NotNull(message = "日报销额度不能为空")
-    private String reimbursementQuotaDay;  //日报销额度
     private String reimbursementDay;  //报销天数
     private String reimbursementAmount;  //报销额度
-    private String remainReimbursementAmount;  //剩余报销额度
     private String alreadyReimbursementAmount;  //已报销额度
     private String remarks; //备注
 
 
-    private String alreadyReimbursementDay;  //已报销天数
-    private String surplusReimbursementDay;  //剩余报销天数
     private String surplusReimbursementAmount;  //剩余报销额度
     private String keyFlag; //用于判断使用
 

+ 1 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementProject/mapper/xml/ProjectReimbursementBusinessTwoMapper.xml

@@ -30,6 +30,7 @@
         a.reimbursement_day as 'reimbursementDay',
         a.reimbursement_amount as 'reimbursementAmount',
         a.reimbursement_type as 'reimbursementType',
+        (case when a.reimbursement_type = '1' then '正常报销' when a.reimbursement_type = '2' then '补差' else '' end) as reimbursementTypeStr,
         su.name as 'userName'
     </sql>
     <sql id="reimbursementUserJoinColumns">

+ 5 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementProject/mapper/xml/ProjectReimbursementUserMapper.xml

@@ -15,7 +15,8 @@
         a.reimbursement_all_day AS "reimbursementAllDay",
         a.reimbursement_quota_day AS "reimbursementQuotaDay",
         su.id as "user.id",
-        su.name as "user.name"
+        su.name as "user.name",
+        su.name as "userName"
     </sql>
 
     <sql id="reimbursementUserJoinColumns">
@@ -79,6 +80,9 @@
             <if test="reimbursementUser.userId != null and reimbursementUser.userId != ''">
                 and a.user_id = #{reimbursementUser.userId}
             </if>
+            <if test="reimbursementUser.officeId != null and reimbursementUser.officeId != ''">
+                and su.office_id in (select id from sys_office where del_flag = 0 and (id = #{reimbursementUser.officeId} or parent_ids like concat('%',#{reimbursementUser.officeId},'%')))
+            </if>
         </where>
         group by a.user_id,a.year
         order by a.update_date desc,a.year desc, a.user_id asc

+ 9 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementProject/service/ProjectReimbursementSysService.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jeeplus.test.reimbursementAccountant.domain.dto.AccountantReimbursementDTO;
 import com.jeeplus.test.reimbursementProject.domain.dto.ProjectReimbursementDTO;
+import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementDTO;
 
 import java.util.List;
 import java.util.Map;
@@ -38,6 +39,14 @@ public interface ProjectReimbursementSysService {
 
     IPage<ProjectReimbursementDTO> findList(Page<ProjectReimbursementDTO> page, ProjectReimbursementDTO reimbursement);
 
+    /**
+     * 导出数据获取
+     * @param page
+     * @param reimbursement
+     * @return
+     */
+    List<ProjectReimbursementDTO> findPage(Page<ProjectReimbursementDTO> page, ProjectReimbursementDTO reimbursement);
+
     IPage<ProjectReimbursementDTO> treeData(Page<ProjectReimbursementDTO> page, ProjectReimbursementDTO reimbursement);
 
     /**

+ 93 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementProject/service/impl/ProjectReimbursementSysServiceImpl.java

@@ -9,6 +9,7 @@ import com.jeeplus.test.reimbursementProject.mapper.ProjectReimbursementSysMappe
 import com.jeeplus.test.reimbursementProject.service.ProjectReimbursementBusinessService;
 import com.jeeplus.test.reimbursementProject.service.ProjectReimbursementSysService;
 import com.jeeplus.test.reimbursementAccountant.utils.MyBeanUtils;
+import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementDTO;
 import com.jeeplus.test.reimbursementsys.utils.PublicUtil;
 import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -67,6 +68,98 @@ public class ProjectReimbursementSysServiceImpl implements ProjectReimbursementS
         return list;
     }
 
+    @Override
+    public List<ProjectReimbursementDTO> findPage(Page<ProjectReimbursementDTO> page, ProjectReimbursementDTO reimbursement) {
+        IPage<ProjectReimbursementDTO> pageList = new Page();
+        List<ProjectReimbursementDTO> returnList =  Lists.newArrayList();
+        //如果筛选项含有发票号码,则需先查询对应的发票信息
+        if(StringUtils.isNotBlank(reimbursement.getInvoiceNumber()) ||
+                StringUtils.isNotBlank(reimbursement.getProposer()) ||
+                StringUtils.isNotBlank(reimbursement.getPartner()) ||
+                null != reimbursement.getBeginDate() ||
+                null != reimbursement.getEndDate() ||
+                StringUtils.isNotBlank(reimbursement.getBeginIncome()) ||
+                StringUtils.isNotBlank(reimbursement.getEndIncome()) ||
+                StringUtils.isNotBlank(reimbursement.getFirmName())){
+            List<ProjectReimbursementDTO> invoiceList =  mapper.getInvoiceList(reimbursement);
+            //如果存在发票信息,则根据发票的父节点查询对应的业务信息
+            if(invoiceList.size()>0){
+                Set<String> idSet = new HashSet<String>();
+                for (ProjectReimbursementDTO  info : invoiceList) {
+                    idSet.add(info.getParentId());
+                }
+                reimbursement.setIdList(new ArrayList<>(idSet));
+                pageList = mapper.queryAllList(page,reimbursement);
+
+                List<ProjectReimbursementDTO> list =  pageList.getRecords();
+                if(list.size()>0){
+                    //将子节点信息进行分组
+                    Map<String, List<ProjectReimbursementDTO>> invoiceListMap = dataMessageDispose(invoiceList);
+                    //将分组后的子节点信息通过遍历的方式添加到父节点中的children中
+                    for (ProjectReimbursementDTO info:list) {
+                        /*ProjectReimbursementDTO businessById = reimbursementBusinessService.getBusinessById(info.getId());
+                        if(null != businessById){
+                            info.setAllAlreadyReimbursementQuota(businessById.getAllAlreadyReimbursementQuota());
+                            info.setCanReimbursementAmount(businessById.getCanReimbursementAmount());
+                            info.setSurplusReimbursementAmount(businessById.getSurplusReimbursementAmount());
+                        }
+                        returnList.add(info);*/
+                        for (String key : invoiceListMap.keySet()) {
+                            if (info.getId().equals(key)) {
+                                List<ProjectReimbursementDTO> children = invoiceListMap.get(key);
+                                for (ProjectReimbursementDTO childrenInfo : children) {
+                                    childrenInfo.setBusinessCode(info.getBusinessCode());
+                                    returnList.add(childrenInfo);
+                                }
+                                info.setChildren(children);
+                            }
+                        }
+                    }
+                }
+            }else{
+                return page.getRecords();
+            }
+        }else{
+            pageList = mapper.queryAllList(page,reimbursement);
+            List<ProjectReimbursementDTO> list =  pageList.getRecords();
+            if(list.size()>0){
+                //获取所有发票信息表中的数据
+                List<String> parentIdList = Lists.newArrayList();
+                for (ProjectReimbursementDTO info:list) {
+                    parentIdList.add(info.getId());
+                }
+                //根据查询的父节点信息查询对应的子节点信息
+                List<ProjectReimbursementDTO> invoiceList =  mapper.getInvoiceByParentIdList(parentIdList);
+                if(list.size()>0){
+                    //将子节点信息进行分组
+                    Map<String, List<ProjectReimbursementDTO>> invoiceListMap = dataMessageDispose(invoiceList);
+                    //将分组后的子节点信息通过遍历的方式添加到父节点中的children中
+                    for (ProjectReimbursementDTO info:list) {
+                        /*ProjectReimbursementDTO businessById = reimbursementBusinessService.getBusinessById(info.getId());
+                        if(null != businessById){
+                            info.setAllAlreadyReimbursementQuota(businessById.getAllAlreadyReimbursementQuota());
+                            info.setCanReimbursementAmount(businessById.getCanReimbursementAmount());
+                            info.setSurplusReimbursementAmount(businessById.getSurplusReimbursementAmount());
+                        }
+                        returnList.add(info);*/
+                        for (String key : invoiceListMap.keySet()) {
+                            if (info.getId().equals(key)) {
+                                List<ProjectReimbursementDTO> children = invoiceListMap.get(key);
+                                for (ProjectReimbursementDTO childrenInfo : children) {
+                                    childrenInfo.setBusinessCode(info.getBusinessCode());
+                                    returnList.add(childrenInfo);
+                                }
+                                info.setChildren(children);
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+        return returnList;
+    }
+
 
     @Override
     public IPage<ProjectReimbursementDTO> treeData(Page<ProjectReimbursementDTO> page, ProjectReimbursementDTO reimbursement) {

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

@@ -1,14 +1,20 @@
 package com.jeeplus.test.reimbursementsys.controller;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.google.common.collect.Lists;
 import com.jeeplus.aop.demo.annotation.DemoMode;
 import com.jeeplus.aop.logging.annotation.ApiLog;
+import com.jeeplus.core.excel.ExcelOptions;
+import com.jeeplus.core.excel.ExportMode;
 import com.jeeplus.core.excel.utils.EasyPoiUtil;
+import com.jeeplus.core.query.QueryWrapperGenerator;
+import com.jeeplus.sys.service.dto.UserDTO;
 import com.jeeplus.sys.utils.StringUtils;
 import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementDTO;
 import com.jeeplus.test.reimbursementsys.service.ReimbursementSysService;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -16,11 +22,13 @@ import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
 import java.io.IOException;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * @author li-peike
@@ -211,4 +219,33 @@ public class ReimbursementSysController {
         service.removeInvoiceByIds ( Lists.newArrayList (idArray) );
         return ResponseEntity.ok ("删除成功!");
     }
+
+
+    /**
+     * 导出分所报销数据
+     * @param reimbursementDTO
+     * @param page
+     * @param response
+     * @throws Exception
+     */
+    @ApiLog("导出分所报销数据")
+    @GetMapping("export")
+    @ApiOperation(value = "导出分所报销数据excel")
+    public void exportFile(ReimbursementDTO reimbursementDTO, Page <ReimbursementDTO> page, ExcelOptions options, HttpServletResponse response) {
+        String fileName = options.getFilename ( );
+
+        List <ReimbursementDTO> result;
+        if ( ExportMode.current.equals ( options.getMode ( ) ) ) {
+            result = service.findPage ( page, reimbursementDTO );
+        } else if ( ExportMode.selected.equals ( options.getMode ( ) ) ) {
+            result = service.findPage ( page, reimbursementDTO ).stream ( ).filter ( reimbursement ->
+                    options.getSelectIds ( ).contains ( reimbursement.getId ( ) )
+            ).collect ( Collectors.toList ( ) );
+        } else {
+            page.setSize ( -1 );
+            page.setCurrent ( 0 );
+            result = service.findPage ( page, reimbursementDTO );
+        }
+        EasyPoiUtil.exportExcel ( result, "分所报销数据",  options.getSheetName ( ), ReimbursementDTO.class, fileName, response );
+    }
 }

+ 38 - 2
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/controller/ReimbursementUserController.java

@@ -6,13 +6,17 @@ import com.google.common.collect.Lists;
 import com.jeeplus.aop.demo.annotation.DemoMode;
 import com.jeeplus.aop.logging.annotation.ApiLog;
 import com.jeeplus.common.beanvalidator.BeanValidators;
+import com.jeeplus.core.excel.ExcelOptions;
+import com.jeeplus.core.excel.ExportMode;
 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.reimbursementProject.domain.dto.ProjectReimbursementDTO;
 import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementAddressDTO;
 import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementBusinessReturnDTO;
 import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementUserDTO;
+import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementUserImportDTO;
 import com.jeeplus.test.reimbursementsys.service.ReimbursementUserService;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -27,6 +31,7 @@ import java.time.LocalDate;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * @author 徐滕
@@ -176,8 +181,8 @@ public class ReimbursementUserController {
     @ApiOperation(value = "下载模板")
     public void importFileTemplate(HttpServletResponse response) {
         String fileName = "报销人员数据导入模板.xlsx";
-        List<ReimbursementUserDTO> list = Lists.newArrayList();
-        EasyPoiUtil.exportExcel ( list, "报销人员数据",  "报销人员数据", ReimbursementUserDTO.class, fileName, response );
+        List<ReimbursementUserImportDTO> list = Lists.newArrayList();
+        EasyPoiUtil.exportExcel ( list, "报销人员数据",  "报销人员数据", ReimbursementUserImportDTO.class, fileName, response );
     }
 
     /**
@@ -247,4 +252,35 @@ public class ReimbursementUserController {
             return ResponseEntity.badRequest().body ( "导入员工报销数据失败!失败信息:" + e.getMessage ( ) );
         }
     }
+
+
+    /**
+     * 导出中审众环人员信息数据
+     * @param reimbursementUserDTO
+     * @param page
+     * @param response
+     * @throws Exception
+     */
+    @ApiLog("导出中审众环人员信息数据")
+    @GetMapping("export")
+    @ApiOperation(value = "导出中审众环人员信息数据excel")
+    public void exportFile(ReimbursementUserDTO reimbursementUserDTO, Page <ReimbursementUserDTO> page, ExcelOptions options, HttpServletResponse response) {
+        String fileName = options.getFilename ( );
+
+        List <ReimbursementUserDTO> result;
+        if ( ExportMode.current.equals ( options.getMode ( ) ) ) {
+            result = service.findList ( page, reimbursementUserDTO ).getRecords();
+        } else if ( ExportMode.selected.equals ( options.getMode ( ) ) ) {
+            result = service.findList ( page, reimbursementUserDTO ).getRecords().stream ( ).filter ( reimbursement ->
+                    options.getSelectIds ( ).contains ( reimbursement.getId ( ) )
+            ).collect ( Collectors.toList ( ) );
+        } else {
+            page.setSize ( -1 );
+            page.setCurrent ( 0 );
+            result = service.findList ( page, reimbursementUserDTO ).getRecords();
+        }
+        EasyPoiUtil.exportExcel ( result, "中审众环人员信息数据",  options.getSheetName ( ), ReimbursementUserDTO.class, fileName, response );
+    }
+
+
 }

+ 34 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/controller/WuHanReimbursementSysController.java

@@ -5,12 +5,15 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.google.common.collect.Lists;
 import com.jeeplus.aop.demo.annotation.DemoMode;
 import com.jeeplus.aop.logging.annotation.ApiLog;
+import com.jeeplus.core.excel.ExcelOptions;
+import com.jeeplus.core.excel.ExportMode;
 import com.jeeplus.core.excel.utils.EasyPoiUtil;
 import com.jeeplus.sys.utils.StringUtils;
 import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementDTO;
 import com.jeeplus.test.reimbursementsys.domain.dto.WuHanReimbursementDTO;
 import com.jeeplus.test.reimbursementsys.service.ReimbursementSysService;
 import com.jeeplus.test.reimbursementsys.service.WuHanReimbursementSysService;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -18,11 +21,13 @@ import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
 import java.io.IOException;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * @author li-peike
@@ -214,4 +219,33 @@ public class WuHanReimbursementSysController {
         service.removeInvoiceByIds ( Lists.newArrayList (idArray) );
         return ResponseEntity.ok ("删除成功!");
     }
+
+
+    /**
+     * 导出分所报销数据
+     * @param reimbursementDTO
+     * @param page
+     * @param response
+     * @throws Exception
+     */
+    @ApiLog("导出总所报销数据")
+    @GetMapping("export")
+    @ApiOperation(value = "导出总所报销数据excel")
+    public void exportFile(WuHanReimbursementDTO reimbursementDTO, Page <WuHanReimbursementDTO> page, ExcelOptions options, HttpServletResponse response) {
+        String fileName = options.getFilename ( );
+
+        List <WuHanReimbursementDTO> result;
+        if ( ExportMode.current.equals ( options.getMode ( ) ) ) {
+            result = service.findPage ( page, reimbursementDTO );
+        } else if ( ExportMode.selected.equals ( options.getMode ( ) ) ) {
+            result = service.findPage ( page, reimbursementDTO ).stream ( ).filter ( reimbursement ->
+                    options.getSelectIds ( ).contains ( reimbursement.getId ( ) )
+            ).collect ( Collectors.toList ( ) );
+        } else {
+            page.setSize ( -1 );
+            page.setCurrent ( 0 );
+            result = service.findPage ( page, reimbursementDTO );
+        }
+        EasyPoiUtil.exportExcel ( result, "总所报销数据",  options.getSheetName ( ), WuHanReimbursementDTO.class, fileName, response );
+    }
 }

+ 17 - 12
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/domain/dto/ReimbursementDTO.java

@@ -25,24 +25,33 @@ public class ReimbursementDTO extends TreeEntity<ReimbursementDTO> {
     private static final long serialVersionUID = 1L;
     @Excel(name = "业务编号")
     private String businessCode;    //业务编号
+    //@Excel(name = "所属年份")
+    private String year;    //业务编码年份(相同的业务编码根据年份不同生成不同的数据列)(仅业务表中使用)
     private String businessCodeId;    //业务编号id
     @Excel(name = "发票代码")
     private String invoiceCode;     //发票代码
     @Excel(name = "发票号码")
     private String invoiceNumber;   //发票号码
+    @Excel(name = "金额",type = 10)
+    private String money;       //金额
+    @Excel(name = "税额",type = 10)
+    private String tax;         //税额
+    @Excel(name = "收入",type = 10)
+    private String income;      //收入
+    //@Excel(name = "报销比例")
+    private String reimbursementRatio;    //报销比例
+    //@Excel(name = "已报金额",type = 10)
+    private String allAlreadyReimbursementQuota;    //总报销额度(已报金额)
+    //@Excel(name = "可报金额",type = 10)
+    private String canReimbursementAmount;    //可报销额度
     @Excel(name = "购方企业名称")
     private String firmName;        //购方企业名称
 
-    @Excel(name = "开票日期",importFormat = "yyyy-MM-dd",exportFormat = "yyyy-MM-dd")
+    @Excel(name = "开票日期",importFormat = "yyyy-MM-dd")
     private String makeTime;          //开票日期
     @Excel(name = "商品名称")
     private String name;     //商品名称
-    @Excel(name = "金额")
-    private String money;       //金额
-    @Excel(name = "税额")
-    private String tax;         //税额
-    @Excel(name = "收入")
-    private String income;      //收入
+
     @Excel(name = "申请人")
     private String proposer;        //申请人
     @Excel(name = "合伙人")
@@ -51,20 +60,16 @@ public class ReimbursementDTO extends TreeEntity<ReimbursementDTO> {
     private String businessType;    //业务类型
     private String remarks;    //备注
     private Integer type;    //状态
-    private String reimbursementRatio;    //报销比例
-    private String allAlreadyReimbursementQuota;    //总报销额度(已报金额)
-    private String canReimbursementAmount;    //可报销额度
     private String surplusReimbursementAmount;    //剩余报销额度
     private String reimbursementType;    //报销比例
     private String gatheringStatus;    //收款状态
     private String reimbursementStatus;    //报销状态
     private String randomType;    //随机状态(1:随机业务编码,2:指定业务编码)(默认为指定业务编码仅业务表中使用)
-    private String year;    //业务编码年份(相同的业务编码根据年份不同生成不同的数据列)(仅业务表中使用)
     private String batchFlag;    //批量报销状态(1:批量报销)(仅业务表中使用)
     private String randomBusinessCodeIndex;    //随即业务编码序号
     private List<String> idList;
 
-    @Excel(name = "收款日期",importFormat = "yyyy-MM-dd",exportFormat = "yyyy-MM-dd")
+    @Excel(name = "收款日期",importFormat = "yyyy-MM-dd")
     private String gatheringTime;     //收款日期
 
 

+ 18 - 12
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/domain/dto/ReimbursementUserDTO.java

@@ -22,7 +22,7 @@ public class ReimbursementUserDTO extends BaseEntity {
 
     private int addressName; //地区类型(0:正常报销;1:武汉)
 
-    @Excel(name = "姓名")
+    @Excel(name = "姓名",width = 6)
     @Length(min = 1, max = 100)
     @NotNull(message = "姓名不能为空")
     private String userName;//员工姓名
@@ -31,6 +31,8 @@ public class ReimbursementUserDTO extends BaseEntity {
     @NotNull(message = "部门不能为空")
     private String officeName;//部门名称
 
+    private String officeId;//部门id
+
     private String userId;  //报销人id
     private UserDTO user;   //报销人员信息
 
@@ -38,29 +40,33 @@ public class ReimbursementUserDTO extends BaseEntity {
     @Length(min = 1, max = 100)
     @NotNull(message = "报销年份不能为空")
     private String year;    //报销年份
-    //@Excel(name = "年报销额度")
+    @Excel(name = "日报销额度")
+    @Length(min = 1, max = 100)
+    @NotNull(message = "日报销额度不能为空")
+    private String reimbursementQuotaDay;  //日报销额度
+    @Excel(name = "年报销额度")
     @Length(min = 1, max = 100)
-    @NotNull(message = "年报销额度不能为空")
     private String reimbursementQuota;  //年报销额度
+    @Excel(name = "分所已报销额度", type = 10)
+    private String substationAlreadyReimbursementAmount;  //分所已报销额度
+    @Excel(name = "总所已报销额度", type = 10)
+    private String headquarterAlreadyReimbursementAmount;  //总所已报销额度
+    @Excel(name = "剩余额度", type = 10)
+    private String remainReimbursementAmount;  //剩余报销额度
+    @Excel(name = "已报天数")
+    private String alreadyReimbursementDay;  //已报销天数
+    @Excel(name = "剩余天数")
+    private String surplusReimbursementDay;  //剩余报销天数
 
     @Excel(name = "年可报销天数")
     @NotNull(message = "年可报销天数不能为空")
     private Integer reimbursementAllDay;  //年可报销天数
-    @Excel(name = "日报销额度")
-    @Length(min = 1, max = 100)
-    @NotNull(message = "日报销额度不能为空")
-    private String reimbursementQuotaDay;  //日报销额度
     private String reimbursementDay;  //报销天数
     private String reimbursementAmount;  //报销额度
-    private String remainReimbursementAmount;  //剩余报销额度
     private String alreadyReimbursementAmount;  //已报销额度
     private String remarks; //备注
-    private String substationAlreadyReimbursementAmount;  //分所已报销额度
-    private String headquarterAlreadyReimbursementAmount;  //总所已报销额度
 
 
-    private String alreadyReimbursementDay;  //已报销天数
-    private String surplusReimbursementDay;  //剩余报销天数
     private String surplusReimbursementAmount;  //剩余报销额度
     private String keyFlag; //用于判断使用
     private String reimbursementAddress; //报销类型 0:分所报销;1:总所报销

+ 70 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/domain/dto/ReimbursementUserImportDTO.java

@@ -0,0 +1,70 @@
+package com.jeeplus.test.reimbursementsys.domain.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import com.jeeplus.sys.service.dto.UserDTO;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.hibernate.validator.constraints.Length;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * 报销人员表
+ * @author: 徐滕
+ * @version: 2022-05-16 11:06
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@TableName("zs_reimbursement_user_info")
+public class ReimbursementUserImportDTO extends BaseEntity {
+
+    private int addressName; //地区类型(0:正常报销;1:武汉)
+
+    @Excel(name = "姓名",width = 6)
+    @Length(min = 1, max = 100)
+    @NotNull(message = "姓名不能为空")
+    private String userName;//员工姓名
+    @Excel(name = "部门",width = 10)
+    @Length(min = 1, max = 100)
+    @NotNull(message = "部门不能为空")
+    private String officeName;//部门名称
+
+    private String officeId;//部门id
+
+    private String userId;  //报销人id
+    private UserDTO user;   //报销人员信息
+
+    @Excel(name = "报销年份")
+    @Length(min = 1, max = 100)
+    @NotNull(message = "报销年份不能为空")
+    private String year;    //报销年份
+    //@Excel(name = "年报销额度")
+    @Length(min = 1, max = 100)
+    @NotNull(message = "年报销额度不能为空")
+    private String reimbursementQuota;  //年报销额度
+
+    @Excel(name = "年可报销天数",width = 16)
+    @NotNull(message = "年可报销天数不能为空")
+    private Integer reimbursementAllDay;  //年可报销天数
+    @Excel(name = "日报销额度")
+    @Length(min = 1, max = 100)
+    @NotNull(message = "日报销额度不能为空")
+    private String reimbursementQuotaDay;  //日报销额度
+    private String reimbursementDay;  //报销天数
+    private String reimbursementAmount;  //报销额度
+    private String remainReimbursementAmount;  //剩余报销额度
+    private String alreadyReimbursementAmount;  //已报销额度
+    private String remarks; //备注
+    private String substationAlreadyReimbursementAmount;  //分所已报销额度
+    private String headquarterAlreadyReimbursementAmount;  //总所已报销额度
+
+
+    private String alreadyReimbursementDay;  //已报销天数
+    private String surplusReimbursementDay;  //剩余报销天数
+    private String surplusReimbursementAmount;  //剩余报销额度
+    private String keyFlag; //用于判断使用
+    private String reimbursementAddress; //报销类型 0:分所报销;1:总所报销
+
+}

+ 18 - 12
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/domain/dto/WuHanReimbursementDTO.java

@@ -21,24 +21,34 @@ public class WuHanReimbursementDTO extends TreeEntity<WuHanReimbursementDTO> {
     private static final long serialVersionUID = 1L;
     @Excel(name = "业务编号")
     private String businessCode;    //业务编号
+    //@Excel(name = "所属年份")
+    private String year;    //业务编码年份(相同的业务编码根据年份不同生成不同的数据列)(仅业务表中使用)
     private String businessCodeId;    //业务编号id
     @Excel(name = "发票代码")
     private String invoiceCode;     //发票代码
     @Excel(name = "发票号码")
     private String invoiceNumber;   //发票号码
+    @Excel(name = "金额",type = 10)
+    private String money;       //金额
+    @Excel(name = "税额",type = 10)
+    private String tax;         //税额
+    @Excel(name = "收入",type = 10)
+    private String income;      //收入
+    //@Excel(name = "报销比例")
+    private String reimbursementRatio;    //报销比例
+    //@Excel(name = "已报金额",type = 10)
+    private String allAlreadyReimbursementQuota;    //总报销额度(已报金额)
+    //@Excel(name = "可报金额",type = 10)
+    private String canReimbursementAmount;    //可报销额度
+
     @Excel(name = "购方企业名称")
     private String firmName;        //购方企业名称
 
-    @Excel(name = "开票日期",importFormat = "yyyy-MM-dd",exportFormat = "yyyy-MM-dd")
+    @Excel(name = "开票日期",importFormat = "yyyy-MM-dd")
     private String makeTime;          //开票日期
     @Excel(name = "商品名称")
     private String name;     //商品名称
-    @Excel(name = "金额")
-    private String money;       //金额
-    @Excel(name = "税额")
-    private String tax;         //税额
-    @Excel(name = "收入")
-    private String income;      //收入
+
     @Excel(name = "申请人")
     private String proposer;        //申请人
     @Excel(name = "合伙人")
@@ -47,20 +57,16 @@ public class WuHanReimbursementDTO extends TreeEntity<WuHanReimbursementDTO> {
     private String businessType;    //业务类型
     private String remarks;    //备注
     private Integer type;    //状态
-    private String reimbursementRatio;    //报销比例
-    private String allAlreadyReimbursementQuota;    //总报销额度(已报金额)
-    private String canReimbursementAmount;    //可报销额度
     private String surplusReimbursementAmount;    //剩余报销额度
     private String reimbursementType;    //报销比例
     private String gatheringStatus;    //收款状态
     private String reimbursementStatus;    //报销状态
     private String randomType;    //随机状态(1:随机业务编码,2:指定业务编码)(默认为指定业务编码仅业务表中使用)
-    private String year;    //业务编码年份(相同的业务编码根据年份不同生成不同的数据列)(仅业务表中使用)
     private String batchFlag;    //批量报销状态(1:批量报销)(仅业务表中使用)
     private String randomBusinessCodeIndex;    //随即业务编码序号
     private List<String> idList;
 
-    @Excel(name = "收款日期",importFormat = "yyyy-MM-dd",exportFormat = "yyyy-MM-dd")
+    @Excel(name = "收款日期",importFormat = "yyyy-MM-dd")
     private String gatheringTime;     //收款日期
 
 

+ 5 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/mapper/xml/ReimbursementUserMapper.xml

@@ -15,7 +15,8 @@
         a.reimbursement_all_day AS "reimbursementAllDay",
         a.reimbursement_quota_day AS "reimbursementQuotaDay",
         su.id as "user.id",
-        su.name as "user.name"
+        su.name as "user.name",
+        su.name as "userName"
     </sql>
 
     <sql id="reimbursementUserJoinColumns">
@@ -86,6 +87,9 @@
             <if test="reimbursementUser.reimbursementAddress != null and reimbursementUser.reimbursementAddress != ''">
                 and a.user_id in (select user_id from zs_reimbursement_business_info where reimbursement_address= #{reimbursementUser.reimbursementAddress})
             </if>
+            <if test="reimbursementUser.officeId != null and reimbursementUser.officeId != ''">
+                and su.office_id in (select id from sys_office where del_flag = 0 and (id = #{reimbursementUser.officeId} or parent_ids like concat('%',#{reimbursementUser.officeId},'%')))
+            </if>
         </where>
         group by a.user_id,a.year
         order by a.update_date desc,a.year desc, a.user_id asc

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

@@ -33,6 +33,14 @@ public interface ReimbursementSysService {
     IPage<ReimbursementDTO> treeData(Page<ReimbursementDTO> page, ReimbursementDTO reimbursement);
 
     /**
+     * 导出数据获取
+     * @param page
+     * @param reimbursement
+     * @return
+     */
+    List<ReimbursementDTO> findPage(Page<ReimbursementDTO> page, ReimbursementDTO reimbursement);
+
+    /**
      * 保存方法
      * @param reimbursementList
      */

+ 3 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/service/WuHanReimbursementSysService.java

@@ -2,6 +2,7 @@ package com.jeeplus.test.reimbursementsys.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementDTO;
 import com.jeeplus.test.reimbursementsys.domain.dto.WuHanReimbursementDTO;
 
 import java.util.List;
@@ -31,6 +32,8 @@ public interface WuHanReimbursementSysService {
 
     IPage<WuHanReimbursementDTO> treeData(Page<WuHanReimbursementDTO> page, WuHanReimbursementDTO reimbursement);
 
+    List<WuHanReimbursementDTO> findPage(Page<WuHanReimbursementDTO> page, WuHanReimbursementDTO reimbursement);
+
     /**
      * 保存方法
      * @param reimbursementList

+ 92 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/service/impl/ReimbursementSysServiceImpl.java

@@ -129,6 +129,98 @@ public class ReimbursementSysServiceImpl implements ReimbursementSysService {
         return pageList;
     }
 
+    @Override
+    public List<ReimbursementDTO> findPage(Page<ReimbursementDTO> page, ReimbursementDTO reimbursement) {
+        IPage<ReimbursementDTO> pageList = new Page();
+        List<ReimbursementDTO> returnList =  Lists.newArrayList();
+        //如果筛选项含有发票号码,则需先查询对应的发票信息
+        if(StringUtils.isNotBlank(reimbursement.getInvoiceNumber()) ||
+                StringUtils.isNotBlank(reimbursement.getProposer()) ||
+                StringUtils.isNotBlank(reimbursement.getPartner()) ||
+                null != reimbursement.getBeginDate() ||
+                null != reimbursement.getEndDate() ||
+                StringUtils.isNotBlank(reimbursement.getBeginIncome()) ||
+                StringUtils.isNotBlank(reimbursement.getEndIncome()) ||
+                StringUtils.isNotBlank(reimbursement.getFirmName())){
+            List<ReimbursementDTO> invoiceList =  mapper.getInvoiceList(reimbursement);
+            //如果存在发票信息,则根据发票的父节点查询对应的业务信息
+            if(invoiceList.size()>0){
+                Set<String> idSet = new HashSet<String>();
+                for (ReimbursementDTO  info : invoiceList) {
+                    idSet.add(info.getParentId());
+                }
+                reimbursement.setIdList(new ArrayList<>(idSet));
+                pageList = mapper.queryAllList(page,reimbursement);
+
+                List<ReimbursementDTO> list =  pageList.getRecords();
+                if(list.size()>0){
+                    //将子节点信息进行分组
+                    Map<String, List<ReimbursementDTO>> invoiceListMap = dataMessageDispose(invoiceList);
+                    //将分组后的子节点信息通过遍历的方式添加到父节点中的children中
+                    for (ReimbursementDTO info:list) {
+                        /*ReimbursementDTO businessById = reimbursementBusinessService.getBusinessById(info.getId());
+                        if(null != businessById){
+                            info.setAllAlreadyReimbursementQuota(businessById.getAllAlreadyReimbursementQuota());
+                            info.setCanReimbursementAmount(businessById.getCanReimbursementAmount());
+                            info.setSurplusReimbursementAmount(businessById.getSurplusReimbursementAmount());
+                        }
+                        returnList.add(info);*/
+                        for (String key : invoiceListMap.keySet()) {
+                            if (info.getId().equals(key)) {
+                                List<ReimbursementDTO> children = invoiceListMap.get(key);
+                                for (ReimbursementDTO childrenInfo : children) {
+                                    childrenInfo.setBusinessCode(info.getBusinessCode());
+                                    returnList.add(childrenInfo);
+                                }
+                                info.setChildren(children);
+                            }
+                        }
+                    }
+                }
+            }else{
+                return page.getRecords();
+            }
+        }else{
+            pageList = mapper.queryAllList(page,reimbursement);
+            List<ReimbursementDTO> list =  pageList.getRecords();
+            if(list.size()>0){
+                //获取所有发票信息表中的数据
+                List<String> parentIdList = Lists.newArrayList();
+                for (ReimbursementDTO info:list) {
+                    parentIdList.add(info.getId());
+                }
+                //根据查询的父节点信息查询对应的子节点信息
+                List<ReimbursementDTO> invoiceList =  mapper.getInvoiceByParentIdList(parentIdList);
+                if(list.size()>0){
+                    //将子节点信息进行分组
+                    Map<String, List<ReimbursementDTO>> invoiceListMap = dataMessageDispose(invoiceList);
+                    //将分组后的子节点信息通过遍历的方式添加到父节点中的children中
+                    for (ReimbursementDTO info:list) {
+                        /*ReimbursementDTO businessById = reimbursementBusinessService.getBusinessById(info.getId());
+                        if(null != businessById){
+                            info.setAllAlreadyReimbursementQuota(businessById.getAllAlreadyReimbursementQuota());
+                            info.setCanReimbursementAmount(businessById.getCanReimbursementAmount());
+                            info.setSurplusReimbursementAmount(businessById.getSurplusReimbursementAmount());
+                        }
+                        returnList.add(info);*/
+                        for (String key : invoiceListMap.keySet()) {
+                            if (info.getId().equals(key)) {
+                                List<ReimbursementDTO> children = invoiceListMap.get(key);
+                                for (ReimbursementDTO childrenInfo : children) {
+                                    childrenInfo.setBusinessCode(info.getBusinessCode());
+                                    returnList.add(childrenInfo);
+                                }
+                                info.setChildren(children);
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+        return returnList;
+    }
+
     /**
      * 文件数据分组
      * @param dataList

+ 91 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/service/impl/WuHanReimbursementSysServiceImpl.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.utils.StringUtils;
+import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementDTO;
 import com.jeeplus.test.reimbursementsys.domain.dto.WuHanReimbursementDTO;
 import com.jeeplus.test.reimbursementsys.mapper.WuHanReimbursementSysMapper;
 import com.jeeplus.test.reimbursementsys.service.ReimbursementBusinessService;
@@ -128,6 +129,96 @@ public class WuHanReimbursementSysServiceImpl implements WuHanReimbursementSysSe
         return pageList;
     }
 
+    @Override
+    public List<WuHanReimbursementDTO> findPage(Page<WuHanReimbursementDTO> page, WuHanReimbursementDTO reimbursement) {
+        IPage<WuHanReimbursementDTO> pageList = new Page();
+        List<WuHanReimbursementDTO> returnList =  Lists.newArrayList();
+        //如果筛选项含有发票号码,则需先查询对应的发票信息
+        if(StringUtils.isNotBlank(reimbursement.getInvoiceNumber()) ||
+                StringUtils.isNotBlank(reimbursement.getProposer()) ||
+                StringUtils.isNotBlank(reimbursement.getPartner()) ||
+                null != reimbursement.getBeginDate() ||
+                null != reimbursement.getEndDate() ||
+                StringUtils.isNotBlank(reimbursement.getBeginIncome()) ||
+                StringUtils.isNotBlank(reimbursement.getEndIncome()) ||
+                StringUtils.isNotBlank(reimbursement.getFirmName())){
+            List<WuHanReimbursementDTO> invoiceList =  mapper.getInvoiceList(reimbursement);
+            //如果存在发票信息,则根据发票的父节点查询对应的业务信息
+            if(invoiceList.size()>0){
+                Set<String> idSet = new HashSet<String>();
+                for (WuHanReimbursementDTO  info : invoiceList) {
+                    idSet.add(info.getParentId());
+                }
+                reimbursement.setIdList(new ArrayList<>(idSet));
+                pageList = mapper.queryAllList(page,reimbursement);
+
+                List<WuHanReimbursementDTO> list =  pageList.getRecords();
+                if(list.size()>0){
+                    //将子节点信息进行分组
+                    Map<String, List<WuHanReimbursementDTO>> invoiceListMap = dataMessageDispose(invoiceList);
+                    //将分组后的子节点信息通过遍历的方式添加到父节点中的children中
+                    for (WuHanReimbursementDTO info:list) {
+                        /*WuHanReimbursementDTO businessById = reimbursementBusinessService.getWuHanBusinessById(info.getId());
+                        if(null != businessById){
+                            info.setAllAlreadyReimbursementQuota(businessById.getAllAlreadyReimbursementQuota());
+                            info.setCanReimbursementAmount(businessById.getCanReimbursementAmount());
+                            info.setSurplusReimbursementAmount(businessById.getSurplusReimbursementAmount());
+                        }
+                        returnList.add(info);*/
+                        for (String key : invoiceListMap.keySet()) {
+                            if (info.getId().equals(key)) {
+                                List<WuHanReimbursementDTO> children = invoiceListMap.get(key);
+                                for (WuHanReimbursementDTO childrenInfo : children) {
+                                    childrenInfo.setBusinessCode(info.getBusinessCode());
+                                    returnList.add(childrenInfo);
+                                }
+                            }
+                        }
+                    }
+                }
+            }else{
+                return returnList;
+            }
+        }else{
+            pageList = mapper.queryAllList(page,reimbursement);
+            List<WuHanReimbursementDTO> list =  pageList.getRecords();
+            if(list.size()>0){
+                //获取所有发票信息表中的数据
+                List<String> parentIdList = Lists.newArrayList();
+                for (WuHanReimbursementDTO info:list) {
+                    parentIdList.add(info.getId());
+                }
+                //根据查询的父节点信息查询对应的子节点信息
+                List<WuHanReimbursementDTO> invoiceList =  mapper.getInvoiceByParentIdList(parentIdList);
+                if(list.size()>0){
+                    //将子节点信息进行分组
+                    Map<String, List<WuHanReimbursementDTO>> invoiceListMap = dataMessageDispose(invoiceList);
+                    //将分组后的子节点信息通过遍历的方式添加到父节点中的children中
+                    for (WuHanReimbursementDTO info:list) {
+                        /*WuHanReimbursementDTO businessById = reimbursementBusinessService.getWuHanBusinessById(info.getId());
+                        if(null != businessById){
+                            info.setAllAlreadyReimbursementQuota(businessById.getAllAlreadyReimbursementQuota());
+                            info.setCanReimbursementAmount(businessById.getCanReimbursementAmount());
+                            info.setSurplusReimbursementAmount(businessById.getSurplusReimbursementAmount());
+                        }
+                        returnList.add(info);*/
+                        for (String key : invoiceListMap.keySet()) {
+                            if (info.getId().equals(key)) {
+                                List<WuHanReimbursementDTO> children = invoiceListMap.get(key);
+                                for (WuHanReimbursementDTO childrenInfo : children) {
+                                    childrenInfo.setBusinessCode(info.getBusinessCode());
+                                    returnList.add(childrenInfo);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+        return returnList;
+    }
+
     /**
      * 文件数据分组
      * @param dataList

+ 24 - 0
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/controller/UserController.java

@@ -424,5 +424,29 @@ public class UserController {
         return ResponseEntity.ok (rootTree);
     }
 
+    /**
+     * 获取机构JSON数据。
+     *
+     * @param officeName 部门名称
+     * @param extId 排除的ID
+     * @param type  类型(1:公司;2:部门)
+     * @param showAll 是否显示不可用数据 1 显示 0 隐藏
+     * @return
+     */
+    @ApiLog("获取部门信息")
+    @GetMapping("treeUserDataByOfficeList")
+    public ResponseEntity treeUserDataByOfficeList(@RequestParam(required = false) String officeName,@RequestParam(required = false) String extId, @RequestParam(required = false) String type, @RequestParam(required = false, defaultValue = CommonConstants.NO) String showAll) {
+        List<OfficeDTO> list = officeService.getOfficeAllByOfficeName (officeName);
+        if(list.size()>0){
+            List<String> officeIds = Lists.newArrayList();
+            for (OfficeDTO info :
+                    list) {
+                officeIds.add(info.getId());
+            }
+        }
+        List rootTree = officeService.getofficeUserTree (officeName,list, extId, type, showAll);
+        return ResponseEntity.ok (rootTree);
+    }
+
 
 }