zero 9 mesiacov pred
rodič
commit
53fc3d27ab
18 zmenil súbory, kde vykonal 192 pridanie a 176 odobranie
  1. 1 1
      src/main/java/cn/cslg/pas/common/utils/CronUtil.java
  2. 15 50
      src/main/java/cn/cslg/pas/controller/AssoGroupFeatureController.java
  3. 8 35
      src/main/java/cn/cslg/pas/controller/PatentController.java
  4. 1 1
      src/main/java/cn/cslg/pas/service/business/ImportTaskConditionService.java
  5. 6 6
      src/main/java/cn/cslg/pas/service/business/MergePersonService.java
  6. 5 4
      src/main/java/cn/cslg/pas/service/business/PDFExportFirstPageService.java
  7. 5 5
      src/main/java/cn/cslg/pas/service/business/PatentExportService.java
  8. 1 1
      src/main/java/cn/cslg/pas/service/business/es/EsCustomFieldService.java
  9. 21 21
      src/main/java/cn/cslg/pas/service/business/es/EsExportService.java
  10. 9 5
      src/main/java/cn/cslg/pas/service/business/es/EsFamilyService.java
  11. 9 7
      src/main/java/cn/cslg/pas/service/business/es/EsLegalEventService.java
  12. 23 13
      src/main/java/cn/cslg/pas/service/business/es/EsPatentService.java
  13. 1 1
      src/main/java/cn/cslg/pas/service/business/es/EsProductPatentService.java
  14. 16 2
      src/main/java/cn/cslg/pas/service/business/es/EsQuotePatentService.java
  15. 46 10
      src/main/java/cn/cslg/pas/service/business/es/EsScratchWordsService.java
  16. 16 6
      src/main/java/cn/cslg/pas/service/business/es/EsService.java
  17. 5 4
      src/main/java/cn/cslg/pas/service/business/invalidReport/AssoGroupFeatureService.java
  18. 4 4
      src/main/java/cn/cslg/pas/service/importPatent/ImportSinglePatentService.java

+ 1 - 1
src/main/java/cn/cslg/pas/common/utils/CronUtil.java

@@ -33,7 +33,7 @@ public class CronUtil {
                 cron = "0 0 0 1 1 ? *";
                 break;
             default:
-                throw new XiaoShiException(ExceptionEnum.BUSINESS_CHECK,"周期非法输入");
+                throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR,"周期非法输入");
         }
         return cron;
 

+ 15 - 50
src/main/java/cn/cslg/pas/controller/AssoGroupFeatureController.java

