|
@@ -4,6 +4,8 @@ import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
+import com.txz.cif.core.ResultCode;
|
|
|
|
+import com.txz.cif.core.ResultGenerator;
|
|
import com.txz.cif.core.ServiceException;
|
|
import com.txz.cif.core.ServiceException;
|
|
import com.txz.cif.dto.AccountDTO;
|
|
import com.txz.cif.dto.AccountDTO;
|
|
import com.txz.cif.dto.Result;
|
|
import com.txz.cif.dto.Result;
|
|
@@ -90,6 +92,15 @@ public class AccountDubboServiceImpl implements AccountDubboService {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public Result openGroup(OpenParam param) {
|
|
public Result openGroup(OpenParam param) {
|
|
|
|
+ if (param == null){
|
|
|
|
+ return Result.genFailResult("对象为空");
|
|
|
|
+ }
|
|
|
|
+ if (param.getUserId() == null){
|
|
|
|
+ return Result.genFailResult("userId为空");
|
|
|
|
+ }
|
|
|
|
+ if (param.getAmount() == null){
|
|
|
|
+ return Result.genFailResult("Amount为空");
|
|
|
|
+ }
|
|
// 支付
|
|
// 支付
|
|
// BizTypeEnum 类型 1001充值 2001提现 3001开团支付 3002参团支付 4001未成团退款 4002成团退款 5001开团红包收益 5002参团红包收益 5003签到红包收益 5004下级红包佣金 5005下下级红包佣金
|
|
// BizTypeEnum 类型 1001充值 2001提现 3001开团支付 3002参团支付 4001未成团退款 4002成团退款 5001开团红包收益 5002参团红包收益 5003签到红包收益 5004下级红包佣金 5005下下级红包佣金
|
|
Result result = flowService.pay(PayParam.builder().bizNo(param.getBizNo())
|
|
Result result = flowService.pay(PayParam.builder().bizNo(param.getBizNo())
|
|
@@ -100,11 +111,20 @@ public class AccountDubboServiceImpl implements AccountDubboService {
|
|
.bizType(BizTypeEnum.OPEN_GROUP_PAY.getKey())
|
|
.bizType(BizTypeEnum.OPEN_GROUP_PAY.getKey())
|
|
.build());
|
|
.build());
|
|
|
|
|
|
- return Result.genSuccessResult();
|
|
|
|
|
|
+ return result;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public Result joinGroup(JoinParam param) {
|
|
public Result joinGroup(JoinParam param) {
|
|
|
|
+ if (param == null){
|
|
|
|
+ return Result.genFailResult("对象为空");
|
|
|
|
+ }
|
|
|
|
+ if (param.getUserId() == null){
|
|
|
|
+ return Result.genFailResult("userId为空");
|
|
|
|
+ }
|
|
|
|
+ if (param.getAmount() == null){
|
|
|
|
+ return Result.genFailResult("Amount为空");
|
|
|
|
+ }
|
|
// 支付
|
|
// 支付
|
|
// 类型 1001充值 2001提现 3001开团支付 3002参团支付 4001未成团退款 4002成团退款 5001开团红包收益 5002参团红包收益 5003签到红包收益 5004下级红包佣金 5005下下级红包佣金
|
|
// 类型 1001充值 2001提现 3001开团支付 3002参团支付 4001未成团退款 4002成团退款 5001开团红包收益 5002参团红包收益 5003签到红包收益 5004下级红包佣金 5005下下级红包佣金
|
|
Result result = flowService.pay(PayParam.builder().bizNo(param.getBizNo())
|
|
Result result = flowService.pay(PayParam.builder().bizNo(param.getBizNo())
|
|
@@ -114,7 +134,7 @@ public class AccountDubboServiceImpl implements AccountDubboService {
|
|
.transTime(param.getTransTime())
|
|
.transTime(param.getTransTime())
|
|
.bizType(BizTypeEnum.JOIN_GROUP_PAY.getKey())
|
|
.bizType(BizTypeEnum.JOIN_GROUP_PAY.getKey())
|
|
.build());
|
|
.build());
|
|
- return Result.genSuccessResult();
|
|
|
|
|
|
+ return result;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -131,21 +151,7 @@ public class AccountDubboServiceImpl implements AccountDubboService {
|
|
if (!StrUtil.equals("200", result.getCode())) {
|
|
if (!StrUtil.equals("200", result.getCode())) {
|
|
throw new ServiceException();
|
|
throw new ServiceException();
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
- // TODO 计算参团红包金额
|
|
|
|
-// com.txz.operating.result.Result<ConfigDTO> openRedEnvelopeRate = operatingConfigDubboServiceClient.getConfigByCode("join_red_envelope_rate");
|
|
|
|
-// String rate = openRedEnvelopeRate.getData().getValueInfo();
|
|
|
|
-// BigDecimal amount = param.getAmount().multiply(new BigDecimal(rate)).divide(BigDecimal.valueOf(100), 2, RoundingMode.DOWN);
|
|
|
|
- // 参团红包
|
|
|
|
-// param.getUserIds().remove(param.getOpenGroupUserId());
|
|
|
|
-// if (CollUtil.isNotEmpty(param.getUserIds())){
|
|
|
|
-// Result result1 = redEnvelopeService.addRedEnvelope(RedEnvelopeParam.builder()
|
|
|
|
-// .amount(amount).bizType(BizTypeEnum.JOIN_GROUP_RED_ENVELOPE.getKey()).orderNo(param.getBizNo())
|
|
|
|
-// .userIds(param.getUserIds())
|
|
|
|
-// .transTime(param.getTransTime())
|
|
|
|
-// .build());
|
|
|
|
-// }
|
|
|
|
return Result.genSuccessResult();
|
|
return Result.genSuccessResult();
|
|
}
|
|
}
|
|
|
|
|