|
|
@@ -9,6 +9,7 @@ import com.hotent.base.jwt.JwtAuthenticationResponse;
|
|
|
import com.hotent.base.jwt.JwtTokenHandler;
|
|
|
import com.hotent.base.model.CommonResult;
|
|
|
import com.hotent.base.util.*;
|
|
|
+import com.hotent.pricing.common.MyAsyncExecutor;
|
|
|
import com.hotent.pricing.manager.DataMiddlePlatformManager;
|
|
|
import com.hotent.uc.api.model.IUser;
|
|
|
import com.hotent.uc.manager.OrgManager;
|
|
|
@@ -80,6 +81,8 @@ public class DataMiddlePlatformManagerImpl implements DataMiddlePlatformManager
|
|
|
@Value("${oauth2.front.redirect-uri:}")
|
|
|
private String frontRedirectUri;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private MyAsyncExecutor myAsyncExecutor;
|
|
|
|
|
|
@Autowired
|
|
|
private OrgManager orgManager;
|
|
|
@@ -126,6 +129,7 @@ public class DataMiddlePlatformManagerImpl implements DataMiddlePlatformManager
|
|
|
UserVo userVo = new UserVo();
|
|
|
BeanUtils.copyProperties(u, userVo);
|
|
|
userVo.setOrgId(u.getDeptId());
|
|
|
+ userVo.setId(u.getId());
|
|
|
return userVo;
|
|
|
}).collect(Collectors.toList());
|
|
|
userService.addUsers(userVos);
|
|
|
@@ -238,6 +242,28 @@ public class DataMiddlePlatformManagerImpl implements DataMiddlePlatformManager
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 异步推送消息通知
|
|
|
+ * @param subject 标题
|
|
|
+ * @param description 简介
|
|
|
+ * @param content 内容
|
|
|
+ * @param receiverId 接收人id(中台用户id)
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public String sendMsg(String subject, String description, String content, String receiverId) {
|
|
|
+
|
|
|
+ // 将同步调用改为异步执行
|
|
|
+ myAsyncExecutor.execute(() -> {
|
|
|
+ String openApiToken = OAuth2ToMethod.getOpenApiToken("");
|
|
|
+ com.integration.oauth2.sdk.response.CommonResult result = OAuth2ToMethod.sendMsg(openApiToken, subject, description, content, receiverId);
|
|
|
+ System.out.println("消息id: " + result.getValue().toString());
|
|
|
+ });
|
|
|
+
|
|
|
+ // 立即返回,不等待消息发送完成
|
|
|
+ return "消息发送任务已提交";
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public ResponseEntity<?> ssoForFront(String code) {
|
|
|
if (StringUtil.isEmpty(code)) {
|