Merge branch 'master' of gitee.com:beijing_hongye_huicheng/lilishop into feature/pg

This commit is contained in:
OceansDeep
2021-05-20 20:00:38 +08:00
committed by Gitee
17 changed files with 78 additions and 47 deletions

View File

@@ -10,7 +10,6 @@ import org.springframework.util.CollectionUtils;
import javax.annotation.PostConstruct;
import java.util.Calendar;
import java.util.Set;
import java.util.TimeZone;
import java.util.concurrent.TimeUnit;
/**
@@ -42,6 +41,9 @@ public abstract class AbstractDelayQueueMachineFactory {
}
/**
* 延时队列机器开始运作
*/
private void startDelayQueueMachine() {
log.info(String.format("延时队列机器{%s}开始运作", setDelayQueueName()));
@@ -66,11 +68,11 @@ public abstract class AbstractDelayQueueMachineFactory {
}
} catch (Exception e) {
// log.warn(String.format("处理延时任务发生异常,异常原因为{%s}", e.getMessage()), e);
log.error(String.format("处理延时任务发生异常,异常原因为{%s}", e.getMessage()), e);
} finally {
// 间隔一秒钟搞一次
try {
TimeUnit.SECONDS.sleep(1L);
TimeUnit.SECONDS.sleep(5L);
} catch (InterruptedException e) {
e.printStackTrace();
}

View File

@@ -52,13 +52,15 @@ public class RocketmqTimerTrigger implements TimeTrigger {
if (StringUtils.isEmpty(uniqueKey)) {
uniqueKey = StringUtils.getRandStr(10);
}
//执行任务key
String generateKey = TimeTriggerUtil.generateKey(timeTriggerMsg.getTriggerExecutor(), timeTriggerMsg.getTriggerTime(), uniqueKey);
this.cache.put(generateKey, 1);
//设置延时任务
if (Boolean.TRUE.equals(promotionDelayQueue.addJobId(JSONUtil.toJsonStr(timeTriggerMsg), delayTime))) {
log.info("add Redis key {} --------------------------", generateKey);
log.info("add Redis key {}", generateKey);
log.info("定时执行在【" + DateUtil.toString(timeTriggerMsg.getTriggerTime(), "yyyy-MM-dd HH:mm:ss") + "】,消费【" + timeTriggerMsg.getParam().toString() + "");
} else {
log.error("延时任务添加失败");
log.error("延时任务添加失败:{}", timeTriggerMsg);
}
}

View File

@@ -146,6 +146,11 @@ public class DistributionServiceImpl extends ServiceImpl<DistributionMapper, Dis
@Override
public void bindingDistribution(String distributionId) {
//判断用户是否登录,未登录不能进行绑定
if(UserContext.getCurrentUser()==null){
throw new ServiceException(ResultCode.USER_NOT_LOGIN);
}
//储存分销关系为3天
Distribution distribution = this.getById(distributionId);
if (distribution!=null) {

View File

@@ -55,9 +55,6 @@ import java.util.List;
@Transactional
public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements GoodsService {
//商品
@Autowired
private GoodsMapper goodsMapper;
//商品属性
@Autowired
private GoodsParamsService goodsParamsService;
@@ -85,7 +82,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
@Override
public void underStoreGoods(String storeId) {
this.goodsMapper.underStoreGoods(storeId);
this.baseMapper.underStoreGoods(storeId);
}
@Override

View File

@@ -89,7 +89,7 @@ public class CartVO extends CartBase implements Serializable {
this.remark = "";
}
public void add(Integer goodsNum) {
public void addGoodsNum(Integer goodsNum) {
if (this.goodsNum == null) {
this.goodsNum = goodsNum;
} else {

View File

@@ -8,7 +8,6 @@ import cn.lili.modules.order.cart.entity.vo.CartSkuVO;
import cn.lili.modules.order.cart.entity.vo.CartVO;
import cn.lili.modules.order.cart.render.CartRenderStep;
import cn.lili.modules.order.order.entity.dto.PriceDetailDTO;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Service;
@@ -53,7 +52,7 @@ public class CartPriceRender implements CartRenderStep {
if (Boolean.FALSE.equals(sku.getChecked())) {
continue;
}
cart.setGoodsNum(sku.getNum());
cart.addGoodsNum(sku.getNum());
if (cart.getStoreId().equals(sku.getStoreId()) && !cart.getSkuList().contains(sku)) {
cart.getSkuList().add(sku);
}

View File

@@ -1,7 +1,6 @@
package cn.lili.modules.page.entity.dos;
import cn.lili.base.BaseEntity;
import cn.lili.common.enums.SwitchEnum;
import cn.lili.modules.page.entity.enums.ArticleEnum;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
@@ -45,11 +44,8 @@ public class Article extends BaseEntity {
@NotEmpty(message = "文章内容不能为空")
private String content;
/**
* @see SwitchEnum
*/
@ApiModelProperty(value = "状态", allowableValues = "OPEN,CLOSE")
private String openStatus;
@ApiModelProperty(value = "状态")
private Boolean openStatus;
/**
* @see ArticleEnum
*/

View File

@@ -25,5 +25,5 @@ public class ArticleVO {
private Integer sort;
@ApiModelProperty(value = "状态, allowableValues = OPEN,CLOSE")
private String openStatus;
private Boolean openStatus;
}

View File

@@ -3,7 +3,6 @@ package cn.lili.modules.page.serviceimpl;
import cn.hutool.core.util.StrUtil;
import cn.lili.common.enums.ResultCode;
import cn.lili.common.enums.SwitchEnum;
import cn.lili.common.exception.ServiceException;
import cn.lili.common.utils.BeanUtil;
import cn.lili.common.utils.PageUtil;
@@ -83,7 +82,7 @@ public class ArticleServiceImpl extends ServiceImpl<ArticleMapper, Article> impl
@Override
public Boolean updateArticleStatus(String id, boolean status) {
Article article=this.getById(id);
article.setOpenStatus(status? SwitchEnum.OPEN.name():SwitchEnum.CLOSE.name());
article.setOpenStatus(status);
return this.updateById(article);
}
}

View File

@@ -139,7 +139,7 @@ public class IndexStatisticsServiceImpl implements IndexStatisticsService {
//获取总会员数量
indexStatisticsVO.setMemberNum(memberStatisticsDataService.getMemberCount());
//获取总上架商品数量
indexStatisticsVO.setGoodsNum(goodsService.goodsNum(GoodsStatusEnum.UPPER, null));
indexStatisticsVO.setGoodsNum(goodsService.goodsNum(GoodsStatusEnum.UPPER, GoodsAuthEnum.PASS));
//获取总店铺数量
indexStatisticsVO.setStoreNum(storeService.storeNum());

View File

@@ -59,7 +59,6 @@ public class AppVersionDO{
@ApiModelProperty(value = "版本名称")
private String versionName;
@ApiModelProperty(value = "更新内容")
private String content;