Explorar o código

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/flowable/model/Flow.java
user5 %!s(int64=2) %!d(string=hai) anos
pai
achega
6a32cf2590
Modificáronse 100 ficheiros con 6680 adicións e 464 borrados
  1. 35 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/common/FindUtils.java
  2. 51 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/controller/ContractFilePaperController.java
  3. 25 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/controller/ContractInfoController.java
  4. 96 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/controller/CwContractBorrowController.java
  5. 4 2
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/domain/ContractFile.java
  6. 81 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/domain/ContractFilePaper.java
  7. 114 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/domain/ContractInfo.java
  8. 40 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/domain/CwWorkContractBorrow.java
  9. 42 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/domain/CwWorkContractBorrowMessage.java
  10. 2 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/mapper/ContractFileMapper.java
  11. 34 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/mapper/ContractFilePaperMapper.java
  12. 27 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/mapper/ContractInfoMapper.java
  13. 36 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/mapper/CwWorkContractBorrowMapper.java
  14. 11 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/mapper/CwWorkContractBorrowMessageMapper.java
  15. 3 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/mapper/xml/ContractFileMapper.xml
  16. 32 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/mapper/xml/ContractFilePaperMapper.xml
  17. 90 6
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/mapper/xml/ContractInfoMapper.xml
  18. 77 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/mapper/xml/CwWorkContractBorrowMapper.xml
  19. 206 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/service/ContractFilePaperService.java
  20. 11 3
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/service/ContractFileService.java
  21. 260 12
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/service/ContractInfoService.java
  22. 298 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/service/CwWorkContractBorrowService.java
  23. 42 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/service/dto/CwWorkContractBorrowDto.java
  24. 296 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/controller/CwFinanceInvoiceController.java
  25. 179 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/domain/CwFinanceInvoice.java
  26. 52 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/domain/CwFinanceInvoiceBase.java
  27. 66 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/domain/CwFinanceInvoiceDetail.java
  28. 46 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/domain/CwFinanceInvoiceInvalid.java
  29. 51 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/domain/CwFinanceInvoiceReceivables.java
  30. 14 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/mapper/CwFinanceInvoiceBaseMapper.java
  31. 14 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/mapper/CwFinanceInvoiceDetailMapper.java
  32. 14 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/mapper/CwFinanceInvoiceInvalidMapper.java
  33. 33 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/mapper/CwFinanceInvoiceMapper.java
  34. 14 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/mapper/CwFinanceInvoiceReceivablesMapper.java
  35. 36 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/mapper/xml/CwFinanceInvoiceBaseMapper.xml
  36. 42 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/mapper/xml/CwFinanceInvoiceDetailMapper.xml
  37. 34 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/mapper/xml/CwFinanceInvoiceInvalidMapper.xml
  38. 280 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/mapper/xml/CwFinanceInvoiceMapper.xml
  39. 36 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/mapper/xml/CwFinanceInvoiceReceivablesMapper.xml
  40. 536 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/service/CwFinanceInvoiceService.java
  41. 9 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/service/dto/CwFinanceDTO.java
  42. 47 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/service/dto/CwFinanceInvoiceBaseDTO.java
  43. 265 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/service/dto/CwFinanceInvoiceDTO.java
  44. 73 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/service/dto/CwFinanceInvoiceDetailDTO.java
  45. 42 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/service/dto/CwFinanceInvoiceInvalidDTO.java
  46. 53 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/service/dto/CwFinanceInvoiceReceivablesDTO.java
  47. 15 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/service/mapstruct/CwFinanceInvoiceBaseWrapper.java
  48. 15 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/service/mapstruct/CwFinanceInvoiceDetailWrapper.java
  49. 15 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/service/mapstruct/CwFinanceInvoiceInvalidWrapper.java
  50. 15 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/service/mapstruct/CwFinanceInvoiceReceivablesWrapper.java
  51. 15 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/service/mapstruct/CwFinanceInvoiceWrapper.java
  52. 131 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectBusinessType/controller/CwProjectBusinessTypeController.java
  53. 46 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectBusinessType/domain/CwProjectBusinessType.java
  54. 30 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectBusinessType/mapper/CwProjectBusinessTypeMapper.java
  55. 79 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectBusinessType/mapper/xml/CwManageLevelTypeMapper.xml
  56. 85 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectBusinessType/service/CwProjectBusinessTypeService.java
  57. 52 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectBusinessType/service/dto/CwProjectBusinessTypeDTO.java
  58. 17 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectBusinessType/service/mapstruct/CwProjectBusinessTypeWrapper.java
  59. 96 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/controller/CwManHourManagementController.java
  60. 46 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/controller/CwProjectRecordsController.java
  61. 26 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/domain/CwManHourManagement.java
  62. 76 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/domain/CwProjectClientContact.java
  63. 38 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/domain/CwProjectMembers.java
  64. 20 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/domain/CwProjectRecords.java
  65. 48 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/mapper/CwManHourManagementMapper.java
  66. 17 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/mapper/CwProjectClientContactMapper.java
  67. 15 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/mapper/CwProjectMembersMapper.java
  68. 10 2
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/mapper/CwProjectRecordsMapper.java
  69. 58 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/mapper/xml/CwManHourManagementMapper.xml
  70. 46 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/mapper/xml/CwProjectClientContactMapper.xml
  71. 32 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/mapper/xml/CwProjectMembersMapper.xml
  72. 138 4
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/mapper/xml/CwProjectRecordsMapper.xml
  73. 208 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/service/CwManHourManagementService.java
  74. 15 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/service/CwProjectClientContactService.java
  75. 17 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/service/CwProjectMembersService.java
  76. 224 368
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/service/CwProjectRecordsService.java
  77. 36 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/service/dto/CwManHourManagementDTO.java
  78. 73 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/service/dto/CwProjectClientContactDTO.java
  79. 38 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/service/dto/CwProjectMembersDTO.java
  80. 55 4
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/service/dto/CwProjectRecordsDTO.java
  81. 18 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/service/mapstruct/CwManHourManagementWrapper.java
  82. 18 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/service/mapstruct/CwProjectClientContactWrapper.java
  83. 18 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/service/mapstruct/CwProjectMembersWrapper.java
  84. 104 18
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/controller/CwProjectReportController.java
  85. 81 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/controller/CwProjectReportReviewController.java
  86. 110 34
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/controller/CwProjectReportSignatureCallBackController.java
  87. 102 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/domain/CwProjectReport.java
  88. 211 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/domain/CwProjectReportData.java
  89. 5 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/domain/CwProjectReportFile.java
  90. 15 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/domain/CwProjectReportSignature.java
  91. 125 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/domain/CwProjectReview.java
  92. 49 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/domain/CwProofreadDetail.java
  93. 16 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/domain/ReviewUser.java
  94. 12 4
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/CwProjectInfoMapper.java
  95. 48 3
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/CwProjectReportMapper.java
  96. 21 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/CwProjectReportReviewMapper.java
  97. 19 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/CwProofreadDetailMapper.java
  98. 8 1
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/ProjectReportWorkAttachmentMapper.java
  99. 4 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/xml/CwProjectInfoMapper.xml
  100. 0 0
      jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/xml/CwProjectReportMapper.xml

+ 35 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/common/FindUtils.java

@@ -0,0 +1,35 @@
+package com.jeeplus.test.cw.common;
+
+import cn.hutool.core.collection.CollectionUtil;
+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.List;
+import java.util.stream.Collectors;
+
+public class FindUtils {
+
+    /**
+     * 判断当前用户是否拥有 “ 财务部门主任 ” 的角色
+     * @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 ("1589893310822690818".equals(item.getId())) {
+                    return true;
+                }
+                return false;
+            }).collect(Collectors.toList());
+        }
+        if (CollectionUtil.isNotEmpty(roles)) {
+            return true;
+        }
+        return false;
+    }
+}

+ 51 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/controller/ContractFilePaperController.java

@@ -0,0 +1,51 @@
+package com.jeeplus.test.cw.contractRegistration.controller;
+
+import com.jeeplus.common.utils.ResponseUtil;
+import com.jeeplus.test.cw.contractRegistration.domain.ContractFilePaper;
+import com.jeeplus.test.cw.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);
+    }
+}

+ 25 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/controller/ContractInfoController.java

@@ -72,6 +72,15 @@ public class ContractInfoController {
     }
 
     /**
+     * 合同登记查询附件信息
+     */
+    @ApiOperation(value = "合同登记查询")
+    @GetMapping(value = "findFileInfoById")
+    public ContractInfo findFileInfoById(@RequestParam String id) {
+        return service.findFileInfoById(id);
+    }
+
+    /**
      * 合同登记查询
      */
     @ApiOperation(value = "根据归档id查询")
@@ -97,4 +106,20 @@ public class ContractInfoController {
     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);
+    }
 }

+ 96 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/controller/CwContractBorrowController.java

@@ -0,0 +1,96 @@
+package com.jeeplus.test.cw.contractRegistration.controller;
+
+import com.jeeplus.common.utils.ResponseUtil;
+import com.jeeplus.test.cw.contractRegistration.domain.CwWorkContractBorrow;
+import com.jeeplus.test.cw.contractRegistration.domain.CwWorkContractBorrowMessage;
+import com.jeeplus.test.cw.contractRegistration.service.CwWorkContractBorrowService;
+import com.jeeplus.test.cw.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
+ **/
+@Slf4j
+@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);
+    }
+}

+ 4 - 2
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/domain/ContractFile.java

@@ -46,11 +46,11 @@ public class ContractFile extends BaseEntity {
     /**
      * 案卷号
      */
-    private String filedNo;
+//    private String filedNo;
     /**
      * 确认案卷号
      */
-    private String confirmFiledNo;
+//    private String confirmFiledNo;
 
     @TableField(exist = false)
     private String createId;       //创建人id
@@ -58,11 +58,13 @@ public class ContractFile extends BaseEntity {
     /**
      * 客户名称
      */
+    @TableField(exist = false)
     private String customerName;
 
     /**
      * 客户编号
      */
+    @TableField(exist = false)
     private String customerNo;
 
     /**

+ 81 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/domain/ContractFilePaper.java

@@ -0,0 +1,81 @@
+package com.jeeplus.test.cw.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.test.workContract.service.dto.WorkAttachmentDto;
+import lombok.Data;
+
+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;
+}

+ 114 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/domain/ContractInfo.java

@@ -26,6 +26,19 @@ 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_no")
     private String contractNo;              //合同编号
     @Query(tableColumn = "a.contract_name")
@@ -42,7 +55,7 @@ public class ContractInfo extends BaseEntity {
     private String paymentAgreement;        //付款约定
     @TableField(fill = FieldFill.UPDATE)
     private String changeNum;               //修改次数
-    @Query(tableColumn = "a.department")
+//    @Query(tableColumn = "a.department")
     private String department;              //所属部门
     private String clientContacts;          //委托方联系人
     private String clientContactsPhone;     //委托方联系人电话
@@ -67,12 +80,20 @@ public class ContractInfo extends BaseEntity {
     @TableField(exist = false)
     private String taskFiledProcInsId;
 
+    @TableField(exist = false)
+    private String taskFiledPaperProcInsId;
+
     /**
      * 归档状态
      */
     @Query(tableColumn = "a.filed_type")
     private String filedType;
 
+    /**
+     * 纸质归档状态
+     */
+    private String filedPaperType;
+
     @TableField(exist = false)
     private String[] contractAmounts;
 
@@ -99,4 +120,96 @@ public class ContractInfo extends BaseEntity {
      */
     @TableField(exist = false)
     private List<WorkAttachmentDto> contractInfoList;
+
+    /**
+     * 合同金额类别
+     */
+    private String contractAmountType;
+
+    /**
+     * 对方合同编号
+     */
+    private String contractOpposite;
+
+    /**
+     * 收费标准
+     */
+    private String contractFee;
+
+    private String fees;
+
+    /**
+     * 案卷号
+     */
+    @TableField(exist = false)
+    private String filedNo;
+    /**
+     * 确认案卷号
+     */
+    @TableField(exist = false)
+    private String confirmFiledNo;
+
+    /**
+     * 借用状态
+     */
+    private String borrowType;
+
+    @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;
+
+    /**
+     * 委托方联系人名称
+     */
+    @TableField(exist = false)
+    private String clientContactsName;
+
+    /**
+     * 创建人
+     */
+    @TableField(exist = false)
+    private String createName;
+
+    /**
+     * 创建时间
+     */
+    private Date createDate;
+
+    /**
+     * 付款描述
+     */
+    private String paymentDescribe;
+
+    /**
+     * 合同类型
+     */
+    private String contractType;
+
+    /**
+     * 合同流水号
+     */
+    private String contractSerialNumber;
 }

+ 40 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/domain/CwWorkContractBorrow.java

@@ -0,0 +1,40 @@
+package com.jeeplus.test.cw.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-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/domain/CwWorkContractBorrowMessage.java

@@ -0,0 +1,42 @@
+package com.jeeplus.test.cw.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
+
+}

+ 2 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/mapper/ContractFileMapper.java

@@ -39,4 +39,6 @@ public interface ContractFileMapper extends BaseMapper<ContractFile> {
      * @param id
      */
     ContractFile getInfoByConId(String id);
+
+    ContractFile getById(String id);
 }

+ 34 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/mapper/ContractFilePaperMapper.java

@@ -0,0 +1,34 @@
+package com.jeeplus.test.cw.contractRegistration.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.test.cw.contractRegistration.domain.ContractFilePaper;
+import com.jeeplus.test.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("name")String name);
+
+    /**
+     * 根据attachmentId删除上传文件信息
+     */
+    void deleteFileInfo(String attachmentId);
+}

+ 27 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/mapper/ContractInfoMapper.java

@@ -22,6 +22,8 @@ import java.util.List;
  **/
 public interface ContractInfoMapper extends BaseMapper<ContractInfo> {
 
+    ContractInfo getInfoById(String id);
+
     ContractFile getById(String id);
 
     List<WorkAttachmentDto> findDtos(@Param("id") String id);
@@ -30,12 +32,16 @@ public interface ContractInfoMapper extends BaseMapper<ContractInfo> {
 
     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);
@@ -48,5 +54,25 @@ public interface ContractInfoMapper extends BaseMapper<ContractInfo> {
      */
     void updateInfo(@Param("id") String id,
                     @Param("actualContractAmount") Double actualContractAmount,
-                    @Param("contractApprovalType") String contractApprovalType);
+                    @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);
 }

+ 36 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/mapper/CwWorkContractBorrowMapper.java

@@ -0,0 +1,36 @@
+package com.jeeplus.test.cw.contractRegistration.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.test.cw.contractRegistration.domain.CwWorkContractBorrow;
+import com.jeeplus.test.cw.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-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/mapper/CwWorkContractBorrowMessageMapper.java

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

+ 3 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/mapper/xml/ContractFileMapper.xml

@@ -116,4 +116,7 @@
     <select id="getInfoByConId" resultType="com.jeeplus.test.cw.contractRegistration.domain.ContractFile">
         select * from cw_work_contract_file where contract_info_id = #{id}
     </select>
+    <select id="getById" resultType="com.jeeplus.test.cw.contractRegistration.domain.ContractFile">
+        select * from cw_work_contract_file where id = #{id}
+    </select>
 </mapper>

+ 32 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/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.test.cw.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.test.cw.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.test.cw.contractRegistration.domain.ContractFilePaper">
+        select * from cw_work_contract_file_paper where id = #{id}
+    </select>
+    <select id="findList" resultType="com.jeeplus.test.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>
+
+</mapper>

+ 90 - 6
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/mapper/xml/ContractInfoMapper.xml

@@ -10,7 +10,19 @@
     </update>
     <update id="updateInfo">
         UPDATE cw_work_contract_info SET actual_contract_amount = #{actualContractAmount}
-        ,contract_approval_type = #{contractApprovalType} where del_flag = 0 AND id = #{id}
+        ,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.test.cw.contractRegistration.domain.ContractInfo">
@@ -38,17 +50,35 @@
             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
+            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
 		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 = c.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'
 		${ew.customSqlSegment}
 		ORDER BY a.update_date DESC
     </select>
@@ -72,16 +102,34 @@
             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_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,
-            b.filed_type as filedType
+            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 = 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
@@ -137,11 +185,15 @@
             a.contract_approval_type as contractApprovalType,
             a.proc_ins_id as procInsId,
             a.status,
-            b.filed_type as filedType
+            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 = 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
@@ -149,4 +201,36 @@
     <select id="getById" resultType="com.jeeplus.test.cw.contractRegistration.domain.ContractFile">
         select * from cw_work_contract_file where id = #{id}
     </select>
+    <select id="getInfoById" resultType="com.jeeplus.test.cw.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.test.cw.contractRegistration.domain.ContractInfo">
+        select * from cw_work_contract_info where id = #{id}
+    </select>
+    <select id="getByClientId" resultType="com.jeeplus.test.cw.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_date,
+            cw_wci.create_by 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 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>
 </mapper>

+ 77 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/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.test.cw.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_date 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_date desc limit 1
+    </update>
+    <select id="selectFileByContractInfoId"
+            resultType="com.jeeplus.test.cw.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.test.cw.contractRegistration.domain.CwWorkContractBorrowMessage">
+        SELECT
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			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_date desc
+    </select>
+    <select id="selectByInfoId"
+            resultType="com.jeeplus.test.cw.contractRegistration.domain.CwWorkContractBorrow">
+        select * from cw_work_contract_borrow where contract_info_id = #{id}
+    </select>
+
+
+    <select id="getAdventMessageList" resultType="com.jeeplus.test.cw.contractRegistration.domain.CwWorkContractBorrowMessage">
+        SELECT
+			a.id,
+			a.create_by,
+			wci.create_by as "contractCreateById",
+			wcb.contract_info_id as "contractId",
+			wcb.proc_ins_id as "procInsId",
+			wcb.process_definition_id as "processDefinitionId",
+			a.create_date,
+			a.update_by,
+			a.update_date,
+			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_date desc
+    </select>
+</mapper>

+ 206 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/service/ContractFilePaperService.java

