补全后端基础相关模块

This commit is contained in:
陈博文
2025-06-24 08:59:52 +08:00
committed by chenbowen
parent 9408e9fd2b
commit c3844f76bb
1151 changed files with 77508 additions and 1 deletions

View File

@@ -0,0 +1,30 @@
package cn.iocoder.yudao.module.crm;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* 项目的启动类
* <p>
* 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
* 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
* 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
*
* @author 芋道源码
*/
@SpringBootApplication
public class CrmServerApplication {
public static void main(String[] args) {
// 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
// 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
// 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
SpringApplication.run(CrmServerApplication.class, args);
// 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
// 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
// 如果你碰到启动的问题,请认真阅读 https://cloud.iocoder.cn/quick-start/ 文章
}
}

View File

@@ -0,0 +1,4 @@
/**
* crm API 实现类,定义暴露给其它模块的 API
*/
package cn.iocoder.yudao.module.crm.api;

View File

@@ -0,0 +1,30 @@
package cn.iocoder.yudao.module.crm.controller.admin.business.vo.business;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.validation.InEnum;
import cn.iocoder.yudao.module.crm.enums.common.CrmSceneTypeEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@Schema(description = "管理后台 - 商机分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class CrmBusinessPageReqVO extends PageParam {
@Schema(description = "商机名称", example = "李四")
private String name;
@Schema(description = "客户编号", example = "10795")
private Long customerId;
@Schema(description = "联系人编号", example = "10795")
private Long contactId;
@Schema(description = "场景类型", example = "1")
@InEnum(CrmSceneTypeEnum.class)
private Integer sceneType; // 场景类型,为 null 时则表示全部
}

View File

@@ -0,0 +1,95 @@
package cn.iocoder.yudao.module.crm.controller.admin.business.vo.business;
import cn.iocoder.yudao.module.crm.framework.operatelog.core.CrmCustomerParseFunction;
import cn.iocoder.yudao.module.crm.framework.operatelog.core.SysAdminUserParseFunction;
import com.mzt.logapi.starter.annotation.DiffLogField;
import io.swagger.v3.oas.annotations.media.Schema;
import javax.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - CRM 商机创建/更新 Request VO")
@Data
public class CrmBusinessSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "32129")
private Long id;
@Schema(description = "商机名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
@DiffLogField(name = "商机名称")
@NotNull(message = "商机名称不能为空")
private String name;
@Schema(description = "客户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "10299")
@DiffLogField(name = "客户", function = CrmCustomerParseFunction.NAME)
@NotNull(message = "客户不能为空")
private Long customerId;
@Schema(description = "下次联系时间")
@DiffLogField(name = "下次联系时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime contactNextTime;
@Schema(description = "负责人用户编号", example = "14334")
@NotNull(message = "负责人不能为空")
@DiffLogField(name = "负责人", function = SysAdminUserParseFunction.NAME)
private Long ownerUserId;
@Schema(description = "商机状态组编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "25714")
@DiffLogField(name = "商机状态组")
@NotNull(message = "商机状态组不能为空")
private Long statusTypeId;
@Schema(description = "预计成交日期")
@DiffLogField(name = "预计成交日期")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime dealTime;
@Schema(description = "整单折扣", requiredMode = Schema.RequiredMode.REQUIRED, example = "55.00")
@DiffLogField(name = "整单折扣")
@NotNull(message = "整单折扣不能为空")
private BigDecimal discountPercent;
@Schema(description = "备注", example = "随便")
@DiffLogField(name = "备注")
private String remark;
@Schema(description = "联系人编号", example = "110")
private Long contactId; // 使用场景,在【联系人详情】添加商机时,如果需要关联两者,需要传递 contactId 字段
@Schema(description = "产品列表")
private List<BusinessProduct> products;
@Schema(description = "产品列表")
@Data
@NoArgsConstructor
@AllArgsConstructor
public static class BusinessProduct {
@Schema(description = "产品编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "20529")
@NotNull(message = "产品编号不能为空")
private Long productId;
@Schema(description = "产品单价", requiredMode = Schema.RequiredMode.REQUIRED, example = "123.00")
@NotNull(message = "产品单价不能为空")
private BigDecimal productPrice;
@Schema(description = "商机价格", requiredMode = Schema.RequiredMode.REQUIRED, example = "123.00")
@NotNull(message = "商机价格不能为空")
private BigDecimal businessPrice;
@Schema(description = "产品数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "8911")
@NotNull(message = "产品数量不能为空")
private Integer count;
}
}

View File

@@ -0,0 +1,36 @@
package cn.iocoder.yudao.module.crm.controller.admin.business.vo.business;
import cn.iocoder.yudao.module.crm.enums.permission.CrmPermissionLevelEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotNull;
@Schema(description = "管理后台 - 商机转移 Request VO")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class CrmBusinessTransferReqVO {
@Schema(description = "商机编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "10430")
@NotNull(message = "商机编号不能为空")
private Long id;
/**
* 新负责人的用户编号
*/
@Schema(description = "新负责人的用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "10430")
@NotNull(message = "新负责人的用户编号不能为空")
private Long newOwnerUserId;
/**
* 老负责人加入团队后的权限级别。如果 null 说明移除
*
* 关联 {@link CrmPermissionLevelEnum}
*/
@Schema(description = "老负责人加入团队后的权限级别", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
private Integer oldOwnerPermissionLevel;
}

View File

@@ -0,0 +1,31 @@
package cn.iocoder.yudao.module.crm.controller.admin.business.vo.business;
import cn.iocoder.yudao.framework.common.validation.InEnum;
import cn.iocoder.yudao.module.crm.enums.business.CrmBusinessEndStatusEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.AssertTrue;
import javax.validation.constraints.NotNull;
@Schema(description = "管理后台 - CRM 商机更新状态 Request VO")
@Data
public class CrmBusinessUpdateStatusReqVO {
@Schema(description = "商机编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "32129")
@NotNull(message = "商机编号不能为空")
private Long id;
@Schema(description = "状态编号", example = "1")
private Long statusId;
@Schema(description = "结束状态", example = "1")
@InEnum(value = CrmBusinessEndStatusEnum.class)
private Integer endStatus;
@AssertTrue(message = "变更状态不正确")
public boolean isStatusValid() {
return statusId != null || endStatus != null;
}
}

View File

@@ -0,0 +1,51 @@
package cn.iocoder.yudao.module.crm.controller.admin.business.vo.status;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
@Schema(description = "管理后台 - 商机状态 Response VO")
@Data
public class CrmBusinessStatusRespVO {
@Schema(description = "状态组编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2934")
private Long id;
@Schema(description = "状态组名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
private String name;
@Schema(description = "使用的部门编号", requiredMode = Schema.RequiredMode.REQUIRED)
private List<Long> deptIds;
@Schema(description = "使用的部门名称", requiredMode = Schema.RequiredMode.REQUIRED)
private List<String> deptNames;
@Schema(description = "创建人", requiredMode = Schema.RequiredMode.REQUIRED)
private String creator;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;
@Schema(description = "状态集合", requiredMode = Schema.RequiredMode.REQUIRED)
private List<Status> statuses;
@Data
public static class Status {
@Schema(description = "状态编号", example = "23899")
private Long id;
@Schema(description = "状态名", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
private String name;
@Schema(description = "赢单率", requiredMode = Schema.RequiredMode.REQUIRED, example = "50")
private BigDecimal percent;
@Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Integer sort;
}
}

Some files were not shown because too many files have changed in this diff Show More