|
@@ -17,6 +17,7 @@ import cn.cslg.pas.domain.business.CompareLiterature;
|
|
|
import cn.cslg.pas.domain.es.Marking;
|
|
|
import cn.cslg.pas.domain.es.Patent;
|
|
|
import cn.cslg.pas.domain.es.PatentPerson;
|
|
|
+import cn.cslg.pas.exception.XiaoShiException;
|
|
|
import cn.cslg.pas.mapper.CompareLiteratureMapper;
|
|
|
import cn.cslg.pas.mapper.RetrieveRecordMapper;
|
|
|
import cn.cslg.pas.mapper.novelty.NoveltyCompareLiteratureMapper;
|
|
@@ -235,7 +236,6 @@ public class NoveltyCompareLiteratureService extends ServiceImpl<NoveltyCompareL
|
|
|
//TODO 缺少对比记录方法,判断是否有对比记录,有的话则提示
|
|
|
noveltyCompareLiteratureMapper.deleteById(noveltyCompareLiterature.getId());
|
|
|
}
|
|
|
- //删除该对比文件的标注
|
|
|
// CompareLiterature compareLiterature = compareLiteratureMapper.selectById(vo.getCompareLitertureId());
|
|
|
// String literatureNo = compareLiterature.getLiteratureNo();
|
|
|
// if (StringUtils.isNotEmpty(literatureNo)) {
|
|
@@ -245,14 +245,36 @@ public class NoveltyCompareLiteratureService extends ServiceImpl<NoveltyCompareL
|
|
|
// esScratchWordsService.delete(list);
|
|
|
// }
|
|
|
// }
|
|
|
- //删除该专利的对比记录
|
|
|
CompareLiterature compareLiterature = compareLiteratureMapper.selectById(vo.getCompareLitertureId());
|
|
|
String literatureNo = compareLiterature.getLiteratureNo();
|
|
|
+ //将该对比文件的标注projectId修改为0
|
|
|
+ if (StringUtils.isNotEmpty(literatureNo)) {
|
|
|
+ List<NoveltyCompareRecordVO> markingList = esScratchWordsService.queryMarkingByNo(compareLiterature.getProjectId(), Arrays.asList(literatureNo),1);
|
|
|
+ if (!CollectionUtils.isEmpty(markingList)) {
|
|
|
+ for (NoveltyCompareRecordVO recordVO : markingList) {
|
|
|
+ Marking marking = esScratchWordsService.getById(recordVO.getId());
|
|
|
+ marking.setProjectId(0);
|
|
|
+ Integer count = esScratchWordsService.updateToEs(marking, recordVO.getId());
|
|
|
+ if (count < 1) {
|
|
|
+ throw new XiaoShiException("删除对比记录失败");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //将该专利的对比记录projectId修改为0
|
|
|
if (StringUtils.isNotEmpty(literatureNo)) {
|
|
|
List<NoveltyCompareRecordVO> markingList = esScratchWordsService.queryMarkingByNo(compareLiterature.getProjectId(), Arrays.asList(literatureNo),2);
|
|
|
if (!CollectionUtils.isEmpty(markingList)) {
|
|
|
- List<String> list = markingList.stream().map(NoveltyCompareRecordVO::getId).collect(Collectors.toList());
|
|
|
- esScratchWordsService.delete(list);
|
|
|
+ for (NoveltyCompareRecordVO recordVO : markingList) {
|
|
|
+ Marking marking = esScratchWordsService.getById(recordVO.getId());
|
|
|
+ marking.setProjectId(0);
|
|
|
+ Integer count = esScratchWordsService.updateToEs(marking, recordVO.getId());
|
|
|
+ if (count < 1) {
|
|
|
+ throw new XiaoShiException("删除对比记录失败");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
compareLiteratureMapper.deleteById(vo.getCompareLitertureId());
|