@@ -0,0 +1,206 @@
+package com.jeeplus.test.cw.contractRegistration.service;
+
+import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.sys.utils.UserUtils;
+import com.jeeplus.test.cw.contractRegistration.domain.ContractFile;
+import com.jeeplus.test.cw.contractRegistration.domain.ContractFilePaper;
+import com.jeeplus.test.cw.contractRegistration.domain.ContractInfo;
+import com.jeeplus.test.cw.contractRegistration.mapper.ContractFilePaperMapper;
+import com.jeeplus.test.cw.contractRegistration.mapper.ContractInfoMapper;
+import com.jeeplus.test.oss.domain.WorkAttachment;
+import com.jeeplus.test.oss.mapper.OssServiceMapper;
+import com.jeeplus.test.workContract.service.dto.WorkAttachmentDto;
+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;
+
+    public String saveInfo(ContractFilePaper filePaper) throws Exception {
+
+        ContractFilePaper info = mapper.selectFilePaperByContractInfoId(filePaper.getId());
+        if (null != info) {
+            filePaper.setFileCreateName(filePaper.getCreateBy());
+            filePaper.setCreateBy(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.setUpdateBy(userDTO.getId());
+        file.setUpdateDate(new Date());
+        mapper.updateById(file);
+        List<WorkAttachmentDto> list = filePaper.getContractInfoList();
+        if (CollectionUtils.isNotEmpty(list)) {
+            updateFiles(list, userDTO, file.getId());
+        }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.setCreateBy(userDTO.getId());
+        file.setCreateDate(new Date());
+        file.setUpdateBy(userDTO.getId());
+        file.setUpdateDate(new Date());
+        mapper.insert(file);
+        List<WorkAttachmentDto> list = filePaper.getContractInfoList();
+        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) {
+        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.setCreateDate(new Date());
+//                i.getUpdateBy().setId(userDTO.getId());
+                i.setUpdateDate(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.setCreateDate(new Date());
+//            i.getUpdateBy().setId(userDTO.getId());
+            i.setUpdateDate(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++;
+        }
+    }
+
+}

+ 11 - 3
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/service/ContractFileService.java

@@ -43,8 +43,16 @@ public class ContractFileService {
      * 根据id修改status
      */
     public void updateStatusById(ContractFile contractFile) {
-        infoMapper.updatefiledTypeById(contractFile.getId(),contractFile.getFiledType());
-        mapper.updateStatusById(contractFile.getId(), contractFile.getFiledType());
+        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 {
@@ -55,7 +63,7 @@ public class ContractFileService {
         if (null != info) {
             contractFile.setFileCreateName(contractFile.getCreateBy());
             contractFile.setCreateBy(contractFile.getCreateId());
-            infoMapper.updatefiledTypeById(contractFile.getContractInfoId(),contractFile.getFiledType());
+            infoMapper.updatefiledTypeById(info.getContractInfoId(),contractFile.getFiledType());
             return update(contractFile, info.getId());
         }else {
             return add(contractFile);

+ 260 - 12
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/service/ContractInfoService.java

@@ -1,5 +1,8 @@
 package com.jeeplus.test.cw.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;
@@ -9,11 +12,15 @@ import com.jeeplus.sys.service.dto.UserDTO;
 import com.jeeplus.sys.utils.StringUtils;
 import com.jeeplus.sys.utils.UserUtils;
 import com.jeeplus.test.cw.contractRegistration.domain.ContractFile;
+import com.jeeplus.test.cw.contractRegistration.domain.ContractFilePaper;
 import com.jeeplus.test.cw.contractRegistration.domain.ContractInfo;
 import com.jeeplus.test.cw.contractRegistration.domain.ContractParticipant;
 import com.jeeplus.test.cw.contractRegistration.mapper.ContractFileMapper;
+import com.jeeplus.test.cw.contractRegistration.mapper.ContractFilePaperMapper;
 import com.jeeplus.test.cw.contractRegistration.mapper.ContractInfoMapper;
 import com.jeeplus.test.cw.contractRegistration.mapper.ContractParticipantMapper;
+import com.jeeplus.test.cw.workClientInfo.domain.CwWorkClientBase;
+import com.jeeplus.test.cw.workClientInfo.service.CwWorkClientService;
 import com.jeeplus.test.cw.workClientInfo.service.dto.CwWorkClientBaseDTO;
 import com.jeeplus.test.mould.service.SerialnumTplService;
 import com.jeeplus.test.oss.domain.WorkAttachment;
@@ -23,6 +30,7 @@ import com.jeeplus.test.workContract.domain.WorkContractInfo;
 import com.jeeplus.test.workContract.service.dto.WorkAttachmentDto;
 import com.jeeplus.test.workContract.service.dto.WorkContractInfoDto;
 import org.flowable.editor.language.json.converter.util.CollectionUtils;
+import org.flowable.ui.modeler.service.mapper.InfoMapper;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -51,8 +59,14 @@ public class ContractInfoService {
     private ContractFileMapper fileMapper;
 
     @Resource
+    private ContractFilePaperMapper paperMapper;
+
+    @Resource
     private ContractParticipantMapper participantMapper;
 
+    @Resource
+    private CwWorkClientService cwWorkClientService;
+
     /**
      * 根据id修改status
      */
@@ -63,7 +77,14 @@ public class ContractInfoService {
      * 根据id修改合同实际金额
      */
     public void updateInfo(ContractInfo info) {
-        mapper.updateInfo(info.getId(), info.getActualContractAmount(),info.getContractApprovalType());
+        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());
     }
 
     public IPage<ContractInfo> list(Page<ContractInfo> page, ContractInfo info, QueryWrapper<ContractInfo> wrapper) {
@@ -95,12 +116,19 @@ public class ContractInfoService {
             wrapper.between("a.signing_date", contractDates[0], contractDates[1]);
         }
         //5、创建人
-        if (StringUtils.isNotEmpty(info.getContractName())) {
-            wrapper.like("a.contract_name", info.getContractName());
+        if (StringUtils.isNotEmpty(info.getCreateBy())) {
+            wrapper.like("c.`id`", info.getCreateBy());
         }
         //6、所属部门
         if (StringUtils.isNotEmpty(info.getDepartment())) {
-            wrapper.like("a.department", 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.isNotEmpty(info.getStatus())) {
@@ -110,6 +138,10 @@ public class ContractInfoService {
         if (StringUtils.isNotEmpty(info.getFiledType())) {
             wrapper.like("a.filed_type", info.getFiledType());
         }
+        //纸质归档
+        if (StringUtils.isNotEmpty(info.getFiledPaperType())) {
+            wrapper.like("a.filed_paper_type", info.getFiledPaperType());
+        }
         wrapper.eq("a.del_flag","0");
         IPage<ContractInfo> pageList = mapper.findPageList(page, wrapper);
 
@@ -172,6 +204,169 @@ public class ContractInfoService {
                 });
 
             }
+            //根据合同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()));
+                    }
+                    dto.setContractInfoList(fileDtos);
+                }
+            }
+
+            dto.setCwWorkClientContactDTOList(list);
+            dto.setContractProperList(dtos);
+        } 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()));
+                        }
+                    }
+                    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()));
+                            }
+                            dto.setContractInfoList(fileDtos);
+                        }
+                    }
+
+                    dto.setCwWorkClientContactDTOList(list);
+                    dto.setContractProperList(dtos);
+                }
+            } 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()));
+                            }
+                        }
+                        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()));
+                            }
+                            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(dtos);
+                    }
+                }
+            }
+        }
+
+        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);
         }
@@ -180,6 +375,7 @@ public class ContractInfoService {
     }
 
     public String saveInfo(ContractInfo info) throws Exception {
+        info.setClientContacts(info.getCustomerId());
         if (StringUtils.isNotEmpty(info.getId())) {
             //对参与签约方进行处理  将参与签约方的客户编号 和 客户名称进行持久化
             ContractInfo contractInfo = mapper.selectById(info.getId());
@@ -208,10 +404,8 @@ public class ContractInfoService {
         //获取当前登录人信息
         UserDTO userDTO = UserUtils.getCurrentUserDTO();
         //合同编号生成
-//        String serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), WorkContractInfoDto.BIZ_CODE);
         ContractInfo contractInfo = new ContractInfo();
         BeanUtils.copyProperties(info, contractInfo);
-//        info.setNo(serialNum);
         contractInfo.setUpdateBy(userDTO.getId());
         contractInfo.setUpdateDate(new Date());
 
@@ -221,17 +415,25 @@ public class ContractInfoService {
         }else {
             contractInfo.setChangeNum(contractInfo.getChangeNum());
         }
-        //对管理员上传归档文件进行相关操作
+        //对管理员上传归档文件进行相关操作  归档修改
         if (StringUtils.isNotEmpty(contractInfo.getFiledType()) && contractInfo.getFiledType().equals("5")){
             //根据id找到归档表id
             ContractFile contractFile = fileMapper.getInfoByConId(info.getId());
-            contractFile.setContractInfoList(info.getContractInfoList());
-            if (CollectionUtils.isNotEmpty(contractFile.getContractInfoList())){
-                updateFiles(contractFile.getContractInfoList(), userDTO, contractFile.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();
@@ -256,7 +458,6 @@ public class ContractInfoService {
             }
         }
 
-
         List<WorkAttachmentDto> list = info.getContractProperList();
         if (CollectionUtils.isNotEmpty(list)) {
             updateFiles(list, userDTO, info.getId());
@@ -274,6 +475,24 @@ public class ContractInfoService {
         UserDTO userDTO = UserUtils.getCurrentUserDTO();
         //合同编号生成
         String serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.BIZ_CODE);
+        //合同流水号生成
+        String serialNumber = "";
+        if (StringUtils.isNotEmpty(contractInfo.getContractType())){
+            if (contractInfo.getContractType().equals("1")){
+                serialNumber = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER1);
+            } else if (contractInfo.getContractType().equals("2")) {
+                serialNumber = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER2);
+            } else if (contractInfo.getContractType().equals("3")) {
+                serialNumber = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER3);
+            } else if (contractInfo.getContractType().equals("4")) {
+                serialNumber = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER4);
+            } else if (contractInfo.getContractType().equals("5")) {
+                serialNumber = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ContractInfo.SERIAL_NUMBER5);
+            } else if (contractInfo.getContractType().equals("6")) {
+                serialNumber = 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);
@@ -400,4 +619,33 @@ public class ContractInfoService {
             }
         }
     }
+
+    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");
+                        queryWrapper.orderByDesc("cw_wci.create_date");
+                        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<>();
+    }
 }

+ 298 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/service/CwWorkContractBorrowService.java