@@ -33,64 +33,39 @@ public class AssoGroupFeatureController {
     @Operation(summary = "修改特征")
     @PostMapping("/updateGroupFeature")
     public Response updateGroupFeature(@RequestBody UpdateGroupFeatureDTO updateGroupFeatureDTO) throws Exception {
-        try {
-            Records records = new Records();
-            records.setData(assoGroupFeatureService.updateGroupFeature(updateGroupFeatureDTO));
-            return Response.success(records);
-
-        } catch (Exception e) {
-            return Response.error(e.getMessage());
-        }
+        Records records = new Records();
+        records.setData(assoGroupFeatureService.updateGroupFeature(updateGroupFeatureDTO));
+        return Response.success(records);
     }
 
     @Operation(summary = "删除特征")
     @PostMapping("/removeGroupFeature")
     public Response removeGroupFeature(@RequestBody RemoveGroupFeatureDTO removeGroupFeatureDTO) throws Exception {
-        try {
-            Records records = new Records();
-            records.setData(assoGroupFeatureService.removeGroupFeature(removeGroupFeatureDTO));
-            return Response.success(records);
-
-        } catch (Exception e) {
-            return Response.error(e.getMessage());
-        }
+        Records records = new Records();
+        records.setData(assoGroupFeatureService.removeGroupFeature(removeGroupFeatureDTO));
+        return Response.success(records);
     }
 
 
     @Operation(summary = "查询特征修改历史")
     @PostMapping("/queryFeatureHistory")
     public Response queryFeatureHistory(@RequestBody QueryFeatureHistoryDTO queryFeatureHistoryDTO) throws Exception {
-        try {
-            Records records = new Records();
-            records.setData(assoGroupFeatureService.queryFeatureHistory(queryFeatureHistoryDTO));
-            return Response.success(records);
-
-        } catch (Exception e) {
-            return Response.error(e.getMessage());
-        }
+        Records records = new Records();
+        records.setData(assoGroupFeatureService.queryFeatureHistory(queryFeatureHistoryDTO));
+        return Response.success(records);
     }
 
     @Operation(summary = "更新特征")
     @PostMapping("/updateFeature")
     public Response updateFeature(@RequestBody UpdateGroupFeatureDTO updateGroupFeatureDTO) throws Exception {
-        try {
-           assoGroupFeatureService.updateFeature(updateGroupFeatureDTO);
-            return Response.success("更新成功");
-
-        } catch (Exception e) {
-            return Response.error(e.getMessage());
-        }
+        assoGroupFeatureService.updateFeature(updateGroupFeatureDTO);
+        return Response.success("更新成功");
     }
 
     @Operation(summary = "更新信息")
     @PostMapping("/updateMessage")
     public Response updateMessage(@RequestBody UpdateMessageDTO updateMessageDTO) {
-        try {
-            assoGroupFeatureService.updateMessage(updateMessageDTO);
-        }
-        catch (Exception e){
-            return  Response.error(e.getMessage());
-        }
+        assoGroupFeatureService.updateMessage(updateMessageDTO);
         return Response.success("更新成功");
     }
 
@@ -98,12 +73,7 @@ public class AssoGroupFeatureController {
     @Operation(summary = "批量给证据组合添加特征")
     @PostMapping("/addFeatureGroupBatch")
     public Response addFeatureGroupBatch(@RequestBody AddFeatureGroupBatchDTO addFeatureGroupBatchDTO) {
-        try {
-            assoGroupFeatureService.addFeatureGroupBatch(addFeatureGroupBatchDTO);
-        }
-        catch (Exception e){
-            return  Response.error(e.getMessage());
-        }
+        assoGroupFeatureService.addFeatureGroupBatch(addFeatureGroupBatchDTO);
         return Response.success("添加成功");
     }
 
@@ -111,13 +81,8 @@ public class AssoGroupFeatureController {
     @GetMapping("/cancelRemoveFeature")
     public Response cancelRemoveFeature( Integer featureId ) {
         Records records =new Records();
-        try {
-           List<Integer> ids = assoGroupFeatureService.cancelRemoveFeature(featureId);
-           records.setData(ids);
-        }
-        catch (Exception e){
-            return  Response.error(e.getMessage());
-        }
+        List<Integer> ids = assoGroupFeatureService.cancelRemoveFeature(featureId);
+        records.setData(ids);
         return Response.success(records);
     }
 }

+ 8 - 35
src/main/java/cn/cslg/pas/controller/PatentController.java

@@ -175,12 +175,7 @@ public class PatentController {
     @Operation(summary = "专利的聚合统计")
     @PostMapping("/esCountAnalysis")
     public Response esCountAnalysis(@RequestBody EsAllCountVO countVO) throws Exception {
-        EsCountDTO dto = null;
-        try {
-            dto = esCountService.esCountAnalysis(countVO);
-        } catch (Exception e) {
-            return Response.error(e.getMessage());
-        }
+        EsCountDTO dto = esCountService.esCountAnalysis(countVO);
         return Response.success(dto);
     }
 
@@ -195,12 +190,7 @@ public class PatentController {
     @Operation(summary = "专利列表上新增或编辑发明人/权利人/申请人合并共享接口")
     @PostMapping("/commonMerge")
     public Response commonMerge(@RequestBody MergePersonCommonVO commonVO) throws Exception {
-        Integer personId = null;
-        try {
-            personId = mergePersonService.commonMerge(commonVO);
-        } catch (Exception e) {
-            return Response.error(e.getMessage());
-        }
+        Integer personId = mergePersonService.commonMerge(commonVO);
         return Response.success(personId);
     }
 
@@ -221,12 +211,7 @@ public class PatentController {
     @Operation(summary = "发明人/权利人/申请人合并记录删除")
     @PostMapping("/delMergePerson")
     public Response delMergePerson(@RequestBody MergePersonIdVO vo) throws Exception {
-        Integer id = null;
-        try {
-            id = mergePersonService.delMergePerson(vo);
-        } catch (Exception e) {
-            return Response.error(e.getMessage());
-        }
+        Integer id = mergePersonService.delMergePerson(vo);
         return Response.success(id);
     }
 
@@ -258,11 +243,7 @@ public class PatentController {
         Integer taskId = importTaskService.addExportTask(exportTaskDTO);
         exportTaskDTO.setEsVO(EsVO);
         exportTaskDTO.setTaskId(taskId);
-        try {
-            pdfExportFirstPageService.mergePdfFirstPage(exportTaskDTO);
-        } catch (Exception e) {
-            return Response.error(e.getMessage());
-        }
+        pdfExportFirstPageService.mergePdfFirstPage(exportTaskDTO);
         Records records = new Records();
         records.setData("正在导出PDF首页");
         return Response.success(records);
@@ -319,23 +300,15 @@ public class PatentController {
     }
 
     @PostMapping("/refreshPatent")
-    public Response refreshPatent(@RequestBody RefreshPatentDTO refreshPatentDTO) {
-        try {
-            importSinglePatentService.refreshPatent(refreshPatentDTO);
-        } catch (Exception e) {
-            return Response.error(e.getMessage());
-        }
+    public Response refreshPatent(@RequestBody RefreshPatentDTO refreshPatentDTO) throws Exception {
+        importSinglePatentService.refreshPatent(refreshPatentDTO);
           return Response.success("刷新成功");
     }
 
     @Operation(summary = "批量删除专利")
     @PostMapping("/deletePatents")
     public Response deletePatents(@RequestBody EsCustomFieldBatchVO vo) throws Exception {
-        try {
-            esService.deletePatents(vo);
-            return Response.success("删除成功");
-        } catch (Exception e) {
-            return Response.error("删除失败");
-        }
+        esService.deletePatents(vo);
+        return Response.success("删除成功");
     }
 }

+ 1 - 1
src/main/java/cn/cslg/pas/service/business/ImportTaskConditionService.java

@@ -268,7 +268,7 @@ public class ImportTaskConditionService extends ServiceImpl<ImportTaskConditionM
     public Boolean removeQuartzCondition(QuartzConditionRemoveDTO quartzConditionRemoveDTO) {
         List<Integer> ids = quartzConditionRemoveDTO.getIds();
         if (ids == null || ids.size() == 0) {
-            throw new XiaoShiException(ExceptionEnum.BUSINESS_CHECK, "请选择至少一个条件");
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "请选择至少一个条件");
         }
         this.removeBatchByIds(ids);
         return true;

+ 6 - 6
src/main/java/cn/cslg/pas/service/business/MergePersonService.java

@@ -233,7 +233,7 @@ public class MergePersonService extends ServiceImpl<MergePersonMapper, MergePers
             createPatent(patent, type, list, name, num);
             Integer count = updateChild(patent, id, hit.routing());
             if (count < 0) {
-                throw new XiaoShiException("合并失败");
+                throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "合并失败");
             }
         }
     }
@@ -265,7 +265,7 @@ public class MergePersonService extends ServiceImpl<MergePersonMapper, MergePers
             createPatent(patent, type, list, name, num);
             Integer count = updateChild(patent, id, hit.routing());
             if (count < 0) {
-                throw new XiaoShiException("合并失败");
+                throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "合并失败");
             }
         }
         return mergeId;
@@ -300,7 +300,7 @@ public class MergePersonService extends ServiceImpl<MergePersonMapper, MergePers
                 .eq(MergePerson::getName, vo.getName());
         List<MergePerson> list = mergePersonMapper.selectList(wrapper);
         if (!list.isEmpty()) {
-            throw new XiaoShiException("合并名称不可重复");
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "合并名称不可重复");
         }
         MergePerson person = new MergePerson();
         BeanUtils.copyProperties(vo, person);
