Commit 7cf8e60f by 吕明尚

修改参与集点活动

parent 29b7d1c5
......@@ -99,7 +99,7 @@ public class PointActivitiesServiceImpl extends ServiceImpl<PointActivitiesMappe
);
if (ObjectUtil.isNotEmpty(oldPointActivities)) {
if (ObjectUtil.isNotEmpty(oldPointActivities.getLastConsumptionTime())) {
if (DateUtils.addHours(oldPointActivities.getLastConsumptionTime(), pointActivitiesConf.getTimeInterval()).compareTo(new Date()) >= 0
if (DateUtils.addHours(oldPointActivities.getLastConsumptionTime(), pointActivitiesConf.getTimeInterval()).compareTo(new Date()) <= 0
&& !oldPointActivities.getPoints().equals(pointActivitiesConf.getPointsRequired())) {
oldPointActivities.setPoints(oldPointActivities.getPoints() + YesNoEnum.yes.getIndex());
oldPointActivities.setLastConsumptionTime(sOrder.getPayTime());
......@@ -168,25 +168,27 @@ public class PointActivitiesServiceImpl extends ServiceImpl<PointActivitiesMappe
List<PointActivities> activitiesList =
pointActivitiesMapper.selectList(new LambdaQueryWrapper<PointActivities>()
.eq(PointActivities::getConsumerId, info.getId())
//当前年月,次数未到的 or 领取优惠券未领取,年月在上个月
//当前年月,活动次数未完成
.eq(PointActivities::getCurrentYear, LocalDate.now().getYear())
.eq(PointActivities::getCurrentMonth, LocalDate.now().getMonthValue())
.lt(PointActivities::getPoints, 4)
.eq(PointActivities::getIsReceive, YesNoEnum.no.getIndex())
.eq(PointActivities::getCouponReceived, YesNoEnum.no.getIndex())
.or()
//当前年月,活动次数以完成未领取的
.eq(PointActivities::getCurrentYear, LocalDate.now().getYear())
.eq(PointActivities::getCurrentMonth, LocalDate.now().getMonthValue())
.eq(PointActivities::getPoints, 4)
.eq(PointActivities::getIsReceive, YesNoEnum.yes.getIndex())
.eq(PointActivities::getCouponReceived, YesNoEnum.no.getIndex())
.or()
//或者夸年
//夸年的,已完成,未领取
.eq(PointActivities::getCurrentYear, LocalDate.now().getYear() - 1)
.eq(PointActivities::getCurrentMonth, LocalDate.now().getMonthValue() + 11)
.eq(PointActivities::getIsReceive, YesNoEnum.yes.getIndex())
.eq(PointActivities::getCouponReceived, YesNoEnum.no.getIndex())
.or()
//当前年,上个月份,已完成,未领取的
.eq(PointActivities::getCurrentYear, LocalDate.now().getYear())
.eq(PointActivities::getCurrentMonth, LocalDate.now().getMonthValue() - 1)
.eq(PointActivities::getIsReceive, YesNoEnum.yes.getIndex())
......
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