Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
@@ -9,10 +9,12 @@ public class SkuInfoPo {
|
||||
|
||||
private String productName;
|
||||
private String productSkuName;
|
||||
private Integer num;
|
||||
private BigDecimal num;
|
||||
private BigDecimal priceAmount;
|
||||
private BigDecimal discountSaleAmount;
|
||||
private BigDecimal packAmount;
|
||||
private String categoryId;
|
||||
private BigDecimal price;
|
||||
private BigDecimal memberPrice;
|
||||
private String proGroupInfo;
|
||||
}
|
||||
|
||||
@@ -246,7 +246,7 @@ public class OrderService {
|
||||
|
||||
cashierCart.setProGroupInfo(JSONObject.toJSONString(foods));
|
||||
}
|
||||
}else if (isFixGroup) {
|
||||
} else if (isFixGroup) {
|
||||
String groupSnap = product.getGroupSnap();
|
||||
if (StrUtil.isNotBlank(groupSnap)) {
|
||||
ArrayList<ProductGroupVo.Food> foods = new ArrayList<>();
|
||||
@@ -266,6 +266,7 @@ public class OrderService {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Result createCart(String masterId, Integer productId, Integer shopId, Integer skuId, BigDecimal number,
|
||||
String userId, String clientType, Integer cartId, String isGift, String isPack, String uuid,
|
||||
@@ -291,7 +292,6 @@ public class OrderService {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
String finalMasterId = masterId;
|
||||
LambdaQueryWrapper<TbCashierCart> cartQuery = new LambdaQueryWrapper<TbCashierCart>()
|
||||
.eq(TbCashierCart::getShopId, shopId)
|
||||
@@ -304,16 +304,24 @@ public class OrderService {
|
||||
.eq(TbCashierCart::getSkuId, skuId);
|
||||
}
|
||||
|
||||
if (cartId != null) {
|
||||
if (cartId != null) {
|
||||
cartQuery.eq(TbCashierCart::getId, cartId);
|
||||
}
|
||||
|
||||
TbCashierCart cart = mpCashierCartMapper.selectOne(cartQuery);
|
||||
|
||||
// 校验是否是代客下单往期订单
|
||||
if (shopEatTypeInfoDTO.isDineInAfter() && cart != null && cart.getPlaceNum() != null && !isSeatCart) {
|
||||
return Result.fail("后付费已下单订单仅支持退款");
|
||||
if (StringUtils.isEmpty(masterId)) {
|
||||
boolean flag = redisUtil.exists("SHOP:CODE:" + clientType + ":" + shopId);
|
||||
if (flag) {
|
||||
String code = redisUtil.getMessage("SHOP:CODE:" + clientType + ":" + shopId);
|
||||
Integer foodCode = Integer.parseInt(code) + 1;
|
||||
code = "#" + String.format("%03d", foodCode);
|
||||
redisUtil.saveMessage("SHOP:CODE:" + clientType + ":" + shopId, foodCode.toString());
|
||||
masterId = code;
|
||||
} else {
|
||||
redisUtil.saveMessage("SHOP:CODE:" + clientType + ":" + shopId, "1");
|
||||
masterId = "#" + String.format("%03d", 1);
|
||||
}
|
||||
}
|
||||
|
||||
TbProduct product = null;
|
||||
TbProductSkuWithBLOBs skuWithBLOBs = null;
|
||||
if (!isSeatCart && productId != null) {
|
||||
@@ -336,40 +344,6 @@ public class OrderService {
|
||||
return Result.fail(CodeEnum.PRODUCTSKUERROR);
|
||||
}
|
||||
|
||||
// 首次加入购物车,并且拥有起售数,设置为起售数
|
||||
if (cart == null && skuWithBLOBs.getSuit() != null && skuWithBLOBs.getSuit() != 0 && number.compareTo(BigDecimal.valueOf(skuWithBLOBs.getSuit())) < 0) {
|
||||
number = BigDecimal.valueOf(skuWithBLOBs.getSuit());
|
||||
// 低于起售,删除商品
|
||||
} else if (cart != null && skuWithBLOBs.getSuit() != null && skuWithBLOBs.getSuit() != 0 && number.compareTo(BigDecimal.valueOf(skuWithBLOBs.getSuit())) < 0) {
|
||||
delCart(masterId, cartId);
|
||||
if (cart.getOrderId() != null && StrUtil.isNotBlank(cart.getTableId())) {
|
||||
LambdaQueryWrapper<TbCashierCart> queryWrapper = new LambdaQueryWrapper<TbCashierCart>()
|
||||
.notIn(TbCashierCart::getStatus, "final", "refund", "closed", "pending")
|
||||
.eq(TbCashierCart::getShopId, cart.getShopId());
|
||||
|
||||
TbCashierCart finalCart = cart;
|
||||
queryWrapper.eq(TbCashierCart::getTableId, cart.getTableId())
|
||||
.and(q -> q.or(
|
||||
query -> query.eq(TbCashierCart::getMasterId, finalCart.getMasterId())
|
||||
.or()
|
||||
.isNull(TbCashierCart::getMasterId)
|
||||
.or()
|
||||
.eq(TbCashierCart::getMasterId, "")
|
||||
)
|
||||
.or(query -> query.eq(TbCashierCart::getOrderId, finalCart.getOrderId())
|
||||
.or()
|
||||
.isNull(TbCashierCart::getOrderId)));
|
||||
|
||||
List<TbCashierCart> list = mpCashierCartMapper.selectList(queryWrapper.eq(TbCashierCart::getStatus, "create"));
|
||||
|
||||
if (list.isEmpty()) {
|
||||
tbOrderInfoMapper.deleteByPrimaryKey(Integer.valueOf(cart.getOrderId()));
|
||||
}
|
||||
}
|
||||
|
||||
setRedisTableCartInfo(tableId, shopId, Collections.singletonList(cart), false);
|
||||
return Result.success(CodeEnum.SUCCESS, masterId);
|
||||
}
|
||||
|
||||
// 校验库存
|
||||
if ("1".equals(product.getIsStock().toString())) {
|
||||
@@ -379,108 +353,200 @@ public class OrderService {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (StringUtils.isEmpty(masterId)) {
|
||||
boolean flag = redisUtil.exists("SHOP:CODE:" + clientType + ":" + shopId);
|
||||
if (flag) {
|
||||
String code = redisUtil.getMessage("SHOP:CODE:" + clientType + ":" + shopId);
|
||||
Integer foodCode = Integer.parseInt(code) + 1;
|
||||
code = "#" + String.format("%03d", foodCode);
|
||||
redisUtil.saveMessage("SHOP:CODE:" + clientType + ":" + shopId, foodCode.toString());
|
||||
masterId = code;
|
||||
} else {
|
||||
redisUtil.saveMessage("SHOP:CODE:" + clientType + ":" + shopId, "1");
|
||||
masterId = "#" + String.format("%03d", 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
boolean needNew = false;
|
||||
List<TbCashierCart> list = cashierCartMapper.selectALlByMasterId(masterId, "create");
|
||||
|
||||
TbCashierCart cashierCart = getCashierInfo(shopId, skuId, productId, tableId, masterId, shopEatTypeInfoDTO);
|
||||
if (type.equals("add") || cashierCart == null || (cart != null && cart.getGroupType() != null && cart.getGroupType() == 1)) {
|
||||
cashierCart = new TbCashierCart();
|
||||
cashierCart.setUseType(shopEatTypeInfoDTO.getUseType());
|
||||
if (product != null) {
|
||||
cashierCart.setCoverImg(product.getCoverImg());
|
||||
cashierCart.setIsSku(product.getTypeEnum());
|
||||
cashierCart.setName(product.getName());
|
||||
cashierCart.setCategoryId(product.getCategoryId());
|
||||
cashierCart.setTypeEnum(product.getTypeEnum());
|
||||
cashierCart.setGroupType(product.getGroupType());
|
||||
}
|
||||
cashierCart.setCreatedAt(System.currentTimeMillis());
|
||||
cashierCart.setMasterId(masterId);
|
||||
cashierCart.setUuid(uuid);
|
||||
cashierCart.setMerchantId(userId);
|
||||
cashierCart.setProductId(productId == null ? null : productId.toString());
|
||||
if (skuWithBLOBs != null) {
|
||||
cashierCart.setSalePrice(skuWithBLOBs.getSalePrice());
|
||||
cashierCart.setSkuId(skuWithBLOBs.getId().toString());
|
||||
cashierCart.setSkuName(skuWithBLOBs.getSpecSnap());
|
||||
cashierCart.setMemberPrice(skuWithBLOBs.getMemberPrice());
|
||||
cashierCart.setIsMember(0);
|
||||
}
|
||||
cashierCart.setIsPrint(isPrint);
|
||||
cashierCart.setShopId(shopId.toString());
|
||||
cashierCart.setTradeDay(DateUtils.getDay());
|
||||
cashierCart.setStatus("create");
|
||||
cashierCart.setIsPack(isPack);
|
||||
cashierCart.setIsGift(isGift);
|
||||
if (isGift.equals("false")) {
|
||||
if (isSeatCart) {
|
||||
cashierCart.setTotalAmount(number.multiply(cashierCart.getSalePrice()));
|
||||
} else {
|
||||
cashierCart.setTotalAmount(number.multiply(skuWithBLOBs.getSalePrice()));
|
||||
}
|
||||
TbCashierCart cashierCart = null;
|
||||
if (type.equals("edit")) {
|
||||
cashierCart = getCashierInfo(shopId, skuId, productId, tableId, masterId, shopEatTypeInfoDTO, cartId);
|
||||
if (cashierCart == null) {
|
||||
needNew = true;
|
||||
} else {
|
||||
cashierCart.setTotalAmount(BigDecimal.ZERO);
|
||||
}
|
||||
if (isPack.equals("false")) {
|
||||
cashierCart.setPackFee(BigDecimal.ZERO);
|
||||
} else {
|
||||
if (!isSeatCart) {
|
||||
cashierCart.setPackFee(number.multiply(product == null ? BigDecimal.ZERO : product.getPackFee()));
|
||||
// 校验是否是代客下单往期订单
|
||||
if (shopEatTypeInfoDTO.isDineInAfter() && cashierCart.getPlaceNum() != null && !isSeatCart) {
|
||||
return Result.fail("后付费已下单订单仅支持退款");
|
||||
}
|
||||
cashierCart.setTotalAmount(cashierCart.getTotalAmount().add(cashierCart.getPackFee()));
|
||||
|
||||
}
|
||||
cashierCart.setTotalNumber(number);
|
||||
cashierCart.setUserId(Integer.valueOf(userId));
|
||||
cashierCart.setNumber(number);
|
||||
cashierCart.setUuid(uuid);
|
||||
cashierCart.setTableId(tableId);
|
||||
cashierCart.setPlatformType(OrderPlatformTypeEnum.CASH.getValue());
|
||||
if (product != null) {
|
||||
resetGroupProductCart(groupProductIdList, product, cashierCart);
|
||||
}
|
||||
list.add(cashierCart);
|
||||
mpCashierCartMapper.insert(cashierCart);
|
||||
}else {
|
||||
cashierCart.setNumber(number);
|
||||
if (product != null) {
|
||||
resetGroupProductCart(groupProductIdList, product, cashierCart);
|
||||
}
|
||||
cashierCart.setTotalNumber(number);
|
||||
cashierCart.setIsPrint(isPrint);
|
||||
cashierCart.setIsPack(isPack);
|
||||
cashierCart.resetTotalAmount();
|
||||
cashierCart.setUuid(uuid);
|
||||
cashierCart.setIsPrint(isPrint);
|
||||
cashierCart.resetTotalAmount();
|
||||
if (product != null) {
|
||||
resetGroupProductCart(groupProductIdList, product, cart);
|
||||
if (skuWithBLOBs != null && skuWithBLOBs.getSuit() != null && skuWithBLOBs.getSuit() != 0 && number.compareTo(BigDecimal.valueOf(skuWithBLOBs.getSuit())) < 0) {
|
||||
delCart(masterId, cartId);
|
||||
if (cashierCart.getOrderId() != null && StrUtil.isNotBlank(cashierCart.getTableId())) {
|
||||
LambdaQueryWrapper<TbCashierCart> queryWrapper = new LambdaQueryWrapper<TbCashierCart>()
|
||||
.notIn(TbCashierCart::getStatus, "final", "refund", "closed", "pending")
|
||||
.eq(TbCashierCart::getShopId, cashierCart.getShopId());
|
||||
|
||||
TbCashierCart finalCart = cashierCart;
|
||||
queryWrapper.eq(TbCashierCart::getTableId, cashierCart.getTableId())
|
||||
.and(q -> q.or(
|
||||
query -> query.eq(TbCashierCart::getMasterId, finalCart.getMasterId())
|
||||
.or()
|
||||
.isNull(TbCashierCart::getMasterId)
|
||||
.or()
|
||||
.eq(TbCashierCart::getMasterId, "")
|
||||
)
|
||||
.or(query -> query.eq(TbCashierCart::getOrderId, finalCart.getOrderId())
|
||||
.or()
|
||||
.isNull(TbCashierCart::getOrderId)));
|
||||
|
||||
List<TbCashierCart> list1 = mpCashierCartMapper.selectList(queryWrapper.eq(TbCashierCart::getStatus, "create"));
|
||||
|
||||
if (list1.isEmpty()) {
|
||||
tbOrderInfoMapper.deleteByPrimaryKey(cashierCart.getOrderId());
|
||||
}
|
||||
}
|
||||
|
||||
setRedisTableCartInfo(tableId, shopId, Collections.singletonList(cashierCart), false);
|
||||
return Result.success(CodeEnum.SUCCESS, masterId);
|
||||
}
|
||||
|
||||
cashierCart.setNumber(number);
|
||||
if (product != null) {
|
||||
resetGroupProductCart(groupProductIdList, product, cashierCart);
|
||||
}
|
||||
cashierCart.setTotalNumber(number);
|
||||
cashierCart.setIsPrint(isPrint);
|
||||
cashierCart.setIsPack(isPack);
|
||||
cashierCart.resetTotalAmount();
|
||||
cashierCart.setUuid(uuid);
|
||||
cashierCart.setIsPrint(isPrint);
|
||||
cashierCart.resetTotalAmount();
|
||||
if (product != null) {
|
||||
resetGroupProductCart(groupProductIdList, product, cashierCart);
|
||||
}
|
||||
|
||||
mpCashierCartMapper.updateById(cashierCart);
|
||||
}
|
||||
|
||||
mpCashierCartMapper.updateById(cashierCart);
|
||||
}
|
||||
|
||||
setRedisTableCartInfo(tableId, shopId, Collections.singletonList(cart), true);
|
||||
if (type.equals("add") || needNew) {
|
||||
if (product == null || product.getGroupType() == null || product.getGroupType() != 1) {
|
||||
cashierCart = getCashierInfo(shopId, skuId, productId, tableId, masterId, shopEatTypeInfoDTO, cartId);
|
||||
}
|
||||
|
||||
if (cashierCart != null) {
|
||||
// 校验是否是代客下单往期订单
|
||||
if (shopEatTypeInfoDTO.isDineInAfter() && cashierCart.getPlaceNum() != null && !isSeatCart) {
|
||||
return Result.fail("后付费已下单订单仅支持退款");
|
||||
}
|
||||
|
||||
if (skuWithBLOBs != null && skuWithBLOBs.getSuit() != null && skuWithBLOBs.getSuit() != 0 && number.compareTo(BigDecimal.valueOf(skuWithBLOBs.getSuit())) < 0) {
|
||||
delCart(masterId, cartId);
|
||||
if (cashierCart.getOrderId() != null && StrUtil.isNotBlank(cashierCart.getTableId())) {
|
||||
LambdaQueryWrapper<TbCashierCart> queryWrapper = new LambdaQueryWrapper<TbCashierCart>()
|
||||
.notIn(TbCashierCart::getStatus, "final", "refund", "closed", "pending")
|
||||
.eq(TbCashierCart::getShopId, cashierCart.getShopId());
|
||||
|
||||
TbCashierCart finalCart = cashierCart;
|
||||
queryWrapper.eq(TbCashierCart::getTableId, cashierCart.getTableId())
|
||||
.and(q -> q.or(
|
||||
query -> query.eq(TbCashierCart::getMasterId, finalCart.getMasterId())
|
||||
.or()
|
||||
.isNull(TbCashierCart::getMasterId)
|
||||
.or()
|
||||
.eq(TbCashierCart::getMasterId, "")
|
||||
)
|
||||
.or(query -> query.eq(TbCashierCart::getOrderId, finalCart.getOrderId())
|
||||
.or()
|
||||
.isNull(TbCashierCart::getOrderId)));
|
||||
|
||||
List<TbCashierCart> list1 = mpCashierCartMapper.selectList(queryWrapper.eq(TbCashierCart::getStatus, "create"));
|
||||
|
||||
if (list1.isEmpty()) {
|
||||
tbOrderInfoMapper.deleteByPrimaryKey(cashierCart.getOrderId());
|
||||
}
|
||||
}
|
||||
|
||||
setRedisTableCartInfo(tableId, shopId, Collections.singletonList(cashierCart), false);
|
||||
return Result.success(CodeEnum.SUCCESS, masterId);
|
||||
}
|
||||
|
||||
number = cashierCart.getNumber().add(number);
|
||||
cashierCart.setNumber(number);
|
||||
if (product != null) {
|
||||
resetGroupProductCart(groupProductIdList, product, cashierCart);
|
||||
}
|
||||
cashierCart.setTotalNumber(number);
|
||||
cashierCart.setIsPrint(isPrint);
|
||||
cashierCart.setIsPack(isPack);
|
||||
cashierCart.resetTotalAmount();
|
||||
cashierCart.setUuid(uuid);
|
||||
cashierCart.setIsPrint(isPrint);
|
||||
cashierCart.resetTotalAmount();
|
||||
if (product != null) {
|
||||
resetGroupProductCart(groupProductIdList, product, cashierCart);
|
||||
}
|
||||
|
||||
mpCashierCartMapper.updateById(cashierCart);
|
||||
} else {
|
||||
|
||||
cashierCart = new TbCashierCart();
|
||||
cashierCart.setUseType(shopEatTypeInfoDTO.getUseType());
|
||||
if (product != null) {
|
||||
cashierCart.setCoverImg(product.getCoverImg());
|
||||
cashierCart.setIsSku(product.getTypeEnum());
|
||||
cashierCart.setName(product.getName());
|
||||
cashierCart.setCategoryId(product.getCategoryId());
|
||||
cashierCart.setTypeEnum(product.getTypeEnum());
|
||||
cashierCart.setGroupType(product.getGroupType());
|
||||
}
|
||||
cashierCart.setCreatedAt(System.currentTimeMillis());
|
||||
cashierCart.setMasterId(masterId);
|
||||
cashierCart.setUuid(uuid);
|
||||
cashierCart.setMerchantId(userId);
|
||||
cashierCart.setProductId(productId == null ? null : productId.toString());
|
||||
if (skuWithBLOBs != null) {
|
||||
cashierCart.setSalePrice(skuWithBLOBs.getSalePrice());
|
||||
cashierCart.setSkuId(skuWithBLOBs.getId().toString());
|
||||
cashierCart.setSkuName(skuWithBLOBs.getSpecSnap());
|
||||
cashierCart.setMemberPrice(skuWithBLOBs.getMemberPrice());
|
||||
cashierCart.setIsMember(0);
|
||||
}
|
||||
cashierCart.setIsPrint(isPrint);
|
||||
cashierCart.setShopId(shopId.toString());
|
||||
cashierCart.setTradeDay(DateUtils.getDay());
|
||||
cashierCart.setStatus("create");
|
||||
cashierCart.setIsPack(isPack);
|
||||
cashierCart.setIsGift(isGift);
|
||||
if (isGift.equals("false")) {
|
||||
if (isSeatCart) {
|
||||
cashierCart.setTotalAmount(number.multiply(cashierCart.getSalePrice()));
|
||||
} else {
|
||||
cashierCart.setTotalAmount(number.multiply(skuWithBLOBs.getSalePrice()));
|
||||
}
|
||||
} else {
|
||||
cashierCart.setTotalAmount(BigDecimal.ZERO);
|
||||
}
|
||||
if (isPack.equals("false")) {
|
||||
cashierCart.setPackFee(BigDecimal.ZERO);
|
||||
} else {
|
||||
if (!isSeatCart) {
|
||||
cashierCart.setPackFee(number.multiply(product == null ? BigDecimal.ZERO : product.getPackFee()));
|
||||
}
|
||||
cashierCart.setTotalAmount(cashierCart.getTotalAmount().add(cashierCart.getPackFee()));
|
||||
}
|
||||
if (skuWithBLOBs != null && skuWithBLOBs.getSuit() != null && skuWithBLOBs.getSuit() != 0 && number.compareTo(BigDecimal.valueOf(skuWithBLOBs.getSuit())) < 0) {
|
||||
number = BigDecimal.valueOf(skuWithBLOBs.getSuit());
|
||||
}
|
||||
cashierCart.setTotalNumber(number);
|
||||
cashierCart.setNumber(number);
|
||||
cashierCart.setUserId(Integer.valueOf(userId));
|
||||
cashierCart.setUuid(uuid);
|
||||
cashierCart.setTableId(tableId);
|
||||
cashierCart.setPlatformType(OrderPlatformTypeEnum.CASH.getValue());
|
||||
if (product != null) {
|
||||
resetGroupProductCart(groupProductIdList, product, cashierCart);
|
||||
}
|
||||
list.add(cashierCart);
|
||||
mpCashierCartMapper.insert(cashierCart);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
setRedisTableCartInfo(tableId, shopId, Collections.singletonList(cashierCart), true);
|
||||
|
||||
return Result.success(CodeEnum.SUCCESS, masterId);
|
||||
}
|
||||
|
||||
private TbCashierCart getCashierInfo(Object shopId, Object skuId, Object productId, String tableId, String MasterId, ShopEatTypeInfoDTO shopEatTypeInfoDTO) {
|
||||
private TbCashierCart getCashierInfo(Object shopId, Object skuId, Object productId, String tableId, String MasterId, ShopEatTypeInfoDTO shopEatTypeInfoDTO, Integer cartId) {
|
||||
LambdaQueryWrapper<TbCashierCart> query = new LambdaQueryWrapper<TbCashierCart>()
|
||||
.eq(TbCashierCart::getShopId, shopId)
|
||||
.eq(TbCashierCart::getSkuId, skuId)
|
||||
@@ -488,6 +554,10 @@ public class OrderService {
|
||||
.in(TbCashierCart::getStatus, "create")
|
||||
.eq(TbCashierCart::getUseType, shopEatTypeInfoDTO.getUseType());
|
||||
|
||||
if (cartId != null) {
|
||||
query.eq(TbCashierCart::getId, cartId);
|
||||
}
|
||||
|
||||
if (shopEatTypeInfoDTO.isDineInAfter()) {
|
||||
query.isNull(TbCashierCart::getPlaceNum);
|
||||
}
|
||||
@@ -1176,6 +1246,7 @@ public class OrderService {
|
||||
|
||||
return Result.success(CodeEnum.SUCCESS, orderInfo);
|
||||
}
|
||||
|
||||
private void updateOrderDetailCanReturn(List<TbOrderDetail> orderDetailList, TbOrderInfo orderInfo) {
|
||||
orderDetailList = orderDetailList.stream().filter(item -> TableConstant.OrderInfo.Status.UNPAID.equalsVals(item.getStatus())).collect(Collectors.toList());
|
||||
BigDecimal totalAmount = BigDecimal.ZERO;
|
||||
@@ -1510,12 +1581,28 @@ public class OrderService {
|
||||
if (Objects.isNull(skuInfoPos) || skuInfoPos.size() < 0) {
|
||||
skuInfoPos = new ArrayList<>();
|
||||
}
|
||||
skuInfoPos.forEach(item -> {
|
||||
if (item.getDiscountSaleAmount() != null) {
|
||||
item.setPrice(item.getPrice().subtract(item.getDiscountSaleAmount()));
|
||||
if (item.getMemberPrice() != null) {
|
||||
item.setMemberPrice(item.getMemberPrice().subtract(item.getDiscountSaleAmount()));
|
||||
}
|
||||
}
|
||||
});
|
||||
orderInfo.setSkuInfos(skuInfoPos);
|
||||
} else {
|
||||
List<SkuInfoPo> skuInfoPos = tbOrderInfoMapper.selectSkuByOrderId(orderInfo.getId().toString());
|
||||
if (Objects.isNull(skuInfoPos) || skuInfoPos.size() < 0) {
|
||||
skuInfoPos = new ArrayList<>();
|
||||
}
|
||||
skuInfoPos.forEach(item -> {
|
||||
if (item.getDiscountSaleAmount() != null) {
|
||||
item.setPrice(item.getPrice().subtract(item.getDiscountSaleAmount()));
|
||||
if (item.getMemberPrice() != null) {
|
||||
item.setMemberPrice(item.getMemberPrice().subtract(item.getDiscountSaleAmount()));
|
||||
}
|
||||
}
|
||||
});
|
||||
orderInfo.setSkuInfos(skuInfoPos);
|
||||
}
|
||||
|
||||
|
||||
@@ -611,8 +611,11 @@ select * from tb_order_info where trade_day = #{day} and table_id = #{masterId}
|
||||
d.product_sku_name AS productSkuName,
|
||||
c.category_id AS categoryId,
|
||||
d.price_amount as priceAmount,
|
||||
d.discount_sale_amount as discountSaleAmount,
|
||||
d.pack_amount as packAmount,
|
||||
d.price as price,
|
||||
d.member_price as memberPrice,
|
||||
|
||||
d.pro_group_info as proGroupInfo
|
||||
FROM
|
||||
tb_order_detail d
|
||||
@@ -632,8 +635,10 @@ select * from tb_order_info where trade_day = #{day} and table_id = #{masterId}
|
||||
d.product_sku_name AS productSkuName,
|
||||
'' AS categoryId,
|
||||
d.price_amount as priceAmount,
|
||||
d.discount_sale_amount as discountSaleAmount,
|
||||
d.pack_amount as packAmount,
|
||||
d.price as price,
|
||||
d.member_price as memberPrice,
|
||||
d.pro_group_info as proGroupInfo
|
||||
FROM
|
||||
tb_order_detail d
|
||||
|
||||
Reference in New Issue
Block a user