浏览代码

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	jeeplus-modules/jeeplus-flowable/src/main/java/com/jeeplus/flowable/controller/FlowableTaskController.java
lizhenhao 1 年之前
父节点
当前提交
4f7a98b9b8
共有 100 个文件被更改,包括 9645 次插入23 次删除
  1. 11 0
      jeeplus-api/jeeplus-system-api/pom.xml
  2. 19 0
      jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/factory/FlowableApiFallbackFactory.java
  3. 29 2
      jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/feign/IFlowableApi.java
  4. 5 10
      jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/sys/domain/Office.java
  5. 84 0
      jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/sys/service/dto/CertDTO.java
  6. 5 10
      jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/sys/service/dto/OfficeDTO.java
  7. 19 0
      jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/sys/service/dto/UserDTO.java
  8. 4 1
      jeeplus-common/jeeplus-common-log/src/main/java/com/jeeplus/logging/constant/enums/LogTypeEnum.java
  9. 143 0
      jeeplus-modules/jeeplus-finance/pom.xml
  10. 28 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/JeeplusFinanceApplication.java
  11. 82 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/common/CommonApi.java
  12. 200 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/common/CommonUtils.java
  13. 46 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/common/enterpriseSearch/EnterpriseJsonRespDTO.java
  14. 87 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/common/enterpriseSearch/EnterpriseSearchApi.java
  15. 53 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/common/enterpriseSearch/EnterpriseSearchDTO.java
  16. 279 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/common/enterpriseSearch/TicketQueryUtils.java
  17. 42 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/common/flowable/dto/CommitParamDTO.java
  18. 60 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/controller/ContractFileController.java
  19. 51 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/controller/ContractFilePaperController.java
  20. 181 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/controller/ContractInfoController.java
  21. 95 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/controller/CwContractBorrowController.java
  22. 81 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/domain/ContractFile.java
  23. 82 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/domain/ContractFilePaper.java
  24. 248 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/domain/ContractInfo.java
  25. 22 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/domain/ContractParticipant.java
  26. 40 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/domain/CwWorkContractBorrow.java
  27. 42 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/domain/CwWorkContractBorrowMessage.java
  28. 43 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/mapper/ContractFileMapper.java
  29. 34 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/mapper/ContractFilePaperMapper.java
  30. 82 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/mapper/ContractInfoMapper.java
  31. 22 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/mapper/ContractParticipantMapper.java
  32. 36 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/mapper/CwWorkContractBorrowMapper.java
  33. 11 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/mapper/CwWorkContractBorrowMessageMapper.java
  34. 122 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/mapper/xml/ContractFileMapper.xml
  35. 32 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/mapper/xml/ContractFilePaperMapper.xml
  36. 269 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/mapper/xml/ContractInfoMapper.xml
  37. 11 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/mapper/xml/ContractParticipantMapper.xml
  38. 77 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/mapper/xml/CwWorkContractBorrowMapper.xml
  39. 210 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/service/ContractFilePaperService.java
  40. 232 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/service/ContractFileService.java
  41. 738 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/service/ContractInfoService.java
  42. 303 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/service/CwWorkContractBorrowService.java
  43. 45 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/service/dto/CwWorkContractBorrowDto.java
  44. 385 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/controller/CwFinanceInvoiceController.java
  45. 189 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/domain/CwFinanceInvoice.java
  46. 52 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/domain/CwFinanceInvoiceBase.java
  47. 66 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/domain/CwFinanceInvoiceDetail.java
  48. 46 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/domain/CwFinanceInvoiceInvalid.java
  49. 51 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/domain/CwFinanceInvoiceReceivables.java
  50. 95 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/domain/SealUserInfo.java
  51. 14 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/CwFinanceInvoiceBaseMapper.java
  52. 14 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/CwFinanceInvoiceDetailMapper.java
  53. 14 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/CwFinanceInvoiceInvalidMapper.java
  54. 39 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/CwFinanceInvoiceMapper.java
  55. 14 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/CwFinanceInvoiceReceivablesMapper.java
  56. 36 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/xml/CwFinanceInvoiceBaseMapper.xml
  57. 42 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/xml/CwFinanceInvoiceDetailMapper.xml
  58. 34 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/xml/CwFinanceInvoiceInvalidMapper.xml
  59. 305 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/xml/CwFinanceInvoiceMapper.xml
  60. 36 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/xml/CwFinanceInvoiceReceivablesMapper.xml
  61. 593 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/CwFinanceInvoiceService.java
  62. 9 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/dto/CwFinanceDTO.java
  63. 47 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/dto/CwFinanceInvoiceBaseDTO.java
  64. 318 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/dto/CwFinanceInvoiceDTO.java
  65. 73 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/dto/CwFinanceInvoiceDetailDTO.java
  66. 42 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/dto/CwFinanceInvoiceInvalidDTO.java
  67. 53 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/dto/CwFinanceInvoiceReceivablesDTO.java
  68. 15 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/mapstruct/CwFinanceInvoiceBaseWrapper.java
  69. 15 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/mapstruct/CwFinanceInvoiceDetailWrapper.java
  70. 15 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/mapstruct/CwFinanceInvoiceInvalidWrapper.java
  71. 15 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/mapstruct/CwFinanceInvoiceReceivablesWrapper.java
  72. 15 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/mapstruct/CwFinanceInvoiceWrapper.java
  73. 323 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/util/EasyPoiUtil.java
  74. 66 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/util/ExcelDiceAddressListHandlerImpl.java
  75. 104 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/util/FlowTaskUtil.java
  76. 25 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/util/FreemarkerUtil.java
  77. 61 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/util/ResponseUtil.java
  78. 815 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/util/SignaturePostUtil.java
  79. 131 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectBusinessType/controller/CwProjectBusinessTypeController.java
  80. 46 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectBusinessType/domain/CwProjectBusinessType.java
  81. 28 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectBusinessType/mapper/CwProjectBusinessTypeMapper.java
  82. 79 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectBusinessType/mapper/xml/CwManageLevelTypeMapper.xml
  83. 80 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectBusinessType/service/CwProjectBusinessTypeService.java
  84. 51 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectBusinessType/service/dto/CwProjectBusinessTypeDTO.java
  85. 15 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectBusinessType/service/mapstruct/CwProjectBusinessTypeWrapper.java
  86. 96 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/controller/CwManHourManagementController.java
  87. 212 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/controller/CwProjectRecordsController.java
  88. 26 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/domain/CwManHourManagement.java
  89. 81 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/domain/CwProjectClientContact.java
  90. 30 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/domain/CwProjectClientInfo.java
  91. 43 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/domain/CwProjectMembers.java
  92. 116 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/domain/CwProjectRecords.java
  93. 48 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/mapper/CwManHourManagementMapper.java
  94. 17 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/mapper/CwProjectClientContactMapper.java
  95. 17 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/mapper/CwProjectClientInfoMapper.java
  96. 15 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/mapper/CwProjectMembersMapper.java
  97. 69 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/mapper/CwProjectRecordsMapper.java
  98. 58 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/mapper/xml/CwManHourManagementMapper.xml
  99. 46 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/mapper/xml/CwProjectClientContactMapper.xml
  100. 0 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/mapper/xml/CwProjectClientInfoMapper.xml

+ 11 - 0
jeeplus-api/jeeplus-system-api/pom.xml

@@ -17,5 +17,16 @@
             <artifactId>jeeplus-common-core</artifactId>
             <version>${project.parent.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.flowable</groupId>
+            <artifactId>flowable-json-converter</artifactId>
+            <version>6.7.2</version>
+        </dependency>
+<!--        <dependency>-->
+<!--            <groupId>org.flowable</groupId>-->
+<!--            <artifactId>flowable-spring-boot-starter-process-rest</artifactId>-->
+<!--            <version>6.7.2</version>-->
+<!--            <scope>provided</scope>-->
+<!--        </dependency>-->
     </dependencies>
 </project>

+ 19 - 0
jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/factory/FlowableApiFallbackFactory.java

@@ -4,10 +4,13 @@ import com.jeeplus.flowable.feign.IFlowableApi;
 import com.jeeplus.mail.feign.IMailApi;
 import com.jeeplus.sys.service.dto.UserDTO;
 import lombok.extern.slf4j.Slf4j;
+import org.flowable.bpmn.model.FlowNode;
+//import org.flowable.task.api.Task;
 import org.springframework.cloud.openfeign.FallbackFactory;
 import org.springframework.stereotype.Component;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 流程服务降级处理
@@ -20,6 +23,22 @@ public class FlowableApiFallbackFactory implements FallbackFactory <IFlowableApi
     public IFlowableApi create(Throwable throwable) {
         log.error ( "流程服务调用失败:{}", throwable.getMessage ( ) );
         return new IFlowableApi() {
+
+//            @Override
+//            public List<Task> getRecords() {
+//                return null;
+//            }
+
+            @Override
+            public FlowNode getCurrentTask(String processInstanceId) {
+                return null;
+            }
+
+            @Override
+            public String getTaskIdByprocInstId(String procInsId) {
+                return null;
+            }
+
             @Override
             public List<String> getTaskAuditUsers(String taskId) {
                 return null;

+ 29 - 2
jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/flowable/feign/IFlowableApi.java

@@ -2,17 +2,44 @@ package com.jeeplus.flowable.feign;
 
 import com.jeeplus.common.constant.AppNameConstants;
 import com.jeeplus.flowable.factory.FlowableApiFallbackFactory;
-import com.jeeplus.sys.factory.DictApiFallbackFactory;
-import com.jeeplus.sys.service.dto.UserDTO;
+import org.flowable.bpmn.model.FlowNode;
+//import org.flowable.task.api.Task;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestParam;
+//import org.flowable.task.api.Task;
 
 import java.util.List;
+import java.util.Map;
 
 
 @FeignClient(contextId = "flowableApi", name = AppNameConstants.APP_FLOWABLE_SERVICE, fallbackFactory = FlowableApiFallbackFactory.class)
 public interface IFlowableApi {
+
+    /**
+     * 已经签收或者等待签收的任务
+     *
+     */
+//    @GetMapping("/flowable/task/getRecords")
+//    List <Task> getRecords();
+
+    /**
+     * 根据processInstanceId获取taskId
+     * @param processInstanceId
+     * @return
+     */
+    @GetMapping(value = "/flowable/task/getCurrentTask")
+    FlowNode getCurrentTask(@RequestParam(value = "processInstanceId") String processInstanceId);
+
+    /**
+     * 根据procInsId获取taskId
+     * @param procInsId
+     * @return
+     */
+    @GetMapping(value = "/flowable/task/getTaskIdByprocInstId")
+    String getTaskIdByprocInstId(@RequestParam(value = "procInsId") String procInsId);
+
     /**
      * 获取当前节点审核人
      * @param taskId

+ 5 - 10
jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/sys/domain/Office.java

@@ -22,6 +22,11 @@ public class Office extends TreeEntity <Office> {
     private static final long serialVersionUID = 1L;
 
     /**
+     * 0为私有,1为公有
+     */
+    private String isPublic;
+
+    /**
      * 归属区域
      */
     private String area;
@@ -82,16 +87,6 @@ public class Office extends TreeEntity <Office> {
     private String remarks;
 
     /**
-     * 0为私有,1为公有
-     */
-    private String isPublic;
-
-    /**
-     * 分管领导
-     */
-    private String administrator;
-
-    /**
      * 构造函数
      */
     public Office() {

+ 84 - 0
jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/sys/service/dto/CertDTO.java

@@ -0,0 +1,84 @@
+package com.jeeplus.sys.service.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jeeplus.core.service.dto.BaseDTO;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * 组织机构-人员资质-人员职业资格证
+ * @TableName sys_cert
+ */
+@Data
+public class CertDTO extends BaseDTO {
+
+    /**
+     * 备注信息
+     */
+    private String remarks;
+
+    /**
+     * 人员id
+     */
+    private String userId;
+
+    /**
+     * 证书类型
+     */
+    private String type;
+
+    /**
+     * 证书编号
+     */
+    private String no;
+
+    /**
+     * 发证机关
+     */
+    private String authorities;
+
+    /**
+     * 发证日期
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date issuedDate;
+
+    /**
+     * 注册日期
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date enrollDate;
+
+    /**
+     * 到期日期
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date expireDate;
+
+    /**
+     * 注册证书编号
+     */
+    private String enrollCertNo;
+
+    /**
+     * 专业
+     */
+    private String profession;
+
+    /**
+     * 文件地址
+     */
+    private String fileUrl;
+
+    /**
+     * 文件临时地址
+     */
+    private String fileLsUrl;
+
+    private static final long serialVersionUID = 1L;
+}

+ 5 - 10
jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/sys/service/dto/OfficeDTO.java

@@ -23,6 +23,11 @@ public class OfficeDTO extends TreeDTO <OfficeDTO> {
     private static final long serialVersionUID = 1L;
 
     /**
+     * 是否公用
+     */
+    private String isPublic;
+
+    /**
      * 归属区域
      */
     private String area;
@@ -91,16 +96,6 @@ public class OfficeDTO extends TreeDTO <OfficeDTO> {
     private String remarks;
 
     /**
-     * 0为私有,1为公有
-     */
-    private String isPublic;
-
-    /**
-     * 分管领导
-     */
-    private String administrator;
-
-    /**
      * 子部门
      */
     private List <String> childDeptList;

+ 19 - 0
jeeplus-api/jeeplus-system-api/src/main/java/com/jeeplus/sys/service/dto/UserDTO.java

@@ -41,6 +41,25 @@ public class UserDTO extends BaseDTO {
 
     private static final long serialVersionUID = 1L;
 
+    /**
+     * 角色信息
+     */
+    private List<RoleDTO> roleList;
+
+    private String manageOfficeIds;   //管理的部门id
+
+    /**
+     * 管理的部门名称
+     */
+    private List<String> manageOfficeNameList;
+
+    /**
+     * 执业资格证列表
+     */
+    private List<CertDTO> certDTOList;
+
+    private OfficeDTO corporationDTO;   //公司信息
+
 
     /**
      * 登录名

+ 4 - 1
jeeplus-common/jeeplus-common-log/src/main/java/com/jeeplus/logging/constant/enums/LogTypeEnum.java

@@ -6,7 +6,10 @@ package com.jeeplus.logging.constant.enums;
 public enum LogTypeEnum {
     LOGIN ( "1", "登录日志" ),
     ACCESS ( "2", "访问日志" ),
-    EXCEPTION ( "3", "异常日志" );
+    EXCEPTION ( "3", "异常日志" ),
+    SAVE ("4", "修改或新增数据日志"),
+    EXPORT ("5", "导出日志"),
+    IMPORT ("6", "导入日志");
 
     /**
      * 类型值

+ 143 - 0
jeeplus-modules/jeeplus-finance/pom.xml

@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>jeeplus-modules</artifactId>
+        <groupId>org.jeeplus</groupId>
+        <version>9.0</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>jeeplus-finance</artifactId>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-freemarker</artifactId>
+        </dependency>
+        <!-- poi office -->
+        <dependency>
+            <groupId>cn.afterturn</groupId>
+            <artifactId>easypoi-spring-boot-starter</artifactId>
+            <version>4.3.0</version>
+        </dependency>
+
+<!--        <dependency>-->
+<!--            <groupId>org.jeeplus</groupId>-->
+<!--            <artifactId>jeeplus-flowable</artifactId>-->
+<!--            <version>${project.parent.version}</version>-->
+<!--        </dependency>-->
+
+        <dependency>
+            <groupId>org.jeeplus</groupId>
+            <artifactId>jeeplus-public-modules</artifactId>
+            <version>${project.parent.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.jeeplus</groupId>
+            <artifactId>jeeplus-common-mybatis-plus</artifactId>
+            <version>${project.parent.version}</version>
+        </dependency>
+
+
+        <!-- SpringCloud Alibaba Nacos -->
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
+        </dependency>
+
+        <!-- SpringCloud Alibaba Nacos Config -->
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
+        </dependency>
+
+        <!-- SpringCloud Alibaba Sentinel -->
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
+        </dependency>
+
+        <!--添加actuator依赖-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>
+        <!--spring boot admin依赖-->
+        <dependency>
+            <groupId>de.codecentric</groupId>
+            <artifactId>spring-boot-admin-starter-client</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-websocket</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-mail</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jeeplus</groupId>
+            <artifactId>jeeplus-common-core</artifactId>
+            <version>${project.parent.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.jeeplus</groupId>
+            <artifactId>jeeplus-common-security</artifactId>
+            <version>${project.parent.version}</version>
+        </dependency>
+<!--        <dependency>-->
+<!--            <groupId>org.jeeplus</groupId>-->
+<!--            <artifactId>jeeplus-system</artifactId>-->
+<!--            <version>${project.parent.version}</version>-->
+<!--        </dependency>-->
+<!--        <dependency>-->
+<!--            <groupId>org.jeeplus</groupId>-->
+<!--            <artifactId>jeeplus-system-api</artifactId>-->
+<!--            <version>${project.parent.version}</version>-->
+<!--        </dependency>-->
+        <dependency>
+            <groupId>org.jeeplus</groupId>
+            <artifactId>jeeplus-common-log</artifactId>
+            <version>${project.parent.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.jeeplus</groupId>
+            <artifactId>jeeplus-common-swagger</artifactId>
+            <version>${project.parent.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <finalName>${project.artifactId}</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <version>2.1.2.RELEASE</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+
+                </configuration>
+            </plugin>
+
+        </plugins>
+    </build>
+</project>

+ 28 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/JeeplusFinanceApplication.java

@@ -0,0 +1,28 @@
+package com.jeeplus.finance;
+
+import com.jeeplus.core.annotation.JeeplusCloudApplication;
+import org.springframework.boot.SpringApplication;
+
+/**
+ * 测试模块
+ *
+ * @author jeeplus
+ */
+
+
+@JeeplusCloudApplication
+public class JeeplusFinanceApplication {
+    public static void main(String[] args) {
+        SpringApplication.run ( JeeplusFinanceApplication.class, args );
+        System.out.println ( " O(∩_∩)O~ 财务模块启动成功 ^_^゙  \n" + "    _                         _                   _                  _   \n" +
+                "   (_)                       | |                 | |                | |  \n" +
+                "    _    ___    ___   _ __   | |  _   _   ___    | |_    ___   ___  | |_ \n" +
+                "   | |  / _ \\  / _ \\ | '_ \\  | | | | | | / __|   | __|  / _ \\ / __| | __|\n" +
+                "   | | |  __/ |  __/ | |_) | | | | |_| | \\__ \\   | |_  |  __/ \\__ \\ | |_ \n" +
+                "   | |  \\___|  \\___| | .__/  |_|  \\__,_| |___/    \\__|  \\___| |___/  \\__|\n" +
+                "  _/ |               | |                                                 \n" +
+                " |__/                |_|                                                 " );
+    }
+
+
+}

+ 82 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/common/CommonApi.java

@@ -0,0 +1,82 @@
+//package com.jeeplus.finance.common;
+//
+//import cn.hutool.core.util.ObjectUtil;
+//import cn.hutool.extra.spring.SpringUtil;
+//import io.swagger.annotations.Api;
+//import org.apache.commons.lang3.StringUtils;
+//import org.flowable.bpmn.model.BpmnModel;
+//import org.flowable.bpmn.model.FlowNode;
+//import org.flowable.engine.RepositoryService;
+//import org.flowable.engine.RuntimeService;
+//import org.flowable.engine.TaskService;
+//import org.flowable.task.api.Task;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.http.ResponseEntity;
+//import org.springframework.web.bind.annotation.GetMapping;
+//import org.springframework.web.bind.annotation.RequestMapping;
+//import org.springframework.web.bind.annotation.RequestParam;
+//import org.springframework.web.bind.annotation.RestController;
+//
+//import java.util.Objects;
+//
+//@RestController
+//@RequestMapping(value = "/commonApi")
+//public class CommonApi {
+//
+//    @Autowired
+//    private TaskService taskService;
+//    @Autowired
+//    private RuntimeService runtimeService;
+//
+//    /**
+//     * 根据procInsId获取当前流程节点名称
+//     * @param procInsId
+//     * @return
+//     */
+//    @GetMapping("/getTaskNameByProcInsId")
+//    public ResponseEntity<String> getTaskNameByProcInsId(@RequestParam("procInsId") String procInsId) {
+//        String res = getTaskName(procInsId);
+//        return ResponseEntity.ok(res);
+//    }
+//
+//    /**
+//     * 判断当前审核节点是否为最后一个节点
+//     * @param procInsId
+//     * @return
+//     */
+//    @GetMapping("/isLastTask")
+//    @Deprecated
+//    public ResponseEntity<Boolean> isLastTask(@RequestParam("procInsId") String procInsId) {
+//        Task task = taskService.createTaskQuery().processInstanceId(procInsId).active().singleResult();
+//        // task为null则审核节点为最后一个审核节点
+//        if (ObjectUtil.isEmpty(task)) {
+//            return ResponseEntity.ok(true);
+//        }
+//        return ResponseEntity.ok(false);
+//    }
+//
+//    /**
+//     * 根据procInsId获取当前流程节点名称
+//     * @param procInsId
+//     * @return
+//     */
+//    public String getTaskName(String procInsId) {
+//        if (StringUtils.isNotBlank(procInsId)) {
+//            Task task = taskService.createTaskQuery().processInstanceId(procInsId).active().singleResult();
+//            if (task!=null) {
+//                //获取流程发布Id信息
+//                String definitionId = runtimeService.createProcessInstanceQuery().processInstanceId(procInsId).singleResult().getProcessDefinitionId();
+//                //获取bpm对象
+//                BpmnModel bpmnModel = SpringUtil.getBean (RepositoryService.class).getBpmnModel(definitionId);
+//                //传节点定义key 获取当前节点
+//                FlowNode flowNode = (FlowNode) bpmnModel.getFlowElement(task.getTaskDefinitionKey());
+//                if (ObjectUtil.isNotEmpty(flowNode)) {
+//                    if (StringUtils.isNotBlank(flowNode.getName())) {
+//                        return flowNode.getName();
+//                    }
+//                }
+//            }
+//        }
+//        return "";
+//    }
+//}

+ 200 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/common/CommonUtils.java

@@ -0,0 +1,200 @@
+package com.jeeplus.finance.common;
+
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.extra.spring.SpringUtil;
+import com.jeeplus.sys.service.DictTypeService;
+import com.jeeplus.sys.service.OfficeService;
+import com.jeeplus.sys.service.dto.OfficeDTO;
+import com.jeeplus.sys.service.dto.RoleDTO;
+import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.sys.utils.UserUtils;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class CommonUtils {
+
+    /**
+     * 判断当前用户是否拥有 “ 财务部门主任 ” 的角色
+     * @return
+     */
+    public static boolean haveRoleCwBmzr() {
+        UserDTO userDTO = UserUtils.getCurrentUserDTO();
+        List<RoleDTO> roles = new ArrayList<>(); // 当前用户拥有的角色
+        if (CollectionUtil.isNotEmpty(userDTO.getRoleDTOList())) {
+            roles = userDTO.getRoleDTOList().stream().filter(item -> {
+                // 过滤当前用户是否拥有财务部门主任角色
+                if ("cw_bmzr".equals(item.getEnName())) {
+                    return true;
+                }
+                return false;
+            }).collect(Collectors.toList());
+        }
+        if (CollectionUtil.isNotEmpty(roles)) {
+            return true;
+        }
+        return false;
+    }
+    /**
+     * 判断当前用户是否拥有 “ 财务员工 ” 的角色
+     * @return
+     */
+    public static boolean haveRoleCwYg() {
+        UserDTO userDTO = UserUtils.getCurrentUserDTO();
+        List<RoleDTO> roles = new ArrayList<>(); // 当前用户拥有的角色
+        if (CollectionUtil.isNotEmpty(userDTO.getRoleDTOList())) {
+            roles = userDTO.getRoleDTOList().stream().filter(item -> {
+                // 过滤当前用户是否拥有财务员工角色
+                if ("cwyg".equals(item.getEnName())) {
+                    return true;
+                }
+                return false;
+            }).collect(Collectors.toList());
+        }
+        if (CollectionUtil.isNotEmpty(roles)) {
+            return true;
+        }
+        return false;
+    }
+    /**
+     * 判断当前用户是否拥有 “ 专家组成员 ” 的角色
+     * @return
+     */
+    public static boolean haveRoleZjzcy() {
+        UserDTO userDTO = UserUtils.getCurrentUserDTO();
+        List<RoleDTO> roles = new ArrayList<>(); // 当前用户拥有的角色
+        if (CollectionUtil.isNotEmpty(userDTO.getRoleDTOList())) {
+            roles = userDTO.getRoleDTOList().stream().filter(item -> {
+                // 过滤当前用户是否拥有专家组成员角色
+                if ("zjzcy".equals(item.getEnName())) {
+                    return true;
+                }
+                return false;
+            }).collect(Collectors.toList());
+        }
+        if (CollectionUtil.isNotEmpty(roles)) {
+            return true;
+        }
+        return false;
+    }
+    /**
+     * 判断当前用户是否拥有 “ 项目员工 ” 的角色
+     * @return
+     */
+    public static boolean haveRoleXmYg() {
+        UserDTO userDTO = UserUtils.getCurrentUserDTO();
+        List<RoleDTO> roles = new ArrayList<>(); // 当前用户拥有的角色
+        if (CollectionUtil.isNotEmpty(userDTO.getRoleDTOList())) {
+            roles = userDTO.getRoleDTOList().stream().filter(item -> {
+                // 过滤当前用户是否拥有项目员工角色
+                if ("xmyg".equals(item.getEnName())) {
+                    return true;
+                }
+                return false;
+            }).collect(Collectors.toList());
+        }
+        if (CollectionUtil.isNotEmpty(roles)) {
+            return true;
+        }
+        return false;
+    }
+    /**
+     * 判断当前用户是否拥有 “ 会计所长 ” 的角色
+     * @return
+     */
+    public static boolean haveRoleKjsz() {
+        UserDTO userDTO = UserUtils.getCurrentUserDTO();
+        List<RoleDTO> roles = new ArrayList<>(); // 当前用户拥有的角色
+        if (CollectionUtil.isNotEmpty(userDTO.getRoleDTOList())) {
+            roles = userDTO.getRoleDTOList().stream().filter(item -> {
+                // 过滤当前用户是否拥有会计所长角色
+                if ("kjsz".equals(item.getEnName())) {
+                    return true;
+                }
+                return false;
+            }).collect(Collectors.toList());
+        }
+        if (CollectionUtil.isNotEmpty(roles)) {
+            return true;
+        }
+        return false;
+    }
+    /**
+     * 判断当前用户是否拥有 “ 质控部主任 ” 的角色
+     * @return
+     */
+    public static boolean haveRoleZkbzr() {
+        UserDTO userDTO = UserUtils.getCurrentUserDTO();
+        List<RoleDTO> roles = new ArrayList<>(); // 当前用户拥有的角色
+        if (CollectionUtil.isNotEmpty(userDTO.getRoleDTOList())) {
+            roles = userDTO.getRoleDTOList().stream().filter(item -> {
+                // 过滤当前用户是否拥有质控部主任角色
+                if ("zkbzr".equals(item.getEnName())) {
+                    return true;
+                }
+                return false;
+            }).collect(Collectors.toList());
+        }
+        if (CollectionUtil.isNotEmpty(roles)) {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * 判断当前用户是否拥有 “ 质控部员工 ” 的角色
+     * @return
+     */
+    public static boolean haveRoleZkbyg() {
+        UserDTO userDTO = UserUtils.getCurrentUserDTO();
+        List<RoleDTO> roles = new ArrayList<>(); // 当前用户拥有的角色
+        if (CollectionUtil.isNotEmpty(userDTO.getRoleDTOList())) {
+            roles = userDTO.getRoleDTOList().stream().filter(item -> {
+                // 过滤当前用户是否拥有质控部员工角色
+                if ("zkbyg".equals(item.getEnName())) {
+                    return true;
+                }
+                return false;
+            }).collect(Collectors.toList());
+        }
+        if (CollectionUtil.isNotEmpty(roles)) {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * 计算时间差
+     * 注:参数小于或等于当前时间
+     */
+    public static String timeDef(Date time) {
+        Long def = new Date().getTime() - time.getTime();
+        // 计算天数
+        long day = def / (1000 * 60 * 60 * 24);
+        if (day != 0) {
+            return day + "天前";
+        }
+        // 计算小时
+        long house = def / (1000 * 60 * 60);
+        if (house != 0) {
+            return house + "小时前";
+        }
+        // 计算分钟
+        long min = def / (1000 * 60);
+        return min + "分钟前";
+    }
+
+    /**
+     * 获取所有公司中的第一个
+     * @return
+     */
+    public static String getFirstCompanyId() {
+        List<OfficeDTO> allCompany = SpringUtil.getBean(OfficeService.class).getAllCompany();
+        if (CollectionUtil.isNotEmpty(allCompany)) {
+            return allCompany.get(0).getId();
+        }
+        return "";
+    }
+}

+ 46 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/common/enterpriseSearch/EnterpriseJsonRespDTO.java

@@ -0,0 +1,46 @@
+package com.jeeplus.finance.common.enterpriseSearch;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+@Data
+public class EnterpriseJsonRespDTO {
+
+    private Integer error_code;
+
+    private Boolean success;
+
+    private String message;
+
+    private D data;
+
+    @Data
+    class D {
+        private BigDecimal searchtime;
+
+        private Integer total;
+
+        private String num;
+
+        private Integer viewtotal;
+
+        private List<Items> items;
+    }
+
+    @Data
+    class Items {
+        private String entname;
+
+        private String legalname;
+
+        private String esdate;
+
+        private Integer id;
+
+        private String companyid;
+    }
+
+
+}

+ 87 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/common/enterpriseSearch/EnterpriseSearchApi.java

@@ -0,0 +1,87 @@
+package com.jeeplus.finance.common.enterpriseSearch;
+
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.util.ObjectUtil;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.logging.annotation.ApiLog;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Api("企业信息查询API")
+@RestController
+@RequestMapping(value = "/enterprise_search_api")
+public class EnterpriseSearchApi {
+
+    /**
+     * 根据关键字查询相关企业
+     * @param keyword
+     * @return
+     */
+    @ApiOperation(value = "根据关键字查询相关企业")
+    @PostMapping("enterpriseSearchByName")
+    public String enterpriseSearchByName(@RequestParam String keyword){
+        if(StringUtils.isBlank(keyword)){
+            return null;
+        }
+        return  TicketQueryUtils.enterpriseSearchByName(keyword);
+    }
+
+    /**
+     * 根据id查询企业税号
+     * @param id
+     * @return
+     */
+    @ApiOperation(value = "根据id查询企业税号")
+    @PostMapping("enterpriseTicketInfo")
+    public Object enterpriseTicketInfo(String id){
+        if(StringUtils.isBlank(id)){
+            return null;
+        }
+        return TicketQueryUtils.enterpriseTicketInfoQueryById(id);
+    }
+
+    /**
+     * 分页查询相关企业
+     * @param enterpriseSearchDTO
+     * @param page
+     * @return
+     * @throws Exception
+     */
+    @ApiLog("分页查询相关企业")
+    @GetMapping("list")
+    public ResponseEntity<IPage<EnterpriseSearchDTO>> data(EnterpriseSearchDTO enterpriseSearchDTO, Page<EnterpriseSearchDTO> page) throws Exception {
+        IPage<EnterpriseSearchDTO> result = new Page<EnterpriseSearchDTO>();
+        List<EnterpriseSearchDTO> list = new ArrayList<>();
+        if (ObjectUtil.isNotEmpty(enterpriseSearchDTO)){
+            if (StringUtils.isNotBlank(enterpriseSearchDTO.getENTNAME())){
+                String s = TicketQueryUtils.enterpriseSearchPage(enterpriseSearchDTO.getENTNAME(),String.valueOf(page.getSize()),String.valueOf(page.getCurrent()));
+                if (StringUtils.isNotBlank(s)){
+                    EnterpriseJsonRespDTO enterpriseJsonRespDTO = JSONObject.parseObject(s, EnterpriseJsonRespDTO.class); //json字符串直接转java对象
+                    if (ObjectUtil.isNotEmpty(enterpriseJsonRespDTO)){
+                        if(ObjectUtil.isNotEmpty(enterpriseJsonRespDTO.getData())){
+                            if(CollectionUtil.isNotEmpty(enterpriseJsonRespDTO.getData().getItems())){
+                                enterpriseJsonRespDTO.getData().getItems().stream().forEach(item->{
+                                    String s1 = TicketQueryUtils.enterpriseTicketInfoQueryById(item.getCompanyid());
+                                    EnterpriseSearchDTO dto = JSONObject.parseObject(s1, EnterpriseSearchDTO.class);
+                                    list.add(dto);
+                                });
+                                result.setRecords(list);
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+        return ResponseEntity.ok (result);
+    }
+
+}

+ 53 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/common/enterpriseSearch/EnterpriseSearchDTO.java

@@ -0,0 +1,53 @@
+package com.jeeplus.finance.common.enterpriseSearch;
+
+import lombok.Data;
+
+/**
+ * 企业查询DTO
+ *     "ENTNAME": "用友网络科技股份有限公司", //企业全称
+ *     "OPLOC": "北京市海淀区北清路68号", //注册地址
+ *     "UNCID": "91110000600001760P",  //统一信用代码
+ *     "GONGSH": "110000005119254", //工商注册号
+ *     "ORGCODE": "600001760", //组织机构代码
+ *     "HASUNIFY": true, //是否三证合一
+ *     "TAXNUMBER": "91110000600001760P", //税号(同统一信用代码)
+ */
+@Data
+public class EnterpriseSearchDTO  {
+
+    /**
+     * 企业全称
+     */
+    private String ENTNAME;
+
+    /**
+     * 注册地址
+     */
+    private String OPLOC;
+
+    /**
+     * 统一信用代码
+     */
+    private String UNCID;
+
+    /**
+     * 工商注册号
+     */
+    private String GONGSH;
+
+    /**
+     * 组织机构代码
+     */
+    private String ORGCODE;
+
+    /**
+     * 是否三证合一
+     */
+    private Boolean HASUNIFY;
+
+    /**
+     * 税号(同统一信用代码)
+     */
+    private String TAXNUMBER;
+
+}

+ 279 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/common/enterpriseSearch/TicketQueryUtils.java

@@ -0,0 +1,279 @@
+package com.jeeplus.finance.common.enterpriseSearch;
+
+import com.alibaba.fastjson.JSONObject;
+
+import javax.net.ssl.HostnameVerifier;
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.SSLSession;
+import java.io.*;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLEncoder;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+名称:企业开票税号查询
+ * 功能:
+ * 1、根据关键字查询相关企业,或者根据企业信息的id查询企业的详细信息;
+ * 2、可以查到企业的名称、联系方式等基本信息;
+ * 3、可以查到公司纳税人识别号、注册地址等开发票需要的详细信息。
+ *
+ * 状态:
+ * 	    错误码	说明
+ *  	300001	请求header中没有设置apikey
+ *  	300002	api不存在或url无法解析
+ *  	300003	apikey不存在,请输入正确的apikey
+ *  	300004	服务剩余次数不足,请再次购买
+ *  	300005	未设置ip白名单
+ *  	300006	IP白名单中不包含您的IP
+ *  	300007	系统繁忙稍候再试
+ *  	300008	访问次数超载
+ *  	300009	未找到节流信息
+ *  	300010	header参数中缺少需签名的参数值
+ *  	300011	缺少需验证的参数列表
+ *  	300012	签名信息不匹配
+ *  	300013	header中缺少参数appkey
+ *  	300014	header中缺少参数appsecret
+ *  	300015	api已过期,请另行购买
+ *  	300017	要求必填参数为不能为空
+ *  	300018	api没有授权
+ */
+public class TicketQueryUtils {
+
+    private static String ApiCode = "35afe9ec3263424f9a18feb837177169";
+    private static String searchByNameUrl = "https://api.yonyoucloud.com/apis/dst/enterpriseTicketQuery/enterpriseSearchByName";
+    private static String ticketInfoQueryUrl = "https://api.yonyoucloud.com/apis/dst/enterpriseTicketQuery/enterpriseTicketInfo";
+
+    private static final String DEF_CHATSET = "UTF-8";
+    private static final int DEF_CONN_TIMEOUT = 30000;
+    private static final int DEF_READ_TIMEOUT = 30000;
+    private static String userAgent = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.66 Safari/537.36";
+
+
+    /**
+     * 根据关键字查询相关企业
+     * @param keyword
+     * @return
+     */
+    public static String enterpriseSearchByName(String keyword){
+        String result =null;
+        String method = "GET";
+        String paramFormat = "form";
+        Map<String, Object> params = new HashMap<String, Object>();//请求参数
+        params.put("keyword", keyword);
+
+        Map<String, Object> headerParams = new HashMap<String, Object>();//请求头参数
+        headerParams.put("apicode", ApiCode);//APICODE
+        try {
+            result = net(searchByNameUrl, params, headerParams, method, paramFormat);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return result;
+    }
+
+    /**
+     * 根据关键字以及分页信息查询相关企业
+     * @param keyword
+     * @return
+     */
+    public static String enterpriseSearchPage(String keyword,String size,String pageNum){
+        String result =null;
+        String method = "GET";
+        String paramFormat = "form";
+        Map<String, Object> params = new HashMap<String, Object>();//请求参数
+        params.put("keyword", keyword);
+        params.put("size", size);
+        params.put("pageNum", pageNum);
+
+        Map<String, Object> headerParams = new HashMap<String, Object>();//请求头参数
+        headerParams.put("apicode", ApiCode);//APICODE
+        try {
+            result = net(searchByNameUrl, params, headerParams, method, paramFormat);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return result;
+    }
+
+    /**
+     * 根据id查询企业税号
+     * @param id
+     * @return
+     */
+    public static String enterpriseTicketInfoQueryById(String id){
+        String result =null;
+        String method = "GET";
+        String paramFormat = "form";
+        Map<String, Object> params = new HashMap<String, Object>();//请求参数
+        params.put("id", id);
+
+        Map<String, Object> headerParams = new HashMap<String, Object>();//请求头参数
+        headerParams.put("apicode", ApiCode);//APICODE
+
+        try {
+            result = net(ticketInfoQueryUrl, params, headerParams, method, paramFormat);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return result;
+    }
+
+    private static final HostnameVerifier DO_NOT_VERIFY = new HostnameVerifier() {
+        public boolean verify(String hostname, SSLSession session) {
+            return true;
+        }
+    };
+
+    /**
+     *
+     * @param strUrl 请求地址
+     * @param params 请求参数
+     * @param method 请求方法
+     * @return  网络请求字符串
+     * @throws Exception
+     */
+    public static String net(String strUrl, Map<String,Object> params, Map<String,Object> headerParams, String method, String paramFormat) throws Exception {
+        HttpURLConnection conn = null;
+        BufferedReader reader = null;
+        String rs = null;
+        try {
+            String contentType = null;
+            if(headerParams.containsKey("Content-Type"))
+                contentType = headerParams.get("Content-Type").toString();
+
+            StringBuffer sb = new StringBuffer();
+            if(method==null || method.equals("GET")){
+                strUrl = strUrl+"?"+urlencode(params);
+            }
+
+            trustAllHttpsCertificates();
+            HttpsURLConnection.setDefaultHostnameVerifier(DO_NOT_VERIFY);
+
+            URL url = new URL(strUrl);
+            conn = (HttpURLConnection) url.openConnection();
+            if(method==null || method.equals("GET")){
+                conn.setRequestMethod("GET");
+            }else{
+                conn.setRequestMethod("POST");
+                conn.setDoOutput(true);
+            }
+            conn.setRequestProperty("User-agent", userAgent);
+            for (String i : headerParams.keySet()) {
+                conn.setRequestProperty(i, headerParams.get(i).toString());
+            }
+            if("form".equals(paramFormat) && !"application/x-www-form-urlencoded".equals(contentType) && !"application/xml".equals(contentType)) {
+                conn.setRequestProperty("Content-Type", "application/json;charset=utf-8");
+            }
+            conn.setUseCaches(false);
+            conn.setConnectTimeout(DEF_CONN_TIMEOUT);
+            conn.setReadTimeout(DEF_READ_TIMEOUT);
+            conn.setInstanceFollowRedirects(false);
+            conn.connect();
+            if (params!= null && method.equals("POST")) {
+                try {
+                    OutputStream out = conn.getOutputStream();
+                    if("form".equals(paramFormat)) {
+                        if("application/x-www-form-urlencoded".equals(contentType))
+                            out.write(urlencode(params).getBytes("utf-8"));
+                        else if("application/xml".equals(contentType))
+                            out.write(xmlencode(params).getBytes("utf-8"));
+                        else
+                            out.write(jsonencode(params).getBytes("utf-8"));
+                    } else
+                        out.write(params.toString().getBytes("utf-8"));
+
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+            InputStream is = conn.getInputStream();
+            reader = new BufferedReader(new InputStreamReader(is, DEF_CHATSET));
+            String strRead = null;
+            while ((strRead = reader.readLine()) != null) {
+                sb.append(strRead);
+            }
+            rs = sb.toString();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            if (reader != null) {
+                reader.close();
+            }
+            if (conn != null) {
+                conn.disconnect();
+            }
+        }
+        return rs;
+    }
+
+    //将map型转为请求参数型
+    public static String urlencode(Map<String,Object>data) {
+        StringBuilder sb = new StringBuilder();
+        for (Map.Entry i : data.entrySet()) {
+            try {
+                if(("").equals(i.getKey())) {
+                    sb.append(URLEncoder.encode(i.getValue()+"","UTF-8"));
+                } else {
+                    sb.append(i.getKey()).append("=").append(URLEncoder.encode(i.getValue()+"","UTF-8")).append("&");
+                }
+            } catch (UnsupportedEncodingException e) {
+                e.printStackTrace();
+            }
+        }
+        return sb.toString();
+    }
+
+    //将map型转为请求参数型
+    public static String jsonencode(Map<String,Object>data) {
+        JSONObject jparam = new JSONObject();
+        for (Map.Entry i : data.entrySet())
+            jparam.put((String) i.getKey(), i.getValue());
+
+        return jparam.toString();
+    }
+
+    //将map型转为请求参数型
+    public static String xmlencode(Map<String,Object>data) {
+        StringBuffer xmlData = new StringBuffer();
+        xmlData.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
+        for (Map.Entry i : data.entrySet())
+            xmlData.append("<" + i.getKey() + ">" + i.getValue() + "</" + i.getKey() + ">");
+
+        return xmlData.toString();
+    }
+
+    static class miTM implements javax.net.ssl.TrustManager, javax.net.ssl.X509TrustManager {
+        public java.security.cert.X509Certificate[] getAcceptedIssuers() {
+            return null;
+        }
+
+        public boolean isServerTrusted(java.security.cert.X509Certificate[] certs) {
+            return true;
+        }
+
+        public boolean isClientTrusted(java.security.cert.X509Certificate[] certs) {
+            return true;
+        }
+
+        public void checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType)
+                throws java.security.cert.CertificateException {
+            return;
+        }
+
+        public void checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType)
+                throws java.security.cert.CertificateException {
+            return;
+        }
+    }
+
+    private static void trustAllHttpsCertificates() throws Exception {
+        javax.net.ssl.TrustManager[] trustAllCerts = new javax.net.ssl.TrustManager[1];
+        javax.net.ssl.TrustManager tm = new miTM();
+        trustAllCerts[0] = tm;
+        javax.net.ssl.SSLContext sc = javax.net.ssl.SSLContext.getInstance("SSL");
+        sc.init(null, trustAllCerts, null);
+        HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
+    }
+}

+ 42 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/common/flowable/dto/CommitParamDTO.java

@@ -0,0 +1,42 @@
+package com.jeeplus.finance.common.flowable.dto;
+
+//先注释import com.jeeplus.flowable.model.TaskComment;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 流程审核通过时需要的参数
+ */
+@Data
+public class CommitParamDTO<T> implements Serializable {
+
+    private String taskId;
+    private String taskDefKey;
+    private String procInsId;
+    private String procDefId;
+    private String assignee;
+//先注释    private TaskComment comment;
+    private T vars;
+    private Cope cope; // 抄送的参数,按需使用
+
+    @Data
+    class Cope implements Serializable{
+        private List<String> userIds;
+        private String procDefId;
+        private String procInsId; // 后端自己给,前端没传
+        private String procDefName;
+        private String procInsName;
+        private String taskName;
+    }
+
+//    @Data
+//    class Comment {
+//        private String assignee;
+//        private String message;
+//        private String status;
+//        private String type;
+//        private List<String> userIds;
+//    }
+}

+ 60 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/controller/ContractFileController.java

@@ -0,0 +1,60 @@
+package com.jeeplus.finance.contractRegistration.controller;
+
+import com.jeeplus.common.utils.ResponseUtil;
+import com.jeeplus.finance.contractRegistration.domain.ContractFile;
+import com.jeeplus.finance.contractRegistration.service.ContractFileService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @author: 王强
+ * @create: 2022-11-10 16:13
+ **/
+@RestController
+@Api(tags ="财务合同登记归档管理")
+@RequestMapping(value = "/contract/contractFile")
+public class ContractFileController {
+
+    @Autowired
+    private ContractFileService service;
+
+    /**
+     * 合同登记新增/修改
+     */
+    @ApiOperation(value = "合同登记归档新增/修改")
+    @PostMapping(value = "save")
+    public ResponseEntity<String> save(@RequestBody ContractFile contractFile) throws Exception{
+        String id = service.saveInfo(contractFile);
+        return ResponseUtil.newInstance().add("businessTable", "cw_work_contract_file").add("businessId", id).ok ("操作成功");
+    }
+
+    /**
+     * 根据id修改状态status
+     */
+    @ApiOperation(value = "根据id修改状态status")
+    @PostMapping(value = "updateStatusById")
+    public void updateStatusById(@RequestBody ContractFile contractFile) {
+        service.updateStatusById(contractFile);
+    }
+
+    /**
+     * 根据id查询
+     */
+    @ApiOperation(value = "根据id查询")
+    @GetMapping(value = "findById")
+    public ContractFile findById(@RequestParam String id) {
+        return service.findById(id);
+    }
+
+    /**
+     * 根据contractInfoId查询
+     */
+    @ApiOperation(value = "根据contractInfoId查询")
+    @GetMapping(value = "findByContractInfoId")
+    public ContractFile findByContractInfoId(@RequestParam String id) {
+        return service.findByContractInfoId(id);
+    }
+}

+ 51 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/controller/ContractFilePaperController.java

@@ -0,0 +1,51 @@
+package com.jeeplus.finance.contractRegistration.controller;
+
+import com.jeeplus.common.utils.ResponseUtil;
+import com.jeeplus.finance.contractRegistration.domain.ContractFilePaper;
+import com.jeeplus.finance.contractRegistration.service.ContractFilePaperService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @author: 王强
+ * @create: 2022-11-29 14:22
+ **/
+@RestController
+@Api(tags ="财务合同登记纸质归档管理")
+@RequestMapping(value = "/contract/contractPaperFile")
+public class ContractFilePaperController {
+
+    @Autowired
+    private ContractFilePaperService service;
+
+    /**
+     * 合同登记纸质归档新增/修改
+     */
+    @ApiOperation(value = "合同登记纸质归档新增/修改")
+    @PostMapping(value = "save")
+    public ResponseEntity<String> save(@RequestBody ContractFilePaper contractFilePaper) throws Exception{
+        String id = service.saveInfo(contractFilePaper);
+        return ResponseUtil.newInstance().add("businessTable", "cw_work_contract_file_paper").add("businessId", id).ok ("操作成功");
+    }
+
+    /**
+     * 根据id修改状态status
+     */
+    @ApiOperation(value = "根据id修改状态status")
+    @PostMapping(value = "updateStatusById")
+    public void updateStatusById(@RequestBody ContractFilePaper filePaper) {
+        service.updateStatusById(filePaper);
+    }
+
+    /**
+     * 根据contractInfoId查询
+     */
+    @ApiOperation(value = "根据contractInfoId查询")
+    @GetMapping(value = "findByContractInfoId")
+    public ContractFilePaper findByContractInfoId(@RequestParam String id) {
+        return service.findByContractInfoId(id);
+    }
+}

+ 181 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/controller/ContractInfoController.java

@@ -0,0 +1,181 @@
+package com.jeeplus.finance.contractRegistration.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.jeeplus.common.excel.ExcelOptions;
+import com.jeeplus.common.excel.annotation.ExportMode;
+import com.jeeplus.common.utils.ResponseUtil;
+import com.jeeplus.core.query.QueryWrapperGenerator;
+import com.jeeplus.finance.contractRegistration.domain.ContractInfo;
+import com.jeeplus.finance.contractRegistration.service.ContractInfoService;
+import com.jeeplus.finance.invoice.util.EasyPoiUtil;
+import com.jeeplus.flowable.feign.IFlowableApi;
+import com.jeeplus.logging.annotation.ApiLog;
+import com.jeeplus.logging.constant.enums.LogTypeEnum;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+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.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * @author: 王强
+ * @create: 2022-11-08 10:52
+ **/
+@RestController
+@Api(tags ="财务合同登记管理")
+@RequestMapping(value = "/contract/registration")
+public class ContractInfoController {
+
+    @Autowired
+    private ContractInfoService service;
+
+    @Resource
+    private IFlowableApi flowTaskService;
+
+    /**
+     * 列表查询
+     * @param info
+     * @return
+     */
+    @ApiOperation(value = "列表查询")
+    // @PreAuthorize("hasAnyAuthority('cw_work_contract_info:list')")
+    @GetMapping("/list")
+    public ResponseEntity<IPage<ContractInfo>> list(ContractInfo info, Page<ContractInfo> page) throws Exception {
+        QueryWrapper<ContractInfo> wrapper = QueryWrapperGenerator.buildQueryCondition(info, ContractInfo.class);
+        IPage<ContractInfo> list = service.list(page,info,wrapper);
+        list.getRecords().stream().forEach(i -> {
+            // 项目登记
+            if (StringUtils.isNotBlank(i.getTaskId()) && StringUtils.isNotBlank(i.getStatus())) {
+                if ("2".equals(i.getStatus())) { // “审核中”的数据要获取数据审核人
+                    i.setAuditUserIds(flowTaskService.getTaskAuditUsers(i.getTaskId()));  // 获取数据审核人
+                }
+            }
+            // 纸质归档
+            if (StringUtils.isNotBlank(i.getFilePaperTaskId()) && StringUtils.isNotBlank(i.getFiledPaperType())) {
+                if ("2".equals(i.getFiledPaperType())) { // “审核中”的数据要获取数据审核人
+                    i.setAuditUserIdsFP(flowTaskService.getTaskAuditUsers(i.getFilePaperTaskId()));  // 获取数据审核人
+                }
+            }
+        });
+        return ResponseEntity.ok(list);
+    }
+
+    /**
+     * 合同登记新增/修改    cw:workContract:add
+     */
+    @ApiOperation(value = "合同登记新增/修改")
+    @PreAuthorize("hasAnyAuthority('cw:workContract:add','cw:workContract:edit')")
+    @PostMapping(value = "save")
+    public ResponseEntity<String> save(@RequestBody ContractInfo info) throws Exception{
+        String id = service.saveInfo(info);
+        return ResponseUtil.newInstance().add("businessTable", "cw_work_contract_info").add("businessId", id).ok ("操作成功");
+    }
+
+    /**
+     * 合同登记信息删除
+     */
+    @ApiOperation(value = "合同登记删除")
+    @GetMapping(value = "remove")
+    public ResponseEntity remove(@RequestParam String id) {
+        return service.removeById(id);
+    }
+
+    /**
+     * 合同登记查询
+     */
+    @ApiOperation(value = "合同登记查询")
+    @GetMapping(value = "findById")
+    public ContractInfo findById(@RequestParam String id) {
+        return service.findById(id);
+    }
+
+    /**
+     * 合同登记查询附件信息
+     */
+    @ApiOperation(value = "合同登记查询")
+    @GetMapping(value = "findFileInfoById")
+    public ContractInfo findFileInfoById(@RequestParam String id) {
+        return service.findFileInfoById(id);
+    }
+
+    /**
+     * 合同登记查询
+     */
+    @ApiOperation(value = "根据归档id查询")
+    @GetMapping(value = "findByContractId")
+    public ContractInfo findByContractId(@RequestParam String id) {
+        return service.findByContractId(id);
+    }
+
+    /**
+     * 根据id修改状态status
+     */
+    @ApiOperation(value = "根据id修改状态status")
+    @PostMapping(value = "updateStatusById")
+    public void updateStatusById(@RequestBody ContractInfo info) {
+        service.updateStatusById(info);
+    }
+
+    /**
+     * 根据id修改合同实际金额
+     */
+    @ApiOperation(value = "根据id修改合同实际金额")
+    @PostMapping(value = "updateInfo")
+    public void updateInfo(@RequestBody ContractInfo info) {
+        service.updateInfo(info);
+    }
+
+    /**
+     * 根据id修改纸质归档状态
+     */
+    @ApiOperation(value = "根据id修改纸质归档状态")
+    @PostMapping(value = "updatePaperInfo")
+    public void updatePaperInfo(@RequestBody ContractInfo info) {
+        service.updatePaperInfo(info);
+    }
+
+    @ApiOperation(value = "根据客户id查询关联的项目")
+    @GetMapping("/getByClientId")
+    public ResponseEntity<List<ContractInfo>> getByClientId(String contractId, ContractInfo contractInfo) {
+        List<ContractInfo> list = service.getByClientId(contractId,contractInfo);
+        return ResponseEntity.ok(list);
+    }
+
+
+    @ApiLog(value = "兴光会计合同数据导出", type = LogTypeEnum.EXPORT)
+    @GetMapping("exportFile")
+    @ApiOperation(value = "兴光会计合同数据导出")
+    public void exportFile(ContractInfo info, Page <ContractInfo> page, ExcelOptions options, HttpServletResponse response) throws Exception {
+        QueryWrapper<ContractInfo> wrapper = QueryWrapperGenerator.buildQueryCondition(info, ContractInfo.class);
+        String fileName = options.getFilename();
+        String sheetName = options.getSheetName();
+        List<ContractInfo> result = new ArrayList<>();
+        if ( ExportMode.current.equals ( options.getMode() ) ) {
+            result = service.list (page,info,wrapper).getRecords();
+        } else if (ExportMode.selected.equals ( options.getMode() )) {
+            result = service.list (page,info,wrapper).getRecords().stream ( ).filter ( item ->
+                    options.getSelectIds ( ).contains ( item.getId ( ) )
+            ).collect ( Collectors.toList ( ) );
+        } else {
+            page.setSize (-1);
+            page.setCurrent (0);
+            result = service.list (page,info,wrapper).getRecords();
+        }
+        try {
+            EasyPoiUtil.exportExcel ( result, sheetName,  sheetName, ContractInfo.class, fileName, response );
+        }catch (Exception e){
+            System.out.println(e);
+        }
+
+    }
+}

+ 95 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/controller/CwContractBorrowController.java

@@ -0,0 +1,95 @@
+package com.jeeplus.finance.contractRegistration.controller;
+
+import com.jeeplus.common.utils.ResponseUtil;
+import com.jeeplus.finance.contractRegistration.domain.CwWorkContractBorrow;
+import com.jeeplus.finance.contractRegistration.domain.CwWorkContractBorrowMessage;
+import com.jeeplus.finance.contractRegistration.service.CwWorkContractBorrowService;
+import com.jeeplus.finance.contractRegistration.service.dto.CwWorkContractBorrowDto;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * @author: 王强
+ * @create: 2022-11-27 13:50
+ **/
+@Api(tags ="财务-合同登记借用")
+@RestController
+@RequestMapping(value = "/contract/workContractBorrow")
+public class CwContractBorrowController {
+
+    @Resource
+    private CwWorkContractBorrowService borrowService;
+
+    /**
+     * 合同登记新增/修改
+     */
+    @ApiOperation(value = "合同登记借用新增/修改")
+    @PostMapping(value = "save")
+    public ResponseEntity<String> save(@RequestBody CwWorkContractBorrowDto workContractBorrowDto) throws Exception{
+        String id = borrowService.saveInfo(workContractBorrowDto);
+        return ResponseUtil.newInstance().add("businessTable", "cw_work_contract_borrow").add("businessId", id).ok ("操作成功");
+    }
+
+    /**
+     * 根据id修改状态status
+     */
+    @ApiOperation(value = "根据id修改状态status")
+    @PostMapping(value = "updateStatusById")
+    public void updateStatusById(@RequestBody CwWorkContractBorrowDto workContractBorrowDto) {
+        borrowService.updateStatusById(workContractBorrowDto);
+    }
+
+    /**
+     * 根据contractInfoId修改状态status
+     */
+    @ApiOperation(value = "根据id修改状态status")
+    @PostMapping(value = "updateStatusByContractInfoId")
+    public void updateStatusByContractInfoId(@RequestBody CwWorkContractBorrowDto workContractBorrowDto) {
+        borrowService.updateStatusByContractInfoId(workContractBorrowDto);
+    }
+
+    /**
+     * 根据id查询
+     */
+    @ApiOperation(value = "根据id查询")
+    @GetMapping(value = "findById")
+    public CwWorkContractBorrow findById(@RequestParam String id) {
+        return borrowService.findById(id);
+    }
+
+    /**
+     * 根据contractInfoId查询
+     */
+    @ApiOperation(value = "根据contractInfoId查询")
+    @GetMapping(value = "findByContractInfoId")
+    public CwWorkContractBorrow findByContractInfoId(@RequestParam String id) {
+        return borrowService.findByContractInfoId(id);
+    }
+
+    /**
+     * 根据id修改状态status
+     */
+    @ApiOperation(value = "根据id修改状态借用表status")
+    @PostMapping(value = "updateMessageStatusById")
+    public void updateMessageStatusById(@RequestBody CwWorkContractBorrowDto workContractBorrowDto) {
+        borrowService.updateMessageByBorrowId(workContractBorrowDto, workContractBorrowDto.getType());
+    }
+
+    @ApiOperation(value = "根据id删除借用表信息")
+    @GetMapping(value = "deleteById")
+    public void deleteById(@RequestParam String id) {
+        borrowService.deleteById(id);
+    }
+
+    @ApiOperation(value = "根据id查询借用表信息")
+    @GetMapping(value = "findMessageList")
+    public List<CwWorkContractBorrowMessage> findMessageList(@RequestParam String id) {
+        return borrowService.findMessageList(id);
+    }
+}

+ 81 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/domain/ContractFile.java

@@ -0,0 +1,81 @@
+package com.jeeplus.finance.contractRegistration.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jeeplus.core.domain.BaseEntity;
+import com.jeeplus.core.query.Query;
+import com.jeeplus.pubmodules.oss.service.dto.WorkAttachmentDto;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author: 王强
+ * @create: 2022-11-10 16:06
+ **/
+@Data
+@TableName(value = "cw_work_contract_file")
+public class ContractFile extends BaseEntity {
+
+    @TableField(exist = false)
+    private String fileId;
+
+    /**
+     * 合同登记主键值
+     */
+    private String contractInfoId;
+    /**
+     * 流程id
+     */
+    private String procInsId;
+    private String processDefinitionId;
+    /**
+     * 归档人
+     */
+    private String fileCreateName;
+    /**
+     * 归档状态
+     */
+    private String filedType;
+    /**
+     * 归档完成时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private String filedData;
+    /**
+     * 案卷号
+     */
+//    private String filedNo;
+    /**
+     * 确认案卷号
+     */
+//    private String confirmFiledNo;
+
+    @TableField(exist = false)
+    private String createId;       //创建人id
+
+    /**
+     * 客户名称
+     */
+    @TableField(exist = false)
+    private String customerName;
+
+    /**
+     * 客户编号
+     */
+    @TableField(exist = false)
+    private String customerNo;
+
+    /**
+     * 合同正文附件信息
+     */
+    @TableField(exist = false)
+    private List<WorkAttachmentDto> contractProperList;
+
+    /**
+     * 归档附件信息
+     */
+    @TableField(exist = false)
+    private List<WorkAttachmentDto> contractInfoList;
+}

+ 82 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/domain/ContractFilePaper.java

@@ -0,0 +1,82 @@
+package com.jeeplus.finance.contractRegistration.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jeeplus.core.domain.BaseEntity;
+import com.jeeplus.pubmodules.oss.service.dto.WorkAttachmentDto;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 纸质归档
+ * @author: 王强
+ * @create: 2022-11-10 16:06
+ **/
+@Data
+@TableName(value = "cw_work_contract_file_paper")
+public class ContractFilePaper extends BaseEntity {
+
+    @TableField(exist = false)
+    private String fileId;
+
+    /**
+     * 合同登记主键值
+     */
+    private String contractInfoId;
+    /**
+     * 流程id
+     */
+    private String procInsId;
+    private String processDefinitionId;
+    /**
+     * 归档人
+     */
+    private String fileCreateName;
+    /**
+     * 纸质归档状态
+     */
+    private String filedPaperType;
+    /**
+     * 归档完成时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private String filedData;
+    /**
+     * 案卷号
+     */
+    private String filedNo;
+    /**
+     * 确认案卷号
+     */
+    private String confirmFiledNo;
+
+    @TableField(exist = false)
+    private String createId;       //创建人id
+
+    /**
+     * 客户名称
+     */
+    @TableField(exist = false)
+    private String customerName;
+
+    /**
+     * 客户编号
+     */
+    @TableField(exist = false)
+    private String customerNo;
+
+    /**
+     * 合同正文附件信息
+     */
+    @TableField(exist = false)
+    private List<WorkAttachmentDto> contractProperList;
+
+    /**
+     * 归档附件信息
+     */
+    @TableField(exist = false)
+    private List<WorkAttachmentDto> contractInfoList;
+}

+ 248 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/domain/ContractInfo.java

@@ -0,0 +1,248 @@
+package com.jeeplus.finance.contractRegistration.domain;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jeeplus.core.domain.BaseEntity;
+import com.jeeplus.core.query.Query;
+import com.jeeplus.core.query.QueryType;
+import com.jeeplus.finance.workClientInfo.service.dto.CwWorkClientBaseDTO;
+import com.jeeplus.pubmodules.oss.service.dto.WorkAttachmentDto;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author: 王强
+ * @create: 2022-11-08 10:42
+ **/
+@Data
+@TableName(value = "cw_work_contract_info")
+public class ContractInfo extends BaseEntity {
+
+    //合同编号(字典值)
+    public static final String BIZ_CODE = "10";
+
+    //合同 基字流水号
+    public static final String SERIAL_NUMBER1 = "17";
+    //合同 咨字流水号
+    public static final String SERIAL_NUMBER2 = "18";
+    //合同 框字流水号
+    public static final String SERIAL_NUMBER3 = "19";
+    //合同 审字流水号
+    public static final String SERIAL_NUMBER4 = "20";
+    //合同 验字流水号
+    public static final String SERIAL_NUMBER5 = "21";
+    //合同 特字流水号
+    public static final String SERIAL_NUMBER6 = "22";
+
+    @Query(tableColumn = "a.contract_name")
+    @Excel(name = "合同名称", width = 30)
+    private String contractName;            //合同名称
+    @Query(tableColumn = "a.contract_no")
+    @Excel(name = "合同编号", width = 30)
+    private String contractNo;              //合同编号
+
+    /**
+     * 委托方联系人名称
+     */
+    @TableField(exist = false)
+    @Excel(name = "委托方", width = 30)
+    private String clientContactsName;
+
+    /**
+     * 案卷号
+     */
+    @TableField(exist = false)
+    @Excel(name = "案卷号", width = 16)
+    private String filedNo;
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "签约日期", width = 16,exportFormat="yyyy-MM-dd")
+    private Date signingDate;             //签约日期
+    @Query(tableColumn = "a.contract_amount")
+    @Excel(name = "合同金额(元)", width = 16, type = 10)
+    private Double contractAmount;          //合同金额(元)
+
+    @TableField(exist = false)
+    @Excel(name = "所属部门", width = 16)
+    private String departmentName;
+
+    /**
+     * 创建人
+     */
+    @TableField(exist = false)
+    @Excel(name = "创建人", width = 12)
+    private String createName;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "创建时间", width = 16,exportFormat="yyyy-MM-dd")
+    private Date createTime;
+    @Excel(name = "状态", width = 10,dict = "cw_status")
+    private String status;                  //状态
+
+    /**
+     * 纸质归档状态
+     */
+    @Excel(name = "纸质归档状态", width = 16,dict = "filed_type")
+    private String filedPaperType;
+
+    /**
+     * 借用状态
+     */
+    @Excel(name = "借用状态", width = 12,dict = "borrow_type")
+    private String borrowType;
+
+    private String payerSubject;            //付款主体
+    private String paymentMethod;           //付款方式
+    private Double predictAmount;          //预计金额(元)
+    private Double actualContractAmount;    //合同实际金额
+    private String contractNum;             //合同份数
+    private String paymentAgreement;        //付款约定
+    @TableField(fill = FieldFill.UPDATE)
+    private String changeNum;               //修改次数
+//    @Query(tableColumn = "a.department")
+    private String department;              //所属部门
+    private String clientContacts;          //委托方联系人
+    private String clientContactsPhone;     //委托方联系人电话
+    private String contractApprovalType;    //合同归档审批类型
+    private String procInsId;               //流程id
+    private String processDefinitionId;     //
+
+    @TableField(exist = false)
+    private String createBy;                //创建人名称
+
+    @TableField(exist = false)
+    @Query(tableColumn = "c.id",type = QueryType.EQ)
+    private String createId;                //创建人id
+
+    @TableField(exist = false)
+    private String contractStatus;          //合同状态
+
+    @TableField(exist = false)
+    private String taskFiledId;
+
+    @TableField(exist = false)
+    private String taskFiledProcInsId;
+
+    @TableField(exist = false)
+    private String taskFiledPaperProcInsId;
+
+    /**
+     * 归档状态
+     */
+    @Query(tableColumn = "a.filed_type")
+    private String filedType;
+
+    @TableField(exist = false)
+    private String[] contractAmounts;
+
+    @TableField(exist = false)
+    private String[] contractDates;
+
+    /**
+     * 附件信息
+     */
+    @TableField(exist = false)
+    private List<WorkAttachmentDto> contractProperList;
+
+    /**
+     * 被服务单位信息
+     */
+    @TableField(exist = false)
+    private List<CwWorkClientBaseDTO> cwWorkClientContactDTOList;
+
+    /**
+     * 归档附件信息
+     */
+    @TableField(exist = false)
+    private List<WorkAttachmentDto> contractInfoList;
+
+    /**
+     * 合同金额类别
+     */
+    private String contractAmountType;
+
+    /**
+     * 对方合同编号
+     */
+    private String contractOpposite;
+
+    /**
+     * 收费标准
+     */
+    private String contractFee;
+
+    private String fees;
+    /**
+     * 确认案卷号
+     */
+    @TableField(exist = false)
+    private String confirmFiledNo;
+
+    @TableField(exist = false)
+    private String taskBorrowId;
+
+    /**
+     * 客户id
+     */
+    @TableField(exist = false)
+    private String customerId;
+
+    /**
+     * 客户编号
+     */
+    @TableField(exist = false)
+    private String customerNo;
+
+    /**
+     * 统一社会信用代码
+     */
+    @TableField(exist = false)
+    private String uscCode;
+
+    /**
+     * 客户地址
+     */
+    @TableField(exist = false)
+    private String address;
+
+    /**
+     * 付款描述
+     */
+    private String paymentDescribe;
+
+    /**
+     * 合同类型
+     */
+    private String contractType;
+
+    /**
+     * 合同流水号
+     */
+    private String contractSerialNumber;
+
+    @TableField(exist = false)
+    private String taskId;
+
+    /**
+     * 数据审核人
+     */
+    @TableField(exist = false)
+    private List<String> auditUserIds;
+
+    @TableField(exist = false)
+    private String filePaperTaskId;
+
+    /**
+     * 数据审核人  纸质归档
+     */
+    @TableField(exist = false)
+    private List<String> auditUserIdsFP;
+}

+ 22 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/domain/ContractParticipant.java

@@ -0,0 +1,22 @@
+package com.jeeplus.finance.contractRegistration.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+/**
+ * 参与签约方信息
+ * @author: 王强
+ * @create: 2022-11-15 13:32
+ **/
+@Data
+@TableName(value = "cw_work_contract_participant")
+public class ContractParticipant extends BaseEntity {
+
+    private String customerName;
+
+    private String customerNo;
+
+    private String contractInfoId;
+}

+ 40 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/domain/CwWorkContractBorrow.java

@@ -0,0 +1,40 @@
+package com.jeeplus.finance.contractRegistration.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author: 王强
+ * @create: 2022-11-27 13:53
+ **/
+@Data
+@TableName("cw_work_contract_borrow")
+public class CwWorkContractBorrow extends BaseEntity {
+
+    private String contractInfoId;
+
+    private String procInsId;
+
+    private String processDefinitionId;
+
+    private String contractName;
+
+    private String contractNo;
+
+    private String clientName;
+
+    private String borrowName;
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date borrowData;
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date borrowRetData;
+
+    private String remarks;
+
+    private String borrowType;
+
+}

+ 42 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/domain/CwWorkContractBorrowMessage.java

@@ -0,0 +1,42 @@
+package com.jeeplus.finance.contractRegistration.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author: 王强
+ * @create: 2022-11-27 13:54
+ **/
+@Data
+@TableName("cw_work_contract_borrow_message")
+public class CwWorkContractBorrowMessage extends BaseEntity {
+
+    private String contractBorrowId;
+
+    private String contractName;
+
+    private String borrowName;
+
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date borrowData;
+
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date borrowRetData;
+
+    private String borrowType;
+
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date retData;
+
+    private String contractId;  //合同id
+
+    private String contractCreateById;  //合同创建人id
+
+    private String processDefinitionId;  //流程defId
+    private String procInsId;  //流程procInsId
+
+}

+ 43 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/mapper/ContractFileMapper.java

@@ -0,0 +1,43 @@
+package com.jeeplus.finance.contractRegistration.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.finance.contractRegistration.domain.ContractFile;
+import com.jeeplus.pubmodules.oss.domain.WorkAttachment;
+import com.jeeplus.pubmodules.oss.service.dto.WorkAttachmentDto;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @author: 王强
+ * @create: 2022-11-10 16:10
+ **/
+public interface ContractFileMapper extends BaseMapper<ContractFile> {
+
+    List<WorkAttachmentDto> findDtos(@Param("id") String id);
+
+    ContractFile findById (@Param("id") String id);
+
+    ContractFile findByInfoId (@Param("id") String id);
+
+    void updateStatusById(@Param("id") String id, @Param("filedType")String filedType);
+
+    ContractFile selectFileByContractInfoId (@Param("id") String id);
+
+    List<WorkAttachment> findList(@Param("id") String id);
+
+    Integer findIsExit(@Param("id") String id, @Param("name")String name);
+
+    /**
+     * 根据attachmentId删除上传文件信息
+     */
+    void deleteFileInfo(String attachmentId);
+
+    /**
+     * 根据合同登记主键值找到对应归档信息
+     * @param id
+     */
+    ContractFile getInfoByConId(String id);
+
+    ContractFile getById(String id);
+}

+ 34 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/mapper/ContractFilePaperMapper.java

@@ -0,0 +1,34 @@
+package com.jeeplus.finance.contractRegistration.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.finance.contractRegistration.domain.ContractFilePaper;
+import com.jeeplus.pubmodules.oss.domain.WorkAttachment;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @author: 王强
+ * @create: 2022-11-29 14:20
+ **/
+public interface ContractFilePaperMapper extends BaseMapper<ContractFilePaper> {
+    /**
+     * 根据合同id查询纸质归档信息
+     * @param id
+     * @return
+     */
+    ContractFilePaper selectFilePaperByContractInfoId(String id);
+
+    ContractFilePaper getById(String id);
+
+    void updateStatusById(@Param("id") String id, @Param("filedType")String filedType);
+
+    List<WorkAttachment> findList(@Param("id") String id);
+
+    Integer findIsExit(@Param("id") String id, @Param("contractInfoId") String contractInfoId, @Param("name")String name);
+
+    /**
+     * 根据attachmentId删除上传文件信息
+     */
+    void deleteFileInfo(String attachmentId);
+}

+ 82 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/mapper/ContractInfoMapper.java

@@ -0,0 +1,82 @@
+package com.jeeplus.finance.contractRegistration.mapper;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+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.finance.contractRegistration.domain.ContractFile;
+import com.jeeplus.finance.contractRegistration.domain.ContractInfo;
+import com.jeeplus.pubmodules.oss.domain.WorkAttachment;
+import com.jeeplus.pubmodules.oss.service.dto.WorkAttachmentDto;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @author: 王强
+ * @create: 2022-11-08 10:47
+ **/
+public interface ContractInfoMapper extends BaseMapper<ContractInfo> {
+
+    ContractInfo getInfoById(String id);
+
+    ContractFile getById(String id);
+
+    List<WorkAttachmentDto> findDtos(@Param("id") String id);
+
+    IPage<ContractInfo> findPageList(Page<ContractInfo> page, @Param("officeIds") String officeIds, @Param(Constants.WRAPPER) QueryWrapper queryWrapper);
+
+    ContractInfo findById (@Param("id") String id);
+
+    ContractInfo findFileInfoById (@Param("id") String id);
+
+    ContractInfo findByContractId (@Param("id") String id);
+
+    void updateStatusById(@Param("id") String id, @Param("status")String status);
+
+    void updatefiledTypeById(@Param("id") String id, @Param("status")String status);
+
+    void updatefiledPaperTypeById(@Param("id") String id, @Param("status")String status);
+
+    List<WorkAttachment> findList(@Param("id") String id);
+
+    Integer findIsExit(@Param("id") String id, @Param("name")String name);
+
+    /**
+     * 修改合同实际金额
+     * @param id
+     * @param actualContractAmount
+     * @param contractApprovalType
+     */
+    void updateInfo(@Param("id") String id,
+                    @Param("actualContractAmount") Double actualContractAmount,
+                    @Param("contractApprovalType") String contractApprovalType,
+                    @Param("filedType") String filedType);
+
+    List<String> findChildIds(String department);
+
+    List<ContractInfo> getByClientId(@Param(Constants.WRAPPER) QueryWrapper queryWrapper);
+
+    // 没有使用客户id作为参数,而是直接查询,是因为 合同与客户的关联表 中没有 客户id 的字段,只有客户编号的字段
+    List<String> getClientListByClientNo(@Param("no") String no);
+
+    void updateBorrowTypeById(@Param("id") String id, @Param("status")String status);
+
+    /**
+     * 修改纸质归档状态
+     * @param id
+     * @param filedPaperType
+     */
+    void updatePaperInfo(@Param("id") String id,
+                         @Param("actualContractAmount") Double actualContractAmount,
+                         @Param("contractApprovalType") String contractApprovalType,
+                         @Param("filedPaperType") String filedPaperType);
+
+    String isUseByProject(@Param("id") String id);
+
+    String isUseByReim(@Param("id") String id);
+
+    String isUseByInvoice(@Param("id") String id);
+}

+ 22 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/mapper/ContractParticipantMapper.java

@@ -0,0 +1,22 @@
+package com.jeeplus.finance.contractRegistration.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.finance.contractRegistration.domain.ContractParticipant;
+
+import java.util.List;
+
+/**
+ * @author: 王强
+ * @create: 2022-11-15 13:44
+ **/
+public interface ContractParticipantMapper extends BaseMapper<ContractParticipant> {
+
+    /**
+     * 估计infoid删除相关的参与签约方信息
+     * @param InfoId
+     */
+    void deleteFromParticipant(String InfoId);
+
+
+    List<ContractParticipant> findByInfoId(String infoID);
+}

+ 36 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/mapper/CwWorkContractBorrowMapper.java

@@ -0,0 +1,36 @@
+package com.jeeplus.finance.contractRegistration.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.finance.contractRegistration.domain.CwWorkContractBorrow;
+import com.jeeplus.finance.contractRegistration.domain.CwWorkContractBorrowMessage;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @author: 王强
+ * @create: 2022-11-27 13:52
+ **/
+public interface CwWorkContractBorrowMapper extends BaseMapper<CwWorkContractBorrow> {
+
+    void updateStatusById(@Param("id") String id, @Param("borrowType")String borrowType);
+
+    void updateStatusByContractInfoId(@Param("id") String id, @Param("borrowType")String borrowType);
+
+    CwWorkContractBorrow selectFileByContractInfoId (@Param("id") String id);
+
+    void updateMessageByBorrowId(@Param("id") String id, @Param("borrowType")String borrowType, @Param("type")String type);
+
+    void deleteMessageById(@Param("id") String id);
+
+    List<CwWorkContractBorrowMessage> findMessageList(@Param("id") String id);
+
+    CwWorkContractBorrow selectByInfoId(String id);
+
+    /**
+     * 查询临期合同借用信息
+     * @param adventDay
+     * @return
+     */
+    List<CwWorkContractBorrowMessage> getAdventMessageList(@Param("adventDay") String adventDay);
+}

+ 11 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/mapper/CwWorkContractBorrowMessageMapper.java

@@ -0,0 +1,11 @@
+package com.jeeplus.finance.contractRegistration.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.finance.contractRegistration.domain.CwWorkContractBorrowMessage;
+
+/**
+ * @author: 王强
+ * @create: 2022-11-27 13:59
+ **/
+public interface CwWorkContractBorrowMessageMapper extends BaseMapper<CwWorkContractBorrowMessage> {
+}

+ 122 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/mapper/xml/ContractFileMapper.xml

@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.finance.contractRegistration.mapper.ContractFileMapper">
+    <update id="updateStatusById">
+        UPDATE cw_work_contract_file SET filed_type = #{filedType}, filed_data = NOW()
+<!--        <if test="filedType == '4'.toString()">-->
+<!--            ,proc_ins_id = null-->
+<!--            ,process_definition_id = null-->
+<!--        </if>-->
+        WHERE del_flag = 0 AND contract_info_id = #{id}
+    </update>
+    <delete id="deleteFileInfo">
+        delete from work_attachment where attachment_id = #{attachmentId}
+    </delete>
+    <select id="selectFileByContractInfoId"
+            resultType="com.jeeplus.finance.contractRegistration.domain.ContractFile">
+        SELECT * FROM `cw_work_contract_file` WHERE del_flag = 0 AND contract_info_id = #{id}
+    </select>
+    <select id="findList" resultType="com.jeeplus.pubmodules.oss.domain.WorkAttachment">
+        SELECT * FROM work_attachment WHERE del_flag = 0 AND attachment_id = #{id}
+    </select>
+    <select id="findIsExit" resultType="java.lang.Integer">
+         SELECT
+			COUNT( 0 )
+		FROM
+			work_attachment
+		WHERE
+			del_flag = 0
+			AND attachment_id = #{id}
+			AND attachment_name = #{name}
+    </select>
+    <select id="findById" resultType="com.jeeplus.finance.contractRegistration.domain.ContractFile">
+        SELECT
+			a.id,
+			b.id as fileId,
+			c.`name` AS createBy,
+			c.`id` AS createId,
+			a.create_time,
+			a.update_by_id,
+			a.update_time,
+			a.del_flag,
+			a.contract_no as contractNo,
+			a.contract_name as contractName,
+			a.payer_subject as payerSubject,
+			a.payment_method as paymentMethod,
+			DATE_FORMAT(a.signing_date,'%Y-%m-%d') as signingDate,
+            a.contract_amount as contractAmount,
+            a.actual_contract_amount as actualContractAmount,
+            a.contract_num as contractNum,
+            a.payment_agreement as paymentAgreement,
+            a.change_num as changeNum,
+            a.department,
+            a.client_contacts as clientContacts,
+            a.client_contacts_phone as clientContactsPhone,
+            a.contract_approval_type as contractApprovalType,
+            a.proc_ins_id as procInsId,
+            a.status,
+            b.filed_type as filedType,
+            b.contract_info_id as contractInfoId
+		FROM
+			cw_work_contract_info a
+            LEFT JOIN cw_work_contract_file b on a.id = b.contract_info_id
+            LEFT JOIN sys_user c ON a.create_by_id = c.id
+        WHERE
+			a.id = #{id}
+			AND a.del_flag = 0
+    </select>
+    <select id="findDtos" resultType="com.jeeplus.pubmodules.oss.service.dto.WorkAttachmentDto">
+        SELECT
+			id,
+			url,
+			attachment_name AS `name`,
+			create_by_id AS `by`,
+			create_time
+		FROM
+			work_attachment
+		WHERE
+			del_flag = 0
+			AND attachment_id = #{id}
+    </select>
+    <select id="findByInfoId" resultType="com.jeeplus.finance.contractRegistration.domain.ContractFile">
+        SELECT
+			b.id as fileId,
+			c.`name` AS createBy,
+			c.`id` AS createId,
+			a.create_time,
+			a.update_by_id,
+			a.update_time,
+			a.del_flag,
+			a.contract_no as contractNo,
+			a.contract_name as contractName,
+			a.payer_subject as payerSubject,
+			a.payment_method as paymentMethod,
+			DATE_FORMAT(a.signing_date,'%Y-%m-%d') as signingDate,
+            a.contract_amount as contractAmount,
+            a.actual_contract_amount as actualContractAmount,
+            a.contract_num as contractNum,
+            a.payment_agreement as paymentAgreement,
+            a.change_num as changeNum,
+            a.department,
+            a.client_contacts as clientContacts,
+            a.client_contacts_phone as clientContactsPhone,
+            a.contract_approval_type as contractApprovalType,
+            a.proc_ins_id as procInsId,
+            a.status,
+            b.filed_type as filedType,
+            b.contract_info_id as contractInfoId
+		FROM
+			cw_work_contract_file b
+            LEFT JOIN cw_work_contract_info a on a.id = b.contract_info_id
+            LEFT JOIN sys_user c ON a.create_by_id = c.id
+        WHERE
+			b.id = #{id}
+			AND b.del_flag = 0
+    </select>
+    <select id="getInfoByConId" resultType="com.jeeplus.finance.contractRegistration.domain.ContractFile">
+        select * from cw_work_contract_file where contract_info_id = #{id}
+    </select>
+    <select id="getById" resultType="com.jeeplus.finance.contractRegistration.domain.ContractFile">
+        select * from cw_work_contract_file where id = #{id}
+    </select>
+</mapper>

+ 32 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/mapper/xml/ContractFilePaperMapper.xml

@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.finance.contractRegistration.mapper.ContractFilePaperMapper">
+    <update id="updateStatusById">
+        UPDATE cw_work_contract_file_paper SET filed_paper_type = #{filedType}, filed_data = NOW()
+        WHERE del_flag = 0 AND contract_info_id = #{id}
+    </update>
+    <delete id="deleteFileInfo">
+        delete from work_attachment where attachment_id = #{attachmentId}
+    </delete>
+    <select id="selectFilePaperByContractInfoId"
+            resultType="com.jeeplus.finance.contractRegistration.domain.ContractFilePaper">
+        SELECT * FROM `cw_work_contract_file_paper` WHERE del_flag = 0 AND contract_info_id = #{id}
+    </select>
+    <select id="getById" resultType="com.jeeplus.finance.contractRegistration.domain.ContractFilePaper">
+        select * from cw_work_contract_file_paper where id = #{id}
+    </select>
+    <select id="findList" resultType="com.jeeplus.pubmodules.oss.domain.WorkAttachment">
+        SELECT * FROM work_attachment WHERE del_flag = 0 AND attachment_id = #{id}
+    </select>
+    <select id="findIsExit" resultType="java.lang.Integer">
+        SELECT
+			COUNT( 0 )
+		FROM
+			work_attachment
+		WHERE
+			del_flag = 0
+			AND attachment_id in (#{id}, #{contractInfoId})
+			AND attachment_name = #{name}
+    </select>
+
+</mapper>

+ 269 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/mapper/xml/ContractInfoMapper.xml

@@ -0,0 +1,269 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.finance.contractRegistration.mapper.ContractInfoMapper">
+
+    <update id="updateStatusById">
+        UPDATE cw_work_contract_info SET `status` = #{status} WHERE del_flag = 0 AND id = #{id}
+    </update>
+    <update id="updatefiledTypeById">
+        UPDATE cw_work_contract_info SET `filed_type` = #{status} WHERE del_flag = 0 AND id = #{id}
+    </update>
+    <update id="updateInfo">
+        UPDATE cw_work_contract_info SET actual_contract_amount = #{actualContractAmount}
+        ,contract_approval_type = #{contractApprovalType},filed_type = #{filedType} where del_flag = 0 AND id = #{id}
+    </update>
+    <update id="updatefiledPaperTypeById">
+        UPDATE cw_work_contract_info SET `filed_paper_type` = #{status} WHERE del_flag = 0 AND id = #{id}
+    </update>
+    <update id="updateBorrowTypeById">
+        UPDATE cw_work_contract_info SET `borrow_type` = #{status} WHERE del_flag = 0 AND id = #{id}
+    </update>
+    <update id="updatePaperInfo">
+        UPDATE cw_work_contract_info SET filed_paper_type = #{filedPaperType},
+        actual_contract_amount = #{actualContractAmount}
+        ,contract_approval_type = #{contractApprovalType}
+        where del_flag = 0 AND id = #{id}
+    </update>
+
+    <select id="findPageList" resultType="com.jeeplus.finance.contractRegistration.domain.ContractInfo">
+        SELECT
+        DISTINCT a.id,
+			c.`name` AS create_by,
+			c.`name` AS createName,
+			c.`id` AS createId,
+			a.create_time,
+			a.update_by_id,
+			a.update_time,
+			a.del_flag,
+			a.contract_no as contractNo,
+			a.contract_name as contractName,
+			a.payer_subject as payerSubject,
+			a.payment_method as paymentMethod,
+			DATE_FORMAT(a.signing_date,'%Y-%m-%d') as signingDate,
+            a.contract_amount as contractAmount,
+            a.actual_contract_amount as actualContractAmount,
+            a.contract_num as contractNum,
+            a.payment_agreement as paymentAgreement,
+            a.change_num as changeNum,
+            a.department,
+            a.client_contacts as clientContacts,
+            a.client_contacts_phone as clientContactsPhone,
+            a.contract_approval_type as contractApprovalType,
+            a.proc_ins_id as procInsId,
+            a.process_definition_id as processDefinitionId,
+            a.contract_amount_type,
+            a.contract_opposite,
+            a.contract_fee,
+            a.payment_describe,
+            a.contract_type,
+            a.contract_serial_number,
+            a.fees,
+            a.status,
+            b.filed_type as filedType,
+            e.ID_ as taskFiledId,
+            b.proc_ins_id as taskFiledProcInsId,
+            d.name as departmentName,
+            f.borrow_type,
+            g.ID_ as task_borrow_id,
+            h.filed_paper_type as filedPaperType,
+            h.filed_no as filedNo,
+            h.confirm_filed_no as confirmFiledNo,
+            h.proc_ins_id as taskFiledPaperProcInsId,
+            cw_wcb.name as client_contacts_name,
+            art.ID_ as task_id,
+            art_fp.ID_ as file_paper_task_id
+		FROM
+			cw_work_contract_info a
+            LEFT JOIN cw_work_contract_file b on a.id = b.contract_info_id
+            LEFT JOIN sys_user c ON a.create_by_id = c.id
+            left join sys_user_manage_office sumo on sumo.office_id = c.office_id
+            LEFT JOIN act_ru_task e ON b.proc_ins_id = e.PROC_INST_ID_
+            LEFT JOIN sys_office d on a.department = d.id
+            LEFT JOIN cw_work_contract_borrow f ON a.id = f.contract_info_id
+            LEFT JOIN act_ru_task g ON f.proc_ins_id = g.PROC_INST_ID_
+            LEFT JOIN cw_work_contract_file_paper h on a.id = h.contract_info_id
+            LEFT JOIN cw_work_client_base cw_wcb on a.client_contacts = cw_wcb.id and cw_wcb.del_flag = '0'
+            LEFT JOIN act_ru_task art ON a.proc_ins_id = art.PROC_INST_ID_
+            LEFT JOIN act_ru_task art_fp ON h.proc_ins_id = art_fp.PROC_INST_ID_
+		${ew.customSqlSegment}
+		ORDER BY a.update_time DESC
+    </select>
+    <select id="findById" resultType="com.jeeplus.finance.contractRegistration.domain.ContractInfo">
+        SELECT
+			a.id,
+			c.`name` AS createBy,
+			c.`id` AS createId,
+			a.create_time,
+			a.update_by_id,
+			a.update_time,
+			a.del_flag,
+			a.contract_no as contractNo,
+			a.contract_name as contractName,
+			a.payer_subject as payerSubject,
+			a.payment_method as paymentMethod,
+			DATE_FORMAT(a.signing_date,'%Y-%m-%d') as signingDate,
+            a.contract_amount as contractAmount,
+            a.actual_contract_amount as actualContractAmount,
+            a.contract_num as contractNum,
+            a.payment_agreement as paymentAgreement,
+            a.change_num as changeNum,
+            a.department,
+            a.contract_amount_type,
+            a.contract_opposite,
+            a.contract_fee,
+            a.payment_describe,
+            a.contract_type,
+            a.contract_serial_number,
+            a.fees,
+            cw.id as customerId,
+            cw.name as clientContacts,
+            cw.no as customerNo,
+            cw.usc_code as uscCode,
+            cw.mobile as clientContactsPhone,
+            cw.address as address,
+            a.contract_approval_type as contractApprovalType,
+            a.proc_ins_id as procInsId,
+            a.status,
+            a.predict_amount as "predictAmount",
+            b.filed_type as filedType,
+            d.filed_paper_type as filedPaperType,
+            d.filed_no as filedNo,
+            d.confirm_filed_no as confirmFiledNo,
+            e.name as departmentName
+		FROM
+			cw_work_contract_info a
+            LEFT JOIN cw_work_contract_file b on a.id = b.contract_info_id
+            LEFT JOIN sys_user c ON a.create_by_id = c.id
+            left join cw_work_client_base cw on a.client_contacts = cw.id
+            LEFT JOIN cw_work_contract_file_paper d on a.id = d.contract_info_id
+            LEFT JOIN sys_office e on a.department = e.id
+        WHERE
+			a.id = #{id}
+			AND a.del_flag = 0
+    </select>
+    <select id="findList" resultType="com.jeeplus.pubmodules.oss.domain.WorkAttachment">
+        SELECT * FROM work_attachment WHERE del_flag = 0 AND attachment_id = #{id}
+    </select>
+    <select id="findIsExit" resultType="java.lang.Integer">
+        SELECT
+			COUNT( 0 )
+		FROM
+			work_attachment
+		WHERE
+			del_flag = 0
+			AND attachment_id = #{id}
+			AND attachment_name = #{name}
+    </select>
+    <select id="findDtos" resultType="com.jeeplus.pubmodules.oss.service.dto.WorkAttachmentDto">
+        SELECT
+			id,
+			url,
+			attachment_name AS `name`,
+			create_by_id AS `by`,
+			create_time
+		FROM
+			work_attachment
+		WHERE
+			del_flag = 0
+			AND attachment_id = #{id}
+    </select>
+    <select id="findByContractId" resultType="com.jeeplus.finance.contractRegistration.domain.ContractInfo">
+        SELECT
+			a.id,
+			c.`name` AS createBy,
+			c.`id` AS createId,
+			a.create_time,
+			a.update_by_id,
+			a.update_time,
+			a.del_flag,
+			a.contract_no as contractNo,
+			a.contract_name as contractName,
+			a.payer_subject as payerSubject,
+			a.payment_method as paymentMethod,
+			DATE_FORMAT(a.signing_date,'%Y-%m-%d') as signingDate,
+            a.contract_amount as contractAmount,
+            a.actual_contract_amount as actualContractAmount,
+            a.contract_num as contractNum,
+            a.payment_agreement as paymentAgreement,
+            a.change_num as changeNum,
+            a.department,
+            a.client_contacts as clientContacts,
+            a.client_contacts_phone as clientContactsPhone,
+            a.contract_approval_type as contractApprovalType,
+            a.proc_ins_id as procInsId,
+            a.status,
+            b.filed_type as filedType,
+            d.filed_paper_type as filedPaperType,
+            d.filed_no as filedNo,
+            d.confirm_filed_no as confirmFiledNo
+		FROM
+			cw_work_contract_info a
+            LEFT JOIN cw_work_contract_file b on a.id = b.contract_info_id
+            LEFT JOIN sys_user c ON a.create_by_id = c.id
+            LEFT JOIN cw_work_contract_file_paper d on a.id = d.contract_info_id
+        WHERE
+			b.id = #{id}
+			AND a.del_flag = 0
+    </select>
+    <select id="getById" resultType="com.jeeplus.finance.contractRegistration.domain.ContractFile">
+        select * from cw_work_contract_file where id = #{id}
+    </select>
+    <select id="getInfoById" resultType="com.jeeplus.finance.contractRegistration.domain.ContractInfo">
+        select * from cw_work_contract_info where id = #{id}
+    </select>
+    <select id="findChildIds" resultType="java.lang.String">
+        select id from sys_office where parent_id = #{department}
+    </select>
+    <select id="findFileInfoById" resultType="com.jeeplus.finance.contractRegistration.domain.ContractInfo">
+        select * from cw_work_contract_info where id = #{id}
+    </select>
+    <select id="getByClientId" resultType="com.jeeplus.finance.contractRegistration.domain.ContractInfo" parameterType="string">
+        select
+            cw_wci.contract_name,
+            cw_wci.id,
+            cw_wci.contract_no,
+            cw_wci.signing_date,
+            cw_wci.contract_amount,
+            cw_wci.department,
+            cw_wci.create_time,
+            cw_wci.create_by_id as create_id,
+            su.name as create_name,
+            so.name as department_name
+        from cw_work_contract_info cw_wci
+        left join sys_user su on su.id = cw_wci.create_by_id and su.del_flag = '0'
+        left join sys_office so on so.id = cw_wci.department and so.del_flag = '0'
+        ${ew.customSqlSegment}
+    </select>
+    <select id="getClientListByClientNo" resultType="string">
+        select
+            cw_wcp.contract_info_id
+        from cw_work_contract_participant cw_wcp
+        where cw_wcp.del_flag = '0' and cw_wcp.customer_no = #{no}
+    </select>
+
+    <select id="isUseByProject" resultType="string">
+        select
+            cw_wci.contract_name
+        from cw_project_records cw_pr
+        left join cw_work_contract_info cw_wci on cw_wci.id = cw_pr.contract_id and cw_wci.del_flag = '0'
+        where cw_pr.del_flag = '0' and cw_pr.contract_id = #{id}
+    </select>
+
+    <select id="isUseByReim" resultType="string">
+        select
+            cw_wci.contract_name
+        from cw_reimbursement_detail_info_contract cw_rdic
+        inner join cw_reimbursement_info cw_ri on cw_ri.id = cw_rdic.info_id and cw_ri.del_flag = '0'
+        left join cw_work_contract_info cw_wci on cw_wci.id = cw_rdic.contract_id and cw_wci.del_flag = '0'
+        where cw_rdic.del_flag = '0' and cw_rdic.contract_id = #{id}
+    </select>
+
+    <select id="isUseByInvoice" resultType="string">
+        select
+            cw_wci.contract_name
+        from cw_finance_invoice_base cw_fib
+        inner join cw_finance_invoice cw_fi on cw_fi.id = cw_fib.invoice_id and cw_fi.del_flag = '0'
+        left join cw_work_contract_info cw_wci on cw_wci.id = cw_fib.contract_id and cw_wci.del_flag = '0'
+        where cw_fib.del_flag = '0' and cw_fib.contract_id = #{id}
+    </select>
+</mapper>

+ 11 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/mapper/xml/ContractParticipantMapper.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.finance.contractRegistration.mapper.ContractParticipantMapper">
+    <delete id="deleteFromParticipant">
+        delete from cw_work_contract_participant where contract_info_id = #{InfoId}
+    </delete>
+    <select id="findByInfoId" resultType="com.jeeplus.finance.contractRegistration.domain.ContractParticipant">
+        select customer_name as customerName,customer_no as customerNo from cw_work_contract_participant
+        where contract_info_id = #{infoID}
+    </select>
+</mapper>

+ 77 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/mapper/xml/CwWorkContractBorrowMapper.xml

@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.finance.contractRegistration.mapper.CwWorkContractBorrowMapper">
+
+    <update id="updateStatusById">
+        UPDATE cw_work_contract_borrow SET borrow_type = #{borrowType} WHERE del_flag = 0 AND id = #{id}
+    </update>
+    <update id="updateStatusByContractInfoId">
+        UPDATE cw_work_contract_borrow SET borrow_type = #{borrowType} WHERE del_flag = 0 AND contract_info_id = #{id}
+    </update>
+    <update id="updateMessageByBorrowId">
+        UPDATE cw_work_contract_borrow_message SET borrow_type = #{borrowType}
+        <if test="type != null and type != ''">
+            ,ret_data = NOW()
+        </if>
+        WHERE del_flag = 0 AND contract_borrow_id = #{id} order by create_time desc limit 1
+    </update>
+    <update id="deleteMessageById">
+        UPDATE cw_work_contract_borrow_message SET del_flag = 1
+		WHERE del_flag = 0 AND contract_borrow_id = #{id} order by create_time desc limit 1
+    </update>
+    <select id="selectFileByContractInfoId"
+            resultType="com.jeeplus.finance.contractRegistration.domain.CwWorkContractBorrow">
+        SELECT * FROM `cw_work_contract_borrow` WHERE del_flag = 0 AND contract_info_id = #{id}
+    </select>
+    <select id="findMessageList"
+            resultType="com.jeeplus.finance.contractRegistration.domain.CwWorkContractBorrowMessage">
+        SELECT
+			id,
+			create_by_id,
+			create_time,
+			update_by_id,
+			update_time,
+			del_flag,
+			contract_borrow_id,
+			contract_name,
+			borrow_name,
+			DATE_FORMAT(borrow_data,'%Y-%m-%d') as borrow_data,
+			DATE_FORMAT(borrow_ret_data,'%Y-%m-%d') as borrow_ret_data,
+			borrow_type,
+			DATE_FORMAT( ret_data, '%Y-%m-%d' ) AS ret_data
+		 FROM cw_work_contract_borrow_message WHERE del_flag = 0 AND contract_borrow_id = #{id}
+		 order by create_time desc
+    </select>
+    <select id="selectByInfoId"
+            resultType="com.jeeplus.finance.contractRegistration.domain.CwWorkContractBorrow">
+        select * from cw_work_contract_borrow where contract_info_id = #{id}
+    </select>
+
+
+    <select id="getAdventMessageList" resultType="com.jeeplus.finance.contractRegistration.domain.CwWorkContractBorrowMessage">
+        SELECT
+			a.id,
+			a.create_by_id,
+			wci.create_by_id as "contractCreateById",
+			wcb.contract_info_id as "contractId",
+			wcb.proc_ins_id as "procInsId",
+			wcb.process_definition_id as "processDefinitionId",
+			a.create_time,
+			a.update_by_id,
+			a.update_time,
+			a.del_flag,
+			a.contract_borrow_id,
+			a.contract_name,
+			a.borrow_name,
+			DATE_FORMAT(a.borrow_data,'%Y-%m-%d') as borrow_data,
+			DATE_FORMAT(a.borrow_ret_data,'%Y-%m-%d') as borrow_ret_data,
+			a.borrow_type,
+			DATE_FORMAT( a.ret_data, '%Y-%m-%d' ) AS ret_data
+		 FROM cw_work_contract_borrow_message a
+		 left join cw_work_contract_borrow wcb on wcb.id = a.contract_borrow_id
+		 left join cw_work_contract_info wci on wci.id = wcb.contract_info_id
+		 WHERE a.del_flag = 0 and a.ret_data is null
+			and now() > date_add(a.borrow_ret_data,interval #{adventDay} day)
+		 order by a.create_time desc
+    </select>
+</mapper>

+ 210 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/service/ContractFilePaperService.java

@@ -0,0 +1,210 @@
+package com.jeeplus.finance.contractRegistration.service;
+
+import com.jeeplus.finance.contractRegistration.domain.ContractFilePaper;
+import com.jeeplus.finance.contractRegistration.domain.ContractInfo;
+import com.jeeplus.finance.contractRegistration.mapper.ContractFilePaperMapper;
+import com.jeeplus.finance.contractRegistration.mapper.ContractInfoMapper;
+import com.jeeplus.pubmodules.oss.domain.WorkAttachment;
+import com.jeeplus.pubmodules.oss.mapper.OssServiceMapper;
+import com.jeeplus.pubmodules.oss.service.OssService;
+import com.jeeplus.pubmodules.oss.service.dto.WorkAttachmentDto;
+import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.sys.utils.UserUtils;
+import org.flowable.editor.language.json.converter.util.CollectionUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.beans.BeanUtils;
+
+import javax.annotation.Resource;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+import java.util.UUID;
+
+/**
+ * @author: 王强
+ * @create: 2022-11-29 14:21
+ **/
+@Service
+public class ContractFilePaperService {
+
+    @Resource
+    private OssServiceMapper ossServiceMapper;
+
+    @Resource
+    private ContractFilePaperMapper mapper;
+
+    @Resource
+    private ContractInfoMapper infoMapper;
+
+    @Resource
+    private OssService ossService;
+
+    public String saveInfo(ContractFilePaper filePaper) throws Exception {
+
+        ContractFilePaper info = mapper.selectFilePaperByContractInfoId(filePaper.getId());
+        if (null != info) {
+            filePaper.setFileCreateName(filePaper.getCreateById());
+            filePaper.setCreateById(filePaper.getCreateId());
+            infoMapper.updatefiledPaperTypeById(info.getContractInfoId(),filePaper.getFiledPaperType());
+            return update(filePaper, info.getId());
+        }else {
+            return add(filePaper);
+        }
+    }
+
+    /**
+     * 根据id修改status
+     */
+    public void updateStatusById(ContractFilePaper filePaper) {
+        ContractInfo infoById = infoMapper.getInfoById(filePaper.getId());
+        if (null != infoById){
+            infoMapper.updatefiledPaperTypeById(filePaper.getId(),filePaper.getFiledPaperType());
+            mapper.updateStatusById(filePaper.getId(), filePaper.getFiledPaperType());
+        } else {
+            ContractFilePaper file = mapper.getById(filePaper.getId());
+            infoMapper.updatefiledPaperTypeById(file.getContractInfoId(),filePaper.getFiledPaperType());
+            mapper.updateStatusById(filePaper.getId(), filePaper.getFiledPaperType());
+        }
+
+    }
+
+    public ContractFilePaper findByContractInfoId(String id) {
+        return mapper.selectFilePaperByContractInfoId(id);
+    }
+
+    /**
+     * 合同登记纸质归档修改
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public String update(ContractFilePaper filePaper, String id) {
+        //获取当前登录人信息
+        UserDTO userDTO = UserUtils.getCurrentUserDTO();
+        ContractFilePaper file = new ContractFilePaper();
+        BeanUtils.copyProperties(filePaper, file);
+        file.setId(id);
+        file.setUpdateById(userDTO.getId());
+        file.setUpdateTime(new Date());
+        mapper.updateById(file);
+        List<WorkAttachmentDto> list = filePaper.getContractProperList();
+        if (CollectionUtils.isNotEmpty(list)) {
+            updateFiles(list, userDTO, file.getId(),filePaper.getContractInfoId());
+        }else {
+            //删除文件信息
+            mapper.deleteFileInfo(file.getId());
+        }
+        return file.getId();
+    }
+
+    /**
+     * 合同登记新增
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public String add(ContractFilePaper filePaper) throws Exception{
+        //获取当前登录人信息
+        UserDTO userDTO = UserUtils.getCurrentUserDTO();
+        String id = UUID.randomUUID().toString().replace("-", "");
+        ContractFilePaper file = new ContractFilePaper();
+        BeanUtils.copyProperties(filePaper, file);
+        file.setId(id);
+        file.setCreateById(userDTO.getId());
+        file.setCreateTime(filePaper.getCreateTime());
+        file.setUpdateById(userDTO.getId());
+        file.setUpdateTime(new Date());
+        mapper.insert(file);
+        ossService.saveOrUpdateFileList(filePaper.getContractProperList(),id,"cwWorkContract");
+//        List<WorkAttachmentDto> list = filePaper.getContractProperList();
+//        if (CollectionUtils.isNotEmpty(list)) {
+//            saveFiles(list, userDTO, id);
+//        }
+        return id;
+    }
+
+    /**
+     * 修改附件信息
+     * @param list 待修改的附件列表
+     * @param userDTO 当前登录用户
+     * @param id 关联id
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public void updateFiles(List<WorkAttachmentDto> list, UserDTO userDTO, String id,String contractInfoId) {
+        int j = 1;
+        String names = new String();
+        //表中存在,但是传过来不存在,说明已删除,表中数据也要删除
+        for (WorkAttachmentDto dto : list) {
+            names = names + "," +dto.getUrl();
+        }
+        //查询保存的附件信息
+        List<WorkAttachment> infoList = mapper.findList(id);
+        if (CollectionUtils.isNotEmpty(infoList)) {
+            for (WorkAttachment i : infoList) {
+                if (!names.contains(i.getUrl())) {
+                    ossServiceMapper.deleteById(i.getId());
+                }
+            }
+        }
+        //保存信息
+        for (WorkAttachmentDto dto : list) {
+            //判断是否存在
+            Integer isExit = mapper.findIsExit(id, contractInfoId, dto.getName());
+            if (isExit == 0) {
+                WorkAttachment i = new WorkAttachment();
+                //包含了url、size、name
+                i.setId(UUID.randomUUID().toString().replace("-", ""));
+//                i.getCreateBy().setId(userDTO.getId());
+                i.setCreateTime(new Date());
+//                i.getUpdateBy().setId(userDTO.getId());
+                i.setUpdateTime(new Date());
+                i.setDelFlag(0);
+                i.setUrl(dto.getUrl());
+                //文件类型处理
+                List<String> strings = Arrays.asList(dto.getName().split("\\."));
+                if (CollectionUtils.isNotEmpty(strings)) {
+                    i.setType(strings.get(1));
+                }
+                i.setAttachmentId(id);
+                i.setAttachmentName(dto.getName());
+                i.setAttachmentFlag("cwWorkContract");
+                i.setFileSize(dto.getSize());
+                i.setSort(j);
+                ossServiceMapper.insertWorkAttachment(i, userDTO);
+                j++;
+            }
+        }
+    }
+
+    /**
+     * 保存附件信息
+     * @param list 待保存的附件列表
+     * @param userDTO 当前登录用户
+     * @param id 关联id
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public void saveFiles(List<WorkAttachmentDto> list, UserDTO userDTO, String id) {
+        int j = 1;
+        for (WorkAttachmentDto dto : list) {
+            WorkAttachment i = new WorkAttachment();
+            //包含了url、size、name
+            i.setId(UUID.randomUUID().toString().replace("-", ""));
+//            i.getCreateBy().setId(userDTO.getId());
+            i.setCreateTime(new Date());
+//            i.getUpdateBy().setId(userDTO.getId());
+            i.setUpdateTime(new Date());
+            i.setDelFlag(0);
+            i.setUrl(dto.getUrl());
+            //文件类型处理
+            List<String> strings = Arrays.asList(dto.getName().split("\\."));
+            if (CollectionUtils.isNotEmpty(strings)) {
+                i.setType(strings.get(1));
+            }
+            i.setAttachmentId(id);
+            i.setAttachmentName(dto.getName());
+            i.setAttachmentFlag("cwWorkContract");
+            i.setFileSize(dto.getSize());
+            i.setSort(j);
+            ossServiceMapper.insertWorkAttachment(i, userDTO);
+            j++;
+        }
+    }
+
+}

+ 232 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/service/ContractFileService.java

@@ -0,0 +1,232 @@
+package com.jeeplus.finance.contractRegistration.service;
+
+import com.jeeplus.finance.contractRegistration.domain.ContractFile;
+import com.jeeplus.finance.contractRegistration.domain.ContractInfo;
+import com.jeeplus.finance.contractRegistration.mapper.ContractFileMapper;
+import com.jeeplus.finance.contractRegistration.mapper.ContractInfoMapper;
+import com.jeeplus.pubmodules.oss.domain.WorkAttachment;
+import com.jeeplus.pubmodules.oss.mapper.OssServiceMapper;
+import com.jeeplus.pubmodules.oss.service.dto.WorkAttachmentDto;
+import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.sys.utils.UserUtils;
+import org.flowable.editor.language.json.converter.util.CollectionUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+import java.util.UUID;
+
+/**
+ * @author: 王强
+ * @create: 2022-11-10 16:12
+ **/
+@Service
+public class ContractFileService {
+
+    @Resource
+    private ContractFileMapper mapper;
+
+    @Resource
+    private ContractInfoMapper infoMapper;
+
+    @Resource
+    private OssServiceMapper ossServiceMapper;
+
+    /**
+     * 根据id修改status
+     */
+    public void updateStatusById(ContractFile contractFile) {
+        ContractInfo infoById = infoMapper.getInfoById(contractFile.getId());
+        if (null != infoById){
+            infoMapper.updatefiledTypeById(contractFile.getId(),contractFile.getFiledType());
+            mapper.updateStatusById(contractFile.getId(), contractFile.getFiledType());
+        } else {
+            ContractFile file = mapper.getById(contractFile.getId());
+            infoMapper.updatefiledTypeById(file.getContractInfoId(),contractFile.getFiledType());
+            mapper.updateStatusById(contractFile.getId(), contractFile.getFiledType());
+        }
+
+    }
+
+    public String saveInfo(ContractFile contractFile) throws Exception {
+//        if (StringUtils.isNotEmpty(contractFile.getId())) {
+//
+//        }
+        ContractFile info = mapper.selectFileByContractInfoId(contractFile.getId());
+        if (null != info) {
+            contractFile.setFileCreateName(contractFile.getCreateById());
+            contractFile.setCreateById(contractFile.getCreateId());
+            infoMapper.updatefiledTypeById(info.getContractInfoId(),contractFile.getFiledType());
+            return update(contractFile, info.getId());
+        }else {
+            return add(contractFile);
+        }
+    }
+
+    /**
+     * 合同登记新增
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public String add(ContractFile contractFile) throws Exception{
+        //获取当前登录人信息
+        UserDTO userDTO = UserUtils.getCurrentUserDTO();
+        String id = UUID.randomUUID().toString().replace("-", "");
+        ContractFile file = new ContractFile();
+        BeanUtils.copyProperties(contractFile, file);
+        file.setId(id);
+        file.setCreateById(userDTO.getId());
+        file.setCreateTime(new Date());
+        file.setUpdateById(userDTO.getId());
+        file.setUpdateTime(new Date());
+        mapper.insert(file);
+        List<WorkAttachmentDto> list = contractFile.getContractInfoList();
+        if (CollectionUtils.isNotEmpty(list)) {
+            saveFiles(list, userDTO, id);
+        }
+        return id;
+    }
+
+    /**
+     * 合同登记归档修改
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public String update(ContractFile contractFile, String id) {
+        //获取当前登录人信息
+        UserDTO userDTO = UserUtils.getCurrentUserDTO();
+        ContractFile file = new ContractFile();
+        BeanUtils.copyProperties(contractFile, file);
+        file.setId(id);
+        file.setUpdateById(userDTO.getId());
+        file.setUpdateTime(new Date());
+        mapper.updateById(file);
+        List<WorkAttachmentDto> list = contractFile.getContractInfoList();
+        if (CollectionUtils.isNotEmpty(list)) {
+            updateFiles(list, userDTO, file.getId());
+        }else {
+            //删除文件信息
+            mapper.deleteFileInfo(file.getId());
+        }
+        return file.getId();
+    }
+
+    public ContractFile findById(String id) {
+        ContractFile dto = mapper.findById(id);
+        if (dto == null){
+            dto = mapper.findByInfoId(id);
+        }
+        if (dto != null){
+            // 查询归档附件信息
+            List<WorkAttachmentDto> dtos = mapper.findDtos(dto.getFileId());
+            List<WorkAttachmentDto> contractInfoList = mapper.findDtos(dto.getContractInfoId());
+
+            if (CollectionUtils.isNotEmpty(dtos)) {
+                for (WorkAttachmentDto i : dtos) {
+                    i.setCreateBy(UserUtils.get(i.getBy()));
+                }
+                dto.setContractInfoList(dtos);
+            }
+            if (CollectionUtils.isNotEmpty(contractInfoList)){
+                for (WorkAttachmentDto i : contractInfoList){
+                    i.setCreateBy(UserUtils.get(i.getBy()));
+                }
+                dto.setContractProperList(contractInfoList);
+            }
+
+        }
+        return dto;
+    }
+
+    public ContractFile findByContractInfoId(String id) {
+        return mapper.selectFileByContractInfoId(id);
+    }
+
+    /**
+     * 修改附件信息
+     * @param list 待修改的附件列表
+     * @param userDTO 当前登录用户
+     * @param id 关联id
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public void updateFiles(List<WorkAttachmentDto> list, UserDTO userDTO, String id) {
+        int j = 1;
+        String names = new String();
+        //表中存在,但是传过来不存在,说明已删除,表中数据也要删除
+        for (WorkAttachmentDto dto : list) {
+            names = names + "," +dto.getUrl();
+        }
+        //查询保存的附件信息
+        List<WorkAttachment> infoList = mapper.findList(id);
+        if (CollectionUtils.isNotEmpty(infoList)) {
+            for (WorkAttachment i : infoList) {
+                if (!names.contains(i.getUrl())) {
+                    ossServiceMapper.deleteById(i.getId());
+                }
+            }
+        }
+        //保存信息
+        for (WorkAttachmentDto dto : list) {
+            //判断是否存在
+            Integer isExit = mapper.findIsExit(id, dto.getName());
+            if (isExit == 0) {
+                WorkAttachment i = new WorkAttachment();
+                //包含了url、size、name
+                i.setId(UUID.randomUUID().toString().replace("-", ""));
+//                i.getCreateBy().setId(userDTO.getId());
+                i.setCreateTime(new Date());
+//                i.getUpdateBy().setId(userDTO.getId());
+                i.setUpdateTime(new Date());
+                i.setDelFlag(0);
+                i.setUrl(dto.getUrl());
+                //文件类型处理
+                List<String> strings = Arrays.asList(dto.getName().split("\\."));
+                if (CollectionUtils.isNotEmpty(strings)) {
+                    i.setType(strings.get(1));
+                }
+                i.setAttachmentId(id);
+                i.setAttachmentName(dto.getName());
+                i.setAttachmentFlag("cwWorkContract");
+                i.setFileSize(dto.getSize());
+                i.setSort(j);
+                ossServiceMapper.insertWorkAttachment(i, userDTO);
+                j++;
+            }
+        }
+    }
+    /**
+     * 保存附件信息
+     * @param list 待保存的附件列表
+     * @param userDTO 当前登录用户
+     * @param id 关联id
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public void saveFiles(List<WorkAttachmentDto> list, UserDTO userDTO, String id) {
+        int j = 1;
+        for (WorkAttachmentDto dto : list) {
+            WorkAttachment i = new WorkAttachment();
+            //包含了url、size、name
+            i.setId(UUID.randomUUID().toString().replace("-", ""));
+//            i.getCreateBy().setId(userDTO.getId());
+            i.setCreateTime(new Date());
+//            i.getUpdateBy().setId(userDTO.getId());
+            i.setUpdateTime(new Date());
+            i.setDelFlag(0);
+            i.setUrl(dto.getUrl());
+            //文件类型处理
+            List<String> strings = Arrays.asList(dto.getName().split("\\."));
+            if (CollectionUtils.isNotEmpty(strings)) {
+                i.setType(strings.get(1));
+            }
+            i.setAttachmentId(id);
+            i.setAttachmentName(dto.getName());
+            i.setAttachmentFlag("cwWorkContract");
+            i.setFileSize(dto.getSize());
+            i.setSort(j);
+            ossServiceMapper.insertWorkAttachment(i, userDTO);
+            j++;
+        }
+    }
+}

+ 738 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/service/ContractInfoService.java

@@ -0,0 +1,738 @@
+package com.jeeplus.finance.contractRegistration.service;
+
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.util.ObjectUtil;
+import com.alibaba.druid.sql.visitor.functions.If;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+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.core.domain.BaseEntity;
+import com.jeeplus.finance.contractRegistration.domain.ContractFile;
+import com.jeeplus.finance.contractRegistration.domain.ContractFilePaper;
+import com.jeeplus.finance.contractRegistration.domain.ContractInfo;
+import com.jeeplus.finance.contractRegistration.domain.ContractParticipant;
+import com.jeeplus.finance.contractRegistration.mapper.ContractFileMapper;
+import com.jeeplus.finance.contractRegistration.mapper.ContractFilePaperMapper;
+import com.jeeplus.finance.contractRegistration.mapper.ContractInfoMapper;
+import com.jeeplus.finance.contractRegistration.mapper.ContractParticipantMapper;
+import com.jeeplus.finance.workClientInfo.domain.CwWorkClientBase;
+import com.jeeplus.finance.workClientInfo.service.CwWorkClientService;
+import com.jeeplus.finance.workClientInfo.service.dto.CwWorkClientBaseDTO;
+import com.jeeplus.pubmodules.oss.domain.WorkAttachment;
+import com.jeeplus.pubmodules.oss.mapper.OssServiceMapper;
+import com.jeeplus.pubmodules.oss.service.OssService;
+import com.jeeplus.pubmodules.oss.service.dto.WorkAttachmentDto;
+import com.jeeplus.pubmodules.serialNumTpl.service.SerialnumTplService;
+import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.sys.utils.UserUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.flowable.editor.language.json.converter.util.CollectionUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * @author: 王强
+ * @create: 2022-11-08 10:50
+ **/
+@Service
+public class ContractInfoService {
+
+    @Resource
+    private ContractInfoMapper mapper;
+
+    @Resource
+    private SerialnumTplService serialnumTplService;
+
+    @Resource
+    private OssServiceMapper ossServiceMapper;
+
+    @Resource
+    private ContractFileMapper fileMapper;
+
+    @Resource
+    private ContractFilePaperMapper paperMapper;
+
+    @Resource
+    private ContractParticipantMapper participantMapper;
+
+    @Resource
+    private CwWorkClientService cwWorkClientService;
+
+    @Resource
+    private OssService ossService;
+
+    /**
+     * 根据id修改status
+     */
+    public void updateStatusById(ContractInfo info) {
+        mapper.updateStatusById(info.getId(), info.getStatus());
+    }
+    /**
+     * 根据id修改合同实际金额
+     */
+    public void updateInfo(ContractInfo info) {
+        mapper.updateInfo(info.getId(), info.getActualContractAmount(),info.getContractApprovalType(),info.getFiledType());
+    }
+
+    /**
+     * 根据id修改合同实际金额
+     */
+    public void updatePaperInfo(ContractInfo info) {
+        mapper.updatePaperInfo(info.getId(), info.getActualContractAmount(),info.getContractApprovalType(), info.getFiledPaperType());
+        List<WorkAttachmentDto> list = info.getContractInfoList();
+        UserDTO userDTO = UserUtils.getCurrentUserDTO();
+        if (CollectionUtils.isNotEmpty(list)) {
+            updateFiles(list, userDTO, info.getId());
+        }
+    }
+
+    public IPage<ContractInfo> list(Page<ContractInfo> page, ContractInfo info, QueryWrapper<ContractInfo> wrapper) {
+//        LambdaQueryWrapper<ContractInfo> wrapper = new LambdaQueryWrapper<>();
+
+        //条件查询list
+        //1、合同编号
+        if (StringUtils.isNotBlank(info.getContractNo())) {
+            wrapper.like("a.contract_no", info.getContractNo());
+        }
+        //案卷号
+        if (StringUtils.isNotBlank(info.getFiledNo())) {
+            wrapper.like("h.filed_no", info.getFiledNo());
+        }
+        //2、合同名称
+        if (StringUtils.isNotBlank(info.getContractName())) {
+            wrapper.like("a.contract_name", info.getContractName());
+        }
+        //3、合同金额(区间)
+        String[] contractAmounts = info.getContractAmounts();
+        if (contractAmounts != null) {
+            if (StringUtils.isNotBlank(contractAmounts[0])) {
+                wrapper.ge("a.contract_amount",contractAmounts[0]);
+            }
+            if (StringUtils.isNotBlank(contractAmounts[1])) {
+                wrapper.le("a.contract_amount", contractAmounts[1]);
+            }
+        }
+        //4、签约时间(区间)
+        String[] contractDates = info.getContractDates();
+        if (contractDates != null) {
+
+            wrapper.between("a.signing_date", contractDates[0], contractDates[1]);
+        }
+        //5、创建人
+        if (StringUtils.isNotBlank(info.getCreateBy())) {
+            wrapper.like("c.`id`", info.getCreateBy());
+        }
+        //6、所属部门
+        if (StringUtils.isNotBlank(info.getDepartment())) {
+            //先根据id查出是否是父节点,是父节点则查出所有的子节点信息
+            List<String> childIds = mapper.findChildIds(info.getDepartment());
+            if ( null != childIds & childIds.size()>0){
+                childIds.add(info.getDepartment());
+                wrapper.in("a.department",childIds);
+            }else {
+                wrapper.eq("a.department", info.getDepartment());
+            }
+        }
+        //7、状态
+        //判断 状态是否包含 逗号
+        if(StringUtils.isNotBlank(info.getStatus())){
+            if (info.getStatus().contains(",")) {
+                List<String> statusList = Lists.newLinkedList();
+                statusList = Arrays.asList(info.getStatus().split(","));
+                wrapper.in("a.status", statusList);
+            }else{
+                wrapper.like("a.status", info.getStatus());
+            }
+        }
+        //8、归档状态
+        if (StringUtils.isNotBlank(info.getFiledType())) {
+            wrapper.like("a.filed_type", info.getFiledType());
+        }
+        //纸质归档
+        if (StringUtils.isNotBlank(info.getFiledPaperType())) {
+            wrapper.like("a.filed_paper_type", info.getFiledPaperType());
+        }
+        //委托方名称
+        if (StringUtils.isNotBlank(info.getClientContactsName())) {
+            wrapper.like("cw_wcb.name", info.getClientContactsName());
+        }
+        wrapper.eq("a.del_flag","0");
+
+
+        StringBuilder officeIds = new StringBuilder();
+        List<String> manageOfficeIdList= Lists.newArrayList();
+        UserDTO userDTO = UserUtils.getCurrentUserDTO();
+        //判定是否为会计所长
+        /*if(CommonUtils.haveRoleKjsz()){
+            //获取当前人管理的部门id
+            if(StringUtils.isNotBlank(userDTO.getManageOfficeIds())){
+                manageOfficeIdList = Arrays.asList(userDTO.getManageOfficeIds().split(","));
+            }else{
+                manageOfficeIdList.add(userDTO.getOfficeDTO().getId());
+            }
+            for (int i = 0; i <manageOfficeIdList.size(); i++){
+                officeIds.append("'").append(manageOfficeIdList.get(i)).append("'");
+                if(i < manageOfficeIdList.size()-1){
+                    officeIds.append(",");
+                }
+            }
+        }*/
+
+        IPage<ContractInfo> pageList = mapper.findPageList(page, officeIds.toString(), wrapper);
+
+        return pageList;
+    }
+
+    /**
+     * 合同登记查询
+     */
+    public ContractInfo findByContractId(String id) {
+
+        //根据id判断是file表的id,还是info表的id
+//        ContractFile byId = mapper.getById(id);
+//        ContractInfo dto = null;
+//        if (byId != null){
+//            dto = mapper.findByContractId(id);
+//        }else {
+//            dto = mapper.findById(id);
+//        }
+        ContractInfo dto = mapper.findById(id);
+        if (dto != null){
+            dto.setContractStatus("新创建");
+            // 查询附件信息
+            List<WorkAttachmentDto> dtos = mapper.findDtos(id);
+            if (CollectionUtils.isNotEmpty(dtos)) {
+                for (WorkAttachmentDto i : dtos) {
+                    i.setCreateBy(UserUtils.get(i.getBy()));
+                }
+            }
+            dto.setContractProperList(dtos);
+        }
+
+        return dto;
+    }
+
+    /**
+     * 合同登记查询
+     */
+    public ContractInfo findById(String id) {
+
+        ContractInfo dto = mapper.findById(id);
+        List<WorkAttachmentDto> fileList = Lists.newArrayList();
+
+        if (dto != null){
+            List<ContractParticipant> participant = participantMapper.findByInfoId(dto.getId());
+            dto.setContractStatus("新创建");
+            // 查询附件信息
+            List<WorkAttachmentDto> dtos = mapper.findDtos(id);
+            if (CollectionUtils.isNotEmpty(dtos)) {
+                for (WorkAttachmentDto i : dtos) {
+                    i.setCreateBy(UserUtils.get(i.getBy()));
+                }
+            }
+            fileList.addAll(dtos);
+            List<CwWorkClientBaseDTO> list = new ArrayList<>();
+            if (participant.size()>0){
+                participant.forEach(cw->{
+                    CwWorkClientBaseDTO baseDTO = new CwWorkClientBaseDTO();
+                    baseDTO.setName(cw.getCustomerName());
+                    baseDTO.setNo(cw.getCustomerNo());
+                    list.add(baseDTO);
+                });
+
+            }
+            //根据合同id去归档表查归档附件信息
+//            ContractFile file = fileMapper.getInfoByConId(dto.getId());
+//            if (null != file){
+//                //查归档附件信息
+//                List<WorkAttachmentDto> fileDtos = mapper.findDtos(file.getId());
+//                if (CollectionUtils.isNotEmpty(fileDtos)) {
+//                    for (WorkAttachmentDto i : fileDtos) {
+//                        i.setCreateBy(UserUtils.get(i.getBy()));
+//                    }
+//                    dto.setContractInfoList(fileDtos);
+//                }
+//            }
+            //根据合同id去纸质归档表查附件信息
+            ContractFilePaper filePaper = paperMapper.selectFilePaperByContractInfoId(id);
+            if (null != filePaper){
+                //查归档附件信息
+                List<WorkAttachmentDto> fileDtos = mapper.findDtos(filePaper.getId());
+                if (CollectionUtils.isNotEmpty(fileDtos)) {
+                    for (WorkAttachmentDto i : fileDtos) {
+                        i.setCreateBy(UserUtils.get(i.getBy()));
+                    }
+                    fileList.addAll(fileDtos);
+                    //dto.setContractInfoList(fileDtos);
+                }
+            }
+
+            dto.setCwWorkClientContactDTOList(list);
+            dto.setContractProperList(fileList);
+        } else {
+            //穿来的是归档的id
+            ContractFile infoByConId = fileMapper.getById(id);
+            if ( null != infoByConId) {
+                dto = mapper.findById(infoByConId.getContractInfoId());
+                if (null != dto) {
+                    List<ContractParticipant> participant = participantMapper.findByInfoId(dto.getId());
+                    dto.setContractStatus("新创建");
+                    // 查询附件信息
+                    List<WorkAttachmentDto> dtos = mapper.findDtos(dto.getId());
+                    if (CollectionUtils.isNotEmpty(dtos)) {
+                        for (WorkAttachmentDto i : dtos) {
+                            i.setCreateBy(UserUtils.get(i.getBy()));
+                        }
+                    }
+                    fileList.addAll(dtos);
+                    List<CwWorkClientBaseDTO> list = new ArrayList<>();
+                    if (participant.size()>0){
+                        participant.forEach(cw->{
+                            CwWorkClientBaseDTO baseDTO = new CwWorkClientBaseDTO();
+                            baseDTO.setName(cw.getCustomerName());
+                            baseDTO.setNo(cw.getCustomerNo());
+                            list.add(baseDTO);
+                        });
+
+                    }
+                    if (null != infoByConId){
+                        //查归档附件信息
+                        List<WorkAttachmentDto> fileDtos = mapper.findDtos(id);
+                        if (CollectionUtils.isNotEmpty(fileDtos)) {
+                            for (WorkAttachmentDto i : fileDtos) {
+                                i.setCreateBy(UserUtils.get(i.getBy()));
+                            }
+                            fileList.addAll(fileDtos);
+                            //dto.setContractInfoList(fileDtos);
+                        }
+                    }
+
+                    dto.setCwWorkClientContactDTOList(list);
+                    dto.setContractProperList(fileList);
+                }
+            } else {
+                //传过来的是纸质归档的id
+                ContractFilePaper filePaper = paperMapper.getById(id);
+                if ( null != filePaper ) {
+                    dto = mapper.findById(filePaper.getContractInfoId());
+                    if (null != dto) {
+                        //参与签约方信息
+                        List<ContractParticipant> participant = participantMapper.findByInfoId(dto.getId());
+                        dto.setContractStatus("新创建");
+                        // 查询合同登记附件信息
+                        List<WorkAttachmentDto> dtos = mapper.findDtos(dto.getId());
+                        if (CollectionUtils.isNotEmpty(dtos)) {
+                            for (WorkAttachmentDto i : dtos) {
+                                i.setCreateBy(UserUtils.get(i.getBy()));
+                            }
+                        }
+                        fileList.addAll(dtos);
+                        List<CwWorkClientBaseDTO> list = new ArrayList<>();
+                        if (participant.size()>0){
+                            participant.forEach(cw->{
+                                CwWorkClientBaseDTO baseDTO = new CwWorkClientBaseDTO();
+                                baseDTO.setName(cw.getCustomerName());
+                                baseDTO.setNo(cw.getCustomerNo());
+                                list.add(baseDTO);
+                            });
+
+                        }
+                        //查归档附件信息
+                        List<WorkAttachmentDto> fileDtos = mapper.findDtos(filePaper.getId());
+                        if (CollectionUtils.isNotEmpty(fileDtos)) {
+                            for (WorkAttachmentDto i : fileDtos) {
+                                i.setCreateBy(UserUtils.get(i.getBy()));
+                            }
+                            fileList.addAll(fileDtos);
+                            //dto.setContractInfoList(fileDtos);
+                        }
+//                        //估计合同登记id查出归档信息
+//                        ContractFile contractFile = fileMapper.getInfoByConId(dto.getId());
+//                        if (null != contractFile){
+//                            //查归档附件信息
+//                            List<WorkAttachmentDto> fileDtos = mapper.findDtos(contractFile.getId());
+//                            if (CollectionUtils.isNotEmpty(fileDtos)) {
+//                                for (WorkAttachmentDto i : fileDtos) {
+//                                    i.setCreateBy(UserUtils.get(i.getBy()));
+//                                }
+//                                dto.setContractInfoList(fileDtos);
+//                            }
+//                        }
+
+                        dto.setCwWorkClientContactDTOList(list);
+                        dto.setContractProperList(fileList);
+                    }
+                }
+            }
+        }
+
+        return dto;
+    }
+
+    /**
+     * 合同登记查询附件信息
+     */
+    public ContractInfo findFileInfoById(String id) {
+
+        ContractInfo dto = mapper.findFileInfoById(id);
+
+        if (dto != null){
+            List<ContractParticipant> participant = participantMapper.findByInfoId(dto.getId());
+            dto.setContractStatus("新创建");
+            // 查询附件信息
+            List<WorkAttachmentDto> dtos = mapper.findDtos(id);
+            if (CollectionUtils.isNotEmpty(dtos)) {
+                for (WorkAttachmentDto i : dtos) {
+                    i.setCreateBy(UserUtils.get(i.getBy()));
+                }
+            }
+            List<CwWorkClientBaseDTO> list = new ArrayList<>();
+            if (participant.size()>0){
+                participant.forEach(cw->{
+                    CwWorkClientBaseDTO baseDTO = new CwWorkClientBaseDTO();
+                    baseDTO.setName(cw.getCustomerName());
+                    baseDTO.setNo(cw.getCustomerNo());
+                    list.add(baseDTO);
+                });
+
+            }
+            //根据合同id去归档表查归档附件信息
+            ContractFile file = fileMapper.getInfoByConId(dto.getId());
+            if (null != file){
+                //查归档附件信息
+                List<WorkAttachmentDto> fileDtos = mapper.findDtos(file.getId());
+                if (CollectionUtils.isNotEmpty(fileDtos)) {
+                    for (WorkAttachmentDto i : fileDtos) {
+                        i.setCreateBy(UserUtils.get(i.getBy()));
+                    }
+                    dto.setContractInfoList(fileDtos);
+                }
+            }
+
+            dto.setCwWorkClientContactDTOList(list);
+            dto.setContractProperList(dtos);
+        }
+
+        return dto;
+    }
+
+    public String saveInfo(ContractInfo info) throws Exception {
+        info.setClientContacts(info.getCustomerId());
+        if (StringUtils.isNotEmpty(info.getId())) {
+            //对参与签约方进行处理  将参与签约方的客户编号 和 客户名称进行持久化
+            ContractInfo contractInfo = mapper.selectById(info.getId());
+            if (contractInfo != null) {
+                info.setCreateById(info.getCreateId());
+                return update(info);
+            }
+        }
+        return add(info);
+    }
+
+    /**
+     * 合同登记删除
+     */
+    public ResponseEntity removeById(String id) {
+        // 查询合同是否被引用 (项目、报销、发票)
+        // 查询合同是否被引用(项目)
+        String useByProject = mapper.isUseByProject(id);
+        String aa = mapper.isUseByReim(id);
+        String bb = mapper.isUseByInvoice(id);
+        if (StringUtils.isNotBlank(useByProject)) {
+            return ResponseEntity.ok ("合同: "+useByProject+" 被引用,不可删除");
+        }
+        // 查询合同是否被引用(报销)
+        String useByReim = mapper.isUseByReim(id);
+        if (StringUtils.isNotBlank(useByReim)) {
+            return ResponseEntity.ok ("合同: "+useByReim+" 被引用,不可删除");
+        }
+        // 查询合同是否被引用(发票)
+        String useByInvoice = mapper.isUseByInvoice(id);
+        if (StringUtils.isNotBlank(useByInvoice)) {
+            return ResponseEntity.ok ("合同: "+useByInvoice+" 被引用,不可删除");
+        }
+        mapper.deleteById(id);
+        return ResponseEntity.ok ("删除成功");
+    }
+
+    /**
+     * 合同登记修改
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public String update(ContractInfo info) throws Exception{
+        //获取当前登录人信息
+        UserDTO userDTO = UserUtils.getCurrentUserDTO();
+
+        ContractInfo contractInfo = new ContractInfo();
+        BeanUtils.copyProperties(info, contractInfo);
+        contractInfo.setUpdateById(userDTO.getId());
+        contractInfo.setUpdateTime(new Date());
+
+        //合同编号生成
+        String serialNum = "";
+        if (StringUtils.isNotBlank(contractInfo.getContractType()) && StringUtils.isBlank(contractInfo.getContractNo())){
+            if (contractInfo.getContractType().equals("1")){
+                serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER1);
+            } else if (contractInfo.getContractType().equals("2")) {
+                serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER2);
+            } else if (contractInfo.getContractType().equals("3")) {
+                serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER3);
+            } else if (contractInfo.getContractType().equals("4")) {
+                serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER4);
+            } else if (contractInfo.getContractType().equals("5")) {
+                serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER5);
+            } else if (contractInfo.getContractType().equals("6")) {
+                serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER6);
+            }
+            contractInfo.setContractNo(serialNum);
+        }
+
+        if (StringUtils.isNotEmpty(contractInfo.getStatus()) &&!contractInfo.getStatus().equals("5")){
+            int num = Integer.parseInt(contractInfo.getChangeNum()) + 1;
+            contractInfo.setChangeNum(num + "");
+        }else {
+            contractInfo.setChangeNum(contractInfo.getChangeNum());
+        }
+        //对管理员上传归档文件进行相关操作  归档修改
+        if (StringUtils.isNotEmpty(contractInfo.getFiledType()) && contractInfo.getFiledType().equals("5")){
+            //根据id找到归档表id
+            ContractFile contractFile = fileMapper.getInfoByConId(info.getId());
+            if ( null != contractFile) {
+                contractFile.setContractInfoList(info.getContractInfoList());
+                if (CollectionUtils.isNotEmpty(contractFile.getContractInfoList())){
+                    updateFiles(contractFile.getContractInfoList(), userDTO, contractFile.getId());
+                }
+            }
+        }
+
+        //纸质归档修改
+        ContractFilePaper filePaper = paperMapper.selectFilePaperByContractInfoId(info.getId());
+        if (null != filePaper) {
+            filePaper.setFiledNo(info.getFiledNo());
+            filePaper.setConfirmFiledNo(info.getConfirmFiledNo());
+            paperMapper.updateById(filePaper);
+        }
+
+        mapper.updateById(contractInfo);
+        ContractParticipant participant = new ContractParticipant();
+        //对参与签约方进行操作
+        participantMapper.deleteFromParticipant(info.getId());
+        //在操作前,清空之前的信息
+        if (info.getCwWorkClientContactDTOList() != null){
+            if (info.getCwWorkClientContactDTOList().size()>0){
+                info.getCwWorkClientContactDTOList().forEach(cw->{
+
+                    String parId = UUID.randomUUID().toString().replace("-", "");
+                    participant.setId(parId);
+                    participant.setContractInfoId(info.getId());
+                    participant.setCustomerName(cw.getName());
+                    participant.setCustomerNo(cw.getNo());
+                    participant.setCreateById(userDTO.getId());
+                    participant.setCreateTime(info.getCreateTime());
+                    participant.setUpdateById(userDTO.getId());
+                    participant.setUpdateTime(new Date());
+                    participantMapper.insert(participant);
+                });
+            }
+        }
+
+        List<WorkAttachmentDto> list = info.getContractProperList();
+        if (CollectionUtils.isNotEmpty(list)) {
+            updateFiles(list, userDTO, info.getId());
+        }
+
+        return info.getId();
+    }
+
+    /**
+     * 合同登记新增
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public String add(ContractInfo contractInfo) throws Exception{
+        //获取当前登录人信息
+        UserDTO userDTO = UserUtils.getCurrentUserDTO();
+        //合同流水号生成
+        String serialNumber = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.BIZ_CODE);
+        //合同编号生成
+        String serialNum = "";
+        if (StringUtils.isNotEmpty(contractInfo.getContractType())){
+            if (contractInfo.getContractType().equals("1")){
+                serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER1);
+            } else if (contractInfo.getContractType().equals("2")) {
+                serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER2);
+            } else if (contractInfo.getContractType().equals("3")) {
+                serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER3);
+            } else if (contractInfo.getContractType().equals("4")) {
+                serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER4);
+            } else if (contractInfo.getContractType().equals("5")) {
+                serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER5);
+            } else if (contractInfo.getContractType().equals("6")) {
+                serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER6);
+            }
+            contractInfo.setContractSerialNumber(serialNumber);
+        }
+        String id = UUID.randomUUID().toString().replace("-", "");
+        ContractInfo info = new ContractInfo();
+        BeanUtils.copyProperties(contractInfo, info);
+        info.setId(id);
+//        info.setNo(serialNum);
+        info.setContractNo(serialNum);
+        info.setCreateById(userDTO.getId());
+        info.setCreateTime(contractInfo.getCreateTime());
+        info.setUpdateById(userDTO.getId());
+        info.setUpdateTime(new Date());
+        mapper.insert(info);
+        //对参与签约方进行持久化
+        //对参与签约方进行操作
+        participantMapper.deleteFromParticipant(info.getId());
+        ContractParticipant participant = new ContractParticipant();
+        if (info.getCwWorkClientContactDTOList() != null){
+            if (info.getCwWorkClientContactDTOList().size()>0){
+                info.getCwWorkClientContactDTOList().forEach(cw->{
+                    String parId = UUID.randomUUID().toString().replace("-", "");
+                    participant.setId(parId);
+                    participant.setContractInfoId(id);
+                    participant.setCustomerName(cw.getName());
+                    participant.setCustomerNo(cw.getNo());
+                    participant.setCreateById(userDTO.getId());
+                    participant.setCreateTime(contractInfo.getCreateTime());
+                    participant.setUpdateById(userDTO.getId());
+                    participant.setUpdateTime(new Date());
+                    participantMapper.insert(participant);
+                });
+            }
+        }
+        ossService.saveOrUpdateFileList(contractInfo.getContractProperList(),id,"cwWorkContract");
+//        List<WorkAttachmentDto> list = contractInfo.getContractProperList();
+//        if (CollectionUtils.isNotEmpty(list)) {
+//            saveFiles(list, userDTO, id);
+//        }
+
+        return id;
+    }
+
+    /**
+     * 保存附件信息
+     * @param list 待保存的附件列表
+     * @param userDTO 当前登录用户
+     * @param id 关联id
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public void saveFiles(List<WorkAttachmentDto> list, UserDTO userDTO, String id) {
+        int j = 1;
+        for (WorkAttachmentDto dto : list) {
+            WorkAttachment i = new WorkAttachment();
+            //包含了url、size、name
+            i.setId(UUID.randomUUID().toString().replace("-", ""));
+//            i.getCreateBy().setId(userDTO.getId());
+            i.setCreateTime(new Date());
+//            i.getUpdateBy().setId(userDTO.getId());
+            i.setUpdateTime(new Date());
+            i.setDelFlag(0);
+            i.setUrl(dto.getUrl());
+            //文件类型处理
+            List<String> strings = Arrays.asList(dto.getName().split("\\."));
+            if (CollectionUtils.isNotEmpty(strings)) {
+                i.setType(strings.get(1));
+            }
+            i.setAttachmentId(id);
+            i.setAttachmentName(dto.getName());
+            i.setAttachmentFlag("cwWorkContract");
+            i.setFileSize(dto.getSize());
+            i.setSort(j);
+            ossServiceMapper.insertWorkAttachment(i, userDTO);
+            j++;
+        }
+    }
+
+    /**
+     * 修改附件信息
+     * @param list 待修改的附件列表
+     * @param userDTO 当前登录用户
+     * @param id 关联id
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public void updateFiles(List<WorkAttachmentDto> list, UserDTO userDTO, String id) {
+        int j = 1;
+        String names = new String();
+        //表中存在,但是传过来不存在,说明已删除,表中数据也要删除
+        for (WorkAttachmentDto dto : list) {
+            names = names + "," +dto.getUrl();
+        }
+        //查询保存的附件信息
+        List<WorkAttachment> infoList = mapper.findList(id);
+        if (CollectionUtils.isNotEmpty(infoList)) {
+            for (WorkAttachment i : infoList) {
+                if (!names.contains(i.getUrl())) {
+                    ossServiceMapper.deleteById(i.getId());
+                }
+            }
+        }
+        //保存信息
+        for (WorkAttachmentDto dto : list) {
+            //判断是否存在
+            Integer isExit = mapper.findIsExit(id, dto.getName());
+            if (isExit == 0) {
+                WorkAttachment i = new WorkAttachment();
+                //包含了url、size、name
+                i.setId(UUID.randomUUID().toString().replace("-", ""));
+//                i.getCreateBy().setId(userDTO.getId());
+                i.setCreateTime(new Date());
+//                i.getUpdateBy().setId(userDTO.getId());
+                i.setUpdateTime(new Date());
+                i.setDelFlag(0);
+                i.setUrl(dto.getUrl());
+                //文件类型处理
+                List<String> strings = Arrays.asList(dto.getName().split("\\."));
+                if (CollectionUtils.isNotEmpty(strings)) {
+                    i.setType(strings.get(1));
+                }
+                i.setAttachmentId(id);
+                i.setAttachmentName(dto.getName());
+                i.setAttachmentFlag("cwWorkContract");
+                i.setFileSize(dto.getSize());
+                i.setSort(j);
+                ossServiceMapper.insertWorkAttachment(i, userDTO);
+                j++;
+            }
+        }
+    }
+
+    public List<ContractInfo> getByClientId(String contractId, ContractInfo contractInfo){
+        if (StringUtils.isNotBlank(contractId)) {
+            CwWorkClientBase cwWorkClientBase = cwWorkClientService.getById(contractId);
+            if (ObjectUtil.isNotEmpty(cwWorkClientBase)) {
+                if (StringUtils.isNotBlank(cwWorkClientBase.getNo())) {
+                    List<String> ids = mapper.getClientListByClientNo(cwWorkClientBase.getNo());
+                    if (CollectionUtil.isNotEmpty(ids)){
+                        QueryWrapper<ContractInfo> queryWrapper = new QueryWrapper<>();
+                        queryWrapper.in("cw_wci.id",ids);
+                        queryWrapper.eq("cw_wci.del_flag","0");
+//                        queryWrapper.eq("cw_wci.status","5");  //  取消查询审核通过(status=5)的合同数据,只要求数据有效(del_flag=0)就可以
+                        queryWrapper.orderByDesc("cw_wci.create_time");
+                        if(ObjectUtil.isNotEmpty(contractInfo)){
+                            if(StringUtils.isNotBlank(contractInfo.getContractName())){
+                                queryWrapper.like("cw_wci.contract_name",contractInfo.getContractName());
+                            }
+                            if(StringUtils.isNotBlank(contractInfo.getContractNo())){
+                                queryWrapper.like("cw_wci.contract_no",contractInfo.getContractNo());
+                            }
+                        }
+                        return mapper.getByClientId(queryWrapper);
+                    }
+                }
+            }
+            return new ArrayList<>();
+        }
+        return new ArrayList<>();
+    }
+}

+ 303 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/service/CwWorkContractBorrowService.java

@@ -0,0 +1,303 @@
+package com.jeeplus.finance.contractRegistration.service;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.jeeplus.finance.contractRegistration.domain.CwWorkContractBorrow;
+import com.jeeplus.finance.contractRegistration.domain.CwWorkContractBorrowMessage;
+import com.jeeplus.finance.contractRegistration.mapper.ContractInfoMapper;
+import com.jeeplus.finance.contractRegistration.mapper.CwWorkContractBorrowMapper;
+import com.jeeplus.finance.contractRegistration.mapper.CwWorkContractBorrowMessageMapper;
+import com.jeeplus.finance.contractRegistration.service.dto.CwWorkContractBorrowDto;
+//先注释import com.jeeplus.flowable.model.MyNoticeList;
+//import com.jeeplus.flowable.service.MyNoticeService;
+import com.jeeplus.flowable.feign.IFlowableApi;
+import com.jeeplus.sys.service.UserService;
+import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.sys.utils.DictUtils;
+import com.jeeplus.sys.utils.UserUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.flowable.bpmn.model.FlowNode;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.beans.BeanUtils;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * @author: 王强
+ * @create: 2022-11-27 13:51
+ **/
+@Service
+public class CwWorkContractBorrowService {
+
+    @Resource
+    private CwWorkContractBorrowMapper borrowMapper;
+
+    @Resource
+    private CwWorkContractBorrowMessageMapper messageMapper;
+
+    @Resource
+    private ContractInfoMapper infoMapper;
+
+//先注释    @Resource
+//    private MyNoticeService myNoticeService;
+
+    @Resource
+    private IFlowableApi flowTaskService;
+
+    @Resource
+    private UserService userService;
+
+    public String saveInfo(CwWorkContractBorrowDto workContractBorrowDto) throws Exception {
+        if (StringUtils.isNotEmpty(workContractBorrowDto.getId())) {
+            CwWorkContractBorrow info = borrowMapper.selectById( workContractBorrowDto.getId());
+            if (info != null) {
+                infoMapper.updateBorrowTypeById(info.getContractInfoId(),workContractBorrowDto.getBorrowType());
+                return update(workContractBorrowDto, info.getContractInfoId());
+            }
+        }
+        return add(workContractBorrowDto);
+    }
+
+    /**
+     * 合同登记借用新增
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public String add(CwWorkContractBorrowDto workContractBorrowDto) throws Exception{
+        //获取当前登录人信息
+        UserDTO userDTO = UserUtils.getCurrentUserDTO();
+        String id = UUID.randomUUID().toString().replace("-", "");
+        CwWorkContractBorrow borrow = new CwWorkContractBorrow();
+        BeanUtils.copyProperties(workContractBorrowDto, borrow);
+        borrow.setId(id);
+        borrow.setCreateById(userDTO.getId());
+        borrow.setCreateTime(new Date());
+        borrow.setUpdateById(userDTO.getId());
+        borrow.setUpdateTime(new Date());
+        borrowMapper.insert(borrow);
+        //借用记录信息
+        this.saveMessage(workContractBorrowDto, id);
+        return id;
+    }
+
+    /**
+     * 合同登记修改
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public String update(CwWorkContractBorrowDto workContractBorrowDto, String id) {
+        //获取当前登录人信息
+        UserDTO userDTO = UserUtils.getCurrentUserDTO();
+        CwWorkContractBorrow borrow = new CwWorkContractBorrow();
+        BeanUtils.copyProperties(workContractBorrowDto, borrow);
+        borrow.setContractInfoId(id);
+        borrow.setUpdateById(userDTO.getId());
+        borrow.setUpdateTime(new Date());
+        borrowMapper.updateById(borrow);
+        //借用记录信息
+        this.saveMessage(workContractBorrowDto, workContractBorrowDto.getId());
+        return borrow.getId();
+    }
+    /**
+     * 根据id修改status
+     */
+    public void updateStatusById(CwWorkContractBorrowDto workContractBorrowDto) {
+        borrowMapper.updateStatusById(workContractBorrowDto.getId(), workContractBorrowDto.getBorrowType());
+    }
+
+    public void updateStatusByContractInfoId(CwWorkContractBorrowDto workContractBorrowDto) {
+        infoMapper.updateBorrowTypeById(workContractBorrowDto.getId(),workContractBorrowDto.getBorrowType());
+        borrowMapper.updateStatusByContractInfoId(workContractBorrowDto.getId(), workContractBorrowDto.getBorrowType());
+    }
+
+    public CwWorkContractBorrow findById(String id) {
+        CwWorkContractBorrow borrow = borrowMapper.selectById(id);
+        if (borrow == null) {
+            LambdaQueryWrapper<CwWorkContractBorrow> wrapper = new LambdaQueryWrapper<>();
+            wrapper.eq(CwWorkContractBorrow::getContractInfoId, id);
+            return borrowMapper.selectOne(wrapper);
+        }
+        return borrow;
+    }
+
+    public CwWorkContractBorrow findByContractInfoId(String id) {
+        return borrowMapper.selectFileByContractInfoId(id);
+    }
+
+    /**
+     * 借用记录保存
+     * @param workContractBorrowDto
+     * @param id
+     * @return
+     */
+    public void saveMessage (CwWorkContractBorrowDto workContractBorrowDto, String id) {
+        //保存借用信息
+        UserDTO userDTO = UserUtils.getCurrentUserDTO();
+        CwWorkContractBorrowMessage message = new CwWorkContractBorrowMessage();
+        BeanUtils.copyProperties(workContractBorrowDto, message);
+        String messageId = UUID.randomUUID().toString().replace("-", "");
+        message.setId(messageId);
+        message.setCreateById(userDTO.getId());
+        message.setCreateTime(new Date());
+        message.setUpdateById(userDTO.getId());
+        message.setUpdateTime(new Date());
+        message.setContractBorrowId(id);
+//        message.setBorrowType("3");
+        message.setBorrowType(workContractBorrowDto.getBorrowType());
+//        message.setRetData(workContractBorrowDto.getBorrowRetData());
+        messageMapper.insert(message);
+    }
+
+    /**
+     * 根据contractBorrowId修改borrowType
+     */
+    public void updateMessageByBorrowId(CwWorkContractBorrowDto workContractBorrowDto, String type) {
+        if ("reture".equals(type)) {
+            CwWorkContractBorrow borrow = borrowMapper.selectFileByContractInfoId(workContractBorrowDto.getId());
+            if (borrow != null) {
+                borrowMapper.updateMessageByBorrowId(borrow.getId(), workContractBorrowDto.getBorrowType(), type);
+            }
+        } else {
+            borrowMapper.updateMessageByBorrowId(workContractBorrowDto.getId(), workContractBorrowDto.getBorrowType(), null);
+        }
+    }
+
+    public void deleteById(String id) {
+        LambdaQueryWrapper<CwWorkContractBorrow> wrapper = new LambdaQueryWrapper<CwWorkContractBorrow>();
+        wrapper.eq(CwWorkContractBorrow::getContractInfoId, id);
+        CwWorkContractBorrow borrow = borrowMapper.selectOne(wrapper);
+        if (borrow != null) {
+            borrowMapper.deleteMessageById(borrow.getId());
+        }
+    }
+
+    public List<CwWorkContractBorrowMessage> findMessageList(String id) {
+        CwWorkContractBorrow borrow = findByContractInfoId(id);
+        if (borrow != null) {
+            return borrowMapper.findMessageList(borrow.getId());
+        }
+        return null;
+    }
+
+    /**
+     * 查询临期合同借用信息
+     * @return
+     */
+    public List<CwWorkContractBorrowMessage> getAdventMessageList() {
+        String adventDay = DictUtils.getDictLabel("advent_day", "cw_borrow_advent", "");
+        adventDay = "-" + adventDay;
+        List<CwWorkContractBorrowMessage> adventMessageList = borrowMapper.getAdventMessageList(adventDay);
+        if(null != adventMessageList && adventMessageList.size()>0){
+            for (CwWorkContractBorrowMessage info : adventMessageList) {
+                String taskName = null;
+                String titleStr = null;
+
+                //如果当前时间大于过期时间
+                //Date类的一个方法,如果info.getAdventDateDate()早于 new Date() 返回true,否则返回false
+                if(info.getBorrowRetData().before(new Date())){
+                    taskName = "合同【"+ info.getContractName()+"】借用已超期";
+                    titleStr = "合同【"+ info.getContractName()+"】借用已超期。超期时间:"+dateToString(info.getBorrowRetData()) +"。";
+                }else{
+                    taskName = "合同【"+ info.getContractName()+"】即将借用超期";
+                    titleStr = "合同【"+ info.getContractName()+"】即将借用超期。超期时间:"+dateToString(info.getBorrowRetData());
+                }
+
+
+                //计算两日期之间的天数
+                Integer interval = Integer.valueOf(this.getInterval(info.getBorrowRetData(), new Date()));
+                if(interval > 0){
+                    titleStr = titleStr + "已超期:" + interval + "天。请尽快归还";
+                }
+
+                Set<String> noticeUserSet = new HashSet<String>();
+                if(StringUtils.isNotBlank(info.getBorrowName())){
+                    UserDTO borrowUser = userService.getUserByName(info.getBorrowName());
+                    if(null != borrowUser && StringUtils.isNotBlank(borrowUser.getId())){
+                        noticeUserSet.add(borrowUser.getId());
+                    }
+                }
+                if(StringUtils.isNotBlank(info.getContractCreateById())){
+                    noticeUserSet.add(info.getContractCreateById());
+                }
+//先注释                List<String> noticeUserList = new ArrayList<String>(noticeUserSet);
+//                if(noticeUserList.size()>0){
+//                    MyNoticeList myNotice = new MyNoticeList();
+//                    myNotice.setCreateById("1");
+//                    myNotice.setCreateTime(new Date());
+//                    myNotice.setUpdateById("1");
+//                    myNotice.setUpdateTime(new Date());
+//                    myNotice.setDelFlag(0);
+//                    //根据procInsId获取taskId
+//                    String currentTask = flowTaskService.getTaskIdByprocInstId(info.getProcInsId());
+//                    myNotice.setTaskId(currentTask);
+//                    myNotice.setDefId(info.getProcessDefinitionId());
+//                    myNotice.setTitle(titleStr);
+//                    myNotice.setTaskName(taskName);
+//                    myNotice.setLink("结束");
+//                    myNotice.setType("0");
+//                    myNotice.setCreateUser("管理员");
+//                    myNotice.setCreateTime(new Date());
+//
+//                    for (String noticeUserId : noticeUserList) {
+//                        myNotice.setNoticeId(noticeUserId);
+//                        myNotice.setNoticeName(UserUtils.get(noticeUserId).getName());
+//                        //根据taskName和通知人 查询重复数量
+//                        MyNoticeList repetitionCountBymyNotice = myNoticeService.getRepetitionCountBymyNotice(myNotice);
+//                        if(null == repetitionCountBymyNotice){
+//                            // 生成id
+//                            String id = UUID.randomUUID().toString().replace("-", "");
+//                            myNotice.setId(id);
+//                            myNotice.setRepetitionCount(0);
+//                            myNoticeService.insertMyNotice(myNotice);
+//                        }else{
+//                            myNotice.setId(repetitionCountBymyNotice.getId());
+//                            myNotice.setRepetitionCount(repetitionCountBymyNotice.getRepetitionCount()+1);
+//                            myNoticeService.updateMyNotice(myNotice);
+//                        }
+//                    }
+//
+//                }
+            }
+        }
+        return null;
+    }
+
+
+    /**
+     * 计算两日期相差天数
+     * @param beginDate
+     * @param endDate
+     * @return
+     * @throws Exception
+     */
+    public String getInterval(Date beginDate, Date endDate){
+        long day = 0;
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
+        try {
+            if(beginDate != null){
+                String begin = sdf.format(beginDate);
+                beginDate  = sdf.parse(begin);
+            }
+            if(endDate!= null){
+                String end= sdf.format(endDate);
+                endDate= sdf.parse(end);
+            }
+        } catch (Exception e){
+            e.getMessage();
+        }
+        day = (endDate.getTime()-beginDate.getTime())/(24*60*60*1000);
+        return String.valueOf(day);
+    }
+    public static String dateToString(Date date) {
+        SimpleDateFormat sformat = new SimpleDateFormat("yyyy-MM-dd");//日期格式
+
+        // SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//24小时制
+        // SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");//12小时制
+
+        String s = sformat.format(date);
+
+        return s;
+    }
+
+}

+ 45 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/service/dto/CwWorkContractBorrowDto.java

@@ -0,0 +1,45 @@
+package com.jeeplus.finance.contractRegistration.service.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jeeplus.core.service.dto.BaseDTO;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author: 王强
+ * @create: 2022-11-27 14:00
+ **/
+@Data
+public class CwWorkContractBorrowDto extends BaseDTO {
+
+    private String contractInfoId;
+
+    private String procInsId;
+
+    private String processDefinitionId;
+
+    private String contractName;
+
+    private String contractNo;
+
+    private String clientName;
+
+    private String borrowName;
+
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date borrowData;
+
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date borrowRetData;
+
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date createDate;
+
+    private String remarks;
+
+    private String borrowType;
+
+    private String type;
+
+}

+ 385 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/controller/CwFinanceInvoiceController.java

@@ -0,0 +1,385 @@
+package com.jeeplus.finance.invoice.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.aop.demo.annotation.DemoMode;
+import com.jeeplus.common.excel.ExcelOptions;
+import com.jeeplus.common.excel.annotation.ExportMode;
+import com.jeeplus.common.utils.ResponseUtil;
+import com.jeeplus.finance.invoice.domain.CwFinanceInvoice;
+import com.jeeplus.finance.invoice.service.CwFinanceInvoiceService;
+import com.jeeplus.finance.invoice.service.dto.CwFinanceDTO;
+import com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceDTO;
+import com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceDetailDTO;
+import com.jeeplus.finance.invoice.util.EasyPoiUtil;
+import com.jeeplus.flowable.feign.IFlowableApi;
+import com.jeeplus.logging.annotation.ApiLog;
+import com.jeeplus.logging.constant.enums.LogTypeEnum;
+import com.jeeplus.sys.utils.DictUtils;
+import com.jeeplus.sys.utils.SpringContextHolder;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.log4j.Log4j2;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.lang.reflect.Field;
+import java.lang.reflect.Type;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+@Api("财务管理-发票")
+@RestController
+@RequestMapping(value = "/cw_finance/invoice")
+public class CwFinanceInvoiceController {
+
+    private static Logger log = LoggerFactory.getLogger(CwFinanceInvoiceController.class);
+
+    @Resource
+    private CwFinanceInvoiceService cwFinanceInvoiceService;
+
+    @Resource
+    private IFlowableApi flowTaskService;
+
+    /**
+     * 查询发票列表
+     * @param cwFinanceInvoiceDTO
+     * @param page
+     * @return
+     * @throws Exception
+     */
+    @ApiLog("查询发票列表")
+    @PreAuthorize("hasAuthority('cw_finance:invoice:list')")
+    @GetMapping("list")
+    public ResponseEntity<IPage<CwFinanceInvoiceDTO>> data(CwFinanceInvoiceDTO cwFinanceInvoiceDTO, Page<CwFinanceInvoiceDTO> page) throws Exception {
+        IPage<CwFinanceInvoiceDTO> result = new Page<CwFinanceInvoiceDTO>();
+        result = cwFinanceInvoiceService.findList (page, cwFinanceInvoiceDTO);
+        result.getRecords().stream().forEach(i -> {
+            // 发票申请
+            if (StringUtils.isNotBlank(i.getTaskId()) && StringUtils.isNotBlank(i.getStatus())) {
+                if ("2".equals(i.getStatus())) { // “审核中”的数据要获取数据审核人
+                    i.setAuditUserIds(flowTaskService.getTaskAuditUsers(i.getTaskId()));  // 获取数据审核人
+                }
+            }
+            // 发票作废
+            if (StringUtils.isNotBlank(i.getInvalidTaskId()) && StringUtils.isNotBlank(i.getStatus())) {
+                if ("6".equals(i.getStatus())) { // “审核中”的数据要获取数据审核人
+                    i.setAuditUserIdsInvalid(flowTaskService.getTaskAuditUsers(i.getInvalidTaskId()));  // 获取数据审核人
+                }
+            }
+        });
+        return ResponseEntity.ok (result);
+    }
+
+    /**
+     * 查询发票数据
+     * @param id
+     * @return
+     */
+    @ApiLog("查询发票数据")
+    @PreAuthorize ("hasAnyAuthority('cw_finance:invoice:view','cw_finance:invoice:add','cw_finance:invoice:edit')")
+    @GetMapping("queryById")
+    public ResponseEntity queryById(@RequestParam("id") String id) {
+        CwFinanceInvoiceDTO cwFinanceInvoiceDTO = cwFinanceInvoiceService.queryById ( id );
+        return ResponseEntity.ok (cwFinanceInvoiceDTO);
+    }
+
+    /**
+     * 查询发票号是否存在
+     * @param number
+     * @return
+     */
+    @ApiLog("查询发票号是否存在")
+    @GetMapping("queryByNumber")
+    public ResponseEntity queryByNumber(@RequestParam("number") String number, @RequestParam(value="id", required = false) String id) {
+        Boolean bool = cwFinanceInvoiceService.queryByNumber ( number, id );
+        return ResponseEntity.ok (bool);
+    }
+
+    /**
+     * 保存发票数据
+     * @param cwFinanceInvoiceDTO
+     * @return
+     */
+    @ApiLog(value = "修改/新增发票数据", type = LogTypeEnum.SAVE)
+    @PreAuthorize("hasAnyAuthority('cw_finance:invoice:add','cw_finance:invoice:edit')")
+    @PostMapping("save")
+    public ResponseEntity save(@Valid @RequestBody CwFinanceInvoiceDTO cwFinanceInvoiceDTO) throws Exception {
+        cwFinanceInvoiceService.saveInvoice(cwFinanceInvoiceDTO);
+        return ResponseEntity.ok ("操作成功");
+    }
+
+    /**
+     * 保存发票数据-流程
+     * @param cwFinanceInvoiceDTO
+     * @return
+     */
+    @ApiLog(value = "保存发票数据-流程", type = LogTypeEnum.SAVE)
+    @PreAuthorize("hasAnyAuthority('cw_finance:invoice:add','cw_finance:invoice:edit')")
+    @PostMapping("saveForm")
+    public ResponseEntity saveForm(@Valid @RequestBody CwFinanceInvoiceDTO cwFinanceInvoiceDTO) throws Exception {
+        CwFinanceInvoice cwFinanceInvoice = cwFinanceInvoiceService.saveForm(cwFinanceInvoiceDTO);
+        return ResponseUtil.newInstance().add("businessTable", "cw_finance_invoice")
+                .add("businessId", cwFinanceInvoice.getId())
+                .add("no", cwFinanceInvoice.getNo())
+                .ok ("操作成功");
+    }
+
+    /**
+     * 作废发票数据-流程
+     * @param cwFinanceInvoiceDTO
+     * @return
+     */
+    @ApiLog(value = "作废发票数据-流程", type = LogTypeEnum.SAVE)
+    @PreAuthorize("hasAnyAuthority('cw_finance:invoice:add','cw_finance:invoice:edit')")
+    @PostMapping("saveFormInvalid")
+    public ResponseEntity saveFormInvalid(@Valid @RequestBody CwFinanceInvoiceDTO cwFinanceInvoiceDTO) throws Exception {
+        String id = cwFinanceInvoiceService.saveFormInvalid(cwFinanceInvoiceDTO);
+        return ResponseUtil.newInstance().add("businessTable", "cw_finance_invoice_invalid").add("businessId", id).ok ("操作成功");
+    }
+
+    /**
+     * 根据发票作废数据的id查询发票id
+     * @param id
+     * @return
+     */
+    @GetMapping("queryIdByInvalidId")
+    @ApiOperation(value = "查询发票号是否存在")
+    public ResponseEntity<CwFinanceDTO> queryIdByInvalidId(@RequestParam String id) {
+        String businessId = cwFinanceInvoiceService.queryIdByInvalidId ( id );
+        CwFinanceDTO cwFinanceDTO = new CwFinanceDTO();
+        cwFinanceDTO.setBusinessId(businessId);
+        return ResponseEntity.ok(cwFinanceDTO);
+    }
+
+    /**
+     * 删除附件类型
+     * @param ids
+     * @return
+     */
+    @ApiLog(value = "删除附件类型", type = LogTypeEnum.SAVE)
+    @PreAuthorize ("hasAuthority('cw_finance:invoice:del')")
+    @DeleteMapping("delete")
+    public ResponseEntity delete(String ids) {
+        return cwFinanceInvoiceService.deleteByIds(ids);
+    }
+
+    /**
+     * 根据id修改状态值status
+     * @param dto
+     * @return
+     */
+    @ApiOperation(value = "根据id修改状态值status")
+    @PostMapping(value = "/updateStatusById")
+    public ResponseEntity<String> updateStatusById(@RequestBody CwFinanceInvoiceDTO dto) {
+        String s = cwFinanceInvoiceService.updateStatusById(dto);
+        return ResponseEntity.ok(s);
+    }
+
+    /**
+     * 确认收款
+     * @param dto
+     * @return
+     */
+    @ApiOperation(value = "确认收款")
+    @PostMapping(value = "/isReceivables")
+    public ResponseEntity<String> isReceivables(@RequestBody CwFinanceInvoiceDTO dto) {
+        String s = cwFinanceInvoiceService.isReceivables(dto);
+        return ResponseEntity.ok(s);
+    }
+
+    /**
+     * 下载发票明细导入模板
+     *
+     * @param response
+     * @return
+     */
+    @GetMapping("/importDetail/template")
+    @ApiOperation(value = "下载模板")
+    public void importFileTemplate(HttpServletResponse response, HttpServletRequest request) {
+        try {
+            InputStream inputStream = this.getClass().getResourceAsStream("/dot/发票明细导入模板.xlsx");
+            //强制下载不打开
+            response.setContentType("application/force-download");
+            OutputStream out = response.getOutputStream();
+            //使用URLEncoder来防止文件名乱码或者读取错误
+            response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode("finance_invoice_detail_template.xlsx", "UTF-8"));
+            int b = 0;
+            byte[] buffer = new byte[1000000];
+            while (b != -1) {
+                b = inputStream.read(buffer);
+                if (b != -1) out.write(buffer, 0, b);
+            }
+            inputStream.close();
+            out.close();
+            out.flush();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 导入发票明细数据
+     *
+     * @return
+     */
+    @DemoMode
+    @PostMapping("/importDetail")
+    @ApiLog(value = "导入发票明细数据excel", type = LogTypeEnum.IMPORT)
+    public ResponseEntity importDetail(MultipartFile file, HttpServletRequest request) throws IOException {
+
+        ArrayList<CwFinanceInvoiceDetailDTO> arrayList = new ArrayList<>();
+        HashMap<String,String> hashMap = new HashMap<>();
+
+        List<CwFinanceInvoiceDetailDTO> listA = new ArrayList<>();
+        //获取sheet
+        listA = EasyPoiUtil.importExcel(file, 0, 1, CwFinanceInvoiceDetailDTO.class);
+        //去除excel中的空行
+        listA = getExcelList(listA);
+        //导入前检测数据
+        String resultA = cwFinanceInvoiceService.importDecide(listA, arrayList, hashMap);
+        if(StringUtils.isNotBlank(resultA)){
+            //有返回值,说明导入的数据不正确。向用户抛提示
+            return ResponseEntity.badRequest().body  (resultA);
+        }
+        //判断文件中是否有重复的发票号
+        if(hashMap.size() != listA.size()){
+            return ResponseEntity.badRequest().body  ("文件中存在重复的发票号");
+        }
+
+        return ResponseEntity.ok(arrayList);
+    }
+
+    /**
+     * 去除excel中的空行
+     * @param list
+     * @return
+     */
+    public ArrayList<CwFinanceInvoiceDetailDTO> getExcelList(List<CwFinanceInvoiceDetailDTO> list){
+
+        ArrayList<CwFinanceInvoiceDetailDTO> cwFinanceInvoiceDetailDTOS = new ArrayList<>();
+
+        list.stream().forEach(item->{
+            if(objectCheckIsNull(item)){
+                cwFinanceInvoiceDetailDTOS.add(item);
+            }
+        });
+
+        return cwFinanceInvoiceDetailDTOS;
+    }
+
+    /**
+     * 根据项目id查询项目关联发票
+     * @param projectId
+     * @param cwFinanceInvoiceDTO
+     * @return
+     * @throws Exception
+     */
+    @GetMapping("getByIds")
+    @ApiOperation(value = "根据项目id查询项目关联发票")
+    public ResponseEntity<List<CwFinanceInvoiceDTO>> getByIds(String projectId,CwFinanceInvoiceDTO cwFinanceInvoiceDTO) throws Exception {
+        List<CwFinanceInvoiceDTO> cwFinanceDTO = cwFinanceInvoiceService.getByIds(projectId, cwFinanceInvoiceDTO);
+        return ResponseEntity.ok(cwFinanceDTO);
+    }
+
+    /**
+     * 根据合同id查询项目关联发票
+     * @param contractId
+     * @param cwFinanceInvoiceDTO
+     * @return
+     * @throws Exception
+     */
+    @GetMapping("getByContractId")
+    @ApiOperation(value = "根据合同id查询项目关联发票")
+    public ResponseEntity<List<CwFinanceInvoiceDTO>> getByContractId(String contractId,CwFinanceInvoiceDTO cwFinanceInvoiceDTO) throws Exception {
+        List<CwFinanceInvoiceDTO> cwFinanceDTO = cwFinanceInvoiceService.getByContractId(contractId, cwFinanceInvoiceDTO);
+        return ResponseEntity.ok(cwFinanceDTO);
+    }
+
+    /**
+     * 根据客户id查询项目关联发票
+     * @param clientId
+     * @param cwFinanceInvoiceDTO
+     * @return
+     * @throws Exception
+     */
+    @GetMapping("getIdByClientId")
+    @ApiOperation(value = "根据客户id查询项目关联发票")
+    public ResponseEntity<List<CwFinanceInvoiceDTO>> getIdByClientId(String clientId,CwFinanceInvoiceDTO cwFinanceInvoiceDTO) throws Exception {
+        List<CwFinanceInvoiceDTO> cwFinanceDTO = cwFinanceInvoiceService.getIdByClientId(clientId, cwFinanceInvoiceDTO);
+        return ResponseEntity.ok(cwFinanceDTO);
+    }
+
+    @ApiLog(value = "导出发票数据", type = LogTypeEnum.EXPORT)
+    @GetMapping("export")
+    //@PreAuthorize ("hasAuthority('cw_finance:invoice:export')")
+    @ApiOperation(value = "导出发票数据")
+    public void exportFile(CwFinanceInvoiceDTO cwFinanceInvoiceDTO, Page <CwFinanceInvoiceDTO> page, ExcelOptions options, HttpServletResponse response) throws Exception {
+        String fileName = options.getFilename();
+        String sheetName = options.getSheetName();
+        List<CwFinanceInvoiceDTO> result = new ArrayList<>();
+        if ( ExportMode.current.equals ( options.getMode() ) ) {
+            result = cwFinanceInvoiceService.findList (page,cwFinanceInvoiceDTO).getRecords();
+        } else if (ExportMode.selected.equals ( options.getMode() )) {
+            result = cwFinanceInvoiceService.findList (page,cwFinanceInvoiceDTO).getRecords().stream ( ).filter ( item ->
+                    options.getSelectIds ( ).contains ( item.getId ( ) )
+            ).collect ( Collectors.toList ( ) );
+        } else {
+            page.setSize (-1);
+            page.setCurrent (0);
+            result = cwFinanceInvoiceService.findList (page,cwFinanceInvoiceDTO).getRecords();
+        }
+        EasyPoiUtil.exportExcel ( result, sheetName,  sheetName, CwFinanceInvoiceDTO.class, fileName, response );
+
+    }
+
+    public static boolean objectCheckIsNull(Object object) {
+        boolean flag = false; //定义返回结果,默认为true
+
+        if (Objects.isNull(object)) {
+            flag = false;
+        } else {
+            Class clazz = (Class) object.getClass(); // 得到类对象
+            Field fields[] = clazz.getDeclaredFields(); // 得到所有属性
+            for (Field field : fields) {
+                if("serialVersionUID".equals(field.getName()) || "BIZ_CODE".equalsIgnoreCase(field.getName())){
+                    continue;
+                }
+                field.setAccessible(true);
+                Object fieldValue = null;
+                try {
+                    fieldValue = field.get(object); //得到属性值
+                    Type fieldType = field.getGenericType();//得到属性类型
+                    String fieldName = field.getName(); // 得到属性名
+                    log.info("属性类型:" + fieldType + ",属性名:" + fieldName + ",属性值:" + fieldValue);
+                } catch (IllegalArgumentException e) {
+                    log.error(e.getMessage(), e);
+                } catch (IllegalAccessException e) {
+                    log.error(e.getMessage(), e);
+                }
+                if (fieldValue != null && fieldValue != "") {  //只要有一个属性值不为null 就返回false 表示对象不为null
+                    flag = true;
+                    break;
+                }
+            }
+        }
+
+        return flag;
+    }
+}

+ 189 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/domain/CwFinanceInvoice.java

@@ -0,0 +1,189 @@
+package com.jeeplus.finance.invoice.domain;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import com.jeeplus.core.query.Query;
+import com.jeeplus.core.query.QueryType;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 财务管理-发票
+ * @TableName cw_finance_invoice
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@TableName("cw_finance_invoice")
+public class CwFinanceInvoice extends BaseEntity {
+
+    /**
+     * 备注信息
+     */
+    private String remarks;
+
+    /**
+     * 发票类型
+     */
+    @Query(tableColumn = "fi.type",type = QueryType.EQ)
+    private String type;
+
+    /**
+     * 发票申请编号
+     */
+    @Query(tableColumn = "fi.no",type = QueryType.LIKE)
+    private String no;
+
+    /**
+     * 开票类型
+     */
+    private String billingType;
+
+    /**
+     * 实际开票单位
+     */
+    @Query(tableColumn = "fi.billing_workplace_real",type = QueryType.LIKE)
+    private String billingWorkplaceReal;
+
+    /**
+     * 纳税人识别号
+     */
+    private String taxpayerIdentificationNo;
+
+    /**
+     * 地址
+     */
+    private String address;
+
+    /**
+     * 电话
+     */
+    private String telPhone;
+
+    /**
+     * 开户银行
+     */
+    private String openBank;
+
+    /**
+     * 银行账号
+     */
+    private String bankAccount;
+
+    /**
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 收款类型
+     */
+    @Query(tableColumn = "fi.receivables_type",type = QueryType.EQ)
+    private String receivablesType;
+
+    /**
+     * 开票内容
+     */
+    @Query(tableColumn = "fi.billing_content",type = QueryType.EQ)
+    private String billingContent;
+
+    /**
+     * 发票金额(元)
+     */
+    private String account;
+
+    /**
+     * 开票内容要求
+     */
+    private String billingContentTerms;
+
+    /**
+     * 开票人
+     */
+    private String billingPeople;
+
+    /**
+     * 开票时间
+     */
+    private Date billingDate;
+
+    /**
+     * 领票时间
+     */
+    private Date collectDate;
+
+    /**
+     * 实际开票人
+     */
+    private String billingPeopleReal;
+
+    /**
+     * 对账人
+     */
+    @Query(tableColumn = "fi.reconciliation_people",type = QueryType.EQ)
+    private String reconciliationPeople;
+
+    /**
+     * 实际开票单位id
+     */
+    @Query(tableColumn = "fi.billing_workplace_real_id",type = QueryType.EQ)
+    private String billingWorkplaceRealId;
+
+    /**
+     * 开票人id
+     */
+    private String billingPeopleId;
+
+    /**
+     * 对账地区
+     */
+    @Query(tableColumn = "fi.reconciliation_area",type = QueryType.EQ)
+    private String reconciliationArea;
+
+    /**
+     * 状态
+     */
+    @Query(tableColumn = "fi.status",type = QueryType.EQ)
+    private String status;
+
+    /**
+     * 流程id
+     */
+    private String procInsId;
+
+    /**
+     * 流程信息
+     */
+    private String processDefinitionId;
+
+    /**
+     * 是否确认收款
+     */
+    @Query(tableColumn = "fi.receivables_status",type = QueryType.EQ)
+    private String receivablesStatus;
+
+    /**
+     * 是否作废
+     */
+    @Query(tableColumn = "fi.invalid_status",type = QueryType.EQ)
+    private String invalidStatus;
+
+    /**
+     * 收款日期
+     */
+    private Date receivablesDate;
+
+    /**
+     * 是否多张开票  1是  0否
+     */
+    private String isMultiple;
+
+    /**
+     * 实际开票单位的开票信息id
+     */
+    private String billingId;
+
+    private static final long serialVersionUID = 1L;
+}

+ 52 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/domain/CwFinanceInvoiceBase.java

@@ -0,0 +1,52 @@
+package com.jeeplus.finance.invoice.domain;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 财务管理-发票基本信息
+ * @TableName cw_finance_invoice_base
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@TableName("cw_finance_invoice_base")
+public class CwFinanceInvoiceBase extends BaseEntity {
+
+    /**
+     * 发票id
+     */
+    private String invoiceId;
+
+    /**
+     * 项目id
+     */
+    private String programId;
+
+    /**
+     * 项目名称
+     */
+    private String programName;
+
+    /**
+     * 合同名称
+     */
+    private String contractName;
+
+    /**
+     * 项目编号
+     */
+    private String programNo;
+
+    /**
+     * 合同id
+     */
+    private String contractId;
+
+
+    private static final long serialVersionUID = 1L;
+}

+ 66 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/domain/CwFinanceInvoiceDetail.java

@@ -0,0 +1,66 @@
+package com.jeeplus.finance.invoice.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 财务管理-发票明细
+ * @TableName cw_finance_invoice_detail
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@TableName("cw_finance_invoice_detail")
+public class CwFinanceInvoiceDetail extends BaseEntity {
+
+    /**
+     * 备注信息
+     */
+    private String remarks;
+
+    /**
+     * 发票id
+     */
+    private String invoiceId;
+
+    /**
+     * 发票代码
+     */
+    private String code;
+
+    /**
+     * 发票号
+     */
+    private String number;
+
+    /**
+     * 开票金额(元)
+     */
+    private String account;
+
+    /**
+     * 税率
+     */
+    private String rate;
+
+    /**
+     * 金额
+     */
+    private String amount;
+
+    /**
+     * 税额
+     */
+    private String tax;
+
+    /**
+     * 累计登记金额
+     */
+    private String allAmount;
+
+    private static final long serialVersionUID = 1L;
+}

+ 46 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/domain/CwFinanceInvoiceInvalid.java

@@ -0,0 +1,46 @@
+package com.jeeplus.finance.invoice.domain;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 财务管理-发票-发票作废
+ * @TableName cw_finance_invoice_invalid
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@TableName("cw_finance_invoice_invalid")
+public class CwFinanceInvoiceInvalid extends BaseEntity {
+
+    /**
+     * 备注信息
+     */
+    private String remarks;
+
+    /**
+     * 发票id
+     */
+    private String invoiceId;
+
+    /**
+     * 是否作废
+     */
+    private String invalidStatus;
+
+    /**
+     * 流程id
+     */
+    private String procInsId;
+
+    /**
+     * 流程信息
+     */
+    private String processDefinitionId;
+
+    private static final long serialVersionUID = 1L;
+}

+ 51 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/domain/CwFinanceInvoiceReceivables.java

@@ -0,0 +1,51 @@
+package com.jeeplus.finance.invoice.domain;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 财务管理-发票-收款明细
+ * @TableName cw_finance_invoice_receivables
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@TableName("cw_finance_invoice_receivables")
+public class CwFinanceInvoiceReceivables extends BaseEntity {
+
+    /**
+     * 备注信息
+     */
+    private String remarks;
+
+    /**
+     * 发票id
+     */
+    private String invoiceId;
+
+    /**
+     * 汇款单位
+     */
+    private String remittanceUnit;
+
+    /**
+     * 汇款金额
+     */
+    private String remittanceAmount;
+
+    /**
+     * 汇款时间
+     */
+    private Date remittanceDate;
+
+    /**
+     * 是否收款
+     */
+    private String status;
+
+    private static final long serialVersionUID = 1L;
+}

+ 95 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/domain/SealUserInfo.java

@@ -0,0 +1,95 @@
+package com.jeeplus.finance.invoice.domain;
+
+import java.util.Date;
+
+/**
+ * 员工印章表
+ * @author: 徐滕
+ * @create: 2021-11-05 09:18
+ **/
+public class SealUserInfo {
+    private String id;  //印章ID
+    private String owner;   //公司ID
+    private String name;    //印章名称
+    private String otherName;   //印章别名
+    //private SealType type;    //签章类型
+    //private SealSpec spec;    //印章规格
+    private String sealKey; //印章图片key
+    private Date createTime; //创建时间
+    //private SealStatus status; //印章状态
+    private String useCount; //印章使用的次数
+    private String category; //印章类型:物理章,电子章
+    private String sealCategoryName; //印章分类名称
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getOwner() {
+        return owner;
+    }
+
+    public void setOwner(String owner) {
+        this.owner = owner;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getOtherName() {
+        return otherName;
+    }
+
+    public void setOtherName(String otherName) {
+        this.otherName = otherName;
+    }
+
+    public String getSealKey() {
+        return sealKey;
+    }
+
+    public void setSealKey(String sealKey) {
+        this.sealKey = sealKey;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getUseCount() {
+        return useCount;
+    }
+
+    public void setUseCount(String useCount) {
+        this.useCount = useCount;
+    }
+
+    public String getCategory() {
+        return category;
+    }
+
+    public void setCategory(String category) {
+        this.category = category;
+    }
+
+    public String getSealCategoryName() {
+        return sealCategoryName;
+    }
+
+    public void setSealCategoryName(String sealCategoryName) {
+        this.sealCategoryName = sealCategoryName;
+    }
+}

+ 14 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/CwFinanceInvoiceBaseMapper.java

@@ -0,0 +1,14 @@
+package com.jeeplus.finance.invoice.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.finance.invoice.domain.CwFinanceInvoiceBase;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface CwFinanceInvoiceBaseMapper extends BaseMapper<CwFinanceInvoiceBase> {
+
+}
+
+
+
+

+ 14 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/CwFinanceInvoiceDetailMapper.java

@@ -0,0 +1,14 @@
+package com.jeeplus.finance.invoice.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.finance.invoice.domain.CwFinanceInvoiceDetail;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface CwFinanceInvoiceDetailMapper extends BaseMapper<CwFinanceInvoiceDetail> {
+
+}
+
+
+
+

+ 14 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/CwFinanceInvoiceInvalidMapper.java

@@ -0,0 +1,14 @@
+package com.jeeplus.finance.invoice.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.finance.invoice.domain.CwFinanceInvoiceInvalid;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface CwFinanceInvoiceInvalidMapper extends BaseMapper<CwFinanceInvoiceInvalid> {
+
+}
+
+
+
+

+ 39 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/CwFinanceInvoiceMapper.java

@@ -0,0 +1,39 @@
+package com.jeeplus.finance.invoice.mapper;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Constants;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.finance.invoice.domain.CwFinanceInvoice;
+import com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceDTO;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface CwFinanceInvoiceMapper extends BaseMapper<CwFinanceInvoice> {
+
+    public IPage<CwFinanceInvoiceDTO> findList(Page<CwFinanceInvoiceDTO> page, @Param(Constants.WRAPPER) QueryWrapper<CwFinanceInvoice> queryWrapper, @Param("officeIds") String officeIds);
+
+    public CwFinanceInvoiceDTO queryById(@Param("id") String id);
+
+    public List<String> getIdByProjectId(@Param("id") String id);
+
+    public List<CwFinanceInvoiceDTO> getByIds(@Param(Constants.WRAPPER) QueryWrapper<CwFinanceInvoice> queryWrapper);
+
+    public List<String> getIdByContractId(@Param("id") String id);
+
+    public List<String> getIdByClientId(@Param("id") String id);
+
+    /**
+     * 根据发票id清空发票的收款日期
+     * @param id
+     */
+    void setReceivablesDateNull(@Param("id") String id);
+}
+
+
+
+

+ 14 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/CwFinanceInvoiceReceivablesMapper.java

@@ -0,0 +1,14 @@
+package com.jeeplus.finance.invoice.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.finance.invoice.domain.CwFinanceInvoiceReceivables;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface CwFinanceInvoiceReceivablesMapper extends BaseMapper<CwFinanceInvoiceReceivables> {
+
+}
+
+
+
+

+ 36 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/xml/CwFinanceInvoiceBaseMapper.xml

@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.finance.invoice.mapper.CwFinanceInvoiceBaseMapper">
+
+    <resultMap id="BaseResultMap" type="com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceBaseDTO">
+            <id property="id" column="id" jdbcType="VARCHAR"/>
+            <result property="createBy.id" column="create_by" jdbcType="VARCHAR"/>
+            <result property="createTime" column="create_date" jdbcType="TIMESTAMP"/>
+            <result property="updateBy.id" column="update_by" jdbcType="VARCHAR"/>
+            <result property="updateTime" column="update_date" jdbcType="TIMESTAMP"/>
+            <result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
+            <result property="invoiceId" column="invoice_id" jdbcType="VARCHAR"/>
+            <result property="programId" column="program_id" jdbcType="VARCHAR"/>
+            <result property="programName" column="program_name" jdbcType="VARCHAR"/>
+            <result property="contractName" column="contract_name" jdbcType="VARCHAR"/>
+            <result property="programNo" column="program_no" jdbcType="VARCHAR"/>
+            <result property="contractId" column="contract_id" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        fib.id,
+        fib.create_by,
+        fib.create_date,
+        fib.update_by,
+        fib.update_date,
+        fib.del_flag,
+        fib.invoice_id,
+        fib.program_id,
+        fib.program_name,
+        fib.contract_name,
+        fib.program_no,
+        fib.contract_id
+    </sql>
+</mapper>

+ 42 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/xml/CwFinanceInvoiceDetailMapper.xml

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.finance.invoice.mapper.CwFinanceInvoiceDetailMapper">
+
+    <resultMap id="BaseResultMap" type="com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceDetailDTO">
+            <id property="id" column="id" jdbcType="VARCHAR"/>
+            <result property="createBy.id" column="create_by" jdbcType="VARCHAR"/>
+            <result property="createTime" column="create_date" jdbcType="TIMESTAMP"/>
+            <result property="updateBy.id" column="update_by" jdbcType="VARCHAR"/>
+            <result property="updateTime" column="update_date" jdbcType="TIMESTAMP"/>
+            <result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
+            <result property="remarks" column="remarks" jdbcType="VARCHAR"/>
+            <result property="invoiceId" column="invoice_id" jdbcType="VARCHAR"/>
+            <result property="code" column="code" jdbcType="VARCHAR"/>
+            <result property="number" column="number" jdbcType="VARCHAR"/>
+            <result property="account" column="account" jdbcType="VARCHAR"/>
+            <result property="rate" column="rate" jdbcType="VARCHAR"/>
+            <result property="amount" column="amount" jdbcType="VARCHAR"/>
+            <result property="tax" column="tax" jdbcType="VARCHAR"/>
+            <result property="allAmount" column="all_amount" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        fid.id,
+        fid.create_by,
+        fid.create_date,
+        fid.update_by,
+        fid.update_date,
+        fid.del_flag,
+        fid.remarks,
+        fid.invoice_id,
+        fid.code,
+        fid.number,
+        fid.account,
+        fid.rate,
+        fid.amount,
+        fid.tax,
+        fid.all_amount
+    </sql>
+</mapper>

+ 34 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/xml/CwFinanceInvoiceInvalidMapper.xml

@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.finance.invoice.mapper.CwFinanceInvoiceInvalidMapper">
+
+    <resultMap id="BaseResultMap" type="com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceInvalidDTO">
+            <id property="id" column="id" jdbcType="VARCHAR"/>
+            <result property="createBy.id" column="create_by" jdbcType="VARCHAR"/>
+            <result property="createTime" column="create_date" jdbcType="TIMESTAMP"/>
+            <result property="updateBy.id" column="update_by" jdbcType="VARCHAR"/>
+            <result property="updateTime" column="update_date" jdbcType="TIMESTAMP"/>
+            <result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
+            <result property="remarks" column="remarks" jdbcType="VARCHAR"/>
+            <result property="invoiceId" column="invoice_id" jdbcType="VARCHAR"/>
+            <result property="invalidStatus" column="invalid_status" jdbcType="VARCHAR"/>
+            <result property="procInsId" column="proc_ins_id" jdbcType="VARCHAR"/>
+            <result property="processDefinitionId" column="process_definition_id" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        fii.id,
+        fii.create_by,
+        fii.create_date,
+        fii.update_by,
+        fii.update_date,
+        fii.del_flag,
+        fii.remarks,
+        fii.invoice_id,
+        fii.invalid_status,
+        fii.proc_ins_id,
+        fii.process_definition_id
+    </sql>
+</mapper>

+ 305 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/xml/CwFinanceInvoiceMapper.xml

@@ -0,0 +1,305 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.finance.invoice.mapper.CwFinanceInvoiceMapper">
+
+    <resultMap id="BaseResultMap" type="com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceDTO">
+            <id property="id" column="id" jdbcType="VARCHAR"/>
+            <result property="createBy.id" column="create_by_id" jdbcType="VARCHAR"/>
+            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+            <result property="updateBy.id" column="update_by_id" jdbcType="VARCHAR"/>
+            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+            <result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
+            <result property="remarks" column="remarks" jdbcType="VARCHAR"/>
+            <result property="type" column="type" jdbcType="VARCHAR"/>
+            <result property="no" column="no" jdbcType="VARCHAR"/>
+            <result property="billingType" column="billing_type" jdbcType="VARCHAR"/>
+            <result property="billingWorkplaceReal" column="billing_workplace_real" jdbcType="VARCHAR"/>
+            <result property="taxpayerIdentificationNo" column="taxpayer_identification_no" jdbcType="VARCHAR"/>
+            <result property="address" column="address" jdbcType="VARCHAR"/>
+            <result property="telPhone" column="tel_phone" jdbcType="VARCHAR"/>
+            <result property="openBank" column="open_bank" jdbcType="VARCHAR"/>
+            <result property="bankAccount" column="bank_account" jdbcType="VARCHAR"/>
+            <result property="name" column="name" jdbcType="VARCHAR"/>
+            <result property="receivablesType" column="receivables_type" jdbcType="VARCHAR"/>
+            <result property="billingContent" column="billing_content" jdbcType="VARCHAR"/>
+            <result property="account" column="account" jdbcType="VARCHAR"/>
+            <result property="billingContentTerms" column="billing_content_terms" jdbcType="VARCHAR"/>
+            <result property="billingPeople" column="billing_people" jdbcType="VARCHAR"/>
+            <result property="billingDate" column="billing_date" jdbcType="TIMESTAMP"/>
+            <result property="collectDate" column="collect_date" jdbcType="TIMESTAMP"/>
+            <result property="billingPeopleReal" column="billing_people_real" jdbcType="VARCHAR"/>
+            <result property="reconciliationPeople" column="reconciliation_people" jdbcType="VARCHAR"/>
+            <result property="reconciliationArea" column="reconciliation_area" jdbcType="VARCHAR"/>
+            <result property="billingWorkplaceRealId" column="billing_workplace_real_id" jdbcType="VARCHAR"/>
+            <result property="billingPeopleId" column="billing_people_id" jdbcType="VARCHAR"/>
+            <result property="status" column="status" jdbcType="VARCHAR"/>
+            <result property="procInsId" column="proc_ins_id" jdbcType="VARCHAR"/>
+            <result property="processDefinitionId" column="process_definition_id" jdbcType="VARCHAR"/>
+            <result property="receivablesStatus" column="receivables_status" jdbcType="VARCHAR"/>
+            <result property="invalidStatus" column="invalid_status" jdbcType="VARCHAR"/>
+            <result property="receivablesDate" column="receivables_date" jdbcType="TIMESTAMP"/>
+            <result property="operator" column="operator" jdbcType="VARCHAR"/>
+            <result property="operatorOffice" column="operator_office" jdbcType="VARCHAR"/>
+            <result property="invalidTaskId" column="invalid_task_id" jdbcType="VARCHAR"/>
+            <result property="taskId" column="task_id" jdbcType="VARCHAR"/>
+            <result property="isMultiple" column="is_multiple" jdbcType="VARCHAR"/>
+            <result property="billingId" column="billing_id" jdbcType="VARCHAR"/>
+            <association property="financeInvoiceInvalidDTO" column="id" select="getFii" javaType="com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceInvalidDTO"></association>
+            <collection property="financeInvoiceReceivablesDTOList" column="id" select="getFirList" ofType="com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceReceivablesDTO"></collection>
+            <collection property="financeInvoiceBaseDTOList" column="id" select="getBaseList" ofType="com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceBaseDTO"></collection>
+            <collection property="financeInvoiceDetailDTOList" column="id" select="getFidList" ofType="com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceDetailDTO"></collection>
+            <collection property="workAttachmentDtoList" ofType="com.jeeplus.pubmodules.oss.service.dto.WorkAttachmentDto" column="id" select="getFileList"></collection>
+    </resultMap>
+
+    <resultMap id="AttachmentMap" type="com.jeeplus.pubmodules.oss.service.dto.WorkAttachmentDto">
+        <id property="id" column="id" jdbcType="VARCHAR"/>
+        <result property="createBy.id" column="create_by_id" jdbcType="VARCHAR"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+        <result property="updateBy.id" column="update_by_id" jdbcType="VARCHAR"/>
+        <result property="createBy.name" column="create_name" jdbcType="VARCHAR"/>
+        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+        <result property="delFlag" column="del_flag" jdbcType="VARCHAR"/>
+        <result property="url" column="url" jdbcType="VARCHAR"/>
+        <result property="name" column="attachment_name" jdbcType="VARCHAR"/>
+        <result property="size" column="file_size" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <sql id="FIR_Column_List">
+        fir.id,
+        fir.create_by_id,
+        fir.create_time,
+        fir.update_by_id,
+        fir.update_time,
+        fir.del_flag,
+        fir.remarks,
+        fir.invoice_id,
+        fir.remittance_unit,
+        fir.remittance_amount,
+        fir.remittance_date,
+        fir.status
+    </sql>
+
+    <sql id="FII_Column_List">
+        fii.id,
+        fii.create_by_id,
+        fii.create_time,
+        fii.update_by_id,
+        fii.update_time,
+        fii.del_flag,
+        fii.remarks,
+        fii.invoice_id,
+        fii.invalid_status,
+        fii.proc_ins_id,
+        fii.process_definition_id
+    </sql>
+
+    <sql id="FID_Column_List">
+        fid.id,
+        fid.create_by_id,
+        fid.create_time,
+        fid.update_by_id,
+        fid.update_time,
+        fid.del_flag,
+        fid.remarks,
+        fid.invoice_id,
+        fid.code,
+        fid.number,
+        fid.account,
+        fid.rate,
+        fid.amount,
+        fid.tax,
+        fid.all_amount
+    </sql>
+
+    <sql id="Base_Column_List">
+        fi.id,
+        fi.create_by_id,
+        fi.create_time,
+        fi.update_by_id,
+        fi.update_time,
+        fi.del_flag,
+        fi.remarks,
+        fi.type,
+        fi.no,
+        fi.billing_type,
+        fi.billing_workplace_real,
+        fi.taxpayer_identification_no,
+        fi.address,
+        fi.tel_phone,
+        fi.open_bank,
+        fi.bank_account,
+        fi.name,
+        fi.receivables_type,
+        fi.billing_content,
+        fi.account,
+        fi.billing_content_terms,
+        fi.billing_people,
+        fi.billing_date,
+        fi.collect_date,
+        fi.billing_people_real,
+        fi.reconciliation_people,
+        fi.reconciliation_area,
+        fi.billing_workplace_real_id,
+        fi.billing_people_id,
+        fi.status,
+        fi.proc_ins_id,
+        fi.process_definition_id,
+        fi.receivables_status,
+        fi.invalid_status,
+        fi.receivables_date,
+        fi.is_multiple,
+        fi.billing_id
+    </sql>
+
+    <sql id="File_Column_List">
+        wa.id,
+        wa.create_by_id,
+        wa.create_time,
+        wa.update_by_id,
+        wa.update_time,
+        wa.remarks,
+        wa.del_flag,
+        wa.url,
+        wa.type,
+        wa.attachment_id,
+        wa.attachment_name,
+        wa.attachment_flag,
+        wa.module_type,
+        wa.attachment_type,
+        wa.file_size,
+        wa.sort,
+        wa.description
+    </sql>
+
+    <sql id="FIB_Column_List">
+        fib.id,
+        fib.create_by_id,
+        fib.create_time,
+        fib.update_by_id,
+        fib.update_time,
+        fib.del_flag,
+        fib.invoice_id,
+        fib.program_id,
+        fib.program_name,
+        fib.contract_name,
+        fib.program_no,
+        fib.contract_id
+    </sql>
+
+    <select id="getFileList" resultMap="AttachmentMap">
+        select
+        <include refid="File_Column_List"></include>,
+        su.name as create_name
+        from work_attachment wa
+        left join sys_user su on su.id = wa.create_by_id and su.del_flag = '0'
+        where wa.del_flag = '0' and wa.attachment_id = #{id}
+    </select>
+
+    <select id="getFii" resultType="com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceInvalidDTO">
+        select
+        <include refid="FII_Column_List"></include>
+        from cw_finance_invoice_invalid fii
+        where fii.del_flag = '0' and fii.invoice_id = ${id}
+    </select>
+
+    <select id="getFirList" resultType="com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceReceivablesDTO">
+        select
+        <include refid="FIR_Column_List"></include>
+        from cw_finance_invoice_receivables fir
+        where fir.del_flag = '0' and fir.invoice_id = ${id}
+    </select>
+
+    <select id="getFidList" resultType="com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceDetailDTO">
+        select
+        <include refid="FID_Column_List"></include>
+        from cw_finance_invoice_detail fid
+        where fid.del_flag = '0' and fid.invoice_id = ${id}
+    </select>
+
+    <select id="getBaseList" resultType="com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceBaseDTO">
+        select
+        <include refid="FIB_Column_List"></include>
+        from cw_finance_invoice_base fib
+
+        where fib.del_flag = '0' and fib.invoice_id = ${id}
+    </select>
+    <select id="findList" resultMap="BaseResultMap">
+        select
+        DISTINCT
+        <include refid="Base_Column_List"></include>,
+        su.name as operator,
+        so.name as operator_office,
+        (select
+        CASE
+        WHEN RIGHT( GROUP_CONCAT(case when program_id is null then 2 else 1 end),1) =2 THEN GROUP_CONCAT(concat('其他:',wipr1.program_name))
+        WHEN RIGHT( GROUP_CONCAT(case when program_id is null then 2 else 1 end),1) =1 THEN GROUP_CONCAT(rpr1.project_name)
+        ELSE '' END
+        FROM cw_finance_invoice_base wipr1
+        LEFT JOIN cw_project_records rpr1 ON wipr1.program_id = rpr1.id
+        WHERE wipr1.invoice_id = fi.id) as programName,
+        cfid.number as "number",
+        cfid.account as "accountDetail"
+        from cw_finance_invoice fi
+        left join cw_finance_invoice_detail cfid on cfid.invoice_id = fi.id and cfid.del_flag = '0'
+        left join sys_user su on fi.create_by_id = su.id and su.del_flag = '0'
+        left join sys_user_manage_office sumo on sumo.office_id = su.office_id
+        left join sys_office so on su.office_id = so.id and so.del_flag = '0'
+        ${ew.customSqlSegment}
+        ORDER BY
+        fi.create_time DESC, cfid.number asc
+    </select>
+
+    <select id="queryById" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List"></include>
+        from cw_finance_invoice fi
+        where fi.del_flag = '0' and fi.id = #{id}
+    </select>
+
+    <select id="getIdByProjectId" resultType="string">
+        select
+            invoice_id
+        from cw_finance_invoice_base cw_fib
+        where cw_fib.del_flag = '0' and cw_fib.program_id = #{id}
+    </select>
+
+    <select id="getByIds" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List"></include>,
+        su.name as operator
+        from cw_finance_invoice fi
+        left join sys_user su on fi.create_by_id = su.id and su.del_flag = '0'
+        ${ew.customSqlSegment}
+    </select>
+
+    <select id="getIdByContractId" resultType="string">
+        select
+        a.invoice_id
+        from
+        (select distinct
+            cw_fib.invoice_id
+        from cw_finance_invoice_base cw_fib
+        where cw_fib.del_flag = '0'
+        and cw_fib.program_id in (select cw_pr.id from cw_project_records cw_pr where cw_pr.contract_id = #{id} and cw_pr.del_flag = '0')
+        union
+        select distinct
+            fi.invoice_id
+        from cw_finance_invoice_base fi
+        where (fi.program_id is null or fi.program_id = '')
+        and fi.contract_id = #{id}
+        AND fi.del_flag = '0') a
+    </select>
+
+    <select id="getIdByClientId" resultType="string">
+        select
+            cw_fi.id
+        from cw_finance_invoice cw_fi
+        where cw_fi.del_flag = '0' and cw_fi.billing_workplace_real_id = #{id}
+    </select>
+
+    <update id="setReceivablesDateNull" parameterType="string">
+        update cw_finance_invoice set receivables_date = null where id = #{id}
+    </update>
+</mapper>

+ 36 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/xml/CwFinanceInvoiceReceivablesMapper.xml

@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.finance.invoice.mapper.CwFinanceInvoiceReceivablesMapper">
+
+    <resultMap id="BaseResultMap" type="com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceReceivablesDTO">
+            <id property="id" column="id" jdbcType="VARCHAR"/>
+            <result property="createBy.id" column="create_by" jdbcType="VARCHAR"/>
+            <result property="createTime" column="create_date" jdbcType="TIMESTAMP"/>
+            <result property="updateBy.id" column="update_by" jdbcType="VARCHAR"/>
+            <result property="updateTime" column="update_date" jdbcType="TIMESTAMP"/>
+            <result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
+            <result property="remarks" column="remarks" jdbcType="VARCHAR"/>
+            <result property="invoiceId" column="invoice_id" jdbcType="VARCHAR"/>
+            <result property="remittanceUnit" column="remittance_unit" jdbcType="VARCHAR"/>
+            <result property="remittanceAmount" column="remittance_amount" jdbcType="VARCHAR"/>
+            <result property="remittanceDate" column="remittance_date" jdbcType="TIMESTAMP"/>
+            <result property="status" column="status" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        fir.id,
+        fir.create_by,
+        fir.create_date,
+        fir.update_by,
+        fir.update_date,
+        fir.del_flag,
+        fir.remarks,
+        fir.invoice_id,
+        fir.remittance_unit,
+        fir.remittance_amount,
+        fir.remittance_date,
+        fir.status
+    </sql>
+</mapper>

+ 593 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/CwFinanceInvoiceService.java

@@ -0,0 +1,593 @@
+package com.jeeplus.finance.invoice.service;
+
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.google.common.collect.Lists;
+import com.jeeplus.core.query.QueryWrapperGenerator;
+import com.jeeplus.finance.invoice.domain.*;
+import com.jeeplus.finance.invoice.mapper.*;
+import com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceBaseDTO;
+import com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceDTO;
+import com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceDetailDTO;
+import com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceReceivablesDTO;
+import com.jeeplus.finance.invoice.service.mapstruct.*;
+import com.jeeplus.finance.workClientInfo.domain.CwWorkClientBase;
+import com.jeeplus.finance.workClientInfo.domain.CwWorkClientBilling;
+import com.jeeplus.finance.workClientInfo.service.CwWorkClientBillingService;
+import com.jeeplus.finance.workClientInfo.service.CwWorkClientService;
+import com.jeeplus.pubmodules.oss.mapper.OssServiceMapper;
+import com.jeeplus.pubmodules.oss.service.OssService;
+import com.jeeplus.pubmodules.serialNumTpl.service.SerialnumTplService;
+import com.jeeplus.sys.domain.User;
+import com.jeeplus.sys.service.UserService;
+import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.sys.utils.UserUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.stream.Collectors;
+
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class CwFinanceInvoiceService extends ServiceImpl<CwFinanceInvoiceMapper, CwFinanceInvoice> {
+
+    @Resource
+    private CwFinanceInvoiceMapper cwFinanceInvoiceMapper;
+    @Resource
+    private CwFinanceInvoiceBaseMapper cwFinanceInvoiceBaseMapper;
+    @Resource
+    private CwFinanceInvoiceDetailMapper cwFinanceInvoiceDetailMapper;
+    @Resource
+    private CwFinanceInvoiceReceivablesMapper cwFinanceInvoiceReceivablesMapper;
+    @Resource
+    private CwFinanceInvoiceInvalidMapper cwFinanceInvoiceInvalidMapper;
+    @Resource
+    private SerialnumTplService serialnumTplService;
+    @Resource
+    private OssServiceMapper ossServiceMapper;
+    @Resource
+    private UserService userService;
+    @Resource
+    private OssService ossService;
+    @Resource
+    private CwWorkClientBillingService cwWorkClientBillingService;
+    @Resource
+    private CwWorkClientService cwWorkClientService;
+
+    public List<String> getSearchList(ArrayList<String> searchIdList, List<String> ids) {
+        List<String> newSearchIdList = searchIdList.stream().filter(item -> {
+            AtomicInteger num = new AtomicInteger();
+            ids.stream().forEach(id -> {
+                if (item.equals(id)) {
+                    num.getAndIncrement();
+                }
+            });
+            if (num.get() > 0) {
+                return true;
+            }
+            return false;
+        }).collect(Collectors.toList());
+        return newSearchIdList;
+    }
+
+    public IPage<CwFinanceInvoiceDTO> findList(Page<CwFinanceInvoiceDTO> page, CwFinanceInvoiceDTO cwFinanceInvoiceDTO) throws Exception{
+        QueryWrapper<CwFinanceInvoice> queryWrapper = QueryWrapperGenerator.buildQueryCondition ( CwFinanceInvoiceWrapper.INSTANCE.toEntity(cwFinanceInvoiceDTO), CwFinanceInvoice.class );
+        queryWrapper.eq("fi.del_flag","0");
+        ArrayList<String> searchIdList = new ArrayList<>();
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        AtomicInteger checkNum = new AtomicInteger();
+        if (ObjectUtil.isNotEmpty(cwFinanceInvoiceDTO)) {
+            // 发票号查询
+            if (StringUtils.isNotBlank(cwFinanceInvoiceDTO.getNumber())) {
+                List<CwFinanceInvoiceDetail> cwFinanceInvoiceDetails = cwFinanceInvoiceDetailMapper.selectList(new LambdaQueryWrapper<CwFinanceInvoiceDetail>().like(CwFinanceInvoiceDetail::getNumber, cwFinanceInvoiceDTO.getNumber()));
+                List<String> ids = cwFinanceInvoiceDetails.stream().distinct().map(CwFinanceInvoiceDetail::getInvoiceId).collect(Collectors.toList());
+                if(CollectionUtil.isEmpty(ids)) {
+                    return new Page<CwFinanceInvoiceDTO>();
+                }else{
+                    if (CollectionUtil.isNotEmpty(searchIdList)){
+                        List<String> newSearchIdList = getSearchList(searchIdList,ids);
+                        searchIdList = new ArrayList<String>();
+                        for (String item : newSearchIdList) {
+                            searchIdList.add(item);
+                        }
+                    }else{
+                        if (checkNum.get() > 0){
+                            return new Page<CwFinanceInvoiceDTO>();
+                        }else{
+                            for (String item : ids) {
+                                searchIdList.add(item);
+                            }
+                        }
+                    }
+                    checkNum.getAndIncrement();
+                }
+            }
+            // 开票总金额
+            if (StringUtils.isNotBlank(cwFinanceInvoiceDTO.getAccountBegin())&&StringUtils.isNotBlank(cwFinanceInvoiceDTO.getAccountEnd())) {
+                List<CwFinanceInvoice> cwFinanceInvoices = cwFinanceInvoiceMapper.selectList(new LambdaQueryWrapper<CwFinanceInvoice>()
+                        .between(CwFinanceInvoice::getAccount, new BigDecimal(cwFinanceInvoiceDTO.getAccountBegin()), new BigDecimal(cwFinanceInvoiceDTO.getAccountEnd())));
+                List<String> ids = cwFinanceInvoices.stream().distinct().map(CwFinanceInvoice::getId).collect(Collectors.toList());
+                if(CollectionUtil.isEmpty(ids)) {
+                    return new Page<CwFinanceInvoiceDTO>();
+                }else{
+                    if (CollectionUtil.isNotEmpty(searchIdList)){
+                        List<String> newSearchIdList = getSearchList(searchIdList,ids);
+                        searchIdList = new ArrayList<String>();
+                        for (String item : newSearchIdList) {
+                            searchIdList.add(item);
+                        }
+                    }else{
+                        if (checkNum.get() > 0){
+                            return new Page<CwFinanceInvoiceDTO>();
+                        }else{
+                            for (String item : ids) {
+                                searchIdList.add(item);
+                            }
+                        }
+                    }
+                    checkNum.getAndIncrement();
+                }
+            }
+            // 开票日期
+            if (StringUtils.isNotBlank(cwFinanceInvoiceDTO.getBillingDateBegin())&&StringUtils.isNotBlank(cwFinanceInvoiceDTO.getBillingDateEnd())) {
+                List<CwFinanceInvoice> cwFinanceInvoices = cwFinanceInvoiceMapper.selectList(new LambdaQueryWrapper<CwFinanceInvoice>()
+                        .between(CwFinanceInvoice::getBillingDate, sdf.parse(cwFinanceInvoiceDTO.getBillingDateBegin()), sdf.parse(cwFinanceInvoiceDTO.getBillingDateEnd())));
+                List<String> ids = cwFinanceInvoices.stream().distinct().map(CwFinanceInvoice::getId).collect(Collectors.toList());
+                if(CollectionUtil.isEmpty(ids)) {
+                    return new Page<CwFinanceInvoiceDTO>();
+                }else{
+                    if (CollectionUtil.isNotEmpty(searchIdList)){
+                        List<String> newSearchIdList = getSearchList(searchIdList,ids);
+                        searchIdList = new ArrayList<String>();
+                        for (String item : newSearchIdList) {
+                            searchIdList.add(item);
+                        }
+                    }else{
+                        if (checkNum.get() > 0){
+                            return new Page<CwFinanceInvoiceDTO>();
+                        }else{
+                            for (String item : ids) {
+                                searchIdList.add(item);
+                            }
+                        }
+                    }
+                    checkNum.getAndIncrement();
+                }
+            }
+            // 收款日期
+            if (StringUtils.isNotBlank(cwFinanceInvoiceDTO.getRemittanceDateBegin())&&StringUtils.isNotBlank(cwFinanceInvoiceDTO.getRemittanceDateEnd())) {
+                List<CwFinanceInvoice> cwFinanceInvoices = cwFinanceInvoiceMapper.selectList(new LambdaQueryWrapper<CwFinanceInvoice>()
+                        .between(CwFinanceInvoice::getReceivablesDate, sdf.parse(cwFinanceInvoiceDTO.getRemittanceDateBegin()), sdf.parse(cwFinanceInvoiceDTO.getRemittanceDateEnd())));
+                List<String> ids = cwFinanceInvoices.stream().distinct().map(CwFinanceInvoice::getId).collect(Collectors.toList());
+                if(CollectionUtil.isEmpty(ids)) {
+                    return new Page<CwFinanceInvoiceDTO>();
+                }else{
+                    if (CollectionUtil.isNotEmpty(searchIdList)){
+                        List<String> newSearchIdList = getSearchList(searchIdList,ids);
+                        searchIdList = new ArrayList<String>();
+                        for (String item : newSearchIdList) {
+                            searchIdList.add(item);
+                        }
+                    }else{
+                        if (checkNum.get() > 0){
+                            return new Page<CwFinanceInvoiceDTO>();
+                        }else{
+                            for (String item : ids) {
+                                searchIdList.add(item);
+                            }
+                        }
+                    }
+                    checkNum.getAndIncrement();
+                }
+            }
+            // 项目名称
+            if (StringUtils.isNotBlank(cwFinanceInvoiceDTO.getProgramId())){
+                    List<CwFinanceInvoiceBase> cwFinanceInvoiceBaseList = cwFinanceInvoiceBaseMapper.selectList(new LambdaQueryWrapper<CwFinanceInvoiceBase>()
+                            .eq(CwFinanceInvoiceBase::getProgramId, cwFinanceInvoiceDTO.getProgramId()));
+                    List<String> ids = cwFinanceInvoiceBaseList.stream().distinct().map(CwFinanceInvoiceBase::getInvoiceId).collect(Collectors.toList());
+                    if(CollectionUtil.isEmpty(ids)) {
+                        return new Page<CwFinanceInvoiceDTO>();
+                    }else{
+                        if (CollectionUtil.isNotEmpty(searchIdList)){
+                            List<String> newSearchIdList = getSearchList(searchIdList,ids);
+                            searchIdList = new ArrayList<String>();
+                            for (String item : newSearchIdList) {
+                                searchIdList.add(item);
+                            }
+                        }else{
+                            if (checkNum.get() > 0){
+                                return new Page<CwFinanceInvoiceDTO>();
+                            }else{
+                                for (String item : ids) {
+                                    searchIdList.add(item);
+                                }
+                            }
+                        }
+                        checkNum.getAndIncrement();
+                    }
+                }
+            // 经办人
+            if (StringUtils.isNotBlank(cwFinanceInvoiceDTO.getOperator())){
+                queryWrapper.like("su.name", cwFinanceInvoiceDTO.getOperator());
+            }
+            // 对账人
+            if (StringUtils.isNotBlank(cwFinanceInvoiceDTO.getReconciliationPeopleName())) {
+                List<User> users = userService.list(new QueryWrapper<User>().lambda().like(User::getName, cwFinanceInvoiceDTO.getReconciliationPeopleName()));
+                List<String> userIdList = users.stream().distinct().map(User::getId).collect(Collectors.toList());
+                if (CollectionUtil.isNotEmpty(userIdList)) {
+                    queryWrapper.in("fi.reconciliation_people",userIdList);
+                } else {
+                    return new Page<CwFinanceInvoiceDTO>();
+                }
+            }
+            // 经办人部门
+            if (StringUtils.isNotBlank(cwFinanceInvoiceDTO.getOperatorOffice())){
+                List<User> userList = userService.getUserByOfficeAll(cwFinanceInvoiceDTO.getOperatorOffice());
+                if (CollectionUtil.isNotEmpty(userList)) {
+                    List<String> userIdList = userList.stream().distinct().map(User::getId).collect(Collectors.toList());
+                    if (CollectionUtil.isNotEmpty(userIdList)) {
+                        queryWrapper.in("fi.create_by_id",userIdList);
+                    } else {
+                        return new Page<CwFinanceInvoiceDTO>();
+                    }
+                } else {
+                    return new Page<CwFinanceInvoiceDTO>();
+                }
+            }
+        }
+        if (CollectionUtil.isNotEmpty(searchIdList)){
+            List<String> ids = searchIdList.stream().distinct().collect(Collectors.toList());
+            queryWrapper.in("fi.id",ids);
+        } else{
+            if (checkNum.get() > 0) {
+                return new Page<CwFinanceInvoiceDTO>();
+            }
+        }
+        // 如果当前用户是部门主任,则可以查看部门所有的项目、自己创建的项目以及所属项目组的项目
+        // 如果当前用户是员工,则可以查看自己创建的项目以及所属项目组的项目
+        StringBuilder officeIds = new StringBuilder();
+        UserDTO userDTO = UserUtils.getCurrentUserDTO();
+        List<String> manageOfficeIdList= Lists.newArrayList();
+        //判定是否为会计所长
+        /*if(CommonUtils.haveRoleKjsz()){
+            //获取当前人管理的部门id
+            if(StringUtils.isNotBlank(userDTO.getManageOfficeIds())){
+                manageOfficeIdList = Arrays.asList(userDTO.getManageOfficeIds().split(","));
+            }else{
+                manageOfficeIdList.add(userDTO.getOfficeDTO().getId());
+            }
+            for (int i = 0; i <manageOfficeIdList.size(); i++){
+                officeIds.append("'").append(manageOfficeIdList.get(i)).append("'");
+                if(i < manageOfficeIdList.size()-1){
+                    officeIds.append(",");
+                }
+            }
+        }*/
+        return cwFinanceInvoiceMapper.findList(page,queryWrapper,officeIds.toString());
+    }
+
+    public CwFinanceInvoiceDTO queryById(String id) {
+
+        CwFinanceInvoiceDTO cwFinanceInvoiceDTO = cwFinanceInvoiceMapper.queryById(id);
+
+        // 电话号获取
+        if (ObjectUtil.isNotEmpty(cwFinanceInvoiceDTO) && StringUtils.isNotBlank(cwFinanceInvoiceDTO.getBillingId())) {
+            CwWorkClientBilling cwWorkClientBilling = cwWorkClientBillingService.getById(cwFinanceInvoiceDTO.getBillingId());
+            if (ObjectUtil.isNotEmpty(cwWorkClientBilling) && StringUtils.isNotBlank(cwWorkClientBilling.getPhone())) {
+                // 如果通过billingId(开票信息id)可以查询到数据,并且数据的phone(电话)有值的话,那么就将方法返回结果的telPhone替换为查询到的phone
+                cwFinanceInvoiceDTO.setTelPhone(cwWorkClientBilling.getPhone());
+            } else {
+                // 如果通过billingId(开票信息id)查询不到数据或者查询到数据的phone值为空
+                // 将billingId(开票信息id)置空,因为前端根据billingId是否有值来判断->是否允许电话号码可以手填
+                cwFinanceInvoiceDTO.setBillingId("");
+                // 将telPhone(电话号)置空
+//                cwFinanceInvoiceDTO.setTelPhone("");
+            }
+        }
+
+        // 实际开票单位名称获取
+        if (ObjectUtil.isNotEmpty(cwFinanceInvoiceDTO) && StringUtils.isNotBlank(cwFinanceInvoiceDTO.getBillingWorkplaceRealId())) {
+            CwWorkClientBase cwWorkClientBase = cwWorkClientService.getById(cwFinanceInvoiceDTO.getBillingWorkplaceRealId());
+            if (ObjectUtil.isNotEmpty(cwWorkClientBase) && StringUtils.isNotBlank(cwWorkClientBase.getName())) {
+                // 如果通过billingWorkplaceRealId(实际开票单位id)可以查询到数据,并且数据的name(实际开票单位名称)有值的话,
+                // 那么就将方法返回结果的billingWorkplaceReal替换
+                cwFinanceInvoiceDTO.setBillingWorkplaceReal(cwWorkClientBase.getName());
+            }
+        }
+
+        return cwFinanceInvoiceDTO;
+    }
+
+    public CwFinanceInvoice saveForm(CwFinanceInvoiceDTO cwFinanceInvoiceDTO) throws Exception{
+        CwFinanceInvoice cwFinanceInvoice = CwFinanceInvoiceWrapper.INSTANCE.toEntity(cwFinanceInvoiceDTO);
+        if (ObjectUtil.isNotEmpty(cwFinanceInvoice)) {
+            if(StringUtils.isBlank(cwFinanceInvoice.getId())){
+                //获取当前登录人信息
+                UserDTO userDTO = UserUtils.getCurrentUserDTO();
+                //发票编号生成
+                String serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), CwFinanceInvoiceDTO.BIZ_CODE);
+                cwFinanceInvoice.setNo(serialNum);
+                if (StringUtils.isBlank(cwFinanceInvoice.getInvalidStatus())){
+                    cwFinanceInvoice.setInvalidStatus("0");
+                }
+                if (StringUtils.isBlank(cwFinanceInvoice.getReceivablesStatus())){
+                    cwFinanceInvoice.setReceivablesStatus("0");
+                }
+            }
+        }
+        this.saveOrUpdate(cwFinanceInvoice);
+
+        if (ObjectUtil.isNotEmpty(cwFinanceInvoiceDTO)) {
+            // 如果当前是执行的是收款页面的保存方法
+            if ("1".equals(cwFinanceInvoiceDTO.getIsReceivables())) {
+                // 如果传过来的收款日期为空,则将本条发票的收款日期置空
+                if (ObjectUtil.isEmpty(cwFinanceInvoiceDTO.getReceivablesDate())) {
+                    // 根据发票id,置空发票的收款日期
+                    cwFinanceInvoiceMapper.setReceivablesDateNull(cwFinanceInvoice.getId());
+                }
+            }
+            // 基本信息保存
+            if(CollectionUtil.isNotEmpty(cwFinanceInvoiceDTO.getFinanceInvoiceBaseDTOList())){
+                List<String> delIds = cwFinanceInvoiceDTO.getFinanceInvoiceBaseDTOList().stream().distinct().filter(item->{
+                    if(StringUtils.isNotBlank(item.getId())){
+                        return true;
+                    }
+                    return false;
+                }).map(CwFinanceInvoiceBaseDTO::getId).collect(Collectors.toList());
+                if(CollectionUtil.isNotEmpty(delIds)){
+                    cwFinanceInvoiceBaseMapper.delete(new QueryWrapper<CwFinanceInvoiceBase>().lambda()
+                            .eq(CwFinanceInvoiceBase::getInvoiceId, cwFinanceInvoice.getId()).notIn(CwFinanceInvoiceBase::getId,delIds));
+                }else{
+                    cwFinanceInvoiceBaseMapper.delete(new QueryWrapper<CwFinanceInvoiceBase>().lambda()
+                            .eq(CwFinanceInvoiceBase::getInvoiceId, cwFinanceInvoice.getId()));
+                }
+                cwFinanceInvoiceDTO.getFinanceInvoiceBaseDTOList().stream().forEach(item->{
+                    CwFinanceInvoiceBase cwFinanceInvoiceBase = CwFinanceInvoiceBaseWrapper.INSTANCE.toEntity(item);
+                    if(StringUtils.isNotBlank(cwFinanceInvoiceBase.getId())){
+                        cwFinanceInvoiceBaseMapper.updateById(cwFinanceInvoiceBase);
+                    }else{
+                        cwFinanceInvoiceBase.setInvoiceId(cwFinanceInvoice.getId());
+                        cwFinanceInvoiceBaseMapper.insert(cwFinanceInvoiceBase);
+                    }
+                });
+            }else{
+                cwFinanceInvoiceBaseMapper.delete(new QueryWrapper<CwFinanceInvoiceBase>().lambda()
+                        .eq(CwFinanceInvoiceBase::getInvoiceId, cwFinanceInvoice.getId()));
+            }
+            // 附件
+            ossService.saveOrUpdateFileList(cwFinanceInvoiceDTO.getWorkAttachmentDtoList(), cwFinanceInvoice.getId(),"cw_invoice");
+            // 发票明细保存
+            if(CollectionUtil.isNotEmpty(cwFinanceInvoiceDTO.getFinanceInvoiceDetailDTOList())){
+                List<String> delIds = cwFinanceInvoiceDTO.getFinanceInvoiceDetailDTOList().stream().distinct().filter(item -> {
+                    if (StringUtils.isNotBlank(item.getId())) {
+                        return true;
+                    }
+                    return false;
+                }).map(CwFinanceInvoiceDetailDTO::getId).collect(Collectors.toList());
+                if(CollectionUtil.isNotEmpty(delIds)){
+                    cwFinanceInvoiceDetailMapper.delete(new QueryWrapper<CwFinanceInvoiceDetail>().lambda()
+                            .eq(CwFinanceInvoiceDetail::getInvoiceId, cwFinanceInvoice.getId())
+                            .notIn(CwFinanceInvoiceDetail::getId,delIds));
+                }else{
+                    cwFinanceInvoiceDetailMapper.delete(new QueryWrapper<CwFinanceInvoiceDetail>().lambda().eq(CwFinanceInvoiceDetail::getInvoiceId, cwFinanceInvoice.getId()));
+                }
+                cwFinanceInvoiceDTO.getFinanceInvoiceDetailDTOList().stream().forEach(item->{
+                    CwFinanceInvoiceDetail cwFinanceInvoiceDetail = CwFinanceInvoiceDetailWrapper.INSTANCE.toEntity(item);
+                    if(StringUtils.isNotBlank(cwFinanceInvoiceDetail.getId())){
+                        cwFinanceInvoiceDetailMapper.updateById(cwFinanceInvoiceDetail);
+                    }else{
+                        cwFinanceInvoiceDetail.setInvoiceId(cwFinanceInvoice.getId());
+                        cwFinanceInvoiceDetailMapper.insert(cwFinanceInvoiceDetail);
+                    }
+                });
+            }else{
+                cwFinanceInvoiceDetailMapper.delete(new QueryWrapper<CwFinanceInvoiceDetail>().lambda().eq(CwFinanceInvoiceDetail::getInvoiceId, cwFinanceInvoice.getId()));
+            }
+            // 收款明细保存
+            if(CollectionUtil.isNotEmpty(cwFinanceInvoiceDTO.getFinanceInvoiceReceivablesDTOList())){
+                List<String> delIds = cwFinanceInvoiceDTO.getFinanceInvoiceReceivablesDTOList().stream().distinct().filter(item -> {
+                    if (StringUtils.isNotBlank(item.getId())) {
+                        return true;
+                    }
+                    return false;
+                }).map(CwFinanceInvoiceReceivablesDTO::getId).collect(Collectors.toList());
+                if(CollectionUtil.isNotEmpty(delIds)){
+                    cwFinanceInvoiceReceivablesMapper.delete(new QueryWrapper<CwFinanceInvoiceReceivables>().lambda()
+                            .eq(CwFinanceInvoiceReceivables::getInvoiceId, cwFinanceInvoice.getId())
+                            .notIn(CwFinanceInvoiceReceivables::getId,delIds));
+                }else{
+                    cwFinanceInvoiceReceivablesMapper.delete(new QueryWrapper<CwFinanceInvoiceReceivables>().lambda().eq(CwFinanceInvoiceReceivables::getInvoiceId, cwFinanceInvoice.getId()));
+                }
+                cwFinanceInvoiceDTO.getFinanceInvoiceReceivablesDTOList().stream().forEach(item->{
+                    CwFinanceInvoiceReceivables cwFinanceInvoiceReceivables = CwFinanceInvoiceReceivablesWrapper.INSTANCE.toEntity(item);
+                    if(StringUtils.isNotBlank(cwFinanceInvoiceReceivables.getId())){
+                        cwFinanceInvoiceReceivablesMapper.updateById(cwFinanceInvoiceReceivables);
+                    }else{
+                        cwFinanceInvoiceReceivables.setInvoiceId(cwFinanceInvoice.getId());
+                        cwFinanceInvoiceReceivablesMapper.insert(cwFinanceInvoiceReceivables);
+                    }
+                });
+            }else{
+                cwFinanceInvoiceReceivablesMapper.delete(new QueryWrapper<CwFinanceInvoiceReceivables>().lambda().eq(CwFinanceInvoiceReceivables::getInvoiceId, cwFinanceInvoice.getId()));
+            }
+            // 作废信息保存
+            if(ObjectUtil.isNotEmpty(cwFinanceInvoiceDTO.getFinanceInvoiceInvalidDTO())){
+                CwFinanceInvoiceInvalid cwFinanceInvoiceInvalid = CwFinanceInvoiceInvalidWrapper.INSTANCE.toEntity(cwFinanceInvoiceDTO.getFinanceInvoiceInvalidDTO());
+                if(StringUtils.isNotBlank(cwFinanceInvoiceInvalid.getId())){
+                    cwFinanceInvoiceInvalidMapper.update(cwFinanceInvoiceInvalid,
+                            new QueryWrapper<CwFinanceInvoiceInvalid>().lambda().eq(CwFinanceInvoiceInvalid::getId, cwFinanceInvoiceInvalid.getId()));
+                }else{
+                    cwFinanceInvoiceInvalid.setInvalidStatus("0");
+                    cwFinanceInvoiceInvalid.setInvoiceId(cwFinanceInvoice.getId());
+                    cwFinanceInvoiceInvalidMapper.insert(cwFinanceInvoiceInvalid);
+                }
+            }else{
+                cwFinanceInvoiceInvalidMapper.delete(new QueryWrapper<CwFinanceInvoiceInvalid>().lambda().eq(CwFinanceInvoiceInvalid::getInvoiceId, cwFinanceInvoice.getId()));
+                CwFinanceInvoiceInvalid cwFinanceInvoiceInvalid = new CwFinanceInvoiceInvalid();
+                cwFinanceInvoiceInvalid.setInvalidStatus("0");
+                cwFinanceInvoiceInvalid.setInvoiceId(cwFinanceInvoice.getId());
+                cwFinanceInvoiceInvalidMapper.insert(cwFinanceInvoiceInvalid);
+            }
+        }
+        return cwFinanceInvoice;
+    }
+
+    public ResponseEntity saveInvoice(CwFinanceInvoiceDTO cwFinanceInvoiceDTO) throws Exception{
+        this.saveForm(cwFinanceInvoiceDTO);
+        return ResponseEntity.ok("保存成功");
+    }
+
+    public String saveFormInvalid(CwFinanceInvoiceDTO cwFinanceInvoiceDTO) throws Exception{
+        String invoiceId = this.saveForm(cwFinanceInvoiceDTO).getId();
+        List<CwFinanceInvoiceInvalid> cwFinanceInvoiceInvalids = cwFinanceInvoiceInvalidMapper.selectList(
+                new QueryWrapper<CwFinanceInvoiceInvalid>().lambda().eq(CwFinanceInvoiceInvalid::getInvoiceId, invoiceId));
+        return cwFinanceInvoiceInvalids.get(0).getId();
+    }
+
+    public ResponseEntity deleteByIds(String ids) {
+        String idArray[] =ids.split(",");
+        this.removeByIds (Lists.newArrayList (idArray));
+        return ResponseEntity.ok ("删除成功");
+    }
+
+    public Boolean queryByNumber(String number, String id) {
+        List<CwFinanceInvoiceDetail> cwFinanceInvoiceDetails = cwFinanceInvoiceDetailMapper.selectList(new QueryWrapper<CwFinanceInvoiceDetail>().lambda()
+                .eq(CwFinanceInvoiceDetail::getNumber, number)
+                .eq(CwFinanceInvoiceDetail::getDelFlag, '0')
+                .ne(StringUtils.isNotBlank(id), CwFinanceInvoiceDetail::getId,id));
+        if (CollectionUtil.isNotEmpty(cwFinanceInvoiceDetails)) {
+            return true;
+        }
+        return false;
+    }
+
+    public String queryIdByInvalidId(String id) {
+        CwFinanceInvoiceInvalid cwFinanceInvoiceInvalid = cwFinanceInvoiceInvalidMapper.selectById(id);
+        return cwFinanceInvoiceInvalid.getInvoiceId();
+    }
+
+    public String updateStatusById(CwFinanceInvoiceDTO cwFinanceInvoiceDTO) {
+        CwFinanceInvoice cwFinanceInvoice = CwFinanceInvoiceWrapper.INSTANCE.toEntity(cwFinanceInvoiceDTO);
+        cwFinanceInvoiceMapper.update(cwFinanceInvoice, new QueryWrapper<CwFinanceInvoice>().lambda().eq(CwFinanceInvoice::getId, cwFinanceInvoice.getId()));
+        return "操作成功";
+    }
+
+    public String isReceivables(CwFinanceInvoiceDTO cwFinanceInvoiceDTO) {
+        CwFinanceInvoice cwFinanceInvoice = CwFinanceInvoiceWrapper.INSTANCE.toEntity(cwFinanceInvoiceDTO);
+        cwFinanceInvoiceMapper.update(cwFinanceInvoice, new QueryWrapper<CwFinanceInvoice>().lambda().eq(CwFinanceInvoice::getId, cwFinanceInvoice.getId()));
+        return "操作成功";
+    }
+
+    public String importDecide(List<CwFinanceInvoiceDetailDTO> list, ArrayList<CwFinanceInvoiceDetailDTO> arrayList, HashMap<String,String> hashMap){
+        for (CwFinanceInvoiceDetailDTO cwFinanceInvoiceDetailDTO : list) {
+            if(ObjectUtil.isEmpty(cwFinanceInvoiceDetailDTO)){
+                continue;
+            }
+
+            if(StringUtils.isBlank(cwFinanceInvoiceDetailDTO.getNumber())){
+                return "文件中有发票号为空,请重新填写";
+            }
+            if(StringUtils.isNotBlank(cwFinanceInvoiceDetailDTO.getNumber())){
+                try {
+                    Integer integer = new Integer(cwFinanceInvoiceDetailDTO.getNumber());
+                    if (integer < 0) {
+                        return "文件中有发票号填写不正确,请重新填写";
+                    }
+                }catch (Exception e){
+                    return "文件中有发票号填写不正确,请重新填写";
+                }
+                List<CwFinanceInvoiceDetail> cwFinanceInvoiceDetailList = cwFinanceInvoiceDetailMapper.selectList(new QueryWrapper<CwFinanceInvoiceDetail>().eq("number", cwFinanceInvoiceDetailDTO.getNumber()));
+                if(CollectionUtil.isNotEmpty(cwFinanceInvoiceDetailList)){
+                    return "文件中有发票号已在系统中存在,请重新填写";
+                }
+            }
+//            if (StringUtils.isBlank(financeInvoiceDetailDTO.getRate())) {
+//                return "文件中有税率为空,请重新填写";
+//            }
+            if (StringUtils.isNotBlank(cwFinanceInvoiceDetailDTO.getRate())) {
+                try {
+                    if ((new BigDecimal(cwFinanceInvoiceDetailDTO.getRate())).compareTo(new BigDecimal(1)) == -1
+                            || (new BigDecimal(cwFinanceInvoiceDetailDTO.getRate())).compareTo(new BigDecimal(100)) == 1) {
+                        return "文件中有税率填写不正确,请重新填写";
+                    }
+                }catch (Exception e){
+                    return "文件中有税率填写不正确,请重新填写";
+                }
+            }
+            if (StringUtils.isBlank(cwFinanceInvoiceDetailDTO.getAccount())) {
+                return "文件中有开票金额为空,请重新填写";
+            } else {
+                try {
+                    cwFinanceInvoiceDetailDTO.setAccount(new BigDecimal(cwFinanceInvoiceDetailDTO.getAccount()).toString());
+                }catch (Exception e){
+                    return "文件中有开票金额填写不正确,请重新填写";
+                }
+            }
+
+            hashMap.put(cwFinanceInvoiceDetailDTO.getNumber(),null);
+
+            arrayList.add(cwFinanceInvoiceDetailDTO);
+        }
+        return null;
+    }
+
+    public List<CwFinanceInvoiceDTO> getByIds(String projectId,CwFinanceInvoiceDTO cwFinanceInvoiceDTO) throws Exception{
+        if(StringUtils.isNotBlank(projectId)){
+            List<String> idByProjectId = cwFinanceInvoiceMapper.getIdByProjectId(projectId);
+            if (CollectionUtil.isNotEmpty(idByProjectId)){
+                QueryWrapper<CwFinanceInvoice> queryWrapper = QueryWrapperGenerator.buildQueryCondition ( CwFinanceInvoiceWrapper.INSTANCE.toEntity(cwFinanceInvoiceDTO), CwFinanceInvoice.class );
+                queryWrapper.in("fi.id", idByProjectId);
+                queryWrapper.eq("fi.del_flag","0");
+                queryWrapper.eq("fi.status","5"); // 发票申请流程已通过
+                queryWrapper.orderByDesc("fi.create_time");
+                queryWrapper.eq("fi.invalid_status","0"); // 未作废
+                return cwFinanceInvoiceMapper.getByIds(queryWrapper);
+            }
+        }
+        return new ArrayList<>();
+    }
+
+    public List<CwFinanceInvoiceDTO> getByContractId(String contractId,CwFinanceInvoiceDTO cwFinanceInvoiceDTO) throws Exception{
+        if(StringUtils.isNotBlank(contractId)){
+            List<String> idByContractId = cwFinanceInvoiceMapper.getIdByContractId(contractId);
+            if (CollectionUtil.isNotEmpty(idByContractId)){
+                QueryWrapper<CwFinanceInvoice> queryWrapper = QueryWrapperGenerator.buildQueryCondition ( CwFinanceInvoiceWrapper.INSTANCE.toEntity(cwFinanceInvoiceDTO), CwFinanceInvoice.class );
+                queryWrapper.in("fi.id", idByContractId);
+                queryWrapper.eq("fi.del_flag","0");
+                queryWrapper.eq("fi.status","5"); // 发票申请流程已通过
+                queryWrapper.orderByDesc("fi.create_time");
+                queryWrapper.eq("fi.invalid_status","0"); // 未作废
+                return cwFinanceInvoiceMapper.getByIds(queryWrapper);
+            }
+        }
+        return new ArrayList<>();
+    }
+
+    public List<CwFinanceInvoiceDTO> getIdByClientId(String clientId,CwFinanceInvoiceDTO cwFinanceInvoiceDTO) throws Exception{
+        if(StringUtils.isNotBlank(clientId)){
+            List<String> idByClientId = cwFinanceInvoiceMapper.getIdByClientId(clientId);
+            if (CollectionUtil.isNotEmpty(idByClientId)){
+                QueryWrapper<CwFinanceInvoice> queryWrapper = QueryWrapperGenerator.buildQueryCondition ( CwFinanceInvoiceWrapper.INSTANCE.toEntity(cwFinanceInvoiceDTO), CwFinanceInvoice.class );
+                queryWrapper.in("fi.id", idByClientId);
+                queryWrapper.eq("fi.del_flag","0");
+                queryWrapper.eq("fi.status","5"); // 发票申请流程已通过
+                queryWrapper.orderByDesc("fi.create_time");
+                queryWrapper.eq("fi.invalid_status","0"); // 未作废
+                return cwFinanceInvoiceMapper.getByIds(queryWrapper);
+            }
+        }
+        return new ArrayList<>();
+    }
+}

+ 9 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/dto/CwFinanceDTO.java

@@ -0,0 +1,9 @@
+package com.jeeplus.finance.invoice.service.dto;
+
+import lombok.Data;
+
+@Data
+public class CwFinanceDTO {
+
+    private String businessId;
+}

+ 47 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/dto/CwFinanceInvoiceBaseDTO.java

@@ -0,0 +1,47 @@
+package com.jeeplus.finance.invoice.service.dto;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import com.jeeplus.core.service.dto.BaseDTO;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 财务管理-发票基本信息
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class CwFinanceInvoiceBaseDTO extends BaseDTO {
+
+    /**
+     * 发票id
+     */
+    private String invoiceId;
+
+    /**
+     * 项目id
+     */
+    private String programId;
+
+    /**
+     * 项目名称
+     */
+    private String programName;
+
+    /**
+     * 合同名称
+     */
+    private String contractName;
+
+    /**
+     * 项目编号
+     */
+    private String programNo;
+
+    /**
+     * 合同id
+     */
+    private String contractId;
+
+    private static final long serialVersionUID = 1L;
+}

+ 318 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/dto/CwFinanceInvoiceDTO.java

@@ -0,0 +1,318 @@
+package com.jeeplus.finance.invoice.service.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jeeplus.core.service.dto.BaseDTO;
+import com.jeeplus.finance.projectRecords.service.dto.CwProjectRecordsDTO;
+import com.jeeplus.pubmodules.oss.service.dto.WorkAttachmentDto;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 财务管理-发票
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class CwFinanceInvoiceDTO extends BaseDTO {
+
+    public static final String BIZ_CODE = "4";
+
+
+    /**
+     * 发票申请编号
+     */
+    @Excel(name = "开票申请编号",width = 16)
+    private String no;
+
+    /**
+     * 项目名称
+     */
+    @Excel(name = "项目名称",width = 25)
+    private String programName;
+
+    /**
+     * 实际开票单位
+     */
+    @Excel(name = "实际开票单位",width = 25)
+    private String billingWorkplaceReal;
+
+    /**
+     * 经办人
+     */
+    @Excel(name = "经办人",width = 16)
+    private String operator;
+
+    /**
+     * 经办人部门
+     */
+    @Excel(name = "经办人部门",width = 16)
+    private String operatorOffice;
+
+    /**
+     * 发票号
+     */
+    @Excel(name = "发票号",width = 16)
+    private String number;
+
+    /**
+     * 开票金额(元)
+     */
+    @Excel(name = "开票金额(元)",width = 16,type = 10)
+    private String account;
+
+    /**
+     * 发票金额(元)
+     */
+    @Excel(name = "发票金额(元)",width = 16,type = 10)
+    private String accountDetail;
+
+    /**
+     * 开票内容
+     */
+    @Excel(name = "开票内容",width = 30,dict = "invoice_billing_content")
+    private String billingContent;
+
+    /**
+     * 发票类型
+     */
+    @Excel(name = "发票类型",width = 20,dict = "invoice_type")
+    private String type;
+
+    /**
+     * 开票时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    @Excel(name = "开票日期",width = 20,exportFormat = "yyyy-MM-dd")
+    private Date billingDate;
+
+    /**
+     * 状态
+     */
+    @Excel(name = "开票状态",width = 20,dict = "invoice_status")
+    private String status;
+
+    /**
+     * 收款日期
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    @Excel(name = "收款日期",width = 20,exportFormat = "yyyy-MM-dd")
+    private Date receivablesDate;
+
+    /**
+     * 是否确认收款
+     */
+    @Excel(name = "是否确认收款",width = 14, replace = {"是_1", "否_0"})
+    private String receivablesStatus;
+
+    /**
+     * 备注信息
+     */
+    private String remarks;
+
+    /**
+     * 开票类型
+     */
+    private String billingType;
+
+
+    /**
+     * 纳税人识别号
+     */
+    private String taxpayerIdentificationNo;
+
+    /**
+     * 地址
+     */
+    private String address;
+
+    /**
+     * 电话
+     */
+    private String telPhone;
+
+    /**
+     * 开户银行
+     */
+    private String openBank;
+
+    /**
+     * 银行账号
+     */
+    private String bankAccount;
+
+    /**
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 收款类型
+     */
+    private String receivablesType;
+
+    /**
+     * 开票内容要求
+     */
+    private String billingContentTerms;
+
+    /**
+     * 开票人
+     */
+    private String billingPeople;
+
+
+    /**
+     * 领票时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date collectDate;
+
+    /**
+     * 实际开票人
+     */
+    private String billingPeopleReal;
+
+    /**
+     * 对账人id
+     */
+    private String reconciliationPeople;
+
+    /**
+     * 对账人姓名
+     */
+    private String reconciliationPeopleName;
+
+    /**
+     * 对账地区
+     */
+    private String reconciliationArea;
+
+    /**
+     * 实际开票单位id
+     */
+    private String billingWorkplaceRealId;
+
+    /**
+     * 开票人id
+     */
+    private String billingPeopleId;
+
+    /**
+     * 流程id
+     */
+    private String procInsId;
+
+    /**
+     * 流程信息
+     */
+    private String processDefinitionId;
+
+    /**
+     * 是否作废
+     */
+    private String invalidStatus;
+
+    /**
+     * 基础项目信息
+     */
+    private List<CwProjectRecordsDTO> projectRecordsDTOList;
+
+    /**
+     * 基础信息
+     */
+    private List<CwFinanceInvoiceBaseDTO> financeInvoiceBaseDTOList;
+
+    /**
+     * 附件信息
+     */
+    private List<WorkAttachmentDto> workAttachmentDtoList;
+
+    /**
+     * 发票明细
+     */
+    private List<CwFinanceInvoiceDetailDTO> financeInvoiceDetailDTOList;
+
+    /**
+     * 收款明细
+     */
+    private List<CwFinanceInvoiceReceivablesDTO> financeInvoiceReceivablesDTOList;
+
+    /**
+     * 作废信息
+     */
+    private CwFinanceInvoiceInvalidDTO financeInvoiceInvalidDTO;
+
+    /**
+     * 开票总金额 Begin
+     */
+    private String accountBegin;
+
+    /**
+     * 开票总金额 End
+     */
+    private String accountEnd;
+
+    /**
+     * 开票日期 Begin
+     */
+    private String billingDateBegin;
+
+    /**
+     * 开票日期 End
+     */
+    private String billingDateEnd;
+
+    /**
+     * 收款日期Begin
+     */
+    private String remittanceDateBegin;
+
+    /**
+     * 收款日期End
+     */
+    private String remittanceDateEnd;
+
+    /**
+     * 项目id
+     */
+    private String programId;
+
+    /**
+     * 数据审核人  发票申请
+     */
+    private List<String> auditUserIds;
+
+    /**
+     * 发票作废  taskId
+     */
+    private String invalidTaskId;
+
+    /**
+     * 数据审核人  发票作废
+     */
+    private List<String> auditUserIdsInvalid;
+
+    /**
+     * 是否为收款页面   0否  1是
+     */
+    private String isReceivables;
+
+    /**
+     * 是否多张开票  1是  0否
+     */
+    private String isMultiple;
+
+    /**
+     * 实际开票单位的开票信息id
+     */
+    private String billingId;
+
+    private static final long serialVersionUID = 1L;
+}

+ 73 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/dto/CwFinanceInvoiceDetailDTO.java

@@ -0,0 +1,73 @@
+package com.jeeplus.finance.invoice.service.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import com.jeeplus.core.service.dto.BaseDTO;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 财务管理-发票明细
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class CwFinanceInvoiceDetailDTO extends BaseDTO {
+
+    /**
+     * 备注信息
+     */
+    private String remarks;
+
+    /**
+     * 发票id
+     */
+    private String invoiceId;
+
+    /**
+     * 发票代码
+     */
+    @Excel(name = "发票代码",width = 25)
+    private String code;
+
+    /**
+     * 发票号
+     */
+    @Excel(name = "发票号",width = 25)
+    private String number;
+
+    /**
+     * 开票金额(元)
+     */
+    @Excel(name = "开票金额(元)",width = 25)
+    private String account;
+
+    /**
+     * 税率
+     */
+    @Excel(name = "税率(%)",width = 25)
+    private String rate;
+
+    /**
+     * 金额
+     */
+    private String amount;
+
+    /**
+     * 税额
+     */
+    private String tax;
+
+    /**
+     * 累计登记金额
+     */
+    private String allAmount;
+
+    /**
+     * 纳税人识别号
+     */
+    @Excel(name = "纳税人识别号",width = 25)
+    private String taxpayerIdentificationNo;
+
+    private static final long serialVersionUID = 1L;
+}

+ 42 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/dto/CwFinanceInvoiceInvalidDTO.java

@@ -0,0 +1,42 @@
+package com.jeeplus.finance.invoice.service.dto;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import com.jeeplus.core.service.dto.BaseDTO;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 财务管理-发票-发票作废
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class CwFinanceInvoiceInvalidDTO extends BaseDTO {
+
+    /**
+     * 备注信息
+     */
+    private String remarks;
+
+    /**
+     * 发票id
+     */
+    private String invoiceId;
+
+    /**
+     * 是否作废
+     */
+    private String invalidStatus;
+
+    /**
+     * 流程id
+     */
+    private String procInsId;
+
+    /**
+     * 流程信息
+     */
+    private String processDefinitionId;
+
+    private static final long serialVersionUID = 1L;
+}

+ 53 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/dto/CwFinanceInvoiceReceivablesDTO.java

@@ -0,0 +1,53 @@
+package com.jeeplus.finance.invoice.service.dto;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jeeplus.core.domain.BaseEntity;
+import com.jeeplus.core.service.dto.BaseDTO;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * 财务管理-发票-收款明细
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class CwFinanceInvoiceReceivablesDTO extends BaseDTO {
+
+    /**
+     * 备注信息
+     */
+    private String remarks;
+
+    /**
+     * 发票id
+     */
+    private String invoiceId;
+
+    /**
+     * 汇款单位
+     */
+    private String remittanceUnit;
+
+    /**
+     * 汇款金额
+     */
+    private String remittanceAmount;
+
+    /**
+     * 汇款时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date remittanceDate;
+
+    /**
+     * 是否收款
+     */
+    private String status;
+
+    private static final long serialVersionUID = 1L;
+}

+ 15 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/mapstruct/CwFinanceInvoiceBaseWrapper.java

@@ -0,0 +1,15 @@
+package com.jeeplus.finance.invoice.service.mapstruct;
+
+import com.jeeplus.core.mapstruct.EntityWrapper;
+import com.jeeplus.finance.invoice.domain.CwFinanceInvoiceBase;
+import com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceBaseDTO;
+import org.mapstruct.Mapper;
+import org.mapstruct.ReportingPolicy;
+import org.mapstruct.factory.Mappers;
+
+@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {})
+public interface CwFinanceInvoiceBaseWrapper extends EntityWrapper<CwFinanceInvoiceBaseDTO, CwFinanceInvoiceBase>{
+
+        CwFinanceInvoiceBaseWrapper INSTANCE = Mappers.getMapper(CwFinanceInvoiceBaseWrapper.class);
+
+}

+ 15 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/mapstruct/CwFinanceInvoiceDetailWrapper.java

@@ -0,0 +1,15 @@
+package com.jeeplus.finance.invoice.service.mapstruct;
+
+import com.jeeplus.core.mapstruct.EntityWrapper;
+import com.jeeplus.finance.invoice.domain.CwFinanceInvoiceDetail;
+import com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceDetailDTO;
+import org.mapstruct.Mapper;
+import org.mapstruct.ReportingPolicy;
+import org.mapstruct.factory.Mappers;
+
+@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {})
+public interface CwFinanceInvoiceDetailWrapper extends EntityWrapper<CwFinanceInvoiceDetailDTO, CwFinanceInvoiceDetail>{
+
+        CwFinanceInvoiceDetailWrapper INSTANCE = Mappers.getMapper(CwFinanceInvoiceDetailWrapper.class);
+
+}

+ 15 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/mapstruct/CwFinanceInvoiceInvalidWrapper.java

@@ -0,0 +1,15 @@
+package com.jeeplus.finance.invoice.service.mapstruct;
+
+import com.jeeplus.core.mapstruct.EntityWrapper;
+import com.jeeplus.finance.invoice.domain.CwFinanceInvoiceInvalid;
+import com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceInvalidDTO;
+import org.mapstruct.Mapper;
+import org.mapstruct.ReportingPolicy;
+import org.mapstruct.factory.Mappers;
+
+@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {})
+public interface CwFinanceInvoiceInvalidWrapper extends EntityWrapper<CwFinanceInvoiceInvalidDTO, CwFinanceInvoiceInvalid>{
+
+        CwFinanceInvoiceInvalidWrapper INSTANCE = Mappers.getMapper(CwFinanceInvoiceInvalidWrapper.class);
+
+}

+ 15 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/mapstruct/CwFinanceInvoiceReceivablesWrapper.java

@@ -0,0 +1,15 @@
+package com.jeeplus.finance.invoice.service.mapstruct;
+
+import com.jeeplus.core.mapstruct.EntityWrapper;
+import com.jeeplus.finance.invoice.domain.CwFinanceInvoiceReceivables;
+import com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceReceivablesDTO;
+import org.mapstruct.Mapper;
+import org.mapstruct.ReportingPolicy;
+import org.mapstruct.factory.Mappers;
+
+@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {})
+public interface CwFinanceInvoiceReceivablesWrapper extends EntityWrapper<CwFinanceInvoiceReceivablesDTO, CwFinanceInvoiceReceivables>{
+
+        CwFinanceInvoiceReceivablesWrapper INSTANCE = Mappers.getMapper(CwFinanceInvoiceReceivablesWrapper.class);
+
+}

+ 15 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/mapstruct/CwFinanceInvoiceWrapper.java

@@ -0,0 +1,15 @@
+package com.jeeplus.finance.invoice.service.mapstruct;
+
+import com.jeeplus.core.mapstruct.EntityWrapper;
+import com.jeeplus.finance.invoice.domain.CwFinanceInvoice;
+import com.jeeplus.finance.invoice.service.dto.CwFinanceInvoiceDTO;
+import org.mapstruct.Mapper;
+import org.mapstruct.ReportingPolicy;
+import org.mapstruct.factory.Mappers;
+
+@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {})
+public interface CwFinanceInvoiceWrapper extends EntityWrapper<CwFinanceInvoiceDTO, CwFinanceInvoice>{
+
+        CwFinanceInvoiceWrapper INSTANCE = Mappers.getMapper(CwFinanceInvoiceWrapper.class);
+
+}

+ 323 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/util/EasyPoiUtil.java

@@ -0,0 +1,323 @@
+package com.jeeplus.finance.invoice.util;
+
+import cn.afterturn.easypoi.excel.ExcelExportUtil;
+import cn.afterturn.easypoi.excel.ExcelImportUtil;
+import cn.afterturn.easypoi.excel.entity.ExportParams;
+import cn.afterturn.easypoi.excel.entity.ImportParams;
+import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.IOException;
+import java.net.URLEncoder;
+import java.util.List;
+import java.util.Map;
+import java.util.NoSuchElementException;
+
+/**
+ * @Author Steel.D
+ * @Description easypoi导入导出通用工具类
+ * @Date 2019-7-31 9:29
+ * @Param
+ * @return
+ **/
+
+public class EasyPoiUtil {
+
+    /**
+     * 功能描述:复杂导出Excel,包括文件名以及表名。创建表头
+     *
+     * @param list           导出的实体类
+     * @param title          表头名称
+     * @param sheetName      sheet表名
+     * @param pojoClass      映射的实体类
+     * @param isCreateHeader 是否创建表头
+     * @param fileName
+     * @param response
+     * @return
+     * @author Steel.D
+     * @Date 2019-7-31 9:30
+     */
+
+    public static void exportExcel(List <?> list, String title, String sheetName, Class <?> pojoClass, String fileName, boolean isCreateHeader, HttpServletResponse response) {
+
+        ExportParams exportParams = new ExportParams ( title, sheetName );
+
+        exportParams.setCreateHeadRows ( isCreateHeader );
+
+        defaultExport ( list, pojoClass, fileName, response, exportParams );
+
+    }
+
+
+    /**
+     * 功能描述:复杂导出Excel,包括文件名以及表名,不创建表头
+     *
+     * @param list      导出的实体类
+     * @param title     表头名称
+     * @param sheetName sheet表名
+     * @param pojoClass 映射的实体类
+     * @param fileName  文件名
+     * @param response
+     * @return
+     * @author Steel.D
+     * @Date 2019-7-31 9:35
+     */
+
+    public static void exportExcel(List <?> list, String title, String sheetName, Class <?> pojoClass, String fileName, HttpServletResponse response) {
+        ExportParams exportParams = new ExportParams(title, sheetName);
+        exportParams.setDictHandler(new ExcelDiceAddressListHandlerImpl());
+        defaultExport ( list, pojoClass, fileName, response, exportParams );
+
+    }
+
+
+    /**
+     * 功能描述:Map 集合导出
+     *
+     * @param list     实体集合
+     * @param fileName 导出的文件名称
+     * @param response
+     * @return
+     * @author Steel.D
+     * @Date 2019-7-31 9:45
+     */
+
+    public static void exportExcel(List <Map <String, Object>> list, String fileName, HttpServletResponse response) {
+
+        defaultExport ( list, fileName, response );
+
+    }
+
+
+    /**
+     * 功能描述:默认导出方法
+     *
+     * @param list         导出的实体集合
+     * @param fileName     导出的文件名
+     * @param pojoClass    pojo实体
+     * @param exportParams ExportParams封装实体
+     * @param response
+     * @return
+     * @author Steel.D
+     * @Date 2019-7-31 9:50
+     */
+
+    private static void defaultExport(List <?> list, Class <?> pojoClass, String fileName, HttpServletResponse response, ExportParams exportParams) {
+
+        Workbook workbook = ExcelExportUtil.exportExcel ( exportParams, pojoClass, list );
+
+        if ( workbook != null ) {
+
+            downLoadExcel ( fileName, response, workbook );
+
+        }
+
+    }
+
+    /**
+     * 功能描述:Excel导出
+     *
+     * @param fileName 文件名称
+     * @param response
+     * @param workbook Excel对象
+     * @return
+     * @author Steel.D
+     * @Date 2019-7-31 10:35
+     */
+
+    private static void downLoadExcel(String fileName, HttpServletResponse response, Workbook workbook) {
+
+        try {
+
+            response.setCharacterEncoding ( "UTF-8" );
+
+            response.setHeader ( "content-Type", "application/vnd.ms-excel" );
+
+            response.setHeader ( "Content-Disposition", "attachment;filename=" + URLEncoder.encode ( fileName, "UTF-8" ) );
+
+            workbook.write ( response.getOutputStream ( ) );
+
+        } catch (IOException e) {
+
+            throw new RuntimeException ( e );
+
+        }
+
+    }
+
+
+    /**
+     * 功能描述:默认导出方法
+     *
+     * @param list     导出的实体集合
+     * @param fileName 导出的文件名
+     * @param response
+     * @return
+     * @author SteeL.D
+     * @Date 2019-7-31 10:45
+     */
+
+    private static void defaultExport(List <Map <String, Object>> list, String fileName, HttpServletResponse response) {
+
+        Workbook workbook = ExcelExportUtil.exportExcel ( list, ExcelType.HSSF );
+
+        if ( workbook != null ) ;
+
+        downLoadExcel ( fileName, response, workbook );
+
+    }
+
+
+    /**
+     * 功能描述:根据文件路径来导入Excel
+     *
+     * @param filePath   文件路径
+     * @param titleRows  表标题的行数
+     * @param headerRows 表头行数
+     * @param pojoClass  Excel实体类
+     * @return
+     * @author Steel.D
+     * @Date 2019-7-31 11:05
+     */
+
+    public static <T> List <T> importExcel(String filePath, Integer titleRows, Integer headerRows, Class <T> pojoClass) {
+
+        //判断文件是否存在
+
+        if ( StringUtils.isBlank ( filePath ) ) {
+
+            return null;
+
+        }
+
+        ImportParams params = new ImportParams ( );
+
+        params.setTitleRows ( titleRows );
+
+        params.setHeadRows ( headerRows );
+
+        List <T> list = null;
+
+        try {
+
+            list = ExcelImportUtil.importExcel ( new File ( filePath ), pojoClass, params );
+
+        } catch (NoSuchElementException e) {
+
+            throw new RuntimeException ( "模板不能为空" );
+
+        } catch (Exception e) {
+
+            e.printStackTrace ( );
+
+
+        }
+
+        return list;
+
+    }
+
+
+    /**
+     * 功能描述:根据接收的Excel文件来导入Excel,并封装成实体类
+     *
+     * @param file       上传的文件
+     * @param titleRows  表标题的行数
+     * @param headerRows 表头行数
+     * @param pojoClass  Excel实体类
+     * @return
+     * @author Steel.D
+     * @Date 2019-7-31 11:30
+     */
+
+    public static <T> List <T> importExcel(MultipartFile file, Integer titleRows, Integer headerRows, Class <T> pojoClass) {
+
+        if ( file == null ) {
+
+            return null;
+
+        }
+
+        ImportParams params = new ImportParams ( );
+
+        params.setTitleRows ( titleRows );
+
+        params.setHeadRows ( headerRows );
+
+        List <T> list = null;
+
+        try {
+
+            list = ExcelImportUtil.importExcel ( file.getInputStream ( ), pojoClass, params );
+
+        } catch (NoSuchElementException e) {
+
+            throw new RuntimeException ( "excel文件不能为空" );
+
+        } catch (Exception e) {
+            e.printStackTrace ();
+            throw new RuntimeException ( e.getMessage ( ) );
+
+        }
+
+        return list;
+
+    }
+
+    /**
+     * 功能描述:根据接收的Excel文件来导入Excel,并封装成实体类
+     *
+     * @param file       上传的文件
+     * @param titleRows  表标题的行数
+     * @param headerRows 表头行数
+     * @param sheetNum   开始sheet页
+     * @param sheetNum   sheet页数
+     * @param pojoClass  Excel实体类
+     * @return
+     * @author Steel.D
+     * @Date 2019-7-31 11:30
+     */
+    public static <T> List <T> importSheetExcel(MultipartFile file, Integer titleRows, Integer headerRows, Integer startSheetIndex, Integer sheetNum, Class <T> pojoClass) {
+
+        if ( file == null ) {
+
+            return null;
+
+        }
+
+        ImportParams params = new ImportParams ( );
+
+        params.setTitleRows ( titleRows );
+
+        params.setHeadRows ( headerRows );
+
+        params.setStartSheetIndex(startSheetIndex);
+
+        params.setSheetNum(sheetNum);
+
+        List <T> list = null;
+
+        try {
+
+            list = ExcelImportUtil.importExcel ( file.getInputStream ( ), pojoClass, params );
+
+        } catch (NoSuchElementException e) {
+
+            throw new RuntimeException ( "excel文件不能为空" );
+
+        } catch (Exception e) {
+            e.printStackTrace ();
+            throw new RuntimeException ( e.getMessage ( ) );
+
+        }
+
+        return list;
+
+    }
+
+
+}

+ 66 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/util/ExcelDiceAddressListHandlerImpl.java

@@ -0,0 +1,66 @@
+package com.jeeplus.finance.invoice.util;
+
+import cn.afterturn.easypoi.handler.inter.IExcelDictHandler;
+import cn.hutool.core.util.ObjectUtil;
+import com.jeeplus.sys.service.dto.DictValueDTO;
+import com.jeeplus.sys.utils.DictUtils;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 模拟使用,生产请用真实字典
+ *
+ */
+public class ExcelDiceAddressListHandlerImpl implements IExcelDictHandler {
+
+    /**
+     * 返回字典所有值
+     * key: dictKey
+     *
+     * @param dict 字典Key
+     * @return
+     */
+    @Override
+    public List<Map> getList(String dict) {
+        List<Map> list = new ArrayList<> ();
+//        Map<String, String> dictMap = new HashMap<>();
+//        dictMap.put("dictKey", "0");
+//        dictMap.put("dictValue", "严重瞌睡");
+//        list.add(dictMap);
+//        dictMap = new HashMap<>();
+//        dictMap.put("dictKey", "1");
+//        dictMap.put("dictValue", "小B");
+//        list.add(dictMap);
+//        dictMap = new HashMap<>();
+//        dictMap.put("dictKey", "1");
+//        dictMap.put("dictValue", "深度富有");
+//        list.add(dictMap);
+        List<DictValueDTO> dictValueDTOs = DictUtils.getDictMap ().get (dict);
+        dictValueDTOs.forEach (dictValueDTO -> {
+            Map<String, String> dictMap = new HashMap<> ();
+            dictMap.put ("dictKey", dictValueDTO.getValue ());
+            dictMap.put ("dictValue", dictValueDTO.getLabel ());
+            list.add (dictMap);
+        });
+        return list;
+    }
+
+    @Override
+    public String toName(String dict, Object obj, String name, Object value) {
+        if (ObjectUtil.isNotEmpty(value)) {
+            return DictUtils.getDictLabel (value.toString (), dict, null);
+        }
+        return "";
+    }
+
+    @Override
+    public String toValue(String dict, Object obj, String name, Object value) {
+        if (ObjectUtil.isNotEmpty(value)) {
+            return DictUtils.getDictLabel (value.toString (), dict, null);
+        }
+        return "";
+    }
+}

+ 104 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/util/FlowTaskUtil.java

@@ -0,0 +1,104 @@
+package com.jeeplus.finance.invoice.util;
+
+//先注释import com.jeeplus.flowable.service.FlowTaskService;
+import com.jeeplus.flowable.feign.IFlowableApi;
+import com.jeeplus.sys.utils.SpringContextHolder;
+//import org.flowable.task.api.Task;
+//先注释import org.flowable.task.api.Task;
+
+import javax.annotation.Resource;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.List;
+
+/**
+ * @author: 徐滕
+ * @version: 2022-12-08 15:34
+ */
+public class FlowTaskUtil {
+
+    @Resource
+    private IFlowableApi iFlowableApi;
+
+//    private FlowTaskService flowTaskService = SpringContextHolder.getBean(FlowTaskService.class);
+
+
+//    public <T> List<T> taskDispose(List<T> list) {
+//
+//        List<Task> taskList = iFlowableApi.getRecords();
+//        Method procInsIdMethod = null;
+//        Method processDefinitionIdMethod = null;
+//        Method statusMethod = null;
+//        for (T info : list ) {
+//            Class<? extends Object> tClass = info.getClass();
+//            //得到所有属性
+//            Field[] fields = tClass.getDeclaredFields();
+//            Class<? extends Object> superClass = tClass.getSuperclass();
+//            //得到所有属性
+//            Field[] superField = superClass.getDeclaredFields();
+//            Field[] field = concat(fields,superField);
+//
+//            for (Task taskInfo : taskList) {
+//                Integer taskIdInteger = null;
+//                try {
+//                    for (Integer i=0; i<field.length; i++ ){
+//                        //获取属性的名字
+//                        String name = field[i].getName();
+//                        //将属性名字的首字母大写
+//                        name = name.replaceFirst(name.substring(0, 1), name.substring(0, 1).toUpperCase());
+//
+//                        if("ProcInsId".equals(name)){
+//                            field[i].setAccessible(true);
+//                            //整合出 getId() 属性这个方法
+//                            procInsIdMethod = tClass.getMethod("get"+name);
+//
+//                        }else if("ProcessDefinitionId".equals(name)){
+//                            field[i].setAccessible(true);
+//                            //整合出 getId() 属性这个方法
+//                            processDefinitionIdMethod = tClass.getMethod("get"+name);
+//
+//                        }else if("Status".equals(name)){
+//                            field[i].setAccessible(true);
+//                            //整合出 getId() 属性这个方法
+//                            statusMethod = tClass.getMethod("get"+name);
+//
+//                        }else if("TaskId".equals(name)){
+//                            field[i].setAccessible(true);
+//                            //整合出 getId() 属性这个方法
+//                            taskIdInteger = i;
+//
+//                        }
+//                    }
+//
+//                    //调用这个整合出来的get方法,强转成自己需要的类型
+//                    String procInsId = (String)procInsIdMethod.invoke(info);
+//                    String processDefinitionId = (String)processDefinitionIdMethod.invoke(info);
+//                    String status = (String)statusMethod.invoke(info);
+//
+//                    if(procInsId.equals(taskInfo.getProcessInstanceId()) && processDefinitionId.equals(taskInfo.getProcessDefinitionId()) && "4".equals(status)){
+//                        field[taskIdInteger].set(info,taskInfo.getId());
+//                    }
+//                } catch (Exception e) {
+//                    e.printStackTrace();
+//                }
+//            }
+//        }
+//        return list;
+//
+//    }
+
+    /**
+     * 数据整合方法
+     * @param a
+     * @param b
+     * @return
+     */
+    static Field[] concat(Field[] a, Field[] b) {
+
+        Field[] c= new Field[a.length+b.length];
+        System.arraycopy(a, 0, c, 0, a.length);
+        System.arraycopy(b, 0, c, a.length, b.length);
+        return c;
+    }
+
+}

+ 25 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/util/FreemarkerUtil.java

@@ -0,0 +1,25 @@
+package com.jeeplus.finance.invoice.util;
+
+import freemarker.template.Template;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.util.Map;
+
+public class FreemarkerUtil {
+    public static void generateFile(Map<?, ?> dataMap, Template template, File file){
+
+        Template t = template;
+        try {
+            // 这个地方不能使用FileWriter因为需要指定编码类型否则生成的Word文档会因为有无法识别的编码而无法打开
+            Writer w = new OutputStreamWriter(new FileOutputStream(file), "UTF-8");
+            t.process(dataMap, w);
+            w.close();
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            throw new RuntimeException(ex);
+        }
+    }
+}

+ 61 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/util/ResponseUtil.java

@@ -0,0 +1,61 @@
+package com.jeeplus.finance.invoice.util;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.net.URLEncoder;
+import java.util.Calendar;
+
+public class ResponseUtil {
+    private static Logger logger = LoggerFactory.getLogger(ResponseUtil.class);
+
+    public static void docResponse(String fileName, File file, HttpServletResponse response) {
+        ServletOutputStream out = null;
+        FileInputStream fin = null;
+        try {
+            fin = new FileInputStream(file);
+            response.setCharacterEncoding("utf-8");
+            response.setContentType("application/octet-stream; charset=UTF-8");
+            // 设置浏览器以下载的方式处理该文件名
+            response.setHeader("Content-Disposition", "attachment;filename="
+                    .concat(String.valueOf(URLEncoder.encode(fileName, "UTF-8"))));
+            out = response.getOutputStream();
+            byte[] buffer = new byte[1024];  // 缓冲区
+            int bytesToRead = -1;
+            // 通过循环将读入的Word文件的内容输出到浏览器中
+            while ((bytesToRead = fin.read(buffer)) != -1) {
+                out.write(buffer, 0, bytesToRead);
+            }
+        } catch (Exception e) {
+            logger.error("导出模板文件发生错误!",e);
+        } finally {
+            try {
+                out.flush();
+                if (fin != null) fin.close();
+                if (out != null) out.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+
+        }
+    }
+
+
+    /**
+     * 获取当前时间年月日
+     * @return
+     */
+    public static String datePath(){
+        Calendar date = Calendar.getInstance();
+        String year = String.valueOf(date.get(Calendar.YEAR));
+        String month = String.valueOf(date.get(Calendar.MONTH)+1);
+        String day = String.valueOf(date.get(Calendar.DAY_OF_MONTH));
+        String path = "/"+year+"/"+month+"/"+day;
+        return path;
+    }
+}

+ 815 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/util/SignaturePostUtil.java

@@ -0,0 +1,815 @@
+package com.jeeplus.finance.invoice.util;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.jeeplus.finance.invoice.domain.SealUserInfo;
+import com.jeeplus.sys.utils.Global;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.HttpStatus;
+import org.apache.http.NameValuePair;
+import org.apache.http.client.ClientProtocolException;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.utils.URLEncodedUtils;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.message.BasicNameValuePair;
+import org.apache.http.util.EntityUtils;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.*;
+import java.net.HttpURLConnection;
+import java.net.URI;
+import java.net.URL;
+import java.net.URLConnection;
+import java.nio.charset.Charset;
+import java.util.*;
+import java.util.Map.Entry;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+/**
+ * @author: 徐滕
+ * @create: 2021-11-02 14:20
+ **/
+public class SignaturePostUtil {
+
+    //竖版模板templateId
+    private static final String VERTICALTEMPLATEID = Global.getConfig("vertical_templateId");
+    //横板模板templateId
+    private static final String ACROSSTEMPLATEID = Global.getConfig("across_templateId");
+    private static final String HTTPTOP = Global.getConfig("signature_http_top");
+
+    private final static String apptoken = Global.getConfig("apptoken");
+    private final static String appsecret = Global.getConfig("appsecret");
+    private final static String signature = Global.getConfig("signature");
+
+
+    /**
+     * 发送get请求
+     *
+     * @param requestUrl
+     *      请求url
+     * @param requestHeader
+     *      请求头
+     * @param responseEncoding
+     *      响应编码
+     * @return 页面响应html
+     */
+    public static String sendGet(String requestUrl, Map<String, String> requestHeader, String responseEncoding) {
+        String result = "";
+        BufferedReader reader = null;
+        try {
+            if (requestUrl == null || requestUrl.isEmpty()) {
+                return result;
+            }
+            URL realUrl = new URL(requestUrl);
+            URLConnection connection = realUrl.openConnection();
+            connection.setRequestProperty("accept", "text/html, application/xhtml+xml, image/jxr, */*");
+            connection.setRequestProperty("user-agent", "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0");
+            if (requestHeader != null && requestHeader.size() > 0) {
+                for (Entry<String, String> entry : requestHeader.entrySet()) {
+                    connection.setRequestProperty(entry.getKey(), entry.getValue());
+                }
+            }
+            connection.connect();
+            if (responseEncoding == null || responseEncoding.isEmpty()) {
+                responseEncoding = "UTF-8";
+            }
+            reader = new BufferedReader(new InputStreamReader(connection.getInputStream(), responseEncoding));
+            String line;
+            while ((line = reader.readLine()) != null) {
+                result += line;
+            }
+        } catch (Exception e) {
+            System.out.println("发送GET请求出现异常!");
+            e.printStackTrace();
+        } finally {
+            try {
+                if (reader != null) {
+                    reader.close();
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        result = decodeUnicode(result);
+        return result;
+    }
+
+    /**
+     * 发送下载压缩包get请求
+     * @param requestUrl 请求url
+     * @param requestHeader 请求头
+     * @param fileName 下载文件名称
+     * @param responseEncoding 响应编码
+     * @return 页面响应html
+     */
+    public static String downloadZipGet(String requestUrl, Map<String, String> requestHeader, String fileName, String responseEncoding, HttpServletResponse response) {
+        String result = "";
+        BufferedReader reader = null;
+        try {
+            if (requestUrl == null || requestUrl.isEmpty()) {
+                return result;
+            }
+            URL realUrl = new URL(requestUrl);
+            URLConnection connection = realUrl.openConnection();
+            connection.setRequestProperty("accept", "text/html, application/xhtml+xml, image/jxr, */*");
+            connection.setRequestProperty("user-agent", "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0");
+            if (requestHeader != null && requestHeader.size() > 0) {
+                for (Entry<String, String> entry : requestHeader.entrySet()) {
+                    connection.setRequestProperty(entry.getKey(), entry.getValue());
+                }
+            }
+            connection.setRequestProperty("Content-Type", "application/zip");
+            connection.connect();
+            if (responseEncoding == null || responseEncoding.isEmpty()) {
+                responseEncoding = "UTF-8";
+            }
+            InputStream inputStream = connection.getInputStream();
+            //获取自己数组
+            byte[] getData = readInputStream(inputStream);
+
+            //设置HTTP响应头
+            response.reset();//重置 响应头
+            response.setContentType("application/x-download");//告知浏览器下载文件,而不是直接打开,浏览器默认为打开
+            fileName = new String(fileName.getBytes("UTF-8"), "ISO-8859-1");
+            response.addHeader("Content-Disposition" ,"attachment;filename=" +fileName+ "");//下载文件的名称
+            // 循环取出流中的数据
+            response.getOutputStream().write(getData);
+            response.getOutputStream().close();
+
+            if(inputStream!=null){
+                inputStream.close();
+            }
+
+        } catch (Exception e) {
+            System.out.println("发送GET请求出现异常!");
+            e.printStackTrace();
+        } finally {
+            try {
+                if (reader != null) {
+                    reader.close();
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        return result;
+    }
+
+    /**
+     * 下载文件并保存到指定位置
+     * @param requestUrl 请求url
+     * @param requestHeader 请求头
+     * @param fileName 下载文件名称
+     * @param responseEncoding 响应编码
+     * @return 页面响应html
+     */
+    public static Map<String,Object> downloadZipDesignated(String requestUrl, Map<String, String> requestHeader, String fileName, String responseEncoding) {
+        Map<String,Object> map = new HashMap<>();
+        BufferedReader reader = null;
+        try {
+            if (requestUrl == null || requestUrl.isEmpty()) {
+                map.put("success",false);
+                map.put("message",fileName + " 的请求路径为空");
+                map.put("fileName",fileName);
+                map.put("filePath","");
+                return map;
+            }
+            URL realUrl = new URL(requestUrl);
+            URLConnection connection = realUrl.openConnection();
+            connection.setRequestProperty("accept", "text/html, application/xhtml+xml, image/jxr, */*");
+            connection.setRequestProperty("user-agent", "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0");
+            if (requestHeader != null && requestHeader.size() > 0) {
+                for (Entry<String, String> entry : requestHeader.entrySet()) {
+                    connection.setRequestProperty(entry.getKey(), entry.getValue());
+                }
+            }
+            connection.setRequestProperty("Content-Type", "application/zip");
+            connection.connect();
+            if (responseEncoding == null || responseEncoding.isEmpty()) {
+                responseEncoding = "UTF-8";
+            }
+            InputStream inputStream = connection.getInputStream();
+
+            BufferedInputStream bis = new BufferedInputStream(inputStream);
+            //判断文件的保存路径后面是否以/结尾
+            String filePath = null;
+            if(System.getProperty("os.name").toLowerCase().contains("win")){
+                filePath = "D:/attachment-file/";
+            }else{
+                filePath = "/attachment-file/";
+            }
+            //写入到文件(注意文件保存路径的后面一定要加上文件的名称)
+            fileName = fileName.replaceAll("\\\\","");
+            fileName = fileName.replaceAll("/","");
+            fileName = fileName.replaceAll("\\*","");
+            fileName = fileName.replaceAll("\\?","");
+            fileName = fileName.replaceAll("\"","");
+            fileName = fileName.replaceAll("<","");
+            fileName = fileName.replaceAll(">","");
+            fileName = fileName.replaceAll("\\|","");
+            fileName = fileName.replaceAll("\\’","'");
+            fileName = fileName.replaceAll("\\”","\"");
+            fileName = fileName.replaceAll("【","(");
+            fileName = fileName.replaceAll("\\{","(");
+            fileName = fileName.replaceAll("】",")");
+            fileName = fileName.replaceAll("}",")");
+            fileName = fileName.replaceAll(",",",");
+            fileName = fileName.replaceAll(":",":");
+            fileName = fileName.replaceAll("—","-");
+            fileName = fileName.replaceAll("……","");
+            fileName = fileName.replaceAll("±","");
+            fileName = fileName.replaceAll("#","");
+            fileName = fileName.replaceAll("%","");
+            fileName = fileName.replaceAll("Π","");
+
+            FileOutputStream fileOut = new FileOutputStream(filePath + fileName);
+            BufferedOutputStream bos = new BufferedOutputStream(fileOut);
+
+            byte[] buf = new byte[4096];
+            int length = bis.read(buf);
+            //保存文件
+            while(length != -1)
+            {
+                bos.write(buf, 0, length);
+                length = bis.read(buf);
+            }
+            //response.getOutputStream().close();
+            bos.close();
+            fileOut.close();
+            bis.close();
+            if(inputStream!=null){
+                inputStream.close();
+            }
+            map.put("success",true);
+            map.put("message","下载成功");
+            map.put("fileName",fileName);
+            map.put("filePath",filePath);
+        } catch (Exception e) {
+            System.out.println("发送GET请求出现异常!");
+            e.printStackTrace();
+        } finally {
+            try {
+                if (reader != null) {
+                    reader.close();
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        return map;
+    }
+
+    /**
+     * 从输入流中获取字节数组
+     * @param inputStream
+     * @return
+     * @throws IOException
+     */
+    public static byte[] readInputStream(InputStream inputStream) throws IOException {
+        byte[] buffer = new byte[1024];
+        int len = 0;
+        ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        while((len = inputStream.read(buffer)) != -1) {
+            bos.write(buffer, 0, len);
+        }
+        bos.close();
+        return bos.toByteArray();
+    }
+
+    /**
+     * 发送post请求
+     *
+     * @param requestUrl 请求url
+     * @param requestHeader 请求头
+     * @param formTexts 表单数据
+     * @param files 上传文件
+     * @param requestEncoding 请求编码
+     * @param responseEncoding 响应编码
+     * @return 页面响应html
+     */
+    public static String sendPost(String requestUrl, Map<String, String> requestHeader, Map<String, String> formTexts, File[] files, String requestEncoding, String responseEncoding) {
+        OutputStream out = null;
+        BufferedReader reader = null;
+        String result = "";
+        try {
+            if (requestUrl == null || requestUrl.isEmpty()) {
+                return result;
+            }
+            URL realUrl = new URL(requestUrl);
+            HttpURLConnection connection = (HttpURLConnection) realUrl.openConnection();
+            connection.setRequestProperty("accept", "text/html, application/xhtml+xml, image/jxr, */*");
+            connection.setRequestProperty("user-agent", "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0");
+            if (requestHeader != null && requestHeader.size() > 0) {
+                for (Entry<String, String> entry : requestHeader.entrySet()) {
+                    connection.setRequestProperty(entry.getKey(), entry.getValue());
+                }
+            }
+            connection.setDoOutput(true);
+            connection.setDoInput(true);
+            connection.setRequestMethod("POST");
+            if (requestEncoding == null || requestEncoding.isEmpty()) {
+                requestEncoding = "UTF-8";
+            }
+            if (responseEncoding == null || responseEncoding.isEmpty()) {
+                responseEncoding = "UTF-8";
+            }
+            if (requestHeader != null && requestHeader.size() > 0) {
+                for (Entry<String, String> entry : requestHeader.entrySet()) {
+                    connection.setRequestProperty(entry.getKey(), entry.getValue());
+                }
+            }
+            if (files == null || files.length == 0) {
+                String boundary = "-----------------------------" + String.valueOf(new Date().getTime());
+                connection.setRequestProperty("content-type", "multipart/form-data; boundary=" + boundary);
+                out = new DataOutputStream(connection.getOutputStream());
+                if (formTexts != null && formTexts.size() > 0) {
+                    StringBuilder sbFormData = new StringBuilder();
+                    for (Entry<String, String> entry : formTexts.entrySet()) {
+                        sbFormData.append("--" + boundary + "\r\n");
+                        sbFormData.append("Content-Disposition: form-data; name=\"" + entry.getKey() + "\"\r\n\r\n");
+                        sbFormData.append(entry.getValue() + "\r\n");
+                    }
+                    out.write(sbFormData.toString().getBytes(requestEncoding));
+                }
+            } else {
+                String boundary = "-----------------------------" + String.valueOf(new Date().getTime());
+                connection.setRequestProperty("content-type", "multipart/form-data; boundary=" + boundary);
+                out = new DataOutputStream(connection.getOutputStream());
+                if (formTexts != null && formTexts.size() > 0) {
+                    StringBuilder sbFormData = new StringBuilder();
+                    for (Entry<String, String> entry : formTexts.entrySet()) {
+                        sbFormData.append("--" + boundary + "\r\n");
+                        sbFormData.append("Content-Disposition: form-data; name=\"" + entry.getKey() + "\"\r\n\r\n");
+                        sbFormData.append(entry.getValue() + "\r\n");
+                    }
+                    out.write(sbFormData.toString().getBytes(requestEncoding));
+                }
+                for (File file : files) {
+                    if (!file.exists()) {
+                        continue;
+                    }
+                    out.write(("--" + boundary + "\r\n").getBytes(requestEncoding));
+                    out.write(("Content-Disposition: form-data; name=\" file \"; filename=\"" + file.getName() + "\"\r\n").getBytes(requestEncoding));
+                    out.write(("Content-Type: application/x-msdownload\r\n\r\n").getBytes(requestEncoding));
+                    DataInputStream in = new DataInputStream(new FileInputStream(file));
+                    int bytes = 0;
+                    byte[] bufferOut = new byte[1024];
+                    while ((bytes = in.read(bufferOut)) != -1) {
+                        out.write(bufferOut, 0, bytes);
+                    }
+                    in.close();
+                    out.write(("\r\n").getBytes(requestEncoding));
+                }
+                out.write(("--" + boundary + "--").getBytes(requestEncoding));
+            }
+            out.flush();
+            out.close();
+            out = null;
+            reader = new BufferedReader(new InputStreamReader(connection.getInputStream(), responseEncoding));
+            String line;
+            while ((line = reader.readLine()) != null) {
+                result += line;
+            }
+        } catch (Exception e) {
+            System.out.println("发送POST请求出现异常!");
+            e.printStackTrace();
+        } finally {
+            try {
+                if (out != null) {
+                    out.close();
+                }
+                if (reader != null) {
+                    reader.close();
+                }
+            } catch (IOException ex) {
+                ex.printStackTrace();
+            }
+        }
+        result = decodeUnicode(result);
+        return result;
+    }
+
+    /**
+     * ApplicationJson的post请求
+     * @return
+     */
+    public static String sendPostApplicationJson(String url, String jsonString) {
+        CloseableHttpClient httpClient = null;
+        CloseableHttpResponse httpResponse = null;
+        String result = "";
+        // 创建httpClient实例
+        httpClient = HttpClients.createDefault();
+        // 创建httpPost远程连接实例
+        HttpPost httpPost = new HttpPost(url);
+        // 配置请求参数实例
+        RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(35000)// 设置连接主机服务超时时间
+                .setConnectionRequestTimeout(35000)// 设置连接请求超时时间
+                .setSocketTimeout(60000)// 设置读取数据连接超时时间
+                .build();
+        // 为httpPost实例设置配置
+        httpPost.setConfig(requestConfig);
+        // 设置请求头鉴权
+        httpPost.setHeader("x-qys-accesstoken", apptoken);
+        httpPost.setHeader("x-qys-signature", signature);
+        httpPost.setHeader("x-qys-timestamp", "0");
+        // 包含内容格式设置
+        httpPost.addHeader("Content-Type", "application/json");
+        // 封装post请求参数
+        if (null != jsonString) {
+            // 为httpPost设置封装好的请求参数
+            System.out.println("添加到实体------");
+            httpPost.setEntity(new StringEntity(jsonString, "UTF-8"));
+        }
+        try {
+            // httpClient对象执行post请求,并返回响应参数对象
+            httpResponse = httpClient.execute(httpPost);
+            // 从响应对象中获取响应内容
+            HttpEntity entity = httpResponse.getEntity();
+            result = EntityUtils.toString(entity);
+        } catch (ClientProtocolException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            // 关闭资源
+            if (null != httpResponse) {
+                try {
+                    httpResponse.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+            if (null != httpClient) {
+                try {
+                    httpClient.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        result = decodeUnicode(result);
+        System.out.println(result);
+        return result;
+    }
+    /**
+     * imagePng的post请求
+     * @return
+     */
+    public static String sendPostImagePng(String url, String jsonString) {
+        CloseableHttpClient httpClient = null;
+        CloseableHttpResponse httpResponse = null;
+        String result = "";
+        // 创建httpClient实例
+        httpClient = HttpClients.createDefault();
+        // 创建httpPost远程连接实例
+        HttpPost httpPost = new HttpPost(url);
+        // 配置请求参数实例
+        RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(35000)// 设置连接主机服务超时时间
+                .setConnectionRequestTimeout(35000)// 设置连接请求超时时间
+                .setSocketTimeout(60000)// 设置读取数据连接超时时间
+                .build();
+        // 为httpPost实例设置配置
+        httpPost.setConfig(requestConfig);
+        // 设置请求头鉴权
+        httpPost.setHeader("x-qys-accesstoken", apptoken);
+        httpPost.setHeader("x-qys-signature", signature);
+        httpPost.setHeader("x-qys-timestamp", "0");
+        // 包含内容格式设置
+        httpPost.addHeader("Content-Type", "image/png");
+        // 封装post请求参数
+        if (null != jsonString) {
+            // 为httpPost设置封装好的请求参数
+            System.out.println("添加到实体------");
+            httpPost.setEntity(new StringEntity(jsonString, "UTF-8"));
+        }
+        try {
+            // httpClient对象执行post请求,并返回响应参数对象
+            httpResponse = httpClient.execute(httpPost);
+            // 从响应对象中获取响应内容
+            HttpEntity entity = httpResponse.getEntity();
+            result = EntityUtils.toString(entity);
+        } catch (ClientProtocolException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            // 关闭资源
+            if (null != httpResponse) {
+                try {
+                    httpResponse.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+            if (null != httpClient) {
+                try {
+                    httpClient.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        result = decodeUnicode(result);
+        System.out.println(result);
+        return result;
+    }
+
+    public static String decodeUnicode(String asciicode) {
+        String[] asciis = asciicode.split ("\\\\u");
+        String nativeValue = asciis[0];
+        try
+        {
+            for ( int i = 1; i < asciis.length; i++ )
+            {
+                String code = asciis[i];
+                nativeValue += (char) Integer.parseInt (code.substring (0, 4), 16);
+                if (code.length () > 4)
+                {
+                    nativeValue += code.substring (4, code.length ());
+                }
+            }
+        }
+        catch (NumberFormatException e)
+        {
+            return asciicode;
+        }
+        return nativeValue;
+    }
+
+    /**
+     * 根据文件创建合同信息
+     * @param srcFile
+     * @return
+     */
+    public static HashMap getDocument(File srcFile) {
+        //截取文件后缀名
+        String substring = srcFile.getName().substring(srcFile.getName().lastIndexOf(".")+1, srcFile.getName().length());
+        //截取文件名称
+        String fileName = srcFile.getName().substring(0,srcFile.getName().lastIndexOf("."));
+        //添加请求头
+        Map<String,String> requestHeaderMap = new HashMap<>();
+        requestHeaderMap.put("x-qys-accesstoken", apptoken);
+        requestHeaderMap.put("x-qys-signature", signature);
+        requestHeaderMap.put("x-qys-timestamp", "0");
+        //添加文件参数
+        Map<String,String> formTextsMap = new HashMap<>();
+        formTextsMap.put("title",fileName);
+        formTextsMap.put("fileType",substring);
+        //创建文件数组
+        File[] files = new File[]{srcFile};
+        //访问方法
+        String documentResult = sendPost(HTTPTOP + "/v2/document/createbyfile", requestHeaderMap, formTextsMap, files, "", "");
+        HashMap hashMap = JSON.parseObject(documentResult, HashMap.class);
+
+        return hashMap;
+    }
+
+    /**
+     * 运行无效合同信息
+     * @param fileName
+     * @param invalidFile
+     * @return
+     */
+    public static String getVerticalInvalidDocument(String fileName,File invalidFile){
+        File[] files = new File[]{invalidFile};
+        //添加请求头
+        Map<String,String> requestHeaderMap = new HashMap<>();
+        requestHeaderMap.put("x-qys-accesstoken", apptoken);
+        requestHeaderMap.put("x-qys-signature", signature);
+        requestHeaderMap.put("x-qys-timestamp", "0");
+        //添加文件参数
+        Map<String,String> formTextsMap = new HashMap<>();
+        formTextsMap.put("title",fileName);
+        formTextsMap.put("templateId",VERTICALTEMPLATEID);
+        //访问方法
+        String documentResult = sendPost(HTTPTOP + "/document/createbytemplate", requestHeaderMap, formTextsMap, files, "", "");
+        HashMap hashMap = JSON.parseObject(documentResult, HashMap.class);
+        String code = hashMap.get("code").toString();
+        if("0".equals(code)){
+            String documentId = hashMap.get("documentId").toString();
+            return documentId;
+        }
+        return "";
+    }
+
+    /**
+     * 运行无效合同信息
+     * @param fileName
+     * @param invalidFile
+     * @return
+     */
+    public static String getAcrossVerticalInvalidDocument(String fileName,File invalidFile){
+        File[] files = new File[]{invalidFile};
+        //添加请求头
+        Map<String,String> requestHeaderMap = new HashMap<>();
+        requestHeaderMap.put("x-qys-accesstoken", apptoken);
+        requestHeaderMap.put("x-qys-signature", signature);
+        requestHeaderMap.put("x-qys-timestamp", "0");
+        //添加文件参数
+        Map<String,String> formTextsMap = new HashMap<>();
+        formTextsMap.put("title",fileName);
+        formTextsMap.put("templateId",ACROSSTEMPLATEID);
+        //访问方法
+        String documentResult = sendPost(HTTPTOP + "/document/createbytemplate", requestHeaderMap, formTextsMap, files, "", "");
+        HashMap hashMap = JSON.parseObject(documentResult, HashMap.class);
+        String code = hashMap.get("code").toString();
+        if("0".equals(code)){
+            String documentId = hashMap.get("documentId").toString();
+            return documentId;
+        }
+        return "";
+    }
+
+
+    public static String doGet(Map<String, String> paramMap, String url){
+        String result = "";
+        HttpGet get = new HttpGet(url);
+        try{
+            // 设置请求头鉴权
+            get.setHeader("x-qys-accesstoken", apptoken);
+            get.setHeader("x-qys-signature", signature);
+            get.setHeader("x-qys-timestamp", "0");
+            CloseableHttpClient httpClient = HttpClients.createDefault();
+            List<NameValuePair> params = setHttpParams(paramMap);
+            String param = URLEncodedUtils.format(params, "UTF-8");
+            get.setURI(URI.create(url + "?" + param));
+            HttpResponse response = httpClient.execute(get);
+            result = getHttpEntityContent(response);
+
+            if(response.getStatusLine().getStatusCode()!= HttpStatus.SC_OK){
+                result = "服务器异常";
+            }
+        } catch (Exception e){
+            System.out.println("请求异常");
+            throw new RuntimeException(e);
+        } finally{
+            get.abort();
+        }
+        result = decodeUnicode(result);
+        return result;
+    }
+
+    public static List<NameValuePair> setHttpParams(Map<String, String> paramMap){
+        List<NameValuePair> params = new ArrayList<NameValuePair>();
+        Set<Entry<String, String>> set = paramMap.entrySet();
+        for(Entry<String, String> entry : set){
+            params.add(new BasicNameValuePair(entry.getKey(), entry.getValue()));
+        }
+        return params;
+    }
+
+    public static String getHttpEntityContent(HttpResponse response) throws UnsupportedOperationException, IOException{
+        String result = "";
+        HttpEntity entity = response.getEntity();
+        if(entity != null){
+            InputStream in = entity.getContent();
+            BufferedReader br = new BufferedReader(new InputStreamReader(in, "utf-8"));
+            StringBuilder strber= new StringBuilder();
+            String line = null;
+            while((line = br.readLine())!=null){
+                strber.append(line+'\n');
+            }
+            br.close();
+            in.close();
+            result = strber.toString();
+        }
+
+        return result;
+    }
+
+
+    /**
+     * 根据用户手机号查询用户章信息
+     * @param userMobile
+     * @param employeeNo 用户编号
+     * @param sealName 印章名称
+     * @return
+     */
+    public static String getUserSealByMobile(String userMobile,String employeeNo,String sealName){
+        //根据contractId将文件下载下来 并上传到阿里云服务种
+        //添加请求头
+        Map<String,String> requestHeaderMap = new HashMap<>();
+        requestHeaderMap.put("x-qys-accesstoken", apptoken);
+        requestHeaderMap.put("x-qys-signature", signature);
+        requestHeaderMap.put("x-qys-timestamp", "0");
+
+        Map map =new HashMap();
+        map.put("companyName","江苏兴光项目管理有限公司");
+        map.put("mobile",userMobile);
+        map.put("employeeNo",employeeNo);
+        String viewUrlStr = SignaturePostUtil.doGet(map, HTTPTOP + "/seal/user/charge");
+        HashMap userSealStrMap = JSON.parseObject(viewUrlStr, HashMap.class);
+        String code = userSealStrMap.get("code").toString();
+        if("0".equals(code)){
+            String resultStr = userSealStrMap.get("result").toString();
+            //获取成员印章信息列表
+            List<SealUserInfo> userSealList = (List<SealUserInfo>) JSONArray.parseArray(resultStr, SealUserInfo.class);
+            //ZList <SealUserInfo> userSealList =new Gson().fromJson(resultStr, new TypeToken<List<SealUserInfo>>() {}.getType());
+            if(userSealList.size()>0){
+                //如果需要判定得印章名称不为空则进行精确印章处理
+                if(StringUtils.isNotBlank(sealName)){
+                    for (SealUserInfo userSeal: userSealList) {
+                        if(sealName.equals(userSeal.getName())){
+                            //返回成员印章编号id
+                            return userSeal.getId();
+                        }
+                    }
+                }else{
+                    if(StringUtils.isNotBlank(userSealList.get(0).getId())){
+                        //返回成员第一个印章编号id
+                        return userSealList.get(0).getId();
+                    }
+                }
+            }
+        }
+        return "";
+    }
+
+    /**
+     * 根据合同编号查询签章合同对应的url访问界面
+     * @param contractId 签章合同id
+     * @param contact 签章人手机号
+     * @return
+     */
+    public static String getSignatureContractUrl( String contractId,String contact ){
+        Map map = new HashMap();
+        map.put("contractId",contractId);
+        map.put("tenantType","COMPANY");
+        map.put("tenantName","江苏兴光项目管理有限公司");
+        map.put("contact",contact);
+        String jsonString = JSON.toJSONString(map);
+        String contractIdUrl = SignaturePostUtil.sendPostApplicationJson(HTTPTOP + "/contract/signurl", jsonString);
+        HashMap signUrlHashMap = JSON.parseObject(contractIdUrl, HashMap.class);
+        String code = signUrlHashMap.get("code").toString();
+        if("0".equals(code)){
+            String signUrl = signUrlHashMap.get("signUrl").toString();
+            return signUrl;
+        }
+        return "";
+    }
+
+    /**
+     * zip文件解压
+     * @param file 需解压的文件
+     * @param destDirPath 解压文件地址
+     */
+    public static void unZipFile(File file,String destDirPath){
+        // 开始解压
+        ZipFile zipFile = null;
+        try {
+            //zipFile = new ZipFile(file);
+            //添加解压编码,解决解压报错问题
+            zipFile = new ZipFile(file, Charset.forName("GBK"));
+            Enumeration<?> entries = zipFile.entries();
+            while (entries.hasMoreElements()) {
+                ZipEntry entry = (ZipEntry) entries.nextElement();
+                System.out.println("解压" + entry.getName());
+                // 如果是文件夹,就创建个文件夹
+                if (entry.isDirectory()) {
+                    String dirPath = destDirPath + "/" + entry.getName();
+                    File dir = new File(dirPath);
+                    dir.mkdirs();
+                } else {
+                    // 如果是文件,就先创建一个文件,然后用io流把内容copy过去
+                    File targetFile = new File(destDirPath + "/" + entry.getName());
+                    // 保证这个文件的父文件夹必须要存在
+                    if(!targetFile.getParentFile().exists()){
+                        targetFile.getParentFile().mkdirs();
+                    }
+                    targetFile.createNewFile();
+                    // 将压缩文件内容写入到这个文件中
+                    InputStream is = zipFile.getInputStream(entry);
+                    FileOutputStream fos = new FileOutputStream(targetFile);
+                    int len;
+                    byte[] buf = new byte[1024];
+                    while ((len = is.read(buf)) != -1) {
+                        fos.write(buf, 0, len);
+                    }
+                    // 关流顺序,先打开的后关闭
+                    fos.close();
+                    is.close();
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            if(zipFile != null){
+                try {
+                    zipFile.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                    e.printStackTrace();
+                }
+            }
+        }
+    }
+}
+

+ 131 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectBusinessType/controller/CwProjectBusinessTypeController.java

@@ -0,0 +1,131 @@
+package com.jeeplus.finance.projectBusinessType.controller;
+
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.util.ObjectUtil;
+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.jeeplus.finance.projectBusinessType.domain.CwProjectBusinessType;
+import com.jeeplus.finance.projectBusinessType.service.CwProjectBusinessTypeService;
+import com.jeeplus.finance.projectBusinessType.service.dto.CwProjectBusinessTypeDTO;
+import com.jeeplus.logging.annotation.ApiLog;
+import com.jeeplus.logging.constant.enums.LogTypeEnum;
+import io.swagger.annotations.Api;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.validation.Valid;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Api("项目管理-业务类型管理")
+@RestController
+@RequestMapping(value = "/projectRecords/cw_project_business_type")
+public class CwProjectBusinessTypeController {
+
+    @Resource
+    private CwProjectBusinessTypeService cwProjectBusinessTypeService;
+
+    /**
+     * 查询业务类型列表
+     * @param cwProjectBusinessTypeDTO
+     * @param page
+     * @return
+     * @throws Exception
+     */
+    @ApiLog("查询业务类型列表")
+//    @PreAuthorize("hasAuthority('cw_project_business_type:list')")
+    @GetMapping("list")
+    public ResponseEntity<IPage<CwProjectBusinessTypeDTO>> data(CwProjectBusinessTypeDTO cwProjectBusinessTypeDTO, Page<CwProjectBusinessTypeDTO> page) throws Exception {
+        page.setSize(-1);
+        IPage<CwProjectBusinessTypeDTO> result = new Page<CwProjectBusinessTypeDTO>();
+        if(ObjectUtil.isNotEmpty(cwProjectBusinessTypeDTO)){
+            if(StringUtils.isNotBlank(cwProjectBusinessTypeDTO.getName())){
+                //根据type模糊查询
+                List<CwProjectBusinessType> cwProjectBusinessTypeList = cwProjectBusinessTypeService.list(new QueryWrapper<CwProjectBusinessType>().lambda()
+                        .like(StringUtils.isNotBlank(cwProjectBusinessTypeDTO.getName()), CwProjectBusinessType::getName, cwProjectBusinessTypeDTO.getName())
+                );
+                List<String> idList = new ArrayList<>();
+                cwProjectBusinessTypeList.stream().forEach(item->{
+                    if (StringUtils.isNotBlank(item.getParentIds())){
+                        String[] split = item.getParentIds().split(",");
+                        for (String s : split) {
+                            idList.add(s);
+                        }
+                    }
+                    List<CwProjectBusinessType> list = cwProjectBusinessTypeService.list(new QueryWrapper<CwProjectBusinessType>().lambda().like(CwProjectBusinessType::getParentIds, "," + item.getId() + ","));
+                    idList.addAll(list.stream().map(CwProjectBusinessType::getId).collect(Collectors.toList()));
+                    idList.add(item.getId());
+                });
+                List<String> ids = idList.stream().distinct().filter(item->{
+                    if (!"0".equals(item)){
+                        return true;
+                    }
+                    return false;
+                }).collect(Collectors.toList());
+                if(CollectionUtil.isNotEmpty(ids)){
+                    QueryWrapper<CwProjectBusinessType> wrapper = new QueryWrapper<CwProjectBusinessType>()
+                            .in("cw_pbt.id",idList);
+                    result = cwProjectBusinessTypeService.findList (page,wrapper);
+                }
+            }else{
+                result = cwProjectBusinessTypeService.findList (page,new QueryWrapper<CwProjectBusinessType>());
+            }
+        }
+        return ResponseEntity.ok (result);
+    }
+
+    /**
+     * 查询业务类型数据
+     * @param id
+     * @return
+     */
+    @ApiLog("查询业务类型数据")
+    @PreAuthorize ("hasAnyAuthority('cw_project_business_type:view','cw_project_business_type:add','cw_project_business_type:edit')")
+    @GetMapping("queryById")
+    public ResponseEntity queryById(@RequestParam("id") String id) {
+        CwProjectBusinessTypeDTO cwProjectBusinessTypeDTO = cwProjectBusinessTypeService.queryById ( id );
+        return ResponseEntity.ok (cwProjectBusinessTypeDTO);
+    }
+
+    /**
+     * 查询全部一级业务类型
+     * @return
+     */
+    @ApiLog("查询全部一级业务类型")
+    @GetMapping("getList")
+    public ResponseEntity<List<CwProjectBusinessTypeDTO>> getList() {
+        List<CwProjectBusinessTypeDTO> list = cwProjectBusinessTypeService.getList();
+        return ResponseEntity.ok (list);
+    }
+
+    /**
+     * 保存业务类型
+     * @param cwProjectBusinessTypeDTO
+     * @return
+     */
+    @ApiLog(value = "修改/新增业务类型", type = LogTypeEnum.SAVE)
+    @PreAuthorize("hasAnyAuthority('cw_project_business_type:add','cw_project_business_type:edit')")
+    @PostMapping("save")
+    public ResponseEntity save(@Valid @RequestBody CwProjectBusinessTypeDTO cwProjectBusinessTypeDTO) {
+        cwProjectBusinessTypeService.saveType(cwProjectBusinessTypeDTO);
+        return ResponseEntity.ok ("操作成功");
+    }
+
+    /**
+     * 删除业务类型
+     * @param ids
+     * @return
+     */
+    @ApiLog(value = "删除业务类型", type = LogTypeEnum.SAVE)
+    @PreAuthorize ("hasAuthority('cw_project_business_type:del')")
+    @DeleteMapping("delete")
+    public ResponseEntity delete(String ids) {
+        return cwProjectBusinessTypeService.deleteByIds(ids);
+    }
+
+}

+ 46 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectBusinessType/domain/CwProjectBusinessType.java

@@ -0,0 +1,46 @@
+package com.jeeplus.finance.projectBusinessType.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+/**
+ * 财务-项目管理-业务类型管理
+ * @TableName cw_project_business_type
+ */
+@Data
+@TableName("cw_project_business_type")
+public class CwProjectBusinessType extends BaseEntity {
+
+    /**
+     * 备注信息
+     */
+    private String remarks;
+
+    /**
+     * 分类名称
+     */
+    private String name;
+
+    /**
+     * 父id
+     */
+    private String parentId;
+
+    /**
+     * 等级
+     */
+    private Integer level;
+
+    /**
+     * 排序
+     */
+    private Integer sort;
+
+    /**
+     * 父ids
+     */
+    private String parentIds;
+
+    private static final long serialVersionUID = 1L;
+}

+ 28 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectBusinessType/mapper/CwProjectBusinessTypeMapper.java

@@ -0,0 +1,28 @@
+package com.jeeplus.finance.projectBusinessType.mapper;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Constants;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.finance.projectBusinessType.domain.CwProjectBusinessType;
+import com.jeeplus.finance.projectBusinessType.service.dto.CwProjectBusinessTypeDTO;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface CwProjectBusinessTypeMapper extends BaseMapper<CwProjectBusinessType> {
+
+    public IPage<CwProjectBusinessTypeDTO> findList(Page<CwProjectBusinessTypeDTO> page, @Param(Constants.WRAPPER) QueryWrapper<CwProjectBusinessType> queryWrapper);
+
+    public CwProjectBusinessTypeDTO queryById(@Param("id") String id);
+
+    public List<CwProjectBusinessTypeDTO> getList();
+
+}
+
+
+
+

+ 79 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectBusinessType/mapper/xml/CwManageLevelTypeMapper.xml

@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.finance.projectBusinessType.mapper.CwProjectBusinessTypeMapper">
+
+    <resultMap id="BaseResultMap" type="com.jeeplus.finance.projectBusinessType.service.dto.CwProjectBusinessTypeDTO">
+            <id property="id" column="id" jdbcType="VARCHAR"/>
+            <result property="createBy.id" column="create_by_id" jdbcType="VARCHAR"/>
+            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+            <result property="updateBy.id" column="update_by_id" jdbcType="VARCHAR"/>
+            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+            <result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
+            <result property="remarks" column="remarks" jdbcType="VARCHAR"/>
+            <result property="name" column="name" jdbcType="VARCHAR"/>
+            <result property="parentId" column="parent_id" jdbcType="VARCHAR"/>
+            <result property="level" column="level" jdbcType="INTEGER"/>
+            <result property="sort" column="sort" jdbcType="INTEGER"/>
+            <result property="parentIds" column="parent_ids" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        cw_pbt.id,
+        cw_pbt.create_by_id,
+        cw_pbt.create_time,
+        cw_pbt.update_by_id,
+        cw_pbt.update_time,
+        cw_pbt.del_flag,
+        cw_pbt.remarks,
+        cw_pbt.name,
+        cw_pbt.parent_id,
+        cw_pbt.level,
+        cw_pbt.sort
+    </sql>
+
+    <select id="findList" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List"></include>
+        from cw_project_business_type cw_pbt
+        ${ew.customSqlSegment}
+    </select>
+
+    <select id="queryById" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List"></include>
+        from cw_project_business_type cw_pbt
+        where cw_pbt.del_flag = '0' and cw_pbt.id = #{id}
+    </select>
+
+    <select id="getList" resultMap="map">
+        select
+        <include refid="Base_Column_List"></include>
+        from cw_project_business_type cw_pbt
+        where cw_pbt.del_flag = '0' and cw_pbt.parent_id = '0'
+    </select>
+
+    <resultMap id="map" type="com.jeeplus.finance.workClientInfo.service.dto.CwManageLevelTypeDTO">
+        <id property="id" column="id" jdbcType="VARCHAR"/>
+        <result property="createBy.id" column="create_by_id" jdbcType="VARCHAR"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+        <result property="updateBy.id" column="update_by_id" jdbcType="VARCHAR"/>
+        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+        <result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
+        <result property="remarks" column="remarks" jdbcType="VARCHAR"/>
+        <result property="name" column="name" jdbcType="VARCHAR"/>
+        <result property="parentId" column="parent_id" jdbcType="VARCHAR"/>
+        <result property="level" column="level" jdbcType="INTEGER"/>
+        <result property="sort" column="sort" jdbcType="INTEGER"/>
+        <result property="parentIds" column="parent_ids" jdbcType="VARCHAR"/>
+        <collection property="childrenList" column="id" select="getChildList" ofType="com.jeeplus.finance.workClientInfo.service.dto.CwManageLevelTypeDTO"/>
+    </resultMap>
+
+    <select id="getChildList" resultType="com.jeeplus.finance.workClientInfo.service.dto.CwManageLevelTypeDTO">
+        select
+        <include refid="Base_Column_List"></include>
+        from cw_project_business_type cw_pbt
+        where cw_pbt.del_flag = '0' and cw_pbt.parent_id = ${id}
+    </select>
+</mapper>

+ 80 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectBusinessType/service/CwProjectBusinessTypeService.java

@@ -0,0 +1,80 @@
+package com.jeeplus.finance.projectBusinessType.service;
+
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.util.ObjectUtil;
+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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.google.common.collect.Lists;
+import com.jeeplus.finance.projectBusinessType.domain.CwProjectBusinessType;
+import com.jeeplus.finance.projectBusinessType.mapper.CwProjectBusinessTypeMapper;
+import com.jeeplus.finance.projectBusinessType.service.dto.CwProjectBusinessTypeDTO;
+import com.jeeplus.finance.projectBusinessType.service.mapstruct.CwProjectBusinessTypeWrapper;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Service
+@Transactional
+public class CwProjectBusinessTypeService extends ServiceImpl<CwProjectBusinessTypeMapper, CwProjectBusinessType> {
+
+    @Resource
+    private CwProjectBusinessTypeMapper cwProjectBusinessTypeMapper;
+
+    public IPage<CwProjectBusinessTypeDTO> findList(Page<CwProjectBusinessTypeDTO> page, QueryWrapper<CwProjectBusinessType> queryWrapper){
+        queryWrapper.eq("cw_pbt.del_flag","0").orderByAsc("cw_pbt.sort");
+        return cwProjectBusinessTypeMapper.findList(page,queryWrapper);
+    }
+
+    public CwProjectBusinessTypeDTO queryById(String id) {
+
+        CwProjectBusinessTypeDTO cwProjectBusinessTypeDTO = cwProjectBusinessTypeMapper.queryById(id);
+
+        return cwProjectBusinessTypeDTO;
+    }
+
+    public List<CwProjectBusinessTypeDTO> getList() {
+        List<CwProjectBusinessTypeDTO> list = cwProjectBusinessTypeMapper.getList();
+        return list;
+    }
+
+    public ResponseEntity saveType(CwProjectBusinessTypeDTO cwProjectBusinessTypeDTO) {
+        CwProjectBusinessType cwProjectBusinessType = CwProjectBusinessTypeWrapper.INSTANCE.toEntity(cwProjectBusinessTypeDTO);
+        if (ObjectUtil.isNotEmpty(cwProjectBusinessTypeDTO)) {
+            if (StringUtils.isBlank(cwProjectBusinessTypeDTO.getId())) {
+                if (StringUtils.isNotBlank(cwProjectBusinessTypeDTO.getParentId())){
+                    if ("0".equals(cwProjectBusinessTypeDTO.getParentId())){
+                        cwProjectBusinessType.setLevel(1);
+                        cwProjectBusinessType.setParentIds("0,");
+                    }else{
+                        CwProjectBusinessType byId = this.getById(cwProjectBusinessTypeDTO.getParentId());
+                        CwProjectBusinessTypeDTO pbt = CwProjectBusinessTypeWrapper.INSTANCE.toDTO(byId);
+                        if(ObjectUtil.isNotEmpty(pbt)){
+                            cwProjectBusinessType.setLevel(pbt.getLevel()+1);
+                            cwProjectBusinessType.setParentIds(pbt.getParentIds()+pbt.getId()+",");
+                        }
+                    }
+                }
+            }
+        }
+        this.saveOrUpdate(cwProjectBusinessType);
+        return ResponseEntity.ok("保存成功");
+    }
+
+    public ResponseEntity deleteByIds(String ids) {
+        String idArray[] =ids.split(",");
+        if(CollectionUtil.isNotEmpty(Lists.newArrayList (idArray))){
+            List<String> list = this.list(new QueryWrapper<CwProjectBusinessType>().lambda().in(CwProjectBusinessType::getParentId, Lists.newArrayList(idArray))).stream().distinct().map(CwProjectBusinessType::getId).collect(Collectors.toList());
+            this.removeByIds (list);
+        }
+        this.removeByIds (Lists.newArrayList (idArray));
+        return ResponseEntity.ok ("删除成功");
+    }
+
+}

+ 51 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectBusinessType/service/dto/CwProjectBusinessTypeDTO.java

@@ -0,0 +1,51 @@
+package com.jeeplus.finance.projectBusinessType.service.dto;
+
+import com.jeeplus.core.service.dto.BaseDTO;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * 财务-项目管理-业务类型管理
+ * @TableName cw_project_business_type
+ */
+@Data
+public class CwProjectBusinessTypeDTO extends BaseDTO {
+
+    /**
+     * 备注信息
+     */
+    private String remarks;
+
+    /**
+     * 分类名称
+     */
+    private String name;
+
+    /**
+     * 父id
+     */
+    private String parentId;
+
+    /**
+     * 等级
+     */
+    private Integer level;
+
+    /**
+     * 排序
+     */
+    private Integer sort;
+
+    /**
+     * 父ids
+     */
+    private String parentIds;
+
+    /**
+     * 子集合
+     */
+    private List<CwProjectBusinessTypeDTO> childrenList;
+
+    private static final long serialVersionUID = 1L;
+}

+ 15 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectBusinessType/service/mapstruct/CwProjectBusinessTypeWrapper.java

@@ -0,0 +1,15 @@
+package com.jeeplus.finance.projectBusinessType.service.mapstruct;
+
+import com.jeeplus.core.mapstruct.EntityWrapper;
+import com.jeeplus.finance.projectBusinessType.domain.CwProjectBusinessType;
+import com.jeeplus.finance.projectBusinessType.service.dto.CwProjectBusinessTypeDTO;
+import org.mapstruct.Mapper;
+import org.mapstruct.ReportingPolicy;
+import org.mapstruct.factory.Mappers;
+
+@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {})
+public interface CwProjectBusinessTypeWrapper extends EntityWrapper<CwProjectBusinessTypeDTO, CwProjectBusinessType>{
+
+        CwProjectBusinessTypeWrapper INSTANCE = Mappers.getMapper(CwProjectBusinessTypeWrapper.class);
+
+}

+ 96 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/controller/CwManHourManagementController.java

@@ -0,0 +1,96 @@
+package com.jeeplus.finance.projectRecords.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.finance.projectRecords.service.CwManHourManagementService;
+import com.jeeplus.finance.projectRecords.service.dto.CwManHourManagementDTO;
+import com.jeeplus.logging.annotation.ApiLog;
+import com.jeeplus.logging.constant.enums.LogTypeEnum;
+import io.swagger.annotations.Api;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.validation.Valid;
+
+/**
+ * @author: 徐滕
+ * @version: 2022-12-06 16:28
+ */
+@RestController
+@Api("财务项目工时管理信息")
+@RequestMapping(value = "/manHourManagement")
+public class CwManHourManagementController {
+
+    @Resource
+    private CwManHourManagementService cwManHourManagementService;
+
+    /**
+     * 查询财务项目信息列表
+     * @param cwManHourManagementDTO
+     * @param page
+     * @return
+     */
+    @ApiLog("查询财务项目工时管理列表")
+    @PreAuthorize("hasAuthority('manHourManagement:list')")
+    @GetMapping("list")
+    public ResponseEntity<IPage<CwManHourManagementDTO>> data(CwManHourManagementDTO cwManHourManagementDTO, Page<CwManHourManagementDTO> page) throws Exception {
+        IPage<CwManHourManagementDTO> result = new Page<CwManHourManagementDTO>();
+        result = cwManHourManagementService.findList (page,cwManHourManagementDTO);
+        return ResponseEntity.ok (result);
+    }
+
+    /**
+     * 查询财务项目详情
+     * @param id
+     * @return
+     */
+    @ApiLog("查询财务项目工时管理详情")
+    @PreAuthorize ("hasAnyAuthority('manHourManagement:view','manHourManagement:add','manHourManagement:edit')")
+    @GetMapping("queryById")
+    public ResponseEntity queryById(@RequestParam("id") String id) {
+        CwManHourManagementDTO cwManHourManagementDTO = cwManHourManagementService.queryById ( id );
+        return ResponseEntity.ok (cwManHourManagementDTO);
+    }
+
+    /**
+     * 保存财务项目信息
+     * @param cwManHourManagementDTO
+     * @return
+     */
+    @ApiLog(value = "修改/新增财务项目工时管理信息", type = LogTypeEnum.SAVE)
+    @PreAuthorize("hasAnyAuthority('manHourManagement:add','manHourManagement:edit')")
+    @PostMapping("save")
+    public ResponseEntity save(@Valid @RequestBody CwManHourManagementDTO cwManHourManagementDTO) throws Exception {
+        cwManHourManagementService.save(cwManHourManagementDTO);
+        return ResponseEntity.ok ("操作成功");
+    }
+
+    /**
+     * 更改状态
+     * @param id
+     * @return
+     */
+    @ApiLog("查询财务项目工时管理详情")
+    @PreAuthorize ("hasAnyAuthority('manHourManagement:add','manHourManagement:edit')")
+    @GetMapping("updateStatus")
+    public ResponseEntity updateStatus(@RequestParam("id") String id) {
+        cwManHourManagementService.updateStatus ( id );
+        return ResponseEntity.ok ("确认工时成功");
+    }
+
+    /**
+     * 删除财务项目信息
+     * @param ids
+     * @return
+     */
+    @ApiLog(value = "删除财务项目工时管理信息", type = LogTypeEnum.SAVE)
+    @PreAuthorize ("hasAuthority('manHourManagement:del')")
+    @DeleteMapping("delete")
+    public ResponseEntity delete(String ids) {
+        return cwManHourManagementService.deleteByIds(ids);
+    }
+
+}
+

+ 212 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/controller/CwProjectRecordsController.java

@@ -0,0 +1,212 @@
+package com.jeeplus.finance.projectRecords.controller;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.common.excel.ExcelOptions;
+import com.jeeplus.common.excel.annotation.ExportMode;
+import com.jeeplus.common.utils.ResponseUtil;
+import com.jeeplus.finance.invoice.util.EasyPoiUtil;
+import com.jeeplus.finance.projectRecords.service.CwProjectRecordsService;
+import com.jeeplus.finance.projectRecords.service.dto.CwProjectRecordsDTO;
+import com.jeeplus.logging.annotation.ApiLog;
+import com.jeeplus.logging.constant.enums.LogTypeEnum;
+import com.jeeplus.sys.utils.DictUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 财务项目登记controller
+ * @author: 徐滕
+ * @version: 2022-11-10 14:55
+ */
+@RestController
+@Api("财务项目信息")
+@RequestMapping(value = "/cwProjectRecords")
+public class CwProjectRecordsController {
+
+    @Resource
+    private CwProjectRecordsService cwProjectRecordsService;
+
+    /**
+     * 查询财务项目信息列表
+     * @param cwProjectRecordsDTO
+     * @param page
+     * @return
+     */
+    @ApiLog("查询财务项目信息列表")
+    // @PreAuthorize("hasAuthority('cwProjectRecords:list')")
+    @GetMapping("list")
+    public ResponseEntity<IPage<CwProjectRecordsDTO>> data(CwProjectRecordsDTO cwProjectRecordsDTO, Page<CwProjectRecordsDTO> page) throws Exception {
+        IPage<CwProjectRecordsDTO> result = new Page<CwProjectRecordsDTO>();
+        result = cwProjectRecordsService.findList (page,cwProjectRecordsDTO);
+        return ResponseEntity.ok (result);
+    }
+    /**
+     * 查询项目数据集合,和上面list接口是一样的,目的是跳过findList mapper接口的数据规则(比如仅部门可见、仅自己可见之类的)
+     */
+    @GetMapping("list2")
+    public ResponseEntity<IPage<CwProjectRecordsDTO>> data2(CwProjectRecordsDTO cwProjectRecordsDTO, Page<CwProjectRecordsDTO> page) throws Exception {
+        IPage<CwProjectRecordsDTO> result = new Page<CwProjectRecordsDTO>();
+        result = cwProjectRecordsService.findList2 (page,cwProjectRecordsDTO);
+        return ResponseEntity.ok (result);
+    }
+
+    /**
+     * 查询财务项目详情
+     * @param id
+     * @return
+     */
+    @ApiLog("查询财务项目详情")
+//    @PreAuthorize ("hasAnyAuthority('cwProjectRecords:view','cwProjectRecords:add','cwProjectRecords:edit')")
+    @GetMapping("queryById")
+    public ResponseEntity queryById(@RequestParam("id") String id) {
+        CwProjectRecordsDTO cwProjectRecordsDTO = cwProjectRecordsService.queryById ( id );
+        return ResponseEntity.ok (cwProjectRecordsDTO);
+    }
+
+    /**
+     * 保存财务项目信息
+     * @param cwProjectRecordsDTO
+     * @return
+     */
+    @ApiLog(value = "修改/新增财务项目信息", type = LogTypeEnum.SAVE)
+    @PreAuthorize("hasAnyAuthority('cwProjectRecords:add','cwProjectRecords:edit')")
+    @PostMapping("save")
+    public ResponseEntity save(@Valid @RequestBody CwProjectRecordsDTO cwProjectRecordsDTO) throws Exception {
+        cwProjectRecordsService.save(cwProjectRecordsDTO);
+        return ResponseEntity.ok ("操作成功");
+    }
+
+    /**
+     * 保存财务项目信息-流程
+     * @param cwProjectRecordsDTO
+     * @return
+     */
+    @ApiLog(value = "保存财务项目信息-流程", type = LogTypeEnum.SAVE)
+    @PreAuthorize("hasAnyAuthority('cwProjectRecords:add','cwProjectRecords:edit')")
+    @PostMapping("saveForm")
+    public ResponseEntity saveForm(@Valid @RequestBody CwProjectRecordsDTO cwProjectRecordsDTO) throws Exception {
+        String id = cwProjectRecordsService.saveForm(cwProjectRecordsDTO);
+        return ResponseUtil.newInstance().add("businessTable", "cw_project_records").add("businessId", id).ok ("操作成功");
+    }
+
+    /**
+     * 保存财务项目组成员信息
+     * @param cwProjectRecordsDTO
+     * @return
+     */
+    @ApiLog(value = "保存财务项目组成员信息", type = LogTypeEnum.SAVE)
+    @PreAuthorize("hasAnyAuthority('cwProjectRecords:add','cwProjectRecords:edit')")
+    @PostMapping("updateMembers")
+    public ResponseEntity updateMembers(@Valid @RequestBody CwProjectRecordsDTO cwProjectRecordsDTO) {
+        return cwProjectRecordsService.updateMembers(cwProjectRecordsDTO);
+    }
+
+    /**
+     * 删除财务项目信息
+     * @param ids
+     * @return
+     */
+    @ApiLog(value = "删除财务项目信息", type = LogTypeEnum.SAVE)
+    @PreAuthorize ("hasAuthority('cwProjectRecords:del')")
+    @DeleteMapping("delete")
+    public ResponseEntity delete(String ids) {
+        return cwProjectRecordsService.deleteByIds(ids);
+    }
+
+    /**
+     * 根据id修改状态值status
+     * @param dto
+     * @return
+     */
+    @ApiOperation(value = "根据id修改状态值status")
+    @PostMapping(value = "/updateStatusById")
+    public ResponseEntity<String> updateStatusById(@RequestBody CwProjectRecordsDTO dto) {
+        String s = cwProjectRecordsService.updateStatusById(dto);
+        return ResponseEntity.ok(s);
+    }
+
+    /**
+     * 导出项目数据
+     *
+     * @param cwProjectRecordsDTO
+     * @param page
+     * @param response
+     * @throws Exception
+     */
+    @ApiLog(value = "导出项目数据", type = LogTypeEnum.EXPORT)
+    @GetMapping("export")
+    @PreAuthorize ("hasAuthority('cwProjectRecords:export')")
+    @ApiOperation(value = "导出项目数据")
+    public void exportFile(CwProjectRecordsDTO cwProjectRecordsDTO, Page <CwProjectRecordsDTO> page, ExcelOptions options, HttpServletResponse response) throws Exception {
+        String fileName = options.getFilename();
+        String sheetName = options.getSheetName();
+        List<CwProjectRecordsDTO> result = new ArrayList<>();
+        if ( ExportMode.current.equals ( options.getMode() ) ) {
+            result = cwProjectRecordsService.findList (page,cwProjectRecordsDTO).getRecords();
+        } else if (ExportMode.selected.equals ( options.getMode() )) {
+            result = cwProjectRecordsService.findList (page,cwProjectRecordsDTO).getRecords().stream ( ).filter ( item ->
+                    options.getSelectIds ( ).contains ( item.getId ( ) )
+            ).collect ( Collectors.toList ( ) );
+        } else {
+            page.setSize (-1);
+            page.setCurrent (0);
+            result = cwProjectRecordsService.findList (page,cwProjectRecordsDTO).getRecords();
+        }
+        result.stream().forEach(item -> {
+            if (StringUtils.isNotBlank(item.getStatus())){
+                item.setStatus(DictUtils.getDictLabel(item.getStatus(),"cw_status",""));
+            }
+        });
+        EasyPoiUtil.exportExcel ( result, sheetName,  sheetName, CwProjectRecordsDTO.class, fileName, response );
+
+    }
+
+    /**
+     * 根据客户id获取关联的项目信息
+     * @param clientId
+     * @return
+     */
+    @ApiOperation(value = "根据客户id获取关联的项目信息")
+    @GetMapping(value = "/getByClientId")
+    public ResponseEntity<List<CwProjectRecordsDTO>> getByClientId(String clientId, CwProjectRecordsDTO cwProjectRecordsDTO) throws Exception {
+        List<CwProjectRecordsDTO> cwProjectRecordsDTOList = cwProjectRecordsService.getByClientId(clientId,cwProjectRecordsDTO);
+        return ResponseEntity.ok(cwProjectRecordsDTOList);
+    }
+
+    /**
+     * 根据合同id获取关联的项目信息
+     * @param contractId
+     * @return
+     */
+    @ApiOperation(value = "根据合同id获取关联的项目信息")
+    @GetMapping(value = "/getByContractId")
+    public ResponseEntity<List<CwProjectRecordsDTO>> getByContractId(String contractId,CwProjectRecordsDTO cwProjectRecordsDTO) throws Exception {
+        List<CwProjectRecordsDTO> cwProjectRecordsDTOList = cwProjectRecordsService.getByContractId(contractId,cwProjectRecordsDTO);
+        return ResponseEntity.ok(cwProjectRecordsDTOList);
+    }
+
+    /**
+     * 查询当前登录人创建的项目 以及 所属项目组的项目(当前登录人未被移除项目组)
+     * @return
+     */
+    @ApiOperation(value = "查询当前登录人创建的项目以及所属项目组的项目")
+    @GetMapping(value = "/getHaveProjectIds")
+    public ResponseEntity<List<String>> getHaveProjectIds() {
+        return cwProjectRecordsService.getHaveProjectIds();
+    }
+
+}

+ 26 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/domain/CwManHourManagement.java

@@ -0,0 +1,26 @@
+package com.jeeplus.finance.projectRecords.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 财务工时管理表
+ * @author: 徐滕
+ * @version: 2022-12-06 16:34
+ */
+@Data
+@TableName("cw_man_hour_management")
+public class CwManHourManagement extends BaseEntity {
+
+    private String projectId;   //项目id
+    private Date planStartDate; //计划开始时间
+    private Date planEndDate;   //计划结束时间
+    private String status;  //工时确认状态
+
+    private String projectName; //项目名称
+    private String projectNumber;   //项目编号
+    private String projectMasterId; //项目经理
+}

+ 81 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/domain/CwProjectClientContact.java

@@ -0,0 +1,81 @@
+package com.jeeplus.finance.projectRecords.domain;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+/**
+ * 项目管理-项目登记-客户联系人页签
+ * @TableName cw_project_client_contact
+ */
+@TableName(value ="cw_project_client_contact")
+@Data
+public class CwProjectClientContact extends BaseEntity {
+
+    /**
+     * 备注
+     */
+    private String remarks;
+
+    /**
+     * 项目id
+     */
+    private String projectId;
+
+    /**
+     * 客户id
+     */
+    private String clientId;
+
+    /**
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 性别
+     */
+    private String sex;
+
+    /**
+     * 部门
+     */
+    private String officeId;
+
+    /**
+     * 职务
+     */
+    private String position;
+
+    /**
+     * 联系方式1
+     */
+    private String contactFirst;
+
+    /**
+     * 联系方式2
+     */
+    private String contactSecond;
+
+    /**
+     * 传真
+     */
+    private String fax;
+
+    /**
+     * 邮箱
+     */
+    private String email;
+
+    /**
+     * 客户联系人关联id
+     */
+    private String clientContactId;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+}

+ 30 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/domain/CwProjectClientInfo.java

@@ -0,0 +1,30 @@
+package com.jeeplus.finance.projectRecords.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+/**
+ * 项目被服务单位数据表
+ * @author: 徐滕
+ * @version: 2022-11-10 16:17
+ */
+@Data
+@TableName("cw_project_client_info")
+public class CwProjectClientInfo {
+    private static final long serialVersionUID = 1L;
+
+    private String projectId;       //项目id
+
+    private String clientId;        //客户id
+
+    @TableField(exist = false)
+    private String clientNumber;    //客户编号
+
+    @TableField(exist = false)
+    private String clientName;      //客户名称
+
+    @TableField(exist = false)
+    private String companyLevel;    //客户层级
+}

+ 43 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/domain/CwProjectMembers.java

@@ -0,0 +1,43 @@
+package com.jeeplus.finance.projectRecords.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+/**
+ * 项目管理-项目登记-项目组成员
+ * @TableName cw_project_members
+ */
+@TableName(value ="cw_project_members")
+@Data
+public class CwProjectMembers extends BaseEntity {
+
+    /**
+     * 备注
+     */
+    private String remarks;
+
+    /**
+     * 项目id
+     */
+    private String projectId;
+
+    /**
+     * 人员id
+     */
+    private String userId;
+
+    /**
+     * 状态
+     */
+    private String status;
+
+    /**
+     * 项目主要成员
+     */
+    private String isImportant;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+}

+ 116 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/domain/CwProjectRecords.java

@@ -0,0 +1,116 @@
+package com.jeeplus.finance.projectRecords.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import com.jeeplus.core.query.Query;
+import com.jeeplus.core.query.QueryType;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author: 徐滕
+ * @version: 2022-11-10 14:55
+ */
+@Data
+@TableName("cw_project_records")
+public class CwProjectRecords extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 备注信息
+     */
+    private String remarks;
+
+    /**
+     * 项目编号
+     */
+    @Query(tableColumn = "a.project_number", type = QueryType.LIKE)
+    private String projectNumber;
+
+    /**
+     * 项目名称
+     */
+    @Query(tableColumn = "a.project_name", type = QueryType.LIKE)
+    private String projectName;
+
+    /**
+     * 项目所属部门
+     */
+    private String officeId;
+
+    /**
+     * 项目金额
+     */
+    private String projectMoney;
+
+    /**
+     * 审计期间
+     */
+    private String auditYear;
+
+    /**
+     * 项目计划开始时间
+     */
+    private Date planStartDate;
+
+    /**
+     * 项目计划结束时间
+     */
+    private Date planEndDate;
+
+    /**
+     * 项目经理
+     */
+    private String projectMasterId;
+
+    /**
+     * 现场负责人
+     */
+    private String projectLeaderId;
+
+    /**
+     * 流程id
+     */
+    private String procInsId;
+
+    private String processDefinitionId;
+
+    /**
+     * 状态
+     */
+    @Query(tableColumn = "a.status", type = QueryType.EQ)
+    private String status;
+
+    /**
+     * 合同id
+     */
+    private String contractId;
+
+    /**
+     * 业务类型
+     */
+    private String businessType;
+
+    /**
+     * 风险等级
+     */
+    private String riskLevel;
+
+    /**
+     * 项目实际责任人
+     */
+    private String realHeader;
+
+    /**
+     * 报备类型
+     */
+    private String reportType;
+
+    /**
+     * 报告复核 1:已开始复核/已完成复核
+     */
+    private String reportReview;
+
+}

+ 48 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/mapper/CwManHourManagementMapper.java

@@ -0,0 +1,48 @@
+package com.jeeplus.finance.projectRecords.mapper;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+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.finance.projectRecords.domain.CwManHourManagement;
+import com.jeeplus.finance.projectRecords.service.dto.CwManHourManagementDTO;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 财务项目登记mapper
+ * @author: 徐滕
+ * @version: 2022-11-10 14:56
+ */
+@Mapper
+public interface CwManHourManagementMapper extends BaseMapper<CwManHourManagement> {
+    /**
+     * 查询项目数据集合
+     * @param page
+     * @param queryWrapper
+     * @return
+     */
+    IPage<CwManHourManagementDTO> findList(Page<CwManHourManagementDTO> page, @Param(Constants.WRAPPER) QueryWrapper<CwManHourManagement> queryWrapper);
+
+    /**
+     * 根据id查询项目详情
+     * @param id
+     * @return
+     */
+    CwManHourManagementDTO queryById(@Param("id") String id);
+
+    /**
+     * 逻辑删除数据信息
+     * @param id
+     */
+    void delete(@Param("id") String id);
+
+    /**
+     * 更改状态
+     * @param id
+     */
+    void updateStatus(@Param("id") String id);
+}

+ 17 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/mapper/CwProjectClientContactMapper.java

@@ -0,0 +1,17 @@
+package com.jeeplus.finance.projectRecords.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.finance.projectRecords.domain.CwProjectClientContact;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * @Entity com.jeeplus.test.cw.projectRecords.domain.CwProjectClientContact
+ */
+@Mapper
+public interface CwProjectClientContactMapper extends BaseMapper<CwProjectClientContact> {
+
+}
+
+
+
+

+ 17 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/mapper/CwProjectClientInfoMapper.java

@@ -0,0 +1,17 @@
+package com.jeeplus.finance.projectRecords.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.finance.projectRecords.domain.CwProjectClientInfo;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * @Entity generator.domain.CwProjectClientInfo
+ */
+@Mapper
+public interface CwProjectClientInfoMapper extends BaseMapper<CwProjectClientInfo> {
+
+}
+
+
+
+

+ 15 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/mapper/CwProjectMembersMapper.java

@@ -0,0 +1,15 @@
+package com.jeeplus.finance.projectRecords.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.finance.projectRecords.domain.CwProjectMembers;
+
+/**
+ * @Entity com.jeeplus.test.cw.projectRecords.domain.CwProjectMembers
+ */
+public interface CwProjectMembersMapper extends BaseMapper<CwProjectMembers> {
+
+}
+
+
+
+

+ 69 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/mapper/CwProjectRecordsMapper.java

@@ -0,0 +1,69 @@
+package com.jeeplus.finance.projectRecords.mapper;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+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.finance.projectRecords.domain.CwProjectRecords;
+import com.jeeplus.finance.projectRecords.service.dto.CwProjectClientInfoDTO;
+import com.jeeplus.finance.projectRecords.service.dto.CwProjectRecordsDTO;
+import com.jeeplus.sys.service.dto.UserDTO;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 财务项目登记mapper
+ * @author: 徐滕
+ * @version: 2022-11-10 14:56
+ */
+@Mapper
+public interface CwProjectRecordsMapper extends BaseMapper<CwProjectRecords> {
+    /**
+     * 查询项目数据集合
+     * @param page
+     * @param queryWrapper
+     * @return
+     */
+    IPage<CwProjectRecordsDTO> findList(Page<CwProjectRecordsDTO> page, @Param(Constants.WRAPPER) QueryWrapper<CwProjectRecords> queryWrapper);
+    /**
+     * 查询项目数据集合,和上面findList是一样的,目的是跳过findList接口的数据规则(比如仅部门可见、仅自己可见之类的)
+     */
+    IPage<CwProjectRecordsDTO> findList2(Page<CwProjectRecordsDTO> page, @Param(Constants.WRAPPER) QueryWrapper<CwProjectRecords> queryWrapper);
+    /**
+     * 根据id查询项目详情
+     * @param id
+     * @return
+     */
+    CwProjectRecordsDTO queryById(@Param("id") String id);
+
+    /**
+     * 根据项目id删除项目相关的所有被服务单位
+     * @param projectId
+     * @return
+     */
+    Integer deleteProjectClientInfoByProjectId(@Param("projectId") String projectId);
+
+    /**
+     * 保存被服务单位信息
+     * @param cwProjectClientInfoList
+     * @return
+     */
+    Integer insertProjectClientInfoList(@Param("cwProjectClientInfoList") List<CwProjectClientInfoDTO> cwProjectClientInfoList);
+
+    List<String> getProjectIdByClientId(@Param("id") String id);
+
+    List<CwProjectRecordsDTO> getProjectByIdList(@Param(Constants.WRAPPER) QueryWrapper<CwProjectRecords> queryWrapper);
+
+    List<CwProjectRecordsDTO> getByContractId(@Param(Constants.WRAPPER) QueryWrapper<CwProjectRecords> queryWrapper);
+
+    List<String> getHaveProjectIds(@Param("currentUser") UserDTO currentUser);
+
+    List<String> isUseByReport(String[] idArray);
+
+    List<String> isUseByReim(String[] idArray);
+
+    List<String> isUseByFinance(String[] idArray);
+}

+ 58 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/mapper/xml/CwManHourManagementMapper.xml

@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.finance.projectRecords.mapper.CwManHourManagementMapper">
+
+    <select id="findList" resultType="com.jeeplus.finance.projectRecords.service.dto.CwManHourManagementDTO">
+        select
+        p.id as "projectId",
+        p.project_name as "projectName",
+        p.project_number as "projectNumber",
+        psu.name as "projectMasterName",
+        a.id as "id",
+        a.create_by_id as "createBy.id",
+        su.name as "createBy.name",
+        a.create_time as "createTime",
+        a.plan_start_date as "planStartDate",
+        a.plan_end_date as "planEndDate",
+        a.status as "status"
+        from cw_man_hour_management a
+        left join cw_project_records p on a.project_id = p.id
+        left join sys_user psu on psu.id = p.project_master_id
+        left join sys_user su on a.create_by_id = su.id
+        ${ew.customSqlSegment}
+    </select>
+
+    <select id="queryById" resultType="com.jeeplus.finance.projectRecords.service.dto.CwManHourManagementDTO">
+        select
+        p.id as "projectId",
+        p.project_name as "projectName",
+        p.project_number as "projectNumber",
+        psu.name as "projectMasterName",
+        a.id as "id",
+        a.create_by_id as "createBy.id",
+        su.name as "createBy.name",
+        a.create_time as "createTime",
+        a.plan_start_date as "planStartDate",
+        a.plan_end_date as "planEndDate",
+        a.status as "status"
+        from cw_man_hour_management a
+        left join cw_project_records p on a.project_id = p.id
+        left join sys_user psu on psu.id = p.project_master_id
+        left join sys_user su on a.create_by_id = su.id
+        where a.del_flag = '0' and a.id = ${id}
+    </select>
+
+    <update id="delete">
+        update cw_man_hour_management
+        set del_flag = 0
+        where id = #{id}
+    </update>
+
+    <update id="updateStatus">
+        update cw_man_hour_management
+        set status = 1
+        where id = #{id}
+    </update>
+</mapper>

+ 46 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/mapper/xml/CwProjectClientContactMapper.xml

@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.finance.projectRecords.mapper.CwProjectClientContactMapper">
+
+    <resultMap id="BaseResultMap" type="com.jeeplus.finance.projectRecords.service.dto.CwProjectClientContactDTO">
+            <id property="id" column="id" jdbcType="VARCHAR"/>
+            <result property="createBy.id" column="create_by" jdbcType="VARCHAR"/>
+            <result property="createTime" column="create_date" jdbcType="TIMESTAMP"/>
+            <result property="updateBy.id" column="update_by" jdbcType="VARCHAR"/>
+            <result property="updateTime" column="update_date" jdbcType="TIMESTAMP"/>
+            <result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
+            <result property="remarks" column="remarks" jdbcType="VARCHAR"/>
+            <result property="projectId" column="project_id" jdbcType="VARCHAR"/>
+            <result property="clientId" column="client_id" jdbcType="VARCHAR"/>
+            <result property="name" column="name" jdbcType="VARCHAR"/>
+            <result property="sex" column="sex" jdbcType="VARCHAR"/>
+            <result property="officeId" column="office_id" jdbcType="VARCHAR"/>
+            <result property="position" column="position" jdbcType="VARCHAR"/>
+            <result property="contactFirst" column="contact_first" jdbcType="VARCHAR"/>
+            <result property="contactSecond" column="contact_second" jdbcType="VARCHAR"/>
+            <result property="fax" column="fax" jdbcType="VARCHAR"/>
+            <result property="email" column="email" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <sql id="Contact_Column_List">
+        cw_pcc.id,
+        cw_pcc.create_by,
+        cw_pcc.create_date,
+        cw_pcc.update_by,
+        cw_pcc.update_date,
+        cw_pcc.del_flag,
+        cw_pcc.remarks,
+        cw_pcc.project_id,
+        cw_pcc.client_id,
+        cw_pcc.name,
+        cw_pcc.sex,
+        cw_pcc.office_id,
+        cw_pcc.position,
+        cw_pcc.contact_first,
+        cw_pcc.contact_second,
+        cw_pcc.fax,
+        cw_pcc.email
+    </sql>
+</mapper>

+ 0 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectRecords/mapper/xml/CwProjectClientInfoMapper.xml


部分文件因为文件数量过多而无法显示