浏览代码

add shaoyin task

zero 7 月之前
父节点
当前提交
2a26b649a4

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

@@ -9,5 +9,5 @@ public class QueryCasePhaseVO {
 
     private String caseChildPhase;
 
-    private Integer flowType;
+    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;
+}

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

@@ -235,9 +235,13 @@ 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;
 }

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

@@ -1,6 +1,7 @@
 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;
@@ -18,4 +19,6 @@ import java.util.List;
 public interface ReportAffairMapper extends BaseMapper<ReportAffair> {
 
     public List<QueryCasePhaseVO> queryCasePhase(@Param("projectIds") List<Integer> projectIds);
+
+    public List<QueryReportAffairConclusionVO> queryReportAffairConclusion(@Param("projectIds") List<Integer> projectIds);
 }

+ 23 - 1
src/main/java/cn/cslg/pas/service/business/InvalidDecisionFileService.java

@@ -10,15 +10,19 @@ import cn.cslg.pas.common.vo.invalidVO.OralTrailVO;
 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;
@@ -45,7 +49,8 @@ public class InvalidDecisionFileService extends ServiceImpl<InvalidDecisionFileM
     private AssoInvalidDecisionCronService assoInvalidDecisionCronService;
 
     @Autowired
-    private MailSendService mailSendService;
+    private ReportProjectMapper reportProjectMapper;
+
 
     public Integer add(AddInvalidDecisionFileDTO addInvalidDecisionFileDTO){
         if (addInvalidDecisionFileDTO == null) {
@@ -78,6 +83,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()) {
@@ -109,6 +115,20 @@ public class InvalidDecisionFileService extends ServiceImpl<InvalidDecisionFileM
         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();
+            }
+        }
+    }
+
     /**
      * 修改无效决定书
      * @param updateInvalidDecisionFileDTO
@@ -133,6 +153,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);

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

@@ -149,7 +149,7 @@ public class ReportAffairService extends ServiceImpl<ReportAffairMapper, ReportA
                     LambdaQueryWrapper<CourtOrder> queryWrapper1 = new LambdaQueryWrapper<>();
                     queryWrapper1.eq(CourtOrder::getReportAffairId, id);
                     courtOrderService.remove(queryWrapper1);
-                } else if (flowType.equals(17) || flowType.equals(27)) {//其他文档
+                } else if (flowType.equals(17) || flowType.equals(27) || flowType.equals(28)) {//其他文档
                     LambdaQueryWrapper<OtherDocuments> queryWrapper1 = new LambdaQueryWrapper<>();
                     queryWrapper1.eq(OtherDocuments::getReportAffairId, id);
                     otherDocumentsService.remove(queryWrapper1);
@@ -219,7 +219,7 @@ public class ReportAffairService extends ServiceImpl<ReportAffairMapper, ReportA
                     this.loadClaimHistory(reportAffairVO);
                 } else if (type.equals(3)) {//3 补充证据及理由
                     this.loadSupplyEvidence(reportAffairVO);
-                } else if (type.equals(17) || type.equals(27)) {//17 27 其他文档
+                } else if (type.equals(17) || type.equals(27) || type.equals(28)) {//17 27 28其他文档
                     this.loadOtherDocuments(reportAffairVO);
                     reportAffairVO.setCaseChildPhase(item.getCaseChildPhase());
                 }

+ 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) {

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

@@ -16,6 +16,7 @@ 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;
@@ -74,6 +75,12 @@ public class LitigationService extends ServiceImpl<LitigationMapper, Litigation>
         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;
     }
@@ -145,6 +152,16 @@ public class LitigationService extends ServiceImpl<LitigationMapper, Litigation>
         });
         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;
+    }
 }
 
 

+ 273 - 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,37 @@
     "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"
   }
 ]

+ 40 - 12
src/main/resources/mapper/ReportAffairMapper.xml

@@ -2,17 +2,45 @@
 <!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 a.case_phase,
-        (CASE
-           WHEN a.case_child_phase is not null or a.case_child_phase != '' THEN a.case_child_phase
-           ELSE b.case_child_phase
-        END) AS caseChildPhase
-        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>
-        order by b.occurred_time desc,b.id desc
+        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>