超级会员相关

This commit is contained in:
张松
2025-09-11 18:15:39 +08:00
parent 8ad76d3844
commit 9c728249f7
4 changed files with 20 additions and 17 deletions

View File

@@ -17,6 +17,7 @@ import com.czg.market.entity.ShopCoupon;
import com.czg.market.entity.TbMemberConfig;
import com.czg.market.service.MemberLevelConfigService;
import com.czg.market.service.TbMemberConfigService;
import com.czg.order.entity.MemberOrder;
import com.czg.order.entity.OrderInfo;
import com.czg.order.entity.OrderPayment;
import com.czg.order.service.OrderInfoService;
@@ -106,10 +107,10 @@ public class TbMemberConfigServiceImpl extends ServiceImpl<TbMemberConfigMapper,
memberConfig.setConfigList(JSONObject.toJSONString(memberDTO.getConfigList()));
}
if (memberConfig.getConfigList() != null && !memberConfig.getConfigList().isEmpty() &&
(memberConfig.getConditionList() != null || !memberConfig.getConditionList().isEmpty())) {
throw new CzgException("会员开通方式为单选条件");
}
// if (memberConfig.getConfigList() != null && !memberConfig.getConfigList().isEmpty() &&
// (memberConfig.getConditionList() != null || !memberConfig.getConditionList().isEmpty())) {
// throw new CzgException("会员开通方式为单选条件");
// }
if (memberDTO.getConditionList() != null && !memberDTO.getConditionList().isEmpty()) {
// ArrayList<String> conditionList = CollUtil.newArrayList(conditionMap);
@@ -238,7 +239,7 @@ public class TbMemberConfigServiceImpl extends ServiceImpl<TbMemberConfigMapper,
}
@Override
public boolean joinMember(Long shopId, Long userId) {
public boolean joinMember(Long shopId, Long userId, Long memberOrderId) {
MemberConfigVO memberConfigVO = detail(shopId);
ShopUser shopUser = shopUserService.getOne(new QueryWrapper().eq(ShopUser::getShopId, shopId).eq(ShopUser::getUserId, userId));
if (shopUser == null) {
@@ -246,8 +247,15 @@ public class TbMemberConfigServiceImpl extends ServiceImpl<TbMemberConfigMapper,
return false;
}
boolean canOpen = false;
// 条件开通
if (memberConfigVO.getOpenAmount() == null) {
// 购买开通
if (memberOrderId != null) {
// MemberOrder memberOrder = memberOrderService.getOne(new QueryWrapper().eq(MemberOrder::getId, payment.getRelatedId()));
// if (memberOrder == null) {
// log.warn("会员购买支付失败会员订单不存在会员订单id{}", payment.getRelatedId());
// return;
// }
// 条件开通
} else if ("CONDITION".equals(memberConfigVO.getOpenType())){
for (MemberConfigDTO.condition item : memberConfigVO.getConditionList()) {
canOpen = switch (item.getCode()) {
case "BIND_PHONE" -> StrUtil.isNotBlank(shopUser.getPhone());
@@ -266,9 +274,6 @@ public class TbMemberConfigServiceImpl extends ServiceImpl<TbMemberConfigMapper,
};
}
// 购买开通
} else {
}
if (canOpen) {