Browse Source

12.12修改

chenyi 2 years ago
parent
commit
fd0ce88e3f

+ 3 - 0
RMS/src/main/java/cn/cslg/report/common/model/vo/PatentVO.java

@@ -77,4 +77,7 @@ public class PatentVO extends BaseVO {
 
     @Schema(description = "标题")
     private String patentName;
+    @Schema(description = "总数")
+    private Integer total;
+
 }

+ 4 - 4
RMS/src/main/java/cn/cslg/report/controller/AssoTaskPersonelController.java

@@ -2,6 +2,7 @@ package cn.cslg.report.controller;
 
 import cn.cslg.report.common.core.base.Constants;
 
+import cn.cslg.report.common.model.vo.PatentVO;
 import cn.cslg.report.common.utils.SecurityUtils.LoginUtils;
 import cn.cslg.report.service.business.AssoTaskPersonelService;
 import io.swagger.v3.oas.annotations.Operation;
@@ -20,11 +21,10 @@ import java.io.IOException;
 public class AssoTaskPersonelController {
     public final AssoTaskPersonelService assoTaskPersonelService;
     private final LoginUtils loginUtils;
-    @GetMapping("/getPartClient")
+    @PostMapping("/getPartClient")
     @Operation(summary = "分页获取对比专利")
-    public String getPagination( int  state, int taskId,int location)throws IOException{
-        Integer id = loginUtils.getId();
-        String res =assoTaskPersonelService.pagination(id,state,taskId,location);
+    public String getPagination(@RequestBody PatentVO patentVO)throws IOException{
+        String res =assoTaskPersonelService.pagination(patentVO);
         return res;
     }
 

+ 2 - 2
RMS/src/main/java/cn/cslg/report/service/OutInterfaceService.java

@@ -337,8 +337,6 @@ public class OutInterfaceService {
         if (type == 0) {
             map.put("projectId", report.getProjectId());
             map.put("importTaskId", taskIds);
-            map.put("startNumber", patentVO.getStartNumber());
-            map.put("endNumber", patentVO.getEndNumber());
         }
         //专利名称
         map.put("patentName",patentVO.getPatentName());
@@ -360,6 +358,8 @@ public class OutInterfaceService {
         map.put("numberCpc",patentVO.getNumberCpc());
         map.put("numberIpc",patentVO.getNumberIpc());
         map.put("numberUpc",patentVO.getNumberUpc());
+        map.put("startNumber", patentVO.getStartNumber());
+        map.put("endNumber", patentVO.getEndNumber());
         JSONObject json = new JSONObject(map);
         RequestBody requestBody = RequestBody.create(JSON, String.valueOf(json));
         OkHttpClient okHttpClient = new OkHttpClient();

+ 45 - 25
RMS/src/main/java/cn/cslg/report/service/business/AssoTaskPersonelService.java

@@ -1,11 +1,14 @@
 package cn.cslg.report.service.business;
 
 
+import cn.cslg.report.common.model.vo.PatentVO;
 import cn.cslg.report.common.utils.Response;
 
 import cn.cslg.report.entity.asso.AssoTaskPersonel;
 import cn.cslg.report.mapper.AssoTaskPersonelMapper;
 
+import cn.cslg.report.service.OutInterfaceService;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 
@@ -34,6 +37,7 @@ import java.util.stream.Collectors;
 @SuppressWarnings({"all"})
 public class AssoTaskPersonelService extends ServiceImpl<AssoTaskPersonelMapper, AssoTaskPersonel> {
    public final  AssoTaskPersonelMapper assoTaskPersonelMapper ;
+   public final OutInterfaceService outInterfaceService;
     public static final MediaType JSON = MediaType.parse("application/json; charset=utf-8");
     @Value("${PCSUrl}")
     private String PCSUrl;
@@ -63,35 +67,51 @@ public class AssoTaskPersonelService extends ServiceImpl<AssoTaskPersonelMapper,
      * @return  专利号
      * @throws IOException
      */
-    public String pagination(int personelId , int  state, int taskId,int location)throws IOException{
-        Map<String,Object> map =new HashMap<>();
-        List<String> patentNumber =new ArrayList<>();
-        if(state==3){
-        LambdaQueryWrapper<AssoTaskPersonel> wrappers =new LambdaQueryWrapper();
-        wrappers.eq(AssoTaskPersonel::getPersonelId,personelId)
-        .eq(AssoTaskPersonel::getTaskId,taskId);
+    public String pagination(PatentVO patentVO)throws IOException {
+        Map<String, Object> map = new HashMap<>();
+        List<String> patentNumber = new ArrayList<>();
+        if (patentVO.getState() == 3) {
+            //3类型包括1和2
+            LambdaQueryWrapper<AssoTaskPersonel> wrappers = new LambdaQueryWrapper();
+            wrappers.eq(AssoTaskPersonel::getTaskId, patentVO.getTaskId());
             List<AssoTaskPersonel> list = this.list(wrappers);
-            patentNumber=list.stream().map(AssoTaskPersonel ::getPatentNo).collect(Collectors.toList());
+            //专利号
+            patentNumber = list.stream().map(AssoTaskPersonel::getPatentNo).collect(Collectors.toList());
 
-        }else {
+        } else {
             //拿到专利号
-            patentNumber = assoTaskPersonelMapper.getPatentNumber(personelId, state, taskId);
-        }
-
+            LambdaQueryWrapper<AssoTaskPersonel> wrappers = new LambdaQueryWrapper();
+            wrappers.eq(AssoTaskPersonel::getTaskId, patentVO.getTaskId())
+                    .eq(AssoTaskPersonel::getState, patentVO.getState());
 
-         map.put("patentNos",patentNumber);
-         map.put("startNumber",location);
-        JSONObject json = new JSONObject(map);
-           RequestBody requestBody =RequestBody.create(JSON,String.valueOf(json));
-           //网络通信协议调  分析系统api/v2/patent/getPagination
-        OkHttpClient okHttpClient = new OkHttpClient();
-        Request request = new Request.Builder()
-                .url(PASUrl + "/api/v2/patent/getPagination")
-                .post(requestBody)
-                .build();
-        //获取分析系统api/v2/patent/getPagination 返回值
-        return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
+        }
 
-    }
+        patentVO.setPatentNos(patentNumber);
+
+        if (patentVO.getLocPosition() <= 1) {
+            patentVO.setStartNumber(0);
+            patentVO.setEndNumber(1);
+            String res = outInterfaceService.getPatentFromPAS(patentVO, 1);
+            JSONObject jsonObject = JSONObject.parseObject(res);
+            JSONObject jsonObject1 = JSONObject.parseObject(jsonObject.get("data").toString());
+            List<JSONObject> jsonObjects = JSONArray.parseArray(jsonObject1.get("records").toString(), JSONObject.class);
+            jsonObject1.put("type", "first");
+        } else {
+            patentVO.setStartNumber(patentVO.getLocPosition() - 2);
+            patentVO.setEndNumber(patentVO.getLocPosition());
+            String res = outInterfaceService.getPatentFromPAS(patentVO, 1);
+            JSONObject jsonObject = JSONObject.parseObject(res);
+            JSONObject jsonObject1 = JSONObject.parseObject(jsonObject.get("data").toString());
+            List<JSONObject> jsonObjects = JSONArray.parseArray(jsonObject1.get("records").toString(), JSONObject.class);
+            if (jsonObjects.size() < 3) {
+
+                jsonObject1.put("type", "end");
+
+            } else {
+                jsonObject1.put("type", "normal");
+            }
+            return  "11";
+        }
 
+        return  "11"; }
 }

+ 2 - 3
RMS/src/main/java/cn/cslg/report/service/business/FeatureService.java

@@ -416,14 +416,13 @@ public class FeatureService extends ServiceImpl<FeatureMapper, Features> {
     }
 
 
-    //TODO
+
     @Transactional(rollbackFor = Exception.class)
     public Integer delByReportId(int reportId){
         LambdaQueryWrapper<Features> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.eq(Features::getReportId,reportId);
         this.remove(queryWrapper);
-  List<Features> features =this.list(queryWrapper);
-//  List<Integer> featureIds =features
+        List<Features> features =this.list(queryWrapper);
         return 1;
     }
 

File diff suppressed because it is too large
+ 0 - 7815
logs/rms/rms-debug.2022-12-05.0.log


File diff suppressed because it is too large
+ 29539 - 0
logs/rms/rms-debug.2022-12-12.0.log


File diff suppressed because it is too large
+ 0 - 1402
logs/rms/rms-info.2022-12-05.0.log


File diff suppressed because it is too large
+ 317 - 0
logs/rms/rms-info.2022-12-12.0.log