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

This commit is contained in:
张松 2025-10-15 16:29:47 +08:00
commit 66ecbeb7df
5 changed files with 29 additions and 16 deletions

View File

@ -10,6 +10,7 @@ import com.czg.enums.ShopUserFlowBizEnum;
import com.czg.market.entity.SmsPushEventUser; import com.czg.market.entity.SmsPushEventUser;
import com.czg.resp.CzgResult; import com.czg.resp.CzgResult;
import com.czg.sa.StpKit; import com.czg.sa.StpKit;
import com.czg.utils.AssertUtil;
import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.paginate.Page;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
@ -165,7 +166,7 @@ public class ShopUserController {
*/ */
@PostMapping("/getPushEventUser") @PostMapping("/getPushEventUser")
public CzgResult<Page<ShopUser>> getPushEventUser(@RequestBody @Validated SmsPushEventUser smsPushEventUser) { public CzgResult<Page<ShopUser>> getPushEventUser(@RequestBody @Validated SmsPushEventUser smsPushEventUser) {
smsPushEventUser.setShopId(StpKit.USER.getShopId()); AssertUtil.isNull(smsPushEventUser.getShopId(), "店铺id不能为空");
return CzgResult.success(shopUserService.getPushEventUser(smsPushEventUser)); return CzgResult.success(shopUserService.getPushEventUser(smsPushEventUser));
} }

View File

@ -4,6 +4,7 @@ import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id; import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType; import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table; import com.mybatisflex.annotation.Table;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ -48,7 +49,7 @@ public class SmsPushEventUser implements Serializable {
private Integer sexWoman; private Integer sexWoman;
private Integer sexUnknown; private Integer sexUnknown;
/** /**
* 是否会员 0否 1是 null全查 * 是否会员 0否 1是 null全查
*/ */
private Integer isVip; private Integer isVip;
@ -62,11 +63,11 @@ public class SmsPushEventUser implements Serializable {
* 下单时间 从未下单 1查询 其余不查 * 下单时间 从未下单 1查询 其余不查
*/ */
private Integer noOrder; private Integer noOrder;
/** /**
* 下单时间 下过一单 1查询 其余不查 * 下单时间 下过一单 1查询 其余不查
*/ */
private Integer oneOrder; private Integer oneOrder;
/** /**
* 下单时间 下过五单及以上 1查询 其余不查 * 下单时间 下过五单及以上 1查询 其余不查
*/ */
private Integer fiveOrder; private Integer fiveOrder;
@ -76,15 +77,15 @@ public class SmsPushEventUser implements Serializable {
* 下单时间 今天 1查询 其余不查 * 下单时间 今天 1查询 其余不查
*/ */
private Integer orderTimeToday; private Integer orderTimeToday;
/** /**
* 下单时间 昨天 1查询 其余不查 * 下单时间 昨天 1查询 其余不查
*/ */
private Integer orderTimeYesterday; private Integer orderTimeYesterday;
/** /**
* 下单时间 两周内 1查询 其余不查 * 下单时间 两周内 1查询 其余不查
*/ */
private Integer orderTimeTwoWeeks; private Integer orderTimeTwoWeeks;
/** /**
* 下单时间 两周前 1查询 其余不查 * 下单时间 两周前 1查询 其余不查
*/ */
private Integer orderTimeMoreThanTwoWeeks; private Integer orderTimeMoreThanTwoWeeks;
@ -102,5 +103,16 @@ public class SmsPushEventUser implements Serializable {
@Column(onInsertValue = "now()") @Column(onInsertValue = "now()")
private LocalDateTime createTime; private LocalDateTime createTime;
@Column(ignore = true)
private Integer page;
@Column(ignore = true)
private Integer size;
public Integer getPage() {
return page == null ? 1 : page;
}
public Integer getSize() {
return size == null ? 10 : size;
}
} }

View File

@ -95,7 +95,7 @@ public class AShopUserServiceImpl implements AShopUserService {
@Override @Override
public Page<ShopUser> getPushEventUser(SmsPushEventUser smsPushEventUser) { public Page<ShopUser> getPushEventUser(SmsPushEventUser smsPushEventUser) {
PageHelper.startPage(PageUtil.buildPage()); PageHelper.startPage(new Page<>(smsPushEventUser.getPage(), smsPushEventUser.getSize()));
Long mainShopId = shopInfoService.getMainIdByShopId(smsPushEventUser.getShopId()); Long mainShopId = shopInfoService.getMainIdByShopId(smsPushEventUser.getShopId());
// 调用Mapper层查询 // 调用Mapper层查询
return shopUserMapper.selectPushEventUser( return shopUserMapper.selectPushEventUser(

View File

@ -148,7 +148,7 @@
noOrder == 1 or oneOrder == 1 or fiveOrder == 1"> noOrder == 1 or oneOrder == 1 or fiveOrder == 1">
LEFT JOIN `order` o ON u.user_id = o.user_id and o.user_id is not null AND o.shop_id = #{shopId} AND o.status = 'done' LEFT JOIN `order` o ON u.user_id = o.user_id and o.user_id is not null AND o.shop_id = #{shopId} AND o.status = 'done'
</if> </if>
WHERE u.main_shop_id = #{mainShopId} WHERE u.main_shop_id = #{mainShopId} and u.phone is not null
<!-- 性别筛选条件 --> <!-- 性别筛选条件 -->
<if test="(sexMan == 1 or sexWoman == 1 or sexUnknown == 1)"> <if test="(sexMan == 1 or sexWoman == 1 or sexUnknown == 1)">
AND AND

View File

@ -472,12 +472,12 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
}); });
} }
//总商品支付金额 不包含打包费 用来计算后续
if (prodCouponAmount.getPrice().compareTo(param.getProductCouponDiscountAmount()) != 0) { if (prodCouponAmount.getPrice().compareTo(param.getProductCouponDiscountAmount()) != 0) {
log.info("支付计算金额不正确:商品券抵扣金额为:{},传递为:{}", prodCouponAmount.getPrice(), param.getProductCouponDiscountAmount()); log.info("支付计算金额不正确:商品券抵扣金额为:{},传递为:{}", prodCouponAmount.getPrice(), param.getProductCouponDiscountAmount());
throw new ValidateException("生成支付订单失败,商品优惠券优惠金额不正确"); throw new ValidateException("生成支付订单失败,商品优惠券优惠金额不正确");
} }
orderInfo.setOriginAmount(param.getOriginAmount()); orderInfo.setOriginAmount(param.getOriginAmount());
//总商品支付金额 不包含打包费 用来计算后续
BigDecimal newTotalAmount = totalAmount.getPrice(); BigDecimal newTotalAmount = totalAmount.getPrice();
//减去商品优惠券 //减去商品优惠券
@ -536,11 +536,11 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
} }
if (newTotalAmount.compareTo(param.getOrderAmount()) != 0) { if (newTotalAmount.compareTo(param.getOrderAmount()) != 0) {
log.info(""" log.info("""
支付计算金额不正确订单Id:{},支付计算金额为:{},商品总金额:{},打包费:{}餐位费:{}, 支付计算金额不正确订单Id:{},支付计算金额为:{},商品总金额:{},临时菜价格:{},打包费:{}餐位费:{},
传递支付金额为:{},商品券:{},其它券:{},新客立减:{},满减活动:{}, 传递支付金额为:{},商品券:{},其它券:{},新客立减:{},满减活动:{},
商家最终改价:{},积分抵扣金额:{},抹零金额:{} 商家最终改价:{},积分抵扣金额:{},抹零金额:{}
""", """,
orderInfo.getId(), newTotalAmount, totalAmount.getPrice(), packAmount.getPrice(), orderInfo.getSeatAmount(), orderInfo.getId(), newTotalAmount, totalAmount.getPrice(), tempAmount.getPrice(), packAmount.getPrice(), orderInfo.getSeatAmount(),
param.getOrderAmount(), param.getProductCouponDiscountAmount(), param.getOtherCouponDiscountAmount(), param.getNewCustomerDiscountAmount(), param.getOrderAmount(), param.getProductCouponDiscountAmount(), param.getOtherCouponDiscountAmount(), param.getNewCustomerDiscountAmount(),
discountActAmount, param.getDiscountAmount(), param.getPointsDiscountAmount(), param.getRoundAmount()); discountActAmount, param.getDiscountAmount(), param.getPointsDiscountAmount(), param.getRoundAmount());
throw new ValidateException("生成支付订单失败,支付金额不正确"); throw new ValidateException("生成支付订单失败,支付金额不正确");
@ -675,7 +675,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
// log.info("商品券 计算 orderDetails:{}", orderDetails); // log.info("商品券 计算 orderDetails:{}", orderDetails);
BigDecimal remaining = new BigDecimal(discountNum); BigDecimal remaining = new BigDecimal(discountNum);
for (OrderDetail detail : orderDetails) { for (OrderDetail detail : orderDetails) {
if ((isAllFoods || couponFoodIds.contains(detail.getProductId())) && detail.getUnitPrice().compareTo(BigDecimal.ZERO) > 0) { if (detail.getIsTemporary() != 1 && (isAllFoods || couponFoodIds.contains(detail.getProductId())) && detail.getUnitPrice().compareTo(BigDecimal.ZERO) > 0) {
if (remaining.compareTo(BigDecimal.ZERO) > 0) { if (remaining.compareTo(BigDecimal.ZERO) > 0) {
if (remaining.compareTo(detail.getNum().subtract(detail.getReturnNum())) >= 0) { if (remaining.compareTo(detail.getNum().subtract(detail.getReturnNum())) >= 0) {
detail.setCouponNum(detail.getNum().subtract(detail.getReturnNum()).setScale(2, RoundingMode.CEILING)); detail.setCouponNum(detail.getNum().subtract(detail.getReturnNum()).setScale(2, RoundingMode.CEILING));