Browse Source

2022-10-08 18:04:00 分析系统提交代码

沈永艺 3 years ago
parent
commit
abbeccaa6f

+ 2 - 3
PAS/src/main/java/cn/cslg/pas/common/utils/SecurityUtils/SecurityUtils.java

@@ -1,6 +1,5 @@
 package cn.cslg.pas.common.utils.SecurityUtils;
 
-import cn.cslg.pas.common.utils.RedisUtil;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;
@@ -16,11 +15,11 @@ public class SecurityUtils {
     /**
      * 设置权限标识
      */
-    public  void startDataScope(String Function) {
+    public void startDataScope(String Function) {
         Map<String, Object> m = new HashMap<>();
         m.put("token", LoginUtils.getToken());
         m.put("loginId", loginUtils.getId());
-        m.put("functionId", "/workspace/project/check");
+        m.put("functionId", Function);
         threadLocal.set(m);
     }
 

+ 1 - 1
PAS/src/main/java/cn/cslg/pas/service/ClientService.java

@@ -78,7 +78,7 @@ public class ClientService extends ServiceImpl<ClientMapper, Client> {
         return this.getOne(queryWrapper);
     }
 
-    public List<Client> getClientBytenant(Integer tenantId) {
+    public List<Client> getClientByTenant(Integer tenantId) {
         LambdaQueryWrapper<Client> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.eq(Client::getTenantId, tenantId);
         return this.list(queryWrapper);

+ 0 - 2
PAS/src/main/java/cn/cslg/pas/service/ProjectService.java

@@ -97,7 +97,6 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
     private final ProjectExportService projectExportService;
     private final PatentInventorMergeService patentInventorMergeService;
     private final UserService userService;
-    private final ApiUtils apiUtils;
     private final LoginUtils loginUtils;
     private final SecurityUtils securityUtils;
     private final RequestService requestService;
@@ -125,7 +124,6 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
 
         try {
             //获取所属部门对应信息
-
             String jsonObject = requestService.getDepartmentFromPCS(dataList);
             JSONArray jsonArray1 = JSON.parseArray(jsonObject);
             List<ProjectVO.Department> departmentList = jsonArray1.toJavaList(ProjectVO.Department.class);

+ 5 - 1
PAS/src/main/java/cn/cslg/pas/service/RequestService.java

@@ -17,6 +17,10 @@ import java.io.IOException;
 import java.util.*;
 import java.util.stream.Collectors;
 
+/**
+ * @author 李仁杰
+ * @description 调用外部接口的Service类
+ */
 @Service
 @RequiredArgsConstructor(onConstructor_ = {@Lazy})
 public class RequestService {
@@ -75,7 +79,7 @@ public class RequestService {
         //设定formData类型参数
         Project project = projectService.getProjectById(params.getProjectId());
         int tentId = project.getTenantId();
-        List<Client> clients = clientService.getClientBytenant(tentId);
+        List<Client> clients = clientService.getClientByTenant(tentId);
         List<String> tenantNames = new ArrayList<>();
         clients.forEach(item -> tenantNames.add(item.getName()));
         String names = JSON.toJSONString(tenantNames);