|
@@ -20,6 +20,7 @@ import cn.cslg.report.entity.invalidReReport.InvalidReason;
|
|
|
import cn.cslg.report.entity.invalidReReport.ProofGroup;
|
|
|
import cn.cslg.report.mapper.FeatureMapper;
|
|
|
import cn.cslg.report.mapper.InvalidReReport.InvalidReasonMapper;
|
|
|
+import cn.cslg.report.service.business.FeatureService;
|
|
|
import cn.cslg.report.service.business.ReportService;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -28,6 +29,7 @@ import com.github.pagehelper.PageHelper;
|
|
|
import io.swagger.v3.oas.models.security.SecurityScheme;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.omg.CORBA.DynAnyPackage.Invalid;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -46,6 +48,7 @@ public class InvalidReasonService extends ServiceImpl<InvalidReasonMapper, Inval
|
|
|
private final ReportService reportService;
|
|
|
private final AssoPositionFeaturesService assoPositionFeaturesService;
|
|
|
private final AssoProofGroupService assoProofGroupService;
|
|
|
+ private final FeatureService featureService;
|
|
|
private final FeatureMapper featureMapper;
|
|
|
private final ProofGroupService proofGroupService;
|
|
|
private final CacheUtils cacheUtils;
|
|
@@ -134,6 +137,7 @@ public class InvalidReasonService extends ServiceImpl<InvalidReasonMapper, Inval
|
|
|
//获取当前登陆人信息
|
|
|
PersonnelVO personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
|
|
|
invalidReason.setCreateId(personnelVO.getId());
|
|
|
+ //说明书公开不充分入表
|
|
|
invalidReason.insert();
|
|
|
} else if(invalidName.equals(0)){//若类型为0,则为“权利要求不清楚”,需要选择涉及内容(content)并输入相关证据(proofStr)
|
|
|
if(invalidReasonDTO.getProofStr() != null && invalidReasonDTO.getProofStr() != ""){
|
|
@@ -142,7 +146,11 @@ public class InvalidReasonService extends ServiceImpl<InvalidReasonMapper, Inval
|
|
|
//获取当前登陆人信息
|
|
|
PersonnelVO personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
|
|
|
invalidReason.setCreateId(personnelVO.getId());
|
|
|
+ //权要排序字段 值为content
|
|
|
+ invalidReason.setRightSort(invalidReasonDTO.getContent());
|
|
|
+ //无效理由入表
|
|
|
invalidReason.insert();
|
|
|
+ //有可能为特征不清楚
|
|
|
//判断是否传入特征集合
|
|
|
if(invalidReasonDTO.getFeatures() != null && invalidReasonDTO.getFeatures().size() > 0) {
|
|
|
//若类型为0检查features是否有交集(根据位置和字符串长度判断)若有则返回
|
|
@@ -150,6 +158,7 @@ public class InvalidReasonService extends ServiceImpl<InvalidReasonMapper, Inval
|
|
|
//特征内容
|
|
|
List<InvalidReasonDTO.featuresIn> featuresIns = invalidReasonDTO.getFeatures();
|
|
|
//检查特征内容是否有交集(根据位置和字符串长度判断)若有则返回
|
|
|
+ //装载检查重复需要的类
|
|
|
CheckReFeaturesDTO checkReFeaturesDTO = new CheckReFeaturesDTO();
|
|
|
checkReFeaturesDTO.setReportId(invalidReasonDTO.getReportId());
|
|
|
checkReFeaturesDTO.setRightSort(invalidReasonDTO.getContent());
|
|
@@ -164,6 +173,7 @@ public class InvalidReasonService extends ServiceImpl<InvalidReasonMapper, Inval
|
|
|
if (isFlag == false) {
|
|
|
return Response.error("特征内容重复");
|
|
|
}
|
|
|
+ //不重复则需要入表
|
|
|
//标的专利号,权要id,特征内容,报告id
|
|
|
//通过报告id查询标的专利号
|
|
|
Integer reportId = invalidReasonDTO.getReportId();
|
|
@@ -178,11 +188,11 @@ public class InvalidReasonService extends ServiceImpl<InvalidReasonMapper, Inval
|
|
|
features.setReportId(reportId);
|
|
|
//遍历特征内容集合,保存到表(类型为0)
|
|
|
for (int i = 0; i < featuresIns.size(); i++) {
|
|
|
- //若类型为0,2,3保存到特征表
|
|
|
+ //若类型为0,保存到特征表
|
|
|
InvalidReasonDTO.featuresIn featuresIn = featuresIns.get(i);
|
|
|
features.setContent(featuresIn.getFeatureStr());
|
|
|
features.insert();
|
|
|
- //若类型为0,2,3保存到特征与位置关联表(特征id,位置)
|
|
|
+ //若类型为0,保存到特征与位置关联表(特征id,位置)
|
|
|
AssoPositionFeatures assoPositionFeatures = new AssoPositionFeatures();
|
|
|
assoPositionFeatures.setFeaturesID(features.getId());
|
|
|
assoPositionFeatures.setPosition(featuresIn.getPosition());
|
|
@@ -261,7 +271,6 @@ public class InvalidReasonService extends ServiceImpl<InvalidReasonMapper, Inval
|
|
|
|
|
|
/**
|
|
|
* 查找无效理由和证据列表
|
|
|
- * 分页查询
|
|
|
* @param
|
|
|
* @return
|
|
|
*/
|
|
@@ -351,10 +360,124 @@ public class InvalidReasonService extends ServiceImpl<InvalidReasonMapper, Inval
|
|
|
return proofGroupIns;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 查询无效理由和证据的详情
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ * @throws IOException
|
|
|
+ */
|
|
|
public String queryInvalidReasonDetail(Integer id) throws IOException {
|
|
|
- //根据报告id查询无效理由
|
|
|
- ///若类型为2,3则查询证据组合和特征并装载
|
|
|
- return Response.success();
|
|
|
+ QueryInvalidReasonVO queryInvalidReasonVO = new QueryInvalidReasonVO();
|
|
|
+ if(id != null && id > 0){
|
|
|
+ //根据id查询无效理由
|
|
|
+ InvalidReason invalidReason = this.getById(id);
|
|
|
+ if(invalidReason == null){
|
|
|
+ return Response.error("没查到无效理由");
|
|
|
+ }
|
|
|
+ //将初步查出来的无效理由赋值给要返回的VO类
|
|
|
+ BeanUtils.copyProperties(invalidReason,queryInvalidReasonVO);
|
|
|
+ Integer invalidName = invalidReason.getInvalidName();
|
|
|
+ if(invalidName == null){
|
|
|
+ return Response.error("没查到类型");
|
|
|
+ }
|
|
|
+ //若类型为0,则查询出特征并且装载
|
|
|
+ if(invalidName.equals(0)){
|
|
|
+ //获取报告id和权要排序字段
|
|
|
+ Integer reportId = invalidReason.getReportId();
|
|
|
+ Integer rightSort = invalidReason.getRightSort();
|
|
|
+ if(reportId != null && rightSort != null){
|
|
|
+ //调用装载特征的方法
|
|
|
+ List<QueryInvalidReasonVO.featuresIn> featuresIns = this.loadFeature(reportId,rightSort);
|
|
|
+ //赋值
|
|
|
+ queryInvalidReasonVO.setFeatures(featuresIns);
|
|
|
+ return Response.success(queryInvalidReasonVO);
|
|
|
+ }
|
|
|
+ } else if(invalidName.equals(2)||invalidName.equals(3)){//若类型为2,3则查询证据组合并装载
|
|
|
+ //根据无效理由id查询出proofGroup集合
|
|
|
+ Integer invalidReasonId = invalidReason.getId();
|
|
|
+ //调用装载证据组合方法
|
|
|
+ List<QueryInvalidReasonVO.proofGroupIn> proofGroupIns = this.loadProofGroup(invalidReasonId);
|
|
|
+ queryInvalidReasonVO.setProofGroups(proofGroupIns);
|
|
|
+ return Response.success(queryInvalidReasonVO);
|
|
|
+ } else if(invalidName.equals(1)){
|
|
|
+ //查出来的无效理由可以直接返回
|
|
|
+ return Response.success(queryInvalidReasonVO);
|
|
|
+ } else {
|
|
|
+ return Response.error("无效类型错误");
|
|
|
+ }
|
|
|
+ return Response.success();
|
|
|
+ } else {
|
|
|
+ return Response.error("未传入参数");
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 装载特征集合
|
|
|
+ * @param reportId
|
|
|
+ * @param rightSort
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<QueryInvalidReasonVO.featuresIn> loadFeature(Integer reportId, Integer rightSort){
|
|
|
+ //需要装载的某个无效理由的特征集合
|
|
|
+ List<QueryInvalidReasonVO.featuresIn> featuresIns = new ArrayList<>();
|
|
|
+ //通过报告id查询标的专利号
|
|
|
+ LambdaQueryWrapper<Report> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(Report::getId, reportId);
|
|
|
+ Report report = reportService.getOne(queryWrapper);
|
|
|
+ //获取标的专利号
|
|
|
+ String signPatentNo = report.getSignPatentNo();
|
|
|
+ //根据标的专利号、报告id、权要排序查询出特征集合
|
|
|
+ LambdaQueryWrapper<Features> queryWrapper1 = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper1.eq(Features::getReportId,reportId)
|
|
|
+ .eq(Features::getSignPatentNo,signPatentNo)
|
|
|
+ .eq(Features::getRightId,rightSort);
|
|
|
+ List<Features> featuress= featureService.list(queryWrapper1);
|
|
|
+ //遍历特征集合
|
|
|
+ for(Features features:featuress){
|
|
|
+ //需要装载的某个无效理由的每个特征
|
|
|
+ QueryInvalidReasonVO.featuresIn featuresIn = new QueryInvalidReasonVO.featuresIn();
|
|
|
+ featuresIn.setFeatureStr(features.getContent());
|
|
|
+ //需要根据特征id查询出它的初始位置
|
|
|
+ Integer featureId = features.getId();
|
|
|
+ LambdaQueryWrapper<AssoPositionFeatures> queryWrapper2 = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper2.eq(AssoPositionFeatures::getFeaturesID,featureId);
|
|
|
+ AssoPositionFeatures assoPositionFeatures = assoPositionFeaturesService.getOne(queryWrapper2);
|
|
|
+ featuresIn.setPosition(assoPositionFeatures.getPosition());
|
|
|
+ featuresIns.add(featuresIn);
|
|
|
+ }
|
|
|
+ return featuresIns;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 装载证据组合
|
|
|
+ * @param invalidReasonId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<QueryInvalidReasonVO.proofGroupIn> loadProofGroup(Integer invalidReasonId){
|
|
|
+ List<QueryInvalidReasonVO.proofGroupIn> proofGroupIns = new ArrayList<>();
|
|
|
+ //根据无效理由id查询出证据组合集合
|
|
|
+ LambdaQueryWrapper<ProofGroup> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(ProofGroup::getInvalidReasonId,invalidReasonId);
|
|
|
+ List<ProofGroup> proofGroups = proofGroupService.list(queryWrapper);
|
|
|
+ if(proofGroups != null && proofGroups.size() > 0){
|
|
|
+ //遍历证据组合集合
|
|
|
+ for(ProofGroup proofGroup:proofGroups){
|
|
|
+ QueryInvalidReasonVO.proofGroupIn proofGroupIn = new QueryInvalidReasonVO.proofGroupIn();
|
|
|
+ proofGroupIn.setDescription(proofGroup.getDescription());
|
|
|
+ proofGroupIn.setArgument_str(proofGroup.getArgument_str());
|
|
|
+ //组合id
|
|
|
+ Integer groupId = proofGroup.getId();
|
|
|
+ LambdaQueryWrapper<AssoProofGroup> queryWrapper1 = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper1.eq(AssoProofGroup::getGroupId,groupId);
|
|
|
+ List<AssoProofGroup> assoProofGroups = assoProofGroupService.list(queryWrapper1);
|
|
|
+ //取出证据ids
|
|
|
+ List<Integer> proofIds = assoProofGroups.stream().map(AssoProofGroup::getProofId).collect(Collectors.toList());
|
|
|
+ proofGroupIn.setProofIds(proofIds);
|
|
|
+ proofGroupIns.add(proofGroupIn);
|
|
|
+ }
|
|
|
+ return proofGroupIns;
|
|
|
+ } else {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|