From 5cafa7c6ace0cd104949bdf7a99f9ccf3f598ad1 Mon Sep 17 00:00:00 2001 From: lxd <1004405501@qq.com> Date: Wed, 2 Apr 2025 23:00:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B6=85=E5=A3=B0=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E5=8F=B0=E7=9B=B8=E5=85=B3=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EcganalysisparasController.java | 2 +- .../PatientexamlistController.java | 118 +++++++++++------- .../vo/PatientexamlistPageReqVO.java | 2 +- .../PatientexamlistMapper.java | 53 +++++++- .../PatientexamlistService.java | 3 + .../PatientexamlistServiceImpl.java | 5 +- 6 files changed, 136 insertions(+), 47 deletions(-) diff --git a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/ecganalysisparas/EcganalysisparasController.java b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/ecganalysisparas/EcganalysisparasController.java index 58207d600..96e500990 100644 --- a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/ecganalysisparas/EcganalysisparasController.java +++ b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/ecganalysisparas/EcganalysisparasController.java @@ -125,7 +125,7 @@ public class EcganalysisparasController { } else { - return success("未获取到相关数据"); + return success(null,"未获取到相关数据"); } return success(list1); } diff --git a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/PatientexamlistController.java b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/PatientexamlistController.java index 7bf62c858..87497d767 100644 --- a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/PatientexamlistController.java +++ b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/PatientexamlistController.java @@ -161,53 +161,85 @@ public class PatientexamlistController { @PreAuthorize("@ss.hasPermission('tblist:patientexamlist:query')") public CommonResult> getPatientexamlistPage(@Valid PatientexamlistPageReqVO pageReqVO) { - //获取当前登陆用户 +// //获取当前登陆用户 +// AdminUserDO user = userService.getUser(getLoginUserId()); +// pageReqVO.setOrgId(user.getOrgId()); +// +// String devicetype = pageReqVO.getDeviceType(); +// if (devicetype != null && devicetype.contains("CT")) +// pageReqVO.setDeviceType(null); +// PageResult pageResult = patientexamlistService.getPatientexamlistPage(pageReqVO); +// List doList = new ArrayList<>(); +// if (devicetype != null && devicetype.contains("US"))//表示只查询超声的数据 +// { +// // 筛选条件: +// doList = pageResult.getList().stream() +// .filter(PatientexamlistDO -> (PatientexamlistDO.getDeviceType().contains("US"))) +// .sorted(Comparator.comparing(PatientexamlistDO::getExamDate, Comparator.nullsLast(Comparator.reverseOrder()))) // 降序排序,null值排在后面 +// .collect(Collectors.toList()); +// } else if (devicetype != null && devicetype.contains("CSH1"))//表示只查询病理工作台的数据 +// { +// // 筛选条件: +// doList = pageResult.getList().stream() +// .filter(PatientexamlistDO -> (PatientexamlistDO.getDeviceType().contains("CSH1"))) +// .sorted(Comparator.comparing(PatientexamlistDO::getExamDate, Comparator.nullsLast(Comparator.reverseOrder()))) // 降序排序,null值排在后面 +// .collect(Collectors.toList()); +// } else if (devicetype != null && devicetype.contains("ECG"))//表示只查询心电的数据 +// { +// // 筛选条件: +// doList = pageResult.getList().stream() +// .filter(PatientexamlistDO -> (PatientexamlistDO.getDeviceType().contains("ECG"))) +// .sorted(Comparator.comparing(PatientexamlistDO::getExamDate, Comparator.nullsLast(Comparator.reverseOrder()))) // 降序排序,null值排在后面 +// .collect(Collectors.toList()); +// } else if (devicetype != null && !devicetype.trim().isEmpty())//表示只查询影像的数据 +// { +// // 筛选条件: +// doList = pageResult.getList().stream() +// .filter(PatientexamlistDO -> !(PatientexamlistDO.getDeviceType().contains("US")) && !(PatientexamlistDO.getDeviceType().contains("CSH1")) && !(PatientexamlistDO.getDeviceType().contains("ECG"))) +// .sorted(Comparator.comparing(PatientexamlistDO::getExamDate, Comparator.nullsLast(Comparator.reverseOrder()))) // 降序排序,null值排在后面 +// .collect(Collectors.toList()); +// } else //devicetype为空,查询全部数据 +// { +// doList = pageResult.getList().stream() +// .sorted(Comparator.comparing(PatientexamlistDO::getExamDate, Comparator.nullsLast(Comparator.reverseOrder()))) // 降序排序,null值排在后面 +// .collect(Collectors.toList()); +// } +// +// pageResult.setList(doList); +// pageResult.setTotal((long) doList.size()); +// +// return success(BeanUtils.toBean(pageResult, PatientexamlistRespVO.class)); + + + // 获取当前登陆用户 AdminUserDO user = userService.getUser(getLoginUserId()); pageReqVO.setOrgId(user.getOrgId()); - String devicetype = pageReqVO.getDeviceType(); - if (devicetype != null && devicetype.contains("CT")) - pageReqVO.setDeviceType(null); - PageResult pageResult = patientexamlistService.getPatientexamlistPage(pageReqVO); - List doList = new ArrayList<>(); - if (devicetype != null && devicetype.contains("US"))//表示只查询超声的数据 - { - // 筛选条件: - doList = pageResult.getList().stream() - .filter(PatientexamlistDO -> (PatientexamlistDO.getDeviceType().contains("US"))) - .sorted(Comparator.comparing(PatientexamlistDO::getExamDate, Comparator.nullsLast(Comparator.reverseOrder()))) // 降序排序,null值排在后面 - .collect(Collectors.toList()); - } else if (devicetype != null && devicetype.contains("CSH1"))//表示只查询病理工作台的数据 - { - // 筛选条件: - doList = pageResult.getList().stream() - .filter(PatientexamlistDO -> (PatientexamlistDO.getDeviceType().contains("CSH1"))) - .sorted(Comparator.comparing(PatientexamlistDO::getExamDate, Comparator.nullsLast(Comparator.reverseOrder()))) // 降序排序,null值排在后面 - .collect(Collectors.toList()); - } else if (devicetype != null && devicetype.contains("ECG"))//表示只查询心电的数据 - { - // 筛选条件: - doList = pageResult.getList().stream() - .filter(PatientexamlistDO -> (PatientexamlistDO.getDeviceType().contains("ECG"))) - .sorted(Comparator.comparing(PatientexamlistDO::getExamDate, Comparator.nullsLast(Comparator.reverseOrder()))) // 降序排序,null值排在后面 - .collect(Collectors.toList()); - } else if (devicetype != null && !devicetype.trim().isEmpty())//表示只查询影像的数据 - { - // 筛选条件: - doList = pageResult.getList().stream() - .filter(PatientexamlistDO -> !(PatientexamlistDO.getDeviceType().contains("US")) && !(PatientexamlistDO.getDeviceType().contains("CSH1")) && !(PatientexamlistDO.getDeviceType().contains("ECG"))) - .sorted(Comparator.comparing(PatientexamlistDO::getExamDate, Comparator.nullsLast(Comparator.reverseOrder()))) // 降序排序,null值排在后面 - .collect(Collectors.toList()); - } else //devicetype为空,查询全部数据 - { - doList = pageResult.getList().stream() - .sorted(Comparator.comparing(PatientexamlistDO::getExamDate, Comparator.nullsLast(Comparator.reverseOrder()))) // 降序排序,null值排在后面 - .collect(Collectors.toList()); - } - - pageResult.setList(doList); - pageResult.setTotal((long) doList.size()); +// // 构建查询条件 +// QueryWrapper queryWrapper = new QueryWrapper<>(); +// queryWrapper.eq("orgId", pageReqVO.getOrgId()); +// if (pageReqVO.getDeviceType() != null) { +// String devicetype = pageReqVO.getDeviceType(); +// if (devicetype.contains("US")) { +// queryWrapper.like("deviceType", "US"); +// } else if (devicetype.contains("CSH1")) { +// queryWrapper.like("deviceType", "CSH1"); +// } else if (devicetype.contains("ECG")) { +// queryWrapper.like("deviceType", "ECG"); +// } else { +// // 排除US、CSH1、ECG设备类型 +// queryWrapper.notLike("deviceType", "US") +// .notLike("deviceType", "CSH1") +// .notLike("deviceType", "ECG"); +// } +// +// } +// +// // 添加排序条件 +// queryWrapper.orderByDesc("examDate"); + // 获取分页结果 + PageResult pageResult = patientexamlistService.getPatientexamlistPagesql(pageReqVO); return success(BeanUtils.toBean(pageResult, PatientexamlistRespVO.class)); } diff --git a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/vo/PatientexamlistPageReqVO.java b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/vo/PatientexamlistPageReqVO.java index e58c94810..44ad102c2 100644 --- a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/vo/PatientexamlistPageReqVO.java +++ b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/controller/admin/patientexamlist/vo/PatientexamlistPageReqVO.java @@ -19,7 +19,7 @@ public class PatientexamlistPageReqVO extends PageParam { private String examId; @Schema(description = "患者姓名", example = "赵六") - private String pName; + private String pname; @Schema(description = "性别") private String gender; diff --git a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/dal/mysql/patientexamlist/PatientexamlistMapper.java b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/dal/mysql/patientexamlist/PatientexamlistMapper.java index dfc5e0752..5faefef55 100644 --- a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/dal/mysql/patientexamlist/PatientexamlistMapper.java +++ b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/dal/mysql/patientexamlist/PatientexamlistMapper.java @@ -8,6 +8,7 @@ import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.yudao.module.system.dal.dataobject.org.OrgUnitDO; import cn.iocoder.yudao.module.tblist.dal.dataobject.patientexamlist.PatientexamlistDO; import com.baomidou.mybatisplus.annotation.InterceptorIgnore; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import org.apache.ibatis.annotations.*; import cn.iocoder.yudao.module.tblist.controller.admin.patientexamlist.vo.*; @@ -73,7 +74,7 @@ public interface PatientexamlistMapper extends BaseMapperX { default PageResult selectPage(PatientexamlistPageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX() .eqIfPresent(PatientexamlistDO::getExamId, reqVO.getExamId()) - .likeIfPresent(PatientexamlistDO::getPName, reqVO.getPName()) + .likeIfPresent(PatientexamlistDO::getPName, reqVO.getPname()) .eqIfPresent(PatientexamlistDO::getGender, reqVO.getGender()) .betweenIfPresent(PatientexamlistDO::getExamDate, reqVO.getExamDate()) .likeIfPresent(PatientexamlistDO::getExamItemName, reqVO.getExamItemName()) @@ -106,6 +107,56 @@ public interface PatientexamlistMapper extends BaseMapperX { .orderByDesc(PatientexamlistDO::getId)); } + default PageResult selectPagesql(PatientexamlistPageReqVO reqVO) { + LambdaQueryWrapperX queryWrapper = new LambdaQueryWrapperX<>(); + + // 添加 orgId 条件 + queryWrapper.eqIfPresent(PatientexamlistDO::getOrgId, reqVO.getOrgId()); + + // 添加 deviceType 条件 + if (reqVO.getDeviceType() != null) { + String devicetype = reqVO.getDeviceType(); + if (devicetype.contains("US")) { + queryWrapper.like(PatientexamlistDO::getDeviceType, "US"); + } else if (devicetype.contains("CSH1")) { + queryWrapper.like(PatientexamlistDO::getDeviceType, "CSH1"); + } else if (devicetype.contains("ECG")) { + queryWrapper.like(PatientexamlistDO::getDeviceType, "ECG"); + } else { + // 排除US、CSH1、ECG设备类型 + queryWrapper.notLike(PatientexamlistDO::getDeviceType, "US") + .notLike(PatientexamlistDO::getDeviceType, "CSH1") + .notLike(PatientexamlistDO::getDeviceType, "ECG"); + } + } + + // 添加其他查询条件 + queryWrapper.eqIfPresent(PatientexamlistDO::getExamId, reqVO.getExamId()) + .likeIfPresent(PatientexamlistDO::getPName, reqVO.getPname()) + .eqIfPresent(PatientexamlistDO::getGender, reqVO.getGender()) + .betweenIfPresent(PatientexamlistDO::getExamDate, reqVO.getExamDate()) + .likeIfPresent(PatientexamlistDO::getExamItemName, reqVO.getExamItemName()) + .eqIfPresent(PatientexamlistDO::getReportstatus, reqVO.getReportstatus()) + .betweenIfPresent(PatientexamlistDO::getUploadDate, reqVO.getUploadDate()) + .likeIfPresent(PatientexamlistDO::getOrgName, reqVO.getOrgName()) + .betweenIfPresent(PatientexamlistDO::getCreateDate, reqVO.getCreateDate()) + .eqIfPresent(PatientexamlistDO::getExamDescription, reqVO.getExamDescription()) + .eqIfPresent(PatientexamlistDO::getDiagResults, reqVO.getDiagResults()) + .betweenIfPresent(PatientexamlistDO::getDiagDate, reqVO.getDiagDate()) + .eqIfPresent(PatientexamlistDO::getDiagDoctor, reqVO.getDiagDoctor()) + .betweenIfPresent(PatientexamlistDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(PatientexamlistDO::getIsFavourite, reqVO.getIsFavourite()) + .and(wrapper -> wrapper + .eq(PatientexamlistDO::getOrgId, reqVO.getOrgId()) + .or() + .eq(PatientexamlistDO::getHighLevelOrgId, reqVO.getOrgId())) + .orderByDesc(PatientexamlistDO::getId); + + // 获取分页结果 + return selectPage(reqVO, queryWrapper); + } + + // 查询需要刷新的数据 @Select("select * from tb_patientexamlist where reportstatus='已分检' and examDate is null and orgId=#{orgId}") diff --git a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/service/patientexamlist/PatientexamlistService.java b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/service/patientexamlist/PatientexamlistService.java index 9522b76c4..7bb2df7ed 100644 --- a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/service/patientexamlist/PatientexamlistService.java +++ b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/service/patientexamlist/PatientexamlistService.java @@ -6,6 +6,7 @@ import cn.iocoder.yudao.module.tblist.controller.admin.patientexamlist.vo.*; import cn.iocoder.yudao.module.tblist.dal.dataobject.patientexamlist.PatientexamlistDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.IService; import javax.validation.Valid; @@ -71,6 +72,8 @@ public interface PatientexamlistService extends IService { * @return PACS检查列表分页 */ PageResult getPatientexamlistPage(PatientexamlistPageReqVO pageReqVO); + /*查询分页 */ + PageResult getPatientexamlistPagesql(PatientexamlistPageReqVO pageReqVO); /** * 获得PACS病例管理分页 diff --git a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/service/patientexamlist/PatientexamlistServiceImpl.java b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/service/patientexamlist/PatientexamlistServiceImpl.java index 5eb930023..7bb7cc501 100644 --- a/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/service/patientexamlist/PatientexamlistServiceImpl.java +++ b/yudao-module-tblist/yudao-module-tblist-biz/src/main/java/cn/iocoder/yudao/module/tblist/service/patientexamlist/PatientexamlistServiceImpl.java @@ -140,7 +140,10 @@ public class PatientexamlistServiceImpl extends ServiceImpl getPatientexamlistPage(PatientexamlistPageReqVO pageReqVO) { return patientexamlistMapper.selectPage(pageReqVO); } - + @Override + public PageResult getPatientexamlistPagesql(PatientexamlistPageReqVO pageReqVO) { + return patientexamlistMapper.selectPagesql(pageReqVO); + } @Override public PageResult getIllnessCasePage(IllnessCasePageReqVO pageReqVO) {