@@ -0,0 +1,298 @@
+package com.jeeplus.test.cw.contractRegistration.service;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.jeeplus.flowable.model.MyNoticeList;
+import com.jeeplus.flowable.service.FlowTaskService;
+import com.jeeplus.flowable.service.MyNoticeService;
+import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.sys.utils.DictUtils;
+import com.jeeplus.sys.utils.StringUtils;
+import com.jeeplus.sys.utils.UserUtils;
+import com.jeeplus.test.cw.contractRegistration.domain.CwWorkContractBorrow;
+import com.jeeplus.test.cw.contractRegistration.domain.CwWorkContractBorrowMessage;
+import com.jeeplus.test.cw.contractRegistration.mapper.ContractInfoMapper;
+import com.jeeplus.test.cw.contractRegistration.mapper.CwWorkContractBorrowMapper;
+import com.jeeplus.test.cw.contractRegistration.mapper.CwWorkContractBorrowMessageMapper;
+import com.jeeplus.test.cw.contractRegistration.service.dto.CwWorkContractBorrowDto;
+import org.flowable.bpmn.model.FlowNode;
+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 FlowTaskService flowTaskService;
+
+    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.setCreateBy(userDTO.getId());
+        borrow.setCreateDate(new Date());
+        borrow.setUpdateBy(userDTO.getId());
+        borrow.setUpdateDate(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.setUpdateBy(userDTO.getId());
+        borrow.setUpdateDate(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.setCreateBy(userDTO.getId());
+        message.setCreateDate(new Date());
+        message.setUpdateBy(userDTO.getId());
+        message.setUpdateDate(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 = UserUtils.getByName(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.setCreateBy("1");
+                    myNotice.setCreateDate(new Date());
+                    myNotice.setUpdateBy("1");
+                    myNotice.setUpdateDate(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;
+    }
+
+}

+ 42 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/contractRegistration/service/dto/CwWorkContractBorrowDto.java

@@ -0,0 +1,42 @@
+package com.jeeplus.test.cw.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;
+
+    private String remarks;
+
+    private String borrowType;
+
+    private String type;
+
+}

+ 296 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/controller/CwFinanceInvoiceController.java

@@ -0,0 +1,296 @@
+package com.jeeplus.test.cw.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.aop.logging.annotation.ApiLog;
+import com.jeeplus.common.utils.ResponseUtil;
+import com.jeeplus.core.excel.utils.EasyPoiUtil;
+import com.jeeplus.sys.constant.enums.LogTypeEnum;
+import com.jeeplus.sys.utils.StringUtils;
+import com.jeeplus.test.cw.invoice.service.CwFinanceInvoiceService;
+import com.jeeplus.test.cw.invoice.service.dto.CwFinanceDTO;
+import com.jeeplus.test.cw.invoice.service.dto.CwFinanceInvoiceDTO;
+import com.jeeplus.test.cw.invoice.service.dto.CwFinanceInvoiceDetailDTO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+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.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import static com.jeeplus.test.jobPosion.utils.BeanUtils.objectCheckIsNull;
+
+@Api("财务管理-发票")
+@RestController
+@RequestMapping(value = "/cw_finance/invoice")
+public class CwFinanceInvoiceController {
+
+    @Resource
+    private CwFinanceInvoiceService cwFinanceInvoiceService;
+
+    /**
+     * 查询发票列表
+     * @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);
+        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 {
+        String id = cwFinanceInvoiceService.saveForm(cwFinanceInvoiceDTO);
+        return ResponseUtil.newInstance().add("businessTable", "cw_finance_invoice").add("businessId", id).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);
+    }
+
+}

+ 179 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/domain/CwFinanceInvoice.java

@@ -0,0 +1,179 @@
+package com.jeeplus.test.cw.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;
+
+    private static final long serialVersionUID = 1L;
+}

+ 52 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/domain/CwFinanceInvoiceBase.java

@@ -0,0 +1,52 @@
+package com.jeeplus.test.cw.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-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/domain/CwFinanceInvoiceDetail.java

@@ -0,0 +1,66 @@
+package com.jeeplus.test.cw.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-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/domain/CwFinanceInvoiceInvalid.java

@@ -0,0 +1,46 @@
+package com.jeeplus.test.cw.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-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/domain/CwFinanceInvoiceReceivables.java

@@ -0,0 +1,51 @@
+package com.jeeplus.test.cw.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;
+}

+ 14 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/mapper/CwFinanceInvoiceBaseMapper.java

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

+ 14 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/mapper/CwFinanceInvoiceDetailMapper.java

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

+ 14 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/mapper/CwFinanceInvoiceInvalidMapper.java

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

+ 33 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/mapper/CwFinanceInvoiceMapper.java

@@ -0,0 +1,33 @@
+package com.jeeplus.test.cw.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.test.cw.invoice.domain.CwFinanceInvoice;
+import com.jeeplus.test.cw.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);
+
+    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);
+}
+
+
+
+

+ 14 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/mapper/CwFinanceInvoiceReceivablesMapper.java

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

+ 36 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/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.test.cw.invoice.mapper.CwFinanceInvoiceBaseMapper">
+
+    <resultMap id="BaseResultMap" type="com.jeeplus.test.cw.invoice.service.dto.CwFinanceInvoiceBaseDTO">
+            <id property="id" column="id" jdbcType="VARCHAR"/>
+            <result property="createBy.id" column="create_by" jdbcType="VARCHAR"/>
+            <result property="createDate" column="create_date" jdbcType="TIMESTAMP"/>
+            <result property="updateBy.id" column="update_by" jdbcType="VARCHAR"/>
+            <result property="updateDate" 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-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/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.test.cw.invoice.mapper.CwFinanceInvoiceDetailMapper">
+
+    <resultMap id="BaseResultMap" type="com.jeeplus.test.cw.invoice.service.dto.CwFinanceInvoiceDetailDTO">
+            <id property="id" column="id" jdbcType="VARCHAR"/>
+            <result property="createBy.id" column="create_by" jdbcType="VARCHAR"/>
+            <result property="createDate" column="create_date" jdbcType="TIMESTAMP"/>
+            <result property="updateBy.id" column="update_by" jdbcType="VARCHAR"/>
+            <result property="updateDate" 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-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/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.test.cw.invoice.mapper.CwFinanceInvoiceInvalidMapper">
+
+    <resultMap id="BaseResultMap" type="com.jeeplus.test.cw.invoice.service.dto.CwFinanceInvoiceInvalidDTO">
+            <id property="id" column="id" jdbcType="VARCHAR"/>
+            <result property="createBy.id" column="create_by" jdbcType="VARCHAR"/>
+            <result property="createDate" column="create_date" jdbcType="TIMESTAMP"/>
+            <result property="updateBy.id" column="update_by" jdbcType="VARCHAR"/>
+            <result property="updateDate" 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>

+ 280 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/mapper/xml/CwFinanceInvoiceMapper.xml

@@ -0,0 +1,280 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.test.cw.invoice.mapper.CwFinanceInvoiceMapper">
+
+    <resultMap id="BaseResultMap" type="com.jeeplus.test.cw.invoice.service.dto.CwFinanceInvoiceDTO">
+            <id property="id" column="id" jdbcType="VARCHAR"/>
+            <result property="createBy.id" column="create_by" jdbcType="VARCHAR"/>
+            <result property="createDate" column="create_date" jdbcType="TIMESTAMP"/>
+            <result property="updateBy.id" column="update_by" jdbcType="VARCHAR"/>
+            <result property="updateDate" column="update_date" 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"/>
+            <association property="financeInvoiceInvalidDTO" column="id" select="getFii" javaType="com.jeeplus.test.cw.invoice.service.dto.CwFinanceInvoiceInvalidDTO"></association>
+            <collection property="financeInvoiceReceivablesDTOList" column="id" select="getFirList" ofType="com.jeeplus.test.cw.invoice.service.dto.CwFinanceInvoiceReceivablesDTO"></collection>
+            <collection property="financeInvoiceBaseDTOList" column="id" select="getBaseList" ofType="com.jeeplus.test.cw.invoice.service.dto.CwFinanceInvoiceBaseDTO"></collection>
+            <collection property="financeInvoiceDetailDTOList" column="id" select="getFidList" ofType="com.jeeplus.test.cw.invoice.service.dto.CwFinanceInvoiceDetailDTO"></collection>
+            <collection property="workAttachmentDtoList" ofType="com.jeeplus.test.workContract.service.dto.WorkAttachmentDto" column="id" select="getFileList"></collection>
+    </resultMap>
+
+    <resultMap id="AttachmentMap" type="com.jeeplus.test.workContract.service.dto.WorkAttachmentDto">
+        <id property="id" column="id" jdbcType="VARCHAR"/>
+        <result property="createBy.id" column="create_by" jdbcType="VARCHAR"/>
+        <result property="createDate" column="create_date" jdbcType="TIMESTAMP"/>
+        <result property="updateBy.id" column="update_by" jdbcType="VARCHAR"/>
+        <result property="createBy.name" column="create_name" jdbcType="VARCHAR"/>
+        <result property="updateDate" column="update_date" 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,
+        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>
+
+    <sql id="FII_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>
+
+    <sql id="FID_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>
+
+    <sql id="Base_Column_List">
+        fi.id,
+        fi.create_by,
+        fi.create_date,
+        fi.update_by,
+        fi.update_date,
+        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
+    </sql>
+
+    <sql id="File_Column_List">
+        wa.id,
+        wa.create_by,
+        wa.create_date,
+        wa.update_by,
+        wa.update_date,
+        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,
+        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>
+
+    <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 and su.del_flag = '0'
+        where wa.del_flag = '0' and wa.attachment_id = #{id}
+    </select>
+
+    <select id="getFii" resultType="com.jeeplus.test.cw.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.test.cw.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.test.cw.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.test.cw.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
+        <include refid="Base_Column_List"></include>,
+        su.name as operator,
+        so.name as operator_office
+        from cw_finance_invoice fi
+        left join sys_user su on fi.create_by = su.id and su.del_flag = '0'
+        left join sys_office so on su.office_id = so.id and so.del_flag = '0'
+        ${ew.customSqlSegment}
+    </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 = su.id and su.del_flag = '0'
+        ${ew.customSqlSegment}
+    </select>
+
+    <select id="getIdByContractId" resultType="string">
+        select
+        a.invoice_id
+        from
+        (select distinct
+            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
+            invoice_id
+        from cw_finance_invoice_base fi
+        where program_id is null or program_id = ''
+        and 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>
+</mapper>

+ 36 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/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.test.cw.invoice.mapper.CwFinanceInvoiceReceivablesMapper">
+
+    <resultMap id="BaseResultMap" type="com.jeeplus.test.cw.invoice.service.dto.CwFinanceInvoiceReceivablesDTO">
+            <id property="id" column="id" jdbcType="VARCHAR"/>
+            <result property="createBy.id" column="create_by" jdbcType="VARCHAR"/>
+            <result property="createDate" column="create_date" jdbcType="TIMESTAMP"/>
+            <result property="updateBy.id" column="update_by" jdbcType="VARCHAR"/>
+            <result property="updateDate" 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>

+ 536 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/service/CwFinanceInvoiceService.java

@@ -0,0 +1,536 @@
+package com.jeeplus.test.cw.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.sys.domain.User;
+import com.jeeplus.sys.service.UserService;
+import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.sys.utils.StringUtils;
+import com.jeeplus.sys.utils.UserUtils;
+import com.jeeplus.test.cw.invoice.domain.*;
+import com.jeeplus.test.cw.invoice.mapper.*;
+import com.jeeplus.test.cw.invoice.service.dto.CwFinanceInvoiceBaseDTO;
+import com.jeeplus.test.cw.invoice.service.dto.CwFinanceInvoiceDTO;
+import com.jeeplus.test.cw.invoice.service.dto.CwFinanceInvoiceDetailDTO;
+import com.jeeplus.test.cw.invoice.service.dto.CwFinanceInvoiceReceivablesDTO;
+import com.jeeplus.test.cw.invoice.service.mapstruct.*;
+import com.jeeplus.test.mould.service.SerialnumTplService;
+import com.jeeplus.test.oss.mapper.OssServiceMapper;
+import com.jeeplus.test.oss.service.OssService;
+import com.jeeplus.test.workContract.mapper.WorkContractInfoMapper;
+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
+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 WorkContractInfoMapper workContractInfoMapper;
+    @Resource
+    private UserService userService;
+    @Resource
+    private OssService ossService;
+
+    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");
+        queryWrapper.orderByDesc("fi.create_date");
+        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",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>();
+            }
+        }
+        return cwFinanceInvoiceMapper.findList(page,queryWrapper);
+    }
+
+    public CwFinanceInvoiceDTO queryById(String id) {
+
+        CwFinanceInvoiceDTO cwFinanceInvoiceDTO = cwFinanceInvoiceMapper.queryById(id);
+
+        return cwFinanceInvoiceDTO;
+    }
+
+    public String 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(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.getId();
+    }
+
+    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);
+        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_date");
+                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_date");
+                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_date");
+                queryWrapper.eq("fi.invalid_status","0"); // 未作废
+                return cwFinanceInvoiceMapper.getByIds(queryWrapper);
+            }
+        }
+        return new ArrayList<>();
+    }
+}

+ 9 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/service/dto/CwFinanceDTO.java

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

+ 47 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/service/dto/CwFinanceInvoiceBaseDTO.java

@@ -0,0 +1,47 @@
+package com.jeeplus.test.cw.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;
+}

+ 265 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/service/dto/CwFinanceInvoiceDTO.java

@@ -0,0 +1,265 @@
+package com.jeeplus.test.cw.invoice.service.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jeeplus.core.service.dto.BaseDTO;
+import com.jeeplus.test.workContract.service.dto.WorkAttachmentDto;
+import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectRecordsDTO;
+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";
+
+    /**
+     * 备注信息
+     */
+    private String remarks;
+
+    /**
+     * 发票类型
+     */
+    private String type;
+
+    /**
+     * 发票申请编号
+     */
+    private String no;
+
+    /**
+     * 开票类型
+     */
+    private String billingType;
+
+    /**
+     * 实际开票单位
+     */
+    private String billingWorkplaceReal;
+
+    /**
+     * 纳税人识别号
+     */
+    private String taxpayerIdentificationNo;
+
+    /**
+     * 地址
+     */
+    private String address;
+
+    /**
+     * 电话
+     */
+    private String telPhone;
+
+    /**
+     * 开户银行
+     */
+    private String openBank;
+
+    /**
+     * 银行账号
+     */
+    private String bankAccount;
+
+    /**
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 收款类型
+     */
+    private String receivablesType;
+
+    /**
+     * 开票内容
+     */
+    private String billingContent;
+
+    /**
+     * 发票金额(元)
+     */
+    private String account;
+
+    /**
+     * 开票内容要求
+     */
+    private String billingContentTerms;
+
+    /**
+     * 开票人
+     */
+    private String billingPeople;
+
+    /**
+     * 开票时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date billingDate;
+
+    /**
+     * 领票时间
+     */
+    @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;
+
+    /**
+     * 状态
+     */
+    private String status;
+
+    /**
+     * 流程id
+     */
+    private String procInsId;
+
+    /**
+     * 流程信息
+     */
+    private String processDefinitionId;
+
+    /**
+     * 是否确认收款
+     */
+    private String receivablesStatus;
+
+    /**
+     * 是否作废
+     */
+    private String invalidStatus;
+
+    /**
+     * 收款日期
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date receivablesDate;
+
+    /**
+     * 基础项目信息
+     */
+    private List<CwProjectRecordsDTO> projectRecordsDTOList;
+
+    /**
+     * 基础信息
+     */
+    private List<CwFinanceInvoiceBaseDTO> financeInvoiceBaseDTOList;
+
+    /**
+     * 附件信息
+     */
+    private List<WorkAttachmentDto> workAttachmentDtoList;
+
+    /**
+     * 发票明细
+     */
+    private List<CwFinanceInvoiceDetailDTO> financeInvoiceDetailDTOList;
+
+    /**
+     * 收款明细
+     */
+    private List<CwFinanceInvoiceReceivablesDTO> financeInvoiceReceivablesDTOList;
+
+    /**
+     * 作废信息
+     */
+    private CwFinanceInvoiceInvalidDTO financeInvoiceInvalidDTO;
+
+    /**
+     * 发票号
+     */
+    private String number;
+
+    /**
+     * 开票总金额 Begin
+     */
+    private String accountBegin;
+
+    /**
+     * 开票总金额 End
+     */
+    private String accountEnd;
+
+    /**
+     * 开票日期 Begin
+     */
+    private String billingDateBegin;
+
+    /**
+     * 开票日期 End
+     */
+    private String billingDateEnd;
+
+    /**
+     * 收款日期Begin
+     */
+    private String remittanceDateBegin;
+
+    /**
+     * 收款日期End
+     */
+    private String remittanceDateEnd;
+
+    /**
+     * 项目名称
+     */
+    private String programName;
+
+    /**
+     * 项目id
+     */
+    private String programId;
+
+    /**
+     * 经办人
+     */
+    private String operator;
+
+    /**
+     * 经办人部门
+     */
+    private String operatorOffice;
+
+    private static final long serialVersionUID = 1L;
+}

+ 73 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/service/dto/CwFinanceInvoiceDetailDTO.java

@@ -0,0 +1,73 @@
+package com.jeeplus.test.cw.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-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/service/dto/CwFinanceInvoiceInvalidDTO.java

@@ -0,0 +1,42 @@
+package com.jeeplus.test.cw.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-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/service/dto/CwFinanceInvoiceReceivablesDTO.java

@@ -0,0 +1,53 @@
+package com.jeeplus.test.cw.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-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/service/mapstruct/CwFinanceInvoiceBaseWrapper.java

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

+ 15 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/service/mapstruct/CwFinanceInvoiceDetailWrapper.java

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

+ 15 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/service/mapstruct/CwFinanceInvoiceInvalidWrapper.java

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

+ 15 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/service/mapstruct/CwFinanceInvoiceReceivablesWrapper.java

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

+ 15 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/invoice/service/mapstruct/CwFinanceInvoiceWrapper.java

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

+ 131 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectBusinessType/controller/CwProjectBusinessTypeController.java

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

+ 46 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectBusinessType/domain/CwProjectBusinessType.java

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

+ 30 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectBusinessType/mapper/CwProjectBusinessTypeMapper.java

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

+ 79 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectBusinessType/mapper/xml/CwManageLevelTypeMapper.xml

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

+ 85 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectBusinessType/service/CwProjectBusinessTypeService.java

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

+ 52 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectBusinessType/service/dto/CwProjectBusinessTypeDTO.java

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

+ 17 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectBusinessType/service/mapstruct/CwProjectBusinessTypeWrapper.java

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

+ 96 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/controller/CwManHourManagementController.java

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

+ 46 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/controller/CwProjectRecordsController.java

@@ -96,6 +96,18 @@ public class CwProjectRecordsController {
     }
 
     /**
+     * 保存财务项目组成员信息
+     * @param cwProjectRecordsDTO
+     * @return
+     */
+    @ApiLog(value = "保存财务项目组成员信息", type = LogTypeEnum.SAVE)
+    @PreAuthorize("hasAnyAuthority('cwProjectRecords:add','cwProjectRecords:edit')")
+    @PostMapping("updateMembers")
+    public ResponseEntity updateMembers(@Valid @RequestBody CwProjectRecordsDTO cwProjectRecordsDTO) {
+        return cwProjectRecordsService.updateMembers(cwProjectRecordsDTO);
+    }
+
+    /**
      * 删除财务项目信息
      * @param ids
      * @return
@@ -155,4 +167,38 @@ public class CwProjectRecordsController {
 
     }
 
+    /**
+     * 根据客户id获取关联的项目信息
+     * @param clientId
+     * @return
+     */
+    @ApiOperation(value = "根据客户id获取关联的项目信息")
+    @GetMapping(value = "/getByClientId")
+    public ResponseEntity<List<CwProjectRecordsDTO>> getByClientId(String clientId, CwProjectRecordsDTO cwProjectRecordsDTO) throws Exception {
+        List<CwProjectRecordsDTO> cwProjectRecordsDTOList = cwProjectRecordsService.getByClientId(clientId,cwProjectRecordsDTO);
+        return ResponseEntity.ok(cwProjectRecordsDTOList);
+    }
+
+    /**
+     * 根据合同id获取关联的项目信息
+     * @param contractId
+     * @return
+     */
+    @ApiOperation(value = "根据合同id获取关联的项目信息")
+    @GetMapping(value = "/getByContractId")
+    public ResponseEntity<List<CwProjectRecordsDTO>> getByContractId(String contractId,CwProjectRecordsDTO cwProjectRecordsDTO) throws Exception {
+        List<CwProjectRecordsDTO> cwProjectRecordsDTOList = cwProjectRecordsService.getByContractId(contractId,cwProjectRecordsDTO);
+        return ResponseEntity.ok(cwProjectRecordsDTOList);
+    }
+
+    /**
+     * 查询当前登录人创建的项目 以及 所属项目组的项目(当前登录人未被移除项目组)
+     * @return
+     */
+    @ApiOperation(value = "查询当前登录人创建的项目以及所属项目组的项目")
+    @GetMapping(value = "/getHaveProjectIds")
+    public ResponseEntity<List<String>> getHaveProjectIds() {
+        return cwProjectRecordsService.getHaveProjectIds();
+    }
+
 }

+ 26 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/domain/CwManHourManagement.java

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

+ 76 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/domain/CwProjectClientContact.java

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

+ 38 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/domain/CwProjectMembers.java

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

+ 20 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/domain/CwProjectRecords.java

@@ -88,4 +88,24 @@ public class CwProjectRecords extends BaseEntity {
      */
     private String contractId;
 
+    /**
+     * 业务类型
+     */
+    private String businessType;
+
+    /**
+     * 风险等级
+     */
+    private String riskLevel;
+
+    /**
+     * 项目实际责任人
+     */
+    private String realHeader;
+
+    /**
+     * 报备类型
+     */
+    private String reportType;
+
 }

+ 48 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/mapper/CwManHourManagementMapper.java

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

+ 17 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/mapper/CwProjectClientContactMapper.java

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

+ 15 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/mapper/CwProjectMembersMapper.java

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

+ 10 - 2
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/mapper/CwProjectRecordsMapper.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Constants;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.sys.service.dto.UserDTO;
 import com.jeeplus.test.cw.projectRecords.domain.CwProjectRecords;
 import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectClientInfoDTO;
 import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectRecordsDTO;
@@ -26,8 +27,7 @@ public interface CwProjectRecordsMapper extends BaseMapper<CwProjectRecords> {
      * @param queryWrapper
      * @return
      */
-    IPage<CwProjectRecordsDTO> findList(Page<CwProjectRecordsDTO> page, @Param(Constants.WRAPPER) QueryWrapper<CwProjectRecords> queryWrapper);
-
+    IPage<CwProjectRecordsDTO> findList(Page<CwProjectRecordsDTO> page,@Param("currentUser") UserDTO currentUser,@Param("isBmzr") String isBmzr, @Param(Constants.WRAPPER) QueryWrapper<CwProjectRecords> queryWrapper);
     /**
      * 根据id查询项目详情
      * @param id
@@ -48,4 +48,12 @@ public interface CwProjectRecordsMapper extends BaseMapper<CwProjectRecords> {
      * @return
      */
     Integer insertProjectClientInfoList(@Param("cwProjectClientInfoList") List<CwProjectClientInfoDTO> cwProjectClientInfoList);
+
+    List<String> getProjectIdByClientId(@Param("id") String id);
+
+    List<CwProjectRecordsDTO> getProjectByIdList(@Param(Constants.WRAPPER) QueryWrapper<CwProjectRecords> queryWrapper);
+
+    List<CwProjectRecordsDTO> getByContractId(@Param(Constants.WRAPPER) QueryWrapper<CwProjectRecords> queryWrapper);
+
+    List<String> getHaveProjectIds(@Param("currentUser") UserDTO currentUser);
 }

+ 58 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/mapper/xml/CwManHourManagementMapper.xml

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

+ 46 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/mapper/xml/CwProjectClientContactMapper.xml

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

+ 32 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/mapper/xml/CwProjectMembersMapper.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.test.cw.projectRecords.mapper.CwProjectMembersMapper">
+
+    <resultMap id="BaseResultMap" type="com.jeeplus.test.cw.projectRecords.service.dto.CwProjectMembersDTO">
+            <id property="id" column="id" jdbcType="VARCHAR"/>
+            <result property="createBy.id" column="create_by" jdbcType="VARCHAR"/>
+            <result property="createDate" column="create_date" jdbcType="TIMESTAMP"/>
+            <result property="updateBy.id" column="update_by" jdbcType="VARCHAR"/>
+            <result property="updateDate" column="update_date" jdbcType="TIMESTAMP"/>
+            <result property="delFlag" column="del_flag" jdbcType="INTEGER"/>
+            <result property="remarks" column="remarks" jdbcType="VARCHAR"/>
+            <result property="projectId" column="project_id" jdbcType="VARCHAR"/>
+            <result property="userId" column="user_id" jdbcType="VARCHAR"/>
+            <result property="status" column="status" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <sql id="Members_Column_List">
+        cw_pm.id,
+        cw_pm.create_by,
+        cw_pm.create_date,
+        cw_pm.update_by,
+        cw_pm.update_date,
+        cw_pm.del_flag,
+        cw_pm.remarks,
+        cw_pm.project_id,
+        cw_pm.user_id,
+        cw_pm.status
+    </sql>
+</mapper>

+ 138 - 4
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/mapper/xml/CwProjectRecordsMapper.xml

@@ -35,8 +35,18 @@
         <result property="paymentMethod" column="payment_method" jdbcType="VARCHAR"/>
         <result property="createName" column="user_name" jdbcType="VARCHAR"/>
         <result property="createDateT" column="create_date" jdbcType="VARCHAR"/>
+        <result property="businessType" column="business_type" jdbcType="VARCHAR"/>
+        <result property="riskLevel" column="risk_level" jdbcType="VARCHAR"/>
+        <result property="businessTypeName" column="business_type_name" jdbcType="VARCHAR"/>
+        <result property="realHeader" column="real_header" jdbcType="VARCHAR"/>
+        <result property="clientContactsName" column="client_contacts_name" jdbcType="VARCHAR"/>
+        <result property="reportType" column="report_type" jdbcType="VARCHAR"/>
+        <result property="memberCount" column="member_count" jdbcType="VARCHAR"/>
         <collection property="cwProjectClientInfoDTOList" ofType="com.jeeplus.test.cw.workClientInfo.service.dto.CwWorkClientBaseDTO" column="id" select="getProjectClient"></collection>
         <collection property="workAttachmentDtoList" ofType="com.jeeplus.test.workContract.service.dto.WorkAttachmentDto" column="id" select="getFileList"></collection>
+        <collection property="cwProjectClientContactDTOList" ofType="com.jeeplus.test.cw.projectRecords.service.dto.CwProjectClientContactDTO" column="id" select="getContact"></collection>
+        <collection property="cwProjectMembersDTOList" ofType="com.jeeplus.test.cw.projectRecords.service.dto.CwProjectMembersDTO" column="id" select="getMembers"></collection>
+
     </resultMap>
 
     <resultMap id="AttachmentMap" type="com.jeeplus.test.workContract.service.dto.WorkAttachmentDto">
@@ -72,7 +82,11 @@
         a.proc_ins_id,
         a.status,
         a.process_definition_id,
-        a.contract_id
+        a.contract_id,
+        a.business_type,
+        a.risk_level,
+        a.real_header,
+        a.report_type
     </sql>
     <sql id="File_Column_List">
         wa.id,
@@ -93,7 +107,25 @@
         wa.sort,
         wa.description
     </sql>
-
+    <sql id="Contact_Column_List">
+        cw_pcc.id,
+        cw_pcc.create_by,
+        cw_pcc.create_date,
+        cw_pcc.update_by,
+        cw_pcc.update_date,
+        cw_pcc.del_flag,
+        cw_pcc.remarks,
+        cw_pcc.project_id,
+        cw_pcc.client_id,
+        cw_pcc.name,
+        cw_pcc.sex,
+        cw_pcc.office_id,
+        cw_pcc.position,
+        cw_pcc.contact_first,
+        cw_pcc.contact_second,
+        cw_pcc.fax,
+        cw_pcc.email
+    </sql>
     <sql id="Project_Client_List">
         cw_pci.project_id,
         cw_pci.client_id,
@@ -135,6 +167,18 @@
         cw_wcb.agree_date,
         cw_wcb.agree_user_id
     </sql>
+    <sql id="Members_Column_List">
+        cw_pm.id,
+        cw_pm.create_by,
+        cw_pm.create_date,
+        cw_pm.update_by,
+        cw_pm.update_date,
+        cw_pm.del_flag,
+        cw_pm.remarks,
+        cw_pm.project_id,
+        cw_pm.user_id,
+        cw_pm.status
+    </sql>
 
     <select id="getProjectClient" resultType="com.jeeplus.test.cw.workClientInfo.service.dto.CwWorkClientBaseDTO">
         select
@@ -153,6 +197,20 @@
         where wa.del_flag = '0' and wa.attachment_id = #{id}
     </select>
 
+    <select id="getContact" resultType="com.jeeplus.test.cw.projectRecords.service.dto.CwProjectClientContactDTO">
+        select
+        <include refid="Contact_Column_List"></include>
+        from cw_project_client_contact cw_pcc
+        where cw_pcc.project_id = #{id} and cw_pcc.del_flag = '0'
+    </select>
+    <select id="getMembers" resultType="com.jeeplus.test.cw.projectRecords.service.dto.CwProjectMembersDTO">
+        select
+        <include refid="Members_Column_List"></include>
+        from cw_project_members cw_pm
+        where cw_pm.project_id = #{id} and cw_pm.del_flag = '0'
+    </select>
+
+
     <select id="findList" resultMap="BaseResultMap">
         select
         <include refid="Base_Column_List"></include>,
@@ -162,12 +220,42 @@
         cw_wci.contract_amount,
         cw_wci.contract_num,
         cw_wci.payer_subject,
-        cw_wci.payment_method
+        cw_wci.payment_method,
+        cw_wcb.name as client_contacts_name,
+        cw_pbt.name as business_type_name,
+        b.member_count
         from cw_project_records a
         left join sys_user su on su.id = a.create_by and su.del_flag = '0'
         left join sys_user su2 on su2.id = a.project_master_id and su2.del_flag = '0'
         left join cw_work_contract_info cw_wci on cw_wci.id = a.contract_id and cw_wci.del_flag = '0'
+        left join cw_work_client_base cw_wcb on cw_wci.client_contacts = cw_wcb.id and cw_wcb.del_flag = '0'
+        left join cw_project_business_type cw_pbt on cw_pbt.id = a.business_type and cw_pbt.del_flag = '0'
+        left join (select rec.id,count(cw_pm.id) as member_count
+                    from cw_project_records rec
+                    left join cw_project_members cw_pm on cw_pm.project_id = rec.id and cw_pm.del_flag = '0'
+                    group by rec.id
+                    ) b on b.id = a.id
         ${ew.customSqlSegment}
+        <if test="currentUser.id != '1'.toString">
+            <if test="isBmzr == '0'.toString">
+                and a.create_by = #{currentUser.id} or a.id in (
+                select cw_pm.project_id
+                from cw_project_members cw_pm
+                where cw_pm.user_id = #{currentUser.id} and cw_pm.del_flag = '0' and cw_pm.status = '0'
+                )
+            </if>
+            <if test="isBmzr == '1'.toString">
+                and a.create_by in (
+                select su.id from sys_user su where su.del_flag = '0' and su.office_id in
+                (select so.id from sys_office so where so.id = #{currentUser.officeDTO.id} or so.parent_ids like concat('%',#{currentUser.officeDTO.id},'%') and so.del_flag = '0')
+                ) or a.id in (
+                select cw_pm.project_id
+                from cw_project_members cw_pm
+                where cw_pm.user_id = #{currentUser.id} and cw_pm.del_flag = '0' and cw_pm.status = '0'
+                )
+            </if>
+        </if>
+        ORDER BY a.create_date DESC
     </select>
 
     <select id="queryById" resultMap="BaseResultMap">
@@ -179,11 +267,15 @@
         cw_wci.contract_amount,
         cw_wci.contract_num,
         cw_wci.payer_subject,
-        cw_wci.payment_method
+        cw_wci.payment_method,
+        cw_wcb.name as client_contacts_name,
+        cw_pbt.name as business_type_name
         from cw_project_records a
         left join sys_user su on su.id = a.create_by and su.del_flag = '0'
         left join sys_user su2 on su2.id = a.project_master_id and su2.del_flag = '0'
         left join cw_work_contract_info cw_wci on cw_wci.id = a.contract_id and cw_wci.del_flag = '0'
+        left join cw_work_client_base cw_wcb on cw_wci.client_contacts = cw_wcb.id and cw_wcb.del_flag = '0'
+        left join cw_project_business_type cw_pbt on cw_pbt.id = a.business_type and cw_pbt.del_flag = '0'
         where a.del_flag = '0' and a.id = ${id}
     </select>
 
@@ -196,4 +288,46 @@
             insert into cw_project_client_info(project_id,client_id) values(#{item.projectId},#{item.clientId})
         </foreach>
     </insert>
+
+    <select id="getProjectIdByClientId" resultType="string">
+        select
+            cw_pci.project_id
+        from cw_project_client_info cw_pci
+        where cw_pci.client_id = #{id}
+    </select>
+
+    <select id="getProjectByIdList" resultType="com.jeeplus.test.cw.projectRecords.service.dto.CwProjectRecordsDTO" parameterType="string">
+        select
+        <include refid="Base_Column_List"></include>,
+        su.name as create_name,
+        su2.name as project_master_name
+        from cw_project_records a
+        left join sys_user su on su.id = a.create_by and su.del_flag = '0'
+        left join sys_user su2 on su2.id = a.project_master_id and su2.del_flag = '0'
+        ${ew.customSqlSegment}
+    </select>
+
+    <select id="getByContractId" resultType="com.jeeplus.test.cw.projectRecords.service.dto.CwProjectRecordsDTO">
+        select
+            <include refid="Base_Column_List"></include>,
+            su.name as create_name,
+            su2.name as project_master_name
+        from cw_project_records a
+        left join sys_user su on su.id = a.create_by and su.del_flag = '0'
+        left join sys_user su2 on su2.id = a.project_master_id and su2.del_flag = '0'
+        ${ew.customSqlSegment}
+    </select>
+
+    <select id="getHaveProjectIds" resultType="string">
+        select
+            distinct id
+        from
+        (select cw_pm.project_id as id
+        from cw_project_members cw_pm
+        where cw_pm.user_id = #{currentUser.id} and cw_pm.del_flag = '0' and cw_pm.status = '0'
+        union
+        select cw_pr.id as id
+        from cw_project_records cw_pr
+        where cw_pr.create_by = #{currentUser.id} and cw_pr.del_flag = '0') a
+    </select>
 </mapper>

+ 208 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/service/CwManHourManagementService.java

@@ -0,0 +1,208 @@
+package com.jeeplus.test.cw.projectRecords.service;
+
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.util.ArrayUtil;
+import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.google.common.collect.Lists;
+import com.jeeplus.core.query.QueryWrapperGenerator;
+import com.jeeplus.sys.domain.User;
+import com.jeeplus.sys.mapper.UserMapper;
+import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.sys.utils.StringUtils;
+import com.jeeplus.sys.utils.UserUtils;
+import com.jeeplus.test.cw.projectRecords.domain.CwManHourManagement;
+import com.jeeplus.test.cw.projectRecords.mapper.CwManHourManagementMapper;
+import com.jeeplus.test.cw.projectRecords.service.dto.CwManHourManagementDTO;
+import com.jeeplus.test.cw.projectRecords.service.mapstruct.CwManHourManagementWrapper;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 财务项目登记service
+ * @author: 徐滕
+ * @version: 2022-11-10 14:56
+ */
+@Service
+@Transactional
+public class CwManHourManagementService extends ServiceImpl<CwManHourManagementMapper, CwManHourManagement> {
+
+    @Resource
+    private CwManHourManagementMapper cwManHourManagementMapper;
+    @Resource
+    private UserMapper userMapper;
+
+    /**
+     * 差选项目列表信息
+     * @param page
+     * @param cwManHourManagementDTO
+     * @return
+     * @throws Exception
+     */
+    public IPage<CwManHourManagementDTO> findList(Page<CwManHourManagementDTO> page, CwManHourManagementDTO cwManHourManagementDTO) throws Exception{
+        QueryWrapper<CwManHourManagement> queryWrapper = QueryWrapperGenerator.buildQueryCondition ( CwManHourManagementWrapper.INSTANCE.toEntity(cwManHourManagementDTO), CwManHourManagement.class );
+        queryWrapper.eq("a.del_flag","0");
+        queryWrapper.orderByDesc("a.create_date");
+        if (ObjectUtil.isNotEmpty(cwManHourManagementDTO)) {
+            if (ArrayUtil.isNotEmpty(cwManHourManagementDTO.getCreateDates())) {
+                queryWrapper.between("a.create_date", cwManHourManagementDTO.getCreateDates()[0], cwManHourManagementDTO.getCreateDates()[1]);
+            }
+            if (StringUtils.isNotBlank(cwManHourManagementDTO.getProjectMasterName())) {
+                List<User> userList = userMapper.selectList(new QueryWrapper<User>().lambda().like(User::getName, cwManHourManagementDTO.getProjectMasterName()));
+                List<String> ids = userList.stream().distinct().map(User::getId).collect(Collectors.toList());
+                if (CollectionUtil.isNotEmpty(ids)) {
+                    queryWrapper.in("a.project_master_id", ids);
+                } else {
+                    return new Page<>();
+                }
+            }
+            if (StringUtils.isNotBlank(cwManHourManagementDTO.getCreateId())){
+                queryWrapper.eq("a.create_by", cwManHourManagementDTO.getCreateId());
+            }
+        }
+        if(StringUtils.isNotBlank(cwManHourManagementDTO.getProjectName())){
+            queryWrapper.like("p.project_name", cwManHourManagementDTO.getProjectName());
+        }
+        IPage<CwManHourManagementDTO> list = cwManHourManagementMapper.findList(page, queryWrapper);
+        List<CwManHourManagementDTO> records = list.getRecords();
+        for (CwManHourManagementDTO info:records) {
+            if("0".equals(info.getStatus())){
+                info.setStatusStr("未确认");
+            }else if("1".equals(info.getStatus())){
+                info.setStatusStr("已确认");
+            }
+        }
+        return list;
+    }
+
+    /**
+     * 根据id查询项目详情
+     * @param id
+     * @return
+     */
+    public CwManHourManagementDTO queryById(String id) {
+        CwManHourManagementDTO cwManHourManagementDTO = cwManHourManagementMapper.queryById(id);
+        if (ObjectUtil.isNotEmpty(cwManHourManagementDTO)) {
+            if (ObjectUtil.isNotEmpty(cwManHourManagementDTO.getPlanStartDate()) && ObjectUtil.isNotEmpty(cwManHourManagementDTO.getPlanEndDate())) {
+                Date[] planDate = new Date[2];
+                planDate[0] = cwManHourManagementDTO.getPlanStartDate();
+                planDate[1] = cwManHourManagementDTO.getPlanEndDate();
+                cwManHourManagementDTO.setPlanDate(planDate);
+            }
+        }
+        return cwManHourManagementDTO;
+    }
+
+    /**
+     * 保存项目以及其他相关信息
+     * @param cwManHourManagementDTO
+     * @return
+     * @throws Exception
+     */
+    public String saveForm(CwManHourManagementDTO cwManHourManagementDTO) throws Exception{
+        if(StringUtils.isBlank(cwManHourManagementDTO.getId())){
+            //获取当前登录人信息
+            UserDTO userDTO = UserUtils.getCurrentUserDTO();
+        }
+        CwManHourManagement cwManHourManagement = CwManHourManagementWrapper.INSTANCE.toEntity(cwManHourManagementDTO);
+        if (ObjectUtil.isNotEmpty(cwManHourManagement)) {
+            if (StringUtils.isBlank(cwManHourManagement.getCreateBy())) {
+                cwManHourManagement.setCreateBy(UserUtils.getCurrentUserDTO().getId());
+            }
+        }
+        if(StringUtils.isNotBlank(cwManHourManagementDTO.getProjectId())){
+            cwManHourManagement.setProjectId(cwManHourManagementDTO.getProjectId());
+        }
+        if(cwManHourManagementDTO.getPlanDate().length>1){
+            cwManHourManagement.setPlanStartDate(cwManHourManagementDTO.getPlanDate()[0]);
+            cwManHourManagement.setPlanEndDate(cwManHourManagementDTO.getPlanDate()[1]);
+        }
+        this.saveOrUpdate(cwManHourManagement);
+        return cwManHourManagement.getId();
+    }
+
+    /**
+     * 保存项目信息
+     * @param cwManHourManagementDTO
+     * @return
+     * @throws Exception
+     */
+    public ResponseEntity save(CwManHourManagementDTO cwManHourManagementDTO) throws Exception{
+        this.saveForm(cwManHourManagementDTO);
+        return ResponseEntity.ok("保存成功");
+    }
+
+    /**
+     * 保存项目信息
+     * @param id
+     * @return
+     * @throws Exception
+     */
+    public ResponseEntity updateStatus(String id){
+        cwManHourManagementMapper.updateStatus(id);
+        return ResponseEntity.ok("保存成功");
+    }
+
+    /**
+     * 根据id删除项目信息
+     * @param ids
+     * @return
+     */
+    public ResponseEntity deleteByIds(String ids) {
+        String idArray[] =ids.split(",");
+        this.removeByIds (Lists.newArrayList (idArray));
+        return ResponseEntity.ok ("删除成功");
+    }
+
+    /**
+     * 根据客户id获取关联的项目信息
+     * @param clientId
+     * @return
+     */
+    /*public List<CwManHourManagementDTO> getByClientId(String clientId,CwManHourManagementDTO cwManHourManagementDTO) throws Exception {
+        if(StringUtils.isNotBlank(clientId)){
+            List<String> projectIdByClientId = cwManHourManagementMapper.getProjectIdByClientId(clientId);
+            List<String> projectList = projectIdByClientId.stream().distinct().collect(Collectors.toList());
+            if (CollectionUtil.isNotEmpty(projectList)) {
+                QueryWrapper<CwManHourManagement> queryWrapper = QueryWrapperGenerator.buildQueryCondition ( CwManHourManagementWrapper.INSTANCE.toEntity(cwManHourManagementDTO), CwManHourManagement.class );
+                queryWrapper.in("a.id", projectList);
+                queryWrapper.eq("a.del_flag","0");
+                queryWrapper.eq("a.status","5");
+                queryWrapper.orderByDesc("a.create_date");
+                return cwManHourManagementMapper.getProjectByIdList(queryWrapper);
+            } else {
+                return new ArrayList<>();
+            }
+        } else {
+            return new ArrayList<>();
+        }
+    }*/
+
+    /**
+     * 根据合同id获取关联的项目信息
+     * @param contractId
+     * @return
+     */
+    /*public List<CwManHourManagementDTO> getByContractId(String contractId,CwManHourManagementDTO cwManHourManagementDTO) throws Exception{
+        if (StringUtils.isNotBlank(contractId)) {
+            QueryWrapper<CwManHourManagement> queryWrapper = QueryWrapperGenerator.buildQueryCondition ( CwManHourManagementWrapper.INSTANCE.toEntity(cwManHourManagementDTO), CwManHourManagement.class );
+            queryWrapper.eq("a.contract_id", contractId);
+            queryWrapper.eq("a.del_flag","0");
+            queryWrapper.eq("a.status","5");
+            queryWrapper.orderByDesc("a.create_date");
+            return cwManHourManagementMapper.getByContractId(queryWrapper);
+        }
+        return new ArrayList<>();
+    }*/
+
+}

+ 15 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/service/CwProjectClientContactService.java

@@ -0,0 +1,15 @@
+package com.jeeplus.test.cw.projectRecords.service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.jeeplus.test.cw.projectRecords.domain.CwProjectClientContact;
+import com.jeeplus.test.cw.projectRecords.mapper.CwProjectClientContactMapper;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+@Service
+@Transactional
+public class CwProjectClientContactService extends ServiceImpl<CwProjectClientContactMapper, CwProjectClientContact> {
+
+    private CwProjectClientContactMapper cwProjectClientContactMapper;
+
+}

+ 17 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/service/CwProjectMembersService.java

@@ -0,0 +1,17 @@
+package com.jeeplus.test.cw.projectRecords.service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.jeeplus.test.cw.projectRecords.domain.CwProjectClientContact;
+import com.jeeplus.test.cw.projectRecords.domain.CwProjectMembers;
+import com.jeeplus.test.cw.projectRecords.mapper.CwProjectClientContactMapper;
+import com.jeeplus.test.cw.projectRecords.mapper.CwProjectMembersMapper;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+@Service
+@Transactional
+public class CwProjectMembersService extends ServiceImpl<CwProjectMembersMapper, CwProjectMembers> {
+
+    private CwProjectMembersMapper cwProjectMembersMapper;
+
+}

+ 224 - 368
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/service/CwProjectRecordsService.java

@@ -1,5 +1,6 @@
 package com.jeeplus.test.cw.projectRecords.service;
 
+import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.util.ArrayUtil;
 import cn.hutool.core.util.ObjectUtil;
@@ -14,15 +15,30 @@ import com.google.gson.reflect.TypeToken;
 import com.jeeplus.core.query.QueryWrapperGenerator;
 import com.jeeplus.sys.domain.User;
 import com.jeeplus.sys.mapper.UserMapper;
+import com.jeeplus.sys.service.dto.RoleDTO;
 import com.jeeplus.sys.service.dto.UserDTO;
 import com.jeeplus.sys.utils.Global;
 import com.jeeplus.sys.utils.StringUtils;
 import com.jeeplus.sys.utils.UserUtils;
+import com.jeeplus.test.cw.common.FindUtils;
+import com.jeeplus.test.cw.contractRegistration.domain.ContractFile;
+import com.jeeplus.test.cw.contractRegistration.domain.ContractInfo;
+import com.jeeplus.test.cw.contractRegistration.mapper.ContractInfoMapper;
+import com.jeeplus.test.cw.projectRecords.domain.CwProjectClientContact;
+import com.jeeplus.test.cw.projectRecords.domain.CwProjectMembers;
 import com.jeeplus.test.cw.projectRecords.domain.CwProjectRecords;
+import com.jeeplus.test.cw.projectRecords.mapper.CwProjectClientContactMapper;
 import com.jeeplus.test.cw.projectRecords.mapper.CwProjectRecordsMapper;
+import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectClientContactDTO;
 import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectClientInfoDTO;
+import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectMembersDTO;
 import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectRecordsDTO;
+import com.jeeplus.test.cw.projectRecords.service.mapstruct.CwProjectClientContactWrapper;
+import com.jeeplus.test.cw.projectRecords.service.mapstruct.CwProjectMembersWrapper;
 import com.jeeplus.test.cw.projectRecords.service.mapstruct.CwProjectRecordsWrapper;
+import com.jeeplus.test.cw.workClientInfo.domain.CwWorkClientContact;
+import com.jeeplus.test.cw.workClientInfo.service.CwWorkClientContactService;
+import com.jeeplus.test.cw.workClientInfo.service.CwWorkClientService;
 import com.jeeplus.test.cw.workClientInfo.service.dto.CwWorkClientBaseDTO;
 import com.jeeplus.test.mould.service.SerialnumTplService;
 import com.jeeplus.test.oss.domain.WorkAttachment;
@@ -30,6 +46,7 @@ import com.jeeplus.test.oss.service.OSSClientService;
 import com.jeeplus.test.oss.service.OssService;
 import com.jeeplus.test.signature.domain.*;
 import com.jeeplus.test.signature.utils.SignaturePostUtil;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.data.redis.connection.jedis.JedisUtils;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Service;
@@ -56,11 +73,20 @@ public class CwProjectRecordsService extends ServiceImpl<CwProjectRecordsMapper,
     private CwProjectRecordsMapper cwProjectRecordsMapper;
     @Resource
     private OssService ossService;
-
+    @Resource
+    private CwProjectClientContactMapper cwProjectClientContactMapper;
+    @Resource
+    private CwProjectClientContactService cwProjectClientContactService;
+    @Resource
+    private ContractInfoMapper contractInfoMapper;
     @Resource
     private SerialnumTplService serialnumTplService;
     @Resource
     private UserMapper userMapper;
+    @Resource
+    private CwWorkClientContactService cwWorkClientContactService;
+    @Resource
+    private CwProjectMembersService cwProjectMembersService;
 
     /**
      * 差选项目列表信息
@@ -72,7 +98,7 @@ public class CwProjectRecordsService extends ServiceImpl<CwProjectRecordsMapper,
     public IPage<CwProjectRecordsDTO> findList(Page<CwProjectRecordsDTO> page, CwProjectRecordsDTO cwProjectRecordsDTO) throws Exception{
         QueryWrapper<CwProjectRecords> queryWrapper = QueryWrapperGenerator.buildQueryCondition ( CwProjectRecordsWrapper.INSTANCE.toEntity(cwProjectRecordsDTO), CwProjectRecords.class );
         queryWrapper.eq("a.del_flag","0");
-        queryWrapper.orderByDesc("a.create_date");
+//        queryWrapper.orderByDesc("a.create_date");
         if (ObjectUtil.isNotEmpty(cwProjectRecordsDTO)) {
             if (ArrayUtil.isNotEmpty(cwProjectRecordsDTO.getCreateDates())) {
                 queryWrapper.between("a.create_date", cwProjectRecordsDTO.getCreateDates()[0], cwProjectRecordsDTO.getCreateDates()[1]);
@@ -90,7 +116,16 @@ public class CwProjectRecordsService extends ServiceImpl<CwProjectRecordsMapper,
                 queryWrapper.eq("a.create_by", cwProjectRecordsDTO.getCreateId());
             }
         }
-        IPage<CwProjectRecordsDTO> list = cwProjectRecordsMapper.findList(page, queryWrapper);
+        // 如果当前用户是部门主任,则可以查看部门所有的项目、自己创建的项目以及所属项目组的项目
+        // 如果当前用户是员工,则可以查看自己创建的项目以及所属项目组的项目
+        String isBmzr = "0";
+        UserDTO userDTO = UserUtils.getCurrentUserDTO();
+        if (FindUtils.haveRoleCwBmzr()) {
+            isBmzr = "1";
+        } else {
+            isBmzr = "0";
+        }
+        IPage<CwProjectRecordsDTO> list = cwProjectRecordsMapper.findList(page,userDTO,isBmzr, queryWrapper);
         return list;
     }
 
@@ -101,6 +136,14 @@ public class CwProjectRecordsService extends ServiceImpl<CwProjectRecordsMapper,
      */
     public CwProjectRecordsDTO queryById(String id) {
         CwProjectRecordsDTO cwProjectRecordsDTO = cwProjectRecordsMapper.queryById(id);
+        if (ObjectUtil.isNotEmpty(cwProjectRecordsDTO)) {
+            if (ObjectUtil.isNotEmpty(cwProjectRecordsDTO.getPlanStartDate()) && ObjectUtil.isNotEmpty(cwProjectRecordsDTO.getPlanEndDate())) {
+                Date[] planDate = new Date[2];
+                planDate[0] = cwProjectRecordsDTO.getPlanStartDate();
+                planDate[1] = cwProjectRecordsDTO.getPlanEndDate();
+                cwProjectRecordsDTO.setPlanDate(planDate);
+            }
+        }
         return cwProjectRecordsDTO;
     }
 
@@ -117,6 +160,24 @@ public class CwProjectRecordsService extends ServiceImpl<CwProjectRecordsMapper,
             //项目编号生成
             String serialNum = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), CwProjectRecordsDTO.BIZ_CODE);
             cwProjectRecordsDTO.setProjectNumber(serialNum);
+            cwProjectRecordsDTO.setStatus("5");
+        } else {
+            //把原项目关联的客户联系人从客户表删除
+            CwProjectRecords project = this.getById(cwProjectRecordsDTO.getId());
+            if (ObjectUtil.isNotEmpty(project)) {
+                if (StringUtils.isNotBlank(project.getContractId())) {
+                    ContractInfo contractInfo = contractInfoMapper.selectById(project.getContractId());
+                    if (ObjectUtil.isNotEmpty(contractInfo)) {
+                        if (StringUtils.isNotBlank(contractInfo.getClientContacts())) {
+                            // 删除客户的联系人表中与此项目关联的联系人
+                            cwWorkClientContactService.remove(new QueryWrapper<CwWorkClientContact>().lambda()
+                                    .eq(CwWorkClientContact::getClientId,contractInfo.getClientContacts())
+                                    .eq(CwWorkClientContact::getProjectId,cwProjectRecordsDTO.getId())
+                            );
+                        }
+                    }
+                }
+            }
         }
         CwProjectRecords cwProjectRecords = CwProjectRecordsWrapper.INSTANCE.toEntity(cwProjectRecordsDTO);
         if (ObjectUtil.isNotEmpty(cwProjectRecords)) {
@@ -145,6 +206,83 @@ public class CwProjectRecordsService extends ServiceImpl<CwProjectRecordsMapper,
                 //对数据进行批量插入
                 cwProjectRecordsMapper.insertProjectClientInfoList(cwProjectClientInfoDTOList);
             }
