字段修改

This commit is contained in:
zhangheng 2024-06-20 13:46:21 +08:00
parent da882d8475
commit 2bbd91fd71
5 changed files with 199 additions and 109 deletions

View File

@ -15,7 +15,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
* 标签字段内容信息对象 label_field_content
*
* @author xinelu
* @date 2024-03-11
* @date 2024-06-20
*/
@Data
@AllArgsConstructor
@ -45,25 +45,39 @@ public class LabelFieldContent extends BaseEntity {
private String fieldName;
/**
* 内容名称
* 字段编码同param_key字段值
*/
@ApiModelProperty(value = "内容名称")
@Excel(name = "内容名称")
private String contentName;
@ApiModelProperty(value = "字段编码同param_key字段值")
@Excel(name = "字段编码同param_key字段值")
private String fieldCode;
/**
* 内容编码
* 字段值同param_value
*/
@ApiModelProperty(value = "内容编码")
@Excel(name = "内容编码")
private String contentCode;
@ApiModelProperty(value = "字段值同param_value")
@Excel(name = "字段值同param_value")
private String fieldValue;
/**
* 结果预览
* 画像流水号用年月日时分秒毫秒数字转成的字符串
*/
@ApiModelProperty(value = "结果预览")
@Excel(name = "结果预览")
private String resultPreview;
@ApiModelProperty(value = "画像流水号,用年月日时分秒毫秒数字转成的字符串")
@Excel(name = "画像流水号,用年月日时分秒毫秒数字转成的字符串")
private String portraitSn;
/**
* 患者ID
*/
@ApiModelProperty(value = "患者ID")
@Excel(name = "患者ID")
private Long patientId;
/**
* 画像状态FIELD已归档INUSE在用
*/
@ApiModelProperty(value = "画像状态")
@Excel(name = "画像状态", readConverterExp = "FIELD已归档INUSE在用")
private String portraitStatus;
/**
* 内容排序
@ -79,11 +93,24 @@ public class LabelFieldContent extends BaseEntity {
@Excel(name = "内容备注信息")
private String contentRemark;
/**
* 画像字段标识存储方式例子${content}
*/
@ApiModelProperty(value = "画像字段标识,存储方式例子:${content}")
@Excel(name = "画像字段标识,存储方式例子:${content}")
private String fieldMark;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("fieldId", getFieldId())
.append("fieldName", getFieldName())
.append("fieldCode", getFieldCode())
.append("fieldValue", getFieldValue())
.append("portraitSn", getPortraitSn())
.append("patientId", getPatientId())
.append("portraitStatus", getPortraitStatus())
.append("contentSort", getContentSort())
.append("contentRemark", getContentRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -2,8 +2,6 @@ package com.xinelu.manage.domain.labelfieldinfo;
import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseEntity;
import com.xinelu.common.custominterface.Insert;
import com.xinelu.common.custominterface.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
@ -13,13 +11,11 @@ import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import javax.validation.constraints.NotBlank;
/**
* 标签字段信息对象 label_field_info
*
* @author xinelu
* @date 2024-03-11
* @date 2024-06-20
*/
@Data
@AllArgsConstructor
@ -39,7 +35,6 @@ public class LabelFieldInfo extends BaseEntity {
*/
@ApiModelProperty(value = "字段名称")
@Excel(name = "字段名称")
@NotBlank(message = "字段名称不能为空", groups = {Insert.class, Update.class})
private String fieldName;
/**
@ -54,7 +49,6 @@ public class LabelFieldInfo extends BaseEntity {
*/
@ApiModelProperty(value = "字段类型画像标签字段PORTRAIT_LABEL_FIELD知识库字段KNOWLEDGE_FIELD")
@Excel(name = "字段类型画像标签字段PORTRAIT_LABEL_FIELD知识库字段KNOWLEDGE_FIELD")
@NotBlank(message = "字段类型不能为空", groups = {Insert.class, Update.class})
private String fieldType;
/**
@ -70,4 +64,50 @@ public class LabelFieldInfo extends BaseEntity {
@ApiModelProperty(value = "字段备注信息")
@Excel(name = "字段备注信息")
private String fieldRemark;
/**
* 任务细分id当做分组使用
*/
@ApiModelProperty(value = "任务细分id当做分组使用")
private Long taskPartitionDictId;
/**
* 任务细分名称(冗余)
*/
@ApiModelProperty(value = "任务细分名称(冗余)")
@Excel(name = "任务细分名称")
private String taskPartitionDictName;
/**
* 任务类型表id(冗余)
*/
@ApiModelProperty(value = "任务类型表id(冗余)")
private Long taskTypeId;
/**
* 任务类型名称(冗余)
*/
@ApiModelProperty(value = "任务类型名称(冗余)")
private String taskTypeName;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("fieldName", getFieldName())
.append("fieldCode", getFieldCode())
.append("fieldType", getFieldType())
.append("fieldSort", getFieldSort())
.append("fieldRemark", getFieldRemark())
.append("taskPartitionDictId", getTaskPartitionDictId())
.append("taskPartitionDictName", getTaskPartitionDictName())
.append("taskTypeId", getTaskTypeId())
.append("taskTypeName", getTaskTypeName())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -79,7 +79,7 @@ public class LabelFieldContentServiceImpl implements ILabelFieldContentService {
throw new ServiceException("当前字段内容不存在,无法修改,请联系管理员");
}
// 检查除去当前记录外有没有重复内容名称
int existCount = labelFieldContentMapper.existCountByContentNameExcludingId(labelFieldContent.getId(), labelFieldContent.getFieldId(), labelFieldContent.getContentName());
int existCount = labelFieldContentMapper.existCountByContentNameExcludingId(labelFieldContent.getId(), labelFieldContent.getFieldId(), null);
if (existCount > 0) {
throw new ServiceException("当前标签字段类型下字段内容名称已存在");
}
@ -131,7 +131,7 @@ public class LabelFieldContentServiceImpl implements ILabelFieldContentService {
BeanUtils.copyProperties(contentDTO, labelFieldContent);
labelFieldContent.setFieldId(labelFieldContentAddDTO.getFieldId());
labelFieldContent.setFieldName(labelFieldContentAddDTO.getFieldName());
labelFieldContent.setContentCode(Constants.CONTENT_ENCODING + systemCodeUtil.generateDepartCode(Constants.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

@ -8,12 +8,13 @@
<result property="id" column="id"/>
<result property="fieldId" column="field_id"/>
<result property="fieldName" column="field_name"/>
<result property="contentName" column="content_name"/>
<result property="contentCode" column="content_code"/>
<result property="resultPreview" column="result_preview"/>
<result property="fieldCode" column="field_code"/>
<result property="fieldValue" column="field_value"/>
<result property="portraitSn" column="portrait_sn"/>
<result property="patientId" column="patient_id"/>
<result property="portraitStatus" column="portrait_status"/>
<result property="contentSort" column="content_sort"/>
<result property="contentRemark" column="content_remark"/>
<result property="fieldMark" column="field_mark"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
@ -24,12 +25,13 @@
select id,
field_id,
field_name,
content_name,
content_code,
result_preview,
field_code,
field_value,
portrait_sn,
patient_id,
portrait_status,
content_sort,
content_remark,
field_mark,
create_by,
create_time,
update_by,
@ -41,40 +43,31 @@
<include refid="selectLabelFieldContentVo"/>
<where>
<if test="fieldId != null ">
and field_id =
#{fieldId}
and field_id = #{fieldId}
</if>
<if test="fieldName != null and fieldName != ''">
and field_name like concat('%',
#{fieldName},
'%'
)
and field_name like concat('%', #{fieldName}, '%')
</if>
<if test="contentName != null and contentName != ''">
and content_name like concat('%',
#{contentName},
'%'
)
<if test="fieldCode != null and fieldCode != ''">
and field_code = #{fieldCode}
</if>
<if test="contentCode != null and contentCode != ''">
and content_code =
#{contentCode}
<if test="fieldValue != null and fieldValue != ''">
and field_value = #{fieldValue}
</if>
<if test="resultPreview != null and resultPreview != ''">
and result_preview =
#{resultPreview}
<if test="portraitSn != null and portraitSn != ''">
and portrait_sn = #{portraitSn}
</if>
<if test="patientId != null ">
and patient_id = #{patientId}
</if>
<if test="portraitStatus != null and portraitStatus != ''">
and portrait_status = #{portraitStatus}
</if>
<if test="contentSort != null ">
and content_sort =
#{contentSort}
and content_sort = #{contentSort}
</if>
<if test="contentRemark != null and contentRemark != ''">
and content_remark =
#{contentRemark}
</if>
<if test="fieldMark != null and fieldMark != ''">
and field_mark =
#{fieldMark}
and content_remark = #{contentRemark}
</if>
</where>
order by content_sort, create_time DESC
@ -109,18 +102,20 @@
</if>
<if test="fieldName != null">field_name,
</if>
<if test="contentName != null">content_name,
<if test="fieldCode != null">field_code,
</if>
<if test="contentCode != null">content_code,
<if test="fieldValue != null">field_value,
</if>
<if test="resultPreview != null">result_preview,
<if test="portraitSn != null">portrait_sn,
</if>
<if test="patientId != null">patient_id,
</if>
<if test="portraitStatus != null">portrait_status,
</if>
<if test="contentSort != null">content_sort,
</if>
<if test="contentRemark != null">content_remark,
</if>
<if test="fieldMark != null">field_mark,
</if>
<if test="createBy != null">create_by,
</if>
<if test="createTime != null">create_time,
@ -135,18 +130,20 @@
</if>
<if test="fieldName != null">#{fieldName},
</if>
<if test="contentName != null">#{contentName},
<if test="fieldCode != null">#{fieldCode},
</if>
<if test="contentCode != null">#{contentCode},
<if test="fieldValue != null">#{fieldValue},
</if>
<if test="resultPreview != null">#{resultPreview},
<if test="portraitSn != null">#{portraitSn},
</if>
<if test="patientId != null">#{patientId},
</if>
<if test="portraitStatus != null">#{portraitStatus},
</if>
<if test="contentSort != null">#{contentSort},
</if>
<if test="contentRemark != null">#{contentRemark},
</if>
<if test="fieldMark != null">#{fieldMark},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="createTime != null">#{createTime},
@ -167,14 +164,20 @@
<if test="fieldName != null">field_name =
#{fieldName},
</if>
<if test="contentName != null">content_name =
#{contentName},
<if test="fieldCode != null">field_code =
#{fieldCode},
</if>
<if test="contentCode != null">content_code =
#{contentCode},
<if test="fieldValue != null">field_value =
#{fieldValue},
</if>
<if test="resultPreview != null">result_preview =
#{resultPreview},
<if test="portraitSn != null">portrait_sn =
#{portraitSn},
</if>
<if test="patientId != null">patient_id =
#{patientId},
</if>
<if test="portraitStatus != null">portrait_status =
#{portraitStatus},
</if>
<if test="contentSort != null">content_sort =
#{contentSort},
@ -182,9 +185,6 @@
<if test="contentRemark != null">content_remark =
#{contentRemark},
</if>
<if test="fieldMark != null">field_mark =
#{fieldMark},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
@ -219,12 +219,8 @@
select id LabelFieldContentId,
field_id,
field_name,
content_name,
content_code,
result_preview,
content_sort,
content_remark,
field_mark
content_remark
from label_field_content
<where>
<if test="labelFieldIds != null and labelFieldIds.size() > 0">

View File

@ -11,6 +11,10 @@
<result property="fieldType" column="field_type"/>
<result property="fieldSort" column="field_sort"/>
<result property="fieldRemark" column="field_remark"/>
<result property="taskPartitionDictId" column="task_partition_dict_id"/>
<result property="taskPartitionDictName" column="task_partition_dict_name"/>
<result property="taskTypeId" column="task_type_id"/>
<result property="taskTypeName" column="task_type_name"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
@ -18,43 +22,38 @@
</resultMap>
<sql id="selectLabelFieldInfoVo">
select id,
field_name,
field_code,
field_type,
field_sort,
field_remark,
create_by,
create_time,
update_by,
update_time
from label_field_info
select id, field_name, field_code, field_type, field_sort, field_remark, task_partition_dict_id, task_partition_dict_name, task_type_id, task_type_name, create_by, create_time, update_by, update_time from label_field_info
</sql>
<select id="selectLabelFieldInfoList" parameterType="LabelFieldInfo" resultMap="LabelFieldInfoResult">
<include refid="selectLabelFieldInfoVo"/>
<where>
<if test="fieldName != null and fieldName != ''">
and field_name like concat('%',
#{fieldName},
'%'
)
and field_name like concat('%', #{fieldName}, '%')
</if>
<if test="fieldCode != null and fieldCode != ''">
and field_code =
#{fieldCode}
and field_code = #{fieldCode}
</if>
<if test="fieldType != null and fieldType != ''">
and field_type =
#{fieldType}
and field_type = #{fieldType}
</if>
<if test="fieldSort != null ">
and field_sort =
#{fieldSort}
and field_sort = #{fieldSort}
</if>
<if test="fieldRemark != null and fieldRemark != ''">
and field_remark =
#{fieldRemark}
and field_remark = #{fieldRemark}
</if>
<if test="taskPartitionDictId != null ">
and task_partition_dict_id = #{taskPartitionDictId}
</if>
<if test="taskPartitionDictName != null and taskPartitionDictName != ''">
and task_partition_dict_name like concat('%', #{taskPartitionDictName}, '%')
</if>
<if test="taskTypeId != null ">
and task_type_id = #{taskTypeId}
</if>
<if test="taskTypeName != null and taskTypeName != ''">
and task_type_name like concat('%', #{taskTypeName}, '%')
</if>
</where>
order by field_sort, create_time DESC
@ -109,6 +108,14 @@
</if>
<if test="fieldRemark != null">field_remark,
</if>
<if test="taskPartitionDictId != null">task_partition_dict_id,
</if>
<if test="taskPartitionDictName != null">task_partition_dict_name,
</if>
<if test="taskTypeId != null">task_type_id,
</if>
<if test="taskTypeName != null">task_type_name,
</if>
<if test="createBy != null">create_by,
</if>
<if test="createTime != null">create_time,
@ -129,6 +136,14 @@
</if>
<if test="fieldRemark != null">#{fieldRemark},
</if>
<if test="taskPartitionDictId != null">#{taskPartitionDictId},
</if>
<if test="taskPartitionDictName != null">#{taskPartitionDictName},
</if>
<if test="taskTypeId != null">#{taskTypeId},
</if>
<if test="taskTypeName != null">#{taskTypeName},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="createTime != null">#{createTime},
@ -158,6 +173,18 @@
<if test="fieldRemark != null">field_remark =
#{fieldRemark},
</if>
<if test="taskPartitionDictId != null">task_partition_dict_id =
#{taskPartitionDictId},
</if>
<if test="taskPartitionDictName != null">task_partition_dict_name =
#{taskPartitionDictName},
</if>
<if test="taskTypeId != null">task_type_id =
#{taskTypeId},
</if>
<if test="taskTypeName != null">task_type_name =
#{taskTypeName},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>