mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-22 23:31:52 +08:00
code review:客户表的实现
This commit is contained in:
parent
0719efb4c2
commit
74f786f8ed
@ -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 @芋艿:longitude、latitude 这两个字段删除;
|
||||
@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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -8,7 +8,7 @@ import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
// TODO 芋艿:导出最后做,等基本确认的差不多之后;
|
||||
/**
|
||||
* 客户 Excel VO
|
||||
*
|
||||
|
@ -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 {
|
||||
|
@ -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 @芋艿:场景;
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ public class CrmCustomerUpdateReqVO extends CrmCustomerBaseVO {
|
||||
@NotNull(message = "编号不能为空")
|
||||
private Long id;
|
||||
|
||||
// TODO @wanwan:下面两个字段,同 CrmCustomerCreateReqVO
|
||||
@Schema(description = "只读权限的用户编号数组")
|
||||
private String roUserIds;
|
||||
|
||||
|
@ -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);
|
||||
|
@ -44,7 +44,8 @@ public class CrmClueDO extends BaseDO {
|
||||
private String name;
|
||||
/**
|
||||
* 客户 id
|
||||
* 对应 {@link CrmCustomerDO#getId()}
|
||||
*
|
||||
* 关联 {@link CrmCustomerDO#getId()}
|
||||
*/
|
||||
private Long customerId;
|
||||
/**
|
||||
|
@ -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:下面两个字段:删除
|
||||
/**
|
||||
* 地理位置经度
|
||||
*/
|
||||
|
@ -96,6 +96,7 @@ public class CrmClueServiceImpl implements CrmClueService {
|
||||
return clueMapper.selectList(exportReqVO);
|
||||
}
|
||||
|
||||
// TODO @wanwan:可以在 CrmClueServiceImpl 中,增加一个方法,用于校验客户是否存在;validateCustomer;然后其它方法可以调用它。不过要注意,需要把 CustomerDO 返回,因为其它模块可能要它的信息
|
||||
/**
|
||||
* 校验客户是否存在
|
||||
*
|
||||
|
@ -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} 的单元测试类
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user