Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
commit
66ecbeb7df
|
|
@ -10,6 +10,7 @@ import com.czg.enums.ShopUserFlowBizEnum;
|
|||
import com.czg.market.entity.SmsPushEventUser;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.utils.AssertUtil;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
|
@ -165,7 +166,7 @@ public class ShopUserController {
|
|||
*/
|
||||
@PostMapping("/getPushEventUser")
|
||||
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));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.mybatisflex.annotation.Column;
|
|||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
|
@ -48,7 +49,7 @@ public class SmsPushEventUser implements Serializable {
|
|||
private Integer sexWoman;
|
||||
private Integer sexUnknown;
|
||||
|
||||
/**
|
||||
/**
|
||||
* 是否会员 0否 1是 null全查
|
||||
*/
|
||||
private Integer isVip;
|
||||
|
|
@ -62,11 +63,11 @@ public class SmsPushEventUser implements Serializable {
|
|||
* 下单时间 从未下单 1查询 其余不查
|
||||
*/
|
||||
private Integer noOrder;
|
||||
/**
|
||||
/**
|
||||
* 下单时间 下过一单 1查询 其余不查
|
||||
*/
|
||||
private Integer oneOrder;
|
||||
/**
|
||||
/**
|
||||
* 下单时间 下过五单及以上 1查询 其余不查
|
||||
*/
|
||||
private Integer fiveOrder;
|
||||
|
|
@ -76,15 +77,15 @@ public class SmsPushEventUser implements Serializable {
|
|||
* 下单时间 今天 1查询 其余不查
|
||||
*/
|
||||
private Integer orderTimeToday;
|
||||
/**
|
||||
/**
|
||||
* 下单时间 昨天 1查询 其余不查
|
||||
*/
|
||||
private Integer orderTimeYesterday;
|
||||
/**
|
||||
/**
|
||||
* 下单时间 两周内 1查询 其余不查
|
||||
*/
|
||||
private Integer orderTimeTwoWeeks;
|
||||
/**
|
||||
/**
|
||||
* 下单时间 两周前 1查询 其余不查
|
||||
*/
|
||||
private Integer orderTimeMoreThanTwoWeeks;
|
||||
|
|
@ -102,5 +103,16 @@ public class SmsPushEventUser implements Serializable {
|
|||
|
||||
@Column(onInsertValue = "now()")
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ public class AShopUserServiceImpl implements AShopUserService {
|
|||
|
||||
@Override
|
||||
public Page<ShopUser> getPushEventUser(SmsPushEventUser smsPushEventUser) {
|
||||
PageHelper.startPage(PageUtil.buildPage());
|
||||
PageHelper.startPage(new Page<>(smsPushEventUser.getPage(), smsPushEventUser.getSize()));
|
||||
Long mainShopId = shopInfoService.getMainIdByShopId(smsPushEventUser.getShopId());
|
||||
// 调用Mapper层查询
|
||||
return shopUserMapper.selectPushEventUser(
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@
|
|||
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'
|
||||
</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)">
|
||||
AND
|
||||
|
|
|
|||
|
|
@ -472,12 +472,12 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|||
});
|
||||
}
|
||||
|
||||
//总商品支付金额 不包含打包费 用来计算后续
|
||||
if (prodCouponAmount.getPrice().compareTo(param.getProductCouponDiscountAmount()) != 0) {
|
||||
log.info("支付计算金额不正确:商品券抵扣金额为:{},传递为:{}", prodCouponAmount.getPrice(), param.getProductCouponDiscountAmount());
|
||||
throw new ValidateException("生成支付订单失败,商品优惠券优惠金额不正确");
|
||||
}
|
||||
orderInfo.setOriginAmount(param.getOriginAmount());
|
||||
//总商品支付金额 不包含打包费 用来计算后续
|
||||
BigDecimal newTotalAmount = totalAmount.getPrice();
|
||||
|
||||
//减去商品优惠券
|
||||
|
|
@ -536,11 +536,11 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|||
}
|
||||
if (newTotalAmount.compareTo(param.getOrderAmount()) != 0) {
|
||||
log.info("""
|
||||
支付计算金额不正确,订单Id:{},支付计算金额为:{},商品总金额:{},打包费:{},餐位费:{},
|
||||
传递支付金额为:{},商品券:{},其它券:{},新客立减:{},满减活动:{},
|
||||
商家最终改价:{},积分抵扣金额:{},抹零金额:{}
|
||||
""",
|
||||
orderInfo.getId(), newTotalAmount, totalAmount.getPrice(), packAmount.getPrice(), orderInfo.getSeatAmount(),
|
||||
支付计算金额不正确,订单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());
|
||||
throw new ValidateException("生成支付订单失败,支付金额不正确");
|
||||
|
|
@ -675,7 +675,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|||
// log.info("商品券 计算 orderDetails:{}", orderDetails);
|
||||
BigDecimal remaining = new BigDecimal(discountNum);
|
||||
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(detail.getNum().subtract(detail.getReturnNum())) >= 0) {
|
||||
detail.setCouponNum(detail.getNum().subtract(detail.getReturnNum()).setScale(2, RoundingMode.CEILING));
|
||||
|
|
|
|||
Loading…
Reference in New Issue