lwhhszx 2 年 前
コミット
54d3191082

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

@@ -28,12 +28,9 @@ import java.util.List;
 @RestController
 @RequestMapping(Constants.REPORT_API + "/report")
 @RequiredArgsConstructor(onConstructor_ = {@Lazy})
-@SuppressWarnings({"all"})
 public class ReportController {
     private final ReportService reportService;
     private final ReportReferencesService reportReferencesService;
-
-
     /**
      * @param report 报告类
      * @author 沈永艺
@@ -100,16 +97,17 @@ public class ReportController {
     }
     @PostMapping(value = "selectfile")
     @Operation(summary = "文件查询")
-
     public String queryLitigationHistory(@RequestBody ReportReferences reportReferences)throws IOException{
             return reportReferencesService.queryReportReferences(reportReferences);
 
     }
+
     @GetMapping("/deletefile")
     @Operation(summary = "删除文件")
     public String deleFile(int id)throws IOException{
         return reportReferencesService.delete(id);
     }
+
     @PostMapping(value = "updatefiles")
     @Operation(summary = "文件修改")
     @Transactional(rollbackFor = Exception.class)
@@ -121,6 +119,7 @@ public class ReportController {
         }
         return Response.error();
     }
+
     @GetMapping(value = "updateStatus")
     @Operation(summary = "修改报告状态")
     @Transactional(rollbackFor = Exception.class)

+ 14 - 11
RMS/src/main/java/cn/cslg/report/controller/TaskController.java

@@ -32,6 +32,12 @@ public class TaskController {
     private final BaseService baseService;
     private final ImportTaskService importTaskService;
 
+    @RequestMapping(value = "/addTask", method = RequestMethod.POST)
+    @Operation(summary = "新增审核任务")
+    public String addTask( String taskVO,List<MultipartFile> files) throws ParseException, IOException {
+        return taskService.addTask(taskVO,files);
+    }
+
     @RequestMapping(value = "/deleteTask", method = RequestMethod.POST)
     @Operation(summary = "删除任务")
     public String deleteTask(Integer id) {
@@ -56,12 +62,6 @@ public class TaskController {
         return taskService.getAllTask();
     }
 
-    @RequestMapping(value = "/addTask", method = RequestMethod.POST)
-    @Operation(summary = "新增审核任务")
-    @checkAuth(FunId = "/pcs/report/add")
-    public String addTask( String taskVO,List<MultipartFile> files) throws ParseException, IOException {
-        return taskService.addTask(taskVO,files);
-    }
 
     @RequestMapping(value = "/auditTask", method = RequestMethod.POST)
     @Operation(summary = "审核任务")
@@ -86,6 +86,7 @@ public class TaskController {
     public String reTaskStateCount(Integer reportId,Integer taskId) throws ParseException, IOException {
         return Response.success(taskService.reTaskStateCount(reportId,taskId));
     }
+
     @RequestMapping(value = "/import", method = RequestMethod.POST)
     @Operation(summary = "导入")
     public String importPatent(MultipartFile file, Integer reportId) throws ParseException, IOException {
@@ -111,32 +112,34 @@ public class TaskController {
 
         return importTaskService.reImportTask(importTask);
     }
+
     @RequestMapping(value = "/finish", method = RequestMethod.GET)
     @Operation(summary = "完成任务")
-    private String finish(Integer id) throws IOException {
+    public String finish(Integer id) throws IOException {
         return taskService.finishTask(id);
     }
+
     @RequestMapping(value = "/reviewTheTasks", method = RequestMethod.POST)
     @Operation(summary = "查看任务")
-    private String ReviewTheTasks(@RequestBody TaskTDO taskVO) throws IOException {
+    public String ReviewTheTasks(@RequestBody TaskTDO taskVO) throws IOException {
         return taskService.ReviewTheTasks(taskVO) ;
     }
 
     @RequestMapping(value = "/progress", method = RequestMethod.GET)
     @Operation(summary = "任务进度")
-    private String progress(int id){
+    public String progress(int id){
         return Response.success (taskService.reCount(id));
     }
 
     @RequestMapping(value = "/read", method = RequestMethod.GET)
     @Operation(summary = "未读变成已读")
-    private String read(int taskID,String patentNo ,Integer reportId){
+    public String read(int taskID,String patentNo ,Integer reportId){
         return taskService.read(taskID,patentNo, reportId);
     }
 
     @RequestMapping(value = "/look", method = RequestMethod.GET)
     @Operation(summary = "查看某个专利的状态")
-    private String look(int taskID,String patentNo,Integer reportId){
+    public String look(int taskID,String patentNo,Integer reportId){
         return taskService.look(taskID,patentNo,reportId);
     }
 

+ 7 - 0
RMS/src/main/java/cn/cslg/report/service/BaseService.java

@@ -13,8 +13,10 @@ import cn.cslg.report.entity.Task;
 import cn.cslg.report.service.business.ImportTaskService;
 import cn.hutool.core.collection.IterUtil;
 import cn.hutool.poi.excel.ExcelUtil;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import io.swagger.v3.oas.models.security.SecurityScheme;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
@@ -244,6 +246,11 @@ public class BaseService {
         }
     }
 
+    /**
+     * @return 根据登录人ID获得负责不能Id
+     * @
+     * @author lrj
+     */
     //获得
     public ImportTask getImportPatentTaskParamsBro(MultipartFile file,Integer reportId) throws IOException {
         Integer type =0;

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

@@ -11,6 +11,7 @@ import cn.cslg.report.entity.ImportTask;
 import cn.cslg.report.entity.Report;
 import cn.cslg.report.service.business.ImportTaskService;
 import cn.cslg.report.service.business.ReportService;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.google.gson.Gson;
@@ -545,4 +546,17 @@ public class OutInterfaceService {
 
         return  Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
     }
+    public List<Integer> getDutyDepartsFromPCS(Integer personId) throws IOException {
+        OkHttpClient okHttpClient = new OkHttpClient();
+        Request request = new Request.Builder()
+                .url(PCSUrl + "/permission/api/system/getDutyDeparts?personId="+personId)
+                .get()
+                .build();
+String resBody =okHttpClient.newCall(request).execute().body().string();
+
+        List<Integer> ids = JSONArray.parseArray(resBody,Integer.class);
+        return  ids;
+
+    }
+
 }

+ 10 - 2
RMS/src/main/java/cn/cslg/report/service/business/ReportService.java

@@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.models.security.SecurityScheme;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 
@@ -63,6 +64,7 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
     private final InvalidRecordService invalidRecordService;
     private  final ReportDocumentService reportDocumentService;
     private final ReportReferencesService reportReferencesService;
+
     /**
      * @param report 报告类
      * @author 沈永艺
@@ -111,6 +113,8 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
     @Transactional(rollbackFor = Exception.class)
     //查询报告
     public String queryReport(ReportVO reportVO) throws IOException {
+        Integer id =loginUtils.getId();
+         List<Integer> departIds =outInterfaceService.getDutyDepartsFromPCS(id);
         LambdaQueryWrapper<Report> queryWrapper = new LambdaQueryWrapper<>();
         if (reportVO.getName() != null && reportVO.getName() != "") {
             queryWrapper.like(Report::getName, reportVO.getName());
@@ -121,11 +125,15 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
         if (reportVO.getSignPatentNo() != null && reportVO.getSignPatentNo() != "") {
             queryWrapper.like(Report::getSignPatentNo, reportVO.getSignPatentNo());
         }
+
         //分页
         if (reportVO.getSize() != null && reportVO.getCurrent() != null) {
             queryWrapper.and(QueryWrapper -> {
-                QueryWrapper.eq(Report::getCreatePersonId, loginUtils.getId())
-                        .or().eq(Report::getPersonId, loginUtils.getId());
+                QueryWrapper.eq(Report::getCreatePersonId, id)
+                        .or().eq(Report::getPersonId, id);
+                if(departIds.size()!=0){
+                    QueryWrapper.or().in(Report::getDepartmentId,departIds);
+                }
             });
             queryWrapper.orderByDesc(Report::getId);
             List<Report> reports = this.page(new Page<>(reportVO.getCurrent(), reportVO.getSize()), queryWrapper).getRecords();

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

@@ -50,18 +50,18 @@ import java.util.stream.Collectors;
 @RequiredArgsConstructor(onConstructor_ = {@Lazy})
 @SuppressWarnings({"all"})
 public class TaskService extends ServiceImpl<TaskMapper, Task> {
-    private final ReportService reportService;
-    private final OutInterfaceService outInterfaceService;
-    private final CacheUtils cacheUtils;
-    private final CompareFilesService compareFilesService;
-    private final AssoTaskPersonelService assoTaskPersonelService;
-    private final ReportFieldService reportFieldService;
-    private final MessageUtils mailUtils;
-    private final LoginUtils loginUtils;
-    private final SyneryCCService syneryCCService;
-    private final CompareRecordsService compareRecordsService;
-    private final CompareMessageService compareMessageService;
-    private final SyneryCodeService syneryCodeService;
+    public final ReportService reportService;
+    public final OutInterfaceService outInterfaceService;
+    public final CacheUtils cacheUtils;
+    public final CompareFilesService compareFilesService;
+    public final AssoTaskPersonelService assoTaskPersonelService;
+    public final ReportFieldService reportFieldService;
+    public final MessageUtils mailUtils;
+    public final LoginUtils loginUtils;
+    public final SyneryCCService syneryCCService;
+    public final CompareRecordsService compareRecordsService;
+    public final CompareMessageService compareMessageService;
+    public final SyneryCodeService syneryCodeService;
 
 
     /**