Merge branch 'dev' into prod

This commit is contained in:
2025-11-13 15:53:08 +08:00
6 changed files with 30 additions and 9 deletions

View File

@@ -1,6 +1,7 @@
package com.czg.service.account.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.StrUtil;
import com.czg.account.dto.pad.*;
@@ -27,6 +28,7 @@ import jakarta.annotation.Resource;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.LocalTime;
@@ -34,6 +36,7 @@ import java.time.format.TextStyle;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Optional;
/**
* @author Administrator
@@ -115,7 +118,8 @@ public class PadProdServiceImpl implements PadProdService {
List<ProdSku> skuList = prodSkuService.list(new QueryWrapper().eq(ProdSku::getProductId, item.getId()));
item.setSkuList(skuList);
item.setIsSaleTime(calcIsSaleTime(item.getDays(), item.getStartTime(), item.getEndTime()));
// Optional<BigDecimal> lowMemberPriceIsPresent = skuList.stream().map(obj -> NumberUtil.nullToZero(obj.getMemberPrice())).min(BigDecimal::compareTo);
// lowMemberPriceIsPresent.ifPresent(item::setLowMemberPrice);
});
padDetailDTO.setProductList(products);
}

View File

@@ -264,7 +264,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
@Override
@Transactional
public OrderInfo createOrder(OrderInfoAddDTO param) throws ValidateException{
public OrderInfo createOrder(OrderInfoAddDTO param) throws ValidateException {
ShopInfo shopInfo = shopInfoService.getById(param.getShopId());
AssertUtil.isNull(shopInfo, "生成订单失败,店铺信息不存在");
if (!shopInfo.getEatModel().contains(param.getDineMode())) {
@@ -524,16 +524,21 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
支付计算金额不正确,
订单Id:{},支付计算金额为:{},商品总金额:{},临时菜价格:{},打包费:{},餐位费:{},
传递支付金额为:{},商品券:{},其它券:{},新客立减:{},满减活动:{},
商家最终改价:{},积分抵扣金额:{},抹零金额:{}
超级会员折扣金额:{},商家最终改价:{},积分抵扣金额:{},抹零金额:{}
""",
orderInfo.getId(), newTotalAmount, totalAmount.getPrice(), tempAmount.getPrice(), packAmount.getPrice(), orderInfo.getSeatAmount(),
param.getOrderAmount(), param.getProductCouponDiscountAmount(), param.getOtherCouponDiscountAmount(), param.getNewCustomerDiscountAmount(),
discountActAmount, param.getDiscountAmount(), param.getPointsDiscountAmount(), param.getRoundAmount());
discountActAmount, param.getVipDiscountAmount(), param.getDiscountAmount(), param.getPointsDiscountAmount(), param.getRoundAmount());
throw new OrderValidateException("生成支付订单失败,支付金额不正确");
}
orderInfo.setPackFee(packAmount.getPrice());
//生成订单 //discount_info 所有折扣 几折 折扣金额 满减金额 优惠券金额 积分抵扣金额 抹零
upOrderPayInfo(orderInfo, param);
orderDetailService.updateBatch(orderDetails);
return orderInfo;
}

View File

@@ -246,9 +246,10 @@
where id = #{shopId}
</select>
<select id="productList" resultType="com.czg.product.vo.ProductVO">
select a.*, min(b.sale_price) as lowPrice
select a.*, min(b.sale_price) as lowPrice, min(b.member_price) as lowMemberPrice, unit.name as unitName
from tb_product as a
left join tb_prod_sku as b on a.id = b.product_id
left join tb_shop_prod_unit unit on a.unit_id=unit.id
where a.shop_id = #{shopId}
<if test="productIds != null">
and a.id in