mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2025-01-19 19:50:06 +08:00
Merge remote-tracking branch 'origin/feature/crm' into feature/crm
# Conflicts: # yudao-module-crm/yudao-module-crm-api/src/main/java/cn/iocoder/yudao/module/crm/enums/ErrorCodeConstants.java # yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/clue/CrmClueController.java # yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/clue/vo/CrmClueBaseVO.java # yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/clue/vo/CrmCluePageReqVO.java # yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/dal/dataobject/clue/CrmClueDO.java # yudao-module-crm/yudao-module-crm-biz/src/test/java/cn/iocoder/yudao/module/crm/service/clue/CrmClueServiceImplTest.java
This commit is contained in:
commit
435d7dcfca
@ -12,6 +12,7 @@ public interface ErrorCodeConstants {
|
|||||||
// ========== 合同管理 1-020-000-000 ==========
|
// ========== 合同管理 1-020-000-000 ==========
|
||||||
ErrorCode CONTRACT_NOT_EXISTS = new ErrorCode(1_020_000_000, "合同不存在");
|
ErrorCode CONTRACT_NOT_EXISTS = new ErrorCode(1_020_000_000, "合同不存在");
|
||||||
|
|
||||||
|
// TODO @wanwan:要单独一个分段噢
|
||||||
ErrorCode CLUE_NOT_EXISTS = new ErrorCode(1_020_000_001, "线索不存在");
|
ErrorCode CLUE_NOT_EXISTS = new ErrorCode(1_020_000_001, "线索不存在");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,32 +1,28 @@
|
|||||||
package cn.iocoder.yudao.module.crm.controller.admin.clue;
|
package cn.iocoder.yudao.module.crm.controller.admin.clue;
|
||||||
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
|
|
||||||
import javax.validation.constraints.*;
|
|
||||||
import javax.validation.*;
|
|
||||||
import javax.servlet.http.*;
|
|
||||||
import java.util.*;
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.crm.controller.admin.clue.vo.*;
|
import cn.iocoder.yudao.module.crm.controller.admin.clue.vo.*;
|
||||||
import cn.iocoder.yudao.module.crm.dal.dataobject.clue.CrmClueDO;
|
|
||||||
import cn.iocoder.yudao.module.crm.convert.clue.CrmClueConvert;
|
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.service.clue.CrmClueService;
|
import cn.iocoder.yudao.module.crm.service.clue.CrmClueService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||||
|
|
||||||
@Tag(name = "管理后台 - 线索")
|
@Tag(name = "管理后台 - 线索")
|
||||||
@RestController
|
@RestController
|
||||||
@ -70,15 +66,6 @@ public class CrmClueController {
|
|||||||
return success(CrmClueConvert.INSTANCE.convert(clue));
|
return success(CrmClueConvert.INSTANCE.convert(clue));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/list")
|
|
||||||
@Operation(summary = "获得线索列表")
|
|
||||||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
|
|
||||||
@PreAuthorize("@ss.hasPermission('crm:clue:query')")
|
|
||||||
public CommonResult<List<CrmClueRespVO>> getClueList(@RequestParam("ids") Collection<Long> ids) {
|
|
||||||
List<CrmClueDO> list = clueService.getClueList(ids);
|
|
||||||
return success(CrmClueConvert.INSTANCE.convertList(list));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
@Operation(summary = "获得线索分页")
|
@Operation(summary = "获得线索分页")
|
||||||
@PreAuthorize("@ss.hasPermission('crm:clue:query')")
|
@PreAuthorize("@ss.hasPermission('crm:clue:query')")
|
||||||
|
@ -2,15 +2,12 @@ package cn.iocoder.yudao.module.crm.controller.admin.clue.vo;
|
|||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.validation.Mobile;
|
import cn.iocoder.yudao.framework.common.validation.Mobile;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.Data;
|
||||||
import java.util.*;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import javax.validation.constraints.*;
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -20,18 +17,21 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
|||||||
@Data
|
@Data
|
||||||
public class CrmClueBaseVO {
|
public class CrmClueBaseVO {
|
||||||
|
|
||||||
|
// TODO @wanwan:转化状态,新增和修改的时候,应该不传递的哈;而是在未来的时候,才会更新到
|
||||||
@Schema(description = "转化状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
|
@Schema(description = "转化状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
|
||||||
@NotNull(message = "转化状态不能为空")
|
@NotNull(message = "转化状态不能为空")
|
||||||
private Boolean transformStatus;
|
private Boolean transformStatus;
|
||||||
|
|
||||||
|
// TODO @wanwan:同 transformStatus
|
||||||
@Schema(description = "跟进状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
|
@Schema(description = "跟进状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
|
||||||
@NotNull(message = "跟进状态不能为空")
|
@NotNull(message = "跟进状态不能为空")
|
||||||
private Boolean followUpStatus;
|
private Boolean followUpStatus;
|
||||||
|
|
||||||
@Schema(description = "线索名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "线索xxx")
|
@Schema(description = "线索名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "线索xxx")
|
||||||
@NotNull(message = "线索名称不能为空")
|
@NotNull(message = "线索名称不能为空") // TODO @wanwan:应该是 NotEmpty 噢。空串都无法接受
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
// TODO @wanwan:中英文之间,要有个空格;例如说,客户 id 不能为空
|
||||||
@Schema(description = "客户id", requiredMode = Schema.RequiredMode.REQUIRED, example = "520")
|
@Schema(description = "客户id", requiredMode = Schema.RequiredMode.REQUIRED, example = "520")
|
||||||
@NotNull(message = "客户id不能为空")
|
@NotNull(message = "客户id不能为空")
|
||||||
private Long customerId;
|
private Long customerId;
|
||||||
@ -40,10 +40,12 @@ public class CrmClueBaseVO {
|
|||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
private LocalDateTime contactNextTime;
|
private LocalDateTime contactNextTime;
|
||||||
|
|
||||||
|
// TODO @wanwan:@Schema 在 @Mobile 之前,要保持统一的顺序;2)可以加个 @Telephone 的校验格式;应该不是手机的格式哈
|
||||||
@Mobile(message = "电话格式不正确")
|
@Mobile(message = "电话格式不正确")
|
||||||
@Schema(description = "电话", example = "18000000000")
|
@Schema(description = "电话", example = "18000000000")
|
||||||
private String telephone;
|
private String telephone;
|
||||||
|
|
||||||
|
// TODO @wanwan:@Schema 在 @Mobile 之前,要保持统一的顺序;2)类似 @Mobile 这个提示如果是默认的,就可以不写 message
|
||||||
@Mobile(message = "手机号格式不正确")
|
@Mobile(message = "手机号格式不正确")
|
||||||
@Schema(description = "手机号", example = "18000000000")
|
@Schema(description = "手机号", example = "18000000000")
|
||||||
private String mobile;
|
private String mobile;
|
||||||
@ -52,6 +54,7 @@ public class CrmClueBaseVO {
|
|||||||
private String address;
|
private String address;
|
||||||
|
|
||||||
@Schema(description = "负责人的用户编号", example = "27199")
|
@Schema(description = "负责人的用户编号", example = "27199")
|
||||||
|
// TODO @wanwan:这个是必填字段哈;
|
||||||
private Long ownerUserId;
|
private Long ownerUserId;
|
||||||
|
|
||||||
@Schema(description = "最后跟进时间")
|
@Schema(description = "最后跟进时间")
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
package cn.iocoder.yudao.module.crm.controller.admin.clue.vo;
|
package cn.iocoder.yudao.module.crm.controller.admin.clue.vo;
|
||||||
|
|
||||||
import lombok.*;
|
|
||||||
import java.util.*;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
@ -15,6 +17,8 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
|||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
public class CrmCluePageReqVO extends PageParam {
|
public class CrmCluePageReqVO extends PageParam {
|
||||||
|
|
||||||
|
// TODO @wanwan:目前只要支持 name、mobile、telephone 的搜索即可;其它字段应该暂时不需要哈;
|
||||||
|
|
||||||
@Schema(description = "转化状态", example = "true")
|
@Schema(description = "转化状态", example = "true")
|
||||||
private Boolean transformStatus;
|
private Boolean transformStatus;
|
||||||
|
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
package cn.iocoder.yudao.module.crm.dal.dataobject.clue;
|
package cn.iocoder.yudao.module.crm.dal.dataobject.clue;
|
||||||
|
|
||||||
|
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 com.sun.xml.bind.v2.TODO;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import java.util.*;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
// TODO 芋艿:字段的顺序,需要整理下;
|
||||||
/**
|
/**
|
||||||
* 线索 DO
|
* 线索 DO
|
||||||
*
|
*
|
||||||
@ -68,6 +68,8 @@ public class CrmClueDO extends BaseDO {
|
|||||||
private String address;
|
private String address;
|
||||||
/**
|
/**
|
||||||
* 负责人的用户编号
|
* 负责人的用户编号
|
||||||
|
*
|
||||||
|
* 关联 AdminUserDO 的 id 字段
|
||||||
*/
|
*/
|
||||||
private Long ownerUserId;
|
private Long ownerUserId;
|
||||||
/**
|
/**
|
||||||
@ -79,4 +81,8 @@ public class CrmClueDO extends BaseDO {
|
|||||||
*/
|
*/
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
// TODO 芋艿:客户级别;
|
||||||
|
// TODO 芋艿:线索来源;
|
||||||
|
// TODO 芋艿:客户行业;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,33 +1,30 @@
|
|||||||
package cn.iocoder.yudao.module.crm.service.clue;
|
package cn.iocoder.yudao.module.crm.service.clue;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Disabled;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import org.springframework.boot.test.mock.mockito.MockBean;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest;
|
import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest;
|
||||||
|
import cn.iocoder.yudao.module.crm.controller.admin.clue.vo.CrmClueCreateReqVO;
|
||||||
import cn.iocoder.yudao.module.crm.controller.admin.clue.vo.*;
|
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.dal.dataobject.clue.CrmClueDO;
|
import cn.iocoder.yudao.module.crm.dal.dataobject.clue.CrmClueDO;
|
||||||
import cn.iocoder.yudao.module.crm.dal.mysql.clue.CrmClueMapper;
|
import cn.iocoder.yudao.module.crm.dal.mysql.clue.CrmClueMapper;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import org.junit.jupiter.api.Disabled;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.springframework.context.annotation.Import;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import org.springframework.context.annotation.Import;
|
import java.util.List;
|
||||||
import java.util.*;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
import static cn.hutool.core.util.RandomUtil.*;
|
import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime;
|
||||||
import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.*;
|
import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId;
|
||||||
import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.*;
|
import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals;
|
||||||
import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*;
|
import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException;
|
||||||
import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.*;
|
import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId;
|
||||||
import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.*;
|
import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo;
|
||||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.*;
|
import static cn.iocoder.yudao.module.crm.enums.ErrorCodeConstants.CLUE_NOT_EXISTS;
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
import static org.mockito.Mockito.*;
|
|
||||||
|
|
||||||
|
// TODO 芋艿:单测后续补;
|
||||||
/**
|
/**
|
||||||
* {@link CrmClueServiceImpl} 的单元测试类
|
* {@link CrmClueServiceImpl} 的单元测试类
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user