mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2025-02-20 19:20:32 +08:00
code review:CRM 线索表的逻辑
This commit is contained in:
parent
9cf4cfca86
commit
b5560fa0be
@ -15,8 +15,8 @@ public interface ErrorCodeConstants {
|
||||
// ========== 线索管理 1-020-001-000 ==========
|
||||
ErrorCode CLUE_NOT_EXISTS = new ErrorCode(1_020_001_000, "线索不存在");
|
||||
|
||||
// ========== 商机管理 1-020-001-000 ==========
|
||||
ErrorCode BUSINESS_NOT_EXISTS = new ErrorCode(1_020_001_000, "商机不存在");
|
||||
// ========== 商机管理 1-020-002-000 ==========
|
||||
ErrorCode BUSINESS_NOT_EXISTS = new ErrorCode(1_020_002_000, "商机不存在");
|
||||
|
||||
// TODO @liuhongfeng:错误码分段;
|
||||
ErrorCode RECEIVABLE_NOT_EXISTS = new ErrorCode(1_030_000_001, "回款管理不存在");
|
||||
|
@ -11,6 +11,7 @@ import lombok.ToString;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class CrmCluePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "线索名称", example = "线索xxx")
|
||||
private String name;
|
||||
|
||||
@ -19,4 +20,5 @@ public class CrmCluePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "手机号", example = "18000000000")
|
||||
private String mobile;
|
||||
|
||||
}
|
||||
|
@ -1,9 +1,11 @@
|
||||
package cn.iocoder.yudao.module.crm.controller.admin.clue.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Schema(description = "管理后台 - 线索更新 Request VO")
|
||||
@Data
|
||||
@ -11,8 +13,8 @@ import javax.validation.constraints.*;
|
||||
@ToString(callSuper = true)
|
||||
public class CrmClueUpdateReqVO extends CrmClueBaseVO {
|
||||
|
||||
@Schema(description = "编号,主键自增", requiredMode = Schema.RequiredMode.REQUIRED, example = "10969")
|
||||
@NotNull(message = "编号,主键自增不能为空")
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "10969")
|
||||
@NotNull(message = "编号不能为空")
|
||||
private Long id;
|
||||
|
||||
}
|
||||
|
@ -25,8 +25,6 @@ public interface CrmClueConvert {
|
||||
|
||||
CrmClueRespVO convert(CrmClueDO bean);
|
||||
|
||||
List<CrmClueRespVO> convertList(List<CrmClueDO> list);
|
||||
|
||||
PageResult<CrmClueRespVO> convertPage(PageResult<CrmClueDO> page);
|
||||
|
||||
List<CrmClueExcelVO> convertList02(List<CrmClueDO> list);
|
||||
|
@ -4,7 +4,6 @@ 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;
|
||||
@ -32,14 +31,10 @@ public class CrmClueDO extends BaseDO {
|
||||
private Long id;
|
||||
/**
|
||||
* 转化状态
|
||||
*
|
||||
* 枚举 {@link TODO infra_boolean_string 对应的类}
|
||||
*/
|
||||
private Boolean transformStatus;
|
||||
/**
|
||||
* 跟进状态
|
||||
*
|
||||
* 枚举 {@link TODO infra_boolean_string 对应的类}
|
||||
*/
|
||||
private Boolean followUpStatus;
|
||||
/**
|
||||
@ -47,7 +42,9 @@ public class CrmClueDO extends BaseDO {
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 客户id
|
||||
* 客户 id
|
||||
*
|
||||
* // TODO @wanwan:要写下关联的实体,以及对应的属性哈
|
||||
*/
|
||||
private Long customerId;
|
||||
/**
|
||||
|
@ -1,22 +1,24 @@
|
||||
package cn.iocoder.yudao.module.crm.service.clue;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.crm.controller.admin.clue.vo.*;
|
||||
import cn.iocoder.yudao.module.crm.dal.dataobject.clue.CrmClueDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
import cn.iocoder.yudao.module.crm.convert.clue.CrmClueConvert;
|
||||
import cn.iocoder.yudao.module.crm.dal.mysql.clue.CrmClueMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.*;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.crm.controller.admin.clue.vo.CrmClueCreateReqVO;
|
||||
import cn.iocoder.yudao.module.crm.controller.admin.clue.vo.CrmClueExportReqVO;
|
||||
import cn.iocoder.yudao.module.crm.controller.admin.clue.vo.CrmCluePageReqVO;
|
||||
import cn.iocoder.yudao.module.crm.controller.admin.clue.vo.CrmClueUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.crm.convert.clue.CrmClueConvert;
|
||||
import cn.iocoder.yudao.module.crm.dal.dataobject.clue.CrmClueDO;
|
||||
import cn.iocoder.yudao.module.crm.dal.mysql.clue.CrmClueMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.CLUE_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 线索 Service 实现类
|
||||
@ -32,6 +34,7 @@ public class CrmClueServiceImpl implements CrmClueService {
|
||||
|
||||
@Override
|
||||
public Long createClue(CrmClueCreateReqVO createReqVO) {
|
||||
// TODO @wanwan:校验客户是否存在;以及类似的逻辑哈;如果目前还缺对应的模块的 service,可以先给自己写 todo;
|
||||
// 插入
|
||||
CrmClueDO clue = CrmClueConvert.INSTANCE.convert(createReqVO);
|
||||
clueMapper.insert(clue);
|
||||
@ -41,8 +44,10 @@ public class CrmClueServiceImpl implements CrmClueService {
|
||||
|
||||
@Override
|
||||
public void updateClue(CrmClueUpdateReqVO updateReqVO) {
|
||||
// TODO @wanwan:校验客户是否存在;以及类似的逻辑哈;如果目前还缺对应的模块的 service,可以先给自己写 todo;
|
||||
// 校验存在
|
||||
validateClueExists(updateReqVO.getId());
|
||||
|
||||
// 更新
|
||||
CrmClueDO updateObj = CrmClueConvert.INSTANCE.convert(updateReqVO);
|
||||
clueMapper.updateById(updateObj);
|
||||
|
@ -144,17 +144,9 @@ public class CrmClueServiceImplTest extends BaseDbUnitTest {
|
||||
clueMapper.insert(cloneIgnoreId(dbClue, o -> o.setCreateTime(null)));
|
||||
// 准备参数
|
||||
CrmCluePageReqVO reqVO = new CrmCluePageReqVO();
|
||||
reqVO.setTransformStatus(null);
|
||||
reqVO.setFollowUpStatus(null);
|
||||
reqVO.setName(null);
|
||||
reqVO.setCustomerId(null);
|
||||
reqVO.setContactNextTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
|
||||
reqVO.setTelephone(null);
|
||||
reqVO.setMobile(null);
|
||||
reqVO.setAddress(null);
|
||||
reqVO.setOwnerUserId(null);
|
||||
reqVO.setContactLastTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
|
||||
reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
|
||||
|
||||
// 调用
|
||||
PageResult<CrmClueDO> pageResult = clueService.getCluePage(reqVO);
|
||||
|
Loading…
Reference in New Issue
Block a user