|
|
@@ -243,11 +243,29 @@ public class DistributePopularizeController {
|
|
|
if (user == null) {
|
|
|
throw BusinessRuntimeException.getInstance("请先授权登录");
|
|
|
}
|
|
|
- if (ObjectUtil.hasEmpty(applyMoneyReq.getAccount(), applyMoneyReq.getRealName())) {
|
|
|
- throw BusinessRuntimeException.getInstance("必填项不能为空");
|
|
|
+ DistributeMoneyApply.Type type = applyMoneyReq.getType();
|
|
|
+ if (type != null && type == DistributeMoneyApply.Type.zfb) {
|
|
|
+ if (ObjectUtil.hasEmpty(applyMoneyReq.getAccount(), applyMoneyReq.getRealName())) {
|
|
|
+ throw BusinessRuntimeException.getInstance("必填项不能为空");
|
|
|
+ }
|
|
|
+ if (applyMoneyReq.getAccount().length() > 255 || applyMoneyReq.getRealName().length() > 32) {
|
|
|
+ throw BusinessRuntimeException.getInstance("请输入正确的账户信息");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (type != null && type == DistributeMoneyApply.Type.usdt) {
|
|
|
+ if (StrUtil.isEmpty(applyMoneyReq.getWalletAddr())) {
|
|
|
+ throw BusinessRuntimeException.getInstance("USDT提现钱包地址不能为空");
|
|
|
+ }
|
|
|
+ if (applyMoneyReq.getWalletAddr().length() > 1000) {
|
|
|
+ throw BusinessRuntimeException.getInstance("请输入正确的钱包地址");
|
|
|
+ }
|
|
|
+ if (StrUtil.isNotBlank(applyMoneyReq.getRemark()) && applyMoneyReq.getRemark().length() > 512) {
|
|
|
+ throw BusinessRuntimeException.getInstance("备注过多");
|
|
|
+ }
|
|
|
}
|
|
|
- if (applyMoneyReq.getAccount().length() > 255 || applyMoneyReq.getRealName().length() > 32) {
|
|
|
- throw BusinessRuntimeException.getInstance("请输入正确的账户信息");
|
|
|
+ DistributeMoneyApply distributeMoneyApply = null;
|
|
|
+ if (type != null && type == DistributeMoneyApply.Type.pwdRed) {
|
|
|
+ distributeMoneyApply = userDistributeMapper.selectRelationBusiness(userId);
|
|
|
}
|
|
|
Boolean isTakeAll = applyMoneyReq.getIsTakeAll();
|
|
|
BigDecimal userPoints = user.getPoints();
|
|
|
@@ -275,12 +293,13 @@ public class DistributePopularizeController {
|
|
|
}
|
|
|
Integer update = userMapper.subPoints(user.getId(), needSubPoints);
|
|
|
if (update == 1) {
|
|
|
- DistributeMoneyApply distributeMoneyApply = new DistributeMoneyApply();
|
|
|
distributeMoneyApply.setUserId(userId);
|
|
|
distributeMoneyApply.setPoints(needSubPoints);
|
|
|
distributeMoneyApply.setMoney(needApplyMoney);
|
|
|
distributeMoneyApply.setAccount(applyMoneyReq.getAccount());
|
|
|
distributeMoneyApply.setRealName(applyMoneyReq.getRealName());
|
|
|
+ distributeMoneyApply.setWalletAddr(applyMoneyReq.getWalletAddr());
|
|
|
+ distributeMoneyApply.setReason(applyMoneyReq.getRemark());
|
|
|
if (isTakeAll != null && isTakeAll) {
|
|
|
distributeMoneyApply.setVerifyStatus(DistributeMoneyApply.Status.verifying);
|
|
|
} else {
|