管理员收入新增salaryEvent查询条件

This commit is contained in:
tianfeng 2025-12-17 10:27:47 +08:00
parent 202411bba8
commit 8e4802b231
8 changed files with 12 additions and 9 deletions

View File

@ -53,6 +53,7 @@ public interface UserSalaryAccountClientApi {
@GetMapping("/total-income")
ResultResponse<BigDecimal> getTotalIncome(@RequestParam("userId") Long userId,
@RequestParam("salaryType") String salaryType,
@RequestParam("salaryEvent") String salaryEvent,
@RequestParam(value = "startTime", required = false) String startTime,
@RequestParam(value = "endTime", required = false) String endTime);

View File

@ -125,6 +125,7 @@ public class RechargeUserServiceImpl implements RechargeUserService {
return new RechargeSummaryVO()
.setTotalIncome(userSalaryAccountClient.getTotalIncome(cmd.getReqUserId(), "ADMIN_SALARY",
"SALARY_ADMIN",
startTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")),
endTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))).getBody())
.setCurrentMonthRecharge(currentMonthRecharge)

View File

@ -21,10 +21,11 @@ public class SalaryTotalIncomeQryExe {
private final SalaryAccountRunningWaterService salaryAccountRunningWaterService;
public BigDecimal execute(Long userId, SalaryType salaryType, String startTime, String endTime) {
public BigDecimal execute(Long userId, SalaryType salaryType, String salaryEvent, String startTime, String endTime) {
LambdaQueryWrapper<SalaryAccountRunningWater> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SalaryAccountRunningWater::getUserId, userId)
.eq(SalaryAccountRunningWater::getSalaryType, salaryType.getCode())
.eq(SalaryAccountRunningWater::getSalaryEvent, salaryEvent)
.eq(SalaryAccountRunningWater::getType, 0)
.gt(StringUtils.hasText(startTime), TimestampBaseEntity::getCreateTime, startTime)
.lt(StringUtils.hasText(endTime), TimestampBaseEntity::getCreateTime, endTime);

View File

@ -63,7 +63,7 @@ public class SalaryAccountServiceImpl implements SalaryAccountService {
}
@Override
public BigDecimal getTotalIncome(Long userId, String salaryType, String startTime, String endTime) {
return salaryTotalIncomeQryExe.execute(userId, Objects.requireNonNull(SalaryType.of(salaryType)), startTime, endTime);
public BigDecimal getTotalIncome(Long userId, String salaryType, String salaryEvent, String startTime, String endTime) {
return salaryTotalIncomeQryExe.execute(userId, Objects.requireNonNull(SalaryType.of(salaryType)), salaryEvent, startTime, endTime);
}
}

View File

@ -54,5 +54,5 @@ public interface SalaryAccountService {
* @param salaryType 工资类型
* @return 累计收入
*/
BigDecimal getTotalIncome(Long userId, String salaryType, String startTime, String endTime);
BigDecimal getTotalIncome(Long userId, String salaryType, String salaryEvent, String startTime, String endTime);
}

View File

@ -52,7 +52,7 @@ public class UserSalaryAccountClientEndpoint implements UserSalaryAccountClientA
}
@Override
public ResultResponse<BigDecimal> getTotalIncome(Long userId, String salaryType, String startTime, String endTime) {
return ResultResponse.success(userSalaryAccountClientService.getTotalIncome(userId, salaryType, startTime, endTime));
public ResultResponse<BigDecimal> getTotalIncome(Long userId, String salaryType, String salaryEvent, String startTime, String endTime) {
return ResultResponse.success(userSalaryAccountClientService.getTotalIncome(userId, salaryType, salaryEvent, startTime, endTime));
}
}

View File

@ -38,5 +38,5 @@ public interface UserSalaryAccountClientService {
/**
* 查询用户累计收入.
*/
BigDecimal getTotalIncome(Long userId, String salaryType, String startTime, String endTime);
BigDecimal getTotalIncome(Long userId, String salaryType, String salaryEvent, String startTime, String endTime);
}

View File

@ -70,8 +70,8 @@ public class UserSalaryAccountClientServiceImpl implements UserSalaryAccountClie
}
@Override
public BigDecimal getTotalIncome(Long userId, String salaryType, String startTime, String endTime) {
BigDecimal totalIncome = salaryAccountService.getTotalIncome(userId, salaryType, startTime, endTime);
public BigDecimal getTotalIncome(Long userId, String salaryType, String salaryEvent, String startTime, String endTime) {
BigDecimal totalIncome = salaryAccountService.getTotalIncome(userId, salaryType, salaryEvent, startTime, endTime);
return totalIncome != null ? totalIncome : BigDecimal.ZERO;
}
}