@@ -890,7 +890,7 @@ public class MergePersonService extends ServiceImpl<MergePersonMapper, MergePers
         // 通用添加逻辑
         String child = addChildCommon(id, joinName, mergePersonList, setter);
         if (StringUtils.isEmpty(child)) {
-            throw new XiaoShiException("添加子文档失败");
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "添加子文档失败");
         }
 
         // 如果type为0,还需要额外添加一个字段
@@ -898,7 +898,7 @@ public class MergePersonService extends ServiceImpl<MergePersonMapper, MergePers
             setter = setterMap.get(1); // 假设第二个字段是mergeRightHolder
             String child1 = addChildCommon(id, joinName, mergePersonList, setter);
             if (StringUtils.isEmpty(child1)) {
-                throw new XiaoShiException("添加子文档失败");
+                throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "添加子文档失败");
             }
         }
     }
@@ -1084,7 +1084,7 @@ public class MergePersonService extends ServiceImpl<MergePersonMapper, MergePers
             client.deleteByQuery(request);
             return 1;
         } catch (IOException e) {
-            throw new XiaoShiException("删除失败");
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "删除失败");
         }
     }
 

+ 5 - 4
src/main/java/cn/cslg/pas/service/business/PDFExportFirstPageService.java

@@ -10,6 +10,7 @@ import cn.cslg.pas.common.utils.ParseByteToFileUtils;
 import cn.cslg.pas.common.vo.WebSocketMessageVO;
 import cn.cslg.pas.common.vo.business.PatentNoVO;
 import cn.cslg.pas.common.vo.es.EsCustomFieldBatchVO;
+import cn.cslg.pas.exception.ExceptionEnum;
 import cn.cslg.pas.exception.XiaoShiException;
 import cn.cslg.pas.service.business.es.EsCustomFieldService;
 import cn.cslg.pas.service.business.es.EsPatentService;
@@ -187,7 +188,7 @@ public class PDFExportFirstPageService {
         exportTask.setDoneNum(total - defaultNum);
         Integer taskId = importTaskService.updateExportTask(exportTask);
         if (taskId == null) {
-            throw new XiaoShiException("导出记录失败");
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "导出记录失败");
         }
     }
 
@@ -244,13 +245,13 @@ public class PDFExportFirstPageService {
                     patentNos = esCustomFieldService.getPatentNos(EsVO);
                     return patentNos;
                 } catch (Exception e) {
-                    throw new XiaoShiException("");
+                    throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "");
                 }
             } else {
-                throw new XiaoShiException("入参错误");
+                throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "入参错误");
             }
         } catch (Exception e) {
-            throw new XiaoShiException("获取专利号错误");
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "获取专利号错误");
         }
     }
 

+ 5 - 5
src/main/java/cn/cslg/pas/service/business/PatentExportService.java

@@ -161,7 +161,7 @@ public class PatentExportService {
             //根据projectId查询专利信息
             List<String> patentNos = pdfExportFirstPageService.getPatentNo(EsVO);
             if (patentNos.isEmpty()) {
-                throw new XiaoShiException("未获取到专利信息");
+                throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "未获取到专利信息");
             }
             Integer total = patentNos.size();
             Integer defaultNum = 0;
@@ -271,7 +271,7 @@ public class PatentExportService {
             exportTask.setState(2);
             Integer taskId = importTaskService.updateExportTask(exportTask);
             if (taskId == null) {
-                throw new XiaoShiException("导出记录失败");
+                throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "导出记录失败");
             }
             WebSocketMessageVO webSocketMessageVO = new WebSocketMessageVO();
             webSocketMessageVO.setProjectId(EsVO.getProjectId());
@@ -368,10 +368,10 @@ public class PatentExportService {
         Integer projectId = exportTask.getProjectId();
         String createId = exportTask.getCreateId();
         if (taskId == null) {
-            throw new XiaoShiException(ExceptionEnum.BUSINESS_CHECK, "任务id不可为空");
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "任务id不可为空");
         }
         if (CollectionUtils.isEmpty(selectedFields)) {
-            throw new IllegalArgumentException("没有选择要导出的字段数据");
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "没有选择要导出的字段数据");
         }
 
 
@@ -534,7 +534,7 @@ public class PatentExportService {
             Integer reTaskId = importTaskService.updateExportTask(exportTask);
             this.sendWebSocketMessage(projectId, taskId, createId, total.intValue(), index, true);
             if (reTaskId == null) {
-                throw new XiaoShiException("导出记录失败");
+                throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "导出记录失败");
             }
 
         }

+ 1 - 1
src/main/java/cn/cslg/pas/service/business/es/EsCustomFieldService.java

@@ -66,7 +66,7 @@ public class EsCustomFieldService {
         Date createDate = new Date();
 
         if (optionType.equals(1) && (addValues == null || addValues.size() == 0)) {
-            throw new XiaoShiException("请填写值");
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "请填写值");
         }
 
 

