Commit 74f786f8ed2a31e6bd947c42b3eadd92f34df43e
1 parent
0719efb4
code review:客户表的实现
Showing
11 changed files
with
21 additions
and
12 deletions
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/vo/CrmCustomerBaseVO.java
| @@ -19,14 +19,16 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ | @@ -19,14 +19,16 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ | ||
| 19 | @Data | 19 | @Data |
| 20 | public class CrmCustomerBaseVO { | 20 | public class CrmCustomerBaseVO { |
| 21 | 21 | ||
| 22 | - @Schema(description = "客户名称", example = "赵六") | 22 | + @Schema(description = "客户名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") |
| 23 | @NotEmpty(message = "客户名称不能为空") | 23 | @NotEmpty(message = "客户名称不能为空") |
| 24 | private String name; | 24 | private String name; |
| 25 | 25 | ||
| 26 | + // TODO wanwan:这个字段应该只有 RespVO 会有;创建和修改不传递; | ||
| 26 | @Schema(description = "跟进状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") | 27 | @Schema(description = "跟进状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") |
| 27 | @NotNull(message = "跟进状态不能为空") | 28 | @NotNull(message = "跟进状态不能为空") |
| 28 | private Boolean followUpStatus; | 29 | private Boolean followUpStatus; |
| 29 | 30 | ||
| 31 | + // TODO wanwan:这个字段应该只有 RespVO 会有;创建和修改不传递; | ||
| 30 | @Schema(description = "锁定状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") | 32 | @Schema(description = "锁定状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") |
| 31 | @NotNull(message = "锁定状态不能为空") | 33 | @NotNull(message = "锁定状态不能为空") |
| 32 | private Boolean lockStatus; | 34 | private Boolean lockStatus; |
| @@ -45,6 +47,7 @@ public class CrmCustomerBaseVO { | @@ -45,6 +47,7 @@ public class CrmCustomerBaseVO { | ||
| 45 | @Schema(description = "备注", example = "随便") | 47 | @Schema(description = "备注", example = "随便") |
| 46 | private String remark; | 48 | private String remark; |
| 47 | 49 | ||
| 50 | + // TODO wanwan:这个字段应该只有 RespVO 会有;创建和修改不传递;因为它会在“移交”里面做哈 | ||
| 48 | @Schema(description = "负责人的用户编号", example = "25682") | 51 | @Schema(description = "负责人的用户编号", example = "25682") |
| 49 | @NotNull(message = "负责人不能为空") | 52 | @NotNull(message = "负责人不能为空") |
| 50 | private Long ownerUserId; | 53 | private Long ownerUserId; |
| @@ -55,12 +58,14 @@ public class CrmCustomerBaseVO { | @@ -55,12 +58,14 @@ public class CrmCustomerBaseVO { | ||
| 55 | @Schema(description = "详细地址", example = "北京市海淀区") | 58 | @Schema(description = "详细地址", example = "北京市海淀区") |
| 56 | private String detailAddress; | 59 | private String detailAddress; |
| 57 | 60 | ||
| 61 | + // TODO @芋艿:longitude、latitude 这两个字段删除; | ||
| 58 | @Schema(description = "地理位置经度", example = "116.40341") | 62 | @Schema(description = "地理位置经度", example = "116.40341") |
| 59 | private String longitude; | 63 | private String longitude; |
| 60 | 64 | ||
| 61 | @Schema(description = "地理位置维度", example = "39.92409") | 65 | @Schema(description = "地理位置维度", example = "39.92409") |
| 62 | private String latitude; | 66 | private String latitude; |
| 63 | 67 | ||
| 68 | + // TODO wanwan:这个字段应该只有 RespVO 会有;创建和修改不传递; | ||
| 64 | @Schema(description = "最后跟进时间") | 69 | @Schema(description = "最后跟进时间") |
| 65 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | 70 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
| 66 | private LocalDateTime contactLastTime; | 71 | private LocalDateTime contactLastTime; |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/vo/CrmCustomerCreateReqVO.java
| @@ -11,9 +11,11 @@ import lombok.ToString; | @@ -11,9 +11,11 @@ import lombok.ToString; | ||
| 11 | @ToString(callSuper = true) | 11 | @ToString(callSuper = true) |
| 12 | public class CrmCustomerCreateReqVO extends CrmCustomerBaseVO { | 12 | public class CrmCustomerCreateReqVO extends CrmCustomerBaseVO { |
| 13 | 13 | ||
| 14 | + // TODO @wanwan:类型应该是传递 List<Long>; 不过这个字段,默认新建的时候不传递,在“移交”功能里管理 | ||
| 14 | @Schema(description = "只读权限的用户编号数组") | 15 | @Schema(description = "只读权限的用户编号数组") |
| 15 | private String roUserIds; | 16 | private String roUserIds; |
| 16 | 17 | ||
| 18 | + // TODO @wanwan:类型应该是传递 List<Long>; 不过这个字段,默认新建的时候不传递,在“移交”功能里管理 | ||
| 17 | @Schema(description = "读写权限的用户编号数组") | 19 | @Schema(description = "读写权限的用户编号数组") |
| 18 | private String rwUserIds; | 20 | private String rwUserIds; |
| 19 | 21 |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/vo/CrmCustomerExcelVO.java
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/vo/CrmCustomerExportReqVO.java
| @@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.crm.controller.admin.customer.vo; | @@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.crm.controller.admin.customer.vo; | ||
| 3 | import io.swagger.v3.oas.annotations.media.Schema; | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | import lombok.Data; | 4 | import lombok.Data; |
| 5 | 5 | ||
| 6 | +// TODO 芋艿:导出最后做,等基本确认的差不多之后; | ||
| 6 | @Schema(description = "管理后台 - 客户 Excel 导出 Request VO,参数和 CrmCustomerPageReqVO 是一致的") | 7 | @Schema(description = "管理后台 - 客户 Excel 导出 Request VO,参数和 CrmCustomerPageReqVO 是一致的") |
| 7 | @Data | 8 | @Data |
| 8 | public class CrmCustomerExportReqVO { | 9 | public class CrmCustomerExportReqVO { |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/vo/CrmCustomerPageReqVO.java
| @@ -18,10 +18,13 @@ public class CrmCustomerPageReqVO extends PageParam { | @@ -18,10 +18,13 @@ public class CrmCustomerPageReqVO extends PageParam { | ||
| 18 | @Schema(description = "手机", example = "18000000000") | 18 | @Schema(description = "手机", example = "18000000000") |
| 19 | private String mobile; | 19 | private String mobile; |
| 20 | 20 | ||
| 21 | + // TODO @wanwan:这个字段不需要哈 | ||
| 21 | @Schema(description = "电话", example = "18000000000") | 22 | @Schema(description = "电话", example = "18000000000") |
| 22 | private String telephone; | 23 | private String telephone; |
| 23 | 24 | ||
| 25 | + // TODO @wanwan:这个字段不需要哈 | ||
| 24 | @Schema(description = "网址", example = "https://www.baidu.com") | 26 | @Schema(description = "网址", example = "https://www.baidu.com") |
| 25 | private String website; | 27 | private String website; |
| 26 | 28 | ||
| 29 | + // TODO @芋艿:场景; | ||
| 27 | } | 30 | } |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/vo/CrmCustomerUpdateReqVO.java
| @@ -17,6 +17,7 @@ public class CrmCustomerUpdateReqVO extends CrmCustomerBaseVO { | @@ -17,6 +17,7 @@ public class CrmCustomerUpdateReqVO extends CrmCustomerBaseVO { | ||
| 17 | @NotNull(message = "编号不能为空") | 17 | @NotNull(message = "编号不能为空") |
| 18 | private Long id; | 18 | private Long id; |
| 19 | 19 | ||
| 20 | + // TODO @wanwan:下面两个字段,同 CrmCustomerCreateReqVO | ||
| 20 | @Schema(description = "只读权限的用户编号数组") | 21 | @Schema(description = "只读权限的用户编号数组") |
| 21 | private String roUserIds; | 22 | private String roUserIds; |
| 22 | 23 |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/convert/customer/CrmCustomerConvert.java
| @@ -25,8 +25,6 @@ public interface CrmCustomerConvert { | @@ -25,8 +25,6 @@ public interface CrmCustomerConvert { | ||
| 25 | 25 | ||
| 26 | CrmCustomerRespVO convert(CrmCustomerDO bean); | 26 | CrmCustomerRespVO convert(CrmCustomerDO bean); |
| 27 | 27 | ||
| 28 | - List<CrmCustomerRespVO> convertList(List<CrmCustomerDO> list); | ||
| 29 | - | ||
| 30 | PageResult<CrmCustomerRespVO> convertPage(PageResult<CrmCustomerDO> page); | 28 | PageResult<CrmCustomerRespVO> convertPage(PageResult<CrmCustomerDO> page); |
| 31 | 29 | ||
| 32 | List<CrmCustomerExcelVO> convertList02(List<CrmCustomerDO> list); | 30 | List<CrmCustomerExcelVO> convertList02(List<CrmCustomerDO> list); |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/clue/CrmClueDO.java
| @@ -44,7 +44,8 @@ public class CrmClueDO extends BaseDO { | @@ -44,7 +44,8 @@ public class CrmClueDO extends BaseDO { | ||
| 44 | private String name; | 44 | private String name; |
| 45 | /** | 45 | /** |
| 46 | * 客户 id | 46 | * 客户 id |
| 47 | - * 对应 {@link CrmCustomerDO#getId()} | 47 | + * |
| 48 | + * 关联 {@link CrmCustomerDO#getId()} | ||
| 48 | */ | 49 | */ |
| 49 | private Long customerId; | 50 | private Long customerId; |
| 50 | /** | 51 | /** |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/customer/CrmCustomerDO.java
| @@ -4,11 +4,11 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | @@ -4,11 +4,11 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||
| 4 | import com.baomidou.mybatisplus.annotation.KeySequence; | 4 | import com.baomidou.mybatisplus.annotation.KeySequence; |
| 5 | import com.baomidou.mybatisplus.annotation.TableId; | 5 | import com.baomidou.mybatisplus.annotation.TableId; |
| 6 | import com.baomidou.mybatisplus.annotation.TableName; | 6 | import com.baomidou.mybatisplus.annotation.TableName; |
| 7 | -import com.sun.xml.bind.v2.TODO; | ||
| 8 | import lombok.*; | 7 | import lombok.*; |
| 9 | 8 | ||
| 10 | import java.time.LocalDateTime; | 9 | import java.time.LocalDateTime; |
| 11 | 10 | ||
| 11 | +// TODO 芋艿:调整下字段 | ||
| 12 | /** | 12 | /** |
| 13 | * 客户 DO | 13 | * 客户 DO |
| 14 | * | 14 | * |
| @@ -35,20 +35,14 @@ public class CrmCustomerDO extends BaseDO { | @@ -35,20 +35,14 @@ public class CrmCustomerDO extends BaseDO { | ||
| 35 | private String name; | 35 | private String name; |
| 36 | /** | 36 | /** |
| 37 | * 跟进状态 | 37 | * 跟进状态 |
| 38 | - * <p> | ||
| 39 | - * 枚举 {@link TODO infra_boolean_string 对应的类} | ||
| 40 | */ | 38 | */ |
| 41 | private Boolean followUpStatus; | 39 | private Boolean followUpStatus; |
| 42 | /** | 40 | /** |
| 43 | * 锁定状态 | 41 | * 锁定状态 |
| 44 | - * <p> | ||
| 45 | - * 枚举 {@link TODO infra_boolean_string 对应的类} | ||
| 46 | */ | 42 | */ |
| 47 | private Boolean lockStatus; | 43 | private Boolean lockStatus; |
| 48 | /** | 44 | /** |
| 49 | * 成交状态 | 45 | * 成交状态 |
| 50 | - * <p> | ||
| 51 | - * 枚举 {@link TODO infra_boolean_string 对应的类} | ||
| 52 | */ | 46 | */ |
| 53 | private Boolean dealStatus; | 47 | private Boolean dealStatus; |
| 54 | /** | 48 | /** |
| @@ -71,6 +65,7 @@ public class CrmCustomerDO extends BaseDO { | @@ -71,6 +65,7 @@ public class CrmCustomerDO extends BaseDO { | ||
| 71 | * 负责人的用户编号 | 65 | * 负责人的用户编号 |
| 72 | */ | 66 | */ |
| 73 | private Long ownerUserId; | 67 | private Long ownerUserId; |
| 68 | + // TODO @wanwan:下面两个字段,使用 List<Long>,然后使用 typeHandler = LongListTypeHandler 解决持久化的问题;注意类上需要加 autoResultMap = true | ||
| 74 | /** | 69 | /** |
| 75 | * 只读权限的用户编号数组 | 70 | * 只读权限的用户编号数组 |
| 76 | */ | 71 | */ |
| @@ -87,6 +82,7 @@ public class CrmCustomerDO extends BaseDO { | @@ -87,6 +82,7 @@ public class CrmCustomerDO extends BaseDO { | ||
| 87 | * 详细地址 | 82 | * 详细地址 |
| 88 | */ | 83 | */ |
| 89 | private String detailAddress; | 84 | private String detailAddress; |
| 85 | + // TODO @wanwan:下面两个字段:删除 | ||
| 90 | /** | 86 | /** |
| 91 | * 地理位置经度 | 87 | * 地理位置经度 |
| 92 | */ | 88 | */ |
yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/clue/CrmClueServiceImpl.java
| @@ -96,6 +96,7 @@ public class CrmClueServiceImpl implements CrmClueService { | @@ -96,6 +96,7 @@ public class CrmClueServiceImpl implements CrmClueService { | ||
| 96 | return clueMapper.selectList(exportReqVO); | 96 | return clueMapper.selectList(exportReqVO); |
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | + // TODO @wanwan:可以在 CrmClueServiceImpl 中,增加一个方法,用于校验客户是否存在;validateCustomer;然后其它方法可以调用它。不过要注意,需要把 CustomerDO 返回,因为其它模块可能要它的信息 | ||
| 99 | /** | 100 | /** |
| 100 | * 校验客户是否存在 | 101 | * 校验客户是否存在 |
| 101 | * | 102 | * |
yudao-module-crm/yudao-module-crm-biz/src/test/java/cn/iocoder/yudao/module/crm/service/customer/CrmCustomerServiceImplTest.java
| @@ -23,6 +23,7 @@ import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; | @@ -23,6 +23,7 @@ import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; | ||
| 23 | import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.CUSTOMER_NOT_EXISTS; | 23 | import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.CUSTOMER_NOT_EXISTS; |
| 24 | import static org.junit.jupiter.api.Assertions.*; | 24 | import static org.junit.jupiter.api.Assertions.*; |
| 25 | 25 | ||
| 26 | +// TODO 芋艿:单测后续补 | ||
| 26 | /** | 27 | /** |
| 27 | * {@link CrmCustomerServiceImpl} 的单元测试类 | 28 | * {@link CrmCustomerServiceImpl} 的单元测试类 |
| 28 | * | 29 | * |