|
@@ -2,8 +2,6 @@ package cn.cslg.pas.service;
|
|
|
|
|
|
import cn.cslg.pas.common.model.params.PatentRightParams;
|
|
|
import cn.cslg.pas.common.utils.PatentRightUtils;
|
|
|
-import cn.cslg.pas.common.utils.PatentUtils;
|
|
|
-import cn.cslg.pas.common.utils.Response;
|
|
|
import cn.cslg.pas.common.utils.StringUtils;
|
|
|
import cn.cslg.pas.domain.Authority;
|
|
|
import cn.cslg.pas.domain.Patent;
|
|
@@ -17,7 +15,6 @@ import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
-import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
import java.util.regex.Matcher;
|
|
|
import java.util.regex.Pattern;
|
|
@@ -431,17 +428,26 @@ public class PatentRightService extends ServiceImpl<PatentRightMapper, PatentRig
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 格式化权要、拆分并理清父子级,insert/update DB
|
|
|
+ * 1.格式化权要 2.理出主次权要父子关系 3.权要表"os_patent_right"更新或新增权要
|
|
|
*
|
|
|
- * @param params 权利要求
|
|
|
+ * @param params 权利要求相关数据
|
|
|
*/
|
|
|
public void updatePatentRight(PatentRightParams params) {
|
|
|
- //调用拆分权要工具类格式化并拆分权要理清父子级
|
|
|
- List<PatentRight> patentRights = PatentRightUtils.formatPatentRight(params);
|
|
|
- //删除库表中原有该权要
|
|
|
- if (patentRights.size() > 0) {
|
|
|
- this.deleteByPatentId(params.getPatentId());
|
|
|
- this.saveOrUpdateBatch(patentRights);
|
|
|
+ try {
|
|
|
+ //调用拆分权要工具类
|
|
|
+ List<PatentRight> patentRights = PatentRightUtils.formatPatentRight(params);
|
|
|
+
|
|
|
+ if (patentRights.size() > 0) {
|
|
|
+ //TODO 先根据专利id查询库中原权要,与当前权要比对,若不同则更新,若相同则不更新
|
|
|
+
|
|
|
+ //删除库表中原有该权要
|
|
|
+ this.deleteByPatentId(params.getPatentId());
|
|
|
+ //权要数据入表"os_patent_right"
|
|
|
+ this.saveOrUpdateBatch(patentRights);
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
}
|