提交 595cc54b authored 作者: huyufan's avatar huyufan

开发:修改BUG

上级 90afdd72
...@@ -23,7 +23,7 @@ public class OrderGoodsIdGenerate { ...@@ -23,7 +23,7 @@ public class OrderGoodsIdGenerate {
long baseStart = Long.parseLong(DateUtils.formatDate(LocalDate.now(), "yyyyMMdd").get() + "00001"); long baseStart = Long.parseLong(DateUtils.formatDate(LocalDate.now(), "yyyyMMdd").get() + "00001");
Object o = redisTemplate.opsForHash().get(RedisConstants.ORDER_GOODS_ID, type); Object o = redisTemplate.opsForHash().get(RedisConstants.ORDER_GOODS_ID, type);
if (o == null) { if (o == null) {
Long maxOrderGoodsId = orderGoodsDao.getMaxOrderGoodsId(type); Long maxOrderGoodsId = Long.valueOf(orderGoodsDao.getMaxOrderGoodsId(type).substring(2));
if (maxOrderGoodsId == null) { if (maxOrderGoodsId == null) {
maxOrderGoodsId = 0L; maxOrderGoodsId = 0L;
} }
......
...@@ -19,7 +19,7 @@ import java.math.BigDecimal; ...@@ -19,7 +19,7 @@ import java.math.BigDecimal;
public interface OrderGoodsDao extends BaseDao<OrderGoodsMapper, OrderGoods, Integer> { public interface OrderGoodsDao extends BaseDao<OrderGoodsMapper, OrderGoods, Integer> {
boolean updateWeight(@Param("orderId")Integer orderId, @Param("weight") BigDecimal weight); boolean updateWeight(@Param("orderId")Integer orderId, @Param("weight") BigDecimal weight);
Long getMaxOrderGoodsId(String type); String getMaxOrderGoodsId(String type);
Optional<OrderGoods> getByOrderGoodsNo(String orderGoodsNo); Optional<OrderGoods> getByOrderGoodsNo(String orderGoodsNo);
......
...@@ -29,7 +29,7 @@ public class OrderGoodsDaoImpl extends BaseDaoImpl<OrderGoodsMapper, OrderGoods, ...@@ -29,7 +29,7 @@ public class OrderGoodsDaoImpl extends BaseDaoImpl<OrderGoodsMapper, OrderGoods,
} }
@Override @Override
public Long getMaxOrderGoodsId(String type) { public String getMaxOrderGoodsId(String type) {
return baseMapper.getMaxOrderGoodsId(type); return baseMapper.getMaxOrderGoodsId(type);
} }
......
...@@ -13,8 +13,8 @@ import java.util.Objects; ...@@ -13,8 +13,8 @@ import java.util.Objects;
public class OrderGoodsSqlProvider { public class OrderGoodsSqlProvider {
public String getMaxOrderGoodsId(String type) { public String getMaxOrderGoodsId(String type) {
return "SELECT s.order_goods_no FROM `order_goods` s WHERE s. id = ( SELECT max(id) FROM order_goods where order_goods_type = '" + type + "')"; return "SELECT s.order_goods_no FROM `order_goods` s WHERE s. id = ( SELECT max(id) FROM order_goods )";
// return "SELECT s.order_goods_no FROM `order_goods` s WHERE s. id = ( SELECT max(id) FROM order_goods where order_goods_type = '" + type + "')";
} }
public String pageOrderGoodsList(@Param("page") Page<FeignPageOrderVO> page, @Param("param") PageOrderGoodsListParam param) { public String pageOrderGoodsList(@Param("page") Page<FeignPageOrderVO> page, @Param("param") PageOrderGoodsListParam param) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论