Explorar el Código

中审报表报销以及报销数据查询功能开发

user5 hace 3 años
padre
commit
bda3063a50
Se han modificado 31 ficheros con 1646 adiciones y 63 borrados
  1. 134 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/controller/ReimbursementBusinessController.java
  2. 21 9
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/controller/ReimbursementSysController.java
  3. 111 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/controller/ReimbursementUserController.java
  4. 33 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/domain/dto/ReimbursementBusinessDTO.java
  5. 6 2
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/domain/dto/ReimbursementDTO.java
  6. 31 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/domain/dto/ReimbursementUserDTO.java
  7. 105 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/mapper/ReimbursementBusinessMapper.java
  8. 20 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/mapper/ReimbursementSysMapper.java
  9. 65 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/mapper/ReimbursementUserMapper.java
  10. 227 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/mapper/xml/ReimbursementBusinessMapper.xml
  11. 34 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/mapper/xml/ReimbursementSysMapper.xml
  12. 138 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/mapper/xml/ReimbursementUserMapper.xml
  13. 80 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/service/ReimbursementBusinessService.java
  14. 6 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/service/ReimbursementSysService.java
  15. 65 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/service/ReimbursementUserService.java
  16. 221 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/service/impl/ReimbursementBusinessServiceImpl.java
  17. 5 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/service/impl/ReimbursementSysServiceImpl.java
  18. 124 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/service/impl/ReimbursementUserServiceImpl.java
  19. 29 0
      jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/core/domain/BaseEntity.java
  20. 0 33
      jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/core/domain/TreeEntity.java
  21. 34 0
      jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/controller/UserController.java
  22. 11 3
      jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/mapper/UserMapper.java
  23. 37 0
      jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/mapper/xml/UserMapper.xml
  24. 9 2
      jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/service/UserService.java
  25. 88 1
      jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/service/dto/OfficeDTO.java
  26. 2 2
      jeeplus-plugins/jeeplus-datasource/target/generated-sources/annotations/com/jeeplus/database/datalink/service/mapstruct/DataSourceWrapperImpl.java
  27. 2 2
      jeeplus-plugins/jeeplus-datasource/target/generated-sources/annotations/com/jeeplus/database/datamodel/service/mapstruct/DataMetaWrapperImpl.java
  28. 2 2
      jeeplus-plugins/jeeplus-datasource/target/generated-sources/annotations/com/jeeplus/database/datamodel/service/mapstruct/DataParamWrapperImpl.java
  29. 2 2
      jeeplus-plugins/jeeplus-datasource/target/generated-sources/annotations/com/jeeplus/database/datamodel/service/mapstruct/DataSetWrapperImpl.java
  30. 2 2
      jeeplus-plugins/jeeplus-notify/target/generated-sources/annotations/com/jeeplus/notify/service/mapstruct/NotifyRecordWrapperImpl.java
  31. 2 2
      jeeplus-plugins/jeeplus-notify/target/generated-sources/annotations/com/jeeplus/notify/service/mapstruct/NotifyWrapperImpl.java

+ 134 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/controller/ReimbursementBusinessController.java

@@ -0,0 +1,134 @@
+package com.jeeplus.test.reimbursementsys.controller;
+
+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.sys.utils.StringUtils;
+import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementBusinessDTO;
+import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementDTO;
+import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementUserDTO;
+import com.jeeplus.test.reimbursementsys.service.ReimbursementBusinessService;
+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 java.util.List;
+import java.util.Map;
+
+/**
+ * @author 徐滕
+ * @version 1.0.0
+ * @ClassName ReimbursementUserController.java
+ * @Description TODO 报销人员年份金额信息
+ * @createTime 2022年05月16日 10:35:21
+ */
+@RestController
+@RequestMapping("/reimbursementBusiness")
+public class ReimbursementBusinessController {
+
+    @Autowired
+    private ReimbursementBusinessService service;
+
+    /**
+     * 根据id报销人员信息
+     * @param id
+     * @return
+     */
+    @ApiLog("根据id报销人员信息")
+    @GetMapping("queryById")
+    public ResponseEntity queryById(@RequestParam String id) {
+        ReimbursementBusinessDTO reimbursementDTO = service.queryById (id);
+        return ResponseEntity.ok (reimbursementDTO);
+    }
+
+    /**
+     * 根据id报销人员信息
+     * @param id
+     * @return
+     */
+    @ApiLog("根据id报销人员信息")
+    @PreAuthorize("hasAnyAuthority('reimbursementBusiness:add')")
+    @GetMapping("getBusinessById")
+    public ResponseEntity getBusinessById(@RequestParam String id) {
+        ReimbursementDTO reimbursementDTO = service.getBusinessById (id);
+        return ResponseEntity.ok (reimbursementDTO);
+    }
+
+    /**
+     * 根据人员id查询报销年份信息
+     * @param reimbursementUser
+     * @param page
+     * @return
+     */
+    @ApiLog("查询角色列表")
+    @GetMapping("getYearList")
+    public ResponseEntity<IPage<ReimbursementUserDTO>> getYearList(ReimbursementUserDTO reimbursementUser, Page<ReimbursementUserDTO> page) {
+        IPage<ReimbursementUserDTO> list = service.getYearList(page,reimbursementUser);
+        return ResponseEntity.ok (list);
+    }
+
+
+    /**
+     * 查询报销信息
+     * @return
+     */
+    @ApiLog("查询报销人员信息列表")
+    @GetMapping("findList")
+    public ResponseEntity findList(ReimbursementUserDTO reimbursementUser, Page<ReimbursementUserDTO> page) {
+        IPage<ReimbursementUserDTO> list = service.findList(page,reimbursementUser);
+        return ResponseEntity.ok(list);
+    }
+
+    /**
+     * 保存业务报销编码
+     * @return
+     */
+    @ApiLog("保存报销人员信息")
+    @PostMapping("save")
+    public ResponseEntity save(@RequestBody ReimbursementBusinessDTO reimbursementUser) {
+        Map<String, Object> result = service.save(reimbursementUser);
+        Boolean success = (Boolean) result.get("success");
+        if(success){
+            return ResponseEntity.ok(result.get("message"));
+        }
+        return ResponseEntity.badRequest ().body (result.get("message"));
+    }
+
+    /**
+     * 批量删除
+     * @param ids
+     * @return
+     */
+    @DemoMode
+    @ApiLog("批量删除")
+    @PreAuthorize("hasAuthority('reimbursementBusiness:del')")
+    @DeleteMapping("delete")
+    public ResponseEntity delete(String ids) {
+        String idArray[] =ids.split(",");
+        service.delete ( Lists.newArrayList (idArray) );
+        return ResponseEntity.ok ("删除成功!");
+    }
+
+
+
+
+    /**
+     * 查询报销信息
+     * @return
+     */
+    @ApiLog("查询业务报销信息列表")
+    @PreAuthorize("hasAuthority('reimbursementBusiness:view')")
+    @GetMapping("findListByBusinessCodeId")
+    public ResponseEntity findListByBusinessCodeId(String id) {
+        if(StringUtils.isBlank(id)){
+            return ResponseEntity.badRequest ().body ("请先选择业务信息");
+        }
+        ReimbursementBusinessDTO reimbursementBusiness = new ReimbursementBusinessDTO();
+        reimbursementBusiness.setBusinessCodeId(id);
+        List<ReimbursementBusinessDTO> list = service.findListByBusinessCodeId(reimbursementBusiness);
+        return ResponseEntity.ok(list);
+    }
+}

+ 21 - 9
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/controller/ReimbursementSysController.java

@@ -5,8 +5,6 @@ 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.sys.service.dto.LogDTO;
-import com.jeeplus.sys.service.dto.OfficeDTO;
 import com.jeeplus.sys.utils.ImportExcel;
 import com.jeeplus.sys.utils.StringUtils;
 import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementDTO;
@@ -19,9 +17,10 @@ import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.validation.Valid;
-import java.io.File;
 import java.io.IOException;
-import java.util.*;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 /**
  * @author li-peike
@@ -43,7 +42,7 @@ public class ReimbursementSysController {
      * @return
      */
     @ApiLog("查询业务具体信息")
