|
|
@@ -28,6 +28,7 @@ import com.cyksj.mapper.station.CollegeStudentStationUserRelateMapper;
|
|
|
import com.cyksj.model.dto.*;
|
|
|
import com.cyksj.model.entity.*;
|
|
|
import com.cyksj.model.request.LoginReq;
|
|
|
+import com.cyksj.model.views.CorpUserFollowView;
|
|
|
import com.cyksj.model.views.RenewalView;
|
|
|
import com.cyksj.model.views.UserCertInfoView;
|
|
|
import com.cyksj.model.views.UserTicketView;
|
|
|
@@ -135,6 +136,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
|
|
|
private final UserStudentCertRecordMapper userStudentCertRecordMapper;
|
|
|
|
|
|
+ private final OrderDonMapper orderDonMapper;
|
|
|
+
|
|
|
private static final GlobalThreadPoolTaskExecutor TASK_POOL = GlobalThreadPoolTaskExecutor.getInstance();
|
|
|
|
|
|
@Override
|
|
|
@@ -265,7 +268,34 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
type = 2;
|
|
|
}
|
|
|
userWhoami.setType(type);
|
|
|
-
|
|
|
+ //是否加过企业微信
|
|
|
+ String unionId = user.getUnionid();
|
|
|
+ if (StrUtil.isEmpty(unionId)) {
|
|
|
+ //获取绑定的微信用户id
|
|
|
+ UserBindDetail bindDetail = userBindDetailMapper.selectOne(Wrappers.lambdaQuery(UserBindDetail.class)
|
|
|
+ .and(qr -> qr.eq(UserBindDetail::getPhoneUserId, user.getId()).or().eq(UserBindDetail::getEmailUserId, user.getId()))
|
|
|
+ .last("limit 1"));
|
|
|
+ if (bindDetail != null && bindDetail.getUserId() != null) {
|
|
|
+ User wxUser = userMapper.selectById(bindDetail.getUserId());
|
|
|
+ if (wxUser != null) {
|
|
|
+ unionId = wxUser.getUnionid();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (StrUtil.isNotBlank(unionId)) {
|
|
|
+ CorpUserFollowView corpUserFollowView = beanSearcher.searchFirst(CorpUserFollowView.class, MapUtils.builder()
|
|
|
+ .field(CorpUserFollowView::getUnionId, unionId)
|
|
|
+ .field(CorpUserFollowView::getStatus, 1).build());
|
|
|
+ if (corpUserFollowView != null) {
|
|
|
+ userWhoami.setIsJoinWx(true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //是否下过单
|
|
|
+ List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, user);
|
|
|
+ Integer selectCount = orderDonMapper.selectCount(Wrappers.lambdaQuery(OrderDon.class)
|
|
|
+ .in(OrderDon::getUserId, userIdList)
|
|
|
+ .notIn(OrderDon::getStatus, Constant.noOrderStatus));
|
|
|
+ userWhoami.setIsPay(selectCount > 0);
|
|
|
return userWhoami;
|
|
|
}
|
|
|
|