From 74e6e4ba746a091e9672a51694483a3122bb6a51 Mon Sep 17 00:00:00 2001 From: zhangheng <3226558941@qq.com> Date: Tue, 25 Jun 2024 17:54:06 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=A0=87=E7=AD=BE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../labelfieldcontent/impl/LabelFieldContentServiceImpl.java | 1 + 1 file changed, 1 insertion(+) 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..aac52fa8 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 @@ -205,6 +205,7 @@ public class LabelFieldContentServiceImpl implements ILabelFieldContentService { return new ArrayList<>(); } for (GroupingValue groupingValue : labelFieldContentList) { + groupingValue.setPatientId(patientId); //获取不同的文件路径 switch (groupingValue.getFieldName()) { case "姓名": From e353564d0ff47168547ab4af5d1a60c4d674ba83 Mon Sep 17 00:00:00 2001 From: zhangheng <3226558941@qq.com> Date: Wed, 26 Jun 2024 09:55:53 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E6=A0=87=E7=AD=BE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../labelfieldinfo/impl/LabelFieldInfoServiceImpl.java | 7 ------- 1 file changed, 7 deletions(-) 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..08340746 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; @@ -155,7 +149,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) { From b33491a04bf0076c2f495a8f9ee496c5c9b2a936 Mon Sep 17 00:00:00 2001 From: zhangheng <3226558941@qq.com> Date: Wed, 26 Jun 2024 11:34:32 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E6=A0=87=E7=AD=BE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LabelFieldContentMapper.java | 16 +++++ .../impl/LabelFieldContentServiceImpl.java | 42 +++++++++-- .../vo/labelfieldcontent/LabelField.java | 2 +- .../LabelFieldContentMapper.xml | 72 +++++++++++++++++++ 4 files changed, 125 insertions(+), 7 deletions(-) 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..f695a741 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 @@ -96,4 +96,20 @@ public interface LabelFieldContentMapper { * @return 患者标签字段列表 */ List selectByPatientId(Long patientId); + + /** + * 批量新增 + * + * @param labelFieldContentList 标签内容 + * @return int + */ + int insertLabelFieldContentList(List labelFieldContentList); + + /** + * 批量修改 + * + * @param labelFieldContentList + * @return + */ + int updateContentRemarkLabelFieldContentList(List labelFieldContentList); } 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 aac52fa8..0eab350b 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 @@ -15,14 +15,10 @@ 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.springframework.stereotype.Service; @@ -34,6 +30,7 @@ import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.stream.Collectors; /** @@ -250,8 +247,41 @@ public class LabelFieldContentServiceImpl implements ILabelFieldContentService { return retObj; } + @Transactional(rollbackFor = Exception.class) @Override public AjaxResult insertLabelField(LabelField labelField) { - return null; + if (CollectionUtils.isEmpty(labelField.getGroupingValues())) { + return AjaxResult.success(); + } + List groupingValues = new ArrayList<>(); + for (List groupingValue : labelField.getGroupingValues()) { + groupingValues.addAll(groupingValue); + } + 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) { + if (Objects.isNull(groupingValue.getLabelFieldContentId())) { + groupingValue.setPortraitSn(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))); + insertGroupingValues.add(groupingValue); + } + if (Objects.nonNull(groupingValue.getLabelFieldContentId())) { + updateGroupingValues.add(groupingValue); + } + } + int insert = labelFieldContentMapper.insertLabelFieldContentList(insertGroupingValues); + int update = labelFieldContentMapper.updateContentRemarkLabelFieldContentList(updateGroupingValues); + return AjaxResult.success(); } } 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..8d68b9cd 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/labelfieldcontent/LabelFieldContentMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/labelfieldcontent/LabelFieldContentMapper.xml @@ -279,4 +279,76 @@ 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.create_by}, + #{GroupingValue.create_time} + ) + + + + + + update label_field_content + field_id = + #{item.fieldId}, + + field_name = + #{item.fieldName}, + + field_code = + #{item.fieldCode}, + + field_value = + #{item.fieldValue}, + + portrait_sn = + #{item.portraitSn}, + + patient_id = + #{item.patientId}, + + portrait_status = + #{item.portraitStatus}, + + content_sort = + #{item.contentSort}, + + content_remark = + #{item.contentRemark}, + + update_by = + #{item.updateBy}, + + update_time = + #{item.updateTime}, + + where id = #{item.id} + + \ No newline at end of file From 6dc21982d96e7da73be35f137cb28e880abcc50d Mon Sep 17 00:00:00 2001 From: zhangheng <3226558941@qq.com> Date: Wed, 26 Jun 2024 15:00:36 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E6=A0=87=E7=AD=BE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LabelFieldContentController.java | 3 + .../PatientAllInfoViewUppercase.java | 283 ++++++++++++++++++ .../patientinfo/PatientAllInfoViewMapper.java | 4 +- .../ILabelFieldContentService.java | 6 + .../impl/LabelFieldContentServiceImpl.java | 49 ++- .../patientinfo/PatientAllInfoViewMapper.xml | 86 +++--- 6 files changed, 360 insertions(+), 71 deletions(-) create mode 100644 postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientinfo/PatientAllInfoViewUppercase.java 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/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 0eab350b..1530b297 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,6 +10,7 @@ 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; @@ -25,12 +26,10 @@ 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.Objects; +import java.util.*; import java.util.stream.Collectors; /** @@ -201,31 +200,21 @@ public class LabelFieldContentServiceImpl implements ILabelFieldContentService { 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) { - groupingValue.setPatientId(patientId); - //获取不同的文件路径 - 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; - } + 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; - } /** @@ -236,17 +225,23 @@ 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; } + /** + * 画像内容新增 + * + * @param labelField 画像信息 + * @return AjaxResult + */ @Transactional(rollbackFor = Exception.class) @Override public AjaxResult insertLabelField(LabelField labelField) { 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 @@ + + \ No newline at end of file