mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2025-02-20 19:20:32 +08:00
code review:商机表的实现
This commit is contained in:
parent
bf247a6626
commit
81b6aebf47
@ -17,6 +17,9 @@ public interface ErrorCodeConstants {
|
||||
|
||||
// ========== 商机管理 1-020-002-000 ==========
|
||||
ErrorCode BUSINESS_NOT_EXISTS = new ErrorCode(1_020_002_000, "商机不存在");
|
||||
|
||||
// TODO @lilleo:商机状态、商机类型,都单独错误码段
|
||||
|
||||
ErrorCode BUSINESS_STATUS_TYPE_NOT_EXISTS = new ErrorCode(1_020_002_001, "商机状态类型不存在");
|
||||
ErrorCode BUSINESS_STATUS_NOT_EXISTS = new ErrorCode(1_020_002_002, "商机状态不存在");
|
||||
|
||||
|
@ -25,6 +25,7 @@ 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;
|
||||
|
||||
// TODO @lilleo:这个模块,可以挪到 business 下;这样我打开 business 包下,就知道,噢~原来里面有 business 商机、有 type 状态类型、status 具体状态;
|
||||
@Tag(name = "管理后台 - 商机状态")
|
||||
@RestController
|
||||
@RequestMapping("/crm/business-status")
|
||||
@ -67,6 +68,7 @@ public class CrmBusinessStatusController {
|
||||
return success(CrmBusinessStatusConvert.INSTANCE.convert(businessStatus));
|
||||
}
|
||||
|
||||
// TODO @lilleo:这个接口,暂时用不到,可以考虑先删除掉
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得商机状态列表")
|
||||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
|
||||
@ -96,6 +98,7 @@ public class CrmBusinessStatusController {
|
||||
ExcelUtils.write(response, "商机状态.xls", "数据", CrmBusinessStatusExcelVO.class, datas);
|
||||
}
|
||||
|
||||
// TODO 芋艿:后续再看看
|
||||
@GetMapping("/get-simple-list")
|
||||
@Operation(summary = "获得商机状态列表")
|
||||
@PreAuthorize("@ss.hasPermission('crm:business-status:query')")
|
||||
@ -104,6 +107,7 @@ public class CrmBusinessStatusController {
|
||||
return success(CrmBusinessStatusConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
// TODO 芋艿:后续再看看
|
||||
@GetMapping("/get-all-list")
|
||||
@Operation(summary = "获得商机状态列表")
|
||||
@PreAuthorize("@ss.hasPermission('crm:business-status:query')")
|
||||
|
@ -12,6 +12,8 @@ import javax.validation.constraints.NotNull;
|
||||
@Data
|
||||
public class CrmBusinessStatusBaseVO {
|
||||
|
||||
// TODO @lilleo:example 要写下
|
||||
|
||||
@Schema(description = "状态类型编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "22882")
|
||||
@NotNull(message = "状态类型编号不能为空")
|
||||
private Long typeId;
|
||||
@ -20,9 +22,11 @@ public class CrmBusinessStatusBaseVO {
|
||||
@NotNull(message = "状态名不能为空")
|
||||
private String name;
|
||||
|
||||
// TODO @lilleo:percent 应该是 Integer;
|
||||
@Schema(description = "赢单率")
|
||||
private String percent;
|
||||
|
||||
// TODO @lilleo:这个是不是不用前端新增和修改的时候传递,交给顺序计算出来,存储起来就好了;
|
||||
@Schema(description = "排序")
|
||||
private Integer sort;
|
||||
|
||||
|
@ -1,11 +1,9 @@
|
||||
package cn.iocoder.yudao.module.crm.controller.admin.businessstatus.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
// TODO @lilleo:这个暂时不需要;嘿嘿~不是每个模块都需要导出哈
|
||||
/**
|
||||
* 商机状态 Excel VO
|
||||
*
|
||||
|
@ -1,10 +1,9 @@
|
||||
package cn.iocoder.yudao.module.crm.controller.admin.businessstatus.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import lombok.Data;
|
||||
|
||||
// TODO @lilleo:这个暂时不需要;嘿嘿~不是每个模块都需要导出哈
|
||||
@Schema(description = "管理后台 - 商机状态 Excel 导出 Request VO,参数和 CrmBusinessStatusPageReqVO 是一致的")
|
||||
@Data
|
||||
public class CrmBusinessStatusExportReqVO {
|
||||
|
@ -9,7 +9,7 @@ import lombok.*;
|
||||
@ToString(callSuper = true)
|
||||
public class CrmBusinessStatusRespVO extends CrmBusinessStatusBaseVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "6802")
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "6802")
|
||||
private Long id;
|
||||
|
||||
}
|
||||
|
@ -1,9 +1,11 @@
|
||||
package cn.iocoder.yudao.module.crm.controller.admin.businessstatus.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 CrmBusinessStatusUpdateReqVO extends CrmBusinessStatusBaseVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "6802")
|
||||
@NotNull(message = "主键不能为空")
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "6802")
|
||||
@NotNull(message = "编号不能为空")
|
||||
private Long id;
|
||||
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ 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;
|
||||
|
||||
// TODO @lilleo:这个模块,可以挪到 business 下;这样我打开 business 包下,就知道,噢~原来里面有 business 商机、有 type 状态类型、status 具体状态;
|
||||
@Tag(name = "管理后台 - 商机状态类型")
|
||||
@RestController
|
||||
@RequestMapping("/crm/business-status-type")
|
||||
@ -68,6 +69,7 @@ public class CrmBusinessStatusTypeController {
|
||||
return success(CrmBusinessStatusTypeConvert.INSTANCE.convert(businessStatusType));
|
||||
}
|
||||
|
||||
// TODO @lilleo:这个接口,暂时用不到,可以考虑先删除掉
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得商机状态类型列表")
|
||||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
|
||||
|
@ -5,6 +5,7 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
// TODO 状态类型和状态添加,是在一个请求里,所以需要把 CrmBusinessStatusCreateReqVO 融合进来;
|
||||
@Schema(description = "管理后台 - 商机状态类型创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
|
@ -1,13 +1,11 @@
|
||||
package cn.iocoder.yudao.module.crm.controller.admin.businessstatustype.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
// TODO @lilleo:这个暂时不需要;嘿嘿~不是每个模块都需要导出哈
|
||||
/**
|
||||
* 商机状态类型 Excel VO
|
||||
*
|
||||
|
@ -1,14 +1,14 @@
|
||||
package cn.iocoder.yudao.module.crm.controller.admin.businessstatustype.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
// TODO @lilleo:这个暂时不需要;嘿嘿~不是每个模块都需要导出哈
|
||||
@Schema(description = "管理后台 - 商机状态类型 Excel 导出 Request VO,参数和 CrmBusinessStatusTypePageReqVO 是一致的")
|
||||
@Data
|
||||
public class CrmBusinessStatusTypeExportReqVO {
|
||||
|
@ -1,10 +1,13 @@
|
||||
package cn.iocoder.yudao.module.crm.controller.admin.businessstatustype.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;
|
||||
|
||||
// TODO 状态类型和状态添加,是在一个请求里,所以需要把 CrmBusinessStatusUpdateReqVO 融合进来;
|
||||
@Schema(description = "管理后台 - 商机状态类型更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
|
@ -26,6 +26,8 @@ public class CrmBusinessStatusDO {
|
||||
private Long id;
|
||||
/**
|
||||
* 状态类型编号
|
||||
*
|
||||
* // TODO @ljlleo:要写下关联字段噢
|
||||
*/
|
||||
private Long typeId;
|
||||
/**
|
||||
|
@ -28,6 +28,7 @@ public class CrmBusinessStatusTypeDO {
|
||||
* 状态类型名
|
||||
*/
|
||||
private String name;
|
||||
// TODO @ljlleo:List 存储哈
|
||||
/**
|
||||
* 使用的部门编号
|
||||
*/
|
||||
@ -35,6 +36,7 @@ public class CrmBusinessStatusTypeDO {
|
||||
/**
|
||||
* 开启状态
|
||||
*/
|
||||
// TODO @ljlleo:这个字段,使用 Integer,对应 CommonStatus
|
||||
private Boolean status;
|
||||
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ public interface CrmBusinessStatusTypeMapper extends BaseMapperX<CrmBusinessStat
|
||||
default PageResult<CrmBusinessStatusTypeDO> selectPage(CrmBusinessStatusTypePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<CrmBusinessStatusTypeDO>()
|
||||
.likeIfPresent(CrmBusinessStatusTypeDO::getName, reqVO.getName())
|
||||
.eqIfPresent(CrmBusinessStatusTypeDO::getDeptIds, reqVO.getDeptIds())
|
||||
// .eqIfPresent(CrmBusinessStatusTypeDO::getDeptIds, reqVO.getDeptIds()) TODO 报错,临时注释掉
|
||||
.eqIfPresent(CrmBusinessStatusTypeDO::getStatus, reqVO.getStatus())
|
||||
.orderByDesc(CrmBusinessStatusTypeDO::getId));
|
||||
}
|
||||
@ -38,6 +38,4 @@ public interface CrmBusinessStatusTypeMapper extends BaseMapperX<CrmBusinessStat
|
||||
return selectList(CrmBusinessStatusTypeDO::getStatus, status.byteValue());
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -73,9 +73,9 @@ public interface CrmBusinessStatusService {
|
||||
List<CrmBusinessStatusDO> getBusinessStatusList(CrmBusinessStatusExportReqVO exportReqVO);
|
||||
|
||||
/**
|
||||
* 根据类型ID获得商机状态列表
|
||||
* 根据类型 ID 获得商机状态列表
|
||||
*
|
||||
* @param typeId 商机状态类型ID
|
||||
* @param typeId 商机状态类型 ID
|
||||
* @return 商机状态列表
|
||||
*/
|
||||
List<CrmBusinessStatusDO> getBusinessStatusListByTypeId(Integer typeId);
|
||||
|
@ -34,6 +34,7 @@ public class CrmBusinessStatusTypeServiceImpl implements CrmBusinessStatusTypeSe
|
||||
|
||||
@Override
|
||||
public Long createBusinessStatusType(CrmBusinessStatusTypeCreateReqVO createReqVO) {
|
||||
// TODO ljlleo:name 应该需要唯一哈;
|
||||
// 插入
|
||||
CrmBusinessStatusTypeDO businessStatusType = CrmBusinessStatusTypeConvert.INSTANCE.convert(createReqVO);
|
||||
businessStatusTypeMapper.insert(businessStatusType);
|
||||
@ -43,6 +44,7 @@ public class CrmBusinessStatusTypeServiceImpl implements CrmBusinessStatusTypeSe
|
||||
|
||||
@Override
|
||||
public void updateBusinessStatusType(CrmBusinessStatusTypeUpdateReqVO updateReqVO) {
|
||||
// TODO ljlleo:name 应该需要唯一哈;
|
||||
// 校验存在
|
||||
validateBusinessStatusTypeExists(updateReqVO.getId());
|
||||
// 更新
|
||||
@ -54,6 +56,7 @@ public class CrmBusinessStatusTypeServiceImpl implements CrmBusinessStatusTypeSe
|
||||
public void deleteBusinessStatusType(Long id) {
|
||||
// 校验存在
|
||||
validateBusinessStatusTypeExists(id);
|
||||
// TODO 艿艿:这里在看看,是不是要校验业务是否在使用;
|
||||
// 删除
|
||||
businessStatusTypeMapper.deleteById(id);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user