|
@@ -63,28 +63,28 @@ public class UploadPatentBatchService {
|
|
|
try {
|
|
|
//拿到存放在服务器的专利数据来源配置文件uploadSetting.json并按行读取文件字符流,返回整个文件字符串
|
|
|
String getSettingJson = fileUtils.analysisJsonFile();
|
|
|
- //查找并装载本次请求需要的数据源(如智慧芽)的对应配置(如前台传来的数据来源id是1,即“智慧芽”,那么jsonData装载的就是智慧芽的数据源配置)
|
|
|
+ //查找并装载本次导入的专利需要的数据源(如智慧芽)的对应配置(如前台传来的数据来源id是1,即“智慧芽”,那么jsonData装载的就是智慧芽的数据源配置)
|
|
|
List<UploadSettingVO.Column> jsonData = UploadPatentBatchUtil.parsingConfigurationFiles(projectImportPatentVO, getSettingJson);
|
|
|
|
|
|
- //装载所有专利的摘要附图(key:下标即专利行数 value:摘要附图图片数据)
|
|
|
+ //装载所有专利的摘要附图(key:专利行数 value:专利行数对应的专利的摘要附图图片数据)
|
|
|
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);
|
|
|
- //根据上一步uploadParamsVO对象中的专利号查询专利表“os_patent”,判断当前专利是否存在库中,如果存在就装载专利patentId到uploadParamsVO对象,如果不存在就新增该专利数据入库后再装载专利patentId到uploadParamsVO对象
|
|
|
+ //专利基础数据入库(专利表"os_patent"):专利基础数据根据UploadParamsVO中patent对象装载的专利号patentNo查询专利表“os_patent”,如果存在就将表中专利的Id装载到patent的id属性上,如果不存在就先将该专利数据入表后再装载Id
|
|
|
getOneOrInsertOne(uploadParamsVO);
|
|
|
|
|
|
- //专利信息(摘要附图)数据装配
|
|
|
+ //摘要附图数据装配及入库(摘要附图表"os_patent_img")
|
|
|
PictureData pictureData = pictureDataMap.get(String.valueOf(i + 1));
|
|
|
if (uploadParamsVO.getPatent() != null) {
|
|
|
if (uploadParamsVO.getPatent().getId() != null && pictureData != null) {
|
|
|
uploadParamsVO.getPatent().setAbstractPath(patentImageService.updatePatentImage(uploadParamsVO.getPatent().getId(), pictureData));
|
|
|
}
|
|
|
}
|
|
|
- //专利信息(代理机构)数据装配
|
|
|
+ //代理机构数据装配及入库(代理机构表"os_patent_agency")
|
|
|
if (uploadParamsVO.getPatent() != null) {
|
|
|
if (uploadParamsVO.getPatent().getAgencyId() != null) {
|
|
|
uploadParamsVO.getPatent().setAgencyId(patentAgencyService.getAgencyStringIdByName(uploadParamsVO.getPatent().getAgencyId()));
|
|
@@ -205,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()
|
|
@@ -216,64 +216,72 @@ public class UploadPatentBatchService {
|
|
|
uploadParamsVO.getPatent().updateById();
|
|
|
}
|
|
|
|
|
|
- //保存权利要求
|
|
|
+ //保存权利要求(表"os_patent_right")
|
|
|
patentRightBusiness(uploadParamsVO);
|
|
|
|
|
|
- //保存说明书
|
|
|
+ //保存说明书(表"os_patent_instruction_text")
|
|
|
if (uploadParamsVO.getPatentInstructionText() != null) {
|
|
|
patentInstructionTextBusiness(uploadParamsVO);
|
|
|
}
|
|
|
|
|
|
- //保存代理人
|
|
|
+ //保存代理人(表"os_patent_agent"、表"os_patent_agent_link")
|
|
|
if (uploadParamsVO.getPatentAgentList() != null) {
|
|
|
patentAgentBusiness(uploadParamsVO);
|
|
|
}
|
|
|
|
|
|
- //保存质押质权人
|
|
|
+ //保存简单同族(表"")
|
|
|
+ patentSimplyFamilyBusiness(uploadParamsVO);
|
|
|
+
|
|
|
+ //保存质押质权人(表"os_patent_pledge")
|
|
|
if (uploadParamsVO.getPatentPledgeList() != null) {
|
|
|
patentPledgeBusiness(uploadParamsVO);
|
|
|
}
|
|
|
|
|
|
- //保存许可人
|
|
|
+ //保存许可人(表"os_patent_licensor")
|
|
|
if (uploadParamsVO.getPatentLicensorList() != null) {
|
|
|
patentLicensorBusiness(uploadParamsVO);
|
|
|
}
|
|
|
|
|
|
- //保存简单同族
|
|
|
- patentSimplyFamilyBusiness(uploadParamsVO);
|
|
|
-
|
|
|
- //保存发明人
|
|
|
+ //保存发明人(表"os_patent_inventor"、表"os_patent_inventor_relation")
|
|
|
patentInventorBusiness(uploadParamsVO);
|
|
|
|
|
|
- //保存申请人(原始)/权利人(当前)
|
|
|
+ //保存申请人(原始)/权利人(当前)(表"os_patent_applicant"、表"os_applicant_attr")
|
|
|
patentApplicationBusiness(uploadParamsVO);
|
|
|
|
|
|
- //保存申请人地址
|
|
|
+ //保存申请人地址(表"")
|
|
|
patentApplicationAddressBusiness(uploadParamsVO);
|
|
|
- //保存专题库关联专利信息
|
|
|
+
|
|
|
+ //保存专题库关联专利信息(表"os_thematic_pid")
|
|
|
if (uploadParamsVO.getPatent() != null) {
|
|
|
patentThematicPidBusiness(uploadParamsVO, projectImportPatentVO);
|
|
|
}
|
|
|
- //保存标引内容关联专利信息
|
|
|
+
|
|
|
+ //保存标引内容关联专利信息(表"os_patent_field_patent_link"、"os_patent_field_text")
|
|
|
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);
|
|
|
}
|
|
|
+
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
if (uploadParamsVO.getPatent() != null) {
|