code review:客户表的实现

This commit is contained in:
YunaiV 2023-10-27 22:56:46 +08:00
parent 0719efb4c2
commit 74f786f8ed
11 changed files with 21 additions and 12 deletions

View File

@ -19,14 +19,16 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
@Data
public class CrmCustomerBaseVO {
@Schema(description = "客户名称", example = "赵六")
@Schema(description = "客户名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
@NotEmpty(message = "客户名称不能为空")
private String name;
// TODO wanwan这个字段应该只有 RespVO 会有创建和修改不传递
@Schema(description = "跟进状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
@NotNull(message = "跟进状态不能为空")
private Boolean followUpStatus;
// TODO wanwan这个字段应该只有 RespVO 会有创建和修改不传递
@Schema(description = "锁定状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
@NotNull(message = "锁定状态不能为空")
private Boolean lockStatus;
@ -45,6 +47,7 @@ public class CrmCustomerBaseVO {
@Schema(description = "备注", example = "随便")
private String remark;
// TODO wanwan这个字段应该只有 RespVO 会有创建和修改不传递因为它会在移交里面做哈
@Schema(description = "负责人的用户编号", example = "25682")
@NotNull(message = "负责人不能为空")
private Long ownerUserId;
@ -55,12 +58,14 @@ public class CrmCustomerBaseVO {
@Schema(description = "详细地址", example = "北京市海淀区")
private String detailAddress;
// TODO @芋艿longitudelatitude 这两个字段删除
@Schema(description = "地理位置经度", example = "116.40341")
private String longitude;
@Schema(description = "地理位置维度", example = "39.92409")
private String latitude;
// TODO wanwan这个字段应该只有 RespVO 会有创建和修改不传递
@Schema(description = "最后跟进时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime contactLastTime;

View File

@ -11,9 +11,11 @@ import lombok.ToString;
@ToString(callSuper = true)
public class CrmCustomerCreateReqVO extends CrmCustomerBaseVO {
// TODO @wanwan类型应该是传递 List<Long>; 不过这个字段默认新建的时候不传递移交功能里管理
@Schema(description = "只读权限的用户编号数组")
private String roUserIds;
// TODO @wanwan类型应该是传递 List<Long>; 不过这个字段默认新建的时候不传递移交功能里管理
@Schema(description = "读写权限的用户编号数组")
private String rwUserIds;

View File

@ -8,7 +8,7 @@ import lombok.Data;
import java.time.LocalDateTime;
// TODO 芋艿导出最后做等基本确认的差不多之后
/**
* 客户 Excel VO
*

View File

@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.crm.controller.admin.customer.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
// TODO 芋艿导出最后做等基本确认的差不多之后
@Schema(description = "管理后台 - 客户 Excel 导出 Request VO参数和 CrmCustomerPageReqVO 是一致的")
@Data
public class CrmCustomerExportReqVO {

View File

@ -18,10 +18,13 @@ public class CrmCustomerPageReqVO extends PageParam {
@Schema(description = "手机", example = "18000000000")
private String mobile;
// TODO @wanwan这个字段不需要哈
@Schema(description = "电话", example = "18000000000")
private String telephone;
// TODO @wanwan这个字段不需要哈
@Schema(description = "网址", example = "https://www.baidu.com")
private String website;
// TODO @芋艿场景
}

View File

@ -17,6 +17,7 @@ public class CrmCustomerUpdateReqVO extends CrmCustomerBaseVO {
@NotNull(message = "编号不能为空")
private Long id;
// TODO @wanwan下面两个字段 CrmCustomerCreateReqVO
@Schema(description = "只读权限的用户编号数组")
private String roUserIds;

View File

@ -25,8 +25,6 @@ public interface CrmCustomerConvert {
CrmCustomerRespVO convert(CrmCustomerDO bean);
List<CrmCustomerRespVO> convertList(List<CrmCustomerDO> list);
PageResult<CrmCustomerRespVO> convertPage(PageResult<CrmCustomerDO> page);
List<CrmCustomerExcelVO> convertList02(List<CrmCustomerDO> list);

View File

@ -44,7 +44,8 @@ public class CrmClueDO extends BaseDO {
private String name;
/**
* 客户 id
* 对应 {@link CrmCustomerDO#getId()}
*
* 关联 {@link CrmCustomerDO#getId()}
*/
private Long customerId;
/**

View File

@ -4,11 +4,11 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.sun.xml.bind.v2.TODO;
import lombok.*;
import java.time.LocalDateTime;
// TODO 芋艿调整下字段
/**
* 客户 DO
*
@ -35,20 +35,14 @@ public class CrmCustomerDO extends BaseDO {
private String name;
/**
* 跟进状态
* <p>
* 枚举 {@link TODO infra_boolean_string 对应的类}
*/
private Boolean followUpStatus;
/**
* 锁定状态
* <p>
* 枚举 {@link TODO infra_boolean_string 对应的类}
*/
private Boolean lockStatus;
/**
* 成交状态
* <p>
* 枚举 {@link TODO infra_boolean_string 对应的类}
*/
private Boolean dealStatus;
/**
@ -71,6 +65,7 @@ public class CrmCustomerDO extends BaseDO {
* 负责人的用户编号
*/
private Long ownerUserId;
// TODO @wanwan下面两个字段使用 List<Long>然后使用 typeHandler = LongListTypeHandler 解决持久化的问题注意类上需要加 autoResultMap = true
/**
* 只读权限的用户编号数组
*/
@ -87,6 +82,7 @@ public class CrmCustomerDO extends BaseDO {
* 详细地址
*/
private String detailAddress;
// TODO @wanwan下面两个字段删除
/**
* 地理位置经度
*/

View File

@ -96,6 +96,7 @@ public class CrmClueServiceImpl implements CrmClueService {
return clueMapper.selectList(exportReqVO);
}
// TODO @wanwan可以在 CrmClueServiceImpl 增加一个方法用于校验客户是否存在validateCustomer然后其它方法可以调用它不过要注意需要把 CustomerDO 返回因为其它模块可能要它的信息
/**
* 校验客户是否存在
*

View File

@ -23,6 +23,7 @@ import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo;
import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.CUSTOMER_NOT_EXISTS;
import static org.junit.jupiter.api.Assertions.*;
// TODO 芋艿单测后续补
/**
* {@link CrmCustomerServiceImpl} 的单元测试类
*