Bladeren bron

Merge remote-tracking branch 'origin/master' into prod_test

# Conflicts:
#	src/main/java/cn/cslg/pas/service/report/MatchCasePersonService.java
zero 7 maanden geleden
bovenliggende
commit
f3c4760387
70 gewijzigde bestanden met toevoegingen van 2196 en 304 verwijderingen
  1. 4 0
      src/main/java/cn/cslg/pas/common/dto/business/ReportAffairDTO.java
  2. 2 0
      src/main/java/cn/cslg/pas/common/dto/invalidDTO/AddAdminProceedDTO.java
  3. 2 0
      src/main/java/cn/cslg/pas/common/dto/invalidDTO/AddClaimHistoryDTO.java
  4. 6 0
      src/main/java/cn/cslg/pas/common/dto/invalidDTO/AddInvalidDecisionFileDTO.java
  5. 2 0
      src/main/java/cn/cslg/pas/common/dto/invalidDTO/AddInvalidRequestFileDTO.java
  6. 2 0
      src/main/java/cn/cslg/pas/common/dto/invalidDTO/AddJudgmentDTO.java
  7. 2 0
      src/main/java/cn/cslg/pas/common/dto/invalidDTO/AddOralTrailDTO.java
  8. 4 0
      src/main/java/cn/cslg/pas/common/dto/invalidDTO/AddOtherDocumentsDTO.java
  9. 2 0
      src/main/java/cn/cslg/pas/common/dto/invalidDTO/AddStateOpinionDTO.java
  10. 2 0
      src/main/java/cn/cslg/pas/common/dto/invalidDTO/AddSupplyEvidenceDTO.java
  11. 31 0
      src/main/java/cn/cslg/pas/common/dto/invalidDTO/ReportAffairCaseDTO.java
  12. 2 0
      src/main/java/cn/cslg/pas/common/dto/invalidDTO/UpdateAdminProceedDTO.java
  13. 2 0
      src/main/java/cn/cslg/pas/common/dto/invalidDTO/UpdateClaimHistoryDTO.java
  14. 4 0
      src/main/java/cn/cslg/pas/common/dto/invalidDTO/UpdateInvalidDecisionFileDTO.java
  15. 2 0
      src/main/java/cn/cslg/pas/common/dto/invalidDTO/UpdateInvalidRequestFileDTO.java
  16. 2 0
      src/main/java/cn/cslg/pas/common/dto/invalidDTO/UpdateJudgmentDTO.java
  17. 2 0
      src/main/java/cn/cslg/pas/common/dto/invalidDTO/UpdateOralTrailDTO.java
  18. 4 0
      src/main/java/cn/cslg/pas/common/dto/invalidDTO/UpdateOtherDocumentsDTO.java
  19. 2 0
      src/main/java/cn/cslg/pas/common/dto/invalidDTO/UpdateStateOpinionDTO.java
  20. 2 0
      src/main/java/cn/cslg/pas/common/dto/invalidDTO/UpdateSupplyEvidenceDTO.java
  21. 68 0
      src/main/java/cn/cslg/pas/common/model/novelty/LitigationDTO.java
  22. 9 0
      src/main/java/cn/cslg/pas/common/model/novelty/LitigationReVO.java
  23. 64 0
      src/main/java/cn/cslg/pas/common/model/novelty/LitigationVO.java
  24. 1 0
      src/main/java/cn/cslg/pas/common/model/report/QueryIprPersonDTO.java
  25. 5 0
      src/main/java/cn/cslg/pas/common/model/report/QueryIprPersonVO.java
  26. 1 0
      src/main/java/cn/cslg/pas/common/model/report/QueryMatchCasePersonDTO.java
  27. 4 0
      src/main/java/cn/cslg/pas/common/model/report/QueryMatchCasePersonVO.java
  28. 3 0
      src/main/java/cn/cslg/pas/common/model/report/UpdateIprPersonDTO.java
  29. 3 0
      src/main/java/cn/cslg/pas/common/model/report/UpdateMatchCasePersonDTO.java
  30. 13 0
      src/main/java/cn/cslg/pas/common/vo/QueryCasePhaseVO.java
  31. 9 0
      src/main/java/cn/cslg/pas/common/vo/QueryReportAffairConclusionVO.java
  32. 4 0
      src/main/java/cn/cslg/pas/common/vo/business/InvalidRecordVO.java
  33. 3 0
      src/main/java/cn/cslg/pas/common/vo/business/ReVO.java
  34. 8 2
      src/main/java/cn/cslg/pas/common/vo/business/ReportProjectVO.java
  35. 6 0
      src/main/java/cn/cslg/pas/common/vo/invalidVO/InvalidDecisionFileVO.java
  36. 23 1
      src/main/java/cn/cslg/pas/common/vo/invalidVO/ReportAffairVO.java
  37. 31 0
      src/main/java/cn/cslg/pas/controller/ReportAffairController.java
  38. 55 0
      src/main/java/cn/cslg/pas/controller/novelty/LitigationController.java
  39. 0 1
      src/main/java/cn/cslg/pas/controller/report/IprPersonController.java
  40. 1 1
      src/main/java/cn/cslg/pas/controller/report/MatchCasePersonController.java
  41. 20 0
      src/main/java/cn/cslg/pas/domain/business/AssoInvalidDecisionCron.java
  42. 12 5
      src/main/java/cn/cslg/pas/domain/business/ReportAffair.java
  43. 38 0
      src/main/java/cn/cslg/pas/domain/business/ReportAffairCasePhase.java
  44. 3 0
      src/main/java/cn/cslg/pas/domain/business/ReportProject.java
  45. 86 0
      src/main/java/cn/cslg/pas/domain/business/novelty/Litigation.java
  46. 7 0
      src/main/java/cn/cslg/pas/domain/report/IprPerson.java
  47. 2 0
      src/main/java/cn/cslg/pas/domain/report/MatchCasePerson.java
  48. 9 0
      src/main/java/cn/cslg/pas/mapper/AssoInvalidDecisionCronMapper.java
  49. 9 0
      src/main/java/cn/cslg/pas/mapper/ReportAffairCasePhaseMapper.java
  50. 10 0
      src/main/java/cn/cslg/pas/mapper/ReportAffairMapper.java
  51. 18 0
      src/main/java/cn/cslg/pas/mapper/novelty/LitigationMapper.java
  52. 27 0
      src/main/java/cn/cslg/pas/service/ReportAffairCasePhaseService.java
  53. 18 4
      src/main/java/cn/cslg/pas/service/business/AdminProceedService.java
  54. 13 0
      src/main/java/cn/cslg/pas/service/business/AssoInvalidDecisionCronService.java
  55. 90 7
      src/main/java/cn/cslg/pas/service/business/InvalidDecisionFileService.java
  56. 40 12
      src/main/java/cn/cslg/pas/service/business/InvalidRecordService.java
  57. 10 2
      src/main/java/cn/cslg/pas/service/business/InvalidRequestFileService.java
  58. 10 2
      src/main/java/cn/cslg/pas/service/business/OralTrailService.java
  59. 16 2
      src/main/java/cn/cslg/pas/service/business/OtherDocumentsService.java
  60. 234 31
      src/main/java/cn/cslg/pas/service/business/ReportAffairService.java
  61. 25 5
      src/main/java/cn/cslg/pas/service/business/ReportProjectService.java
  62. 169 0
      src/main/java/cn/cslg/pas/service/novelty/LitigationService.java
  63. 35 2
      src/main/java/cn/cslg/pas/service/report/IprPersonService.java
  64. 213 26
      src/main/java/cn/cslg/pas/service/report/MatchCasePersonService.java
  65. 288 200
      src/main/resources/jsons/invalidReportProject.json
  66. 46 0
      src/main/resources/mapper/ReportAffairMapper.xml
  67. 1 1
      src/main/resources/mapper/ReportProjectMapper.xml
  68. 31 0
      src/main/resources/mapper/novelty/LitigationMapper.xml
  69. 107 0
      src/test/java/cn/cslg/pas/novelty/LitigationServiceTest.java
  70. 217 0
      src/test/java/cn/cslg/pas/service/ReportAffairTests.java

+ 4 - 0
src/main/java/cn/cslg/pas/common/dto/business/ReportAffairDTO.java

@@ -33,4 +33,8 @@ public class ReportAffairDTO {
      * 备注
      */
     private String description;
+
+    private Integer assoCasePhaseId;
+
+    private String caseChildPhase;
 }

+ 2 - 0
src/main/java/cn/cslg/pas/common/dto/invalidDTO/AddAdminProceedDTO.java

@@ -27,6 +27,8 @@ public class AddAdminProceedDTO {
 
     private String description;
 
+    private Integer assoCasePhaseId;
+
     private Boolean ifSendEmail;
 
     private List<ExtraEmailDTO> extraEmailDTOS;

+ 2 - 0
src/main/java/cn/cslg/pas/common/dto/invalidDTO/AddClaimHistoryDTO.java

@@ -25,6 +25,8 @@ public class AddClaimHistoryDTO {
 
     private String description;
 
+    private Integer assoCasePhaseId;
+
     private Boolean ifSendEmail;
 
     private List<ExtraEmailDTO> extraEmailDTOS;

+ 6 - 0
src/main/java/cn/cslg/pas/common/dto/invalidDTO/AddInvalidDecisionFileDTO.java

@@ -5,6 +5,7 @@ import cn.cslg.pas.domain.BaseEntity;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 import org.springframework.format.annotation.DateTimeFormat;
 
@@ -41,10 +42,15 @@ public class AddInvalidDecisionFileDTO {
 
     private String conclusion;
 
+    @Schema(description = "无效结果:部分无效21、全部无效20、维持有效22、结案24、撤案25")
+    private List<Integer> cronIds;
+
     private List<String> fileGuids;
 
     private String description;
 
+    private Integer assoCasePhaseId;
+
     private Boolean ifSendEmail;
 
     private List<ExtraEmailDTO> extraEmailDTOS;

+ 2 - 0
src/main/java/cn/cslg/pas/common/dto/invalidDTO/AddInvalidRequestFileDTO.java

@@ -28,6 +28,8 @@ public class AddInvalidRequestFileDTO {
 
     private String description;
 
+    private Integer assoCasePhaseId;
+
     private Boolean ifSendEmail;
 
     private List<ExtraEmailDTO> extraEmailDTOS;

+ 2 - 0
src/main/java/cn/cslg/pas/common/dto/invalidDTO/AddJudgmentDTO.java

@@ -27,6 +27,8 @@ public class AddJudgmentDTO {
 
     private String conclusion;
 
+    private Integer assoCasePhaseId;
+
     private Boolean ifSendEmail;
 
     private List<ExtraEmailDTO> extraEmailDTOS;

+ 2 - 0
src/main/java/cn/cslg/pas/common/dto/invalidDTO/AddOralTrailDTO.java

@@ -31,6 +31,8 @@ public class AddOralTrailDTO {
 
     private String description;
 
+    private Integer assoCasePhaseId;
+
     private Boolean ifSendEmail;
 
     private List<ExtraEmailDTO> extraEmailDTOS;

+ 4 - 0
src/main/java/cn/cslg/pas/common/dto/invalidDTO/AddOtherDocumentsDTO.java

@@ -26,6 +26,10 @@ public class AddOtherDocumentsDTO {
 
     private String description;
 
+    private Integer assoCasePhaseId;
+
+    private String caseChildPhase;
+
     private Boolean ifSendEmail;
 
     private List<ExtraEmailDTO> extraEmailDTOS;

+ 2 - 0
src/main/java/cn/cslg/pas/common/dto/invalidDTO/AddStateOpinionDTO.java

@@ -24,6 +24,8 @@ public class AddStateOpinionDTO {
 
     private String description;
 
+    private Integer assoCasePhaseId;
+
     private Boolean ifSendEmail;
 
     private List<ExtraEmailDTO> extraEmailDTOS;

+ 2 - 0
src/main/java/cn/cslg/pas/common/dto/invalidDTO/AddSupplyEvidenceDTO.java

@@ -25,6 +25,8 @@ public class AddSupplyEvidenceDTO {
 
     private String description;
 
+    private Integer assoCasePhaseId;
+
     private Boolean ifSendEmail;
 
     private List<ExtraEmailDTO> extraEmailDTOS;

+ 31 - 0
src/main/java/cn/cslg/pas/common/dto/invalidDTO/ReportAffairCaseDTO.java

@@ -0,0 +1,31 @@
+package cn.cslg.pas.common.dto.invalidDTO;
+
+import cn.cslg.pas.common.model.report.ExtraEmailDTO;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+import java.util.List;
+
+@Data
+public class ReportAffairCaseDTO {
+
+    private Integer id;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date occurredTime;
+
+    private Integer projectId;
+
+    private List<String> fileGuids;
+
+    private String description;
+
+    private Integer assoCasePhaseId;
+
+    private Boolean ifSendEmail;
+
+    private List<ExtraEmailDTO> extraEmailDTOS;
+}

+ 2 - 0
src/main/java/cn/cslg/pas/common/dto/invalidDTO/UpdateAdminProceedDTO.java

@@ -27,6 +27,8 @@ public class UpdateAdminProceedDTO {
 
     private String description;
 
+    private Integer assoCasePhaseId;
+
     private Boolean ifSendEmail;
 
     private List<ExtraEmailDTO> extraEmailDTOS;

+ 2 - 0
src/main/java/cn/cslg/pas/common/dto/invalidDTO/UpdateClaimHistoryDTO.java

@@ -26,6 +26,8 @@ public class UpdateClaimHistoryDTO {
 
     private String description;
 
+    private Integer assoCasePhaseId;
+
     private Boolean ifSendEmail;
 
     private List<ExtraEmailDTO> extraEmailDTOS;

+ 4 - 0
src/main/java/cn/cslg/pas/common/dto/invalidDTO/UpdateInvalidDecisionFileDTO.java

@@ -39,10 +39,14 @@ public class UpdateInvalidDecisionFileDTO {
 
     private String conclusion;
 
+    private List<Integer> cronIds;
+
     private List<String> fileGuids;
 
     private String description;
 
+    private Integer assoCasePhaseId;
+
     private Boolean ifSendEmail;
 
     private List<ExtraEmailDTO> extraEmailDTOS;

+ 2 - 0
src/main/java/cn/cslg/pas/common/dto/invalidDTO/UpdateInvalidRequestFileDTO.java

@@ -30,6 +30,8 @@ public class UpdateInvalidRequestFileDTO {
 
     private String description;
 
+    private Integer assoCasePhaseId;
+
     private Boolean ifSendEmail;
 
     private List<ExtraEmailDTO> extraEmailDTOS;

+ 2 - 0
src/main/java/cn/cslg/pas/common/dto/invalidDTO/UpdateJudgmentDTO.java

@@ -28,6 +28,8 @@ public class UpdateJudgmentDTO {
 
     private String conclusion;
 
+    private Integer assoCasePhaseId;
+
     private Boolean ifSendEmail;
 
     private List<ExtraEmailDTO> extraEmailDTOS;

+ 2 - 0
src/main/java/cn/cslg/pas/common/dto/invalidDTO/UpdateOralTrailDTO.java

@@ -32,6 +32,8 @@ public class UpdateOralTrailDTO {
 
     private String description;
 
+    private Integer assoCasePhaseId;
+
     private Boolean ifSendEmail;
 
     private List<ExtraEmailDTO> extraEmailDTOS;

+ 4 - 0
src/main/java/cn/cslg/pas/common/dto/invalidDTO/UpdateOtherDocumentsDTO.java

@@ -27,6 +27,10 @@ public class UpdateOtherDocumentsDTO {
 
     private String description;
 
+    private Integer assoCasePhaseId;
+
+    private String caseChildPhase;
+
     private Boolean ifSendEmail;
 
     private List<ExtraEmailDTO> extraEmailDTOS;

+ 2 - 0
src/main/java/cn/cslg/pas/common/dto/invalidDTO/UpdateStateOpinionDTO.java

@@ -25,6 +25,8 @@ public class UpdateStateOpinionDTO {
 
     private String description;
 
+    private Integer assoCasePhaseId;
+
     private Boolean ifSendEmail;
 
     private List<ExtraEmailDTO> extraEmailDTOS;

+ 2 - 0
src/main/java/cn/cslg/pas/common/dto/invalidDTO/UpdateSupplyEvidenceDTO.java

@@ -26,6 +26,8 @@ public class UpdateSupplyEvidenceDTO {
 
     private String description;
 
+    private Integer assoCasePhaseId;
+
     private Boolean ifSendEmail;
 
     private List<ExtraEmailDTO> extraEmailDTOS;

+ 68 - 0
src/main/java/cn/cslg/pas/common/model/novelty/LitigationDTO.java

@@ -0,0 +1,68 @@
+package cn.cslg.pas.common.model.novelty;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class LitigationDTO {
+    private Integer id;
+    /**
+     * 案号
+     */
+    private String caseNumber;
+
+    /**
+     * 立案时间
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date caseFieldTime;
+
+    /**
+     * 原告
+     */
+    private String plaintiff;
+
+    /**
+     * 被告
+     */
+    private String defendant;
+
+    /**
+     * 第三人
+     */
+    private String thirdPerson;
+
+    /**
+     * 被告代理人
+     */
+    private String plaintiffAgent;
+
+    /**
+     * 第三代理人
+     */
+    private String thirdAgent;
+
+    /**
+     * 合议庭成员
+     */
+    private String panelMember;
+
+    /**
+     * 结果
+     */
+    private String result;
+
+
+    /**
+     * 1一审 2二审
+     */
+    private Integer type;
+
+    /**
+     *
+     */
+    private Integer projectId;
+
+}

+ 9 - 0
src/main/java/cn/cslg/pas/common/model/novelty/LitigationReVO.java

@@ -0,0 +1,9 @@
+package cn.cslg.pas.common.model.novelty;
+
+import lombok.Data;
+
+@Data
+public class LitigationReVO {
+    private LitigationVO litigationVO1;
+    private LitigationVO litigationVO2;
+}

+ 64 - 0
src/main/java/cn/cslg/pas/common/model/novelty/LitigationVO.java

@@ -0,0 +1,64 @@
+package cn.cslg.pas.common.model.novelty;
+
+import lombok.Data;
+
+import java.util.Date;
+@Data
+public class LitigationVO {
+    /**
+     * 案号
+     */
+    private String caseNumber;
+
+    /**
+     * 立案时间
+     */
+    private Date caseFieldTime;
+
+    /**
+     * 原告
+     */
+    private String plaintiff;
+
+    /**
+     * 被告
+     */
+    private String defendant;
+
+    /**
+     * 第三人
+     */
+    private String thirdPerson;
+
+    /**
+     * 原告代理人
+     */
+    private String plaintiffAgent;
+
+    /**
+     * 第三代理人
+     */
+    private String thirdAgent;
+
+    /**
+     * 合议庭成员
+     */
+    private String panelMember;
+
+    /**
+     * 结果
+     */
+    private String conclusion;
+
+
+    /**
+     * 1一审 2二审
+     */
+    private Integer type;
+
+    /**
+     *
+     */
+    private Integer projectId;
+
+}

+ 1 - 0
src/main/java/cn/cslg/pas/common/model/report/QueryIprPersonDTO.java

@@ -6,6 +6,7 @@ import lombok.Data;
 public class QueryIprPersonDTO {
     private String name;
     private String email;
+    private Integer type;
     private Boolean ifDefault;
     private Long size;
     private Long current;

+ 5 - 0
src/main/java/cn/cslg/pas/common/model/report/QueryIprPersonVO.java

@@ -14,4 +14,9 @@ public class QueryIprPersonVO {
     private String createName;
     private Date createTime;
     private Integer reportType;
+    private Integer type;
+    private String remark;
+    private Integer assoAccountId;
+    private String accountName;
+    private String accountUserName;
 }

+ 1 - 0
src/main/java/cn/cslg/pas/common/model/report/QueryMatchCasePersonDTO.java

@@ -5,4 +5,5 @@ import lombok.Data;
 @Data
 public class QueryMatchCasePersonDTO {
     private Integer reportId;
+    private Integer type;
 }

+ 4 - 0
src/main/java/cn/cslg/pas/common/model/report/QueryMatchCasePersonVO.java

@@ -24,4 +24,8 @@ public class QueryMatchCasePersonVO {
     private Date createTime;
     // ipr人员id   MatchCasePerson
     private Integer iprPersonId;
+    private String remark;
+    private Integer assoAccountId;
+    private String accountName;
+    private String accountUserName;
 }

+ 3 - 0
src/main/java/cn/cslg/pas/common/model/report/UpdateIprPersonDTO.java

@@ -11,4 +11,7 @@ public class UpdateIprPersonDTO {
     private String email;
     private Boolean ifDefault;
     private List<Integer> reportTypes;
+    private Integer type;
+    private Integer assoAccountId;
+    private String remark;
 }

+ 3 - 0
src/main/java/cn/cslg/pas/common/model/report/UpdateMatchCasePersonDTO.java

@@ -9,4 +9,7 @@ public class UpdateMatchCasePersonDTO {
     private String email;
     private Integer iprPersonId;
     private Integer reportId;
+    private Integer type;
+    private Integer assoAccountId;
+    private String remark;
 }

+ 13 - 0
src/main/java/cn/cslg/pas/common/vo/QueryCasePhaseVO.java

@@ -0,0 +1,13 @@
+package cn.cslg.pas.common.vo;
+
+import lombok.Data;
+
+@Data
+public class QueryCasePhaseVO {
+
+    private String casePhase;
+
+    private String caseChildPhase;
+
+    private Integer projectId;
+}

+ 9 - 0
src/main/java/cn/cslg/pas/common/vo/QueryReportAffairConclusionVO.java

@@ -0,0 +1,9 @@
+package cn.cslg.pas.common.vo;
+
+import lombok.Data;
+
+@Data
+public class QueryReportAffairConclusionVO {
+    private String conclusion;
+    private Integer projectId;
+}

+ 4 - 0
src/main/java/cn/cslg/pas/common/vo/business/InvalidRecordVO.java

@@ -71,4 +71,8 @@ public class InvalidRecordVO {
     private Boolean ifAdd;
 
     private ReportVO reportVO;
+
+    private String casePhase;
+    private String caseChildPhase;
+    private Integer flowType;
 }

+ 3 - 0
src/main/java/cn/cslg/pas/common/vo/business/ReVO.java

@@ -12,4 +12,7 @@ import java.util.Date;
 public class ReVO {
     private Date judgementTime;
     private String result;
+    private String casePhase;
+    private String caseChildPhase;
+    private Integer flowType;
 }

+ 8 - 2
src/main/java/cn/cslg/pas/common/vo/business/ReportProjectVO.java

@@ -235,9 +235,15 @@ public class ReportProjectVO {
     private String applicantAgency;
     @Schema(description = " 权利人代理所")
     private String rightHolderAgency;
-    @Schema(description = "案件阶段")
-    private String caseStage;
     private List<String> rightHolder;
     @Schema(description = "参与人")
     private List<SimplePersonVO> involvedPersons;
+    @Schema(description = "案件阶段")
+    private String casePhase;
+    @Schema(description = "案件子阶段")
+    private String caseChildPhase;
+    @Schema(description = "行诉结果")
+    private String conclusion;
+    @Schema(description = "实际处理人")
+    private String actualPerson;
 }

+ 6 - 0
src/main/java/cn/cslg/pas/common/vo/invalidVO/InvalidDecisionFileVO.java

@@ -1,6 +1,7 @@
 package cn.cslg.pas.common.vo.invalidVO;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 import org.springframework.format.annotation.DateTimeFormat;
 
@@ -37,4 +38,9 @@ public class InvalidDecisionFileVO {
     private String decisionKey;
 
     private String conclusion;
+
+    @Schema(description = "无效结果")
+    private List<String> cronNames;
+    @Schema(description = "无效结果")
+    private List<Integer> cronIds;
 }

+ 23 - 1
src/main/java/cn/cslg/pas/common/vo/invalidVO/ReportAffairVO.java

@@ -1,6 +1,7 @@
 package cn.cslg.pas.common.vo.invalidVO;
 
 import cn.cslg.pas.common.model.cronModel.SystemFile;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import org.springframework.format.annotation.DateTimeFormat;
@@ -20,7 +21,7 @@ public class ReportAffairVO {
      * 事务类型(0为口审记录,1为无效请求书,2为陈述意见书,3为无效决定书,4为行政诉讼书,5为行政诉讼判决书
      * 6为权要修改记录,7为补充证据及理由,8为其他文档)
      */
-    private Integer affairType;
+//    private Integer affairType;
 
     private Integer projectId;
 
@@ -100,4 +101,25 @@ public class ReportAffairVO {
      * 其他文档返回VO
      */
     private OtherDocumentsVO otherDocumentsVO;
+
+    /**
+     * 事务和流程关联id
+     */
+    private Integer assoCasePhaseId;
+    /**
+     * 流程名称
+     */
+    private String flowName;
+    /**
+     * 案件阶段
+     */
+    private String casePhase;
+    /**
+     * 案件子阶段
+     */
+    private String caseChildPhase;
+    /**
+     * 流程类型
+     */
+    private Integer flowType;
 }

+ 31 - 0
src/main/java/cn/cslg/pas/controller/ReportAffairController.java

@@ -5,7 +5,9 @@ import cn.cslg.pas.common.dto.invalidDTO.*;
 import cn.cslg.pas.common.model.cronModel.Records;
 import cn.cslg.pas.common.utils.Response;
 import cn.cslg.pas.common.vo.invalidVO.ReportAffairVO;
+import cn.cslg.pas.domain.business.ReportAffairCasePhase;
 import cn.cslg.pas.exception.XiaoShiException;
+import cn.cslg.pas.service.ReportAffairCasePhaseService;
 import cn.cslg.pas.service.business.*;
 import io.swagger.v3.oas.annotations.Operation;
 import lombok.extern.slf4j.Slf4j;
@@ -36,6 +38,8 @@ public class ReportAffairController {
     private AdminProceedService adminProceedService;
     @Autowired
     private OtherDocumentsService otherDocumentsService;
+    @Autowired
+    private ReportAffairCasePhaseService reportAffairCasePhaseService;
 
     @Operation(summary = "上传无效请求书")
     @PostMapping("/addInvalidRequestFile")
@@ -220,4 +224,31 @@ public class ReportAffairController {
         records.setData(id);
         return Response.success(records);
     }
+
+    @Operation(summary = "查询案件关联文档集合")
+    @PostMapping("/queryAssoCasePhaseList")
+    public Response queryAssoCasePhaseList() {
+        List<ReportAffairCasePhase> phases = reportAffairCasePhaseService.queryAssoCasePhaseList();
+        Records records = new Records();
+        records.setData(phases);
+        return Response.success(records);
+    }
+
+    @Operation(summary = "添加案件文档")
+    @PostMapping("/addReportAffairCase")
+    public Response addReportAffairCase(@RequestBody ReportAffairCaseDTO affairDTO) throws Exception {
+        Integer id = reportAffairService.addReportAffairCase(affairDTO);
+        Records records = new Records();
+        records.setData(id);
+        return Response.success(records);
+    }
+
+    @Operation(summary = "修改案件文档")
+    @PostMapping("/updateReportAffairCase")
+    public Response updateReportAffairCase(@RequestBody ReportAffairCaseDTO affairDTO) throws Exception {
+        Integer id = reportAffairService.updateReportAffairCase(affairDTO);
+        Records records = new Records();
+        records.setData(id);
+        return Response.success(records);
+    }
 }

+ 55 - 0
src/main/java/cn/cslg/pas/controller/novelty/LitigationController.java

@@ -0,0 +1,55 @@
+package cn.cslg.pas.controller.novelty;
+
+import cn.cslg.pas.common.core.base.Constants;
+import cn.cslg.pas.common.dto.NoveltyProjectDTO.NoveltyCompareRecordDTO;
+import cn.cslg.pas.common.dto.NoveltyProjectDTO.NoveltyMarkDTO;
+import cn.cslg.pas.common.model.novelty.LitigationDTO;
+import cn.cslg.pas.common.model.novelty.LitigationReVO;
+import cn.cslg.pas.common.utils.Response;
+import cn.cslg.pas.common.vo.NoveltyProjectVO.NoveltyCompareRecordVO;
+import cn.cslg.pas.domain.business.novelty.Litigation;
+import cn.cslg.pas.exception.ExceptionEnum;
+import cn.cslg.pas.exception.XiaoShiException;
+import cn.cslg.pas.service.business.es.EsScratchWordsService;
+import cn.cslg.pas.service.novelty.LitigationService;
+import cn.cslg.pas.service.novelty.NoveltyCompareRecordService;
+import io.swagger.v3.oas.annotations.Operation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 作为无效证据使用历史
+ *
+ * @Author xiexiang
+ * @Date 2024/1/19
+ */
+@Slf4j
+@RequestMapping(Constants.API_XiaoSHI + "/litigation")
+@RestController
+public class LitigationController {
+    @Autowired
+    private LitigationService litigationService;
+
+    @Operation(summary = "添加或编辑行政诉讼")
+    @PostMapping("/addOrUpdate")
+    public Response addOrUpdate(@RequestBody LitigationDTO litigationDTO) {
+     Litigation litigation=litigationService.addOrUpdateLitigation(litigationDTO);
+        return Response.success(litigation.getId());
+    }
+
+    @Operation(summary = "查询行政诉讼")
+    @PostMapping("/query")
+    public Response query(@RequestBody LitigationDTO litigationDTO) {
+        LitigationReVO litigationReVO = litigationService.queryLitigation(litigationDTO);
+        return Response.success(litigationReVO);
+    }
+
+}

+ 0 - 1
src/main/java/cn/cslg/pas/controller/report/IprPersonController.java

@@ -58,6 +58,5 @@ public class IprPersonController {
     public Response query(@RequestBody QueryIprPersonDTO queryIprPersonDTO) {
         Records records = iprPersonService.query(queryIprPersonDTO);
         return Response.success(records);
-
     }
 }

+ 1 - 1
src/main/java/cn/cslg/pas/controller/report/MatchCasePersonController.java

@@ -55,7 +55,7 @@ public class MatchCasePersonController {
     @Operation(summary = "查询配案人员信息")
     @PostMapping("/query")
     public Response query(@RequestBody QueryMatchCasePersonDTO queryMatchCasePersonDTO) {
-        List<QueryMatchCasePersonVO> queryMatchCasePersonVOS = matchCasePersonService.getReportMatchCasePerson(queryMatchCasePersonDTO.getReportId());
+        List<QueryMatchCasePersonVO> queryMatchCasePersonVOS = matchCasePersonService.getReportMatchCasePerson(queryMatchCasePersonDTO);
         return Response.success(queryMatchCasePersonVOS);
 
     }

+ 20 - 0
src/main/java/cn/cslg/pas/domain/business/AssoInvalidDecisionCron.java

@@ -0,0 +1,20 @@
+package cn.cslg.pas.domain.business;
+
+import cn.cslg.pas.domain.BaseEntity;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+/**
+ * 无效决定书与无效结果关联表
+ * @Author xiexiang
+ * @Date 2023/11/6
+ */
+@Data
+@TableName("asso_invalid_decision_cron")
+public class AssoInvalidDecisionCron extends BaseEntity<AssoInvalidDecisionCron> {
+    @TableField(value = "invalid_decision_id")
+    private Integer invalidDecisionId;
+    @TableField(value = "cron_id")
+    private Integer cronId;
+}

+ 12 - 5
src/main/java/cn/cslg/pas/domain/business/ReportAffair.java

@@ -15,11 +15,6 @@ import java.util.Date;
 @Data
 @TableName("report_affair")
 public class ReportAffair extends BaseEntity<ReportAffair> {
-    /**
-     * 事务类型(0为口审记录,1为无效请求书,2为陈述意见书,3为无效决定书,4为行政诉讼书)
-     */
-    @TableField(value = "affair_type")
-    private Integer affairType;
 
     /**
      * 所属报告id
@@ -50,4 +45,16 @@ public class ReportAffair extends BaseEntity<ReportAffair> {
      */
     @TableField(value = "create_time")
     private Date createTime;
+
+    /**
+     * 案件阶段关联id
+     */
+    @TableField(value = "asso_case_phase_id")
+    private Integer assoCasePhaseId;
+
+    /**
+     * 案件子阶段
+     */
+    @TableField(value = "case_child_phase")
+    private String caseChildPhase;
 }

+ 38 - 0
src/main/java/cn/cslg/pas/domain/business/ReportAffairCasePhase.java

@@ -0,0 +1,38 @@
+package cn.cslg.pas.domain.business;
+
+import cn.cslg.pas.domain.BaseEntity;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+/**
+ * 无效事务与案件阶段关联表
+ * @Author xiexiang
+ * @Date 2023/12/22
+ */
+@Data
+@TableName("report_affair_case_phase")
+public class ReportAffairCasePhase extends BaseEntity<ReportAffairCasePhase> {
+
+    /**
+     * 流程名称
+     */
+    @TableField(value = "flow_name")
+    private String flowName;
+    /**
+     * 案件阶段
+     */
+    @TableField(value = "case_phase")
+    private String casePhase;
+    /**
+     * 案件子阶段
+     */
+    @TableField(value = "case_child_phase")
+    private String caseChildPhase;
+    /**
+     * 流程类型
+     */
+    @TableField(value = "flow_type")
+    private Integer flowType;
+
+}

+ 3 - 0
src/main/java/cn/cslg/pas/domain/business/ReportProject.java

@@ -130,4 +130,7 @@ public class ReportProject extends BaseEntity<ReportProject> {
 
     @TableField(value ="case_stage")
     private String caseStage;
+
+    @TableField(value = "actual_person")
+    private String actualPerson;
 }

+ 86 - 0
src/main/java/cn/cslg/pas/domain/business/novelty/Litigation.java

@@ -0,0 +1,86 @@
+package cn.cslg.pas.domain.business.novelty;
+
+import cn.cslg.pas.domain.BaseEntity;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+/**
+ * 行政诉讼表
+ * @TableName litigation
+ */
+@TableName(value ="litigation")
+@Data
+public class Litigation extends BaseEntity<ImportPatentQueen> {
+
+
+    /**
+     * 案号
+     */
+    private String caseNumber;
+
+    /**
+     * 立案时间
+     */
+    private Date caseFieldTime;
+
+    /**
+     * 原告
+     */
+    private String plaintiff;
+
+    /**
+     * 被告
+     */
+    private String defendant;
+
+    /**
+     * 第三人
+     */
+    private String thirdPerson;
+
+    /**
+     * 被告代理人
+     */
+    private String plaintiffAgent;
+
+    /**
+     * 第三代理人
+     */
+    private String thirdAgent;
+
+    /**
+     * 合议庭成员
+     */
+    private String panelMember;
+
+    /**
+     * 结果
+     */
+    private String result;
+
+    /**
+     * 创建人
+     */
+    private String createId;
+
+    /**
+     * 1一审 2二审
+     */
+    private Integer type;
+
+    /**
+     * 
+     */
+    private Integer projectId;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+}

+ 7 - 0
src/main/java/cn/cslg/pas/domain/report/IprPerson.java

@@ -22,5 +22,12 @@ public class IprPerson extends BaseEntity<IprPerson> {
     private String createId;
 
     private Date createTime;
+
     private Boolean ifDefault;
+
+    private Integer type;
+
+    private Integer assoAccountId;
+
+    private String remark;
 }

+ 2 - 0
src/main/java/cn/cslg/pas/domain/report/MatchCasePerson.java

@@ -27,4 +27,6 @@ public class MatchCasePerson extends BaseEntity<MatchCasePerson> {
 
     private Date createTime;
 
+    private Integer type;
+
 }

+ 9 - 0
src/main/java/cn/cslg/pas/mapper/AssoInvalidDecisionCronMapper.java

@@ -0,0 +1,9 @@
+package cn.cslg.pas.mapper;
+
+import cn.cslg.pas.domain.business.AssoInvalidDecisionCron;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface AssoInvalidDecisionCronMapper extends BaseMapper<AssoInvalidDecisionCron> {
+}

+ 9 - 0
src/main/java/cn/cslg/pas/mapper/ReportAffairCasePhaseMapper.java

@@ -0,0 +1,9 @@
+package cn.cslg.pas.mapper;
+
+import cn.cslg.pas.domain.business.ReportAffairCasePhase;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface ReportAffairCasePhaseMapper extends BaseMapper<ReportAffairCasePhase> {
+}

+ 10 - 0
src/main/java/cn/cslg/pas/mapper/ReportAffairMapper.java

@@ -1,14 +1,24 @@
 package cn.cslg.pas.mapper;
 
+import cn.cslg.pas.common.vo.QueryCasePhaseVO;
+import cn.cslg.pas.common.vo.QueryReportAffairConclusionVO;
 import cn.cslg.pas.domain.business.ReportAffair;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
+import java.util.List;
+
 /**
  * 报告事务Mapper层
+ *
  * @Author xiexiang
  * @Date 2023/12/23
  */
 @Repository
 public interface ReportAffairMapper extends BaseMapper<ReportAffair> {
+
+    public List<QueryCasePhaseVO> queryCasePhase(@Param("projectIds") List<Integer> projectIds);
+
+    public List<QueryReportAffairConclusionVO> queryReportAffairConclusion(@Param("projectIds") List<Integer> projectIds);
 }

+ 18 - 0
src/main/java/cn/cslg/pas/mapper/novelty/LitigationMapper.java

@@ -0,0 +1,18 @@
+package cn.cslg.pas.mapper.novelty;
+
+import cn.cslg.pas.domain.business.novelty.Litigation;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+* @author admin
+* @description 针对表【litigation(行政诉讼表)】的数据库操作Mapper
+* @createDate 2025-02-27 10:49:21
+* @Entity cn.cslg.pas.domain.novelty.domain.Litigation
+*/
+public interface LitigationMapper extends BaseMapper<Litigation> {
+
+}
+
+
+
+

+ 27 - 0
src/main/java/cn/cslg/pas/service/ReportAffairCasePhaseService.java

@@ -0,0 +1,27 @@
+package cn.cslg.pas.service;
+
+import cn.cslg.pas.domain.business.ReportAffairCasePhase;
+import cn.cslg.pas.mapper.ReportAffairCasePhaseMapper;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Slf4j
+@Service
+public class ReportAffairCasePhaseService extends ServiceImpl<ReportAffairCasePhaseMapper, ReportAffairCasePhase> {
+
+    @Autowired
+    private ReportAffairCasePhaseMapper reportAffairCasePhaseMapper;
+
+    /**
+     * 查询案件关联文档集合
+     * @return
+     */
+    public List<ReportAffairCasePhase> queryAssoCasePhaseList() {
+        return reportAffairCasePhaseMapper.selectList(new LambdaQueryWrapper<ReportAffairCasePhase>());
+    }
+}

+ 18 - 4
src/main/java/cn/cslg/pas/service/business/AdminProceedService.java

@@ -20,6 +20,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.ObjectUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -64,15 +66,17 @@ public class AdminProceedService extends ServiceImpl<AdminProceedMapper, AdminPr
         if (projectId == null) {
             throw new XiaoShiException("报告id为空");
         }
+        if (ObjectUtils.isEmpty(addDto.getAssoCasePhaseId())) {
+            throw new XiaoShiException("案件流程阶段id为空");
+        }
         //1. 首先上传报告事务,拿到报告事务id
         ReportAffairDTO reportAffairDTO = new ReportAffairDTO();
         reportAffairDTO.setProjectId(projectId);
-        //行政诉讼书 4
-        reportAffairDTO.setAffairType(4);
         //发生时间是口审时间
         reportAffairDTO.setOccurredTime(addDto.getProceedingTime());
         //备注
         reportAffairDTO.setDescription(addDto.getDescription());
+        reportAffairDTO.setAssoCasePhaseId(addDto.getAssoCasePhaseId());
         Integer reportAffairId = reportAffairService.addReportAffair(reportAffairDTO);
 
         if (reportAffairId == null) {
@@ -137,6 +141,9 @@ public class AdminProceedService extends ServiceImpl<AdminProceedMapper, AdminPr
         if (projectId == null) {
             throw new XiaoShiException("报告id为空");
         }
+        if (ObjectUtils.isEmpty(updateDTO.getAssoCasePhaseId())) {
+            throw new XiaoShiException("案件流程阶段id为空");
+        }
         //1. 根据id查出行政记录
         AdminProceed al = this.getById(id);
         if (al == null) {
@@ -152,6 +159,7 @@ public class AdminProceedService extends ServiceImpl<AdminProceedMapper, AdminPr
         reportAffair.setOccurredTime(updateDTO.getProceedingTime());
         //备注
         reportAffair.setDescription(updateDTO.getDescription());
+        reportAffair.setAssoCasePhaseId(updateDTO.getAssoCasePhaseId());
         reportAffair.updateById();
         //3. 更新报告事务与文件关联
         List<String> fileGuids = updateDTO.getFileGuids();
@@ -175,15 +183,17 @@ public class AdminProceedService extends ServiceImpl<AdminProceedMapper, AdminPr
         if (projectId == null) {
             throw new XiaoShiException("报告id为空");
         }
+        if (ObjectUtils.isEmpty(addJudgmentDTO.getAssoCasePhaseId())) {
+            throw new XiaoShiException("案件流程阶段id为空");
+        }
         //1. 首先上传报告事务,拿到报告事务id
         ReportAffairDTO reportAffairDTO = new ReportAffairDTO();
         reportAffairDTO.setProjectId(projectId);
-        //行政诉讼判决书 5
-        reportAffairDTO.setAffairType(5);
         //发生时间是口审时间
         reportAffairDTO.setOccurredTime(addJudgmentDTO.getJudgmentTime());
         //备注
         reportAffairDTO.setDescription(addJudgmentDTO.getDescription());
+        reportAffairDTO.setAssoCasePhaseId(addJudgmentDTO.getAssoCasePhaseId());
         Integer reportAffairId = reportAffairService.addReportAffair(reportAffairDTO);
 
         if (reportAffairId == null) {
@@ -231,6 +241,9 @@ public class AdminProceedService extends ServiceImpl<AdminProceedMapper, AdminPr
         if (projectId == null) {
             throw new XiaoShiException("报告id为空");
         }
+        if (ObjectUtils.isEmpty(updateJudgmentDTO.getAssoCasePhaseId())) {
+            throw new XiaoShiException("案件流程阶段id为空");
+        }
         //1.拿到报告事务id,获取法院判别书,并更新
         List<CourtOrder> courtOrders = courtOrderService.list(new LambdaQueryWrapper<CourtOrder>()
                 .eq(CourtOrder::getReportAffairId, reportAffairId)
@@ -249,6 +262,7 @@ public class AdminProceedService extends ServiceImpl<AdminProceedMapper, AdminPr
         reportAffair.setOccurredTime(updateJudgmentDTO.getJudgmentTime());
         //备注
         reportAffair.setDescription(updateJudgmentDTO.getDescription());
+        reportAffair.setAssoCasePhaseId(updateJudgmentDTO.getAssoCasePhaseId());
         reportAffair.updateById();
         //3. 更新报告事务与文件关联
         List<String> fileGuids = updateJudgmentDTO.getFileGuids();

+ 13 - 0
src/main/java/cn/cslg/pas/service/business/AssoInvalidDecisionCronService.java

@@ -0,0 +1,13 @@
+package cn.cslg.pas.service.business;
+
+import cn.cslg.pas.domain.business.AssoInvalidDecisionCron;
+import cn.cslg.pas.mapper.AssoInvalidDecisionCronMapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+@Service
+@Slf4j
+public class AssoInvalidDecisionCronService extends ServiceImpl<AssoInvalidDecisionCronMapper, AssoInvalidDecisionCron> {
+
+}

+ 90 - 7
src/main/java/cn/cslg/pas/service/business/InvalidDecisionFileService.java

@@ -7,20 +7,23 @@ import cn.cslg.pas.common.model.report.ExtraEmailDTO;
 import cn.cslg.pas.common.model.report.MailMessageDTO;
 import cn.cslg.pas.common.vo.invalidVO.InvalidDecisionFileVO;
 import cn.cslg.pas.common.vo.invalidVO.OralTrailVO;
-import cn.cslg.pas.domain.business.AssoReportAffairFile;
-import cn.cslg.pas.domain.business.InvalidDecisionFile;
-import cn.cslg.pas.domain.business.OralTrail;
-import cn.cslg.pas.domain.business.ReportAffair;
+import cn.cslg.pas.domain.business.*;
 import cn.cslg.pas.exception.XiaoShiException;
 import cn.cslg.pas.mapper.InvalidDecisionFileMapper;
+import cn.cslg.pas.mapper.ReportProjectMapper;
 import cn.cslg.pas.service.MailSendService;
 import cn.cslg.pas.service.report.SendReportMailService;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.ObjectUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -43,7 +46,14 @@ public class InvalidDecisionFileService extends ServiceImpl<InvalidDecisionFileM
     private SendReportMailService sendReportMailService;
 
     @Autowired
-    private MailSendService mailSendService;
+    private AssoInvalidDecisionCronService assoInvalidDecisionCronService;
+
+    @Autowired
+    private ReportProjectMapper reportProjectMapper;
+
+    @Autowired
+    private AssoReportCronService assoReportCronService;
+
 
     public Integer add(AddInvalidDecisionFileDTO addInvalidDecisionFileDTO){
         if (addInvalidDecisionFileDTO == null) {
@@ -53,15 +63,17 @@ public class InvalidDecisionFileService extends ServiceImpl<InvalidDecisionFileM
         if (projectId == null) {
             throw new XiaoShiException("报告id为空");
         }
+        if (ObjectUtils.isEmpty(addInvalidDecisionFileDTO.getAssoCasePhaseId())) {
+            throw new XiaoShiException("案件流程阶段id为空");
+        }
         //1. 首先上传报告事务,拿到报告事务id
         ReportAffairDTO reportAffairDTO = new ReportAffairDTO();
         reportAffairDTO.setProjectId(projectId);
-        //无效决定书 3
-        reportAffairDTO.setAffairType(3);
         //发生时间是口审时间
         reportAffairDTO.setOccurredTime(addInvalidDecisionFileDTO.getInvalidDecisionTime());
         //备注
         reportAffairDTO.setDescription(addInvalidDecisionFileDTO.getDescription());
+        reportAffairDTO.setAssoCasePhaseId(addInvalidDecisionFileDTO.getAssoCasePhaseId());
         Integer reportAffairId = reportAffairService.addReportAffair(reportAffairDTO);
 
         if (reportAffairId == null) {
@@ -75,6 +87,7 @@ public class InvalidDecisionFileService extends ServiceImpl<InvalidDecisionFileM
         invalidDecisionFile.setLegalBase(addInvalidDecisionFileDTO.getLegalBase());
         invalidDecisionFile.setReportAffairId(reportAffairId);
         invalidDecisionFile.insert();
+        this.updateReportIssueNum(projectId, addInvalidDecisionFileDTO.getFileNo());
         //3. 添加报告事务与文件关联
         List<String> fileGuids = addInvalidDecisionFileDTO.getFileGuids();
         if (fileGuids != null && !fileGuids.isEmpty()) {
@@ -87,12 +100,57 @@ public class InvalidDecisionFileService extends ServiceImpl<InvalidDecisionFileM
             });
             assoReportAffairFileService.saveBatch(assoReportAffairFiles);
         }
+        //4. 添加无效决定书与无效结果关联
+        List<Integer> cronIds = addInvalidDecisionFileDTO.getCronIds();
+        List<AssoInvalidDecisionCron> assoInvalidDecisionCrons = new ArrayList<>();
+        if (!CollectionUtils.isEmpty(cronIds)) {
+            cronIds.forEach(item -> {
+                AssoInvalidDecisionCron assoInvalidDecisionCron = new AssoInvalidDecisionCron();
+                assoInvalidDecisionCron.setInvalidDecisionId(invalidDecisionFile.getId());
+                assoInvalidDecisionCron.setCronId(item);
+                assoInvalidDecisionCrons.add(assoInvalidDecisionCron);
+            });
+            assoInvalidDecisionCronService.saveBatch(assoInvalidDecisionCrons);
+        }
+        //5.把无效结果同步到报告的核心结论
+        if (!CollectionUtils.isEmpty(cronIds) && ObjectUtils.isNotEmpty(projectId)) {
+            this.updateReportCron(cronIds, projectId);
+        }
         if (addInvalidDecisionFileDTO.getIfSendEmail()) {
             sendReportMailService.finalSendEmail(projectId, fileGuids, addInvalidDecisionFileDTO.getExtraEmailDTOS());
         }
         return reportAffairId;
     }
 
+    //同步修改报告中发文序号和无效决定书号码保持一致
+    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
+    public void updateReportIssueNum(Integer projectId, String num) {
+        if (StringUtils.isNotEmpty(num)) {
+            ReportProject reportProject = reportProjectMapper.selectOne(new LambdaQueryWrapper<ReportProject>()
+                    .eq(ReportProject::getProjectId, projectId));
+            if (ObjectUtils.isNotEmpty(reportProject)) {
+                reportProject.setId(reportProject.getId());
+                reportProject.setIssueNumber(num);
+                reportProject.updateById();
+            }
+        }
+    }
+
+    //把无效结果同步到报告的核心结论
+    public void updateReportCron(List<Integer> cronIds, Integer projectId) {
+        LambdaQueryWrapper<AssoReportCron> reportCronWrapper = new LambdaQueryWrapper<>();
+        reportCronWrapper.eq(AssoReportCron::getProjectId, projectId);
+        assoReportCronService.remove(reportCronWrapper);
+        List<AssoReportCron> assoReportCrons = new ArrayList<>();
+        cronIds.forEach(item -> {
+            AssoReportCron assoReportCron = new AssoReportCron();
+            assoReportCron.setProjectId(projectId);
+            assoReportCron.setCronId(item);
+            assoReportCrons.add(assoReportCron);
+        });
+        assoReportCronService.saveBatch(assoReportCrons);
+    }
+
     /**
      * 修改无效决定书
      * @param updateInvalidDecisionFileDTO
@@ -110,6 +168,9 @@ public class InvalidDecisionFileService extends ServiceImpl<InvalidDecisionFileM
         if (projectId == null) {
             throw new XiaoShiException("报告id为空");
         }
+        if (ObjectUtils.isEmpty(updateInvalidDecisionFileDTO.getAssoCasePhaseId())) {
+            throw new XiaoShiException("案件流程阶段id为空");
+        }
         //1. 根据id查出无效决定书
         InvalidDecisionFile invalidDecisionFile = this.getById(id);
         if (invalidDecisionFile == null) {
@@ -117,6 +178,8 @@ public class InvalidDecisionFileService extends ServiceImpl<InvalidDecisionFileM
         }
         BeanUtils.copyProperties(updateInvalidDecisionFileDTO, invalidDecisionFile);
         invalidDecisionFile.updateById();
+        this.updateReportIssueNum(projectId, updateInvalidDecisionFileDTO.getFileNo());
+
         Integer reportAffairId = invalidDecisionFile.getReportAffairId();
         //2. 拿到报告事务id,获取报告事务
         ReportAffair reportAffair = reportAffairService.getById(reportAffairId);
@@ -125,6 +188,7 @@ public class InvalidDecisionFileService extends ServiceImpl<InvalidDecisionFileM
         reportAffair.setOccurredTime(updateInvalidDecisionFileDTO.getInvalidDecisionTime());
         //备注
         reportAffair.setDescription(updateInvalidDecisionFileDTO.getDescription());
+        reportAffair.setAssoCasePhaseId(updateInvalidDecisionFileDTO.getAssoCasePhaseId());
         reportAffair.updateById();
         //3. 更新报告事务与文件关联
         LambdaQueryWrapper<AssoReportAffairFile> queryWrapper = new LambdaQueryWrapper<>();
@@ -141,6 +205,25 @@ public class InvalidDecisionFileService extends ServiceImpl<InvalidDecisionFileM
             });
             assoReportAffairFileService.saveBatch(assoReportAffairFiles);
         }
+        //4.更新无效书与无效结果关联
+        List<Integer> cronIds = updateInvalidDecisionFileDTO.getCronIds();
+        LambdaQueryWrapper<AssoInvalidDecisionCron> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(AssoInvalidDecisionCron::getInvalidDecisionId, invalidDecisionFile.getId());
+        assoInvalidDecisionCronService.remove(wrapper);
+        List<AssoInvalidDecisionCron> decisionCrons = new ArrayList<>();
+        if (!CollectionUtils.isEmpty(cronIds)) {
+            cronIds.forEach(item -> {
+                AssoInvalidDecisionCron decisionCron = new AssoInvalidDecisionCron();
+                decisionCron.setInvalidDecisionId(invalidDecisionFile.getId());
+                decisionCron.setCronId(item);
+                decisionCrons.add(decisionCron);
+            });
+            assoInvalidDecisionCronService.saveBatch(decisionCrons);
+        }
+        //5.把无效结果同步到报告的核心结论
+        if (!CollectionUtils.isEmpty(cronIds) && ObjectUtils.isNotEmpty(projectId)) {
+            this.updateReportCron(cronIds, projectId);
+        }
         if (updateInvalidDecisionFileDTO.getIfSendEmail()) {
             sendReportMailService.finalSendEmail(projectId, fileGuids, updateInvalidDecisionFileDTO.getExtraEmailDTOS());
         }

+ 40 - 12
src/main/java/cn/cslg/pas/service/business/InvalidRecordService.java

@@ -17,12 +17,14 @@ import cn.cslg.pas.domain.BaseEntity;
 import cn.cslg.pas.domain.business.*;
 import cn.cslg.pas.exception.XiaoShiException;
 import cn.cslg.pas.mapper.InvalidRecordMapper;
+import cn.cslg.pas.mapper.ReportAffairCasePhaseMapper;
 import cn.cslg.pas.service.common.FileManagerService;
 import cn.cslg.pas.service.permissions.PermissionService;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -78,7 +80,7 @@ public class InvalidRecordService extends ServiceImpl<InvalidRecordMapper, Inval
     private InvalidDecisionFileService invalidDecisionFileService;
 
     @Autowired
-    private AssoReportAffairFileService assoReportAffairFileService;
+    private ReportAffairCasePhaseMapper reportAffairCasePhaseMapper;
 
     @Autowired
     private CourtOrderService courtOrderService;
@@ -270,9 +272,16 @@ public class InvalidRecordService extends ServiceImpl<InvalidRecordMapper, Inval
                         Integer affairType = 1;
                         Date invalidTime = this.loadInvalidTime(affairType, item);
                         invalidRecordVO.setInvalidTime(invalidTime);
-                        Integer judgeType = 5;
-                        Date judgeTime = this.loadInvalidTime(judgeType, item);
-
+                        Integer judgeType = 16;
+                        Date judgeTime1 = this.loadInvalidTime(judgeType, item);
+                        Integer judgeType1 = 26;
+                        Date judgeTime2 = this.loadInvalidTime(judgeType1, item);
+                        Date judgeTime = null;
+                        if (ObjectUtils.isNotEmpty(judgeTime2)) {
+                            judgeTime = judgeTime2;
+                        } else {
+                            judgeTime = judgeTime1;
+                        }
                         invalidRecordVO.setJudgementTime(judgeTime);
                         invalidRecordVO.setCreateId(project.getCreateId());
                         invalidRecordVO.setCreateTime(project.getCreateTime());
@@ -281,10 +290,13 @@ public class InvalidRecordService extends ServiceImpl<InvalidRecordMapper, Inval
                         invalidRecordVO.setFileGuids(fileGuids);
                         invalidRecordVO.setIfAdd(false);
                         //装载结果  先查询行政判决诉讼书
-                        Integer resultType = 5;
+                        Integer resultType = 16;
                         ReVO reVO = this.loadResult(resultType, item);
                         invalidRecordVO.setResult(reVO.getResult());
                         invalidRecordVO.setJudgementTime(reVO.getJudgementTime());
+                        invalidRecordVO.setCasePhase(reVO.getCasePhase());
+                        invalidRecordVO.setCaseChildPhase(reVO.getCaseChildPhase());
+                        invalidRecordVO.setFlowType(reVO.getFlowType());
                         //带出报告信息
                         ReportVO reportVO = new ReportVO();
                         BeanUtils.copyProperties(item, reportVO);
@@ -302,7 +314,7 @@ public class InvalidRecordService extends ServiceImpl<InvalidRecordMapper, Inval
 
     public Date loadInvalidTime(Integer type, ReportProject reportProject) {
         LambdaQueryWrapper<ReportAffair> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(ReportAffair::getAffairType, type)
+        queryWrapper.eq(ReportAffair::getAssoCasePhaseId, type)
                 .eq(ReportAffair::getProjectId, reportProject.getProjectId())
                 .orderByDesc(ReportAffair::getCreateTime)
                 .last("LIMIT 1");
@@ -318,9 +330,11 @@ public class InvalidRecordService extends ServiceImpl<InvalidRecordMapper, Inval
         ReVO reVO = new ReVO();
         String result = "";
         LambdaQueryWrapper<ReportAffair> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(ReportAffair::getAffairType, type)
-                .eq(ReportAffair::getProjectId, reportProject.getProjectId())
-                .orderByDesc(ReportAffair::getCreateTime)
+        queryWrapper.eq(ReportAffair::getProjectId, reportProject.getProjectId())
+                .and(item -> item.eq(ReportAffair::getAssoCasePhaseId, type)
+                .or()
+                .eq(ReportAffair::getAssoCasePhaseId,26))
+                .orderByDesc(ReportAffair::getAssoCasePhaseId).orderByDesc(ReportAffair::getOccurredTime)
                 .last("LIMIT 1");
         ReportAffair reportAffair = reportAffairService.getOne(queryWrapper, false);
         if (reportAffair != null) {
@@ -333,14 +347,21 @@ public class InvalidRecordService extends ServiceImpl<InvalidRecordMapper, Inval
                 result = courtOrder.getConclusion();
                 reVO.setResult(result);
                 reVO.setJudgementTime(reportAffair.getOccurredTime());
+                Integer casePhaseId = reportAffair.getAssoCasePhaseId();
+                ReportAffairCasePhase casePhase = reportAffairCasePhaseMapper.selectById(casePhaseId);
+                if (ObjectUtils.isNotEmpty(casePhase)) {
+                    reVO.setCasePhase(casePhase.getCasePhase());
+                    reVO.setCaseChildPhase(casePhase.getCaseChildPhase());
+                    reVO.setFlowType(casePhase.getFlowType());
+                }
             }
         } else {
             //无效决定书
-            Integer affairType = 3;
+            Integer affairType = 7;
             LambdaQueryWrapper<ReportAffair> invalidRecordWrapper = new LambdaQueryWrapper<>();
-            invalidRecordWrapper.eq(ReportAffair::getAffairType, affairType)
+            invalidRecordWrapper.eq(ReportAffair::getAssoCasePhaseId, affairType)
                     .eq(ReportAffair::getProjectId, reportProject.getProjectId())
-                    .orderByDesc(ReportAffair::getCreateTime)
+                    .orderByDesc(ReportAffair::getOccurredTime)
                     .last("LIMIT 1");
             ReportAffair reportAffair1 = reportAffairService.getOne(invalidRecordWrapper, false);
             if (reportAffair1 != null) {
@@ -359,6 +380,13 @@ public class InvalidRecordService extends ServiceImpl<InvalidRecordMapper, Inval
                         reVO.setJudgementTime(reportAffair1.getOccurredTime());
                     }
                 }
+                Integer casePhaseId = reportAffair1.getAssoCasePhaseId();
+                ReportAffairCasePhase casePhase = reportAffairCasePhaseMapper.selectById(casePhaseId);
+                if (ObjectUtils.isNotEmpty(casePhase)) {
+                    reVO.setCasePhase(casePhase.getCasePhase());
+                    reVO.setCaseChildPhase(casePhase.getCaseChildPhase());
+                    reVO.setFlowType(casePhase.getFlowType());
+                }
             }
         }
         return reVO;

+ 10 - 2
src/main/java/cn/cslg/pas/service/business/InvalidRequestFileService.java

@@ -16,6 +16,8 @@ import cn.cslg.pas.service.report.SendReportMailService;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.ObjectUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Lazy;
@@ -58,15 +60,17 @@ public class InvalidRequestFileService extends ServiceImpl<InvalidRequestFileMap
         if (projectId == null) {
             throw new XiaoShiException("报告id为空");
         }
+        if (ObjectUtils.isEmpty(addInvalidRequestFileDTO.getAssoCasePhaseId())) {
+            throw new XiaoShiException("案件流程阶段id为空");
+        }
         //1. 首先上传报告事务,拿到报告事务id
         ReportAffairDTO reportAffairDTO = new ReportAffairDTO();
         reportAffairDTO.setProjectId(projectId);
-        //无效请求书 1
-        reportAffairDTO.setAffairType(1);
         //发生时间是无效请求日
         reportAffairDTO.setOccurredTime(addInvalidRequestFileDTO.getInvalidRequestDate());
         //备注
         reportAffairDTO.setDescription(addInvalidRequestFileDTO.getDescription());
+        reportAffairDTO.setAssoCasePhaseId(addInvalidRequestFileDTO.getAssoCasePhaseId());
         Integer reportAffairId = reportAffairService.addReportAffair(reportAffairDTO);
 
         if (reportAffairId == null) {
@@ -124,6 +128,9 @@ public class InvalidRequestFileService extends ServiceImpl<InvalidRequestFileMap
         if (projectId == null) {
             throw new XiaoShiException("报告id为空");
         }
+        if (ObjectUtils.isEmpty(updateInvalidRequestFileDTO.getAssoCasePhaseId())) {
+            throw new XiaoShiException("案件流程阶段id为空");
+        }
         //1. 根据id查出无效请求书
         InvalidRequestFile invalidRequestFile = this.getById(id);
         if (invalidRequestFile == null) {
@@ -139,6 +146,7 @@ public class InvalidRequestFileService extends ServiceImpl<InvalidRequestFileMap
         reportAffair.setOccurredTime(updateInvalidRequestFileDTO.getInvalidRequestDate());
         //备注
         reportAffair.setDescription(updateInvalidRequestFileDTO.getDescription());
+        reportAffair.setAssoCasePhaseId(updateInvalidRequestFileDTO.getAssoCasePhaseId());
         reportAffair.updateById();
         //3. 更新报告事务与文件关联
         List<String> fileGuids = updateInvalidRequestFileDTO.getFileGuids();

+ 10 - 2
src/main/java/cn/cslg/pas/service/business/OralTrailService.java

@@ -18,6 +18,8 @@ import cn.cslg.pas.service.report.SendReportMailService;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.ObjectUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Lazy;
@@ -56,15 +58,17 @@ public class OralTrailService extends ServiceImpl<OralTrailMapper, OralTrail> {
         if (projectId == null) {
             throw new XiaoShiException("报告id为空");
         }
+        if (ObjectUtils.isEmpty(addOralTrailDTO.getAssoCasePhaseId())) {
+            throw new XiaoShiException("案件流程阶段id为空");
+        }
         //1. 首先上传报告事务,拿到报告事务id
         ReportAffairDTO reportAffairDTO = new ReportAffairDTO();
         reportAffairDTO.setProjectId(projectId);
-        //口审记录 0
-        reportAffairDTO.setAffairType(0);
         //发生时间是口审时间
         reportAffairDTO.setOccurredTime(addOralTrailDTO.getOralTrailTime());
         //备注
         reportAffairDTO.setDescription(addOralTrailDTO.getDescription());
+        reportAffairDTO.setAssoCasePhaseId(addOralTrailDTO.getAssoCasePhaseId());
         Integer reportAffairId = reportAffairService.addReportAffair(reportAffairDTO);
 
         if (reportAffairId == null) {
@@ -127,6 +131,9 @@ public class OralTrailService extends ServiceImpl<OralTrailMapper, OralTrail> {
         if (projectId == null) {
             throw new XiaoShiException("报告id为空");
         }
+        if (ObjectUtils.isEmpty(updateOralTrailDTO.getAssoCasePhaseId())) {
+            throw new XiaoShiException("案件流程阶段id为空");
+        }
         //1. 根据id查出口审记录
         OralTrail oralTrail = this.getById(id);
         if (oralTrail == null) {
@@ -143,6 +150,7 @@ public class OralTrailService extends ServiceImpl<OralTrailMapper, OralTrail> {
         reportAffair.setOccurredTime(updateOralTrailDTO.getOralTrailTime());
         //备注
         reportAffair.setDescription(updateOralTrailDTO.getDescription());
+        reportAffair.setAssoCasePhaseId(updateOralTrailDTO.getAssoCasePhaseId());
         reportAffair.updateById();
         //3. 更新报告事务与文件关联
         List<String> fileGuids = updateOralTrailDTO.getFileGuids();

+ 16 - 2
src/main/java/cn/cslg/pas/service/business/OtherDocumentsService.java

@@ -15,6 +15,8 @@ import cn.cslg.pas.service.report.SendReportMailService;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.ObjectUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -56,15 +58,20 @@ public class OtherDocumentsService extends ServiceImpl<OtherDocumentsMapper, Oth
         if (projectId == null) {
             throw new XiaoShiException("报告id为空");
         }
+        if (ObjectUtils.isEmpty(addOtherDocumentsDTO.getAssoCasePhaseId())) {
+            throw new XiaoShiException("案件流程阶段id为空");
+        }
         //1. 首先上传报告事务,拿到报告事务id
         ReportAffairDTO reportAffairDTO = new ReportAffairDTO();
         reportAffairDTO.setProjectId(projectId);
-        //其他文档 8
-        reportAffairDTO.setAffairType(8);
         //发生时间是文档时间
         reportAffairDTO.setOccurredTime(addOtherDocumentsDTO.getDocumentTime());
         //备注
         reportAffairDTO.setDescription(addOtherDocumentsDTO.getDescription());
+        reportAffairDTO.setAssoCasePhaseId(addOtherDocumentsDTO.getAssoCasePhaseId());
+        if (StringUtils.isNotEmpty(addOtherDocumentsDTO.getCaseChildPhase())) {
+            reportAffairDTO.setCaseChildPhase(addOtherDocumentsDTO.getCaseChildPhase());
+        }
         Integer reportAffairId = reportAffairService.addReportAffair(reportAffairDTO);
 
         if (reportAffairId == null) {
@@ -111,6 +118,9 @@ public class OtherDocumentsService extends ServiceImpl<OtherDocumentsMapper, Oth
         if (projectId == null) {
             throw new XiaoShiException("报告id为空");
         }
+        if (ObjectUtils.isEmpty(updateOtherDocumentsDTO.getAssoCasePhaseId())) {
+            throw new XiaoShiException("案件流程阶段id为空");
+        }
         //1. 根据id查出其他文档
         OtherDocuments otherDocuments = this.getById(id);
         if (otherDocuments == null) {
@@ -126,6 +136,10 @@ public class OtherDocumentsService extends ServiceImpl<OtherDocumentsMapper, Oth
         reportAffair.setOccurredTime(updateOtherDocumentsDTO.getDocumentTime());
         //备注
         reportAffair.setDescription(updateOtherDocumentsDTO.getDescription());
+        reportAffair.setAssoCasePhaseId(updateOtherDocumentsDTO.getAssoCasePhaseId());
+        if (StringUtils.isNotEmpty(updateOtherDocumentsDTO.getCaseChildPhase())) {
+            reportAffair.setCaseChildPhase(updateOtherDocumentsDTO.getCaseChildPhase());
+        }
         reportAffair.updateById();
         //3. 更新报告事务与文件关联
         LambdaQueryWrapper<AssoReportAffairFile> queryWrapper = new LambdaQueryWrapper<>();

+ 234 - 31
src/main/java/cn/cslg/pas/service/business/ReportAffairService.java

@@ -9,11 +9,14 @@ import cn.cslg.pas.common.model.report.ExtraEmailDTO;
 import cn.cslg.pas.common.model.report.MailMessageDTO;
 import cn.cslg.pas.common.utils.CacheUtils;
 import cn.cslg.pas.common.utils.LoginUtils;
+import cn.cslg.pas.common.vo.business.CronVO;
 import cn.cslg.pas.common.vo.invalidVO.*;
 import cn.cslg.pas.domain.BaseEntity;
 import cn.cslg.pas.domain.business.*;
 import cn.cslg.pas.exception.XiaoShiException;
+import cn.cslg.pas.mapper.ReportAffairCasePhaseMapper;
 import cn.cslg.pas.mapper.ReportAffairMapper;
+import cn.cslg.pas.mapper.ReportProjectMapper;
 import cn.cslg.pas.service.MailSendService;
 import cn.cslg.pas.service.common.FileManagerService;
 import cn.cslg.pas.service.permissions.PermissionService;
@@ -22,6 +25,8 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.ObjectUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Lazy;
@@ -77,6 +82,21 @@ public class ReportAffairService extends ServiceImpl<ReportAffairMapper, ReportA
     @Autowired
     private MailSendService mailSendService;
 
+    @Autowired
+    private ReportAffairCasePhaseMapper reportAffairCasePhaseMapper;
+
+    @Autowired
+    private AssoInvalidDecisionCronService assoInvalidDecisionCronService;
+
+    @Autowired
+    private SystemDictService systemDictService;
+
+    @Autowired
+    private AssoReportCronService assoReportCronService;
+
+    @Autowired
+    private ReportProjectMapper reportProjectMapper;
+
     /**
      * 创建报告事务
      *
@@ -109,24 +129,45 @@ public class ReportAffairService extends ServiceImpl<ReportAffairMapper, ReportA
                 LambdaQueryWrapper<AssoReportAffairFile> queryWrapper2 = new LambdaQueryWrapper<>();
                 queryWrapper2.eq(AssoReportAffairFile::getReportAffairId, id);
                 assoReportAffairFileService.remove(queryWrapper2);
+                Integer assoCasePhaseId = reportAffair.getAssoCasePhaseId();
+                ReportAffairCasePhase casePhase = reportAffairCasePhaseMapper.selectById(assoCasePhaseId);
+                Integer flowType = casePhase.getFlowType();
                 // 根据类型删除对应信息
-                if (reportAffair.getAffairType() == 1) { //无效请求书
+                if (flowType.equals(1)) { //无效请求书
                     LambdaQueryWrapper<InvalidRequestFile> queryWrapper1 = new LambdaQueryWrapper<>();
                     queryWrapper1.eq(InvalidRequestFile::getReportAffairId, id);
                     invalidRequestFileService.remove(queryWrapper1);
-                } else if (reportAffair.getAffairType() == 0) {//口审查记录
+                } else if (flowType.equals(6)) {//口审查记录
                     LambdaQueryWrapper<OralTrail> queryWrapper1 = new LambdaQueryWrapper<>();
                     queryWrapper1.eq(OralTrail::getReportAffairId, id);
                     oralTrailService.remove(queryWrapper1);
-                } else if (reportAffair.getAffairType() == 3) {//无效决定书
+                } else if (flowType.equals(7)) {//无效决定书
+                    Integer projectId = reportAffair.getProjectId();
+                    //删除报告中的发文序号
+                    ReportProject reportProject = reportProjectMapper.selectOne(new LambdaQueryWrapper<ReportProject>()
+                            .eq(ReportProject::getProjectId, projectId));
+                    reportProject.setId(reportProject.getId());
+                    reportProject.setIssueNumber(null);
+                    reportProject.updateById();
+                    //删除报告无效结果与报告关联
+                    LambdaQueryWrapper<AssoReportCron> reportCronWrapper = new LambdaQueryWrapper<>();
+                    reportCronWrapper.eq(AssoReportCron::getProjectId, projectId);
+                    assoReportCronService.remove(reportCronWrapper);
+                    //删除无效决定书和无效结果关联
+                    InvalidDecisionFile decisionFile = invalidDecisionFileService.getOne(new LambdaQueryWrapper<InvalidDecisionFile>()
+                            .eq(InvalidDecisionFile::getReportAffairId, id));
+                    LambdaQueryWrapper<AssoInvalidDecisionCron> wrapper = new LambdaQueryWrapper<>();
+                    wrapper.eq(AssoInvalidDecisionCron::getInvalidDecisionId, decisionFile.getId());
+                    assoInvalidDecisionCronService.remove(wrapper);
+                    //无效决定书
                     LambdaQueryWrapper<InvalidDecisionFile> queryWrapper1 = new LambdaQueryWrapper<>();
                     queryWrapper1.eq(InvalidDecisionFile::getReportAffairId, id);
                     invalidDecisionFileService.remove(queryWrapper1);
-                } else if (reportAffair.getAffairType().equals(5)) {//行政诉讼判决书
+                } else if (flowType.equals(16) || flowType.equals(26)) {//行政诉讼判决书
                     LambdaQueryWrapper<CourtOrder> queryWrapper1 = new LambdaQueryWrapper<>();
                     queryWrapper1.eq(CourtOrder::getReportAffairId, id);
                     courtOrderService.remove(queryWrapper1);
-                } else if (reportAffair.getAffairType().equals(8)) {//其他文档
+                } else if (flowType.equals(17) || flowType.equals(27) || flowType.equals(28)) {//其他文档
                     LambdaQueryWrapper<OtherDocuments> queryWrapper1 = new LambdaQueryWrapper<>();
                     queryWrapper1.eq(OtherDocuments::getReportAffairId, id);
                     otherDocumentsService.remove(queryWrapper1);
@@ -162,30 +203,44 @@ public class ReportAffairService extends ServiceImpl<ReportAffairMapper, ReportA
 
 
     public List<ReportAffairVO> loadReportAffairVOS(List<ReportAffair> reportAffairs) {
+        List<Integer> collect = reportAffairs.stream().map(ReportAffair::getAssoCasePhaseId).collect(Collectors.toList());
+        List<ReportAffairCasePhase> phaseList = new ArrayList<>();
+        if (!CollectionUtils.isEmpty(collect)) {
+            List<ReportAffairCasePhase> phases = reportAffairCasePhaseMapper.selectList(new LambdaQueryWrapper<ReportAffairCasePhase>()
+                    .in(BaseEntity::getId, collect));
+            phaseList.addAll(phases);
+        }
         List<ReportAffairVO> reportAffairVOS = new ArrayList<>();
         reportAffairs.forEach(item -> {
             ReportAffairVO reportAffairVO = new ReportAffairVO();
             BeanUtils.copyProperties(item, reportAffairVO);
-            //根据事务类型选择不同的装载方式
-            Integer type = reportAffairVO.getAffairType();
-            if (type.equals(0)) {//0 口审记录
-                this.loadOralTrail(reportAffairVO);
-            } else if (type.equals(1)) {//1 无效请求书
-                this.loadInvalidRequestFile(reportAffairVO);
-            } else if (type.equals(2)) {//2 陈述意见书
-                this.loadStateOpinion(reportAffairVO);
-            } else if (type.equals(3)) {//3 无效决定书
-                this.loadInvalidDecisionFile(reportAffairVO);
-            } else if (type.equals(4)) {//4 行政诉讼书
-                this.loadAdminProceed(reportAffairVO);
-            } else if (type.equals(5)) {//5 行政诉讼判决书
-                this.loadJudgment(reportAffairVO);
-            } else if (type.equals(6)) {//6 权要修改记录
-                this.loadClaimHistory(reportAffairVO);
-            } else if (type.equals(7)) {//7 补充证据及理由
-                this.loadSupplyEvidence(reportAffairVO);
-            } else if (type.equals(8)) {//8 其他文档
-                this.loadOtherDocuments(reportAffairVO);
+            ReportAffairCasePhase casePhase = phaseList.stream().filter(i -> i.getId().equals(item.getAssoCasePhaseId())).findFirst().orElse(null);
+            if (ObjectUtils.isNotEmpty(casePhase)) {
+                Integer type = casePhase.getFlowType();
+                reportAffairVO.setFlowName(casePhase.getFlowName());
+                reportAffairVO.setFlowType(type);
+                reportAffairVO.setCasePhase(casePhase.getCasePhase());
+                reportAffairVO.setCaseChildPhase(casePhase.getCaseChildPhase());
+                if (type.equals(6)) {//6 口审记录
+                    this.loadOralTrail(reportAffairVO);
+                } else if (type.equals(1)) {//1 无效请求书
+                    this.loadInvalidRequestFile(reportAffairVO);
+                } else if (type.equals(5)) {//5 陈述意见书
+                    this.loadStateOpinion(reportAffairVO);
+                } else if (type.equals(7)) {//7 无效决定书
+                    this.loadInvalidDecisionFile(reportAffairVO);
+                } else if (type.equals(15) || type.equals(25)) {//15 25 行政诉讼书
+                    this.loadAdminProceed(reportAffairVO);
+                } else if (type.equals(16) || type.equals(26)) {//16 26 行政诉讼判决书
+                    this.loadJudgment(reportAffairVO);
+                } else if (type.equals(2)) {//2 权要修改记录
+                    this.loadClaimHistory(reportAffairVO);
+                } else if (type.equals(3)) {//3 补充证据及理由
+                    this.loadSupplyEvidence(reportAffairVO);
+                } else if (type.equals(17) || type.equals(27) || type.equals(28)) {//17 27 28其他文档
+                    this.loadOtherDocuments(reportAffairVO);
+                    reportAffairVO.setCaseChildPhase(item.getCaseChildPhase());
+                }
             }
             reportAffairVOS.add(reportAffairVO);
         });
@@ -194,6 +249,11 @@ public class ReportAffairService extends ServiceImpl<ReportAffairMapper, ReportA
             this.loadSystemFile(reportAffairVOS);
             //装载创建人名
             this.loadCreateName(reportAffairVOS);
+            List<ReportAffairVO> affairVOS = reportAffairVOS.stream().filter(i -> i.getFlowType().equals(7)).collect(Collectors.toList());
+            if (!CollectionUtils.isEmpty(affairVOS)) {
+                //装载无效决定书与无效结果关联
+                this.loadAssoInvalidDecisionCron(affairVOS);
+            }
         }
         return reportAffairVOS;
     }
@@ -291,6 +351,46 @@ public class ReportAffairService extends ServiceImpl<ReportAffairMapper, ReportA
     }
 
     /**
+     * 装载无效决定书与无效结果关联
+     * @param reportAffairVOS
+     */
+    public void loadAssoInvalidDecisionCron(List<ReportAffairVO> reportAffairVOS) {
+        if (!CollectionUtils.isEmpty(reportAffairVOS)) {
+            List<InvalidDecisionFileVO> decisionFileVOS = reportAffairVOS.stream().map(ReportAffairVO::getInvalidDecisionFileVO).collect(Collectors.toList());
+            List<Integer> invalidDecisionIds = decisionFileVOS.stream().map(InvalidDecisionFileVO::getInvalidDecisionFileId).collect(Collectors.toList());
+            //查询核心结论
+            LambdaQueryWrapper<AssoInvalidDecisionCron> reportCronLambdaQueryWrapper = new LambdaQueryWrapper<>();
+            reportCronLambdaQueryWrapper.in(AssoInvalidDecisionCron::getInvalidDecisionId, invalidDecisionIds);
+            List<AssoInvalidDecisionCron> crons = assoInvalidDecisionCronService.list(reportCronLambdaQueryWrapper);
+            List<SystemDict> systemDictList = new ArrayList<>();
+            if (!CollectionUtils.isEmpty(crons)) {
+                LambdaQueryWrapper<SystemDict> systemDictLambdaQueryWrapper = new LambdaQueryWrapper<>();
+                systemDictLambdaQueryWrapper.eq(SystemDict::getGroupType, "ASSESS");
+                systemDictList = systemDictService.list(systemDictLambdaQueryWrapper);
+            }
+
+            for (InvalidDecisionFileVO decisionFileVO : decisionFileVOS) {
+                List<Integer> reCronIds = new ArrayList<>();
+                List<String> reCronNames = new ArrayList<>();
+                if (!CollectionUtils.isEmpty(crons)) {
+                    List<AssoInvalidDecisionCron> decisionCrons = crons.stream().filter(item -> item.getInvalidDecisionId().equals(decisionFileVO.getInvalidDecisionFileId())).collect(Collectors.toList());
+                    if (!CollectionUtils.isEmpty(decisionCrons)) {
+                        //过滤出事件
+                        List<Integer> cronIds = decisionCrons.stream().map(AssoInvalidDecisionCron::getCronId).collect(Collectors.toList());
+                        List<SystemDict> systemDicts = systemDictList.stream().filter(item -> cronIds.contains(Integer.parseInt(item.getValue()))).collect(Collectors.toList());
+                        systemDicts.forEach(item -> {
+                            reCronIds.add(Integer.parseInt(item.getValue()));
+                            reCronNames.add(item.getLabel());
+                        });
+                    }
+                }
+                decisionFileVO.setCronIds(reCronIds);
+                decisionFileVO.setCronNames(reCronNames);
+            }
+        }
+    }
+
+    /**
      * 装载行政诉讼书
      *
      * @param reportAffairVO
@@ -314,15 +414,17 @@ public class ReportAffairService extends ServiceImpl<ReportAffairMapper, ReportA
         if (projectId == null) {
             throw new XiaoShiException("报告id为空");
         }
+        if (ObjectUtils.isEmpty(addStateOpinionDTO.getAssoCasePhaseId())) {
+            throw new XiaoShiException("案件流程阶段id为空");
+        }
         //1. 首先上传报告事务,拿到报告事务id
         ReportAffairDTO reportAffairDTO = new ReportAffairDTO();
         reportAffairDTO.setProjectId(projectId);
-        //陈述意见书 2
-        reportAffairDTO.setAffairType(2);
         //发生时间是无效请求日
         reportAffairDTO.setOccurredTime(addStateOpinionDTO.getStateReplyTime());
         //备注
         reportAffairDTO.setDescription(addStateOpinionDTO.getDescription());
+        reportAffairDTO.setAssoCasePhaseId(addStateOpinionDTO.getAssoCasePhaseId());
         Integer reportAffairId = this.addReportAffair(reportAffairDTO);
 
         if (reportAffairId == null) {
@@ -363,6 +465,9 @@ public class ReportAffairService extends ServiceImpl<ReportAffairMapper, ReportA
         if (projectId == null) {
             throw new XiaoShiException("报告id为空");
         }
+        if (ObjectUtils.isEmpty(updateStateOpinionDTO.getAssoCasePhaseId())) {
+            throw new XiaoShiException("案件流程阶段id为空");
+        }
         //2. 拿到报告事务id,获取报告事务
         ReportAffair reportAffair = this.getById(reportAffairId);
         reportAffair.setProjectId(projectId);
@@ -370,6 +475,7 @@ public class ReportAffairService extends ServiceImpl<ReportAffairMapper, ReportA
         reportAffair.setOccurredTime(updateStateOpinionDTO.getStateReplyTime());
         //备注
         reportAffair.setDescription(updateStateOpinionDTO.getDescription());
+        reportAffair.setAssoCasePhaseId(updateStateOpinionDTO.getAssoCasePhaseId());
         reportAffair.updateById();
         //3. 更新报告事务与文件关联
         List<String> fileGuids = updateStateOpinionDTO.getFileGuids();
@@ -428,15 +534,17 @@ public class ReportAffairService extends ServiceImpl<ReportAffairMapper, ReportA
         if (projectId == null) {
             throw new XiaoShiException("报告id为空");
         }
+        if (ObjectUtils.isEmpty(addClaimHistoryDTO.getAssoCasePhaseId())) {
+            throw new XiaoShiException("案件流程阶段id为空");
+        }
         //1. 首先上传报告事务,拿到报告事务id
         ReportAffairDTO reportAffairDTO = new ReportAffairDTO();
         reportAffairDTO.setProjectId(projectId);
-        //权要修改历史 6
-        reportAffairDTO.setAffairType(6);
         //发生时间是无效请求日
         reportAffairDTO.setOccurredTime(addClaimHistoryDTO.getClaimHistoryTime());
         //备注
         reportAffairDTO.setDescription(addClaimHistoryDTO.getDescription());
+        reportAffairDTO.setAssoCasePhaseId(addClaimHistoryDTO.getAssoCasePhaseId());
         Integer reportAffairId = this.addReportAffair(reportAffairDTO);
 
         if (reportAffairId == null) {
@@ -477,6 +585,9 @@ public class ReportAffairService extends ServiceImpl<ReportAffairMapper, ReportA
         if (projectId == null) {
             throw new XiaoShiException("报告id为空");
         }
+        if (ObjectUtils.isEmpty(updateClaimHistoryDTO.getAssoCasePhaseId())) {
+            throw new XiaoShiException("案件流程阶段id为空");
+        }
         //2. 拿到报告事务id,获取报告事务
         ReportAffair reportAffair = this.getById(reportAffairId);
         reportAffair.setProjectId(projectId);
@@ -484,6 +595,7 @@ public class ReportAffairService extends ServiceImpl<ReportAffairMapper, ReportA
         reportAffair.setOccurredTime(updateClaimHistoryDTO.getClaimHistoryTime());
         //备注
         reportAffair.setDescription(updateClaimHistoryDTO.getDescription());
+        reportAffair.setAssoCasePhaseId(updateClaimHistoryDTO.getAssoCasePhaseId());
         reportAffair.updateById();
         //3. 更新报告事务与文件关联
         List<String> fileGuids = updateClaimHistoryDTO.getFileGuids();
@@ -507,15 +619,17 @@ public class ReportAffairService extends ServiceImpl<ReportAffairMapper, ReportA
         if (projectId == null) {
             throw new XiaoShiException("报告id为空");
         }
+        if (ObjectUtils.isEmpty(addSupplyEvidenceDTO.getAssoCasePhaseId())) {
+            throw new XiaoShiException("案件流程阶段id为空");
+        }
         //1. 首先上传报告事务,拿到报告事务id
         ReportAffairDTO reportAffairDTO = new ReportAffairDTO();
         reportAffairDTO.setProjectId(projectId);
-        //补充证据及理由 7
-        reportAffairDTO.setAffairType(7);
         //发生时间是无效请求日
         reportAffairDTO.setOccurredTime(addSupplyEvidenceDTO.getSupplyEvidenceTime());
         //备注
         reportAffairDTO.setDescription(addSupplyEvidenceDTO.getDescription());
+        reportAffairDTO.setAssoCasePhaseId(addSupplyEvidenceDTO.getAssoCasePhaseId());
         Integer reportAffairId = this.addReportAffair(reportAffairDTO);
 
         if (reportAffairId == null) {
@@ -556,6 +670,9 @@ public class ReportAffairService extends ServiceImpl<ReportAffairMapper, ReportA
         if (projectId == null) {
             throw new XiaoShiException("报告id为空");
         }
+        if (ObjectUtils.isEmpty(updateSupplyEvidenceDTO.getAssoCasePhaseId())) {
+            throw new XiaoShiException("案件流程阶段id为空");
+        }
         //2. 拿到报告事务id,获取报告事务
         ReportAffair reportAffair = this.getById(reportAffairId);
         reportAffair.setProjectId(projectId);
@@ -563,6 +680,7 @@ public class ReportAffairService extends ServiceImpl<ReportAffairMapper, ReportA
         reportAffair.setOccurredTime(updateSupplyEvidenceDTO.getSupplyEvidenceTime());
         //备注
         reportAffair.setDescription(updateSupplyEvidenceDTO.getDescription());
+        reportAffair.setAssoCasePhaseId(updateSupplyEvidenceDTO.getAssoCasePhaseId());
         reportAffair.updateById();
         //3. 更新报告事务与文件关联
         List<String> fileGuids = updateSupplyEvidenceDTO.getFileGuids();
@@ -613,4 +731,89 @@ public class ReportAffairService extends ServiceImpl<ReportAffairMapper, ReportA
         reportAffairVO.setOtherDocumentsVO(otherDocumentsVO);
     }
 
+    /**
+     * 添加案件文档
+     * @param vo
+     * @return
+     */
+    public Integer addReportAffairCase(ReportAffairCaseDTO vo){
+        if (ObjectUtils.isEmpty(vo)) {
+            throw new XiaoShiException("入参为空");
+        }
+        Integer projectId = vo.getProjectId();
+        if (projectId == null) {
+            throw new XiaoShiException("报告id为空");
+        }
+        if (ObjectUtils.isEmpty(vo.getAssoCasePhaseId())) {
+            throw new XiaoShiException("案件流程阶段id为空");
+        }
+        //1. 首先上传报告事务,拿到报告事务id
+        ReportAffairDTO reportAffairDTO = new ReportAffairDTO();
+        reportAffairDTO.setProjectId(projectId);
+        //发生时间是无效请求日
+        reportAffairDTO.setOccurredTime(vo.getOccurredTime());
+        //备注
+        reportAffairDTO.setDescription(vo.getDescription());
+        reportAffairDTO.setAssoCasePhaseId(vo.getAssoCasePhaseId());
+        Integer reportAffairId = this.addReportAffair(reportAffairDTO);
+
+        if (reportAffairId == null) {
+            throw new XiaoShiException("上传报告事务失败");
+        }
+        //3. 添加报告事务与文件关联
+        List<String> fileGuids = vo.getFileGuids();
+        if (!CollectionUtils.isEmpty(fileGuids)) {
+            List<AssoReportAffairFile> assoReportAffairFiles = new ArrayList<>();
+            fileGuids.forEach(item -> {
+                AssoReportAffairFile assoReportAffairFile = new AssoReportAffairFile();
+                assoReportAffairFile.setReportAffairId(reportAffairId);
+                assoReportAffairFile.setFileGuid(item);
+                assoReportAffairFiles.add(assoReportAffairFile);
+            });
+            assoReportAffairFileService.saveBatch(assoReportAffairFiles);
+        }
+        if (vo.getIfSendEmail()) {
+            sendReportMailService.finalSendEmail(projectId, fileGuids, vo.getExtraEmailDTOS());
+        }
+        return reportAffairId;
+    }
+
+    /**
+     * 修改案件文档
+     * @param vo
+     * @return
+     */
+    public Integer updateReportAffairCase(ReportAffairCaseDTO vo){
+        if (ObjectUtils.isEmpty(vo)) {
+            throw new XiaoShiException("入参为空");
+        }
+        Integer projectId = vo.getProjectId();
+        Integer reportAffairId = vo.getId();
+        if (reportAffairId == null) {
+            throw new XiaoShiException("reportAffairId为空");
+        }
+        if (projectId == null) {
+            throw new XiaoShiException("报告id为空");
+        }
+        if (ObjectUtils.isEmpty(vo.getAssoCasePhaseId())) {
+            throw new XiaoShiException("案件流程阶段id为空");
+        }
+        //2. 拿到报告事务id,获取报告事务
+        ReportAffair reportAffair = this.getById(reportAffairId);
+        reportAffair.setProjectId(projectId);
+        //发生时间是无效请求日
+        reportAffair.setOccurredTime(vo.getOccurredTime());
+        //备注
+        reportAffair.setDescription(vo.getDescription());
+        reportAffair.setAssoCasePhaseId(vo.getAssoCasePhaseId());
+        reportAffair.updateById();
+        //3. 更新报告事务与文件关联
+        List<String> fileGuids = vo.getFileGuids();
+        assoReportAffairFileService.updateAffairFile(reportAffairId, fileGuids);
+        if (vo.getIfSendEmail()) {
+            sendReportMailService.finalSendEmail(projectId, fileGuids, vo.getExtraEmailDTOS());
+        }
+        return reportAffairId;
+    }
+
 }

+ 25 - 5
src/main/java/cn/cslg/pas/service/business/ReportProjectService.java

@@ -14,6 +14,8 @@ import cn.cslg.pas.common.utils.CacheUtils;
 import cn.cslg.pas.common.utils.LoginUtils;
 import cn.cslg.pas.common.vo.DepartmentVO;
 import cn.cslg.pas.common.vo.PatentWithIdVO;
+import cn.cslg.pas.common.vo.QueryCasePhaseVO;
+import cn.cslg.pas.common.vo.QueryReportAffairConclusionVO;
 import cn.cslg.pas.common.vo.business.*;
 import cn.cslg.pas.domain.business.*;
 import cn.cslg.pas.domain.es.Patent;
@@ -23,10 +25,7 @@ import cn.cslg.pas.exception.XiaoShiException;
 import cn.cslg.pas.factorys.businessFactory.Business;
 import cn.cslg.pas.factorys.reGroupFactory.QueryGroupFactory;
 import cn.cslg.pas.factorys.reGroupFactory.QueryGroupImp;
-import cn.cslg.pas.mapper.AssoProjectEventMapper;
-import cn.cslg.pas.mapper.EventMapper;
-import cn.cslg.pas.mapper.PatentProjectMapper;
-import cn.cslg.pas.mapper.ReportProjectMapper;
+import cn.cslg.pas.mapper.*;
 import cn.cslg.pas.service.business.es.EsPatentService;
 import cn.cslg.pas.service.business.es.EsService;
 import cn.cslg.pas.service.common.FileManagerService;
@@ -117,13 +116,14 @@ public class ReportProjectService extends ServiceImpl<ReportProjectMapper, Repor
     @Autowired
     @Lazy
     private CompareLiteratureService compareLiteratureService;
+    @Autowired
+    private ReportAffairMapper reportAffairMapper;
 
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Object queryMessage(QueryRequest queryRequest) throws Exception {
         String tableName = "reportProject";
         Boolean ifInvalidReport = queryRequest.getIfInvalidReport();
-        ;
         if (ifInvalidReport != null && ifInvalidReport) {
             tableName = "invalidReportProject";
         }
@@ -678,6 +678,8 @@ public class ReportProjectService extends ServiceImpl<ReportProjectMapper, Repor
         List<String> guids = new ArrayList<>();
         List<SystemFile> systemFiles = new ArrayList<>();
         List<AssoProjectFile> assoEventFiles = new ArrayList<>();
+        List<QueryCasePhaseVO> casePhaseVOS = new ArrayList<>();
+        List<QueryReportAffairConclusionVO> conclusionVOS = new ArrayList<>();
 
 
         //查询部门名称
@@ -727,6 +729,9 @@ public class ReportProjectService extends ServiceImpl<ReportProjectMapper, Repor
             assoProjectPersonList = assoProjectPersonService.list(projectPersonLambdaQueryWrapper);
             List<String> personIds = assoProjectPersonList.stream().map(AssoProjectPerson::getPersonId).collect(Collectors.toList());
             createIds.addAll(personIds);
+
+            casePhaseVOS = reportAffairMapper.queryCasePhase(ids);
+            conclusionVOS = reportAffairMapper.queryReportAffairConclusion(ids);
         }
 
         //查询创建人名称
@@ -907,6 +912,21 @@ public class ReportProjectService extends ServiceImpl<ReportProjectMapper, Repor
             reportProjectVO.setCronIds(reCronIds);
             reportProjectVO.setCronNames(reCronNames);
 
+            //装载案件阶段与案件子阶段
+            if (!CollectionUtils.isEmpty(casePhaseVOS)) {
+                QueryCasePhaseVO casePhaseVO = casePhaseVOS.stream().filter(i -> i.getProjectId().equals(reportProjectVO.getId())).findFirst().orElse(null);
+                if (casePhaseVO != null) {
+                    reportProjectVO.setCasePhase(casePhaseVO.getCasePhase());
+                    reportProjectVO.setCaseChildPhase(casePhaseVO.getCaseChildPhase());
+                }
+            }
+            //装载行诉结果
+            if (!CollectionUtils.isEmpty(conclusionVOS)) {
+                QueryReportAffairConclusionVO conclusionVO = conclusionVOS.stream().filter(i -> i.getProjectId().equals(reportProjectVO.getId())).findFirst().orElse(null);
+                if (conclusionVO != null) {
+                    reportProjectVO.setConclusion(conclusionVO.getConclusion());
+                }
+            }
             //装载报告类型
             SystemDict systemDict = reportTypeList.stream().filter(item -> reportProjectVO.getReportType().equals(Integer.parseInt(item.getValue())) && item.getType().equals("REPORT_TYPE")).findFirst().orElse(null);
             if (systemDict != null) {

+ 169 - 0
src/main/java/cn/cslg/pas/service/novelty/LitigationService.java

@@ -0,0 +1,169 @@
+package cn.cslg.pas.service.novelty;
+
+import cn.cslg.pas.common.model.novelty.LitigationDTO;
+import cn.cslg.pas.common.model.novelty.LitigationReVO;
+import cn.cslg.pas.common.model.novelty.LitigationVO;
+import cn.cslg.pas.domain.business.CourtOrder;
+import cn.cslg.pas.domain.business.ReportAffair;
+import cn.cslg.pas.exception.ExceptionEnum;
+import cn.cslg.pas.exception.XiaoShiException;
+import cn.cslg.pas.service.business.CourtOrderService;
+import cn.cslg.pas.service.business.ReportAffairService;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import cn.cslg.pas.domain.business.novelty.Litigation;
+import cn.cslg.pas.mapper.novelty.LitigationMapper;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * @author admin
+ * @description 针对表【litigation(行政诉讼表)】的数据库操作Service实现
+ * @createDate 2025-02-27 10:49:21
+ */
+@Service
+@RequiredArgsConstructor
+public class LitigationService extends ServiceImpl<LitigationMapper, Litigation> {
+    private final ReportAffairService reportAffairService;
+    private final CourtOrderService courtOrderService;
+
+    public Litigation addLitigation(LitigationDTO litigationDTO) {
+        Litigation litigation = new Litigation();
+        BeanUtils.copyProperties(litigationDTO, litigation);
+        litigation.insert();
+        return litigation;
+    }
+
+    public Litigation updateLitigation(LitigationDTO litigationDTO, Litigation litigation) {
+        Litigation litigation1 = new Litigation();
+        BeanUtils.copyProperties(litigationDTO, litigation1);
+        litigation1.setCreateId(litigation.getCreateId());
+        litigation1.setCreateTime(litigation.getCreateTime());
+        litigation1.setId(litigation.getId());
+        litigation1.updateById();
+        return litigation;
+    }
+
+
+    public Litigation addOrUpdateLitigation(LitigationDTO litigationDTO) {
+        Integer projectId = litigationDTO.getProjectId();
+        Integer type = litigationDTO.getType();
+        if (projectId == null || type == null) {
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "未传入必要参数");
+        }
+        LambdaQueryWrapper<Litigation> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(Litigation::getProjectId, projectId)
+                .eq(Litigation::getType, type);
+        Litigation litigation = this.getOne(queryWrapper, false);
+        if (litigation == null) {
+            return this.addLitigation(litigationDTO);
+        } else {
+            return this.updateLitigation(litigationDTO, litigation);
+        }
+    }
+
+    public LitigationReVO queryLitigation(LitigationDTO litigationDTO) {
+        LitigationReVO litigationReVO = new LitigationReVO();
+        Integer projectId = litigationDTO.getProjectId();
+        LambdaQueryWrapper<Litigation> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(Litigation::getProjectId, projectId);
+        List<Litigation> list = this.list(queryWrapper);
+        if (CollectionUtils.isEmpty(list)) {
+            list = new ArrayList<>();
+        }
+
+        this.formatLitigations(list, 1);
+        this.formatLitigations(list, 2);
+        litigationReVO = this.loadLitigation(list, projectId);
+        return litigationReVO;
+    }
+
+    public LitigationReVO loadLitigation(List<Litigation> list, Integer projectId) {
+        LitigationReVO litigationReVO = new LitigationReVO();
+        if (list.size() == 0) {
+            return litigationReVO;
+        }
+        List<LitigationVO> litigationVOS = new ArrayList<>();
+        list.forEach(item -> {
+            LitigationVO litigationVO = new LitigationVO();
+            BeanUtils.copyProperties(item, litigationVO);
+            litigationVOS.add(litigationVO);
+        });
+
+        this.loadResultByAffair(projectId, litigationVOS);
+        litigationVOS.forEach(item -> {
+            if (item.getType().equals(1)) {
+                litigationReVO.setLitigationVO1(item);
+            } else {
+                litigationReVO.setLitigationVO2(item);
+            }
+        });
+        return litigationReVO;
+    }
+
+    public List<LitigationVO> loadResultByAffair(Integer projectId, List<LitigationVO> list) {
+        if (list.size() == 0) {
+            return list;
+        }
+        Integer litigationType1 = 16;
+        Integer litigationType2 = 26;
+        LambdaQueryWrapper<ReportAffair> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(ReportAffair::getProjectId, projectId)
+                .in(ReportAffair::getAssoCasePhaseId, Arrays.asList(litigationType1, litigationType2));
+        List<ReportAffair> reportAffairs = reportAffairService.list(queryWrapper);
+        if (reportAffairs == null || reportAffairs.size() == 0) {
+            return list;
+        }
+        List<Integer> reportAffairIds = reportAffairs.stream().map(ReportAffair::getId).collect(Collectors.toList());
+        List<CourtOrder> courtOrders = new ArrayList<>();
+        if (reportAffairIds.size() > 0) {
+            LambdaQueryWrapper<CourtOrder> queryWrapper1 = new LambdaQueryWrapper<>();
+            queryWrapper1.in(CourtOrder::getReportAffairId, reportAffairIds);
+            courtOrders = courtOrderService.list(queryWrapper1);
+        }
+        if (courtOrders.size() == 0) {
+            return list;
+        }
+        List<CourtOrder> finalCourtOrders = courtOrders;
+        list.forEach(item -> {
+            Integer affairType = litigationType1;
+            if (item.getType().equals(1)) {
+                affairType = litigationType1;
+            } else {
+                affairType = litigationType2;
+            }
+            Integer finalType = affairType;
+            ReportAffair reportAffair = reportAffairs.stream().filter(tem -> finalType.equals(tem.getAssoCasePhaseId())).findFirst().orElse(null);
+            if (reportAffair != null) {
+                Integer temAffairId = reportAffair.getId();
+                CourtOrder courtOrder = finalCourtOrders.stream().filter(tem -> tem.getReportAffairId().equals(temAffairId)).findFirst().orElse(null);
+                if (courtOrder != null) {
+                    item.setConclusion(courtOrder.getConclusion());
+                }
+            }
+
+        });
+        return list;
+    }
+
+    public List<Litigation> formatLitigations(List<Litigation> list, Integer type) {
+        Litigation litigation1 = list.stream().filter(item -> item.getType().equals(type)).findFirst().orElse(null);
+        if (litigation1 == null) {
+            litigation1 = new Litigation();
+            litigation1.setType(type);
+            list.add(litigation1);
+        }
+        return list;
+    }
+}
+
+
+
+

+ 35 - 2
src/main/java/cn/cslg/pas/service/report/IprPersonService.java

@@ -31,6 +31,7 @@ import org.springframework.web.bind.annotation.RequestBody;
 import javax.transaction.xa.XAException;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Objects;
 import java.util.stream.Collectors;
 
 /**
@@ -110,6 +111,9 @@ public class IprPersonService extends ServiceImpl<IprPersonMapper, IprPerson> {
         iprPerson.setName(updateIprPersonDTO.getName());
         iprPerson.setEmail(updateIprPersonDTO.getEmail());
         iprPerson.setIfDefault(updateIprPersonDTO.getIfDefault());
+        iprPerson.setRemark(updateIprPersonDTO.getRemark());
+        iprPerson.setType(updateIprPersonDTO.getType());
+        iprPerson.setAssoAccountId(updateIprPersonDTO.getAssoAccountId());
         iprPerson.updateById();
         return iprPerson;
     }
@@ -131,6 +135,7 @@ public class IprPersonService extends ServiceImpl<IprPersonMapper, IprPerson> {
         List<IprPerson> iprPersonList = new ArrayList<>();
         String name = queryIprPersonDTO.getName();
         String email = queryIprPersonDTO.getEmail();
+        Integer type = queryIprPersonDTO.getType();
         Boolean ifDefault = queryIprPersonDTO.getIfDefault();
         Long current = queryIprPersonDTO.getCurrent();
         Long size = queryIprPersonDTO.getSize();
@@ -147,6 +152,9 @@ public class IprPersonService extends ServiceImpl<IprPersonMapper, IprPerson> {
         if (email != null && !email.trim().equals("")) {
             queryWrapper.like(IprPerson::getEmail, email);
         }
+        if (type != null) {
+            queryWrapper.eq(IprPerson::getType, type);
+        }
         if (ifDefault != null) {
             queryWrapper.eq(IprPerson::getIfDefault, ifDefault);
         }
@@ -172,17 +180,26 @@ public class IprPersonService extends ServiceImpl<IprPersonMapper, IprPerson> {
             return queryIprPersonVOS;
         }
         List<Personnel> personnels = new ArrayList<>();
-        List<String> createIds = iprPersonList.stream().map(IprPerson::getCreateId).collect(Collectors.toList());
+        List<String> createIds = iprPersonList.stream()
+                .map(IprPerson::getCreateId)
+                .collect(Collectors.toList());
+        List<String> assoAccountStrIds = iprPersonList.stream()
+                .map(IprPerson::getAssoAccountId)//提取Integer
+                .filter(Objects::nonNull)//过滤null值
+                .map(String::valueOf)//转换为String
+                .collect(Collectors.toList());
+        createIds.addAll(assoAccountStrIds);
+
         if (!CollectionUtils.isEmpty(createIds)) {
             try {
                 String res = permissionService.getPersonnelByIdsFromPCS(createIds);
                 JSONObject jsonObject = JSON.parseObject(res);
                 personnels = JSONObject.parseArray(jsonObject.getString("data"), Personnel.class);
             } catch (Exception e) {
+                throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "人员查询错误");
             }
         }
 
-
         for (IprPerson iprPerson : iprPersonList) {
             QueryIprPersonVO queryIprPersonVO = new QueryIprPersonVO();
             BeanUtils.copyProperties(iprPerson, queryIprPersonVO);
@@ -200,6 +217,22 @@ public class IprPersonService extends ServiceImpl<IprPersonMapper, IprPerson> {
             if (personnel != null) {
                 queryIprPersonVO.setCreateName(personnel.getPersonnelName());
             }
+
+            Personnel assoAccount = personnels.stream()
+                    .filter(item -> {
+                        // 获取Integer类型的关联id
+                        Integer targetId = iprPerson.getAssoAccountId();
+                        // 当目标id为空时 直接跳过匹配
+                        if (targetId == null)  return false;
+                        // 将Integer转换为String进行比较
+                        return String.valueOf(targetId).equals(item.getId());
+                    })
+                    .findFirst()
+                    .orElse(null);
+            if (assoAccount != null) {
+                queryIprPersonVO.setAccountName(personnel.getPersonnelName());
+                queryIprPersonVO.setAccountUserName(personnel.getPersonnelUserName());
+            }
             queryIprPersonVOS.add(queryIprPersonVO);
         }
         return queryIprPersonVOS;

+ 213 - 26
src/main/java/cn/cslg/pas/service/report/MatchCasePersonService.java

@@ -1,6 +1,8 @@
 package cn.cslg.pas.service.report;
 
+import cn.cslg.pas.common.model.cronModel.Personnel;
 import cn.cslg.pas.common.model.cronModel.PersonnelVO;
+import cn.cslg.pas.common.model.report.*;
 import cn.cslg.pas.common.model.cronModel.SystemFile;
 import cn.cslg.pas.common.model.report.MailMessageDTO;
 import cn.cslg.pas.common.model.report.QueryMatchCasePersonVO;
@@ -8,15 +10,21 @@ import cn.cslg.pas.common.model.report.UpdateIprPersonDTO;
 import cn.cslg.pas.common.model.report.UpdateMatchCasePersonDTO;
 import cn.cslg.pas.common.utils.CacheUtils;
 import cn.cslg.pas.common.utils.LoginUtils;
+import cn.cslg.pas.domain.business.AssoProjectPerson;
+import cn.cslg.pas.domain.business.ReportProject;
 import cn.cslg.pas.domain.business.Project;
 import cn.cslg.pas.domain.business.ReportProject;
 import cn.cslg.pas.domain.report.AssoIprReportType;
 import cn.cslg.pas.domain.report.IprPerson;
 import cn.cslg.pas.exception.ExceptionEnum;
 import cn.cslg.pas.exception.XiaoShiException;
+import cn.cslg.pas.service.business.AssoProjectPersonService;
+import cn.cslg.pas.service.business.ReportProjectService;
 import cn.cslg.pas.service.business.ProjectService;
 import cn.cslg.pas.service.business.ReportProjectService;
 import cn.cslg.pas.service.permissions.PermissionService;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -27,9 +35,9 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
 
-import java.util.ArrayList;
-import java.util.List;
+import java.util.*;
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 
@@ -50,11 +58,19 @@ public class MatchCasePersonService extends ServiceImpl<MatchCasePersonMapper, M
     @Autowired
     @Lazy
     private IprPersonService iprPersonService;
+    private final AssoProjectPersonService assoProjectPersonService;
+    private final ReportProjectService reportProjectService;
+    private final PermissionService permissionService;
 
     public Integer updateMatchCasePerson(UpdateMatchCasePersonDTO updateMatchCasePersonDTO) {
-        Integer id = updateMatchCasePersonDTO.getId();
         String name = updateMatchCasePersonDTO.getName();
         String email = updateMatchCasePersonDTO.getEmail();
+        Integer assoAccountId = updateMatchCasePersonDTO.getAssoAccountId();
+        String remark = updateMatchCasePersonDTO.getRemark();
+
+        Integer assoId = updateMatchCasePersonDTO.getAssoAccountId();
+        // 1内部ipr 2代理所
+        Integer type = updateMatchCasePersonDTO.getType();
         Integer iprPersonId = null;
 
         // 邮箱传入 即先添加ipr人员 再与报告关联
@@ -69,83 +85,223 @@ public class MatchCasePersonService extends ServiceImpl<MatchCasePersonMapper, M
             queryWrapper.eq(IprPerson::getEmail, email);
             IprPerson iprPerson = iprPersonService.getOne(queryWrapper, false);
             if (iprPerson != null) {
+                if (!name.trim().equals(iprPerson.getName().trim()) || assoAccountId != iprPerson.getAssoAccountId()) {
+                    throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "禁止修改已存在邮箱的相关信息!请前往联系邮箱处");
+                }
+                //邮箱存在
                 iprPersonId = iprPerson.getId();
+                assoId = iprPerson.getAssoAccountId();
+
             } else {
                 PersonnelVO personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
                 String personId = personnelVO.getId();
                 Integer tenantId = personnelVO.getTenantId();
 
-                IprPerson iprPerson1 = new IprPerson();
-                iprPerson1.setName(updateMatchCasePersonDTO.getName());
-                iprPerson1.setEmail(email);
-                iprPerson1.setIfDefault(false);
-                iprPerson1.setCreateId(personId);
-                iprPerson1.setTenantId(tenantId);
-                iprPerson1.insert();
-                iprPersonId = iprPerson1.getId();
+                IprPerson newIprPerson = new IprPerson();
+                newIprPerson.setName(updateMatchCasePersonDTO.getName());
+                newIprPerson.setEmail(email);
+
+                newIprPerson.setType(type);
+                newIprPerson.setAssoAccountId(assoAccountId);
+                newIprPerson.setRemark(remark);
+
+                newIprPerson.setIfDefault(false);
+                newIprPerson.setCreateId(personId);
+                newIprPerson.setTenantId(tenantId);
+                newIprPerson.insert();
+                iprPersonId = newIprPerson.getId();
             }
         } else {
             throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "邮箱不能为空");
         }
         updateMatchCasePersonDTO.setName(name);
+        updateMatchCasePersonDTO.setType(type);
         updateMatchCasePersonDTO.setIprPersonId(iprPersonId);
+        MatchCasePerson matchCasePerson = this.addMatchCasePersonDB(updateMatchCasePersonDTO, assoId);
+        if (type != null) {
+            this.updateReport(updateMatchCasePersonDTO.getReportId(), type);
+        }
         MatchCasePerson matchCasePerson = this.addMatchCasePersonDB(updateMatchCasePersonDTO);
         sendReportMailService.sendMatchCasePersonMail(matchCasePerson.getProjectId(), name, email);
         return matchCasePerson.getId();
     }
 
-    public MatchCasePerson addMatchCasePersonDB(UpdateMatchCasePersonDTO updateMatchCasePersonDTO) {
+    public void updateReport(Integer projectId, Integer type) {
+        if (type != null) {
+            LambdaQueryWrapper<MatchCasePerson> queryWrapper1 = new LambdaQueryWrapper<>();
+            queryWrapper1.eq(MatchCasePerson::getProjectId, projectId)
+                    .eq(MatchCasePerson::getType, type);
+            List<MatchCasePerson> matchCasePersons = this.list(queryWrapper1);
+
+            String resultName = Optional.ofNullable(matchCasePersons)
+                    .orElse(Collections.emptyList())// 空值安全处理
+                    .stream()
+                    .map(person -> {
+                        IprPerson iprPerson = iprPersonService.getById(person.getIprPersonId());
+                        return (iprPerson != null && iprPerson.getName() != null) ? iprPerson.getName() : "";
+                    }) //对象转换
+                    .filter(name -> !name.isEmpty()) // 过滤无效数据
+                    .collect(Collectors.joining("、")); // 只能拼接
+
+            LambdaQueryWrapper<ReportProject> queryWrapper = new LambdaQueryWrapper<>();
+            queryWrapper.eq(ReportProject::getProjectId, projectId);
+            ReportProject reportProject = reportProjectService.getOne(queryWrapper,false);
+            if (reportProject != null) {
+                if (type.equals(2)) { // 代理所
+                    Integer actType = reportProject.getActType();
+                    //主动类型  请求人代理所
+                    if (actType != null && actType.equals(1)) {
+                        reportProject.setApplicantAgency(resultName);
+                    } else if (actType != null && actType.equals(0)) {//被动类型 专利权人代理所
+                        reportProject.setRightHolderAgency(resultName);
+                    }
+                } else if (type.equals(1)) { // 内部ipr
+                    reportProject.setActualPerson(resultName);
+                }
+                reportProject.updateById();
+            }
+        }
+    }
+
+    public MatchCasePerson addMatchCasePersonDB(UpdateMatchCasePersonDTO updateMatchCasePersonDTO, Integer assoId) {
         MatchCasePerson matchCasePerson = new MatchCasePerson();
+        PersonnelVO personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
+        String personId = personnelVO.getId();
+        Integer tenantId = personnelVO.getTenantId();
         Integer id = updateMatchCasePersonDTO.getId();
+        Integer assoAccountId = updateMatchCasePersonDTO.getAssoAccountId();
+        Integer type = updateMatchCasePersonDTO.getType();
+        Integer iprPersonId = updateMatchCasePersonDTO.getIprPersonId();
 
         LambdaQueryWrapper<MatchCasePerson> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(MatchCasePerson::getIprPersonId, iprPersonId);
         queryWrapper.eq(MatchCasePerson::getProjectId, updateMatchCasePersonDTO.getReportId());
-
+        queryWrapper.eq(MatchCasePerson::getType, type);
+        if (id != null) {
+            queryWrapper.ne(MatchCasePerson::getId, id);
+        }
+        List<MatchCasePerson> matchCasePeople = this.list(queryWrapper);
+        if (matchCasePeople != null && !matchCasePeople.isEmpty()) {
+            String entityType = type.equals(2) ? "代理所" : "IPR";
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "该" + entityType + "已配案");
+        }
         if (id != null) {
             matchCasePerson = this.getById(id);
             if (matchCasePerson != null) {
                 matchCasePerson.setIprPersonId(updateMatchCasePersonDTO.getIprPersonId());
                 matchCasePerson.updateById();
+                if (assoId != null) {
+//                    LambdaQueryWrapper<AssoProjectPerson> assoProjectPersonLambdaQueryWrapper = new LambdaQueryWrapper<>();
+//                    assoProjectPersonLambdaQueryWrapper.eq(AssoProjectPerson::getProjectId, updateMatchCasePersonDTO.getReportId())
+//                            .eq(AssoProjectPerson::getRole, 1)
+//                            .eq(AssoProjectPerson::getPersonId, assoId);
+//                    assoProjectPersonService.remove(assoProjectPersonLambdaQueryWrapper);
+                }
             }
         } else {
-            PersonnelVO personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
-            String personId = personnelVO.getId();
-            Integer tenantId = personnelVO.getTenantId();
             matchCasePerson.setProjectId(updateMatchCasePersonDTO.getReportId());
             matchCasePerson.setIprPersonId(updateMatchCasePersonDTO.getIprPersonId());
             matchCasePerson.setCreateId(personId);
             matchCasePerson.setTenantId(tenantId);
+            matchCasePerson.setType(updateMatchCasePersonDTO.getType());
             matchCasePerson.setId(null);
             matchCasePerson.insert();
         }
+        if (assoAccountId != null) {
+            LambdaQueryWrapper<AssoProjectPerson> queryWrapper1 = new LambdaQueryWrapper<>();
+            queryWrapper1.eq(AssoProjectPerson::getProjectId, updateMatchCasePersonDTO.getReportId());
+            queryWrapper1.eq(AssoProjectPerson::getRole, 1);
+            queryWrapper1.eq(AssoProjectPerson::getPersonId, assoAccountId);
+            List<AssoProjectPerson> assoProjectPersons = assoProjectPersonService.list(queryWrapper1);
+            if (assoProjectPersons == null || assoProjectPersons.isEmpty()) {
+                AssoProjectPerson assoProjectPerson = new AssoProjectPerson();
+                assoProjectPerson.setRole(1);
+                assoProjectPerson.setProjectId(updateMatchCasePersonDTO.getReportId());
+                assoProjectPerson.setPersonId(String.valueOf(assoAccountId));
+                assoProjectPerson.setCreateId(personId);
+                assoProjectPerson.insert();
+            }
+        }
         return matchCasePerson;
     }
 
-    public List<QueryMatchCasePersonVO> getReportMatchCasePerson(Integer reportId) {
+    public List<QueryMatchCasePersonVO> getReportMatchCasePerson(QueryMatchCasePersonDTO queryMatchCasePersonDTO) {
+        Integer reportId = queryMatchCasePersonDTO.getReportId();
+        Integer type = queryMatchCasePersonDTO.getType();
+
         List<QueryMatchCasePersonVO> queryMatchCasePersonVOS = new ArrayList<>();
 
         LambdaQueryWrapper<MatchCasePerson> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.eq(MatchCasePerson::getProjectId, reportId);
+        if (type != null) {
+            queryWrapper.eq(MatchCasePerson::getType, type);
+        }
         List<MatchCasePerson> matchCasePersons = this.list(queryWrapper);
         if (matchCasePersons != null && !matchCasePersons.isEmpty()) {
             for (MatchCasePerson matchCasePerson : matchCasePersons) {
                 QueryMatchCasePersonVO queryMatchCasePersonVO = new QueryMatchCasePersonVO();
                 BeanUtils.copyProperties(matchCasePerson, queryMatchCasePersonVO);
-                this.loadQueryMatchCasePersonVO(queryMatchCasePersonVO);
+                queryMatchCasePersonVO.setReportId(matchCasePerson.getProjectId());
+                Integer iprPersonId = matchCasePerson.getIprPersonId();
+                IprPerson iprPerson = iprPersonService.getById(iprPersonId);
+                if (iprPerson != null) {
+                    queryMatchCasePersonVO.setName(iprPerson.getName());
+                    queryMatchCasePersonVO.setEmail(iprPerson.getEmail());
+                    queryMatchCasePersonVO.setAssoAccountId(iprPerson.getAssoAccountId());
+                    queryMatchCasePersonVO.setRemark(iprPerson.getRemark());
+                }
                 queryMatchCasePersonVOS.add(queryMatchCasePersonVO);
             }
+            this.loadQueryMatchCasePersonVOS(queryMatchCasePersonVOS);
         }
         return queryMatchCasePersonVOS;
     }
 
-    public void loadQueryMatchCasePersonVO(QueryMatchCasePersonVO queryMatchCasePersonVO) {
-        // 邮箱装载
-        IprPerson iprPerson = iprPersonService.getById(queryMatchCasePersonVO.getIprPersonId());
-        if (iprPerson != null) {
-            queryMatchCasePersonVO.setName(iprPerson.getName());
-            queryMatchCasePersonVO.setEmail(iprPerson.getEmail());
+
+    public void loadQueryMatchCasePersonVOS(List<QueryMatchCasePersonVO> queryMatchCasePersonVOS) {
+        List<String> personIds = new ArrayList<>();
+        List<Personnel> personnels = new ArrayList<>();
+        List<String> createIds = queryMatchCasePersonVOS.stream()
+                .map(QueryMatchCasePersonVO::getCreateId)
+                .collect(Collectors.toList());
+        personIds.addAll(createIds);
+        List<String> assoAccountStrIds = queryMatchCasePersonVOS.stream()
+                .map(QueryMatchCasePersonVO::getAssoAccountId)//提取Integer
+                .filter(Objects::nonNull)//过滤null值
+                .map(String::valueOf)//转换为String
+                .collect(Collectors.toList());
+        personIds.addAll(assoAccountStrIds);
+        if (!CollectionUtils.isEmpty(personIds)) {
+            try {
+                String res = permissionService.getPersonnelByIdsFromPCS(personIds);
+                JSONObject jsonObject = JSON.parseObject(res);
+                personnels = JSONObject.parseArray(jsonObject.getString("data"), Personnel.class);
+            } catch (Exception e) {
+                throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "人员查询错误");
+            }
+        }
+        for (QueryMatchCasePersonVO queryMatchCasePersonVO : queryMatchCasePersonVOS) {
+            Personnel personnel = personnels.stream().filter(item -> item.getId().equals(queryMatchCasePersonVO.getCreateId())).findFirst().orElse(null);
+            if (personnel != null) {
+                queryMatchCasePersonVO.setCreateName(personnel.getPersonnelName());
+            }
+
+            Personnel assoAccount = personnels.stream()
+                    .filter(item -> {
+                        // 获取Integer类型的关联id
+                        Integer targetId = queryMatchCasePersonVO.getAssoAccountId();
+                        // 当目标id为空时 直接跳过匹配
+                        if (targetId == null)  return false;
+                        // 将Integer转换为String进行比较
+                        return String.valueOf(targetId).equals(item.getId());
+                    })
+                    .findFirst()
+                    .orElse(null);
+            if (assoAccount != null) {
+                queryMatchCasePersonVO.setAccountName(assoAccount.getPersonnelName());
+                queryMatchCasePersonVO.setAccountUserName(assoAccount.getPersonnelUserName());
+            }
         }
-        // 人员信息装载
     }
 
 
@@ -157,7 +313,36 @@ public class MatchCasePersonService extends ServiceImpl<MatchCasePersonMapper, M
     }
 
     public void delete(List<Integer> ids) {
-        this.removeBatchByIds(ids);
+        if (ids != null && !ids.isEmpty()) {
+            LambdaQueryWrapper<MatchCasePerson> queryWrapper = new LambdaQueryWrapper<>();
+            queryWrapper.in(MatchCasePerson::getId, ids);
+            List<MatchCasePerson> matchCasePeople = this.list(queryWrapper);
+            this.removeBatchByIds(ids);
+            List<Integer> assoIds = new ArrayList<>();
+            Integer projectId = null;
+            for (MatchCasePerson matchCasePerson : matchCasePeople) {
+                Integer iprPersonId = matchCasePerson.getIprPersonId();
+                Integer type = matchCasePerson.getType();
+                projectId = matchCasePerson.getProjectId();
+
+                IprPerson iprPerson = iprPersonService.getById(iprPersonId);
+                Integer assoId = iprPerson.getAssoAccountId();
+                if (assoId != null) {
+                    assoIds.add(assoId);
+//                    //assoId取消关联
+//                    LambdaQueryWrapper<AssoProjectPerson> assoProjectPersonLambdaQueryWrapper = new LambdaQueryWrapper<>();
+//                    assoProjectPersonLambdaQueryWrapper.eq(AssoProjectPerson::getProjectId, projectId)
+//                            .eq(AssoProjectPerson::getRole, 1)
+//                            .eq(AssoProjectPerson::getPersonId, assoId);
+//                    assoProjectPersonService.remove(assoProjectPersonLambdaQueryWrapper);
+                }
+                this.updateReport(projectId, type);
+            }
+        }
+    }
+
+    public void cancelConnect() {
+
     }
 
     public void deleteByIprIds(List<Integer> iprPersonIds) {
@@ -167,6 +352,8 @@ public class MatchCasePersonService extends ServiceImpl<MatchCasePersonMapper, M
     }
 
 
+
+
 }
 
 

+ 288 - 200
src/main/resources/jsons/invalidReportProject.json

@@ -1,119 +1,121 @@
 [
-  {"name":"Id",
-    "type":"Integer",
-    "value":"id",
-    "field":"id",
+  {
+    "name": "Id",
+    "type": "Integer",
+    "value": "id",
+    "field": "id",
     "sqlField": "t.id",
     "sqlClass": "getComSql",
     "orderClass": "",
-    "groupClass":"",
-    "ifSearch":"false",
+    "groupClass": "",
+    "ifSearch": "false",
     "ifGroup": "false",
-    "ifShow":"false",
+    "ifShow": "false",
+    "ifSort": "false",
     "ifAsCondition": "true"
   },
-  {"name":"创建月份",
-    "type":"DateTime",
-    "value":"createTimeMonth",
+  {
+    "name": "创建月份",
+    "type": "DateTime",
+    "value": "createTimeMonth",
     "field": "createTimeMonth",
     "sqlField": "t.createTime",
     "sqlClass": "getDateTimeMonthSql",
     "orderClass": "getComOrder",
-    "groupClass":"getTimeGroup",
-    "ifSearch":"false",
+    "groupClass": "getTimeGroup",
+    "ifSearch": "false",
     "ifGroup": "true",
-    "ifShow":"false",
+    "ifShow": "false",
+    "ifSort": "false",
     "ifAsCondition": "true"
   },
-  {"name":"报告名称",
-  "type":"String",
-  "value":"name",
-  "field": "name",
-  "sqlField": "t.name",
-  "sqlClass": "getLikeSql",
+  {
+    "name": "报告名称",
+    "type": "String",
+    "value": "name",
+    "field": "name",
+    "sqlField": "t.name",
+    "sqlClass": "getLikeSql",
     "orderClass": "getComOrder",
-    "groupClass":"getComGroup",
-  "ifSearch":"true",
-  "ifGroup": "false",
-    "ifShow":"true",
+    "groupClass": "getComGroup",
+    "ifSearch": "true",
+    "ifGroup": "false",
+    "ifShow": "true",
+    "ifSort": "true",
     "defaultHidden": "false",
     "ifAsCondition": "true"
-
-},
-  {"name":"标的专利",
-    "type":"String",
-    "value":"signPatentNo",
+  },
+  {
+    "name": "标的专利",
+    "type": "String",
+    "value": "signPatentNo",
     "field": "signPatentNo",
     "sqlField": "t.signPatentNo",
     "sqlClass": "getLikeSql",
     "orderClass": "getComOrder",
-    "ifSearch":"true",
+    "ifSearch": "true",
     "ifGroup": "false",
-    "ifShow":"true",
+    "ifShow": "true",
+    "ifSort": "true",
     "ifAsCondition": "true"
   },
-  {"name":"专利名称",
-    "type":"String",
-    "value":"inventionName",
+  {
+    "name": "专利名称",
+    "type": "String",
+    "value": "inventionName",
     "field": "inventionName",
     "sqlField": "t.inventionName",
     "sqlClass": "getLikeSql",
     "orderClass": "getComOrder",
-    "ifSearch":"false",
+    "ifSearch": "false",
     "ifGroup": "false",
-    "ifShow":"true",
+    "ifShow": "true",
+    "ifSort": "true",
     "ifAsCondition": "true"
   },
-  {"name":"无效案号",
-    "type":"String",
-    "value":"caseNumber",
+  {
+    "name": "无效案号",
+    "type": "String",
+    "value": "caseNumber",
     "field": "caseNumber",
     "sqlField": "t.caseNumber",
     "sqlClass": "getComSql",
     "orderClass": "getComOrder",
-    "groupClass":"getScenarioGroup",
-    "ifSearch":"false",
+    "groupClass": "getScenarioGroup",
+    "ifSearch": "false",
     "ifGroup": "false",
-    "ifShow":"true",
+    "ifShow": "true",
+    "ifSort": "true",
     "defaultHidden": "false"
   },
-  {"name":"案件阶段",
-  "type":"String",
-  "value":"caseStage",
-  "field": "caseStage",
-  "sqlField": "t.caseStage",
-  "sqlClass": "getComSql",
-  "orderClass": "getComOrder",
-  "groupClass":"getScenarioGroup",
-  "ifSearch":"false",
-  "ifGroup": "false",
-  "ifShow":"true",
-  "defaultHidden": "false"
-},
-  {"name":"无效结果",
-    "type":"Array",
-    "value":"cronNames",
+  {
+    "name": "无效结果",
+    "type": "Array",
+    "value": "cronNames",
     "field": "cronNames",
     "sqlField": "t.cronId",
     "sqlClass": "getComSql",
     "orderClass": "getCronsNameOrder",
-    "groupClass":"getTimeGroup",
-    "ifSearch":"true",
+    "groupClass": "getTimeGroup",
+    "ifSearch": "true",
     "ifGroup": "false",
-    "ifShow":"true",
+    "ifShow": "true",
+    "ifSort": "true",
     "defaultHidden": "false",
     "ifAsCondition": "true"
   },
-  {"name":"请求人",
-    "type":"String",
-    "value":"invalidApplication",
+  {
+    "name": "请求人",
+    "type": "String",
+    "value": "invalidApplication",
     "field": "invalidApplication",
     "sqlField": "t.invalidApplication",
     "sqlClass": "getLikeSql",
     "orderClass": "getComOrder",
-    "ifSearch":"false",
+    "ifSearch": "false",
     "ifGroup": "false",
-    "ifShow":"true",
+    "ifShow": "true",
+    "ifSort": "true",
     "ifAsCondition": "true"
   },
   {
@@ -124,145 +126,163 @@
     "sqlField": "t.createId",
     "sqlClass": "getCreateNameSql",
     "orderClass": "getCreateNameOrder",
-    "groupClass":"getComGroup",
-    "ifSearch":"false",
+    "groupClass": "getComGroup",
+    "ifSearch": "false",
     "ifGroup": "false",
-    "ifShow":"true",
-    "defaultHidden": "false",
-    "ifSort": "false"
+    "ifShow": "true",
+    "ifSort": "false",
+    "defaultHidden": "false"
   },
-  {"name":"创建人",
-    "type":"String",
-    "value":"createName",
+  {
+    "name": "创建人",
+    "type": "String",
+    "value": "createName",
     "field": "createName",
     "sqlField": "t.createId",
     "sqlClass": "getCreateNameSql",
     "orderClass": "getCreateNameOrder",
-    "groupClass":"getComGroup",
-    "ifSearch":"true",
+    "groupClass": "getComGroup",
+    "ifSearch": "true",
     "ifGroup": "false",
-    "ifShow":"true",
+    "ifShow": "true",
+    "ifSort": "true",
     "defaultHidden": "true",
     "ifAsCondition": "true"
   },
-  {"name":"负责人名称",
-    "type":"String",
-    "value":"headName",
+  {
+    "name": "负责人名称",
+    "type": "String",
+    "value": "headName",
     "field": "headName",
     "sqlField": "t.headId",
     "sqlClass": "getCreateNameSql",
     "orderClass": "getCreateNameOrder",
-    "groupClass":"getComGroup",
-    "ifSearch":"true",
+    "groupClass": "getComGroup",
+    "ifSearch": "true",
     "ifGroup": "false",
-    "ifShow":"true",
+    "ifShow": "true",
+    "ifSort": "true",
     "defaultHidden": "true",
     "ifAsCondition": "true"
   },
-  {"name":"负责部门",
-    "type":"String",
-    "value":"departmentName",
+  {
+    "name": "负责部门",
+    "type": "String",
+    "value": "departmentName",
     "field": "departmentName",
     "sqlField": "t.departmentId",
     "sqlClass": "getDepartmentNameSql",
     "orderClass": "getDepartmentNameOrder",
-    "groupClass":"getScenarioGroup",
-    "ifSearch":"true",
+    "groupClass": "getScenarioGroup",
+    "ifSearch": "true",
     "ifGroup": "false",
-    "ifShow":"true",
+    "ifShow": "true",
+    "ifSort": "true",
     "defaultHidden": "true",
     "ifAsCondition": "true"
   },
-  {"name":"委托方",
-    "type":"String",
-    "value":"entrustName",
+  {
+    "name": "委托方",
+    "type": "String",
+    "value": "entrustName",
     "field": "entrustName",
     "sqlField": "t.entrustId",
     "sqlClass": "getEntrustTrueNameSql",
     "orderClass": "getEntrustOrder",
-    "groupClass":"getEntrustGroup",
-    "ifSearch":"true",
+    "groupClass": "getEntrustGroup",
+    "ifSearch": "true",
     "ifGroup": "false",
-    "ifShow":"true",
+    "ifShow": "true",
+    "ifSort": "true",
     "defaultHidden": "true",
     "ifAsCondition": "true"
   },
-
-  {"name":"委托方",
-    "type":"String",
-    "value":"entrustNameTrue",
+  {
+    "name": "委托方",
+    "type": "String",
+    "value": "entrustNameTrue",
     "field": "entrustNameTrue",
     "sqlField": "t.entrustId",
     "sqlClass": "getEntrustTrueNameSql",
     "orderClass": "getEntrustOrder",
-    "groupClass":"getEntrustGroup",
-    "ifSearch":"false",
+    "groupClass": "getEntrustGroup",
+    "ifSearch": "false",
     "ifGroup": "true",
-    "ifShow":"false",
+    "ifShow": "false",
+    "ifSort": "true",
     "defaultHidden": "false",
     "ifAsCondition": "true"
   },
-  {"name":"创建时间",
-    "type":"DateTime",
-    "value":"createTime",
+  {
+    "name": "创建时间",
+    "type": "DateTime",
+    "value": "createTime",
     "field": "createTime",
     "sqlField": "t.createTime",
     "sqlClass": "getDateTimeSql",
     "orderClass": "getComOrder",
-    "groupClass":"getTimeGroup",
-    "ifSearch":"true",
+    "groupClass": "getTimeGroup",
+    "ifSearch": "true",
     "ifGroup": "false",
-    "ifShow":"true",
+    "ifShow": "true",
+    "ifSort": "true",
     "defaultHidden": "true",
     "ifAsCondition": "true"
   },
-  {"name":"报告类型",
-    "type":"String",
-    "value":"reportTypeName",
+  {
+    "name": "报告类型",
+    "type": "String",
+    "value": "reportTypeName",
     "field": "reportTypeName",
     "sqlField": "t.reportType",
     "sqlClass": "getComSql",
     "orderClass": "getComOrder",
-    "groupClass":"getReportTypeGroup",
-    "ifSearch":"false",
+    "groupClass": "getReportTypeGroup",
+    "ifSearch": "false",
     "ifGroup": "true",
-    "ifShow":"true",
+    "ifShow": "true",
+    "ifSort": "true",
     "defaultHidden": "true",
     "ifAsCondition": "true"
   },
-  {"name":"报告类型",
-    "type":"Array",
-    "value":"reportType",
+  {
+    "name": "报告类型",
+    "type": "Array",
+    "value": "reportType",
     "field": "reportType",
     "sqlField": "t.reportType",
     "sqlClass": "getComSql",
-    "ifSearch":"true",
+    "ifSearch": "true",
     "ifGroup": "false",
-    "ifShow":"false",
+    "ifShow": "false",
+    "ifSort": "false",
     "ifAsCondition": "true"
   },
-  {"name":"报告状态",
-    "type":"String",
-    "value":"statusName",
+  {
+    "name": "报告状态",
+    "type": "String",
+    "value": "statusName",
     "field": "statusName",
     "sqlField": "t.status",
     "sqlClass": "getComSql",
     "orderClass": "getComOrder",
-    "ifSearch":"false",
+    "ifSearch": "false",
     "ifGroup": "false",
     "defaultHidden": "true",
-    "ifShow":"true"
+    "ifShow": "true",
+    "ifSort": "true"
   },
-  {"name":"报告状态",
-    "type":"Array",
-    "value":"status",
+  {
+    "name": "报告状态",
+    "type": "Array",
+    "value": "status",
     "field": "status",
     "sqlField": "t.status",
     "sqlClass": "getComSql",
     "orderClass": "getComOrder",
-    "ifSearch":"true",
+    "ifSearch": "true",
     "ifGroup": "false",
-    "ifShow":"false",
+    "ifShow": "false",
     "ifAsCondition": "true"
   },
   {
@@ -276,149 +296,171 @@
     "ifSearch": "false",
     "ifGroup": "false",
     "defaultHidden": "true",
-    "ifShow": "true"
+    "ifShow": "true",
+    "ifSort": "true"
   },
-  {"name":"备注",
-    "type":"String",
-    "value":"description",
+  {
+    "name": "备注",
+    "type": "String",
+    "value": "description",
     "field": "description",
     "sqlField": "t.description",
     "sqlClass": "getComSql",
     "orderClass": "getComOrder",
-    "ifSearch":"false",
+    "ifSearch": "false",
     "ifGroup": "false",
     "defaultHidden": "true",
-    "ifShow":"true"
+    "ifShow": "true",
+    "ifSort": "true"
   },
-  {"name":"相关事件",
-    "type":"Array",
-    "value":"eventNames",
+  {
+    "name": "相关事件",
+    "type": "Array",
+    "value": "eventNames",
     "field": "eventNames",
     "sqlField": "t.eventId",
     "sqlClass": "getComSql",
     "orderClass": "getEventOrder",
-    "groupClass":"getScenarioGroup",
-    "ifSearch":"false",
+    "groupClass": "getScenarioGroup",
+    "ifSearch": "false",
     "ifGroup": "false",
     "defaultHidden": "true",
-    "ifShow":"true"
+    "ifShow": "true",
+    "ifSort": "true"
   },
-  {"name":"相关事件",
-    "type":"String",
-    "value":"eventNames",
+  {
+    "name": "相关事件",
+    "type": "String",
+    "value": "eventNames",
     "field": "eventNames",
     "sqlField": "t.eventId",
     "sqlClass": "getEventNameSql",
     "orderClass": "getEventOrder",
-    "groupClass":"getScenarioGroup",
-    "ifSearch":"true",
+    "groupClass": "getScenarioGroup",
+    "ifSearch": "true",
     "ifGroup": "false",
-    "ifShow":"false",
+    "ifShow": "false",
     "ifAsCondition": "true"
   },
-  {"name":"内部卷号",
-    "type":"String",
-    "value":"volumeNumber",
+  {
+    "name": "内部卷号",
+    "type": "String",
+    "value": "volumeNumber",
     "field": "volumeNumber",
     "sqlField": "t.volumeNumber",
     "sqlClass": "getComSql",
     "orderClass": "getComOrder",
-    "groupClass":"getScenarioGroup",
-    "ifSearch":"false",
+    "groupClass": "getScenarioGroup",
+    "ifSearch": "false",
     "ifGroup": "false",
-    "ifShow":"true",
+    "ifShow": "true",
+    "ifSort": "true",
     "defaultHidden": "true"
   },
-  {"name":"产品/技术",
-  "type":"String",
-  "value":"productOrTech",
-  "field": "productOrTech",
-  "sqlField": "t.productOrTech",
-  "sqlClass": "getLikeSql",
-  "orderClass": "getComOrder",
-  "ifSearch":"false",
-  "ifGroup": "false",
-  "ifShow":"true",
+  {
+    "name": "产品/技术",
+    "type": "String",
+    "value": "productOrTech",
+    "field": "productOrTech",
+    "sqlField": "t.productOrTech",
+    "sqlClass": "getLikeSql",
+    "orderClass": "getComOrder",
+    "ifSearch": "false",
+    "ifGroup": "false",
+    "ifShow": "true",
+    "ifSort": "true",
     "defaultHidden": "true"
-},
-  {"name":"调查类型",
-    "type":"Array",
-    "value":"matterNames",
+  },
+  {
+    "name": "调查类型",
+    "type": "Array",
+    "value": "matterNames",
     "field": "matterNames",
     "sqlField": "t.matterId",
     "sqlClass": "getComSql",
     "orderClass": "getMatterOrder",
-    "groupClass":"getMatterGroup",
-    "ifSearch":"true",
+    "groupClass": "getMatterGroup",
+    "ifSearch": "true",
     "ifGroup": "true",
-    "ifShow":"true",
+    "ifShow": "true",
+    "ifSort": "true",
     "defaultHidden": "true",
     "ifAsCondition": "true"
   },
-  {"name":"应用场景",
-    "type":"Array",
-    "value":"scenarioNames",
+  {
+    "name": "应用场景",
+    "type": "Array",
+    "value": "scenarioNames",
     "field": "scenarioNames",
     "sqlField": "t.scenarioId",
     "sqlClass": "getComSql",
     "orderClass": "getProjectScenarioOrder",
-    "groupClass":"getScenarioGroup",
-    "ifSearch":"true",
+    "groupClass": "getScenarioGroup",
+    "ifSearch": "true",
     "ifGroup": "true",
-    "ifShow":"true",
+    "ifShow": "true",
+    "ifSort": "true",
     "defaultHidden": "true",
     "ifAsCondition": "true"
   },
-  {"name":"国知局受理年份",
-    "type":"DateTime",
-    "value":"acceptYear",
+  {
+    "name": "国知局受理年份",
+    "type": "DateTime",
+    "value": "acceptYear",
     "field": "acceptYear",
     "sqlField": "t.acceptYear",
     "sqlClass": "getDateTimeMonthSql",
     "orderClass": "getComOrder",
-    "groupClass":"getTimeGroup",
-    "ifSearch":"false",
+    "groupClass": "getTimeGroup",
+    "ifSearch": "false",
     "ifGroup": "false",
-    "ifShow":"true",
+    "ifShow": "true",
+    "ifSort": "true",
     "ifAsCondition": "true"
   },
-  {"name":"请求人代理所",
-    "type":"String",
-    "value":"applicantAgency",
+  {
+    "name": "请求人代理所",
+    "type": "String",
+    "value": "applicantAgency",
     "field": "applicantAgency",
     "sqlField": "t.applicantAgency",
     "sqlClass": "getComSql",
     "orderClass": "getComOrder",
-    "groupClass":"getScenarioGroup",
-    "ifSearch":"false",
+    "groupClass": "getScenarioGroup",
+    "ifSearch": "false",
     "ifGroup": "false",
-    "ifShow":"true",
+    "ifShow": "true",
+    "ifSort": "true",
     "defaultHidden": "false"
   },
-  {"name":"专利权人代理所",
-    "type":"String",
-    "value":"rightHolderAgency",
+  {
+    "name": "专利权人代理所",
+    "type": "String",
+    "value": "rightHolderAgency",
     "field": "rightHolderAgency",
     "sqlField": "t.rightHolderAgency",
     "sqlClass": "getComSql",
     "orderClass": "getComOrder",
-    "groupClass":"getScenarioGroup",
-    "ifSearch":"false",
+    "groupClass": "getScenarioGroup",
+    "ifSearch": "false",
     "ifGroup": "false",
-    "ifShow":"true",
+    "ifShow": "true",
+    "ifSort": "true",
     "defaultHidden": "false"
   },
-  {"name":"证据库",
-    "type":"String",
-    "value":"proofName",
+  {
+    "name": "证据库",
+    "type": "String",
+    "value": "proofName",
     "field": "proofName",
     "sqlField": "t.id",
     "sqlClass": "getProofNameSql",
     "orderClass": "getProjectScenarioOrder",
-    "groupClass":"getScenarioGroup",
-    "ifSearch":"true",
+    "groupClass": "getScenarioGroup",
+    "ifSearch": "true",
     "ifGroup": "false",
-    "ifShow":"false",
+    "ifShow": "false",
+    "ifSort": "false",
     "ifAsCondition": "true"
   },
   {
@@ -432,6 +474,52 @@
     "ifSearch": "false",
     "ifGroup": "false",
     "defaultHidden": "true",
-    "ifShow": "true"
+    "ifShow": "true",
+    "ifSort": "false"
+  },
+  {
+    "name": "案件阶段",
+    "type": "String",
+    "value": "casePhase",
+    "field": "casePhase",
+    "ifSearch": "false",
+    "ifGroup": "false",
+    "ifShow": "true",
+    "ifSort": "false"
+  },
+  {
+    "name": "案件子阶段",
+    "type": "String",
+    "value": "caseChildPhase",
+    "field": "caseChildPhase",
+    "ifSearch": "false",
+    "ifGroup": "false",
+    "ifShow": "true",
+    "ifSort": "false"
+  },
+  {
+    "name": "行诉结果",
+    "type": "String",
+    "value": "conclusion",
+    "field": "conclusion",
+    "ifSearch": "false",
+    "ifGroup": "false",
+    "ifShow": "true",
+    "ifSort": "false"
+  },
+  {
+    "name": "实际处理人",
+    "type": "String",
+    "value": "actualPerson",
+    "field": "actualPerson",
+    "sqlField": "t.actualPerson",
+    "sqlClass": "getComSql",
+    "orderClass": "getComOrder",
+    "groupClass": "getScenarioGroup",
+    "ifSearch": "false",
+    "ifGroup": "false",
+    "ifShow": "true",
+    "ifSort": "true",
+    "defaultHidden": "false"
   }
 ]

+ 46 - 0
src/main/resources/mapper/ReportAffairMapper.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="cn.cslg.pas.mapper.ReportAffairMapper">
+    <select id="queryCasePhase" resultType="cn.cslg.pas.common.vo.QueryCasePhaseVO">
+        SELECT *
+        FROM (
+            SELECT a.case_phase,
+            b.project_id,
+            CASE
+               WHEN a.case_child_phase != '' THEN a.case_child_phase
+               ELSE b.case_child_phase
+               END AS   caseChildPhase,
+            ROW_NUMBER() OVER (
+                PARTITION BY b.project_id
+                ORDER BY b.occurred_time DESC, b.id DESC
+            ) AS rn
+        FROM report_affair_case_phase a
+        LEFT JOIN report_affair b ON b.asso_case_phase_id = a.id
+        WHERE b.project_id IN
+            <foreach collection="projectIds" index="index" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        ) t
+        WHERE rn = 1
+    </select>
+
+    <select id="queryReportAffairConclusion" resultType="cn.cslg.pas.common.vo.QueryReportAffairConclusionVO">
+        SELECT *
+        FROM (
+            SELECT
+            co.conclusion,
+            ra.project_id,
+            ROW_NUMBER() OVER (
+                PARTITION BY ra.project_id
+                ORDER BY ra.occurred_time DESC, ra.id DESC
+            ) AS rn
+            FROM court_order co
+            LEFT JOIN report_affair ra ON ra.id = co.report_affair_id
+            WHERE ra.project_id IN
+                <foreach collection="projectIds" index="index" item="item" open="(" separator="," close=")">
+                    #{item}
+                 </foreach>
+            ) t
+        WHERE rn = 1
+    </select>
+</mapper>

+ 1 - 1
src/main/resources/mapper/ReportProjectMapper.xml

@@ -11,7 +11,7 @@
         invalidApplication ,rp.act_type as actType ,rp.patent_type as patentType ,rp.current_application as
         currentApplication, rp.invention_name as inventionName,p.contract_no as contractNo,rp.carding_opinion,
         rp.accept_year as acceptYear,rp.applicant_agency as applicantAgency,rp.right_holder_agency as rightHolderAgency,rp.case_stage as caseStage,
-        aspe.event_id as eventId,arc.cron_id as cronId,aspm.matter_id as matterId,asps.scenario_id as scenarioId
+        aspe.event_id as eventId,arc.cron_id as cronId,aspm.matter_id as matterId,asps.scenario_id as scenarioId,rp.actual_person as actualPerson
         from report as rp left join project as p
         on rp.project_id =p.id left join asso_report_cron arc on p.id =arc.project_id
         left join (select * from asso_project_event where scenario_id is not null ) as asps on p.id = asps.project_id

+ 31 - 0
src/main/resources/mapper/novelty/LitigationMapper.xml

@@ -0,0 +1,31 @@
+<?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="cn.cslg.pas.mapper.novelty.LitigationMapper">
+
+    <resultMap id="BaseResultMap" type="cn.cslg.pas.domain.business.novelty.Litigation">
+            <id property="id" column="id" jdbcType="INTEGER"/>
+            <result property="caseNumber" column="case_number" jdbcType="VARCHAR"/>
+            <result property="caseFieldTime" column="case_field_time" jdbcType="DATE"/>
+            <result property="plaintiff" column="plaintiff" jdbcType="VARCHAR"/>
+            <result property="defendant" column="defendant" jdbcType="VARCHAR"/>
+            <result property="thirdPerson" column="third_person" jdbcType="VARCHAR"/>
+            <result property="plaintiffAgent" column="plaintiff_agent" jdbcType="VARCHAR"/>
+            <result property="thirdAgent" column="third_agent" jdbcType="INTEGER"/>
+            <result property="panelMember" column="panel_member" jdbcType="VARCHAR"/>
+            <result property="result" column="result" jdbcType="VARCHAR"/>
+            <result property="createId" column="create_id" jdbcType="VARCHAR"/>
+            <result property="type" column="type" jdbcType="INTEGER"/>
+            <result property="projectId" column="project_id" jdbcType="INTEGER"/>
+            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id,case_number,case_field_time,
+        plaintiff,defendant,third_person,
+        plaintiff_agent,third_agent,panel_member,
+        result,create_id,type,
+        project_id,create_time
+    </sql>
+</mapper>

+ 107 - 0
src/test/java/cn/cslg/pas/novelty/LitigationServiceTest.java

@@ -0,0 +1,107 @@
+package cn.cslg.pas.novelty;
+
+import cn.cslg.pas.common.model.novelty.LitigationDTO;
+import cn.cslg.pas.common.model.novelty.LitigationReVO;
+import cn.cslg.pas.common.vo.GetReportInfoFromWDVO;
+import cn.cslg.pas.domain.business.CourtOrder;
+import cn.cslg.pas.domain.business.ReportAffair;
+import cn.cslg.pas.domain.business.novelty.Litigation;
+import cn.cslg.pas.service.business.CourtOrderService;
+import cn.cslg.pas.service.business.ReportAffairService;
+import cn.cslg.pas.service.novelty.LitigationService;
+import com.alibaba.fastjson2.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import org.checkerframework.checker.units.qual.A;
+import org.junit.Assert;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+
+@SpringBootTest
+public class LitigationServiceTest {
+    @Autowired
+    private LitigationService litigationService;
+
+    @Autowired
+    private ReportAffairService reportAffairService;
+    @Autowired
+    private CourtOrderService courtOrderService;
+
+    @Test
+    public void testAdd() throws IOException {
+        String caseNumber = "caseNumber";
+        Date caseFieldTime = new Date();
+        String plaintiff = "plaintiff";
+        String defendant = "defendant";
+        String thirdPerson = "thirdPerson";
+        String plaintiffAgent = "plaintiffAgent";
+        String thirdAgent = "thirdAgent";
+        String panelMember = "panelMember";
+        Integer type = 2;
+        Integer projectId = 2;
+        LitigationDTO litigationDTO = new LitigationDTO();
+        litigationDTO.setCaseNumber(caseNumber);
+        litigationDTO.setCaseFieldTime(caseFieldTime);
+        litigationDTO.setPlaintiff(plaintiff);
+        litigationDTO.setDefendant(defendant);
+        litigationDTO.setThirdPerson(thirdPerson);
+        litigationDTO.setPlaintiffAgent(plaintiffAgent);
+        litigationDTO.setThirdAgent(thirdAgent);
+        litigationDTO.setPanelMember(panelMember);
+        litigationDTO.setType(type);
+        litigationDTO.setProjectId(projectId);
+        Litigation litigation = litigationService.addOrUpdateLitigation(litigationDTO);
+        Litigation litigation1 = litigationService.getById(litigation);
+        LitigationDTO litigationDTO1 = new LitigationDTO();
+        BeanUtils.copyProperties(litigation1, litigationDTO1);
+        litigationDTO1.setId(null);
+        Assert.assertEquals(litigationDTO1, litigationDTO);
+    }
+
+    @Test
+    public void testQuery() {
+       List<Integer> ids = this.addReportAffair();
+        LitigationDTO litigationDTO = new LitigationDTO();
+        litigationDTO.setProjectId(2);
+        LitigationReVO litigationReVO = litigationService.queryLitigation(litigationDTO);
+        System.out.println(litigationReVO);
+        this.removeAffairById(ids);
+    }
+
+    public List<Integer> addReportAffair() {
+        ReportAffair reportAffair = new ReportAffair();
+        reportAffair.setProjectId(2);
+        reportAffair.setAssoCasePhaseId(16);
+        reportAffair.setCreateId("1");
+        reportAffair.insert();
+        ReportAffair reportAffair2 = new ReportAffair();
+        reportAffair2.setProjectId(2);
+        reportAffair2.setAssoCasePhaseId(26);
+        reportAffair2.setCreateId("1");
+        reportAffair2.insert();
+
+        Integer id1 =reportAffair.getId();
+        Integer id2 =reportAffair2.getId();
+        CourtOrder courtOrder =new CourtOrder();
+        courtOrder.setReportAffairId(id1);
+        courtOrder.setConclusion("结论3");
+        courtOrder.insert();
+        CourtOrder courtOrder2 =new CourtOrder();
+        courtOrder2.setReportAffairId(id2);
+        courtOrder2.setConclusion("结论4");
+        courtOrder2.insert();
+        return Arrays.asList(id1, id2);
+    }
+    public void  removeAffairById(List<Integer> ids ){
+         reportAffairService.removeBatchByIds(ids);
+        LambdaQueryWrapper<CourtOrder> queryWrapper =new LambdaQueryWrapper<>();
+        courtOrderService.remove(queryWrapper);
+
+    }
+}

+ 217 - 0
src/test/java/cn/cslg/pas/service/ReportAffairTests.java

@@ -0,0 +1,217 @@
+package cn.cslg.pas.service;
+
+import cn.cslg.pas.common.dto.invalidDTO.ReportAffairCaseDTO;
+import cn.cslg.pas.domain.business.ReportAffair;
+import cn.cslg.pas.domain.business.ReportAffairCasePhase;
+import cn.cslg.pas.service.business.ReportAffairService;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@SpringBootTest
+public class ReportAffairTests {
+
+    @Autowired
+    private ReportAffairCasePhaseService reportAffairCasePhaseService;
+    @Autowired
+    private ReportAffairService reportAffairService;
+
+    @Test
+    public void queryAssoCasePhaseList() {
+        final List<ReportAffairCasePhase> phases = reportAffairCasePhaseService.queryAssoCasePhaseList();
+        System.out.println(phases);
+    }
+
+    @Test
+    public void addReportAffair() {
+        ReportAffairCaseDTO vo = new ReportAffairCaseDTO();
+        vo.setProjectId(618);
+        final Integer id = reportAffairService.addReportAffairCase(vo);
+        System.out.println(id);
+    }
+
+    @Test
+    public void updateReportAffair() {
+//        ReportAffairCaseDTO vo = new ReportAffairCaseDTO();
+//        vo.setProjectId(618);
+//        final Integer id = reportAffairService.updateReportAffairCase(vo);
+        ReportAffair affair = reportAffairService.getById(119);
+        affair.setCaseChildPhase("行政一审完整测试");
+        affair.setProjectId(618);
+
+        affair.updateById();
+        System.out.println(affair.getId());
+    }
+
+
+
+    public void test() {
+        List<ReportAffairCasePhase> phases = new ArrayList<>();
+
+        ReportAffairCasePhase casePhase = new ReportAffairCasePhase();
+        casePhase.setFlowName("添加无效请求书");
+        casePhase.setCasePhase("无效");
+        casePhase.setCaseChildPhase("无效受理");
+        phases.add(casePhase);
+
+        ReportAffairCasePhase casePhase1 = new ReportAffairCasePhase();
+        casePhase1.setFlowName("添加权要修改记录");
+        casePhase1.setCasePhase("无效");
+        casePhase1.setCaseChildPhase("专利权人提交权要修改");
+        phases.add(casePhase1);
+
+        ReportAffairCasePhase casePhase2 = new ReportAffairCasePhase();
+        casePhase2.setFlowName("补充证据及理由记录");
+        casePhase2.setCasePhase("无效");
+        casePhase2.setCaseChildPhase("请求人补充证据及无效理由");
+        phases.add(casePhase2);
+
+        ReportAffairCasePhase casePhase3 = new ReportAffairCasePhase();
+        casePhase3.setFlowName("添加请求人意见陈述书");
+        casePhase3.setCasePhase("无效");
+        casePhase3.setCaseChildPhase("请求人调整无效证据及理由");
+        phases.add(casePhase3);
+
+        ReportAffairCasePhase casePhase4 = new ReportAffairCasePhase();
+        casePhase4.setFlowName("添加专利权人意见陈述书");
+        casePhase4.setCasePhase("无效");
+        casePhase4.setCaseChildPhase("专利权人答复");
+        phases.add(casePhase4);
+
+        ReportAffairCasePhase casePhase5 = new ReportAffairCasePhase();
+        casePhase5.setFlowName("添加口审记录");
+        casePhase5.setCasePhase("无效");
+        casePhase5.setCaseChildPhase("口审待出决定");
+        phases.add(casePhase5);
+
+        ReportAffairCasePhase casePhase6 = new ReportAffairCasePhase();
+        casePhase6.setFlowName("添加无效决定书");
+        casePhase6.setCasePhase("无效");
+        casePhase6.setCaseChildPhase("已出无效决定");
+        phases.add(casePhase6);
+
+        ReportAffairCasePhase casePhase7 = new ReportAffairCasePhase();
+        casePhase7.setFlowName("添加行政诉讼起诉状");
+        casePhase7.setCasePhase("行政一审");
+        casePhase7.setCaseChildPhase("行诉一审立案");
+        phases.add(casePhase7);
+
+        ReportAffairCasePhase casePhase8 = new ReportAffairCasePhase();
+        casePhase8.setFlowName("添加行政答辩状");
+        casePhase8.setCasePhase("行政一审");
+        casePhase8.setCaseChildPhase("行政答辩");
+        phases.add(casePhase8);
+
+        ReportAffairCasePhase casePhase9 = new ReportAffairCasePhase();
+        casePhase9.setFlowName("添加请求人答辩状");
+        casePhase9.setCasePhase("行政一审");
+        casePhase9.setCaseChildPhase("请求人答辩");
+        phases.add(casePhase9);
+
+        ReportAffairCasePhase casePhase10 = new ReportAffairCasePhase();
+        casePhase10.setFlowName("添加请求人证据");
+        casePhase10.setCasePhase("行政一审");
+        casePhase10.setCaseChildPhase("请求人提交证据");
+        phases.add(casePhase10);
+
+        ReportAffairCasePhase casePhase11 = new ReportAffairCasePhase();
+        casePhase11.setFlowName("添加庭审笔录");
+        casePhase11.setCasePhase("行政一审");
+        casePhase11.setCaseChildPhase("庭审记录");
+        phases.add(casePhase11);
+
+        ReportAffairCasePhase casePhase12 = new ReportAffairCasePhase();
+        casePhase12.setFlowName("添加请求人庭后意见");
+        casePhase12.setCasePhase("行政一审");
+        casePhase12.setCaseChildPhase("请求人提交庭后意见");
+        phases.add(casePhase12);
+
+        ReportAffairCasePhase casePhase13 = new ReportAffairCasePhase();
+        casePhase13.setFlowName("添加第三人庭后意见");
+        casePhase13.setCasePhase("行政一审");
+        casePhase13.setCaseChildPhase("第三人提交庭后意见");
+        phases.add(casePhase13);
+
+        ReportAffairCasePhase casePhase14 = new ReportAffairCasePhase();
+        casePhase14.setFlowName("添加行政诉讼传票");
+        casePhase14.setCasePhase("行政一审");
+        casePhase14.setCaseChildPhase("开庭通知");
+        phases.add(casePhase14);
+
+        ReportAffairCasePhase casePhase15 = new ReportAffairCasePhase();
+        casePhase15.setFlowName("添加行政诉讼判决书");
+        casePhase15.setCasePhase("行政一审");
+        casePhase15.setCaseChildPhase("已出一审判决");
+        phases.add(casePhase15);
+
+        ReportAffairCasePhase casePhase16 = new ReportAffairCasePhase();
+        casePhase16.setFlowName("添加其他文档");
+        casePhase16.setCasePhase("行政一审");
+        phases.add(casePhase16);
+
+        ReportAffairCasePhase casePhase17 = new ReportAffairCasePhase();
+        casePhase17.setFlowName("添加行政诉讼上诉状");
+        casePhase17.setCasePhase("行政二审");
+        casePhase17.setCaseChildPhase("行诉二审立案");
+        phases.add(casePhase17);
+
+        ReportAffairCasePhase casePhase18 = new ReportAffairCasePhase();
+        casePhase18.setFlowName("添加行政答辩状");
+        casePhase18.setCasePhase("行政二审");
+        casePhase18.setCaseChildPhase("行政答辩");
+        phases.add(casePhase18);
+
+        ReportAffairCasePhase casePhase19 = new ReportAffairCasePhase();
+        casePhase19.setFlowName("添加请求人答辩状");
+        casePhase19.setCasePhase("行政二审");
+        casePhase19.setCaseChildPhase("请求人答辩");
+        phases.add(casePhase19);
+
+        ReportAffairCasePhase casePhase20 = new ReportAffairCasePhase();
+        casePhase20.setFlowName("添加请求人证据");
+        casePhase20.setCasePhase("行政二审");
+        casePhase20.setCaseChildPhase("请求人提交证据");
+        phases.add(casePhase20);
+
+        ReportAffairCasePhase casePhase21 = new ReportAffairCasePhase();
+        casePhase21.setFlowName("添加庭审笔录");
+        casePhase21.setCasePhase("行政二审");
+        casePhase21.setCaseChildPhase("庭审记录");
+        phases.add(casePhase21);
+
+        ReportAffairCasePhase casePhase22 = new ReportAffairCasePhase();
+        casePhase22.setFlowName("添加请求人庭后意见");
+        casePhase22.setCasePhase("行政二审");
+        casePhase22.setCaseChildPhase("请求人提交庭后意见");
+        phases.add(casePhase22);
+
+        ReportAffairCasePhase casePhase23 = new ReportAffairCasePhase();
+        casePhase23.setFlowName("添加第三人庭后意见");
+        casePhase23.setCasePhase("行政二审");
+        casePhase23.setCaseChildPhase("第三人提交庭后意见");
+        phases.add(casePhase23);
+
+        ReportAffairCasePhase casePhase24 = new ReportAffairCasePhase();
+        casePhase24.setFlowName("添加行政诉讼传票");
+        casePhase24.setCasePhase("行政二审");
+        casePhase24.setCaseChildPhase("开庭通知");
+        phases.add(casePhase24);
+
+        ReportAffairCasePhase casePhase25 = new ReportAffairCasePhase();
+        casePhase25.setFlowName("添加行政诉讼判决书");
+        casePhase25.setCasePhase("行政二审");
+        casePhase25.setCaseChildPhase("已出终审判决");
+        phases.add(casePhase25);
+
+        ReportAffairCasePhase casePhase26 = new ReportAffairCasePhase();
+        casePhase26.setFlowName("添加其他文档");
+        casePhase26.setCasePhase("行政二审");
+        phases.add(casePhase26);
+
+        reportAffairCasePhaseService.saveBatch(phases);
+        System.out.println("finished");
+    }
+}