commit
e64e60c711
@ -1,37 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.crm.controller.admin.contract.vo;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.ToString;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - CRM 合同 Response VO")
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@ToString(callSuper = true)
|
|
||||||
public class ContractRespVO extends CrmContractBaseVO {
|
|
||||||
|
|
||||||
@Schema(description = "合同编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "10430")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
|
|
||||||
@Schema(description = "创建人", example = "25682")
|
|
||||||
private String creator;
|
|
||||||
|
|
||||||
@Schema(description = "创建人名字", example = "test")
|
|
||||||
private String creatorName;
|
|
||||||
|
|
||||||
@Schema(description = "客户名字", example = "test")
|
|
||||||
private String customerName;
|
|
||||||
|
|
||||||
@Schema(description = "负责人", example = "test")
|
|
||||||
private String ownerUserName;
|
|
||||||
|
|
||||||
@Schema(description = "审批状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
|
|
||||||
private Integer auditStatus;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.crm.controller.admin.contract.vo;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.ToString;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - CRM 合同创建 Request VO")
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@ToString(callSuper = true)
|
|
||||||
public class CrmContractCreateReqVO extends CrmContractBaseVO {
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -0,0 +1,82 @@
|
|||||||
|
package cn.iocoder.yudao.module.crm.controller.admin.contract.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - CRM 合同 Response VO")
|
||||||
|
@Data
|
||||||
|
public class CrmContractRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "合同编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "10430")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "合同名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "客户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "18336")
|
||||||
|
private Long customerId;
|
||||||
|
|
||||||
|
@Schema(description = "商机编号", example = "10864")
|
||||||
|
private Long businessId;
|
||||||
|
|
||||||
|
@Schema(description = "工作流编号", example = "1043")
|
||||||
|
private Long processInstanceId;
|
||||||
|
|
||||||
|
@Schema(description = "下单日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private LocalDateTime orderDate;
|
||||||
|
|
||||||
|
@Schema(description = "负责人的用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "17144")
|
||||||
|
private Long ownerUserId;
|
||||||
|
|
||||||
|
// TODO @芋艿:未来应该支持自动生成;
|
||||||
|
@Schema(description = "合同编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "20230101")
|
||||||
|
private String no;
|
||||||
|
|
||||||
|
@Schema(description = "开始时间")
|
||||||
|
private LocalDateTime startTime;
|
||||||
|
|
||||||
|
@Schema(description = "结束时间")
|
||||||
|
private LocalDateTime endTime;
|
||||||
|
|
||||||
|
@Schema(description = "合同金额", example = "5617")
|
||||||
|
private Integer price;
|
||||||
|
|
||||||
|
@Schema(description = "整单折扣")
|
||||||
|
private Integer discountPercent;
|
||||||
|
|
||||||
|
@Schema(description = "产品总金额", example = "19510")
|
||||||
|
private Integer productPrice;
|
||||||
|
|
||||||
|
@Schema(description = "联系人编号", example = "18546")
|
||||||
|
private Long contactId;
|
||||||
|
|
||||||
|
@Schema(description = "公司签约人", example = "14036")
|
||||||
|
private Long signUserId;
|
||||||
|
|
||||||
|
@Schema(description = "最后跟进时间")
|
||||||
|
private LocalDateTime contactLastTime;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "你猜")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@Schema(description = "创建人", example = "25682")
|
||||||
|
private String creator;
|
||||||
|
|
||||||
|
@Schema(description = "创建人名字", example = "test")
|
||||||
|
private String creatorName;
|
||||||
|
|
||||||
|
@Schema(description = "客户名字", example = "test")
|
||||||
|
private String customerName;
|
||||||
|
|
||||||
|
@Schema(description = "负责人", example = "test")
|
||||||
|
private String ownerUserName;
|
||||||
|
|
||||||
|
@Schema(description = "审批状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
|
||||||
|
private Integer auditStatus;
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,20 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.crm.controller.admin.contract.vo;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.ToString;
|
|
||||||
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - CRM 合同更新 Request VO")
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@ToString(callSuper = true)
|
|
||||||
public class CrmContractUpdateReqVO extends CrmContractBaseVO {
|
|
||||||
|
|
||||||
@Schema(description = "合同编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "10430")
|
|
||||||
@NotNull(message = "合同编号不能为空")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
package cn.iocoder.yudao.module.crm.framework.operatelog.core;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.iocoder.yudao.module.crm.dal.dataobject.business.CrmBusinessDO;
|
||||||
|
import cn.iocoder.yudao.module.crm.service.business.CrmBusinessService;
|
||||||
|
import com.mzt.logapi.service.IParseFunction;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CRM 商机的 {@link IParseFunction} 实现类
|
||||||
|
*
|
||||||
|
* @author HUIHUI
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
public class CrmBusinessParseFunction implements IParseFunction {
|
||||||
|
|
||||||
|
public static final String NAME = "getBusinessById";
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CrmBusinessService businessService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean executeBefore() {
|
||||||
|
return true; // 先转换值后对比
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String functionName() {
|
||||||
|
return NAME;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String apply(Object value) {
|
||||||
|
if (StrUtil.isEmptyIfStr(value)) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
CrmBusinessDO businessDO = businessService.getBusiness(Long.parseLong(value.toString()));
|
||||||
|
return businessDO == null ? "" : businessDO.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,50 @@
|
|||||||
|
package cn.iocoder.yudao.module.crm.framework.operatelog.core;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||||
|
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||||
|
import com.mzt.logapi.service.IParseFunction;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 管理员名字的 {@link IParseFunction} 实现类
|
||||||
|
*
|
||||||
|
* @author HUIHUI
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class SysAdminUserParseFunction implements IParseFunction {
|
||||||
|
|
||||||
|
public static final String NAME = "getAdminUserById";
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private AdminUserApi adminUserApi;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String functionName() {
|
||||||
|
return NAME;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String apply(Object value) {
|
||||||
|
if (StrUtil.isEmptyIfStr(value)) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取用户信息
|
||||||
|
AdminUserRespDTO user = adminUserApi.getUser(Long.parseLong(value.toString()));
|
||||||
|
if (user == null) {
|
||||||
|
log.warn("[apply][获取用户{{}}为空", value);
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
// 返回格式 芋道源码(13888888888)
|
||||||
|
String nickname = user.getNickname();
|
||||||
|
if (StrUtil.isEmpty(user.getMobile())) {
|
||||||
|
return nickname;
|
||||||
|
}
|
||||||
|
return StrUtil.format("{}({})", nickname, user.getMobile());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,38 @@
|
|||||||
|
package cn.iocoder.yudao.module.crm.framework.operatelog.core;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.iocoder.yudao.framework.ip.core.utils.AreaUtils;
|
||||||
|
import com.mzt.logapi.service.IParseFunction;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 地名的 {@link IParseFunction} 实现类
|
||||||
|
*
|
||||||
|
* @author HUIHUI
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class SysAreaParseFunction implements IParseFunction {
|
||||||
|
|
||||||
|
public static final String NAME = "getArea";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean executeBefore() {
|
||||||
|
return true; // 先转换值后对比
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String functionName() {
|
||||||
|
return NAME;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String apply(Object value) {
|
||||||
|
if (StrUtil.isEmptyIfStr(value)) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return AreaUtils.format(Integer.parseInt(value.toString()));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,39 @@
|
|||||||
|
package cn.iocoder.yudao.module.crm.framework.operatelog.core;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.iocoder.yudao.framework.dict.core.util.DictFrameworkUtils;
|
||||||
|
import cn.iocoder.yudao.module.infra.enums.DictTypeConstants;
|
||||||
|
import com.mzt.logapi.service.IParseFunction;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否类型的 {@link IParseFunction} 实现类
|
||||||
|
*
|
||||||
|
* @author HUIHUI
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
public class SysBooleanParseFunction implements IParseFunction {
|
||||||
|
|
||||||
|
public static final String NAME = "getBoolean";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean executeBefore() {
|
||||||
|
return true; // 先转换值后对比
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String functionName() {
|
||||||
|
return NAME;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String apply(Object value) {
|
||||||
|
if (StrUtil.isEmptyIfStr(value)) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return DictFrameworkUtils.getDictDataLabel(DictTypeConstants.BOOLEAN_STRING, value.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,45 @@
|
|||||||
|
package cn.iocoder.yudao.module.crm.framework.operatelog.core;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
||||||
|
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
||||||
|
import com.mzt.logapi.service.IParseFunction;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 管理员名字的 {@link IParseFunction} 实现类
|
||||||
|
*
|
||||||
|
* @author HUIHUI
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class SysDeptParseFunction implements IParseFunction {
|
||||||
|
|
||||||
|
public static final String NAME = "getDeptById";
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private DeptApi deptApi;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String functionName() {
|
||||||
|
return NAME;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String apply(Object value) {
|
||||||
|
if (StrUtil.isEmptyIfStr(value)) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取部门信息
|
||||||
|
DeptRespDTO dept = deptApi.getDept(Long.parseLong(value.toString()));
|
||||||
|
if (dept == null) {
|
||||||
|
log.warn("[apply][获取部门{{}}为空", value);
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return dept.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,39 @@
|
|||||||
|
package cn.iocoder.yudao.module.crm.framework.operatelog.core;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.iocoder.yudao.framework.dict.core.util.DictFrameworkUtils;
|
||||||
|
import cn.iocoder.yudao.module.system.enums.DictTypeConstants;
|
||||||
|
import com.mzt.logapi.service.IParseFunction;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 行业的 {@link IParseFunction} 实现类
|
||||||
|
*
|
||||||
|
* @author HUIHUI
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
public class SysSexParseFunction implements IParseFunction {
|
||||||
|
|
||||||
|
public static final String NAME = "getSex";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean executeBefore() {
|
||||||
|
return true; // 先转换值后对比
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String functionName() {
|
||||||
|
return NAME;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String apply(Object value) {
|
||||||
|
if (StrUtil.isEmptyIfStr(value)) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return DictFrameworkUtils.getDictDataLabel(DictTypeConstants.USER_SEX, value.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue