|
@@ -1,8 +1,10 @@
|
|
package cn.cslg.wdc.service;
|
|
package cn.cslg.wdc.service;
|
|
|
|
|
|
|
|
+import cn.cslg.wdc.common.core.auth.Response;
|
|
import cn.cslg.wdc.common.exception.XiaoShiException;
|
|
import cn.cslg.wdc.common.exception.XiaoShiException;
|
|
import cn.cslg.wdc.common.utils.FileUtils;
|
|
import cn.cslg.wdc.common.utils.FileUtils;
|
|
import cn.cslg.wdc.common.utils.ReadExcelUtils;
|
|
import cn.cslg.wdc.common.utils.ReadExcelUtils;
|
|
|
|
+import cn.cslg.wdc.dto.SelectCaseInfoDTO;
|
|
import cn.cslg.wdc.dto.common.GetBaseInfoByWDDTO;
|
|
import cn.cslg.wdc.dto.common.GetBaseInfoByWDDTO;
|
|
import cn.cslg.wdc.dto.common.GetCaseInfoByWDDTO;
|
|
import cn.cslg.wdc.dto.common.GetCaseInfoByWDDTO;
|
|
import cn.cslg.wdc.dto.common.GetPatentActionByWDDTO;
|
|
import cn.cslg.wdc.dto.common.GetPatentActionByWDDTO;
|
|
@@ -12,6 +14,7 @@ import cn.cslg.wdc.entity.CaseFile;
|
|
import cn.cslg.wdc.entity.Discrepancy;
|
|
import cn.cslg.wdc.entity.Discrepancy;
|
|
import cn.cslg.wdc.entity.DiscrepancyDetail;
|
|
import cn.cslg.wdc.entity.DiscrepancyDetail;
|
|
import cn.cslg.wdc.entity.common.PatentData;
|
|
import cn.cslg.wdc.entity.common.PatentData;
|
|
|
|
+import cn.cslg.wdc.entity.common.Records;
|
|
import cn.cslg.wdc.mapper.AssoCaseFileMapper;
|
|
import cn.cslg.wdc.mapper.AssoCaseFileMapper;
|
|
import cn.cslg.wdc.mapper.CaseFileMapper;
|
|
import cn.cslg.wdc.mapper.CaseFileMapper;
|
|
import cn.cslg.wdc.mapper.DiscrepancyDetailMapper;
|
|
import cn.cslg.wdc.mapper.DiscrepancyDetailMapper;
|
|
@@ -19,6 +22,8 @@ import cn.cslg.wdc.mapper.DiscrepancyMapper;
|
|
import cn.cslg.wdc.service.common.CosineSimilarityService;
|
|
import cn.cslg.wdc.service.common.CosineSimilarityService;
|
|
import cn.cslg.wdc.service.common.FileManagerService;
|
|
import cn.cslg.wdc.service.common.FileManagerService;
|
|
import cn.cslg.wdc.service.common.GetReportInfoFromWDService;
|
|
import cn.cslg.wdc.service.common.GetReportInfoFromWDService;
|
|
|
|
+import cn.cslg.wdc.vo.SelectAssoCaseFileVO;
|
|
|
|
+import cn.cslg.wdc.vo.SelectCaseInfoVO;
|
|
import cn.cslg.wdc.vo.common.GetBaseInfoByWDVO;
|
|
import cn.cslg.wdc.vo.common.GetBaseInfoByWDVO;
|
|
import cn.cslg.wdc.vo.common.GetCaseInfoByWDVO;
|
|
import cn.cslg.wdc.vo.common.GetCaseInfoByWDVO;
|
|
import cn.cslg.wdc.vo.common.TableRowsVO;
|
|
import cn.cslg.wdc.vo.common.TableRowsVO;
|
|
@@ -39,7 +44,6 @@ import org.apache.commons.text.diff.EditScript;
|
|
import org.apache.commons.text.diff.StringsComparator;
|
|
import org.apache.commons.text.diff.StringsComparator;
|
|
import org.apache.poi.hwpf.extractor.WordExtractor;
|
|
import org.apache.poi.hwpf.extractor.WordExtractor;
|
|
import org.apache.poi.ss.usermodel.Sheet;
|
|
import org.apache.poi.ss.usermodel.Sheet;
|
|
-import org.apache.poi.xwpf.extractor.XWPFWordExtractor;
|
|
|
|
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
|
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
|
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
|
|
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
|
|
import org.jsoup.Jsoup;
|
|
import org.jsoup.Jsoup;
|
|
@@ -118,7 +122,7 @@ public class CaseFileService extends ServiceImpl<CaseFileMapper, CaseFile> {
|
|
*
|
|
*
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- @Scheduled(cron = "0 0 1 * * ?")
|
|
|
|
|
|
+// @Scheduled(cron = "0 0 1 * * ?")
|
|
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
|
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
|
public void getCaseInfoByHanding() throws Exception {
|
|
public void getCaseInfoByHanding() throws Exception {
|
|
System.out.println("新申请递交中类型的案件相关信息开始导入-----importBegin");
|
|
System.out.println("新申请递交中类型的案件相关信息开始导入-----importBegin");
|
|
@@ -278,7 +282,7 @@ public class CaseFileService extends ServiceImpl<CaseFileMapper, CaseFile> {
|
|
*
|
|
*
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- @Scheduled(cron = "0 0 3 * * ?")
|
|
|
|
|
|
+// @Scheduled(cron = "0 0 3 * * ?")
|
|
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = Throwable.class)
|
|
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = Throwable.class)
|
|
public void getCaseInfoByFinish() throws Exception {
|
|
public void getCaseInfoByFinish() throws Exception {
|
|
System.out.println("新申请完成类型的案件相关信息开始导入-----importBegin");
|
|
System.out.println("新申请完成类型的案件相关信息开始导入-----importBegin");
|
|
@@ -473,14 +477,14 @@ public class CaseFileService extends ServiceImpl<CaseFileMapper, CaseFile> {
|
|
Map<Object, Object> patentDataMap = patentData.getMap();
|
|
Map<Object, Object> patentDataMap = patentData.getMap();
|
|
String caseNo = patentDataMap.get("我方文号").toString();
|
|
String caseNo = patentDataMap.get("我方文号").toString();
|
|
String completionDate = patentDataMap.get("完成日").toString();
|
|
String completionDate = patentDataMap.get("完成日").toString();
|
|
|
|
+ String writer = patentDataMap.get("案件处理人").toString();
|
|
|
|
+ String auditor = patentDataMap.get("案件核稿人").toString();
|
|
CaseFile caseFile = caseFileMapper.selectOne(new LambdaQueryWrapper<CaseFile>()
|
|
CaseFile caseFile = caseFileMapper.selectOne(new LambdaQueryWrapper<CaseFile>()
|
|
.eq(CaseFile::getCaseNo, caseNo));
|
|
.eq(CaseFile::getCaseNo, caseNo));
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
|
if (ObjectUtils.isEmpty(caseFile)) {
|
|
if (ObjectUtils.isEmpty(caseFile)) {
|
|
String title = patentDataMap.get("案件名称").toString();
|
|
String title = patentDataMap.get("案件名称").toString();
|
|
String customer = patentDataMap.get("客户名称").toString();
|
|
String customer = patentDataMap.get("客户名称").toString();
|
|
- String writer = patentDataMap.get("案件处理人").toString();
|
|
|
|
- String auditor = patentDataMap.get("案件核稿人").toString();
|
|
|
|
|
|
|
|
CaseFile caseFile1 = new CaseFile();
|
|
CaseFile caseFile1 = new CaseFile();
|
|
caseFile1.setCaseNo(caseNo);
|
|
caseFile1.setCaseNo(caseNo);
|
|
@@ -495,13 +499,19 @@ public class CaseFileService extends ServiceImpl<CaseFileMapper, CaseFile> {
|
|
caseFile1.insert();
|
|
caseFile1.insert();
|
|
list.add(caseNo);
|
|
list.add(caseNo);
|
|
} else {
|
|
} else {
|
|
- if (caseFile.getCompletionDate() == null) {
|
|
|
|
|
|
+ if (caseFile.getCompletionDate() == null || StringUtils.isEmpty(caseFile.getWriter()) || StringUtils.isEmpty(caseFile.getAuditor())) {
|
|
caseFile.setId(caseFile.getId());
|
|
caseFile.setId(caseFile.getId());
|
|
if (StringUtils.isNotEmpty(completionDate)) {
|
|
if (StringUtils.isNotEmpty(completionDate)) {
|
|
Date finishDate = format.parse(completionDate);
|
|
Date finishDate = format.parse(completionDate);
|
|
caseFile.setCompletionDate(finishDate);
|
|
caseFile.setCompletionDate(finishDate);
|
|
- caseFile.updateById();
|
|
|
|
}
|
|
}
|
|
|
|
+ if (StringUtils.isNotEmpty(writer)) {
|
|
|
|
+ caseFile.setWriter(writer);
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isNotEmpty(auditor)) {
|
|
|
|
+ caseFile.setAuditor(auditor);
|
|
|
|
+ }
|
|
|
|
+ caseFile.updateById();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -823,7 +833,7 @@ public class CaseFileService extends ServiceImpl<CaseFileMapper, CaseFile> {
|
|
discrepancy.setDiscrepancyType(1);
|
|
discrepancy.setDiscrepancyType(1);
|
|
discrepancy.insert();
|
|
discrepancy.insert();
|
|
|
|
|
|
- this.getFile(assoCaseFile1.getFileGuid(), assoCaseFile2.getFileGuid(), discrepancy.getId(), assoCaseFile1.getFileName(), assoCaseFile2.getFileName());
|
|
|
|
|
|
+ this.getDiscrepancyByFile(assoCaseFile1.getFileGuid(), assoCaseFile2.getFileGuid(), discrepancy.getId(), assoCaseFile1.getFileName(), assoCaseFile2.getFileName());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (ObjectUtils.isNotEmpty(assoCaseFile2) && ObjectUtils.isNotEmpty(assoCaseFile3)) {
|
|
if (ObjectUtils.isNotEmpty(assoCaseFile2) && ObjectUtils.isNotEmpty(assoCaseFile3)) {
|
|
@@ -838,7 +848,7 @@ public class CaseFileService extends ServiceImpl<CaseFileMapper, CaseFile> {
|
|
discrepancy.setDiscrepancyType(2);
|
|
discrepancy.setDiscrepancyType(2);
|
|
discrepancy.insert();
|
|
discrepancy.insert();
|
|
|
|
|
|
- this.getFile(assoCaseFile2.getFileGuid(), assoCaseFile3.getFileGuid(), discrepancy.getId(), assoCaseFile2.getFileName(), assoCaseFile3.getFileName());
|
|
|
|
|
|
+ this.getDiscrepancyByFile(assoCaseFile2.getFileGuid(), assoCaseFile3.getFileGuid(), discrepancy.getId(), assoCaseFile2.getFileName(), assoCaseFile3.getFileName());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -856,7 +866,7 @@ public class CaseFileService extends ServiceImpl<CaseFileMapper, CaseFile> {
|
|
* @param fileName2
|
|
* @param fileName2
|
|
* @throws IOException
|
|
* @throws IOException
|
|
*/
|
|
*/
|
|
- public void getFile(String guid1, String guid2, Integer discrepancyId, String fileName1, String fileName2) throws IOException {
|
|
|
|
|
|
+ public void getDiscrepancyByFile(String guid1, String guid2, Integer discrepancyId, String fileName1, String fileName2) throws IOException {
|
|
byte[] bytes = fileManagerService.downloadSystemFileFromFMS(guid1);
|
|
byte[] bytes = fileManagerService.downloadSystemFileFromFMS(guid1);
|
|
File tempFile = null;
|
|
File tempFile = null;
|
|
if (fileName1.endsWith(".doc")) {
|
|
if (fileName1.endsWith(".doc")) {
|
|
@@ -1073,9 +1083,14 @@ public class CaseFileService extends ServiceImpl<CaseFileMapper, CaseFile> {
|
|
detail.setDelWorldCount(delSum);
|
|
detail.setDelWorldCount(delSum);
|
|
detail.setDiffType(type);
|
|
detail.setDiffType(type);
|
|
detail.setDiffContent(html3);
|
|
detail.setDiffContent(html3);
|
|
- detail.setRate(diff.toString());
|
|
|
|
- detail.setSimilarity(String.format("%.6f", similarity));
|
|
|
|
|
|
+ detail.setRate(diff.doubleValue());
|
|
|
|
+ detail.setSimilarity(similarity);
|
|
detail. insert();
|
|
detail. insert();
|
|
|
|
+ if (type == 1) {
|
|
|
|
+ Discrepancy discrepancy = discrepancyMapper.selectById(discrepancyId);
|
|
|
|
+ discrepancy.setFullTextRate(diff.doubleValue());
|
|
|
|
+ discrepancy.updateById();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
// 关闭文档
|
|
// 关闭文档
|
|
@@ -1086,4 +1101,36 @@ public class CaseFileService extends ServiceImpl<CaseFileMapper, CaseFile> {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ public String selectCaseInfoList(SelectCaseInfoDTO vo) {
|
|
|
|
+ List<SelectCaseInfoVO> caseInfoVOS = caseFileMapper.selectCaseInfoList(vo);
|
|
|
|
+ if (!CollectionUtils.isEmpty(caseInfoVOS)) {
|
|
|
|
+ for (SelectCaseInfoVO caseInfoVO : caseInfoVOS) {
|
|
|
|
+ Integer caseId = caseInfoVO.getCaseId();
|
|
|
|
+ List<AssoCaseFile> caseFiles = assoCaseFileMapper.selectList(new LambdaQueryWrapper<AssoCaseFile>()
|
|
|
|
+ .eq(AssoCaseFile::getCaseId, caseId));
|
|
|
|
+ if (!CollectionUtils.isEmpty(caseFiles)) {
|
|
|
|
+ List<SelectAssoCaseFileVO> fileVOS = new ArrayList<>();
|
|
|
|
+ caseFiles.forEach(i -> {
|
|
|
|
+ SelectAssoCaseFileVO fileVO = new SelectAssoCaseFileVO();
|
|
|
|
+ fileVO.setAssoCaseFileId(i.getId());
|
|
|
|
+ fileVO.setCaseId(i.getCaseId());
|
|
|
|
+ fileVO.setFileType(i.getFileType());
|
|
|
|
+ fileVO.setFileName(i.getFileName());
|
|
|
|
+ fileVO.setFileGuid(i.getFileGuid());
|
|
|
|
+ fileVOS.add(fileVO);
|
|
|
|
+ });
|
|
|
|
+ caseInfoVO.setAssoCaseFileVOList(fileVOS);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ Long count = caseFileMapper.selectCaseInfoCount(vo);
|
|
|
|
+ Records records = new Records();
|
|
|
|
+ records.setTotal(count);
|
|
|
|
+ records.setCurrent(vo.getCurrent());
|
|
|
|
+ records.setSize(vo.getSize());
|
|
|
|
+ records.setData(caseInfoVOS);
|
|
|
|
+ return Response.success(records);
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|