Zimo 3 сар өмнө
parent
commit
086e035c7c

+ 4 - 2
yudao-server/src/main/java/cn/iocoder/yudao/server/controller/admin/TodoController.java

@@ -71,6 +71,8 @@ public class TodoController {
     private RestTemplate restTemplate;
     @Value("${oa.ssoUrl}")
     private String ssoUrl;
+    @Value("${crm.refresh}")
+    private String refresh;
     @Autowired
     private PasswordEncoder passwordEncoder;
 
@@ -121,7 +123,7 @@ public class TodoController {
     @GetMapping("/crm")
     @PermitAll
     public CommonResult<ImmutableMap<String, Object>> crmTodo(String workcode, String type, Integer pageNo, Integer pageSize) throws Exception {
-        ImmutableMap<String, String> stringStringImmutableMap = crmRest.refreshToken("029ae19f-423f-4d3f-9805-bd6c0a3a4b36");
+        ImmutableMap<String, String> stringStringImmutableMap = crmRest.refreshToken(refresh);
         AdminUserRespDTO userByUsername = adminUserApi.getUserByUsername(workcode);
         if (userByUsername == null) {throw new ServiceException(new ErrorCode(1,"门户系统中不存在该用户"));}
 
@@ -159,7 +161,7 @@ public class TodoController {
         if (CollUtil.isNotEmpty(workCode)) {
             return CommonResult.success(workCode);
         } else {
-            ImmutableMap<String, String> stringStringImmutableMap = crmRest.refreshToken("029ae19f-423f-4d3f-9805-bd6c0a3a4b36");
+            ImmutableMap<String, String> stringStringImmutableMap = crmRest.refreshToken(refresh);
             AdminUserRespDTO userByUsername = adminUserApi.getUserByUsername(workcode);
             if (userByUsername == null) {throw new ServiceException(new ErrorCode(1,"门户系统中不存在该用户"));}
 

+ 4 - 1
yudao-server/src/main/java/cn/iocoder/yudao/server/job/CrmPersonJob.java

@@ -4,12 +4,15 @@ import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission;
 import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
 import cn.iocoder.yudao.server.rest.CrmRest;
 import com.google.common.collect.ImmutableMap;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
 @Component
 public class CrmPersonJob {
     private final CrmRest crmRest;
+    @Value("${crm.refresh}")
+    private String refresh;
 
     public CrmPersonJob(CrmRest crmRest) {
         this.crmRest = crmRest;
@@ -19,7 +22,7 @@ public class CrmPersonJob {
     @TenantIgnore
     @DataPermission(enable = false)
     public String executeCrmPerson() throws Exception {
-        ImmutableMap<String, String> stringStringImmutableMap = crmRest.refreshToken("029ae19f-423f-4d3f-9805-bd6c0a3a4b36");
+        ImmutableMap<String, String> stringStringImmutableMap = crmRest.refreshToken(refresh);
         crmRest.querySqlUserJob(String.valueOf(stringStringImmutableMap.get("access")));
         return "";
     }

+ 4 - 2
yudao-server/src/main/resources/application-dev.yaml

@@ -261,7 +261,8 @@ oa:
   outMaintain: https://yfoa.keruioil.com/api/workflow/paService/doCreateRequest
   companyUrl: https://yfoa.keruioil.com/api/hrm/resful/getHrmsubcompanyWithPage
   departmentUrl: https://yfoa.keruioil.com/api/hrm/resful/getHrmdepartmentWithPage
-  userUrl: https://yfoa.keruioil.com/api/hrm/resful/getHrmUserInfoWithPage
+  userUrl: https://yfoa.keruioil.com/api/hrm/info/getResourceInfo
+  ssoUrl: https://yfoa.keruioil.com/api/sso/token/getSSOToken
   workflowId: "640"
   requestName: "设备委外维修申请流程"
   appid: TW
@@ -292,7 +293,8 @@ ehr:
 pms:
   secret: cc99d802-ce5c-5f62-b037-9a00726e7109
   ssoToken: https://iot.deepoil.cc/admin-api/system/auth/ssoLogin/getToken
-
+crm:
+  refresh: 7e8a8825-73f8-468a-86fc-6ff348e1f6b7
 zentao:
   code: Deep0ilPortal
   secret: fff507e4daffa4e8d8519109d21a138f