zoujiajian há 11 meses atrás
pai
commit
dc2475cf4b

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/gzh/factory/EventMsgService.java

@@ -453,7 +453,7 @@ public class EventMsgService implements GzhMsgService {
 							return;
 						}
 						//发送nano 体验卡
-						Long relationId = groupRelationFrontService.getTrialTicketByUserIdAndGoodsId(user.getId(), Constant.DISTRIBUTE_NANO_TRIAL_SKU_ID, 1);
+						Long relationId = groupRelationFrontService.getTrialTicketByUserIdAndGoodsId(user.getId(), Constant.DISTRIBUTE_NANO_TRIAL_SKU_ID, 2);
 						recordReceiveNanoRecord(user.getId(), relationId);
 						//创建nano user
 						createNanoUser(user.getId(), relationId, goodsDonSkuMapper.selectById(Constant.DISTRIBUTE_NANO_TRIAL_SKU_ID));

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/nano/impl/NanoServiceImpl.java

@@ -58,7 +58,7 @@ public class NanoServiceImpl implements NanoService {
 			}
 		}
 		if (nanoUserQuota == null) {
-			nanoUserQuota = nanoUserQuotaMapper.selectOne(Wrappers.lambdaQuery(NanoUserQuota.class).in(NanoUserQuota::getUid, userIdList).last("limit 1"));
+			nanoUserQuota = nanoUserQuotaMapper.selectOne(Wrappers.lambdaQuery(NanoUserQuota.class).in(NanoUserQuota::getUid, userIdList).orderByDesc(NanoUserQuota::getTotalQuota).orderByDesc(NanoUserQuota::getRemainingQuota).last("limit 1"));
 		}
 		if (nanoUserQuota != null) {
 			NanoUserQuotaInfoView nanoUserQuotaInfoView = new NanoUserQuotaInfoView();

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/user/impl/UserServiceImpl.java

@@ -1014,7 +1014,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
 						return;
 					}
 					//发送nano 体验卡
-					Long relationId = groupRelationFrontService.getTrialTicketByUserIdAndGoodsId(user.getId(), Constant.DISTRIBUTE_NANO_TRIAL_SKU_ID, 1);
+					Long relationId = groupRelationFrontService.getTrialTicketByUserIdAndGoodsId(user.getId(), Constant.DISTRIBUTE_NANO_TRIAL_SKU_ID, 2);
 					recordReceiveNanoRecord(user.getId(), relationId);
 					//创建nano user
 					createNanoUser(user.getId(), relationId, goodsDonSkuMapper.selectById(Constant.DISTRIBUTE_NANO_TRIAL_SKU_ID));

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/vip/impl/VipFrontServiceImpl.java

@@ -482,7 +482,7 @@ public class VipFrontServiceImpl implements VipFrontService {
 		if (remainNum == null) {
 			deductMoney = deductMoney.add(orderTotalMoney);
 		} else {
-			BigDecimal remainMoney = BigDecimal.valueOf(remainNum).divide(BigDecimal.valueOf(totalNum), 2, RoundingMode.DOWN).multiply(orderTotalMoney);
+			BigDecimal remainMoney = totalNum == 0 ? BigDecimal.ZERO : BigDecimal.valueOf(remainNum).divide(BigDecimal.valueOf(totalNum), 2, RoundingMode.DOWN).multiply(orderTotalMoney);
 			deductMoney = deductMoney.add(remainMoney);
 		}
 		return deductMoney;