+
+            // 客户联系人
+            if (CollectionUtil.isNotEmpty(cwProjectRecordsDTO.getCwProjectClientContactDTOList())) {
+                if (CollectionUtil.isNotEmpty(cwProjectRecordsDTO.getCwProjectClientContactDTOList())) {
+                    // 1. 查看数据是否有合同信息,
+                    // 如果有合同信息,有委托人,则把所有的联系人client_id替换为合同的委托人id
+                    // 如果有合同信息,但是没有委托人,则把所有的联系人client_id置空""
+                    // 如果有合同信息id,但是并没有通过合同信息id查询到数据,则把所有的联系人client_id置空""
+                    // 如果没有合同信息,则把所有的联系人client_id置空""
+                    if (StringUtils.isNotBlank(cwProjectRecords.getContractId())) {
+                        ContractInfo contractInfo = contractInfoMapper.selectById(cwProjectRecords.getContractId());
+                        if (ObjectUtil.isNotEmpty(contractInfo)){
+                            if (StringUtils.isNotBlank(contractInfo.getClientContacts())) {
+                                cwProjectRecordsDTO.getCwProjectClientContactDTOList().stream().forEach(item->{
+                                    item.setClientId(contractInfo.getClientContacts());
+                                });
+                            } else {
+                                cwProjectRecordsDTO.getCwProjectClientContactDTOList().stream().forEach(item->{
+                                    item.setClientId("");
+                                });
+                            }
+                        } else {
+                            cwProjectRecordsDTO.getCwProjectClientContactDTOList().stream().forEach(item->{
+                                item.setClientId("");
+                            });
+                        }
+                    } else {
+                        cwProjectRecordsDTO.getCwProjectClientContactDTOList().stream().forEach(item->{
+                            item.setClientId("");
+                        });
+                    }
+                    // 2. 联系人的添加或修改
+                    List<String> liveIds = cwProjectRecordsDTO.getCwProjectClientContactDTOList().stream().filter(item -> {
+                        if (StringUtils.isNotBlank(item.getId())) {
+                            return true;
+                        }
+                        return false;
+                    }).map(CwProjectClientContactDTO::getId).collect(Collectors.toList());
+                    if (CollectionUtil.isNotEmpty(liveIds)) {
+                        cwProjectClientContactMapper.delete(new QueryWrapper<CwProjectClientContact>().lambda().notIn(CwProjectClientContact::getId, liveIds).eq(CwProjectClientContact::getProjectId,cwProjectRecords.getId()));
+                    } else {
+                        cwProjectClientContactMapper.delete(new QueryWrapper<CwProjectClientContact>().lambda().eq(CwProjectClientContact::getProjectId,cwProjectRecords.getId()));
+                    }
+                    List<CwProjectClientContact> updateBatchById = new ArrayList<>();
+                    List<CwProjectClientContact> insertBatchById = new ArrayList<>();
+                    List<CwWorkClientContact> saveBatchClient = new ArrayList<>();
+                    cwProjectRecordsDTO.getCwProjectClientContactDTOList().stream().forEach(item->{
+                        item.setProjectId(cwProjectRecords.getId());
+                        if (StringUtils.isNotBlank(item.getId())){
+                            // 有id进行修改操作
+                            updateBatchById.add(CwProjectClientContactWrapper.INSTANCE.toEntity(item));
+                        }else{
+                            // 无id进行新增操作
+                            insertBatchById.add(CwProjectClientContactWrapper.INSTANCE.toEntity(item));
+                        }
+                        CwWorkClientContact cwWorkClientContact = new CwWorkClientContact();
+                        BeanUtil.copyProperties(item, cwWorkClientContact);
+                        cwWorkClientContact.setProjectId(cwProjectRecords.getId());
+                        cwWorkClientContact.setId("");
+                        saveBatchClient.add(cwWorkClientContact);
+                    });
+                    // 批量根据id修改数据
+                    if (CollectionUtil.isNotEmpty(updateBatchById)){
+                        cwProjectClientContactService.updateBatchById(updateBatchById);
+                    }
+                    // 批量新增数据
+                    if (CollectionUtil.isNotEmpty(insertBatchById)){
+                        cwProjectClientContactService.saveBatch(insertBatchById);
+                    }
+                    // 将数据添加到客户的联系人表中
+                    if (CollectionUtil.isNotEmpty(saveBatchClient)){
+                        cwWorkClientContactService.saveBatch(saveBatchClient);
+                    }
+                } else {
+                    cwProjectClientContactMapper.delete(new QueryWrapper<CwProjectClientContact>().lambda().eq(CwProjectClientContact::getProjectId,cwProjectRecords.getId()));
+                }
+            }
         }
         return cwProjectRecords.getId();
     }
