霸王餐日志打印 默认原价 打包费问题
This commit is contained in:
parent
79a77286c8
commit
9137f8e0a5
|
|
@ -30,6 +30,8 @@ public class VipPayParamDTO {
|
||||||
*/
|
*/
|
||||||
private Integer userAllPack;
|
private Integer userAllPack;
|
||||||
private Integer seatNum;
|
private Integer seatNum;
|
||||||
|
//会员价
|
||||||
|
private Integer vipPrice;
|
||||||
@NotNull(message = "充值金额不为空")
|
@NotNull(message = "充值金额不为空")
|
||||||
private BigDecimal amount;
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -460,6 +460,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
||||||
public void processOrderDetails2(List<OrderDetail> orderDetails, Map<Long, Integer> prodCouponMap,
|
public void processOrderDetails2(List<OrderDetail> orderDetails, Map<Long, Integer> prodCouponMap,
|
||||||
BigDecimalDTO prodCouponAmount, BigDecimalDTO totalAmount, BigDecimalDTO packAmount,
|
BigDecimalDTO prodCouponAmount, BigDecimalDTO totalAmount, BigDecimalDTO packAmount,
|
||||||
boolean isAllPack, Integer userAllPack, boolean isVipPrice) {
|
boolean isAllPack, Integer userAllPack, boolean isVipPrice) {
|
||||||
|
log.info("霸王餐入参2 userAllPack:{}", userAllPack);
|
||||||
Map<Long, List<OrderDetail>> detailMap = new HashMap<>();
|
Map<Long, List<OrderDetail>> detailMap = new HashMap<>();
|
||||||
for (OrderDetail detail : orderDetails) {
|
for (OrderDetail detail : orderDetails) {
|
||||||
detailMap.computeIfAbsent(detail.getProductId(), k -> new ArrayList<>()).add(detail);
|
detailMap.computeIfAbsent(detail.getProductId(), k -> new ArrayList<>()).add(detail);
|
||||||
|
|
|
||||||
|
|
@ -147,15 +147,17 @@ public class PayServiceImpl implements PayService {
|
||||||
BigDecimalDTO totalAmount = new BigDecimalDTO(BigDecimal.ZERO);
|
BigDecimalDTO totalAmount = new BigDecimalDTO(BigDecimal.ZERO);
|
||||||
//最终打包费
|
//最终打包费
|
||||||
BigDecimalDTO packAmount = new BigDecimalDTO(BigDecimal.ZERO);
|
BigDecimalDTO packAmount = new BigDecimalDTO(BigDecimal.ZERO);
|
||||||
orderInfoService.processOrderDetails2(orderDetails, null, null, totalAmount, packAmount, payParam.isAllPack(), payParam.getUserAllPack(), true);
|
log.info("霸王餐入参:{}", JSON.toJSONString(payParam));
|
||||||
|
orderInfoService.processOrderDetails2(orderDetails, null, null, totalAmount, packAmount, payParam.isAllPack(), payParam.getUserAllPack(), false);
|
||||||
BigDecimal total = totalAmount.getPrice().add(packAmount.getPrice());
|
BigDecimal total = totalAmount.getPrice().add(packAmount.getPrice());
|
||||||
if (total.compareTo(freeConfig.getRechargeThreshold()) < 0) {
|
if (total.compareTo(freeConfig.getRechargeThreshold()) < 0) {
|
||||||
throw new CzgException("霸王餐满" + freeConfig.getRechargeThreshold() + "可用,当前订单金额为" + total);
|
throw new CzgException("霸王餐满" + freeConfig.getRechargeThreshold() + "可用,当前订单金额为" + total);
|
||||||
}
|
}
|
||||||
BigDecimal payAmount = (totalAmount.getPrice().add(packAmount.getPrice()).add(orderInfo.getSeatAmount()))
|
BigDecimal payAmount = (totalAmount.getPrice().add(packAmount.getPrice()).add(orderInfo.getSeatAmount()))
|
||||||
.multiply(new BigDecimal(freeConfig.getMultiple())).setScale(2, RoundingMode.HALF_UP);
|
.multiply(new BigDecimal(freeConfig.getMultiple())).setScale(2, RoundingMode.HALF_UP);
|
||||||
log.info("霸王餐应支付金额:{},充值金额为:{}", payAmount, payParam.getAmount());
|
|
||||||
if (payAmount.compareTo(payParam.getAmount()) != 0) {
|
if (payAmount.compareTo(payParam.getAmount()) != 0) {
|
||||||
|
log.info("霸王餐应支付金额:{} 其中 打包费{} 餐位费{},充值金额为:{}",
|
||||||
|
payAmount, packAmount.getPrice(), orderInfo.getSeatAmount(), payParam.getAmount());
|
||||||
throw new ValidateException("霸王餐支付金额不正确");
|
throw new ValidateException("霸王餐支付金额不正确");
|
||||||
}
|
}
|
||||||
orderDetailService.updateBatch(orderDetails);
|
orderDetailService.updateBatch(orderDetails);
|
||||||
|
|
@ -542,6 +544,9 @@ public class PayServiceImpl implements PayService {
|
||||||
@Transactional
|
@Transactional
|
||||||
public CzgResult<Object> refundOrderBefore(OrderInfoRefundDTO param) {
|
public CzgResult<Object> refundOrderBefore(OrderInfoRefundDTO param) {
|
||||||
OrderInfo orderInfo = orderInfoService.getById(param.getOrderId());
|
OrderInfo orderInfo = orderInfoService.getById(param.getOrderId());
|
||||||
|
if (orderInfo.getStatus().equals(OrderStatusEnums.CANCELLED.getCode())) {
|
||||||
|
throw new CzgException("订单已过期不可退单");
|
||||||
|
}
|
||||||
ShopInfo shopInfo = shopInfoService.getById(orderInfo.getShopId());
|
ShopInfo shopInfo = shopInfoService.getById(orderInfo.getShopId());
|
||||||
Map<String, BigDecimal> returnProMap = new HashMap<>();
|
Map<String, BigDecimal> returnProMap = new HashMap<>();
|
||||||
boolean isPay = true;
|
boolean isPay = true;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue