Browse Source

getPagination

chenyi 2 years ago
parent
commit
34f11b7d93

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

@@ -27,4 +27,6 @@ public class PatentVO extends BaseVO {
     private List<String> notInPatentNos;
     @Schema(description = "状态")
     private Integer state;
+    @Schema(description = "当前专利位置")
+    private Integer locPosition;
 }

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

@@ -8,10 +8,7 @@ import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import lombok.RequiredArgsConstructor;
 import org.springframework.context.annotation.Lazy;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.io.IOException;
 
@@ -23,16 +20,13 @@ public class AssoTaskPersonelController {
 
     public final AssoTaskPersonelService assoTaskPersonelService;
     private  final LoginUtils loginUtils;
-//    loginUtils.getId();
-    /*
-    根据报告表中的id删除任务人员关联表的数据
-     */
-//    @RequestMapping(value = "/deleAssoTaskPersonel", method = RequestMethod.GET)
-//    @Operation(summary = "删除人员关系")
-//    public String deleAssoTaskPersonel(Integer id)throws IOException{
-//
-//        return assoTaskPersonelService.deleAssoTaskPersonel(id);
-//    }
+    @GetMapping("/getPartClient")
+    @Operation(summary = "分页获取对比专利")
+    public String getPagination( int  state, int taskId,int location)throws IOException{
+        Integer id = loginUtils.getId();
+        return assoTaskPersonelService.pagination(id,state,taskId,location);
+    }
+
 
 
 }

+ 3 - 6
RMS/src/main/java/cn/cslg/report/controller/InvalidRecordController.java

@@ -8,10 +8,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
 import lombok.RequiredArgsConstructor;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.io.IOException;
 
@@ -21,12 +18,12 @@ import java.io.IOException;
 @RequiredArgsConstructor(onConstructor_ = {@Lazy})
 public class InvalidRecordController {
     public final InvalidRecordService invalidRecordService;
-    @PostMapping(value = "/addInvalidRecord")
+    @RequestMapping(value = "/addInvalidRecord", method = RequestMethod.POST)
     @Operation(summary = "增加无效记录")
     public  String addInvalidRecord(InvalidRecord invalidRecord) throws IOException{
         return invalidRecordService.addInvalidRecord(invalidRecord);
     }
-    @PostMapping(value = "/updateInvalidRecord")
+    @RequestMapping(value = "/updateInvalidRecord", method = RequestMethod.POST)
     @Operation(summary = "修改无效记录")
     @Transactional(rollbackFor = Exception.class)
     public String updateInvalidRecord(InvalidRecord invalidRecord)throws IOException{

+ 1 - 1
RMS/src/main/java/cn/cslg/report/entity/InvalidRecord.java

@@ -49,7 +49,7 @@ public class InvalidRecord extends BaseEntity<InvalidRecord> {
      * 结果
      */
     @TableField(value = "RESULT")
-    private String result;
+    private String resultS;
 
     /**
      * 文件ID

+ 32 - 1
RMS/src/main/java/cn/cslg/report/service/business/AssoTaskPersonelService.java

@@ -1,32 +1,47 @@
 package cn.cslg.report.service.business;
 
 import cn.cslg.report.common.core.base.Constants;
+import cn.cslg.report.common.model.vo.PatentVO;
 import cn.cslg.report.common.utils.LogExceptionUtil;
 import cn.cslg.report.common.utils.Response;
 import cn.cslg.report.entity.SysDictItem;
 import cn.cslg.report.entity.asso.AssoTaskPersonel;
 import cn.cslg.report.mapper.AssoTaskPersonelMapper;
 import cn.cslg.report.mapper.SystemDictItemMapper;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import lombok.val;
+import okhttp3.MediaType;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.RequestBody;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
+import org.springframework.web.bind.annotation.RequestParam;
 
 import java.io.IOException;
 import java.sql.Wrapper;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 
 @Service
 @Slf4j
 @RequiredArgsConstructor(onConstructor_ = {@Lazy})
 public class AssoTaskPersonelService extends ServiceImpl<AssoTaskPersonelMapper, AssoTaskPersonel> {
-
+   public final  AssoTaskPersonelMapper assoTaskPersonelMapper ;
+    public static final MediaType JSON = MediaType.parse("application/json; charset=utf-8");
+    @Value("${PCSUrl}")
+    private String PCSUrl;
+    @Value("${PASUrl}")
+    private String PASUrl;
     public  void test(){}
     public String deleAssoTaskPersonel(Integer reportId) throws IOException{
         AssoTaskPersonel assoTaskPersonel =new AssoTaskPersonel();
@@ -35,6 +50,22 @@ public class AssoTaskPersonelService extends ServiceImpl<AssoTaskPersonelMapper,
          this.remove(wrappers);
         return Response.success();
     }
+    public String pagination(int personelId , int  state, int taskId,int location)throws IOException{
+        List<String> patentNumber = assoTaskPersonelMapper.getPatentNumber(personelId, state, taskId);
+   Map<String,Object> map =new HashMap<>();
+   map.put("patentNos",patentNumber);
+   map.put("startNumber",location);
+        JSONObject json = new JSONObject(map);
+           RequestBody requestBody =RequestBody.create(JSON,String.valueOf(json));
+//        @RequestParam("list") List<String> list,@RequestParam("n") int n,@RequestParam("p") int p
+        OkHttpClient okHttpClient = new OkHttpClient();
+        Request request = new Request.Builder()
+                .url(PASUrl + "/api/v2/system/getPagination")
+                .post(requestBody)
+                .build();
+        return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
+
+    }
 
 
 

+ 2 - 2
RMS/src/main/resources/application.yml

@@ -67,6 +67,6 @@ mybatis-plus:
     map-underscore-to-camel-case: true
     cache-enabled: false
   mapper-locations: classpath:mapper/*.xml
-PCSUrl: http://192.168.1.4:8880
-PASUrl: http://192.168.1.4:8879
+PCSUrl: http://192.168.1.17:8880
+PASUrl: http://192.168.1.17:8879
 

+ 1 - 1
RMS/src/main/resources/mapper/AssoTaskPersonelMapper.xml

@@ -4,7 +4,7 @@
 <!--     public List<String> getPatentNumber(@Param("personelId")int personelId ,@Param("state")int  state,@Param("taskId")int taskId);;-->
     <select id="getPatentNumber" resultType="String">
         select PATENT_NO as patentNo from ASSO_TASK_PERSONEL
-       where PERSON_ID={personelId} and STATE=#{state} and TASK_ID=#{taskId}
+       where PERSON_ID=#{personelId} and STATE=#{state} and TASK_ID=#{taskId}
     </select>
 
 </mapper>

+ 8 - 7
RMS/src/main/resources/mapper/InvalidRecord.xml

@@ -6,15 +6,16 @@
         delete from INVALID_RECORD where ID=#{id}
     </delete>
 <!--    int updateInvalidRecord(InvalidRecord invalidRecord);-->
-    <update id="updateInvalidRecord">
-        update INVALID_RECORD set(PATENT_NO,PERSON,PERSON_ID,INVALID_TIME,JUDGMENT_TIME,`RESULT`,FILE_ID,REPORT_ID)
-       values(#{patentNo},#{person},#{personId},#{invalidTime},#{judgmentTime},#{`result`},#{fileId},#{reportId})
+    <update id="updateInvalidRecord" parameterType="cn.cslg.report.entity.InvalidRecord">
+     update INVALID_RECORD set(PATENT_NO,PERSON,PERSON_ID,INVALID_TIME,JUDGMENT_TIME,RESULT,FILE_ID,REPORT_ID)
+
+        value (#{patentNo},#{person},#{personId},#{invalidTime},#{judgmentTime},#{resultS},#{fileId},#{reportId})
        where ID=#{id}
     </update>
 <!--    int addInvalidRecord(InvalidRecord invalidRecord);-->
-    <insert id="addInvalidRecord">
+    <insert id="addInvalidRecord" parameterType="cn.cslg.report.entity.InvalidRecord">
         insert into INVALID_RECORD(PATENT_NO,PERSON,PERSON_ID,INVALID_TIME,JUDGMENT_TIME,`RESULT`,FILE_ID,REPORT_ID)
-        values(#{patentNo},#{person},#{personId},#{invalidTime},#{judgmentTime},#{`result`},#{fileId},#{reportId})
+        values(#{patentNo},#{person},#{personId},#{invalidTime},#{judgmentTime},#{resultS},#{fileId},#{reportId})
     </insert>
     <select id="select" resultType="cn.cslg.report.entity.InvalidRecord">
         <bind name="n" value="(pageNO-1)pageSize"/>
@@ -35,8 +36,8 @@
             <if test="judgmentTime !='' and judgmentTime !=null">
                 and `JUDGMENT_TIME` like concat('%', #{judgmentTime}, '%')
             </if>
-            <if test="`result` !='' and `result` !=null">
-                and `RESULT` like concat('%', #{`result`}, '%')
+            <if test="resultS !='' and resultS !=null">
+                and `RESULT` like concat('%', #{resultS}, '%')
             </if>
             <if test="caseDetails !='' and caseDetails !=null">
                 and CASE_DETAILS like concat('%', #{caseDetails}, '%')

File diff suppressed because it is too large
+ 1825 - 0
logs/rms/rms-debug.2022-11-17.0.log


File diff suppressed because it is too large
+ 490 - 0
logs/rms/rms-info.2022-11-17.0.log