|
@@ -1,10 +1,12 @@
|
|
|
package com.malk.eastar.controller;
|
|
package com.malk.eastar.controller;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
+import com.malk.eastar.service.DDCoreClient;
|
|
|
import com.malk.server.common.McException;
|
|
import com.malk.server.common.McException;
|
|
|
import com.malk.server.common.McR;
|
|
import com.malk.server.common.McR;
|
|
|
import com.malk.service.dingtalk.DDClient;
|
|
import com.malk.service.dingtalk.DDClient;
|
|
|
import com.malk.service.dingtalk.DDClient_Report;
|
|
import com.malk.service.dingtalk.DDClient_Report;
|
|
|
|
|
+import com.malk.utils.UtilMap;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
@@ -22,9 +24,13 @@ public class EastarDdController {
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private DDClient_Report ddClientReport;
|
|
private DDClient_Report ddClientReport;
|
|
|
|
|
+
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private DDClient ddClient;
|
|
private DDClient ddClient;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private DDCoreClient ddCoreClient;
|
|
|
|
|
+
|
|
|
@PostMapping("/report/create")
|
|
@PostMapping("/report/create")
|
|
|
public McR createReport(@RequestBody JSONObject param){
|
|
public McR createReport(@RequestBody JSONObject param){
|
|
|
log.info("创建日志:{}",param);
|
|
log.info("创建日志:{}",param);
|
|
@@ -39,4 +45,43 @@ public class EastarDdController {
|
|
|
list);
|
|
list);
|
|
|
return McR.success(result);
|
|
return McR.success(result);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 根据unionId获取userId
|
|
|
|
|
+ * @param data
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+// @PostMapping("/getUserIdByUnionId")
|
|
|
|
|
+ McR getUserIdByUnionId(@RequestBody JSONObject data) {
|
|
|
|
|
+ log.info("根据unionId获取userId, {}", data);
|
|
|
|
|
+ McException.assertParamException_Null(data, "unionid");
|
|
|
|
|
+ String unionId = UtilMap.getString(data, "unionid");
|
|
|
|
|
+ try {
|
|
|
|
|
+ String userId = ddCoreClient.getUserIdByUnionId(unionId);
|
|
|
|
|
+ return McR.success(userId);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ return McR.error("400",e.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 根据userId获取unionId
|
|
|
|
|
+ * @param data
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+// @PostMapping("/getUnionIdByUserId")
|
|
|
|
|
+ McR getUnionIdByUserId(@RequestBody JSONObject data) {
|
|
|
|
|
+ log.info("根据userId获取unionId, {}", data);
|
|
|
|
|
+ McException.assertParamException_Null(data, "userid");
|
|
|
|
|
+ String userId = UtilMap.getString(data, "userid");
|
|
|
|
|
+ try {
|
|
|
|
|
+ String unionId = ddCoreClient.getUnionIdByUserId(userId);
|
|
|
|
|
+ return McR.success(unionId);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ return McR.error("400",e.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|