|
@@ -1,6 +1,7 @@
|
|
|
package cn.cslg.pas.service;
|
|
|
|
|
|
import cn.cslg.pas.common.core.base.Constants;
|
|
|
+import cn.cslg.pas.common.model.PatentCell;
|
|
|
import cn.cslg.pas.common.model.dto.TaskWebSocketDTO;
|
|
|
import cn.cslg.pas.common.model.params.*;
|
|
|
import cn.cslg.pas.common.model.vo.ProjectImportPatentVO;
|
|
@@ -376,7 +377,6 @@ public class UploadPatentBatchService {
|
|
|
patentRightParams.setSelfContent(uploadParamsVO.getSelfContent());
|
|
|
}
|
|
|
patentRightService.updatePatentRight(patentRightParams);
|
|
|
-
|
|
|
patentRightService.importAuthority(patentRightParams);
|
|
|
}
|
|
|
|
|
@@ -591,19 +591,15 @@ public class UploadPatentBatchService {
|
|
|
String getSettingJson = fileUtils.analysisJsonFile();
|
|
|
//查找需求数据源的对应配置
|
|
|
List<UploadSettingVO.Column> jsonData = UploadPatentBatchUtil.parsingConfigurationFilesBro(getSettingJson);
|
|
|
-
|
|
|
Map<String, PictureData> pictureDataMap = ExcelUtils.getDataFromExcel(params.getPath());
|
|
|
-
|
|
|
//将数据进行装配并进行数据库操作
|
|
|
for (int i = 0; i < params.getRowList().size(); i++) {
|
|
|
//获取每一行的数据
|
|
|
Map<Object, Object> row = params.getRowList().get(i);
|
|
|
//基础数据装配
|
|
|
UploadParamsVO uploadParamsVO = UploadPatentBatchUtil.processData(row, jsonData);
|
|
|
-
|
|
|
//查询数据是否存在 如果存在 返回该条数据 如果不存在 新增一条数据
|
|
|
getOneOrInsertOne(uploadParamsVO);
|
|
|
-
|
|
|
//专利信息需要特殊处理部分
|
|
|
//专利信息(摘要附图)数据装配
|
|
|
PictureData pictureData = pictureDataMap.get(String.valueOf(i + 1));
|
|
@@ -617,7 +613,6 @@ public class UploadPatentBatchService {
|
|
|
if (uploadParamsVO.getPatent().getAgencyId() != null) {
|
|
|
uploadParamsVO.getPatent().setAgencyId(patentAgencyService.getAgencyStringIdByName(uploadParamsVO.getPatent().getAgencyId()));
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
//将装配对象中的数据保存到数据库
|
|
|
dataToDBBro(params, uploadParamsVO);
|
|
@@ -657,4 +652,69 @@ public class UploadPatentBatchService {
|
|
|
FLAG = 0;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+
|
|
|
+ * @date 2022-7-11
|
|
|
+ * @name 数据库交互
|
|
|
+ * @description 将装配完毕的VO类向数据库中不同的表进行添加或修改操作(dataToDB兄弟类)
|
|
|
+ */
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public void dataToDBCell(PatentCell patentCell) {
|
|
|
+ UploadParamsVO uploadParamsVO =new UploadParamsVO();
|
|
|
+ uploadParamsVO.setPatent(new Patent());
|
|
|
+ uploadParamsVO.getPatent().setPatentNo(patentCell.getPatentNo());
|
|
|
+ getOneOrInsertOne(uploadParamsVO);
|
|
|
+ uploadParamsVO.setSimpleStatus(patentCell.getStatue());
|
|
|
+ try {
|
|
|
+ //专利信息 OS_PATENT
|
|
|
+ if (uploadParamsVO.getPatent() != null) {
|
|
|
+ List<SystemDict> systemDictList = systemDictService.getSystemDictListByType(Collections.singletonList(Constants.PATENT_SIMPLE_STATUS));
|
|
|
+ Integer simpleStatus = Integer.parseInt(systemDictList.stream()
|
|
|
+ .filter(systemDict -> systemDict.getType().equals(Constants.PATENT_SIMPLE_STATUS) && systemDict.getLabel().equals(uploadParamsVO.getPatentSimpleStatus()))
|
|
|
+ .findFirst()
|
|
|
+ .orElse(new SystemDict()).getValue());
|
|
|
+ uploadParamsVO.getPatent().setSimpleStatus(simpleStatus);
|
|
|
+ uploadParamsVO.getPatent().updateById();
|
|
|
+ }
|
|
|
+ uploadParamsVO.setPatentRight(new PatentRight());
|
|
|
+ uploadParamsVO.getPatentRight().setContent(StringUtils.join(patentCell.getRights(),""));
|
|
|
+ uploadParamsVO.setSelfContent(patentCell.getMainRignt());
|
|
|
+ //权利要求 OS_PATENT_RIGHT
|
|
|
+ patentRightBusiness(uploadParamsVO);
|
|
|
+ //说明书(文本) OS_PATENT_INSTRUCTION_TEXT
|
|
|
+ uploadParamsVO.setPatentInstructionText(new PatentInstructionText());
|
|
|
+ uploadParamsVO.getPatentInstructionText().setManual(patentCell.getPatentInstructionText());
|
|
|
+ if (uploadParamsVO.getPatentInstructionText() != null) {
|
|
|
+ patentInstructionTextBusiness(uploadParamsVO);
|
|
|
+ }
|
|
|
+ //简单同族 OS_PATENT_SIMPLEFAMILY
|
|
|
+ patentSimplyFamilyBusiness(uploadParamsVO);
|
|
|
+ //发明人 OS_PATENT_INVENTOR
|
|
|
+ patentInventorBusiness(uploadParamsVO);
|
|
|
+ //申请人(原始)/权利人(当前) OS_PATENT_APPLICATION || OS_APPLICATION_ATTR
|
|
|
+ patentApplicationBusiness(uploadParamsVO);
|
|
|
+ //申请人地址 OS_PATENT_APPLICATION
|
|
|
+ patentApplicationAddressBusiness(uploadParamsVO);
|
|
|
+ //分类号关联 OS_PATENT_TYPENO
|
|
|
+ patentTypeNoBusiness(uploadParamsVO);
|
|
|
+ //事务信息 OS_PATENT_AFFAIR
|
|
|
+ patentAffairBusiness(uploadParamsVO);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ if (uploadParamsVO.getPatent() != null) {
|
|
|
+ ImportErrorLog importErrorLog = new ImportErrorLog();
|
|
|
+ importErrorLog.setPatentId(uploadParamsVO.getPatent().getId())
|
|
|
+ .setPatentNo(uploadParamsVO.getPatent().getPatentNo())
|
|
|
+ .setCreateTime(new SimpleDateFormat("yyyy-MM-dd 24HI:mm:ss").format(new Date()));
|
|
|
+// .setCreateUserId(Integer.parseInt(params.getUserId()))
|
|
|
+// .setMistakeMessage(e.getMessage())
|
|
|
+// .setProjectId(params.getProjectId());
|
|
|
+ importErrorLogMapper.insert(importErrorLog);
|
|
|
+ FLAG += 1;
|
|
|
+ }
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|