code review:CRM 商机的逻辑

This commit is contained in:
YunaiV 2023-10-21 21:35:35 +08:00
parent 24e6deb82b
commit 6f8fd383f7
7 changed files with 45 additions and 18 deletions

View File

@ -19,7 +19,6 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.util.Collection;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@ -67,15 +66,6 @@ public class CrmBusinessController {
return success(CrmBusinessConvert.INSTANCE.convert(business));
}
@GetMapping("/list")
@Operation(summary = "获得商机列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@PreAuthorize("@ss.hasPermission('crm:business:query')")
public CommonResult<List<CrmBusinessRespVO>> getBusinessList(@RequestParam("ids") Collection<Long> ids) {
List<CrmBusinessDO> list = businessService.getBusinessList(ids);
return success(CrmBusinessConvert.INSTANCE.convertList(list));
}
@GetMapping("/page")
@Operation(summary = "获得商机分页")
@PreAuthorize("@ss.hasPermission('crm:business:query')")

View File

@ -21,10 +21,12 @@ public class CrmBusinessBaseVO {
@NotNull(message = "商机名称不能为空")
private String name;
// TODO @ljileo要写 requiredMode = Schema.RequiredMode.REQUIRED
@Schema(description = "商机状态类型编号", example = "25714")
@NotNull(message = "商机状态类型不能为空")
private Long statusTypeId;
// TODO @ljileo要写 requiredMode = Schema.RequiredMode.REQUIRED
@Schema(description = "商机状态编号", example = "30320")
@NotNull(message = "商机状态不能为空")
private Long statusId;
@ -41,9 +43,11 @@ public class CrmBusinessBaseVO {
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime dealTime;
// TODO @ljileo金额使用 Integer 类型转换成分
@Schema(description = "商机金额", example = "12371")
private BigDecimal price;
// TODO @ljileo折扣使用 Integer 类型存储时默认 * 100展示的时候前端需要 / 100避免精度丢失问题
@Schema(description = "整单折扣")
private BigDecimal discountPercent;
@ -53,25 +57,32 @@ public class CrmBusinessBaseVO {
@Schema(description = "备注", example = "随便")
private String remark;
// TODO @ljileo这个新建和修改的时候应该不传递哈应该新建的人就是它的负责人
@Schema(description = "负责人的用户编号", example = "25562")
private Long ownerUserId;
// TODO @ljileo这个新建和修改的时候应该不传递哈
@Schema(description = "只读权限的用户编号数组", requiredMode = Schema.RequiredMode.REQUIRED)
private String roUserIds;
// TODO @ljileo这个新建和修改的时候应该不传递哈
@Schema(description = "读写权限的用户编号数组", requiredMode = Schema.RequiredMode.REQUIRED)
private String rwUserIds;
// TODO @lijieo新建的时候不传递这个字段哈
@Schema(description = "1赢单2输单3无效", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Integer endStatus;
// TODO @lijieo新建的时候不传递这个字段哈
@Schema(description = "结束时的备注", example = "你说的对")
private String endRemark;
// TODO @lijieo新建的时候不传递这个字段哈
@Schema(description = "最后跟进时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime contactLastTime;
// TODO @lijieo新建的时候不传递这个字段哈
@Schema(description = "跟进状态", example = "1")
private Integer followUpStatus;

View File

@ -1,9 +1,9 @@
package cn.iocoder.yudao.module.crm.controller.admin.business.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import javax.validation.constraints.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@Schema(description = "管理后台 - 商机创建 Request VO")
@Data
@ -11,4 +11,6 @@ import javax.validation.constraints.*;
@ToString(callSuper = true)
public class CrmBusinessCreateReqVO extends CrmBusinessBaseVO {
// TODO @ljileo新建的时候应该可以传递添加的产品
}

View File

@ -18,6 +18,8 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
@ToString(callSuper = true)
public class CrmBusinessPageReqVO extends PageParam {
// TODO @ljileo目前就使用 name 检索即可
@Schema(description = "商机名称", example = "李四")
private String name;

View File

@ -1,9 +1,11 @@
package cn.iocoder.yudao.module.crm.controller.admin.business.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
@ -15,4 +17,6 @@ public class CrmBusinessUpdateReqVO extends CrmBusinessBaseVO {
@NotNull(message = "主键不能为空")
private Long id;
// TODO @ljileo修改的时候应该可以传递添加的产品
}

View File

@ -25,8 +25,6 @@ public interface CrmBusinessConvert {
CrmBusinessRespVO convert(CrmBusinessDO bean);
List<CrmBusinessRespVO> convertList(List<CrmBusinessDO> list);
PageResult<CrmBusinessRespVO> convertPage(PageResult<CrmBusinessDO> page);
List<CrmBusinessExcelVO> convertList02(List<CrmBusinessDO> list);

View File

@ -35,10 +35,14 @@ public class CrmBusinessDO extends BaseDO {
private String name;
/**
* 商机状态类型编号
*
* TODO @ljileo这个字段后续要写下关联的实体哈
*/
private Long statusTypeId;
/**
* 商机状态编号
*
* TODO @ljileo这个字段后续要写下关联的实体哈
*/
private Long statusId;
/**
@ -47,6 +51,8 @@ public class CrmBusinessDO extends BaseDO {
private LocalDateTime contactNextTime;
/**
* 客户编号
*
* TODO @ljileo这个字段后续要写下关联的实体哈
*/
private Long customerId;
/**
@ -55,14 +61,20 @@ public class CrmBusinessDO extends BaseDO {
private LocalDateTime dealTime;
/**
* 商机金额
*
* TODO @lijieInteger
*/
private BigDecimal price;
/**
* 整单折扣
*
* TODO @lijieInteger
*/
private BigDecimal discountPercent;
/**
* 产品总金额
*
* TODO @lijieInteger
*/
private BigDecimal productPrice;
/**
@ -75,14 +87,20 @@ public class CrmBusinessDO extends BaseDO {
private Long ownerUserId;
/**
* 只读权限的用户编号数组
*
* TODO @lijie应该是 List<Long>然后使用下对应的 typehandler
*/
private String roUserIds;
/**
* 读写权限的用户编号数组
*
* TODO @lijie应该是 List<Long>然后使用下对应的 typehandler
*/
private String rwUserIds;
/**
* 1赢单2输单3无效
*
* TODO @lijie搞个枚举
*/
private Integer endStatus;
/**
@ -95,6 +113,8 @@ public class CrmBusinessDO extends BaseDO {
private LocalDateTime contactLastTime;
/**
* 跟进状态
*
* TODO @lijie目前就是 Boolean是否跟进
*/
private Integer followUpStatus;