|
|
@@ -1885,17 +1885,18 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
|
|
|
if (order.getOrderType() == 1 && order.getGoodsId() == Constant.NANO_GOODS_ID) {
|
|
|
//创建nano user
|
|
|
- createNanoUser(order.getUserId(), sku);
|
|
|
+ createNanoUser(order.getUserId(), order.getRelationId(), sku);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void createNanoUser(Long userId, GoodsDonSku sku) {
|
|
|
+ private void createNanoUser(Long userId, Long relationId, GoodsDonSku sku) {
|
|
|
try {
|
|
|
User user = userMapper.selectById(userId);
|
|
|
NanoUserQuota nanoUserQuota = new NanoUserQuota();
|
|
|
nanoUserQuota.setUid(userId);
|
|
|
+ nanoUserQuota.setRelationId(relationId);
|
|
|
nanoUserQuota.setUserToken(UUID.randomUUID().toString());
|
|
|
nanoUserQuota.setNickname(user.getNickname());
|
|
|
nanoUserQuota.setAvatar(user.getHeadimgurl());
|
|
|
@@ -4343,6 +4344,18 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //nano
|
|
|
+ if (upgradePackage.getGoodsId() == Constant.NANO_GOODS_ID) {
|
|
|
+ NanoUserQuota nanoUserQuota = nanoUserQuotaMapper.selectOne(Wrappers.lambdaQuery(NanoUserQuota.class).eq(NanoUserQuota::getRelationId, orderDon.getRelationId()));
|
|
|
+ if (nanoUserQuota != null) {
|
|
|
+ int update = nanoUserQuotaMapper.update(null, Wrappers.lambdaUpdate(NanoUserQuota.class)
|
|
|
+ .set(NanoUserQuota::getRemainingQuota, nanoUserQuota.getRemainingQuota() + upgradePackage.getNum()).eq(NanoUserQuota::getId, nanoUserQuota.getId()));
|
|
|
+ if (update == 0) {
|
|
|
+ log.info("nano user 套餐包增值失败 id:{},orderId:{}", nanoUserQuota.getId(), orderDon.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//银河币返回
|
|
|
returnUpgradeGalaxyCoin(orderDon);
|
|
|
//查看该订单是否有关闭的余额
|