-    //@PreAuthorize("hasAnyAuthority('sys:office:view','sys:office:add','sys:office:edit')")
+    @PreAuthorize("hasAnyAuthority('reimbursement:view','reimbursement:add','reimbursement:edit')")
     @GetMapping("queryBusinessById")
     public ResponseEntity queryBusinessById(@RequestParam String id) {
         ReimbursementDTO reimbursementDTO = service.queryBusinessById (id);
@@ -55,7 +54,7 @@ public class ReimbursementSysController {
      * @return
      */
     @ApiLog("查询发票具体信息")
-    //@PreAuthorize("hasAnyAuthority('sys:office:view','sys:office:add','sys:office:edit')")
+    @PreAuthorize("hasAnyAuthority('reimbursement:view','reimbursement:add','reimbursement:edit')")
     @GetMapping("queryInvoiceById")
     public ResponseEntity queryInvoiceById(@RequestParam String id) {
         ReimbursementDTO reimbursementDTO = service.queryInvoiceById (id);
@@ -109,6 +108,19 @@ public class ReimbursementSysController {
         service.saveBusiness(reimbursementDTO);
         return ResponseEntity.ok("保存业务编码" + reimbursementDTO.getBusinessCode() + "成功");
     }
+    /**
+     * 保存业务报销编码
+     * @return
+     */
+    @ApiLog("保存业务报销比例")
+    @PostMapping("updateReimbursementRatio")
+    public ResponseEntity updateReimbursementRatio(@Valid @RequestBody ReimbursementDTO reimbursementDTO) {
+        if(StringUtils.isBlank(reimbursementDTO.getReimbursementRatio())){
+            return ResponseEntity.badRequest ().body ("报销比例不可为空,请重新填写!");
+        }
+        service.updateReimbursementRatio(reimbursementDTO);
+        return ResponseEntity.ok("保存业务编码" + reimbursementDTO.getBusinessCode() + "成功");
+    }
 
 
     /**
@@ -129,7 +141,7 @@ public class ReimbursementSysController {
      */
     @DemoMode
     @ApiLog("批量删除")
-    //@PreAuthorize("hasAuthority('sys:office:del')")
+    @PreAuthorize("hasAuthority('reimbursement:del')")
     @DeleteMapping("delete")
     public ResponseEntity delete(String ids) {
         String idArray[] =ids.split(",");
@@ -144,7 +156,7 @@ public class ReimbursementSysController {
      */
     @DemoMode
     @ApiLog("删除业务信息")
-    //@PreAuthorize("hasAuthority('sys:office:del')")
+    @PreAuthorize("hasAuthority('reimbursement:del')")
     @DeleteMapping("deleteBusiness")
     public ResponseEntity deleteBusiness(String ids) {
         String idArray[] =ids.split(",");
@@ -159,7 +171,7 @@ public class ReimbursementSysController {
      */
     @DemoMode
     @ApiLog("删除发票信息")
-    //@PreAuthorize("hasAuthority('sys:office:del')")
+    @PreAuthorize("hasAuthority('reimbursement:del')")
     @DeleteMapping("deleteInvoice")
     public ResponseEntity deleteInvoice(String ids) {
         String idArray[] =ids.split(",");

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

@@ -0,0 +1,111 @@
+package com.jeeplus.test.reimbursementsys.controller;
+
+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.sys.utils.StringUtils;
+import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementBusinessDTO;
+import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementUserDTO;
+import com.jeeplus.test.reimbursementsys.service.ReimbursementUserService;
+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 java.util.List;
+import java.util.Map;
+
+/**
+ * @author 徐滕
+ * @version 1.0.0
+ * @ClassName ReimbursementUserController.java
+ * @Description TODO 报销人员年份金额信息
+ * @createTime 2022年05月16日 10:35:21
+ */
+@RestController
+@RequestMapping("/reimbursementUser")
+public class ReimbursementUserController {
+
+    @Autowired
+    private ReimbursementUserService service;
+
+    /**
+     * 根据id报销人员信息
+     * @param id
+     * @return
+     */
+    @ApiLog("根据id报销人员信息")
+    @PreAuthorize("hasAnyAuthority('reimbursementUser:view','reimbursementUser:add','reimbursementUser:edit')")
+    @GetMapping("queryById")
+    public ResponseEntity queryById(@RequestParam String id) {
+        ReimbursementUserDTO reimbursementDTO = service.queryById (id);
+        return ResponseEntity.ok (reimbursementDTO);
+    }
+
+
+    /**
+     * 查询报销信息
+     * @return
+     */
+    @ApiLog("查询报销人员信息列表")
+    @GetMapping("findList")
+    public ResponseEntity findList(ReimbursementUserDTO reimbursementUser, Page<ReimbursementUserDTO> page) {
+        IPage<ReimbursementUserDTO> list = service.findList(page,reimbursementUser);
+        return ResponseEntity.ok(list);
+    }
+
+    /**
+     * 保存业务报销编码
+     * @return
+     */
+    @ApiLog("保存报销人员信息")
+    @PostMapping("save")
+    public ResponseEntity save(@RequestBody ReimbursementUserDTO reimbursementUser) {
+        Map<String, Object> result = service.save(reimbursementUser);
+        Boolean success = (Boolean) result.get("success");
+        if(success){
+            return ResponseEntity.ok(result.get("message"));
+        }
+        return ResponseEntity.badRequest ().body (result.get("message"));
+    }
+
+    /**
+     * 批量删除
+     * @param ids
+     * @return
+     */
+    @DemoMode
+    @ApiLog("批量删除")
+    @PreAuthorize("hasAuthority('reimbursementUser:del')")
+    @DeleteMapping("delete")
+    public ResponseEntity delete(String ids) {
+        String idArray[] =ids.split(",");
+        service.delete ( Lists.newArrayList (idArray) );
+        return ResponseEntity.ok ("删除成功!");
+    }
+
+
+
+    /**
+     * 查询报销信息
+     * @return
+     */
+    @ApiLog("查询业务报销信息列表")
+    @PreAuthorize("hasAuthority('reimbursementBusiness:view')")
+    @GetMapping("findListByUserId")
+    public ResponseEntity findListByUserId(String id) {
+        if(StringUtils.isBlank(id)){
+            return ResponseEntity.badRequest ().body ("请先选择报销人员信息");
+        }
+
+        //根据id查询人员填报的报销信息
+        ReimbursementUserDTO reimbursementUserDTO = service.queryById(id);
+        if(null == reimbursementUserDTO){
+            return ResponseEntity.badRequest ().body ("报销人员信息无效,请重新选择");
+        }
+        List<ReimbursementBusinessDTO> list = service.findListByUserId(reimbursementUserDTO);
+        return ResponseEntity.ok(list);
+    }
+}

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

@@ -0,0 +1,33 @@
+package com.jeeplus.test.reimbursementsys.domain.dto;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 报销信息表
+ * @author: 徐滕
+ * @version: 2022-05-16 11:06
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@TableName("zs_reimbursement_business_info")
+public class ReimbursementBusinessDTO extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    private String businessCode;  //业务编号
+    private String businessCodeId;  //业务编号Id
+    private String userId;  //报销人id
+    private String userName;  //报销人
+    private String year;    //报销年份
+    private String reimbursementQuota;  //年报销额度
+    private String reimbursementQuotaDay;  //日报销额度
+    private String reimbursementDay;  //报销天数
+    private String reimbursementAmount;  //报销额度
+    private String remainReimbursementAmount;  //剩余报销额度
+    private String remarks; //备注
+
+
+}

+ 6 - 2
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/domain/dto/ReimbursementDTO.java

@@ -3,13 +3,11 @@ package com.jeeplus.test.reimbursementsys.domain.dto;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.jeeplus.core.domain.TreeEntity;
-import com.jeeplus.core.service.dto.TreeDTO;
 import com.jeeplus.sys.utils.ExcelField;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import org.springframework.format.annotation.DateTimeFormat;
 
-import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
 
@@ -22,7 +20,9 @@ import java.util.List;
 @EqualsAndHashCode(callSuper = false)
 @TableName("zs_reimbursement_info")
 public class ReimbursementDTO extends TreeEntity<ReimbursementDTO> {
+    private static final long serialVersionUID = 1L;
     private String businessCode;    //业务编号
+    private String businessCodeId;    //业务编号id
     private String invoiceCode;     //发票代码
     private String invoiceNumber;   //发票号码
     private String firmName;        //购方企业名称
@@ -39,6 +39,10 @@ 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 List<String> idList;
 
     @DateTimeFormat(pattern =  "yyyy-MM-dd")

+ 31 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/domain/dto/ReimbursementUserDTO.java

@@ -0,0 +1,31 @@
+package com.jeeplus.test.reimbursementsys.domain.dto;
+
+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;
+
+/**
+ * 报销人员表
+ * @author: 徐滕
+ * @version: 2022-05-16 11:06
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@TableName("zs_reimbursement_user_info")
+public class ReimbursementUserDTO extends BaseEntity {
+
+    private String userId;  //报销人id
+    private UserDTO user;   //报销人员信息
+    private String year;    //报销年份
+    private String reimbursementQuota;  //年报销额度
+    private String reimbursementQuotaDay;  //日报销额度
+    private String reimbursementDay;  //报销天数
+    private String reimbursementAmount;  //报销额度
+    private String remainReimbursementAmount;  //剩余报销额度
+    private String alreadyReimbursementAmount;  //已报销额度
+    private String remarks; //备注
+
+
+}

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

@@ -0,0 +1,105 @@
+package com.jeeplus.test.reimbursementsys.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementBusinessDTO;
+import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementUserDTO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @author li-peike
+ * @version 1.0.0
+ * @ClassName ReimbursementSysMapper.java
+ * @Description TODO
+ * @createTime 2022年05月06日 10:40:00
+ */
+public interface ReimbursementBusinessMapper extends BaseMapper<ReimbursementUserDTO> {
+    /**
+     * 根据条件查询数据信息
+     * @param page
+     * @param reimbursementUser
+     * @return
+     */
+    IPage<ReimbursementUserDTO> findList(Page<ReimbursementUserDTO> page, @Param("reimbursementUser")ReimbursementUserDTO reimbursementUser);
+    /**
+     * 根据条件查询数据信息
+     * @param reimbursementBusiness
+     * @return
+     */
+    List<ReimbursementBusinessDTO> findListByBusinessCodeId(ReimbursementBusinessDTO reimbursementBusiness);
+    /**
+     * 根据条件查询数据信息
+     * @param reimbursementBusiness
+     * @return
+     */
+    List<ReimbursementBusinessDTO> findListByUserIdAndYear(ReimbursementBusinessDTO reimbursementBusiness);
+    /**
+     * 根据条件查询数据信息
+     * @param page
+     * @param reimbursementUser
+     * @return
+     */
+    IPage<ReimbursementUserDTO> getYearList(Page<ReimbursementUserDTO> page, @Param("reimbursementUser")ReimbursementUserDTO reimbursementUser);
+    /**
+     * 根据条件查询数据信息
+     * @param reimbursementUser
+     * @return
+     */
+    List<ReimbursementUserDTO> getReimbursementMoneyByYear(ReimbursementUserDTO reimbursementUser);
+
+    /**
+     * 保存人员报销信息
+     * @param reimbursementUser
+     */
+    void save(ReimbursementBusinessDTO reimbursementUser);
+
+    /**
+     * 修改人员报销信息
+     * @param reimbursementUser
+     */
+    void update(ReimbursementBusinessDTO reimbursementUser);
+
+    /**
+     * 查询业务信息
+     * @param id
+     * @return
+     */
+    ReimbursementBusinessDTO queryById(String id);
+
+    /**
+     * 查询业务信息
+     * @param reimbursementUser
+     * @return
+     */
+    ReimbursementUserDTO reimbursementUserByUserIdAndYear(ReimbursementBusinessDTO reimbursementUser);
+
+    /**
+     * 查询报销信息(根据人员id和年份)
+     * @param reimbursementUser
+     * @return
+     */
+    ReimbursementUserDTO queryByUserIdAndYear(ReimbursementBusinessDTO reimbursementUser);
+
+    /**
+     * 根据id删除人员报销信息(物理删除)
+     * @param idList
+     */
+    void delete(@Param("idList") List<String> idList);
+
+    /**
+     * 根据人员id和年份查询该员工当年报销额度总额
+     * @param reimbursementUser
+     * @return
+     */
+    String getAlreadyReimbursementQuotaByUserIdAndYear(ReimbursementBusinessDTO reimbursementUser);
+
+    /**
+     * 根据人员id和年份查询该员工当年报销额度总额
+     * @param reimbursementUser
+     * @return
+     */
+    String getAlreadyReimbursementQuotaByBusinessCodeId(ReimbursementBusinessDTO reimbursementUser);
+}

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

@@ -28,6 +28,20 @@ public interface ReimbursementSysMapper  extends BaseMapper<ReimbursementDTO> {
     List<ReimbursementDTO> getInvoiceList(ReimbursementDTO reimbursement);
 
     /**
+     * 根据父id查询已收款的发票信息的首款额度总和
+     * @param parentId
+     * @return
+     */
+    String getReceiptInvoiceIncomeByReimbursementId(String parentId);
+
+    /**
+     * 根据业务id查询报销比例
+     * @param id
+     * @return
+     */
+    String getReimbursementRatioByReimbursementId(String id);
+
+    /**
      * 根据父节点id查询发票信息
      * @param parentIdList
      * @return
@@ -124,4 +138,10 @@ public interface ReimbursementSysMapper  extends BaseMapper<ReimbursementDTO> {
      * @param idList
      */
     void removeInvoiceByIds(@Param("idList")List<String> idList);
+
+    /**
+     * 修改业务报销比例
+     * @param reimbursement
+     */
+    void updateReimbursementRatio(ReimbursementDTO reimbursement);
 }

+ 65 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/mapper/ReimbursementUserMapper.java

@@ -0,0 +1,65 @@
+package com.jeeplus.test.reimbursementsys.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementUserDTO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @author li-peike
+ * @version 1.0.0
+ * @ClassName ReimbursementSysMapper.java
+ * @Description TODO
+ * @createTime 2022年05月06日 10:40:00
+ */
+public interface ReimbursementUserMapper extends BaseMapper<ReimbursementUserDTO> {
+    /**
+     * 根据条件查询数据信息
+     * @param page
+     * @param reimbursementUser
+     * @return
+     */
+    IPage<ReimbursementUserDTO> findList(Page<ReimbursementUserDTO> page, @Param("reimbursementUser")ReimbursementUserDTO reimbursementUser);
+    /**
+     * 根据条件查询数据信息
+     * @param page
+     * @param reimbursementUser
+     * @return
+     */
+    IPage<ReimbursementUserDTO> getYearList(Page<ReimbursementUserDTO> page, @Param("reimbursementUser")ReimbursementUserDTO reimbursementUser);
+
+    /**
+     * 保存人员报销信息
+     * @param reimbursementUser
+     */
+    void save(ReimbursementUserDTO reimbursementUser);
+
+    /**
+     * 修改人员报销信息
+     * @param reimbursementUser
+     */
+    void update(ReimbursementUserDTO reimbursementUser);
+
+    /**
+     * 查询业务信息
+     * @param id
+     * @return
+     */
+    ReimbursementUserDTO queryById(String id);
+
+    /**
+     * 查询报销信息(根据人员id和年份)
+     * @param reimbursementUser
+     * @return
+     */
+    ReimbursementUserDTO queryByUserIdAndYear(ReimbursementUserDTO reimbursementUser);
+
+    /**
+     * 根据id删除人员报销信息(物理删除)
+     * @param idList
+     */
+    void delete(@Param("idList") List<String> idList);
+}

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

@@ -0,0 +1,227 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.test.reimbursementsys.mapper.ReimbursementBusinessMapper">
+    <sql id="reimbursementUserColumns">
+        a.id AS "id",
+		a.create_by AS "createBy.id",
+		a.create_date AS "createDate",
+		a.update_by AS "updateBy.id",
+		a.update_date AS "updateDate",
+		a.remarks AS "remarks",
+		a.del_flag AS "delFlag",
+		a.user_id AS "userId",
+        a.year AS "year",
+        a.reimbursement_quota AS "reimbursementQuota",
+        a.reimbursement_quota_day AS "reimbursementQuotaDay",
+        su.id as "user.id",
+        su.name as "user.name"
+    </sql>
+
+    <sql id="reimbursementBusinessColumns">
+        a.id AS "id",
+		a.create_by AS "createBy.id",
+		a.create_date AS "createDate",
+		a.update_by AS "updateBy.id",
+		a.update_date AS "updateDate",
+		a.remarks AS "remarks",
+		a.del_flag AS "delFlag",
+		a.business_code_id as "businessCodeId",
+		a.user_id AS "userId",
+        su.name as "userName",
+        a.year AS "year",
+        a.reimbursement_day as "reimbursementDay",
+        a.reimbursement_amount as "reimbursementAmount"
+    </sql>
+
+    <sql id="reimbursementUserJoinColumns">
+        left join sys_user su on su.id = a.user_id
+    </sql>
+
+    <select id="findList" resultType="com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementUserDTO">
+        SELECT
+            <include refid="reimbursementUserColumns"/>
+        FROM zs_reimbursement_user_info a
+        <include refid="reimbursementUserJoinColumns"/>
+        <where>
+            a.del_flag = 0
+            <if test="reimbursementUser.year != null and reimbursementUser.year != ''">
+                and a.year like concat('%',#{reimbursementUser.year},'%')
+            </if>
+            <if test="reimbursementUser.userId != null and reimbursementUser.userId != ''">
+                and a.user_id = #{reimbursementUser.userId}
+            </if>
+        </where>
+        order by a.update_date desc,a.year desc, a.user_id asc
+    </select>
+
+    <select id="getYearList" resultType="com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementUserDTO">
+        SELECT
+            <include refid="reimbursementUserColumns"/>
+        FROM zs_reimbursement_user_info a
+        <include refid="reimbursementUserJoinColumns"/>
+        <where>
+            a.del_flag = 0
+            <if test="reimbursementUser.userId != null and reimbursementUser.userId != ''">
+                and a.user_id = #{reimbursementUser.userId}
+            </if>
+        </where>
+        order by a.year desc
+    </select>
+
+    <select id="getReimbursementMoneyByYear" resultType="com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementUserDTO">
+        SELECT
+            a.year as year,
+            sum(a.reimbursement_amount) as alreadyReimbursementAmount
+        FROM zs_reimbursement_business_info a
+        <where>
+            a.del_flag = 0
+            and a.user_id = #{userId}
+            and a.year in (${year})
+        </where>
+        group by a.year
+        order by a.year desc
+    </select>
+
+    <select id="reimbursementUserByUserIdAndYear" resultType="com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementUserDTO">
+        SELECT
+            <include refid="reimbursementUserColumns"/>
+        FROM zs_reimbursement_user_info a
+        <include refid="reimbursementUserJoinColumns"/>
+        <where>
+            a.del_flag = 0
+            and a.user_id = #{userId}
+            and a.year = #{year}
+        </where>
+    </select>
+
+    <insert id="save">
+        insert into zs_reimbursement_business_info (
+            id,
+            create_by,
+            create_date,
+            update_by,
+            update_date,
+            remarks,
+            del_flag,
+            business_code_id,
+            user_id,
+            year,
+            reimbursement_day,
+            reimbursement_amount
+        )
+        values
+        (
+            #{id},
+            #{createBy},
+            #{createDate},
+            #{updateBy},
+            #{updateDate},
+            #{remarks},
+            #{delFlag},
+            #{businessCodeId},
+            #{userId},
+            #{year},
+            #{reimbursementDay},
+            #{reimbursementAmount}
+        )
+    </insert>
+
+    <update id="update">
+        update zs_reimbursement_user_info
+        set
+            update_by = #{updateBy}
+            ,update_date = #{updateDate}
+            <if test="year != null and year != ''">
+                ,year = #{year}
+            </if>
+            <if test="reimbursementQuota != null and reimbursementQuota != ''">
+                ,reimbursement_quota = #{reimbursementQuota}
+            </if>
+            <if test="reimbursementQuotaDay != null and reimbursementQuotaDay != ''">
+                ,reimbursement_quota_day = #{reimbursementQuotaDay}
+            </if>
+        <where>
+            id = #{id}
+        </where>
+    </update>
+
+    <select id="queryById" resultType="com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementBusinessDTO">
+        SELECT
+        <include refid="reimbursementUserColumns"/>
+            FROM zs_reimbursement_user_info a
+        <include refid="reimbursementUserJoinColumns"/>
+        <where>
+            a.del_flag = 0
+            and a.id = #{id}
+        </where>
+    </select>
+
+    <select id="queryByUserIdAndYear" resultType="com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementUserDTO">
+        SELECT
+        <include refid="reimbursementUserColumns"/>
+            FROM zs_reimbursement_user_info a
+        <include refid="reimbursementUserJoinColumns"/>
+        <where>
+            a.del_flag = 0
+            and a.user_id = #{userId}
+            and a.year = #{year}
+        </where>
+    </select>
+
+    <delete id="delete">
+        delete from zs_reimbursement_user_info
+        <where>
+            <if test="idList != null and idList.size>0">
+                and id in
+                <foreach collection="idList" item="id" separator="," open="(" close=")">
+                    #{id}
+                </foreach>
+            </if>
+        </where>
+    </delete>
+
+    <select id="getAlreadyReimbursementQuotaByUserIdAndYear" resultType="java.lang.String">
+        select ifnull(sum(a.reimbursement_amount),0)
+        from zs_reimbursement_business_info a
+        where a.del_flag = 0
+        and a.user_id= #{userId}
+        and a.year = #{year}
+    </select>
+
+    <select id="getAlreadyReimbursementQuotaByBusinessCodeId" resultType="java.lang.String">
+        select ifnull(sum(a.reimbursement_amount),0)
+        from zs_reimbursement_business_info a
+        where a.del_flag = 0
+        and a.business_code_id= #{businessCodeId}
+    </select>
+
+
+
+    <select id="findListByBusinessCodeId" resultType="com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementBusinessDTO">
+        SELECT
+        <include refid="reimbursementBusinessColumns"/>
+        FROM zs_reimbursement_business_info a
+        <include refid="reimbursementUserJoinColumns"/>
+        <where>
+            a.del_flag = 0
+            and a.business_code_id = #{businessCodeId}
+        </where>
+        order by a.update_date desc,a.year desc, a.user_id asc
+    </select>
+
+
+    <select id="findListByUserIdAndYear" resultType="com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementBusinessDTO">
+        SELECT
+        <include refid="reimbursementBusinessColumns"/>
+        ,zri.business_code as "businessCode"
+        FROM zs_reimbursement_business_info a
+        <include refid="reimbursementUserJoinColumns"/>
+        left join zs_reimbursement_info zri on zri.id = a.business_code_id
+        <where>
+            a.del_flag = 0
+            and a.user_id = #{userId}
+            and a.year = #{year}
+        </where>
+        order by a.update_date desc,a.year desc, a.user_id asc
+    </select>
+</mapper>

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

@@ -24,7 +24,8 @@
         a.gathering_time AS "gatheringTime",
         a.proposer AS "proposer",
         a.partner AS "partner",
-        a.business_type AS "businessType"
+        a.business_type AS "businessType",
+        a.reimbursement_ratio AS "reimbursementRatio"
     </sql>
 
     <select id="queryAllList" resultType="com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementDTO">
@@ -59,6 +60,29 @@
         order by a.invoice_number
     </select>
 
+    <select id="getReceiptInvoiceIncomeByReimbursementId" resultType="java.lang.String">
+        SELECT
+            ifnull(sum(a.income),0) as "income"
+        FROM zs_reimbursement_invoice_info a
+        <where>
+            a.del_flag = 0
+            and a.parent_id =#{parentId}
+            and a.gathering_time is not null
+        </where>
+        order by a.invoice_number
+    </select>
+
+    <select id="getReimbursementRatioByReimbursementId" resultType="java.lang.String">
+        SELECT
+            a.reimbursement_ratio as "reimbursementRatio"
+        FROM zs_reimbursement_info a
+        <where>
+            a.del_flag = 0
+            and a.id =#{id}
+        </where>
+        order by a.invoice_number
+    </select>
+
     <select id="getInvoiceByParentIdList" resultType="com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementDTO">
         SELECT
             <include refid="reimbursementColumns"/>
@@ -305,4 +329,13 @@
             </if>
         </where>
     </update>
+
+    <update id="updateReimbursementRatio">
+        update zs_reimbursement_info
+        set
+        reimbursement_ratio = #{reimbursementRatio}
+        <where>
+            id = #{id}
+        </where>
+    </update>
 </mapper>

+ 138 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/mapper/xml/ReimbursementUserMapper.xml

@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.test.reimbursementsys.mapper.ReimbursementUserMapper">
+    <sql id="reimbursementUserColumns">
+        a.id AS "id",
+		a.create_by AS "createBy.id",
+		a.create_date AS "createDate",
+		a.update_by AS "updateBy.id",
+		a.update_date AS "updateDate",
+		a.remarks AS "remarks",
+		a.del_flag AS "delFlag",
+		a.user_id AS "userId",
+        a.year AS "year",
+        a.reimbursement_quota AS "reimbursementQuota",
+        a.reimbursement_quota_day AS "reimbursementQuotaDay",
+        su.id as "user.id",
+        su.name as "user.name"
+    </sql>
+
+    <sql id="reimbursementUserJoinColumns">
+        left join sys_user su on su.id = a.user_id
+    </sql>
+
+    <select id="findList" resultType="com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementUserDTO">
+        SELECT
+            <include refid="reimbursementUserColumns"/>
+        FROM zs_reimbursement_user_info a
+        <include refid="reimbursementUserJoinColumns"/>
+        <where>
+            a.del_flag = 0
+            <if test="reimbursementUser.year != null and reimbursementUser.year != ''">
+                and a.year like concat('%',#{reimbursementUser.year},'%')
+            </if>
+            <if test="reimbursementUser.userId != null and reimbursementUser.userId != ''">
+                and a.user_id = #{reimbursementUser.userId}
+            </if>
+        </where>
+        order by a.update_date desc,a.year desc, a.user_id asc
+    </select>
+
+    <select id="getYearList" resultType="com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementUserDTO">
+        SELECT
+            <include refid="reimbursementUserColumns"/>
+        FROM zs_reimbursement_user_info a
+        <include refid="reimbursementUserJoinColumns"/>
+        <where>
+            a.del_flag = 0
+            <if test="reimbursementUser.userId != null and reimbursementUser.userId != ''">
+                and a.user_id = #{reimbursementUser.userId}
+            </if>
+        </where>
+        order by a.year desc
+    </select>
+
+    <insert id="save">
+        insert into zs_reimbursement_user_info (
+            id,
+            create_by,
+            create_date,
+            update_by,
+            update_date,
+            remarks,
+            del_flag,
+            user_id,
+            year,
+            reimbursement_quota,
+            reimbursement_quota_day
+        )
+        values
+        (
+            #{id},
+            #{createBy},
+            #{createDate},
+            #{updateBy},
+            #{updateDate},
+            #{remarks},
+            #{delFlag},
+            #{userId},
+            #{year},
+            #{reimbursementQuota},
+            #{reimbursementQuotaDay}
+        )
+    </insert>
+
+    <update id="update">
+        update zs_reimbursement_user_info
+        set
+            update_by = #{updateBy}
+            ,update_date = #{updateDate}
+            <if test="year != null and year != ''">
+                ,year = #{year}
+            </if>
+            <if test="reimbursementQuota != null and reimbursementQuota != ''">
+                ,reimbursement_quota = #{reimbursementQuota}
+            </if>
+            <if test="reimbursementQuotaDay != null and reimbursementQuotaDay != ''">
+                ,reimbursement_quota_day = #{reimbursementQuotaDay}
+            </if>
+        <where>
+            id = #{id}
+        </where>
+    </update>
+
+    <select id="queryById" resultType="com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementUserDTO">
+        SELECT
+        <include refid="reimbursementUserColumns"/>
+            FROM zs_reimbursement_user_info a
+        <include refid="reimbursementUserJoinColumns"/>
+        <where>
+            a.del_flag = 0
+            and a.id = #{id}
+        </where>
+    </select>
+
+    <select id="queryByUserIdAndYear" resultType="com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementUserDTO">
+        SELECT
+        <include refid="reimbursementUserColumns"/>
+            FROM zs_reimbursement_user_info a
+        <include refid="reimbursementUserJoinColumns"/>
+        <where>
+            a.del_flag = 0
+            and a.user_id = #{userId}
+            and a.year = #{year}
+        </where>
+    </select>
+
+    <delete id="delete">
+        delete from zs_reimbursement_user_info
+        <where>
+            <if test="idList != null and idList.size>0">
+                and id in
+                <foreach collection="idList" item="id" separator="," open="(" close=")">
+                    #{id}
+                </foreach>
+            </if>
+        </where>
+    </delete>
+</mapper>

+ 80 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/service/ReimbursementBusinessService.java

@@ -0,0 +1,80 @@
+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.ReimbursementBusinessDTO;
+import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementDTO;
+import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementUserDTO;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author li-peike
+ * @version 1.0.0
+ * @ClassName ReimbursementSysService.java
+ * @Description TODO
+ * @createTime 2022年05月06日 10:25:00
+ */
+
+public interface ReimbursementBusinessService {
+    /**
+     * 查询报销人员信息
+     * @param id
+     * @return
+     */
+    ReimbursementBusinessDTO queryById(String id);
+    /**
+     * 查询业务报销额度相关信息
+     * @param id
+     * @return
+     */
+    ReimbursementDTO getBusinessById(String id);
+    /**
+     * 查询报销信息(根据人员id和年份)
+     * @param reimbursementUser
+     * @return
+     */
+    ReimbursementUserDTO queryByUserIdAndYear(ReimbursementBusinessDTO reimbursementUser);
+
+    /**
+     * 查询列表信息
+     * @param page
+     * @param reimbursementUser
+     * @return
+     */
+    IPage<ReimbursementUserDTO> findList(Page<ReimbursementUserDTO> page, ReimbursementUserDTO reimbursementUser);
+
+    /**
+     * 根据人员信息查询报销年份信息
+     * @param page
+     * @param reimbursementUser
+     * @return
+     */
+    IPage<ReimbursementUserDTO> getYearList(Page<ReimbursementUserDTO> page, ReimbursementUserDTO reimbursementUser);
+
+    /**
+     * 保存报销数据信息
+     * @param reimbursementUser
+     */
+    Map<String,Object> save(ReimbursementBusinessDTO reimbursementUser);
+
+    /**
+     * 修改报销人员信息
+     * @param reimbursementUser
+     */
+    void update(ReimbursementBusinessDTO reimbursementUser);
+
+    /**
+     * 根据id删除人员报销信息(物理删除)
+     * @param idList
+     */
+    void delete(List<String> idList);
+
+    /**
+     * 查询列表信息
+     * @param reimbursementBusiness
+     * @return
+     */
+    List<ReimbursementBusinessDTO> findListByBusinessCodeId(ReimbursementBusinessDTO reimbursementBusiness);
+}

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

@@ -66,4 +66,10 @@ public interface ReimbursementSysService {
      * @param idList
      */
     void removeInvoiceByIds(List <String> idList);
+
+    /**
+     * 修改业务报销比例
+     * @param reimbursement
+     */
+    void updateReimbursementRatio(ReimbursementDTO reimbursement);
 }

+ 65 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/service/ReimbursementUserService.java

@@ -0,0 +1,65 @@
+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.ReimbursementBusinessDTO;
+import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementUserDTO;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author li-peike
+ * @version 1.0.0
+ * @ClassName ReimbursementSysService.java
+ * @Description TODO
+ * @createTime 2022年05月06日 10:25:00
+ */
+
+public interface ReimbursementUserService {
+    /**
+     * 查询报销人员信息
+     * @param id
+     * @return
+     */
+    ReimbursementUserDTO queryById(String id);
+    /**
+     * 查询报销信息(根据人员id和年份)
+     * @param reimbursementUser
+     * @return
+     */
+    ReimbursementUserDTO queryByUserIdAndYear(ReimbursementUserDTO reimbursementUser);
+
+    /**
+     * 查询列表信息
+     * @param page
+     * @param reimbursementUser
+     * @return
+     */
+    IPage<ReimbursementUserDTO> findList(Page<ReimbursementUserDTO> page, ReimbursementUserDTO reimbursementUser);
+
+    /**
+     * 保存方法
+     * @param reimbursementUser
+     */
+    Map<String,Object> save(ReimbursementUserDTO reimbursementUser);
+
+    /**
+     * 修改报销人员信息
+     * @param reimbursementUser
+     */
+    void update(ReimbursementUserDTO reimbursementUser);
+
+    /**
+     * 根据id删除人员报销信息(物理删除)
+     * @param idList
+     */
+    void delete(List<String> idList);
+
+    /**
+     * 查询人员报销信息列表
+     * @param reimbursementUserDTO
+     * @return
+     */
+    List<ReimbursementBusinessDTO> findListByUserId(ReimbursementUserDTO reimbursementUserDTO);
+}

+ 221 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/service/impl/ReimbursementBusinessServiceImpl.java

@@ -0,0 +1,221 @@
+package com.jeeplus.test.reimbursementsys.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.google.common.collect.Lists;
+import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.sys.utils.StringUtils;
+import com.jeeplus.sys.utils.UserUtils;
+import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementBusinessDTO;
+import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementDTO;
+import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementUserDTO;
+import com.jeeplus.test.reimbursementsys.mapper.ReimbursementBusinessMapper;
+import com.jeeplus.test.reimbursementsys.mapper.ReimbursementSysMapper;
+import com.jeeplus.test.reimbursementsys.service.ReimbursementBusinessService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author li-peike
+ * @version 1.0.0
+ * @ClassName ReimbursementSysServiceImpl.java
+ * @Description TODO
+ * @createTime 2022年05月06日 10:38:00
+ */
+@Service
+public class ReimbursementBusinessServiceImpl implements ReimbursementBusinessService {
+
+    @Resource
+    private ReimbursementBusinessMapper mapper;
+    @Resource
+    private ReimbursementSysMapper reimbursementSysMapper;
+
+
+    @Override
+    public ReimbursementBusinessDTO queryById(String id) {
+        return mapper.queryById(id);
+    }
+
+    @Override
+    public ReimbursementDTO getBusinessById(String id) {
+        ReimbursementDTO reimbursement = new ReimbursementDTO();
+        reimbursement.setBusinessCodeId(id);
+        ReimbursementBusinessDTO reimbursementBusiness = new ReimbursementBusinessDTO();
+        reimbursementBusiness.setBusinessCodeId(id);
+        //根据业务id查询已收款的发票信息收款总额
+        String getReceiptInvoiceByReimbursementId = reimbursementSysMapper.getReceiptInvoiceIncomeByReimbursementId(id);
+        BigDecimal income = new BigDecimal(getReceiptInvoiceByReimbursementId);    //发票收入
+        //根据业务id查询报销比例
+        String getReimbursementRatioByReimbursementId = reimbursementSysMapper.getReimbursementRatioByReimbursementId(id);
+        if(StringUtils.isBlank(getReimbursementRatioByReimbursementId)){
+            getReimbursementRatioByReimbursementId = "0";
+            reimbursement.setReimbursementRatio("0");
+        }
+        BigDecimal reimbursementRatio = new BigDecimal(getReimbursementRatioByReimbursementId);    //报销比例
+        BigDecimal canReimbursementAmount = income.multiply(reimbursementRatio).divide(new BigDecimal("100")).setScale(2, BigDecimal.ROUND_HALF_UP);    //该项目可报销额度计算
+        //查询该业务总报销额度
+        String alreadyReimbursementQuotaByBusinessCodeId = mapper.getAlreadyReimbursementQuotaByBusinessCodeId(reimbursementBusiness);
+        BigDecimal allAlreadyReimbursementQuota = new BigDecimal(alreadyReimbursementQuotaByBusinessCodeId);    //总报销额度
+        reimbursement.setAllAlreadyReimbursementQuota(allAlreadyReimbursementQuota.toString());
+        reimbursement.setCanReimbursementAmount(canReimbursementAmount.toString());
+        reimbursement.setSurplusReimbursementAmount(canReimbursementAmount.subtract(allAlreadyReimbursementQuota).toString());
+        return reimbursement;
+    }
+
+    @Override
+    public ReimbursementUserDTO queryByUserIdAndYear(ReimbursementBusinessDTO reimbursementUser) {
+        return mapper.queryByUserIdAndYear(reimbursementUser);
+    }
+
+
+    @Override
+    public IPage<ReimbursementUserDTO> findList(Page<ReimbursementUserDTO> page, ReimbursementUserDTO reimbursementUser) {
+        return mapper.findList (page, reimbursementUser);
+    }
+
+    @Override
+    public IPage<ReimbursementUserDTO> getYearList(Page<ReimbursementUserDTO> page, ReimbursementUserDTO reimbursementUser) {
+        IPage<ReimbursementUserDTO> yearList = mapper.getYearList(page, reimbursementUser);
+        List<ReimbursementUserDTO> list = yearList.getRecords();
+        if(list.size()>0){
+            List<String> yearStrList = Lists.newArrayList();
+            for (ReimbursementUserDTO info : list) {
+                yearStrList.add(info.getYear());
+            }
+            String years = StringUtils.join(yearStrList, ',');
+            reimbursementUser.setYear(years);
+            //根据人员和年份查询他的已报金额
+            List<ReimbursementUserDTO> reimbursementMoneyByYear = mapper.getReimbursementMoneyByYear(reimbursementUser);
+            for (ReimbursementUserDTO info : list) {
+                for (ReimbursementUserDTO yearInfo : reimbursementMoneyByYear) {
+                    if(info.getYear().equals(yearInfo.getYear())){
+                        //获取当年总报销额度
+                        BigDecimal allAlreadyReimbursementQuota = new BigDecimal(info.getReimbursementQuota());
+                        //获取当年已报销额度
+                        BigDecimal alreadyReimbursementQuota = new BigDecimal(yearInfo.getAlreadyReimbursementAmount());
+                        info.setAlreadyReimbursementAmount(alreadyReimbursementQuota.toString());
+                        //计算出当年所剩报销额度
+                        info.setRemainReimbursementAmount(allAlreadyReimbursementQuota.subtract(alreadyReimbursementQuota).toString());
+                        break;
+                    }
+                }
+            }
+
+        }
+        return yearList;
+    }
+
+    /**
+     * 保存
+     * @param reimbursementUser
+     */
+    @Override
+    public Map<String,Object> save(ReimbursementBusinessDTO reimbursementUser) {
+        Map<String,Object> map = new HashMap<>();
+
+        if(StringUtils.isBlank(reimbursementUser.getUserId())){
+            map.put("success", false);
+            map.put("message", "报销人员为空,无法进行添加报销信息!");
+            return map;
+        }
+        if(StringUtils.isBlank(reimbursementUser.getYear())){
+            map.put("success", false);
+            map.put("message", "报销年份不正确,请重新填写!");
+            return map;
+        }
+        if(StringUtils.isBlank(reimbursementUser.getReimbursementDay()) || !StringUtils.isNumeric(reimbursementUser.getReimbursementDay())){
+            map.put("success", false);
+            map.put("message", "报销天数不正确,请重新填写!");
+            return map;
+        }
+        //根据人员id和报销年份查询该年度的报销信息
+        ReimbursementUserDTO reimbursementUserByUserIdAndYear = mapper.reimbursementUserByUserIdAndYear(reimbursementUser);
+        if(null == reimbursementUserByUserIdAndYear){
+            map.put("success", false);
+            map.put("message", "该员工" + reimbursementUser.getYear() + "年度未添加报销信息,无法进行报销");
+            return map;
+        }
+        //查询该人员该年度已报销额度
+        String alreadyReimbursementQuota = mapper.getAlreadyReimbursementQuotaByUserIdAndYear(reimbursementUser);
+        //判断本地报销额度是否超过该年度所剩余报销额度,如果超过,则不允许报销,并抛出。否则进行报销并保存报销数据
+        BigDecimal alreadyReimbursementQuotaB = new BigDecimal(alreadyReimbursementQuota);    //已报销额度
+        BigDecimal reimbursementQuotaDay = new BigDecimal(reimbursementUser.getReimbursementQuotaDay());    //日报销额度
+        BigDecimal reimbursementDay = new BigDecimal(reimbursementUser.getReimbursementDay());  //报销天数
+        BigDecimal reimbursementAmount = reimbursementQuotaDay.multiply(reimbursementDay).setScale(2, BigDecimal.ROUND_HALF_UP);    //报销额度
+        //往期加这次的总报销额度和当年的总报销额度进行比较,小于当年报销额度 则个人可以进行报销,否则,无法进行报销
+        if(alreadyReimbursementQuotaB.add(reimbursementAmount).compareTo(new BigDecimal(reimbursementUser.getReimbursementQuota())) == 1){
+            map.put("success", false);
+            map.put("message", "本次报销金额已超出当年报销额度所剩余额,无法进行报销");
+            return map;
+        }
+
+        //根据业务id查询已收款的发票信息收款总额
+        String getReceiptInvoiceByReimbursementId = reimbursementSysMapper.getReceiptInvoiceIncomeByReimbursementId(reimbursementUser.getBusinessCodeId());
+        BigDecimal income = new BigDecimal(getReceiptInvoiceByReimbursementId);    //发票收入
+        if(new BigDecimal("0").compareTo(income) == 0){
+            map.put("success", false);
+            map.put("message", "该业务可报销额度为0,无法进行报销");
+            return map;
+        }
+        //根据业务id查询报销比例
+        String getReimbursementRatioByReimbursementId = reimbursementSysMapper.getReimbursementRatioByReimbursementId(reimbursementUser.getBusinessCodeId());
+        if(StringUtils.isBlank(getReimbursementRatioByReimbursementId)){
+            map.put("success", false);
+            map.put("message", "该业务报销比例为0,无法进行报销");
+            return map;
+        }
+        BigDecimal reimbursementRatio = new BigDecimal(getReimbursementRatioByReimbursementId);    //报销比例
+        BigDecimal canReimbursementAmount = income.multiply(reimbursementRatio).divide(new BigDecimal("100")).setScale(2, BigDecimal.ROUND_HALF_UP);    //该项目可报销额度计算
+        //查询该业务总报销额度
+        String alreadyReimbursementQuotaByBusinessCodeId = mapper.getAlreadyReimbursementQuotaByBusinessCodeId(reimbursementUser);
+        BigDecimal allAlreadyReimbursementQuota = new BigDecimal(alreadyReimbursementQuotaByBusinessCodeId);    //总报销额度
+        //往期加这次的总报销额度和当年的总报销额度进行比较,小于当年报销额度 则个人可以进行报销,否则,无法进行报销
+        if(allAlreadyReimbursementQuota.add(reimbursementAmount).compareTo(canReimbursementAmount) == 1){
+            map.put("success", false);
+            map.put("message", "本次报销金额已超出该业务可报销额度所剩余额,无法进行报销");
+            return map;
+        }
+
+
+        UserDTO user = UserUtils.get(reimbursementUser.getUserId());
+
+        reimbursementUser.setReimbursementAmount(reimbursementAmount.toString());
+        if(StringUtils.isNotBlank(reimbursementUser.getId())){
+            reimbursementUser.preUpdate();
+            //新增
+            mapper.update(reimbursementUser);
+        }else{
+            reimbursementUser.preInsert();
+            //新增
+            mapper.save(reimbursementUser);
+        }
+
+        map.put("success", true);
+        map.put("message", user.getName() + "报销" + reimbursementUser.getReimbursementAmount() + "金额成功");
+        return map;
+    }
+
+
+    @Override
+    public void update(ReimbursementBusinessDTO reimbursementUser) {
+        mapper.update(reimbursementUser);
+    }
+
+    @Override
+    public void delete(List<String> idList) {
+        //删除发票信息
+        mapper.delete(idList);
+    }
+
+
+    @Override
+    public List<ReimbursementBusinessDTO> findListByBusinessCodeId(ReimbursementBusinessDTO reimbursementBusiness) {
+        return mapper.findListByBusinessCodeId (reimbursementBusiness);
+    }
+
+}

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

@@ -307,6 +307,11 @@ public class ReimbursementSysServiceImpl implements ReimbursementSysService {
         mapper.removeInvoiceByIds(idList);
     }
 
+    @Override
+    public void updateReimbursementRatio(ReimbursementDTO reimbursement) {
+        mapper.updateReimbursementRatio(reimbursement);
+    }
+
     /**
      * 文件数据分组
      * @param dataList

+ 124 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementsys/service/impl/ReimbursementUserServiceImpl.java

@@ -0,0 +1,124 @@
+package com.jeeplus.test.reimbursementsys.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.sys.utils.StringUtils;
+import com.jeeplus.sys.utils.UserUtils;
+import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementBusinessDTO;
+import com.jeeplus.test.reimbursementsys.domain.dto.ReimbursementUserDTO;
+import com.jeeplus.test.reimbursementsys.mapper.ReimbursementBusinessMapper;
+import com.jeeplus.test.reimbursementsys.mapper.ReimbursementUserMapper;
+import com.jeeplus.test.reimbursementsys.service.ReimbursementUserService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author li-peike
+ * @version 1.0.0
+ * @ClassName ReimbursementSysServiceImpl.java
+ * @Description TODO
+ * @createTime 2022年05月06日 10:38:00
+ */
+@Service
+public class ReimbursementUserServiceImpl implements ReimbursementUserService {
+
+    @Resource
+    private ReimbursementUserMapper mapper;
+
+    @Resource
+    private ReimbursementBusinessMapper businessMapper;
+
+
+    @Override
+    public ReimbursementUserDTO queryById(String id) {
+        return mapper.queryById(id);
+    }
+
+    @Override
+    public ReimbursementUserDTO queryByUserIdAndYear(ReimbursementUserDTO reimbursementUser) {
+        return mapper.queryByUserIdAndYear(reimbursementUser);
+    }
+
+
+    @Override
+    public IPage<ReimbursementUserDTO> findList(Page<ReimbursementUserDTO> page, ReimbursementUserDTO reimbursementUser) {
+        return mapper.findList (page, reimbursementUser);
+    }
+
+    /**
+     * 保存
+     * @param reimbursementUser
+     */
+    @Override
+    public Map<String,Object> save(ReimbursementUserDTO reimbursementUser) {
+        Map<String,Object> map = new HashMap<>();
+
+        if(StringUtils.isBlank(reimbursementUser.getUserId())){
+            map.put("success", false);
+            map.put("message", "报销人员为空,无法进行添加报销信息!");
+            return map;
+        }
+        if(StringUtils.isBlank(reimbursementUser.getYear())){
+            map.put("success", false);
+            map.put("message", "报销年份不正确,请重新填写!");
+            return map;
+        }
+        if(StringUtils.isBlank(reimbursementUser.getReimbursementQuota())){
+            map.put("success", false);
+            map.put("message", "年报销额度填写不正确!");
+            return map;
+        }
+        if(StringUtils.isBlank(reimbursementUser.getReimbursementQuotaDay())){
+            map.put("success", false);
+            map.put("message", "日报销额度填写不正确!");
+            return map;
+        }
+        UserDTO user = UserUtils.get(reimbursementUser.getUserId());
+        if(StringUtils.isNotBlank(reimbursementUser.getId())){
+            reimbursementUser.preUpdate();
+            //新增
+            mapper.update(reimbursementUser);
+        }else{
+            //查询该用户该年度是否已经添加报销额度
+            ReimbursementUserDTO queryByUserIdAndYear = mapper.queryByUserIdAndYear(reimbursementUser);
+            if(null != queryByUserIdAndYear){
+                map.put("success", false);
+                map.put("message", user.getName() + " " + reimbursementUser.getYear() + "年度报销额度已添加,无法重复添加!");
+                return map;
+            }
+            reimbursementUser.preInsert();
+            //新增
+            mapper.save(reimbursementUser);
+        }
+
+        map.put("success", true);
+        map.put("message", user.getName() + " " + reimbursementUser.getYear() + "年度报销额度:" + reimbursementUser.getReimbursementQuota() +" 保存成功");
+        return map;
+    }
+
+
+    @Override
+    public void update(ReimbursementUserDTO reimbursementUser) {
+        mapper.update(reimbursementUser);
+    }
+
+    @Override
+    public void delete(List<String> idList) {
+        //删除发票信息
+        mapper.delete(idList);
+    }
+
+    @Override
+    public List<ReimbursementBusinessDTO> findListByUserId(ReimbursementUserDTO reimbursementUserDTO) {
+        ReimbursementBusinessDTO reimbursementBusiness = new ReimbursementBusinessDTO();
+        reimbursementBusiness.setUserId(reimbursementUserDTO.getUserId());
+        reimbursementBusiness.setYear(reimbursementUserDTO.getYear());
+        return businessMapper.findListByUserIdAndYear(reimbursementBusiness);
+    }
+
+}

+ 29 - 0
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/core/domain/BaseEntity.java

@@ -4,7 +4,11 @@ import com.baomidou.mybatisplus.annotation.FieldFill;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.sys.utils.IdGen;
+import com.jeeplus.sys.utils.UserUtils;
 import lombok.Data;
+import org.apache.commons.lang3.StringUtils;
 
 import java.io.Serializable;
 import java.util.Date;
@@ -81,4 +85,29 @@ public abstract class BaseEntity implements Serializable {
     public static final String DEL_FLAG_AUDIT = "2";
 
 
+    /**
+     * 插入之前执行方法,需要手动调用
+     */
+    public void preInsert(){
+        setId(IdGen.uuid());
+        UserDTO user = UserUtils.getCurrentUserDTO();
+        if (StringUtils.isNotBlank(user.getId())){
+            this.setCreateBy(user.getId());
+            this.setUpdateBy(user.getId());
+        }
+        this.setCreateDate(new Date());
+        this.setUpdateDate(new Date());
+        this.setDelFlag(0);
+    }
+
+    /**
+     * 更新之前执行方法,需要手动调用
+     */
+    public void preUpdate(){
+        UserDTO user = UserUtils.getCurrentUserDTO();
+        if (StringUtils.isNotBlank(user.getId())){
+            this.setUpdateBy(user.getId());
+        }
+        this.setUpdateDate(new Date());
+    }
 }

+ 0 - 33
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/core/domain/TreeEntity.java

@@ -4,14 +4,9 @@
 package com.jeeplus.core.domain;
 
 import com.baomidou.mybatisplus.annotation.TableField;
-import com.jeeplus.sys.service.dto.UserDTO;
-import com.jeeplus.sys.utils.IdGen;
-import com.jeeplus.sys.utils.UserUtils;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
-import org.apache.commons.lang3.StringUtils;
 
-import java.util.Date;
 import java.util.List;
 
 /**
@@ -68,32 +63,4 @@ public abstract class TreeEntity<T> extends BaseEntity {
 	}
 
 
-
-
-	/**
-	 * 插入之前执行方法,需要手动调用
-	 */
-	public void preInsert(){
-		setId(IdGen.uuid());
-		UserDTO user = UserUtils.getCurrentUserDTO();
-		if (StringUtils.isNotBlank(user.getId())){
-			this.setCreateBy(user.getId());
-			this.setUpdateBy(user.getId());
-		}
-		this.setCreateDate(new Date());
-		this.setUpdateDate(new Date());
-		this.setDelFlag(0);
-	}
-
-	/**
-	 * 更新之前执行方法,需要手动调用
-	 */
-	public void preUpdate(){
-		UserDTO user = UserUtils.getCurrentUserDTO();
-		if (StringUtils.isNotBlank(user.getId())){
-			this.setUpdateBy(user.getId());
-		}
-		this.setUpdateDate(new Date());
-	}
-
 }

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

@@ -19,9 +19,13 @@ import com.jeeplus.core.excel.ExportMode;
 import com.jeeplus.core.excel.utils.EasyPoiUtil;
 import com.jeeplus.core.query.QueryWrapperGenerator;
 import com.jeeplus.security.util.SecurityUtils;
+import com.jeeplus.sys.constant.CommonConstants;
 import com.jeeplus.sys.domain.User;
+import com.jeeplus.sys.service.OfficeService;
 import com.jeeplus.sys.service.UserService;
+import com.jeeplus.sys.service.dto.OfficeDTO;
 import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.sys.service.mapstruct.OfficeWrapper;
 import com.jeeplus.sys.service.mapstruct.UserWrapper;
 import com.jeeplus.sys.utils.*;
 import io.swagger.annotations.Api;
@@ -56,6 +60,11 @@ public class UserController {
     private UserService userService;
     @Autowired
     private FileProperties fileProperties;
+    @Autowired
+    private OfficeService officeService;
+
+    @Autowired
+    private OfficeWrapper officeWrapper;
     /**
      * 验证Bean实例对象
      */
@@ -355,4 +364,29 @@ public class UserController {
     }
 
 
+
+    /**
+     * 获取机构JSON数据。
+     *
+     * @param extId 排除的ID
+     * @param type  类型(1:公司;2:部门)
+     * @param showAll 是否显示不可用数据 1 显示 0 隐藏
+     * @return
+     */
+    @ApiLog("获取部门用户数据")
+    @GetMapping("treeUserData")
+    public ResponseEntity treeUserData(@RequestParam(required = false) String extId, @RequestParam(required = false) String type, @RequestParam(required = false, defaultValue = CommonConstants.NO) String showAll) {
+        List<OfficeDTO> list = officeWrapper.toDTO (officeService.list ());
+        for (OfficeDTO info :
+                list) {
+            info.setTypeFlag(true);
+        }
+        //根据部门查询对应部门下的所有数据
+        List<OfficeDTO> officeDTOList = userService.disposeUserOffice(list,type);
+        list.addAll(officeDTOList);
+        List rootTree = officeService.getRootTree (list, extId, type, showAll);
+        return ResponseEntity.ok (rootTree);
+    }
+
+
 }

+ 11 - 3
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/mapper/UserMapper.java

@@ -9,10 +9,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Constants;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.jeeplus.sys.service.dto.UserDTO;
 import com.jeeplus.sys.domain.User;
-import org.apache.ibatis.annotations.Delete;
-import org.apache.ibatis.annotations.Insert;
+import com.jeeplus.sys.service.dto.OfficeDTO;
+import com.jeeplus.sys.service.dto.UserDTO;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -94,4 +93,13 @@ public interface UserMapper extends BaseMapper<User> {
      */
     void insertUserPost(String userId, String postId);
 
+
+    /**
+     * 按公司获取用户列表
+     *
+     * @param companyId
+     * @return
+     */
+    List <OfficeDTO> findListByCompanyId(@Param("companyId") String companyId,@Param("type") String type);
+
 }

+ 37 - 0
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/mapper/xml/UserMapper.xml

@@ -65,6 +65,31 @@
     	o.parent_ids AS "officeDTO.parentIds"
     </sql>
 
+	<sql id="userOfficeColumns">
+    	a.id,
+    	a.login_name AS "loginName",
+		a.is_admin AS "isAdmin",
+    	a.password,
+    	a.no,
+		a.name,
+		a.email,
+		a.phone,
+		a.mobile,
+		a.login_ip AS "loginIp",
+		a.login_date AS "loginDate",
+		a.remarks,
+		a.login_flag,
+		a.photo,
+		a.qr_code,
+		a.sign,
+		a.create_by AS "createBy.id",
+		a.create_date,
+		a.update_by AS "updateBy.id",
+		a.update_date,
+    	o.id AS "parent.id",
+    	o.parent_ids AS "parentIds"
+    </sql>
+
     <sql id="userJoins">
 		LEFT JOIN sys_office c ON c.id = a.company_id
 		LEFT JOIN sys_office o ON o.id = a.office_id
@@ -130,6 +155,18 @@
 		</where>
 	</select>
 
+	<!-- 查询岗位下的用户 -->
+	<select id="findListByCompanyId" resultType="com.jeeplus.sys.service.dto.OfficeDTO">
+		SELECT
+		<include refid="userOfficeColumns"/>
+		,#{type} as "type"
+		FROM sys_user a
+		<include refid="userJoins"/>
+		<where>
+			a.company_id = #{companyId} and a.del_flag = 0
+		</where>
+	</select>
+
 
 	<!--删除用户角色关联数据-->
 	<delete id="deleteUserRole">

+ 9 - 2
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/service/UserService.java

@@ -10,12 +10,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.jeeplus.common.redis.RedisUtils;
 import com.jeeplus.common.utils.RequestUtils;
-import com.jeeplus.core.errors.ErrorConstants;
-import com.jeeplus.security.jwt.TokenProvider;
 import com.jeeplus.sys.constant.CacheNames;
 import com.jeeplus.sys.domain.SysConfig;
 import com.jeeplus.sys.domain.User;
 import com.jeeplus.sys.mapper.UserMapper;
+import com.jeeplus.sys.service.dto.OfficeDTO;
 import com.jeeplus.sys.service.dto.UserDTO;
 import com.jeeplus.sys.service.mapstruct.UserWrapper;
 import com.jeeplus.sys.utils.UserUtils;
@@ -42,6 +41,9 @@ public class UserService  extends ServiceImpl<UserMapper, User> {
 	private UserWrapper userWrapper;
 
 	@Autowired
+	private UserMapper userMapper;
+
+	@Autowired
 	private RedisUtils redisUtils;
 
 	@Autowired
@@ -197,5 +199,10 @@ public class UserService  extends ServiceImpl<UserMapper, User> {
 		super.updateById (user);
 	}
 
+	//查询所有人员信息
+	public List<OfficeDTO> disposeUserOffice(List<OfficeDTO> officeDTOList,String type){
+		return userMapper.findListByCompanyId(UserUtils.getCurrentUserDTO().getCompanyDTO().getId(),type);
+	}
+
 
 }

+ 88 - 1
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/service/dto/OfficeDTO.java

@@ -4,13 +4,17 @@
 package com.jeeplus.sys.service.dto;
 
 import cn.afterturn.easypoi.excel.annotation.Excel;
-import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.jeeplus.core.query.Query;
 import com.jeeplus.core.service.dto.TreeDTO;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
+import org.hibernate.validator.constraints.Length;
 
 import javax.validation.constraints.NotNull;
 import javax.validation.constraints.Size;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -104,4 +108,87 @@ public class OfficeDTO extends TreeDTO <OfficeDTO> {
 	 */
 	private boolean disabled = false;
 
+
+	/**
+	 * 登录名
+	 */
+	@Length(min = 1, max = 100)
+	@Excel (name = "登录名")
+	@Query
+	private String loginName;
+
+	/**
+	 * 密码
+	 */
+	@JsonIgnore
+	@Length(min = 1, max = 100)
+	private String password;
+
+
+	/**
+	 * 工号
+	 */
+	@Length(min = 1, max = 100)
+	@Excel (name = "工号")
+	private String no;
+
+	/**
+	 * 手机
+	 */
+	@Length(min = 0, max = 100)
+	@Excel(name = "手机")
+	private String mobile;
+
+	/**
+	 * 最后登录IP
+	 */
+	@ApiModelProperty(hidden = true)
+	private String loginIp;
+
+	/**
+	 * 最后登录日期
+	 */
+	@ApiModelProperty(hidden = true)
+	private Date loginDate;
+
+	/**
+	 * 是否允许登录
+	 */
+	private String loginFlag;
+
+	/**
+	 * 头像
+	 */
+	private String photo;
+
+	/**
+	 * 二维码
+	 */
+	private String qrCode;
+
+	/**
+	 * 原登录名
+	 */
+	private String oldLoginName;
+
+	/**
+	 * 新密码
+	 */
+	private String newPassword;
+
+	/**
+	 * 签名
+	 */
+	private String sign;
+
+	/**
+	 * 超级管理员标志
+	 */
+	private boolean isAdmin;
+
+	/**
+	 * 是否可用
+	 */
+	private boolean typeFlag = false;
+
 }

+ 2 - 2
jeeplus-plugins/jeeplus-datasource/target/generated-sources/annotations/com/jeeplus/database/datalink/service/mapstruct/DataSourceWrapperImpl.java

@@ -11,8 +11,8 @@ import org.springframework.stereotype.Component;
 
 @Generated(
     value = "org.mapstruct.ap.MappingProcessor",
-    date = "2022-03-20T22:29:56+0800",
-    comments = "version: 1.4.1.Final, compiler: javac, environment: Java 1.8.0_221 (Oracle Corporation)"
+    date = "2022-05-12T14:22:12+0800",
+    comments = "version: 1.4.1.Final, compiler: javac, environment: Java 1.8.0_181 (Oracle Corporation)"
 )
 @Component
 public class DataSourceWrapperImpl implements DataSourceWrapper {

+ 2 - 2
jeeplus-plugins/jeeplus-datasource/target/generated-sources/annotations/com/jeeplus/database/datamodel/service/mapstruct/DataMetaWrapperImpl.java

@@ -13,8 +13,8 @@ import org.springframework.stereotype.Component;
 
 @Generated(
     value = "org.mapstruct.ap.MappingProcessor",
-    date = "2022-03-20T22:29:56+0800",
-    comments = "version: 1.4.1.Final, compiler: javac, environment: Java 1.8.0_221 (Oracle Corporation)"
+    date = "2022-05-12T14:22:12+0800",
+    comments = "version: 1.4.1.Final, compiler: javac, environment: Java 1.8.0_181 (Oracle Corporation)"
 )
 @Component
 public class DataMetaWrapperImpl implements DataMetaWrapper {

+ 2 - 2
jeeplus-plugins/jeeplus-datasource/target/generated-sources/annotations/com/jeeplus/database/datamodel/service/mapstruct/DataParamWrapperImpl.java

@@ -13,8 +13,8 @@ import org.springframework.stereotype.Component;
 
 @Generated(
     value = "org.mapstruct.ap.MappingProcessor",
-    date = "2022-03-20T22:29:56+0800",
-    comments = "version: 1.4.1.Final, compiler: javac, environment: Java 1.8.0_221 (Oracle Corporation)"
+    date = "2022-05-12T14:22:12+0800",
+    comments = "version: 1.4.1.Final, compiler: javac, environment: Java 1.8.0_181 (Oracle Corporation)"
 )
 @Component
 public class DataParamWrapperImpl implements DataParamWrapper {

+ 2 - 2
jeeplus-plugins/jeeplus-datasource/target/generated-sources/annotations/com/jeeplus/database/datamodel/service/mapstruct/DataSetWrapperImpl.java

@@ -13,8 +13,8 @@ import org.springframework.stereotype.Component;
 
 @Generated(
     value = "org.mapstruct.ap.MappingProcessor",
-    date = "2022-03-20T22:29:55+0800",
-    comments = "version: 1.4.1.Final, compiler: javac, environment: Java 1.8.0_221 (Oracle Corporation)"
+    date = "2022-05-12T14:22:12+0800",
+    comments = "version: 1.4.1.Final, compiler: javac, environment: Java 1.8.0_181 (Oracle Corporation)"
 )
 @Component
 public class DataSetWrapperImpl implements DataSetWrapper {

+ 2 - 2
jeeplus-plugins/jeeplus-notify/target/generated-sources/annotations/com/jeeplus/notify/service/mapstruct/NotifyRecordWrapperImpl.java

@@ -13,8 +13,8 @@ import org.springframework.stereotype.Component;
 
 @Generated(
     value = "org.mapstruct.ap.MappingProcessor",
-    date = "2022-03-20T22:29:54+0800",
-    comments = "version: 1.4.1.Final, compiler: javac, environment: Java 1.8.0_221 (Oracle Corporation)"
+    date = "2022-05-12T14:22:08+0800",
+    comments = "version: 1.4.1.Final, compiler: javac, environment: Java 1.8.0_181 (Oracle Corporation)"
 )
 @Component
 public class NotifyRecordWrapperImpl implements NotifyRecordWrapper {

+ 2 - 2
jeeplus-plugins/jeeplus-notify/target/generated-sources/annotations/com/jeeplus/notify/service/mapstruct/NotifyWrapperImpl.java

@@ -12,8 +12,8 @@ import org.springframework.stereotype.Component;
 
 @Generated(
     value = "org.mapstruct.ap.MappingProcessor",
-    date = "2022-03-20T22:29:54+0800",
-    comments = "version: 1.4.1.Final, compiler: javac, environment: Java 1.8.0_221 (Oracle Corporation)"
+    date = "2022-05-12T14:22:08+0800",
+    comments = "version: 1.4.1.Final, compiler: javac, environment: Java 1.8.0_181 (Oracle Corporation)"
 )
 @Component
 public class NotifyWrapperImpl implements NotifyWrapper {