Parcourir la source

5.30 整理接口时添加注释与优化

chendayu il y a 2 ans
Parent
commit
fe27baebc0

+ 1 - 0
PAS/src/main/java/cn/cslg/pas/common/utils/ExcelUtils.java

@@ -49,6 +49,7 @@ public class ExcelUtils {
             }
         }
         Map<String, PictureData> maplist = null;
+        //拿到excel表格的第一个sheet工作簿
         sheet = wookbook.getSheetAt(0);
         // 判断用07还是03的方法获取图片
         if (filePath.endsWith(".xls") || filePath.endsWith(".XLS")) {

+ 9 - 3
PAS/src/main/java/cn/cslg/pas/domain/SystemDict.java

@@ -15,11 +15,17 @@ import lombok.Data;
 @Data
 @TableName("os_system_dict")
 public class SystemDict extends BaseEntity<SystemDict> {
-
+    /**
+     * 名称
+     */
     private String label;
-
+    /**
+     * 数值
+     */
     private String value;
-
+    /**
+     * 类型
+     */
     private String type;
 
     public SystemDict() {

+ 1 - 1
PAS/src/main/java/cn/cslg/pas/service/PatentAgentService.java

@@ -103,7 +103,7 @@ public class PatentAgentService extends ServiceImpl<PatentAgentMapper, PatentAge
     }
 
     /**
-     * 代理人数据入专利信息代理人表“os_patent_agent”,新增代理人ids和专利id入代理人关联专利表“os_patent_agent_link”
+     * 代理人数据入代理人表“os_patent_agent”,代理人ids和专利id入代理人与专利关联表“os_patent_agent_link”
      *
      * @param patentAgentParams 代理人相关参数
      */

+ 2 - 0
PAS/src/main/java/cn/cslg/pas/service/PatentRightService.java

@@ -440,6 +440,8 @@ public class PatentRightService extends ServiceImpl<PatentRightMapper, PatentRig
         List<PatentRight> patentRights = PatentRightUtils.formatPatentRight(params);
 
         if (patentRights.size() > 0) {
+            //TODO 先根据专利id查询库中原权要,与当前权要比对,若不同则更新,若相同则不更新
+
             //删除库表中原有该权要
             this.deleteByPatentId(params.getPatentId());
             //权要数据入表"os_patent_right"

+ 1 - 1
PAS/src/main/java/cn/cslg/pas/service/ProjectService.java

@@ -651,7 +651,7 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
         //获得文件路径
         String path = fileUtils.getPath(fileDTO.getPath());
 
-        //创建集合rowList,准备装载Excel中所有行数据(元素数=总行数,元素=行数据,第一个元素=表头行数据)
+        //创建集合rowList,准备装载Excel中所有行数据(元素数=总行数,元素=行数据,第一个元素=表头行数据)
         List<List<Object>> rowList = new ArrayList<>();
         //集合mapList,准备装载Excel中的全部专利的数据(每一个元素的key:表头(如"公开号")  value:表头对应的专利内容(如"CN204445352U"))
         List<Map<Object, Object>> mapList = new ArrayList<>();

+ 32 - 24
PAS/src/main/java/cn/cslg/pas/service/UploadPatentBatchService.java

@@ -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) {