|
|
@@ -758,16 +758,16 @@ public class ClaudeCodeServiceImpl implements ClaudeCodeService {
|
|
|
|
|
|
ClaudeCodeResp dashboard = getUserDashboard(userId);
|
|
|
JSONObject data = Jsons.parseObject(dashboard.getData(), JSONObject.class);
|
|
|
- Integer daily_remaining = data.getInt("daily_remaining");
|
|
|
- Integer daily_total = data.getInt("daily_total");
|
|
|
+ BigDecimal daily_remaining = data.getBigDecimal("daily_remaining");
|
|
|
+ BigDecimal daily_total = BigDecimal.valueOf(claudeCodeUser.getClaudeDailyLimit());
|
|
|
//超出积分 异常
|
|
|
- if (daily_remaining + creditCard.getCreditAmount() > daily_total) {
|
|
|
+ if (daily_remaining.add(BigDecimal.valueOf(creditCard.getCreditAmount())).compareTo(daily_total) > 0) {
|
|
|
throw BusinessRuntimeException.getInstance("目前使用只能补充到{0},建议您消耗更多额度后再补充使用", daily_total);
|
|
|
}
|
|
|
|
|
|
- Integer beforeCodePoints = daily_remaining;
|
|
|
- Integer addCodePoints = creditCard.getCreditAmount();
|
|
|
- Integer afterCodePoints = beforeCodePoints + addCodePoints;
|
|
|
+ BigDecimal beforeCodePoints = daily_remaining;
|
|
|
+ BigDecimal addCodePoints = BigDecimal.valueOf(creditCard.getCreditAmount());
|
|
|
+ BigDecimal afterCodePoints = beforeCodePoints.add(addCodePoints);
|
|
|
|
|
|
creditCard.setStatus(1);
|
|
|
creditCard.setUsedUserId(userId);
|
|
|
@@ -915,7 +915,7 @@ public class ClaudeCodeServiceImpl implements ClaudeCodeService {
|
|
|
creditCardRecord.setCardNumber(cardNumber);
|
|
|
creditCardRecord.setUseReason(remark);
|
|
|
creditCardRecord.setNum(1);
|
|
|
- creditCardRecord.setAddCodePoints(points);
|
|
|
+ creditCardRecord.setAddCodePoints(BigDecimal.valueOf(points));
|
|
|
claudeCodeUserCreditCardRecordMapper.insert(creditCardRecord);
|
|
|
}
|
|
|
|