|
|
@@ -18,10 +18,13 @@ import com.cyksj.dto.CorpOauth2UserInfo;
|
|
|
import com.cyksj.dto.Result;
|
|
|
import com.cyksj.enums.GatewayResponse;
|
|
|
import com.cyksj.mapper.GroupsRelationExpiryRecordMapper;
|
|
|
-import com.cyksj.mapper.UserMapper;
|
|
|
+import com.cyksj.mapper.corp.CorpUserAuthMapper;
|
|
|
import com.cyksj.mapper.corp.CorpUserTagMapper;
|
|
|
import com.cyksj.model.dto.AuthRedirect;
|
|
|
-import com.cyksj.model.entity.*;
|
|
|
+import com.cyksj.model.entity.CorpCustomerAcquistionCallback;
|
|
|
+import com.cyksj.model.entity.CorpFollow;
|
|
|
+import com.cyksj.model.entity.CorpMsgFollowAssociation;
|
|
|
+import com.cyksj.model.entity.QyMsgContent;
|
|
|
import com.cyksj.model.manage.views.CorpQyMsgAuditChatView;
|
|
|
import com.cyksj.model.request.corp.CorpCommonReq;
|
|
|
import com.cyksj.model.views.CorpUserIntentionView;
|
|
|
@@ -78,7 +81,7 @@ public class WxCorpController {
|
|
|
|
|
|
private final CorpUserTagMapper corpUserTagMapper;
|
|
|
|
|
|
- private final UserMapper userMapper;
|
|
|
+ private final CorpUserAuthMapper corpUserAuthMapper;
|
|
|
|
|
|
private final static String CORP_UUID = "corp-uuid";
|
|
|
|
|
|
@@ -323,18 +326,17 @@ public class WxCorpController {
|
|
|
* @Param unionId 用户unionId
|
|
|
*/
|
|
|
@GetMapping("/acquistionLinkCallback")
|
|
|
- public Result<CorpCustomerAcquistionCallback> getAcquistionLinkCallback(Long userId) {
|
|
|
- MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap());
|
|
|
- if (userId != null) {
|
|
|
- User user = userMapper.selectById(userId);
|
|
|
- if (user != null && StrUtil.isNotBlank(user.getUnionid())) {
|
|
|
- builder.field(CorpCustomerAcquistionCallback::getUnionId, user.getUnionid());
|
|
|
- }
|
|
|
-
|
|
|
- CorpCustomerAcquistionCallback corpCustomerAcquistionCallback = beanSearcher.searchFirst(CorpCustomerAcquistionCallback.class, builder.build());
|
|
|
- return GatewayResponse.SUCCESS.newBuilder().toResult(corpCustomerAcquistionCallback);
|
|
|
+ public Result<CorpCustomerAcquistionCallback> getAcquistionLinkCallback(String externalUserId) {
|
|
|
+ if (StrUtil.isEmpty(externalUserId)) {
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
|
- return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
+ String unionId = corpUserAuthMapper.getUnionIdByExternalUserId(externalUserId);
|
|
|
+ if (StrUtil.isEmpty(unionId)) {
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
+ }
|
|
|
+ MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap()).field(CorpCustomerAcquistionCallback::getUnionId, unionId);
|
|
|
+ CorpCustomerAcquistionCallback corpCustomerAcquistionCallback = beanSearcher.searchFirst(CorpCustomerAcquistionCallback.class, builder.build());
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(corpCustomerAcquistionCallback);
|
|
|
}
|
|
|
|
|
|
/**
|