feat: 添加存储已存储金额
This commit is contained in:
parent
afd8591020
commit
60592ec580
|
@ -29,6 +29,9 @@ public class SavingGoalDto {
|
||||||
@Schema(name = "amount", title = "目标金额")
|
@Schema(name = "amount", title = "目标金额")
|
||||||
private BigDecimal amount;
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
@Schema(name = "amountDeposited", title = "已存入金额")
|
||||||
|
private BigDecimal amountDeposited;
|
||||||
|
|
||||||
@Schema(name = "startDuration", title = "开始目标时长")
|
@Schema(name = "startDuration", title = "开始目标时长")
|
||||||
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||||
private LocalDate startDuration;
|
private LocalDate startDuration;
|
||||||
|
|
|
@ -39,6 +39,11 @@ public class SavingGoalAddDto {
|
||||||
@Min(value = 0, message = "储蓄值不能小于0")
|
@Min(value = 0, message = "储蓄值不能小于0")
|
||||||
private BigDecimal amount;
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
@Schema(name = "amountDeposited", title = "已存入金额")
|
||||||
|
@NotNull(message = "目标金额不能为空")
|
||||||
|
@Min(value = 0, message = "储蓄值不能小于0")
|
||||||
|
private BigDecimal amountDeposited;
|
||||||
|
|
||||||
@Schema(name = "startDuration", title = "开始目标时长")
|
@Schema(name = "startDuration", title = "开始目标时长")
|
||||||
@NotNull(message = "开始目标时长不能为空")
|
@NotNull(message = "开始目标时长不能为空")
|
||||||
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
|
|
@ -43,6 +43,11 @@ public class SavingGoalUpdateDto {
|
||||||
@Min(value = 0, message = "金额格式不正确")
|
@Min(value = 0, message = "金额格式不正确")
|
||||||
private BigDecimal amount;
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
@Schema(name = "amountDeposited", title = "已存入金额")
|
||||||
|
@NotNull(message = "目标金额不能为空")
|
||||||
|
@Min(value = 0, message = "储蓄值不能小于0")
|
||||||
|
private BigDecimal amountDeposited;
|
||||||
|
|
||||||
@Schema(name = "startDuration", title = "开始目标时长")
|
@Schema(name = "startDuration", title = "开始目标时长")
|
||||||
@NotNull(message = "开始目标时长不能为空")
|
@NotNull(message = "开始目标时长不能为空")
|
||||||
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
|
|
@ -35,6 +35,11 @@ public class SavingGoalAddUserDto {
|
||||||
@Min(value = 0, message = "储蓄值不能小于0")
|
@Min(value = 0, message = "储蓄值不能小于0")
|
||||||
private BigDecimal amount;
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
@Schema(name = "amountDeposited", title = "已存入金额")
|
||||||
|
@NotNull(message = "目标金额不能为空")
|
||||||
|
@Min(value = 0, message = "储蓄值不能小于0")
|
||||||
|
private BigDecimal amountDeposited;
|
||||||
|
|
||||||
@Schema(name = "startDuration", title = "开始目标时长")
|
@Schema(name = "startDuration", title = "开始目标时长")
|
||||||
@NotNull(message = "开始目标时长不能为空")
|
@NotNull(message = "开始目标时长不能为空")
|
||||||
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
|
|
@ -39,6 +39,11 @@ public class SavingGoalUpdateUserDto {
|
||||||
@Min(value = 0, message = "金额格式不正确")
|
@Min(value = 0, message = "金额格式不正确")
|
||||||
private BigDecimal amount;
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
@Schema(name = "amountDeposited", title = "已存入金额")
|
||||||
|
@NotNull(message = "目标金额不能为空")
|
||||||
|
@Min(value = 0, message = "储蓄值不能小于0")
|
||||||
|
private BigDecimal amountDeposited;
|
||||||
|
|
||||||
@Schema(name = "startDuration", title = "开始目标时长")
|
@Schema(name = "startDuration", title = "开始目标时长")
|
||||||
@NotNull(message = "开始目标时长不能为空")
|
@NotNull(message = "开始目标时长不能为空")
|
||||||
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
|
|
@ -37,6 +37,9 @@ public class SavingGoal extends BaseEntity {
|
||||||
@Schema(name = "amount", title = "目标金额")
|
@Schema(name = "amount", title = "目标金额")
|
||||||
private BigDecimal amount;
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
@Schema(name = "amountDeposited", title = "已存入金额")
|
||||||
|
private BigDecimal amountDeposited;
|
||||||
|
|
||||||
@Schema(name = "startDuration", title = "开始目标时长")
|
@Schema(name = "startDuration", title = "开始目标时长")
|
||||||
private LocalDateTime startDuration;
|
private LocalDateTime startDuration;
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,9 @@ public class SavingGoalVo extends BaseUserVo {
|
||||||
@Schema(name = "amount", title = "目标金额")
|
@Schema(name = "amount", title = "目标金额")
|
||||||
private BigDecimal amount;
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
@Schema(name = "amountDeposited", title = "已存入金额")
|
||||||
|
private BigDecimal amountDeposited;
|
||||||
|
|
||||||
@Schema(name = "startDuration", title = "开始目标时长")
|
@Schema(name = "startDuration", title = "开始目标时长")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@JsonSerialize(using = LocalDateTimeSerializer.class)
|
@JsonSerialize(using = LocalDateTimeSerializer.class)
|
||||||
|
|
|
@ -29,6 +29,9 @@ public class SavingGoalUserVo extends BaseVo {
|
||||||
@Schema(name = "amount", title = "目标金额")
|
@Schema(name = "amount", title = "目标金额")
|
||||||
private BigDecimal amount;
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
@Schema(name = "amountDeposited", title = "已存入金额")
|
||||||
|
private BigDecimal amountDeposited;
|
||||||
|
|
||||||
@Schema(name = "startDuration", title = "开始目标时长")
|
@Schema(name = "startDuration", title = "开始目标时长")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@JsonSerialize(using = LocalDateTimeSerializer.class)
|
@JsonSerialize(using = LocalDateTimeSerializer.class)
|
||||||
|
|
|
@ -4,6 +4,7 @@ import cn.bunny.dao.dto.financial.savingGoal.SavingGoalDto;
|
||||||
import cn.bunny.dao.dto.financial.savingGoal.admin.SavingGoalAddDto;
|
import cn.bunny.dao.dto.financial.savingGoal.admin.SavingGoalAddDto;
|
||||||
import cn.bunny.dao.dto.financial.savingGoal.admin.SavingGoalUpdateDto;
|
import cn.bunny.dao.dto.financial.savingGoal.admin.SavingGoalUpdateDto;
|
||||||
import cn.bunny.dao.dto.financial.savingGoal.user.SavingGoalAddUserDto;
|
import cn.bunny.dao.dto.financial.savingGoal.user.SavingGoalAddUserDto;
|
||||||
|
import cn.bunny.dao.dto.financial.savingGoal.user.SavingGoalUpdateUserDto;
|
||||||
import cn.bunny.dao.entity.financial.SavingGoal;
|
import cn.bunny.dao.entity.financial.SavingGoal;
|
||||||
import cn.bunny.dao.pojo.result.PageResult;
|
import cn.bunny.dao.pojo.result.PageResult;
|
||||||
import cn.bunny.dao.pojo.result.Result;
|
import cn.bunny.dao.pojo.result.Result;
|
||||||
|
@ -87,7 +88,7 @@ public class SavingGoalController {
|
||||||
|
|
||||||
@Operation(summary = "用户更新储值", description = "用户更新储值")
|
@Operation(summary = "用户更新储值", description = "用户更新储值")
|
||||||
@PutMapping("noManage/updateUserSavingGoal")
|
@PutMapping("noManage/updateUserSavingGoal")
|
||||||
public Mono<Result<String>> updateUserSavingGoal(@Valid @RequestBody SavingGoalUpdateDto dto) {
|
public Mono<Result<String>> updateUserSavingGoal(@Valid @RequestBody SavingGoalUpdateUserDto dto) {
|
||||||
savingGoalService.updateUserSavingGoal(dto);
|
savingGoalService.updateUserSavingGoal(dto);
|
||||||
return Mono.just(Result.success(ResultCodeEnum.UPDATE_SUCCESS));
|
return Mono.just(Result.success(ResultCodeEnum.UPDATE_SUCCESS));
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import cn.bunny.dao.dto.financial.savingGoal.SavingGoalDto;
|
||||||
import cn.bunny.dao.dto.financial.savingGoal.admin.SavingGoalAddDto;
|
import cn.bunny.dao.dto.financial.savingGoal.admin.SavingGoalAddDto;
|
||||||
import cn.bunny.dao.dto.financial.savingGoal.admin.SavingGoalUpdateDto;
|
import cn.bunny.dao.dto.financial.savingGoal.admin.SavingGoalUpdateDto;
|
||||||
import cn.bunny.dao.dto.financial.savingGoal.user.SavingGoalAddUserDto;
|
import cn.bunny.dao.dto.financial.savingGoal.user.SavingGoalAddUserDto;
|
||||||
|
import cn.bunny.dao.dto.financial.savingGoal.user.SavingGoalUpdateUserDto;
|
||||||
import cn.bunny.dao.entity.financial.SavingGoal;
|
import cn.bunny.dao.entity.financial.SavingGoal;
|
||||||
import cn.bunny.dao.pojo.result.PageResult;
|
import cn.bunny.dao.pojo.result.PageResult;
|
||||||
import cn.bunny.dao.vo.financial.admin.SavingGoalVo;
|
import cn.bunny.dao.vo.financial.admin.SavingGoalVo;
|
||||||
|
@ -73,7 +74,7 @@ public interface SavingGoalService extends IService<SavingGoal> {
|
||||||
*
|
*
|
||||||
* @param dto 更新表单
|
* @param dto 更新表单
|
||||||
*/
|
*/
|
||||||
void updateUserSavingGoal(SavingGoalUpdateDto dto);
|
void updateUserSavingGoal(@Valid SavingGoalUpdateUserDto dto);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户删除储值
|
* 用户删除储值
|
||||||
|
|
|
@ -6,6 +6,7 @@ import cn.bunny.dao.dto.financial.savingGoal.SavingGoalDto;
|
||||||
import cn.bunny.dao.dto.financial.savingGoal.admin.SavingGoalAddDto;
|
import cn.bunny.dao.dto.financial.savingGoal.admin.SavingGoalAddDto;
|
||||||
import cn.bunny.dao.dto.financial.savingGoal.admin.SavingGoalUpdateDto;
|
import cn.bunny.dao.dto.financial.savingGoal.admin.SavingGoalUpdateDto;
|
||||||
import cn.bunny.dao.dto.financial.savingGoal.user.SavingGoalAddUserDto;
|
import cn.bunny.dao.dto.financial.savingGoal.user.SavingGoalAddUserDto;
|
||||||
|
import cn.bunny.dao.dto.financial.savingGoal.user.SavingGoalUpdateUserDto;
|
||||||
import cn.bunny.dao.entity.financial.SavingGoal;
|
import cn.bunny.dao.entity.financial.SavingGoal;
|
||||||
import cn.bunny.dao.pojo.result.PageResult;
|
import cn.bunny.dao.pojo.result.PageResult;
|
||||||
import cn.bunny.dao.pojo.result.ResultCodeEnum;
|
import cn.bunny.dao.pojo.result.ResultCodeEnum;
|
||||||
|
@ -147,7 +148,7 @@ public class SavingGoalServiceImpl extends ServiceImpl<SavingGoalMapper, SavingG
|
||||||
* @param dto 更新表单
|
* @param dto 更新表单
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void updateUserSavingGoal(SavingGoalUpdateDto dto) {
|
public void updateUserSavingGoal(@Valid SavingGoalUpdateUserDto dto) {
|
||||||
// 更新内容
|
// 更新内容
|
||||||
SavingGoal savingGoal = new SavingGoal();
|
SavingGoal savingGoal = new SavingGoal();
|
||||||
BeanUtils.copyProperties(dto, savingGoal);
|
BeanUtils.copyProperties(dto, savingGoal);
|
||||||
|
|
|
@ -48,6 +48,9 @@
|
||||||
<if test="dto.amount != null and dto.amount != ''">
|
<if test="dto.amount != null and dto.amount != ''">
|
||||||
and base.amount like CONCAT('%',#{dto.amount},'%')
|
and base.amount like CONCAT('%',#{dto.amount},'%')
|
||||||
</if>
|
</if>
|
||||||
|
<if test="dto.amountDeposited != null and dto.amountDeposited != ''">
|
||||||
|
and base.amount_deposited like CONCAT('%',#{dto.amountDeposited},'%')
|
||||||
|
</if>
|
||||||
<if test="dto.startDuration != null and dto.endDuration != null">
|
<if test="dto.startDuration != null and dto.endDuration != null">
|
||||||
and (
|
and (
|
||||||
(base.start_duration between #{dto.startDuration} and #{dto.endDuration})
|
(base.start_duration between #{dto.startDuration} and #{dto.endDuration})
|
||||||
|
|
Loading…
Reference in New Issue