分组
This commit is contained in:
parent
9ddba6243d
commit
6061b870b1
@ -6,7 +6,7 @@ spring:
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://192.168.16.64:3306/post-discharge?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
url: jdbc:mysql://192.168.16.64:3306/post-discharge?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true
|
||||
username: root
|
||||
password: 1qaz!@#$
|
||||
# 从库数据源
|
||||
|
||||
@ -4,9 +4,10 @@ import com.xinelu.manage.domain.labelfieldcontent.LabelFieldContent;
|
||||
import com.xinelu.manage.vo.labelfieldcontent.GroupingValue;
|
||||
import com.xinelu.manage.vo.labelfieldcontent.LabelFieldContentVO;
|
||||
import com.xinelu.manage.vo.labelfieldcontent.LabelFieldInfoContentVo;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 标签字段内容信息Mapper接口
|
||||
*
|
||||
@ -81,7 +82,7 @@ public interface LabelFieldContentMapper {
|
||||
List<LabelFieldContentVO> selectLabelFieldContent(@Param("labelFieldIds") List<Long> labelFieldIds);
|
||||
|
||||
/**
|
||||
* 画像查询
|
||||
* 画像内容查询
|
||||
*
|
||||
* @param taskPartitionDictId 细分id
|
||||
* @param patientId 患者id
|
||||
@ -106,10 +107,10 @@ public interface LabelFieldContentMapper {
|
||||
int insertLabelFieldContentList(List<GroupingValue> labelFieldContentList);
|
||||
|
||||
/**
|
||||
* 批量修改
|
||||
* 批量修改 (dev.yml url &allowMultiQueries=true)
|
||||
*
|
||||
* @param labelFieldContentList
|
||||
* @return
|
||||
* @param labelFieldContentList 标签内容
|
||||
* @return int
|
||||
*/
|
||||
int updateContentRemarkLabelFieldContentList(List<GroupingValue> labelFieldContentList);
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.xinelu.manage.mapper.labelfieldinfo;
|
||||
|
||||
import com.xinelu.manage.domain.labelfieldinfo.LabelFieldInfo;
|
||||
import com.xinelu.manage.vo.labelfieldcontent.GroupingValue;
|
||||
import com.xinelu.manage.vo.labelfieldinfo.LabelFieldVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@ -86,4 +87,12 @@ public interface LabelFieldInfoMapper {
|
||||
* @return LabelFieldInfo
|
||||
*/
|
||||
List<LabelFieldInfo> taskPartitionDictIdList(String taskPartitionDictName);
|
||||
|
||||
/**
|
||||
* 查询标签
|
||||
*
|
||||
* @param taskPartitionDictId 标签
|
||||
* @return GroupingValue
|
||||
*/
|
||||
List<GroupingValue> selectLabelFieldInfoByTaskPartitionDictId(Long taskPartitionDictId);
|
||||
}
|
||||
|
||||
@ -197,7 +197,7 @@ public class LabelFieldContentServiceImpl implements ILabelFieldContentService {
|
||||
return new ArrayList<>(collect.values());
|
||||
}
|
||||
//查询未维护标签及从患者表取值
|
||||
List<GroupingValue> labelFieldContentList = labelFieldContentMapper.groupingValue(taskPartitionDictId, null, null);
|
||||
List<GroupingValue> labelFieldContentList = labelFieldInfoMapper.selectLabelFieldInfoByTaskPartitionDictId(taskPartitionDictId);
|
||||
JSONObject paramsValue = getParamsValue(patientId);
|
||||
if (CollectionUtils.isEmpty(labelFieldContentList)) {
|
||||
return new ArrayList<>();
|
||||
@ -211,6 +211,7 @@ public class LabelFieldContentServiceImpl implements ILabelFieldContentService {
|
||||
}
|
||||
List<String> strings1 = Arrays.asList(strings);
|
||||
for (GroupingValue groupingValue : labelFieldContentList) {
|
||||
groupingValue.setPatientId(patientId);
|
||||
String s = strings1.stream().filter(Objects::nonNull).filter(item -> item.equals(groupingValue.getFieldCode())).findFirst().orElse(new String());
|
||||
groupingValue.setFieldValue(paramsValue.getOrDefault(s, "").toString());
|
||||
}
|
||||
@ -219,25 +220,6 @@ public class LabelFieldContentServiceImpl implements ILabelFieldContentService {
|
||||
return lists;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据任务细分类型获取患者的真实信息
|
||||
*
|
||||
* @param patientId 患者主键
|
||||
* @return 实际信息
|
||||
*/
|
||||
private JSONObject getParamsValue(Long patientId) {
|
||||
JSONObject retObj;
|
||||
List<PatientAllInfoViewUppercase> patientAllInfoViews = patientAllInfoViewMapper.selectPatientAllInfoListViewByPatientId(patientId);
|
||||
if (CollectionUtils.isEmpty(patientAllInfoViews) || ObjectUtils.isEmpty(patientAllInfoViews.get(0))) {
|
||||
throw new ServiceException("患者信息获取错误,请联系管理员!");
|
||||
}
|
||||
PatientAllInfoViewUppercase patientAllInfoView = patientAllInfoViews.get(0);
|
||||
retObj = JSONObject.parseObject(JSONObject.toJSONString(patientAllInfoView));
|
||||
// 性别转换成中文、计算年龄
|
||||
retObj.fluentPut("SEX", PatientSexEnum.getInfoByCode(patientAllInfoView.getSEX()).getInfo()).fluentPut("AGE", BaseUtil.getAge(patientAllInfoView.getBIRTHDATE()));
|
||||
return retObj;
|
||||
}
|
||||
|
||||
/**
|
||||
* 画像内容新增
|
||||
*
|
||||
@ -298,4 +280,23 @@ public class LabelFieldContentServiceImpl implements ILabelFieldContentService {
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据任务细分类型获取患者的真实信息
|
||||
*
|
||||
* @param patientId 患者主键
|
||||
* @return 实际信息
|
||||
*/
|
||||
private JSONObject getParamsValue(Long patientId) {
|
||||
JSONObject retObj;
|
||||
List<PatientAllInfoViewUppercase> patientAllInfoViews = patientAllInfoViewMapper.selectPatientAllInfoListViewByPatientId(patientId);
|
||||
if (CollectionUtils.isEmpty(patientAllInfoViews) || ObjectUtils.isEmpty(patientAllInfoViews.get(0))) {
|
||||
throw new ServiceException("患者信息获取错误,请联系管理员!");
|
||||
}
|
||||
PatientAllInfoViewUppercase patientAllInfoView = patientAllInfoViews.get(0);
|
||||
retObj = JSONObject.parseObject(JSONObject.toJSONString(patientAllInfoView));
|
||||
// 性别转换成中文、计算年龄
|
||||
retObj.fluentPut("SEX", PatientSexEnum.getInfoByCode(patientAllInfoView.getSEX()).getInfo()).fluentPut("AGE", BaseUtil.getAge(patientAllInfoView.getBIRTHDATE()));
|
||||
return retObj;
|
||||
}
|
||||
}
|
||||
|
||||
@ -104,10 +104,6 @@ public class LabelFieldInfoServiceImpl implements ILabelFieldInfoService {
|
||||
if (ObjectUtils.isEmpty(fieldInfo)) {
|
||||
throw new ServiceException("当前标签信息不存在,无法修改,请联系管理员");
|
||||
}
|
||||
// 检查除当前记录外有没有重复的标签信息名称
|
||||
if (labelFieldInfoMapper.countByFieldNameExcludingId(labelFieldInfo.getId(), labelFieldInfo.getFieldType(), labelFieldInfo.getFieldName()) > 0) {
|
||||
throw new ServiceException("当前字段类型下字段名称已存在");
|
||||
}
|
||||
// 执行修改操作
|
||||
labelFieldInfo.setUpdateBy(SecurityUtils.getUsername());
|
||||
labelFieldInfo.setUpdateTime(LocalDateTime.now());
|
||||
|
||||
@ -246,6 +246,7 @@
|
||||
lfi.task_type_name,
|
||||
lfc.id labelFieldContentId,
|
||||
lfc.field_id,
|
||||
lfc.patient_id,
|
||||
lfc.field_name,
|
||||
lfc.field_code,
|
||||
lfc.field_value,
|
||||
@ -313,42 +314,38 @@
|
||||
</insert>
|
||||
|
||||
<update id="updateContentRemarkLabelFieldContentList">
|
||||
<foreach collection="list" item="item" index="index" open="" close="" separator=";">
|
||||
<foreach collection="list" item="labelFieldContentList" index="index" open="" close="" separator=";">
|
||||
update label_field_content
|
||||
<if test="item.fieldId != null">field_id =
|
||||
#{item.fieldId},
|
||||
</if>
|
||||
<if test="item.fieldName != null">field_name =
|
||||
#{item.fieldName},
|
||||
</if>
|
||||
<if test="item.fieldCode != null">field_code =
|
||||
#{item.fieldCode},
|
||||
</if>
|
||||
<if test="item.fieldValue != null">field_value =
|
||||
#{item.fieldValue},
|
||||
</if>
|
||||
<if test="item.portraitSn != null">portrait_sn =
|
||||
#{item.portraitSn},
|
||||
</if>
|
||||
<if test="item.patientId != null">patient_id =
|
||||
#{item.patientId},
|
||||
</if>
|
||||
<if test="item.portraitStatus != null">portrait_status =
|
||||
#{item.portraitStatus},
|
||||
</if>
|
||||
<if test="item.contentSort != null">content_sort =
|
||||
#{item.contentSort},
|
||||
</if>
|
||||
<if test="item.contentRemark != null">content_remark =
|
||||
#{item.contentRemark},
|
||||
</if>
|
||||
<if test="item.updateBy != null">update_by =
|
||||
#{item.updateBy},
|
||||
</if>
|
||||
<if test="item.updateTime != null">update_time =
|
||||
#{item.updateTime},
|
||||
</if>
|
||||
where id = #{item.labelFieldContentId}
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="labelFieldContentList.fieldId != null">field_id =
|
||||
#{labelFieldContentList.fieldId},
|
||||
</if>
|
||||
<if test="labelFieldContentList.fieldName != null">field_name =
|
||||
#{labelFieldContentList.fieldName},
|
||||
</if>
|
||||
<if test="labelFieldContentList.fieldCode != null">field_code =
|
||||
#{labelFieldContentList.fieldCode},
|
||||
</if>
|
||||
<if test="labelFieldContentList.fieldValue != null">field_value =
|
||||
#{labelFieldContentList.fieldValue},
|
||||
</if>
|
||||
<if test="labelFieldContentList.portraitSn != null">portrait_sn =
|
||||
#{labelFieldContentList.portraitSn},
|
||||
</if>
|
||||
<if test="labelFieldContentList.patientId != null">patient_id =
|
||||
#{labelFieldContentList.patientId},
|
||||
</if>
|
||||
<if test="labelFieldContentList.portraitStatus != null">portrait_status =
|
||||
#{labelFieldContentList.portraitStatus},
|
||||
</if>
|
||||
<if test="labelFieldContentList.updateBy != null">update_by =
|
||||
#{labelFieldContentList.updateBy},
|
||||
</if>
|
||||
<if test="labelFieldContentList.updateTime != null">update_time =
|
||||
#{labelFieldContentList.updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
where id = #{labelFieldContentList.labelFieldContentId}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
@ -225,4 +225,27 @@
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectLabelFieldInfoByTaskPartitionDictId"
|
||||
resultType="com.xinelu.manage.vo.labelfieldcontent.GroupingValue">
|
||||
select id labelFieldInfoId,
|
||||
field_name,
|
||||
field_code,
|
||||
field_type,
|
||||
field_sort,
|
||||
field_remark,
|
||||
task_partition_dict_id,
|
||||
task_partition_dict_name,
|
||||
task_type_id,
|
||||
task_type_name
|
||||
from label_field_info
|
||||
<where>
|
||||
<if test="taskPartitionDictId != null and taskPartitionDictId != 0">
|
||||
and task_partition_dict_id = #{taskPartitionDictId}
|
||||
</if>
|
||||
<if test="taskPartitionDictId == null">
|
||||
and task_partition_dict_id is null
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue
Block a user