Commit 71ce831d59a587260a748d2a411434da2d488f02

Authored by 芋道源码
Committed by Gitee
2 parents 4092f298 95e9dc81

!706 完善回款管理和回款计划功能

Merge pull request !706 from souvc/feature/crm
Showing 38 changed files with 664 additions and 635 deletions
sql/mysql/crm.sql
@@ -41,7 +41,7 @@ CREATE TABLE `crm_receivable` ( @@ -41,7 +41,7 @@ CREATE TABLE `crm_receivable` (
41 DROP TABLE IF EXISTS `crm_receivable_plan`; 41 DROP TABLE IF EXISTS `crm_receivable_plan`;
42 CREATE TABLE `crm_receivable_plan` ( 42 CREATE TABLE `crm_receivable_plan` (
43 `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID', 43 `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
44 - `index_no` bigint(20) NULL DEFAULT NULL COMMENT '期数', 44 + `period` tinyint(4) DEFAULT NULL COMMENT '期数',
45 `receivable_id` bigint(20) NULL DEFAULT NULL COMMENT '回款ID', 45 `receivable_id` bigint(20) NULL DEFAULT NULL COMMENT '回款ID',
46 `status` tinyint(4) NOT NULL COMMENT '完成状态', 46 `status` tinyint(4) NOT NULL COMMENT '完成状态',
47 `check_status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '审批状态', 47 `check_status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '审批状态',
yudao-module-crm/yudao-module-crm-api/src/main/java/cn/iocoder/yudao/module/crm/enums/AuditStatusEnum.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.enums;
  2 +
  3 +import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
  4 +
  5 +import java.util.Arrays;
  6 +
  7 +/**
  8 + * 流程审批状态枚举类
  9 + * 0 未审核 1 审核通过 2 审核拒绝 3 审核中 4 已撤回
  10 + * @author 赤焰
  11 + */
  12 +public enum AuditStatusEnum implements IntArrayValuable {
  13 + /**
  14 + * 未审批
  15 + */
  16 + AUDIT_NEW(0, "未审批"),
  17 + /**
  18 + * 审核通过
  19 + */
  20 + AUDIT_FINISH(1, "审核通过"),
  21 + /**
  22 + * 审核拒绝
  23 + */
  24 + AUDIT_REJECT(2, "审核拒绝"),
  25 + /**
  26 + * 审核中
  27 + */
  28 + AUDIT_DOING(3, "审核中"),
  29 + /**
  30 + * 已撤回
  31 + */
  32 + AUDIT_RETURN(4, "已撤回");
  33 +
  34 + private final Integer value;
  35 + private final String desc;
  36 +
  37 + public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(AuditStatusEnum::getValue).toArray();
  38 +
  39 + /**
  40 + *
  41 + * @param value
  42 + * @param desc
  43 + */
  44 + AuditStatusEnum(Integer value, String desc) {
  45 + this.value = value;
  46 + this.desc = desc;
  47 + }
  48 +
  49 + public Integer getValue() {
  50 + return value;
  51 + }
  52 +
  53 + public String getDesc() {
  54 + return desc;
  55 + }
  56 +
  57 + @Override
  58 + public int[] array() {
  59 + return ARRAYS;
  60 + }
  61 +}
yudao-module-crm/yudao-module-crm-api/src/main/java/cn/iocoder/yudao/module/crm/enums/DictTypeConstants.java
@@ -11,5 +11,6 @@ public interface DictTypeConstants { @@ -11,5 +11,6 @@ public interface DictTypeConstants {
11 String CRM_CUSTOMER_INDUSTRY = "crm_customer_industry"; // CRM 客户所属行业 11 String CRM_CUSTOMER_INDUSTRY = "crm_customer_industry"; // CRM 客户所属行业
12 String CRM_CUSTOMER_LEVEL = "crm_customer_level"; // CRM 客户等级 12 String CRM_CUSTOMER_LEVEL = "crm_customer_level"; // CRM 客户等级
13 String CRM_CUSTOMER_SOURCE = "crm_customer_source"; // CRM 客户来源 13 String CRM_CUSTOMER_SOURCE = "crm_customer_source"; // CRM 客户来源
  14 + String CRM_RECEIVABLE_CHECK_STATUS = "crm_receivable_check_status"; // CRM 审批状态
14 15
15 } 16 }
yudao-module-crm/yudao-module-crm-api/src/main/java/cn/iocoder/yudao/module/crm/enums/ErrorCodeConstants.java
@@ -26,10 +26,11 @@ public interface ErrorCodeConstants { @@ -26,10 +26,11 @@ public interface ErrorCodeConstants {
26 // ========== 联系人管理 1-020-003-000 ========== 26 // ========== 联系人管理 1-020-003-000 ==========
27 ErrorCode CONTACT_NOT_EXISTS = new ErrorCode(1_020_003_000, "联系人不存在"); 27 ErrorCode CONTACT_NOT_EXISTS = new ErrorCode(1_020_003_000, "联系人不存在");
28 28
29 - // TODO @liuhongfeng:错误码分段;  
30 - ErrorCode RECEIVABLE_NOT_EXISTS = new ErrorCode(1_030_000_001, "回款管理不存在"); 29 + // ========== 回款管理 1-020-004-000 ==========
  30 + ErrorCode RECEIVABLE_NOT_EXISTS = new ErrorCode(1_020_004_000, "回款管理不存在");
31 31
32 - ErrorCode RECEIVABLE_PLAN_NOT_EXISTS = new ErrorCode(1_040_000_001, "回款计划不存在"); 32 + // ========== 合同管理 1-020-005-000 ==========
  33 + ErrorCode RECEIVABLE_PLAN_NOT_EXISTS = new ErrorCode(1_020_005_000, "回款计划不存在");
33 34
34 // ========== 客户管理 1_020_006_000 ========== 35 // ========== 客户管理 1_020_006_000 ==========
35 ErrorCode CUSTOMER_NOT_EXISTS = new ErrorCode(1_020_006_000, "客户不存在"); 36 ErrorCode CUSTOMER_NOT_EXISTS = new ErrorCode(1_020_006_000, "客户不存在");
yudao-module-crm/yudao-module-crm-api/src/main/java/cn/iocoder/yudao/module/crm/enums/ReturnTypeEnum.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.enums;
  2 +
  3 +/**
  4 + * @author 赤焰
  5 + */
  6 +
  7 +public enum ReturnTypeEnum {
  8 +}
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/ReceivableController.java renamed to yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/CrmReceivableController.java
@@ -5,9 +5,9 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; @@ -5,9 +5,9 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
5 import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; 5 import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
6 import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; 6 import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
7 import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*; 7 import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*;
8 -import cn.iocoder.yudao.module.crm.convert.receivable.ReceivableConvert;  
9 -import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivableDO;  
10 -import cn.iocoder.yudao.module.crm.service.receivable.ReceivableService; 8 +import cn.iocoder.yudao.module.crm.convert.receivable.CrmReceivableConvert;
  9 +import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.CrmReceivableDO;
  10 +import cn.iocoder.yudao.module.crm.service.receivable.CrmReceivableService;
11 import io.swagger.v3.oas.annotations.Operation; 11 import io.swagger.v3.oas.annotations.Operation;
12 import io.swagger.v3.oas.annotations.Parameter; 12 import io.swagger.v3.oas.annotations.Parameter;
13 import io.swagger.v3.oas.annotations.tags.Tag; 13 import io.swagger.v3.oas.annotations.tags.Tag;
@@ -28,23 +28,23 @@ import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.E @@ -28,23 +28,23 @@ import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.E
28 @RestController 28 @RestController
29 @RequestMapping("/crm/receivable") 29 @RequestMapping("/crm/receivable")
30 @Validated 30 @Validated
31 -public class ReceivableController { 31 +public class CrmReceivableController {
32 32
33 @Resource 33 @Resource
34 - private ReceivableService receivableService; 34 + private CrmReceivableService crmReceivableService;
35 35
36 @PostMapping("/create") 36 @PostMapping("/create")
37 @Operation(summary = "创建回款管理") 37 @Operation(summary = "创建回款管理")
38 @PreAuthorize("@ss.hasPermission('crm:receivable:create')") 38 @PreAuthorize("@ss.hasPermission('crm:receivable:create')")
39 - public CommonResult<Long> createReceivable(@Valid @RequestBody ReceivableCreateReqVO createReqVO) {  
40 - return success(receivableService.createReceivable(createReqVO)); 39 + public CommonResult<Long> createReceivable(@Valid @RequestBody CrmReceivableCreateReqVO createReqVO) {
  40 + return success(crmReceivableService.createReceivable(createReqVO));
41 } 41 }
42 42
43 @PutMapping("/update") 43 @PutMapping("/update")
44 @Operation(summary = "更新回款管理") 44 @Operation(summary = "更新回款管理")
45 @PreAuthorize("@ss.hasPermission('crm:receivable:update')") 45 @PreAuthorize("@ss.hasPermission('crm:receivable:update')")
46 - public CommonResult<Boolean> updateReceivable(@Valid @RequestBody ReceivableUpdateReqVO updateReqVO) {  
47 - receivableService.updateReceivable(updateReqVO); 46 + public CommonResult<Boolean> updateReceivable(@Valid @RequestBody CrmReceivableUpdateReqVO updateReqVO) {
  47 + crmReceivableService.updateReceivable(updateReqVO);
48 return success(true); 48 return success(true);
49 } 49 }
50 50
@@ -53,7 +53,7 @@ public class ReceivableController { @@ -53,7 +53,7 @@ public class ReceivableController {
53 @Parameter(name = "id", description = "编号", required = true) 53 @Parameter(name = "id", description = "编号", required = true)
54 @PreAuthorize("@ss.hasPermission('crm:receivable:delete')") 54 @PreAuthorize("@ss.hasPermission('crm:receivable:delete')")
55 public CommonResult<Boolean> deleteReceivable(@RequestParam("id") Long id) { 55 public CommonResult<Boolean> deleteReceivable(@RequestParam("id") Long id) {
56 - receivableService.deleteReceivable(id); 56 + crmReceivableService.deleteReceivable(id);
57 return success(true); 57 return success(true);
58 } 58 }
59 59
@@ -61,29 +61,29 @@ public class ReceivableController { @@ -61,29 +61,29 @@ public class ReceivableController {
61 @Operation(summary = "获得回款管理") 61 @Operation(summary = "获得回款管理")
62 @Parameter(name = "id", description = "编号", required = true, example = "1024") 62 @Parameter(name = "id", description = "编号", required = true, example = "1024")
63 @PreAuthorize("@ss.hasPermission('crm:receivable:query')") 63 @PreAuthorize("@ss.hasPermission('crm:receivable:query')")
64 - public CommonResult<ReceivableRespVO> getReceivable(@RequestParam("id") Long id) {  
65 - ReceivableDO receivable = receivableService.getReceivable(id);  
66 - return success(ReceivableConvert.INSTANCE.convert(receivable)); 64 + public CommonResult<CrmReceivableRespVO> getReceivable(@RequestParam("id") Long id) {
  65 + CrmReceivableDO receivable = crmReceivableService.getReceivable(id);
  66 + return success(CrmReceivableConvert.INSTANCE.convert(receivable));
67 } 67 }
68 68
69 @GetMapping("/page") 69 @GetMapping("/page")
70 @Operation(summary = "获得回款管理分页") 70 @Operation(summary = "获得回款管理分页")
71 @PreAuthorize("@ss.hasPermission('crm:receivable:query')") 71 @PreAuthorize("@ss.hasPermission('crm:receivable:query')")
72 - public CommonResult<PageResult<ReceivableRespVO>> getReceivablePage(@Valid ReceivablePageReqVO pageVO) {  
73 - PageResult<ReceivableDO> pageResult = receivableService.getReceivablePage(pageVO);  
74 - return success(ReceivableConvert.INSTANCE.convertPage(pageResult)); 72 + public CommonResult<PageResult<CrmReceivableRespVO>> getReceivablePage(@Valid CrmReceivablePageReqVO pageVO) {
  73 + PageResult<CrmReceivableDO> pageResult = crmReceivableService.getReceivablePage(pageVO);
  74 + return success(CrmReceivableConvert.INSTANCE.convertPage(pageResult));
75 } 75 }
76 76
77 @GetMapping("/export-excel") 77 @GetMapping("/export-excel")
78 @Operation(summary = "导出回款管理 Excel") 78 @Operation(summary = "导出回款管理 Excel")
79 @PreAuthorize("@ss.hasPermission('crm:receivable:export')") 79 @PreAuthorize("@ss.hasPermission('crm:receivable:export')")
80 @OperateLog(type = EXPORT) 80 @OperateLog(type = EXPORT)
81 - public void exportReceivableExcel(@Valid ReceivableExportReqVO exportReqVO, 81 + public void exportReceivableExcel(@Valid CrmReceivableExportReqVO exportReqVO,
82 HttpServletResponse response) throws IOException { 82 HttpServletResponse response) throws IOException {
83 - List<ReceivableDO> list = receivableService.getReceivableList(exportReqVO); 83 + List<CrmReceivableDO> list = crmReceivableService.getReceivableList(exportReqVO);
84 // 导出 Excel 84 // 导出 Excel
85 - List<ReceivableExcelVO> datas = ReceivableConvert.INSTANCE.convertList02(list);  
86 - ExcelUtils.write(response, "回款管理.xls", "数据", ReceivableExcelVO.class, datas); 85 + List<CrmReceivableExcelVO> datas = CrmReceivableConvert.INSTANCE.convertList02(list);
  86 + ExcelUtils.write(response, "回款管理.xls", "数据", CrmReceivableExcelVO.class, datas);
87 } 87 }
88 88
89 } 89 }
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/ReceivablePlanController.java renamed to yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/CrmReceivablePlanController.java
@@ -5,9 +5,9 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; @@ -5,9 +5,9 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
5 import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; 5 import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
6 import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; 6 import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
7 import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*; 7 import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*;
8 -import cn.iocoder.yudao.module.crm.convert.receivable.ReceivablePlanConvert;  
9 -import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivablePlanDO;  
10 -import cn.iocoder.yudao.module.crm.service.receivable.ReceivablePlanService; 8 +import cn.iocoder.yudao.module.crm.convert.receivable.CrmReceivablePlanConvert;
  9 +import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.CrmReceivablePlanDO;
  10 +import cn.iocoder.yudao.module.crm.service.receivable.CrmReceivablePlanService;
11 import io.swagger.v3.oas.annotations.Operation; 11 import io.swagger.v3.oas.annotations.Operation;
12 import io.swagger.v3.oas.annotations.Parameter; 12 import io.swagger.v3.oas.annotations.Parameter;
13 import io.swagger.v3.oas.annotations.tags.Tag; 13 import io.swagger.v3.oas.annotations.tags.Tag;
@@ -28,23 +28,23 @@ import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.E @@ -28,23 +28,23 @@ import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.E
28 @RestController 28 @RestController
29 @RequestMapping("/crm/receivable-plan") 29 @RequestMapping("/crm/receivable-plan")
30 @Validated 30 @Validated
31 -public class ReceivablePlanController { 31 +public class CrmReceivablePlanController {
32 32
33 @Resource 33 @Resource
34 - private ReceivablePlanService receivablePlanService; 34 + private CrmReceivablePlanService crmReceivablePlanService;
35 35
36 @PostMapping("/create") 36 @PostMapping("/create")
37 @Operation(summary = "创建回款计划") 37 @Operation(summary = "创建回款计划")
38 @PreAuthorize("@ss.hasPermission('crm:receivable-plan:create')") 38 @PreAuthorize("@ss.hasPermission('crm:receivable-plan:create')")
39 - public CommonResult<Long> createReceivablePlan(@Valid @RequestBody ReceivablePlanCreateReqVO createReqVO) {  
40 - return success(receivablePlanService.createReceivablePlan(createReqVO)); 39 + public CommonResult<Long> createReceivablePlan(@Valid @RequestBody CrmReceivablePlanCreateReqVO createReqVO) {
  40 + return success(crmReceivablePlanService.createReceivablePlan(createReqVO));
41 } 41 }
42 42
43 @PutMapping("/update") 43 @PutMapping("/update")
44 @Operation(summary = "更新回款计划") 44 @Operation(summary = "更新回款计划")
45 @PreAuthorize("@ss.hasPermission('crm:receivable-plan:update')") 45 @PreAuthorize("@ss.hasPermission('crm:receivable-plan:update')")
46 - public CommonResult<Boolean> updateReceivablePlan(@Valid @RequestBody ReceivablePlanUpdateReqVO updateReqVO) {  
47 - receivablePlanService.updateReceivablePlan(updateReqVO); 46 + public CommonResult<Boolean> updateReceivablePlan(@Valid @RequestBody CrmReceivablePlanUpdateReqVO updateReqVO) {
  47 + crmReceivablePlanService.updateReceivablePlan(updateReqVO);
48 return success(true); 48 return success(true);
49 } 49 }
50 50
@@ -53,7 +53,7 @@ public class ReceivablePlanController { @@ -53,7 +53,7 @@ public class ReceivablePlanController {
53 @Parameter(name = "id", description = "编号", required = true) 53 @Parameter(name = "id", description = "编号", required = true)
54 @PreAuthorize("@ss.hasPermission('crm:receivable-plan:delete')") 54 @PreAuthorize("@ss.hasPermission('crm:receivable-plan:delete')")
55 public CommonResult<Boolean> deleteReceivablePlan(@RequestParam("id") Long id) { 55 public CommonResult<Boolean> deleteReceivablePlan(@RequestParam("id") Long id) {
56 - receivablePlanService.deleteReceivablePlan(id); 56 + crmReceivablePlanService.deleteReceivablePlan(id);
57 return success(true); 57 return success(true);
58 } 58 }
59 59
@@ -61,29 +61,29 @@ public class ReceivablePlanController { @@ -61,29 +61,29 @@ public class ReceivablePlanController {
61 @Operation(summary = "获得回款计划") 61 @Operation(summary = "获得回款计划")
62 @Parameter(name = "id", description = "编号", required = true, example = "1024") 62 @Parameter(name = "id", description = "编号", required = true, example = "1024")
63 @PreAuthorize("@ss.hasPermission('crm:receivable-plan:query')") 63 @PreAuthorize("@ss.hasPermission('crm:receivable-plan:query')")
64 - public CommonResult<ReceivablePlanRespVO> getReceivablePlan(@RequestParam("id") Long id) {  
65 - ReceivablePlanDO receivablePlan = receivablePlanService.getReceivablePlan(id);  
66 - return success(ReceivablePlanConvert.INSTANCE.convert(receivablePlan)); 64 + public CommonResult<CrmReceivablePlanRespVO> getReceivablePlan(@RequestParam("id") Long id) {
  65 + CrmReceivablePlanDO receivablePlan = crmReceivablePlanService.getReceivablePlan(id);
  66 + return success(CrmReceivablePlanConvert.INSTANCE.convert(receivablePlan));
67 } 67 }
68 68
69 @GetMapping("/page") 69 @GetMapping("/page")
70 @Operation(summary = "获得回款计划分页") 70 @Operation(summary = "获得回款计划分页")
71 @PreAuthorize("@ss.hasPermission('crm:receivable-plan:query')") 71 @PreAuthorize("@ss.hasPermission('crm:receivable-plan:query')")
72 - public CommonResult<PageResult<ReceivablePlanRespVO>> getReceivablePlanPage(@Valid ReceivablePlanPageReqVO pageVO) {  
73 - PageResult<ReceivablePlanDO> pageResult = receivablePlanService.getReceivablePlanPage(pageVO);  
74 - return success(ReceivablePlanConvert.INSTANCE.convertPage(pageResult)); 72 + public CommonResult<PageResult<CrmReceivablePlanRespVO>> getReceivablePlanPage(@Valid CrmReceivablePlanPageReqVO pageVO) {
  73 + PageResult<CrmReceivablePlanDO> pageResult = crmReceivablePlanService.getReceivablePlanPage(pageVO);
  74 + return success(CrmReceivablePlanConvert.INSTANCE.convertPage(pageResult));
75 } 75 }
76 76
77 @GetMapping("/export-excel") 77 @GetMapping("/export-excel")
78 @Operation(summary = "导出回款计划 Excel") 78 @Operation(summary = "导出回款计划 Excel")
79 @PreAuthorize("@ss.hasPermission('crm:receivable-plan:export')") 79 @PreAuthorize("@ss.hasPermission('crm:receivable-plan:export')")
80 @OperateLog(type = EXPORT) 80 @OperateLog(type = EXPORT)
81 - public void exportReceivablePlanExcel(@Valid ReceivablePlanExportReqVO exportReqVO, 81 + public void exportReceivablePlanExcel(@Valid CrmReceivablePlanExportReqVO exportReqVO,
82 HttpServletResponse response) throws IOException { 82 HttpServletResponse response) throws IOException {
83 - List<ReceivablePlanDO> list = receivablePlanService.getReceivablePlanList(exportReqVO); 83 + List<CrmReceivablePlanDO> list = crmReceivablePlanService.getReceivablePlanList(exportReqVO);
84 // 导出 Excel 84 // 导出 Excel
85 - List<ReceivablePlanExcelVO> datas = ReceivablePlanConvert.INSTANCE.convertList02(list);  
86 - ExcelUtils.write(response, "回款计划.xls", "数据", ReceivablePlanExcelVO.class, datas); 85 + List<CrmReceivablePlanExcelVO> datas = CrmReceivablePlanConvert.INSTANCE.convertList02(list);
  86 + ExcelUtils.write(response, "回款计划.xls", "数据", CrmReceivablePlanExcelVO.class, datas);
87 } 87 }
88 88
89 } 89 }
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableBaseVO.java renamed to yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivableBaseVO.java
1 package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; 1 package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo;
2 2
  3 +import cn.iocoder.yudao.framework.common.validation.InEnum;
  4 +import cn.iocoder.yudao.module.crm.enums.AuditStatusEnum;
3 import io.swagger.v3.oas.annotations.media.Schema; 5 import io.swagger.v3.oas.annotations.media.Schema;
4 import lombok.Data; 6 import lombok.Data;
5 import org.springframework.format.annotation.DateTimeFormat; 7 import org.springframework.format.annotation.DateTimeFormat;
6 8
7 -import javax.validation.constraints.NotNull;  
8 -import java.math.BigDecimal;  
9 import java.time.LocalDateTime; 9 import java.time.LocalDateTime;
10 10
11 import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; 11 import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@@ -15,33 +15,24 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ @@ -15,33 +15,24 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
15 * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 15 * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
16 */ 16 */
17 @Data 17 @Data
18 -public class ReceivableBaseVO { 18 +public class CrmReceivableBaseVO {
19 19
20 - // TODO @liuhongfeng:部分缺少 example 的字段,要补充下;  
21 - // TODO @liuhongfeng:部分字段,需要必传,要写 requiredMode = Schema.RequiredMode.REQUIRED,以及对应的 validator 非空校验  
22 -  
23 - @Schema(description = "回款编号") 20 + @Schema(description = "回款编号",requiredMode = Schema.RequiredMode.REQUIRED, example = "31177")
24 private String no; 21 private String no;
25 22
26 - // TODO @liuhongfeng:中英文之间,有个空格,这样更干净;  
27 - @Schema(description = "回款计划ID", example = "31177") 23 + @Schema(description = "回款计划", example = "31177")
28 private Long planId; 24 private Long planId;
29 25
30 - @Schema(description = "客户ID", example = "4963") 26 + @Schema(description = "客户名称", example = "4963")
31 private Long customerId; 27 private Long customerId;
32 28
33 - @Schema(description = "合同ID", example = "30305") 29 + @Schema(description = "合同名称", example = "30305")
34 private Long contractId; 30 private Long contractId;
35 31
36 - // TODO @liuhongfeng:这个字段,可以写个枚举,然后 InEnum 去校验下;  
37 - // TODO @liuhongfeng:这个字段,应该不是前端传递的噢,而是后端自己生成的  
38 @Schema(description = "审批状态", example = "1") 32 @Schema(description = "审批状态", example = "1")
  33 + @InEnum(AuditStatusEnum.class)
39 private Integer checkStatus; 34 private Integer checkStatus;
40 35
41 - // TODO @liuhongfeng:这个字段,应该不是前端传递的噢,而是后端自己生成的,所以不适合放在 base 里面;  
42 - @Schema(description = "工作流编号", example = "16568")  
43 - private Long processInstanceId;  
44 -  
45 @Schema(description = "回款日期") 36 @Schema(description = "回款日期")
46 @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) 37 @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
47 private LocalDateTime returnTime; 38 private LocalDateTime returnTime;
@@ -49,9 +40,8 @@ public class ReceivableBaseVO { @@ -49,9 +40,8 @@ public class ReceivableBaseVO {
49 @Schema(description = "回款方式", example = "2") 40 @Schema(description = "回款方式", example = "2")
50 private String returnType; 41 private String returnType;
51 42
52 - // TODO @liuhongfeng:使用 Int 哈,分;  
53 @Schema(description = "回款金额", example = "31859") 43 @Schema(description = "回款金额", example = "31859")
54 - private BigDecimal price; 44 + private Integer price;
55 45
56 @Schema(description = "负责人", example = "22202") 46 @Schema(description = "负责人", example = "22202")
57 private Long ownerUserId; 47 private Long ownerUserId;
@@ -62,19 +52,10 @@ public class ReceivableBaseVO { @@ -62,19 +52,10 @@ public class ReceivableBaseVO {
62 @Schema(description = "显示顺序") 52 @Schema(description = "显示顺序")
63 private Integer sort; 53 private Integer sort;
64 54
65 - // TODO @芋艿:这个字段在看看;dataScope、dataScopeDeptIds  
66 - @Schema(description = "数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)")  
67 - private Integer dataScope;  
68 -  
69 - @Schema(description = "数据范围(指定部门数组)")  
70 - private String dataScopeDeptIds; 55 + @Schema(description = "备注", example = "备注")
  56 + private String remark;
71 57
72 - // TODO @liuhongfeng:这个字段,这个字段,应该不是前端传递的噢,而是后端自己生成的,所以不适合放在 base 里面;  
73 - @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")  
74 - @NotNull(message = "状态不能为空") 58 + @Schema(description = "完成状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
75 private Integer status; 59 private Integer status;
76 60
77 - @Schema(description = "备注", example = "随便")  
78 - private String remark;  
79 -  
80 } 61 }
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableCreateReqVO.java renamed to yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivableCreateReqVO.java
1 package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; 1 package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo;
2 2
3 import lombok.*; 3 import lombok.*;
4 -import java.util.*;  
5 import io.swagger.v3.oas.annotations.media.Schema; 4 import io.swagger.v3.oas.annotations.media.Schema;
6 -import javax.validation.constraints.*;  
7 5
8 @Schema(description = "管理后台 - CRM 回款创建 Request VO") 6 @Schema(description = "管理后台 - CRM 回款创建 Request VO")
9 @Data 7 @Data
10 @EqualsAndHashCode(callSuper = true) 8 @EqualsAndHashCode(callSuper = true)
11 @ToString(callSuper = true) 9 @ToString(callSuper = true)
12 -public class ReceivableCreateReqVO extends ReceivableBaseVO { 10 +public class CrmReceivableCreateReqVO extends CrmReceivableBaseVO {
13 11
14 } 12 }
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableExcelVO.java renamed to yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivableExcelVO.java
1 package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; 1 package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo;
2 2
3 -import io.swagger.v3.oas.annotations.media.Schema; 3 +import cn.iocoder.yudao.module.system.enums.DictTypeConstants;
4 import lombok.*; 4 import lombok.*;
5 -import java.util.*;  
6 -import java.time.LocalDateTime;  
7 -import java.math.BigDecimal;  
8 -import java.time.LocalDateTime; 5 +
9 import java.time.LocalDateTime; 6 import java.time.LocalDateTime;
10 7
11 import com.alibaba.excel.annotation.ExcelProperty; 8 import com.alibaba.excel.annotation.ExcelProperty;
@@ -19,7 +16,7 @@ import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; @@ -19,7 +16,7 @@ import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
19 * @author 赤焰 16 * @author 赤焰
20 */ 17 */
21 @Data 18 @Data
22 -public class ReceivableExcelVO { 19 +public class CrmReceivableExcelVO {
23 20
24 @ExcelProperty("ID") 21 @ExcelProperty("ID")
25 private Long id; 22 private Long id;
@@ -30,14 +27,14 @@ public class ReceivableExcelVO { @@ -30,14 +27,14 @@ public class ReceivableExcelVO {
30 @ExcelProperty("回款计划ID") 27 @ExcelProperty("回款计划ID")
31 private Long planId; 28 private Long planId;
32 29
33 - @ExcelProperty("客户ID") 30 + @ExcelProperty("客户名称")
34 private Long customerId; 31 private Long customerId;
35 32
36 - @ExcelProperty("合同ID") 33 + @ExcelProperty("合同名称")
37 private Long contractId; 34 private Long contractId;
38 35
39 @ExcelProperty(value = "审批状态", converter = DictConvert.class) 36 @ExcelProperty(value = "审批状态", converter = DictConvert.class)
40 - @DictFormat("crm_receivable_check_status") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中 37 + @DictFormat(cn.iocoder.yudao.module.crm.enums.DictTypeConstants.CRM_RECEIVABLE_CHECK_STATUS)
41 private Integer checkStatus; 38 private Integer checkStatus;
42 39
43 @ExcelProperty("工作流编号") 40 @ExcelProperty("工作流编号")
@@ -50,7 +47,7 @@ public class ReceivableExcelVO { @@ -50,7 +47,7 @@ public class ReceivableExcelVO {
50 private String returnType; 47 private String returnType;
51 48
52 @ExcelProperty("回款金额") 49 @ExcelProperty("回款金额")
53 - private BigDecimal price; 50 + private Integer price;
54 51
55 @ExcelProperty("负责人") 52 @ExcelProperty("负责人")
56 private Long ownerUserId; 53 private Long ownerUserId;
@@ -58,17 +55,8 @@ public class ReceivableExcelVO { @@ -58,17 +55,8 @@ public class ReceivableExcelVO {
58 @ExcelProperty("批次") 55 @ExcelProperty("批次")
59 private Long batchId; 56 private Long batchId;
60 57
61 - //@ExcelProperty("显示顺序")  
62 - //private Integer sort;  
63 -  
64 - //@ExcelProperty("数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)")  
65 - //private Integer dataScope;  
66 -  
67 - //@ExcelProperty("数据范围(指定部门数组)")  
68 - //private String dataScopeDeptIds;  
69 -  
70 @ExcelProperty(value = "状态", converter = DictConvert.class) 58 @ExcelProperty(value = "状态", converter = DictConvert.class)
71 - @DictFormat("common_status") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中 59 + @DictFormat(DictTypeConstants.COMMON_STATUS)
72 private Integer status; 60 private Integer status;
73 61
74 @ExcelProperty("备注") 62 @ExcelProperty("备注")
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableExportReqVO.java renamed to yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivableExportReqVO.java
@@ -4,7 +4,6 @@ import io.swagger.v3.oas.annotations.media.Schema; @@ -4,7 +4,6 @@ import io.swagger.v3.oas.annotations.media.Schema;
4 import lombok.Data; 4 import lombok.Data;
5 import org.springframework.format.annotation.DateTimeFormat; 5 import org.springframework.format.annotation.DateTimeFormat;
6 6
7 -import java.math.BigDecimal;  
8 import java.time.LocalDateTime; 7 import java.time.LocalDateTime;
9 8
10 import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; 9 import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@@ -12,28 +11,25 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ @@ -12,28 +11,25 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
12 /** 11 /**
13 * @author 赤焰 12 * @author 赤焰
14 */ 13 */
15 -@Schema(description = "管理后台 - CRM 回款 Excel 导出 Request VO,参数和 ReceivablePageReqVO 是一致的") 14 +@Schema(description = "管理后台 - CRM 回款 Excel 导出 Request VO,参数和 CrmReceivablePageReqVO 是一致的")
16 @Data 15 @Data
17 -public class ReceivableExportReqVO { 16 +public class CrmReceivableExportReqVO {
18 17
19 @Schema(description = "回款编号") 18 @Schema(description = "回款编号")
20 private String no; 19 private String no;
21 20
22 - @Schema(description = "回款计划ID", example = "31177") 21 + @Schema(description = "回款计划", example = "31177")
23 private Long planId; 22 private Long planId;
24 23
25 - @Schema(description = "客户ID", example = "4963") 24 + @Schema(description = "客户名称", example = "4963")
26 private Long customerId; 25 private Long customerId;
27 26
28 - @Schema(description = "合同ID", example = "30305") 27 + @Schema(description = "合同名称", example = "30305")
29 private Long contractId; 28 private Long contractId;
30 29
31 @Schema(description = "审批状态", example = "1") 30 @Schema(description = "审批状态", example = "1")
32 private Integer checkStatus; 31 private Integer checkStatus;
33 32
34 - @Schema(description = "工作流编号", example = "16568")  
35 - private Long processInstanceId;  
36 -  
37 @Schema(description = "回款日期") 33 @Schema(description = "回款日期")
38 @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) 34 @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
39 private LocalDateTime[] returnTime; 35 private LocalDateTime[] returnTime;
@@ -42,7 +38,7 @@ public class ReceivableExportReqVO { @@ -42,7 +38,7 @@ public class ReceivableExportReqVO {
42 private String returnType; 38 private String returnType;
43 39
44 @Schema(description = "回款金额", example = "31859") 40 @Schema(description = "回款金额", example = "31859")
45 - private BigDecimal price; 41 + private Integer price;
46 42
47 @Schema(description = "负责人", example = "22202") 43 @Schema(description = "负责人", example = "22202")
48 private Long ownerUserId; 44 private Long ownerUserId;
@@ -50,15 +46,6 @@ public class ReceivableExportReqVO { @@ -50,15 +46,6 @@ public class ReceivableExportReqVO {
50 @Schema(description = "批次", example = "2539") 46 @Schema(description = "批次", example = "2539")
51 private Long batchId; 47 private Long batchId;
52 48
53 - @Schema(description = "显示顺序")  
54 - private Integer sort;  
55 -  
56 - @Schema(description = "数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)")  
57 - private Integer dataScope;  
58 -  
59 - @Schema(description = "数据范围(指定部门数组)")  
60 - private String dataScopeDeptIds;  
61 -  
62 @Schema(description = "状态", example = "1") 49 @Schema(description = "状态", example = "1")
63 private Integer status; 50 private Integer status;
64 51
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePageReqVO.java renamed to yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePageReqVO.java
@@ -7,7 +7,6 @@ import lombok.EqualsAndHashCode; @@ -7,7 +7,6 @@ import lombok.EqualsAndHashCode;
7 import lombok.ToString; 7 import lombok.ToString;
8 import org.springframework.format.annotation.DateTimeFormat; 8 import org.springframework.format.annotation.DateTimeFormat;
9 9
10 -import java.math.BigDecimal;  
11 import java.time.LocalDateTime; 10 import java.time.LocalDateTime;
12 11
13 import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; 12 import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@@ -16,27 +15,23 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ @@ -16,27 +15,23 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
16 @Data 15 @Data
17 @EqualsAndHashCode(callSuper = true) 16 @EqualsAndHashCode(callSuper = true)
18 @ToString(callSuper = true) 17 @ToString(callSuper = true)
19 -public class ReceivablePageReqVO extends PageParam { 18 +public class CrmReceivablePageReqVO extends PageParam {
20 19
21 - // TODO @liuhongfeng:目前就使用 no 检索即可;  
22 @Schema(description = "回款编号") 20 @Schema(description = "回款编号")
23 private String no; 21 private String no;
24 22
25 @Schema(description = "回款计划ID", example = "31177") 23 @Schema(description = "回款计划ID", example = "31177")
26 private Long planId; 24 private Long planId;
27 25
28 - @Schema(description = "客户ID", example = "4963") 26 + @Schema(description = "客户名称", example = "4963")
29 private Long customerId; 27 private Long customerId;
30 28
31 - @Schema(description = "合同ID", example = "30305") 29 + @Schema(description = "合同名称", example = "30305")
32 private Long contractId; 30 private Long contractId;
33 31
34 @Schema(description = "审批状态", example = "1") 32 @Schema(description = "审批状态", example = "1")
35 private Integer checkStatus; 33 private Integer checkStatus;
36 34
37 - @Schema(description = "工作流编号", example = "16568")  
38 - private Long processInstanceId;  
39 -  
40 @Schema(description = "回款日期") 35 @Schema(description = "回款日期")
41 @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) 36 @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
42 private LocalDateTime[] returnTime; 37 private LocalDateTime[] returnTime;
@@ -45,29 +40,15 @@ public class ReceivablePageReqVO extends PageParam { @@ -45,29 +40,15 @@ public class ReceivablePageReqVO extends PageParam {
45 private String returnType; 40 private String returnType;
46 41
47 @Schema(description = "回款金额", example = "31859") 42 @Schema(description = "回款金额", example = "31859")
48 - private BigDecimal price; 43 + private Integer price;
49 44
50 @Schema(description = "负责人", example = "22202") 45 @Schema(description = "负责人", example = "22202")
51 private Long ownerUserId; 46 private Long ownerUserId;
52 47
53 - @Schema(description = "批次", example = "2539")  
54 - private Long batchId;  
55 -  
56 - @Schema(description = "显示顺序")  
57 - private Integer sort;  
58 -  
59 - @Schema(description = "数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)")  
60 - private Integer dataScope;  
61 -  
62 - @Schema(description = "数据范围(指定部门数组)")  
63 - private String dataScopeDeptIds;  
64 48
65 @Schema(description = "状态", example = "1") 49 @Schema(description = "状态", example = "1")
66 private Integer status; 50 private Integer status;
67 51
68 - @Schema(description = "备注", example = "随便")  
69 - private String remark;  
70 -  
71 @Schema(description = "创建时间") 52 @Schema(description = "创建时间")
72 @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) 53 @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
73 private LocalDateTime[] createTime; 54 private LocalDateTime[] createTime;
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanBaseVO.java renamed to yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanBaseVO.java
1 package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; 1 package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo;
2 2
  3 +import cn.iocoder.yudao.framework.common.validation.InEnum;
  4 +import cn.iocoder.yudao.module.crm.enums.AuditStatusEnum;
3 import io.swagger.v3.oas.annotations.media.Schema; 5 import io.swagger.v3.oas.annotations.media.Schema;
4 import lombok.Data; 6 import lombok.Data;
5 import org.springframework.format.annotation.DateTimeFormat; 7 import org.springframework.format.annotation.DateTimeFormat;
6 8
7 -import java.math.BigDecimal;  
8 import java.time.LocalDateTime; 9 import java.time.LocalDateTime;
9 10
10 import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; 11 import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@@ -14,59 +15,48 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ @@ -14,59 +15,48 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
14 * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 15 * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
15 */ 16 */
16 @Data 17 @Data
17 -public class ReceivablePlanBaseVO { 18 +public class CrmReceivablePlanBaseVO {
18 19
19 - // TODO 芋艿:这个字段,在想想命名;  
20 - @Schema(description = "期数")  
21 - private Long indexNo; 20 + @Schema(description = "期数", example = "1")
  21 + private Integer period;
22 22
23 - // TODO @liuhongfeng:中英文之间,有个空格,这样更干净;  
24 - @Schema(description = "回款ID", example = "19852") 23 + @Schema(description = "回款计划", example = "19852")
25 private Long receivableId; 24 private Long receivableId;
26 25
27 @Schema(description = "完成状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") 26 @Schema(description = "完成状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
28 - //@NotNull(message = "完成状态不能为空")  
29 private Integer status; 27 private Integer status;
30 28
31 - // TODO @liuhongfeng:这个字段,可以写个枚举,然后 InEnum 去校验下;  
32 - // TODO @liuhongfeng:这个字段,应该不是前端传递的噢,而是后端自己生成的  
33 @Schema(description = "审批状态", example = "1") 29 @Schema(description = "审批状态", example = "1")
34 - private String checkStatus; 30 + @InEnum(AuditStatusEnum.class)
  31 + private Integer checkStatus;
35 32
36 - // TODO @liuhongfeng:这个字段,应该不是前端传递的噢,而是后端自己生成的,所以不适合放在 base 里面;  
37 - @Schema(description = "工作流编号", example = "8909")  
38 - private Long processInstanceId;  
39 -  
40 - // TODO @liuhongfeng:使用 Int 哈,分;  
41 @Schema(description = "计划回款金额", example = "29675") 33 @Schema(description = "计划回款金额", example = "29675")
42 - private BigDecimal price; 34 + private Integer price;
43 35
44 @Schema(description = "计划回款日期") 36 @Schema(description = "计划回款日期")
45 @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) 37 @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
46 private LocalDateTime returnTime; 38 private LocalDateTime returnTime;
47 39
48 - // TODO @liuhongfeng:这个字段,Integer  
49 @Schema(description = "提前几天提醒") 40 @Schema(description = "提前几天提醒")
50 - private Long remindDays; 41 + private Integer remindDays;
51 42
52 @Schema(description = "提醒日期") 43 @Schema(description = "提醒日期")
53 @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) 44 @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
54 private LocalDateTime remindTime; 45 private LocalDateTime remindTime;
55 46
56 - @Schema(description = "客户ID", example = "18026") 47 + @Schema(description = "客户名称", example = "18026")
57 private Long customerId; 48 private Long customerId;
58 49
59 - @Schema(description = "合同ID", example = "3473") 50 + @Schema(description = "合同名称", example = "3473")
60 private Long contractId; 51 private Long contractId;
61 52
62 - // TODO @liuhongfeng:这个字段,应该不是前端传递的噢,而是后端自己生成的,所以不适合放在 base 里面;  
63 @Schema(description = "负责人", example = "17828") 53 @Schema(description = "负责人", example = "17828")
64 private Long ownerUserId; 54 private Long ownerUserId;
65 55
66 @Schema(description = "显示顺序") 56 @Schema(description = "显示顺序")
67 private Integer sort; 57 private Integer sort;
68 58
69 - @Schema(description = "备注", example = "随便") 59 + @Schema(description = "备注", example = "备注")
70 private String remark; 60 private String remark;
71 61
72 } 62 }
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanCreateReqVO.java renamed to yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanCreateReqVO.java
1 package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; 1 package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo;
2 2
3 import lombok.*; 3 import lombok.*;
4 -import java.util.*;  
5 import io.swagger.v3.oas.annotations.media.Schema; 4 import io.swagger.v3.oas.annotations.media.Schema;
6 -import javax.validation.constraints.*;  
7 5
8 @Schema(description = "管理后台 - CRM 回款计划创建 Request VO") 6 @Schema(description = "管理后台 - CRM 回款计划创建 Request VO")
9 @Data 7 @Data
10 @EqualsAndHashCode(callSuper = true) 8 @EqualsAndHashCode(callSuper = true)
11 @ToString(callSuper = true) 9 @ToString(callSuper = true)
12 -public class ReceivablePlanCreateReqVO extends ReceivablePlanBaseVO { 10 +public class CrmReceivablePlanCreateReqVO extends CrmReceivablePlanBaseVO {
13 11
14 } 12 }
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanExcelVO.java renamed to yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanExcelVO.java
1 package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; 1 package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo;
2 2
  3 +import cn.iocoder.yudao.module.system.enums.DictTypeConstants;
3 import lombok.*; 4 import lombok.*;
4 5
5 -import java.math.BigDecimal;  
6 import java.time.LocalDateTime; 6 import java.time.LocalDateTime;
7 7
8 import com.alibaba.excel.annotation.ExcelProperty; 8 import com.alibaba.excel.annotation.ExcelProperty;
@@ -16,36 +16,36 @@ import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; @@ -16,36 +16,36 @@ import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
16 * @author 芋道源码 16 * @author 芋道源码
17 */ 17 */
18 @Data 18 @Data
19 -public class ReceivablePlanExcelVO { 19 +public class CrmReceivablePlanExcelVO {
20 20
21 @ExcelProperty("ID") 21 @ExcelProperty("ID")
22 private Long id; 22 private Long id;
23 23
24 @ExcelProperty("期数") 24 @ExcelProperty("期数")
25 - private Long indexNo; 25 + private Integer period;
26 26
27 @ExcelProperty("回款ID") 27 @ExcelProperty("回款ID")
28 private Long receivableId; 28 private Long receivableId;
29 29
30 - @ExcelProperty(value = "完成状态", converter = DictConvert.class)  
31 - @DictFormat("common_status") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中 30 + @ExcelProperty(value = "状态", converter = DictConvert.class)
  31 + @DictFormat(DictTypeConstants.COMMON_STATUS)
32 private Integer status; 32 private Integer status;
33 33
34 @ExcelProperty(value = "审批状态", converter = DictConvert.class) 34 @ExcelProperty(value = "审批状态", converter = DictConvert.class)
35 - @DictFormat("crm_receivable_check_status") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中  
36 - private String checkStatus; 35 + @DictFormat(cn.iocoder.yudao.module.crm.enums.DictTypeConstants.CRM_RECEIVABLE_CHECK_STATUS)
  36 + private Integer checkStatus;
37 37
38 //@ExcelProperty("工作流编号") 38 //@ExcelProperty("工作流编号")
39 //private Long processInstanceId; 39 //private Long processInstanceId;
40 40
41 @ExcelProperty("计划回款金额") 41 @ExcelProperty("计划回款金额")
42 - private BigDecimal price; 42 + private Integer price;
43 43
44 @ExcelProperty("计划回款日期") 44 @ExcelProperty("计划回款日期")
45 private LocalDateTime returnTime; 45 private LocalDateTime returnTime;
46 46
47 @ExcelProperty("提前几天提醒") 47 @ExcelProperty("提前几天提醒")
48 - private Long remindDays; 48 + private Integer remindDays;
49 49
50 @ExcelProperty("提醒日期") 50 @ExcelProperty("提醒日期")
51 private LocalDateTime remindTime; 51 private LocalDateTime remindTime;
@@ -53,7 +53,7 @@ public class ReceivablePlanExcelVO { @@ -53,7 +53,7 @@ public class ReceivablePlanExcelVO {
53 @ExcelProperty("客户ID") 53 @ExcelProperty("客户ID")
54 private Long customerId; 54 private Long customerId;
55 55
56 - @ExcelProperty("合同ID") 56 + @ExcelProperty("合同名称")
57 private Long contractId; 57 private Long contractId;
58 58
59 @ExcelProperty("负责人") 59 @ExcelProperty("负责人")
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanExportReqVO.java renamed to yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanExportReqVO.java
1 package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; 1 package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo;
2 2
3 import lombok.*; 3 import lombok.*;
4 -import java.util.*;  
5 import io.swagger.v3.oas.annotations.media.Schema; 4 import io.swagger.v3.oas.annotations.media.Schema;
6 -import cn.iocoder.yudao.framework.common.pojo.PageParam; 5 +
7 import java.time.LocalDateTime; 6 import java.time.LocalDateTime;
8 import org.springframework.format.annotation.DateTimeFormat; 7 import org.springframework.format.annotation.DateTimeFormat;
9 8
10 import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; 9 import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
11 10
12 -@Schema(description = "管理后台 - CRM 回款计划 Excel 导出 Request VO,参数和 ReceivablePlanPageReqVO 是一致的") 11 +@Schema(description = "管理后台 - CRM 回款计划 Excel 导出 Request VO,参数和 CrmReceivablePlanPageReqVO 是一致的")
13 @Data 12 @Data
14 -public class ReceivablePlanExportReqVO { 13 +public class CrmReceivablePlanExportReqVO {
15 14
16 @Schema(description = "期数") 15 @Schema(description = "期数")
17 - private Long indexNo; 16 + private Integer period;
18 17
19 @Schema(description = "完成状态", example = "2") 18 @Schema(description = "完成状态", example = "2")
20 private Integer status; 19 private Integer status;
21 20
22 @Schema(description = "审批状态", example = "1") 21 @Schema(description = "审批状态", example = "1")
23 - private String checkStatus; 22 + private Integer checkStatus;
24 23
25 @Schema(description = "计划回款日期") 24 @Schema(description = "计划回款日期")
26 @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) 25 @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
27 private LocalDateTime[] returnTime; 26 private LocalDateTime[] returnTime;
28 27
29 @Schema(description = "提前几天提醒") 28 @Schema(description = "提前几天提醒")
30 - private Long remindDays; 29 + private Integer remindDays;
31 30
32 @Schema(description = "提醒日期") 31 @Schema(description = "提醒日期")
33 @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) 32 @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
34 private LocalDateTime[] remindTime; 33 private LocalDateTime[] remindTime;
35 34
36 - @Schema(description = "客户ID", example = "18026") 35 + @Schema(description = "客户名称", example = "18026")
37 private Long customerId; 36 private Long customerId;
38 37
39 - @Schema(description = "合同ID", example = "3473") 38 + @Schema(description = "合同名称", example = "3473")
40 private Long contractId; 39 private Long contractId;
41 40
42 @Schema(description = "负责人", example = "17828") 41 @Schema(description = "负责人", example = "17828")
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanPageReqVO.java renamed to yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanPageReqVO.java
@@ -15,42 +15,31 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ @@ -15,42 +15,31 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
15 @Data 15 @Data
16 @EqualsAndHashCode(callSuper = true) 16 @EqualsAndHashCode(callSuper = true)
17 @ToString(callSuper = true) 17 @ToString(callSuper = true)
18 -public class ReceivablePlanPageReqVO extends PageParam {  
19 -  
20 - // TODO 芋艿:筛选字段,需要去掉几个,在想想;  
21 -  
22 - @Schema(description = "期数")  
23 - private Long indexNo; 18 +public class CrmReceivablePlanPageReqVO extends PageParam {
24 19
25 @Schema(description = "完成状态", example = "2") 20 @Schema(description = "完成状态", example = "2")
26 private Integer status; 21 private Integer status;
27 22
28 @Schema(description = "审批状态", example = "1") 23 @Schema(description = "审批状态", example = "1")
29 - private String checkStatus; 24 + private Integer checkStatus;
30 25
31 @Schema(description = "计划回款日期") 26 @Schema(description = "计划回款日期")
32 @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) 27 @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
33 private LocalDateTime[] returnTime; 28 private LocalDateTime[] returnTime;
34 29
35 - @Schema(description = "提前几天提醒")  
36 - private Long remindDays;  
37 -  
38 @Schema(description = "提醒日期") 30 @Schema(description = "提醒日期")
39 @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) 31 @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
40 private LocalDateTime[] remindTime; 32 private LocalDateTime[] remindTime;
41 33
42 - @Schema(description = "客户ID", example = "18026") 34 + @Schema(description = "客户名称", example = "18026")
43 private Long customerId; 35 private Long customerId;
44 36
45 - @Schema(description = "合同ID", example = "3473") 37 + @Schema(description = "合同名称", example = "3473")
46 private Long contractId; 38 private Long contractId;
47 39
48 @Schema(description = "负责人", example = "17828") 40 @Schema(description = "负责人", example = "17828")
49 private Long ownerUserId; 41 private Long ownerUserId;
50 42
51 - @Schema(description = "备注", example = "随便")  
52 - private String remark;  
53 -  
54 @Schema(description = "创建时间") 43 @Schema(description = "创建时间")
55 @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) 44 @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
56 private LocalDateTime[] createTime; 45 private LocalDateTime[] createTime;
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanRespVO.java renamed to yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanRespVO.java
@@ -8,7 +8,7 @@ import java.time.LocalDateTime; @@ -8,7 +8,7 @@ import java.time.LocalDateTime;
8 @Data 8 @Data
9 @EqualsAndHashCode(callSuper = true) 9 @EqualsAndHashCode(callSuper = true)
10 @ToString(callSuper = true) 10 @ToString(callSuper = true)
11 -public class ReceivablePlanRespVO extends ReceivablePlanBaseVO { 11 +public class CrmReceivablePlanRespVO extends CrmReceivablePlanBaseVO {
12 12
13 @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25153") 13 @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25153")
14 private Long id; 14 private Long id;
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivablePlanUpdateReqVO.java renamed to yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivablePlanUpdateReqVO.java
@@ -2,14 +2,14 @@ package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; @@ -2,14 +2,14 @@ package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo;
2 2
3 import io.swagger.v3.oas.annotations.media.Schema; 3 import io.swagger.v3.oas.annotations.media.Schema;
4 import lombok.*; 4 import lombok.*;
5 -import java.util.*; 5 +
6 import javax.validation.constraints.*; 6 import javax.validation.constraints.*;
7 7
8 @Schema(description = "管理后台 - CRM 回款计划更新 Request VO") 8 @Schema(description = "管理后台 - CRM 回款计划更新 Request VO")
9 @Data 9 @Data
10 @EqualsAndHashCode(callSuper = true) 10 @EqualsAndHashCode(callSuper = true)
11 @ToString(callSuper = true) 11 @ToString(callSuper = true)
12 -public class ReceivablePlanUpdateReqVO extends ReceivablePlanBaseVO { 12 +public class CrmReceivablePlanUpdateReqVO extends CrmReceivablePlanBaseVO {
13 13
14 @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25153") 14 @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25153")
15 @NotNull(message = "ID不能为空") 15 @NotNull(message = "ID不能为空")
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableRespVO.java renamed to yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivableRespVO.java
@@ -8,7 +8,7 @@ import java.time.LocalDateTime; @@ -8,7 +8,7 @@ import java.time.LocalDateTime;
8 @Data 8 @Data
9 @EqualsAndHashCode(callSuper = true) 9 @EqualsAndHashCode(callSuper = true)
10 @ToString(callSuper = true) 10 @ToString(callSuper = true)
11 -public class ReceivableRespVO extends ReceivableBaseVO { 11 +public class CrmReceivableRespVO extends CrmReceivableBaseVO {
12 12
13 @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25787") 13 @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25787")
14 private Long id; 14 private Long id;
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/ReceivableUpdateReqVO.java renamed to yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/receivable/vo/CrmReceivableUpdateReqVO.java
@@ -2,14 +2,14 @@ package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo; @@ -2,14 +2,14 @@ package cn.iocoder.yudao.module.crm.controller.admin.receivable.vo;
2 2
3 import io.swagger.v3.oas.annotations.media.Schema; 3 import io.swagger.v3.oas.annotations.media.Schema;
4 import lombok.*; 4 import lombok.*;
5 -import java.util.*; 5 +
6 import javax.validation.constraints.*; 6 import javax.validation.constraints.*;
7 7
8 @Schema(description = "管理后台 - CRM 回款更新 Request VO") 8 @Schema(description = "管理后台 - CRM 回款更新 Request VO")
9 @Data 9 @Data
10 @EqualsAndHashCode(callSuper = true) 10 @EqualsAndHashCode(callSuper = true)
11 @ToString(callSuper = true) 11 @ToString(callSuper = true)
12 -public class ReceivableUpdateReqVO extends ReceivableBaseVO { 12 +public class CrmReceivableUpdateReqVO extends CrmReceivableBaseVO {
13 13
14 @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25787") 14 @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25787")
15 @NotNull(message = "ID不能为空") 15 @NotNull(message = "ID不能为空")
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/receivable/ReceivableConvert.java renamed to yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/receivable/CrmReceivableConvert.java
@@ -4,10 +4,10 @@ import java.util.*; @@ -4,10 +4,10 @@ import java.util.*;
4 4
5 import cn.iocoder.yudao.framework.common.pojo.PageResult; 5 import cn.iocoder.yudao.framework.common.pojo.PageResult;
6 6
  7 +import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.CrmReceivableDO;
7 import org.mapstruct.Mapper; 8 import org.mapstruct.Mapper;
8 import org.mapstruct.factory.Mappers; 9 import org.mapstruct.factory.Mappers;
9 import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*; 10 import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*;
10 -import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivableDO;  
11 11
12 /** 12 /**
13 * 回款管理 Convert 13 * 回款管理 Convert
@@ -15,20 +15,20 @@ import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivableDO; @@ -15,20 +15,20 @@ import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivableDO;
15 * @author 赤焰 15 * @author 赤焰
16 */ 16 */
17 @Mapper 17 @Mapper
18 -public interface ReceivableConvert { 18 +public interface CrmReceivableConvert {
19 19
20 - ReceivableConvert INSTANCE = Mappers.getMapper(ReceivableConvert.class); 20 + CrmReceivableConvert INSTANCE = Mappers.getMapper(CrmReceivableConvert.class);
21 21
22 - ReceivableDO convert(ReceivableCreateReqVO bean); 22 + CrmReceivableDO convert(CrmReceivableCreateReqVO bean);
23 23
24 - ReceivableDO convert(ReceivableUpdateReqVO bean); 24 + CrmReceivableDO convert(CrmReceivableUpdateReqVO bean);
25 25
26 - ReceivableRespVO convert(ReceivableDO bean); 26 + CrmReceivableRespVO convert(CrmReceivableDO bean);
27 27
28 - List<ReceivableRespVO> convertList(List<ReceivableDO> list); 28 + List<CrmReceivableRespVO> convertList(List<CrmReceivableDO> list);
29 29
30 - PageResult<ReceivableRespVO> convertPage(PageResult<ReceivableDO> page); 30 + PageResult<CrmReceivableRespVO> convertPage(PageResult<CrmReceivableDO> page);
31 31
32 - List<ReceivableExcelVO> convertList02(List<ReceivableDO> list); 32 + List<CrmReceivableExcelVO> convertList02(List<CrmReceivableDO> list);
33 33
34 } 34 }
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/receivable/ReceivablePlanConvert.java renamed to yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/receivable/CrmReceivablePlanConvert.java
@@ -4,10 +4,10 @@ import java.util.*; @@ -4,10 +4,10 @@ import java.util.*;
4 4
5 import cn.iocoder.yudao.framework.common.pojo.PageResult; 5 import cn.iocoder.yudao.framework.common.pojo.PageResult;
6 6
  7 +import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.CrmReceivablePlanDO;
7 import org.mapstruct.Mapper; 8 import org.mapstruct.Mapper;
8 import org.mapstruct.factory.Mappers; 9 import org.mapstruct.factory.Mappers;
9 import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*; 10 import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*;
10 -import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivablePlanDO;  
11 11
12 /** 12 /**
13 * 回款计划 Convert 13 * 回款计划 Convert
@@ -15,20 +15,20 @@ import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivablePlanDO; @@ -15,20 +15,20 @@ import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivablePlanDO;
15 * @author 芋道源码 15 * @author 芋道源码
16 */ 16 */
17 @Mapper 17 @Mapper
18 -public interface ReceivablePlanConvert { 18 +public interface CrmReceivablePlanConvert {
19 19
20 - ReceivablePlanConvert INSTANCE = Mappers.getMapper(ReceivablePlanConvert.class); 20 + CrmReceivablePlanConvert INSTANCE = Mappers.getMapper(CrmReceivablePlanConvert.class);
21 21
22 - ReceivablePlanDO convert(ReceivablePlanCreateReqVO bean); 22 + CrmReceivablePlanDO convert(CrmReceivablePlanCreateReqVO bean);
23 23
24 - ReceivablePlanDO convert(ReceivablePlanUpdateReqVO bean); 24 + CrmReceivablePlanDO convert(CrmReceivablePlanUpdateReqVO bean);
25 25
26 - ReceivablePlanRespVO convert(ReceivablePlanDO bean); 26 + CrmReceivablePlanRespVO convert(CrmReceivablePlanDO bean);
27 27
28 - List<ReceivablePlanRespVO> convertList(List<ReceivablePlanDO> list); 28 + List<CrmReceivablePlanRespVO> convertList(List<CrmReceivablePlanDO> list);
29 29
30 - PageResult<ReceivablePlanRespVO> convertPage(PageResult<ReceivablePlanDO> page); 30 + PageResult<CrmReceivablePlanRespVO> convertPage(PageResult<CrmReceivablePlanDO> page);
31 31
32 - List<ReceivablePlanExcelVO> convertList02(List<ReceivablePlanDO> list); 32 + List<CrmReceivablePlanExcelVO> convertList02(List<CrmReceivablePlanDO> list);
33 33
34 } 34 }
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/receivable/ReceivableDO.java renamed to yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/receivable/CrmReceivableDO.java
@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.annotation.TableId; @@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.annotation.TableId;
6 import com.baomidou.mybatisplus.annotation.TableName; 6 import com.baomidou.mybatisplus.annotation.TableName;
7 import lombok.*; 7 import lombok.*;
8 8
9 -import java.math.BigDecimal;  
10 import java.time.LocalDateTime; 9 import java.time.LocalDateTime;
11 10
12 /** 11 /**
@@ -22,7 +21,7 @@ import java.time.LocalDateTime; @@ -22,7 +21,7 @@ import java.time.LocalDateTime;
22 @Builder 21 @Builder
23 @NoArgsConstructor 22 @NoArgsConstructor
24 @AllArgsConstructor 23 @AllArgsConstructor
25 -public class ReceivableDO extends BaseDO { 24 +public class CrmReceivableDO extends BaseDO {
26 25
27 /** 26 /**
28 * ID 27 * ID
@@ -34,27 +33,26 @@ public class ReceivableDO extends BaseDO { @@ -34,27 +33,26 @@ public class ReceivableDO extends BaseDO {
34 */ 33 */
35 private String no; 34 private String no;
36 /** 35 /**
37 - * 回款计划ID 36 + * 回款计划
38 * 37 *
39 - * TODO @liuhongfeng:这个字段,后续要写下关联的实体哈 38 + * 对应实体 {@link CrmReceivablePlanDO}
40 */ 39 */
41 private Long planId; 40 private Long planId;
42 /** 41 /**
43 * 客户ID 42 * 客户ID
44 * 43 *
45 - * TODO @liuhongfeng:这个字段,后续要写下关联的实体哈 44 + * 对应实体 {@link cn.iocoder.yudao.module.crm.dal.dataobject.customer.CrmCustomerDO}
46 */ 45 */
47 private Long customerId; 46 private Long customerId;
48 /** 47 /**
49 * 合同ID 48 * 合同ID
50 * 49 *
51 - * TODO @liuhongfeng:这个字段,后续要写下关联的实体哈 50 + * 对应实体 {@link cn.iocoder.yudao.module.crm.dal.dataobject.contract.ContractDO}
52 */ 51 */
53 private Long contractId; 52 private Long contractId;
54 /** 53 /**
55 * 审批状态 54 * 审批状态
56 - *  
57 - * 枚举 {@link TODO crm_receivable_check_status 对应的类} 55 + * 对应字典 {@link cn.iocoder.yudao.module.crm.enums.DictTypeConstants#CRM_RECEIVABLE_CHECK_STATUS}
58 */ 56 */
59 private Integer checkStatus; 57 private Integer checkStatus;
60 /** 58 /**
@@ -74,7 +72,7 @@ public class ReceivableDO extends BaseDO { @@ -74,7 +72,7 @@ public class ReceivableDO extends BaseDO {
74 /** 72 /**
75 * 回款金额 73 * 回款金额
76 */ 74 */
77 - private BigDecimal price; 75 + private Integer price;
78 /** 76 /**
79 * 负责人 77 * 负责人
80 */ 78 */
@@ -99,7 +97,8 @@ public class ReceivableDO extends BaseDO { @@ -99,7 +97,8 @@ public class ReceivableDO extends BaseDO {
99 /** 97 /**
100 * 状态 98 * 状态
101 * 99 *
102 - * 枚举 {@link TODO common_status 对应的类} 100 + * 枚举 {@link cn.iocoder.yudao.framework.common.enums.CommonStatusEnum}
  101 + *
103 */ 102 */
104 private Integer status; 103 private Integer status;
105 /** 104 /**
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/receivable/ReceivablePlanDO.java renamed to yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/receivable/CrmReceivablePlanDO.java
1 package cn.iocoder.yudao.module.crm.dal.dataobject.receivable; 1 package cn.iocoder.yudao.module.crm.dal.dataobject.receivable;
2 2
3 import lombok.*; 3 import lombok.*;
4 -import java.util.*;  
5 -import java.math.BigDecimal;  
6 -import java.time.LocalDateTime;  
7 -import java.time.LocalDateTime;  
8 -import java.time.LocalDateTime; 4 +
9 import java.time.LocalDateTime; 5 import java.time.LocalDateTime;
  6 +
10 import com.baomidou.mybatisplus.annotation.*; 7 import com.baomidou.mybatisplus.annotation.*;
11 import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; 8 import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
12 9
@@ -23,7 +20,7 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; @@ -23,7 +20,7 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
23 @Builder 20 @Builder
24 @NoArgsConstructor 21 @NoArgsConstructor
25 @AllArgsConstructor 22 @AllArgsConstructor
26 -public class ReceivablePlanDO extends BaseDO { 23 +public class CrmReceivablePlanDO extends BaseDO {
27 24
28 /** 25 /**
29 * ID 26 * ID
@@ -33,23 +30,23 @@ public class ReceivablePlanDO extends BaseDO { @@ -33,23 +30,23 @@ public class ReceivablePlanDO extends BaseDO {
33 /** 30 /**
34 * 期数 31 * 期数
35 */ 32 */
36 - private Long indexNo; 33 + private Integer period;
37 /** 34 /**
38 * 回款ID 35 * 回款ID
39 */ 36 */
40 private Long receivableId; 37 private Long receivableId;
41 /** 38 /**
42 - * 完成状态 39 + * 状态
  40 + *
  41 + * 枚举 {@link cn.iocoder.yudao.framework.common.enums.CommonStatusEnum}
43 * 42 *
44 - * 枚举 {@link TODO common_status 对应的类}  
45 */ 43 */
46 private Integer status; 44 private Integer status;
47 /** 45 /**
48 * 审批状态 46 * 审批状态
49 - *  
50 - * 枚举 {@link TODO crm_receivable_check_status 对应的类} 47 + * 对应字典 {@link cn.iocoder.yudao.module.crm.enums.DictTypeConstants#CRM_RECEIVABLE_CHECK_STATUS}
51 */ 48 */
52 - private String checkStatus; 49 + private Integer checkStatus;
53 /** 50 /**
54 * 工作流编号 51 * 工作流编号
55 */ 52 */
@@ -57,7 +54,7 @@ public class ReceivablePlanDO extends BaseDO { @@ -57,7 +54,7 @@ public class ReceivablePlanDO extends BaseDO {
57 /** 54 /**
58 * 计划回款金额 55 * 计划回款金额
59 */ 56 */
60 - private BigDecimal price; 57 + private Integer price;
61 /** 58 /**
62 * 计划回款日期 59 * 计划回款日期
63 */ 60 */
@@ -65,7 +62,7 @@ public class ReceivablePlanDO extends BaseDO { @@ -65,7 +62,7 @@ public class ReceivablePlanDO extends BaseDO {
65 /** 62 /**
66 * 提前几天提醒 63 * 提前几天提醒
67 */ 64 */
68 - private Long remindDays; 65 + private Integer remindDays;
69 /** 66 /**
70 * 提醒日期 67 * 提醒日期
71 */ 68 */
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/receivable/CrmReceivableMapper.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.dal.mysql.receivable;
  2 +
  3 +import java.util.*;
  4 +
  5 +import cn.iocoder.yudao.framework.common.pojo.PageResult;
  6 +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
  7 +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
  8 +import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.CrmReceivableDO;
  9 +import org.apache.ibatis.annotations.Mapper;
  10 +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*;
  11 +
  12 +/**
  13 + * 回款管理 Mapper
  14 + *
  15 + * @author 赤焰
  16 + */
  17 +@Mapper
  18 +public interface CrmReceivableMapper extends BaseMapperX<CrmReceivableDO> {
  19 +
  20 + default PageResult<CrmReceivableDO> selectPage(CrmReceivablePageReqVO reqVO) {
  21 + return selectPage(reqVO, new LambdaQueryWrapperX<CrmReceivableDO>()
  22 + .eqIfPresent(CrmReceivableDO::getNo, reqVO.getNo())
  23 + .eqIfPresent(CrmReceivableDO::getPlanId, reqVO.getPlanId())
  24 + .eqIfPresent(CrmReceivableDO::getCustomerId, reqVO.getCustomerId())
  25 + .eqIfPresent(CrmReceivableDO::getContractId, reqVO.getContractId())
  26 + .eqIfPresent(CrmReceivableDO::getCheckStatus, reqVO.getCheckStatus())
  27 + .betweenIfPresent(CrmReceivableDO::getReturnTime, reqVO.getReturnTime())
  28 + .eqIfPresent(CrmReceivableDO::getReturnType, reqVO.getReturnType())
  29 + .eqIfPresent(CrmReceivableDO::getPrice, reqVO.getPrice())
  30 + .eqIfPresent(CrmReceivableDO::getOwnerUserId, reqVO.getOwnerUserId())
  31 + .eqIfPresent(CrmReceivableDO::getStatus, reqVO.getStatus())
  32 + .betweenIfPresent(CrmReceivableDO::getCreateTime, reqVO.getCreateTime())
  33 + .orderByDesc(CrmReceivableDO::getId));
  34 + }
  35 +
  36 + default List<CrmReceivableDO> selectList(CrmReceivableExportReqVO reqVO) {
  37 + return selectList(new LambdaQueryWrapperX<CrmReceivableDO>()
  38 + .eqIfPresent(CrmReceivableDO::getNo, reqVO.getNo())
  39 + .eqIfPresent(CrmReceivableDO::getPlanId, reqVO.getPlanId())
  40 + .eqIfPresent(CrmReceivableDO::getCustomerId, reqVO.getCustomerId())
  41 + .eqIfPresent(CrmReceivableDO::getContractId, reqVO.getContractId())
  42 + .eqIfPresent(CrmReceivableDO::getCheckStatus, reqVO.getCheckStatus())
  43 + .betweenIfPresent(CrmReceivableDO::getReturnTime, reqVO.getReturnTime())
  44 + .eqIfPresent(CrmReceivableDO::getReturnType, reqVO.getReturnType())
  45 + .eqIfPresent(CrmReceivableDO::getPrice, reqVO.getPrice())
  46 + .eqIfPresent(CrmReceivableDO::getOwnerUserId, reqVO.getOwnerUserId())
  47 + .eqIfPresent(CrmReceivableDO::getBatchId, reqVO.getBatchId())
  48 + .eqIfPresent(CrmReceivableDO::getStatus, reqVO.getStatus())
  49 + .eqIfPresent(CrmReceivableDO::getRemark, reqVO.getRemark())
  50 + .betweenIfPresent(CrmReceivableDO::getCreateTime, reqVO.getCreateTime())
  51 + .orderByDesc(CrmReceivableDO::getId));
  52 + }
  53 +
  54 +}
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/receivable/CrmReceivablePlanMapper.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.dal.mysql.receivable;
  2 +
  3 +import java.util.*;
  4 +
  5 +import cn.iocoder.yudao.framework.common.pojo.PageResult;
  6 +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
  7 +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
  8 +import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.CrmReceivablePlanDO;
  9 +import org.apache.ibatis.annotations.Mapper;
  10 +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*;
  11 +
  12 +/**
  13 + * 回款计划 Mapper
  14 + *
  15 + * @author 芋道源码
  16 + */
  17 +@Mapper
  18 +public interface CrmReceivablePlanMapper extends BaseMapperX<CrmReceivablePlanDO> {
  19 +
  20 + default PageResult<CrmReceivablePlanDO> selectPage(CrmReceivablePlanPageReqVO reqVO) {
  21 + return selectPage(reqVO, new LambdaQueryWrapperX<CrmReceivablePlanDO>()
  22 + .eqIfPresent(CrmReceivablePlanDO::getStatus, reqVO.getStatus())
  23 + .eqIfPresent(CrmReceivablePlanDO::getCheckStatus, reqVO.getCheckStatus())
  24 + .betweenIfPresent(CrmReceivablePlanDO::getReturnTime, reqVO.getReturnTime())
  25 + .betweenIfPresent(CrmReceivablePlanDO::getRemindTime, reqVO.getRemindTime())
  26 + .eqIfPresent(CrmReceivablePlanDO::getCustomerId, reqVO.getCustomerId())
  27 + .eqIfPresent(CrmReceivablePlanDO::getContractId, reqVO.getContractId())
  28 + .eqIfPresent(CrmReceivablePlanDO::getOwnerUserId, reqVO.getOwnerUserId())
  29 + .betweenIfPresent(CrmReceivablePlanDO::getCreateTime, reqVO.getCreateTime())
  30 + .orderByDesc(CrmReceivablePlanDO::getId));
  31 + }
  32 +
  33 + default List<CrmReceivablePlanDO> selectList(CrmReceivablePlanExportReqVO reqVO) {
  34 + return selectList(new LambdaQueryWrapperX<CrmReceivablePlanDO>()
  35 + .eqIfPresent(CrmReceivablePlanDO::getPeriod, reqVO.getPeriod())
  36 + .eqIfPresent(CrmReceivablePlanDO::getStatus, reqVO.getStatus())
  37 + .eqIfPresent(CrmReceivablePlanDO::getCheckStatus, reqVO.getCheckStatus())
  38 + .betweenIfPresent(CrmReceivablePlanDO::getReturnTime, reqVO.getReturnTime())
  39 + .eqIfPresent(CrmReceivablePlanDO::getRemindDays, reqVO.getRemindDays())
  40 + .betweenIfPresent(CrmReceivablePlanDO::getRemindTime, reqVO.getRemindTime())
  41 + .eqIfPresent(CrmReceivablePlanDO::getCustomerId, reqVO.getCustomerId())
  42 + .eqIfPresent(CrmReceivablePlanDO::getContractId, reqVO.getContractId())
  43 + .eqIfPresent(CrmReceivablePlanDO::getOwnerUserId, reqVO.getOwnerUserId())
  44 + .eqIfPresent(CrmReceivablePlanDO::getRemark, reqVO.getRemark())
  45 + .betweenIfPresent(CrmReceivablePlanDO::getCreateTime, reqVO.getCreateTime())
  46 + .orderByDesc(CrmReceivablePlanDO::getId));
  47 + }
  48 +
  49 +}
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/receivable/ReceivableMapper.java deleted
1 -package cn.iocoder.yudao.module.crm.dal.mysql.receivable;  
2 -  
3 -import java.util.*;  
4 -  
5 -import cn.iocoder.yudao.framework.common.pojo.PageResult;  
6 -import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;  
7 -import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;  
8 -import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivableDO;  
9 -import org.apache.ibatis.annotations.Mapper;  
10 -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*;  
11 -  
12 -/**  
13 - * 回款管理 Mapper  
14 - *  
15 - * @author 赤焰  
16 - */  
17 -@Mapper  
18 -public interface ReceivableMapper extends BaseMapperX<ReceivableDO> {  
19 -  
20 - default PageResult<ReceivableDO> selectPage(ReceivablePageReqVO reqVO) {  
21 - return selectPage(reqVO, new LambdaQueryWrapperX<ReceivableDO>()  
22 - .eqIfPresent(ReceivableDO::getNo, reqVO.getNo())  
23 - .eqIfPresent(ReceivableDO::getPlanId, reqVO.getPlanId())  
24 - .eqIfPresent(ReceivableDO::getCustomerId, reqVO.getCustomerId())  
25 - .eqIfPresent(ReceivableDO::getContractId, reqVO.getContractId())  
26 - .eqIfPresent(ReceivableDO::getCheckStatus, reqVO.getCheckStatus())  
27 - .eqIfPresent(ReceivableDO::getProcessInstanceId, reqVO.getProcessInstanceId())  
28 - .betweenIfPresent(ReceivableDO::getReturnTime, reqVO.getReturnTime())  
29 - .eqIfPresent(ReceivableDO::getReturnType, reqVO.getReturnType())  
30 - .eqIfPresent(ReceivableDO::getPrice, reqVO.getPrice())  
31 - .eqIfPresent(ReceivableDO::getOwnerUserId, reqVO.getOwnerUserId())  
32 - .eqIfPresent(ReceivableDO::getBatchId, reqVO.getBatchId())  
33 - .eqIfPresent(ReceivableDO::getSort, reqVO.getSort())  
34 - .eqIfPresent(ReceivableDO::getDataScope, reqVO.getDataScope())  
35 - .eqIfPresent(ReceivableDO::getDataScopeDeptIds, reqVO.getDataScopeDeptIds())  
36 - .eqIfPresent(ReceivableDO::getStatus, reqVO.getStatus())  
37 - .eqIfPresent(ReceivableDO::getRemark, reqVO.getRemark())  
38 - .betweenIfPresent(ReceivableDO::getCreateTime, reqVO.getCreateTime())  
39 - .orderByDesc(ReceivableDO::getId));  
40 - }  
41 -  
42 - default List<ReceivableDO> selectList(ReceivableExportReqVO reqVO) {  
43 - return selectList(new LambdaQueryWrapperX<ReceivableDO>()  
44 - .eqIfPresent(ReceivableDO::getNo, reqVO.getNo())  
45 - .eqIfPresent(ReceivableDO::getPlanId, reqVO.getPlanId())  
46 - .eqIfPresent(ReceivableDO::getCustomerId, reqVO.getCustomerId())  
47 - .eqIfPresent(ReceivableDO::getContractId, reqVO.getContractId())  
48 - .eqIfPresent(ReceivableDO::getCheckStatus, reqVO.getCheckStatus())  
49 - .eqIfPresent(ReceivableDO::getProcessInstanceId, reqVO.getProcessInstanceId())  
50 - .betweenIfPresent(ReceivableDO::getReturnTime, reqVO.getReturnTime())  
51 - .eqIfPresent(ReceivableDO::getReturnType, reqVO.getReturnType())  
52 - .eqIfPresent(ReceivableDO::getPrice, reqVO.getPrice())  
53 - .eqIfPresent(ReceivableDO::getOwnerUserId, reqVO.getOwnerUserId())  
54 - .eqIfPresent(ReceivableDO::getBatchId, reqVO.getBatchId())  
55 - .eqIfPresent(ReceivableDO::getSort, reqVO.getSort())  
56 - .eqIfPresent(ReceivableDO::getDataScope, reqVO.getDataScope())  
57 - .eqIfPresent(ReceivableDO::getDataScopeDeptIds, reqVO.getDataScopeDeptIds())  
58 - .eqIfPresent(ReceivableDO::getStatus, reqVO.getStatus())  
59 - .eqIfPresent(ReceivableDO::getRemark, reqVO.getRemark())  
60 - .betweenIfPresent(ReceivableDO::getCreateTime, reqVO.getCreateTime())  
61 - .orderByDesc(ReceivableDO::getId));  
62 - }  
63 -  
64 -}  
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/mysql/receivable/ReceivablePlanMapper.java deleted
1 -package cn.iocoder.yudao.module.crm.dal.mysql.receivable;  
2 -  
3 -import java.util.*;  
4 -  
5 -import cn.iocoder.yudao.framework.common.pojo.PageResult;  
6 -import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;  
7 -import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;  
8 -import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivablePlanDO;  
9 -import org.apache.ibatis.annotations.Mapper;  
10 -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*;  
11 -  
12 -/**  
13 - * 回款计划 Mapper  
14 - *  
15 - * @author 芋道源码  
16 - */  
17 -@Mapper  
18 -public interface ReceivablePlanMapper extends BaseMapperX<ReceivablePlanDO> {  
19 -  
20 - default PageResult<ReceivablePlanDO> selectPage(ReceivablePlanPageReqVO reqVO) {  
21 - return selectPage(reqVO, new LambdaQueryWrapperX<ReceivablePlanDO>()  
22 - .eqIfPresent(ReceivablePlanDO::getIndexNo, reqVO.getIndexNo())  
23 - .eqIfPresent(ReceivablePlanDO::getStatus, reqVO.getStatus())  
24 - .eqIfPresent(ReceivablePlanDO::getCheckStatus, reqVO.getCheckStatus())  
25 - .betweenIfPresent(ReceivablePlanDO::getReturnTime, reqVO.getReturnTime())  
26 - .eqIfPresent(ReceivablePlanDO::getRemindDays, reqVO.getRemindDays())  
27 - .betweenIfPresent(ReceivablePlanDO::getRemindTime, reqVO.getRemindTime())  
28 - .eqIfPresent(ReceivablePlanDO::getCustomerId, reqVO.getCustomerId())  
29 - .eqIfPresent(ReceivablePlanDO::getContractId, reqVO.getContractId())  
30 - .eqIfPresent(ReceivablePlanDO::getOwnerUserId, reqVO.getOwnerUserId())  
31 - .eqIfPresent(ReceivablePlanDO::getRemark, reqVO.getRemark())  
32 - .betweenIfPresent(ReceivablePlanDO::getCreateTime, reqVO.getCreateTime())  
33 - .orderByDesc(ReceivablePlanDO::getId));  
34 - }  
35 -  
36 - default List<ReceivablePlanDO> selectList(ReceivablePlanExportReqVO reqVO) {  
37 - return selectList(new LambdaQueryWrapperX<ReceivablePlanDO>()  
38 - .eqIfPresent(ReceivablePlanDO::getIndexNo, reqVO.getIndexNo())  
39 - .eqIfPresent(ReceivablePlanDO::getStatus, reqVO.getStatus())  
40 - .eqIfPresent(ReceivablePlanDO::getCheckStatus, reqVO.getCheckStatus())  
41 - .betweenIfPresent(ReceivablePlanDO::getReturnTime, reqVO.getReturnTime())  
42 - .eqIfPresent(ReceivablePlanDO::getRemindDays, reqVO.getRemindDays())  
43 - .betweenIfPresent(ReceivablePlanDO::getRemindTime, reqVO.getRemindTime())  
44 - .eqIfPresent(ReceivablePlanDO::getCustomerId, reqVO.getCustomerId())  
45 - .eqIfPresent(ReceivablePlanDO::getContractId, reqVO.getContractId())  
46 - .eqIfPresent(ReceivablePlanDO::getOwnerUserId, reqVO.getOwnerUserId())  
47 - .eqIfPresent(ReceivablePlanDO::getRemark, reqVO.getRemark())  
48 - .betweenIfPresent(ReceivablePlanDO::getCreateTime, reqVO.getCreateTime())  
49 - .orderByDesc(ReceivablePlanDO::getId));  
50 - }  
51 -  
52 -}  
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivablePlanService.java renamed to yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/CrmReceivablePlanService.java
@@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.crm.service.receivable; @@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.crm.service.receivable;
3 import java.util.*; 3 import java.util.*;
4 import javax.validation.*; 4 import javax.validation.*;
5 import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*; 5 import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*;
6 -import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivablePlanDO; 6 +import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.CrmReceivablePlanDO;
7 import cn.iocoder.yudao.framework.common.pojo.PageResult; 7 import cn.iocoder.yudao.framework.common.pojo.PageResult;
8 8
9 /** 9 /**
@@ -11,7 +11,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; @@ -11,7 +11,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
11 * 11 *
12 * @author 芋道源码 12 * @author 芋道源码
13 */ 13 */
14 -public interface ReceivablePlanService { 14 +public interface CrmReceivablePlanService {
15 15
16 /** 16 /**
17 * 创建回款计划 17 * 创建回款计划
@@ -19,14 +19,14 @@ public interface ReceivablePlanService { @@ -19,14 +19,14 @@ public interface ReceivablePlanService {
19 * @param createReqVO 创建信息 19 * @param createReqVO 创建信息
20 * @return 编号 20 * @return 编号
21 */ 21 */
22 - Long createReceivablePlan(@Valid ReceivablePlanCreateReqVO createReqVO); 22 + Long createReceivablePlan(@Valid CrmReceivablePlanCreateReqVO createReqVO);
23 23
24 /** 24 /**
25 * 更新回款计划 25 * 更新回款计划
26 * 26 *
27 * @param updateReqVO 更新信息 27 * @param updateReqVO 更新信息
28 */ 28 */
29 - void updateReceivablePlan(@Valid ReceivablePlanUpdateReqVO updateReqVO); 29 + void updateReceivablePlan(@Valid CrmReceivablePlanUpdateReqVO updateReqVO);
30 30
31 /** 31 /**
32 * 删除回款计划 32 * 删除回款计划
@@ -41,7 +41,7 @@ public interface ReceivablePlanService { @@ -41,7 +41,7 @@ public interface ReceivablePlanService {
41 * @param id 编号 41 * @param id 编号
42 * @return 回款计划 42 * @return 回款计划
43 */ 43 */
44 - ReceivablePlanDO getReceivablePlan(Long id); 44 + CrmReceivablePlanDO getReceivablePlan(Long id);
45 45
46 /** 46 /**
47 * 获得回款计划列表 47 * 获得回款计划列表
@@ -49,7 +49,7 @@ public interface ReceivablePlanService { @@ -49,7 +49,7 @@ public interface ReceivablePlanService {
49 * @param ids 编号 49 * @param ids 编号
50 * @return 回款计划列表 50 * @return 回款计划列表
51 */ 51 */
52 - List<ReceivablePlanDO> getReceivablePlanList(Collection<Long> ids); 52 + List<CrmReceivablePlanDO> getReceivablePlanList(Collection<Long> ids);
53 53
54 /** 54 /**
55 * 获得回款计划分页 55 * 获得回款计划分页
@@ -57,7 +57,7 @@ public interface ReceivablePlanService { @@ -57,7 +57,7 @@ public interface ReceivablePlanService {
57 * @param pageReqVO 分页查询 57 * @param pageReqVO 分页查询
58 * @return 回款计划分页 58 * @return 回款计划分页
59 */ 59 */
60 - PageResult<ReceivablePlanDO> getReceivablePlanPage(ReceivablePlanPageReqVO pageReqVO); 60 + PageResult<CrmReceivablePlanDO> getReceivablePlanPage(CrmReceivablePlanPageReqVO pageReqVO);
61 61
62 /** 62 /**
63 * 获得回款计划列表, 用于 Excel 导出 63 * 获得回款计划列表, 用于 Excel 导出
@@ -65,6 +65,6 @@ public interface ReceivablePlanService { @@ -65,6 +65,6 @@ public interface ReceivablePlanService {
65 * @param exportReqVO 查询条件 65 * @param exportReqVO 查询条件
66 * @return 回款计划列表 66 * @return 回款计划列表
67 */ 67 */
68 - List<ReceivablePlanDO> getReceivablePlanList(ReceivablePlanExportReqVO exportReqVO); 68 + List<CrmReceivablePlanDO> getReceivablePlanList(CrmReceivablePlanExportReqVO exportReqVO);
69 69
70 } 70 }
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivablePlanServiceImpl.java renamed to yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/CrmReceivablePlanServiceImpl.java
@@ -5,13 +5,18 @@ import cn.hutool.core.collection.ListUtil; @@ -5,13 +5,18 @@ import cn.hutool.core.collection.ListUtil;
5 import cn.hutool.core.util.ObjectUtil; 5 import cn.hutool.core.util.ObjectUtil;
6 import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; 6 import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
7 import cn.iocoder.yudao.framework.common.pojo.PageResult; 7 import cn.iocoder.yudao.framework.common.pojo.PageResult;
8 -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivablePlanCreateReqVO;  
9 -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivablePlanExportReqVO;  
10 -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivablePlanPageReqVO;  
11 -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivablePlanUpdateReqVO;  
12 -import cn.iocoder.yudao.module.crm.convert.receivable.ReceivablePlanConvert;  
13 -import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivablePlanDO;  
14 -import cn.iocoder.yudao.module.crm.dal.mysql.receivable.ReceivablePlanMapper; 8 +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivablePlanCreateReqVO;
  9 +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivablePlanExportReqVO;
  10 +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivablePlanPageReqVO;
  11 +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivablePlanUpdateReqVO;
  12 +import cn.iocoder.yudao.module.crm.convert.receivable.CrmReceivablePlanConvert;
  13 +import cn.iocoder.yudao.module.crm.dal.dataobject.contract.ContractDO;
  14 +import cn.iocoder.yudao.module.crm.dal.dataobject.customer.CrmCustomerDO;
  15 +import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.CrmReceivablePlanDO;
  16 +import cn.iocoder.yudao.module.crm.dal.mysql.receivable.CrmReceivablePlanMapper;
  17 +import cn.iocoder.yudao.module.crm.enums.AuditStatusEnum;
  18 +import cn.iocoder.yudao.module.crm.service.contract.ContractService;
  19 +import cn.iocoder.yudao.module.crm.service.customer.CrmCustomerService;
15 import org.springframework.stereotype.Service; 20 import org.springframework.stereotype.Service;
16 import org.springframework.validation.annotation.Validated; 21 import org.springframework.validation.annotation.Validated;
17 22
@@ -20,7 +25,7 @@ import java.util.Collection; @@ -20,7 +25,7 @@ import java.util.Collection;
20 import java.util.List; 25 import java.util.List;
21 26
22 import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; 27 import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
23 -import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.RECEIVABLE_PLAN_NOT_EXISTS; 28 +import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.*;
24 29
25 /** 30 /**
26 * 回款计划 Service 实现类 31 * 回款计划 Service 实现类
@@ -29,32 +34,59 @@ import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.RECEIVABLE_PL @@ -29,32 +34,59 @@ import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.RECEIVABLE_PL
29 */ 34 */
30 @Service 35 @Service
31 @Validated 36 @Validated
32 -public class ReceivablePlanServiceImpl implements ReceivablePlanService { 37 +public class CrmReceivablePlanServiceImpl implements CrmReceivablePlanService {
33 38
34 @Resource 39 @Resource
35 - private ReceivablePlanMapper receivablePlanMapper; 40 + private CrmReceivablePlanMapper crmReceivablePlanMapper;
  41 + @Resource
  42 + private ContractService contractService;
  43 + @Resource
  44 + private CrmCustomerService crmCustomerService;
36 45
37 @Override 46 @Override
38 - public Long createReceivablePlan(ReceivablePlanCreateReqVO createReqVO) { 47 + public Long createReceivablePlan(CrmReceivablePlanCreateReqVO createReqVO) {
39 // 插入 48 // 插入
40 - ReceivablePlanDO receivablePlan = ReceivablePlanConvert.INSTANCE.convert(createReqVO);  
41 - // TODO @liuhongfeng:空格要注释;if (ObjectUtil.isNull(receivablePlan.getStatus())) {  
42 - if(ObjectUtil.isNull(receivablePlan.getStatus())){ 49 + CrmReceivablePlanDO receivablePlan = CrmReceivablePlanConvert.INSTANCE.convert(createReqVO);
  50 + if (ObjectUtil.isNull(receivablePlan.getStatus())){
43 receivablePlan.setStatus(CommonStatusEnum.ENABLE.getStatus()); 51 receivablePlan.setStatus(CommonStatusEnum.ENABLE.getStatus());
44 } 52 }
45 - receivablePlanMapper.insert(receivablePlan); 53 + if (ObjectUtil.isNull(receivablePlan.getCheckStatus())){
  54 + receivablePlan.setCheckStatus(AuditStatusEnum.AUDIT_NEW.getValue());
  55 + }
  56 +
  57 + checkReceivablePlan(receivablePlan);
  58 +
  59 + crmReceivablePlanMapper.insert(receivablePlan);
46 // 返回 60 // 返回
47 return receivablePlan.getId(); 61 return receivablePlan.getId();
48 } 62 }
49 63
  64 + private void checkReceivablePlan(CrmReceivablePlanDO receivablePlan) {
  65 +
  66 + if(ObjectUtil.isNull(receivablePlan.getContractId())){
  67 + throw exception(CONTRACT_NOT_EXISTS);
  68 + }
  69 +
  70 + ContractDO contract = contractService.getContract(receivablePlan.getContractId());
  71 + if(ObjectUtil.isNull(contract)){
  72 + throw exception(CONTRACT_NOT_EXISTS);
  73 + }
  74 +
  75 + CrmCustomerDO customer = crmCustomerService.getCustomer(receivablePlan.getCustomerId());
  76 + if(ObjectUtil.isNull(customer)){
  77 + throw exception(CUSTOMER_NOT_EXISTS);
  78 + }
  79 +
  80 + }
  81 +
50 @Override 82 @Override
51 - public void updateReceivablePlan(ReceivablePlanUpdateReqVO updateReqVO) { 83 + public void updateReceivablePlan(CrmReceivablePlanUpdateReqVO updateReqVO) {
52 // 校验存在 84 // 校验存在
53 validateReceivablePlanExists(updateReqVO.getId()); 85 validateReceivablePlanExists(updateReqVO.getId());
54 86
55 // 更新 87 // 更新
56 - ReceivablePlanDO updateObj = ReceivablePlanConvert.INSTANCE.convert(updateReqVO);  
57 - receivablePlanMapper.updateById(updateObj); 88 + CrmReceivablePlanDO updateObj = CrmReceivablePlanConvert.INSTANCE.convert(updateReqVO);
  89 + crmReceivablePlanMapper.updateById(updateObj);
58 } 90 }
59 91
60 @Override 92 @Override
@@ -62,36 +94,36 @@ public class ReceivablePlanServiceImpl implements ReceivablePlanService { @@ -62,36 +94,36 @@ public class ReceivablePlanServiceImpl implements ReceivablePlanService {
62 // 校验存在 94 // 校验存在
63 validateReceivablePlanExists(id); 95 validateReceivablePlanExists(id);
64 // 删除 96 // 删除
65 - receivablePlanMapper.deleteById(id); 97 + crmReceivablePlanMapper.deleteById(id);
66 } 98 }
67 99
68 private void validateReceivablePlanExists(Long id) { 100 private void validateReceivablePlanExists(Long id) {
69 - if (receivablePlanMapper.selectById(id) == null) { 101 + if (crmReceivablePlanMapper.selectById(id) == null) {
70 throw exception(RECEIVABLE_PLAN_NOT_EXISTS); 102 throw exception(RECEIVABLE_PLAN_NOT_EXISTS);
71 } 103 }
72 } 104 }
73 105
74 @Override 106 @Override
75 - public ReceivablePlanDO getReceivablePlan(Long id) {  
76 - return receivablePlanMapper.selectById(id); 107 + public CrmReceivablePlanDO getReceivablePlan(Long id) {
  108 + return crmReceivablePlanMapper.selectById(id);
77 } 109 }
78 110
79 @Override 111 @Override
80 - public List<ReceivablePlanDO> getReceivablePlanList(Collection<Long> ids) { 112 + public List<CrmReceivablePlanDO> getReceivablePlanList(Collection<Long> ids) {
81 if (CollUtil.isEmpty(ids)) { 113 if (CollUtil.isEmpty(ids)) {
82 return ListUtil.empty(); 114 return ListUtil.empty();
83 } 115 }
84 - return receivablePlanMapper.selectBatchIds(ids); 116 + return crmReceivablePlanMapper.selectBatchIds(ids);
85 } 117 }
86 118
87 @Override 119 @Override
88 - public PageResult<ReceivablePlanDO> getReceivablePlanPage(ReceivablePlanPageReqVO pageReqVO) {  
89 - return receivablePlanMapper.selectPage(pageReqVO); 120 + public PageResult<CrmReceivablePlanDO> getReceivablePlanPage(CrmReceivablePlanPageReqVO pageReqVO) {
  121 + return crmReceivablePlanMapper.selectPage(pageReqVO);
90 } 122 }
91 123
92 @Override 124 @Override
93 - public List<ReceivablePlanDO> getReceivablePlanList(ReceivablePlanExportReqVO exportReqVO) {  
94 - return receivablePlanMapper.selectList(exportReqVO); 125 + public List<CrmReceivablePlanDO> getReceivablePlanList(CrmReceivablePlanExportReqVO exportReqVO) {
  126 + return crmReceivablePlanMapper.selectList(exportReqVO);
95 } 127 }
96 128
97 } 129 }
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivableService.java renamed to yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/CrmReceivableService.java
@@ -4,7 +4,7 @@ import java.util.*; @@ -4,7 +4,7 @@ import java.util.*;
4 import javax.validation.*; 4 import javax.validation.*;
5 5
6 import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*; 6 import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.*;
7 -import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivableDO; 7 +import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.CrmReceivableDO;
8 import cn.iocoder.yudao.framework.common.pojo.PageResult; 8 import cn.iocoder.yudao.framework.common.pojo.PageResult;
9 9
10 /** 10 /**
@@ -12,7 +12,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; @@ -12,7 +12,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
12 * 12 *
13 * @author 赤焰 13 * @author 赤焰
14 */ 14 */
15 -public interface ReceivableService { 15 +public interface CrmReceivableService {
16 16
17 /** 17 /**
18 * 创建回款管理 18 * 创建回款管理
@@ -20,14 +20,14 @@ public interface ReceivableService { @@ -20,14 +20,14 @@ public interface ReceivableService {
20 * @param createReqVO 创建信息 20 * @param createReqVO 创建信息
21 * @return 编号 21 * @return 编号
22 */ 22 */
23 - Long createReceivable(@Valid ReceivableCreateReqVO createReqVO); 23 + Long createReceivable(@Valid CrmReceivableCreateReqVO createReqVO);
24 24
25 /** 25 /**
26 * 更新回款管理 26 * 更新回款管理
27 * 27 *
28 * @param updateReqVO 更新信息 28 * @param updateReqVO 更新信息
29 */ 29 */
30 - void updateReceivable(@Valid ReceivableUpdateReqVO updateReqVO); 30 + void updateReceivable(@Valid CrmReceivableUpdateReqVO updateReqVO);
31 31
32 /** 32 /**
33 * 删除回款管理 33 * 删除回款管理
@@ -42,7 +42,7 @@ public interface ReceivableService { @@ -42,7 +42,7 @@ public interface ReceivableService {
42 * @param id 编号 42 * @param id 编号
43 * @return 回款管理 43 * @return 回款管理
44 */ 44 */
45 - ReceivableDO getReceivable(Long id); 45 + CrmReceivableDO getReceivable(Long id);
46 46
47 /** 47 /**
48 * 获得回款管理列表 48 * 获得回款管理列表
@@ -50,7 +50,7 @@ public interface ReceivableService { @@ -50,7 +50,7 @@ public interface ReceivableService {
50 * @param ids 编号 50 * @param ids 编号
51 * @return 回款管理列表 51 * @return 回款管理列表
52 */ 52 */
53 - List<ReceivableDO> getReceivableList(Collection<Long> ids); 53 + List<CrmReceivableDO> getReceivableList(Collection<Long> ids);
54 54
55 /** 55 /**
56 * 获得回款管理分页 56 * 获得回款管理分页
@@ -58,7 +58,7 @@ public interface ReceivableService { @@ -58,7 +58,7 @@ public interface ReceivableService {
58 * @param pageReqVO 分页查询 58 * @param pageReqVO 分页查询
59 * @return 回款管理分页 59 * @return 回款管理分页
60 */ 60 */
61 - PageResult<ReceivableDO> getReceivablePage(ReceivablePageReqVO pageReqVO); 61 + PageResult<CrmReceivableDO> getReceivablePage(CrmReceivablePageReqVO pageReqVO);
62 62
63 /** 63 /**
64 * 获得回款管理列表, 用于 Excel 导出 64 * 获得回款管理列表, 用于 Excel 导出
@@ -66,6 +66,6 @@ public interface ReceivableService { @@ -66,6 +66,6 @@ public interface ReceivableService {
66 * @param exportReqVO 查询条件 66 * @param exportReqVO 查询条件
67 * @return 回款管理列表 67 * @return 回款管理列表
68 */ 68 */
69 - List<ReceivableDO> getReceivableList(ReceivableExportReqVO exportReqVO); 69 + List<CrmReceivableDO> getReceivableList(CrmReceivableExportReqVO exportReqVO);
70 70
71 } 71 }
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/CrmReceivableServiceImpl.java 0 → 100644
  1 +package cn.iocoder.yudao.module.crm.service.receivable;
  2 +
  3 +import cn.hutool.core.collection.CollUtil;
  4 +import cn.hutool.core.collection.ListUtil;
  5 +import cn.hutool.core.util.ObjectUtil;
  6 +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
  7 +import cn.iocoder.yudao.framework.common.pojo.PageResult;
  8 +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivableCreateReqVO;
  9 +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivableExportReqVO;
  10 +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivablePageReqVO;
  11 +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivableUpdateReqVO;
  12 +import cn.iocoder.yudao.module.crm.convert.receivable.CrmReceivableConvert;
  13 +import cn.iocoder.yudao.module.crm.dal.dataobject.contract.ContractDO;
  14 +import cn.iocoder.yudao.module.crm.dal.dataobject.customer.CrmCustomerDO;
  15 +import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.CrmReceivableDO;
  16 +import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.CrmReceivablePlanDO;
  17 +import cn.iocoder.yudao.module.crm.dal.mysql.receivable.CrmReceivableMapper;
  18 +import cn.iocoder.yudao.module.crm.enums.AuditStatusEnum;
  19 +import cn.iocoder.yudao.module.crm.service.contract.ContractService;
  20 +import cn.iocoder.yudao.module.crm.service.customer.CrmCustomerService;
  21 +import org.springframework.stereotype.Service;
  22 +import org.springframework.validation.annotation.Validated;
  23 +
  24 +import javax.annotation.Resource;
  25 +import java.util.Collection;
  26 +import java.util.List;
  27 +
  28 +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
  29 +import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.*;
  30 +
  31 +/**
  32 + * 回款管理 Service 实现类
  33 + *
  34 + * @author 赤焰
  35 + */
  36 +@Service
  37 +@Validated
  38 +public class CrmReceivableServiceImpl implements CrmReceivableService {
  39 +
  40 + @Resource
  41 + private CrmReceivableMapper crmReceivableMapper;
  42 + @Resource
  43 + private ContractService contractService;
  44 + @Resource
  45 + private CrmCustomerService crmCustomerService;
  46 + @Resource
  47 + private CrmReceivablePlanService crmReceivablePlanService;
  48 +
  49 + @Override
  50 + public Long createReceivable(CrmReceivableCreateReqVO createReqVO) {
  51 + // 插入
  52 + CrmReceivableDO receivable = CrmReceivableConvert.INSTANCE.convert(createReqVO);
  53 + if (ObjectUtil.isNull(receivable.getStatus())){
  54 + receivable.setStatus(CommonStatusEnum.ENABLE.getStatus());
  55 + }
  56 + if (ObjectUtil.isNull(receivable.getCheckStatus())){
  57 + receivable.setCheckStatus(AuditStatusEnum.AUDIT_NEW.getValue());
  58 + }
  59 +
  60 + //校验
  61 + checkReceivable(receivable);
  62 +
  63 + crmReceivableMapper.insert(receivable);
  64 + // 返回
  65 + return receivable.getId();
  66 + }
  67 +
  68 + private void checkReceivable(CrmReceivableDO receivable) {
  69 +
  70 + if(ObjectUtil.isNull(receivable.getContractId())){
  71 + throw exception(CONTRACT_NOT_EXISTS);
  72 + }
  73 +
  74 + ContractDO contract = contractService.getContract(receivable.getContractId());
  75 + if(ObjectUtil.isNull(contract)){
  76 + throw exception(CONTRACT_NOT_EXISTS);
  77 + }
  78 +
  79 + CrmCustomerDO customer = crmCustomerService.getCustomer(receivable.getCustomerId());
  80 + if(ObjectUtil.isNull(customer)){
  81 + throw exception(CUSTOMER_NOT_EXISTS);
  82 + }
  83 +
  84 + CrmReceivablePlanDO receivablePlan = crmReceivablePlanService.getReceivablePlan(receivable.getPlanId());
  85 + if(ObjectUtil.isNull(receivablePlan)){
  86 + throw exception(RECEIVABLE_PLAN_NOT_EXISTS);
  87 + }
  88 +
  89 + }
  90 +
  91 + @Override
  92 + public void updateReceivable(CrmReceivableUpdateReqVO updateReqVO) {
  93 + // 校验存在
  94 + validateReceivableExists(updateReqVO.getId());
  95 +
  96 + // 更新
  97 + CrmReceivableDO updateObj = CrmReceivableConvert.INSTANCE.convert(updateReqVO);
  98 + crmReceivableMapper.updateById(updateObj);
  99 + }
  100 +
  101 + @Override
  102 + public void deleteReceivable(Long id) {
  103 + // 校验存在
  104 + validateReceivableExists(id);
  105 + // 删除
  106 + crmReceivableMapper.deleteById(id);
  107 + }
  108 +
  109 + private void validateReceivableExists(Long id) {
  110 + if (crmReceivableMapper.selectById(id) == null) {
  111 + throw exception(RECEIVABLE_NOT_EXISTS);
  112 + }
  113 + }
  114 +
  115 + @Override
  116 + public CrmReceivableDO getReceivable(Long id) {
  117 + return crmReceivableMapper.selectById(id);
  118 + }
  119 +
  120 + @Override
  121 + public List<CrmReceivableDO> getReceivableList(Collection<Long> ids) {
  122 + if (CollUtil.isEmpty(ids)) {
  123 + return ListUtil.empty();
  124 + }
  125 + return crmReceivableMapper.selectBatchIds(ids);
  126 + }
  127 +
  128 + @Override
  129 + public PageResult<CrmReceivableDO> getReceivablePage(CrmReceivablePageReqVO pageReqVO) {
  130 + return crmReceivableMapper.selectPage(pageReqVO);
  131 + }
  132 +
  133 + @Override
  134 + public List<CrmReceivableDO> getReceivableList(CrmReceivableExportReqVO exportReqVO) {
  135 + return crmReceivableMapper.selectList(exportReqVO);
  136 + }
  137 +
  138 +}
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivableServiceImpl.java deleted
1 -package cn.iocoder.yudao.module.crm.service.receivable;  
2 -  
3 -import cn.hutool.core.collection.CollUtil;  
4 -import cn.hutool.core.collection.ListUtil;  
5 -import cn.iocoder.yudao.framework.common.pojo.PageResult;  
6 -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivableCreateReqVO;  
7 -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivableExportReqVO;  
8 -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivablePageReqVO;  
9 -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivableUpdateReqVO;  
10 -import cn.iocoder.yudao.module.crm.convert.receivable.ReceivableConvert;  
11 -import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivableDO;  
12 -import cn.iocoder.yudao.module.crm.dal.mysql.receivable.ReceivableMapper;  
13 -import org.springframework.stereotype.Service;  
14 -import org.springframework.validation.annotation.Validated;  
15 -  
16 -import javax.annotation.Resource;  
17 -import java.util.Collection;  
18 -import java.util.List;  
19 -  
20 -import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;  
21 -import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.RECEIVABLE_NOT_EXISTS;  
22 -  
23 -/**  
24 - * 回款管理 Service 实现类  
25 - *  
26 - * @author 赤焰  
27 - */  
28 -@Service  
29 -@Validated  
30 -public class ReceivableServiceImpl implements ReceivableService {  
31 -  
32 - @Resource  
33 - private ReceivableMapper receivableMapper;  
34 -  
35 - @Override  
36 - public Long createReceivable(ReceivableCreateReqVO createReqVO) {  
37 - // TODO @liuhongfeng:planId 是否存在,是否合法,需要去校验;  
38 - // TODO @liuhongfeng:其它类似 customerId、contractId 也需要去校验;  
39 - // 插入  
40 - ReceivableDO receivable = ReceivableConvert.INSTANCE.convert(createReqVO);  
41 - receivableMapper.insert(receivable);  
42 - // 返回  
43 - return receivable.getId();  
44 - }  
45 -  
46 - @Override  
47 - public void updateReceivable(ReceivableUpdateReqVO updateReqVO) {  
48 - // 校验存在  
49 - validateReceivableExists(updateReqVO.getId());  
50 -  
51 - // 更新  
52 - ReceivableDO updateObj = ReceivableConvert.INSTANCE.convert(updateReqVO);  
53 - receivableMapper.updateById(updateObj);  
54 - }  
55 -  
56 - @Override  
57 - public void deleteReceivable(Long id) {  
58 - // 校验存在  
59 - validateReceivableExists(id);  
60 - // 删除  
61 - receivableMapper.deleteById(id);  
62 - }  
63 -  
64 - private void validateReceivableExists(Long id) {  
65 - if (receivableMapper.selectById(id) == null) {  
66 - throw exception(RECEIVABLE_NOT_EXISTS);  
67 - }  
68 - }  
69 -  
70 - @Override  
71 - public ReceivableDO getReceivable(Long id) {  
72 - return receivableMapper.selectById(id);  
73 - }  
74 -  
75 - @Override  
76 - public List<ReceivableDO> getReceivableList(Collection<Long> ids) {  
77 - if (CollUtil.isEmpty(ids)) {  
78 - return ListUtil.empty();  
79 - }  
80 - return receivableMapper.selectBatchIds(ids);  
81 - }  
82 -  
83 - @Override  
84 - public PageResult<ReceivableDO> getReceivablePage(ReceivablePageReqVO pageReqVO) {  
85 - return receivableMapper.selectPage(pageReqVO);  
86 - }  
87 -  
88 - @Override  
89 - public List<ReceivableDO> getReceivableList(ReceivableExportReqVO exportReqVO) {  
90 - return receivableMapper.selectList(exportReqVO);  
91 - }  
92 -  
93 -}  
yudao-module-crm/yudao-module-crm-biz/src/main/resources/mapper/receivable/ReceivableMapper.xml renamed to yudao-module-crm/yudao-module-crm-biz/src/main/resources/mapper/receivable/CrmReceivableMapper.xml
1 <?xml version="1.0" encoding="UTF-8"?> 1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> 2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 -<mapper namespace="cn.iocoder.yudao.module.crm.dal.mysql.receivable.ReceivableMapper"> 3 +<mapper namespace="cn.iocoder.yudao.module.crm.dal.mysql.receivable.CrmReceivableMapper">
4 4
5 <!-- 5 <!--
6 一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。 6 一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
yudao-module-crm/yudao-module-crm-biz/src/main/resources/mapper/receivable/ReceivablePlanMapper.xml renamed to yudao-module-crm/yudao-module-crm-biz/src/main/resources/mapper/receivable/CrmReceivablePlanMapper.xml
1 <?xml version="1.0" encoding="UTF-8"?> 1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> 2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 -<mapper namespace="cn.iocoder.yudao.module.crm.dal.mysql.receivable.ReceivablePlanMapper"> 3 +<mapper namespace="cn.iocoder.yudao.module.crm.dal.mysql.receivable.CrmReceivablePlanMapper">
4 4
5 <!-- 5 <!--
6 一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。 6 一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
yudao-module-crm/yudao-module-crm-biz/src/test/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivablePlanServiceImplTest.java renamed to yudao-module-crm/yudao-module-crm-biz/src/test/java/cn/iocoder/yudao/module/crm/service/receivable/CrmCrmReceivablePlanServiceImplTest.java
@@ -2,12 +2,12 @@ package cn.iocoder.yudao.module.crm.service.receivable; @@ -2,12 +2,12 @@ package cn.iocoder.yudao.module.crm.service.receivable;
2 2
3 import cn.iocoder.yudao.framework.common.pojo.PageResult; 3 import cn.iocoder.yudao.framework.common.pojo.PageResult;
4 import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; 4 import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest;
5 -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivablePlanCreateReqVO;  
6 -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivablePlanExportReqVO;  
7 -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivablePlanPageReqVO;  
8 -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivablePlanUpdateReqVO;  
9 -import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivablePlanDO;  
10 -import cn.iocoder.yudao.module.crm.dal.mysql.receivable.ReceivablePlanMapper; 5 +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivablePlanCreateReqVO;
  6 +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivablePlanExportReqVO;
  7 +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivablePlanPageReqVO;
  8 +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivablePlanUpdateReqVO;
  9 +import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.CrmReceivablePlanDO;
  10 +import cn.iocoder.yudao.module.crm.dal.mysql.receivable.CrmReceivablePlanMapper;
11 import org.junit.jupiter.api.Disabled; 11 import org.junit.jupiter.api.Disabled;
12 import org.junit.jupiter.api.Test; 12 import org.junit.jupiter.api.Test;
13 import org.springframework.context.annotation.Import; 13 import org.springframework.context.annotation.Import;
@@ -26,54 +26,54 @@ import static org.junit.jupiter.api.Assertions.*; @@ -26,54 +26,54 @@ import static org.junit.jupiter.api.Assertions.*;
26 26
27 // TODO 芋艿:后续,需要补充测试用例 27 // TODO 芋艿:后续,需要补充测试用例
28 /** 28 /**
29 - * {@link ReceivablePlanServiceImpl} 的单元测试类 29 + * {@link CrmReceivablePlanServiceImpl} 的单元测试类
30 * 30 *
31 * @author 芋道源码 31 * @author 芋道源码
32 */ 32 */
33 -@Import(ReceivablePlanServiceImpl.class)  
34 -public class ReceivablePlanServiceImplTest extends BaseDbUnitTest { 33 +@Import(CrmReceivablePlanServiceImpl.class)
  34 +public class CrmCrmReceivablePlanServiceImplTest extends BaseDbUnitTest {
35 35
36 @Resource 36 @Resource
37 - private ReceivablePlanServiceImpl receivablePlanService; 37 + private CrmReceivablePlanServiceImpl receivablePlanService;
38 38
39 @Resource 39 @Resource
40 - private ReceivablePlanMapper receivablePlanMapper; 40 + private CrmReceivablePlanMapper crmReceivablePlanMapper;
41 41
42 @Test 42 @Test
43 public void testCreateReceivablePlan_success() { 43 public void testCreateReceivablePlan_success() {
44 // 准备参数 44 // 准备参数
45 - ReceivablePlanCreateReqVO reqVO = randomPojo(ReceivablePlanCreateReqVO.class); 45 + CrmReceivablePlanCreateReqVO reqVO = randomPojo(CrmReceivablePlanCreateReqVO.class);
46 46
47 // 调用 47 // 调用
48 Long receivablePlanId = receivablePlanService.createReceivablePlan(reqVO); 48 Long receivablePlanId = receivablePlanService.createReceivablePlan(reqVO);
49 // 断言 49 // 断言
50 assertNotNull(receivablePlanId); 50 assertNotNull(receivablePlanId);
51 // 校验记录的属性是否正确 51 // 校验记录的属性是否正确
52 - ReceivablePlanDO receivablePlan = receivablePlanMapper.selectById(receivablePlanId); 52 + CrmReceivablePlanDO receivablePlan = crmReceivablePlanMapper.selectById(receivablePlanId);
53 assertPojoEquals(reqVO, receivablePlan); 53 assertPojoEquals(reqVO, receivablePlan);
54 } 54 }
55 55
56 @Test 56 @Test
57 public void testUpdateReceivablePlan_success() { 57 public void testUpdateReceivablePlan_success() {
58 // mock 数据 58 // mock 数据
59 - ReceivablePlanDO dbReceivablePlan = randomPojo(ReceivablePlanDO.class);  
60 - receivablePlanMapper.insert(dbReceivablePlan);// @Sql: 先插入出一条存在的数据 59 + CrmReceivablePlanDO dbReceivablePlan = randomPojo(CrmReceivablePlanDO.class);
  60 + crmReceivablePlanMapper.insert(dbReceivablePlan);// @Sql: 先插入出一条存在的数据
61 // 准备参数 61 // 准备参数
62 - ReceivablePlanUpdateReqVO reqVO = randomPojo(ReceivablePlanUpdateReqVO.class, o -> { 62 + CrmReceivablePlanUpdateReqVO reqVO = randomPojo(CrmReceivablePlanUpdateReqVO.class, o -> {
63 o.setId(dbReceivablePlan.getId()); // 设置更新的 ID 63 o.setId(dbReceivablePlan.getId()); // 设置更新的 ID
64 }); 64 });
65 65
66 // 调用 66 // 调用
67 receivablePlanService.updateReceivablePlan(reqVO); 67 receivablePlanService.updateReceivablePlan(reqVO);
68 // 校验是否更新正确 68 // 校验是否更新正确
69 - ReceivablePlanDO receivablePlan = receivablePlanMapper.selectById(reqVO.getId()); // 获取最新的 69 + CrmReceivablePlanDO receivablePlan = crmReceivablePlanMapper.selectById(reqVO.getId()); // 获取最新的
70 assertPojoEquals(reqVO, receivablePlan); 70 assertPojoEquals(reqVO, receivablePlan);
71 } 71 }
72 72
73 @Test 73 @Test
74 public void testUpdateReceivablePlan_notExists() { 74 public void testUpdateReceivablePlan_notExists() {
75 // 准备参数 75 // 准备参数
76 - ReceivablePlanUpdateReqVO reqVO = randomPojo(ReceivablePlanUpdateReqVO.class); 76 + CrmReceivablePlanUpdateReqVO reqVO = randomPojo(CrmReceivablePlanUpdateReqVO.class);
77 77
78 // 调用, 并断言异常 78 // 调用, 并断言异常
79 assertServiceException(() -> receivablePlanService.updateReceivablePlan(reqVO), RECEIVABLE_PLAN_NOT_EXISTS); 79 assertServiceException(() -> receivablePlanService.updateReceivablePlan(reqVO), RECEIVABLE_PLAN_NOT_EXISTS);
@@ -82,15 +82,15 @@ public class ReceivablePlanServiceImplTest extends BaseDbUnitTest { @@ -82,15 +82,15 @@ public class ReceivablePlanServiceImplTest extends BaseDbUnitTest {
82 @Test 82 @Test
83 public void testDeleteReceivablePlan_success() { 83 public void testDeleteReceivablePlan_success() {
84 // mock 数据 84 // mock 数据
85 - ReceivablePlanDO dbReceivablePlan = randomPojo(ReceivablePlanDO.class);  
86 - receivablePlanMapper.insert(dbReceivablePlan);// @Sql: 先插入出一条存在的数据 85 + CrmReceivablePlanDO dbReceivablePlan = randomPojo(CrmReceivablePlanDO.class);
  86 + crmReceivablePlanMapper.insert(dbReceivablePlan);// @Sql: 先插入出一条存在的数据
87 // 准备参数 87 // 准备参数
88 Long id = dbReceivablePlan.getId(); 88 Long id = dbReceivablePlan.getId();
89 89
90 // 调用 90 // 调用
91 receivablePlanService.deleteReceivablePlan(id); 91 receivablePlanService.deleteReceivablePlan(id);
92 // 校验数据不存在了 92 // 校验数据不存在了
93 - assertNull(receivablePlanMapper.selectById(id)); 93 + assertNull(crmReceivablePlanMapper.selectById(id));
94 } 94 }
95 95
96 @Test 96 @Test
@@ -106,8 +106,8 @@ public class ReceivablePlanServiceImplTest extends BaseDbUnitTest { @@ -106,8 +106,8 @@ public class ReceivablePlanServiceImplTest extends BaseDbUnitTest {
106 @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 106 @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
107 public void testGetReceivablePlanPage() { 107 public void testGetReceivablePlanPage() {
108 // mock 数据 108 // mock 数据
109 - ReceivablePlanDO dbReceivablePlan = randomPojo(ReceivablePlanDO.class, o -> { // 等会查询到  
110 - o.setIndexNo(null); 109 + CrmReceivablePlanDO dbReceivablePlan = randomPojo(CrmReceivablePlanDO.class, o -> { // 等会查询到
  110 + o.setPeriod(null);
111 o.setStatus(null); 111 o.setStatus(null);
112 o.setCheckStatus(null); 112 o.setCheckStatus(null);
113 o.setReturnTime(null); 113 o.setReturnTime(null);
@@ -119,45 +119,42 @@ public class ReceivablePlanServiceImplTest extends BaseDbUnitTest { @@ -119,45 +119,42 @@ public class ReceivablePlanServiceImplTest extends BaseDbUnitTest {
119 o.setRemark(null); 119 o.setRemark(null);
120 o.setCreateTime(null); 120 o.setCreateTime(null);
121 }); 121 });
122 - receivablePlanMapper.insert(dbReceivablePlan);  
123 - // 测试 indexNo 不匹配  
124 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setIndexNo(null))); 122 + crmReceivablePlanMapper.insert(dbReceivablePlan);
  123 + // 测试 Period 不匹配
  124 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setPeriod(null)));
125 // 测试 status 不匹配 125 // 测试 status 不匹配
126 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setStatus(null))); 126 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setStatus(null)));
127 // 测试 checkStatus 不匹配 127 // 测试 checkStatus 不匹配
128 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setCheckStatus(null))); 128 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setCheckStatus(null)));
129 // 测试 returnTime 不匹配 129 // 测试 returnTime 不匹配
130 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setReturnTime(null))); 130 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setReturnTime(null)));
131 // 测试 remindDays 不匹配 131 // 测试 remindDays 不匹配
132 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setRemindDays(null))); 132 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setRemindDays(null)));
133 // 测试 remindTime 不匹配 133 // 测试 remindTime 不匹配
134 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setRemindTime(null))); 134 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setRemindTime(null)));
135 // 测试 customerId 不匹配 135 // 测试 customerId 不匹配
136 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setCustomerId(null))); 136 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setCustomerId(null)));
137 // 测试 contractId 不匹配 137 // 测试 contractId 不匹配
138 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setContractId(null))); 138 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setContractId(null)));
139 // 测试 ownerUserId 不匹配 139 // 测试 ownerUserId 不匹配
140 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setOwnerUserId(null))); 140 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setOwnerUserId(null)));
141 // 测试 remark 不匹配 141 // 测试 remark 不匹配
142 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setRemark(null))); 142 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setRemark(null)));
143 // 测试 createTime 不匹配 143 // 测试 createTime 不匹配
144 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setCreateTime(null))); 144 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setCreateTime(null)));
145 // 准备参数 145 // 准备参数
146 - ReceivablePlanPageReqVO reqVO = new ReceivablePlanPageReqVO();  
147 - reqVO.setIndexNo(null); 146 + CrmReceivablePlanPageReqVO reqVO = new CrmReceivablePlanPageReqVO();
148 reqVO.setStatus(null); 147 reqVO.setStatus(null);
149 reqVO.setCheckStatus(null); 148 reqVO.setCheckStatus(null);
150 reqVO.setReturnTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); 149 reqVO.setReturnTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
151 - reqVO.setRemindDays(null);  
152 reqVO.setRemindTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); 150 reqVO.setRemindTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
153 reqVO.setCustomerId(null); 151 reqVO.setCustomerId(null);
154 reqVO.setContractId(null); 152 reqVO.setContractId(null);
155 reqVO.setOwnerUserId(null); 153 reqVO.setOwnerUserId(null);
156 - reqVO.setRemark(null);  
157 reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); 154 reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
158 155
159 // 调用 156 // 调用
160 - PageResult<ReceivablePlanDO> pageResult = receivablePlanService.getReceivablePlanPage(reqVO); 157 + PageResult<CrmReceivablePlanDO> pageResult = receivablePlanService.getReceivablePlanPage(reqVO);
161 // 断言 158 // 断言
162 assertEquals(1, pageResult.getTotal()); 159 assertEquals(1, pageResult.getTotal());
163 assertEquals(1, pageResult.getList().size()); 160 assertEquals(1, pageResult.getList().size());
@@ -168,8 +165,8 @@ public class ReceivablePlanServiceImplTest extends BaseDbUnitTest { @@ -168,8 +165,8 @@ public class ReceivablePlanServiceImplTest extends BaseDbUnitTest {
168 @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 165 @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
169 public void testGetReceivablePlanList() { 166 public void testGetReceivablePlanList() {
170 // mock 数据 167 // mock 数据
171 - ReceivablePlanDO dbReceivablePlan = randomPojo(ReceivablePlanDO.class, o -> { // 等会查询到  
172 - o.setIndexNo(null); 168 + CrmReceivablePlanDO dbReceivablePlan = randomPojo(CrmReceivablePlanDO.class, o -> { // 等会查询到
  169 + o.setPeriod(null);
173 o.setStatus(null); 170 o.setStatus(null);
174 o.setCheckStatus(null); 171 o.setCheckStatus(null);
175 o.setReturnTime(null); 172 o.setReturnTime(null);
@@ -181,32 +178,32 @@ public class ReceivablePlanServiceImplTest extends BaseDbUnitTest { @@ -181,32 +178,32 @@ public class ReceivablePlanServiceImplTest extends BaseDbUnitTest {
181 o.setRemark(null); 178 o.setRemark(null);
182 o.setCreateTime(null); 179 o.setCreateTime(null);
183 }); 180 });
184 - receivablePlanMapper.insert(dbReceivablePlan);  
185 - // 测试 indexNo 不匹配  
186 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setIndexNo(null))); 181 + crmReceivablePlanMapper.insert(dbReceivablePlan);
  182 + // 测试 Period 不匹配
  183 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setPeriod(null)));
187 // 测试 status 不匹配 184 // 测试 status 不匹配
188 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setStatus(null))); 185 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setStatus(null)));
189 // 测试 checkStatus 不匹配 186 // 测试 checkStatus 不匹配
190 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setCheckStatus(null))); 187 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setCheckStatus(null)));
191 // 测试 returnTime 不匹配 188 // 测试 returnTime 不匹配
192 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setReturnTime(null))); 189 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setReturnTime(null)));
193 // 测试 remindDays 不匹配 190 // 测试 remindDays 不匹配
194 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setRemindDays(null))); 191 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setRemindDays(null)));
195 // 测试 remindTime 不匹配 192 // 测试 remindTime 不匹配
196 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setRemindTime(null))); 193 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setRemindTime(null)));
197 // 测试 customerId 不匹配 194 // 测试 customerId 不匹配
198 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setCustomerId(null))); 195 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setCustomerId(null)));
199 // 测试 contractId 不匹配 196 // 测试 contractId 不匹配
200 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setContractId(null))); 197 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setContractId(null)));
201 // 测试 ownerUserId 不匹配 198 // 测试 ownerUserId 不匹配
202 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setOwnerUserId(null))); 199 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setOwnerUserId(null)));
203 // 测试 remark 不匹配 200 // 测试 remark 不匹配
204 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setRemark(null))); 201 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setRemark(null)));
205 // 测试 createTime 不匹配 202 // 测试 createTime 不匹配
206 - receivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setCreateTime(null))); 203 + crmReceivablePlanMapper.insert(cloneIgnoreId(dbReceivablePlan, o -> o.setCreateTime(null)));
207 // 准备参数 204 // 准备参数
208 - ReceivablePlanExportReqVO reqVO = new ReceivablePlanExportReqVO();  
209 - reqVO.setIndexNo(null); 205 + CrmReceivablePlanExportReqVO reqVO = new CrmReceivablePlanExportReqVO();
  206 + reqVO.setPeriod(null);
210 reqVO.setStatus(null); 207 reqVO.setStatus(null);
211 reqVO.setCheckStatus(null); 208 reqVO.setCheckStatus(null);
212 reqVO.setReturnTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); 209 reqVO.setReturnTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
@@ -219,7 +216,7 @@ public class ReceivablePlanServiceImplTest extends BaseDbUnitTest { @@ -219,7 +216,7 @@ public class ReceivablePlanServiceImplTest extends BaseDbUnitTest {
219 reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); 216 reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
220 217
221 // 调用 218 // 调用
222 - List<ReceivablePlanDO> list = receivablePlanService.getReceivablePlanList(reqVO); 219 + List<CrmReceivablePlanDO> list = receivablePlanService.getReceivablePlanList(reqVO);
223 // 断言 220 // 断言
224 assertEquals(1, list.size()); 221 assertEquals(1, list.size());
225 assertPojoEquals(dbReceivablePlan, list.get(0)); 222 assertPojoEquals(dbReceivablePlan, list.get(0));
yudao-module-crm/yudao-module-crm-biz/src/test/java/cn/iocoder/yudao/module/crm/service/receivable/ReceivableServiceImplTest.java renamed to yudao-module-crm/yudao-module-crm-biz/src/test/java/cn/iocoder/yudao/module/crm/service/receivable/CrmCrmReceivableServiceImplTest.java
@@ -2,12 +2,12 @@ package cn.iocoder.yudao.module.crm.service.receivable; @@ -2,12 +2,12 @@ package cn.iocoder.yudao.module.crm.service.receivable;
2 2
3 import cn.iocoder.yudao.framework.common.pojo.PageResult; 3 import cn.iocoder.yudao.framework.common.pojo.PageResult;
4 import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; 4 import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest;
5 -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivableCreateReqVO;  
6 -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivableExportReqVO;  
7 -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivablePageReqVO;  
8 -import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.ReceivableUpdateReqVO;  
9 -import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.ReceivableDO;  
10 -import cn.iocoder.yudao.module.crm.dal.mysql.receivable.ReceivableMapper; 5 +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivableCreateReqVO;
  6 +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivableExportReqVO;
  7 +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivablePageReqVO;
  8 +import cn.iocoder.yudao.module.crm.controller.admin.receivable.vo.CrmReceivableUpdateReqVO;
  9 +import cn.iocoder.yudao.module.crm.dal.dataobject.receivable.CrmReceivableDO;
  10 +import cn.iocoder.yudao.module.crm.dal.mysql.receivable.CrmReceivableMapper;
11 import org.junit.jupiter.api.Disabled; 11 import org.junit.jupiter.api.Disabled;
12 import org.junit.jupiter.api.Test; 12 import org.junit.jupiter.api.Test;
13 import org.springframework.context.annotation.Import; 13 import org.springframework.context.annotation.Import;
@@ -26,54 +26,54 @@ import static org.junit.jupiter.api.Assertions.*; @@ -26,54 +26,54 @@ import static org.junit.jupiter.api.Assertions.*;
26 26
27 // TODO 芋艿:等实现完,在校验下; 27 // TODO 芋艿:等实现完,在校验下;
28 /** 28 /**
29 - * {@link ReceivableServiceImpl} 的单元测试类 29 + * {@link CrmReceivableServiceImpl} 的单元测试类
30 * 30 *
31 * @author 赤焰 31 * @author 赤焰
32 */ 32 */
33 -@Import(ReceivableServiceImpl.class)  
34 -public class ReceivableServiceImplTest extends BaseDbUnitTest { 33 +@Import(CrmReceivableServiceImpl.class)
  34 +public class CrmCrmReceivableServiceImplTest extends BaseDbUnitTest {
35 35
36 @Resource 36 @Resource
37 - private ReceivableServiceImpl receivableService; 37 + private CrmReceivableServiceImpl receivableService;
38 38
39 @Resource 39 @Resource
40 - private ReceivableMapper receivableMapper; 40 + private CrmReceivableMapper crmReceivableMapper;
41 41
42 @Test 42 @Test
43 public void testCreateReceivable_success() { 43 public void testCreateReceivable_success() {
44 // 准备参数 44 // 准备参数
45 - ReceivableCreateReqVO reqVO = randomPojo(ReceivableCreateReqVO.class); 45 + CrmReceivableCreateReqVO reqVO = randomPojo(CrmReceivableCreateReqVO.class);
46 46
47 // 调用 47 // 调用
48 Long receivableId = receivableService.createReceivable(reqVO); 48 Long receivableId = receivableService.createReceivable(reqVO);
49 // 断言 49 // 断言
50 assertNotNull(receivableId); 50 assertNotNull(receivableId);
51 // 校验记录的属性是否正确 51 // 校验记录的属性是否正确
52 - ReceivableDO receivable = receivableMapper.selectById(receivableId); 52 + CrmReceivableDO receivable = crmReceivableMapper.selectById(receivableId);
53 assertPojoEquals(reqVO, receivable); 53 assertPojoEquals(reqVO, receivable);
54 } 54 }
55 55
56 @Test 56 @Test
57 public void testUpdateReceivable_success() { 57 public void testUpdateReceivable_success() {
58 // mock 数据 58 // mock 数据
59 - ReceivableDO dbReceivable = randomPojo(ReceivableDO.class);  
60 - receivableMapper.insert(dbReceivable);// @Sql: 先插入出一条存在的数据 59 + CrmReceivableDO dbReceivable = randomPojo(CrmReceivableDO.class);
  60 + crmReceivableMapper.insert(dbReceivable);// @Sql: 先插入出一条存在的数据
61 // 准备参数 61 // 准备参数
62 - ReceivableUpdateReqVO reqVO = randomPojo(ReceivableUpdateReqVO.class, o -> { 62 + CrmReceivableUpdateReqVO reqVO = randomPojo(CrmReceivableUpdateReqVO.class, o -> {
63 o.setId(dbReceivable.getId()); // 设置更新的 ID 63 o.setId(dbReceivable.getId()); // 设置更新的 ID
64 }); 64 });
65 65
66 // 调用 66 // 调用
67 receivableService.updateReceivable(reqVO); 67 receivableService.updateReceivable(reqVO);
68 // 校验是否更新正确 68 // 校验是否更新正确
69 - ReceivableDO receivable = receivableMapper.selectById(reqVO.getId()); // 获取最新的 69 + CrmReceivableDO receivable = crmReceivableMapper.selectById(reqVO.getId()); // 获取最新的
70 assertPojoEquals(reqVO, receivable); 70 assertPojoEquals(reqVO, receivable);
71 } 71 }
72 72
73 @Test 73 @Test
74 public void testUpdateReceivable_notExists() { 74 public void testUpdateReceivable_notExists() {
75 // 准备参数 75 // 准备参数
76 - ReceivableUpdateReqVO reqVO = randomPojo(ReceivableUpdateReqVO.class); 76 + CrmReceivableUpdateReqVO reqVO = randomPojo(CrmReceivableUpdateReqVO.class);
77 77
78 // 调用, 并断言异常 78 // 调用, 并断言异常
79 assertServiceException(() -> receivableService.updateReceivable(reqVO), RECEIVABLE_NOT_EXISTS); 79 assertServiceException(() -> receivableService.updateReceivable(reqVO), RECEIVABLE_NOT_EXISTS);
@@ -82,15 +82,15 @@ public class ReceivableServiceImplTest extends BaseDbUnitTest { @@ -82,15 +82,15 @@ public class ReceivableServiceImplTest extends BaseDbUnitTest {
82 @Test 82 @Test
83 public void testDeleteReceivable_success() { 83 public void testDeleteReceivable_success() {
84 // mock 数据 84 // mock 数据
85 - ReceivableDO dbReceivable = randomPojo(ReceivableDO.class);  
86 - receivableMapper.insert(dbReceivable);// @Sql: 先插入出一条存在的数据 85 + CrmReceivableDO dbReceivable = randomPojo(CrmReceivableDO.class);
  86 + crmReceivableMapper.insert(dbReceivable);// @Sql: 先插入出一条存在的数据
87 // 准备参数 87 // 准备参数
88 Long id = dbReceivable.getId(); 88 Long id = dbReceivable.getId();
89 89
90 // 调用 90 // 调用
91 receivableService.deleteReceivable(id); 91 receivableService.deleteReceivable(id);
92 // 校验数据不存在了 92 // 校验数据不存在了
93 - assertNull(receivableMapper.selectById(id)); 93 + assertNull(crmReceivableMapper.selectById(id));
94 } 94 }
95 95
96 @Test 96 @Test
@@ -106,7 +106,7 @@ public class ReceivableServiceImplTest extends BaseDbUnitTest { @@ -106,7 +106,7 @@ public class ReceivableServiceImplTest extends BaseDbUnitTest {
106 @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 106 @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
107 public void testGetReceivablePage() { 107 public void testGetReceivablePage() {
108 // mock 数据 108 // mock 数据
109 - ReceivableDO dbReceivable = randomPojo(ReceivableDO.class, o -> { // 等会查询到 109 + CrmReceivableDO dbReceivable = randomPojo(CrmReceivableDO.class, o -> { // 等会查询到
110 o.setNo(null); 110 o.setNo(null);
111 o.setPlanId(null); 111 o.setPlanId(null);
112 o.setCustomerId(null); 112 o.setCustomerId(null);
@@ -125,63 +125,57 @@ public class ReceivableServiceImplTest extends BaseDbUnitTest { @@ -125,63 +125,57 @@ public class ReceivableServiceImplTest extends BaseDbUnitTest {
125 o.setRemark(null); 125 o.setRemark(null);
126 o.setCreateTime(null); 126 o.setCreateTime(null);
127 }); 127 });
128 - receivableMapper.insert(dbReceivable); 128 + crmReceivableMapper.insert(dbReceivable);
129 // 测试 no 不匹配 129 // 测试 no 不匹配
130 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setNo(null))); 130 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setNo(null)));
131 // 测试 planId 不匹配 131 // 测试 planId 不匹配
132 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setPlanId(null))); 132 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setPlanId(null)));
133 // 测试 customerId 不匹配 133 // 测试 customerId 不匹配
134 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setCustomerId(null))); 134 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setCustomerId(null)));
135 // 测试 contractId 不匹配 135 // 测试 contractId 不匹配
136 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setContractId(null))); 136 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setContractId(null)));
137 // 测试 checkStatus 不匹配 137 // 测试 checkStatus 不匹配
138 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setCheckStatus(null))); 138 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setCheckStatus(null)));
139 // 测试 processInstanceId 不匹配 139 // 测试 processInstanceId 不匹配
140 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setProcessInstanceId(null))); 140 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setProcessInstanceId(null)));
141 // 测试 returnTime 不匹配 141 // 测试 returnTime 不匹配
142 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setReturnTime(null))); 142 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setReturnTime(null)));
143 // 测试 returnType 不匹配 143 // 测试 returnType 不匹配
144 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setReturnType(null))); 144 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setReturnType(null)));
145 // 测试 price 不匹配 145 // 测试 price 不匹配
146 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setPrice(null))); 146 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setPrice(null)));
147 // 测试 ownerUserId 不匹配 147 // 测试 ownerUserId 不匹配
148 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setOwnerUserId(null))); 148 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setOwnerUserId(null)));
149 // 测试 batchId 不匹配 149 // 测试 batchId 不匹配
150 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setBatchId(null))); 150 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setBatchId(null)));
151 // 测试 sort 不匹配 151 // 测试 sort 不匹配
152 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setSort(null))); 152 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setSort(null)));
153 // 测试 dataScope 不匹配 153 // 测试 dataScope 不匹配
154 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setDataScope(null))); 154 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setDataScope(null)));
155 // 测试 dataScopeDeptIds 不匹配 155 // 测试 dataScopeDeptIds 不匹配
156 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setDataScopeDeptIds(null))); 156 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setDataScopeDeptIds(null)));
157 // 测试 status 不匹配 157 // 测试 status 不匹配
158 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setStatus(null))); 158 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setStatus(null)));
159 // 测试 remark 不匹配 159 // 测试 remark 不匹配
160 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setRemark(null))); 160 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setRemark(null)));
161 // 测试 createTime 不匹配 161 // 测试 createTime 不匹配
162 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setCreateTime(null))); 162 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setCreateTime(null)));
163 // 准备参数 163 // 准备参数
164 - ReceivablePageReqVO reqVO = new ReceivablePageReqVO(); 164 + CrmReceivablePageReqVO reqVO = new CrmReceivablePageReqVO();
165 reqVO.setNo(null); 165 reqVO.setNo(null);
166 reqVO.setPlanId(null); 166 reqVO.setPlanId(null);
167 reqVO.setCustomerId(null); 167 reqVO.setCustomerId(null);
168 reqVO.setContractId(null); 168 reqVO.setContractId(null);
169 reqVO.setCheckStatus(null); 169 reqVO.setCheckStatus(null);
170 - reqVO.setProcessInstanceId(null);  
171 reqVO.setReturnTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); 170 reqVO.setReturnTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
172 reqVO.setReturnType(null); 171 reqVO.setReturnType(null);
173 reqVO.setPrice(null); 172 reqVO.setPrice(null);
174 reqVO.setOwnerUserId(null); 173 reqVO.setOwnerUserId(null);
175 - reqVO.setBatchId(null);  
176 - reqVO.setSort(null);  
177 - reqVO.setDataScope(null);  
178 - reqVO.setDataScopeDeptIds(null);  
179 reqVO.setStatus(null); 174 reqVO.setStatus(null);
180 - reqVO.setRemark(null);  
181 reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); 175 reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
182 176
183 // 调用 177 // 调用
184 - PageResult<ReceivableDO> pageResult = receivableService.getReceivablePage(reqVO); 178 + PageResult<CrmReceivableDO> pageResult = receivableService.getReceivablePage(reqVO);
185 // 断言 179 // 断言
186 assertEquals(1, pageResult.getTotal()); 180 assertEquals(1, pageResult.getTotal());
187 assertEquals(1, pageResult.getList().size()); 181 assertEquals(1, pageResult.getList().size());
@@ -192,7 +186,7 @@ public class ReceivableServiceImplTest extends BaseDbUnitTest { @@ -192,7 +186,7 @@ public class ReceivableServiceImplTest extends BaseDbUnitTest {
192 @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 186 @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
193 public void testGetReceivableList() { 187 public void testGetReceivableList() {
194 // mock 数据 188 // mock 数据
195 - ReceivableDO dbReceivable = randomPojo(ReceivableDO.class, o -> { // 等会查询到 189 + CrmReceivableDO dbReceivable = randomPojo(CrmReceivableDO.class, o -> { // 等会查询到
196 o.setNo(null); 190 o.setNo(null);
197 o.setPlanId(null); 191 o.setPlanId(null);
198 o.setCustomerId(null); 192 o.setCustomerId(null);
@@ -211,63 +205,59 @@ public class ReceivableServiceImplTest extends BaseDbUnitTest { @@ -211,63 +205,59 @@ public class ReceivableServiceImplTest extends BaseDbUnitTest {
211 o.setRemark(null); 205 o.setRemark(null);
212 o.setCreateTime(null); 206 o.setCreateTime(null);
213 }); 207 });
214 - receivableMapper.insert(dbReceivable); 208 + crmReceivableMapper.insert(dbReceivable);
215 // 测试 no 不匹配 209 // 测试 no 不匹配
216 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setNo(null))); 210 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setNo(null)));
217 // 测试 planId 不匹配 211 // 测试 planId 不匹配
218 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setPlanId(null))); 212 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setPlanId(null)));
219 // 测试 customerId 不匹配 213 // 测试 customerId 不匹配
220 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setCustomerId(null))); 214 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setCustomerId(null)));
221 // 测试 contractId 不匹配 215 // 测试 contractId 不匹配
222 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setContractId(null))); 216 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setContractId(null)));
223 // 测试 checkStatus 不匹配 217 // 测试 checkStatus 不匹配
224 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setCheckStatus(null))); 218 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setCheckStatus(null)));
225 // 测试 processInstanceId 不匹配 219 // 测试 processInstanceId 不匹配
226 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setProcessInstanceId(null))); 220 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setProcessInstanceId(null)));
227 // 测试 returnTime 不匹配 221 // 测试 returnTime 不匹配
228 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setReturnTime(null))); 222 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setReturnTime(null)));
229 // 测试 returnType 不匹配 223 // 测试 returnType 不匹配
230 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setReturnType(null))); 224 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setReturnType(null)));
231 // 测试 price 不匹配 225 // 测试 price 不匹配
232 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setPrice(null))); 226 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setPrice(null)));
233 // 测试 ownerUserId 不匹配 227 // 测试 ownerUserId 不匹配
234 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setOwnerUserId(null))); 228 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setOwnerUserId(null)));
235 // 测试 batchId 不匹配 229 // 测试 batchId 不匹配
236 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setBatchId(null))); 230 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setBatchId(null)));
237 // 测试 sort 不匹配 231 // 测试 sort 不匹配
238 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setSort(null))); 232 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setSort(null)));
239 // 测试 dataScope 不匹配 233 // 测试 dataScope 不匹配
240 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setDataScope(null))); 234 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setDataScope(null)));
241 // 测试 dataScopeDeptIds 不匹配 235 // 测试 dataScopeDeptIds 不匹配
242 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setDataScopeDeptIds(null))); 236 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setDataScopeDeptIds(null)));
243 // 测试 status 不匹配 237 // 测试 status 不匹配
244 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setStatus(null))); 238 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setStatus(null)));
245 // 测试 remark 不匹配 239 // 测试 remark 不匹配
246 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setRemark(null))); 240 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setRemark(null)));
247 // 测试 createTime 不匹配 241 // 测试 createTime 不匹配
248 - receivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setCreateTime(null))); 242 + crmReceivableMapper.insert(cloneIgnoreId(dbReceivable, o -> o.setCreateTime(null)));
249 // 准备参数 243 // 准备参数
250 - ReceivableExportReqVO reqVO = new ReceivableExportReqVO(); 244 + CrmReceivableExportReqVO reqVO = new CrmReceivableExportReqVO();
251 reqVO.setNo(null); 245 reqVO.setNo(null);
252 reqVO.setPlanId(null); 246 reqVO.setPlanId(null);
253 reqVO.setCustomerId(null); 247 reqVO.setCustomerId(null);
254 reqVO.setContractId(null); 248 reqVO.setContractId(null);
255 reqVO.setCheckStatus(null); 249 reqVO.setCheckStatus(null);
256 - reqVO.setProcessInstanceId(null);  
257 reqVO.setReturnTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); 250 reqVO.setReturnTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
258 reqVO.setReturnType(null); 251 reqVO.setReturnType(null);
259 reqVO.setPrice(null); 252 reqVO.setPrice(null);
260 reqVO.setOwnerUserId(null); 253 reqVO.setOwnerUserId(null);
261 reqVO.setBatchId(null); 254 reqVO.setBatchId(null);
262 - reqVO.setSort(null);  
263 - reqVO.setDataScope(null);  
264 - reqVO.setDataScopeDeptIds(null);  
265 reqVO.setStatus(null); 255 reqVO.setStatus(null);
266 reqVO.setRemark(null); 256 reqVO.setRemark(null);
267 reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); 257 reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
268 258
269 // 调用 259 // 调用
270 - List<ReceivableDO> list = receivableService.getReceivableList(reqVO); 260 + List<CrmReceivableDO> list = receivableService.getReceivableList(reqVO);
271 // 断言 261 // 断言
272 assertEquals(1, list.size()); 262 assertEquals(1, list.size());
273 assertPojoEquals(dbReceivable, list.get(0)); 263 assertPojoEquals(dbReceivable, list.get(0));