Kaynağa Gözat

今日白天修改代码推送

chendayu 2 yıl önce
ebeveyn
işleme
9cb19694db

+ 4 - 2
RMS/src/main/java/cn/cslg/report/controller/InvalidReReport/ArgumentsController.java

@@ -35,6 +35,7 @@ public class ArgumentsController {
     private final AssoReportPersonService assoReportPersonService;
     private final ArgumentsService argumentsService;
     private final AssoFeatureProofService assoFeatureProofService;
+
     @Operation(summary = "添加陈述意见")
     @PostMapping("/addArguments")
     public String addArguments(@RequestBody ArgumentsDTO argumentsDTO) throws IOException {
@@ -69,12 +70,13 @@ public class ArgumentsController {
     @Operation(summary = "查询陈述意见列表")
     @GetMapping("/queryPoofArguments")
     public String queryPoofArguments(Integer proofId, Integer rightSort, Integer reportId) throws IOException {
-        return Response.success(argumentsService.queryPoofArguments(proofId,rightSort,reportId));
+        return Response.success(argumentsService.queryPoofArguments(proofId, rightSort, reportId));
     }
 
     @Operation(summary = "根据特征查询相关证据")
     @GetMapping("/queryProofStr")
     public String queryProofStr(Integer proofId, Integer featureId) throws IOException {
-        return Response.success(assoFeatureProofService.queryProofStr(proofId,featureId));
+        return Response.success(assoFeatureProofService.queryProofStr(proofId, featureId));
     }
+
 }

+ 5 - 10
RMS/src/main/java/cn/cslg/report/controller/InvalidReReport/ProofController.java

@@ -38,15 +38,10 @@ public class ProofController {
     private final ProofService proofService;
 
 //    @Operation(summary = "上传专利文献证据(文件)")
-//    @PostMapping("/addPatentProofByFile")
-//    public String addPatentProofByFile(@RequestBody ShareReportDTO shareReportDTO) {
-//        proofService.addPatentProofByFile()
-//        return Response.success(flag);
-//    }
-
-
-
-
-
+////    @PostMapping("/addPatentProofByFile")
+////    public String addPatentProofByFile(@RequestBody ShareReportDTO shareReportDTO) {
+////        proofService.addPatentProofByFile()
+////        return Response.success(flag);
+////    }
 
 }

+ 31 - 32
RMS/src/main/java/cn/cslg/report/service/business/InvalidReReport/ArgumentsService.java

@@ -58,23 +58,22 @@ public class ArgumentsService extends ServiceImpl<ArgumentsMapper, Arguments> {
      */
     public String addArguments(ArgumentsDTO argumentsDTO) throws IOException {
         // 检验参数
-        if (argumentsDTO == null || argumentsDTO.getReportId() == null  || argumentsDTO.getRightId() == null || argumentsDTO.getProofId() == null || argumentsDTO.getProofStr() == null) {
+        if (argumentsDTO == null || argumentsDTO.getReportId() == null || argumentsDTO.getRightId() == null || argumentsDTO.getProofId() == null) {
             return Response.error("参数不正确");
         }
-       if(argumentsDTO.getFeatureId()==null){
-           FeaturesDTO featuresDTO=new FeaturesDTO();
-           featuresDTO.setReportId(argumentsDTO.getReportId());
-           featuresDTO.setRightId(argumentsDTO.getRightId());
-           featuresDTO.setContent(argumentsDTO.getFeatureContent());
-      String ret =  featureService.addSingleFeature(featuresDTO);
-      Response response =JSONObject.parseObject(ret,Response.class);
-      if(response.getCode().equals(0)){
-          return  ret;
-      }
-      else{
-          argumentsDTO.setFeatureId(Integer.parseInt(response.getData().toString()));
-      }
-       }
+        if (argumentsDTO.getFeatureId() == null) {
+            FeaturesDTO featuresDTO = new FeaturesDTO();
+            featuresDTO.setReportId(argumentsDTO.getReportId());
+            featuresDTO.setRightId(argumentsDTO.getRightId());
+            featuresDTO.setContent(argumentsDTO.getFeatureContent());
+            String ret = featureService.addSingleFeature(featuresDTO);
+            Response response = JSONObject.parseObject(ret, Response.class);
+            if (response.getCode().equals(0)) {
+                return ret;
+            } else {
+                argumentsDTO.setFeatureId(Integer.parseInt(response.getData().toString()));
+            }
+        }
         AssoFeatureProof assoFeatureProof = new AssoFeatureProof();
         //根据特征id和文件id查询
         LambdaQueryWrapper<AssoFeatureProof> wrapper = new LambdaQueryWrapper<>();
@@ -97,6 +96,7 @@ public class ArgumentsService extends ServiceImpl<ArgumentsMapper, Arguments> {
         Arguments arguments = new Arguments();
         BeanUtils.copyProperties(argumentsDTO, arguments);
         arguments.setCreateId(loginId);
+        arguments.setRightSort(argumentsDTO.getRightId());
         arguments.insert();
         //若划词不为空
         if (argumentsDTO.getContent() != null) {
@@ -158,8 +158,8 @@ public class ArgumentsService extends ServiceImpl<ArgumentsMapper, Arguments> {
      *
      * @param
      */
-    public  List<ArgumentsDetailsVO>  queryScratchs(Integer fileId) {
-        List<ArgumentsDetailsVO> argumentsDetailsVOS =new ArrayList<>();
+    public List<ArgumentsDetailsVO> queryScratchs(Integer fileId) {
+        List<ArgumentsDetailsVO> argumentsDetailsVOS = new ArrayList<>();
         //根据文件id查询文件
         CompareFiles compareFiles = compareFilesService.getById(fileId);
         String patentNo = compareFiles.getPatentNo();
@@ -194,12 +194,12 @@ public class ArgumentsService extends ServiceImpl<ArgumentsMapper, Arguments> {
         for (Scratch item : scratchList) {
             ArgumentsDetailsVO argumentsDetailsVO = new ArgumentsDetailsVO();
             argumentsDetailsVO.setColor(item.getScratchColor());
-            argumentsDetailsVO.setSortStr("D"+(compareFiles.getSysOrder()));
+            argumentsDetailsVO.setSortStr("D" + (compareFiles.getSysOrder()));
             Arguments argument = arguments.stream().filter(tem -> tem.getId().equals(item.getArgumentId())).findFirst().orElse(null);
-            BeanUtils.copyProperties(argument,argumentsDetailsVO);
+            BeanUtils.copyProperties(argument, argumentsDetailsVO);
             BeanUtils.copyProperties(item, argumentsDetailsVO);
-       AssoFeatureProof assoFeatureProof=     assoFeatureProofs.stream().filter(tem->tem.getFeatureId().equals(argument.getFeatureId())).findFirst().orElse(null);
-            if(assoFeatureProof!=null) {
+            AssoFeatureProof assoFeatureProof = assoFeatureProofs.stream().filter(tem -> tem.getFeatureId().equals(argument.getFeatureId())).findFirst().orElse(null);
+            if (assoFeatureProof != null) {
                 argumentsDetailsVO.setProofStr(assoFeatureProof.getProofStr());
                 argumentsDetailsVO.setProofStrId(assoFeatureProof.getId());
             }
@@ -220,9 +220,9 @@ public class ArgumentsService extends ServiceImpl<ArgumentsMapper, Arguments> {
             return Response.error("参数不正确");
         }
         //根据划词id查询划词信息
-        Integer scratchId=argumentsDTO.getId();
+        Integer scratchId = argumentsDTO.getId();
         //根据划词id获得划词信息
-        Scratch scratch =scratchService.getById(scratchId);
+        Scratch scratch = scratchService.getById(scratchId);
         //装载划词信息并更新
         scratch.setScratchColor(argumentsDTO.getColor());
         scratch.setScratchType(argumentsDTO.getScratchType());
@@ -239,21 +239,20 @@ public class ArgumentsService extends ServiceImpl<ArgumentsMapper, Arguments> {
         featureProofWrapper.in(AssoFeatureProof::getFeatureId, argumentsDTO.getFeatureId())
                 .eq(AssoFeatureProof::getCompareFileId, arguments.getProofId());
         List<AssoFeatureProof> assoFeatureProofs = assoFeatureProofService.list(featureProofWrapper);
-        if(assoFeatureProofs.size()==0){
-            AssoFeatureProof assoFeatureProof =new AssoFeatureProof();
+        if (assoFeatureProofs.size() == 0) {
+            AssoFeatureProof assoFeatureProof = new AssoFeatureProof();
             assoFeatureProof.setFeatureId(argumentsDTO.getFeatureId());
             assoFeatureProof.setFeatureId(arguments.getProofId());
             assoFeatureProof.setProofStr(argumentsDTO.getProofStr());
             assoFeatureProof.insert();
-        }
-        else{
+        } else {
             AssoFeatureProof assoFeatureProof = assoFeatureProofs.get(0);
             assoFeatureProof.setProofStr(argumentsDTO.getProofStr());
             assoFeatureProof.updateById();
 
         }
 
-       return Response.success("修改成功");
+        return Response.success("修改成功");
     }
 
 
@@ -299,7 +298,7 @@ public class ArgumentsService extends ServiceImpl<ArgumentsMapper, Arguments> {
         //根据特征和证据id获得陈述意见
         List<Arguments> arguments = this.baseMapper.getArguments(argumentsListVOS);
 
-//装载陈述意见
+        //装载陈述意见
         argumentsListVOS.forEach(
                 item -> {
                     item.setArguments(new ArrayList<>());
@@ -448,8 +447,8 @@ public class ArgumentsService extends ServiceImpl<ArgumentsMapper, Arguments> {
 
 
     public static void main(String[] args) {
-        String a =Response.error();
-      Response av =  JSONObject.parseObject(a,Response.class);
-    System.out.println(av.getCode());
+        String a = Response.error();
+        Response av = JSONObject.parseObject(a, Response.class);
+        System.out.println(av.getCode());
     }
 }

+ 12 - 6
RMS/src/main/java/cn/cslg/report/service/business/ReportService.java

@@ -11,10 +11,12 @@ import cn.cslg.report.entity.*;
 import cn.cslg.report.entity.asso.AssoReportFile;
 import cn.cslg.report.entity.asso.AssoReportPerson;
 import cn.cslg.report.entity.invalidReReport.InvalidReReport;
+import cn.cslg.report.entity.invalidReReport.InvalidReason;
 import cn.cslg.report.exception.XiaoShiException;
 import cn.cslg.report.mapper.ReportMapper;
 import cn.cslg.report.service.*;
 import cn.cslg.report.service.business.InvalidReReport.InvalidReReportService;
+import cn.cslg.report.service.business.InvalidReReport.InvalidReasonService;
 import cn.cslg.report.service.business.asso.AssoReportPersonService;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
@@ -66,6 +68,7 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
     private final IAssoEventReportService assoEventReportService;
     private final IFollowUpService followUpService;
     private final InvalidReReportService invalidReReportService;
+    private final InvalidReasonService invalidReasonService;
 
     private Report loadReport(ReportDTO reportDto) {
         Report report = new Report();
@@ -128,7 +131,7 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
     @Transactional(rollbackFor = Exception.class)
     public Integer addReport(ReportDTO reportDto, List<MultipartFile> files) throws IOException {
         //侵权/回避报告,若状态不是审核/完成,则直接将报告状态置为2(处理中)
-        if (reportDto.getType().equals(4) || reportDto.getType().equals(5)||reportDto.getType().equals(7)) {
+        if (reportDto.getType().equals(4) || reportDto.getType().equals(5) || reportDto.getType().equals(7)) {
             if (reportDto.getStatus() != null && reportDto.getStatus() != 0 && reportDto.getStatus() != 3) {
                 reportDto.setStatus(2);
             }
@@ -473,6 +476,9 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
         compareMessageService.deleteByreportID(id);
         //TODO 当时无效应对报告时
 
+        //删除与报告关联的表数据
+        //删除无效理由表数据
+        invalidReasonService.remove(new LambdaQueryWrapper<InvalidReason>().eq(InvalidReason::getReportId, id));
 
         Boolean dele = this.removeById(id);
         if (dele == true) {
@@ -707,20 +713,20 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
     }
 
     /**
-     * @autor 谢翔
      * @param ReportId
      * @return
+     * @autor 谢翔
      */
     public ReportDeVO reReportDetail(Integer reportId) {
         ReportDeVO reportDeVO = new ReportDeVO();
         //检测传入参数合法性
-        if(reportId == null && reportId <=0){
+        if (reportId == null && reportId <= 0) {
             throw new XiaoShiException("传入参数异常");
         }
         //根据报告id获得报告
         Report report = this.getById(reportId);
         //若根据报告id未获取到报告返回空
-        if(report == null){
+        if (report == null) {
             return null;
         }
         List<Report> reports = new ArrayList<>();
@@ -730,11 +736,11 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
             List<Report> reports1 = this.reportData(reports);
             Report report1 = reports1.get(0);
             //若报告为无效应对报告则从无效应对报告表中获得无效对应报告拓展信息
-            if(report1.getType().equals(7)){
+            if (report1.getType().equals(7)) {
                 LambdaQueryWrapper<InvalidReReport> queryWrapper = new LambdaQueryWrapper<>();
                 queryWrapper.eq(InvalidReReport::getReportId, report1.getId());
                 InvalidReReport invalidReReport = invalidReReportService.getOne(queryWrapper);
-                if(invalidReReport == null){
+                if (invalidReReport == null) {
                     throw new XiaoShiException("未查询到无效应对报告信息");
                 }
                 //装载报告信息,无效对应报告拓展信息到ReportDeDTO并返回