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) {
if (unActivate.getOrderCount() == 1) {
//'pay购买开通 auto自动开通 manual手动开通' unActivate.setLabelContent("在本店下单过");
if ("pay".equals(unActivate.getOpenType())) { }else if (unActivate.getShopUser() == 1) {
if (unActivate.getShopUser() == 1) { unActivate.setLabelContent("曾进入过店铺");
unActivate.setLabelContent("曾进入过店铺");
}
} else if ("auto".equals(unActivate.getOpenType())) {
if (unActivate.getOrderCount() == 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

@@ -203,7 +203,7 @@ public class PayServiceImpl implements PayService {
AssertUtil.isNull(shopUser, "会员不存在"); AssertUtil.isNull(shopUser, "会员不存在");
UserInfo userInfo = userInfoService.getById(shopUser.getUserId()); UserInfo userInfo = userInfoService.getById(shopUser.getUserId());
AssertUtil.isNull(userInfo, "用户信息不存在"); AssertUtil.isNull(userInfo, "用户信息不存在");
if (userInfo.getUsePayPwd() == 1 ) { if (userInfo.getUsePayPwd() == 1) {
AssertUtil.isBlank(payParam.getPwd(), "支付密码不能为空"); AssertUtil.isBlank(payParam.getPwd(), "支付密码不能为空");
if (userInfo.getPayPwd() == null || !userInfo.getPayPwd().equals(MD5Util.md5AsHex(payParam.getPwd()))) { if (userInfo.getPayPwd() == null || !userInfo.getPayPwd().equals(MD5Util.md5AsHex(payParam.getPwd()))) {
return CzgResult.failure("支付密码错误"); return CzgResult.failure("支付密码错误");
@@ -216,8 +216,17 @@ 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)) {
return CzgResult.failure("违规操作,请确认店铺后重试"); if (!shopUser.getMainShopId().equals(orderInfo.getShopId())) {
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("会员余额不足");
@@ -501,7 +510,7 @@ public class PayServiceImpl implements PayService {
boolean isFree = checkPayVip(rechargeDTO); boolean isFree = checkPayVip(rechargeDTO);
Long mainShopId = shopInfoService.getMainIdByShopId(rechargeDTO.getShopId()); Long mainShopId = shopInfoService.getMainIdByShopId(rechargeDTO.getShopId());
ShopUser shopUser = shopUserService.getOne(new QueryWrapper().eq(ShopUser::getMainShopId,mainShopId) ShopUser shopUser = shopUserService.getOne(new QueryWrapper().eq(ShopUser::getMainShopId, mainShopId)
.eq(ShopUser::getId, shopUserId)); .eq(ShopUser::getId, shopUserId));
AssertUtil.isNull(shopUser, "充值失败 该店铺用户不存在"); AssertUtil.isNull(shopUser, "充值失败 该店铺用户不存在");
MkShopRechargeVO rechargeVO = shopRechargeService.detail(rechargeDTO.getShopId()); MkShopRechargeVO rechargeVO = shopRechargeService.detail(rechargeDTO.getShopId());