浏览代码

4/19 修改权要对于日文韩文的专利权要拆解、产品类别的修改

chendayu 2 年之前
父节点
当前提交
60f25d996f

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

@@ -505,7 +505,7 @@ public class PatentRightService extends ServiceImpl<PatentRightMapper, PatentRig
             contentOut = contentOut.replaceAll(" +", "");
 
             //中文专利的权要拆分 ↓
-            if (country.equals("CN") || country.equals("JP")) {
+            if (country.equals("CN") || country.equals("JP") || country.equals("KR")) {
                 String regex;
                 if (content.contains("。2.")) {
                     regex = "。[0-9]+\\.";
@@ -515,13 +515,18 @@ public class PatentRightService extends ServiceImpl<PatentRightMapper, PatentRig
                     regex = "\\[[0-9]+]";
                 } else if (content.contains("請求項")) {
                     regex = "。【請求項[0-9]+】";
+                } else if (content.contains("청구항")) {
+                    regex = "\\.청구항 [0-9]+";
                 } else {
                     regex = "";
                 }
                 Matcher matcher = Pattern.compile(regex).matcher(content);
                 Matcher matcherOut = Pattern.compile(regex).matcher(contentOut);
                 while (matcher.find()) {
-                    if (matcher.group().contains(".")) {
+                    if (matcher.group().contains("청구항")) {
+                        String matcherGroup = matcher.group().replace(".", "\\.");
+                        content = content.replaceFirst(matcherGroup, ".\n" + matcherGroup.substring(matcherGroup.indexOf(".") + 1));
+                    } else if (matcher.group().contains(".")) {
                         String matcherGroup = matcher.group().replace(".", "\\.");
                         content = content.replaceFirst(matcherGroup, "。\n" + matcherGroup.substring(matcherGroup.indexOf("。") + 1, matcherGroup.indexOf("\\")) + ".");
                     } else if (matcher.group().contains("、") || matcher.group().contains("請求項")) {

+ 3 - 4
PAS/src/main/java/cn/cslg/pas/service/impl/ProductCategoryServiceImpl.java

@@ -7,6 +7,7 @@ import cn.cslg.pas.common.model.vo.*;
 import cn.cslg.pas.common.utils.CacheUtils;
 import cn.cslg.pas.common.utils.FileUtils;
 import cn.cslg.pas.common.utils.SecurityUtils.LoginUtils;
+import cn.cslg.pas.common.utils.ThrowException;
 import cn.cslg.pas.domain.Product;
 import cn.cslg.pas.domain.ProductCategory;
 import cn.cslg.pas.domain.asso.AssoProductCategoryPicture;
@@ -226,9 +227,7 @@ public class ProductCategoryServiceImpl implements IProductCategoryService {
         log.info("检查尝试删除的数据是否存在");
         int count = productCategoryMapper.countById(id);
         if (count == 0) {
-            String message = "删除产品类别失败,尝试访问的数据不存在";
-            log.info("{}", message);
-            throw new XiaoShiException(message);
+            ThrowException.throwXiaoShiException("删除产品类别失败,访问的数据不存在,请尝试刷新页面");
         }
 
         //检查该产品类别是否有图片
@@ -260,7 +259,7 @@ public class ProductCategoryServiceImpl implements IProductCategoryService {
     @Override
     public List<ProductCategoryTrendVO> showTrend(ProductCategoryDTO dto) {
         //判断架构id是否有内容,没有的话直接返回null
-        if (dto.getCategoryId() == null && dto.getCategoryId() == 0) {
+        if (dto.getCategoryId() == null || dto.getCategoryId() == 0) {
             return null;
         }
         //存储各个产品信息和营销数据