|
@@ -257,34 +257,28 @@ public class PartitionCrashServiceImpl implements PartitionCrashService {
|
|
|
BigDecimal smallBigDecimal = new BigDecimal(String.valueOf(smallQuota));
|
|
|
BigDecimal multiply = smallBigDecimal.divide(new BigDecimal("2.0"), 4, RoundingMode.DOWN);
|
|
|
if (compare(highQuota, multiply)) {
|
|
|
- Long currentQuota = integralDO.getCurrentQuota();
|
|
|
- integralDO.setCurrentQuota(currentQuota + multiply.intValue());
|
|
|
+ integralDO.setCurrentQuota(integralDO.getCurrentQuota() + multiply.intValue());
|
|
|
+ integralDO.setHighQuota(parentIntegralDo.getHighQuota() - multiply.intValue());
|
|
|
|
|
|
integralService.updateIntegral(BeanUtils.toBean(integralDO, IntegralSaveReqVO.class));
|
|
|
- ptProfitLogService.addMessage(k.getUserId(), CaclEnum.SMALL_QUOTA_CRASH, currentQuota, integralDO.getCurrentQuota(), JsonUtils.toJsonString(orderPercentageDO));
|
|
|
+ ptProfitLogService.addMessage(k.getUserId(), CaclEnum.SMALL_QUOTA_CRASH, Long.parseLong(String.valueOf(multiply.intValue())), integralDO.getCurrentQuota(), JsonUtils.toJsonString(orderPercentageDO));
|
|
|
}
|
|
|
if (compare(parentHighQuota, multiply)) {
|
|
|
- Long currentQuota = parentIntegralDo.getCurrentQuota();
|
|
|
- parentIntegralDo.setCurrentQuota(currentQuota + multiply.intValue());
|
|
|
+
|
|
|
+ parentIntegralDo.setCurrentQuota(parentIntegralDo.getCurrentQuota() + multiply.intValue());
|
|
|
+ parentIntegralDo.setHighQuota(parentIntegralDo.getHighQuota() - multiply.intValue());
|
|
|
|
|
|
integralService.updateIntegral(BeanUtils.toBean(parentIntegralDo, IntegralSaveReqVO.class));
|
|
|
- LoginMessageTool.messageSave(() -> PtProfitLogSaveReqVO.builder()
|
|
|
- .amount(currentQuota)
|
|
|
- .afterAmount(currentQuota + parentIntegralDo.getCurrentQuota())
|
|
|
- .userId(parentIntegralDo.getUserId())
|
|
|
- .percentTemplate(JsonUtils.toJsonString(orderPercentageDO))
|
|
|
- .profitStatus(CaclEnum.SMALL_QUOTA_CRASH.getType())
|
|
|
- .build());
|
|
|
- ptProfitLogService.addMessage(parentIntegralDo.getUserId(), CaclEnum.SMALL_QUOTA_CRASH, currentQuota, parentIntegralDo.getCurrentQuota(), JsonUtils.toJsonString(orderPercentageDO));
|
|
|
+ ptProfitLogService.addMessage(parentIntegralDo.getUserId(), CaclEnum.SMALL_QUOTA_CRASH, Long.parseLong(String.valueOf(multiply.intValue())), parentIntegralDo.getCurrentQuota(), JsonUtils.toJsonString(orderPercentageDO));
|
|
|
}
|
|
|
|
|
|
|
|
|
HashMap<Long, Long> map = new HashMap<>();
|
|
|
|
|
|
- if (!k.getUserId().equals(PT_ID)){
|
|
|
+ if (!k.getUserId().equals(PT_ID)) {
|
|
|
map.put(k.getUserId(), multiply.longValue());
|
|
|
}
|
|
|
- if (!parentIntegralDo.getUserId().equals(PT_ID)){
|
|
|
+ if (!parentIntegralDo.getUserId().equals(PT_ID)) {
|
|
|
map.put(parentIntegralDo.getUserId(), multiply.longValue());
|
|
|
}
|
|
|
afterCrashMap.add(map);
|