Commit caf44548 by 吕明尚

Merge branch 'refs/heads/dev' into test

parents e1ea5936 ed0873bc
...@@ -14,7 +14,6 @@ import share.common.enums.MemberTypeEnum; ...@@ -14,7 +14,6 @@ import share.common.enums.MemberTypeEnum;
import share.common.enums.YesNoEnum; import share.common.enums.YesNoEnum;
import share.common.utils.DateUtils; import share.common.utils.DateUtils;
import share.common.utils.StringUtils; import share.common.utils.StringUtils;
import share.common.utils.bean.BeanUtils;
import share.system.domain.Activity; import share.system.domain.Activity;
import share.system.domain.ConsumerMember; import share.system.domain.ConsumerMember;
import share.system.domain.SConsumer; import share.system.domain.SConsumer;
...@@ -136,17 +135,24 @@ public class ActivityServiceImpl extends ServiceImpl<ActivityMapper, Activity> i ...@@ -136,17 +135,24 @@ public class ActivityServiceImpl extends ServiceImpl<ActivityMapper, Activity> i
for (int i = 0; i <= 4; i++) { for (int i = 0; i <= 4; i++) {
days.add(DateUtils.addDays(new Date(), i)); days.add(DateUtils.addDays(new Date(), i));
} }
Activity activity = new Activity(); LambdaQueryWrapper<Activity> queryWrapper = new LambdaQueryWrapper<>();
BeanUtils.copyProperties(dto, activity); // Activity activity = new Activity();
activity.setMemberType(MemberTypeEnum.NORMAL.getIndex()); // BeanUtils.copyProperties(dto, activity);
if (consumerMember.getIsRecharge().equals(YesNoEnum.yes.getIndex())) { // activity.setMemberType(MemberTypeEnum.NORMAL.getIndex());
activity.setMemberType(MemberTypeEnum.RECHARGE.getIndex()); if (consumerMember.getIsRecharge().equals(YesNoEnum.no.getIndex()) && consumerMember.getIsRights().equals(YesNoEnum.no.getIndex())) {
} queryWrapper.eq(Activity::getMemberType, MemberTypeEnum.NORMAL.getIndex());
if (consumerMember.getIsRights().equals(YesNoEnum.yes.getIndex())) { } else if (consumerMember.getIsRecharge().equals(YesNoEnum.yes.getIndex()) && consumerMember.getIsRights().equals(YesNoEnum.yes.getIndex())) {
activity.setMemberType(MemberTypeEnum.RIGHTS.getIndex()); queryWrapper.in(Activity::getMemberType, MemberTypeEnum.RECHARGE.getIndex(), MemberTypeEnum.RIGHTS.getIndex());
} else if (consumerMember.getIsRecharge().equals(YesNoEnum.yes.getIndex()) && consumerMember.getIsRights().equals(YesNoEnum.no.getIndex())) {
// activity.setMemberType(MemberTypeEnum.RECHARGE.getIndex());
queryWrapper.eq(Activity::getMemberType, MemberTypeEnum.RECHARGE.getIndex());
} else if (consumerMember.getIsRights().equals(YesNoEnum.yes.getIndex()) && consumerMember.getIsRecharge().equals(YesNoEnum.no.getIndex())) {
// activity.setMemberType(MemberTypeEnum.RIGHTS.getIndex());
queryWrapper.eq(Activity::getMemberType, MemberTypeEnum.RIGHTS.getIndex());
} }
List<Activity> activities = selectActivityList(activity); // List<Activity> activities = selectActivityList(activity);
List<Activity> activities = list(queryWrapper);
CronParser cronParser = new CronParser(CronDefinitionBuilder.instanceDefinitionFor(CronType.QUARTZ)); CronParser cronParser = new CronParser(CronDefinitionBuilder.instanceDefinitionFor(CronType.QUARTZ));
Map<Date, List<Activity>> map = new HashMap<>(); Map<Date, List<Activity>> map = new HashMap<>();
days.stream().forEach(day -> { days.stream().forEach(day -> {
......
...@@ -2446,12 +2446,23 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme ...@@ -2446,12 +2446,23 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
consumerMember = consumerMemberService.getOne(new LambdaQueryWrapper<ConsumerMember>().eq(ConsumerMember::getConsumerId, user.getId())); consumerMember = consumerMemberService.getOne(new LambdaQueryWrapper<ConsumerMember>().eq(ConsumerMember::getConsumerId, user.getId()));
if (ObjectUtil.isNotEmpty(consumerMember)) { if (ObjectUtil.isNotEmpty(consumerMember)) {
queryWrapper.eq(Activity::getIsOpen, YesNoEnum.yes.getIndex()); queryWrapper.eq(Activity::getIsOpen, YesNoEnum.yes.getIndex());
if (consumerMember.getIsRights().equals(YesNoEnum.yes.getIndex())) { // if (consumerMember.getIsRights().equals(YesNoEnum.yes.getIndex())) {
queryWrapper.eq(Activity::getMemberType, MemberTypeEnum.RIGHTS.getIndex()); // queryWrapper.eq(Activity::getMemberType, MemberTypeEnum.RIGHTS.getIndex());
// } else if (consumerMember.getIsRecharge().equals(YesNoEnum.yes.getIndex()) && consumerMember.getIsRights().equals(YesNoEnum.no.getIndex())) {
// queryWrapper.eq(Activity::getMemberType, MemberTypeEnum.RECHARGE.getIndex());
// } else {
// queryWrapper.eq(Activity::getMemberType, MemberTypeEnum.NORMAL.getIndex());
// }
if (consumerMember.getIsRecharge().equals(YesNoEnum.no.getIndex()) && consumerMember.getIsRights().equals(YesNoEnum.no.getIndex())) {
queryWrapper.eq(Activity::getMemberType, MemberTypeEnum.NORMAL.getIndex());
} else if (consumerMember.getIsRecharge().equals(YesNoEnum.yes.getIndex()) && consumerMember.getIsRights().equals(YesNoEnum.yes.getIndex())) {
queryWrapper.in(Activity::getMemberType, MemberTypeEnum.RECHARGE.getIndex(), MemberTypeEnum.RIGHTS.getIndex());
} else if (consumerMember.getIsRecharge().equals(YesNoEnum.yes.getIndex()) && consumerMember.getIsRights().equals(YesNoEnum.no.getIndex())) { } else if (consumerMember.getIsRecharge().equals(YesNoEnum.yes.getIndex()) && consumerMember.getIsRights().equals(YesNoEnum.no.getIndex())) {
// activity.setMemberType(MemberTypeEnum.RECHARGE.getIndex());
queryWrapper.eq(Activity::getMemberType, MemberTypeEnum.RECHARGE.getIndex()); queryWrapper.eq(Activity::getMemberType, MemberTypeEnum.RECHARGE.getIndex());
} else { } else if (consumerMember.getIsRights().equals(YesNoEnum.yes.getIndex()) && consumerMember.getIsRecharge().equals(YesNoEnum.no.getIndex())) {
queryWrapper.eq(Activity::getMemberType, MemberTypeEnum.NORMAL.getIndex()); // activity.setMemberType(MemberTypeEnum.RIGHTS.getIndex());
queryWrapper.eq(Activity::getMemberType, MemberTypeEnum.RIGHTS.getIndex());
} }
} }
if (ObjectUtil.isNotEmpty(consumerWallet)) { if (ObjectUtil.isNotEmpty(consumerWallet)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment