新增 ParseFunctionNameConstants 常量枚举
parent
63db275af1
commit
9bba1ce8a4
@ -0,0 +1,17 @@
|
||||
package cn.iocoder.yudao.module.crm.enums.operatelog;
|
||||
|
||||
/**
|
||||
* functionName 常量枚举
|
||||
* 方便别的模块调用
|
||||
*
|
||||
* @author HUIHUI
|
||||
*/
|
||||
public interface CrmParseFunctionNameConstants {
|
||||
|
||||
String GET_CONTACT_BY_ID = "getContactById"; // 获取联系人信息
|
||||
String GET_CUSTOMER_BY_ID = "getCustomerById"; // 获取客户信息
|
||||
String GET_CUSTOMER_INDUSTRY = "getCustomerIndustry"; // 获取客户行业信息
|
||||
String GET_CUSTOMER_LEVEL = "getCustomerLevel"; // 获取客户级别
|
||||
String GET_CUSTOMER_SOURCE = "getCustomerSource"; // 获取客户来源
|
||||
|
||||
}
|
||||
@ -1,44 +0,0 @@
|
||||
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
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class CrmSysUserParseFunction implements IParseFunction {
|
||||
|
||||
public static final String NAME = "getUserById";
|
||||
|
||||
@Resource
|
||||
private AdminUserApi adminUserApi;
|
||||
|
||||
@Override
|
||||
public boolean executeBefore() {
|
||||
return true; // 先转换值后对比
|
||||
}
|
||||
|
||||
@Override
|
||||
public String functionName() {
|
||||
return NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String apply(Object value) {
|
||||
if (StrUtil.isEmptyIfStr(value)) {
|
||||
return "";
|
||||
}
|
||||
AdminUserRespDTO adminUserRespDTO = adminUserApi.getUser(Long.parseLong(value.toString()));
|
||||
return adminUserRespDTO == null ? "" : adminUserRespDTO.getNickname();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package cn.iocoder.yudao.module.system.enums.operatelog;
|
||||
|
||||
/**
|
||||
* functionName 常量枚举
|
||||
* 方便别的模块调用
|
||||
*
|
||||
* @author HUIHUI
|
||||
*/
|
||||
public interface SysParseFunctionNameConstants {
|
||||
|
||||
String GET_ADMIN_USER_BY_ID = "getAdminUserById"; // 获取用户信息
|
||||
String GET_DEPT_BY_ID = "getDeptById"; // 获取部门信息
|
||||
String GET_AREA = "getArea"; // 获取区域信息
|
||||
String GET_SEX = "getSex"; // 获取性别
|
||||
String GET_BOOLEAN = "getBoolean"; // 获取是否
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue