|
@@ -1,26 +1,38 @@
|
|
package cn.cslg.report.service.business.InvalidReReport;
|
|
package cn.cslg.report.service.business.InvalidReReport;
|
|
|
|
|
|
|
|
+import cn.cslg.report.common.model.dto.FeaturesDTO;
|
|
import cn.cslg.report.common.model.dto.invalidReReport.ArgumentsDTO;
|
|
import cn.cslg.report.common.model.dto.invalidReReport.ArgumentsDTO;
|
|
-import cn.cslg.report.common.model.dto.invalidReReport.ArgumentsQueryDTO;
|
|
|
|
-import cn.cslg.report.common.model.vo.invalidReReport.ArgumentsVO;
|
|
|
|
|
|
+import cn.cslg.report.common.model.dto.invalidReReport.ArgumentsDetailsDTO;
|
|
|
|
+import cn.cslg.report.common.model.dto.invalidReReport.ArgumentsListDTO;
|
|
|
|
+import cn.cslg.report.common.model.vo.invalidReReport.ArgumentsDetailsVO;
|
|
|
|
+import cn.cslg.report.common.model.vo.invalidReReport.ArgumentsListVO;
|
|
|
|
+import cn.cslg.report.common.utils.Response;
|
|
import cn.cslg.report.common.utils.SecurityUtils.LoginUtils;
|
|
import cn.cslg.report.common.utils.SecurityUtils.LoginUtils;
|
|
|
|
+import cn.cslg.report.entity.CompareFiles;
|
|
import cn.cslg.report.entity.Features;
|
|
import cn.cslg.report.entity.Features;
|
|
|
|
+import cn.cslg.report.entity.PatentRight;
|
|
|
|
+import cn.cslg.report.entity.Report;
|
|
import cn.cslg.report.entity.invalidReReport.*;
|
|
import cn.cslg.report.entity.invalidReReport.*;
|
|
import cn.cslg.report.mapper.InvalidReReport.ArgumentsMapper;
|
|
import cn.cslg.report.mapper.InvalidReReport.ArgumentsMapper;
|
|
-import cn.cslg.report.mapper.InvalidReReport.AssoArgumentsMapper;
|
|
|
|
|
|
+
|
|
|
|
+import cn.cslg.report.service.business.CompareFilesService;
|
|
import cn.cslg.report.service.business.FeatureService;
|
|
import cn.cslg.report.service.business.FeatureService;
|
|
|
|
+import cn.cslg.report.service.business.ReportService;
|
|
|
|
+
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
-import io.swagger.v3.oas.models.security.SecurityScheme;
|
|
|
|
|
|
+
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.context.annotation.Lazy;
|
|
import org.springframework.context.annotation.Lazy;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
-import java.util.HashMap;
|
|
|
|
|
|
+import java.io.IOException;
|
|
|
|
+import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
-import java.util.Map;
|
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
@@ -28,22 +40,57 @@ import java.util.stream.Collectors;
|
|
@Slf4j
|
|
@Slf4j
|
|
@RequiredArgsConstructor(onConstructor_ = {@Lazy})
|
|
@RequiredArgsConstructor(onConstructor_ = {@Lazy})
|
|
public class ArgumentsService extends ServiceImpl<ArgumentsMapper, Arguments> {
|
|
public class ArgumentsService extends ServiceImpl<ArgumentsMapper, Arguments> {
|
|
- private static ProofService proofService;
|
|
|
|
- private static LoginUtils loginUtils;
|
|
|
|
- private static ScratchService scratchService;
|
|
|
|
- private static AssoArgumentsService assoArgumentsService;
|
|
|
|
- private static FeatureService featureService;
|
|
|
|
- private static AssoFeatureProofService assoFeatureProofService;
|
|
|
|
|
|
+ private final ProofService proofService;
|
|
|
|
+ private final LoginUtils loginUtils;
|
|
|
|
+ private final ScratchService scratchService;
|
|
|
|
+ private final AssoArgumentsService assoArgumentsService;
|
|
|
|
+ private final FeatureService featureService;
|
|
|
|
+ private final AssoFeatureProofService assoFeatureProofService;
|
|
|
|
+ private final ArgumentsService argumentsService;
|
|
|
|
+ private final ReportService reportService;
|
|
|
|
+ private final CompareFilesService compareFilesService;
|
|
|
|
+
|
|
|
|
|
|
/**
|
|
/**
|
|
* 添加陈述意见
|
|
* 添加陈述意见
|
|
*
|
|
*
|
|
* @param argumentsDTO
|
|
* @param argumentsDTO
|
|
*/
|
|
*/
|
|
- public void addArguments(ArgumentsDTO argumentsDTO) {
|
|
|
|
|
|
+ public String addArguments(ArgumentsDTO argumentsDTO) throws IOException {
|
|
// 检验参数
|
|
// 检验参数
|
|
- if (argumentsDTO == null || argumentsDTO.getReportId() == null || argumentsDTO.getFeatureId() == null || argumentsDTO.getRightId() == null || argumentsDTO.getProofId() == null) {
|
|
|
|
- return;
|
|
|
|
|
|
+ if (argumentsDTO == null || argumentsDTO.getReportId() == null || argumentsDTO.getRightId() == null || argumentsDTO.getProofId() == null || argumentsDTO.getProofStr() == 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()));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ AssoFeatureProof assoFeatureProof = new AssoFeatureProof();
|
|
|
|
+ //根据特征id和文件id查询
|
|
|
|
+ LambdaQueryWrapper<AssoFeatureProof> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ wrapper.eq(AssoFeatureProof::getCompareFileId, argumentsDTO.getProofId())
|
|
|
|
+ .eq(AssoFeatureProof::getFeatureId, argumentsDTO.getFeatureId());
|
|
|
|
+ List<AssoFeatureProof> assoFeatureProofs = assoFeatureProofService.list(wrapper);
|
|
|
|
+ //添加相关证据文本
|
|
|
|
+ if (assoFeatureProofs.size() <= 0) {
|
|
|
|
+ assoFeatureProof.setFeatureId(argumentsDTO.getFeatureId());
|
|
|
|
+ assoFeatureProof.setCompareFileId(argumentsDTO.getProofId());
|
|
|
|
+ assoFeatureProof.setProofStr(argumentsDTO.getProofStr());
|
|
|
|
+ assoFeatureProof.insert();
|
|
|
|
+ } else if (assoFeatureProofs.size() > 0) {
|
|
|
|
+ assoFeatureProof = assoFeatureProofs.get(0);
|
|
|
|
+ assoFeatureProof.setProofStr(argumentsDTO.getProofStr());
|
|
|
|
+ assoFeatureProof.updateById();
|
|
}
|
|
}
|
|
Integer loginId = loginUtils.getId();
|
|
Integer loginId = loginUtils.getId();
|
|
//装载陈述意见实体类
|
|
//装载陈述意见实体类
|
|
@@ -56,44 +103,15 @@ public class ArgumentsService extends ServiceImpl<ArgumentsMapper, Arguments> {
|
|
Scratch scratch = new Scratch();
|
|
Scratch scratch = new Scratch();
|
|
BeanUtils.copyProperties(argumentsDTO, scratch);
|
|
BeanUtils.copyProperties(argumentsDTO, scratch);
|
|
//根据证据类型获得证据的专利号
|
|
//根据证据类型获得证据的专利号
|
|
- Proof proof = proofService.getById(arguments.getProofId());
|
|
|
|
|
|
+ CompareFiles proof = compareFilesService.getById(arguments.getProofId());
|
|
String patenNo = proof.getPatentNo();
|
|
String patenNo = proof.getPatentNo();
|
|
scratch.setPatentNo(patenNo);
|
|
scratch.setPatentNo(patenNo);
|
|
scratch.setCreateId(loginId);
|
|
scratch.setCreateId(loginId);
|
|
|
|
+ scratch.setArgumentId(arguments.getId());
|
|
|
|
+ scratch.setReportId(argumentsDTO.getReportId());
|
|
scratch.insert();
|
|
scratch.insert();
|
|
}
|
|
}
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 查询陈述意见详情
|
|
|
|
- *
|
|
|
|
- * @param argumentsId
|
|
|
|
- */
|
|
|
|
- public ArgumentsVO queryArgumentsDetail(Integer argumentsId) {
|
|
|
|
- //判断argumentsId是否为空
|
|
|
|
- if (argumentsId == null) {
|
|
|
|
- return null;
|
|
|
|
- }
|
|
|
|
- ArgumentsVO argumentsVO = new ArgumentsVO();
|
|
|
|
- //根据argumentsId查询陈述意见
|
|
|
|
- Arguments arguments = this.getById(argumentsId);
|
|
|
|
- BeanUtils.copyProperties(arguments, argumentsVO);
|
|
|
|
- //根据证据id获得专利号
|
|
|
|
- Proof proof = proofService.getById(arguments.getProofId());
|
|
|
|
- if (proof.getPatentNo() != null) {
|
|
|
|
- //根据专利号和报告id获得划词内容
|
|
|
|
- LambdaQueryWrapper<Scratch> scratchLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
- scratchLambdaQueryWrapper.eq(Scratch::getPatentNo, proof.getPatentNo());
|
|
|
|
- scratchLambdaQueryWrapper.eq(Scratch::getReportId, arguments.getReportId());
|
|
|
|
- List<Scratch> scratchList = scratchService.list(scratchLambdaQueryWrapper);
|
|
|
|
- if (scratchList.size() > 0) {
|
|
|
|
- Scratch scratch = scratchList.get(0);
|
|
|
|
- BeanUtils.copyProperties(scratch, argumentsVO);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return argumentsVO;
|
|
|
|
|
|
+ return Response.success("添加成功");
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -103,7 +121,7 @@ public class ArgumentsService extends ServiceImpl<ArgumentsMapper, Arguments> {
|
|
*/
|
|
*/
|
|
public void deleteArguments(List<Integer> argumentsIds) {
|
|
public void deleteArguments(List<Integer> argumentsIds) {
|
|
//判断argumentsId是否为空
|
|
//判断argumentsId是否为空
|
|
- if (argumentsIds == null) {
|
|
|
|
|
|
+ if (argumentsIds == null || argumentsIds.size() == 0) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
//判断陈述意见方案中是否有正在使用的陈述意见
|
|
//判断陈述意见方案中是否有正在使用的陈述意见
|
|
@@ -119,10 +137,10 @@ public class ArgumentsService extends ServiceImpl<ArgumentsMapper, Arguments> {
|
|
List<Arguments> arguments = this.list(argumentsWrapper);
|
|
List<Arguments> arguments = this.list(argumentsWrapper);
|
|
List<Integer> proofIds = arguments.stream().map(Arguments::getProofId).collect(Collectors.toList());
|
|
List<Integer> proofIds = arguments.stream().map(Arguments::getProofId).collect(Collectors.toList());
|
|
//根据proofIds获得proof
|
|
//根据proofIds获得proof
|
|
- LambdaQueryWrapper<Proof> proofWrapper = new LambdaQueryWrapper<>();
|
|
|
|
- proofWrapper.in(Proof::getId, proofIds);
|
|
|
|
- List<Proof> proofs = proofService.list(proofWrapper);
|
|
|
|
- List<String> patentNos = proofs.stream().map(Proof::getPatentNo).collect(Collectors.toList());
|
|
|
|
|
|
+ LambdaQueryWrapper<CompareFiles> proofWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ proofWrapper.in(CompareFiles::getId, proofIds);
|
|
|
|
+ List<CompareFiles> proofs = compareFilesService.list(proofWrapper);
|
|
|
|
+ List<String> patentNos = proofs.stream().map(CompareFiles::getPatentNo).collect(Collectors.toList());
|
|
if (patentNos.size() > 0) {
|
|
if (patentNos.size() > 0) {
|
|
//根据专利号和报告id获得划词内容
|
|
//根据专利号和报告id获得划词内容
|
|
LambdaQueryWrapper<Scratch> scratchLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<Scratch> scratchLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
@@ -135,50 +153,105 @@ public class ArgumentsService extends ServiceImpl<ArgumentsMapper, Arguments> {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 查询陈述意见列表
|
|
|
|
|
|
+ * 查询划词陈述意见
|
|
*
|
|
*
|
|
- * @param argumentsQueryDTO
|
|
|
|
|
|
+ * @param
|
|
*/
|
|
*/
|
|
- public void queryArguments(ArgumentsQueryDTO argumentsQueryDTO) {
|
|
|
|
- //判断reportId是否为空
|
|
|
|
- if (argumentsQueryDTO.getReportId() == null) {
|
|
|
|
- return;
|
|
|
|
|
|
+ public List<ArgumentsDetailsVO> queryScratchs(Integer fileId) {
|
|
|
|
+ List<ArgumentsDetailsVO> argumentsDetailsVOS =new ArrayList<>();
|
|
|
|
+ //根据文件id查询文件
|
|
|
|
+ CompareFiles compareFiles = compareFilesService.getById(fileId);
|
|
|
|
+ String patentNo = compareFiles.getPatentNo();
|
|
|
|
+ //根据报告id获得标的专利号
|
|
|
|
+ Report report = reportService.getById(compareFiles.getReportId());
|
|
|
|
+ Integer reportId = report.getId();
|
|
|
|
+ String signPatentNo = report.getSignPatentNo();
|
|
|
|
+ // 根据报告id和权要id获得所有特征
|
|
|
|
+ LambdaQueryWrapper<Features> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ wrapper.eq(Features::getReportId, reportId);
|
|
|
|
+ List<Features> features = featureService.list(wrapper);
|
|
|
|
+ List<Integer> featureIds = features.stream().map(Features::getId).collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ //根据特征和文件id获得证据
|
|
|
|
+ LambdaQueryWrapper<AssoFeatureProof> featureProofWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ featureProofWrapper.in(AssoFeatureProof::getFeatureId, featureIds)
|
|
|
|
+ .eq(AssoFeatureProof::getCompareFileId, fileId);
|
|
|
|
+ List<AssoFeatureProof> assoFeatureProofs = assoFeatureProofService.list(featureProofWrapper);
|
|
|
|
+ //查询划词信息
|
|
|
|
+ LambdaQueryWrapper<Scratch> scratchLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ scratchLambdaQueryWrapper.eq(Scratch::getPatentNo, patentNo);
|
|
|
|
+ scratchLambdaQueryWrapper.eq(Scratch::getReportId, reportId);
|
|
|
|
+ List<Scratch> scratchList = scratchService.list(scratchLambdaQueryWrapper);
|
|
|
|
+ //获得陈述意见
|
|
|
|
+ List<Arguments> arguments = new ArrayList<>();
|
|
|
|
+ List<Integer> argumentIds = scratchList.stream().map(Scratch::getArgumentId).collect(Collectors.toList());
|
|
|
|
+ if (argumentIds.size() > 0) {
|
|
|
|
+ LambdaQueryWrapper<Arguments> wrapper1 = new LambdaQueryWrapper<>();
|
|
|
|
+ wrapper1.in(Arguments::getId, argumentIds);
|
|
|
|
+ arguments = argumentsService.list(wrapper1);
|
|
}
|
|
}
|
|
- LambdaQueryWrapper<Arguments> argumentsLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
- argumentsLambdaQueryWrapper.eq(Arguments::getReportId, argumentsQueryDTO.getReportId());
|
|
|
|
- if (argumentsQueryDTO.getReportId() != null) {
|
|
|
|
- argumentsLambdaQueryWrapper.eq(Arguments::getRightId, argumentsQueryDTO.getRightId());
|
|
|
|
|
|
+ for (Scratch item : scratchList) {
|
|
|
|
+ ArgumentsDetailsVO argumentsDetailsVO = new ArgumentsDetailsVO();
|
|
|
|
+ argumentsDetailsVO.setColor(item.getScratchColor());
|
|
|
|
+ BeanUtils.copyProperties(item, argumentsDetailsVO);
|
|
|
|
+ Arguments argument = arguments.stream().filter(tem -> tem.getId().equals(item.getArgumentId())).findFirst().orElse(null);
|
|
|
|
+ BeanUtils.copyProperties(argument,argumentsDetailsVO);
|
|
|
|
+ AssoFeatureProof assoFeatureProof= assoFeatureProofs.stream().filter(tem->tem.getFeatureId().equals(argument.getFeatureId())).findFirst().orElse(null);
|
|
|
|
+ if(assoFeatureProof!=null) {
|
|
|
|
+ argumentsDetailsVO.setArgumentStr(assoFeatureProof.getProofStr());
|
|
|
|
+ argumentsDetailsVO.setProofStrId(assoFeatureProof.getId());
|
|
|
|
+ }
|
|
|
|
+ argumentsDetailsVOS.add(argumentsDetailsVO);
|
|
}
|
|
}
|
|
|
|
+ return argumentsDetailsVOS;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 添加陈述意见
|
|
* 添加陈述意见
|
|
*
|
|
*
|
|
* @param argumentsDTO
|
|
* @param argumentsDTO
|
|
|
|
+ * @return
|
|
*/
|
|
*/
|
|
- public void updateArgumentsBatch(ArgumentsDTO argumentsDTO) {
|
|
|
|
|
|
+ public String updateArgument(ArgumentsDetailsDTO argumentsDTO) {
|
|
// 检验参数
|
|
// 检验参数
|
|
if (argumentsDTO == null || argumentsDTO.getReportId() == null || argumentsDTO.getFeatureId() == null || argumentsDTO.getRightId() == null || argumentsDTO.getProofId() == null) {
|
|
if (argumentsDTO == null || argumentsDTO.getReportId() == null || argumentsDTO.getFeatureId() == null || argumentsDTO.getRightId() == null || argumentsDTO.getProofId() == null) {
|
|
- return;
|
|
|
|
|
|
+ return Response.error("参数不正确");
|
|
}
|
|
}
|
|
- Integer loginId = loginUtils.getId();
|
|
|
|
- //装载陈述意见实体类
|
|
|
|
- Arguments arguments = new Arguments();
|
|
|
|
- BeanUtils.copyProperties(argumentsDTO, arguments);
|
|
|
|
- arguments.setCreateId(loginId);
|
|
|
|
- arguments.insert();
|
|
|
|
- //若划词不为空
|
|
|
|
- if (argumentsDTO.getContent() != null) {
|
|
|
|
- Scratch scratch = new Scratch();
|
|
|
|
- BeanUtils.copyProperties(argumentsDTO, scratch);
|
|
|
|
- //根据证据类型获得证据的专利号
|
|
|
|
- Proof proof = proofService.getById(arguments.getProofId());
|
|
|
|
- String patenNo = proof.getPatentNo();
|
|
|
|
- scratch.setPatentNo(patenNo);
|
|
|
|
- scratch.setCreateId(loginId);
|
|
|
|
- scratch.insert();
|
|
|
|
|
|
+ //根据划词id查询划词信息
|
|
|
|
+ Integer scratchId=argumentsDTO.getId();
|
|
|
|
+ //根据划词id获得划词信息
|
|
|
|
+ Scratch scratch =scratchService.getById(scratchId);
|
|
|
|
+ //装载划词信息并更新
|
|
|
|
+ scratch.setScratchColor(argumentsDTO.getColor());
|
|
|
|
+ scratch.setScratchType(argumentsDTO.getScratchType());
|
|
|
|
+ scratch.updateById();
|
|
|
|
+ //根据陈述意见id更新陈述意见
|
|
|
|
+ Arguments arguments = this.getById(scratch.getArgumentId());
|
|
|
|
+ arguments.setArgumentStr(argumentsDTO.getArgumentStr());
|
|
|
|
+ arguments.setRightId(argumentsDTO.getRightId());
|
|
|
|
+ arguments.setFeatureId(argumentsDTO.getFeatureId());
|
|
|
|
+ arguments.updateById();
|
|
|
|
+ //装载并更新证据
|
|
|
|
+ //根据特征和文件id获得证据
|
|
|
|
+ LambdaQueryWrapper<AssoFeatureProof> featureProofWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ 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();
|
|
|
|
+ assoFeatureProof.setFeatureId(argumentsDTO.getFeatureId());
|
|
|
|
+ assoFeatureProof.setFeatureId(arguments.getProofId());
|
|
|
|
+ assoFeatureProof.setProofStr(argumentsDTO.getProofStr());
|
|
|
|
+ assoFeatureProof.insert();
|
|
}
|
|
}
|
|
|
|
+ else{
|
|
|
|
+ AssoFeatureProof assoFeatureProof = assoFeatureProofs.get(0);
|
|
|
|
+ assoFeatureProof.setProofStr(argumentsDTO.getProofStr());
|
|
|
|
+ assoFeatureProof.updateById();
|
|
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return Response.success("修改成功");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -187,21 +260,194 @@ public class ArgumentsService extends ServiceImpl<ArgumentsMapper, Arguments> {
|
|
*
|
|
*
|
|
* @param
|
|
* @param
|
|
*/
|
|
*/
|
|
- public void queryPoofArguments(Integer fileId, Integer rightSort, Integer reportId) {
|
|
|
|
|
|
+ public List<ArgumentsListVO> queryPoofArguments(Integer fileId, Integer rightSort, Integer reportId) throws IOException {
|
|
|
|
+ PatentRight patentRight = this.getPatentRight(reportId, rightSort);
|
|
|
|
+ List<ArgumentsListVO> argumentsListVOS = new ArrayList<>();
|
|
// 根据报告id和权要id获得所有特征
|
|
// 根据报告id和权要id获得所有特征
|
|
LambdaQueryWrapper<Features> wrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<Features> wrapper = new LambdaQueryWrapper<>();
|
|
wrapper.eq(Features::getReportId, reportId)
|
|
wrapper.eq(Features::getReportId, reportId)
|
|
.eq(Features::getRightId, rightSort);
|
|
.eq(Features::getRightId, rightSort);
|
|
List<Features> features = featureService.list(wrapper);
|
|
List<Features> features = featureService.list(wrapper);
|
|
- List<Integer> featureIds =features.stream().map(Features::getId).collect(Collectors.toList());
|
|
|
|
|
|
+ List<Integer> featureIds = features.stream().map(Features::getId).collect(Collectors.toList());
|
|
//根据特征和文件id获得证据
|
|
//根据特征和文件id获得证据
|
|
- LambdaQueryWrapper<AssoFeatureProof> featureProofWrapper =new LambdaQueryWrapper<>();
|
|
|
|
- featureProofWrapper.in(AssoFeatureProof::getFeature_ID,featureIds)
|
|
|
|
- .eq(AssoFeatureProof::getCompareFileId,fileId);
|
|
|
|
- List<AssoFeatureProof> assoFeatureProofs =assoFeatureProofService.list();
|
|
|
|
- List<Integer> assoFeatureProofIds =assoFeatureProofs.stream().map(AssoFeatureProof::getID).collect(Collectors.toList());
|
|
|
|
|
|
+ LambdaQueryWrapper<AssoFeatureProof> featureProofWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ featureProofWrapper.in(AssoFeatureProof::getFeatureId, featureIds)
|
|
|
|
+ .eq(AssoFeatureProof::getCompareFileId, fileId);
|
|
|
|
+ List<AssoFeatureProof> assoFeatureProofs = assoFeatureProofService.list(featureProofWrapper);
|
|
|
|
+ //遍历装载特征和相关证据到实体类
|
|
|
|
+ assoFeatureProofs.forEach(item -> {
|
|
|
|
+ Features features1 = features.stream().filter(tem -> tem.getId().equals(item.getFeatureId())).findFirst().orElse(null);
|
|
|
|
+
|
|
|
|
+ ArgumentsListVO argumentsListVO = new ArgumentsListVO();
|
|
|
|
+ //装载权要
|
|
|
|
+ argumentsListVO.setRightSort(patentRight.getSort());
|
|
|
|
+ argumentsListVO.setRightContent(patentRight.getContent());
|
|
|
|
+ argumentsListVO.setRightName("权要" + (patentRight.getSort() + 1));
|
|
|
|
+ //装载特征
|
|
|
|
+ argumentsListVO.setFeatureId(features1.getId());
|
|
|
|
+ argumentsListVO.setFeatureContent(features1.getContent());
|
|
|
|
+ argumentsListVO.setFeatureName("特征" + features1.getFeaturesOrder());
|
|
|
|
+
|
|
|
|
+ argumentsListVO.setProofStrId(item.getId());
|
|
|
|
+ argumentsListVO.setProofStr(item.getProofStr());
|
|
|
|
+ argumentsListVO.setProofId(fileId);
|
|
|
|
+ argumentsListVOS.add(argumentsListVO);
|
|
|
|
+ });
|
|
|
|
+
|
|
//根据特征和证据id获得陈述意见
|
|
//根据特征和证据id获得陈述意见
|
|
|
|
+ List<Arguments> arguments = this.baseMapper.getArguments(argumentsListVOS);
|
|
|
|
+
|
|
|
|
+//装载陈述意见
|
|
|
|
+ argumentsListVOS.forEach(
|
|
|
|
+ item -> {
|
|
|
|
+ item.setArguments(new ArrayList<>());
|
|
|
|
+ List<Arguments> temArguments = arguments.stream().filter(tem -> item.getFeatureId().equals(tem.getFeatureId())).collect(Collectors.toList());
|
|
|
|
+ temArguments.forEach(tem -> {
|
|
|
|
+ ArgumentsListVO.ArgumentIn argumentIn = new ArgumentsListVO.ArgumentIn();
|
|
|
|
+ argumentIn.setArgumentStr(tem.getArgumentStr());
|
|
|
|
+ argumentIn.setId(tem.getId());
|
|
|
|
+ item.getArguments().add(argumentIn);
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ return argumentsListVOS;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 根据排序获得权利要求
|
|
|
|
+ *
|
|
|
|
+ * @param reportId
|
|
|
|
+ * @param sort
|
|
|
|
+ * @return
|
|
|
|
+ * @throws IOException
|
|
|
|
+ */
|
|
|
|
+ private PatentRight getPatentRight(Integer reportId, Integer sort) throws IOException {
|
|
|
|
+ //获得标的专利号
|
|
|
|
+ Report report = reportService.getById(reportId);
|
|
|
|
+ //根据标的专利号获得权要
|
|
|
|
+ List<PatentRight> patentRights = featureService.getRightNames(report.getSignPatentNo());
|
|
|
|
+ PatentRight patentRight = patentRights.stream().filter(item ->
|
|
|
|
+ sort.equals(item.getSort())
|
|
|
|
+ ).findFirst().orElse(null);
|
|
|
|
+ return patentRight;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 批量添加或者更新陈述意见和证据
|
|
|
|
+ *
|
|
|
|
+ * @param argumentsListDTOS
|
|
|
|
+ */
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
+ public String addOrUpdatePoofArguments(List<ArgumentsListDTO> argumentsListDTOS) {
|
|
|
|
+ //当dto的大小为0时返回
|
|
|
|
+ if (argumentsListDTOS == null && argumentsListDTOS.size() <= 0) {
|
|
|
|
+ return Response.error("请输入信息");
|
|
|
|
+ }
|
|
|
|
+// Integer createId = loginUtils.getId();
|
|
|
|
+ Integer createId = 1;
|
|
|
|
+ List<AssoFeatureProof> assoFeatureProofs = new ArrayList<>();
|
|
|
|
+ List<Arguments> arguments = new ArrayList<>();
|
|
|
|
+ List<Integer> featureIds = new ArrayList<>();
|
|
|
|
+ Integer proofId = argumentsListDTOS.get(0).getProofId();
|
|
|
|
+ argumentsListDTOS.forEach(item -> {
|
|
|
|
+ //获得特征ids
|
|
|
|
+ featureIds.add(item.getFeatureId());
|
|
|
|
+ //装载无效证据
|
|
|
|
+ AssoFeatureProof assoFeatureProof = new AssoFeatureProof();
|
|
|
|
+ assoFeatureProof.setCompareFileId(item.getProofId());
|
|
|
|
+ assoFeatureProof.setId(item.getProofStrId());
|
|
|
|
+ assoFeatureProof.setProofStr(item.getProofStr());
|
|
|
|
+ assoFeatureProof.setFeatureId(item.getFeatureId());
|
|
|
|
+ assoFeatureProofs.add(assoFeatureProof);
|
|
|
|
+ //装载陈述意见
|
|
|
|
+ List<ArgumentsListDTO.ArgumentIn> argumentIns = item.getArguments();
|
|
|
|
+ argumentIns.forEach(tem -> {
|
|
|
|
+ Arguments argument = new Arguments();
|
|
|
|
+ argument.setCreateId(createId);
|
|
|
|
+ argument.setFeatureId(item.getFeatureId());
|
|
|
|
+ argument.setArgumentStr(tem.getArgumentStr());
|
|
|
|
+ argument.setId(tem.getId());
|
|
|
|
+ argument.setProofId(item.getProofId());
|
|
|
|
+ argument.setRightId(item.getRightSort());
|
|
|
|
+ argument.setReportId(item.getReportId());
|
|
|
|
+ arguments.add(argument);
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ this.deleteOrUpdateArguments(arguments, featureIds, proofId);
|
|
|
|
+ if (!this.deleteOrUpdateProofStr(assoFeatureProofs, featureIds, proofId)) {
|
|
|
|
+ return Response.error("同一特征有多个证据");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return Response.success("添加成功");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 批量添加或者更新陈述意见
|
|
|
|
+ *
|
|
|
|
+ * @param
|
|
|
|
+ */
|
|
|
|
+ public void deleteOrUpdateArguments(List<Arguments> arguments, List<Integer> featureIds, Integer proofId) {
|
|
|
|
+ LambdaQueryWrapper<Arguments> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ wrapper.in(Arguments::getFeatureId, featureIds)
|
|
|
|
+ .eq(Arguments::getProofId, proofId);
|
|
|
|
+ List<Arguments> dbArguments = this.list(wrapper);
|
|
|
|
+ //作差获得要删除的陈述意见
|
|
|
|
+ List<Integer> dbIds = dbArguments.stream().map(Arguments::getId).collect(Collectors.toList());
|
|
|
|
+ List<Integer> ids = arguments.stream().map(Arguments::getId).collect(Collectors.toList());
|
|
|
|
+ List<Integer> removeIds = dbIds;
|
|
|
|
+ removeIds.removeAll(ids);
|
|
|
|
+ //删除陈述意见
|
|
|
|
+ if (removeIds.size() > 0) {
|
|
|
|
+ this.deleteArguments(removeIds);
|
|
|
|
+ }
|
|
|
|
+ this.saveOrUpdateBatch(arguments);
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 批量删除或者更新证据详情
|
|
|
|
+ *
|
|
|
|
+ * @param assoFeatureProofs
|
|
|
|
+ * @param featureIds
|
|
|
|
+ * @param proofId
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public boolean deleteOrUpdateProofStr(List<AssoFeatureProof> assoFeatureProofs, List<Integer> featureIds, Integer proofId) {
|
|
|
|
+ LambdaQueryWrapper<AssoFeatureProof> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ wrapper.in(AssoFeatureProof::getFeatureId, featureIds)
|
|
|
|
+ .eq(AssoFeatureProof::getCompareFileId, proofId);
|
|
|
|
+ List<AssoFeatureProof> dbAssoFeatureProof = assoFeatureProofService.list(wrapper);
|
|
|
|
+ //作差获得要删除的相关证据
|
|
|
|
+ List<Integer> dbIds = dbAssoFeatureProof.stream().map(AssoFeatureProof::getId).collect(Collectors.toList());
|
|
|
|
+ List<Integer> ids = assoFeatureProofs.stream().map(AssoFeatureProof::getId).collect(Collectors.toList());
|
|
|
|
+ List<Integer> removeIds = dbIds;
|
|
|
|
+ removeIds.removeAll(ids);
|
|
|
|
+ //检查一个特征是否有多个陈述证据
|
|
|
|
+ for (AssoFeatureProof item : assoFeatureProofs) {
|
|
|
|
+ {
|
|
|
|
+ //查询是否存在多个相同
|
|
|
|
+ List<AssoFeatureProof> assoFeatureProofs1 = assoFeatureProofs.stream().filter(tem ->
|
|
|
|
+ item.getFeatureId().equals(tem.getFeatureId())
|
|
|
|
+ && item.getCompareFileId().equals(tem.getCompareFileId())).collect(Collectors.toList());
|
|
|
|
+ if (assoFeatureProofs1.size() > 1) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //删除陈述意见
|
|
|
|
+ assoFeatureProofService.removeByIds(removeIds);
|
|
|
|
+ assoFeatureProofService.saveOrUpdateBatch(assoFeatureProofs);
|
|
|
|
+
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ public static void main(String[] args) {
|
|
|
|
+ String a =Response.error();
|
|
|
|
+ Response av = JSONObject.parseObject(a,Response.class);
|
|
|
|
+ System.out.println(av.getCode());
|
|
|
|
+ }
|
|
}
|
|
}
|