Commit b060b896 by 吕明尚

Merge branch 'dev' into test

parents d81f6dbf 0d730371
...@@ -802,6 +802,31 @@ public class RedisTask { ...@@ -802,6 +802,31 @@ public class RedisTask {
logger.debug("AutomaticallyMonthlyCard:自动结束月卡结束"); logger.debug("AutomaticallyMonthlyCard:自动结束月卡结束");
} }
//每日00:00:00增加时长
@XxlJob("AutoMonthlyCardTime")
public void AutoMonthlyCardTime() {
logger.debug("AutoMonthlyCardTime:自动增加月卡时长开始");
Set<String> keys = redisTemplate.keys(ReceiptRdeisEnum.MONTHLY_CARD.getValue() + "*");
if (keys.size() == 0) return;
List<ConsumerMonthlyCard> consumerMonthlyCards = new ArrayList<>();
String monthlyCardTime = sysConfigService.selectConfigByKey("monthlyCardTime");
keys.stream().forEach(key -> {
String value = redisUtil.get(String.valueOf(key));
JSONObject jsonObject = new JSONObject(value);
Date expirationTime = jsonObject.getDate("expirationTime");
Long consumerMonthlyCardId = jsonObject.getLong("consumerMonthlyCardId");
if (expirationTime.getTime() > new Date().getTime()) {
ConsumerMonthlyCard consumerMonthlyCard = new ConsumerMonthlyCard();
consumerMonthlyCard.setFreeDuration(new BigDecimal(monthlyCardTime));
consumerMonthlyCard.setId(consumerMonthlyCardId);
consumerMonthlyCards.add(consumerMonthlyCard);
}
});
if (!CollectionUtils.isEmpty(consumerMonthlyCards))
consumerMonthlyCardService.updateBatchById(consumerMonthlyCards);
logger.debug("AutoMonthlyCardTime:自动增加月卡时长结束");
}
@XxlJob("AutomaticallySecondaryCard") @XxlJob("AutomaticallySecondaryCard")
public void AutomaticallySecondaryCard() { public void AutomaticallySecondaryCard() {
logger.debug("AutomaticallySecondaryCard:自动结束次卡开始"); logger.debug("AutomaticallySecondaryCard:自动结束次卡开始");
......
package share.system.domain; package share.system.domain;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
...@@ -25,6 +23,7 @@ public class MonthlyCardConf extends BaseEntity { ...@@ -25,6 +23,7 @@ public class MonthlyCardConf extends BaseEntity {
/** /**
* 主键 * 主键
*/ */
@TableId(type = IdType.AUTO)
private Long id; private Long id;
/** /**
......
package share.system.domain; package share.system.domain;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
...@@ -27,6 +25,7 @@ public class MonthlyCardLog extends BaseEntity { ...@@ -27,6 +25,7 @@ public class MonthlyCardLog extends BaseEntity {
/** /**
* 主键 * 主键
*/ */
@TableId(type = IdType.AUTO)
private Long id; private Long id;
/** /**
......
package share.system.domain; package share.system.domain;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import share.common.annotation.Excel; import share.common.annotation.Excel;
import share.common.core.domain.BaseEntity; import share.common.core.domain.BaseEntity;
...@@ -23,6 +21,7 @@ public class SecondaryCardConf extends BaseEntity { ...@@ -23,6 +21,7 @@ public class SecondaryCardConf extends BaseEntity {
/** /**
* 主键 * 主键
*/ */
@TableId(type = IdType.AUTO)
private Long id; private Long id;
/** /**
......
package share.system.domain; package share.system.domain;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
...@@ -26,6 +24,7 @@ public class SecondaryCardLog extends BaseEntity { ...@@ -26,6 +24,7 @@ public class SecondaryCardLog extends BaseEntity {
/** /**
* 主键 * 主键
*/ */
@TableId(type = IdType.AUTO)
private Long id; private Long id;
/** /**
......
...@@ -130,7 +130,7 @@ public class ConsumerMonthlyCardServiceImpl extends ServiceImpl<ConsumerMonthlyC ...@@ -130,7 +130,7 @@ public class ConsumerMonthlyCardServiceImpl extends ServiceImpl<ConsumerMonthlyC
if (ObjectUtil.isNotEmpty(consumerMember)) { if (ObjectUtil.isNotEmpty(consumerMember)) {
SRoom room = roomService.getById(monthlyCardRequest.getRoomId()); SRoom room = roomService.getById(monthlyCardRequest.getRoomId());
consumerMonthlyCard = baseMapper.selectOne(new LambdaQueryWrapper<ConsumerMonthlyCard>().eq(ConsumerMonthlyCard::getConsumerId, user.getId())); consumerMonthlyCard = baseMapper.selectOne(new LambdaQueryWrapper<ConsumerMonthlyCard>().eq(ConsumerMonthlyCard::getConsumerId, user.getId()).gt(ConsumerMonthlyCard::getFreeDuration, 0));
consumerSecondaryCard = consumerSecondaryCardService.list(new LambdaQueryWrapper<ConsumerSecondaryCard>().eq(ConsumerSecondaryCard::getConsumerId, user.getId()).orderByAsc(ConsumerSecondaryCard::getNumber)); consumerSecondaryCard = consumerSecondaryCardService.list(new LambdaQueryWrapper<ConsumerSecondaryCard>().eq(ConsumerSecondaryCard::getConsumerId, user.getId()).orderByAsc(ConsumerSecondaryCard::getNumber));
if (!ObjectUtils.isEmpty(monthlyCardRequest.getRoomLabelId())) { if (!ObjectUtils.isEmpty(monthlyCardRequest.getRoomLabelId())) {
RoomLabel roomLabel = roomLabelService.selectRoomLabelById(monthlyCardRequest.getRoomLabelId()); RoomLabel roomLabel = roomLabelService.selectRoomLabelById(monthlyCardRequest.getRoomLabelId());
...@@ -165,6 +165,10 @@ public class ConsumerMonthlyCardServiceImpl extends ServiceImpl<ConsumerMonthlyC ...@@ -165,6 +165,10 @@ public class ConsumerMonthlyCardServiceImpl extends ServiceImpl<ConsumerMonthlyC
} }
}); });
} }
if (ObjectUtil.isNotEmpty(consumerMonthlyCard) && consumerMonthlyCard.getFreeDuration().compareTo(new BigDecimal(byId.getDuration())) == 0) {
consumerMonthlyCardList.add(consumerMonthlyCard.getId());
map.put("consumerMonthlyCard", consumerMonthlyCardList);
}
return map; return map;
//标签绑定了套餐,套餐没开启,小时 //标签绑定了套餐,套餐没开启,小时
} else { } else {
...@@ -188,6 +192,10 @@ public class ConsumerMonthlyCardServiceImpl extends ServiceImpl<ConsumerMonthlyC ...@@ -188,6 +192,10 @@ public class ConsumerMonthlyCardServiceImpl extends ServiceImpl<ConsumerMonthlyC
} }
}); });
} }
if (ObjectUtil.isNotEmpty(consumerMonthlyCard) && consumerMonthlyCard.getFreeDuration().compareTo(new BigDecimal(pack.getDuration())) == 0) {
consumerMonthlyCardList.add(consumerMonthlyCard.getId());
map.put("consumerMonthlyCard", consumerMonthlyCardList);
}
} }
} }
return new HashMap<>(); return new HashMap<>();
......
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