|
@@ -4,13 +4,9 @@ package com.malk.ruisi.controller;
|
|
|
* 错误抛出与拦截详见 CatchException
|
|
|
*/
|
|
|
|
|
|
-import com.malk.server.aliwork.YDConf;
|
|
|
+import com.malk.ruisi.service.RSService;
|
|
|
+import com.malk.server.common.McException;
|
|
|
import com.malk.server.common.McR;
|
|
|
-import com.malk.service.aliwork.YDClient;
|
|
|
-import com.malk.service.aliwork.YDService;
|
|
|
-import com.malk.service.dingtalk.DDClient;
|
|
|
-import com.malk.service.dingtalk.DDClient_Contacts;
|
|
|
-import com.malk.utils.UtilMap;
|
|
|
import com.malk.utils.UtilServlet;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -19,7 +15,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
-import java.util.Arrays;
|
|
|
import java.util.Map;
|
|
|
|
|
|
@Slf4j
|
|
@@ -28,42 +23,16 @@ import java.util.Map;
|
|
|
public class CosController {
|
|
|
|
|
|
@Autowired
|
|
|
- private YDService ydService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private YDClient ydClient;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private YDConf ydConf;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private DDClient_Contacts ddClient_contacts;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private DDClient ddClient;
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 创建企业账号: loginI/userId 都为 SHR 工号
|
|
|
- */
|
|
|
- private void createExclusiveUser(String loginId, String name) {
|
|
|
-
|
|
|
- final long DEPT_ID = 965111354L;
|
|
|
- final String PASS_WORD = "tzr@111111";
|
|
|
-
|
|
|
- Map info = UtilMap.map("userid, email", loginId, "pruple_boy@163.com");
|
|
|
- ddClient_contacts.createUser_dingTalk(ddClient.getAccessToken(), loginId, PASS_WORD, name, Arrays.asList(DEPT_ID), info);
|
|
|
- }
|
|
|
+ private RSService rsService;
|
|
|
|
|
|
/**
|
|
|
* 创建投资人用户
|
|
|
*/
|
|
|
- @PostMapping("user")
|
|
|
- McR user(HttpServletRequest request) {
|
|
|
- Map data = UtilServlet.getParamMap(request);
|
|
|
- log.info("user, {}", data);
|
|
|
-
|
|
|
- createExclusiveUser(UtilMap.getString(data, "jobNo"), UtilMap.getString(data, "name"));
|
|
|
+ @PostMapping("user/sync")
|
|
|
+ McR syncUser() {
|
|
|
+
|
|
|
+ log.info("syncUser");
|
|
|
+ rsService.syncDingTalk_exclusive();
|
|
|
return McR.success();
|
|
|
}
|
|
|
|
|
@@ -71,13 +40,13 @@ public class CosController {
|
|
|
* 重置密码流程
|
|
|
*/
|
|
|
@PostMapping("reset")
|
|
|
- McR dept(HttpServletRequest request) {
|
|
|
+ McR resetPwd(HttpServletRequest request) {
|
|
|
|
|
|
Map data = UtilServlet.getParamMap(request);
|
|
|
log.info("reset, {}", data);
|
|
|
|
|
|
-// ddClient_contacts.updateUser_dingTalk(ddClient.getAccessToken(), userId, deptIds, UtilMap.map("dept_title_list", titles));
|
|
|
-
|
|
|
+ McException.assertParamException_Null(data, "userId", "password");
|
|
|
+ rsService.resetPwd(data);
|
|
|
return McR.success();
|
|
|
}
|
|
|
|