|
@@ -704,46 +704,46 @@ public class XiaoJuServiceImpl implements XiaoJuService {
|
|
|
// 券发放
|
|
|
public ResultContent<List<GenPromotionInfo>> getPromotion(String activityId) {
|
|
|
AuthDetails currentUser = authHelper.getCurrentUser();
|
|
|
- XiaoJuActivity byActivityId = xiaoJuActivityDao.findByActivityId(activityId);
|
|
|
- if (byActivityId == null) {
|
|
|
- return ResultContent.build(ResultState.Fail, "活动不存在");
|
|
|
- }
|
|
|
-
|
|
|
- AtomicBoolean grant = new AtomicBoolean(false);
|
|
|
- List<String> planningId = byActivityId.getPlanningId();
|
|
|
-
|
|
|
- planningId.forEach(it -> {
|
|
|
- ResultContent<List<VipUserModel>> listResultContent = vipUserService.userInfo(currentUser.getPhone());
|
|
|
- List<VipUserModel> content = listResultContent.getContent();
|
|
|
- List<String> collect = content.stream().map(vipUserModel -> vipUserModel.getPlanningId()).collect(Collectors.toList());
|
|
|
- for (String s : planningId) {
|
|
|
- grant.set(collect.remove(s));
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- if (!grant.get()) {
|
|
|
- return ResultContent.build(ResultState.Fail, "当前会员不能领取");
|
|
|
- }
|
|
|
- DateTime dateTime = DateUtil.beginOfMonth(new Date());
|
|
|
- List<XiaoJuActivityReceiver> xiaoJuActivityReceivers = xiaoJuActivityReceiverDao.findByUserIdAndCreateTimeAfter(currentUser.getUserId(), dateTime.getTime());
|
|
|
- if (xiaoJuActivityReceivers.size() >= 3) {
|
|
|
- return ResultContent.build(ResultState.Fail, "当月已经领取3次");
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- XiaoJuQueryUserPromotionListModel xiaoJuQueryUserPromotionListModel = new XiaoJuQueryUserPromotionListModel();
|
|
|
- xiaoJuQueryUserPromotionListModel.setPageIndex(1);
|
|
|
- xiaoJuQueryUserPromotionListModel.setPageSize(20);
|
|
|
- xiaoJuQueryUserPromotionListModel.setStatus(5);
|
|
|
- xiaoJuQueryUserPromotionListModel.setMobile(currentUser.getPhone());
|
|
|
- xiaoJuQueryUserPromotionListModel.setOutUserId(currentUser.getUserId());
|
|
|
-
|
|
|
- ResultContent<com.zswl.cloud.springBatch.client.model.xiaoju.QueryUserPromotionListResponse> queryUserPromotionListResponseResultContent = queryUserPromotionList(xiaoJuQueryUserPromotionListModel);
|
|
|
- com.zswl.cloud.springBatch.client.model.xiaoju.QueryUserPromotionListResponse queryUserPromotionListResponse = queryUserPromotionListResponseResultContent.getContent();
|
|
|
-
|
|
|
- if (queryUserPromotionListResponse.getTotalSize() != 0) {
|
|
|
- return ResultContent.build(ResultState.Fail, "有未消费的优惠券,请先使用");
|
|
|
- }
|
|
|
+// XiaoJuActivity byActivityId = xiaoJuActivityDao.findByActivityId(activityId);
|
|
|
+// if (byActivityId == null) {
|
|
|
+// return ResultContent.build(ResultState.Fail, "活动不存在");
|
|
|
+// }
|
|
|
+//
|
|
|
+// AtomicBoolean grant = new AtomicBoolean(false);
|
|
|
+// List<String> planningId = byActivityId.getPlanningId();
|
|
|
+//
|
|
|
+// planningId.forEach(it -> {
|
|
|
+// ResultContent<List<VipUserModel>> listResultContent = vipUserService.userInfo(currentUser.getPhone());
|
|
|
+// List<VipUserModel> content = listResultContent.getContent();
|
|
|
+// List<String> collect = content.stream().map(vipUserModel -> vipUserModel.getPlanningId()).collect(Collectors.toList());
|
|
|
+// for (String s : planningId) {
|
|
|
+// grant.set(collect.remove(s));
|
|
|
+// }
|
|
|
+// });
|
|
|
+//
|
|
|
+// if (!grant.get()) {
|
|
|
+// return ResultContent.build(ResultState.Fail, "当前会员不能领取");
|
|
|
+// }
|
|
|
+// DateTime dateTime = DateUtil.beginOfMonth(new Date());
|
|
|
+// List<XiaoJuActivityReceiver> xiaoJuActivityReceivers = xiaoJuActivityReceiverDao.findByUserIdAndCreateTimeAfter(currentUser.getUserId(), dateTime.getTime());
|
|
|
+// if (xiaoJuActivityReceivers.size() >= 3) {
|
|
|
+// return ResultContent.build(ResultState.Fail, "当月已经领取3次");
|
|
|
+//
|
|
|
+// }
|
|
|
+//
|
|
|
+// XiaoJuQueryUserPromotionListModel xiaoJuQueryUserPromotionListModel = new XiaoJuQueryUserPromotionListModel();
|
|
|
+// xiaoJuQueryUserPromotionListModel.setPageIndex(1);
|
|
|
+// xiaoJuQueryUserPromotionListModel.setPageSize(20);
|
|
|
+// xiaoJuQueryUserPromotionListModel.setStatus(5);
|
|
|
+// xiaoJuQueryUserPromotionListModel.setMobile(currentUser.getPhone());
|
|
|
+// xiaoJuQueryUserPromotionListModel.setOutUserId(currentUser.getUserId());
|
|
|
+//
|
|
|
+// ResultContent<com.zswl.cloud.springBatch.client.model.xiaoju.QueryUserPromotionListResponse> queryUserPromotionListResponseResultContent = queryUserPromotionList(xiaoJuQueryUserPromotionListModel);
|
|
|
+// com.zswl.cloud.springBatch.client.model.xiaoju.QueryUserPromotionListResponse queryUserPromotionListResponse = queryUserPromotionListResponseResultContent.getContent();
|
|
|
+//
|
|
|
+// if (queryUserPromotionListResponse.getTotalSize() != 0) {
|
|
|
+// return ResultContent.build(ResultState.Fail, "有未消费的优惠券,请先使用");
|
|
|
+// }
|
|
|
|
|
|
String tradeNo = snowflake.nextIdStr();
|
|
|
|