feat: 重构代码
This commit is contained in:
parent
43c300b1e6
commit
6d5abf54db
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.financial.bill;
|
||||
package cn.bunny.dao.dto.financial.bill.user;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
@ -18,7 +18,7 @@ import java.time.LocalDateTime;
|
|||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "BillAddDto对象", title = "账单信息添加内容", description = "账单信息添加内容")
|
||||
public class BillAddDto {
|
||||
public class BillUserAddDto {
|
||||
|
||||
@Schema(name = "username", title = "类型:1 - 收入,-1 - 支出")
|
||||
@NotNull(message = "类型不能为空")
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.financial.bill;
|
||||
package cn.bunny.dao.dto.financial.bill.user;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
@ -14,7 +14,7 @@ import java.time.LocalDate;
|
|||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "BillDto对象", title = "账单信息查询内容", description = "账单信息查询内容")
|
||||
public class BillDto {
|
||||
public class BillUserDto {
|
||||
|
||||
@Schema(name = "username", title = "类型:1 - 收入,-1 - 支出")
|
||||
private Byte type;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.financial.bill;
|
||||
package cn.bunny.dao.dto.financial.bill.user;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
@ -16,7 +16,7 @@ import java.time.LocalDateTime;
|
|||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "BillUpdateDto对象", title = "账单信息更新内容", description = "账单信息更新内容")
|
||||
public class BillUpdateDto {
|
||||
public class BillUserUpdateDto {
|
||||
|
||||
@Schema(name = "id", title = "主键")
|
||||
@NotNull(message = "id不能为空")
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.system.configuration.category;
|
||||
package cn.bunny.dao.dto.financial.category.admin;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.system.configuration.category;
|
||||
package cn.bunny.dao.dto.financial.category.admin;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.system.configuration.category;
|
||||
package cn.bunny.dao.dto.financial.category.admin;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.financial.category;
|
||||
package cn.bunny.dao.dto.financial.category.user;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.financial.category;
|
||||
package cn.bunny.dao.dto.financial.category.user;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.bunny.dao.dto.financial.category;
|
||||
package cn.bunny.dao.dto.financial.category.user;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
|
@ -1,43 +0,0 @@
|
|||
package cn.bunny.dao.entity.financial;
|
||||
|
||||
import cn.bunny.dao.common.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 债务回收管理表
|
||||
* </p>
|
||||
*
|
||||
* @author Bunny
|
||||
* @since 2024-11-11
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName("t_debt_collection_management")
|
||||
@Schema(name = "DebtCollectionManagement对象", title = "债务回收管理", description = "债务回收管理")
|
||||
public class DebtCollectionManagement extends BaseEntity {
|
||||
|
||||
@Schema(name = "debtId", title = "债务ID")
|
||||
private Long debtId;
|
||||
|
||||
@Schema(name = "recoveryDate", title = "回收日期")
|
||||
private LocalDateTime recoveryDate;
|
||||
|
||||
@Schema(name = "recoveryAmount", title = "回收金额")
|
||||
private BigDecimal recoveryAmount;
|
||||
|
||||
@Schema(name = "recoveryMethod", title = "回收方式")
|
||||
private String recoveryMethod;
|
||||
|
||||
@Schema(name = "notes", title = "备注")
|
||||
private String notes;
|
||||
|
||||
}
|
|
@ -1,72 +0,0 @@
|
|||
package cn.bunny.services.controller.configuration;
|
||||
|
||||
import cn.bunny.dao.dto.system.configuration.category.CategoryAddDto;
|
||||
import cn.bunny.dao.dto.system.configuration.category.CategoryDto;
|
||||
import cn.bunny.dao.dto.system.configuration.category.CategoryUpdateDto;
|
||||
import cn.bunny.dao.entity.financial.Category;
|
||||
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.configuration.CategoryVo;
|
||||
import cn.bunny.services.service.configuration.CategoryService;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 分类信息表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author Bunny
|
||||
* @since 2024-11-08 10:29:58
|
||||
*/
|
||||
@Tag(name = "分类信息", description = "分类信息相关接口")
|
||||
@RestController
|
||||
@RequestMapping("admin/category")
|
||||
public class CategoryController {
|
||||
|
||||
@Autowired
|
||||
private CategoryService categoryService;
|
||||
|
||||
@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) {
|
||||
categoryService.deleteCategory(ids);
|
||||
return Mono.just(Result.success(ResultCodeEnum.DELETE_SUCCESS));
|
||||
}
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
package cn.bunny.services.controller.financial;
|
||||
|
||||
import cn.bunny.dao.dto.financial.bill.BillAddDto;
|
||||
import cn.bunny.dao.dto.financial.bill.BillDto;
|
||||
import cn.bunny.dao.dto.financial.bill.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.entity.financial.Bill;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.pojo.result.Result;
|
||||
|
@ -31,7 +31,7 @@ import java.util.List;
|
|||
@Tag(name = "账单信息", description = "账单信息相关接口")
|
||||
@RestController
|
||||
@RequestMapping("admin/bill")
|
||||
public class BillController {
|
||||
public class BillUserController {
|
||||
|
||||
@Autowired
|
||||
private BillService billService;
|
||||
|
@ -43,7 +43,7 @@ public class BillController {
|
|||
@PathVariable("page") Integer page,
|
||||
@Parameter(name = "limit", description = "每页记录数", required = true)
|
||||
@PathVariable("limit") Integer limit,
|
||||
BillDto dto) {
|
||||
BillUserDto dto) {
|
||||
Page<Bill> pageParams = new Page<>(page, limit);
|
||||
PageResult<BillVo> pageResult = billService.getBillList(pageParams, dto);
|
||||
return Mono.just(Result.success(pageResult));
|
||||
|
@ -51,14 +51,14 @@ public class BillController {
|
|||
|
||||
@Operation(summary = "添加账单信息", description = "添加账单信息")
|
||||
@PostMapping("noManage/addBill")
|
||||
public Mono<Result<String>> addBill(@Valid @RequestBody BillAddDto dto) {
|
||||
public Mono<Result<String>> addBill(@Valid @RequestBody BillUserAddDto dto) {
|
||||
billService.addBill(dto);
|
||||
return Mono.just(Result.success(ResultCodeEnum.ADD_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "更新账单信息", description = "更新账单信息")
|
||||
@PutMapping("noManage/updateBill")
|
||||
public Mono<Result<String>> updateBill(@Valid @RequestBody BillUpdateDto dto) {
|
||||
public Mono<Result<String>> updateBill(@Valid @RequestBody BillUserUpdateDto dto) {
|
||||
billService.updateBill(dto);
|
||||
return Mono.just(Result.success(ResultCodeEnum.UPDATE_SUCCESS));
|
||||
}
|
|
@ -1,14 +1,18 @@
|
|||
package cn.bunny.services.controller.financial;
|
||||
|
||||
import cn.bunny.dao.dto.financial.category.CategoryUserAddDto;
|
||||
import cn.bunny.dao.dto.financial.category.CategoryUserDto;
|
||||
import cn.bunny.dao.dto.financial.category.CategoryUserUpdateDto;
|
||||
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;
|
||||
import cn.bunny.dao.pojo.result.Result;
|
||||
import cn.bunny.dao.pojo.result.ResultCodeEnum;
|
||||
import cn.bunny.dao.vo.configuration.CategoryVo;
|
||||
import cn.bunny.dao.vo.financial.CategoryUserVo;
|
||||
import cn.bunny.services.service.financial.CategoryUserService;
|
||||
import cn.bunny.services.service.financial.CategoryService;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
|
@ -26,15 +30,15 @@ import java.util.List;
|
|||
* </p>
|
||||
*
|
||||
* @author Bunny
|
||||
* @since 2024-11-08 10:00:09
|
||||
* @since 2024-11-08 10:29:58
|
||||
*/
|
||||
@Tag(name = "分类信息", description = "分类信息相关接口")
|
||||
@RestController
|
||||
@RequestMapping("admin/categoryUser")
|
||||
public class CategoryUserController {
|
||||
@RequestMapping("admin/category")
|
||||
public class CategoryController {
|
||||
|
||||
@Autowired
|
||||
private CategoryUserService categoryUserService;
|
||||
private CategoryService categoryService;
|
||||
|
||||
@Operation(summary = "用户分类分页查询分类信息", description = "用户分类分页查询分类信息")
|
||||
@GetMapping("noManage/getCategoryUserList/{page}/{limit}")
|
||||
|
@ -45,35 +49,69 @@ public class CategoryUserController {
|
|||
@PathVariable("limit") Integer limit,
|
||||
CategoryUserDto dto) {
|
||||
Page<Category> pageParams = new Page<>(page, limit);
|
||||
PageResult<CategoryUserVo> pageResult = categoryUserService.getCategoryUserList(pageParams, dto);
|
||||
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 = categoryUserService.getCategoryUserAllList();
|
||||
List<CategoryUserVo> voList = categoryService.getCategoryUserAllList();
|
||||
return Mono.just(Result.success(voList));
|
||||
}
|
||||
|
||||
@Operation(summary = "用戶分类添加分类信息", description = "用戶分类添加分类信息")
|
||||
@PostMapping("noManage/addCategoryUser")
|
||||
public Mono<Result<String>> addCategoryUser(@Valid @RequestBody CategoryUserAddDto dto) {
|
||||
categoryUserService.addCategoryUser(dto);
|
||||
categoryService.addCategoryUser(dto);
|
||||
return Mono.just(Result.success(ResultCodeEnum.ADD_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "用户分类更新分类信息", description = "用户分类更新分类信息")
|
||||
@PutMapping("noManage/updateCategoryUser")
|
||||
public Mono<Result<String>> updateCategoryUser(@Valid @RequestBody CategoryUserUpdateDto dto) {
|
||||
categoryUserService.updateCategoryUser(dto);
|
||||
categoryService.updateCategoryUser(dto);
|
||||
return Mono.just(Result.success(ResultCodeEnum.UPDATE_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "用户分类删除分类信息", description = "用户分类删除分类信息")
|
||||
@DeleteMapping("noManage/deleteCategoryUser")
|
||||
public Mono<Result<String>> deleteCategoryUser(@RequestBody List<Long> ids) {
|
||||
categoryUserService.deleteCategoryUser(ids);
|
||||
categoryService.deleteCategoryUser(ids);
|
||||
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) {
|
||||
categoryService.deleteCategory(ids);
|
||||
return Mono.just(Result.success(ResultCodeEnum.DELETE_SUCCESS));
|
||||
}
|
||||
}
|
|
@ -1,72 +0,0 @@
|
|||
package cn.bunny.services.controller.financial;
|
||||
|
||||
import cn.bunny.dao.dto.financial.debtCollectionManagement.DebtCollectionManagementAddDto;
|
||||
import cn.bunny.dao.dto.financial.debtCollectionManagement.DebtCollectionManagementDto;
|
||||
import cn.bunny.dao.dto.financial.debtCollectionManagement.DebtCollectionManagementUpdateDto;
|
||||
import cn.bunny.dao.entity.financial.DebtCollectionManagement;
|
||||
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.DebtCollectionManagementVo;
|
||||
import cn.bunny.services.service.financial.DebtCollectionManagementService;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 债务回收管理表表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author Bunny
|
||||
* @since 2024-11-11 16:13:55
|
||||
*/
|
||||
@Tag(name = "债务回收管理表", description = "债务回收管理表相关接口")
|
||||
@RestController
|
||||
@RequestMapping("admin/debtCollectionManagement")
|
||||
public class DebtCollectionManagementController {
|
||||
|
||||
@Autowired
|
||||
private DebtCollectionManagementService debtCollectionManagementService;
|
||||
|
||||
@Operation(summary = "分页查询债务回收管理表", description = "分页查询债务回收管理表")
|
||||
@GetMapping("getDebtCollectionManagementList/{page}/{limit}")
|
||||
public Mono<Result<PageResult<DebtCollectionManagementVo>>> getDebtCollectionManagementList(
|
||||
@Parameter(name = "page", description = "当前页", required = true)
|
||||
@PathVariable("page") Integer page,
|
||||
@Parameter(name = "limit", description = "每页记录数", required = true)
|
||||
@PathVariable("limit") Integer limit,
|
||||
DebtCollectionManagementDto dto) {
|
||||
Page<DebtCollectionManagement> pageParams = new Page<>(page, limit);
|
||||
PageResult<DebtCollectionManagementVo> pageResult = debtCollectionManagementService.getDebtCollectionManagementList(pageParams, dto);
|
||||
return Mono.just(Result.success(pageResult));
|
||||
}
|
||||
|
||||
@Operation(summary = "添加债务回收管理表", description = "添加债务回收管理表")
|
||||
@PostMapping("addDebtCollectionManagement")
|
||||
public Mono<Result<String>> addDebtCollectionManagement(@Valid @RequestBody DebtCollectionManagementAddDto dto) {
|
||||
debtCollectionManagementService.addDebtCollectionManagement(dto);
|
||||
return Mono.just(Result.success(ResultCodeEnum.ADD_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "更新债务回收管理表", description = "更新债务回收管理表")
|
||||
@PutMapping("updateDebtCollectionManagement")
|
||||
public Mono<Result<String>> updateDebtCollectionManagement(@Valid @RequestBody DebtCollectionManagementUpdateDto dto) {
|
||||
debtCollectionManagementService.updateDebtCollectionManagement(dto);
|
||||
return Mono.just(Result.success(ResultCodeEnum.UPDATE_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "删除债务回收管理表", description = "删除债务回收管理表")
|
||||
@DeleteMapping("deleteDebtCollectionManagement")
|
||||
public Mono<Result<String>> deleteDebtCollectionManagement(@RequestBody List<Long> ids) {
|
||||
debtCollectionManagementService.deleteDebtCollectionManagement(ids);
|
||||
return Mono.just(Result.success(ResultCodeEnum.DELETE_SUCCESS));
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.services.mapper.financial;
|
||||
|
||||
import cn.bunny.dao.dto.financial.bill.BillDto;
|
||||
import cn.bunny.dao.dto.financial.bill.user.BillUserDto;
|
||||
import cn.bunny.dao.entity.financial.Bill;
|
||||
import cn.bunny.dao.vo.financial.BillVo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
@ -29,7 +29,7 @@ public interface BillMapper extends BaseMapper<Bill> {
|
|||
* @param dto 账单信息查询表单
|
||||
* @return 账单信息分页结果
|
||||
*/
|
||||
IPage<BillVo> selectListByPage(@Param("page") Page<Bill> pageParams, @Param("dto") BillDto dto, @Param("userId") Long userId);
|
||||
IPage<BillVo> selectListByPage(@Param("page") Page<Bill> pageParams, @Param("dto") BillUserDto dto, @Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 物理删除账单信息
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
package cn.bunny.services.mapper.configuration;
|
||||
package cn.bunny.services.mapper.financial;
|
||||
|
||||
import cn.bunny.dao.dto.system.configuration.category.CategoryDto;
|
||||
import cn.bunny.dao.dto.financial.category.admin.CategoryDto;
|
||||
import cn.bunny.dao.dto.financial.category.user.CategoryUserDto;
|
||||
import cn.bunny.dao.entity.financial.Category;
|
||||
import cn.bunny.dao.vo.configuration.CategoryVo;
|
||||
import cn.bunny.dao.vo.financial.CategoryUserVo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
@ -21,6 +23,21 @@ 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,40 +0,0 @@
|
|||
package cn.bunny.services.mapper.financial;
|
||||
|
||||
import cn.bunny.dao.dto.financial.category.CategoryUserDto;
|
||||
import cn.bunny.dao.entity.financial.Category;
|
||||
import cn.bunny.dao.vo.financial.CategoryUserVo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 分类信息 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author Bunny
|
||||
* @since 2024-11-08 10:00:09
|
||||
*/
|
||||
@Mapper
|
||||
public interface CategoryUserMapper extends BaseMapper<Category> {
|
||||
|
||||
/**
|
||||
* * 分页查询分类信息内容
|
||||
*
|
||||
* @param pageParams 分类信息分页参数
|
||||
* @param dto 分类信息查询表单
|
||||
* @return 分类信息分页结果
|
||||
*/
|
||||
IPage<CategoryUserVo> selectListByPage(@Param("page") Page<Category> pageParams, @Param("dto") CategoryUserDto dto, @Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 物理删除分类信息
|
||||
*
|
||||
* @param ids 删除 id 列表
|
||||
*/
|
||||
void deleteBatchIdsWithPhysics(List<Long> ids);
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
package cn.bunny.services.mapper.financial;
|
||||
|
||||
import cn.bunny.dao.dto.financial.debtCollectionManagement.DebtCollectionManagementDto;
|
||||
import cn.bunny.dao.entity.financial.DebtCollectionManagement;
|
||||
import cn.bunny.dao.vo.financial.DebtCollectionManagementVo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 债务回收管理表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author Bunny
|
||||
* @since 2024-11-11 16:13:55
|
||||
*/
|
||||
@Mapper
|
||||
public interface DebtCollectionManagementMapper extends BaseMapper<DebtCollectionManagement> {
|
||||
|
||||
/**
|
||||
* * 分页查询债务回收管理表内容
|
||||
*
|
||||
* @param pageParams 债务回收管理表分页参数
|
||||
* @param dto 债务回收管理表查询表单
|
||||
* @return 债务回收管理表分页结果
|
||||
*/
|
||||
IPage<DebtCollectionManagementVo> selectListByPage(@Param("page") Page<DebtCollectionManagement> pageParams, @Param("dto") DebtCollectionManagementDto dto);
|
||||
|
||||
/**
|
||||
* 物理删除债务回收管理表
|
||||
*
|
||||
* @param ids 删除 id 列表
|
||||
*/
|
||||
void deleteBatchIdsWithPhysics(List<Long> ids);
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
package cn.bunny.services.service.configuration;
|
||||
|
||||
import cn.bunny.dao.dto.system.configuration.category.CategoryAddDto;
|
||||
import cn.bunny.dao.dto.system.configuration.category.CategoryDto;
|
||||
import cn.bunny.dao.dto.system.configuration.category.CategoryUpdateDto;
|
||||
import cn.bunny.dao.entity.financial.Category;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.vo.configuration.CategoryVo;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 分类信息 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Bunny
|
||||
* @since 2024-11-08 10:29:58
|
||||
*/
|
||||
public interface CategoryService extends IService<Category> {
|
||||
|
||||
/**
|
||||
* * 获取分类信息列表
|
||||
*
|
||||
* @return 分类信息返回列表
|
||||
*/
|
||||
PageResult<CategoryVo> getCategoryList(Page<Category> pageParams, CategoryDto dto);
|
||||
|
||||
/**
|
||||
* * 添加分类信息
|
||||
*
|
||||
* @param dto 添加表单
|
||||
*/
|
||||
void addCategory(@Valid CategoryAddDto dto);
|
||||
|
||||
/**
|
||||
* * 更新分类信息
|
||||
*
|
||||
* @param dto 更新表单
|
||||
*/
|
||||
void updateCategory(@Valid CategoryUpdateDto dto);
|
||||
|
||||
/**
|
||||
* * 删除|批量删除分类信息类型
|
||||
*
|
||||
* @param ids 删除id列表
|
||||
*/
|
||||
void deleteCategory(List<Long> ids);
|
||||
}
|
|
@ -1,89 +0,0 @@
|
|||
package cn.bunny.services.service.configuration.impl;
|
||||
|
||||
import cn.bunny.common.service.context.BaseContext;
|
||||
import cn.bunny.dao.dto.system.configuration.category.CategoryAddDto;
|
||||
import cn.bunny.dao.dto.system.configuration.category.CategoryDto;
|
||||
import cn.bunny.dao.dto.system.configuration.category.CategoryUpdateDto;
|
||||
import cn.bunny.dao.entity.financial.Category;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.vo.configuration.CategoryVo;
|
||||
import cn.bunny.services.mapper.configuration.CategoryMapper;
|
||||
import cn.bunny.services.service.configuration.CategoryService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 分类信息 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author Bunny
|
||||
* @since 2024-11-08 10:29:58
|
||||
*/
|
||||
@Service
|
||||
public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> implements CategoryService {
|
||||
|
||||
/**
|
||||
* * 分类信息 服务实现类
|
||||
*
|
||||
* @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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除|批量删除分类信息
|
||||
*
|
||||
* @param ids 删除id列表
|
||||
*/
|
||||
@Override
|
||||
public void deleteCategory(List<Long> ids) {
|
||||
baseMapper.deleteBatchIdsWithPhysics(ids);
|
||||
}
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
package cn.bunny.services.service.financial;
|
||||
|
||||
import cn.bunny.dao.dto.financial.bill.BillAddDto;
|
||||
import cn.bunny.dao.dto.financial.bill.BillDto;
|
||||
import cn.bunny.dao.dto.financial.bill.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.entity.financial.Bill;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.vo.financial.BillVo;
|
||||
|
@ -27,21 +27,21 @@ public interface BillService extends IService<Bill> {
|
|||
*
|
||||
* @return 账单信息返回列表
|
||||
*/
|
||||
PageResult<BillVo> getBillList(Page<Bill> pageParams, BillDto dto);
|
||||
PageResult<BillVo> getBillList(Page<Bill> pageParams, BillUserDto dto);
|
||||
|
||||
/**
|
||||
* * 添加账单信息
|
||||
*
|
||||
* @param dto 添加表单
|
||||
*/
|
||||
void addBill(@Valid BillAddDto dto);
|
||||
void addBill(@Valid BillUserAddDto dto);
|
||||
|
||||
/**
|
||||
* * 更新账单信息
|
||||
*
|
||||
* @param dto 更新表单
|
||||
*/
|
||||
void updateBill(@Valid BillUpdateDto dto);
|
||||
void updateBill(@Valid BillUserUpdateDto dto);
|
||||
|
||||
/**
|
||||
* * 删除|批量删除账单信息类型
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
package cn.bunny.services.service.financial;
|
||||
|
||||
import cn.bunny.dao.dto.financial.category.CategoryUserAddDto;
|
||||
import cn.bunny.dao.dto.financial.category.CategoryUserDto;
|
||||
import cn.bunny.dao.dto.financial.category.CategoryUserUpdateDto;
|
||||
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;
|
||||
import cn.bunny.dao.vo.configuration.CategoryVo;
|
||||
import cn.bunny.dao.vo.financial.CategoryUserVo;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
@ -18,9 +22,9 @@ import java.util.List;
|
|||
* </p>
|
||||
*
|
||||
* @author Bunny
|
||||
* @since 2024-11-08 10:00:09
|
||||
* @since 2024-11-08 10:29:58
|
||||
*/
|
||||
public interface CategoryUserService extends IService<Category> {
|
||||
public interface CategoryService extends IService<Category> {
|
||||
|
||||
/**
|
||||
* * 用户分类分页查询分类信息
|
||||
|
@ -56,4 +60,32 @@ public interface CategoryUserService extends IService<Category> {
|
|||
* @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);
|
||||
|
||||
/**
|
||||
* * 删除|批量删除分类信息类型
|
||||
*
|
||||
* @param ids 删除id列表
|
||||
*/
|
||||
void deleteCategory(List<Long> ids);
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
package cn.bunny.services.service.financial;
|
||||
|
||||
import cn.bunny.dao.dto.financial.debtCollectionManagement.DebtCollectionManagementAddDto;
|
||||
import cn.bunny.dao.dto.financial.debtCollectionManagement.DebtCollectionManagementDto;
|
||||
import cn.bunny.dao.dto.financial.debtCollectionManagement.DebtCollectionManagementUpdateDto;
|
||||
import cn.bunny.dao.entity.financial.DebtCollectionManagement;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.vo.financial.DebtCollectionManagementVo;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 债务回收管理表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Bunny
|
||||
* @since 2024-11-11 16:13:55
|
||||
*/
|
||||
public interface DebtCollectionManagementService extends IService<DebtCollectionManagement> {
|
||||
|
||||
/**
|
||||
* * 获取债务回收管理表列表
|
||||
*
|
||||
* @return 债务回收管理表返回列表
|
||||
*/
|
||||
PageResult<DebtCollectionManagementVo> getDebtCollectionManagementList(Page<DebtCollectionManagement> pageParams, DebtCollectionManagementDto dto);
|
||||
|
||||
/**
|
||||
* * 添加债务回收管理表
|
||||
*
|
||||
* @param dto 添加表单
|
||||
*/
|
||||
void addDebtCollectionManagement(@Valid DebtCollectionManagementAddDto dto);
|
||||
|
||||
/**
|
||||
* * 更新债务回收管理表
|
||||
*
|
||||
* @param dto 更新表单
|
||||
*/
|
||||
void updateDebtCollectionManagement(@Valid DebtCollectionManagementUpdateDto dto);
|
||||
|
||||
/**
|
||||
* * 删除|批量删除债务回收管理表类型
|
||||
*
|
||||
* @param ids 删除id列表
|
||||
*/
|
||||
void deleteDebtCollectionManagement(List<Long> ids);
|
||||
}
|
|
@ -1,9 +1,9 @@
|
|||
package cn.bunny.services.service.financial.impl;
|
||||
|
||||
import cn.bunny.common.service.context.BaseContext;
|
||||
import cn.bunny.dao.dto.financial.bill.BillAddDto;
|
||||
import cn.bunny.dao.dto.financial.bill.BillDto;
|
||||
import cn.bunny.dao.dto.financial.bill.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.entity.financial.Bill;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.vo.financial.BillVo;
|
||||
|
@ -37,7 +37,7 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements Bi
|
|||
* @return 查询分页账单信息返回对象
|
||||
*/
|
||||
@Override
|
||||
public PageResult<BillVo> getBillList(Page<Bill> pageParams, BillDto dto) {
|
||||
public PageResult<BillVo> getBillList(Page<Bill> pageParams, BillUserDto dto) {
|
||||
// 需要根据当前用户去查询
|
||||
Long userId = BaseContext.getUserId();
|
||||
|
||||
|
@ -58,7 +58,7 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements Bi
|
|||
* @param dto 账单信息添加
|
||||
*/
|
||||
@Override
|
||||
public void addBill(@Valid BillAddDto dto) {
|
||||
public void addBill(@Valid BillUserAddDto dto) {
|
||||
// 保存数据
|
||||
Bill bill = new Bill();
|
||||
BeanUtils.copyProperties(dto, bill);
|
||||
|
@ -71,7 +71,7 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements Bi
|
|||
* @param dto 账单信息更新
|
||||
*/
|
||||
@Override
|
||||
public void updateBill(@Valid BillUpdateDto dto) {
|
||||
public void updateBill(@Valid BillUserUpdateDto dto) {
|
||||
// 更新内容
|
||||
Bill bill = new Bill();
|
||||
BeanUtils.copyProperties(dto, bill);
|
||||
|
|
|
@ -2,16 +2,20 @@ 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.category.CategoryUserAddDto;
|
||||
import cn.bunny.dao.dto.financial.category.CategoryUserDto;
|
||||
import cn.bunny.dao.dto.financial.category.CategoryUserUpdateDto;
|
||||
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;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.pojo.result.ResultCodeEnum;
|
||||
import cn.bunny.dao.vo.configuration.CategoryVo;
|
||||
import cn.bunny.dao.vo.financial.CategoryUserVo;
|
||||
import cn.bunny.services.mapper.financial.CategoryUserMapper;
|
||||
import cn.bunny.services.service.financial.CategoryUserService;
|
||||
import cn.bunny.services.mapper.financial.CategoryMapper;
|
||||
import cn.bunny.services.service.financial.CategoryService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
@ -28,10 +32,10 @@ import java.util.List;
|
|||
* </p>
|
||||
*
|
||||
* @author Bunny
|
||||
* @since 2024-11-08 10:00:09
|
||||
* @since 2024-11-08 10:29:58
|
||||
*/
|
||||
@Service
|
||||
public class CategoryUserServiceImpl extends ServiceImpl<CategoryUserMapper, Category> implements CategoryUserService {
|
||||
public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> implements CategoryService {
|
||||
|
||||
/**
|
||||
* * 用户分类分页查询分类信息 服务实现类
|
||||
|
@ -42,7 +46,7 @@ public class CategoryUserServiceImpl extends ServiceImpl<CategoryUserMapper, Cat
|
|||
*/
|
||||
@Override
|
||||
public PageResult<CategoryUserVo> getCategoryUserList(Page<Category> pageParams, CategoryUserDto dto) {
|
||||
IPage<CategoryUserVo> page = baseMapper.selectListByPage(pageParams, dto, BaseContext.getUserId());
|
||||
IPage<CategoryUserVo> page = baseMapper.selectUserListByPage(pageParams, dto, BaseContext.getUserId());
|
||||
|
||||
return PageResult.<CategoryUserVo>builder()
|
||||
.list(page.getRecords())
|
||||
|
@ -122,4 +126,62 @@ public class CategoryUserServiceImpl extends ServiceImpl<CategoryUserMapper, Cat
|
|||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除|批量删除分类信息
|
||||
*
|
||||
* @param ids 删除id列表
|
||||
*/
|
||||
@Override
|
||||
public void deleteCategory(List<Long> ids) {
|
||||
baseMapper.deleteBatchIdsWithPhysics(ids);
|
||||
}
|
||||
}
|
|
@ -1,85 +0,0 @@
|
|||
package cn.bunny.services.service.financial.impl;
|
||||
|
||||
import cn.bunny.dao.dto.financial.debtCollectionManagement.DebtCollectionManagementAddDto;
|
||||
import cn.bunny.dao.dto.financial.debtCollectionManagement.DebtCollectionManagementDto;
|
||||
import cn.bunny.dao.dto.financial.debtCollectionManagement.DebtCollectionManagementUpdateDto;
|
||||
import cn.bunny.dao.entity.financial.DebtCollectionManagement;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.vo.financial.DebtCollectionManagementVo;
|
||||
import cn.bunny.services.mapper.financial.DebtCollectionManagementMapper;
|
||||
import cn.bunny.services.service.financial.DebtCollectionManagementService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 债务回收管理表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author Bunny
|
||||
* @since 2024-11-11 16:13:55
|
||||
*/
|
||||
@Service
|
||||
public class DebtCollectionManagementServiceImpl extends ServiceImpl<DebtCollectionManagementMapper, DebtCollectionManagement> implements DebtCollectionManagementService {
|
||||
|
||||
/**
|
||||
* * 债务回收管理表 服务实现类
|
||||
*
|
||||
* @param pageParams 债务回收管理表分页查询page对象
|
||||
* @param dto 债务回收管理表分页查询对象
|
||||
* @return 查询分页债务回收管理表返回对象
|
||||
*/
|
||||
@Override
|
||||
public PageResult<DebtCollectionManagementVo> getDebtCollectionManagementList(Page<DebtCollectionManagement> pageParams, DebtCollectionManagementDto dto) {
|
||||
IPage<DebtCollectionManagementVo> page = baseMapper.selectListByPage(pageParams, dto);
|
||||
|
||||
return PageResult.<DebtCollectionManagementVo>builder()
|
||||
.list(page.getRecords())
|
||||
.pageNo(page.getCurrent())
|
||||
.pageSize(page.getSize())
|
||||
.total(page.getTotal())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加债务回收管理表
|
||||
*
|
||||
* @param dto 债务回收管理表添加
|
||||
*/
|
||||
@Override
|
||||
public void addDebtCollectionManagement(@Valid DebtCollectionManagementAddDto dto) {
|
||||
// 保存数据
|
||||
DebtCollectionManagement debtCollectionManagement = new DebtCollectionManagement();
|
||||
BeanUtils.copyProperties(dto, debtCollectionManagement);
|
||||
save(debtCollectionManagement);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新债务回收管理表
|
||||
*
|
||||
* @param dto 债务回收管理表更新
|
||||
*/
|
||||
@Override
|
||||
public void updateDebtCollectionManagement(@Valid DebtCollectionManagementUpdateDto dto) {
|
||||
// 更新内容
|
||||
DebtCollectionManagement debtCollectionManagement = new DebtCollectionManagement();
|
||||
BeanUtils.copyProperties(dto, debtCollectionManagement);
|
||||
updateById(debtCollectionManagement);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除|批量删除债务回收管理表
|
||||
*
|
||||
* @param ids 删除id列表
|
||||
*/
|
||||
@Override
|
||||
public void deleteDebtCollectionManagement(List<Long> ids) {
|
||||
baseMapper.deleteBatchIdsWithPhysics(ids);
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
server:
|
||||
port: 6060
|
||||
port: 7070
|
||||
|
||||
logging:
|
||||
level:
|
||||
|
@ -17,44 +17,44 @@ logging:
|
|||
# map-underscore-to-camel-case: true
|
||||
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 查看日志
|
||||
|
||||
#bunny:
|
||||
# master:
|
||||
# host: 192.168.3.98
|
||||
# port: 3304
|
||||
# database: family_financial
|
||||
# username: root
|
||||
# password: "02120212"
|
||||
#
|
||||
# redis:
|
||||
# host: 192.168.3.98
|
||||
# port: 6379
|
||||
# database: 6
|
||||
# password: "123456"
|
||||
#
|
||||
# minio:
|
||||
# endpointUrl: "http://192.168.3.98:9000"
|
||||
# accessKey: bunny
|
||||
# secretKey: "02120212"
|
||||
# bucket-name: financial
|
||||
bunny:
|
||||
master:
|
||||
host: rm-bp12z6hlv46vi6g8mro.mysql.rds.aliyuncs.com
|
||||
port: 3306
|
||||
host: 192.168.3.98
|
||||
port: 3304
|
||||
database: family_financial
|
||||
username: family_financial_prod
|
||||
password: 0212family_financial
|
||||
|
||||
redis:
|
||||
host: 47.120.65.66
|
||||
port: 6379
|
||||
database: 6
|
||||
username: root
|
||||
password: "02120212"
|
||||
|
||||
redis:
|
||||
host: 192.168.3.98
|
||||
port: 6379
|
||||
database: 6
|
||||
password: "123456"
|
||||
|
||||
minio:
|
||||
endpointUrl: "http://116.196.101.14:9000"
|
||||
endpointUrl: "http://192.168.3.98:9000"
|
||||
accessKey: bunny
|
||||
secretKey: "02120212"
|
||||
bucket-name: financial
|
||||
#bunny:
|
||||
# master:
|
||||
# host: rm-bp12z6hlv46vi6g8mro.mysql.rds.aliyuncs.com
|
||||
# port: 3306
|
||||
# database: family_financial
|
||||
# username: family_financial_prod
|
||||
# password: 0212family_financial
|
||||
#
|
||||
# redis:
|
||||
# host: 47.120.65.66
|
||||
# port: 6379
|
||||
# database: 6
|
||||
# password: "02120212"
|
||||
#
|
||||
# minio:
|
||||
# endpointUrl: "http://116.196.101.14:9000"
|
||||
# accessKey: bunny
|
||||
# secretKey: "02120212"
|
||||
# bucket-name: financial
|
||||
|
||||
backPath: "D:\\MyData\\backup"
|
||||
bashPath: "D:\\MyData"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
server:
|
||||
port: 6060
|
||||
port: 7070
|
||||
|
||||
#mybatis-plus:
|
||||
# configuration:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.bunny.services.mapper.configuration.CategoryMapper">
|
||||
<mapper namespace="cn.bunny.services.mapper.financial.CategoryMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="cn.bunny.dao.entity.financial.Category">
|
||||
|
@ -20,6 +20,37 @@
|
|||
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.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.configuration.CategoryVo">
|
||||
select
|
|
@ -1,54 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.bunny.services.mapper.financial.CategoryUserMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="cn.bunny.dao.entity.financial.Category">
|
||||
<id column="id" property="id"/>
|
||||
<id column="create_time" property="createTime"/>
|
||||
<id column="update_time" property="updateTime"/>
|
||||
<id column="create_user" property="createUser"/>
|
||||
<id column="update_user" property="updateUser"/>
|
||||
<id column="is_deleted" property="isDeleted"/>
|
||||
<id column="user_id" property="userId"/>
|
||||
<id column="category_name" property="categoryName"/>
|
||||
<id column="is_builtin" property="isBuiltin"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, create_time, update_time, create_user, update_user, is_deleted, user_id, category_name, is_builtin
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询分类信息内容 -->
|
||||
<select id="selectListByPage" resultType="cn.bunny.dao.vo.financial.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="deleteBatchIdsWithPhysics">
|
||||
delete
|
||||
from t_category
|
||||
where id in
|
||||
<foreach collection="ids" item="id" open="(" close=")" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
|
@ -1,64 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.bunny.services.mapper.financial.DebtCollectionManagementMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="cn.bunny.dao.entity.financial.DebtCollectionManagement">
|
||||
<id column="id" property="id"/>
|
||||
<id column="create_time" property="createTime"/>
|
||||
<id column="update_time" property="updateTime"/>
|
||||
<id column="create_user" property="createUser"/>
|
||||
<id column="update_user" property="updateUser"/>
|
||||
<id column="is_deleted" property="isDeleted"/>
|
||||
<id column="debt_id" property="debtId"/>
|
||||
<id column="recovery_date" property="recoveryDate"/>
|
||||
<id column="recovery_amount" property="recoveryAmount"/>
|
||||
<id column="recovery_method" property="recoveryMethod"/>
|
||||
<id column="notes" property="notes"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, create_time, update_time, create_user, update_user, is_deleted, debt_id, recovery_date, recovery_amount, recovery_method, notes
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询债务回收管理表内容 -->
|
||||
<select id="selectListByPage" resultType="cn.bunny.dao.vo.financial.DebtCollectionManagementVo">
|
||||
select
|
||||
base.*,
|
||||
create_user.username as create_username,
|
||||
update_user.username as update_username
|
||||
from t_debt_collection_management 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
|
||||
<if test="dto.debtId != null and dto.debtId != ''">
|
||||
and base.debt_id like CONCAT('%',#{dto.debtId},'%')
|
||||
</if>
|
||||
<if test="dto.recoveryDate != null and dto.recoveryDate != ''">
|
||||
and base.recovery_date like CONCAT('%',#{dto.recoveryDate},'%')
|
||||
</if>
|
||||
<if test="dto.recoveryAmount != null and dto.recoveryAmount != ''">
|
||||
and base.recovery_amount like CONCAT('%',#{dto.recoveryAmount},'%')
|
||||
</if>
|
||||
<if test="dto.recoveryMethod != null and dto.recoveryMethod != ''">
|
||||
and base.recovery_method like CONCAT('%',#{dto.recoveryMethod},'%')
|
||||
</if>
|
||||
<if test="dto.notes != null and dto.notes != ''">
|
||||
and base.notes like CONCAT('%',#{dto.notes},'%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- 物理删除债务回收管理表 -->
|
||||
<delete id="deleteBatchIdsWithPhysics">
|
||||
delete
|
||||
from t_debt_collection_management
|
||||
where id in
|
||||
<foreach collection="ids" item="id" open="(" close=")" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue