提交 d0df79af authored 作者: huyufan's avatar huyufan

修改BUG

上级 bd3a75ed
......@@ -3,6 +3,7 @@ package com.clx.performance.component;
import com.clx.performance.constant.RedisConstants;
import com.clx.performance.dao.OrderGoodsDao;
import com.msl.common.utils.DateUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
......@@ -23,7 +24,12 @@ public class OrderGoodsIdGenerate {
long baseStart = Long.parseLong(DateUtils.formatDate(LocalDate.now(), "yyyyMMdd").get() + "00001");
Object o = redisTemplate.opsForHash().get(RedisConstants.ORDER_GOODS_ID, type);
if (o == null) {
Long maxOrderGoodsId = Long.valueOf(orderGoodsDao.getMaxOrderGoodsId(type).substring(2));
Long maxOrderGoodsId = null;
String maxID = orderGoodsDao.getMaxOrderGoodsId(type);
if (StringUtils.isNotBlank(maxID)) {
maxOrderGoodsId = Long.valueOf(maxID.substring(0, 2));
}
if (maxOrderGoodsId == null) {
maxOrderGoodsId = 0L;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论