!134 优化代码

Merge pull request !134 from OceansDeep/feature/pg
This commit is contained in:
OceansDeep 2022-02-24 02:17:05 +00:00 committed by Gitee
commit 25be7094a2
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 4 additions and 2 deletions

View File

@ -307,6 +307,8 @@ lili:
notice-group: lili_notice_group
notice-send-topic: lili_send_notice_topic
notice-send-group: lili_send_notice_group
after-sale-topic: lili_after_sale_topic
after-sale-group: lili_after_sale_group
rocketmq:
name-server: 192.168.0.116:9876
isVIPChannel: false

View File

@ -75,7 +75,7 @@ public class PromotionEverydayExecute implements EveryDayExecute {
LambdaQueryWrapper<Seckill> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(Seckill::getStartTime, seckill.getStartTime());
//如果已经存在促销则不再次保存
if (seckillService.list(lambdaQueryWrapper).size() == 0) {
if (seckillService.list(lambdaQueryWrapper).isEmpty()) {
boolean result = seckillService.savePromotions(seckill);
log.info("生成秒杀活动参数:{},结果:{}", seckill, result);
}

View File

@ -535,7 +535,7 @@ public class EsGoodsIndexServiceImpl extends BaseElasticsearchService implements
if (promotionMap != null && !promotionMap.isEmpty()) {
//促销不为空则进行清洗
promotionMap.entrySet().removeIf(i -> {
JSONObject promotionJson = (JSONObject) i.getValue();
JSONObject promotionJson = JSONUtil.parseObj(i.getValue());
BasePromotions promotion = promotionJson.toBean(BasePromotions.class);
return promotion.getEndTime() != null && promotion.getEndTime().getTime() < DateUtil.date().getTime();
});