feat: 添加预算已使用金额
This commit is contained in:
parent
d9e814110a
commit
afd8591020
|
@ -32,6 +32,9 @@ public class BudgetCategoryDto {
|
|||
@Schema(name = "amount", title = "预算金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(name = "useAmount", title = "已使用预算金额")
|
||||
private BigDecimal useAmount;
|
||||
|
||||
@Schema(name = "startPeriod", title = "开始预算周期")
|
||||
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private LocalDate startPeriod;
|
||||
|
|
|
@ -48,6 +48,11 @@ public class BudgetCategoryAddDto {
|
|||
@Min(value = 0, message = "不能低于0")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(name = "useAmount", title = "已使用预算金额")
|
||||
@NotNull(message = "金额不能为空")
|
||||
@Min(value = 0, message = "不能低于0")
|
||||
private BigDecimal useAmount;
|
||||
|
||||
@Schema(name = "period", title = "预算周期")
|
||||
@NotNull(message = "预算周期不能为空")
|
||||
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
|
|
|
@ -52,6 +52,11 @@ public class BudgetCategoryUpdateDto {
|
|||
@Min(value = 0, message = "不能低于0")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(name = "useAmount", title = "已使用预算金额")
|
||||
@NotNull(message = "金额不能为空")
|
||||
@Min(value = 0, message = "不能低于0")
|
||||
private BigDecimal useAmount;
|
||||
|
||||
@Schema(name = "period", title = "预算周期")
|
||||
@NotNull(message = "预算周期不能为空")
|
||||
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
|
|
|
@ -44,6 +44,11 @@ public class BudgetCategoryAddUserDto {
|
|||
@Min(value = 0, message = "不能低于0")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(name = "useAmount", title = "已使用预算金额")
|
||||
@NotNull(message = "金额不能为空")
|
||||
@Min(value = 0, message = "不能低于0")
|
||||
private BigDecimal useAmount;
|
||||
|
||||
@Schema(name = "period", title = "预算周期")
|
||||
@NotNull(message = "预算周期不能为空")
|
||||
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
|
|
|
@ -48,6 +48,11 @@ public class BudgetCategoryUpdateUserDto {
|
|||
@Min(value = 0, message = "不能低于0")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(name = "useAmount", title = "已使用预算金额")
|
||||
@NotNull(message = "金额不能为空")
|
||||
@Min(value = 0, message = "不能低于0")
|
||||
private BigDecimal useAmount;
|
||||
|
||||
@Schema(name = "period", title = "预算周期")
|
||||
@NotNull(message = "预算周期不能为空")
|
||||
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
|
|
|
@ -43,6 +43,9 @@ public class BudgetCategory extends BaseEntity {
|
|||
@Schema(name = "amount", title = "预算金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(name = "useAmount", title = "已使用预算金额")
|
||||
private BigDecimal useAmount;
|
||||
|
||||
@Schema(name = "period", title = "预算周期")
|
||||
private LocalDateTime startPeriod;
|
||||
|
||||
|
|
|
@ -47,6 +47,9 @@ public class BudgetCategoryVo extends BaseUserVo {
|
|||
@Schema(name = "amount", title = "预算金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(name = "useAmount", title = "已使用预算金额")
|
||||
private BigDecimal useAmount;
|
||||
|
||||
@Schema(name = "startPeriod", title = "预算周期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonSerialize(using = LocalDateTimeSerializer.class)
|
||||
|
|
|
@ -39,6 +39,9 @@ public class BudgetCategoryUserVo extends BaseVo {
|
|||
@Schema(name = "amount", title = "预算金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(name = "useAmount", title = "已使用预算金额")
|
||||
private BigDecimal useAmount;
|
||||
|
||||
@Schema(name = "startPeriod", title = "预算周期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonSerialize(using = LocalDateTimeSerializer.class)
|
||||
|
|
|
@ -53,6 +53,9 @@
|
|||
<if test="dto.amount != null and dto.amount != ''">
|
||||
and base.amount like CONCAT('%',#{dto.amount},'%')
|
||||
</if>
|
||||
<if test="dto.useAmount != null and dto.useAmount != ''">
|
||||
and base.use_amount like CONCAT('%',#{dto.useAmount},'%')
|
||||
</if>
|
||||
<if test="dto.startPeriod != null and dto.endPeriod != null">
|
||||
and (
|
||||
(base.start_period between #{dto.startPeriod} and #{dto.endPeriod})
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue