|
@@ -98,19 +98,7 @@ public class AccountDubboServiceImpl implements AccountDubboService {
|
|
|
.transTime(param.getTransTime())
|
|
|
.bizType(BizTypeEnum.OPEN_GROUP_PAY.getKey())
|
|
|
.build());
|
|
|
- if (StrUtil.equals("200", result.getCode())) {
|
|
|
- // 计算开团红包金额
|
|
|
- com.txz.operating.result.Result<ConfigDTO> openRedEnvelopeRate = operatingConfigDubboServiceClient.getConfigByCode("open_red_envelope_rate");
|
|
|
- String rate = openRedEnvelopeRate.getData().getValueInfo();
|
|
|
- BigDecimal amount = param.getAmount().multiply(new BigDecimal(rate)).divide(BigDecimal.valueOf(100), 2, RoundingMode.DOWN);
|
|
|
-
|
|
|
- // 开团红包
|
|
|
- Result result1 = redEnvelopeService.addRedEnvelope(RedEnvelopeParam.builder()
|
|
|
- .amount(amount).bizType(BizTypeEnum.OPEN_GROUP_RED_ENVELOPE.getKey()).orderNo(param.getBizNo())
|
|
|
- .userIds(CollUtil.newArrayList(param.getUserId()))
|
|
|
- .transTime(param.getTransTime())
|
|
|
- .build());
|
|
|
- }
|
|
|
+
|
|
|
return Result.genSuccessResult();
|
|
|
}
|
|
|
|
|
@@ -174,13 +162,29 @@ public class AccountDubboServiceImpl implements AccountDubboService {
|
|
|
throw new ServiceException();
|
|
|
}
|
|
|
}
|
|
|
- // TODO 计算参团红包金额
|
|
|
+
|
|
|
+ if (param.getOpenGroupUserId() != null) {
|
|
|
+ // 计算开团红包金额
|
|
|
+ com.txz.operating.result.Result<ConfigDTO> openRedEnvelopeRate = operatingConfigDubboServiceClient.getConfigByCode("open_red_envelope_rate");
|
|
|
+ String rate = openRedEnvelopeRate.getData().getValueInfo();
|
|
|
+ BigDecimal amount = param.getAmount().multiply(new BigDecimal(rate)).divide(BigDecimal.valueOf(100), 2, RoundingMode.DOWN);
|
|
|
+
|
|
|
+ // 开团红包
|
|
|
+ Result result1 = redEnvelopeService.addRedEnvelope(RedEnvelopeParam.builder()
|
|
|
+ .amount(amount).bizType(BizTypeEnum.OPEN_GROUP_RED_ENVELOPE.getKey()).orderNo(param.getBizNo())
|
|
|
+ .userIds(CollUtil.newArrayList(param.getOpenGroupUserId()))
|
|
|
+ .transTime(param.getTransTime())
|
|
|
+ .build());
|
|
|
+ }
|
|
|
+
|
|
|
+ // 计算参团红包金额
|
|
|
+ if (param.getUserIds().contains(param.getOpenGroupUserId())) {
|
|
|
+ param.getUserIds().remove(param.getOpenGroupUserId());
|
|
|
+ }
|
|
|
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())
|