Merge remote-tracking branch 'origin/test' into test

This commit is contained in:
张松 2025-09-29 18:31:12 +08:00
commit f08f33b794
8 changed files with 25 additions and 12 deletions

View File

@ -128,4 +128,8 @@ public class UserCouponVo {
* 与会员价同享0-1-
*/
private Integer vipPriceShare;
/**
* 与其他优惠券同享0-1-
*/
private Integer otherCouponShare;
}

View File

@ -150,6 +150,10 @@ public class UserCouponVO implements Serializable {
* 与会员价同享0-1-
*/
private Integer vipPriceShare;
/**
* 与其它优惠共享0-1-
*/
private Integer otherCouponShare;
/**
* 附加规则说明

View File

@ -61,5 +61,5 @@ public interface OrderInfoService extends IService<OrderInfo> {
Boolean cancelledPlaceOrder(Long shopId, Long orderId, Integer placeNum);
Boolean updatePayOrderId(Long shopId, Long orderId, String payType);
Boolean updatePayOrderId(Long orderId, Long paymentId, String payType);
}

View File

@ -64,6 +64,7 @@
coupon.vip_price_share as vipPriceShare,
coupon.rule_details as ruleDetails,
coupon.discount_num as discountNum,
coupon.other_coupon_share as otherCouponShare,
coupon.use_rule as useRule
from mk_shop_coupon_record
left join mk_shop_coupon coupon on mk_shop_coupon_record.coupon_id = coupon.id
@ -115,6 +116,7 @@
coupon.get_limit as getLimit,
coupon.use_limit as useLimit,
coupon.discount_share as discountShare,
coupon.other_coupon_share as otherCouponShare,
coupon.vip_price_share as vipPriceShare,
coupon.rule_details as ruleDetails
FROM

View File

@ -140,5 +140,5 @@ public interface OrderInfoMapper extends BaseMapper<OrderInfo> {
int decrMoney(@Param("id") Long id, @Param("amount") BigDecimal amount);
int updatePayOrderId(@Param("shopId") Long shopId, @Param("orderId") Long orderId, @Param("payType") String payType);
int updatePayOrderId(@Param("orderId") Long orderId, @Param("paymentId") Long paymentId, @Param("payType") String payType);
}

View File

@ -660,7 +660,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
private void oneGiftCalculate(List<OrderDetail> orderDetails, boolean isAllFoods, List<Long> couponFoodIds, boolean isAsc, BigDecimalDTO oneGiftAmount) {
orderDetails = getDetailsSort(orderDetails, isAsc);
for (OrderDetail detail : orderDetails) {
if ((isAllFoods || couponFoodIds.contains(detail.getProductId())) && couponFoodIds.contains(detail.getProductId())
if ((isAllFoods || couponFoodIds.contains(detail.getProductId()))
&& detail.getUnitPrice().compareTo(BigDecimal.ZERO) > 0
&& detail.getNum().subtract(detail.getReturnNum()).subtract(detail.getCouponNum()).compareTo(BigDecimal.TWO) >= 0) {
detail.setCouponNum(detail.getCouponNum().add(BigDecimal.ONE));
@ -682,7 +682,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
&& detail.getUnitPrice().compareTo(BigDecimal.ZERO) > 0
&& detail.getNum().subtract(detail.getReturnNum()).subtract(detail.getCouponNum()).compareTo(BigDecimal.TWO) >= 0) {
detail.setHalfPriceCouponNum(BigDecimal.ONE);
BigDecimal halfPrice = detail.getUnitPrice().divide(new BigDecimal("2").setScale(2, RoundingMode.FLOOR));
BigDecimal halfPrice = detail.getUnitPrice().divide(new BigDecimal("2")).setScale(2, RoundingMode.FLOOR);
detail.setDiscountAmount(detail.getDiscountAmount().add(halfPrice));
detail.setPayAmount(detail.getPayAmount().subtract(halfPrice));
oneGiftAmount.setPrice(halfPrice);
@ -702,7 +702,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
}
BigDecimal foodsAmount = BigDecimal.ZERO;
for (OrderDetail detail : orderDetails) {
if ((isAllFoods || couponFoodIds.contains(detail.getProductId())) || couponFoodIds.contains(detail.getProductId())
if ((isAllFoods || couponFoodIds.contains(detail.getProductId()))
&& detail.getUnitPrice().compareTo(BigDecimal.ZERO) > 0
&& detail.getNum().subtract(detail.getReturnNum()).subtract(detail.getCouponNum()).compareTo(BigDecimal.ONE) >= 0) {
foodsAmount = foodsAmount.add(detail.getPayAmount());
@ -875,10 +875,10 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
.eq(OrderInfo::getPayOrderId, payment.getId())
.eq(OrderInfo::getPayType, PayEnums.VIP_PAY.getValue()));
if (orderInfo != null) {
updateChain().eq(OrderInfo::getPayOrderId, payment.getRelatedId())
.eq(OrderInfo::getPayType, PayEnums.VIP_PAY.getValue())
updateChain().eq(OrderInfo::getId, orderInfo.getId())
.set(OrderInfo::getPayType, PayEnums.VIP_PAY.getValue())
.set(OrderInfo::getStatus, OrderStatusEnums.DONE.getCode())
.set(OrderInfo::getPayAmount, 0)
.set(OrderInfo::getPayAmount, orderInfo.getOrderAmount())
.update();
ShopUserMoneyEditDTO shopUserMoneyEditDTO = new ShopUserMoneyEditDTO()
.setId(shopUser.getId())
@ -1390,8 +1390,8 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean updatePayOrderId(Long shopId, Long orderId, String payType) {
mapper.updatePayOrderId(shopId, orderId, payType);
public Boolean updatePayOrderId(Long orderId, Long paymentId, String payType) {
mapper.updatePayOrderId(orderId, paymentId, payType);
return true;
}
}

View File

@ -43,6 +43,7 @@ import com.czg.service.RedisService;
import com.czg.service.market.service.impl.MemberOrderServiceImpl;
import com.czg.service.order.dto.*;
import com.czg.service.order.enums.OrderStatusEnums;
import com.czg.service.order.mapper.OrderPaymentMapper;
import com.czg.service.order.service.PayService;
import com.czg.system.enums.SysParamCodeEnum;
import com.czg.system.service.SysParamsService;
@ -99,6 +100,8 @@ public class PayServiceImpl implements PayService {
@Resource
private OrderPaymentService paymentService;
@Resource
private OrderPaymentMapper paymentMapper;
@Resource
private CreditBuyerOrderService buyerOrderService;
@Resource
private RedisService redisService;
@ -829,7 +832,7 @@ public class PayServiceImpl implements PayService {
private Long initOrderPayment(OrderPayment payment) {
paymentService.save(payment);
paymentMapper.insert(payment);
return payment.getId();
}

View File

@ -36,7 +36,7 @@
<update id="updatePayOrderId">
update tb_order_info
set pay_order_id = #{payOrderId},
set pay_order_id = #{paymentId},
pay_type = #{payType},
update_time=now()
where id = #{orderId};