|
@@ -91,8 +91,10 @@ public class UploadPatentBatchService {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
//将装配对象中的数据保存到数据库
|
|
|
dataToDB(params, uploadParamsVO, projectImportPatentVO);
|
|
|
+
|
|
|
//通过WebSocket 在每一次循环结束后 向前端发送完成进度
|
|
|
WebSocketServer.sendInfo(Response.websocket(new TaskWebSocketDTO()
|
|
|
.setTaskId(params.getTaskId())
|
|
@@ -203,7 +205,7 @@ public class UploadPatentBatchService {
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void dataToDB(TaskParams params, UploadParamsVO uploadParamsVO, ProjectImportPatentVO projectImportPatentVO) {
|
|
|
try {
|
|
|
- //专利信息 OS_PATENT
|
|
|
+ //保存法律状态
|
|
|
if (uploadParamsVO.getPatent() != null) {
|
|
|
List<SystemDict> systemDictList = systemDictService.getSystemDictListByType(Collections.singletonList(Constants.PATENT_SIMPLE_STATUS));
|
|
|
Integer simpleStatus = Integer.parseInt(systemDictList.stream()
|
|
@@ -213,54 +215,62 @@ public class UploadPatentBatchService {
|
|
|
uploadParamsVO.getPatent().setSimpleStatus(simpleStatus);
|
|
|
uploadParamsVO.getPatent().updateById();
|
|
|
}
|
|
|
- //权利要求 OS_PATENT_RIGHT
|
|
|
+
|
|
|
+ //保存权利要求
|
|
|
patentRightBusiness(uploadParamsVO);
|
|
|
|
|
|
- //说明书(文本) OS_PATENT_INSTRUCTION_TEXT
|
|
|
+ //保存说明书
|
|
|
if (uploadParamsVO.getPatentInstructionText() != null) {
|
|
|
patentInstructionTextBusiness(uploadParamsVO);
|
|
|
}
|
|
|
- //代理人 OS_PATENT_AGENT
|
|
|
+
|
|
|
+ //保存代理人
|
|
|
if (uploadParamsVO.getPatentAgentList() != null) {
|
|
|
patentAgentBusiness(uploadParamsVO);
|
|
|
}
|
|
|
- //质押质权人 OS_PATENT_PLEDGE
|
|
|
+
|
|
|
+ //保存质押质权人
|
|
|
if (uploadParamsVO.getPatentPledgeList() != null) {
|
|
|
patentPledgeBusiness(uploadParamsVO);
|
|
|
}
|
|
|
- //许可人 OS_PATENT_LICENSOR
|
|
|
+
|
|
|
+ //保存许可人
|
|
|
if (uploadParamsVO.getPatentLicensorList() != null) {
|
|
|
patentLicensorBusiness(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_THEMATIC_PID
|
|
|
+ //保存专题库关联专利信息
|
|
|
if (uploadParamsVO.getPatent() != null) {
|
|
|
patentThematicPidBusiness(uploadParamsVO, projectImportPatentVO);
|
|
|
}
|
|
|
- //标引内容关联专利信息 OS_PATENT_FIELD_PATENT_LINK
|
|
|
+ //保存标引内容关联专利信息
|
|
|
if (uploadParamsVO.getPatent() != null) {
|
|
|
patentProjectFieldPatentLinkBusiness(uploadParamsVO, projectImportPatentVO);
|
|
|
}
|
|
|
- //文件夹管理 OS_PORTFOLIO_LINK
|
|
|
+ //保存文件夹管理
|
|
|
if (uploadParamsVO.getPatent() != null) {
|
|
|
patentProjectFolderPatentLinkBusiness(uploadParamsVO, projectImportPatentVO);
|
|
|
}
|
|
|
- //标签 OS_PATENT_LABEL
|
|
|
+ //保存标签
|
|
|
if (uploadParamsVO.getPatentLabelList() != null) {
|
|
|
patentLabelBusiness(uploadParamsVO, projectImportPatentVO);
|
|
|
}
|
|
|
- //分类号关联 OS_PATENT_TYPENO
|
|
|
+ //保存分类号关联
|
|
|
patentTypeNoBusiness(uploadParamsVO);
|
|
|
- //事务信息 OS_PATENT_AFFAIR
|
|
|
+ //保存事务信息
|
|
|
patentAffairBusiness(uploadParamsVO);
|
|
|
- //自定义字段
|
|
|
+ //保存自定义字段
|
|
|
if (uploadParamsVO.getCustomerFieldList() != null) {
|
|
|
patentFieldBusiness(params, uploadParamsVO, projectImportPatentVO);
|
|
|
}
|
|
@@ -368,106 +378,146 @@ public class UploadPatentBatchService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //权利要求
|
|
|
private void patentRightBusiness(UploadParamsVO uploadParamsVO) {
|
|
|
+ //创建PatentRightParams对象保存权要基本信息
|
|
|
PatentRightParams patentRightParams = new PatentRightParams();
|
|
|
+ //装载专利id
|
|
|
patentRightParams.setPatentId(uploadParamsVO.getPatent().getId());
|
|
|
+ //装载专利号
|
|
|
patentRightParams.setPatentNo(uploadParamsVO.getPatent().getPatentNo());
|
|
|
if (uploadParamsVO.getPatentRight() != null) {
|
|
|
+ //装载权利要求原文
|
|
|
patentRightParams.setContent(uploadParamsVO.getPatentRight().getContent());
|
|
|
+ //装载权利要求译文
|
|
|
patentRightParams.setContentOut(uploadParamsVO.getPatentRight().getContentOut());
|
|
|
}
|
|
|
if (uploadParamsVO.getSelfContent() != null) {
|
|
|
+ //装载独立权要
|
|
|
patentRightParams.setSelfContent(uploadParamsVO.getSelfContent());
|
|
|
}
|
|
|
+ //开始保存权要入库(1.格式化权要 2.理出主次权要父子关系 3.权要入表"os_patent_right")
|
|
|
patentRightService.updatePatentRight(patentRightParams);
|
|
|
+ //暂未使用
|
|
|
patentRightService.importAuthority(patentRightParams);
|
|
|
}
|
|
|
|
|
|
+ //说明书文本
|
|
|
private void patentInstructionTextBusiness(UploadParamsVO uploadParamsVO) {
|
|
|
+ //创建PatentInstructionTextParams对象装载说明书相关数据
|
|
|
PatentInstructionTextParams patentInstructionTextParams = new PatentInstructionTextParams();
|
|
|
+ //装载专利id
|
|
|
patentInstructionTextParams.setPatentId(uploadParamsVO.getPatent().getId());
|
|
|
+ //装载说明书
|
|
|
patentInstructionTextParams.setManual(uploadParamsVO.getPatentInstructionText().getManual());
|
|
|
+ //装载说明书(译)
|
|
|
patentInstructionTextParams.setManualOut(uploadParamsVO.getPatentInstructionText().getManualOut());
|
|
|
|
|
|
+ //开始保存说明书入表“os_patent_instruction_text”
|
|
|
patentInstructionTextService.updatePatentInstructionText(patentInstructionTextParams);
|
|
|
}
|
|
|
|
|
|
//代理人
|
|
|
private void patentAgentBusiness(UploadParamsVO uploadParamsVO) {
|
|
|
+ //创建PatentAgentParams对象装载代理人相关数据
|
|
|
PatentAgentParams patentAgentParams = new PatentAgentParams();
|
|
|
+ //装载专利id
|
|
|
patentAgentParams.setPatentId(uploadParamsVO.getPatent().getId());
|
|
|
List<String> agentList = uploadParamsVO.getPatentAgentList().stream().map(PatentAgent::getName).collect(Collectors.toList());
|
|
|
+ //装载代理人集合
|
|
|
patentAgentParams.setAgent(agentList);
|
|
|
+ //开始保存代理人信息入表“os_patent_agent”
|
|
|
patentAgentService.updatePatentAgent(patentAgentParams);
|
|
|
}
|
|
|
|
|
|
- //质押质权人 OS_PATENT_PLEDGE
|
|
|
+ //质押质权人
|
|
|
private void patentPledgeBusiness(UploadParamsVO uploadParamsVO) {
|
|
|
+ //创建PatentPledgeParams对象装载质押质权人相关数据
|
|
|
PatentPledgeParams patentPledgeParams = new PatentPledgeParams();
|
|
|
+ //装载专利id
|
|
|
patentPledgeParams.setPatentId(uploadParamsVO.getPatent().getId());
|
|
|
List<String> pledgeeList = uploadParamsVO.getPatentPledgeList().stream().map(PatentPledge::getPledgee).collect(Collectors.toList());
|
|
|
List<String> pledgorList = uploadParamsVO.getPatentPledgeList().stream().map(PatentPledge::getPledgor).collect(Collectors.toList());
|
|
|
+ //装载质权人集合
|
|
|
patentPledgeParams.setPledgee(pledgeeList);
|
|
|
+ //装载质押人集合
|
|
|
patentPledgeParams.setPledgor(pledgorList);
|
|
|
-
|
|
|
+ //开始保存质押质权人信息入表“os_patent_pledge”
|
|
|
patentPledgeService.updatePatentPledge(patentPledgeParams);
|
|
|
}
|
|
|
|
|
|
|
|
|
- //许可人 OS_PATENT_LICENSOR
|
|
|
+ //许可人
|
|
|
private void patentLicensorBusiness(UploadParamsVO uploadParamsVO) {
|
|
|
+ //创建PatentLicensorParams对象装载许可人相关数据
|
|
|
PatentLicensorParams patentLicensorParams = new PatentLicensorParams();
|
|
|
+ //装载专利id
|
|
|
patentLicensorParams.setPatentId(uploadParamsVO.getPatent().getId());
|
|
|
List<String> licensorList = uploadParamsVO.getPatentLicensorList().stream().map(PatentLicensor::getLicensor).collect(Collectors.toList());
|
|
|
List<String> licenseeList = uploadParamsVO.getPatentLicensorList().stream().map(PatentLicensor::getLicensee).collect(Collectors.toList());
|
|
|
List<String> typeList = uploadParamsVO.getPatentLicensorList().stream().map(PatentLicensor::getType).collect(Collectors.toList());
|
|
|
+ //装载许可人
|
|
|
patentLicensorParams.setLicensor(licensorList);
|
|
|
+ //装载被许可人
|
|
|
patentLicensorParams.setLicensee(licenseeList);
|
|
|
+ //装载许可类型
|
|
|
patentLicensorParams.setType(typeList);
|
|
|
-
|
|
|
+ //开始保存许可人相关信息入专利信息许可人表“os_patent_licensor”
|
|
|
patentLicensorService.updatePatentLicensor(patentLicensorParams);
|
|
|
}
|
|
|
|
|
|
|
|
|
//简单同族
|
|
|
private void patentSimplyFamilyBusiness(UploadParamsVO uploadParamsVO) {
|
|
|
+ //创建PatentSimpleFamilyParams对象装载简单同族相关数据
|
|
|
PatentSimpleFamilyParams patentSimpleFamilyParams = new PatentSimpleFamilyParams();
|
|
|
if (uploadParamsVO.getSimpleFamily() != null) {
|
|
|
+ //装载简单同族
|
|
|
patentSimpleFamilyParams.setSimpleFamily(uploadParamsVO.getSimpleFamily());
|
|
|
}
|
|
|
if (uploadParamsVO.getPatSnapFamily() != null) {
|
|
|
+ //装载
|
|
|
patentSimpleFamilyParams.setPatSnapFamily(uploadParamsVO.getPatSnapFamily());
|
|
|
}
|
|
|
if (uploadParamsVO.getInpadocFamily() != null) {
|
|
|
+ //装载
|
|
|
patentSimpleFamilyParams.setInpadocFamily(uploadParamsVO.getInpadocFamily());
|
|
|
}
|
|
|
+ //装载专利id
|
|
|
patentSimpleFamilyParams.setPatentId(uploadParamsVO.getPatent().getId());
|
|
|
+ //装载专利号
|
|
|
patentSimpleFamilyParams.setPatentNo(uploadParamsVO.getPatent().getPatentNo());
|
|
|
-
|
|
|
+ //开始
|
|
|
patentSimpleFamilyService.updatePatentSimpleFamily(patentSimpleFamilyParams);
|
|
|
}
|
|
|
|
|
|
- //发明人 OS_PATENT_INVENTOR
|
|
|
+ //发明人
|
|
|
private void patentInventorBusiness(UploadParamsVO uploadParamsVO) {
|
|
|
+ //创建PatentInventorParams对象装载发明人相关数据
|
|
|
PatentInventorParams patentInventorParams = new PatentInventorParams();
|
|
|
if (uploadParamsVO.getPatentInventorList() != null) {
|
|
|
List<String> addressList = uploadParamsVO.getPatentInventorList().stream().map(PatentInventor::getAddress).filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
+ //装载发明人地址集合
|
|
|
patentInventorParams.setAddressList(addressList);
|
|
|
List<String> nameList = uploadParamsVO.getPatentInventorList().stream().map(PatentInventor::getName).collect(Collectors.toList());
|
|
|
+ //装载发明人名称集合
|
|
|
patentInventorParams.setNameList(nameList);
|
|
|
}
|
|
|
if (uploadParamsVO.getFirstName() != null) {
|
|
|
+ //装载第一发明人名称
|
|
|
patentInventorParams.setFirstName(uploadParamsVO.getFirstName());
|
|
|
}
|
|
|
if (uploadParamsVO.getFirstAddress() != null) {
|
|
|
+ //装载第一发明人地址
|
|
|
patentInventorParams.setFirstAddress(uploadParamsVO.getFirstAddress());
|
|
|
}
|
|
|
+ //装载专利号
|
|
|
patentInventorParams.setPatentId(uploadParamsVO.getPatent().getId());
|
|
|
-
|
|
|
+ //开始装载发明人表实体类相关信息、专利与发明人关联表实体类集合相关信息,然后各自数据分别插入这两张表
|
|
|
patentInventorService.updatePatentInventor(patentInventorParams);
|
|
|
}
|
|
|
|
|
|
- //申请人(原始)/权利人(当前) OS_PATENT_APPLICATION || OS_APPLICATION_ATTR
|
|
|
+ //申请人(原始)/权利人(当前)
|
|
|
private void patentApplicationBusiness(UploadParamsVO uploadParamsVO) {
|
|
|
// 根据本条数据的名字查询所有的申请人信息
|
|
|
List<String> name = new ArrayList<>();
|