diff --git a/postdischarge-admin/src/main/resources/application-dev.yml b/postdischarge-admin/src/main/resources/application-dev.yml index fdee91ed..109a9b6b 100644 --- a/postdischarge-admin/src/main/resources/application-dev.yml +++ b/postdischarge-admin/src/main/resources/application-dev.yml @@ -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!@#$ # 从库数据源 diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/labelfieldcontent/LabelFieldContentController.java b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/labelfieldcontent/LabelFieldContentController.java index 8cc66db2..d96aa9e4 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/labelfieldcontent/LabelFieldContentController.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/labelfieldcontent/LabelFieldContentController.java @@ -108,6 +108,9 @@ public class LabelFieldContentController extends BaseController { return labelFieldContentService.groupingValue(taskPartitionDictId, patientId); } + /** + * 画像内容新增 + */ @PostMapping("/insertLabelField") public AjaxResult insertLabelField(@RequestBody LabelField labelField) { return labelFieldContentService.insertLabelField(labelField); diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientinfo/PatientAllInfoViewUppercase.java b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientinfo/PatientAllInfoViewUppercase.java new file mode 100644 index 00000000..0056052b --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientinfo/PatientAllInfoViewUppercase.java @@ -0,0 +1,283 @@ +package com.xinelu.manage.domain.patientinfo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.LocalDateTime; + +/** + * 患者全部信息视图对象 patient_all_info_view + * + * @author xinelu + * @date 2024-06-11 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@ApiModel(value = "患者全部信息视图对象", description = "patient_all_info_view") +public class PatientAllInfoViewUppercase { + + private static final long serialVersionUID = 1L; + + /** + * 患者主键 + */ + @ApiModelProperty(value = "患者主键") + private Long PATIENTID; + + /** + * 患者姓名 + */ + @ApiModelProperty(value = "患者姓名") + private String PATIENTNAME; + + /** + * 患者电话 + */ + @ApiModelProperty(value = "患者电话") + private String PATIENTPHONE; + + /** + * 家属电话 + */ + @ApiModelProperty(value = "家属电话") + private String FAMILYMEMBERPHONE; + + /** + * 出生日期,格式:yyyy-MM-dd + */ + @ApiModelProperty(value = "出生日期,格式:yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd") + private LocalDate BIRTHDATE; + + /** + * 身份证号 + */ + @ApiModelProperty(value = "身份证号") + private String CARDNO; + + /** + * 性别,男:MALE,女:FEMALE + */ + @ApiModelProperty(value = "性别,男:MALE,女:FEMALE") + private String SEX; + + /** + * 住址 + */ + @ApiModelProperty(value = "住址") + private String ADDRESS; + + /** + * 患者类型,预住院患者:PRE_HOSPITALIZED_PATIENT,在院患者:IN_HOSPITAL_PATIENT,门诊患者:OUTPATIENT,出院患者:DISCHARGED_PATIENT,签约患者:CONTRACTED_PATIENT + */ + @ApiModelProperty(value = "患者类型,预住院患者:PRE_HOSPITALIZED_PATIENT,在院患者:IN_HOSPITAL_PATIENT,门诊患者:OUTPATIENT,出院患者:DISCHARGED_PATIENT,签约患者:CONTRACTED_PATIENT") + private String PATIENTTYPE; + + /** + * 就诊记录id + */ + @ApiModelProperty(value = "就诊记录id") + private Long PATIENTVISITRECORDID; + + /** + * 就诊类型,门诊:OUTPATIENT_SERVICE,住院:BE_HOSPITALIZED + */ + @ApiModelProperty(value = "就诊类型,门诊:OUTPATIENT_SERVICE,住院:BE_HOSPITALIZED") + private String VISITMETHOD; + + /** + * 就诊时间,格式:yyyy-MM-dd HH:mm:ss + */ + @ApiModelProperty(value = "就诊时间,格式:yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + private LocalDateTime VISITDATE; + + /** + * 所属医院名称 + */ + @ApiModelProperty(value = "所属医院名称") + private String HOSPITALAGENCYNAME; + + /** + * 所属院区名称 + */ + @ApiModelProperty(value = "所属院区名称") + private String CAMPUSAGENCYNAME; + + /** + * 所属科室名称 + */ + @ApiModelProperty(value = "所属科室名称") + private String DEPARTMENTNAME; + + /** + * 所属病区名称 + */ + @ApiModelProperty(value = "所属病区名称") + private String WARDNAME; + + /** + * 主治医生姓名 + */ + @ApiModelProperty(value = "主治医生姓名") + private String ATTENDINGPHYSICIANNAME; + + /** + * 主要诊断 + */ + @ApiModelProperty(value = "主要诊断") + private String MAINDIAGNOSIS; + + /** + * 入院时间 + */ + @ApiModelProperty(value = "入院时间") + private LocalDateTime ADMISSIONTIME; + + /** + * 出院时间 + */ + @ApiModelProperty(value = "出院时间") + private LocalDateTime DISCHARGETIME; + + /** + * 住院天数(出院记录),单位为:天 + */ + @ApiModelProperty(value = "住院天数") + private Integer HOSPITALIZATIONDAYS; + + /** + * 入院病历信息,存储患者入院的整个病历信息 + */ + @ApiModelProperty(value = "入院病历信息,存储患者入院的整个病历信息") + private String INHOSPITALINFO; + + /** + * 出院病历信息,存储患者出院的整个病历信息 + */ + @ApiModelProperty(value = "出院病历信息,存储患者出院的整个病历信息") + private String OUTHOSPITALINFO; + + /** + * 就诊流水号 + */ + @ApiModelProperty(value = "就诊流水号") + private String VISITSERIALNUMBER; + + /** + * 门诊/住院号 + */ + @ApiModelProperty(value = "门诊/住院号") + private String INHOSPITALNUMBER; + + /** + * 责任护士 + */ + @ApiModelProperty(value = "责任护士") + private String RESPONSIBLENURSE; + + /** + * 手术名称 + */ + @ApiModelProperty(value = "手术名称") + private String SURGICALNAME; + + /** + * 手术记录 + */ + @ApiModelProperty(value = "手术记录") + private String SURGICALRECORD; + + /** + * 签约记录表id + */ + @ApiModelProperty(value = "签约记录表id") + private Long SIGNPATIENTRECORDID; + + /** + * 缴费状态,已缴费:PAID,未交费:UNPAID_FEES + */ + @ApiModelProperty(value = "缴费状态,已缴费:PAID,未交费:UNPAID_FEES") + private String PAYMENTSTATUS; + + /** + * 所属健康管理师名称(用户表名称) + */ + @ApiModelProperty(value = "所属健康管理师名称") + private String HEALTHMANAGENAME; + + /** + * 服务状态,意向签约:INTENTIONAL_SIGNING,服务中:SERVICE_CENTER,服务结束:SERVICE_END + */ + @ApiModelProperty(value = "服务状态,意向签约:INTENTIONAL_SIGNING,服务中:SERVICE_CENTER,服务结束:SERVICE_END") + private String SERVICESTATUS; + + /** + * 签约状态,在签:IN_SIGN,忽略:IGNORE_SIGN,解约:SEPARATE_SIGN,续约:CONTINUOUS_SIGN + */ + @ApiModelProperty(value = "签约状态,在签:IN_SIGN,忽略:IGNORE_SIGN,解约:SEPARATE_SIGN,续约:CONTINUOUS_SIGN") + private String SIGNSTATUS; + + /** + * 开单医生姓名(意向签约) + */ + @ApiModelProperty(value = "开单医生姓名") + private String BILLINGDOCTORNAME; + + /** + * 签约时间,格式:yyyy-MM-dd HH:mm:ss + */ + @ApiModelProperty(value = "签约时间,格式:yyyy-MM-dd HH:mm:ss") + private LocalDateTime SIGNTIME; + + /** + * 服务包名称 + */ + @ApiModelProperty(value = "服务包名称") + private String PACKAGENAME; + + /** + * 服务包缴费状态,已缴费:PAID,未交费:UNPAID_FEES + */ + @ApiModelProperty(value = "服务包缴费状态,已缴费:PAID,未交费:UNPAID_FEES") + private String PACKAGEPAYMENTSTATUS; + + /** + * 服务包价格,小数点后两位 + */ + @ApiModelProperty(value = "服务包价格,小数点后两位") + private BigDecimal PACKAGEPRICE; + + /** + * 服务开始时间,格式:yyyy-MM-dd HH:mm:ss + */ + @ApiModelProperty(value = "服务开始时间,格式:yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd") + private LocalDateTime SERVICESTARTTIME; + + /** + * 服务结束时间,格式:yyyy-MM-dd HH:mm:ss + */ + @ApiModelProperty(value = "服务结束时间,格式:yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd") + private LocalDateTime SERVICEENDTIME; + + /** + * 服务包期限 + */ + @ApiModelProperty(value = "服务包期限") + private Integer PACKAGETERM; + + /** + * 服务包期限单位,年,月,日 + */ + @ApiModelProperty(value = "服务包期限单位,年,月,日") + private String PACKAGETERMUNIT; +} \ No newline at end of file diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/labelfieldcontent/LabelFieldContentMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/labelfieldcontent/LabelFieldContentMapper.java index 30dc8866..0c56784f 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/labelfieldcontent/LabelFieldContentMapper.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/labelfieldcontent/LabelFieldContentMapper.java @@ -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 selectLabelFieldContent(@Param("labelFieldIds") List labelFieldIds); /** - * 画像查询 + * 画像内容查询 * * @param taskPartitionDictId 细分id * @param patientId 患者id @@ -96,4 +97,20 @@ public interface LabelFieldContentMapper { * @return 患者标签字段列表 */ List selectByPatientId(Long patientId); + + /** + * 批量新增 + * + * @param labelFieldContentList 标签内容 + * @return int + */ + int insertLabelFieldContentList(List labelFieldContentList); + + /** + * 批量修改 (dev.yml url &allowMultiQueries=true) + * + * @param labelFieldContentList 标签内容 + * @return int + */ + int updateContentRemarkLabelFieldContentList(List labelFieldContentList); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/labelfieldinfo/LabelFieldInfoMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/labelfieldinfo/LabelFieldInfoMapper.java index 697df589..7084d540 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/labelfieldinfo/LabelFieldInfoMapper.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/labelfieldinfo/LabelFieldInfoMapper.java @@ -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 taskPartitionDictIdList(String taskPartitionDictName); + + /** + * 查询标签 + * + * @param taskPartitionDictId 标签 + * @return GroupingValue + */ + List selectLabelFieldInfoByTaskPartitionDictId(Long taskPartitionDictId); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/patientinfo/PatientAllInfoViewMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/patientinfo/PatientAllInfoViewMapper.java index 77fb24bb..f6402f90 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/patientinfo/PatientAllInfoViewMapper.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/patientinfo/PatientAllInfoViewMapper.java @@ -1,6 +1,8 @@ package com.xinelu.manage.mapper.patientinfo; import com.xinelu.manage.domain.patientinfo.PatientAllInfoView; +import com.xinelu.manage.domain.patientinfo.PatientAllInfoViewUppercase; + import java.util.List; @@ -33,5 +35,5 @@ public interface PatientAllInfoViewMapper { * @param patientId 患者主键 * @return 患者全部信息视图对象 */ - List selectPatientAllInfoListViewByPatientId(Long patientId); + List selectPatientAllInfoListViewByPatientId(Long patientId); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldcontent/ILabelFieldContentService.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldcontent/ILabelFieldContentService.java index ee5962e7..5babb5d8 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldcontent/ILabelFieldContentService.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldcontent/ILabelFieldContentService.java @@ -84,5 +84,11 @@ public interface ILabelFieldContentService { */ List> groupingValue(Long taskPartitionDictId, Long patientId); + /** + * 画像内容新增 + * + * @param labelField 画像信息 + * @return AjaxResult + */ AjaxResult insertLabelField(LabelField labelField); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldcontent/impl/LabelFieldContentServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldcontent/impl/LabelFieldContentServiceImpl.java index b0d83c4c..b4020a41 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldcontent/impl/LabelFieldContentServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldcontent/impl/LabelFieldContentServiceImpl.java @@ -10,30 +10,28 @@ import com.xinelu.common.utils.bean.BeanUtils; import com.xinelu.manage.domain.labelfieldcontent.LabelFieldContent; import com.xinelu.manage.domain.labelfieldinfo.LabelFieldInfo; import com.xinelu.manage.domain.patientinfo.PatientAllInfoView; +import com.xinelu.manage.domain.patientinfo.PatientAllInfoViewUppercase; import com.xinelu.manage.dto.labelfieldcontent.LabelFieldContentAddDTO; import com.xinelu.manage.dto.labelfieldcontent.LabelFieldContentDTO; import com.xinelu.manage.mapper.labelfieldcontent.LabelFieldContentMapper; import com.xinelu.manage.mapper.labelfieldinfo.LabelFieldInfoMapper; import com.xinelu.manage.mapper.patientinfo.PatientAllInfoViewMapper; -import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper; -import com.xinelu.manage.mapper.signpatientmanageroute.SignPatientManageRouteMapper; -import com.xinelu.manage.mapper.signpatientmanageroutenode.SignPatientManageRouteNodeMapper; -import com.xinelu.manage.mapper.specialdiseasenode.SpecialDiseaseNodeMapper; -import com.xinelu.manage.mapper.taskpartitiondict.TaskPartitionDictMapper; import com.xinelu.manage.service.labelfieldcontent.ILabelFieldContentService; import com.xinelu.manage.vo.labelfieldcontent.GroupingValue; import com.xinelu.manage.vo.labelfieldcontent.LabelField; +import com.xinelu.manage.vo.labelfieldcontent.LabelFieldContentVO; 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; import javax.annotation.Resource; +import java.lang.reflect.Field; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; +import java.util.*; +import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; /** @@ -199,35 +197,88 @@ public class LabelFieldContentServiceImpl implements ILabelFieldContentService { return new ArrayList<>(collect.values()); } //查询未维护标签及从患者表取值 - List labelFieldContentList = labelFieldContentMapper.groupingValue(taskPartitionDictId, null, null); + List labelFieldContentList = labelFieldInfoMapper.selectLabelFieldInfoByTaskPartitionDictId(taskPartitionDictId); JSONObject paramsValue = getParamsValue(patientId); if (CollectionUtils.isEmpty(labelFieldContentList)) { return new ArrayList<>(); } + //取属性名 + PatientAllInfoView patientAllInfoView = new PatientAllInfoView(); + Field[] declaredFields = patientAllInfoView.getClass().getDeclaredFields(); + String[] strings = new String[declaredFields.length]; + for (int i = 0; i < declaredFields.length; i++) { + strings[i] = declaredFields[i].getName().toUpperCase(); + } + List strings1 = Arrays.asList(strings); for (GroupingValue groupingValue : labelFieldContentList) { - //获取不同的文件路径 - switch (groupingValue.getFieldName()) { - case "姓名": - String s = paramsValue.getOrDefault("patientName", "").toString(); - groupingValue.setFieldValue(paramsValue.getOrDefault("patientName", "").toString()); - break; - case "患者电话": - groupingValue.setFieldValue(paramsValue.getOrDefault("patientPhone", "").toString()); - break; - case "性别": - groupingValue.setFieldValue(paramsValue.getOrDefault("sex", "").toString()); - break; - case "医院": - groupingValue.setFieldValue(paramsValue.getOrDefault("hospitalAgencyName", "").toString()); - break; - default: - break; - } + 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()); } List> lists = new ArrayList<>(); lists.add(labelFieldContentList); return lists; + } + /** + * 画像内容新增 + * + * @param labelField 画像信息 + * @return AjaxResult + */ + @Transactional(rollbackFor = Exception.class) + @Override + public AjaxResult insertLabelField(LabelField labelField) { + if (CollectionUtils.isEmpty(labelField.getGroupingValues())) { + return AjaxResult.success(); + } + List groupingValues = new ArrayList<>(); + try { + for (List groupingValue : labelField.getGroupingValues()) { + if (StringUtils.isBlank(groupingValue.get(0).getPortraitSn())) { + String portraitSn = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS")); + groupingValue.forEach(item -> item.setPortraitSn(portraitSn)); + } + groupingValues.addAll(groupingValue); + TimeUnit.MILLISECONDS.sleep(10); + } + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + List updateGroupingValues = new ArrayList<>(); + List insertGroupingValues = new ArrayList<>(); + //传入标签ids + List afferentLabelFieldInfoIds = groupingValues.stream().filter(Objects::nonNull).map(GroupingValue::getLabelFieldInfoId).filter(Objects::nonNull).collect(Collectors.toList()); + //传入标签内容ids + List afferentLabelFieldContentIds = groupingValues.stream().filter(Objects::nonNull).map(GroupingValue::getLabelFieldContentId).filter(Objects::nonNull).collect(Collectors.toList()); + //数据库标签内容ids + List databaseLabelFieldContents = labelFieldContentMapper.selectLabelFieldContent(afferentLabelFieldInfoIds); + List databaseLabelFieldContentIds = databaseLabelFieldContents.stream().filter(Objects::nonNull).map(LabelFieldContentVO::getLabelFieldContentId).filter(Objects::nonNull).collect(Collectors.toList()); + //做差集 + List subtractLabelFieldContentIds = (List) CollectionUtils.subtract(databaseLabelFieldContentIds, afferentLabelFieldContentIds); + if (CollectionUtils.isNotEmpty(subtractLabelFieldContentIds)) { + labelFieldContentMapper.deleteLabelFieldContentByIds(subtractLabelFieldContentIds.toArray(new Long[0])); + } + for (GroupingValue groupingValue : groupingValues) { + groupingValue.setFieldId(groupingValue.getLabelFieldInfoId()); + if (Objects.isNull(groupingValue.getLabelFieldContentId())) { + groupingValue.setCreateBy(SecurityUtils.getUsername()); + groupingValue.setCreateTime(LocalDateTime.now()); + insertGroupingValues.add(groupingValue); + } + if (Objects.nonNull(groupingValue.getLabelFieldContentId())) { + groupingValue.setCreateTime(LocalDateTime.now()); + groupingValue.setCreateBy(SecurityUtils.getUsername()); + updateGroupingValues.add(groupingValue); + } + } + if (CollectionUtils.isNotEmpty(insertGroupingValues)) { + int insert = labelFieldContentMapper.insertLabelFieldContentList(insertGroupingValues); + } + if (CollectionUtils.isNotEmpty(updateGroupingValues)) { + int update = labelFieldContentMapper.updateContentRemarkLabelFieldContentList(updateGroupingValues); + } + return AjaxResult.success(); } /** @@ -238,19 +289,14 @@ public class LabelFieldContentServiceImpl implements ILabelFieldContentService { */ private JSONObject getParamsValue(Long patientId) { JSONObject retObj; - List patientAllInfoViews = patientAllInfoViewMapper.selectPatientAllInfoListViewByPatientId(patientId); + List patientAllInfoViews = patientAllInfoViewMapper.selectPatientAllInfoListViewByPatientId(patientId); if (CollectionUtils.isEmpty(patientAllInfoViews) || ObjectUtils.isEmpty(patientAllInfoViews.get(0))) { throw new ServiceException("患者信息获取错误,请联系管理员!"); } - PatientAllInfoView patientAllInfoView = patientAllInfoViews.get(0); + 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())); + retObj.fluentPut("SEX", PatientSexEnum.getInfoByCode(patientAllInfoView.getSEX()).getInfo()).fluentPut("AGE", BaseUtil.getAge(patientAllInfoView.getBIRTHDATE())); return retObj; } - - @Override - public AjaxResult insertLabelField(LabelField labelField) { - return null; - } } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldinfo/impl/LabelFieldInfoServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldinfo/impl/LabelFieldInfoServiceImpl.java index 4ac4dca5..de44da28 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldinfo/impl/LabelFieldInfoServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/labelfieldinfo/impl/LabelFieldInfoServiceImpl.java @@ -1,10 +1,8 @@ package com.xinelu.manage.service.labelfieldinfo.impl; -import com.xinelu.common.constant.Constants; import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.exception.ServiceException; import com.xinelu.common.utils.SecurityUtils; -import com.xinelu.common.utils.codes.GenerateSystemCodeUtil; import com.xinelu.manage.domain.labelfieldinfo.LabelFieldInfo; import com.xinelu.manage.dto.labelfieldinfo.LabelFieldInfoAddDTO; import com.xinelu.manage.mapper.labelfieldcontent.LabelFieldContentMapper; @@ -20,7 +18,6 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.time.LocalDateTime; import java.util.List; -import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; @@ -35,9 +32,6 @@ public class LabelFieldInfoServiceImpl implements ILabelFieldInfoService { @Resource private LabelFieldInfoMapper labelFieldInfoMapper; - @Resource - private GenerateSystemCodeUtil systemCodeUtil; - @Resource private LabelFieldContentMapper labelFieldContentMapper; @@ -110,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()); @@ -155,7 +145,6 @@ public class LabelFieldInfoServiceImpl implements ILabelFieldInfoService { } // 如果不存在,执行新增操作 for (LabelFieldInfo labelFieldInfo : fieldInfoList) { - labelFieldInfo.setFieldCode(Constants.FIELD_ENCODING + systemCodeUtil.generateDepartCode(Constants.FIELD_ENCODING)); labelFieldInfo.setCreateBy(SecurityUtils.getUsername()); labelFieldInfo.setCreateTime(LocalDateTime.now()); if (labelFieldInfoMapper.insertLabelFieldInfo(labelFieldInfo) <= 0) { diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/labelfieldcontent/LabelField.java b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/labelfieldcontent/LabelField.java index 7b0dda15..5317f84c 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/labelfieldcontent/LabelField.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/labelfieldcontent/LabelField.java @@ -7,5 +7,5 @@ import java.util.List; @Data public class LabelField { - private List groupingValues; + private List> groupingValues; } diff --git a/postdischarge-manage/src/main/resources/mapper/manage/labelfieldcontent/LabelFieldContentMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/labelfieldcontent/LabelFieldContentMapper.xml index 144e851d..a71610b8 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/labelfieldcontent/LabelFieldContentMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/labelfieldcontent/LabelFieldContentMapper.xml @@ -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, @@ -279,4 +280,72 @@ from label_field_content content left join label_field_info info on content.field_id = info.id where content.patient_id = #{patientId} and content.portrait_status='INUSE' + + + insert into label_field_content( + field_id, + field_name, + field_code, + field_value, + portrait_sn, + patient_id, + portrait_status, + content_sort, + content_remark, + create_by, + create_time + ) + values + + ( + #{GroupingValue.fieldId}, + #{GroupingValue.fieldName}, + #{GroupingValue.fieldCode}, + #{GroupingValue.fieldValue}, + #{GroupingValue.portraitSn}, + #{GroupingValue.patientId}, + #{GroupingValue.portraitStatus}, + #{GroupingValue.contentSort}, + #{GroupingValue.contentRemark}, + #{GroupingValue.createBy}, + #{GroupingValue.createTime} + ) + + + + + + update label_field_content + + field_id = + #{labelFieldContentList.fieldId}, + + field_name = + #{labelFieldContentList.fieldName}, + + field_code = + #{labelFieldContentList.fieldCode}, + + field_value = + #{labelFieldContentList.fieldValue}, + + portrait_sn = + #{labelFieldContentList.portraitSn}, + + patient_id = + #{labelFieldContentList.patientId}, + + portrait_status = + #{labelFieldContentList.portraitStatus}, + + update_by = + #{labelFieldContentList.updateBy}, + + update_time = + #{labelFieldContentList.updateTime}, + + + where id = #{labelFieldContentList.labelFieldContentId} + + \ No newline at end of file diff --git a/postdischarge-manage/src/main/resources/mapper/manage/labelfieldinfo/LabelFieldInfoMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/labelfieldinfo/LabelFieldInfoMapper.xml index d21e337a..5aa431be 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/labelfieldinfo/LabelFieldInfoMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/labelfieldinfo/LabelFieldInfoMapper.xml @@ -225,4 +225,27 @@ + + \ No newline at end of file diff --git a/postdischarge-manage/src/main/resources/mapper/manage/patientinfo/PatientAllInfoViewMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/patientinfo/PatientAllInfoViewMapper.xml index dc9fee36..f95ac747 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/patientinfo/PatientAllInfoViewMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/patientinfo/PatientAllInfoViewMapper.xml @@ -74,49 +74,49 @@