|
@@ -19,6 +19,7 @@ import com.cyksj.mapper.OrderDonMapper;
|
|
|
import com.cyksj.mapper.UserMapper;
|
|
import com.cyksj.mapper.UserMapper;
|
|
|
import com.cyksj.mapper.corp.*;
|
|
import com.cyksj.mapper.corp.*;
|
|
|
import com.cyksj.mapper.manage.coupon.CouponMapper;
|
|
import com.cyksj.mapper.manage.coupon.CouponMapper;
|
|
|
|
|
+import com.cyksj.mapper.market.task.UserBindDetailMapper;
|
|
|
import com.cyksj.model.entity.*;
|
|
import com.cyksj.model.entity.*;
|
|
|
import com.cyksj.model.request.corp.Attachments;
|
|
import com.cyksj.model.request.corp.Attachments;
|
|
|
import com.cyksj.model.request.corp.CorpXmlMessage;
|
|
import com.cyksj.model.request.corp.CorpXmlMessage;
|
|
@@ -116,6 +117,8 @@ public class CorpEventActionServiceImpl implements CorpEventActionService {
|
|
|
|
|
|
|
|
private final CorpUserRelateMapper corpUserRelateMapper;
|
|
private final CorpUserRelateMapper corpUserRelateMapper;
|
|
|
|
|
|
|
|
|
|
+ private final UserBindDetailMapper userBindDetailMapper;
|
|
|
|
|
+
|
|
|
private static final String DEFAULT_MSG = "您好,欢迎加入银河录像局";
|
|
private static final String DEFAULT_MSG = "您好,欢迎加入银河录像局";
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -886,8 +889,9 @@ public class CorpEventActionServiceImpl implements CorpEventActionService {
|
|
|
*/
|
|
*/
|
|
|
public void corpRenewFollowUser(String phone) {
|
|
public void corpRenewFollowUser(String phone) {
|
|
|
//是否是手机用户 或者 邮箱用户
|
|
//是否是手机用户 或者 邮箱用户
|
|
|
- Set<Long> relationUserIds = userMapper.getRelationUserIdsByPhone(phone);
|
|
|
|
|
|
|
+ Set<Long> relationUserIds = getRelationUserIds(phone);
|
|
|
if (CollUtil.isEmpty(relationUserIds)) {
|
|
if (CollUtil.isEmpty(relationUserIds)) {
|
|
|
|
|
+ log.info("该备注手机号:{]暂无关联银河用户", phone);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
List<RenewalView> list = beanSearcher.searchAll(RenewalView.class, MapUtils.builder()
|
|
List<RenewalView> list = beanSearcher.searchAll(RenewalView.class, MapUtils.builder()
|
|
@@ -912,7 +916,7 @@ public class CorpEventActionServiceImpl implements CorpEventActionService {
|
|
|
if (expiryTime.before(DateUtil.offsetMonth(DateTime.now(), 1))) {
|
|
if (expiryTime.before(DateUtil.offsetMonth(DateTime.now(), 1))) {
|
|
|
//续费分类下
|
|
//续费分类下
|
|
|
//寻找对应续费的优惠券 发送
|
|
//寻找对应续费的优惠券 发送
|
|
|
- Coupon coupon = couponMapper.getRenewCouponBySkuId(skuId, couponIds);
|
|
|
|
|
|
|
+ Coupon coupon = couponMapper.getRenewCouponBySkuId(skuId, couponIds, userId);
|
|
|
if (coupon != null) {
|
|
if (coupon != null) {
|
|
|
CouponUser couponUser = new CouponUser();
|
|
CouponUser couponUser = new CouponUser();
|
|
|
couponUser.setUserId(userId);
|
|
couponUser.setUserId(userId);
|
|
@@ -935,4 +939,27 @@ public class CorpEventActionServiceImpl implements CorpEventActionService {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ private Set<Long> getRelationUserIds(String phone) {
|
|
|
|
|
+ User user = userMapper.selectOne(Wrappers.lambdaQuery(User.class)
|
|
|
|
|
+ .eq(User::getLoginPhone, phone).last("limit 1")
|
|
|
|
|
+ .select(User::getId));
|
|
|
|
|
+ Set<Long> relationUserIds = new HashSet<>();
|
|
|
|
|
+ if (user != null) {
|
|
|
|
|
+ relationUserIds.add(user.getId());
|
|
|
|
|
+ }
|
|
|
|
|
+ UserBindDetail userBindDetail = userBindDetailMapper.selectOne(Wrappers.lambdaQuery(UserBindDetail.class)
|
|
|
|
|
+ .eq(UserBindDetail::getPhone, phone).last("limit 1"));
|
|
|
|
|
+ if (userBindDetail != null) {
|
|
|
|
|
+ Long userId = userBindDetail.getUserId();
|
|
|
|
|
+ if (userId != null) {
|
|
|
|
|
+ relationUserIds.add(userId);
|
|
|
|
|
+ }
|
|
|
|
|
+ Long emailUserId = userBindDetail.getEmailUserId();
|
|
|
|
|
+ if (emailUserId != null) {
|
|
|
|
|
+ relationUserIds.add(emailUserId);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return relationUserIds;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|