|
|
@@ -123,14 +123,16 @@ public class PromoterUserServiceImpl implements PromoterUserService {
|
|
|
if (promoter != null) {
|
|
|
throw new CustomerException("该应用已绑定推广人!");
|
|
|
}
|
|
|
+ // 校验推广分成比例合法性,数据处理
|
|
|
if (StrUtil.isNotEmpty(assignParam.getShareRate())) {
|
|
|
BigDecimal shareRate = NumberUtils.rateToBigDecimal(assignParam.getShareRate());
|
|
|
if (BigDecimal.ZERO.compareTo(shareRate) > 0) {
|
|
|
throw new CustomerException("分成比例不得小于0");
|
|
|
}
|
|
|
- if (new BigDecimal("1").compareTo(shareRate) < 0) {
|
|
|
+ if (BigDecimal.ONE.compareTo(shareRate) < 0) {
|
|
|
throw new CustomerException("分成比例不得大于100%");
|
|
|
}
|
|
|
+ assignParam.setShareRate(StrUtil.trim(assignParam.getShareRate().replace("%", "")));
|
|
|
}
|
|
|
// 开始时间为空则默认当前时间
|
|
|
if (assignParam.getStartTime() == null) {
|
|
|
@@ -148,7 +150,7 @@ public class PromoterUserServiceImpl implements PromoterUserService {
|
|
|
promoter.setOperatorId(userInfo.getUserId());
|
|
|
promoter.setOperatorTime(new Date());
|
|
|
promoterUserMapper.insertPromoter(promoter);
|
|
|
- log.info("[agent promoter]渠道商为应用{}指派推广人{}", ytApp.getAppId(), assignParam.getUserId());
|
|
|
+ log.info("[agent promoter]渠道商为应用{}指派推广人:{}", ytApp.getAppId(), assignParam.getUserId());
|
|
|
return RepMessage.SAVE_SUCCESS;
|
|
|
}
|
|
|
|