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

This commit is contained in:
张松
2025-10-31 17:08:35 +08:00
3 changed files with 33 additions and 15 deletions

View File

@@ -124,16 +124,10 @@ public class MkDistributionUserServiceImpl extends ServiceImpl<MkDistributionUse
PageHelper.startPage(page, size); PageHelper.startPage(page, size);
List<DistributionCenterShopVO> unActivates = mapper.selectUnDistributionShops(userId); List<DistributionCenterShopVO> unActivates = mapper.selectUnDistributionShops(userId);
for (DistributionCenterShopVO unActivate : unActivates) { for (DistributionCenterShopVO unActivate : unActivates) {
//'pay购买开通 auto自动开通 manual手动开通'
if ("pay".equals(unActivate.getOpenType())) {
if (unActivate.getShopUser() == 1) {
unActivate.setLabelContent("曾进入过店铺");
}
} else if ("auto".equals(unActivate.getOpenType())) {
if (unActivate.getOrderCount() == 1) { if (unActivate.getOrderCount() == 1) {
unActivate.setLabelContent("在本店下单过"); unActivate.setLabelContent("在本店下单过");
} }else if (unActivate.getShopUser() == 1) {
unActivate.setLabelContent("曾进入过店铺");
} }
// else if("manual".equals(unActivate.getOpenType())){ // else if("manual".equals(unActivate.getOpenType())){
// unActivate.setLabelContent("manual手动开通"); // unActivate.setLabelContent("manual手动开通");

View File

@@ -92,7 +92,22 @@ public class MkLimitTimeDiscountServiceImpl extends ServiceImpl<MkLimitTimeDisco
@Override @Override
public MkLimitTimeDiscount getLimitTimeDiscountByShopId(Long shopId) { public MkLimitTimeDiscount getLimitTimeDiscountByShopId(Long shopId) {
Long mainShopId = shopInfoService.getMainIdByShopId(shopId); Long mainShopId = shopInfoService.getMainIdByShopId(shopId);
return mapper.selectOneByShopId(mainShopId, shopId, CzgStrUtils.getStrWeek()); MkLimitTimeDiscount limitTimeDiscount = mapper.selectOneByShopId(mainShopId, shopId, CzgStrUtils.getStrWeek());
if (limitTimeDiscount != null && limitTimeDiscount.getFoodType() == 2 && StrUtil.isNotBlank(limitTimeDiscount.getFoods())) {
List<String> foodIds = Arrays.stream(limitTimeDiscount.getFoods().split(","))
.map(String::trim)
.filter(StrUtil::isNotBlank)
.distinct()
.toList();
List<String> ids = productService.listAs(QueryWrapper.create().select(Product::getId)
.eq(Product::getShopId, shopId).in(Product::getSyncId, foodIds), String.class);
if (CollUtil.isEmpty(ids)) {
limitTimeDiscount.setFoods("");
} else {
limitTimeDiscount.setFoods(String.join(",", ids));
}
}
return limitTimeDiscount;
} }
@Override @Override

View File

@@ -216,9 +216,18 @@ public class PayServiceImpl implements PayService {
} }
payParam.getCheckOrderPay().setUserId(shopUser.getUserId()); payParam.getCheckOrderPay().setUserId(shopUser.getUserId());
OrderInfo orderInfo = checkPay(payParam.getCheckOrderPay()); OrderInfo orderInfo = checkPay(payParam.getCheckOrderPay());
if (!shopUser.getSourceShopId().equals(orderInfo.getShopId()) && !shopUser.getMainShopId().equals(orderInfo.getShopId())) { if (shopInfo.getIsHeadShop().equals(1)) {
if (!shopUser.getMainShopId().equals(orderInfo.getShopId())) {
return CzgResult.failure("违规操作,请确认店铺后重试"); return CzgResult.failure("违规操作,请确认店铺后重试");
} }
} else {
boolean exists = shopInfoService.exists(QueryWrapper.create()
.eq(ShopInfo::getMainId, shopInfo.getMainId())
.eq(ShopInfo::getId, orderInfo.getShopId()));
if(!exists){
return CzgResult.failure("违规操作,请确认店铺后重试");
}
}
if (shopUser.getAmount().compareTo(orderInfo.getOrderAmount()) < 0) { if (shopUser.getAmount().compareTo(orderInfo.getOrderAmount()) < 0) {
return CzgResult.failure("会员余额不足"); return CzgResult.failure("会员余额不足");
} }