Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
commit
87a9d8b976
|
|
@ -132,6 +132,10 @@ public class MemberPointsServiceImpl extends ServiceImpl<MemberPointsMapper, Mem
|
|||
dto.setUnusableReason("积分不足或小于最低使用门槛" + dto.getMinDeductionPoints());
|
||||
return dto;
|
||||
}
|
||||
|
||||
if (basic.getEquivalentPoints() == 0) {
|
||||
return dto;
|
||||
}
|
||||
// 下单抵扣积分比例 1元=?积分
|
||||
Integer equivalentPoints = basic.getEquivalentPoints();
|
||||
// 计算账户积分=?元
|
||||
|
|
|
|||
|
|
@ -294,27 +294,6 @@ public class ShopCouponServiceImpl extends ServiceImpl<ShopCouponMapper, ShopCou
|
|||
Map<Long, JSONObject> coupons = new HashMap<>();
|
||||
for (UserCouponVo tbUserCouponVo : tbUserCouponVos) {
|
||||
int maxShow = 5;
|
||||
// if (StrUtil.isNotBlank(tbUserCouponVo.getFoods())) {
|
||||
// List<String> productNames = productService.listAs(new QueryWrapper().select(Product::getName)
|
||||
// .in(Product::getId, Arrays.stream(tbUserCouponVo.getFoods().split(",")).map(Long::parseLong).toList())
|
||||
// .eq(Product::getIsDel, 0), String.class);
|
||||
// if (CollUtil.isNotEmpty(productNames)) {
|
||||
// StringBuilder result = new StringBuilder();
|
||||
// for (int i = 0; i < productNames.size(); i++) {
|
||||
// if (i > 0) {
|
||||
// result.append(",");
|
||||
// }
|
||||
// result.append(productNames.get(i));
|
||||
// if (i == maxShow - 1 && i != productNames.size() - 1) {
|
||||
// result.append("...");
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// tbUserCouponVo.setFoods(result.toString());
|
||||
// }
|
||||
// } else {
|
||||
// tbUserCouponVo.setFoods("全部商品");
|
||||
// }
|
||||
if ("only".equals(tbUserCouponVo.getUseShopType())) {
|
||||
ShopInfo shopInfo = shopInfoService.getById(tbUserCouponVo.getShopId());
|
||||
tbUserCouponVo.setUseShops("仅本店:" + shopInfo.getShopName());
|
||||
|
|
@ -322,7 +301,6 @@ public class ShopCouponServiceImpl extends ServiceImpl<ShopCouponMapper, ShopCou
|
|||
tbUserCouponVo.setUseShops("所有门店");
|
||||
} else if ("custom".equals(tbUserCouponVo.getUseShopType())) {
|
||||
if (StrUtil.isNotBlank(tbUserCouponVo.getUseShops())) {
|
||||
tbUserCouponVo.setUseShops(tbUserCouponVo.getUseShops() + "," + tbUserCouponVo.getShopId());
|
||||
QueryWrapper queryWrapper = QueryWrapper.create().select(ShopInfo::getShopName)
|
||||
.in(ShopInfo::getId, Arrays.stream(tbUserCouponVo.getUseShops().split(",")).map(Long::parseLong).toList())
|
||||
.eq(ShopInfo::getStatus, 1);
|
||||
|
|
@ -349,12 +327,13 @@ public class ShopCouponServiceImpl extends ServiceImpl<ShopCouponMapper, ShopCou
|
|||
JSONObject couponJson = coupons.get(tbUserCouponVo.getCouponId());
|
||||
tbUserCouponVo.setUseRestrictions(couponJson.getString("useRestrictions"));
|
||||
tbUserCouponVo.setUse(couponJson.getBoolean("isUse"));
|
||||
if (tbUserCouponVo.getType() == 2 || tbUserCouponVo.getType() == 4 || tbUserCouponVo.getType() == 6) {
|
||||
if (tbUserCouponVo.getType() == 1 ||tbUserCouponVo.getType() == 2 || tbUserCouponVo.getType() == 4 || tbUserCouponVo.getType() == 6) {
|
||||
if (StrUtil.isNotBlank(tbUserCouponVo.getFoods()) && !",".equals(tbUserCouponVo.getFoods())) {
|
||||
List<Long> couponFoodIds = Arrays.stream(tbUserCouponVo.getFoods().split(",")).map(Long::parseLong).toList();
|
||||
if (CollUtil.isNotEmpty(couponFoodIds)) {
|
||||
List<Product> list = productService.list(new QueryWrapper()
|
||||
.in(Product::getId, couponFoodIds).eq(Product::getIsDel, 0));
|
||||
log.info("优惠券商品列表:{}", list);
|
||||
if (CollUtil.isEmpty(list)) {
|
||||
continue;
|
||||
}
|
||||
|
|
@ -366,6 +345,10 @@ public class ShopCouponServiceImpl extends ServiceImpl<ShopCouponMapper, ShopCou
|
|||
tbUserCouponVo.setThresholdFoods(JSON.parseObject(JSON.toJSONString(list), new TypeReference<>() {
|
||||
}));
|
||||
}
|
||||
String foods = list.stream().map(Product::getName).collect(Collectors.joining(","));
|
||||
tbUserCouponVo.setFoods(foods);
|
||||
} else {
|
||||
tbUserCouponVo.setFoods("全部商品");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ public class PayServiceImpl implements PayService {
|
|||
}
|
||||
payParam.getCheckOrderPay().setUserId(shopUser.getUserId());
|
||||
OrderInfo orderInfo = checkPay(payParam.getCheckOrderPay());
|
||||
if (!shopUser.getSourceShopId().equals(orderInfo.getShopId())) {
|
||||
if (!shopUser.getSourceShopId().equals(orderInfo.getShopId()) && !shopUser.getMainShopId().equals(orderInfo.getShopId())) {
|
||||
return CzgResult.failure("违规操作,请确认店铺后重试");
|
||||
}
|
||||
if (shopUser.getAmount().compareTo(orderInfo.getOrderAmount()) < 0) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue