Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
@@ -28,7 +28,7 @@ public interface MkShopRechargeService extends IService<MkShopRecharge> {
|
|||||||
|
|
||||||
BigDecimal checkRecharge(Long mainShopId, @NotNull(message = "店铺不能为空") Long shopId, Long userId, Long rechargeDetailId, @DecimalMin("0.01") BigDecimal money);
|
BigDecimal checkRecharge(Long mainShopId, @NotNull(message = "店铺不能为空") Long shopId, Long userId, Long rechargeDetailId, @DecimalMin("0.01") BigDecimal money);
|
||||||
|
|
||||||
void recharge(Long shopId, Long shopUserId, Long relatedId, BigDecimal amount, Long paymentId, String payType, ShopUserFlowBizEnum bizEnum);
|
void recharge(Long shopId, Long shopUserId, Long rechargeDetailId, BigDecimal amount, Long paymentId, String payType, ShopUserFlowBizEnum bizEnum);
|
||||||
|
|
||||||
List<RechargeListVO> getList(long loginIdAsLong);
|
List<RechargeListVO> getList(long loginIdAsLong);
|
||||||
|
|
||||||
|
|||||||
@@ -156,8 +156,8 @@ public class MkShopRechargeServiceImpl extends ServiceImpl<MkShopRechargeMapper,
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void recharge(Long shopId, Long shopUserId, Long relatedId, BigDecimal amount, Long paymentId, String payType, ShopUserFlowBizEnum bizEnum) {
|
public void recharge(Long shopId, Long shopUserId, Long rechargeDetailId, BigDecimal amount, Long paymentId, String payType, ShopUserFlowBizEnum bizEnum) {
|
||||||
log.info("充值回调, 用户id: {}, 金额: {}, 关联id: {}", shopUserId, amount, relatedId);
|
log.info("充值回调, 用户id: {}, 金额: {}, rechargeDetailId: {}", shopUserId, amount, rechargeDetailId);
|
||||||
ShopUser shopUser = shopUserService.getById(shopUserId);
|
ShopUser shopUser = shopUserService.getById(shopUserId);
|
||||||
ShopUserMoneyEditDTO shopUserMoneyEditDTO = new ShopUserMoneyEditDTO()
|
ShopUserMoneyEditDTO shopUserMoneyEditDTO = new ShopUserMoneyEditDTO()
|
||||||
.setId(shopUserId)
|
.setId(shopUserId)
|
||||||
@@ -165,8 +165,8 @@ public class MkShopRechargeServiceImpl extends ServiceImpl<MkShopRechargeMapper,
|
|||||||
.setBizEnum(bizEnum)
|
.setBizEnum(bizEnum)
|
||||||
.setRelationId(paymentId);
|
.setRelationId(paymentId);
|
||||||
// 标准充值
|
// 标准充值
|
||||||
if (relatedId != null) {
|
if (rechargeDetailId != null) {
|
||||||
MkShopRechargeDetail rechargeDetail = shopRechargeDetailService.getById(relatedId);
|
MkShopRechargeDetail rechargeDetail = shopRechargeDetailService.getById(rechargeDetailId);
|
||||||
shopUserMoneyEditDTO.setMoney(rechargeDetail.getAmount().add(rechargeDetail.getRewardAmount()));
|
shopUserMoneyEditDTO.setMoney(rechargeDetail.getAmount().add(rechargeDetail.getRewardAmount()));
|
||||||
// 发放积分
|
// 发放积分
|
||||||
if (rechargeDetail.getRewardPoints() != null) {
|
if (rechargeDetail.getRewardPoints() != null) {
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import com.czg.account.entity.*;
|
|||||||
import com.czg.account.service.*;
|
import com.czg.account.service.*;
|
||||||
import com.czg.config.RabbitPublisher;
|
import com.czg.config.RabbitPublisher;
|
||||||
import com.czg.config.RedisCst;
|
import com.czg.config.RedisCst;
|
||||||
|
import com.czg.constant.TableValueConstant;
|
||||||
import com.czg.entity.notify.CzgPayNotifyDTO;
|
import com.czg.entity.notify.CzgPayNotifyDTO;
|
||||||
import com.czg.entity.notify.CzgRefundNotifyDTO;
|
import com.czg.entity.notify.CzgRefundNotifyDTO;
|
||||||
import com.czg.enums.ShopTableStatusEnum;
|
import com.czg.enums.ShopTableStatusEnum;
|
||||||
@@ -843,6 +844,8 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|||||||
|
|
||||||
// 会员加入
|
// 会员加入
|
||||||
memberConfigService.joinMemberByCondition(orderInfo.getShopId(), orderInfo.getUserId());
|
memberConfigService.joinMemberByCondition(orderInfo.getShopId(), orderInfo.getUserId());
|
||||||
|
// 会员消费赠送成长值
|
||||||
|
memberConfigService.deliver(orderInfo.getShopId(), orderInfo.getUserId(), TableValueConstant.MemberExpFlow.Type.COST, orderInfo.getPayAmount(), null, orderInfo.getId());
|
||||||
} else if ("memberIn".equals(payment.getPayType()) || "free".equals(payment.getPayType())) {
|
} else if ("memberIn".equals(payment.getPayType()) || "free".equals(payment.getPayType())) {
|
||||||
boolean isFree = "free".equals(payment.getPayType());
|
boolean isFree = "free".equals(payment.getPayType());
|
||||||
ShopUser shopUser = shopUserService.getById(payment.getSourceId());
|
ShopUser shopUser = shopUserService.getById(payment.getSourceId());
|
||||||
@@ -890,6 +893,10 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|||||||
} else if ("memberPay".equals(payment.getPayType())) {
|
} else if ("memberPay".equals(payment.getPayType())) {
|
||||||
ShopUser shopUser = shopUserService.getById(payment.getSourceId());
|
ShopUser shopUser = shopUserService.getById(payment.getSourceId());
|
||||||
memberConfigService.joinMember(payment.getShopId(), shopUser.getUserId(), payment.getRelatedId());
|
memberConfigService.joinMember(payment.getShopId(), shopUser.getUserId(), payment.getRelatedId());
|
||||||
|
|
||||||
|
// 充值赠送积分
|
||||||
|
memberConfigService.deliver(shopUser.getMainShopId(), shopUser.getUserId(), TableValueConstant.MemberExpFlow.Type.COST, payment.getAmount(), null, payment.getId());
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user