浏览代码

Merge remote-tracking branch 'origin/master'

user5 1 年之前
父节点
当前提交
2b4d3e1f3b
共有 100 个文件被更改,包括 7163 次插入291 次删除
  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. 8 8
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/invoice/mapper/xml/FinanceInvoiceBaseMapper.xml
  10. 8 8
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/invoice/mapper/xml/FinanceInvoiceDetailMapper.xml
  11. 8 8
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/invoice/mapper/xml/FinanceInvoiceInvalidMapper.xml
  12. 26 26
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/invoice/mapper/xml/FinanceInvoiceMapper.xml
  13. 8 8
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/invoice/mapper/xml/FinanceInvoiceReceivablesMapper.xml
  14. 3 3
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/invoice/service/FinanceInvoiceService.java
  15. 4 4
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/fileDict/mapper/xml/ProgramFileDictMapper.xml
  16. 12 12
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectDict/mapper/xml/ProjectDictMapper.xml
  17. 8 41
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/domain/ProgramProjectListInfo.java
  18. 8 8
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/mapper/xml/ProgramArchiveMapper.xml
  19. 4 4
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/mapper/xml/ProgramAuditAssessPeopleMapper.xml
  20. 10 10
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/mapper/xml/ProgramAuditMapper.xml
  21. 2 2
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/mapper/xml/ProgramMembersMapper.xml
  22. 4 4
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/mapper/xml/ProgramReportNoMapper.xml
  23. 47 43
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/mapper/xml/ProjectListMapper.xml
  24. 18 15
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/service/ProjectListService.java
  25. 4 4
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/typeDict/mapper/xml/ProgramTypeDictMapper.xml
  26. 4 4
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/serviceType/mapper/xml/ProgramServiceTypeMapper.xml
  27. 8 8
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/proofread/mapper/xml/ProofreadDetailMapper.xml
  28. 4 4
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/proofread/mapper/xml/ProofreadInfoMapper.xml
  29. 4 4
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/proofread/mapper/xml/ProofreadIssuedMapper.xml
  30. 6 6
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementInfo/mapper/xml/ReimbursementDetailInfoContractMapper.xml
  31. 6 6
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementInfo/mapper/xml/ReimbursementDetailInfoOtherMapper.xml
  32. 6 6
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementInfo/mapper/xml/ReimbursementDetailInfoProcuredMapper.xml
  33. 20 20
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementInfo/mapper/xml/ReimbursementInfoMapper.xml
  34. 2 2
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementInfo/service/ReimbursementInfoService.java
  35. 7 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementType/controller/ReimbursementTypeController.java
  36. 8 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementType/mapper/ReimbursementTypeMapper.java
  37. 5 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementType/mapper/xml/ReimbursementTypeMapper.xml
  38. 10 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementType/service/ReimbursementTypeForTreeDataService.java
  39. 4 0
      jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/workContract/controller/WorkContractController.java
  40. 143 0
      jeeplus-modules/jeeplus-finance/pom.xml
  41. 28 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/JeeplusFinanceApplication.java
  42. 82 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/common/CommonApi.java
  43. 200 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/common/CommonUtils.java
  44. 46 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/common/enterpriseSearch/EnterpriseJsonRespDTO.java
  45. 87 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/common/enterpriseSearch/EnterpriseSearchApi.java
  46. 53 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/common/enterpriseSearch/EnterpriseSearchDTO.java
  47. 279 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/common/enterpriseSearch/TicketQueryUtils.java
  48. 42 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/common/flowable/dto/CommitParamDTO.java
  49. 60 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/controller/ContractFileController.java
  50. 51 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/controller/ContractFilePaperController.java
  51. 181 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/controller/ContractInfoController.java
  52. 95 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/controller/CwContractBorrowController.java
  53. 81 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/domain/ContractFile.java
  54. 82 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/domain/ContractFilePaper.java
  55. 248 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/domain/ContractInfo.java
  56. 22 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/domain/ContractParticipant.java
  57. 40 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/domain/CwWorkContractBorrow.java
  58. 42 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/domain/CwWorkContractBorrowMessage.java
  59. 43 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/mapper/ContractFileMapper.java
  60. 34 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/mapper/ContractFilePaperMapper.java
  61. 82 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/mapper/ContractInfoMapper.java
  62. 22 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/mapper/ContractParticipantMapper.java
  63. 36 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/mapper/CwWorkContractBorrowMapper.java
  64. 11 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/mapper/CwWorkContractBorrowMessageMapper.java
  65. 122 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/mapper/xml/ContractFileMapper.xml
  66. 32 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/mapper/xml/ContractFilePaperMapper.xml
  67. 269 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/mapper/xml/ContractInfoMapper.xml
  68. 11 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/mapper/xml/ContractParticipantMapper.xml
  69. 77 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/mapper/xml/CwWorkContractBorrowMapper.xml
  70. 210 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/service/ContractFilePaperService.java
  71. 232 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/service/ContractFileService.java
  72. 738 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/service/ContractInfoService.java
  73. 303 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/service/CwWorkContractBorrowService.java
  74. 45 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/contractRegistration/service/dto/CwWorkContractBorrowDto.java
  75. 385 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/controller/CwFinanceInvoiceController.java
  76. 189 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/domain/CwFinanceInvoice.java
  77. 52 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/domain/CwFinanceInvoiceBase.java
  78. 66 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/domain/CwFinanceInvoiceDetail.java
  79. 46 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/domain/CwFinanceInvoiceInvalid.java
  80. 51 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/domain/CwFinanceInvoiceReceivables.java
  81. 95 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/domain/SealUserInfo.java
  82. 14 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/CwFinanceInvoiceBaseMapper.java
  83. 14 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/CwFinanceInvoiceDetailMapper.java
  84. 14 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/CwFinanceInvoiceInvalidMapper.java
  85. 39 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/CwFinanceInvoiceMapper.java
  86. 14 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/CwFinanceInvoiceReceivablesMapper.java
  87. 36 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/xml/CwFinanceInvoiceBaseMapper.xml
  88. 42 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/xml/CwFinanceInvoiceDetailMapper.xml
  89. 34 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/xml/CwFinanceInvoiceInvalidMapper.xml
  90. 305 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/xml/CwFinanceInvoiceMapper.xml
  91. 36 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/xml/CwFinanceInvoiceReceivablesMapper.xml
  92. 593 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/CwFinanceInvoiceService.java
  93. 9 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/dto/CwFinanceDTO.java
  94. 47 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/dto/CwFinanceInvoiceBaseDTO.java
  95. 318 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/dto/CwFinanceInvoiceDTO.java
  96. 73 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/dto/CwFinanceInvoiceDetailDTO.java
  97. 42 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/dto/CwFinanceInvoiceInvalidDTO.java
  98. 53 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/dto/CwFinanceInvoiceReceivablesDTO.java
  99. 15 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/mapstruct/CwFinanceInvoiceBaseWrapper.java
  100. 0 0
      jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/mapstruct/CwFinanceInvoiceDetailWrapper.java

+ 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", "导入日志");
 
     /**
      * 类型值

+ 8 - 8
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/invoice/mapper/xml/FinanceInvoiceBaseMapper.xml

@@ -6,10 +6,10 @@
 
     <resultMap id="BaseResultMap" type="com.jeeplus.assess.invoice.service.dto.FinanceInvoiceBaseDTO">
             <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="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="invoiceId" column="invoice_id" jdbcType="VARCHAR"/>
             <result property="programName" column="program_name" jdbcType="VARCHAR"/>
@@ -24,10 +24,10 @@
 
     <sql id="Base_Column_List">
         fib.id,
-        fib.create_by,
-        fib.create_date,
-        fib.update_by,
-        fib.update_date,
+        fib.create_by_id,
+        fib.create_time,
+        fib.update_by_id,
+        fib.update_time,
         fib.del_flag,
         fib.invoice_id,
         fib.program_name,

+ 8 - 8
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/invoice/mapper/xml/FinanceInvoiceDetailMapper.xml

@@ -6,10 +6,10 @@
 
     <resultMap id="BaseResultMap" type="com.jeeplus.assess.invoice.service.dto.FinanceInvoiceDetailDTO">
             <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="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="invoiceId" column="invoice_id" jdbcType="VARCHAR"/>
@@ -24,10 +24,10 @@
 
     <sql id="Base_Column_List">
         fid.id,
-        fid.create_by,
-        fid.create_date,
-        fid.update_by,
-        fid.update_date,
+        fid.create_by_id,
+        fid.create_time,
+        fid.update_by_id,
+        fid.update_time,
         fid.del_flag,
         fid.remarks,
         fid.invoice_id,

+ 8 - 8
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/invoice/mapper/xml/FinanceInvoiceInvalidMapper.xml

@@ -6,10 +6,10 @@
 
     <resultMap id="BaseResultMap" type="com.jeeplus.assess.invoice.service.dto.FinanceInvoiceInvalidDTO">
             <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="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="invoiceId" column="invoice_id" jdbcType="VARCHAR"/>
@@ -20,10 +20,10 @@
 
     <sql id="Base_Column_List">
         fii.id,
-        fii.create_by,
-        fii.create_date,
-        fii.update_by,
-        fii.update_date,
+        fii.create_by_id,
+        fii.create_time,
+        fii.update_by_id,
+        fii.update_time,
         fii.del_flag,
         fii.remarks,
         fii.invoice_id,

+ 26 - 26
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/invoice/mapper/xml/FinanceInvoiceMapper.xml

@@ -6,10 +6,10 @@
 
     <resultMap id="BaseResultMap" type="com.jeeplus.assess.invoice.service.dto.FinanceInvoiceDTO">
             <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="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"/>
@@ -53,10 +53,10 @@
 
     <sql id="FIR_Column_List">
         fir.id,
-        fir.create_by,
-        fir.create_date,
-        fir.update_by,
-        fir.update_date,
+        fir.create_by_id,
+        fir.create_time,
+        fir.update_by_id,
+        fir.update_time,
         fir.del_flag,
         fir.remarks,
         fir.invoice_id,
@@ -68,10 +68,10 @@
 
     <sql id="FII_Column_List">
         fii.id,
-        fii.create_by,
-        fii.create_date,
-        fii.update_by,
-        fii.update_date,
+        fii.create_by_id,
+        fii.create_time,
+        fii.update_by_id,
+        fii.update_time,
         fii.del_flag,
         fii.remarks,
         fii.invoice_id,
@@ -82,10 +82,10 @@
 
     <sql id="FID_Column_List">
         fid.id,
-        fid.create_by,
-        fid.create_date,
-        fid.update_by,
-        fid.update_date,
+        fid.create_by_id,
+        fid.create_time,
+        fid.update_by_id,
+        fid.update_time,
         fid.del_flag,
         fid.remarks,
         fid.invoice_id,
@@ -100,10 +100,10 @@
 
     <sql id="FIB_Column_List">
         fib.id,
-        fib.create_by,
-        fib.create_date,
-        fib.update_by,
-        fib.update_date,
+        fib.create_by_id,
+        fib.create_time,
+        fib.update_by_id,
+        fib.update_time,
         fib.del_flag,
         fib.invoice_id,
         fib.program_name,
@@ -118,10 +118,10 @@
 
     <sql id="Base_Column_List">
         fi.id,
-        fi.create_by,
-        fi.create_date,
-        fi.update_by,
-        fi.update_date,
+        fi.create_by_id,
+        fi.create_time,
+        fi.update_by_id,
+        fi.update_time,
         fi.del_flag,
         fi.remarks,
         fi.type,
@@ -211,8 +211,8 @@
         art_invalid.ID_ as task_id_invalid
         from finance_invoice fi
         left join finance_invoice_detail cfid on cfid.invoice_id = fi.id and cfid.del_flag = '0'
-        left join sys_user su on fi.create_by = su.id and su.del_flag = '0'
-        left join sys_user_manage_office sumo on sumo.office_id = su.office_id
+        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'
         left join act_ru_task art on fi.proc_ins_id = art.PROC_INST_ID_
         left join finance_invoice_invalid invalid on invalid.invoice_id = fi.id and invalid.del_flag = '0'

+ 8 - 8
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/invoice/mapper/xml/FinanceInvoiceReceivablesMapper.xml

@@ -6,10 +6,10 @@
 
     <resultMap id="BaseResultMap" type="com.jeeplus.assess.invoice.service.dto.FinanceInvoiceReceivablesDTO">
             <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="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="invoiceId" column="invoice_id" jdbcType="VARCHAR"/>
@@ -21,10 +21,10 @@
 
     <sql id="Base_Column_List">
         fir.id,
-        fir.create_by,
-        fir.create_date,
-        fir.update_by,
-        fir.update_date,
+        fir.create_by_id,
+        fir.create_time,
+        fir.update_by_id,
+        fir.update_time,
         fir.del_flag,
         fir.remarks,
         fir.invoice_id,

+ 3 - 3
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/invoice/service/FinanceInvoiceService.java

@@ -82,7 +82,7 @@ public class FinanceInvoiceService extends ServiceImpl<FinanceInvoiceMapper, Fin
     public IPage<FinanceInvoiceDTO> findList(Page<FinanceInvoiceDTO> page, FinanceInvoiceDTO financeInvoiceDTO) throws Exception{
         QueryWrapper<FinanceInvoice> queryWrapper = QueryWrapperGenerator.buildQueryCondition ( FinanceInvoiceWrapper.INSTANCE.toEntity(financeInvoiceDTO), FinanceInvoice.class );
         queryWrapper.eq("fi.del_flag","0");
-        queryWrapper.orderByDesc("fi.create_date");
+        queryWrapper.orderByDesc("fi.create_time");
         ArrayList<String> searchIdList = new ArrayList<>();
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
         AtomicInteger checkNum = new AtomicInteger();
@@ -238,7 +238,7 @@ public class FinanceInvoiceService extends ServiceImpl<FinanceInvoiceMapper, Fin
                 }
             }
             if (StringUtils.isNotBlank(financeInvoiceDTO.getOperator())){
-                queryWrapper.like("su.name",financeInvoiceDTO.getOperator());
+                queryWrapper.eq("su.id",financeInvoiceDTO.getOperator());
             }
             if (StringUtils.isNotBlank(financeInvoiceDTO.getReconciliationPeopleName())) {
                 List<User> users = userService.list(new QueryWrapper<User>().lambda().like(User::getName, financeInvoiceDTO.getReconciliationPeopleName()));
@@ -254,7 +254,7 @@ public class FinanceInvoiceService extends ServiceImpl<FinanceInvoiceMapper, Fin
                 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",userIdList);
+                        queryWrapper.in("fi.create_by_id",userIdList);
                     } else {
                         return new Page<FinanceInvoiceDTO>();
                     }

+ 4 - 4
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/fileDict/mapper/xml/ProgramFileDictMapper.xml

@@ -21,10 +21,10 @@
 
     <sql id="Base_Column_List">
         pfd.id,
-        pfd.create_by,
-        pfd.create_date,
-        pfd.update_by,
-        pfd.update_date,
+        pfd.create_by_id,
+        pfd.create_time,
+        pfd.update_by_id,
+        pfd.update_time,
         pfd.del_flag,
         pfd.remarks,
         pfd.parent_id,

+ 12 - 12
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectDict/mapper/xml/ProjectDictMapper.xml

@@ -5,10 +5,10 @@
     <select id="parentList" resultType="com.jeeplus.assess.program.configuration.projectDict.domain.vo.FileDictVo">
         SELECT
             id AS file_id,
-            create_by,
-            create_by,
-            update_by,
-            update_date,
+            create_by_id,
+            create_time,
+            update_by_id,
+            update_time,
             del_flag,
             remarks,
             parent_id,
@@ -29,10 +29,10 @@
             a.id,
             a.required_stage,
             b.id AS file_id,
-            b.create_by,
-            b.create_by,
-            b.update_by,
-            b.update_date,
+            b.create_by_id,
+            b.create_time,
+            b.update_by_id,
+            b.update_time,
             b.del_flag,
             b.remarks,
             b.parent_id,
@@ -89,10 +89,10 @@
             a.id,
             a.required_stage,
             b.id AS file_id,
-            b.create_by,
-            b.create_by,
-            b.update_by,
-            b.update_date,
+            b.create_by_id,
+            b.create_time,
+            b.update_by_id,
+            b.update_time,
             b.del_flag,
             b.remarks,
             b.parent_id,

+ 8 - 41
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/domain/ProgramProjectListInfo.java

@@ -3,6 +3,7 @@ package com.jeeplus.assess.program.configuration.projectList.domain;
 import cn.afterturn.easypoi.excel.annotation.Excel;
 import com.baomidou.mybatisplus.annotation.*;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jeeplus.core.domain.BaseEntity;
 import com.jeeplus.core.query.Query;
 import lombok.Data;
 import org.springframework.format.annotation.DateTimeFormat;
@@ -13,47 +14,7 @@ import java.util.List;
 
 @Data
 @TableName(value = "program_project_list_info")
-public class ProgramProjectListInfo {
-
-    /**
-     * 实体主键
-     */
-    @TableId
-    private String id;
-
-    /**
-     * 创建日期
-     */
-    @TableField(fill = FieldFill.INSERT)
-    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
-    @Excel(name = "创建时间", width = 30, orderNum = "6")
-    private Date createDate;
-
-    /**
-     * 创建人
-     */
-    @Query(tableColumn = "a.create_by")
-    @TableField(fill = FieldFill.INSERT)
-    private String createBy;
-
-    /**
-     * 更新日期
-     */
-    @TableField(fill = FieldFill.INSERT_UPDATE)
-    private Date updateDate;
-
-    /**
-     * 更新人
-     */
-    @TableField(fill = FieldFill.INSERT_UPDATE)
-    private String updateBy;
-
-    /**
-     * 逻辑删除标记
-     */
-    @TableLogic
-    @TableField(fill = FieldFill.INSERT)
-    private Integer delFlag;
+public class ProgramProjectListInfo extends BaseEntity {
 
     private String contractId;
 
@@ -214,6 +175,12 @@ public class ProgramProjectListInfo {
     private String[] createDates;
 
     /**
+     * 创建人id
+     */
+    @TableField(exist = false)
+    private String createBy;
+
+    /**
      * 是否开票
      */
     @TableField(exist = false)

+ 8 - 8
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/mapper/xml/ProgramArchiveMapper.xml

@@ -49,10 +49,10 @@
 
     <sql id="Base_Column_List">
         pa.id,
-        pa.create_by,
-        pa.create_date,
-        pa.update_by,
-        pa.update_date,
+        pa.create_by_id,
+        pa.create_time,
+        pa.update_by_id,
+        pa.update_time,
         pa.del_flag,
         pa.remarks,
         pa.program_id,
@@ -91,10 +91,10 @@
     </sql>
     <sql id="Program_Column_List">
         ppli.id,
-        ppli.create_by,
-        ppli.create_date,
-        ppli.update_by,
-        ppli.update_date,
+        ppli.create_by_id,
+        ppli.create_time,
+        ppli.update_by_id,
+        ppli.update_time,
         ppli.del_flag,
         ppli.contract_id,
         ppli.contract_name,

+ 4 - 4
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/mapper/xml/ProgramAuditAssessPeopleMapper.xml

@@ -18,10 +18,10 @@
 
     <sql id="Base_Column_List">
         paap.id,
-        paap.create_by,
-        paap.create_date,
-        paap.update_by,
-        paap.update_date,
+        paap.create_by_id,
+        paap.create_time,
+        paap.update_by_id,
+        paap.update_time,
         paap.del_flag,
         paap.remarks,
         paap.audit_id,

+ 10 - 10
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/mapper/xml/ProgramAuditMapper.xml

@@ -31,10 +31,10 @@
 
     <sql id="Base_Column_List">
         pa.id,
-        pa.create_by,
-        pa.create_date,
-        pa.update_by,
-        pa.update_date,
+        pa.create_by_id,
+        pa.create_time,
+        pa.update_by_id,
+        pa.update_time,
         pa.del_flag,
         pa.remarks,
         pa.program_id,
@@ -52,8 +52,8 @@
         pa.status
     </sql>
     <sql id="Program_Column_List">
-        id,create_by,create_date,
-        update_by,update_date,del_flag,
+        id,create_by_id,create_time,
+        update_by_id,update_time,del_flag,
         contract_id,contract_name,client,
         client_name,amount,contract_type,
         name,no,project_type,
@@ -74,10 +74,10 @@
     </sql>
     <sql id="Assess_Column_List">
         paap.id,
-        paap.create_by,
-        paap.create_date,
-        paap.update_by,
-        paap.update_date,
+        paap.create_by_id,
+        paap.create_time,
+        paap.update_by_id,
+        paap.update_time,
         paap.del_flag,
         paap.remarks,
         paap.audit_id,

+ 2 - 2
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/mapper/xml/ProgramMembersMapper.xml

@@ -19,8 +19,8 @@
     </resultMap>
 
     <sql id="Base_Column_List">
-        id,create_by,create_date,
-        update_by,update_date,del_flag,
+        id,create_by_id,create_time,
+        update_by_id,update_time,del_flag,
         remarks,project_id,user_id,
         status,is_important
     </sql>

+ 4 - 4
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/mapper/xml/ProgramReportNoMapper.xml

@@ -18,10 +18,10 @@
 
     <sql id="Base_Column_List">
         prn.id,
-        prn.create_by,
-        prn.create_date,
-        prn.update_by,
-        prn.update_date,
+        prn.create_by_id,
+        prn.create_time,
+        prn.update_by_id,
+        prn.update_time,
         prn.del_flag,
         prn.remarks,
         prn.program_id,

+ 47 - 43
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/mapper/xml/ProjectListMapper.xml

@@ -5,9 +5,9 @@
    <select id="findContractPageList" resultType="com.jeeplus.assess.workContract.domain.WorkContractInfo">
        SELECT
            a.id,
-           a.create_date,
-           a.update_by,
-           a.update_date,
+           a.create_time,
+           a.update_by_id,
+           a.update_time,
            a.del_flag,
            a.client_id,
            a.client_name,
@@ -35,10 +35,10 @@
            a.status,
            a.filed_type,
            a.borrow_type,
-           b.NAME AS create_by
+           b.NAME AS create_by_id
         FROM
             work_contract_info a
-            LEFT JOIN sys_user b ON a.create_by = b.id
+            LEFT JOIN sys_user b ON a.create_by_id = b.id
         WHERE
             a.del_flag = 0
             and a.status != 1
@@ -51,7 +51,7 @@
            <if test="dto.clientName != null and dto.clientName != ''">
                AND a.client_name LIKE CONCAT ('%', #{dto.clientName}, '%')
            </if>
-            ORDER BY a.create_by DESC
+            ORDER BY a.create_by_id DESC
    </select>
 
     <update id="updateStatusById">
@@ -62,10 +62,11 @@
         SELECT
         distinct
            a.id,
-           b.name AS create_by,
-           a.create_date,
-           a.update_by,
-           a.update_date,
+           b.name AS create_by_id,
+           a.create_by_id as create_by,
+           a.create_time,
+           a.update_by_id,
+           a.update_time,
            a.del_flag,
            a.contract_id,
            a.contract_name,
@@ -143,7 +144,7 @@
            art_archive.ID_ as task_id_archive
         FROM
             program_project_list_info a
-            LEFT JOIN sys_user b ON a.create_by = b.id
+            LEFT JOIN sys_user b ON a.create_by_id = b.id
             LEFT JOIN sys_user c ON a.project_manager = c.id
             LEFT JOIN work_contract_info wci ON wci.id = a.contract_id and wci.del_flag = '0'
             LEFT JOIN program_report_no prn ON prn.program_id = a.id and prn.del_flag = '0'
@@ -160,16 +161,17 @@
             LEFT JOIN act_ru_task artd ON d.proc_ins_id = artd.PROC_INST_ID_
             LEFT JOIN act_ru_task art_archive ON pa.proc_ins_id = art_archive.PROC_INST_ID_
             ${ew.customSqlSegment}
-            ORDER BY a.update_date DESC
+            ORDER BY a.create_time DESC
     </select>
     <select id="findPageList2" resultType="com.jeeplus.assess.program.configuration.projectList.domain.ProgramProjectListInfo">
         SELECT
         distinct
            a.id,
-           b.name AS create_by,
-           a.create_date,
-           a.update_by,
-           a.update_date,
+           b.name AS create_by_id,
+           a.create_by_id as create_by,
+           a.create_time,
+           a.update_by_id,
+           a.update_time,
            a.del_flag,
            a.contract_id,
            a.contract_name,
@@ -241,7 +243,7 @@
            wci.no AS contract_no
         FROM
             program_project_list_info a
-            LEFT JOIN sys_user b ON a.create_by = b.id
+            LEFT JOIN sys_user b ON a.create_by_id = b.id
             LEFT JOIN sys_user c ON a.project_manager = c.id
             LEFT JOIN work_contract_info wci ON wci.id = a.contract_id and wci.del_flag = '0'
             LEFT JOIN program_report_no prn ON prn.program_id = a.id and prn.del_flag = '0'
@@ -252,16 +254,17 @@
             left join program_members pm on a.id = pm.project_id
             LEFT JOIN proofread_issued d ON a.id = d.project_id
             ${ew.customSqlSegment}
-            ORDER BY a.update_date DESC
+            ORDER BY a.create_time DESC
     </select>
 
     <select id="findInfoList" resultType="com.jeeplus.assess.program.configuration.projectList.domain.ProgramProjectListInfo">
         SELECT
            a.id,
-           b.name AS create_by,
-           a.create_date,
-           a.update_by,
-           a.update_date,
+           b.name AS create_by_id,
+           a.create_by_id as create_by,
+           a.create_time,
+           a.update_by_id,
+           a.update_time,
            a.del_flag,
            a.contract_id,
            a.contract_name,
@@ -333,7 +336,7 @@
            d.status AS issued_status
         FROM
             program_project_list_info a
-            LEFT JOIN sys_user b ON a.create_by = b.id
+            LEFT JOIN sys_user b ON a.create_by_id = b.id
             LEFT JOIN sys_user c ON a.project_manager = c.id
             LEFT JOIN program_report_no prn ON prn.program_id = a.id
             LEFT JOIN program_audit pa1 ON pa1.program_id = a.id and pa1.audit_level = '1' and pa1.del_flag = '0'
@@ -342,16 +345,16 @@
             LEFT JOIN program_archive pa ON pa.program_id = a.id and pa.del_flag = '0'
             LEFT JOIN proofread_issued d ON a.id = d.project_id
             ${ew.customSqlSegment}
-            ORDER BY a.update_date DESC
+            ORDER BY a.create_time DESC
     </select>
 
     <select id="getById" resultType="com.jeeplus.assess.program.configuration.projectList.domain.ProgramProjectListInfo">
         SELECT
            a.id,
-           b.name AS create_by,
-           a.create_date,
-           a.update_by,
-           a.update_date,
+           b.name AS create_by_id,
+           a.create_time,
+           a.update_by_id,
+           a.update_time,
            a.del_flag,
            a.contract_id,
            a.contract_name,
@@ -423,7 +426,7 @@
            d.status AS issued_status
         FROM
             program_project_list_info a
-            LEFT JOIN sys_user b ON a.create_by = b.id
+            LEFT JOIN sys_user b ON a.create_by_id = b.id
             LEFT JOIN sys_user c ON a.project_manager = c.id
             LEFT JOIN program_report_no prn ON prn.program_id = a.id
             LEFT JOIN program_audit pa1 ON pa1.program_id = a.id and pa1.audit_level = '1' and pa1.del_flag = '0'
@@ -484,16 +487,16 @@
                     #{item.id}
                 </foreach>
             </if>
-            ORDER BY a.update_date DESC) AS tab
+            ORDER BY a.create_time DESC) AS tab
             ,(SELECT @i:=0) AS itable
     </select>
 
     <resultMap id="BaseResultMap" type="com.jeeplus.assess.program.configuration.projectList.domain.ProgramProjectListInfo">
         <id property="id" column="id" jdbcType="VARCHAR"/>
-        <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
-        <result property="createDate" column="create_date" jdbcType="TIMESTAMP"/>
-        <result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
-        <result property="updateDate" column="update_date" jdbcType="TIMESTAMP"/>
+        <result property="createById" column="create_by_id" jdbcType="VARCHAR"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+        <result property="updateById" column="update_by_id" jdbcType="VARCHAR"/>
+        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
         <result property="delFlag" column="del_flag" jdbcType="VARCHAR"/>
         <result property="contractId" column="contract_id" jdbcType="VARCHAR"/>
         <result property="contractName" column="contract_name" jdbcType="VARCHAR"/>
@@ -550,10 +553,10 @@
 
     <sql id="Base_Column_List">
         ppli.id,
-        ppli.create_by,
-        ppli.create_date,
-        ppli.update_by,
-        ppli.update_date,
+        ppli.create_by_id,
+        ppli.create_time,
+        ppli.update_by_id,
+        ppli.update_time,
         ppli.del_flag,
         ppli.contract_id,
         ppli.contract_name,
@@ -610,15 +613,16 @@
     <select id="findPage" resultType="com.jeeplus.assess.program.configuration.projectList.domain.ProgramProjectListInfo">
         SELECT
         <include refid="Base_Column_List"></include>,
-        su.name AS create_by,
-        sup.name as project_manager_name
+        su.name AS create_by_id,
+        sup.name as project_manager_name,
+        ppli.create_by_id as create_by
         FROM
             program_project_list_info ppli
-            LEFT JOIN sys_user su ON ppli.create_by = su.id
+            LEFT JOIN sys_user su ON ppli.create_by_id = su.id
             LEFT JOIN sys_user sup ON ppli.project_manager = su.id
             LEFT JOIN
             ${ew.customSqlSegment}
-            ORDER BY ppli.update_date DESC
+            ORDER BY ppli.create_time DESC
     </select>
 
     <select id="selectInvoiceFlag" resultType="string">
@@ -636,7 +640,7 @@
         from finance_invoice_base fib
         inner join finance_invoice fi on fi.id = fib.invoice_id and fi.del_flag = '0'
         where fib.del_flag = '0' and fi.status != '9' and fib.program_id = #{id}
-        order by fi.create_date desc
+        order by fi.create_time desc
         limit 1
     </select>
 

+ 18 - 15
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/projectList/service/ProjectListService.java

@@ -106,7 +106,7 @@ public class ProjectListService {
         BeanUtils.copyProperties(dto, info);
         String reportNo = "";
         String id = UUID.randomUUID().toString().replace("-", "");
-        if (dto.getGenerateReportNumber().equals("true")) {
+        if (("true").equals(dto.getGenerateReportNumber())) {
             if(StringUtils.isNotBlank(info.getReportType())){
                 if (info.getReportType().equals("1")){
                     reportNo = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ProgramReportNoDto.BIZ_CODE);
@@ -126,10 +126,10 @@ public class ProjectListService {
         info.setId(id);
         info.setNo(no);
         info.setApprovalNo(approvalNo);
-        info.setCreateBy(userDTO.getId());
-        info.setCreateDate(new Date());
-        info.setUpdateBy(userDTO.getId());
-        info.setUpdateDate(new Date());
+        info.setCreateById(userDTO.getId());
+        info.setCreateTime(new Date());
+        info.setUpdateById(userDTO.getId());
+        info.setUpdateTime(new Date());
         info.setDelFlag(0);
         info.setTabType(tabType);
         projectListMapper.insert(info);
@@ -163,7 +163,7 @@ public class ProjectListService {
                 projectMemberMapper.insert(member);
                 if (StringUtils.isNotBlank(member.getUserId())) {
 //                    成员的user_id不是"项目负责人"、"项目创建人"的添加到非主要项目组成员id集合中
-                    if (!member.getUserId().equals(info.getProjectManager()) && !member.getUserId().equals(info.getCreateBy())) {
+                    if (!member.getUserId().equals(info.getProjectManager()) && !member.getUserId().equals(info.getCreateById())) {
                         memberIds.add(member.getUserId());
                     }
                 }
@@ -186,10 +186,10 @@ public class ProjectListService {
         p.setIsImportant("1");  // 主要成员
         p.setProjectId(id);
         p.setStatus("0");
-        p.setUserId(info.getCreateBy());  //  项目创建人
+        p.setUserId(info.getCreateById());  //  项目创建人
         programMembers.add(p);
         if (StringUtils.isNotBlank(info.getProjectManager())) {
-            if (!info.getCreateBy().equals(info.getProjectManager())) { // 项目创建人,项目负责人去重一下
+            if (!info.getCreateById().equals(info.getProjectManager())) { // 项目创建人,项目负责人去重一下
                 ProgramMembers m = new ProgramMembers();
                 m.setIsImportant("1");  // 主要成员
                 m.setProjectId(id);
@@ -339,12 +339,12 @@ public class ProjectListService {
         // 修改项目管理列表主表信息
         ProgramProjectListInfo info = new ProgramProjectListInfo();
         BeanUtils.copyProperties(dto, info);
-        info.setUpdateBy(userDTO.getId());
-        info.setUpdateDate(new Date());
+        info.setUpdateById(userDTO.getId());
+        info.setUpdateTime(new Date());
         info.setDelFlag(0);
         projectListMapper.updateById(info);
         String reportNo = "";
-        if (dto.getGenerateReportNumber().equals("true")) {
+        if (("true").equals(dto.getGenerateReportNumber())) {
             ProgramReportNo programReportNo = programReportNoMapper.selectByProgramId(info.getId());
             if (null == programReportNo) {
                 if(StringUtils.isNotBlank(info.getReportType())){
@@ -395,7 +395,7 @@ public class ProjectListService {
                 projectMemberMapper.insert(member);
                 if (StringUtils.isNotBlank(member.getUserId())) {
 //                    成员的user_id不是"项目负责人"、"项目创建人"的添加到非主要项目组成员id集合中
-                    if (!member.getUserId().equals(info.getProjectManager()) && !member.getUserId().equals(info.getCreateBy())) {
+                    if (!member.getUserId().equals(info.getProjectManager()) && !member.getUserId().equals(info.getCreateById())) {
                         memberIds.add(member.getUserId());
                     }
                 }
@@ -419,11 +419,11 @@ public class ProjectListService {
         p.setIsImportant("1");  // 主要成员
         p.setProjectId(dto.getId());
         p.setStatus("0");
-        p.setUserId(byId1.getCreateBy());  //  项目创建人
+        p.setUserId(byId1.getCreateById());  //  项目创建人
         programMembers.add(p);
         if (StringUtils.isNotBlank(info.getProjectManager())) {
             ProgramProjectListInfo byId = projectListMapper.getById(dto.getId());
-            if (!byId.getCreateBy().equals(info.getProjectManager())) { // 项目创建人,项目负责人去重一下
+            if (!byId.getCreateById().equals(info.getProjectManager())) { // 项目创建人,项目负责人去重一下
                 ProgramMembers m = new ProgramMembers();
                 m.setIsImportant("1");  // 主要成员
                 m.setProjectId(dto.getId());
@@ -627,10 +627,13 @@ public class ProjectListService {
 
     public IPage<ProgramProjectListInfo> list(Page<ProgramProjectListInfo> page, ProgramProjectListInfo info, String tabType) throws Exception{
         QueryWrapper<ProgramProjectListInfo> wrapper = QueryWrapperGenerator.buildQueryCondition(info, ProgramProjectListInfo.class);
+        if (ObjectUtil.isNotEmpty(info) && StringUtils.isNotBlank(info.getCreateById())) {
+            wrapper.eq("a.create_by_id", info.getCreateById());
+        }
         wrapper.eq("a.del_flag", "0");
         wrapper.eq("a.tab_type", tabType);
         if (info.getCreateDates() != null) {
-            wrapper.between("a.create_date", info.getCreateDates()[0], info.getCreateDates()[1]);
+            wrapper.between("a.create_time", info.getCreateDates()[0], info.getCreateDates()[1]);
         }
         IPage<ProgramProjectListInfo> pageList = projectListMapper.findPageList(page, wrapper);
         pageList.getRecords().stream().forEach(item ->{

+ 4 - 4
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/configuration/typeDict/mapper/xml/ProgramTypeDictMapper.xml

@@ -19,10 +19,10 @@
 
     <sql id="Base_Column_List">
         ptd.id,
-        ptd.create_by,
-        ptd.create_date,
-        ptd.update_by,
-        ptd.update_date,
+        ptd.create_by_id,
+        ptd.create_time,
+        ptd.update_by_id,
+        ptd.update_time,
         ptd.del_flag,
         ptd.remarks,
         ptd.type,

+ 4 - 4
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/program/serviceType/mapper/xml/ProgramServiceTypeMapper.xml

@@ -21,10 +21,10 @@
 
     <sql id="Base_Column_List">
         pst.id,
-        pst.create_by,
-        pst.create_date,
-        pst.update_by,
-        pst.update_date,
+        pst.create_by_id,
+        pst.create_time,
+        pst.update_by_id,
+        pst.update_time,
         pst.del_flag,
         pst.remarks,
         pst.name,

+ 8 - 8
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/proofread/mapper/xml/ProofreadDetailMapper.xml

@@ -5,10 +5,10 @@
 	<select id="findByInfoId" resultType="com.jeeplus.assess.proofread.domain.ProofreadDetail">
 		SELECT
 			a.id,
-			a.create_by,
-			a.create_date,
-			a.update_by,
-			a.update_date,
+			a.create_by_id,
+			a.create_time,
+			a.update_by_id,
+			a.update_time,
 			a.del_flag,
 			a.info_id,
 			a.type_id,
@@ -27,10 +27,10 @@
 	<select id="findList" resultType="com.jeeplus.assess.proofread.domain.ProofreadDetail">
 		SELECT
 			id AS type_id,
-			create_by,
-			create_date,
-			update_by,
-			update_date,
+			create_by_id,
+			create_time,
+			update_by_id,
+			update_time,
 			del_flag,
 			parent_id,
 			parent_ids,

+ 4 - 4
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/proofread/mapper/xml/ProofreadInfoMapper.xml

@@ -5,10 +5,10 @@
 	<select id="findByProjectId" resultType="com.jeeplus.assess.proofread.service.dto.ProofreadInfoDto">
 		SELECT
 			a.id,
-			a.create_by,
-			a.create_date,
-			a.update_by,
-			a.update_date,
+			a.create_by_id,
+			a.create_time,
+			a.update_by_id,
+			a.update_time,
 			a.del_flag,
 			a.type,
 			a.project_id,

+ 4 - 4
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/proofread/mapper/xml/ProofreadIssuedMapper.xml

@@ -5,10 +5,10 @@
 	<select id="findById" resultType="com.jeeplus.assess.proofread.domain.ProofreadIssued">
 		SELECT
 			a.id,
-			a.create_by,
-			a.create_date,
-			a.update_by,
-			a.update_date,
+			a.create_by_id,
+			a.create_time,
+			a.update_by_id,
+			a.update_time,
 			a.del_flag,
 			a.project_id,
 			b.`name` AS project_name,

+ 6 - 6
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementInfo/mapper/xml/ReimbursementDetailInfoContractMapper.xml

@@ -6,10 +6,10 @@
 
     <resultMap id="BaseResultMap" type="com.jeeplus.assess.reimbursement.reimbursementInfo.service.dto.ReimbursementDetailInfoContractDTO">
             <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="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="infoId" column="info_id" jdbcType="VARCHAR"/>
             <result property="userId" column="user_id" jdbcType="VARCHAR"/>
@@ -24,8 +24,8 @@
     </resultMap>
 
     <sql id="Base_Column_List">
-        id,create_by,create_date,
-        update_by,update_date,del_flag,
+        id,create_by_id,create_time,
+        update_by_id,update_time,del_flag,
         info_id,user_id,dept_id,
         type_id,contract_id,report_number,
         number,receipt_number,days,

+ 6 - 6
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementInfo/mapper/xml/ReimbursementDetailInfoOtherMapper.xml

@@ -6,10 +6,10 @@
 
     <resultMap id="BaseResultMap" type="com.jeeplus.assess.reimbursement.reimbursementInfo.service.dto.ReimbursementDetailInfoOtherDTO">
             <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="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="infoId" column="info_id" jdbcType="VARCHAR"/>
             <result property="userId" column="user_id" jdbcType="VARCHAR"/>
@@ -28,8 +28,8 @@
     </resultMap>
 
     <sql id="Base_Column_List">
-        id,create_by,create_date,
-        update_by,update_date,del_flag,
+        id,create_by_id,create_time,
+        update_by_id,update_time,del_flag,
         info_id,user_id,user_name,
         dept_id,dept_name,type_id,
         type_name,project_id,project_name,

+ 6 - 6
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementInfo/mapper/xml/ReimbursementDetailInfoProcuredMapper.xml

@@ -6,10 +6,10 @@
 
     <resultMap id="BaseResultMap" type="com.jeeplus.assess.reimbursement.reimbursementInfo.service.dto.ReimbursementDetailInfoProcuredDTO">
             <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="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="infoId" column="info_id" jdbcType="VARCHAR"/>
             <result property="userId" column="user_id" jdbcType="VARCHAR"/>
@@ -28,8 +28,8 @@
     </resultMap>
 
     <sql id="Base_Column_List">
-        id,create_by,create_date,
-        update_by,update_date,del_flag,
+        id,create_by_id,create_time,
+        update_by_id,update_time,del_flag,
         info_id,user_id,user_name,
         dept_id,dept_name,type_id,
         type_name,project_id,project_name,

+ 20 - 20
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementInfo/mapper/xml/ReimbursementInfoMapper.xml

@@ -52,10 +52,10 @@
 			a.proc_ins_id,
 			a.process_definition_id,
 			d.ID_ AS task_id,
-			a.create_by as create_id,
+			a.create_by_id as create_id,
 			a.source_type,
-			a.purchase_id,
-			pru.purchase_no
+			a.purchase_id
+-- 			pru.purchase_no
 		FROM
 			reimbursement_info a
 
@@ -85,12 +85,12 @@
 
 
 
-			LEFT JOIN sys_user c ON a.create_by =  c.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 d ON a.proc_ins_id = d.PROC_INST_ID_
-			left join material_management_pruchase_request_basics pru on pru.id = a.purchase_id and pru.del_flag = '0'
+-- 			left join material_management_pruchase_request_basics pru on pru.id = a.purchase_id and pru.del_flag = '0'
 			${ew.customSqlSegment}
-		ORDER BY a.update_date DESC
+		ORDER BY a.update_time DESC
 	</select>
 
 	<select id="findFiles" resultType="com.jeeplus.pubmodules.oss.service.dto.WorkAttachmentDto">
@@ -98,8 +98,8 @@
 			id,
 			url,
 			attachment_name AS `name`,
-			create_by AS `by`,
-			create_date
+			create_by_id AS `by`,
+			create_time
 		FROM
 			work_attachment
 		WHERE
@@ -154,10 +154,10 @@
 		FROM
 			reimbursement_info a
 			LEFT JOIN reimbursement_detail_info b ON a.id = b.info_id AND b.del_flag = 0
-			LEFT JOIN sys_user c ON a.create_by =  c.id
+			LEFT JOIN sys_user c ON a.create_by_id =  c.id
 			LEFT JOIN act_ru_task d ON a.proc_ins_id = d.PROC_INST_ID_
 			${ew.customSqlSegment}
-		ORDER BY a.update_date DESC
+		ORDER BY a.update_time DESC
 	</select>
 
 	<select id="relationReimbursementList" resultType="com.jeeplus.assess.reimbursement.reimbursementInfo.service.dto.RetureListDto">
@@ -181,12 +181,12 @@
 		FROM
 			reimbursement_info a
 			LEFT JOIN reimbursement_detail_info b ON a.id = b.info_id AND b.del_flag = 0
-			LEFT JOIN sys_user c ON a.create_by =  c.id
+			LEFT JOIN sys_user c ON a.create_by_id =  c.id
 			LEFT JOIN act_ru_task d ON a.proc_ins_id = d.PROC_INST_ID_
 		WHERE
 			a.del_flag = 0
 			AND a.project_id IN (SELECT id FROM program_project_list_info WHERE del_flag = 0 AND contract_id = #{id})
-		ORDER BY a.update_date DESC
+		ORDER BY a.update_time DESC
 	</select>
 	<select id="findOfficeListByUserName"
 			resultType="com.jeeplus.assess.reimbursement.reimbursementInfo.service.dto.TreeUserDto">
@@ -199,8 +199,8 @@
 	<select id="getContractDetailList" resultType="com.jeeplus.assess.reimbursement.reimbursementInfo.domain.ReimbursementDetailInfoContract">
 		select
 		a.id,
-		a.create_by,
-		a.create_date,
+		a.create_by_id,
+		a.create_time,
 		a.del_flag,
 		a.info_id,
 		a.user_id,
@@ -228,8 +228,8 @@
 	<select id="getDetailList" resultType="com.jeeplus.assess.reimbursement.reimbursementInfo.domain.ReimbursementDetailInfo">
 		select
 		a.id,
-		a.create_by,
-		a.create_date,
+		a.create_by_id,
+		a.create_time,
 		a.del_flag,
 		a.info_id,
 		a.user_id,
@@ -257,8 +257,8 @@
 	<select id="getOtherDetailList" resultType="com.jeeplus.assess.reimbursement.reimbursementInfo.domain.ReimbursementDetailInfoOther">
 		select
 		a.id,
-		a.create_by,
-		a.create_date,
+		a.create_by_id,
+		a.create_time,
 		a.del_flag,
 		a.info_id,
 		a.user_id,
@@ -286,8 +286,8 @@
 	<select id="getProcuredDetailList" resultType="com.jeeplus.assess.reimbursement.reimbursementInfo.domain.ReimbursementDetailInfoProcured">
 		select
 		a.id,
-		a.create_by,
-		a.create_date,
+		a.create_by_id,
+		a.create_time,
 		a.del_flag,
 		a.info_id,
 		a.user_id,

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

@@ -112,7 +112,7 @@ public class ReimbursementInfoService {
         }
         // 经办人
         if (StringUtils.isNotEmpty(dto.getHandled())) {
-            queryWrapper.apply("(a.create_by = {0} OR c.name LIKE {1})", dto.getHandled(), "%" + dto.getHandled() + "%");
+            queryWrapper.apply("(a.create_by_id = {0} OR c.name LIKE {1})", dto.getHandled(), "%" + dto.getHandled() + "%");
         }
         // 报销人
         if (StringUtils.isNotEmpty(dto.getReimBy())) {
@@ -629,7 +629,7 @@ public class ReimbursementInfoService {
         for (TreeUserDto userDto : userList) {
 
             for (TreeUserDto officeDto : officeList) {
-                if(userDto.getParentId().equals(officeDto.getId())){
+                if(StringUtils.isNotBlank(userDto.getParentId()) && userDto.getParentId().equals(officeDto.getId())){
                     list.add(officeDto);
                     list.add(userDto);
                     List<TreeUserDto> treeUserDtos = disposeOfficeTree(officeDto, officeList);

+ 7 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementType/controller/ReimbursementTypeController.java

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

+ 8 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementType/mapper/ReimbursementTypeMapper.java

@@ -5,6 +5,8 @@ import com.jeeplus.core.domain.TreeMapper;
 import com.jeeplus.assess.reimbursement.reimbursementType.domain.ReimbursementTypeInfo;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 public interface ReimbursementTypeMapper extends BaseMapper<ReimbursementTypeInfo>, TreeMapper<ReimbursementTypeInfo> {
 
     /**
@@ -18,4 +20,10 @@ public interface ReimbursementTypeMapper extends BaseMapper<ReimbursementTypeInf
     Integer getNo(@Param("parentId") String parentId);
 
     Integer getLevel(@Param("parentId") String parentId);
+
+    /**
+     * 获取所有业务类型的数据
+     * @return
+     */
+    List<ReimbursementTypeInfo> getAllList();
 }

+ 5 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementType/mapper/xml/ReimbursementTypeMapper.xml

@@ -32,4 +32,9 @@
 			del_flag = 0
 			AND id = #{parentId}
 	</select>
+
+	<select id="getAllList"
+			resultType="com.jeeplus.assess.reimbursement.reimbursementType.domain.ReimbursementTypeInfo">
+		select * from cw_reimbursement_type_info where  del_flag = '0' order by sort asc
+	</select>
 </mapper>

+ 10 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementType/service/ReimbursementTypeForTreeDataService.java

@@ -38,6 +38,16 @@ public class ReimbursementTypeForTreeDataService extends TreeService<Reimburseme
         return rootTree;
     }
 
+    public List<ReimbursementTypeInfo> treeDataForType1(String extId, String type) throws Exception{
+        //获取所有的业务类型为1的数据
+        List<ReimbursementTypeInfo> allList = typeMapper.getAllList();
+//        List <ReimbursementTypeInfo> allList = super.list (new LambdaQueryWrapper<>( (Class <ReimbursementTypeInfo>) entityClass ).orderByAsc ( ReimbursementTypeInfo::getSort ));
+        ReimbursementTypeInfo root = entityClass.getConstructor ( ).newInstance ( );
+        root.setId ( TreeDTO.getRootId () );
+        List <ReimbursementTypeInfo> rootTree = this.formatListToTreeForType ( root, allList, extId, type );
+        return rootTree;
+    }
+
     /**
      * 以root为根节点, 将allList从线性列表转为树形列表
      *

+ 4 - 0
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/workContract/controller/WorkContractController.java

@@ -18,6 +18,7 @@ import com.jeeplus.assess.workContract.service.dto.WorkContractInfoDto;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.*;
 
@@ -45,6 +46,9 @@ public class WorkContractController {
         String statusList = workClientInfo.getStatusList();
         String status = workClientInfo.getStatus();
         QueryWrapper<WorkContractInfo> workContractInfoQueryWrapper = QueryWrapperGenerator.buildQueryCondition(workClientInfo, WorkContractInfo.class);
+        if (ObjectUtil.isNotEmpty(workClientInfo) && StringUtils.isNotBlank(workClientInfo.getCreateById())) {
+            workContractInfoQueryWrapper.eq("a.create_by_id", workClientInfo.getCreateById());
+        }
         IPage<WorkContractInfo> list = workContractService.list(page, workContractInfoQueryWrapper, clientName, contractDates, contractAmounts, statusList, status);
         return ResponseEntity.ok (list);
     }

+ 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);
+
+}

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


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