chenyi преди 2 години
родител
ревизия
db680813ac

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

@@ -36,7 +36,7 @@ public class PatentVO extends BaseVO {
     @Schema(description = "当前专利位置")
     private Integer locPosition;
 
-    @Schema(description = "任务状态 0未完成 1已完成")
+    @Schema(description = "任务状态 0未完成 1已完成,3全部")
     private Integer taskStatus;
 
     @Schema(description = "任务Id")

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

@@ -55,8 +55,8 @@ public class TaskVO extends BaseVO {
 
     @Schema(description = "登录人在任务中的身份 0创建人 1处理人")
     private Integer roleInTask;
-@Schema(description = "人员专题号对象列表")
-private List<personPatents> personPatents;
+   @Schema(description = "人员专题号对象列表")
+  private List<personPatents> personPatents;
 
     @Schema(description = "人员专题号对象")
     @Data

+ 6 - 0
RMS/src/main/java/cn/cslg/report/controller/TaskController.java

@@ -111,5 +111,11 @@ public class TaskController {
 
         return importTaskService.reImportTask(importTask);
     }
+    @RequestMapping(value = "/finish", method = RequestMethod.GET)
+    @Operation(summary = "完成任务")
+    private String finish(Integer id){
+        return taskService.finishTask(id);
+    }
+
 
 }

+ 83 - 11
RMS/src/main/java/cn/cslg/report/service/business/AssoTaskPersonelService.java

@@ -1,6 +1,7 @@
 package cn.cslg.report.service.business;
 
 
+import cn.cslg.report.common.model.delete.Patents;
 import cn.cslg.report.common.model.vo.PatentVO;
 import cn.cslg.report.common.utils.Response;
 
@@ -17,9 +18,6 @@ import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 
 import okhttp3.MediaType;
-import okhttp3.OkHttpClient;
-import okhttp3.Request;
-import okhttp3.RequestBody;
 
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Lazy;
@@ -43,6 +41,9 @@ public class AssoTaskPersonelService extends ServiceImpl<AssoTaskPersonelMapper,
     private String PCSUrl;
     @Value("${PASUrl}")
     private String PASUrl;
+
+
+
     public  void test(){}
 
     /**
@@ -64,13 +65,12 @@ public class AssoTaskPersonelService extends ServiceImpl<AssoTaskPersonelMapper,
      * @param state 状态 1已读 0 未读 3 全部
      * @param taskId 任务id
      * @param location 该条专利位置
-     * @return  专利号
      * @throws IOException
      */
     public String pagination(PatentVO patentVO)throws IOException {
         Map<String, Object> map = new HashMap<>();
         List<String> patentNumber = new ArrayList<>();
-        if (patentVO.getState() == 3) {
+        if (patentVO.getTaskStatus().equals(3)) {
             //3类型包括1和2
             LambdaQueryWrapper<AssoTaskPersonel> wrappers = new LambdaQueryWrapper();
             wrappers.eq(AssoTaskPersonel::getTaskId, patentVO.getTaskId());
@@ -88,6 +88,7 @@ public class AssoTaskPersonelService extends ServiceImpl<AssoTaskPersonelMapper,
 
         patentVO.setPatentNos(patentNumber);
 
+
         if (patentVO.getLocPosition() <= 1) {
             patentVO.setStartNumber(0);
             patentVO.setEndNumber(1);
@@ -95,7 +96,39 @@ public class AssoTaskPersonelService extends ServiceImpl<AssoTaskPersonelMapper,
             JSONObject jsonObject = JSONObject.parseObject(res);
             JSONObject jsonObject1 = JSONObject.parseObject(jsonObject.get("data").toString());
             List<JSONObject> jsonObjects = JSONArray.parseArray(jsonObject1.get("records").toString(), JSONObject.class);
+           List<Patents> list= new ArrayList<>();
+           for(JSONObject obj:jsonObjects){
+
+               Patents patent = obj.toJavaObject(obj, Patents.class);
+               list.add(patent);
+
+           }
+
+           if(list.size()==1){
+               map.put("currentID", list.get(0).getId());
+               map.put("behindID",null);
+               map.put("frontID", null);
+               map.put("totalNumber" , list.size());
+               map.put("frontPatentNo",null);
+               map.put("currentPatentNo",list.get(0).getPatentNo());
+               map.put("behindPatentNo",null);
+               map.put("frontNumber",0);
+               map.put("behindNumber",0);
+            return Response.success(map);
+
+           }
             jsonObject1.put("type", "first");
+            map.put("currentID", list.get(0).getId());
+            map.put("behindID",list.get(1).getId());
+            map.put("frontID", null);
+            map.put("totalNumber" , list.size());
+            map.put("frontNumber",0);
+            map.put("behindNumber",list.size()-1);
+            map.put("location",1);
+            map.put("frontPatentNo",null);
+            map.put("currentPatentNo",list.get(0).getPatentNo());
+            map.put("behindPatentNo",list.get(1).getPatentNo());
+            return  Response.success(map);
         } else {
             patentVO.setStartNumber(patentVO.getLocPosition() - 2);
             patentVO.setEndNumber(patentVO.getLocPosition());
@@ -103,15 +136,54 @@ public class AssoTaskPersonelService extends ServiceImpl<AssoTaskPersonelMapper,
             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) {
+            List<Patents> list= new ArrayList<>();
+            for(JSONObject obj:jsonObjects){
+                Patents patent = obj.toJavaObject(obj, Patents.class);
+                list.add(patent);
+
+            }
 
-                jsonObject1.put("type", "end");
+            if(list.size()==1){
+                map.put("currentID", list.get(0).getId());
+                map.put("behindID",null);
+                map.put("frontID", null);
+                map.put("totalNumber" , list.size());
+                map.put("frontPatentNo",null);
+                map.put("currentPatentNo",list.get(0).getPatentNo());
+                map.put("behindPatentNo",null);
+                map.put("frontNumber",0);
+                map.put("behindNumber",0);
+                return  Response.success(map);
 
-            } else {
-                jsonObject1.put("type", "normal");
             }
-            return  "11";
+            if(patentVO.getLocPosition()>=list.size()) {
+                map.put("currentID", list.get(list.size()-1).getId());
+                map.put("behindID",null);
+                map.put("frontID",list.get(list.size()-2).getId());
+                map.put("totalNumber" , list.size());
+                map.put("frontNumber",list.size()-1);
+                map.put("behindNumber",0);
+                map.put("location",list.size());
+                map.put("frontPatentNo",list.get(list.size()-2).getPatentNo());
+                map.put("currentPatentNo",list.get(list.size()-1).getPatentNo());
+                map.put("behindPatentNo",null);
+                return  Response.success(map);
+            }
+            map.put("currentID", list.get(patentVO.getLocPosition()-1).getId());
+            map.put("behindID",list.get(patentVO.getLocPosition()).getId());
+            map.put("frontID",list.get(patentVO.getLocPosition()-2).getId());
+            map.put("totalNumber" , list.size());
+            map.put("frontNumber",patentVO.getLocPosition()-1);
+            map.put("behindNumber", list.size()-patentVO.getLocPosition());
+            map.put("location",patentVO.getLocPosition());
+            map.put("frontPatentNo",list.get(patentVO.getLocPosition()-2).getPatentNo());
+            map.put("currentPatentNo",list.get(patentVO.getLocPosition()-1).getPatentNo());
+            map.put("behindPatentNo",list.get(patentVO.getLocPosition()).getPatentNo());
+            return  Response.success(map);
+
+
         }
 
-        return  "11"; }
+
+    }
 }

+ 26 - 0
RMS/src/main/java/cn/cslg/report/service/business/TaskService.java

@@ -400,4 +400,30 @@ public class TaskService extends ServiceImpl<TaskMapper, Task> {
         reMap.put("read", assoRead.size());
         return reMap;
     }
+    /**
+     * @function :改变任务的状态
+     * @param : 任务的id
+     * @return: 是否改变成功
+     * @author :cj
+     */
+    @Transactional
+    public String finishTask(Integer id){
+        LambdaQueryWrapper<Task> queryWrapper = new LambdaQueryWrapper<>();
+            queryWrapper.eq(Task::getId,id);
+        List<Task> list = this.list(queryWrapper);
+        Task task = list.get(0);
+        //1为已完成
+        Date now = new Date();
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        simpleDateFormat.format(now);
+        task.setFinishTime(now);
+        task.setTaskStatus(1);
+        task.setResult(1);
+        task.updateById();
+        return Response.success();
+
+
+
+    }
+
 }

Файловите разлики са ограничени, защото са твърде много
+ 0 - 9329
logs/rms/rms-debug.2022-12-06.0.log


Файловите разлики са ограничени, защото са твърде много
+ 5522 - 0
logs/rms/rms-debug.2022-12-13.0.log


Файловите разлики са ограничени, защото са твърде много
+ 0 - 723
logs/rms/rms-info.2022-12-06.0.log


Файловите разлики са ограничени, защото са твърде много
+ 325 - 0
logs/rms/rms-info.2022-12-13.0.log