管理员收入新增salaryEvent查询条件
This commit is contained in:
parent
202411bba8
commit
8e4802b231
@ -53,6 +53,7 @@ public interface UserSalaryAccountClientApi {
|
|||||||
@GetMapping("/total-income")
|
@GetMapping("/total-income")
|
||||||
ResultResponse<BigDecimal> getTotalIncome(@RequestParam("userId") Long userId,
|
ResultResponse<BigDecimal> getTotalIncome(@RequestParam("userId") Long userId,
|
||||||
@RequestParam("salaryType") String salaryType,
|
@RequestParam("salaryType") String salaryType,
|
||||||
|
@RequestParam("salaryEvent") String salaryEvent,
|
||||||
@RequestParam(value = "startTime", required = false) String startTime,
|
@RequestParam(value = "startTime", required = false) String startTime,
|
||||||
@RequestParam(value = "endTime", required = false) String endTime);
|
@RequestParam(value = "endTime", required = false) String endTime);
|
||||||
|
|
||||||
|
|||||||
@ -125,6 +125,7 @@ public class RechargeUserServiceImpl implements RechargeUserService {
|
|||||||
|
|
||||||
return new RechargeSummaryVO()
|
return new RechargeSummaryVO()
|
||||||
.setTotalIncome(userSalaryAccountClient.getTotalIncome(cmd.getReqUserId(), "ADMIN_SALARY",
|
.setTotalIncome(userSalaryAccountClient.getTotalIncome(cmd.getReqUserId(), "ADMIN_SALARY",
|
||||||
|
"SALARY_ADMIN",
|
||||||
startTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")),
|
startTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")),
|
||||||
endTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))).getBody())
|
endTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))).getBody())
|
||||||
.setCurrentMonthRecharge(currentMonthRecharge)
|
.setCurrentMonthRecharge(currentMonthRecharge)
|
||||||
|
|||||||
@ -21,10 +21,11 @@ public class SalaryTotalIncomeQryExe {
|
|||||||
|
|
||||||
private final SalaryAccountRunningWaterService salaryAccountRunningWaterService;
|
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<>();
|
LambdaQueryWrapper<SalaryAccountRunningWater> wrapper = new LambdaQueryWrapper<>();
|
||||||
wrapper.eq(SalaryAccountRunningWater::getUserId, userId)
|
wrapper.eq(SalaryAccountRunningWater::getUserId, userId)
|
||||||
.eq(SalaryAccountRunningWater::getSalaryType, salaryType.getCode())
|
.eq(SalaryAccountRunningWater::getSalaryType, salaryType.getCode())
|
||||||
|
.eq(SalaryAccountRunningWater::getSalaryEvent, salaryEvent)
|
||||||
.eq(SalaryAccountRunningWater::getType, 0)
|
.eq(SalaryAccountRunningWater::getType, 0)
|
||||||
.gt(StringUtils.hasText(startTime), TimestampBaseEntity::getCreateTime, startTime)
|
.gt(StringUtils.hasText(startTime), TimestampBaseEntity::getCreateTime, startTime)
|
||||||
.lt(StringUtils.hasText(endTime), TimestampBaseEntity::getCreateTime, endTime);
|
.lt(StringUtils.hasText(endTime), TimestampBaseEntity::getCreateTime, endTime);
|
||||||
|
|||||||
@ -63,7 +63,7 @@ public class SalaryAccountServiceImpl implements SalaryAccountService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BigDecimal getTotalIncome(Long userId, String salaryType, String startTime, String endTime) {
|
public BigDecimal getTotalIncome(Long userId, String salaryType, String salaryEvent, String startTime, String endTime) {
|
||||||
return salaryTotalIncomeQryExe.execute(userId, Objects.requireNonNull(SalaryType.of(salaryType)), startTime, endTime);
|
return salaryTotalIncomeQryExe.execute(userId, Objects.requireNonNull(SalaryType.of(salaryType)), salaryEvent, startTime, endTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -54,5 +54,5 @@ public interface SalaryAccountService {
|
|||||||
* @param salaryType 工资类型
|
* @param salaryType 工资类型
|
||||||
* @return 累计收入
|
* @return 累计收入
|
||||||
*/
|
*/
|
||||||
BigDecimal getTotalIncome(Long userId, String salaryType, String startTime, String endTime);
|
BigDecimal getTotalIncome(Long userId, String salaryType, String salaryEvent, String startTime, String endTime);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,7 +52,7 @@ public class UserSalaryAccountClientEndpoint implements UserSalaryAccountClientA
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResultResponse<BigDecimal> getTotalIncome(Long userId, String salaryType, String startTime, String endTime) {
|
public ResultResponse<BigDecimal> getTotalIncome(Long userId, String salaryType, String salaryEvent, String startTime, String endTime) {
|
||||||
return ResultResponse.success(userSalaryAccountClientService.getTotalIncome(userId, salaryType, startTime, endTime));
|
return ResultResponse.success(userSalaryAccountClientService.getTotalIncome(userId, salaryType, salaryEvent, startTime, endTime));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -70,8 +70,8 @@ public class UserSalaryAccountClientServiceImpl implements UserSalaryAccountClie
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BigDecimal getTotalIncome(Long userId, String salaryType, String startTime, String endTime) {
|
public BigDecimal getTotalIncome(Long userId, String salaryType, String salaryEvent, String startTime, String endTime) {
|
||||||
BigDecimal totalIncome = salaryAccountService.getTotalIncome(userId, salaryType, startTime, endTime);
|
BigDecimal totalIncome = salaryAccountService.getTotalIncome(userId, salaryType, salaryEvent, startTime, endTime);
|
||||||
return totalIncome != null ? totalIncome : BigDecimal.ZERO;
|
return totalIncome != null ? totalIncome : BigDecimal.ZERO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user