去掉最低充值限制

master
wjt 1 year ago
parent a9b8decb78
commit a132525cb8

@ -61,7 +61,7 @@ public class ChannelManageServiceImpl implements ChannelManageService {
for (ChannelCustom channelCustom : content) {
Long parentId = channelCustom.getId();
if (userMap.containsKey(parentId)) {
List<ChannelCustom> list = userMap.get(parentId);
List<ChannelCustom> list = userMap.get(parentId).stream().sorted(Comparator.comparing(ChannelCustom::getCreateTime).reversed()).collect(Collectors.toList());
if (CollUtil.isNotEmpty(list)) {
List<ChannelCustom> normalNums = list.stream().filter(c -> c.getStatus() == DefaultNumberConstants.ONE_NUMBER).collect(Collectors.toList());
List<ChannelCustom> waitNums = list.stream().filter(c -> c.getStatus() == DefaultNumberConstants.TWO_NUMBER).collect(Collectors.toList());

@ -85,15 +85,15 @@ public class CustomManageServiceImpl implements CustomManageService {
ChannelCustom parent = getChannelCustomByUserId();
//设置分配
if (channelCustom.getTotalNum() != null && channelCustom.getTotalNum() > 0) {
if (channelCustom.getType() == DefaultNumberConstants.ONE_NUMBER) {
if (channelCustom.getTotalNum() < DefaultNumberConstants.TEN_THOUSAND) {
return CommonResponse.createByErrorMessage("渠道商账号最低分配1万");
}
} else {
if (channelCustom.getTotalNum() < DefaultNumberConstants.ONE_THOUSAND) {
return CommonResponse.createByErrorMessage("直客账号最低分配1000");
}
}
// if (channelCustom.getType() == DefaultNumberConstants.ONE_NUMBER) {
// if (channelCustom.getTotalNum() < DefaultNumberConstants.TEN_THOUSAND) {
// return CommonResponse.createByErrorMessage("渠道商账号最低分配1万");
// }
// } else {
// if (channelCustom.getTotalNum() < DefaultNumberConstants.ONE_THOUSAND) {
// return CommonResponse.createByErrorMessage("直客账号最低分配1000");
// }
// }
if (parent.getSurplusNum() == null || parent.getSurplusNum() < channelCustom.getTotalNum()) {
return CommonResponse.createByErrorMessage("可分配的余量不足");
}
@ -102,9 +102,6 @@ public class CustomManageServiceImpl implements CustomManageService {
parent.setSurplusNum(parent.getSurplusNum() - channelCustom.getTotalNum());
parent.setCreateTime(DateUtil.date());
channelCustomRepository.save(parent);
//分配记录
ChannelResourceAssign channelResourceAssign = new ChannelResourceAssign().addChannelResourceAssign(parent.getId(), channelCustom.getTotalNum(), channelCustom.getId(), channelCustom.getChannelName());
channelResourceAssignRepository.save(channelResourceAssign);
}
//激活码
@ -135,6 +132,11 @@ public class CustomManageServiceImpl implements CustomManageService {
}
channelCustom.setCreateTime(DateUtil.date());
channelCustomRepository.save(channelCustom);
if (channelCustom.getSurplusNum() != null && channelCustom.getSurplusNum() > 0) {
//分配记录
ChannelResourceAssign channelResourceAssign = new ChannelResourceAssign().addChannelResourceAssign(parent.getId(), channelCustom.getTotalNum(), channelCustom.getId(), channelCustom.getChannelName());
channelResourceAssignRepository.save(channelResourceAssign);
}
return CommonResponse.createBySuccess();
}
@ -144,15 +146,15 @@ public class CustomManageServiceImpl implements CustomManageService {
ChannelCustom channelCustom = channelCustomRepository.findById(customId).orElse(new ChannelCustom());
ChannelCustom parent = channelCustomRepository.findById(channelCustom.getParentId()).orElse(new ChannelCustom());
int parentSurplusNum = parent.getSurplusNum();
if (channelCustom.getType() == DefaultNumberConstants.ONE_NUMBER) {
if (assignNum < DefaultNumberConstants.TEN_THOUSAND) {
return CommonResponse.createByErrorMessage("渠道商账号最低分配1万");
}
} else {
if (assignNum < DefaultNumberConstants.ONE_THOUSAND) {
return CommonResponse.createByErrorMessage("直客账号最低分配1000");
}
}
// if (channelCustom.getType() == DefaultNumberConstants.ONE_NUMBER) {
// if (assignNum < DefaultNumberConstants.TEN_THOUSAND) {
// return CommonResponse.createByErrorMessage("渠道商账号最低分配1万");
// }
// } else {
// if (assignNum < DefaultNumberConstants.ONE_THOUSAND) {
// return CommonResponse.createByErrorMessage("直客账号最低分配1000");
// }
// }
if (parentSurplusNum < assignNum) {
return CommonResponse.createByErrorMessage("可分配的余量不足");
}

Loading…
Cancel
Save