多余 注释
This commit is contained in:
@@ -113,14 +113,12 @@ public class MkConsumeCashbackServiceImpl extends ServiceImpl<MkConsumeCashbackM
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void cashback(Long shopId, Long userId, BigDecimal amount, Long orderId, String orderNo) {
|
||||
AssertUtil.isTrue(amount == null || amount.compareTo(BigDecimal.ZERO) == 0, "金额必须大于0");
|
||||
log.info("消费返现1, shopId: {}, userId: {}, amount: {}, orderId: {}, orderNo: {}", shopId, userId, amount, orderId, orderNo);
|
||||
Long mainShopId = shopInfoService.getMainIdByShopId(shopId);
|
||||
MkConsumeCashbackVO config = detail(mainShopId);
|
||||
if (config.getIsEnable() == 0) {
|
||||
log.info("消费返现未开启, {}", shopId);
|
||||
return;
|
||||
}
|
||||
log.info("消费返现2, orderId: {}, orderNo: {}, config: {}", orderId, orderNo, config);
|
||||
ShopUser shopUser = shopUserService.getOne(new QueryWrapper().eq(ShopUser::getMainShopId, mainShopId).eq(ShopUser::getUserId, userId));
|
||||
if (StrUtil.isNotBlank(config.getApplicableUser()) && !"all".equals(config.getApplicableUser())) {
|
||||
if ("new".equals(config.getApplicableUser())) {
|
||||
@@ -134,12 +132,10 @@ public class MkConsumeCashbackServiceImpl extends ServiceImpl<MkConsumeCashbackM
|
||||
}
|
||||
}
|
||||
List<MkConsumeCashbackStep> cashbackStepList = config.getCashbackStepList();
|
||||
log.info("消费返现2, orderId: {}, cashbackStepList:{}", orderId, cashbackStepList);
|
||||
if (CollUtil.isNotEmpty(cashbackStepList)) {
|
||||
|
||||
config.setCashbackStepList(cashbackStepList.stream().sorted(Comparator.comparing(MkConsumeCashbackStep::getAmount).reversed()).collect(Collectors.toList()));
|
||||
for (MkConsumeCashbackStep cashbackStep : config.getCashbackStepList()) {
|
||||
log.info("消费返现3, cashbackStep: {}, userId: {}, amount: {}, orderId: {}", cashbackStep, userId, amount, orderId);
|
||||
if (cashbackStep.getAmount().compareTo(amount) <= 0) {
|
||||
BigDecimal cashbackAmount;
|
||||
// 固定金额
|
||||
@@ -159,17 +155,10 @@ public class MkConsumeCashbackServiceImpl extends ServiceImpl<MkConsumeCashbackM
|
||||
shopUserService.updateMoney(new ShopUserMoneyEditDTO().setId(shopUser.getId()).setType(1)
|
||||
.setRelationId(mkConsumeCashbackRecord.getId()).setMoney(cashbackAmount).setBizEnum(ShopUserFlowBizEnum.CASHBACK)
|
||||
.setRemark(StrUtil.format("订单消费: {}, 返现: {}", amount, cashbackAmount)));
|
||||
log.info("店铺用户id: {}, 消费返现: {}, 返现: {}", shopUser.getId(), amount, cashbackAmount);
|
||||
log.info("订单返现 订单ID:{}, 店铺用户id: {}, 订单消费: {}, 返现: {}",orderId, shopUser.getId(), amount, cashbackAmount);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
long count = 15L;
|
||||
if (count > 0) {
|
||||
System.out.println(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user