Commit 6f8fd383f7f6989616594966918f318c8d6f31fb

Authored by YunaiV
1 parent 24e6deb8

code review:CRM 商机的逻辑

yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/business/CrmBusinessController.java
... ... @@ -19,7 +19,6 @@ import javax.annotation.Resource;
19 19 import javax.servlet.http.HttpServletResponse;
20 20 import javax.validation.Valid;
21 21 import java.io.IOException;
22   -import java.util.Collection;
23 22 import java.util.List;
24 23  
25 24 import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
... ... @@ -67,15 +66,6 @@ public class CrmBusinessController {
67 66 return success(CrmBusinessConvert.INSTANCE.convert(business));
68 67 }
69 68  
70   - @GetMapping("/list")
71   - @Operation(summary = "获得商机列表")
72   - @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
73   - @PreAuthorize("@ss.hasPermission('crm:business:query')")
74   - public CommonResult<List<CrmBusinessRespVO>> getBusinessList(@RequestParam("ids") Collection<Long> ids) {
75   - List<CrmBusinessDO> list = businessService.getBusinessList(ids);
76   - return success(CrmBusinessConvert.INSTANCE.convertList(list));
77   - }
78   -
79 69 @GetMapping("/page")
80 70 @Operation(summary = "获得商机分页")
81 71 @PreAuthorize("@ss.hasPermission('crm:business:query')")
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/business/vo/CrmBusinessBaseVO.java
... ... @@ -21,10 +21,12 @@ public class CrmBusinessBaseVO {
21 21 @NotNull(message = "商机名称不能为空")
22 22 private String name;
23 23  
  24 + // TODO @ljileo:要写 requiredMode = Schema.RequiredMode.REQUIRED
24 25 @Schema(description = "商机状态类型编号", example = "25714")
25 26 @NotNull(message = "商机状态类型不能为空")
26 27 private Long statusTypeId;
27 28  
  29 + // TODO @ljileo:要写 requiredMode = Schema.RequiredMode.REQUIRED
28 30 @Schema(description = "商机状态编号", example = "30320")
29 31 @NotNull(message = "商机状态不能为空")
30 32 private Long statusId;
... ... @@ -41,9 +43,11 @@ public class CrmBusinessBaseVO {
41 43 @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
42 44 private LocalDateTime dealTime;
43 45  
  46 + // TODO @ljileo:金额使用 Integer 类型,转换成分
44 47 @Schema(description = "商机金额", example = "12371")
45 48 private BigDecimal price;
46 49  
  50 + // TODO @ljileo:折扣使用 Integer 类型,存储时,默认 * 100;展示的时候,前端需要 / 100;避免精度丢失问题
47 51 @Schema(description = "整单折扣")
48 52 private BigDecimal discountPercent;
49 53  
... ... @@ -53,25 +57,32 @@ public class CrmBusinessBaseVO {
53 57 @Schema(description = "备注", example = "随便")
54 58 private String remark;
55 59  
  60 + // TODO @ljileo:这个新建和修改的时候,应该不传递哈;应该新建的人,就是它的负责人
56 61 @Schema(description = "负责人的用户编号", example = "25562")
57 62 private Long ownerUserId;
58 63  
  64 + // TODO @ljileo:这个新建和修改的时候,应该不传递哈
59 65 @Schema(description = "只读权限的用户编号数组", requiredMode = Schema.RequiredMode.REQUIRED)
60 66 private String roUserIds;
61 67  
  68 + // TODO @ljileo:这个新建和修改的时候,应该不传递哈
62 69 @Schema(description = "读写权限的用户编号数组", requiredMode = Schema.RequiredMode.REQUIRED)
63 70 private String rwUserIds;
64 71  
  72 + // TODO @lijieo:新建的时候,不传递这个字段哈;
65 73 @Schema(description = "1赢单2输单3无效", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
66 74 private Integer endStatus;
67 75  
  76 + // TODO @lijieo:新建的时候,不传递这个字段哈;
68 77 @Schema(description = "结束时的备注", example = "你说的对")
69 78 private String endRemark;
70 79  
  80 + // TODO @lijieo:新建的时候,不传递这个字段哈;
71 81 @Schema(description = "最后跟进时间")
72 82 @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
73 83 private LocalDateTime contactLastTime;
74 84  
  85 + // TODO @lijieo:新建的时候,不传递这个字段哈;
75 86 @Schema(description = "跟进状态", example = "1")
76 87 private Integer followUpStatus;
77 88  
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/business/vo/CrmBusinessCreateReqVO.java
1 1 package cn.iocoder.yudao.module.crm.controller.admin.business.vo;
2 2  
3   -import lombok.*;
4   -import java.util.*;
5 3 import io.swagger.v3.oas.annotations.media.Schema;
6   -import javax.validation.constraints.*;
  4 +import lombok.Data;
  5 +import lombok.EqualsAndHashCode;
  6 +import lombok.ToString;
7 7  
8 8 @Schema(description = "管理后台 - 商机创建 Request VO")
9 9 @Data
... ... @@ -11,4 +11,6 @@ import javax.validation.constraints.*;
11 11 @ToString(callSuper = true)
12 12 public class CrmBusinessCreateReqVO extends CrmBusinessBaseVO {
13 13  
  14 + // TODO @ljileo:新建的时候,应该可以传递添加的产品;
  15 +
14 16 }
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/business/vo/CrmBusinessPageReqVO.java
... ... @@ -18,6 +18,8 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
18 18 @ToString(callSuper = true)
19 19 public class CrmBusinessPageReqVO extends PageParam {
20 20  
  21 + // TODO @ljileo:目前就使用 name 检索即可;
  22 +
21 23 @Schema(description = "商机名称", example = "李四")
22 24 private String name;
23 25  
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/business/vo/CrmBusinessUpdateReqVO.java
1 1 package cn.iocoder.yudao.module.crm.controller.admin.business.vo;
2 2  
3 3 import io.swagger.v3.oas.annotations.media.Schema;
4   -import lombok.*;
5   -import java.util.*;
6   -import javax.validation.constraints.*;
  4 +import lombok.Data;
  5 +import lombok.EqualsAndHashCode;
  6 +import lombok.ToString;
  7 +
  8 +import javax.validation.constraints.NotNull;
7 9  
8 10 @Schema(description = "管理后台 - 商机更新 Request VO")
9 11 @Data
... ... @@ -15,4 +17,6 @@ public class CrmBusinessUpdateReqVO extends CrmBusinessBaseVO {
15 17 @NotNull(message = "主键不能为空")
16 18 private Long id;
17 19  
  20 + // TODO @ljileo:修改的时候,应该可以传递添加的产品;
  21 +
18 22 }
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/business/CrmBusinessConvert.java
... ... @@ -25,8 +25,6 @@ public interface CrmBusinessConvert {
25 25  
26 26 CrmBusinessRespVO convert(CrmBusinessDO bean);
27 27  
28   - List<CrmBusinessRespVO> convertList(List<CrmBusinessDO> list);
29   -
30 28 PageResult<CrmBusinessRespVO> convertPage(PageResult<CrmBusinessDO> page);
31 29  
32 30 List<CrmBusinessExcelVO> convertList02(List<CrmBusinessDO> list);
... ...
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/business/CrmBusinessDO.java
... ... @@ -35,10 +35,14 @@ public class CrmBusinessDO extends BaseDO {
35 35 private String name;
36 36 /**
37 37 * 商机状态类型编号
  38 + *
  39 + * TODO @ljileo:这个字段,后续要写下关联的实体哈
38 40 */
39 41 private Long statusTypeId;
40 42 /**
41 43 * 商机状态编号
  44 + *
  45 + * TODO @ljileo:这个字段,后续要写下关联的实体哈
42 46 */
43 47 private Long statusId;
44 48 /**
... ... @@ -47,6 +51,8 @@ public class CrmBusinessDO extends BaseDO {
47 51 private LocalDateTime contactNextTime;
48 52 /**
49 53 * 客户编号
  54 + *
  55 + * TODO @ljileo:这个字段,后续要写下关联的实体哈
50 56 */
51 57 private Long customerId;
52 58 /**
... ... @@ -55,14 +61,20 @@ public class CrmBusinessDO extends BaseDO {
55 61 private LocalDateTime dealTime;
56 62 /**
57 63 * 商机金额
  64 + *
  65 + * TODO @lijie:Integer
58 66 */
59 67 private BigDecimal price;
60 68 /**
61 69 * 整单折扣
  70 + *
  71 + * TODO @lijie:Integer
62 72 */
63 73 private BigDecimal discountPercent;
64 74 /**
65 75 * 产品总金额
  76 + *
  77 + * TODO @lijie:Integer
66 78 */
67 79 private BigDecimal productPrice;
68 80 /**
... ... @@ -75,14 +87,20 @@ public class CrmBusinessDO extends BaseDO {
75 87 private Long ownerUserId;
76 88 /**
77 89 * 只读权限的用户编号数组
  90 + *
  91 + * TODO @lijie:应该是 List<Long>,然后使用下对应的 typehandler
78 92 */
79 93 private String roUserIds;
80 94 /**
81 95 * 读写权限的用户编号数组
  96 + *
  97 + * TODO @lijie:应该是 List<Long>,然后使用下对应的 typehandler
82 98 */
83 99 private String rwUserIds;
84 100 /**
85 101 * 1赢单2输单3无效
  102 + *
  103 + * TODO @lijie:搞个枚举;
86 104 */
87 105 private Integer endStatus;
88 106 /**
... ... @@ -95,6 +113,8 @@ public class CrmBusinessDO extends BaseDO {
95 113 private LocalDateTime contactLastTime;
96 114 /**
97 115 * 跟进状态
  116 + *
  117 + * TODO @lijie:目前就是 Boolean;是否跟进
98 118 */
99 119 private Integer followUpStatus;
100 120  
... ...