+ 21 - 21
src/main/java/cn/cslg/pas/service/business/es/EsExportService.java

@@ -291,7 +291,7 @@ public class EsExportService {
             response = client.search(builder.build(), Patent.class);
         } catch (Exception e) {
             e.printStackTrace();
-            throw new XiaoShiException(e.getMessage());
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
         }
         long total = response.hits().total().value();
         System.out.println("total:" + total);
@@ -338,7 +338,7 @@ public class EsExportService {
             response = client.search(builder.build(), Patent.class);
         } catch (Exception e) {
             e.printStackTrace();
-            throw new XiaoShiException(e.getMessage());
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
         }
         List<Hit<Patent>> hits = response.hits().hits();
         List<String> list = new ArrayList<>();
@@ -405,7 +405,7 @@ public class EsExportService {
             response = client.search(builder.build(), Patent.class);
         } catch (Exception e) {
             e.printStackTrace();
-            throw new XiaoShiException(e.getMessage());
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
         }
         long total = response.hits().total().value();
         System.out.println("total:" + total);
@@ -454,7 +454,7 @@ public class EsExportService {
             response = client.search(builder.build(), Patent.class);
         } catch (Exception e) {
             e.printStackTrace();
-            throw new XiaoShiException(e.getMessage());
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
         }
         List<Hit<Patent>> hits = response.hits().hits();
         List<String> list = new ArrayList<>();
@@ -521,7 +521,7 @@ public class EsExportService {
             response = client.search(builder.build(), Patent.class);
         } catch (Exception e) {
             e.printStackTrace();
-            throw new XiaoShiException(e.getMessage());
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
         }
         List<Hit<Patent>> hits = response.hits().hits();
         List<String> list = new ArrayList<>();
@@ -568,7 +568,7 @@ public class EsExportService {
             response = client.search(builder.build(), Patent.class);
         } catch (Exception e) {
             e.printStackTrace();
-            throw new XiaoShiException(e.getMessage());
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
         }
         List<Hit<Patent>> hits = response.hits().hits();
         List<String> list = new ArrayList<>();
@@ -658,7 +658,7 @@ public class EsExportService {
             response = client.search(builder.build(), Patent.class);
         } catch (Exception e) {
             e.printStackTrace();
-            throw new XiaoShiException(e.getMessage());
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
         }
         return response.hits().total().value();
     }
@@ -690,7 +690,7 @@ public class EsExportService {
             response = client.search(builder.build(), Patent.class);
         } catch (Exception e) {
             e.printStackTrace();
-            throw new XiaoShiException(e.getMessage());
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
         }
         return response.hits().total().value();
     }
@@ -724,7 +724,7 @@ public class EsExportService {
             response = client.search(builder.build(), Patent.class);
         } catch (Exception e) {
             e.printStackTrace();
-            throw new XiaoShiException(e.getMessage());
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
         }
         List<Hit<Patent>> hits = response.hits().hits();
         List<EsExportRefreshVO> list = new ArrayList<>();
@@ -878,7 +878,7 @@ public class EsExportService {
             response = client.search(builder.build(), Patent.class);
         } catch (Exception e) {
             e.printStackTrace();
-            throw new XiaoShiException(e.getMessage());
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
         }
         long total = response.hits().total().value();
         if (total > 1) {
@@ -944,7 +944,7 @@ public class EsExportService {
             response = client.search(builder.build(), Patent.class);
         } catch (Exception e) {
             e.printStackTrace();
-            throw new XiaoShiException(e.getMessage());
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
         }
         long total = response.hits().total().value();
         System.out.println("total:" + total);
@@ -992,7 +992,7 @@ public class EsExportService {
             response = client.search(builder.build(), Patent.class);
         } catch (Exception e) {
             e.printStackTrace();
-            throw new XiaoShiException(e.getMessage());
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
         }
         List<Hit<Patent>> hits = response.hits().hits();
         List<String> list = new ArrayList<>();
@@ -1034,7 +1034,7 @@ public class EsExportService {
             response = client.search(builder.build(), Patent.class);
         } catch (Exception e) {
             e.printStackTrace();
-            throw new XiaoShiException(e.getMessage());
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
         }
         long total = response.hits().total().value();
         System.out.println("total:" + total);
@@ -1083,7 +1083,7 @@ public class EsExportService {
             response = client.search(builder.build(), Patent.class);
         } catch (Exception e) {
             e.printStackTrace();
-            throw new XiaoShiException(e.getMessage());
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
         }
         List<Hit<Patent>> hits = response.hits().hits();
         List<String> list = new ArrayList<>();
@@ -1368,7 +1368,7 @@ public class EsExportService {
             response = client.search(builder.build(), Patent.class);
         } catch (Exception e) {
             e.printStackTrace();
-            throw new XiaoShiException(e.getMessage());
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
         }
         List<Hit<Patent>> hits = response.hits().hits();
         if (!CollectionUtils.isEmpty(hits)) {
@@ -1403,7 +1403,7 @@ public class EsExportService {
             response = client.search(builder.build(), Patent.class);
         } catch (Exception e) {
             e.printStackTrace();
-            throw new XiaoShiException(e.getMessage());
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
         }
         List<Hit<Patent>> hits = response.hits().hits();
         if (!CollectionUtils.isEmpty(hits)) {
@@ -1440,7 +1440,7 @@ public class EsExportService {
             response = client.search(builder.build(), Patent.class);
         } catch (Exception e) {
             e.printStackTrace();
-            throw new XiaoShiException(e.getMessage());
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
         }
         List<Hit<Patent>> hits = response.hits().hits();
         if (!CollectionUtils.isEmpty(hits)) {
@@ -1468,7 +1468,7 @@ public class EsExportService {
             response = client.search(builder.build(), Patent.class);
         } catch (Exception e) {
             e.printStackTrace();
-            throw new XiaoShiException(e.getMessage());
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
         }
         List<Hit<Patent>> hits = response.hits().hits();
         if (!CollectionUtils.isEmpty(hits)) {
@@ -1503,7 +1503,7 @@ public class EsExportService {
             response = client.search(builder.build(), Patent.class);
         } catch (Exception e) {
             e.printStackTrace();
-            throw new XiaoShiException(e.getMessage());
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
         }
         List<Hit<Patent>> hits = response.hits().hits();
         if (!CollectionUtils.isEmpty(hits)) {
@@ -1538,7 +1538,7 @@ public class EsExportService {
             response = client.search(builder.build(), Patent.class);
         } catch (Exception e) {
             e.printStackTrace();
-            throw new XiaoShiException(e.getMessage());
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
         }
         List<Hit<Patent>> hits = response.hits().hits();
         if (!CollectionUtils.isEmpty(hits)) {
@@ -1564,7 +1564,7 @@ public class EsExportService {
             response = client.search(builder.build(), Patent.class);
         } catch (Exception e) {
             e.printStackTrace();
-            throw new XiaoShiException(e.getMessage());
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
         }
         List<Hit<Patent>> hits = response.hits().hits();
         Map<String, String> map = new HashMap<>();

+ 9 - 5
src/main/java/cn/cslg/pas/service/business/es/EsFamilyService.java

@@ -18,12 +18,11 @@ import cn.cslg.pas.common.vo.business.PatentKinDetailVO;
 import cn.cslg.pas.common.vo.business.PatentKinVO;
 import cn.cslg.pas.common.vo.business.PatentNoVO;
 import cn.cslg.pas.domain.es.*;
+import cn.cslg.pas.exception.ExceptionEnum;
+import cn.cslg.pas.exception.XiaoShiException;
 import cn.cslg.pas.service.query.FormatQueryService;
 import co.elastic.clients.elasticsearch.ElasticsearchClient;
-import co.elastic.clients.elasticsearch._types.FieldValue;
-import co.elastic.clients.elasticsearch._types.InlineScript;
-import co.elastic.clients.elasticsearch._types.Script;
-import co.elastic.clients.elasticsearch._types.SortOrder;
+import co.elastic.clients.elasticsearch._types.*;
 import co.elastic.clients.elasticsearch._types.query_dsl.Query;
 import co.elastic.clients.elasticsearch._types.query_dsl.QueryBuilders;
 import co.elastic.clients.elasticsearch._types.query_dsl.TermsQueryField;
@@ -74,7 +73,12 @@ public class EsFamilyService {
         Query nosQuerys = QueryBuilders.bool((i -> i.should(querys)));
         Query finalQuery = QueryBuilders.bool((i -> i.must(nosQuerys, query)));
         builder.query(finalQuery);
-        SearchResponse<PatentFamilyMessage> response = client.search(builder.build(), PatentFamilyMessage.class);
+        SearchResponse<PatentFamilyMessage> response = null;
+        try {
+            response = client.search(builder.build(), PatentFamilyMessage.class);
+        } catch (Exception e) {
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "ES检索失败");
+        }
         List<Hit<PatentFamilyMessage>> hits = response.hits().hits();
 
         for (Hit<PatentFamilyMessage> hit : hits) {

+ 9 - 7
src/main/java/cn/cslg/pas/service/business/es/EsLegalEventService.java

@@ -8,10 +8,7 @@ import cn.cslg.pas.exception.XiaoShiException;
 import cn.cslg.pas.service.common.PatentStarApiService;
 import cn.cslg.pas.service.importPatent.WebVOTransformService;
 import co.elastic.clients.elasticsearch.ElasticsearchClient;
-import co.elastic.clients.elasticsearch._types.InlineScript;
-import co.elastic.clients.elasticsearch._types.Refresh;
-import co.elastic.clients.elasticsearch._types.Script;
-import co.elastic.clients.elasticsearch._types.WaitForActiveShards;
+import co.elastic.clients.elasticsearch._types.*;
 import co.elastic.clients.elasticsearch._types.query_dsl.Query;
 import co.elastic.clients.elasticsearch._types.query_dsl.QueryBuilders;
 import co.elastic.clients.elasticsearch.core.*;
@@ -47,7 +44,12 @@ public class EsLegalEventService {
         Query query = QueryBuilders.bool(i -> i.should(q1, q2, q3));
 
         builder.query(query);
-        SearchResponse<LegalEvent> response = client.search(builder.build(), LegalEvent.class);
+        SearchResponse<LegalEvent> response = null;
+        try {
+            response = client.search(builder.build(), LegalEvent.class);
+        } catch (Exception e) {
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "ES检索失败");
+        }
         List<Hit<LegalEvent>> hits = response.hits().hits();
         List<LegalEvent> legalEvents = new ArrayList<>();
         if (hits.size() <= 0) {
@@ -70,7 +72,7 @@ public class EsLegalEventService {
             });
 
         } catch (Exception e) {
-            throw new XiaoShiException("获得事务错误");
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "获得事务错误");
         }
         return stringList;
     }
@@ -127,7 +129,7 @@ public class EsLegalEventService {
                 try {
                     String reId = this.addLegalEvent(legalEvent1);
                 } catch (Exception e) {
-                    throw new XiaoShiException(e.getMessage());
+                    throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, e.getMessage());
                 }
             });
             webVOTransformService.transLegalEvent(patent, legalEvents);

+ 23 - 13
src/main/java/cn/cslg/pas/service/business/es/EsPatentService.java

@@ -62,6 +62,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
 import java.io.IOException;
+import java.text.ParseException;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -155,7 +156,12 @@ public class EsPatentService {
         if (!CollectionUtils.isEmpty(queries)) {
             Query query = QueryBuilders.bool(i -> i.should(queries));
             builder.query(query);
-            SearchResponse<LegalEvent> response = client.search(builder.build(), LegalEvent.class);
+            SearchResponse<LegalEvent> response = null;
+            try {
+                response = client.search(builder.build(), LegalEvent.class);
+            } catch (Exception e) {
+                throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "ES检索失败");
+            }
             List<Hit<LegalEvent>> hits = response.hits().hits();
             for (Hit<LegalEvent> hit : hits) {
                 LegalEvent event = hit.source();
@@ -387,7 +393,12 @@ public class EsPatentService {
         if (pageNum > 0 && pageSize > 0) {
             builder.from((pageNum - 1) * pageSize).size(pageSize);
         }
-        SearchResponse<PatentFamilyMessage> response = client.search(builder.build(), PatentFamilyMessage.class);
+        SearchResponse<PatentFamilyMessage> response = null;
+        try {
+            response = client.search(builder.build(), PatentFamilyMessage.class);
+        } catch (Exception e) {
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "ES检索失败");
+        }
         List<Hit<PatentFamilyMessage>> hits = response.hits().hits();
         List<PatentKinDTO> kinDTOS = new ArrayList<>();
         for (Hit<PatentFamilyMessage> hit : hits) {
@@ -814,15 +825,14 @@ public class EsPatentService {
         }
         String condition = esService.appendIdsCondition(searchCondition, taskId, productFrom, projectId, productId);
 
-        Query q =null;
-        if(condition==null||condition.trim().equals("")){
-            q =QueryBuilders.exists(i->i.field("patent_no"));
-        }
-        else {
-        //1. 解析检索条件
-        treeNode tree = expressManager.getInstance().Parse(condition, false);
-        //3. 从es中检索数据
-        q = formatQueryService.EsQueryToQuery((operateNode) tree, "patent", projectId);
+        Query q = null;
+        if (StringUtils.isEmpty(condition)) {
+            q = QueryBuilders.exists(i -> i.field("patent_no"));
+        } else {
+            //1. 解析检索条件
+            treeNode tree = expressManager.getInstance().Parse(condition, false);
+            //3. 从es中检索数据
+            q = formatQueryService.EsQueryToQuery((operateNode) tree, "patent", projectId);
         }
         Query finalQ=q;
         Query reQuery = null;
@@ -1018,8 +1028,8 @@ public class EsPatentService {
         try {
             response = client.search(builder.build(), Patent.class);
         } catch (Exception e) {
-            e.printStackTrace();
-            throw new XiaoShiException("检索错误,请检查检索式");
+//            e.printStackTrace();
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "检索错误,请检查检索式");
         }
         List<PatentColumnDTO> list = new ArrayList<>();
         List<Hit<Patent>> hits = response.hits().hits();

+ 1 - 1
src/main/java/cn/cslg/pas/service/business/es/EsProductPatentService.java

@@ -108,7 +108,7 @@ public class EsProductPatentService {
             client.deleteByQuery(request);
             return 1;
         } catch (IOException e) {
-            throw new XiaoShiException("删除失败");
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "删除失败");
         }
     }
 

+ 16 - 2
src/main/java/cn/cslg/pas/service/business/es/EsQuotePatentService.java

@@ -4,7 +4,10 @@ import cn.cslg.pas.domain.es.FamilyPatent;
 import cn.cslg.pas.domain.es.PatentFamilyMessage;
 import cn.cslg.pas.domain.es.PatentQuoteMessage;
 import cn.cslg.pas.domain.es.QuotePatent;
+import cn.cslg.pas.exception.ExceptionEnum;
+import cn.cslg.pas.exception.XiaoShiException;
 import co.elastic.clients.elasticsearch.ElasticsearchClient;
+import co.elastic.clients.elasticsearch._types.ElasticsearchException;
 import co.elastic.clients.elasticsearch._types.query_dsl.Query;
 import co.elastic.clients.elasticsearch._types.query_dsl.QueryBuilders;
 import co.elastic.clients.elasticsearch.core.SearchRequest;
@@ -15,6 +18,7 @@ import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -40,7 +44,12 @@ public class EsQuotePatentService {
         Query query = QueryBuilders.bool(i -> i.should(q1, q2, q3));
 
         builder.query(query);
-        SearchResponse<PatentQuoteMessage> response = client.search(builder.build(), PatentQuoteMessage.class);
+        SearchResponse<PatentQuoteMessage> response = null;
+        try {
+            response = client.search(builder.build(), PatentQuoteMessage.class);
+        } catch (Exception e) {
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "ES检索失败");
+        }
         List<Hit<PatentQuoteMessage>> hits = response.hits().hits();
         Map<String, Object> reQuotePatent = new HashMap<>();
         if(hits.size()<=0){
@@ -83,7 +92,12 @@ public class EsQuotePatentService {
         Query query = QueryBuilders.bool(i -> i.should(q1, q2, q3));
 
         builder.query(query);
-        SearchResponse<PatentQuoteMessage> response = client.search(builder.build(), PatentQuoteMessage.class);
+        SearchResponse<PatentQuoteMessage> response = null;
+        try {
+            response = client.search(builder.build(), PatentQuoteMessage.class);
+        } catch (Exception e) {
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "ES检索失败");
+        }
         List<Hit<PatentQuoteMessage>> hits = response.hits().hits();
         if(hits.size()<=0){
             return null;

+ 46 - 10
src/main/java/cn/cslg/pas/service/business/es/EsScratchWordsService.java

@@ -26,6 +26,7 @@ import cn.cslg.pas.service.business.CommonService;
 import cn.cslg.pas.service.permissions.PermissionService;
 import cn.cslg.pas.service.query.FormatQueryService;
 import co.elastic.clients.elasticsearch.ElasticsearchClient;
+import co.elastic.clients.elasticsearch._types.ElasticsearchException;
 import co.elastic.clients.elasticsearch._types.FieldValue;
 import co.elastic.clients.elasticsearch._types.Refresh;
 import co.elastic.clients.elasticsearch._types.Time;
@@ -71,7 +72,7 @@ public class EsScratchWordsService {
     public String addScratchWords(ScratchWords scratchWords) {
         String patentNo = scratchWords.getPatentNo();
         if (patentNo == null) {
-            throw new XiaoShiException("请输入专利号");
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "请输入专利号");
         }
 
         Marking marking = new Marking();
@@ -81,7 +82,7 @@ public class EsScratchWordsService {
         try {
             id = this.saveToEs(marking);
         } catch (Exception e) {
-            throw new XiaoShiException("保存失败");
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "保存失败");
         }
         return id;
     }
@@ -119,7 +120,12 @@ public class EsScratchWordsService {
 
         long total = 0;
         try {
-            SearchResponse<Marking> response = client.search(builder.build(), Marking.class);
+            SearchResponse<Marking> response = null;
+            try {
+                response = client.search(builder.build(), Marking.class);
+            } catch (Exception e) {
+                throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "ES检索失败");
+            }
             List<Hit<Marking>> hits = response.hits().hits();
             total = response.hits().total().value();
             for (Hit<Marking> hit : hits) {
@@ -226,7 +232,12 @@ public class EsScratchWordsService {
         builder.index("patent_marking");
         Query q = QueryBuilders.ids(i -> i.values(Arrays.asList(wordsId)));
         builder.query(q);
-        SearchResponse<Marking> response = client.search(builder.build(), Marking.class);
+        SearchResponse<Marking> response = null;
+        try {
+            response = client.search(builder.build(), Marking.class);
+        } catch (Exception e) {
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "ES检索失败");
+        }
         long total = response.hits().total().value();
         if (total > 0) {
             marking = response.hits().hits().get(0).source();
@@ -316,7 +327,12 @@ public class EsScratchWordsService {
                 .bucketsPath(n -> n.single("agg._count")).build()).build();
         builder.aggregations("total", totalAggregation);
         try {
-            SearchResponse<Marking> response = client.search(builder.build(), Marking.class);
+            SearchResponse<Marking> response = null;
+            try {
+                response = client.search(builder.build(), Marking.class);
+            } catch (Exception e) {
+                throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "ES检索失败");
+            }
             Aggregate agg = response.aggregations().get("agg");
             List<Map<String, Object>> maps = new ArrayList<>();
             if (esGroupFiled.equals("mark_time")) {
@@ -425,7 +441,12 @@ public class EsScratchWordsService {
 
         long total = 0;
         try {
-            SearchResponse<Marking> response = client.search(builder.build(), Marking.class);
+            SearchResponse<Marking> response = null;
+            try {
+                response = client.search(builder.build(), Marking.class);
+            } catch (Exception e) {
+                throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "ES检索失败");
+            }
             List<Hit<Marking>> hits = response.hits().hits();
             total = response.hits().total().value();
             for (Hit<Marking> hit : hits) {
@@ -450,7 +471,12 @@ public class EsScratchWordsService {
         builder.index("patent_marking");
         Query q = QueryBuilders.ids(i -> i.values(wordsIds));
         builder.query(q);
-        SearchResponse<Marking> response = client.search(builder.build(), Marking.class);
+        SearchResponse<Marking> response = null;
+        try {
+            response = client.search(builder.build(), Marking.class);
+        } catch (Exception e) {
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "ES检索失败");
+        }
         long total = response.hits().total().value();
         response.hits().hits().forEach(item->{markings.add(item.source());
         });
@@ -498,7 +524,12 @@ public class EsScratchWordsService {
 
         long total = 0;
         try {
-            SearchResponse<Marking> response = client.search(builder.build(), Marking.class);
+            SearchResponse<Marking> response = null;
+            try {
+                response = client.search(builder.build(), Marking.class);
+            } catch (Exception e) {
+                throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "ES检索失败");
+            }
             List<Hit<Marking>> hits = response.hits().hits();
             total = response.hits().total().value();
             for (Hit<Marking> hit : hits) {
@@ -537,7 +568,12 @@ public class EsScratchWordsService {
         builder.query(q4);
 
         try {
-            SearchResponse<Marking> response = client.search(builder.build(), Marking.class);
+            SearchResponse<Marking> response = null;
+            try {
+                response = client.search(builder.build(), Marking.class);
+            } catch (Exception e) {
+                throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "ES检索失败");
+            }
             List<Hit<Marking>> hits = response.hits().hits();
             for (Hit<Marking> hit : hits) {
                 Marking marking = hit.source();
@@ -560,7 +596,7 @@ public class EsScratchWordsService {
             client.deleteByQuery(request);
             return 1;
         } catch (IOException e) {
-            throw new XiaoShiException("删除失败");
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "删除失败");
         }
     }
 }

+ 16 - 6
src/main/java/cn/cslg/pas/service/business/es/EsService.java

@@ -758,7 +758,7 @@ public class EsService {
         String parentId = patent.getPatentJoin().getParent();
         Integer num = this.getIds(parentId, customField.getProjectId(), customField.getTaskId(), customField.getField());
         if (num < 1) {
-            throw new XiaoShiException("子文档是否最新更新失败");
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "子文档是否最新更新失败");
         }
 
         String valueField = "[";
@@ -957,7 +957,12 @@ public class EsService {
                 Query p = QueryBuilders.bool(i -> i.should(q1, q2, q3));
                 Query bool = QueryBuilders.bool(i -> i.must(q4, p));
                 builder.query(bool);
-                SearchResponse<PatentFamilyMessage> response = client.search(builder.build(), PatentFamilyMessage.class);
+                SearchResponse<PatentFamilyMessage> response = null;
+                try {
+                    response = client.search(builder.build(), PatentFamilyMessage.class);
+                } catch (Exception e) {
+                    throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "ES检索失败");
+                }
                 long total = response.hits().total().value();
                 if (total > 0) {
                     List<FamilyPatent> list = new ArrayList<>();
@@ -1206,7 +1211,12 @@ public class EsService {
         Query q1 = QueryBuilders.term(t -> t.field("patent.app_no").value(patent.getAppNo()));
         Query bool = QueryBuilders.bool(i -> i.must(q1));
         builder.query(bool);
-        SearchResponse<PatentQuoteMessage> response = client.search(builder.build(), PatentQuoteMessage.class);
+        SearchResponse<PatentQuoteMessage> response = null;
+        try {
+            response = client.search(builder.build(), PatentQuoteMessage.class);
+        } catch (Exception e) {
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "ES检索失败");
+        }
         long total = response.hits().total().value();
         if (total > 0) {
             patentQuoteMessage = response.hits().hits().get(0).source();
@@ -1467,7 +1477,7 @@ public class EsService {
             for (String patentNo : isAdd) {
                 Integer number = this.getPatent(patentNo, projectId);
                 if (number < 1) {
-                    throw new XiaoShiException("删除失败");
+                    throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "删除失败");
                 }
             }
         } else if (startNum >= 1 && endNum > 0) {
@@ -1475,7 +1485,7 @@ public class EsService {
             for (String patentNo : patentNos) {
                 Integer number = this.getPatent(patentNo, projectId);
                 if (number < 1) {
-                    throw new XiaoShiException("删除失败");
+                    throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "删除失败");
                 }
             }
         }
@@ -1516,7 +1526,7 @@ public class EsService {
             client.deleteByQuery(request);
             return 1;
         } catch (IOException e) {
-            throw new XiaoShiException("删除失败");
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "删除失败");
         }
     }
 

+ 5 - 4
src/main/java/cn/cslg/pas/service/business/invalidReport/AssoGroupFeatureService.java

@@ -14,6 +14,7 @@ import cn.cslg.pas.common.vo.business.SplitVO;
 import cn.cslg.pas.common.vo.invalidVO.GroupFeatureHistoryVO;
 import cn.cslg.pas.domain.BaseEntity;
 import cn.cslg.pas.domain.business.*;
+import cn.cslg.pas.exception.ExceptionEnum;
 import cn.cslg.pas.exception.XiaoShiException;
 import cn.cslg.pas.mapper.InvalidReport.AssoGroupFeatureMapper;
 import cn.cslg.pas.service.business.FeatureService;
@@ -266,7 +267,7 @@ public class AssoGroupFeatureService extends ServiceImpl<AssoGroupFeatureMapper,
         //更新特征
         Boolean flag = this.updateFeatureContent(featureId, featureContent);
         if (flag.equals(false)) {
-            throw new XiaoShiException("特征不存在");
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "特征不存在");
         }
         //根据特征id查询证据组合和特征关联
         LambdaQueryWrapper<AssoGroupFeature> queryWrapper = new LambdaQueryWrapper<>();
@@ -386,11 +387,11 @@ public class AssoGroupFeatureService extends ServiceImpl<AssoGroupFeatureMapper,
         for (Integer id : ids) {
             AssoGroupFeature assoGroupFeature = this.getById(id);
             if (assoGroupFeature == null) {
-                throw new XiaoShiException("证据不存在");
+                throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "证据不存在");
 
             }
             if (domainFieldDTOS == null || domainFieldDTOS.size() == 0) {
-                throw new XiaoShiException("请输入值");
+                throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "请输入值");
             }
             domainFieldDTOS.forEach(item -> {
                     try {
@@ -399,7 +400,7 @@ public class AssoGroupFeatureService extends ServiceImpl<AssoGroupFeatureMapper,
                             assoGroupFeature.updateById();
                         }
                     } catch (Exception e) {
-                        throw new XiaoShiException("装载失败");
+                        throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "装载失败");
                     }
             });
         }

+ 4 - 4
src/main/java/cn/cslg/pas/service/importPatent/ImportSinglePatentService.java

@@ -359,19 +359,19 @@ public class ImportSinglePatentService {
         List<Integer> contents = refreshPatentDTO.getRefreshContent();
         Integer projectId = refreshPatentDTO.getProjectId();
         if (patentNo == null) {
-            throw new XiaoShiException("请输入专利号");
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "请输入专利号");
         }
         if (contents == null || contents.size() == 0) {
-            throw new XiaoShiException("请选择导入内容");
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "请选择导入内容");
         }
 
         PatentWithIdVO patentWithIdVO = esService.getIdByPatentNo(patentNo);
         if (patentWithIdVO == null) {
-            throw new XiaoShiException("专利不存在");
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "专利不存在");
         }
         StarPatentVO starPatentVO = this.getPatentFromWeb(patentNo);
         if (starPatentVO == null) {
-            throw new XiaoShiException("未检索到专利");
+            throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "未检索到专利");
         }
 
         Patent patent = new Patent();