Compare commits
6 Commits
d835d962fc
...
38eb0afd92
Author | SHA1 | Date |
---|---|---|
|
38eb0afd92 | |
|
58c53a10f0 | |
|
889c774520 | |
|
0ae6a9d9bd | |
|
6bc4eb0cbd | |
|
2d6bf3daab |
|
@ -4,7 +4,7 @@ target/
|
|||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
logs/
|
||||
!**/src/main/resources/application-prod.yml
|
||||
application-prod.yml
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
|
|
|
@ -3,8 +3,8 @@ package cn.bunny.common.generator.generator;
|
|||
import cn.bunny.common.generator.entity.BaseField;
|
||||
import cn.bunny.common.generator.entity.BaseResultMap;
|
||||
import cn.bunny.common.generator.utils.GeneratorCodeUtils;
|
||||
import cn.bunny.dao.dto.financial.bill.BillDto;
|
||||
import cn.bunny.dao.dto.financial.bill.admin.BillAddDto;
|
||||
import cn.bunny.dao.dto.financial.bill.admin.BillDto;
|
||||
import cn.bunny.dao.dto.financial.bill.admin.BillUpdateDto;
|
||||
import cn.bunny.dao.entity.financial.Bill;
|
||||
import cn.bunny.dao.vo.financial.admin.BillVo;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.financial.bill.admin;
|
||||
package cn.bunny.dao.dto.financial.bill;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
@ -21,6 +21,7 @@ import java.time.LocalDateTime;
|
|||
public class BillAddDto {
|
||||
|
||||
@Schema(name = "userId", title = "绑定的用户id")
|
||||
@NotNull(message = "用户不能为空")
|
||||
private Long userId;
|
||||
|
||||
@Schema(name = "username", title = "类型:1 - 收入,-1 - 支出")
|
||||
|
|
|
@ -25,6 +25,7 @@ public class BillUpdateDto {
|
|||
private Long id;
|
||||
|
||||
@Schema(name = "userId", title = "绑定的用户id")
|
||||
@NotNull(message = "用户不能为空")
|
||||
private Long userId;
|
||||
|
||||
@Schema(name = "username", title = "类型:1 - 收入,-1 - 支出")
|
||||
|
|
|
@ -17,8 +17,8 @@ import java.time.LocalDateTime;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "BillUserAddDto对象", title = "用户账单信息添加内容", description = "用户账单信息添加内容")
|
||||
public class BillUserAddDto {
|
||||
@Schema(name = "BillAddDto对象", title = "账单信息添加内容", description = "账单信息添加内容")
|
||||
public class BillAddUserDto {
|
||||
|
||||
@Schema(name = "username", title = "类型:1 - 收入,-1 - 支出")
|
||||
@NotNull(message = "类型不能为空")
|
|
@ -2,6 +2,8 @@ package cn.bunny.dao.dto.financial.bill.user;
|
|||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.Max;
|
||||
import jakarta.validation.constraints.Min;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
|
@ -15,17 +17,22 @@ import java.time.LocalDateTime;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "BillUserUpdateDto对象", title = "用户账单信息更新内容", description = "用户账单信息更新内容")
|
||||
public class BillUserUpdateDto {
|
||||
@Schema(name = "BillUpdateDto对象", title = "账单信息更新内容", description = "账单信息更新内容")
|
||||
public class BillUpdateUserDto {
|
||||
|
||||
@Schema(name = "id", title = "主键")
|
||||
@NotNull(message = "id不能为空")
|
||||
private Long id;
|
||||
|
||||
@Schema(name = "username", title = "类型:1 - 收入,-1 - 支出")
|
||||
@NotNull(message = "类型不能为空")
|
||||
@Min(value = -1, message = "类型格式不正确")
|
||||
@Max(value = 1, message = "类型格式不正确")
|
||||
private Byte type;
|
||||
|
||||
@Schema(name = "amount", title = "金额")
|
||||
@NotNull(message = "金额不能为空")
|
||||
@Min(value = 0, message = "金额格式不正确")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(name = "description", title = "描述")
|
|
@ -1,33 +0,0 @@
|
|||
package cn.bunny.dao.dto.financial.bill.user;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "BillUserDto对象", title = "用户账单信息查询内容", description = "用户账单信息查询内容")
|
||||
public class BillUserDto {
|
||||
|
||||
@Schema(name = "username", title = "类型:1 - 收入,-1 - 支出")
|
||||
private Byte type;
|
||||
|
||||
@Schema(name = "description", title = "描述")
|
||||
private String description;
|
||||
|
||||
@Schema(name = "startDate", title = "开始交易日期")
|
||||
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private LocalDate startDate;
|
||||
|
||||
@Schema(name = "endDate", title = "结束交易日期")
|
||||
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private LocalDate endDate;
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.financial.budgetCategory;
|
||||
package cn.bunny.dao.dto.financial.budgetCategory.admin;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
@ -25,7 +25,7 @@ public class BudgetCategoryAddDto {
|
|||
private Long parentId;
|
||||
|
||||
@Schema(name = "userId", title = "绑定的用户id")
|
||||
@NotNull(message = "债绑定的用户不能为空")
|
||||
@NotNull(message = "用户不能为空")
|
||||
private Long userId;
|
||||
|
||||
@Schema(name = "categoryName", title = "分类名称")
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.financial.budgetCategory;
|
||||
package cn.bunny.dao.dto.financial.budgetCategory.admin;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
@ -29,7 +29,7 @@ public class BudgetCategoryUpdateDto {
|
|||
private Long parentId;
|
||||
|
||||
@Schema(name = "userId", title = "绑定的用户id")
|
||||
@NotNull(message = "债绑定的用户不能为空")
|
||||
@NotNull(message = "用户不能为空")
|
||||
private Long userId;
|
||||
|
||||
@Schema(name = "categoryName", title = "分类名称")
|
|
@ -0,0 +1,57 @@
|
|||
package cn.bunny.dao.dto.financial.budgetCategory.user;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.Min;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "BudgetCategoryAddDto对象", title = "预算分类添加", description = "预算分类添加")
|
||||
public class BudgetCategoryAddUserDto {
|
||||
|
||||
@Schema(name = "parentId", title = "父级id")
|
||||
@NotNull(message = "父级id不能为空")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(name = "categoryName", title = "分类名称")
|
||||
@NotNull(message = "分类名称不能为空")
|
||||
@NotBlank(message = "分类名称不能为空")
|
||||
private String categoryName;
|
||||
|
||||
@Schema(name = "budgetName", title = "预算名称")
|
||||
@NotNull(message = "预算名称不能为空")
|
||||
@NotBlank(message = "预算名称不能为空")
|
||||
private String budgetName;
|
||||
|
||||
@Schema(name = "statusType", title = "完成状态")
|
||||
@NotNull(message = "完成状态不能为空")
|
||||
@NotBlank(message = "完成状态不能为空")
|
||||
private String statusType;
|
||||
|
||||
@Schema(name = "amount", title = "预算金额")
|
||||
@NotNull(message = "预算金额不能为空")
|
||||
@Min(value = 0, message = "不能低于0")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(name = "period", title = "预算周期")
|
||||
@NotNull(message = "预算周期不能为空")
|
||||
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime startPeriod;
|
||||
|
||||
@Schema(name = "period", title = "预算周期")
|
||||
@NotNull(message = "预算周期不能为空")
|
||||
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime endPeriod;
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package cn.bunny.dao.dto.financial.budgetCategory.user;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.Min;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "BudgetCategoryUpdateDto对象", title = "预算分类更新", description = "预算分类更新")
|
||||
public class BudgetCategoryUpdateUserDto {
|
||||
|
||||
@Schema(name = "id", title = "主键")
|
||||
@NotNull(message = "id不能为空")
|
||||
private Long id;
|
||||
|
||||
@Schema(name = "parentId", title = "父级id")
|
||||
@NotNull(message = "父级id不能为空")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(name = "categoryName", title = "分类名称")
|
||||
@NotNull(message = "分类名称不能为空")
|
||||
@NotBlank(message = "分类名称不能为空")
|
||||
private String categoryName;
|
||||
|
||||
@Schema(name = "budgetName", title = "预算名称")
|
||||
@NotNull(message = "预算名称不能为空")
|
||||
@NotBlank(message = "预算名称不能为空")
|
||||
private String budgetName;
|
||||
|
||||
@Schema(name = "statusType", title = "完成状态")
|
||||
@NotNull(message = "完成状态不能为空")
|
||||
@NotBlank(message = "完成状态不能为空")
|
||||
private String statusType;
|
||||
|
||||
@Schema(name = "amount", title = "预算金额")
|
||||
@NotNull(message = "预算金额不能为空")
|
||||
@Min(value = 0, message = "不能低于0")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(name = "period", title = "预算周期")
|
||||
@NotNull(message = "预算周期不能为空")
|
||||
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime startPeriod;
|
||||
|
||||
@Schema(name = "period", title = "预算周期")
|
||||
@NotNull(message = "预算周期不能为空")
|
||||
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime endPeriod;
|
||||
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.financial.category.admin;
|
||||
package cn.bunny.dao.dto.financial.category;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
|
@ -16,6 +16,7 @@ import lombok.NoArgsConstructor;
|
|||
public class CategoryAddDto {
|
||||
|
||||
@Schema(name = "userId", title = "绑定的用户id")
|
||||
@NotNull(message = "用户不能为空")
|
||||
private Long userId;
|
||||
|
||||
@Schema(name = "categoryName", title = "分类名称")
|
||||
|
|
|
@ -20,6 +20,7 @@ public class CategoryUpdateDto {
|
|||
private Long id;
|
||||
|
||||
@Schema(name = "userId", title = "绑定的用户id")
|
||||
@NotNull(message = "用户不能为空")
|
||||
private Long userId;
|
||||
|
||||
@Schema(name = "categoryName", title = "分类名称")
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
package cn.bunny.dao.dto.financial.category.user;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "CategoryDto对象", title = "分类信息查询", description = "分类信息查询")
|
||||
public class CategoryUserDto {
|
||||
|
||||
@Schema(name = "categoryName", title = "分类名称")
|
||||
private String categoryName;
|
||||
|
||||
@Schema(name = "isBuiltin", title = "是否内置字段")
|
||||
private Boolean isBuiltin;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.financial.debtRepaymentPlan;
|
||||
package cn.bunny.dao.dto.financial.debtRepaymentPlan.admin;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
@ -21,6 +21,7 @@ import java.time.LocalDateTime;
|
|||
public class DebtRepaymentPlanAddDto {
|
||||
|
||||
@Schema(name = "userId", title = "绑定的用户id")
|
||||
@NotNull(message = "用户不能为空")
|
||||
private Long userId;
|
||||
|
||||
@Schema(name = "installmentNumber", title = "债务金额")
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.financial.debtRepaymentPlan;
|
||||
package cn.bunny.dao.dto.financial.debtRepaymentPlan.admin;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
@ -25,6 +25,7 @@ public class DebtRepaymentPlanUpdateDto {
|
|||
private Long id;
|
||||
|
||||
@Schema(name = "userId", title = "绑定的用户id")
|
||||
@NotNull(message = "用户不能为空")
|
||||
private Long userId;
|
||||
|
||||
@Schema(name = "installmentNumber", title = "债务金额")
|
|
@ -0,0 +1,46 @@
|
|||
package cn.bunny.dao.dto.financial.debtRepaymentPlan.user;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.Min;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "CategoryUserAddDto对象", title = "债务还款计划表添加", description = "债务还款计划表添加")
|
||||
public class DebtRepaymentPlanAddUserDto {
|
||||
|
||||
@Schema(name = "installmentNumber", title = "债务金额")
|
||||
@NotNull(message = "债务金额不能为空")
|
||||
private BigDecimal installmentNumber;
|
||||
|
||||
@Schema(name = "installmentAmount", title = "每期应还金额")
|
||||
@NotNull(message = "每期应还金额不能为空")
|
||||
private BigDecimal installmentAmount;
|
||||
|
||||
@Schema(name = "dueDate", title = "还款截止日期")
|
||||
@NotNull(message = "还款截止日期不能为空")
|
||||
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime dueDate;
|
||||
|
||||
@Schema(name = "paidAmount", title = "已还金额")
|
||||
@NotNull(message = "已还金额不能为空")
|
||||
@Min(value = 0, message = "金额格式不正确")
|
||||
private BigDecimal paidAmount;
|
||||
|
||||
@Schema(name = "paymentStatus", title = "还款状态")
|
||||
@NotNull(message = "还款状态不能为空")
|
||||
@NotBlank(message = "还款状态不能为空")
|
||||
private String paymentStatus;
|
||||
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
package cn.bunny.dao.dto.financial.debtRepaymentPlan.user;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.Min;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "DebtRepaymentPlanUpdateDto对象", title = "债务还款计划更新", description = "债务还款计划更新")
|
||||
public class DebtRepaymentPlanUpdateUserDto {
|
||||
|
||||
@Schema(name = "id", title = "主键")
|
||||
@NotNull(message = "id不能为空")
|
||||
private Long id;
|
||||
|
||||
@Schema(name = "installmentNumber", title = "债务金额")
|
||||
@NotNull(message = "债务金额不能为空")
|
||||
private BigDecimal installmentNumber;
|
||||
|
||||
@Schema(name = "installmentAmount", title = "每期应还金额")
|
||||
@NotNull(message = "每期应还金额不能为空")
|
||||
@Min(value = 0, message = "金额格式不正确")
|
||||
private BigDecimal installmentAmount;
|
||||
|
||||
@Schema(name = "dueDate", title = "还款截止日期")
|
||||
@NotNull(message = "还款截止日期不能为空")
|
||||
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime dueDate;
|
||||
|
||||
@Schema(name = "paidAmount", title = "已还金额")
|
||||
@NotNull(message = "已还金额不能为空")
|
||||
private BigDecimal paidAmount;
|
||||
|
||||
@Schema(name = "paymentStatus", title = "还款状态")
|
||||
@NotNull(message = "还款状态不能为空")
|
||||
@NotBlank(message = "还款状态不能为空")
|
||||
private String paymentStatus;
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.financial.debtTracking;
|
||||
package cn.bunny.dao.dto.financial.debtTracking.admin;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
@ -21,7 +21,7 @@ import java.time.LocalDateTime;
|
|||
public class DebtTrackingAddDto {
|
||||
|
||||
@Schema(name = "userId", title = "绑定的用户")
|
||||
@NotNull(message = "债务不能为空")
|
||||
@NotNull(message = "用户不能为空")
|
||||
private Long userId;
|
||||
|
||||
@Schema(name = "debtorName", title = "债务人姓名")
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.financial.debtTracking;
|
||||
package cn.bunny.dao.dto.financial.debtTracking.admin;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
@ -25,6 +25,7 @@ public class DebtTrackingUpdateDto {
|
|||
private Long id;
|
||||
|
||||
@Schema(name = "userId", title = "绑定的用户")
|
||||
@NotNull(message = "用户不能为空")
|
||||
private Long userId;
|
||||
|
||||
@Schema(name = "debtorName", title = "债务人姓名")
|
|
@ -0,0 +1,49 @@
|
|||
package cn.bunny.dao.dto.financial.debtTracking.user;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.Min;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "DebtTrackingAddDto对象", title = "债务追踪添加", description = "债务追踪")
|
||||
public class DebtTrackingAddUserDto {
|
||||
|
||||
@Schema(name = "debtorName", title = "债务人姓名")
|
||||
@NotNull(message = "债务人姓名不能为空")
|
||||
@NotBlank(message = "债务人姓名不能为空")
|
||||
private String debtorName;
|
||||
|
||||
@Schema(name = "debtAmount", title = "债务金额")
|
||||
@NotNull(message = "债务不能为空")
|
||||
@Min(value = 0, message = "金额格式不正确")
|
||||
private BigDecimal debtAmount;
|
||||
|
||||
@Schema(name = "debtType", title = "债务类型")
|
||||
@NotNull(message = "债务类型不能为空")
|
||||
@NotBlank(message = "债务类型不能为空")
|
||||
private String debtType;
|
||||
|
||||
@Schema(name = "debtStatus", title = "债务状态")
|
||||
@NotNull(message = "债务状态不能为空")
|
||||
@NotBlank(message = "债务状态不能为空")
|
||||
private String debtStatus;
|
||||
|
||||
@Schema(name = "dueDate", title = "还款截止日期")
|
||||
@NotNull(message = "债务不能为空")
|
||||
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime dueDate;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
package cn.bunny.dao.dto.financial.debtTracking.user;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.Min;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "DebtTrackingUpdateDto对象", title = "债务追踪更新", description = "债务追踪更新")
|
||||
public class DebtTrackingUpdateUserDto {
|
||||
|
||||
@Schema(name = "id", title = "主键")
|
||||
@NotNull(message = "id不能为空")
|
||||
private Long id;
|
||||
|
||||
@Schema(name = "debtorName", title = "债务人姓名")
|
||||
@NotNull(message = "债务人姓名不能为空")
|
||||
@NotBlank(message = "债务人姓名不能为空")
|
||||
private String debtorName;
|
||||
|
||||
@Schema(name = "debtAmount", title = "债务金额")
|
||||
@NotNull(message = "债务不能为空")
|
||||
@Min(value = 0, message = "金额格式不正确")
|
||||
private BigDecimal debtAmount;
|
||||
|
||||
@Schema(name = "debtType", title = "债务类型")
|
||||
@NotNull(message = "债务类型不能为空")
|
||||
@NotBlank(message = "债务类型不能为空")
|
||||
private String debtType;
|
||||
|
||||
@Schema(name = "debtStatus", title = "债务状态")
|
||||
@NotNull(message = "债务状态不能为空")
|
||||
@NotBlank(message = "债务状态不能为空")
|
||||
private String debtStatus;
|
||||
|
||||
@Schema(name = "dueDate", title = "还款截止日期")
|
||||
@NotNull(message = "债务不能为空")
|
||||
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime dueDate;
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.financial.savingGoal;
|
||||
package cn.bunny.dao.dto.financial.savingGoal.admin;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
@ -21,7 +21,7 @@ import java.time.LocalDateTime;
|
|||
public class SavingGoalAddDto {
|
||||
|
||||
@Schema(name = "userId", title = "绑定的用户id")
|
||||
@NotNull(message = "用户id不能为空")
|
||||
@NotNull(message = "用户不能为空")
|
||||
private Long userId;
|
||||
|
||||
@Schema(name = "statusType", title = "完成状态")
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.financial.savingGoal;
|
||||
package cn.bunny.dao.dto.financial.savingGoal.admin;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
@ -25,7 +25,7 @@ public class SavingGoalUpdateDto {
|
|||
private Long id;
|
||||
|
||||
@Schema(name = "userId", title = "绑定的用户id")
|
||||
@NotNull(message = "用户id不能为空")
|
||||
@NotNull(message = "用户不能为空")
|
||||
private Long userId;
|
||||
|
||||
@Schema(name = "statusType", title = "完成状态")
|
|
@ -0,0 +1,48 @@
|
|||
package cn.bunny.dao.dto.financial.savingGoal.user;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.Min;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "SavingGoalAddDto对象", title = "用户储值添加", description = "用户储值添加")
|
||||
public class SavingGoalAddUserDto {
|
||||
|
||||
@Schema(name = "statusType", title = "完成状态")
|
||||
@NotNull(message = "完成状态不能为空")
|
||||
@NotBlank(message = "完成状态不能为空")
|
||||
private String statusType;
|
||||
|
||||
@Schema(name = "savingGoalName", title = "储值目标名称")
|
||||
@NotNull(message = "储值目标名称不能为空")
|
||||
@NotBlank(message = "储值目标名称不能为空")
|
||||
private String savingGoalName;
|
||||
|
||||
@Schema(name = "amount", title = "目标金额")
|
||||
@NotNull(message = "目标金额不能为空")
|
||||
@Min(value = 0, message = "储蓄值不能小于0")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(name = "startDuration", title = "开始目标时长")
|
||||
@NotNull(message = "开始目标时长不能为空")
|
||||
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime startDuration;
|
||||
|
||||
@Schema(name = "endDuration", title = "结束目标时长")
|
||||
@NotNull(message = "结束目标时长不能为空")
|
||||
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime endDuration;
|
||||
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
package cn.bunny.dao.dto.financial.savingGoal.user;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.Min;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "SavingGoalUpdateDto对象", title = "用户储值更新", description = "用户储值更新")
|
||||
public class SavingGoalUpdateUserDto {
|
||||
|
||||
@Schema(name = "id", title = "主键")
|
||||
@NotNull(message = "id不能为空")
|
||||
private Long id;
|
||||
|
||||
@Schema(name = "statusType", title = "完成状态")
|
||||
@NotNull(message = "完成状态不能为空")
|
||||
@NotBlank(message = "完成状态不能为空")
|
||||
private String statusType;
|
||||
|
||||
@Schema(name = "savingGoalName", title = "储值目标名称")
|
||||
@NotNull(message = "储值目标名称不能为空")
|
||||
@NotBlank(message = "储值目标名称不能为空")
|
||||
private String savingGoalName;
|
||||
|
||||
@Schema(name = "amount", title = "目标金额")
|
||||
@NotNull(message = "目标金额不能为空")
|
||||
@Min(value = 0, message = "金额格式不正确")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(name = "startDuration", title = "开始目标时长")
|
||||
@NotNull(message = "开始目标时长不能为空")
|
||||
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime startDuration;
|
||||
|
||||
@Schema(name = "endDuration", title = "结束目标时长")
|
||||
@NotNull(message = "结束目标时长不能为空")
|
||||
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime endDuration;
|
||||
|
||||
}
|
|
@ -73,6 +73,7 @@ public enum ResultCodeEnum {
|
|||
LOGGED_IN_FROM_ANOTHER_DEVICE(403, "没有权限访问"),
|
||||
TOKEN_PARSING_FAILED(403, "token解析失败"),
|
||||
FAIL_NO_ACCESS_DENIED_USER_LOCKED(403, "该账户已封禁"),
|
||||
ROUTER_RANK_NEED_LARGER_THAN_THE_PARENT(219, "设置路由等级需要大于或等于父级的路由等级"),
|
||||
|
||||
// 系统错误 500
|
||||
UNKNOWN_EXCEPTION(500, "服务异常"),
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.vo.financial.admin;
|
||||
package cn.bunny.dao.vo.financial;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
@ -0,0 +1,54 @@
|
|||
package cn.bunny.dao.vo.financial.user;
|
||||
|
||||
import cn.bunny.dao.common.vo.BaseUserVo;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "BudgetCategoryVo对象", title = "预算分类查询返回对象", description = "预算分类查询返回对象")
|
||||
public class BudgetCategoryUserVo extends BaseUserVo {
|
||||
|
||||
@Schema(name = "parentId", title = "父级id")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||
@JSONField(serializeUsing = ToStringSerializer.class)
|
||||
private Long parentId;
|
||||
|
||||
@Schema(name = "categoryName", title = "分类名称")
|
||||
private String categoryName;
|
||||
|
||||
@Schema(name = "budgetName", title = "预算名称")
|
||||
private String budgetName;
|
||||
|
||||
@Schema(name = "statusType", title = "完成状态")
|
||||
private String statusType;
|
||||
|
||||
@Schema(name = "amount", title = "预算金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(name = "startPeriod", title = "预算周期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonSerialize(using = LocalDateTimeSerializer.class)
|
||||
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
|
||||
private LocalDateTime startPeriod;
|
||||
|
||||
@Schema(name = "endPeriod", title = "预算周期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonSerialize(using = LocalDateTimeSerializer.class)
|
||||
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
|
||||
private LocalDateTime endPeriod;
|
||||
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
package cn.bunny.dao.vo.financial.user;
|
||||
|
||||
import cn.bunny.dao.common.vo.BaseUserVo;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "DebtTrackingVo对象", title = "债务追踪返回内容", description = "债务追踪返回内容")
|
||||
public class DebtTrackingUserVo extends BaseUserVo {
|
||||
|
||||
@Schema(name = "userId", title = "绑定的用户")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||
@JSONField(serializeUsing = ToStringSerializer.class)
|
||||
private Long userId;
|
||||
|
||||
@Schema(name = "username", title = "用户名")
|
||||
private String username;
|
||||
|
||||
@Schema(name = "debtorName", title = "债务人姓名")
|
||||
private String debtorName;
|
||||
|
||||
@Schema(name = "debtAmount", title = "债务金额")
|
||||
private BigDecimal debtAmount;
|
||||
|
||||
@Schema(name = "debtType", title = "债务类型")
|
||||
private String debtType;
|
||||
|
||||
@Schema(name = "debtStatus", title = "债务状态")
|
||||
private String debtStatus;
|
||||
|
||||
@Schema(name = "dueDate", title = "还款截止日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonSerialize(using = LocalDateTimeSerializer.class)
|
||||
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
|
||||
private LocalDateTime dueDate;
|
||||
|
||||
}
|
|
@ -1,11 +1,10 @@
|
|||
package cn.bunny.services.controller.financial;
|
||||
|
||||
import cn.bunny.dao.dto.financial.bill.BillDto;
|
||||
import cn.bunny.dao.dto.financial.bill.admin.BillAddDto;
|
||||
import cn.bunny.dao.dto.financial.bill.admin.BillDto;
|
||||
import cn.bunny.dao.dto.financial.bill.admin.BillUpdateDto;
|
||||
import cn.bunny.dao.dto.financial.bill.user.BillUserAddDto;
|
||||
import cn.bunny.dao.dto.financial.bill.user.BillUserDto;
|
||||
import cn.bunny.dao.dto.financial.bill.user.BillUserUpdateDto;
|
||||
import cn.bunny.dao.dto.financial.bill.user.BillAddUserDto;
|
||||
import cn.bunny.dao.dto.financial.bill.user.BillUpdateUserDto;
|
||||
import cn.bunny.dao.entity.financial.Bill;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.pojo.result.Result;
|
||||
|
@ -40,40 +39,6 @@ public class BillController {
|
|||
@Autowired
|
||||
private BillService billService;
|
||||
|
||||
@Operation(summary = "用户分页查询账单信息", description = "用户分页查询账单信息")
|
||||
@GetMapping("noManage/getUserBillList/{page}/{limit}")
|
||||
public Mono<Result<PageResult<BillUserVo>>> getUserBillList(
|
||||
@Parameter(name = "page", description = "当前页", required = true)
|
||||
@PathVariable("page") Integer page,
|
||||
@Parameter(name = "limit", description = "每页记录数", required = true)
|
||||
@PathVariable("limit") Integer limit,
|
||||
BillUserDto dto) {
|
||||
Page<Bill> pageParams = new Page<>(page, limit);
|
||||
PageResult<BillUserVo> pageResult = billService.getUserBillList(pageParams, dto);
|
||||
return Mono.just(Result.success(pageResult));
|
||||
}
|
||||
|
||||
@Operation(summary = "用户添加账单信息", description = "用户添加账单信息")
|
||||
@PostMapping("noManage/addUserBill")
|
||||
public Mono<Result<String>> addUserBill(@Valid @RequestBody BillUserAddDto dto) {
|
||||
billService.addUserBill(dto);
|
||||
return Mono.just(Result.success(ResultCodeEnum.ADD_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "用户更新账单信息", description = "用户更新账单信息")
|
||||
@PutMapping("noManage/updateUserBill")
|
||||
public Mono<Result<String>> updateUserBill(@Valid @RequestBody BillUserUpdateDto dto) {
|
||||
billService.updateUserBill(dto);
|
||||
return Mono.just(Result.success(ResultCodeEnum.UPDATE_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "用户删除账单信息", description = "用户删除账单信息")
|
||||
@DeleteMapping("noManage/deleteUserBill")
|
||||
public Mono<Result<String>> deleteUserBill(@RequestBody List<Long> ids) {
|
||||
billService.deleteUserBill(ids);
|
||||
return Mono.just(Result.success(ResultCodeEnum.DELETE_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页查询账单信息", description = "分页查询账单信息")
|
||||
@GetMapping("getBillList/{page}/{limit}")
|
||||
public Mono<Result<PageResult<BillVo>>> getBillList(
|
||||
|
@ -87,6 +52,19 @@ public class BillController {
|
|||
return Mono.just(Result.success(pageResult));
|
||||
}
|
||||
|
||||
@Operation(summary = "用户分页查询账单信息", description = "用户分页查询账单信息")
|
||||
@GetMapping("noManage/getUserBillList/{page}/{limit}")
|
||||
public Mono<Result<PageResult<BillUserVo>>> getUserBillList(
|
||||
@Parameter(name = "page", description = "当前页", required = true)
|
||||
@PathVariable("page") Integer page,
|
||||
@Parameter(name = "limit", description = "每页记录数", required = true)
|
||||
@PathVariable("limit") Integer limit,
|
||||
BillDto dto) {
|
||||
Page<Bill> pageParams = new Page<>(page, limit);
|
||||
PageResult<BillUserVo> pageResult = billService.getUserBillList(pageParams, dto);
|
||||
return Mono.just(Result.success(pageResult));
|
||||
}
|
||||
|
||||
@Operation(summary = "添加账单信息", description = "添加账单信息")
|
||||
@PostMapping("addBill")
|
||||
public Mono<Result<String>> addBill(@Valid @RequestBody BillAddDto dto) {
|
||||
|
@ -94,6 +72,13 @@ public class BillController {
|
|||
return Mono.just(Result.success(ResultCodeEnum.ADD_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "用户添加账单信息", description = "用户添加账单信息")
|
||||
@PostMapping("noManage/addUserBill")
|
||||
public Mono<Result<String>> addUserBill(@Valid @RequestBody BillAddUserDto dto) {
|
||||
billService.addUserBill(dto);
|
||||
return Mono.just(Result.success(ResultCodeEnum.ADD_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "更新账单信息", description = "更新账单信息")
|
||||
@PutMapping("updateBill")
|
||||
public Mono<Result<String>> updateBill(@Valid @RequestBody BillUpdateDto dto) {
|
||||
|
@ -101,10 +86,24 @@ public class BillController {
|
|||
return Mono.just(Result.success(ResultCodeEnum.UPDATE_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "用户更新账单信息", description = "用户更新账单信息")
|
||||
@PutMapping("noManage/updateUserBill")
|
||||
public Mono<Result<String>> updateUserBill(@Valid @RequestBody BillUpdateUserDto dto) {
|
||||
billService.updateUserBill(dto);
|
||||
return Mono.just(Result.success(ResultCodeEnum.UPDATE_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "删除账单信息", description = "删除账单信息")
|
||||
@DeleteMapping("deleteBill")
|
||||
public Mono<Result<String>> deleteBill(@RequestBody List<Long> ids) {
|
||||
billService.deleteBill(ids);
|
||||
return Mono.just(Result.success(ResultCodeEnum.DELETE_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "用户删除账单信息", description = "用户删除账单信息")
|
||||
@DeleteMapping("noManage/deleteUserBill")
|
||||
public Mono<Result<String>> deleteUserBill(@RequestBody List<Long> ids) {
|
||||
billService.deleteUserBill(ids);
|
||||
return Mono.just(Result.success(ResultCodeEnum.DELETE_SUCCESS));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,17 @@
|
|||
package cn.bunny.services.controller.financial;
|
||||
|
||||
import cn.bunny.dao.dto.financial.budgetCategory.BudgetCategoryAddDto;
|
||||
import cn.bunny.dao.dto.financial.budgetCategory.BudgetCategoryDto;
|
||||
import cn.bunny.dao.dto.financial.budgetCategory.BudgetCategoryUpdateDto;
|
||||
import cn.bunny.dao.dto.financial.budgetCategory.admin.BudgetCategoryAddDto;
|
||||
import cn.bunny.dao.dto.financial.budgetCategory.admin.BudgetCategoryUpdateDto;
|
||||
import cn.bunny.dao.dto.financial.budgetCategory.user.BudgetCategoryAddUserDto;
|
||||
import cn.bunny.dao.dto.financial.budgetCategory.user.BudgetCategoryUpdateUserDto;
|
||||
import cn.bunny.dao.entity.financial.BudgetCategory;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.pojo.result.Result;
|
||||
import cn.bunny.dao.pojo.result.ResultCodeEnum;
|
||||
import cn.bunny.dao.vo.financial.admin.BudgetCategoryParentVo;
|
||||
import cn.bunny.dao.vo.financial.BudgetCategoryParentVo;
|
||||
import cn.bunny.dao.vo.financial.admin.BudgetCategoryVo;
|
||||
import cn.bunny.dao.vo.financial.user.BudgetCategoryUserVo;
|
||||
import cn.bunny.services.service.financial.BudgetCategoryService;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
@ -37,6 +40,20 @@ public class BudgetCategoryController {
|
|||
@Autowired
|
||||
private BudgetCategoryService budgetCategoryService;
|
||||
|
||||
@Operation(summary = "返回所有父级对象", description = "返回所有父级对象")
|
||||
@GetMapping("noManage/getAllParentList")
|
||||
public Mono<Result<List<BudgetCategoryParentVo>>> getAllParentList(@RequestBody(required = false) Long userId) {
|
||||
List<BudgetCategoryParentVo> voList = budgetCategoryService.getAllParentList(userId);
|
||||
return Mono.just(Result.success(voList));
|
||||
}
|
||||
|
||||
@Operation(summary = "返回当前用户所有父级对象", description = "返回当前用户所有父级对象")
|
||||
@GetMapping("noManage/getAllUserParentList")
|
||||
public Mono<Result<List<BudgetCategoryParentVo>>> getAllUserParentList() {
|
||||
List<BudgetCategoryParentVo> voList = budgetCategoryService.getAllUserParentList();
|
||||
return Mono.just(Result.success(voList));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页查询预算分类表", description = "分页查询预算分类表")
|
||||
@GetMapping("getBudgetCategoryList/{page}/{limit}")
|
||||
public Mono<Result<PageResult<BudgetCategoryVo>>> getBudgetCategoryList(
|
||||
|
@ -50,11 +67,17 @@ public class BudgetCategoryController {
|
|||
return Mono.just(Result.success(pageResult));
|
||||
}
|
||||
|
||||
@Operation(summary = "返回所有父级对象", description = "返回所有父级对象")
|
||||
@GetMapping("noManage/getAllParentList")
|
||||
public Mono<Result<List<BudgetCategoryParentVo>>> getAllParentList() {
|
||||
List<BudgetCategoryParentVo> voList = budgetCategoryService.getAllParentList();
|
||||
return Mono.just(Result.success(voList));
|
||||
@Operation(summary = "用户分页查询预算分类表", description = "用户分页查询预算分类表")
|
||||
@GetMapping("noManage/getUserBudgetCategoryList/{page}/{limit}")
|
||||
public Mono<Result<PageResult<BudgetCategoryUserVo>>> getUserBudgetCategoryList(
|
||||
@Parameter(name = "page", description = "当前页", required = true)
|
||||
@PathVariable("page") Integer page,
|
||||
@Parameter(name = "limit", description = "每页记录数", required = true)
|
||||
@PathVariable("limit") Integer limit,
|
||||
BudgetCategoryDto dto) {
|
||||
Page<BudgetCategory> pageParams = new Page<>(page, limit);
|
||||
PageResult<BudgetCategoryUserVo> pageResult = budgetCategoryService.getUserBudgetCategoryList(pageParams, dto);
|
||||
return Mono.just(Result.success(pageResult));
|
||||
}
|
||||
|
||||
@Operation(summary = "添加预算分类表", description = "添加预算分类表")
|
||||
|
@ -64,6 +87,13 @@ public class BudgetCategoryController {
|
|||
return Mono.just(Result.success(ResultCodeEnum.ADD_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "用户添加预算分类表", description = "用户添加预算分类表")
|
||||
@PostMapping("noManage/addUserBudgetCategory")
|
||||
public Mono<Result<String>> addUserBudgetCategory(@Valid @RequestBody BudgetCategoryAddUserDto dto) {
|
||||
budgetCategoryService.addUserBudgetCategory(dto);
|
||||
return Mono.just(Result.success(ResultCodeEnum.ADD_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "更新预算分类表", description = "更新预算分类表")
|
||||
@PutMapping("updateBudgetCategory")
|
||||
public Mono<Result<String>> updateBudgetCategory(@Valid @RequestBody BudgetCategoryUpdateDto dto) {
|
||||
|
@ -71,10 +101,24 @@ public class BudgetCategoryController {
|
|||
return Mono.just(Result.success(ResultCodeEnum.UPDATE_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "用户更新预算分类表", description = "用户更新预算分类表")
|
||||
@PutMapping("noManage/updateUserBudgetCategory")
|
||||
public Mono<Result<String>> updateUserBudgetCategory(@Valid @RequestBody BudgetCategoryUpdateUserDto dto) {
|
||||
budgetCategoryService.updateUserBudgetCategory(dto);
|
||||
return Mono.just(Result.success(ResultCodeEnum.UPDATE_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "删除预算分类表", description = "删除预算分类表")
|
||||
@DeleteMapping("deleteBudgetCategory")
|
||||
public Mono<Result<String>> deleteBudgetCategory(@RequestBody List<Long> ids) {
|
||||
budgetCategoryService.deleteBudgetCategory(ids);
|
||||
return Mono.just(Result.success(ResultCodeEnum.DELETE_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "用户删除预算分类表", description = "用户删除预算分类表")
|
||||
@DeleteMapping("noManage/deleteUserBudgetCategory")
|
||||
public Mono<Result<String>> deleteUserBudgetCategory(@RequestBody List<Long> ids) {
|
||||
budgetCategoryService.deleteUserBudgetCategory(ids);
|
||||
return Mono.just(Result.success(ResultCodeEnum.DELETE_SUCCESS));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
package cn.bunny.services.controller.financial;
|
||||
|
||||
import cn.bunny.dao.dto.financial.budgetCategory.user.BudgetCategoryAddUserDto;
|
||||
import cn.bunny.dao.dto.financial.category.CategoryDto;
|
||||
import cn.bunny.dao.dto.financial.category.admin.CategoryAddDto;
|
||||
import cn.bunny.dao.dto.financial.category.admin.CategoryDto;
|
||||
import cn.bunny.dao.dto.financial.category.admin.CategoryUpdateDto;
|
||||
import cn.bunny.dao.dto.financial.category.user.CategoryUserAddDto;
|
||||
import cn.bunny.dao.dto.financial.category.user.CategoryUserDto;
|
||||
import cn.bunny.dao.dto.financial.category.user.CategoryUserUpdateDto;
|
||||
import cn.bunny.dao.entity.financial.Category;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
|
@ -40,6 +39,26 @@ public class CategoryController {
|
|||
@Autowired
|
||||
private CategoryService categoryService;
|
||||
|
||||
@Operation(summary = "查询当前用户下所有的分类", description = "查询当前用户下所有的分类")
|
||||
@GetMapping("noManage/getCategoryUserAllList")
|
||||
public Mono<Result<List<CategoryUserVo>>> getCategoryUserAllList(@RequestParam(required = false) Long userId) {
|
||||
List<CategoryUserVo> voList = categoryService.getCategoryUserAllList(userId);
|
||||
return Mono.just(Result.success(voList));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页查询分类信息", description = "分页查询分类信息")
|
||||
@GetMapping("getCategoryList/{page}/{limit}")
|
||||
public Mono<Result<PageResult<CategoryVo>>> getCategoryList(
|
||||
@Parameter(name = "page", description = "当前页", required = true)
|
||||
@PathVariable("page") Integer page,
|
||||
@Parameter(name = "limit", description = "每页记录数", required = true)
|
||||
@PathVariable("limit") Integer limit,
|
||||
CategoryDto dto) {
|
||||
Page<Category> pageParams = new Page<>(page, limit);
|
||||
PageResult<CategoryVo> pageResult = categoryService.getCategoryList(pageParams, dto);
|
||||
return Mono.just(Result.success(pageResult));
|
||||
}
|
||||
|
||||
@Operation(summary = "用户分类分页查询分类信息", description = "用户分类分页查询分类信息")
|
||||
@GetMapping("noManage/getCategoryUserList/{page}/{limit}")
|
||||
public Mono<Result<PageResult<CategoryUserVo>>> getCategoryUserList(
|
||||
|
@ -47,26 +66,33 @@ public class CategoryController {
|
|||
@PathVariable("page") Integer page,
|
||||
@Parameter(name = "limit", description = "每页记录数", required = true)
|
||||
@PathVariable("limit") Integer limit,
|
||||
CategoryUserDto dto) {
|
||||
CategoryDto dto) {
|
||||
Page<Category> pageParams = new Page<>(page, limit);
|
||||
PageResult<CategoryUserVo> pageResult = categoryService.getCategoryUserList(pageParams, dto);
|
||||
return Mono.just(Result.success(pageResult));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询当前用户下所有的分类", description = "查询当前用户下所有的分类")
|
||||
@GetMapping("noManage/getCategoryUserAllList")
|
||||
public Mono<Result<List<CategoryUserVo>>> getCategoryUserAllList() {
|
||||
List<CategoryUserVo> voList = categoryService.getCategoryUserAllList();
|
||||
return Mono.just(Result.success(voList));
|
||||
@Operation(summary = "添加分类信息", description = "添加分类信息")
|
||||
@PostMapping("addCategory")
|
||||
public Mono<Result<String>> addCategory(@Valid @RequestBody CategoryAddDto dto) {
|
||||
categoryService.addCategory(dto);
|
||||
return Mono.just(Result.success(ResultCodeEnum.ADD_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "用戶分类添加分类信息", description = "用戶分类添加分类信息")
|
||||
@PostMapping("noManage/addCategoryUser")
|
||||
public Mono<Result<String>> addCategoryUser(@Valid @RequestBody CategoryUserAddDto dto) {
|
||||
public Mono<Result<String>> addCategoryUser(@Valid @RequestBody BudgetCategoryAddUserDto dto) {
|
||||
categoryService.addCategoryUser(dto);
|
||||
return Mono.just(Result.success(ResultCodeEnum.ADD_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "更新分类信息", description = "更新分类信息")
|
||||
@PutMapping("updateCategory")
|
||||
public Mono<Result<String>> updateCategory(@Valid @RequestBody CategoryUpdateDto dto) {
|
||||
categoryService.updateCategory(dto);
|
||||
return Mono.just(Result.success(ResultCodeEnum.UPDATE_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "用户分类更新分类信息", description = "用户分类更新分类信息")
|
||||
@PutMapping("noManage/updateCategoryUser")
|
||||
public Mono<Result<String>> updateCategoryUser(@Valid @RequestBody CategoryUserUpdateDto dto) {
|
||||
|
@ -81,33 +107,6 @@ public class CategoryController {
|
|||
return Mono.just(Result.success(ResultCodeEnum.DELETE_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页查询分类信息", description = "分页查询分类信息")
|
||||
@GetMapping("getCategoryList/{page}/{limit}")
|
||||
public Mono<Result<PageResult<CategoryVo>>> getCategoryList(
|
||||
@Parameter(name = "page", description = "当前页", required = true)
|
||||
@PathVariable("page") Integer page,
|
||||
@Parameter(name = "limit", description = "每页记录数", required = true)
|
||||
@PathVariable("limit") Integer limit,
|
||||
CategoryDto dto) {
|
||||
Page<Category> pageParams = new Page<>(page, limit);
|
||||
PageResult<CategoryVo> pageResult = categoryService.getCategoryList(pageParams, dto);
|
||||
return Mono.just(Result.success(pageResult));
|
||||
}
|
||||
|
||||
@Operation(summary = "添加分类信息", description = "添加分类信息")
|
||||
@PostMapping("addCategory")
|
||||
public Mono<Result<String>> addCategory(@Valid @RequestBody CategoryAddDto dto) {
|
||||
categoryService.addCategory(dto);
|
||||
return Mono.just(Result.success(ResultCodeEnum.ADD_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "更新分类信息", description = "更新分类信息")
|
||||
@PutMapping("updateCategory")
|
||||
public Mono<Result<String>> updateCategory(@Valid @RequestBody CategoryUpdateDto dto) {
|
||||
categoryService.updateCategory(dto);
|
||||
return Mono.just(Result.success(ResultCodeEnum.UPDATE_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "删除分类信息", description = "删除分类信息")
|
||||
@DeleteMapping("deleteCategory")
|
||||
public Mono<Result<String>> deleteCategory(@RequestBody List<Long> ids) {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package cn.bunny.services.controller.financial;
|
||||
|
||||
import cn.bunny.dao.dto.financial.debtRepaymentPlan.DebtRepaymentPlanAddDto;
|
||||
import cn.bunny.dao.dto.financial.debtRepaymentPlan.DebtRepaymentPlanDto;
|
||||
import cn.bunny.dao.dto.financial.debtRepaymentPlan.DebtRepaymentPlanUpdateDto;
|
||||
import cn.bunny.dao.dto.financial.debtRepaymentPlan.admin.DebtRepaymentPlanAddDto;
|
||||
import cn.bunny.dao.dto.financial.debtRepaymentPlan.admin.DebtRepaymentPlanUpdateDto;
|
||||
import cn.bunny.dao.entity.financial.DebtRepaymentPlan;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.pojo.result.Result;
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
package cn.bunny.services.controller.financial;
|
||||
|
||||
import cn.bunny.dao.dto.financial.debtTracking.DebtTrackingAddDto;
|
||||
import cn.bunny.dao.dto.financial.debtTracking.DebtTrackingDto;
|
||||
import cn.bunny.dao.dto.financial.debtTracking.DebtTrackingUpdateDto;
|
||||
import cn.bunny.dao.dto.financial.debtTracking.admin.DebtTrackingAddDto;
|
||||
import cn.bunny.dao.dto.financial.debtTracking.admin.DebtTrackingUpdateDto;
|
||||
import cn.bunny.dao.dto.financial.debtTracking.user.DebtTrackingAddUserDto;
|
||||
import cn.bunny.dao.dto.financial.debtTracking.user.DebtTrackingUpdateUserDto;
|
||||
import cn.bunny.dao.entity.financial.DebtTracking;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.pojo.result.Result;
|
||||
import cn.bunny.dao.pojo.result.ResultCodeEnum;
|
||||
import cn.bunny.dao.vo.financial.admin.DebtTrackingVo;
|
||||
import cn.bunny.dao.vo.financial.user.DebtTrackingUserVo;
|
||||
import cn.bunny.services.service.financial.DebtTrackingService;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
@ -49,6 +52,19 @@ public class DebtTrackingController {
|
|||
return Mono.just(Result.success(pageResult));
|
||||
}
|
||||
|
||||
@Operation(summary = "用户分页查询债务追踪", description = "用户分页查询债务追踪")
|
||||
@GetMapping("noManage/getUserDebtTrackingList/{page}/{limit}")
|
||||
public Mono<Result<PageResult<DebtTrackingUserVo>>> getUserDebtTrackingList(
|
||||
@Parameter(name = "page", description = "当前页", required = true)
|
||||
@PathVariable("page") Integer page,
|
||||
@Parameter(name = "limit", description = "每页记录数", required = true)
|
||||
@PathVariable("limit") Integer limit,
|
||||
DebtTrackingDto dto) {
|
||||
Page<DebtTracking> pageParams = new Page<>(page, limit);
|
||||
PageResult<DebtTrackingUserVo> pageResult = debtTrackingService.getUserDebtTrackingList(pageParams, dto);
|
||||
return Mono.just(Result.success(pageResult));
|
||||
}
|
||||
|
||||
@Operation(summary = "添加债务追踪", description = "添加债务追踪")
|
||||
@PostMapping("addDebtTracking")
|
||||
public Mono<Result<String>> addDebtTracking(@Valid @RequestBody DebtTrackingAddDto dto) {
|
||||
|
@ -56,6 +72,13 @@ public class DebtTrackingController {
|
|||
return Mono.just(Result.success(ResultCodeEnum.ADD_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "用户添加债务追踪", description = "用户添加债务追踪")
|
||||
@PostMapping("noManage/addUserDebtTracking")
|
||||
public Mono<Result<String>> addUserDebtTracking(@Valid @RequestBody DebtTrackingAddUserDto dto) {
|
||||
debtTrackingService.addUserDebtTracking(dto);
|
||||
return Mono.just(Result.success(ResultCodeEnum.ADD_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "更新债务追踪", description = "更新债务追踪")
|
||||
@PutMapping("updateDebtTracking")
|
||||
public Mono<Result<String>> updateDebtTracking(@Valid @RequestBody DebtTrackingUpdateDto dto) {
|
||||
|
@ -63,10 +86,24 @@ public class DebtTrackingController {
|
|||
return Mono.just(Result.success(ResultCodeEnum.UPDATE_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "用户更新债务追踪", description = "用户更新债务追踪")
|
||||
@PutMapping("noManage/updateUserDebtTracking")
|
||||
public Mono<Result<String>> updateUserDebtTracking(@Valid @RequestBody DebtTrackingUpdateUserDto dto) {
|
||||
debtTrackingService.updateUserDebtTracking(dto);
|
||||
return Mono.just(Result.success(ResultCodeEnum.UPDATE_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "删除债务追踪", description = "删除债务追踪")
|
||||
@DeleteMapping("deleteDebtTracking")
|
||||
public Mono<Result<String>> deleteDebtTracking(@RequestBody List<Long> ids) {
|
||||
debtTrackingService.deleteDebtTracking(ids);
|
||||
return Mono.just(Result.success(ResultCodeEnum.DELETE_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "用户删除债务追踪", description = "用户删除债务追踪")
|
||||
@DeleteMapping("noManage/deleteUserDebtTracking")
|
||||
public Mono<Result<String>> deleteUserDebtTracking(@RequestBody List<Long> ids) {
|
||||
debtTrackingService.deleteUserDebtTracking(ids);
|
||||
return Mono.just(Result.success(ResultCodeEnum.DELETE_SUCCESS));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
package cn.bunny.services.controller.financial;
|
||||
|
||||
import cn.bunny.dao.dto.financial.savingGoal.SavingGoalAddDto;
|
||||
import cn.bunny.dao.dto.financial.savingGoal.SavingGoalDto;
|
||||
import cn.bunny.dao.dto.financial.savingGoal.SavingGoalUpdateDto;
|
||||
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.user.SavingGoalAddUserDto;
|
||||
import cn.bunny.dao.entity.financial.SavingGoal;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.pojo.result.Result;
|
||||
|
@ -49,24 +50,58 @@ public class SavingGoalController {
|
|||
return Mono.just(Result.success(pageResult));
|
||||
}
|
||||
|
||||
@Operation(summary = "添加用户储值", description = "添加用户储值")
|
||||
@Operation(summary = "用户分页查询用户储值", description = "用户分页查询用户储值")
|
||||
@GetMapping("noManage/getUserSavingGoalList/{page}/{limit}")
|
||||
public Mono<Result<PageResult<SavingGoalVo>>> getUserSavingGoalList(
|
||||
@Parameter(name = "page", description = "当前页", required = true)
|
||||
@PathVariable("page") Integer page,
|
||||
@Parameter(name = "limit", description = "每页记录数", required = true)
|
||||
@PathVariable("limit") Integer limit,
|
||||
SavingGoalDto dto) {
|
||||
Page<SavingGoal> pageParams = new Page<>(page, limit);
|
||||
PageResult<SavingGoalVo> pageResult = savingGoalService.getUserSavingGoalList(pageParams, dto);
|
||||
return Mono.just(Result.success(pageResult));
|
||||
}
|
||||
|
||||
@Operation(summary = "添加储值", description = "添加储值")
|
||||
@PostMapping("addSavingGoal")
|
||||
public Mono<Result<String>> addSavingGoal(@Valid @RequestBody SavingGoalAddDto dto) {
|
||||
savingGoalService.addSavingGoal(dto);
|
||||
return Mono.just(Result.success(ResultCodeEnum.ADD_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "更新用户储值", description = "更新用户储值")
|
||||
@Operation(summary = "用户添加储值", description = "用户添加储值")
|
||||
@PostMapping("noManage/adduserSavingGoal")
|
||||
public Mono<Result<String>> adduserSavingGoal(@Valid @RequestBody SavingGoalAddUserDto dto) {
|
||||
savingGoalService.adduserSavingGoal(dto);
|
||||
return Mono.just(Result.success(ResultCodeEnum.ADD_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "更新储值", description = "更新储值")
|
||||
@PutMapping("updateSavingGoal")
|
||||
public Mono<Result<String>> updateSavingGoal(@Valid @RequestBody SavingGoalUpdateDto dto) {
|
||||
savingGoalService.updateSavingGoal(dto);
|
||||
return Mono.just(Result.success(ResultCodeEnum.UPDATE_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "删除用户储值", description = "删除用户储值")
|
||||
@Operation(summary = "用户更新储值", description = "用户更新储值")
|
||||
@PutMapping("noManage/updateUserSavingGoal")
|
||||
public Mono<Result<String>> updateUserSavingGoal(@Valid @RequestBody SavingGoalUpdateDto dto) {
|
||||
savingGoalService.updateUserSavingGoal(dto);
|
||||
return Mono.just(Result.success(ResultCodeEnum.UPDATE_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "删除储值", description = "删除储值")
|
||||
@DeleteMapping("deleteSavingGoal")
|
||||
public Mono<Result<String>> deleteSavingGoal(@RequestBody List<Long> ids) {
|
||||
savingGoalService.deleteSavingGoal(ids);
|
||||
return Mono.just(Result.success(ResultCodeEnum.DELETE_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "用户删除储值", description = "用户删除储值")
|
||||
@DeleteMapping("noManage/deleteUserSavingGoal")
|
||||
public Mono<Result<String>> deleteUserSavingGoal(@RequestBody List<Long> ids) {
|
||||
savingGoalService.deleteUserSavingGoal(ids);
|
||||
return Mono.just(Result.success(ResultCodeEnum.DELETE_SUCCESS));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
package cn.bunny.services.mapper.financial;
|
||||
|
||||
import cn.bunny.dao.dto.financial.bill.admin.BillDto;
|
||||
import cn.bunny.dao.dto.financial.bill.user.BillUserDto;
|
||||
import cn.bunny.dao.dto.financial.bill.BillDto;
|
||||
import cn.bunny.dao.entity.financial.Bill;
|
||||
import cn.bunny.dao.vo.financial.admin.BillVo;
|
||||
import cn.bunny.dao.vo.financial.user.BillUserVo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
@ -24,15 +22,6 @@ import java.util.List;
|
|||
@Mapper
|
||||
public interface BillMapper extends BaseMapper<Bill> {
|
||||
|
||||
/**
|
||||
* * 分页查询用户账单信息内容
|
||||
*
|
||||
* @param pageParams 账单信息分页参数
|
||||
* @param dto 账单信息查询表单
|
||||
* @return 账单信息分页结果
|
||||
*/
|
||||
IPage<BillUserVo> selectUserListByPage(@Param("page") Page<Bill> pageParams, @Param("dto") BillUserDto dto, @Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 物理删除账单信息
|
||||
*
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
package cn.bunny.services.mapper.financial;
|
||||
|
||||
import cn.bunny.dao.dto.financial.category.admin.CategoryDto;
|
||||
import cn.bunny.dao.dto.financial.category.user.CategoryUserDto;
|
||||
import cn.bunny.dao.dto.financial.category.CategoryDto;
|
||||
import cn.bunny.dao.entity.financial.Category;
|
||||
import cn.bunny.dao.vo.financial.admin.CategoryVo;
|
||||
import cn.bunny.dao.vo.financial.user.CategoryUserVo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
@ -23,21 +21,6 @@ import java.util.List;
|
|||
*/
|
||||
@Mapper
|
||||
public interface CategoryMapper extends BaseMapper<Category> {
|
||||
/**
|
||||
* * 分页查询分类信息内容
|
||||
*
|
||||
* @param pageParams 分类信息分页参数
|
||||
* @param dto 分类信息查询表单
|
||||
* @return 分类信息分页结果
|
||||
*/
|
||||
IPage<CategoryUserVo> selectUserListByPage(@Param("page") Page<Category> pageParams, @Param("dto") CategoryUserDto dto, @Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 物理删除分类信息
|
||||
*
|
||||
* @param ids 删除 id 列表
|
||||
*/
|
||||
void deleteBatchIdsWithUserPhysics(List<Long> ids);
|
||||
|
||||
/**
|
||||
* * 分页查询分类信息内容
|
||||
|
|
|
@ -1,18 +1,16 @@
|
|||
package cn.bunny.services.service.financial;
|
||||
|
||||
import cn.bunny.dao.dto.financial.bill.BillDto;
|
||||
import cn.bunny.dao.dto.financial.bill.admin.BillAddDto;
|
||||
import cn.bunny.dao.dto.financial.bill.admin.BillDto;
|
||||
import cn.bunny.dao.dto.financial.bill.admin.BillUpdateDto;
|
||||
import cn.bunny.dao.dto.financial.bill.user.BillUserAddDto;
|
||||
import cn.bunny.dao.dto.financial.bill.user.BillUserDto;
|
||||
import cn.bunny.dao.dto.financial.bill.user.BillUserUpdateDto;
|
||||
import cn.bunny.dao.dto.financial.bill.user.BillAddUserDto;
|
||||
import cn.bunny.dao.dto.financial.bill.user.BillUpdateUserDto;
|
||||
import cn.bunny.dao.entity.financial.Bill;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.vo.financial.admin.BillVo;
|
||||
import cn.bunny.dao.vo.financial.user.BillUserVo;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -31,21 +29,7 @@ public interface BillService extends IService<Bill> {
|
|||
*
|
||||
* @return 账单信息返回列表
|
||||
*/
|
||||
PageResult<BillUserVo> getUserBillList(Page<Bill> pageParams, BillUserDto dto);
|
||||
|
||||
/**
|
||||
* * 添加账单信息
|
||||
*
|
||||
* @param dto 添加表单
|
||||
*/
|
||||
void addUserBill(@Valid BillUserAddDto dto);
|
||||
|
||||
/**
|
||||
* * 更新账单信息
|
||||
*
|
||||
* @param dto 更新表单
|
||||
*/
|
||||
void updateUserBill(@Valid BillUserUpdateDto dto);
|
||||
PageResult<BillUserVo> getUserBillList(Page<Bill> pageParams, BillDto dto);
|
||||
|
||||
/**
|
||||
* * 删除|批量删除账单信息类型
|
||||
|
@ -81,4 +65,18 @@ public interface BillService extends IService<Bill> {
|
|||
* @param ids 删除的ids
|
||||
*/
|
||||
void deleteBill(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 用户添加账单信息
|
||||
*
|
||||
* @param dto 添加表单
|
||||
*/
|
||||
void addUserBill(BillAddUserDto dto);
|
||||
|
||||
/**
|
||||
* 用户更新账单信息
|
||||
*
|
||||
* @param dto 更新表单
|
||||
*/
|
||||
void updateUserBill(BillUpdateUserDto dto);
|
||||
}
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
package cn.bunny.services.service.financial;
|
||||
|
||||
import cn.bunny.dao.dto.financial.budgetCategory.BudgetCategoryAddDto;
|
||||
import cn.bunny.dao.dto.financial.budgetCategory.BudgetCategoryDto;
|
||||
import cn.bunny.dao.dto.financial.budgetCategory.BudgetCategoryUpdateDto;
|
||||
import cn.bunny.dao.dto.financial.budgetCategory.admin.BudgetCategoryAddDto;
|
||||
import cn.bunny.dao.dto.financial.budgetCategory.admin.BudgetCategoryUpdateDto;
|
||||
import cn.bunny.dao.dto.financial.budgetCategory.user.BudgetCategoryAddUserDto;
|
||||
import cn.bunny.dao.dto.financial.budgetCategory.user.BudgetCategoryUpdateUserDto;
|
||||
import cn.bunny.dao.entity.financial.BudgetCategory;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.vo.financial.admin.BudgetCategoryParentVo;
|
||||
import cn.bunny.dao.vo.financial.BudgetCategoryParentVo;
|
||||
import cn.bunny.dao.vo.financial.admin.BudgetCategoryVo;
|
||||
import cn.bunny.dao.vo.financial.user.BudgetCategoryUserVo;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import jakarta.validation.Valid;
|
||||
|
@ -56,5 +59,42 @@ public interface BudgetCategoryService extends IService<BudgetCategory> {
|
|||
*
|
||||
* @return 父级列表
|
||||
*/
|
||||
List<BudgetCategoryParentVo> getAllParentList();
|
||||
List<BudgetCategoryParentVo> getAllParentList(Long userId);
|
||||
|
||||
/**
|
||||
* 用户分页查询预算分类表
|
||||
*
|
||||
* @param pageParams 分页参数
|
||||
* @param dto 查询表单
|
||||
* @return 分页返回结果
|
||||
*/
|
||||
PageResult<BudgetCategoryUserVo> getUserBudgetCategoryList(Page<BudgetCategory> pageParams, BudgetCategoryDto dto);
|
||||
|
||||
/**
|
||||
* 用户删除预算分类表
|
||||
*
|
||||
* @param ids 删除id列表
|
||||
*/
|
||||
void deleteUserBudgetCategory(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 返回当前用户所有父级对象
|
||||
*
|
||||
* @return 所有父级列表
|
||||
*/
|
||||
List<BudgetCategoryParentVo> getAllUserParentList();
|
||||
|
||||
/**
|
||||
* 用户添加预算分类表
|
||||
*
|
||||
* @param dto 添加表单
|
||||
*/
|
||||
void addUserBudgetCategory(BudgetCategoryAddUserDto dto);
|
||||
|
||||
/**
|
||||
* 用户更新预算分类表
|
||||
*
|
||||
* @param dto 更新表单
|
||||
*/
|
||||
void updateUserBudgetCategory(BudgetCategoryUpdateUserDto dto);
|
||||
}
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
package cn.bunny.services.service.financial;
|
||||
|
||||
import cn.bunny.dao.dto.financial.budgetCategory.user.BudgetCategoryAddUserDto;
|
||||
import cn.bunny.dao.dto.financial.category.CategoryDto;
|
||||
import cn.bunny.dao.dto.financial.category.admin.CategoryAddDto;
|
||||
import cn.bunny.dao.dto.financial.category.admin.CategoryDto;
|
||||
import cn.bunny.dao.dto.financial.category.admin.CategoryUpdateDto;
|
||||
import cn.bunny.dao.dto.financial.category.user.CategoryUserAddDto;
|
||||
import cn.bunny.dao.dto.financial.category.user.CategoryUserDto;
|
||||
import cn.bunny.dao.dto.financial.category.user.CategoryUserUpdateDto;
|
||||
import cn.bunny.dao.entity.financial.Category;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
|
@ -26,19 +25,47 @@ import java.util.List;
|
|||
*/
|
||||
public interface CategoryService extends IService<Category> {
|
||||
|
||||
/**
|
||||
* * 获取分类信息列表
|
||||
*
|
||||
* @return 分类信息返回列表
|
||||
*/
|
||||
PageResult<CategoryVo> getCategoryList(Page<Category> pageParams, CategoryDto dto);
|
||||
|
||||
/**
|
||||
* * 用户分类分页查询分类信息
|
||||
*
|
||||
* @return 分类信息返回列表
|
||||
*/
|
||||
PageResult<CategoryUserVo> getCategoryUserList(Page<Category> pageParams, CategoryUserDto dto);
|
||||
PageResult<CategoryUserVo> getCategoryUserList(Page<Category> pageParams, CategoryDto dto);
|
||||
|
||||
/**
|
||||
* 查询当前用户下所有的分类
|
||||
*
|
||||
* @return 当前用户分类返回列表
|
||||
*/
|
||||
List<CategoryUserVo> getCategoryUserAllList(Long userId);
|
||||
|
||||
/**
|
||||
* * 添加分类信息
|
||||
*
|
||||
* @param dto 添加表单
|
||||
*/
|
||||
void addCategory(@Valid CategoryAddDto dto);
|
||||
|
||||
/**
|
||||
* * 用戶分类添加分类信息
|
||||
*
|
||||
* @param dto 添加表单
|
||||
*/
|
||||
void addCategoryUser(@Valid CategoryUserAddDto dto);
|
||||
void addCategoryUser(@Valid BudgetCategoryAddUserDto dto);
|
||||
|
||||
/**
|
||||
* * 更新分类信息
|
||||
*
|
||||
* @param dto 更新表单
|
||||
*/
|
||||
void updateCategory(@Valid CategoryUpdateDto dto);
|
||||
|
||||
/**
|
||||
* * 用户分类更新分类信息
|
||||
|
@ -54,34 +81,6 @@ public interface CategoryService extends IService<Category> {
|
|||
*/
|
||||
void deleteCategoryUser(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 查询当前用户下所有的分类
|
||||
*
|
||||
* @return 当前用户分类返回列表
|
||||
*/
|
||||
List<CategoryUserVo> getCategoryUserAllList();
|
||||
|
||||
/**
|
||||
* * 获取分类信息列表
|
||||
*
|
||||
* @return 分类信息返回列表
|
||||
*/
|
||||
PageResult<CategoryVo> getCategoryList(Page<Category> pageParams, CategoryDto dto);
|
||||
|
||||
/**
|
||||
* * 添加分类信息
|
||||
*
|
||||
* @param dto 添加表单
|
||||
*/
|
||||
void addCategory(@Valid CategoryAddDto dto);
|
||||
|
||||
/**
|
||||
* * 更新分类信息
|
||||
*
|
||||
* @param dto 更新表单
|
||||
*/
|
||||
void updateCategory(@Valid CategoryUpdateDto dto);
|
||||
|
||||
/**
|
||||
* * 删除|批量删除分类信息类型
|
||||
*
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package cn.bunny.services.service.financial;
|
||||
|
||||
import cn.bunny.dao.dto.financial.debtRepaymentPlan.DebtRepaymentPlanAddDto;
|
||||
import cn.bunny.dao.dto.financial.debtRepaymentPlan.DebtRepaymentPlanDto;
|
||||
import cn.bunny.dao.dto.financial.debtRepaymentPlan.DebtRepaymentPlanUpdateDto;
|
||||
import cn.bunny.dao.dto.financial.debtRepaymentPlan.admin.DebtRepaymentPlanAddDto;
|
||||
import cn.bunny.dao.dto.financial.debtRepaymentPlan.admin.DebtRepaymentPlanUpdateDto;
|
||||
import cn.bunny.dao.entity.financial.DebtRepaymentPlan;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.vo.financial.admin.DebtRepaymentPlanVo;
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
package cn.bunny.services.service.financial;
|
||||
|
||||
import cn.bunny.dao.dto.financial.debtTracking.DebtTrackingAddDto;
|
||||
import cn.bunny.dao.dto.financial.debtTracking.DebtTrackingDto;
|
||||
import cn.bunny.dao.dto.financial.debtTracking.DebtTrackingUpdateDto;
|
||||
import cn.bunny.dao.dto.financial.debtTracking.admin.DebtTrackingAddDto;
|
||||
import cn.bunny.dao.dto.financial.debtTracking.admin.DebtTrackingUpdateDto;
|
||||
import cn.bunny.dao.dto.financial.debtTracking.user.DebtTrackingAddUserDto;
|
||||
import cn.bunny.dao.dto.financial.debtTracking.user.DebtTrackingUpdateUserDto;
|
||||
import cn.bunny.dao.entity.financial.DebtTracking;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.vo.financial.admin.DebtTrackingVo;
|
||||
import cn.bunny.dao.vo.financial.user.DebtTrackingUserVo;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import jakarta.validation.Valid;
|
||||
|
@ -49,4 +52,34 @@ public interface DebtTrackingService extends IService<DebtTracking> {
|
|||
* @param ids 删除id列表
|
||||
*/
|
||||
void deleteDebtTracking(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 用户分页查询债务追踪
|
||||
*
|
||||
* @param pageParams 分页条件
|
||||
* @param dto 查询表单
|
||||
* @return 查询接到过
|
||||
*/
|
||||
PageResult<DebtTrackingUserVo> getUserDebtTrackingList(Page<DebtTracking> pageParams, DebtTrackingDto dto);
|
||||
|
||||
/**
|
||||
* 用户添加债务追踪
|
||||
*
|
||||
* @param dto 添加表单
|
||||
*/
|
||||
void addUserDebtTracking(DebtTrackingAddUserDto dto);
|
||||
|
||||
/**
|
||||
* 用户更新债务追踪
|
||||
*
|
||||
* @param dto 更新表单
|
||||
*/
|
||||
void updateUserDebtTracking(DebtTrackingUpdateUserDto dto);
|
||||
|
||||
/**
|
||||
* 用户删除债务追踪
|
||||
*
|
||||
* @param ids 删除列表
|
||||
*/
|
||||
void deleteUserDebtTracking(List<Long> ids);
|
||||
}
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
package cn.bunny.services.service.financial;
|
||||
|
||||
import cn.bunny.dao.dto.financial.savingGoal.SavingGoalAddDto;
|
||||
import cn.bunny.dao.dto.financial.savingGoal.SavingGoalDto;
|
||||
import cn.bunny.dao.dto.financial.savingGoal.SavingGoalUpdateDto;
|
||||
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.user.SavingGoalAddUserDto;
|
||||
import cn.bunny.dao.entity.financial.SavingGoal;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.vo.financial.admin.SavingGoalVo;
|
||||
|
@ -49,4 +50,34 @@ public interface SavingGoalService extends IService<SavingGoal> {
|
|||
* @param ids 删除id列表
|
||||
*/
|
||||
void deleteSavingGoal(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 用户分页查询用户储值
|
||||
*
|
||||
* @param pageParams 分页查询条件
|
||||
* @param dto 分页查询表单
|
||||
* @return 分页返回结果
|
||||
*/
|
||||
PageResult<SavingGoalVo> getUserSavingGoalList(Page<SavingGoal> pageParams, SavingGoalDto dto);
|
||||
|
||||
/**
|
||||
* 用户添加储值
|
||||
*
|
||||
* @param dto 添加表单
|
||||
*/
|
||||
void adduserSavingGoal(@Valid SavingGoalAddUserDto dto);
|
||||
|
||||
/**
|
||||
* 用户更新储值
|
||||
*
|
||||
* @param dto 更新表单
|
||||
*/
|
||||
void updateUserSavingGoal(SavingGoalUpdateDto dto);
|
||||
|
||||
/**
|
||||
* 用户删除储值
|
||||
*
|
||||
* @param ids 删除列表
|
||||
*/
|
||||
void deleteUserSavingGoal(List<Long> ids);
|
||||
}
|
||||
|
|
|
@ -2,12 +2,11 @@ package cn.bunny.services.service.financial.impl;
|
|||
|
||||
import cn.bunny.common.service.context.BaseContext;
|
||||
import cn.bunny.common.service.exception.BunnyException;
|
||||
import cn.bunny.dao.dto.financial.bill.BillDto;
|
||||
import cn.bunny.dao.dto.financial.bill.admin.BillAddDto;
|
||||
import cn.bunny.dao.dto.financial.bill.admin.BillDto;
|
||||
import cn.bunny.dao.dto.financial.bill.admin.BillUpdateDto;
|
||||
import cn.bunny.dao.dto.financial.bill.user.BillUserAddDto;
|
||||
import cn.bunny.dao.dto.financial.bill.user.BillUserDto;
|
||||
import cn.bunny.dao.dto.financial.bill.user.BillUserUpdateDto;
|
||||
import cn.bunny.dao.dto.financial.bill.user.BillAddUserDto;
|
||||
import cn.bunny.dao.dto.financial.bill.user.BillUpdateUserDto;
|
||||
import cn.bunny.dao.entity.financial.Bill;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.pojo.result.ResultCodeEnum;
|
||||
|
@ -19,7 +18,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
@ -44,72 +42,24 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements Bi
|
|||
* @return 查询分页账单信息返回对象
|
||||
*/
|
||||
@Override
|
||||
public PageResult<BillUserVo> getUserBillList(Page<Bill> pageParams, BillUserDto dto) {
|
||||
// 需要根据当前用户去查询
|
||||
Long userId = BaseContext.getUserId();
|
||||
public PageResult<BillUserVo> getUserBillList(Page<Bill> pageParams, BillDto dto) {
|
||||
dto.setUserId(BaseContext.getUserId());
|
||||
|
||||
// 判断创建用户的Id是否和当前请求的用户id是否相同
|
||||
IPage<BillUserVo> page = baseMapper.selectUserListByPage(pageParams, dto, userId);
|
||||
IPage<BillVo> page = baseMapper.selectListByPage(pageParams, dto);
|
||||
List<BillUserVo> userVoList = page.getRecords().stream().map(billVo -> {
|
||||
BillUserVo billUserVo = new BillUserVo();
|
||||
BeanUtils.copyProperties(billVo, billUserVo);
|
||||
return billUserVo;
|
||||
}).toList();
|
||||
|
||||
return PageResult.<BillUserVo>builder()
|
||||
.list(page.getRecords())
|
||||
.list(userVoList)
|
||||
.pageNo(page.getCurrent())
|
||||
.pageSize(page.getSize())
|
||||
.total(page.getTotal())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加账单信息
|
||||
*
|
||||
* @param dto 账单信息添加
|
||||
*/
|
||||
@Override
|
||||
public void addUserBill(@Valid BillUserAddDto dto) {
|
||||
// 保存数据
|
||||
Bill bill = new Bill();
|
||||
BeanUtils.copyProperties(dto, bill);
|
||||
|
||||
// 设置当前的用户Id
|
||||
bill.setUserId(BaseContext.getUserId());
|
||||
save(bill);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新账单信息
|
||||
*
|
||||
* @param dto 账单信息更新
|
||||
*/
|
||||
@Override
|
||||
public void updateUserBill(@Valid BillUserUpdateDto dto) {
|
||||
// 判断当前用户修改的内容是否是自己的内容
|
||||
Bill bill = getOne(Wrappers.<Bill>lambdaQuery().eq(Bill::getId, dto.getId()));
|
||||
if (!bill.getUserId().equals(BaseContext.getUserId())) {
|
||||
throw new BunnyException(ResultCodeEnum.ILLEGAL_DATA_REQUEST);
|
||||
}
|
||||
|
||||
// 更新内容
|
||||
bill = new Bill();
|
||||
BeanUtils.copyProperties(dto, bill);
|
||||
updateById(bill);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除|批量删除账单信息
|
||||
*
|
||||
* @param ids 删除id列表
|
||||
*/
|
||||
@Override
|
||||
public void deleteUserBill(List<Long> ids) {
|
||||
// 判断删除的是否是自己的账单
|
||||
List<Bill> billList = list(Wrappers.<Bill>lambdaQuery().in(Bill::getId, ids))
|
||||
.stream().filter(bill -> !bill.getUserId().equals(BaseContext.getUserId())).toList();
|
||||
if (!billList.isEmpty()) {
|
||||
throw new BunnyException(ResultCodeEnum.ILLEGAL_DATA_REQUEST);
|
||||
}
|
||||
baseMapper.deleteBatchIdsWithPhysics(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询账单信息
|
||||
*
|
||||
|
@ -163,4 +113,50 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements Bi
|
|||
public void deleteBill(List<Long> ids) {
|
||||
baseMapper.deleteBatchIdsWithPhysics(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户添加账单信息
|
||||
*
|
||||
* @param dto 添加表单
|
||||
*/
|
||||
@Override
|
||||
public void addUserBill(BillAddUserDto dto) {
|
||||
// 保存数据
|
||||
Bill bill = new Bill();
|
||||
BeanUtils.copyProperties(dto, bill);
|
||||
|
||||
bill.setUserId(BaseContext.getUserId());
|
||||
save(bill);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户更新账单信息
|
||||
*
|
||||
* @param dto 更新表单
|
||||
*/
|
||||
@Override
|
||||
public void updateUserBill(BillUpdateUserDto dto) {
|
||||
// 更新内容
|
||||
Bill bill = new Bill();
|
||||
BeanUtils.copyProperties(dto, bill);
|
||||
|
||||
bill.setUserId(BaseContext.getUserId());
|
||||
updateById(bill);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除|批量删除账单信息
|
||||
*
|
||||
* @param ids 删除id列表
|
||||
*/
|
||||
@Override
|
||||
public void deleteUserBill(List<Long> ids) {
|
||||
// 判断删除的是否是自己的账单
|
||||
List<Bill> billList = list(Wrappers.<Bill>lambdaQuery().in(Bill::getId, ids))
|
||||
.stream().filter(bill -> !bill.getUserId().equals(BaseContext.getUserId())).toList();
|
||||
if (!billList.isEmpty()) {
|
||||
throw new BunnyException(ResultCodeEnum.ILLEGAL_DATA_REQUEST);
|
||||
}
|
||||
baseMapper.deleteBatchIdsWithPhysics(ids);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,15 +1,22 @@
|
|||
package cn.bunny.services.service.financial.impl;
|
||||
|
||||
import cn.bunny.dao.dto.financial.budgetCategory.BudgetCategoryAddDto;
|
||||
import cn.bunny.common.service.context.BaseContext;
|
||||
import cn.bunny.common.service.exception.BunnyException;
|
||||
import cn.bunny.dao.dto.financial.budgetCategory.BudgetCategoryDto;
|
||||
import cn.bunny.dao.dto.financial.budgetCategory.BudgetCategoryUpdateDto;
|
||||
import cn.bunny.dao.dto.financial.budgetCategory.admin.BudgetCategoryAddDto;
|
||||
import cn.bunny.dao.dto.financial.budgetCategory.admin.BudgetCategoryUpdateDto;
|
||||
import cn.bunny.dao.dto.financial.budgetCategory.user.BudgetCategoryAddUserDto;
|
||||
import cn.bunny.dao.dto.financial.budgetCategory.user.BudgetCategoryUpdateUserDto;
|
||||
import cn.bunny.dao.entity.financial.BudgetCategory;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.vo.financial.admin.BudgetCategoryParentVo;
|
||||
import cn.bunny.dao.pojo.result.ResultCodeEnum;
|
||||
import cn.bunny.dao.vo.financial.BudgetCategoryParentVo;
|
||||
import cn.bunny.dao.vo.financial.admin.BudgetCategoryVo;
|
||||
import cn.bunny.dao.vo.financial.user.BudgetCategoryUserVo;
|
||||
import cn.bunny.services.mapper.financial.BudgetCategoryMapper;
|
||||
import cn.bunny.services.service.financial.BudgetCategoryService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jakarta.validation.Valid;
|
||||
|
@ -90,11 +97,94 @@ public class BudgetCategoryServiceImpl extends ServiceImpl<BudgetCategoryMapper,
|
|||
* @return 父级列表
|
||||
*/
|
||||
@Override
|
||||
public List<BudgetCategoryParentVo> getAllParentList() {
|
||||
public List<BudgetCategoryParentVo> getAllParentList(Long userId) {
|
||||
return list().stream().map(budgetCategory -> {
|
||||
BudgetCategoryParentVo budgetCategoryParentVo = new BudgetCategoryParentVo();
|
||||
BeanUtils.copyProperties(budgetCategory, budgetCategoryParentVo);
|
||||
return budgetCategoryParentVo;
|
||||
}).toList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户分页查询预算分类表
|
||||
*
|
||||
* @param pageParams 分页参数
|
||||
* @param dto 查询表单
|
||||
* @return 分页返回结果
|
||||
*/
|
||||
@Override
|
||||
public PageResult<BudgetCategoryUserVo> getUserBudgetCategoryList(Page<BudgetCategory> pageParams, BudgetCategoryDto dto) {
|
||||
dto.setUserId(BaseContext.getUserId());
|
||||
|
||||
IPage<BudgetCategoryVo> page = baseMapper.selectListByPage(pageParams, dto);
|
||||
List<BudgetCategoryUserVo> categoryUserVoList = page.getRecords().stream().map(budgetCategoryVo -> {
|
||||
BudgetCategoryUserVo budgetCategoryUserVo = new BudgetCategoryUserVo();
|
||||
BeanUtils.copyProperties(budgetCategoryVo, budgetCategoryUserVo);
|
||||
return budgetCategoryUserVo;
|
||||
}).toList();
|
||||
|
||||
return PageResult.<BudgetCategoryUserVo>builder()
|
||||
.list(categoryUserVoList)
|
||||
.pageNo(page.getCurrent())
|
||||
.pageSize(page.getSize())
|
||||
.total(page.getTotal())
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteUserBudgetCategory(List<Long> ids) {
|
||||
// 判断删除的是否是自己的账单
|
||||
List<BudgetCategory> billList = list(Wrappers.<BudgetCategory>lambdaQuery().in(BudgetCategory::getId, ids))
|
||||
.stream().filter(bill -> !bill.getUserId().equals(BaseContext.getUserId())).toList();
|
||||
if (!billList.isEmpty()) {
|
||||
throw new BunnyException(ResultCodeEnum.ILLEGAL_DATA_REQUEST);
|
||||
}
|
||||
|
||||
baseMapper.deleteBatchIdsWithPhysics(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回当前用户所有父级对象
|
||||
*
|
||||
* @return 父级列表
|
||||
*/
|
||||
@Override
|
||||
public List<BudgetCategoryParentVo> getAllUserParentList() {
|
||||
return list(Wrappers.<BudgetCategory>lambdaQuery().eq(BudgetCategory::getUserId, BaseContext.getUserId()))
|
||||
.stream().map(budgetCategory -> {
|
||||
BudgetCategoryParentVo budgetCategoryParentVo = new BudgetCategoryParentVo();
|
||||
BeanUtils.copyProperties(budgetCategory, budgetCategoryParentVo);
|
||||
return budgetCategoryParentVo;
|
||||
}).toList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户添加预算分类表
|
||||
*
|
||||
* @param dto 添加表单
|
||||
*/
|
||||
@Override
|
||||
public void addUserBudgetCategory(BudgetCategoryAddUserDto dto) {
|
||||
// 保存数据
|
||||
BudgetCategory budgetCategory = new BudgetCategory();
|
||||
BeanUtils.copyProperties(dto, budgetCategory);
|
||||
|
||||
budgetCategory.setUserId(BaseContext.getUserId());
|
||||
save(budgetCategory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户更新预算分类表
|
||||
*
|
||||
* @param dto 更新表单
|
||||
*/
|
||||
@Override
|
||||
public void updateUserBudgetCategory(BudgetCategoryUpdateUserDto dto) {
|
||||
// 更新内容
|
||||
BudgetCategory budgetCategory = new BudgetCategory();
|
||||
BeanUtils.copyProperties(dto, budgetCategory);
|
||||
|
||||
budgetCategory.setUserId(BaseContext.getUserId());
|
||||
updateById(budgetCategory);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,11 +2,10 @@ package cn.bunny.services.service.financial.impl;
|
|||
|
||||
import cn.bunny.common.service.context.BaseContext;
|
||||
import cn.bunny.common.service.exception.BunnyException;
|
||||
import cn.bunny.dao.dto.financial.budgetCategory.user.BudgetCategoryAddUserDto;
|
||||
import cn.bunny.dao.dto.financial.category.CategoryDto;
|
||||
import cn.bunny.dao.dto.financial.category.admin.CategoryAddDto;
|
||||
import cn.bunny.dao.dto.financial.category.admin.CategoryDto;
|
||||
import cn.bunny.dao.dto.financial.category.admin.CategoryUpdateDto;
|
||||
import cn.bunny.dao.dto.financial.category.user.CategoryUserAddDto;
|
||||
import cn.bunny.dao.dto.financial.category.user.CategoryUserDto;
|
||||
import cn.bunny.dao.dto.financial.category.user.CategoryUserUpdateDto;
|
||||
import cn.bunny.dao.entity.financial.Category;
|
||||
import cn.bunny.dao.pojo.constant.UserConstant;
|
||||
|
@ -16,6 +15,7 @@ import cn.bunny.dao.vo.financial.admin.CategoryVo;
|
|||
import cn.bunny.dao.vo.financial.user.CategoryUserVo;
|
||||
import cn.bunny.services.mapper.financial.CategoryMapper;
|
||||
import cn.bunny.services.service.financial.CategoryService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
@ -38,17 +38,17 @@ import java.util.List;
|
|||
public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> implements CategoryService {
|
||||
|
||||
/**
|
||||
* * 用户分类分页查询分类信息 服务实现类
|
||||
* 分类信息 服务实现类
|
||||
*
|
||||
* @param pageParams 分类信息分页查询page对象
|
||||
* @param dto 分类信息分页查询对象
|
||||
* @return 查询分页分类信息返回对象
|
||||
*/
|
||||
@Override
|
||||
public PageResult<CategoryUserVo> getCategoryUserList(Page<Category> pageParams, CategoryUserDto dto) {
|
||||
IPage<CategoryUserVo> page = baseMapper.selectUserListByPage(pageParams, dto, BaseContext.getUserId());
|
||||
public PageResult<CategoryVo> getCategoryList(Page<Category> pageParams, CategoryDto dto) {
|
||||
IPage<CategoryVo> page = baseMapper.selectListByPage(pageParams, dto);
|
||||
|
||||
return PageResult.<CategoryUserVo>builder()
|
||||
return PageResult.<CategoryVo>builder()
|
||||
.list(page.getRecords())
|
||||
.pageNo(page.getCurrent())
|
||||
.pageSize(page.getSize())
|
||||
|
@ -56,13 +56,82 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> i
|
|||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户分类分页查询分类信息
|
||||
*
|
||||
* @param pageParams 分类信息分页查询page对象
|
||||
* @param dto 分类信息分页查询对象
|
||||
* @return 查询分页分类信息返回对象
|
||||
*/
|
||||
@Override
|
||||
public PageResult<CategoryUserVo> getCategoryUserList(Page<Category> pageParams, CategoryDto dto) {
|
||||
// 为当前用户查询信息
|
||||
dto.setUserId(BaseContext.getUserId());
|
||||
|
||||
IPage<CategoryVo> page = baseMapper.selectListByPage(pageParams, dto);
|
||||
|
||||
List<CategoryUserVo> categoryUserVoList = page.getRecords().stream().map(categoryVo -> {
|
||||
CategoryUserVo categoryUserVo = new CategoryUserVo();
|
||||
BeanUtils.copyProperties(categoryVo, categoryUserVo);
|
||||
return categoryUserVo;
|
||||
}).toList();
|
||||
|
||||
return PageResult.<CategoryUserVo>builder()
|
||||
.list(categoryUserVoList)
|
||||
.pageNo(page.getCurrent())
|
||||
.pageSize(page.getSize())
|
||||
.total(page.getTotal())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当前用户下所有的分类
|
||||
*
|
||||
* @return 当前用户分类返回列表
|
||||
*/
|
||||
@Override
|
||||
public List<CategoryUserVo> getCategoryUserAllList(Long userId) {
|
||||
// 判断用户ID是否为空,如果为空设置为当前的用户的ID
|
||||
if (userId == null) {
|
||||
userId = BaseContext.getUserId();
|
||||
}
|
||||
|
||||
// 根据用户id返回父级列表
|
||||
LambdaQueryWrapper<Category> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(Category::getUserId, userId)
|
||||
.or()
|
||||
.eq(Category::getIsBuiltin, true);
|
||||
return list(wrapper)
|
||||
.stream().map(category -> {
|
||||
CategoryUserVo categoryUserVo = new CategoryUserVo();
|
||||
BeanUtils.copyProperties(category, categoryUserVo);
|
||||
return categoryUserVo;
|
||||
}).toList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加分类信息
|
||||
*
|
||||
* @param dto 分类信息添加
|
||||
*/
|
||||
@Override
|
||||
public void addCategory(@Valid CategoryAddDto dto) {
|
||||
// 保存数据
|
||||
Category category = new Category();
|
||||
BeanUtils.copyProperties(dto, category);
|
||||
|
||||
// 如果内置的id为空设置为当前用户的id
|
||||
category.setUserId(category.getUserId() == null ? BaseContext.getUserId() : dto.getUserId());
|
||||
save(category);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用戶分类添加分类信息
|
||||
*
|
||||
* @param dto 分类信息添加
|
||||
*/
|
||||
@Override
|
||||
public void addCategoryUser(@Valid CategoryUserAddDto dto) {
|
||||
public void addCategoryUser(@Valid BudgetCategoryAddUserDto dto) {
|
||||
// 查询当前用户添加了多少条
|
||||
if (count(Wrappers.<Category>lambdaQuery().eq(Category::getIsBuiltin, false)) >= UserConstant.CATEGORY_COUNT) {
|
||||
throw new BunnyException(ResultCodeEnum.THE_MAXIMUM_BAR_CODE);
|
||||
|
@ -77,6 +146,19 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> i
|
|||
save(categoryUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新分类信息
|
||||
*
|
||||
* @param dto 分类信息更新
|
||||
*/
|
||||
@Override
|
||||
public void updateCategory(@Valid CategoryUpdateDto dto) {
|
||||
// 更新内容
|
||||
Category category = new Category();
|
||||
BeanUtils.copyProperties(dto, category);
|
||||
updateById(category);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户分类更新分类信息
|
||||
*
|
||||
|
@ -85,14 +167,12 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> i
|
|||
@Override
|
||||
public void updateCategoryUser(@Valid CategoryUserUpdateDto dto) {
|
||||
Long userId = BaseContext.getUserId();
|
||||
String categoryName = dto.getCategoryName();
|
||||
|
||||
// 判断用户修改的当前内容是否和系统内置的信息一致
|
||||
Category category = getOne(Wrappers.<Category>lambdaQuery().eq(Category::getId, dto.getId()));
|
||||
Long categoryUserId = category.getUserId();
|
||||
String categoryCategoryName = category.getCategoryName();
|
||||
|
||||
if (!categoryUserId.equals(userId) || !categoryCategoryName.equals(categoryName)) {
|
||||
if (!categoryUserId.equals(userId)) {
|
||||
throw new BunnyException(ResultCodeEnum.ILLEGAL_DATA_REQUEST);
|
||||
}
|
||||
|
||||
|
@ -112,69 +192,6 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> i
|
|||
baseMapper.deleteBatchIdsWithPhysics(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当前用户下所有的分类
|
||||
*
|
||||
* @return 当前用户分类返回列表
|
||||
*/
|
||||
@Override
|
||||
public List<CategoryUserVo> getCategoryUserAllList() {
|
||||
return list(Wrappers.<Category>lambdaQuery().eq(Category::getUserId, BaseContext.getUserId()))
|
||||
.stream().map(category -> {
|
||||
CategoryUserVo categoryUserVo = new CategoryUserVo();
|
||||
BeanUtils.copyProperties(category, categoryUserVo);
|
||||
return categoryUserVo;
|
||||
}).toList();
|
||||
}
|
||||
|
||||
/**
|
||||
* * 分类信息 服务实现类
|
||||
*
|
||||
* @param pageParams 分类信息分页查询page对象
|
||||
* @param dto 分类信息分页查询对象
|
||||
* @return 查询分页分类信息返回对象
|
||||
*/
|
||||
@Override
|
||||
public PageResult<CategoryVo> getCategoryList(Page<Category> pageParams, CategoryDto dto) {
|
||||
IPage<CategoryVo> page = baseMapper.selectListByPage(pageParams, dto);
|
||||
|
||||
return PageResult.<CategoryVo>builder()
|
||||
.list(page.getRecords())
|
||||
.pageNo(page.getCurrent())
|
||||
.pageSize(page.getSize())
|
||||
.total(page.getTotal())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加分类信息
|
||||
*
|
||||
* @param dto 分类信息添加
|
||||
*/
|
||||
@Override
|
||||
public void addCategory(@Valid CategoryAddDto dto) {
|
||||
// 保存数据
|
||||
Category category = new Category();
|
||||
BeanUtils.copyProperties(dto, category);
|
||||
|
||||
// 如果内置的id为空设置为当前用户的id
|
||||
category.setUserId(category.getUserId() == null ? BaseContext.getUserId() : dto.getUserId());
|
||||
save(category);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新分类信息
|
||||
*
|
||||
* @param dto 分类信息更新
|
||||
*/
|
||||
@Override
|
||||
public void updateCategory(@Valid CategoryUpdateDto dto) {
|
||||
// 更新内容
|
||||
Category category = new Category();
|
||||
BeanUtils.copyProperties(dto, category);
|
||||
updateById(category);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除|批量删除分类信息
|
||||
*
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package cn.bunny.services.service.financial.impl;
|
||||
|
||||
import cn.bunny.dao.dto.financial.debtRepaymentPlan.DebtRepaymentPlanAddDto;
|
||||
import cn.bunny.dao.dto.financial.debtRepaymentPlan.DebtRepaymentPlanDto;
|
||||
import cn.bunny.dao.dto.financial.debtRepaymentPlan.DebtRepaymentPlanUpdateDto;
|
||||
import cn.bunny.dao.dto.financial.debtRepaymentPlan.admin.DebtRepaymentPlanAddDto;
|
||||
import cn.bunny.dao.dto.financial.debtRepaymentPlan.admin.DebtRepaymentPlanUpdateDto;
|
||||
import cn.bunny.dao.entity.financial.DebtRepaymentPlan;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.vo.financial.admin.DebtRepaymentPlanVo;
|
||||
|
|
|
@ -1,14 +1,21 @@
|
|||
package cn.bunny.services.service.financial.impl;
|
||||
|
||||
import cn.bunny.dao.dto.financial.debtTracking.DebtTrackingAddDto;
|
||||
import cn.bunny.common.service.context.BaseContext;
|
||||
import cn.bunny.common.service.exception.BunnyException;
|
||||
import cn.bunny.dao.dto.financial.debtTracking.DebtTrackingDto;
|
||||
import cn.bunny.dao.dto.financial.debtTracking.DebtTrackingUpdateDto;
|
||||
import cn.bunny.dao.dto.financial.debtTracking.admin.DebtTrackingAddDto;
|
||||
import cn.bunny.dao.dto.financial.debtTracking.admin.DebtTrackingUpdateDto;
|
||||
import cn.bunny.dao.dto.financial.debtTracking.user.DebtTrackingAddUserDto;
|
||||
import cn.bunny.dao.dto.financial.debtTracking.user.DebtTrackingUpdateUserDto;
|
||||
import cn.bunny.dao.entity.financial.DebtTracking;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.pojo.result.ResultCodeEnum;
|
||||
import cn.bunny.dao.vo.financial.admin.DebtTrackingVo;
|
||||
import cn.bunny.dao.vo.financial.user.DebtTrackingUserVo;
|
||||
import cn.bunny.services.mapper.financial.DebtTrackingMapper;
|
||||
import cn.bunny.services.service.financial.DebtTrackingService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jakarta.validation.Valid;
|
||||
|
@ -26,6 +33,7 @@ import java.util.List;
|
|||
* @since 2024-11-11 16:36:31
|
||||
*/
|
||||
@Service
|
||||
|
||||
public class DebtTrackingServiceImpl extends ServiceImpl<DebtTrackingMapper, DebtTracking> implements DebtTrackingService {
|
||||
|
||||
/**
|
||||
|
@ -82,4 +90,77 @@ public class DebtTrackingServiceImpl extends ServiceImpl<DebtTrackingMapper, Deb
|
|||
public void deleteDebtTracking(List<Long> ids) {
|
||||
baseMapper.deleteBatchIdsWithPhysics(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户分页查询债务追踪
|
||||
*
|
||||
* @param pageParams 分页条件
|
||||
* @param dto 查询表单
|
||||
* @return 查询接到过
|
||||
*/
|
||||
@Override
|
||||
public PageResult<DebtTrackingUserVo> getUserDebtTrackingList(Page<DebtTracking> pageParams, DebtTrackingDto dto) {
|
||||
dto.setUserId(BaseContext.getUserId());
|
||||
|
||||
IPage<DebtTrackingVo> page = baseMapper.selectListByPage(pageParams, dto);
|
||||
List<DebtTrackingUserVo> debtTrackingList = page.getRecords().stream().map(debtTrackingVo -> {
|
||||
DebtTrackingUserVo debtTracking = new DebtTrackingUserVo();
|
||||
BeanUtils.copyProperties(debtTrackingVo, debtTracking);
|
||||
return debtTracking;
|
||||
}).toList();
|
||||
|
||||
return PageResult.<DebtTrackingUserVo>builder()
|
||||
.list(debtTrackingList)
|
||||
.pageNo(page.getCurrent())
|
||||
.pageSize(page.getSize())
|
||||
.total(page.getTotal())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户添加债务追踪
|
||||
*
|
||||
* @param dto 添加表单
|
||||
*/
|
||||
@Override
|
||||
public void addUserDebtTracking(DebtTrackingAddUserDto dto) {
|
||||
// 保存数据
|
||||
DebtTracking debtTracking = new DebtTracking();
|
||||
BeanUtils.copyProperties(dto, debtTracking);
|
||||
|
||||
debtTracking.setUserId(BaseContext.getUserId());
|
||||
save(debtTracking);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户更新债务追踪
|
||||
*
|
||||
* @param dto 更新表单
|
||||
*/
|
||||
@Override
|
||||
public void updateUserDebtTracking(DebtTrackingUpdateUserDto dto) {
|
||||
// 更新内容
|
||||
DebtTracking debtTracking = new DebtTracking();
|
||||
BeanUtils.copyProperties(dto, debtTracking);
|
||||
|
||||
debtTracking.setUserId(BaseContext.getUserId());
|
||||
updateById(debtTracking);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户删除债务追踪
|
||||
*
|
||||
* @param ids 删除列表
|
||||
*/
|
||||
@Override
|
||||
public void deleteUserDebtTracking(List<Long> ids) {
|
||||
// 判断删除的是否是自己的账单
|
||||
List<DebtTracking> billList = list(Wrappers.<DebtTracking>lambdaQuery().in(DebtTracking::getId, ids))
|
||||
.stream().filter(bill -> !bill.getUserId().equals(BaseContext.getUserId())).toList();
|
||||
if (!billList.isEmpty()) {
|
||||
throw new BunnyException(ResultCodeEnum.ILLEGAL_DATA_REQUEST);
|
||||
}
|
||||
|
||||
baseMapper.deleteBatchIdsWithPhysics(ids);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,19 @@
|
|||
package cn.bunny.services.service.financial.impl;
|
||||
|
||||
import cn.bunny.dao.dto.financial.savingGoal.SavingGoalAddDto;
|
||||
import cn.bunny.common.service.context.BaseContext;
|
||||
import cn.bunny.common.service.exception.BunnyException;
|
||||
import cn.bunny.dao.dto.financial.savingGoal.SavingGoalDto;
|
||||
import cn.bunny.dao.dto.financial.savingGoal.SavingGoalUpdateDto;
|
||||
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.user.SavingGoalAddUserDto;
|
||||
import cn.bunny.dao.entity.financial.SavingGoal;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.pojo.result.ResultCodeEnum;
|
||||
import cn.bunny.dao.vo.financial.admin.SavingGoalVo;
|
||||
import cn.bunny.services.mapper.financial.SavingGoalMapper;
|
||||
import cn.bunny.services.service.financial.SavingGoalService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jakarta.validation.Valid;
|
||||
|
@ -82,4 +87,71 @@ public class SavingGoalServiceImpl extends ServiceImpl<SavingGoalMapper, SavingG
|
|||
public void deleteSavingGoal(List<Long> ids) {
|
||||
baseMapper.deleteBatchIdsWithPhysics(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户分页查询用户储值
|
||||
*
|
||||
* @param pageParams 分页查询条件
|
||||
* @param dto 分页查询表单
|
||||
* @return 分页返回结果
|
||||
*/
|
||||
@Override
|
||||
public PageResult<SavingGoalVo> getUserSavingGoalList(Page<SavingGoal> pageParams, SavingGoalDto dto) {
|
||||
dto.setUserId(BaseContext.getUserId());
|
||||
IPage<SavingGoalVo> page = baseMapper.selectListByPage(pageParams, dto);
|
||||
|
||||
return PageResult.<SavingGoalVo>builder()
|
||||
.list(page.getRecords())
|
||||
.pageNo(page.getCurrent())
|
||||
.pageSize(page.getSize())
|
||||
.total(page.getTotal())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户添加储值
|
||||
*
|
||||
* @param dto 添加表单
|
||||
*/
|
||||
@Override
|
||||
public void adduserSavingGoal(@Valid SavingGoalAddUserDto dto) {
|
||||
// 保存数据
|
||||
SavingGoal savingGoal = new SavingGoal();
|
||||
BeanUtils.copyProperties(dto, savingGoal);
|
||||
|
||||
savingGoal.setUserId(BaseContext.getUserId());
|
||||
save(savingGoal);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户更新储值
|
||||
*
|
||||
* @param dto 更新表单
|
||||
*/
|
||||
@Override
|
||||
public void updateUserSavingGoal(SavingGoalUpdateDto dto) {
|
||||
// 更新内容
|
||||
SavingGoal savingGoal = new SavingGoal();
|
||||
BeanUtils.copyProperties(dto, savingGoal);
|
||||
|
||||
savingGoal.setUserId(BaseContext.getUserId());
|
||||
updateById(savingGoal);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户删除储值
|
||||
*
|
||||
* @param ids 删除列表
|
||||
*/
|
||||
@Override
|
||||
public void deleteUserSavingGoal(List<Long> ids) {
|
||||
// 判断删除的是否是自己的账单
|
||||
List<SavingGoal> billList = list(Wrappers.<SavingGoal>lambdaQuery().in(SavingGoal::getId, ids))
|
||||
.stream().filter(bill -> !bill.getUserId().equals(BaseContext.getUserId())).toList();
|
||||
if (!billList.isEmpty()) {
|
||||
throw new BunnyException(ResultCodeEnum.ILLEGAL_DATA_REQUEST);
|
||||
}
|
||||
|
||||
baseMapper.deleteBatchIdsWithPhysics(ids);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -217,6 +217,14 @@ public class RouterServiceImpl extends ServiceImpl<RouterMapper, Router> impleme
|
|||
*/
|
||||
@Override
|
||||
public void updateMenu(RouterUpdateDto dto) {
|
||||
// 查询当前路由和父级路由
|
||||
Router routerParent = getOne(Wrappers.<Router>lambdaQuery().eq(Router::getId, dto.getParentId()));
|
||||
|
||||
// 设置路由等级需要大于或等于父级的路由等级
|
||||
if (routerParent != null && (dto.getRouterRank() < routerParent.getRouterRank())) {
|
||||
throw new BunnyException(ResultCodeEnum.ROUTER_RANK_NEED_LARGER_THAN_THE_PARENT);
|
||||
}
|
||||
|
||||
// 如果设置的不是外部页面
|
||||
if (!dto.getMenuType().equals(2)) dto.setFrameSrc("");
|
||||
|
||||
|
@ -258,6 +266,14 @@ public class RouterServiceImpl extends ServiceImpl<RouterMapper, Router> impleme
|
|||
// 判断更新数据是否存在
|
||||
if (router == null) throw new BunnyException(ResultCodeEnum.DATA_NOT_EXIST);
|
||||
|
||||
// 查询当前路由和父级路由
|
||||
Router routerParent = getOne(Wrappers.<Router>lambdaQuery().eq(Router::getId, router.getParentId()));
|
||||
|
||||
// 设置路由等级需要大于或等于父级的路由等级
|
||||
if (routerParent != null && (dto.getRouterRank() < routerParent.getRouterRank())) {
|
||||
throw new BunnyException(ResultCodeEnum.ROUTER_RANK_NEED_LARGER_THAN_THE_PARENT);
|
||||
}
|
||||
|
||||
// 更新排序
|
||||
router = new Router();
|
||||
router.setId(dto.getId());
|
||||
|
|
|
@ -22,32 +22,6 @@
|
|||
id, create_time, update_time, create_user, update_user, is_deleted, type, amount, description, transaction_date, category_id
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询用户账单信息内容 -->
|
||||
<select id="selectUserListByPage" resultType="cn.bunny.dao.vo.financial.user.BillUserVo">
|
||||
select
|
||||
base.*,
|
||||
category.category_name,
|
||||
category.id as category_id,
|
||||
create_user.username as create_username,
|
||||
update_user.username as update_username
|
||||
from t_bill base
|
||||
left join t_category category on category.id = base.category_id
|
||||
left join sys_user create_user on create_user.id = base.create_user
|
||||
left join sys_user update_user on update_user.id = base.update_user
|
||||
<where>
|
||||
base.is_deleted = 0 and base.user_id = #{userId}
|
||||
<if test="dto.type != null and dto.type != ''">
|
||||
and base.type = #{dto.type}
|
||||
</if>
|
||||
<if test="dto.description != null and dto.description != ''">
|
||||
and base.description like CONCAT('%',#{dto.description},'%')
|
||||
</if>
|
||||
<if test="dto.startDate != null and dto.endDate != null">
|
||||
and base.transaction_date between #{dto.startDate} and #{dto.endDate}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- 分页查询账单信息内容 -->
|
||||
<select id="selectListByPage" resultType="cn.bunny.dao.vo.financial.admin.BillVo">
|
||||
select
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
left join sys_user update_user on update_user.id = base.update_user
|
||||
<where>
|
||||
base.is_deleted = 0
|
||||
<if test="dto.userId != null and dto.userId != ''">
|
||||
<if test="dto.userId != null">
|
||||
and base.user_id = #{dto.userId}
|
||||
</if>
|
||||
<if test="dto.categoryName != null and dto.categoryName != ''">
|
||||
|
@ -54,8 +54,10 @@
|
|||
and base.amount like CONCAT('%',#{dto.amount},'%')
|
||||
</if>
|
||||
<if test="dto.startPeriod != null and dto.endPeriod != null">
|
||||
and (base.start_period between #{dto.startPeriod} and #{dto.endPeriod})
|
||||
and (
|
||||
(base.start_period between #{dto.startPeriod} and #{dto.endPeriod})
|
||||
or (base.end_period between #{dto.startPeriod} and #{dto.endPeriod})
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
|
|
@ -20,37 +20,6 @@
|
|||
id, create_time, update_time, create_user, update_user, is_deleted, user_id, category_name, is_builtin
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询分类信息内容 -->
|
||||
<select id="selectUserListByPage" resultType="cn.bunny.dao.vo.financial.user.CategoryUserVo">
|
||||
select
|
||||
base.*,
|
||||
create_user.username as create_username,
|
||||
update_user.username as update_username
|
||||
from t_category base
|
||||
left join sys_user create_user on create_user.id = base.create_user
|
||||
left join sys_user update_user on update_user.id = base.update_user
|
||||
<where>
|
||||
base.is_deleted = 0 and (base.user_id = #{userId} or base.is_builtin = 1)
|
||||
<if test="dto.categoryName != null and dto.categoryName != ''">
|
||||
and base.category_name like CONCAT('%',#{dto.categoryName},'%')
|
||||
</if>
|
||||
<if test="dto.isBuiltin != null and dto.isBuiltin != ''">
|
||||
and base.is_builtin = #{dto.isBuiltin}
|
||||
</if>
|
||||
</where>
|
||||
order by base.is_builtin desc
|
||||
</select>
|
||||
|
||||
<!-- 物理删除分类信息 -->
|
||||
<delete id="deleteBatchIdsWithUserPhysics">
|
||||
delete
|
||||
from t_category
|
||||
where id in
|
||||
<foreach collection="ids" item="id" open="(" close=")" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!-- 分页查询分类信息内容 -->
|
||||
<select id="selectListByPage" resultType="cn.bunny.dao.vo.financial.admin.CategoryVo">
|
||||
select
|
||||
|
@ -65,7 +34,7 @@
|
|||
<where>
|
||||
base.is_deleted = 0
|
||||
<if test="dto.userId != null and dto.userId != ''">
|
||||
and base.user_id = #{dto.userId}
|
||||
and (base.user_id = #{dto.userId} or base.is_builtin = 1)
|
||||
</if>
|
||||
<if test="dto.categoryName != null and dto.categoryName != ''">
|
||||
and base.category_name like CONCAT('%',#{dto.categoryName},'%')
|
||||
|
|
|
@ -42,14 +42,14 @@
|
|||
<if test="dto.installmentAmount != null and dto.installmentAmount != ''">
|
||||
and base.installment_amount like CONCAT('%',#{dto.installmentAmount},'%')
|
||||
</if>
|
||||
<if test="dto.dueDate != null and dto.dueDate != ''">
|
||||
<if test="dto.dueDate != null">
|
||||
and base.due_date like CONCAT('%',#{dto.dueDate},'%')
|
||||
</if>
|
||||
<if test="dto.paidAmount != null and dto.paidAmount != ''">
|
||||
and base.paid_amount like CONCAT('%',#{dto.paidAmount},'%')
|
||||
</if>
|
||||
<if test="dto.paymentStatus != null and dto.paymentStatus != ''">
|
||||
and base.payment_status like CONCAT('%',#{dto.paymentStatus},'%')
|
||||
and base.payment_status = #{dto.paymentStatus}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
<where>
|
||||
base.is_deleted = 0
|
||||
<if test="dto.userId != null and dto.userId != ''">
|
||||
and base.user_id like CONCAT('%',#{dto.userId},'%')
|
||||
and base.user_id = #{dto.userId}
|
||||
</if>
|
||||
<if test="dto.debtorName != null and dto.debtorName != ''">
|
||||
and base.debtor_name like CONCAT('%',#{dto.debtorName},'%')
|
||||
|
@ -46,12 +46,12 @@
|
|||
and base.debt_amount like CONCAT('%',#{dto.debtAmount},'%')
|
||||
</if>
|
||||
<if test="dto.debtType != null and dto.debtType != ''">
|
||||
and base.debt_type like CONCAT('%',#{dto.debtType},'%')
|
||||
and base.debt_type = #{dto.debtType}
|
||||
</if>
|
||||
<if test="dto.debtStatus != null and dto.debtStatus != ''">
|
||||
and base.debt_status like CONCAT('%',#{dto.debtStatus},'%')
|
||||
and base.debt_status = #{dto.debtStatus}
|
||||
</if>
|
||||
<if test="dto.dueDate != null and dto.dueDate != ''">
|
||||
<if test="dto.dueDate != null">
|
||||
and base.due_date like CONCAT('%',#{dto.dueDate},'%')
|
||||
</if>
|
||||
</where>
|
||||
|
|
|
@ -49,8 +49,10 @@
|
|||
and base.amount like CONCAT('%',#{dto.amount},'%')
|
||||
</if>
|
||||
<if test="dto.startDuration != null and dto.endDuration != null">
|
||||
and (base.start_duration between #{dto.startDuration} and #{dto.endDuration})
|
||||
and (
|
||||
(base.start_duration between #{dto.startDuration} and #{dto.endDuration})
|
||||
or (base.end_duration between #{dto.startDuration} and #{dto.endDuration})
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
|
Loading…
Reference in New Issue