补充枚举类

This commit is contained in:
youxilong 2024-03-19 10:29:15 +08:00
parent 8ed5796704
commit dac6412d6c
13 changed files with 171 additions and 53 deletions

View File

@ -208,4 +208,14 @@ public class Constants {
* 出院
*/
public static final String DISCHARGED = "discharged";
/**
* 字段信息编码前缀
*/
public static final String FIELD_ENCODING = "FE";
/**
* 字段内容编码前缀
*/
public static final String CONTENT_ENCODING = "CE";
}

View File

@ -1,29 +0,0 @@
package com.xinelu.common.constant;
/**
* 字段标签信息字段类型
*
* @author : youxilong
* @date : 2024/3/11 10:19
*/
public class LabelFieldInfoFieldTypeConstants {
/**
* 画像标签字段
*/
public static final String PORTRAIT_LABEL_FIELD = "PORTRAIT_LABEL_FIELD";
/**
* 知识库字段
*/
public static final String KNOWLEDGE_FIELD = "KNOWLEDGE_FIELD";
/**
* 字段信息编码前缀
*/
public static final String FIELD_ENCODING = "FE";
/**
* 字段内容编码前缀
*/
public static final String CONTENT_ENCODING = "CE";
}

View File

@ -0,0 +1,25 @@
package com.xinelu.common.enums;
/**
* 硬件类型标识
*
* @author : youxilong
* @date : 2024/3/19 10:09
*/
public enum HardWareTypeEnum {
/**
* 硬件类型:血压仪
*/
BLOOD_PRESSURE,
/**
* 硬件类型:血糖仪
*/
GLUCOSE_METER,
/**
* 硬件类型:心电仪
*/
ELECTROCARDIOGRA
}

View File

@ -0,0 +1,20 @@
package com.xinelu.common.enums;
/**
* 字段类型标识
*
* @author : youxilong
* @date : 2024/3/19 10:22
*/
public enum LabelFieldTypeEnum {
/**
* 字段类型:画像标签字段
*/
PORTRAIT_LABEL_FIELD,
/**
* 字段类型:知识库字段
*/
KNOWLEDGE_FIELD
}

View File

@ -0,0 +1,25 @@
package com.xinelu.common.enums;
/**
* 话术状态标识
*
* @author : youxilong
* @date : 2024/3/19 10:06
*/
public enum ScriptStatusEnum {
/**
* 话术状态正常
*/
NORMAL,
/**
* 话术状态:下架
*/
OFF_SHELF,
/**
* 话术状态:暂停
*/
SUSPEND
}

View File

@ -0,0 +1,20 @@
package com.xinelu.common.enums;
/**
* 服务频次标识
*
* @author : youxilong
* @date : 2024/3/19 10:12
*/
public enum ServiceFrequencyTypeEnum {
/**
* 服务频次类型数字DIGIT
*/
DIGIT,
/**
* 服务频次类型文本TEXT
*/
TEXT
}

View File

@ -6,7 +6,7 @@ package com.xinelu.common.enums;
* @author : youxilong
* @date : 2024/2/29 20:08
*/
public enum ServiceWayContentServiceType {
public enum ServiceTypeEnum {
/**
* 服务方式
@ -21,16 +21,6 @@ public enum ServiceWayContentServiceType {
/**
* 服务频次
*/
SERVICE_FREQUENCY,
/**
* 服务频次类型数字DIGIT
*/
DIGIT,
/**
* 服务频次类型文本TEXT
*/
TEXT
SERVICE_FREQUENCY
}

View File

@ -0,0 +1,15 @@
package com.xinelu.common.enums;
/**
* 短信通道标识
*
* @author : youxilong
* @date : 2024/3/19 10:14
*/
public enum TextMessageChannelEnum {
/**
* 短信通道水滴平台
*/
WATER_DROPLET_PLATFORM
}

View File

@ -0,0 +1,20 @@
package com.xinelu.common.enums;
/**
* 短信状态标识
*
* @author : youxilong
* @date : 2024/3/19 10:15
*/
public enum TextMessageStatusEnum {
/**
* 短信状态:上架
*/
GROUNDING,
/**
* 短信状态:下架
*/
OFF_SHELF
}

View File

@ -0,0 +1,21 @@
package com.xinelu.common.enums;
/**
* 微信模板来源
*
* @author : youxilong
* @date : 2024/3/19 10:19
*/
public enum WeChatTemplateSourceEnum {
/**
* 模板来源:小程序
*/
WE_CHAT_APPLET,
/**
* 模板来源:公众号
*/
WE_CHAT_OFFICIAL_ACCOUNT
}

View File

@ -1,6 +1,6 @@
package com.xinelu.manage.service.labelfieldcontent.impl;
import com.xinelu.common.constant.LabelFieldInfoFieldTypeConstants;
import com.xinelu.common.constant.Constants;
import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.bean.BeanUtils;
@ -128,7 +128,7 @@ public class LabelFieldContentServiceImpl implements ILabelFieldContentService {
BeanUtils.copyProperties(contentDTO, labelFieldContent);
labelFieldContent.setFieldId(labelFieldContentAddDTO.getFieldId());
labelFieldContent.setFieldName(labelFieldContentAddDTO.getFieldName());
labelFieldContent.setContentCode(LabelFieldInfoFieldTypeConstants.CONTENT_ENCODING + systemCodeUtil.generateDepartCode(LabelFieldInfoFieldTypeConstants.CONTENT_ENCODING));
labelFieldContent.setContentCode(Constants.CONTENT_ENCODING + systemCodeUtil.generateDepartCode(Constants.CONTENT_ENCODING));
labelFieldContent.setCreateBy(SecurityUtils.getUsername());
labelFieldContent.setCreateTime(LocalDateTime.now());
if (labelFieldContentMapper.insertLabelFieldContent(labelFieldContent) <= 0) {

View File

@ -1,6 +1,6 @@
package com.xinelu.manage.service.labelfieldinfo.impl;
import com.xinelu.common.constant.LabelFieldInfoFieldTypeConstants;
import com.xinelu.common.constant.Constants;
import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.codes.GenerateSystemCodeUtil;
@ -142,7 +142,7 @@ public class LabelFieldInfoServiceImpl implements ILabelFieldInfoService {
}
// 如果不存在执行新增操作
for (LabelFieldInfo labelFieldInfo : fieldInfoList) {
labelFieldInfo.setFieldCode(LabelFieldInfoFieldTypeConstants.FIELD_ENCODING + systemCodeUtil.generateDepartCode(LabelFieldInfoFieldTypeConstants.FIELD_ENCODING));
labelFieldInfo.setFieldCode(Constants.FIELD_ENCODING + systemCodeUtil.generateDepartCode(Constants.FIELD_ENCODING));
labelFieldInfo.setCreateBy(SecurityUtils.getUsername());
labelFieldInfo.setCreateTime(LocalDateTime.now());
if (labelFieldInfoMapper.insertLabelFieldInfo(labelFieldInfo) <= 0) {

View File

@ -1,7 +1,8 @@
package com.xinelu.manage.service.servicewaycontent.impl;
import com.xinelu.common.constant.Constants;
import com.xinelu.common.enums.ServiceWayContentServiceType;
import com.xinelu.common.enums.ServiceFrequencyTypeEnum;
import com.xinelu.common.enums.ServiceTypeEnum;
import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.bean.BeanUtils;
@ -85,7 +86,7 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService {
throw new ServiceException("当前服务内容下服务频次已存在");
}
// 如果当前服务内容下服务频次不存在新增服务频次
serviceFrequency.setServiceType(ServiceWayContentServiceType.SERVICE_FREQUENCY.toString());
serviceFrequency.setServiceType(ServiceTypeEnum.SERVICE_FREQUENCY.toString());
serviceFrequency.setServiceContentId(serviceWayContentVO.getId());
serviceFrequency.setServiceFrequencyType(serviceWayContentAddDTO.getServiceFrequencyType());
serviceFrequency.setServiceFrequencyText(serviceWayContentAddDTO.getServiceFrequencyText());
@ -100,7 +101,7 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService {
// 如果服务内容在服务内容表不存在新增服务内容新增服务频次
// 新增服务内容
ServiceWayContent serviceContent = new ServiceWayContent();
serviceContent.setServiceType(ServiceWayContentServiceType.SERVICE_CONTENT.toString());
serviceContent.setServiceType(ServiceTypeEnum.SERVICE_CONTENT.toString());
serviceContent.setServiceWayId(serviceWayContentAddDTO.getServiceWayId());
serviceContent.setServiceContent(serviceWayContentAddDTO.getServiceContent());
serviceContent.setCreateBy(username);
@ -109,7 +110,7 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService {
throw new ServiceException("新增服务内容失败");
}
// 新增服务频次
serviceFrequency.setServiceType(ServiceWayContentServiceType.SERVICE_FREQUENCY.toString());
serviceFrequency.setServiceType(ServiceTypeEnum.SERVICE_FREQUENCY.toString());
serviceFrequency.setServiceContentId(serviceContent.getId());
serviceFrequency.setServiceFrequencyType(serviceWayContentAddDTO.getServiceFrequencyType());
serviceFrequency.setServiceFrequencyText(serviceWayContentAddDTO.getServiceFrequencyText());
@ -159,7 +160,7 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService {
ServiceWayContent newServiceContent = new ServiceWayContent();
newServiceContent.setServiceWayId(serviceWayContentEditDTO.getServiceWayId());
newServiceContent.setServiceContent(serviceWayContentEditDTO.getServiceContent());
newServiceContent.setServiceType(ServiceWayContentServiceType.SERVICE_CONTENT.toString());
newServiceContent.setServiceType(ServiceTypeEnum.SERVICE_CONTENT.toString());
newServiceContent.setCreateBy(username);
newServiceContent.setCreateTime(LocalDateTime.now());
serviceWayContentMapper.insertServiceWayContent(newServiceContent);
@ -176,9 +177,9 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService {
// 如果服务频次改变了检查新服务频次的重复性
if (serviceFrequencyChanged) {
boolean isFrequencyDuplicate = false;
if (ServiceWayContentServiceType.TEXT.toString().equals(serviceWayContentEditDTO.getServiceFrequencyType())) {
if (ServiceFrequencyTypeEnum.TEXT.toString().equals(serviceWayContentEditDTO.getServiceFrequencyType())) {
isFrequencyDuplicate = serviceWayContentMapper.isServiceFrequencyTextDuplicate(serviceWayContentEditDTO);
} else if (ServiceWayContentServiceType.DIGIT.toString().equals(serviceWayContentEditDTO.getServiceFrequencyType())) {
} else if (ServiceFrequencyTypeEnum.DIGIT.toString().equals(serviceWayContentEditDTO.getServiceFrequencyType())) {
isFrequencyDuplicate = serviceWayContentMapper.isServiceFrequencyDigitDuplicate(serviceWayContentEditDTO);
}
if (isFrequencyDuplicate) {
@ -246,7 +247,7 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService {
}
// 如果不存在执行新增功能
serviceWayContent.setServiceWayCode(Constants.SERVICE_MODE_ENCODING + systemCodeUtil.generateDepartCode(Constants.SERVICE_MODE_ENCODING));
serviceWayContent.setServiceType(ServiceWayContentServiceType.SERVICE_WRY.toString());
serviceWayContent.setServiceType(ServiceTypeEnum.SERVICE_WRY.toString());
serviceWayContent.setCreateBy(SecurityUtils.getUsername());
serviceWayContent.setCreateTime(LocalDateTime.now());
return serviceWayContentMapper.insertServiceWayContent(serviceWayContent);