|
|
@@ -30,6 +30,7 @@ import com.cyksj.mapper.station.CollegeStudentStationUserRelateMapper;
|
|
|
import com.cyksj.mapper.vip.VipUserMapper;
|
|
|
import com.cyksj.model.dto.*;
|
|
|
import com.cyksj.model.entity.*;
|
|
|
+import com.cyksj.model.manage.views.GroupsRelationView;
|
|
|
import com.cyksj.model.request.LoginReq;
|
|
|
import com.cyksj.model.views.*;
|
|
|
import com.cyksj.redis.RedisService;
|
|
|
@@ -251,14 +252,14 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public UserWhoami whoami(long userId) {
|
|
|
- User user = this.getById(userId);
|
|
|
- Assert.notNull(user, "业务处理失败,请联系客服");
|
|
|
- UserWhoami userWhoami = new UserWhoami();
|
|
|
- if (StrUtil.isEmpty(user.getShowId())) {
|
|
|
- user.setShowId(userCommonService.getUserShowId(userId));
|
|
|
- }
|
|
|
- BeanUtil.copyProperties(user, userWhoami);
|
|
|
+ public UserWhoami whoami(long userId, Boolean ccCode) {
|
|
|
+ User user = this.getById(userId);
|
|
|
+ Assert.notNull(user, "业务处理失败,请联系客服");
|
|
|
+ UserWhoami userWhoami = new UserWhoami();
|
|
|
+ if (StrUtil.isEmpty(user.getShowId())) {
|
|
|
+ user.setShowId(userCommonService.getUserShowId(userId));
|
|
|
+ }
|
|
|
+ BeanUtil.copyProperties(user, userWhoami);
|
|
|
|
|
|
UserBindDetail bindPhone = userBindDetailMapper.selectOne(Wrappers.lambdaQuery(UserBindDetail.class)
|
|
|
.eq(StrUtil.isNotEmpty(user.getUnionid()), UserBindDetail::getUserId, userId)
|
|
|
@@ -269,13 +270,13 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
userWhoami.setBindPhone(bindPhone.getPhone());
|
|
|
userWhoami.setBindEmail(bindPhone.getEmail());
|
|
|
}
|
|
|
- Integer type = 3;
|
|
|
- if (StrUtil.isNotBlank(user.getLoginPhone())) {
|
|
|
- type = 1;
|
|
|
- } else if (StrUtil.isNotBlank(user.getEmail())) {
|
|
|
- type = 2;
|
|
|
- }
|
|
|
- userWhoami.setType(type);
|
|
|
+ Integer type = 3;
|
|
|
+ if (StrUtil.isNotBlank(user.getLoginPhone())) {
|
|
|
+ type = 1;
|
|
|
+ } else if (StrUtil.isNotBlank(user.getEmail())) {
|
|
|
+ type = 2;
|
|
|
+ }
|
|
|
+ userWhoami.setType(type);
|
|
|
//是否加过企业微信
|
|
|
String unionId = user.getUnionid();
|
|
|
if (StrUtil.isEmpty(unionId)) {
|
|
|
@@ -304,8 +305,12 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
.in(OrderDon::getUserId, userIdList)
|
|
|
.notIn(OrderDon::getStatus, Constant.noOrderStatus));
|
|
|
userWhoami.setIsPay(selectCount > 0);
|
|
|
+ if (ccCode != null) {
|
|
|
+ Number number = beanSearcher.searchCount(GroupsRelationView.class, MapUtils.builder().field(GroupsRelationView::getUserId, userId).field(GroupsRelationView::getAqType, 2).field(GroupsRelationView::getGoodsId, Constant.CLAUDE_CODE_GOODS_ID).build());
|
|
|
+ userWhoami.setCcCode(number.intValue() > 0);
|
|
|
+ }
|
|
|
return userWhoami;
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
public User getSyncUser(String openId, String unionId, WxSyncLog wxSyncLog) {
|
|
|
@@ -593,7 +598,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
if (!claudeCodeService.checkClaudeCodeUser(user.getId())) {
|
|
|
//发送claude code 体验卡
|
|
|
groupRelationFrontService.getTrialTicketByUserIdAndGoodsId(user.getId(), Constant.DISTRIBUTE_CLAUDE_CODE_TRIAL_SKU_ID, 2);
|
|
|
- user.setCcCode(Boolean.TRUE);
|
|
|
}
|
|
|
}
|
|
|
} else {
|