画像编辑

This commit is contained in:
zhangheng 2024-07-01 14:47:28 +08:00
parent fe4c9382c9
commit 707f7f5edc
12 changed files with 194 additions and 67 deletions

View File

@ -15,6 +15,8 @@ import com.xinelu.manage.vo.labelfieldcontent.LabelField;
import java.util.List; import java.util.List;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.xinelu.manage.vo.labelfieldcontent.LabelFieldAndPartitionDict;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -111,7 +113,7 @@ public class LabelFieldContentController extends BaseController {
* 画像查询 * 画像查询
*/ */
@GetMapping("/groupingValue") @GetMapping("/groupingValue")
public List<List<GroupingValue>> groupingValue(Long taskPartitionDictId, Long patientId) { public List<LabelFieldAndPartitionDict> groupingValue(Long taskPartitionDictId, Long patientId) {
return labelFieldContentService.groupingValue(taskPartitionDictId, patientId); return labelFieldContentService.groupingValue(taskPartitionDictId, patientId);
} }

View File

@ -38,6 +38,9 @@ public class TaskTypeDictController extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
/**
* 查询任务类型字典列表(不分页)
*/
@GetMapping("/selectTaskTypeList") @GetMapping("/selectTaskTypeList")
public AjaxResult selectTaskTypeList(TaskTypeDict taskTypeDict) { public AjaxResult selectTaskTypeList(TaskTypeDict taskTypeDict) {
return AjaxResult.success(taskTypeDictService.selectTaskTypeDictList(taskTypeDict)); return AjaxResult.success(taskTypeDictService.selectTaskTypeDictList(taskTypeDict));

View File

@ -2,6 +2,7 @@ package com.xinelu.manage.mapper.labelfieldcontent;
import com.xinelu.manage.domain.labelfieldcontent.LabelFieldContent; import com.xinelu.manage.domain.labelfieldcontent.LabelFieldContent;
import com.xinelu.manage.vo.labelfieldcontent.GroupingValue; import com.xinelu.manage.vo.labelfieldcontent.GroupingValue;
import com.xinelu.manage.vo.labelfieldcontent.LabelFieldAndPartitionDict;
import com.xinelu.manage.vo.labelfieldcontent.LabelFieldContentVO; import com.xinelu.manage.vo.labelfieldcontent.LabelFieldContentVO;
import com.xinelu.manage.vo.labelfieldcontent.LabelFieldInfoContentVo; import com.xinelu.manage.vo.labelfieldcontent.LabelFieldInfoContentVo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -89,6 +90,8 @@ public interface LabelFieldContentMapper {
* @param portraitStatus 状态 * @param portraitStatus 状态
* @return GroupingValue * @return GroupingValue
*/ */
List<LabelFieldAndPartitionDict> labelFieldAndPartitionDict(@Param("taskPartitionDictId") Long taskPartitionDictId, @Param("patientId") Long patientId, @Param("portraitStatus") String portraitStatus);
List<GroupingValue> groupingValue(@Param("taskPartitionDictId") Long taskPartitionDictId, @Param("patientId") Long patientId, @Param("portraitStatus") String portraitStatus); List<GroupingValue> groupingValue(@Param("taskPartitionDictId") Long taskPartitionDictId, @Param("patientId") Long patientId, @Param("portraitStatus") String portraitStatus);
/** /**

View File

@ -83,10 +83,9 @@ public interface LabelFieldInfoMapper {
/** /**
* 分组信息 * 分组信息
* *
* @param taskPartitionDictName 分组名
* @return LabelFieldInfo * @return LabelFieldInfo
*/ */
List<LabelFieldInfo> taskPartitionDictIdList(String taskPartitionDictName); List<LabelFieldInfo> taskPartitionDictIdList();
/** /**
* 查询标签 * 查询标签

View File

@ -5,6 +5,8 @@ import com.xinelu.manage.domain.labelfieldcontent.LabelFieldContent;
import com.xinelu.manage.dto.labelfieldcontent.LabelFieldContentAddDTO; import com.xinelu.manage.dto.labelfieldcontent.LabelFieldContentAddDTO;
import com.xinelu.manage.vo.labelfieldcontent.GroupingValue; import com.xinelu.manage.vo.labelfieldcontent.GroupingValue;
import com.xinelu.manage.vo.labelfieldcontent.LabelField; import com.xinelu.manage.vo.labelfieldcontent.LabelField;
import com.xinelu.manage.vo.labelfieldcontent.LabelFieldAndPartitionDict;
import java.util.List; import java.util.List;
/** /**
@ -81,7 +83,7 @@ public interface ILabelFieldContentService {
* @param patientId 患者id * @param patientId 患者id
* @return GroupingValue * @return GroupingValue
*/ */
List<List<GroupingValue>> groupingValue(Long taskPartitionDictId, Long patientId); List<LabelFieldAndPartitionDict> groupingValue(Long taskPartitionDictId, Long patientId);
/** /**
* 画像内容新增 * 画像内容新增

View File

@ -18,25 +18,23 @@ import com.xinelu.manage.mapper.labelfieldcontent.LabelFieldContentMapper;
import com.xinelu.manage.mapper.labelfieldinfo.LabelFieldInfoMapper; import com.xinelu.manage.mapper.labelfieldinfo.LabelFieldInfoMapper;
import com.xinelu.manage.mapper.patientinfo.PatientAllInfoViewMapper; import com.xinelu.manage.mapper.patientinfo.PatientAllInfoViewMapper;
import com.xinelu.manage.service.labelfieldcontent.ILabelFieldContentService; import com.xinelu.manage.service.labelfieldcontent.ILabelFieldContentService;
import com.xinelu.manage.vo.labelfieldcontent.GroupingValue; import com.xinelu.manage.vo.labelfieldcontent.*;
import com.xinelu.manage.vo.labelfieldcontent.LabelField; import org.apache.commons.collections4.CollectionUtils;
import com.xinelu.manage.vo.labelfieldcontent.LabelFieldContentVO; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Objects; import java.util.Objects;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javax.annotation.Resource;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/** /**
* 标签字段内容信息Service业务层处理 * 标签字段内容信息Service业务层处理
@ -172,7 +170,7 @@ public class LabelFieldContentServiceImpl implements ILabelFieldContentService {
labelFieldInfo.setTaskPartitionDictName("全部"); labelFieldInfo.setTaskPartitionDictName("全部");
labelFieldInfoList.add(labelFieldInfo); labelFieldInfoList.add(labelFieldInfo);
//任务细分表数据 //任务细分表数据
List<LabelFieldInfo> labelFieldInfos = labelFieldInfoMapper.taskPartitionDictIdList(null); List<LabelFieldInfo> labelFieldInfos = labelFieldInfoMapper.taskPartitionDictIdList();
if (CollectionUtils.isNotEmpty(labelFieldInfos)) { if (CollectionUtils.isNotEmpty(labelFieldInfos)) {
labelFieldInfoList.addAll(labelFieldInfos); labelFieldInfoList.addAll(labelFieldInfos);
} }
@ -191,15 +189,14 @@ public class LabelFieldContentServiceImpl implements ILabelFieldContentService {
* @return GroupingValue * @return GroupingValue
*/ */
@Override @Override
public List<List<GroupingValue>> groupingValue(Long taskPartitionDictId, Long patientId) { public List<LabelFieldAndPartitionDict> groupingValue(Long taskPartitionDictId, Long patientId) {
if (ObjectUtils.isEmpty(patientId)) { if (ObjectUtils.isEmpty(patientId)) {
throw new ServiceException("请选择患者!"); throw new ServiceException("请选择患者!");
} }
//根据patientId查询是否有已经维护的参数 //根据patientId查询是否有已经维护的参数
List<GroupingValue> labelFieldContents = labelFieldContentMapper.groupingValue(taskPartitionDictId, patientId, null); List<LabelFieldAndPartitionDict> labelFieldContents = labelFieldContentMapper.labelFieldAndPartitionDict(taskPartitionDictId, patientId, null);
if (CollectionUtils.isNotEmpty(labelFieldContents)) { if (CollectionUtils.isNotEmpty(labelFieldContents)) {
Map<String, List<GroupingValue>> collect = labelFieldContents.stream().collect(Collectors.groupingBy(GroupingValue::getPortraitSn)); return labelFieldContents;
return new ArrayList<>(collect.values());
} }
//查询未维护标签及从患者表取值 //查询未维护标签及从患者表取值
List<GroupingValue> labelFieldContentList = labelFieldInfoMapper.selectLabelFieldInfoByTaskPartitionDictId(taskPartitionDictId); List<GroupingValue> labelFieldContentList = labelFieldInfoMapper.selectLabelFieldInfoByTaskPartitionDictId(taskPartitionDictId);
@ -214,15 +211,21 @@ public class LabelFieldContentServiceImpl implements ILabelFieldContentService {
for (int i = 0; i < declaredFields.length; i++) { for (int i = 0; i < declaredFields.length; i++) {
strings[i] = declaredFields[i].getName().toUpperCase(); strings[i] = declaredFields[i].getName().toUpperCase();
} }
List<String> strings1 = Arrays.asList(strings); List<PortraitSnVO> PortraitSnVOS = new ArrayList<>();
List<String> asListStrings = Arrays.asList(strings);
for (GroupingValue groupingValue : labelFieldContentList) { for (GroupingValue groupingValue : labelFieldContentList) {
PortraitSnVO portraitSnVO = new PortraitSnVO();
groupingValue.setPatientId(patientId); groupingValue.setPatientId(patientId);
String s = strings1.stream().filter(Objects::nonNull).filter(item -> item.equals(groupingValue.getFieldCode())).findFirst().orElse(new String()); String s = asListStrings.stream().filter(Objects::nonNull).filter(item -> item.equals(groupingValue.getFieldCode())).findFirst().orElse(new String());
groupingValue.setFieldValue(paramsValue.getOrDefault(s, "").toString()); groupingValue.setFieldValue(paramsValue.getOrDefault(s, "").toString());
portraitSnVO.setPortraitSn(groupingValue.getPortraitSn());
PortraitSnVOS.add(portraitSnVO);
} }
List<List<GroupingValue>> lists = new ArrayList<>(); List<LabelFieldAndPartitionDict> labelFieldAndPartitionDictList = new ArrayList<>();
lists.add(labelFieldContentList); LabelFieldAndPartitionDict labelFieldAndPartitionDict = new LabelFieldAndPartitionDict();
return lists; labelFieldAndPartitionDict.setPortraitSnVOList(PortraitSnVOS);
labelFieldAndPartitionDictList.add(labelFieldAndPartitionDict);
return labelFieldAndPartitionDictList;
} }
/** /**
@ -234,22 +237,27 @@ public class LabelFieldContentServiceImpl implements ILabelFieldContentService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public AjaxResult insertLabelField(LabelField labelField) { public AjaxResult insertLabelField(LabelField labelField) {
if (CollectionUtils.isEmpty(labelField.getGroupingValues())) { if (CollectionUtils.isEmpty(labelField.getLabelFieldAndPartitionDictList())) {
return AjaxResult.success(); return AjaxResult.success();
} }
List<GroupingValue> groupingValues = new ArrayList<>(); List<PortraitSnVO> PortraitSnVOS = new ArrayList<>();
try { try {
for (List<GroupingValue> groupingValue : labelField.getGroupingValues()) { for (LabelFieldAndPartitionDict labelFieldAndPartitionDict : labelField.getLabelFieldAndPartitionDictList()) {
if (StringUtils.isBlank(groupingValue.get(0).getPortraitSn())) { if (StringUtils.isBlank(labelFieldAndPartitionDict.getPortraitSnVOList().get(0).getPortraitSn())) {
String portraitSn = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS")); String portraitSn = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS"));
groupingValue.forEach(item -> item.setPortraitSn(portraitSn)); labelFieldAndPartitionDict.getPortraitSnVOList().forEach(item -> item.setPortraitSn(portraitSn));
} }
groupingValues.addAll(groupingValue); PortraitSnVOS.addAll(labelFieldAndPartitionDict.getPortraitSnVOList());
TimeUnit.MILLISECONDS.sleep(10); TimeUnit.MILLISECONDS.sleep(10);
} }
} catch (InterruptedException e) { } catch (InterruptedException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
List<GroupingValue> groupingValues = new ArrayList<>();
for (PortraitSnVO portraitSnVO : PortraitSnVOS) {
portraitSnVO.getGroupingValues().forEach(item -> item.setPortraitSn(portraitSnVO.getPortraitSn()));
groupingValues.addAll(portraitSnVO.getGroupingValues());
}
List<GroupingValue> updateGroupingValues = new ArrayList<>(); List<GroupingValue> updateGroupingValues = new ArrayList<>();
List<GroupingValue> insertGroupingValues = new ArrayList<>(); List<GroupingValue> insertGroupingValues = new ArrayList<>();
//传入标签ids //传入标签ids
@ -288,7 +296,8 @@ public class LabelFieldContentServiceImpl implements ILabelFieldContentService {
return AjaxResult.success(); return AjaxResult.success();
} }
@Override public List<List<GroupingValue>> getPortaitByPatient(Long patientId) { @Override
public List<List<GroupingValue>> getPortaitByPatient(Long patientId) {
//List<Map<String, List<List<GroupingValue>>>> retMap = new ArrayList<>(); //List<Map<String, List<List<GroupingValue>>>> retMap = new ArrayList<>();
List<List<GroupingValue>> retList = new ArrayList<>(); List<List<GroupingValue>> retList = new ArrayList<>();
List<GroupingValue> labelFieldContents = labelFieldContentMapper.groupingValue(0L, patientId, null); List<GroupingValue> labelFieldContents = labelFieldContentMapper.groupingValue(0L, patientId, null);

View File

@ -78,4 +78,6 @@ public class GroupingValue extends LabelFieldInfo {
*/ */
@ApiModelProperty(value = "内容备注信息") @ApiModelProperty(value = "内容备注信息")
private String contentRemark; private String contentRemark;
private Integer sign;
} }

View File

@ -8,4 +8,6 @@ import java.util.List;
public class LabelField { public class LabelField {
private List<List<GroupingValue>> groupingValues; private List<List<GroupingValue>> groupingValues;
private List<LabelFieldAndPartitionDict> labelFieldAndPartitionDictList;
} }

View File

@ -0,0 +1,18 @@
package com.xinelu.manage.vo.labelfieldcontent;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class LabelFieldAndPartitionDict {
@ApiModelProperty(value = "任务细分id当做分组使用")
private Long taskPartitionDictId;
@ApiModelProperty(value = "任务细分名称(冗余)")
private String taskPartitionDictName;
private List<PortraitSnVO> portraitSnVOList;
}

View File

@ -0,0 +1,13 @@
package com.xinelu.manage.vo.labelfieldcontent;
import lombok.Data;
import java.util.List;
@Data
public class PortraitSnVO {
private String portraitSn;
private List<GroupingValue> groupingValues;
}

View File

@ -21,6 +21,42 @@
<result property="updateTime" column="update_time"/> <result property="updateTime" column="update_time"/>
</resultMap> </resultMap>
<resultMap type="com.xinelu.manage.vo.labelfieldcontent.LabelFieldAndPartitionDict" id="LabelFieldAndPartitionDictResult">
<result property="taskPartitionDictId" column="task_partition_dict_id"/>
<result property="taskPartitionDictName" column="task_partition_dict_name"/>
<collection property="portraitSnVOList" javaType="java.util.List"
resultMap="portraitSnVOResult"/>
</resultMap>
<resultMap type="com.xinelu.manage.vo.labelfieldcontent.PortraitSnVO" id="portraitSnVOResult">
<result property="portraitSn" column="portrait_sn"/>
<collection property="groupingValues" javaType="java.util.List"
resultMap="GroupingValueResult"/>
</resultMap>
<resultMap type="com.xinelu.manage.vo.labelfieldcontent.GroupingValue" id="GroupingValueResult">
<result property="labelFieldInfoId" column="labelFieldInfoId"/>
<result property="fieldName" column="field_name"/>
<result property="fieldCode" column="field_code"/>
<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="labelFieldContentId" column="labelFieldContentId"/>
<result property="fieldId" column="field_id"/>
<result property="fieldName" column="field_name"/>
<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"/>
</resultMap>
<sql id="selectLabelFieldContentVo"> <sql id="selectLabelFieldContentVo">
select id, select id,
field_id, field_id,
@ -284,6 +320,46 @@
where content.patient_id = #{patientId} and content.portrait_status='INUSE' where content.patient_id = #{patientId} and content.portrait_status='INUSE'
</select> </select>
<select id="labelFieldAndPartitionDict" resultType="com.xinelu.manage.vo.labelfieldcontent.LabelFieldAndPartitionDict" resultMap="LabelFieldAndPartitionDictResult">
select
lfi.id labelFieldInfoId,
lfi.field_name,
lfi.field_code,
lfi.field_type,
lfi.field_sort,
lfi.field_remark,
lfi.task_partition_dict_id,
lfi.task_partition_dict_name,
lfi.task_type_id,
lfi.task_type_name,
lfc.id labelFieldContentId,
lfc.field_id,
lfc.patient_id,
lfc.field_name,
lfc.field_code,
lfc.field_value,
lfc.portrait_sn,
lfc.portrait_status,
lfc.content_sort
from label_field_info lfi
LEFT JOIN label_field_content lfc ON lfi.id =lfc.field_id
LEFT JOIN task_partition_dict tpd on tpd.id = lfi.task_partition_dict_id
where 1=1
<if test="taskPartitionDictId != null and taskPartitionDictId != 0">
and lfi.task_partition_dict_id = #{taskPartitionDictId}
</if>
<if test="taskPartitionDictId == null">
and lfi.task_partition_dict_id is null
</if>
<if test="patientId != null">
and lfc.patient_id = #{patientId}
</if>
<if test="portraitStatus != null">
and lfc.portrait_status = #{portraitStatus}
</if>
Order by tpd.task_partition_sort,lfc.portrait_sn
</select>
<insert id="insertLabelFieldContentList"> <insert id="insertLabelFieldContentList">
insert into label_field_content( insert into label_field_content(
field_id, field_id,

View File

@ -221,15 +221,13 @@
</delete> </delete>
<select id="taskPartitionDictIdList" resultType="com.xinelu.manage.domain.labelfieldinfo.LabelFieldInfo"> <select id="taskPartitionDictIdList" resultType="com.xinelu.manage.domain.labelfieldinfo.LabelFieldInfo">
select select tpd.id taskPartitionDictId,
id taskPartitionDictId, tpd.task_partition_name taskPartitionDictName,
task_partition_name taskPartitionDictName ttd.id taskTypeId,
from task_partition_dict ttd.task_type_name taskTypeName
<where> from task_partition_dict tpd
<if test="taskPartitionDictName != null and taskPartitionDictName != ''"> LEFT JOIN task_type_dict ttd on tpd.task_type_id = ttd.id
task_partition_dict_name like concat('%', #{taskPartitionDictName}, '%') ORDER BY ttd.task_type_sort, tpd.task_partition_sort
</if>
</where>
</select> </select>
<select id="selectLabelFieldInfoByTaskPartitionDictId" <select id="selectLabelFieldInfoByTaskPartitionDictId"