@@ -182,384 +320,102 @@ public class CwProjectRecordsService extends ServiceImpl<CwProjectRecordsMapper,
         return "操作成功";
     }
 
-
-
-
-
-
-
-
-
-
-
-    /*public String createSignatureContractId(){
-    //public Map<String,Object> createSignatureContractId(){
-        List<WorkAttachment> fileList = Lists.newArrayList();
-        if(fileList.size()>0){
-
-            //下载审定单文件
-            String path = null;
-            if(System.getProperty("os.name").toLowerCase().contains("win")){
-                path = "D:/attachment-file/";
-            }else{
-                path = "/attachment-file/";
-            }
-            String aliyunUrl = Global.getAliyunUrl();
-            String aliDownloadUrl = Global.getAliDownloadUrl();
-
-            //获取文件生成的documentId
-            List<String> documentList = Lists.newArrayList();
-
-            for (WorkAttachment workattachment : fileList) {
-                String deleteFile = null;
-                try{
-                if(StringUtils.isBlank(workattachment.getUrl())){
-                    return "审定单文件存储路径为空,无法进行签章操作,请驳回后重新上传审定单";
-                }
-
-                String file = workattachment.getUrl();
-                file = file.replace("amp;","");
-                String fileName = file.substring(file.lastIndexOf("/") + 1, file.length());
-                String cons = "";
-                if (file.contains(aliyunUrl)){
-                    cons = aliyunUrl;
-                }else if (file.contains("http://gangwan-app.oss-cn-hangzhou.aliyuncs.com")){
-                    cons = "http://gangwan-app.oss-cn-hangzhou.aliyuncs.com";
-                }else {
-                    cons = aliDownloadUrl;
-                }
-                String ossKey = file.split(cons+"/")[1];
-                new OSSClientService().downByStreamSaveLocal(ossKey,fileName,path+fileName);
-                //将下载下来的文件转换为file文件
-                File srcFile = new File(path+fileName);
-                deleteFile = path+fileName;
-
-                //截取文件名称
-                String srcFileName = srcFile.getName().substring(0,srcFile.getName().lastIndexOf("."));
-                //截取文件后缀名
-                String substring = srcFile.getName().substring(srcFile.getName().lastIndexOf(".")+1, srcFile.getName().length());
-                if(!"doc".equals(substring.toLowerCase()) && !"docx".equals(substring.toLowerCase()) && !"pdf".equals(substring.toLowerCase())){
-                    return "请上传doc、docx或者pdf的文件进行签章操作";
-                }
-                //获取真签单的documentId
-                HashMap hashMap = SignaturePostUtil.getDocument(srcFile);
-                String code = hashMap.get("code").toString();
-                String documentId = "";
-                if("0".equals(code)){
-                    String result = hashMap.get("result").toString();
-                    HashMap documentIdMap = JSON.parseObject(result, HashMap.class);
-                    documentId =  documentIdMap.get("documentId").toString();
-                    if("".equals(documentId)){
-                        return "签章文件创建失败";
-                    }
-                }else{
-                    String message = hashMap.get("message").toString();
-                    return message;
-                }
-
-                documentList.add(documentId);
-
-                }catch (Exception e){
-
-                }finally {
-                    if(StringUtils.isNotBlank(deleteFile)){
-                        //根据路径创建文件对象
-                        File file = new File(deleteFile);
-                        //路径是个文件且不为空时删除文件
-                        if(file.isFile()&&file.exists()){
-                            file.delete();
-                        }
-                    }
-                }
-
-            }
-
-
-            //将documentId存入数据库中
-            projectReportData.setSignatureInvalidDocumentId(String.join(",", documentList));
-            //根据项目id 和 documentId生成合同id
-            HashMap contractIdHashMap = ruralProjectMessageService.getSignatureContractIdByPageSign(ruralProjectRecords.getId(), documentList);
-            String contractIdCode = contractIdHashMap.get("code").toString();
-            String contractId = "";
-            if("0".equals(contractIdCode)){
-                contractId = contractIdHashMap.get("contractId").toString();
-                if("".equals(contractId)){
-                    return "签章文件创建失败";
-                }
-                contractUrl = ruralProjectMessageService.getSignatureContractUrl(contractId);
-                System.out.println(contractUrl);
-            }else{
-                return contractIdHashMap.get("message").toString();
-            }
-            //将documentId 和contractId存储到质量复核对应的数据种
-            //签章完成则进行数据的保存
-            projectReportData.setSignatureFlag(1);
-            projectReportData.setSignatureDocumentId(documentId);
-            projectReportData.setSignatureContractId(contractId);
-            projectReportData.setSignatureFileName(srcFileName);
-            projectReportData.setSignatureUploadFileUser(UserUtils.getUser());
-            projectReportData.setSignatureUploadDate(new Date());
-            //修改签章对应信息文件
-            projectReportDataService.updateSignatureInfo(projectReportData);
-
-            //将数据信息以contractId作为key 并且有效期为1天 存储在redis中
-            Gson gson = new Gson();
-            String toJson = gson.toJson(projectApprovalSignature);
-
-            if(StringUtils.isNotBlank(toJson)){
-                Jedis jedis = JedisUtils.getResource();
-                String contractIdRedis = jedis.get("qiyuesuo" + contractId);
-                if (StringUtils.isBlank(contractIdRedis)) {
-                    //将该盖章url存放到redis 并设置1天的过期时间
-                    jedis.set("qiyuesuo" + contractId, toJson);
-                    jedis.expire("qiyuesuo" + contractId,86400);
-                }
-            }
-
-            String auditUserListJson = gson.toJson(auditUsers);
-
-            if(StringUtils.isNotBlank(auditUserListJson)){
-                Jedis jedis = JedisUtils.getResource();
-                String contractIdRedis = jedis.get("qiyuesuoAuditUserList" + contractId);
-                if (StringUtils.isBlank(contractIdRedis)) {
-                    //将该盖章url存放到redis 并设置1天的过期时间
-                    jedis.set("qiyuesuoAuditUserList" + contractId, auditUserListJson);
-                    jedis.expire("qiyuesuoAuditUserList" + contractId,86400);
-                }
+    /**
+     * 根据客户id获取关联的项目信息
+     * @param clientId
+     * @return
+     */
+    public List<CwProjectRecordsDTO> getByClientId(String clientId,CwProjectRecordsDTO cwProjectRecordsDTO) throws Exception {
+        if(StringUtils.isNotBlank(clientId)){
+            List<String> projectIdByClientId = cwProjectRecordsMapper.getProjectIdByClientId(clientId);
+            List<String> projectList = projectIdByClientId.stream().distinct().collect(Collectors.toList());
+            if (CollectionUtil.isNotEmpty(projectList)) {
+                QueryWrapper<CwProjectRecords> queryWrapper = QueryWrapperGenerator.buildQueryCondition ( CwProjectRecordsWrapper.INSTANCE.toEntity(cwProjectRecordsDTO), CwProjectRecords.class );
+                queryWrapper.in("a.id", projectList);
+                queryWrapper.eq("a.del_flag","0");
+                queryWrapper.eq("a.status","5");
+                queryWrapper.orderByDesc("a.create_date");
+                return cwProjectRecordsMapper.getProjectByIdList(queryWrapper);
+            } else {
+                return new ArrayList<>();
             }
-
-        }else{
-            return "审定单文件未找到,无法进行签章操作";
+        } else {
+            return new ArrayList<>();
         }
-        return null;
     }
 
-
-
-
-
-    private static final String HTTPTOP = Global.getConfig("signature_http_top");
-    private static final String COMPANYROUNDSEALID = Global.getConfig("company_round_seal_id");
-    private static final String COMPANYROUNDSEALIDVERTICAL = Global.getConfig("company_round_seal_id_vertical");
-    private static final String COMPANYPARTIESSEALID = Global.getConfig("company_parties_seal_id");
-    private static final String APPROVALCATEGORYID = Global.getConfig("approval_category_id");
-    private static final String APPROVALYCCATEGORYID = Global.getConfig("approval_YC_category_id");
-    private static final String REPORTCATEGORYID = Global.getConfig("report_category_id");
-    private static final String REPORTYCCATEGORYID = Global.getConfig("report_YC_category_id");
-    private static final String JUDGEMENTCATEGORYID = Global.getConfig("judgement_category_id");
-
-
-    *//**
-     * 根据项目id 和 documentId生成合同id(页面签署生成)
-     * 个人签字章功能
-     * @param projectId
-     * @param documentList
+    /**
+     * 根据合同id获取关联的项目信息
+     * @param contractId
      * @return
-     *//*
-    public HashMap getSignatureContractIdByPageSign(String projectId, List<String> documentList){
-        HashMap hashMap = new HashMap();
-        Set<String> serialIdSet = new HashSet<>();
-        //根据项目id查询项目信息
-        RuralProjectRecords ruralProjectRecords = ruralProjectRecordsService.get(projectId);
-        //创建签署方信息
-        List<Action> actions = Lists.newArrayList();
-        Action companyAction = new Action();
-        companyAction.setType("CORPORATE");
-        companyAction.setName("公司印章");
-        companyAction.setSerialNo("3");
-        //公司圆章-竖
-        //serialIdSet.add(COMPANYROUNDSEALIDVERTICAL);
-        //添加盖章位置
-        List<Location> locations = Lists.newArrayList();
-        *//*for (String documentId: documentList) {
-            Location location = new Location();
-            location.setSealId(COMPANYROUNDSEALIDVERTICAL);
-            location.setDocumentId(documentId);
-            location.setPage("0");
-            location.setRectType("SEAL_CORPORATE");
-            location.setKeywordIndex(-1);
-            location.setOffsetX("0.5264");
-            location.setOffsetY("0.6787");
-            locations.add(location);
-        }*//*
-
-        //根据角色信息录入签署方信息
-        //负责人
-        if(StringUtils.isNotBlank(principalUserId)){
-            User user = UserUtils.get(principalUserId);
-            if(null != user){
-                //获取成员印章id信息
-                String userSealId = SignaturePostUtil.getUserSealByMobile(user.getMobile(),"","江苏兴光项目管理有限公司公章");
-
-
+     */
+    public List<CwProjectRecordsDTO> getByContractId(String contractId,CwProjectRecordsDTO cwProjectRecordsDTO) throws Exception{
+        if (StringUtils.isNotBlank(contractId)) {
+            QueryWrapper<CwProjectRecords> queryWrapper = QueryWrapperGenerator.buildQueryCondition ( CwProjectRecordsWrapper.INSTANCE.toEntity(cwProjectRecordsDTO), CwProjectRecords.class );
+            queryWrapper.eq("a.contract_id", contractId);
+            queryWrapper.eq("a.del_flag","0");
+            queryWrapper.eq("a.status","5");
+            queryWrapper.orderByDesc("a.create_date");
+            return cwProjectRecordsMapper.getByContractId(queryWrapper);
+        }
+        return new ArrayList<>();
+    }
 
-                if(StringUtils.isNotBlank(userSealId)){
-                    for (String documentId: documentList) {
-                        //添加盖章位置
-                        Location principalLocation = new Location();
-                        serialIdSet.add(userSealId);
-                        principalLocation.setSealId(userSealId);
-                        principalLocation.setDocumentId(documentId);
-                        principalLocation.setPage("0");
-                        principalLocation.setRectType("SEAL_CORPORATE");
-                        principalLocation.setKeywordIndex(-1);
-                        principalLocation.setOffsetX("0.5971");
-                        principalLocation.setOffsetY("0.8176");
-                        locations.add(principalLocation);
-                    }
+    /**
+     * 根据项目id修改项目组成员信息
+     * 注:项目id必须不为空
+     * @param cwProjectRecordsDTO
+     * @return
+     */
+    public ResponseEntity updateMembers(CwProjectRecordsDTO cwProjectRecordsDTO) {
+        if (CollectionUtil.isNotEmpty(cwProjectRecordsDTO.getCwProjectMembersDTOList())) {
+            List<String> liveIds = cwProjectRecordsDTO.getCwProjectMembersDTOList().stream().filter(item -> {
+                if (StringUtils.isNotBlank(item.getId())) {
+                    return true;
+                }
+                return false;
+            }).map(CwProjectMembersDTO::getId).collect(Collectors.toList());
+            if (CollectionUtil.isNotEmpty(liveIds)) {
+                cwProjectMembersService.remove(new QueryWrapper<CwProjectMembers>().lambda()
+                        .eq(CwProjectMembers::getProjectId,cwProjectRecordsDTO.getId())
+                        .notIn(CwProjectMembers::getId,liveIds));
+
+            } else {
+                cwProjectMembersService.remove(new QueryWrapper<CwProjectMembers>().lambda().eq(CwProjectMembers::getProjectId,cwProjectRecordsDTO.getId()));
+            }
+            List<CwProjectMembers> updateBatchById = new ArrayList<>();
+            List<CwProjectMembers> insertBatchById = new ArrayList<>();
+            cwProjectRecordsDTO.getCwProjectMembersDTOList().stream().forEach(item->{
+                item.setProjectId(cwProjectRecordsDTO.getId());
+                if (StringUtils.isNotBlank(item.getId())){
+                    // 有id进行修改操作
+                    updateBatchById.add(CwProjectMembersWrapper.INSTANCE.toEntity(item));
                 }else{
-                    hashMap.put("code","2");
-                    hashMap.put("message","查询不到江苏兴光项目管理有限公司公章信息!请联系管理员");
-                    return hashMap;
+                    // 无id进行新增操作
+                    insertBatchById.add(CwProjectMembersWrapper.INSTANCE.toEntity(item));
                 }
+            });
+            // 批量根据id修改数据
+            if (CollectionUtil.isNotEmpty(updateBatchById)){
+                cwProjectMembersService.updateBatchById(updateBatchById);
             }
-        }else{
-            hashMap.put("code","2");
-            hashMap.put("message","查询不到江苏兴光项目管理有限公司公章信息!请联系管理员");
-            return hashMap;
-        }
-
-        List<String> serialIdList = new ArrayList<String>(serialIdSet);
-        companyAction.setSealIds("[" + String.join(",", serialIdList) + "]");
-        //判定该action是否采用自动签署
-        companyAction.setAutoSign("false");
-        companyAction.setLocations(locations);
-        actions.add(companyAction);
-
-        //创建个人职业章参数
-        Action professionalChapterAction = new Action();
-        professionalChapterAction.setType("PRACTICE");
-        professionalChapterAction.setName("杨荣华个人职业章");
-        professionalChapterAction.setSerialNo("1");
-
-        //添加盖章位置
-        List<Location> professionalChapterLocations = Lists.newArrayList();
-
-        Set<String> professionalChapterSerialIdSet = new HashSet<>();
-
-        //添加个人职业章人员信息
-        ActionOperatorInfo actionOperatorInfo = new ActionOperatorInfo();
-        actionOperatorInfo.setOperatorContact("15240492484");//个人职业章盖章人的手机号
-        List<ActionOperatorInfo> actionOperators = Lists.newArrayList();
-        actionOperators.add(actionOperatorInfo);
-        professionalChapterAction.setActionOperators(actionOperators);
-
-        //获取成员印章id信息
-        long s1=System.currentTimeMillis();
-        String userSealId = SignaturePostUtil.getUserSealByMobile("15240492484","","杨荣华个人签名");
-        long s2=System.currentTimeMillis();
-        System.out.println("第三个人员印章获取时间:" + (s2 - s1));
-        if(StringUtils.isNotBlank(userSealId)){
-        }else{
-            hashMap.put("code","2");
-            hashMap.put("message","查询不到项目负责人 的印章信息!请联系管理员");
-            return hashMap;
+            // 批量新增数据
+            if (CollectionUtil.isNotEmpty(insertBatchById)){
+                cwProjectMembersService.saveBatch(insertBatchById);
+            }
+        } else {
+            cwProjectMembersService.remove(new QueryWrapper<CwProjectMembers>().lambda().eq(CwProjectMembers::getProjectId,cwProjectRecordsDTO.getId()));
         }
-
-        List<String> serialIdsList = new ArrayList<String>(professionalChapterSerialIdSet);
-        professionalChapterAction.setSealIds("[" + String.join(",", serialIdsList) + "]");
-        professionalChapterAction.setLocations(professionalChapterLocations);
-        net.sf.json.JSONObject professionalChapterJson = net.sf.json.JSONObject.fromObject(professionalChapterAction);
-        System.out.println(professionalChapterJson.toString());
-        actions.add(professionalChapterAction);
-
-
-
-
-        //创建个人职业章参数
-        Action professionalChapterTwoAction = new Action();
-        professionalChapterTwoAction.setType("PRACTICE");
-        professionalChapterTwoAction.setName("刘建春个人职业章");
-        professionalChapterTwoAction.setSerialNo("2");
-
-        //添加盖章位置
-        List<Location> professionalChapterTwoLocations = Lists.newArrayList();
-
-        Set<String> professionalChapterTwoSerialIdSet = new HashSet<>();
-
-        //添加个人职业章人员信息
-        ActionOperatorInfo actionTwoOperatorInfo = new ActionOperatorInfo();
-        actionTwoOperatorInfo.setOperatorContact("13398782899");
-        List<ActionOperatorInfo> actionTwoOperators = Lists.newArrayList();
-        actionTwoOperators.add(actionTwoOperatorInfo);
-        professionalChapterTwoAction.setActionOperators(actionTwoOperators);
-
-        //获取成员印章id信息
-        long s3=System.currentTimeMillis();
-        String userSealId2 = SignaturePostUtil.getUserSealByMobile("13398782899","","杨荣华个人签名章");
-        long s4=System.currentTimeMillis();
-        System.out.println("第四个人员印章获取时间:" + (s4 - s3));
-
-        serialIdsList = new ArrayList<String>(professionalChapterTwoSerialIdSet);
-        professionalChapterTwoAction.setSealIds("[" + String.join(",", serialIdsList) + "]");
-        professionalChapterTwoAction.setLocations(professionalChapterTwoLocations);
-        professionalChapterJson = net.sf.json.JSONObject.fromObject(professionalChapterTwoAction);
-        System.out.println(professionalChapterJson.toString());
-        actions.add(professionalChapterTwoAction);
-
-
-
-        //创建签署方信息表
-        List<SignatorieInfo> signatories = Lists.newArrayList();
-        SignatorieInfo signatorieInfo1 = new SignatorieInfo();
-        signatorieInfo1.setSerialNo("1");
-        signatorieInfo1.setTenantName("江苏兴光项目管理有限公司");
-        signatorieInfo1.setTenantType("COMPANY");
-        signatorieInfo1.setActions(actions);
-        signatories.add(signatorieInfo1);
-        SignatureContract signatureContract = new SignatureContract();
-        signatureContract.setDocuments(documentList);
-        //审定单用印流程id
-        signatureContract.setCategoryId(APPROVALCATEGORYID);
-        signatureContract.setSend(true);
-        signatureContract.setSignatories(signatories);
-        signatureContract.setSn("");
-        signatureContract.setSubject(ruralProjectRecords.getProjectName());//添加项目名称
-        net.sf.json.JSONObject json = net.sf.json.JSONObject.fromObject(signatureContract);
-        System.out.println(json.toString());
-        long s5=System.currentTimeMillis();
-        System.out.println(json.toString());
-        String contractIdMapStr = SignaturePostUtil.sendPostApplicationJson(HTTPTOP + "/contract/createbycategory", json.toString());
-        long s6=System.currentTimeMillis();
-        System.out.println("获取合同id获取时间:" + (s6 - s5));
-        hashMap = JSON.parseObject(contractIdMapStr, HashMap.class);
-
-
-        return hashMap;
-    }*/
-
+        return ResponseEntity.ok("操作成功");
+    }
 
     /**
-     * 审定单签章回调操作(个人职业章盖章)
-     * @param presignCallBack  回调参数
+     * 查询当前登录人创建的项目以及所属项目组的项目
      * @return
      */
-    /*@RequestMapping(value = "/getApprovalCallBackCoordinates", method= RequestMethod.POST)
-    public String getApprovalCallBackCoordinates(PresignCallBack presignCallBack) throws Exception {
-
-        Jedis jedis = JedisUtils.getResource();
-        String contractIdRedis = jedis.get("qiyuesuo" + presignCallBack.getContractId());
-        String auditUsersStr = jedis.get("qiyuesuoAuditUserList" + presignCallBack.getContractId());
-        Gson gson = new Gson();
-        ProjectApprovalSignature projectApprovalSignature1 = gson.fromJson(contractIdRedis, ProjectApprovalSignature.class);
-
-        Type listType = new TypeToken<ArrayList<User>>(){}.getType();
-        List<User> auditUserList = new Gson().fromJson(auditUsersStr, listType);
-
-        //根据contractId查询对应的报告信息
-        ProjectReportData projectReportData = projectReportDataService.getReportDataByProjectId(projectApprovalSignature1.getProjectId());
-
-        if(null == projectReportData){
-            return null;
-        }
-        //根据项目id查询对应的审定单数据状态是否是已经被送审或者 是否存在值
-        ProjectApprovalSignature projectApprovalSignature = ruralProjectMessageElectronicSealService.getProjectApprovalSignature(projectReportData.getProject().getId());
-        projectApprovalSignature1.setCreateBy(projectApprovalSignature.getCreateBy());
-
-        //对流程数据进行处理
-        approvalSaveAudit(projectApprovalSignature1,auditUserList);
-
-        return null;
-    }*/
+    public ResponseEntity<List<String>> getHaveProjectIds(){
+        UserDTO userDTO = UserUtils.getCurrentUserDTO();
+        return ResponseEntity.ok(cwProjectRecordsMapper.getHaveProjectIds(userDTO));
+    }
 
 }

+ 36 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/service/dto/CwManHourManagementDTO.java

@@ -0,0 +1,36 @@
+package com.jeeplus.test.cw.projectRecords.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;
+
+/**
+ * @author: 徐滕
+ * @version: 2022-12-06 16:38
+ */
+@Data
+public class CwManHourManagementDTO extends BaseDTO {
+
+    private String projectId;   //项目id
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date planStartDate; //计划开始时间
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date planEndDate;   //计划结束时间
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date[] planDate;    //项目预计时间
+    private String status;  //工时确认状态
+    private String statusStr;  //工时确认状态
+
+    private String projectName; //项目名称
+    private String projectNumber;   //项目编号
+    private String projectMasterId; //项目经理
+    private String projectMasterName;   //项目经理姓名
+    private String createId;   //创建人id
+    private Date[] createDates;   //时间查询
+}

+ 73 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/service/dto/CwProjectClientContactDTO.java

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

+ 38 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/service/dto/CwProjectMembersDTO.java

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

+ 55 - 4
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/service/dto/CwProjectRecordsDTO.java

@@ -1,6 +1,7 @@
 package com.jeeplus.test.cw.projectRecords.service.dto;
 
 import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.jeeplus.core.query.Query;
 import com.jeeplus.core.query.QueryType;
@@ -62,15 +63,15 @@ public class CwProjectRecordsDTO extends BaseDTO {
     /**
      * 项目计划开始时间
      */
-    @DateTimeFormat(pattern = "yyyy-MM-dd")
-    @JsonFormat(pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date planStartDate;
 
     /**
      * 项目计划结束时间
      */
-    @DateTimeFormat(pattern = "yyyy-MM-dd")
-    @JsonFormat(pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date planEndDate;
 
     /**
@@ -168,4 +169,54 @@ public class CwProjectRecordsDTO extends BaseDTO {
     @Excel(name = "创建时间",exportFormat = "yyyy-MM-dd HH:mm:ss",width = 25,orderNum = "4")
     private String createDateT;
 
+    /**
+     * 业务类型
+     */
+    private String businessType;
+
+    /**
+     * 风险等级
+     */
+    private String riskLevel;
+
+    /**
+     * 业务类型名称
+     */
+    private String businessTypeName;
+
+    /**
+     * 项目预计时间
+     */
+    private Date[] planDate;
+
+    /**
+     * 项目实际责任人
+     */
+    private String realHeader;
+
+    /**
+     * 合同委托人
+     */
+    private String clientContactsName;
+
+    /**
+     * 报备类型
+     */
+    private String reportType;
+
+    /**
+     * 客户联系人
+     */
+    private List<CwProjectClientContactDTO> cwProjectClientContactDTOList;
+
+    /**
+     * 项目组成员
+     */
+    private List<CwProjectMembersDTO> cwProjectMembersDTOList;
+
+    /**
+     * 项目组成员数量
+     */
+    private String memberCount;
+
 }

+ 18 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/service/mapstruct/CwManHourManagementWrapper.java

@@ -0,0 +1,18 @@
+package com.jeeplus.test.cw.projectRecords.service.mapstruct;
+
+import com.jeeplus.core.mapstruct.EntityWrapper;
+import com.jeeplus.test.cw.projectRecords.domain.CwManHourManagement;
+import com.jeeplus.test.cw.projectRecords.domain.CwProjectRecords;
+import com.jeeplus.test.cw.projectRecords.service.dto.CwManHourManagementDTO;
+import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectRecordsDTO;
+import org.mapstruct.Mapper;
+import org.mapstruct.ReportingPolicy;
+import org.mapstruct.factory.Mappers;
+
+
+@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {})
+public interface CwManHourManagementWrapper extends EntityWrapper<CwManHourManagementDTO, CwManHourManagement> {
+
+    CwManHourManagementWrapper INSTANCE = Mappers.getMapper(CwManHourManagementWrapper.class);
+
+}

+ 18 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/service/mapstruct/CwProjectClientContactWrapper.java

@@ -0,0 +1,18 @@
+package com.jeeplus.test.cw.projectRecords.service.mapstruct;
+
+import com.jeeplus.core.mapstruct.EntityWrapper;
+import com.jeeplus.test.cw.projectRecords.domain.CwProjectClientContact;
+import com.jeeplus.test.cw.projectRecords.domain.CwProjectRecords;
+import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectClientContactDTO;
+import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectRecordsDTO;
+import org.mapstruct.Mapper;
+import org.mapstruct.ReportingPolicy;
+import org.mapstruct.factory.Mappers;
+
+
+@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {})
+public interface CwProjectClientContactWrapper extends EntityWrapper<CwProjectClientContactDTO, CwProjectClientContact> {
+
+    CwProjectClientContactWrapper INSTANCE = Mappers.getMapper(CwProjectClientContactWrapper.class);
+
+}

+ 18 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectRecords/service/mapstruct/CwProjectMembersWrapper.java

@@ -0,0 +1,18 @@
+package com.jeeplus.test.cw.projectRecords.service.mapstruct;
+
+import com.jeeplus.core.mapstruct.EntityWrapper;
+import com.jeeplus.test.cw.projectRecords.domain.CwProjectMembers;
+import com.jeeplus.test.cw.projectRecords.domain.CwProjectRecords;
+import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectMembersDTO;
+import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectRecordsDTO;
+import org.mapstruct.Mapper;
+import org.mapstruct.ReportingPolicy;
+import org.mapstruct.factory.Mappers;
+
+
+@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {})
+public interface CwProjectMembersWrapper extends EntityWrapper<CwProjectMembersDTO, CwProjectMembers> {
+
+    CwProjectMembersWrapper INSTANCE = Mappers.getMapper(CwProjectMembersWrapper.class);
+
+}

+ 104 - 18
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/controller/CwProjectReportController.java

@@ -13,6 +13,8 @@ import com.jeeplus.flowable.service.FlowTaskService;
 import com.jeeplus.sys.constant.enums.LogTypeEnum;
 import com.jeeplus.sys.utils.DictUtils;
 import com.jeeplus.sys.utils.UserUtils;
+import com.jeeplus.test.cw.invoice.service.dto.CwFinanceInvoiceDTO;
+import com.jeeplus.test.cw.projectReport.domain.CwProjectReport;
 import com.jeeplus.test.cw.projectReport.domain.CwProjectReportData;
 import com.jeeplus.test.cw.projectReport.domain.CwProjectReportSignature;
 import com.jeeplus.test.cw.projectReport.mapper.ProjectReportWorkAttachmentMapper;
@@ -140,32 +142,46 @@ public class CwProjectReportController {
     }
 
     /**
-     * 签章流程审核通过
+     * 签章链接
      * @param cwProjectReportData
      * @return
      */
-    @ApiLog(value = "签章流程审核通过", type = LogTypeEnum.SAVE)
+    @ApiLog(value = "签章链接", type = LogTypeEnum.SAVE)
     @PostMapping("saveFlowableParam")
     public ResponseEntity<String> saveFlowableParam(@Valid @RequestBody CwProjectReportData cwProjectReportData) {
         //查询报告文件信息(电子章)
-        List<WorkAttachment> fileList = attachmentMapper.selectWorkAttachmentByReportId(cwProjectReportData.getId());
+//        List<WorkAttachment> fileList = attachmentMapper.selectWorkAttachmentByReportId(cwProjectReportData.getId());
         // 有电子章的附件时,走签章流程
-        if (CollectionUtil.isNotEmpty(fileList)) {
-            CwProjectReportData cwProjectReportDto = projectReportService.queryById(cwProjectReportData.getId());
-            // 获取签章页面url
-            String mobile = UserUtils.getCurrentUserDTO().getMobile();
-            String signatureContractUrl = SignaturePostUtil.getSignatureContractUrl(cwProjectReportDto.getSignatureContractId(), mobile);
-            // 将数据存储到redis中,key为contractId
-            cwProjectReportData.getCommitParamDTO().setVars(cwProjectReportDto);
-            redisUtils.set("cw_report_signature_" + cwProjectReportDto.getSignatureContractId(),cwProjectReportData.getCommitParamDTO());
-            redisUtils.expire("cw_report_signature_" + cwProjectReportDto.getSignatureContractId(),24, TimeUnit.HOURS);
-            return ResponseEntity.ok(signatureContractUrl);
-        } else {
-            // 没有电子章的附件时,走正常审核流程
-            // 流程审核通过
-            projectReportService.commitFlowable(cwProjectReportData);
-            return ResponseEntity.ok("操作成功");
+//        if (CollectionUtil.isNotEmpty(fileList)) {
+//            CwProjectReportData cwProjectReportDto = projectReportService.queryById(cwProjectReportData.getId());
+//            // 获取签章页面url
+//            String mobile = UserUtils.getCurrentUserDTO().getMobile();
+//            String signatureContractUrl = SignaturePostUtil.getSignatureContractUrl(cwProjectReportDto.getSignatureContractId(), mobile);
+//            // 将数据存储到redis中,key为contractId
+//            cwProjectReportData.getCommitParamDTO().setVars(cwProjectReportDto);
+//            redisUtils.set("cw_report_signature_" + cwProjectReportDto.getSignatureContractId(),cwProjectReportData.getCommitParamDTO());
+//            redisUtils.expire("cw_report_signature_" + cwProjectReportDto.getSignatureContractId(),24, TimeUnit.HOURS);
+//            return ResponseEntity.ok(signatureContractUrl);
+//        } else {
+//            // 没有电子章的附件时,走正常审核流程
+//            // 流程审核通过
+//            projectReportService.commitFlowable(cwProjectReportData);
+//            return ResponseEntity.ok("操作成功");
+//        }
+
+        CwProjectReportData cwProjectReportDto = projectReportService.queryById(cwProjectReportData.getId());
+        // 获取签章页面url
+        String mobile = UserUtils.getCurrentUserDTO().getMobile();
+        String signatureContractUrl = SignaturePostUtil.getSignatureContractUrl(cwProjectReportDto.getSignatureContractId(), mobile);
+        // 将数据存储到redis中,key为contractId
+        if("1".equals(cwProjectReportDto.getSignatureType())) {
+            redisUtils.set("cw_report_signature_" + cwProjectReportDto.getSignatureContractId(),cwProjectReportDto.getSid1());
         }
+        if("2".equals(cwProjectReportDto.getSignatureType())) {
+            redisUtils.set("cw_report_signature_" + cwProjectReportDto.getSignatureContractId(),cwProjectReportDto.getSid2());
+        }
+        redisUtils.expire("cw_report_signature_" + cwProjectReportDto.getSignatureContractId(),24, TimeUnit.HOURS);
+        return ResponseEntity.ok(signatureContractUrl);
     }
 
     /**
@@ -285,4 +301,74 @@ public class CwProjectReportController {
         }
         EasyPoiUtil.exportExcel ( result, "报告信息",  options.getSheetName ( ), CwProjectReportData.class, fileName, response );
     }
+
+
+
+    /**
+     * 根据报告签章id查询签章审核节点信息
+     * @param id
+     * @return
+     */
+    @ApiLog("根据报告签章id查询签章审核节点信息")
+    @GetMapping("getAuditNodeByReportId")
+    public ResponseEntity getAuditNodeByReportId(@RequestParam("id") String id) {
+        Map<String, Object> auditNodeByReportId = projectReportService.getAuditNodeByReportId(id);
+        return ResponseEntity.ok (auditNodeByReportId);
+    }
+
+
+
+    /**
+     * 根据报告签章id查询签章审核节点信息
+     * @param id
+     * @return
+     */
+    @ApiLog("根据报告签章id查询签章审核节点信息")
+    @GetMapping("getSignatureTypeById")
+    public ResponseEntity getSignatureTypeById(@RequestParam("id") String id,@RequestParam("signatureType") String signatureType) {
+        Map<String, Object> signatureTypeById = projectReportService.getSignatureTypeById(id, signatureType);
+        return ResponseEntity.ok (signatureTypeById);
+    }
+
+    /**
+     * 根据客户id查询关联报告
+     * @param clientId
+     * @param cwProjectReport
+     * @return
+     * @throws Exception
+     */
+    @GetMapping("getIdByClientId")
+    @ApiOperation(value = "根据客户id查询关联报告")
+    public ResponseEntity<List<CwProjectReport>> getIdByClientId(String clientId, CwProjectReport cwProjectReport) throws Exception {
+        List<CwProjectReport> cwProjectReportList = projectReportService.getIdByClientId(clientId, cwProjectReport);
+        return ResponseEntity.ok(cwProjectReportList);
+    }
+
+    /**
+     * 根据项目id查询关联报告
+     * @param projectId
+     * @param cwProjectReport
+     * @return
+     * @throws Exception
+     */
+    @GetMapping("getIdByProjectId")
+    @ApiOperation(value = "根据项目id查询关联报告")
+    public ResponseEntity<List<CwProjectReport>> getIdByProjectId(String projectId, CwProjectReport cwProjectReport) throws Exception {
+        List<CwProjectReport> cwProjectReportList = projectReportService.getIdByProjectId(projectId, cwProjectReport);
+        return ResponseEntity.ok(cwProjectReportList);
+    }
+
+    /**
+     * 根据合同id查询关联报告
+     * @param contractId
+     * @param cwProjectReport
+     * @return
+     * @throws Exception
+     */
+    @GetMapping("getIdByContractId")
+    @ApiOperation(value = "根据合同id查询关联报告")
+    public ResponseEntity<List<CwProjectReport>> getIdByContractId(String contractId, CwProjectReport cwProjectReport) throws Exception {
+        List<CwProjectReport> cwProjectReportList = projectReportService.getIdByContractId(contractId, cwProjectReport);
+        return ResponseEntity.ok(cwProjectReportList);
+    }
 }

+ 81 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/controller/CwProjectReportReviewController.java

@@ -0,0 +1,81 @@
+package com.jeeplus.test.cw.projectReport.controller;
+
+import com.jeeplus.aop.logging.annotation.ApiLog;
+import com.jeeplus.common.utils.ResponseUtil;
+import com.jeeplus.sys.constant.enums.LogTypeEnum;
+import com.jeeplus.test.cw.projectReport.domain.CwProjectReportData;
+import com.jeeplus.test.cw.projectReport.service.CwProjectReportReviewService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.validation.Valid;
+import java.lang.reflect.InvocationTargetException;
+import java.util.List;
+
+/**
+ * @author: 王强
+ * @create: 2022-12-12 14:45
+ **/
+@RestController
+@Api(tags ="报告审核校对")
+@RequestMapping(value = "/projectReport/review")
+public class CwProjectReportReviewController {
+
+    @Resource
+    private CwProjectReportReviewService service;
+
+    /**
+     * 保存财务报告信息-流程
+     * @param reportData
+     * @return
+     */
+    @ApiLog(value = "保存财务报告信息-流程", type = LogTypeEnum.SAVE)
+    @PreAuthorize("hasAnyAuthority('cwProjectReportReview:add','cwProjectReportReview:edit')")
+    @PostMapping("saveForm")
+    public ResponseEntity saveForm(@Valid @RequestBody CwProjectReportData reportData) throws Exception {
+        String id = service.saveForm(reportData);
+        return ResponseUtil.newInstance().add("businessTable", "cw_project_report_review").add("businessId", id).ok ("操作成功");
+    }
+
+    /**
+     * 根据id修改状态值status
+     * @param data
+     * @return
+     */
+    @ApiOperation(value = "根据id修改状态值status")
+    @PostMapping(value = "/updateReviewStatysByReportId")
+    public ResponseEntity<String> updateReviewStatysByReportId(@RequestBody CwProjectReportData data) {
+        String s = service.updateReviewStatysByReportId(data);
+        return ResponseEntity.ok(s);
+    }
+
+    /**
+     * 查询客户信息数据
+     * @param id
+     * @return
+     */
+    @ApiLog("查询财务报告数据")
+    @PreAuthorize ("hasAnyAuthority('cwProjectReport:view','cwProjectReport:add','cwProjectReport:edit')")
+    @GetMapping("queryByReportId")
+    public ResponseEntity queryByReportId(@RequestParam("id") String id) throws IllegalAccessException, NoSuchMethodException, InvocationTargetException {
+        CwProjectReportData projectReportData = service.queryByReportId(id);
+        return ResponseEntity.ok (projectReportData);
+    }
+
+    /**
+     * 查询客户信息数据
+     * @param procInsId
+     * @return
+     */
+    @ApiLog("查询财务报告数据")
+    @PreAuthorize ("hasAnyAuthority('cwProjectReport:view','cwProjectReport:add','cwProjectReport:edit')")
+    @GetMapping("getProcessStatus")
+    public ResponseEntity getProcessStatus(@RequestParam("procInsId") String procInsId) throws IllegalAccessException, NoSuchMethodException, InvocationTargetException {
+        String taskName = service.getProcessStatus(procInsId);
+        return ResponseEntity.ok (taskName);
+    }
+}

+ 110 - 34
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/controller/CwProjectReportSignatureCallBackController.java

@@ -14,20 +14,26 @@ import com.jeeplus.flowable.model.Flow;
 import com.jeeplus.flowable.service.FlowTaskService;
 import com.jeeplus.sys.utils.Global;
 import com.jeeplus.sys.utils.SpringContextHolder;
+import com.jeeplus.sys.utils.UserUtils;
 import com.jeeplus.test.cw.common.flowable.dto.CommitParamDTO;
 import com.jeeplus.test.cw.projectRecords.domain.CwProjectRecords;
 import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectRecordsDTO;
 import com.jeeplus.test.cw.projectReport.domain.CwProjectReport;
 import com.jeeplus.test.cw.projectReport.domain.CwProjectReportData;
+import com.jeeplus.test.cw.projectReport.domain.CwProjectReportFile;
 import com.jeeplus.test.cw.projectReport.domain.CwProjectReportSignature;
+import com.jeeplus.test.cw.projectReport.mapper.CwProjectReportMapper;
 import com.jeeplus.test.cw.projectReport.mapper.CwProjectReportSignatureMapper;
 import com.jeeplus.test.cw.projectReport.mapper.ProjectReportWorkAttachmentMapper;
 import com.jeeplus.test.cw.projectReport.service.CwProjectReportService;
+import com.jeeplus.test.cw.projectReport.service.dto.CwProjectReportSignatureDTO;
 import com.jeeplus.test.oss.domain.WorkAttachment;
+import com.jeeplus.test.oss.mapper.OssServiceMapper;
 import com.jeeplus.test.oss.service.OSSClientService;
 import com.jeeplus.test.signature.domain.PresignCallBack;
 import com.jeeplus.test.signature.utils.SignaturePostUtil;
 import org.apache.commons.lang3.StringUtils;
+import org.flowable.bpmn.model.FlowNode;
 import org.flowable.engine.TaskService;
 import org.flowable.task.api.Task;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -61,8 +67,10 @@ public class CwProjectReportSignatureCallBackController {
 
     private CwProjectReportService cwProjectReportService = SpringContextHolder.getBean(CwProjectReportService.class);
     private OSSClientService ossClientService = SpringContextHolder.getBean(OSSClientService.class);
+    private OssServiceMapper ossServiceMapper = SpringContextHolder.getBean(OssServiceMapper.class);
     private CwProjectReportSignatureMapper cwProjectReportSignatureMapper = SpringContextHolder.getBean(CwProjectReportSignatureMapper.class);
     private ProjectReportWorkAttachmentMapper attachmentMapper = SpringContextHolder.getBean(ProjectReportWorkAttachmentMapper.class);
+    private CwProjectReportMapper reportMapper = SpringContextHolder.getBean(CwProjectReportMapper.class);
 
     private static final String HTTPTOP = Global.getConfig("signature_http_top");
 
@@ -85,7 +93,35 @@ public class CwProjectReportSignatureCallBackController {
      */
     @RequestMapping(value = "/getApprovalCallBackCoordinates", method= RequestMethod.POST)
     public String getApprovalCallBackCoordinates(PresignCallBack presignCallBack, HttpServletResponse response) throws Exception {
-        // 在redis中取回流程审核所需的参数
+        //查询报告签章id
+        String id = (String) redisUtils.get("cw_report_signature_" + presignCallBack.getContractId());
+
+        CwProjectReportSignature reportSignature = new CwProjectReportSignature();
+        reportSignature.setId(id);
+        //查询流程id
+        String processInstanceId = reportMapper.getProcessInstanceIdById(id);
+        if(com.jeeplus.sys.utils.StringUtils.isNotBlank(processInstanceId)){
+            //根据流程id查询流程当前节点信息
+            FlowNode currentTask = flowTaskService.getCurrentTask(processInstanceId);
+            if(null != currentTask && com.jeeplus.sys.utils.StringUtils.isNotBlank(currentTask.getName())){
+                switch (currentTask.getName()){
+                    case "签字注师1审核":
+                        reportSignature.setSignatureAnnotator1Status("1");
+                        cwProjectReportService.updateSignatureType(reportSignature);
+                        break;
+                    case "签字注师2审核":
+                        reportSignature.setSignatureAnnotator2Status("1");
+                        cwProjectReportService.updateSignatureType(reportSignature);
+                        break;
+                    case "签章管理人审核":
+                        reportSignature.setSealAdminStatus("1");
+                        cwProjectReportService.updateSignatureType(reportSignature);
+                        break;
+                }
+            }
+        }
+
+        /*// 在redis中取回流程审核所需的参数
         CommitParamDTO<CwProjectReportData> commitParamDTO = (CommitParamDTO<CwProjectReportData>)redisUtils.get("cw_report_signature_" + presignCallBack.getContractId());
         // 将取回的数据转换为审核通过所需要的参数
         Map<String, Object> vars = Maps.newHashMap();
@@ -138,7 +174,7 @@ public class CwProjectReportSignatureCallBackController {
                 cwProjectReportSignature.setStatus("5");
                 cwProjectReportSignatureMapper.updateById(cwProjectReportSignature);
             }
-        }
+        }*/
         // 删除redis中的数据
         redisUtils.delete("cw_report_signature_" + presignCallBack.getContractId());
 
@@ -235,45 +271,85 @@ public class CwProjectReportSignatureCallBackController {
 
             File[] unZipFileList = unZipFile.listFiles();
 
-            for (File f : unZipFileList) {
-                String filepath = "";
-                //取得上传文件
-                //将文件上传到oss云盘中
-                MultipartFile cMultiFile = new MockMultipartFile("file", f.getName(), null, new FileInputStream(f));
-                if (cMultiFile != null && !cMultiFile.isEmpty()) {
-                    // 文件保存路径
-                    String realPath =DIRECTORY.replace("/","")+"/cw_project_report_file"+ossClientService.datePath()+"/"+ System.currentTimeMillis();
-                    //文件原名称
-                    String newName = cMultiFile.getOriginalFilename();
-                    newName = newName.substring(13, newName.length());
-                    ossClientService.uploadFile2OSS(cMultiFile.getInputStream(),realPath,newName);
-                    filepath = "/" + realPath + newName;
-                }
-
-                System.out.println(f.getName());
-                //截取文件后缀名
-                String substring = f.getName().substring(f.getName().lastIndexOf(".")+1, f.getName().length());
-                //遍历该contractId对应的报告信息,将报告信息中的附件地址进行替换
+            if(null != unZipFileList && unZipFileList.length>0){
+                for (File f : unZipFileList) {
+                    String filepath = "";
+                    //取得上传文件
+                    //将文件上传到oss云盘中
+                    MultipartFile cMultiFile = new MockMultipartFile("file", f.getName(), null, new FileInputStream(f));
+                    if (!cMultiFile.isEmpty()) {
+                        // 文件保存路径
+                        String realPath =DIRECTORY.replace("/","")+"/cw_project_report_file"+ossClientService.datePath()+"/"+ System.currentTimeMillis();
+                        //文件原名称
+                        String newName = cMultiFile.getOriginalFilename();
+                        if(StringUtils.isNotBlank(newName)){
+                            newName = newName.substring(13, newName.length());
+                            ossClientService.uploadFile2OSS(cMultiFile.getInputStream(),realPath,newName);
+                            filepath = "/" + realPath + newName;
+                        }
+                    }
 
-                //查询报告文件信息(电子章)
-                List<WorkAttachment> fileList = attachmentMapper.selectWorkAttachmentByReportId(projectReportData.getId());
-                if(fileList.size()>0){
-                    for (WorkAttachment workattachment : fileList) {
-                        //根据url截取文件名成
-                        String workattachmentName = workattachment.getUrl().substring(workattachment.getUrl().lastIndexOf("/")+1, workattachment.getUrl().length());
+                    System.out.println(f.getName());
+                    //截取文件后缀名
+                    String substring = f.getName().substring(f.getName().lastIndexOf(".")+1, f.getName().length());
+
+                    String newFileName = f.getName().substring(13, f.getName().length());
+
+                    //将签章完成的附件进行保存到附件表中
+                    WorkAttachment workattachment = new WorkAttachment();
+                    workattachment.setDelFlag(0);
+                    workattachment.setUrl(filepath);
+                    workattachment.setType(substring);
+                    workattachment.setAttachmentName(newFileName);
+                    workattachment.setAttachmentFlag("cw_project_report_file");
+                    workattachment.setFileSize(String.valueOf(f.length()));
+                    workattachment.setAttachmentId(projectReportData.getId());
+                    workattachment.setAttachmentType("");
+                    String id = UUID.randomUUID().toString().replace("-", "");
+                    workattachment.setId(id);
+                    workattachment.setCreateDate(new Date());
+                    workattachment.setUpdateDate(new Date());
+                    //先查询数据库中是否已经对数据进行保存
+                    //若未保存,则进行保存,否则直接跳过
+                    List<WorkAttachment> byAttachmentIdAndUrl = ossServiceMapper.getByAttachmentIdAndUrl(workattachment);
+                    if(byAttachmentIdAndUrl.size() == 0){
+                        ossServiceMapper.insert(workattachment);
+
+                        //将附件信息添加到签章附件信息表中
+                        CwProjectReportFile cwProjectReportFile = new CwProjectReportFile();
+                        cwProjectReportFile.setDelFlag(0);
+                        cwProjectReportFile.setId(UUID.randomUUID().toString().replace("-", ""));
+                        cwProjectReportFile.setCreateBy(UserUtils.getByLoginName("admin").getId());
+                        cwProjectReportFile.setUpdateBy(UserUtils.getByLoginName("admin").getId());
+                        cwProjectReportFile.setCreateDate(new Date());
+                        cwProjectReportFile.setUpdateDate(new Date());
+                        cwProjectReportFile.setReportFileId(id);
+                        cwProjectReportFile.setFileAffiliation("1");
+                        cwProjectReportService.insertProjectReportFile(cwProjectReportFile);
+                    }
 
-                        if(f.getName().contains(workattachmentName)){
-                            workattachment.setUrl(filepath);
-                            workattachment.setType(substring);
-                            workattachment.setAttachmentName(f.getName());
-                            attachmentMapper.updateByIdOnSignature(workattachment);
+                    //遍历该contractId对应的报告信息,将报告信息中的附件地址进行替换
+
+                    //查询报告文件信息(电子章)
+                    /*List<WorkAttachment> fileList = attachmentMapper.selectWorkAttachmentByReportId(projectReportData.getId());
+                    if(fileList.size()>0){
+                        for (WorkAttachment workattachment : fileList) {
+                            //根据url截取文件名成
+                            String workattachmentName = workattachment.getUrl().substring(workattachment.getUrl().lastIndexOf("/")+1, workattachment.getUrl().length());
+
+                            if(f.getName().contains(workattachmentName)){
+                                workattachment.setUrl(filepath);
+                                workattachment.setType(substring);
+                                workattachment.setAttachmentName(f.getName());
+                                attachmentMapper.updateByIdOnSignature(workattachment);
+                            }
                         }
-                    }
+                    }*/
                 }
             }
 
             //将报告数据中的盖章状态更改为已盖章
-            cwProjectReportService.updateReportSealType(projectReportData);
+            //cwProjectReportService.updateReportSealType(projectReportData);
 
         }catch (Exception e){
             e.printStackTrace();

+ 102 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/domain/CwProjectReport.java

@@ -2,8 +2,10 @@ package com.jeeplus.test.cw.projectReport.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.test.cw.projectReport.service.dto.ProjectReportWorkAttachmentDTO;
 import lombok.Data;
 
 import java.util.Date;
@@ -96,8 +98,12 @@ public class CwProjectReport extends BaseEntity {
     private String status;
 
     //新建行数据
+//    @TableField(exist = false)
+//    List<CwProjectInfoData> cwProjectInfoList;
+
+    //新建行数据
     @TableField(exist = false)
-    List<CwProjectInfoData> cwProjectInfoList;
+    CwProjectInfoData projectInfoData;
 
     @TableField(exist = false)
     private String departmentName; //部门名称
@@ -112,4 +118,99 @@ public class CwProjectReport extends BaseEntity {
      * 签章合同id
      */
     private String signatureContractId;
+
+    /**
+     * 报告实际制作人
+     */
+    private String realCreate;
+
+    /**
+     * 审计收费(元)
+     */
+    private String auditFees;
+
+    /**
+     * 被服务单位名称
+     */
+    @TableField(exist = false)
+    private String servedUnitName;
+
+    /**
+     * 报告日期
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @TableField(exist = false)
+    private Date reportDate;
+
+    /**
+     * 报告类型
+     */
+    @TableField(exist = false)
+    private String reportType;
+
+    /**
+     * 意见类型
+     */
+    @TableField(exist = false)
+    private String opinionType;
+
+    /**
+     * 盖章状态
+     */
+    @TableField(exist = false)
+    private String sealType;
+
+    /**
+     * 附件信息
+     */
+    @TableField(exist = false)
+    List<ProjectReportWorkAttachmentDTO> cwFileInfoList;
+
+    /**
+     * 被服务单位id
+     */
+    @TableField(exist = false)
+    private String servedUnitId;
+
+    /**
+     * 报告流水号
+     */
+    @TableField(exist = false)
+    private String reportNumber;
+    /**
+     * 报告文号
+     */
+    @TableField(exist = false)
+    private String reportNo;
+
+    /**
+     * 所属部门
+     */
+    @TableField(exist = false)
+    private String officeName;
+
+    /**
+     *业务类型
+     */
+    private String businessType;
+
+    /**
+     *审计业务类型
+     */
+    private String auditBusinessType;
+
+    /**
+     *公司注册地址
+     */
+    private String registerAddress;
+
+    /**
+     *业务所在地
+     */
+    private String businessLocation;
+
+    /**
+     *是否数据证券业务
+     */
+    private String securityBusiness;
 }

+ 211 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/domain/CwProjectReportData.java

@@ -2,9 +2,11 @@ package com.jeeplus.test.cw.projectReport.domain;
 
 import cn.afterturn.easypoi.excel.annotation.Excel;
 import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.jeeplus.core.query.Query;
 import com.jeeplus.core.service.dto.BaseDTO;
 import com.jeeplus.test.cw.common.flowable.dto.CommitParamDTO;
+import com.jeeplus.test.cw.projectReport.service.dto.ProjectReportWorkAttachmentDTO;
 import lombok.Data;
 
 import java.util.Date;
@@ -181,7 +183,216 @@ public class CwProjectReportData extends BaseDTO {
     private String sid2;
 
     /**
+     * 实体章流程procInsId
+     */
+    private String procInsIds3;
+
+    /**
+     * 实体章流程processDefinitionId
+     */
+    private String processDefinitionId3;
+
+    /**
+     * 实体章流程status
+     */
+    private String status3;
+
+    /**
+     * 实体章流程表id
+     */
+    private String sid3;
+
+    /**
      * 电子签章文件地址
      */
     private String signatureUrl;
+
+    /**
+     * 报告实际制作人
+     */
+    private String realCreate;
+
+    /**
+     * 审计收费(元)
+     */
+    private String auditFees;
+
+    /**
+     * 为签章附件信息
+     */
+    List<ProjectReportWorkAttachmentDTO> cwFileInfoList;
+
+    /**
+     * 已签章附件信息
+     */
+    List<ProjectReportWorkAttachmentDTO> signatureFileList;
+
+    /**
+     * 被服务单位名称
+     */
+    @TableField(exist = false)
+    private String servedUnitName;
+
+    /**
+     * 报告日期
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @TableField(exist = false)
+    private Date reportDate;
+
+    /**
+     * 报告类型
+     */
+    @TableField(exist = false)
+    private String reportType;
+
+    /**
+     * 意见类型
+     */
+    @TableField(exist = false)
+    private String opinionType;
+
+    /**
+     * 盖章状态
+     */
+    @TableField(exist = false)
+    private String sealType;
+
+    /**
+     * 被服务单位id
+     */
+    private String servedUnitId;
+
+    /**
+     * 报告流水号
+     */
+    private String reportNumber;
+    /**
+     * 报告文号
+     */
+    private String reportNo;
+
+    private String[] contractAmounts;
+
+    /**
+     * 报告复核流程id
+     */
+    private String procInsId3;
+
+    /**
+     * 报告复核流程状态
+     */
+    private String reviewStatus;
+
+    /**
+     *业务类型
+     */
+    private String businessType;
+
+    /**
+     *审计业务类型
+     */
+    private String auditBusinessType;
+
+    /**
+     *公司注册地址
+     */
+    private String registerAddress;
+
+    /**
+     *业务所在地
+     */
+    private String businessLocation;
+
+    /**
+     *是否数据证券业务
+     */
+    private String securityBusiness;
+
+    /**
+     * 复核信息表
+     */
+    private List<CwProofreadDetail> details;
+
+    /*
+    计算机文号
+     */
+    private String computerNo;
+
+    /**
+     * 本报告共印份数
+     */
+    private String allPrintNum;
+
+    /**
+     * 发出份数
+     */
+    private String issueNum;
+
+    /**
+     * 存档份数
+     */
+    private String placeOnFileNum;
+
+    /**
+     * 打印人签名
+     */
+    private String printedBy;
+
+    /**
+     * 校对人签名
+     */
+    private String checkAutograph;
+
+    /**
+     * 财务-报告表id
+     */
+    private String reportId;
+
+    /**
+     * 报告类型及标题
+     */
+    private String reportTitleType;
+
+    /**
+     * 一级复核需提请关注或修改的事项
+     */
+    private String needUpdate1;
+
+    /**
+     * 二级复核需提请关注或修改的事项
+     */
+    private String needUpdate2;
+
+    /**
+     * 三级复核需提请关注或修改的事项
+     */
+    private String needUpdate3;
+
+    /**
+     * 一级复核备注
+     */
+    private String remark1;
+
+    /**
+     * 二级复核备注
+     */
+    private String remark2;
+
+    /**
+     * 三级复核备注
+     */
+    private String remark3;
+
+    /**
+     * 财务-报告编号
+     */
+    private String reportReviewNo;
+
+    /**
+     * 下一个节点审核人信息
+     */
+    List<ReviewUser> reviewBys;
+
+    private String reviewBy;
 }

+ 5 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/domain/CwProjectReportFile.java

@@ -58,4 +58,9 @@ public class CwProjectReportFile extends BaseEntity {
      * 备注信息
      */
     private String remarks;
+
+    /**
+     * 附件归属(0:未盖章签章文件;1:已盖章签章文件)
+     */
+    private String fileAffiliation;
 }

+ 15 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/domain/CwProjectReportSignature.java

@@ -46,4 +46,19 @@ public class CwProjectReportSignature extends BaseEntity {
     private String processDefinitionId;
 
     private static final long serialVersionUID = 1L;
+
+    /**
+     * 签字注师1签章状态
+     */
+    private String signatureAnnotator1Status;
+
+    /**
+     * 签字注师2签章状态
+     */
+    private String signatureAnnotator2Status;
+
+    /**
+     * 盖章管理人签章状态
+     */
+    private String sealAdminStatus;
 }

+ 125 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/domain/CwProjectReview.java

@@ -0,0 +1,125 @@
+package com.jeeplus.test.cw.projectReport.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-12-12 20:37
+ **/
+@Data
+@TableName(value = "cw_project_report_review")
+public class CwProjectReview extends BaseEntity {
+
+    //报告编号基字(字典值)
+    public static final String BIZ_CODE1 = "23";
+
+    //报告编号咨字(字典值)
+    public static final String BIZ_CODE2 = "24";
+
+    //报告编号审字(字典值)
+    public static final String BIZ_CODE3 = "25";
+
+    //报告编号验字(字典值)
+    public static final String BIZ_CODE4 = "26";
+
+    //报告编号特字(字典值)
+    public static final String BIZ_CODE5 = "27";
+
+    /**
+     * 流程id
+     */
+    private String procInsId;
+
+    private String processDefinitionId;
+
+    /**
+     * 报告类型
+     */
+    @TableField(exist = false)
+    private String reportType;
+
+    /**
+     * 状态
+     */
+    private String reviewStatus;
+
+    /**
+     * 本报告共印份数
+     */
+    private String allPrintNum;
+
+    /**
+     * 发出份数
+     */
+    private String issueNum;
+
+    /**
+     * 存档份数
+     */
+    private String placeOnFileNum;
+
+    /**
+     * 打印人签名
+     */
+    private String printedBy;
+
+    /**
+     * 校对人签名
+     */
+    private String checkAutograph;
+
+    /**
+     * 财务-报告表id
+     */
+    private String reportId;
+
+    /**
+     * 财务-报告编号
+     */
+    private String reportReviewNo;
+
+    /**
+     * 报告类型及标题
+     */
+    private String reportTitleType;
+
+    /**
+     * 一级复核需提请关注或修改的事项
+     */
+    private String needUpdate1;
+
+    /**
+     * 二级复核需提请关注或修改的事项
+     */
+    private String needUpdate2;
+
+    /**
+     * 三级复核需提请关注或修改的事项
+     */
+    private String needUpdate3;
+
+    /**
+     * 一级复核备注
+     */
+    private String remark1;
+
+    /**
+     * 二级复核备注
+     */
+    private String remark2;
+
+    /**
+     * 三级复核备注
+     */
+    private String remark3;
+
+    /**
+     * 计算机文号
+     */
+    private String computerNo;
+
+    private String reviewBy;
+}

+ 49 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/domain/CwProofreadDetail.java

@@ -0,0 +1,49 @@
+package com.jeeplus.test.cw.projectReport.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+
+@Data
+@TableName(value = "cw_proofread_detail")
+public class CwProofreadDetail extends BaseEntity {
+
+    /**
+     * 序号
+     */
+    private Integer serialNumber;
+
+    /**
+     * 基本信息
+     */
+    private String infoId;
+
+    /**
+     * 类型id
+     */
+    private String typeId;
+
+    /**
+     * 类型名称
+     */
+    @TableField(exist = false)
+    private String typeName;
+
+    /**
+     * 审核意见
+     */
+    private String reviewComments;
+
+    /**
+     * 回复意见
+     */
+    private String replyComments;
+
+    /**
+     * 序号
+     */
+    @TableField(exist = false)
+    private String sort;
+
+}

+ 16 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/domain/ReviewUser.java

@@ -0,0 +1,16 @@
+package com.jeeplus.test.cw.projectReport.domain;
+
+import lombok.Data;
+
+/**
+ * 下一个节点指定人
+ * @author: 王强
+ * @create: 2022-12-14 16:43
+ **/
+@Data
+public class ReviewUser {
+
+    private String name;
+    private String id;
+    private String sysUserId;
+}

+ 12 - 4
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/CwProjectInfoMapper.java

@@ -21,9 +21,9 @@ public interface CwProjectInfoMapper extends BaseMapper<CwProjectInfoData> {
      */
     void updateSignById(@Param("id") String id, @Param("sign")String sign);
 
-    List<CwProjectInfoData> selectIdByReportId(String id);
+    CwProjectInfoData selectIdByReportId(String id);
 
-    List<CwProjectInfoData> selectByReportId(String id);
+    CwProjectInfoData selectByReportId(String id);
 
     /**
      * 去报废的报告文号表中查报告文号
@@ -31,7 +31,7 @@ public interface CwProjectInfoMapper extends BaseMapper<CwProjectInfoData> {
      */
     List<String> getReportNo();
 
-    List<CwProjectInfoData> selectInfoByReportId(String id);
+    CwProjectInfoData selectInfoByReportId(String id);
 
     /**
      * 根据项目编码查流水号
@@ -68,5 +68,13 @@ public interface CwProjectInfoMapper extends BaseMapper<CwProjectInfoData> {
      * @param id
      * @return
      */
-    List<CwProjectInfoData> getByReportId(String id);
+    CwProjectInfoData getByReportId(String id);
+
+    /**
+     * 根据报告id修改报告文号与报告流水号
+     * @param
+     */
+    void updateByReportId(@Param("reportId")String reportId,
+                          @Param("reportNumber")String reportNumber,
+                          @Param("reportNo")String reportNo);
 }

+ 48 - 3
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/CwProjectReportMapper.java

@@ -5,12 +5,13 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Constants;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.sys.service.dto.UserDTO;
 import com.jeeplus.test.cw.projectRecords.domain.CwProjectRecords;
 import com.jeeplus.test.cw.projectRecords.service.dto.CwProjectRecordsDTO;
-import com.jeeplus.test.cw.projectReport.domain.CwProjectReport;
-import com.jeeplus.test.cw.projectReport.domain.CwProjectReportData;
+import com.jeeplus.test.cw.projectReport.domain.*;
 import com.jeeplus.test.cw.workClientInfo.domain.CwWorkClientBase;
 import com.jeeplus.test.cw.workClientInfo.service.dto.CwWorkClientBaseDTO;
+import com.jeeplus.test.oss.domain.WorkAttachment;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -30,7 +31,11 @@ public interface CwProjectReportMapper extends BaseMapper<CwProjectReport> {
      * @param queryWrapper
      * @return
      */
-    IPage<CwProjectReportData> findList(Page<CwProjectReportData> page, @Param(Constants.WRAPPER) QueryWrapper<CwProjectReportData> queryWrapper);
+    IPage<CwProjectReportData> findList(Page<CwProjectReportData> page, @Param("currentUser") UserDTO currentUser, @Param("isBmzr") String isBmzr, @Param(Constants.WRAPPER) QueryWrapper<CwProjectReportData> queryWrapper);
+
+    List<WorkAttachment> findFileList(@Param("id") String id);
+
+    Integer findIsExit(@Param("id") String id, @Param("name")String name);
 
     CwProjectReportData queryById(@Param("id") String id);
 
@@ -81,4 +86,44 @@ public interface CwProjectReportMapper extends BaseMapper<CwProjectReport> {
      * @return
      */
     List<CwProjectReportData> getByProjectId(String projectId);
+
+    /**
+     * 根据报告签章id查询流程id
+     * @param id
+     * @return
+     */
+    String getProcessInstanceIdById(String id);
+
+    /**
+     * 修改签章流程节点状态
+     * @param repportSignature
+     */
+    void updateSignatureType(CwProjectReportSignature repportSignature);
+
+    /**
+     * 根据id查询报告签章数据信息
+     * @param id
+     * @return
+     */
+    CwProjectReportSignature getReportSignatureById(String id);
+
+    /**
+     * 新增签章附件信息
+     * @param cwProjectReportFile
+     */
+    void insertProjectReportFile(CwProjectReportFile cwProjectReportFile);
+
+    List<String> getIdByProjectId(@Param("id") String id);
+
+    List<String> getIdByClientId(@Param("id") String id);
+
+    List<String> getIdByContractId(@Param("id") String id);
+
+    List<CwProjectReport> getByIds(@Param(Constants.WRAPPER) QueryWrapper<CwProjectReport> queryWrapper);
+
+    /**
+     * 根据报告类型查询指定下一个审核人信息
+     * @return
+     */
+    List<ReviewUser> getReviewByS(String parentId);
 }

+ 21 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/CwProjectReportReviewMapper.java

@@ -0,0 +1,21 @@
+package com.jeeplus.test.cw.projectReport.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.test.cw.projectReport.domain.CwProjectReportData;
+import com.jeeplus.test.cw.projectReport.domain.CwProjectReview;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * @author: 王强
+ * @create: 2022-12-12 20:35
+ **/
+@Mapper
+public interface CwProjectReportReviewMapper extends BaseMapper<CwProjectReview> {
+
+    CwProjectReview selectByReportId(String id);
+
+    void updateReviewStatysByReportId(@Param("reviewStatus") String reviewStatus,@Param("id") String id);
+
+    CwProjectReportData selectByPortId(String id);
+}

+ 19 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/CwProofreadDetailMapper.java

@@ -0,0 +1,19 @@
+package com.jeeplus.test.cw.projectReport.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.test.cw.projectReport.domain.CwProofreadDetail;
+import com.jeeplus.test.proofread.domain.ProofreadDetail;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface CwProofreadDetailMapper extends BaseMapper<CwProofreadDetail> {
+
+    List<CwProofreadDetail> findByInfoId(@Param("id") String id);
+
+    List<CwProofreadDetail> findByReportInfoId(@Param("id") String id);
+
+    List<CwProofreadDetail> findList(@Param("type")String type);
+
+    CwProofreadDetail getByTypeIdAndInfoId(@Param("typeId")String typeId,@Param("infoId")String infoId);
+}

+ 8 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/ProjectReportWorkAttachmentMapper.java

@@ -6,6 +6,7 @@ import com.jeeplus.test.cw.projectReport.domain.CwProjectReportFile;
 import com.jeeplus.test.cw.projectReport.service.dto.ProjectReportWorkAttachmentDTO;
 import com.jeeplus.test.oss.domain.WorkAttachment;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -17,15 +18,21 @@ import java.util.List;
 @Mapper
 public interface ProjectReportWorkAttachmentMapper extends BaseMapper<CwProjectReportFile> {
 
+    void updateFileInfo(ProjectReportWorkAttachmentDTO dto);
+
     List<String> getIdByAttachmentId(String id);
 
+    List<String> getFileId(String id);
+
     void deleteByRepotyId(String id);
 
     void deleteByAttachMnentId(String id);
 
     List<ProjectReportWorkAttachmentDTO> selectByInfoId(String id);
 
-    CwProjectReportFile selectInfoByFileId(String id);
+    List<ProjectReportWorkAttachmentDTO> selectByInfoIdAndNewLineId(String id);
+
+    CwProjectReportFile selectInfoByFileId(@Param("id") String id,@Param("fileType") String fileTType);
 
     /**
      * 查询电子章文件信息

+ 4 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/xml/CwProjectInfoMapper.xml

@@ -4,6 +4,10 @@
     <update id="updateSignById">
         update cw_project_report_new_line set delete_sign = #{sign} where id = #{id}
     </update>
+    <update id="updateByReportId">
+        update cw_project_report_new_line set report_no = #{reportNo}, report_number = #{reportNumber}
+        where report_id = #{reportId}
+    </update>
     <delete id="deleteByReportId">
         update cw_project_report_new_line set del_flag = '1' where report_id = #{id}
     </delete>

+ 0 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/cw/projectReport/mapper/xml/CwProjectReportMapper.xml


Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio