|
@@ -65,13 +65,11 @@ public class AccountWarningServiceImpl implements IAccountWarningService {
|
|
|
if (!Check.isNull(nowCost) && nowCost.compareTo(new BigDecimal(0)) != 0) {
|
|
|
BigDecimal lastHourCost = hourlyAccountMapper.getCost(accountId, maxHour - 1, statDate);
|
|
|
if (!Check.isNull(lastHourCost) && lastHourCost.compareTo(new BigDecimal(0)) != 0) {
|
|
|
- if (!Check.isNull(userAllocation)) {
|
|
|
- BigDecimal subtract = nowCost.subtract(lastHourCost);
|
|
|
- BigDecimal divide = nowCost.divide(lastHourCost, 2, RoundingMode.HALF_UP);
|
|
|
- if (subtract.compareTo(warningAmount) > -1 && divide.compareTo(warningProportion) > -1) {
|
|
|
- sendMessage(accountId, userAllocation.getAuthName(), maxHour, nowCost, userAllocation.getProjectId(), userAllocation.getProjectName());
|
|
|
- sendFeishuMessage(accountId, userAllocation.getAuthName(), maxHour, nowCost, userAllocation.getProjectId(), userAllocation.getProjectName());
|
|
|
- }
|
|
|
+ BigDecimal subtract = nowCost.subtract(lastHourCost);
|
|
|
+ BigDecimal divide = nowCost.divide(lastHourCost, 2, RoundingMode.HALF_UP);
|
|
|
+ if (subtract.compareTo(warningAmount) > -1 && divide.compareTo(warningProportion) > -1) {
|
|
|
+ sendMessage(accountId, userAllocation.getAuthName(), maxHour, nowCost, userAllocation.getProjectId(), userAllocation.getProjectName());
|
|
|
+ sendFeishuMessage(accountId, userAllocation.getAuthName(), maxHour, nowCost, userAllocation.getProjectId(), userAllocation.getProjectName());
|
|
|
}
|
|
|
}
|
|
|
}
|