From dfdab41c00dca07e2d2fdcec30b294b19a3cfa97 Mon Sep 17 00:00:00 2001 From: chenjinyang <1950285536@qq.com> Date: Thu, 5 Feb 2026 16:30:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=9093=E9=9C=80=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../appservice/ISurgeryAppService.java | 4 +- .../ISurgicalScheduleAppService.java | 69 + .../impl/SurgeryAppServiceImpl.java | 38 +- .../impl/SurgicalScheduleAppServiceImpl.java | 302 ++++ .../controller/SurgeryController.java | 9 +- .../SurgicalScheduleController.java | 101 ++ .../dto/OpCreateScheduleDto.java | 268 +++ .../mapper/SurgeryAppMapper.java | 3 +- .../mapper/SurgicalScheduleAppMapper.java | 61 + .../IRequestFormManageAppService.java | 10 + .../impl/RequestFormManageAppServiceImpl.java | 14 + .../RequestFormManageController.java | 17 +- .../regdoctorstation/dto/RequestFormDto.java | 37 + .../dto/RequestFormPageDto.java | 80 + .../mapper/RequestFormManageAppMapper.java | 13 + .../mapper/clinicalmanage/SurgeryMapper.xml | 6 +- .../SurgicalScheduleAppMapper.xml | 146 ++ .../RequestFormManageAppMapper.xml | 58 + .../surgicalschedule/domain/OpSchedule.java | 191 +++ .../mapper/OpScheduleMapper.java | 18 + .../service/IOpScheduleService.java | 14 + .../service/impl/OpScheduleServiceImpl.java | 18 + openhis-ui-vue3/package-lock.json | 19 + openhis-ui-vue3/package.json | 1 + openhis-ui-vue3/src/api/surgicalschedule.js | 62 + openhis-ui-vue3/src/utils/request.js | 26 +- .../components/surgery/surgeryApplication.vue | 10 +- .../home/components/applicationShow/api.js | 14 + .../src/views/surgerymanage/index.vue | 8 +- .../src/views/surgicalschedule/index.vue | 1505 +++++++++++++++++ 30 files changed, 3104 insertions(+), 18 deletions(-) create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/appservice/ISurgicalScheduleAppService.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/appservice/impl/SurgicalScheduleAppServiceImpl.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/controller/SurgicalScheduleController.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/dto/OpCreateScheduleDto.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/mapper/SurgicalScheduleAppMapper.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/dto/RequestFormDto.java create mode 100644 openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/dto/RequestFormPageDto.java create mode 100644 openhis-server-new/openhis-application/src/main/resources/mapper/clinicalmanage/SurgicalScheduleAppMapper.xml create mode 100644 openhis-server-new/openhis-domain/src/main/java/com/openhis/surgicalschedule/domain/OpSchedule.java create mode 100644 openhis-server-new/openhis-domain/src/main/java/com/openhis/surgicalschedule/mapper/OpScheduleMapper.java create mode 100644 openhis-server-new/openhis-domain/src/main/java/com/openhis/surgicalschedule/service/IOpScheduleService.java create mode 100644 openhis-server-new/openhis-domain/src/main/java/com/openhis/surgicalschedule/service/impl/OpScheduleServiceImpl.java create mode 100644 openhis-ui-vue3/src/api/surgicalschedule.js create mode 100644 openhis-ui-vue3/src/views/surgicalschedule/index.vue diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/appservice/ISurgeryAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/appservice/ISurgeryAppService.java index e5bcc557..457b8652 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/appservice/ISurgeryAppService.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/appservice/ISurgeryAppService.java @@ -21,9 +21,11 @@ public interface ISurgeryAppService { * @param surgeryDto 查询条件 * @param pageNo 当前页 * @param pageSize 每页条数 + * @param plannedTimeStart 计划开始时间 + * @param plannedTimeEnd 计划结束时间 * @return 手术列表 */ - IPage getSurgeryPage(SurgeryDto surgeryDto, Integer pageNo, Integer pageSize); + IPage getSurgeryPage(SurgeryDto surgeryDto, Integer pageNo, Integer pageSize, String plannedTimeStart, String plannedTimeEnd); /** * 根据ID查询手术详情 diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/appservice/ISurgicalScheduleAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/appservice/ISurgicalScheduleAppService.java new file mode 100644 index 00000000..21052d9c --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/appservice/ISurgicalScheduleAppService.java @@ -0,0 +1,69 @@ +package com.openhis.web.clinicalmanage.appservice; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.core.common.core.domain.R; +import com.openhis.web.clinicalmanage.dto.OpCreateScheduleDto; +import com.openhis.web.clinicalmanage.dto.OpScheduleDto; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +/** + * 手术安排业务层接口 + * + * @author system + * @date 2026-01-28 + */ +public interface ISurgicalScheduleAppService { + + /** + * 分页查询手术安排列表 + * + * @param opScheduleDto 查询条件 + * @param pageNo 当前页 + * @param pageSize 每页条数 + * @return 手术安排列表 + */ + IPage getSurgerySchedulePage(OpScheduleDto opScheduleDto, Integer pageNo, Integer pageSize); + + /** + * 根据ID查询手术安排详情 + * + * @param scheduleId 手术安排ID + * @return 手术安排详情 + */ + R getSurgeryScheduleDetail(Long scheduleId); + + /** + * 新增手术安排 + * + * @param opCreateScheduleDto 手术安排信息 + * @return 结果 + */ + R addSurgerySchedule(OpCreateScheduleDto opCreateScheduleDto); + + /** + * 修改手术安排 + * + * @param opScheduleDto 手术安排信息 + * @return 结果 + */ + R updateSurgerySchedule(OpScheduleDto opScheduleDto); + + /** + * 删除手术安排 + * + * @param scheduleId 手术安排ID + * @return 结果 + */ + R deleteSurgerySchedule(Long scheduleId); + + /** + * 导出手术安排列表 + * + * @param opScheduleDto 查询条件 + * @param response 响应对象 + * @throws IOException 异常 + */ + void exportSurgerySchedule(OpScheduleDto opScheduleDto, HttpServletResponse response) throws IOException; +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/appservice/impl/SurgeryAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/appservice/impl/SurgeryAppServiceImpl.java index b9fafab4..d03c8531 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/appservice/impl/SurgeryAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/appservice/impl/SurgeryAppServiceImpl.java @@ -47,8 +47,9 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; import java.util.*; -import java.util.stream.Collectors; import static com.core.framework.datasource.DynamicDataSourceContextHolder.log; @@ -102,10 +103,12 @@ public class SurgeryAppServiceImpl implements ISurgeryAppService { * @param surgeryDto 查询条件 * @param pageNo 当前页 * @param pageSize 每页条数 + * @param plannedTimeStart 计划开始时间 + * @param plannedTimeEnd 计划结束时间 * @return 手术列表 */ @Override - public IPage getSurgeryPage(SurgeryDto surgeryDto, Integer pageNo, Integer pageSize) { + public IPage getSurgeryPage(SurgeryDto surgeryDto, Integer pageNo, Integer pageSize, String plannedTimeStart, String plannedTimeEnd) { QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(surgeryDto, null, new HashSet() {{ add("surgery_no"); @@ -115,6 +118,37 @@ public class SurgeryAppServiceImpl implements ISurgeryAppService { add("anesthetist_name"); add("org_name"); }}, null); + + // 添加计划时间范围查询 + if (plannedTimeStart != null && !plannedTimeStart.isEmpty()) { + try { + LocalDateTime startDateTime = LocalDateTime.parse(plannedTimeStart, DateTimeFormatter.ISO_DATE_TIME); + queryWrapper.ge("planned_time", startDateTime); + } catch (Exception e) { + // 如果解析失败,尝试使用日期格式解析 + try { + LocalDateTime startDateTime = LocalDateTime.parse(plannedTimeStart + "T00:00:00", DateTimeFormatter.ISO_DATE_TIME); + queryWrapper.ge("planned_time", startDateTime); + } catch (Exception ex) { + log.error("解析计划开始时间失败: {}", plannedTimeStart, ex); + } + } + } + if (plannedTimeEnd != null && !plannedTimeEnd.isEmpty()) { + try { + LocalDateTime endDateTime = LocalDateTime.parse(plannedTimeEnd, DateTimeFormatter.ISO_DATE_TIME); + queryWrapper.le("planned_time", endDateTime); + } catch (Exception e) { + // 如果解析失败,尝试使用日期格式解析 + try { + LocalDateTime endDateTime = LocalDateTime.parse(plannedTimeEnd + "T23:59:59", DateTimeFormatter.ISO_DATE_TIME); + queryWrapper.le("planned_time", endDateTime); + } catch (Exception ex) { + log.error("解析计划结束时间失败: {}", plannedTimeEnd, ex); + } + } + } + queryWrapper.orderByDesc("create_time"); return surgeryAppMapper.getSurgeryPage(new Page<>(pageNo, pageSize), queryWrapper); } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/appservice/impl/SurgicalScheduleAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/appservice/impl/SurgicalScheduleAppServiceImpl.java new file mode 100644 index 00000000..ceed3671 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/appservice/impl/SurgicalScheduleAppServiceImpl.java @@ -0,0 +1,302 @@ +package com.openhis.web.clinicalmanage.appservice.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.core.common.core.domain.R; +import com.core.common.core.domain.model.LoginUser; +import com.core.common.utils.SecurityUtils; +import com.openhis.administration.domain.Patient; +import com.openhis.administration.service.IPatientService; +import com.openhis.surgicalschedule.domain.OpSchedule; +import com.openhis.surgicalschedule.service.IOpScheduleService; +import com.openhis.web.clinicalmanage.appservice.ISurgicalScheduleAppService; +import com.openhis.web.clinicalmanage.dto.OpCreateScheduleDto; +import com.openhis.web.clinicalmanage.dto.OpScheduleDto; +import com.openhis.web.clinicalmanage.mapper.SurgicalScheduleAppMapper; +import com.openhis.web.regdoctorstation.mapper.RequestFormManageAppMapper; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.OutputStream; +import java.io.PrintWriter; +import java.net.URLEncoder; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.util.Date; +import java.util.List; + +/** + * 手术安排业务层实现类 + * + * @author system + * @date 2026-01-28 + */ +@Service +public class SurgicalScheduleAppServiceImpl implements ISurgicalScheduleAppService { + + @Resource + private IOpScheduleService opScheduleService; + + @Resource + private IPatientService patientService; + + @Resource + private SurgicalScheduleAppMapper surgicalScheduleAppMapper; + + + @Resource + private RequestFormManageAppMapper requestFormManageAppMapper; + /** + * 分页查询手术安排列表 + * + * @param opScheduleDto 查询条件 + * @param pageNo 当前页 + * @param pageSize 每页条数 + * @return 手术安排列表 + */ + @Override + public IPage getSurgerySchedulePage(OpScheduleDto opScheduleDto, Integer pageNo, Integer pageSize) { + return surgicalScheduleAppMapper.getSurgerySchedulePage(new Page<>(pageNo, pageSize), opScheduleDto); + } + + /** + * 根据ID查询手术安排详情 + * + * @param scheduleId 手术安排ID + * @return 手术安排详情 + */ + @Override + public R getSurgeryScheduleDetail(Long scheduleId) { + OpScheduleDto opScheduleDto = surgicalScheduleAppMapper.getSurgeryScheduleDetail(scheduleId); + if (opScheduleDto == null) { + return R.fail("手术安排信息不存在"); + } + return R.ok(opScheduleDto); + } + + /** + * 新增手术安排 + * + * @param opCreateScheduleDto 手术安排信息 + * @return 结果 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public R addSurgerySchedule(OpCreateScheduleDto opCreateScheduleDto) { + // 校验患者是否存在 + if (opCreateScheduleDto.getPatientId() != null) { + Patient patient = patientService.getById(opCreateScheduleDto.getPatientId()); + if (patient == null) { + return R.fail("患者信息不存在"); + } + } + //校验该时段内手术间是否被占用 + LocalDateTime scheduleDate = opCreateScheduleDto.getEntryTime();//入室时间 + String roomCode = opCreateScheduleDto.getRoomCode();//手术室编号 + LocalDateTime endTime = opCreateScheduleDto.getEndTime();//手术结束时间 + Boolean scheduleConflict = surgicalScheduleAppMapper.isScheduleConflict(scheduleDate, endTime, roomCode); + if (scheduleConflict) { + return R.fail("该时段内手术间被占用"); + } + + LoginUser loginUser = new LoginUser(); + //获取当前登录用户信息 + loginUser = SecurityUtils.getLoginUser(); + // 当前登录用户ID + Long userId = loginUser.getUserId(); + + // 转换为实体对象 + OpSchedule opSchedule = new OpSchedule(); + BeanUtils.copyProperties(opCreateScheduleDto, opSchedule); + + // 设置创建者ID + opSchedule.setCreatorId(userId); + //设置创建人名称 + opSchedule.setCreateBy(loginUser.getUsername()); + //设置创建时间 + opSchedule.setCreateTime(new Date()); + // 设置租户ID + opSchedule.setTenantId(loginUser.getTenantId()); + //设置手术状态 + opSchedule.setOperStatus(0); + //修改申请表状态为已排期 + + // 保存手术安排 + boolean saved = opScheduleService.save(opSchedule); + //修改申请单状态为已排期 + + if (!saved) { + return R.fail("新增手术安排失败"); + } + + return R.ok("新增手术安排成功"); + } + + /** + * 修改手术安排 + * + * @param opScheduleDto 手术安排信息 + * @return 结果 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public R updateSurgerySchedule(OpScheduleDto opScheduleDto) { + // 校验手术安排是否存在 + if (opScheduleDto.getScheduleId() == null) { + return R.fail("排程号不能为空"); + } + OpSchedule existSchedule = opScheduleService.getById(opScheduleDto.getScheduleId()); + if (existSchedule == null) { + return R.fail("手术安排信息不存在"); + } + + // 转换为实体对象 + OpSchedule opSchedule = new OpSchedule(); + BeanUtils.copyProperties(opScheduleDto, opSchedule); + + // 更新时间 + opSchedule.setUpdateTime(new Date()); + + // 更新手术安排 + boolean updated = opScheduleService.updateById(opSchedule); + if (!updated) { + return R.fail("修改手术安排失败"); + } + + return R.ok("修改手术安排成功"); + } + + /** + * 删除手术安排 + * + * @param scheduleId 手术安排ID + * @return 结果 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public R deleteSurgerySchedule(Long scheduleId) { + // 校验手术安排是否存在 + OpSchedule existSchedule = opScheduleService.getById(scheduleId); + if (existSchedule == null) { + return R.fail("手术安排信息不存在"); + } + + // 逻辑删除手术安排 + boolean deleted = opScheduleService.removeById(scheduleId); + if (!deleted) { + return R.fail("删除手术安排失败"); + } + + return R.ok(null, "删除手术安排成功"); + } + + /** + * 导出手术安排列表 + * + * @param opScheduleDto 查询条件 + * @param response 响应对象 + * @throws IOException 异常 + */ + @Override + public void exportSurgerySchedule(OpScheduleDto opScheduleDto, HttpServletResponse response) throws IOException { + // 查询所有符合条件的手术安排 + List scheduleList = surgicalScheduleAppMapper.getSurgeryScheduleList(opScheduleDto); + + // 设置响应头 + response.setContentType("text/csv; charset=utf-8"); + response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode("手术安排列表.csv", "UTF-8")); + + // 写入CSV文件 + try (OutputStream outputStream = response.getOutputStream(); + PrintWriter writer = new PrintWriter(outputStream)) { + + // 写入UTF-8 BOM,解决Excel乱码问题 + outputStream.write(0xEF); + outputStream.write(0xBB); + outputStream.write(0xBF); + + // 写入表头(与前端表格完全一致) + writer.println("ID,卫生机构,姓名,就诊卡号,手术单号,手术名称,申请科室,手术类型,手术性质,主刀医生,麻醉方法,安排时间,操作人"); + + // 写入数据 + int index = 0; + for (OpScheduleDto schedule : scheduleList) { + index++; + + // 转换手术类型 + String surgeryType = convertSurgeryNature(schedule.getSurgeryNature()); + + // 转换麻醉方法 + String anesthesiaMethod = convertAnesMethod(schedule.getAnesMethod()); + + // 格式化安排时间 + String formattedDate = formatScheduleDate(schedule.getScheduleDate()); + + writer.printf("%d,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s\n", + index, // 序号从1开始 + schedule.getOrgName() != null ? schedule.getOrgName() : "", + schedule.getPatientName() != null ? schedule.getPatientName() : "", + schedule.getVisitId() != null ? schedule.getVisitId().toString() : "", + schedule.getOperCode() != null ? schedule.getOperCode() : "", + schedule.getOperName() != null ? schedule.getOperName() : "", + schedule.getApplyDeptName() != null ? schedule.getApplyDeptName() : "", + surgeryType, + surgeryType, // 手术性质和手术类型使用相同的转换 + schedule.getSurgeonName() != null ? schedule.getSurgeonName() : "", + anesthesiaMethod, + formattedDate, + schedule.getCreateByName() != null ? schedule.getCreateByName() : "" + ); + } + + writer.flush(); + } + } + + /** + * 转换手术性质/类型 + */ + private String convertSurgeryNature(String surgeryNature) { + if (surgeryNature == null) return ""; + + switch (surgeryNature) { + case "1": return "择期手术"; + case "2": return "急诊手术"; + case "3": return "限期手术"; + case "4": return "日间手术"; + default: return surgeryNature; + } + } + + /** + * 转换麻醉方法 + */ + private String convertAnesMethod(String anesMethod) { + if (anesMethod == null) return ""; + + switch (anesMethod) { + case "1": return "全身麻醉"; + case "2": return "椎管内麻醉"; + case "3": return "神经阻滞麻醉"; + case "4": return "局部浸润麻醉"; + case "5": return "表面麻醉"; + case "6": return "复合麻醉"; + case "7": return "基础麻醉"; + default: return anesMethod; + } + } + + /** + * 格式化安排时间 + */ + private String formatScheduleDate(LocalDate scheduleDate) { + if (scheduleDate == null) return ""; + + // 格式化为 yyyy-MM-dd + return scheduleDate.format(java.time.format.DateTimeFormatter.ofPattern("yyyy-MM-dd")); + } +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/controller/SurgeryController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/controller/SurgeryController.java index 945c708c..e9f01bc9 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/controller/SurgeryController.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/controller/SurgeryController.java @@ -31,13 +31,18 @@ public class SurgeryController { * @param surgeryDto 查询条件 * @param pageNo 当前页 * @param pageSize 每页条数 + * @param plannedTimeStart 计划开始时间 + * @param plannedTimeEnd 计划结束时间 * @return 手术列表 */ @GetMapping(value = "/surgery-page") public R> getSurgeryPage(SurgeryDto surgeryDto, @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, - @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { - IPage page = surgeryAppService.getSurgeryPage(surgeryDto, pageNo, pageSize); + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, + @RequestParam(value = "plannedTimeStart", required = false) String plannedTimeStart, + @RequestParam(value = "plannedTimeEnd", required = false) String plannedTimeEnd) { + // 将时间范围参数传递给服务层 + IPage page = surgeryAppService.getSurgeryPage(surgeryDto, pageNo, pageSize, plannedTimeStart, plannedTimeEnd); return R.ok(page); } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/controller/SurgicalScheduleController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/controller/SurgicalScheduleController.java new file mode 100644 index 00000000..746a94a3 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/controller/SurgicalScheduleController.java @@ -0,0 +1,101 @@ +package com.openhis.web.clinicalmanage.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.core.common.core.domain.R; +import com.openhis.web.clinicalmanage.appservice.ISurgicalScheduleAppService; +import com.openhis.web.clinicalmanage.dto.OpCreateScheduleDto; +import com.openhis.web.clinicalmanage.dto.OpScheduleDto; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +/** + * 手术安排Controller + * + * @author system + * @date 2026-01-28 + */ +@RestController +@RequestMapping("/clinical-manage/surgery-schedule") +@Slf4j +@AllArgsConstructor +public class SurgicalScheduleController { + + private final ISurgicalScheduleAppService surgicalScheduleAppService; + + /** + * 分页查询手术安排列表 + * + * @param opScheduleDto 查询条件 + * @param pageNo 当前页 + * @param pageSize 每页条数 + * @return 手术安排列表 + */ + @GetMapping(value = "/page") + public R> getSurgerySchedulePage(OpScheduleDto opScheduleDto, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { + IPage page = surgicalScheduleAppService.getSurgerySchedulePage(opScheduleDto, pageNo, pageSize); + return R.ok(page); + } + + /** + * 根据ID查询手术安排详情 + * + * @param scheduleId 手术安排ID + * @return 手术安排详情 + */ + @GetMapping(value = "/{scheduleId}") + public R getSurgeryScheduleDetail(@PathVariable Long scheduleId) { + return surgicalScheduleAppService.getSurgeryScheduleDetail(scheduleId); + } + + /** + * 新增手术安排 + * + * @param opCreateScheduleDto 手术安排信息 + * @return 结果 + */ + @PostMapping(value = "/create") + public R addSurgerySchedule(@RequestBody OpCreateScheduleDto opCreateScheduleDto) { + return surgicalScheduleAppService.addSurgerySchedule(opCreateScheduleDto); + } + + /** + * 修改手术安排 + * + * @param opScheduleDto 手术安排信息 + * @return 结果 + */ + @PutMapping(value = "/update") + public R updateSurgerySchedule(@RequestBody OpScheduleDto opScheduleDto) { + return surgicalScheduleAppService.updateSurgerySchedule(opScheduleDto); + } + + /** + * 删除手术安排 + * + * @param scheduleId 手术安排ID + * @return 结果 + */ + @DeleteMapping(value = "/{scheduleId}") + public R deleteSurgerySchedule(@PathVariable Long scheduleId) { + return surgicalScheduleAppService.deleteSurgerySchedule(scheduleId); + } + + /** + * 导出手术安排列表 + * + * @param opScheduleDto 查询条件 + * @param response 响应对象 + * @throws IOException 异常 + */ + @GetMapping(value = "/export") + public void exportSurgerySchedule(OpScheduleDto opScheduleDto, HttpServletResponse response) throws IOException { + surgicalScheduleAppService.exportSurgerySchedule(opScheduleDto, response); + } + +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/dto/OpCreateScheduleDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/dto/OpCreateScheduleDto.java new file mode 100644 index 00000000..5dfc1cba --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/dto/OpCreateScheduleDto.java @@ -0,0 +1,268 @@ +package com.openhis.web.clinicalmanage.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.LocalDateTime; + +@Data +public class OpCreateScheduleDto { + /** + * 申请单ID + */ + private Long applyId; + + /** + * 患者ID + */ + private Long patientId; + + /** + * 就诊ID + */ + private Long visitId; + + /** + * 手术编码 + */ + private String operCode; + + /** + * 手术名称 + */ + private String operName; + + /** + * 术前诊断 + */ + private String preoperativeDiagnosis; + + /** + * 术后诊断 + */ + private String postoperativeDiagnosis; + + /** + * 手术安排日期 + */ + private LocalDate scheduleDate; + + /** + * 手术台次序号 + */ + private Integer sequenceNo; + + /** + * 是否首台手术 1-是 0-否 + */ + private Integer isFirstSurgery; + + /** + * 是否有药物过敏 1-是 0-否 + */ + private Integer isAllergyMedication; + + /** + * 过敏备注 + */ + private String allergyRemark; + + /** + * 手术性质 + */ + private String surgeryNature; + + /** + * 手术部位 + */ + private String surgerySite; + + /** + * 入院时间 + */ + private LocalDateTime admissionTime; + + /** + * 入手术室时间 + */ + private LocalDateTime entryTime; + + /** + * 手术室编码 + */ + private String roomCode; + + /** + * 手术台号 + */ + private String tableNo; + + /** + * 麻醉方式 + */ + private String anesMethod; + + /** + * 麻醉医生1编码 + */ + private String anesDoctor1Code; + + /** + * 麻醉医生2编码 + */ + private String anesDoctor2Code; + + /** + * 麻醉医生3编码 + */ + private String anesDoctor3Code; + + /** + * 洗手护士编码 + */ + private String scrubNurseCode; + + /** + * 巡回护士1编码 + */ + private String circuNurse1Code; + + /** + * 巡回护士2编码 + */ + private String circuNurse2Code; + + /** + * 洗手护士1编码 + */ + private String scrubNurse1Code; + + /** + * 洗手护士2编码 + */ + private String scrubNurse2Code; + + /** + * 主刀医生编码 + */ + private String surgeonCode; + + /** + * 助手1编码 + */ + private String assistant1Code; + + /** + * 助手2编码 + */ + private String assistant2Code; + + /** + * 助手3编码 + */ + private String assistant3Code; + + /** + * 手术开始时间 + */ + private LocalDateTime startTime; + + /** + * 手术结束时间 + */ + private LocalDateTime endTime; + + /** + * 麻醉开始时间 + */ + private LocalDateTime anesStart; + + /** + * 麻醉结束时间 + */ + private LocalDateTime anesEnd; + + /** + * 手术状态 + */ + private Integer operStatus; + + /** + * 是否植入耗材 1-是 0-否 + */ + private Integer implantFlag; + + /** + * 植入物序列号 + */ + private String implantSerial; + + /** + * 失血量(ml) + */ + private Integer bloodLoss; + + /** + * 输血量(ml) + */ + private Integer bloodTrans; + + /** + * 感染诊断 + */ + private String infectionDiagnosis; + + /** + * 隔离类型 + */ + private String isolationType; + + /** + * 患者体重(kg) + */ + private BigDecimal patientWeight; + + /** + * 患者身高(cm) + */ + private BigDecimal patientHeight; + + /** + * 沟通信息 + */ + private String communicationInfo; + + /** + * 备注 + */ + private String remark; + + /** + * 创建时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createTime; + + /** + * 创建人ID + */ + private String creatorId; + + /** + * 更新时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime updateTime; + + /** + * 租户id + */ + private Integer tenantId; + + /** + * 是否删除(默认为0,1表示删除) + */ + private Integer deleteFlag; +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/mapper/SurgeryAppMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/mapper/SurgeryAppMapper.java index 7ac808ed..87b3e38e 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/mapper/SurgeryAppMapper.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/mapper/SurgeryAppMapper.java @@ -1,6 +1,7 @@ package com.openhis.web.clinicalmanage.mapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Constants; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -12,7 +13,7 @@ import org.springframework.stereotype.Repository; * 手术管理应用Mapper */ @Repository -public interface SurgeryAppMapper { +public interface SurgeryAppMapper extends BaseMapper { /** * 分页查询手术列表 diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/mapper/SurgicalScheduleAppMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/mapper/SurgicalScheduleAppMapper.java new file mode 100644 index 00000000..62356878 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/clinicalmanage/mapper/SurgicalScheduleAppMapper.java @@ -0,0 +1,61 @@ +package com.openhis.web.clinicalmanage.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.openhis.web.clinicalmanage.dto.OpScheduleDto; +import org.apache.ibatis.annotations.Param; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 手术安排Mapper接口 + * + * @author system + * @date 2026-01-28 + */ +public interface SurgicalScheduleAppMapper { + + /** + * 分页查询手术安排列表 + * + * @param page 分页参数 + * @param opScheduleDto 查询条件 + * @return 手术安排列表 + */ + IPage getSurgerySchedulePage(Page page, @Param("dto") OpScheduleDto opScheduleDto); + + /** + * 新增手术安排 + * + * @param opScheduleDto 手术安排信息 + * @return 添加结果 + */ + void addSurgerySchedule(@Param("opScheduleDto") OpScheduleDto opScheduleDto); + /** + * 根据ID查询手术安排详情 + * + * @param scheduleId 手术安排ID + * @return 手术安排详情 + */ + OpScheduleDto getSurgeryScheduleDetail(Long scheduleId); + + /** + * 查询所有符合条件的手术安排列表(用于导出) + * + * @param opScheduleDto 查询条件 + * @return 手术安排列表 + */ + List getSurgeryScheduleList(@Param("dto") OpScheduleDto opScheduleDto); + + /** + * 查询手术间在该时段是否被占用 + * + * @param startTime 手术开始时间 + * @param endTime 手术结束时间 + * @param surgeryRoomId 手术间ID + * @return 是否存在冲突的手术安排 + */ + Boolean isScheduleConflict(LocalDateTime startTime, LocalDateTime endTime, String surgeryRoomId); +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/appservice/IRequestFormManageAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/appservice/IRequestFormManageAppService.java index 60734e23..c8607e15 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/appservice/IRequestFormManageAppService.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/appservice/IRequestFormManageAppService.java @@ -1,6 +1,9 @@ package com.openhis.web.regdoctorstation.appservice; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.core.common.core.domain.R; +import com.openhis.web.regdoctorstation.dto.RequestFormDto; +import com.openhis.web.regdoctorstation.dto.RequestFormPageDto; import com.openhis.web.regdoctorstation.dto.RequestFormQueryDto; import com.openhis.web.regdoctorstation.dto.RequestFormSaveDto; @@ -29,4 +32,11 @@ public interface IRequestFormManageAppService { */ List getRequestForm(Long encounterId, String typeCode); + /** + * 分页查询申请单 + * + * @param requestFormDto 查询条件 + * @return 申请单 + */ + IPage getRequestFormPage(RequestFormDto requestFormDto); } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/appservice/impl/RequestFormManageAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/appservice/impl/RequestFormManageAppServiceImpl.java index eb60f766..c3b70ca7 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/appservice/impl/RequestFormManageAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/appservice/impl/RequestFormManageAppServiceImpl.java @@ -1,6 +1,8 @@ package com.openhis.web.regdoctorstation.appservice.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.core.common.core.domain.R; import com.core.common.exception.ServiceException; import com.core.common.utils.AssignSeqUtil; @@ -236,4 +238,16 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer return requestFormList; } + /** + * 查询申请单分页 + * + * @param requestFormDto 查询参数 + * @return 申请单分页列表 + */ + @Override + public IPage getRequestFormPage(RequestFormDto requestFormDto) { + Page page = new Page<>(requestFormDto.getPageNo(), requestFormDto.getPageSize()); + return requestFormManageAppMapper.getRequestFormPage(requestFormDto, page); + } + } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/controller/RequestFormManageController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/controller/RequestFormManageController.java index 87edc5ff..c2d2a015 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/controller/RequestFormManageController.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/controller/RequestFormManageController.java @@ -3,14 +3,21 @@ */ package com.openhis.web.regdoctorstation.controller; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.core.common.core.domain.R; import com.openhis.common.enums.ActivityDefCategory; +import com.openhis.document.domain.RequestForm; +import com.openhis.web.inventorymanage.appservice.impl.ProductStocktakingAppServiceImpl; import com.openhis.web.regdoctorstation.appservice.IRequestFormManageAppService; +import com.openhis.web.regdoctorstation.dto.RequestFormDto; +import com.openhis.web.regdoctorstation.dto.RequestFormPageDto; import com.openhis.web.regdoctorstation.dto.RequestFormSaveDto; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * 申请单管理 controller */ @@ -21,6 +28,7 @@ import org.springframework.web.bind.annotation.*; public class RequestFormManageController { private final IRequestFormManageAppService iRequestFormManageAppService; + private final ProductStocktakingAppServiceImpl productStocktakingAppServiceImpl; /** * 保存检查申请单 @@ -123,5 +131,12 @@ public class RequestFormManageController { } return R.ok(iRequestFormManageAppService.getRequestForm(encounterId, ActivityDefCategory.PROCEDURE.getCode())); } - +/** + * 分页查询申请单 + * @return 申请单 + */ + @RequestMapping(value = "/get-page") + public R> getRequestFormPage(@RequestBody RequestFormDto requestFormDto) { + return R.ok(iRequestFormManageAppService.getRequestFormPage(requestFormDto)); + } } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/dto/RequestFormDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/dto/RequestFormDto.java new file mode 100644 index 00000000..4f32af5f --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/dto/RequestFormDto.java @@ -0,0 +1,37 @@ +package com.openhis.web.regdoctorstation.dto; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDate; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class RequestFormDto { + /** + * 申请时间开始 + */ + private LocalDate applyTimeStart; + /** + * 申请时间结束 + */ + private LocalDate applyTimeEnd; + /** + * 主刀医生ID + */ + private Long mainDoctorId; + /** + * 申请科室ID + */ + private Long applyDeptId; + /** + * 当前页码 + */ + private Integer pageNo; + /** + * 每页数量 + */ + private Integer pageSize; +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/dto/RequestFormPageDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/dto/RequestFormPageDto.java new file mode 100644 index 00000000..9f3a295e --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/dto/RequestFormPageDto.java @@ -0,0 +1,80 @@ +package com.openhis.web.regdoctorstation.dto; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; +import lombok.Data; + +import java.util.Map; + +@Data +public class RequestFormPageDto { + /** + * 姓名 + */ + private String name; + /** + * 性别 + */ + private String gender; + /** + * 病人id + */ + private String patientId; + /** + * 出生日期 + */ + private String birthDay; + /** + * 就诊id + */ + private String encounterId; + /** + * 手术单号 + */ + private String surgeryNo; + /** + * 描述JSON + */ + @TableField(value = "desc_json", typeHandler = JacksonTypeHandler.class) + private Map descJson; + /** + * 申请单id + */ + private String applyId; + /** + * 申请科室 + */ + private String applyDeptId; + /** + * 申请科室名称 + */ + private String applyDeptName; + /** + * 申请医生ID + */ + private String applyDoctorId; + /** + * 申请医生名称 + */ + private String applyDoctorName; + /** + * 手术类型 + */ + private Integer surgeryType; + /** + * 主刀医生ID + */ + private String mainSurgeonId; + /** + * 主刀医生名称 + */ + private String mainSurgeonName; + /** + * 手术类型 + */ + private String surgeryTypeEnum; + /** + * 申请时间 + */ + private String applyTime; +} diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/mapper/RequestFormManageAppMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/mapper/RequestFormManageAppMapper.java index 87a374ae..b879416f 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/mapper/RequestFormManageAppMapper.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/regdoctorstation/mapper/RequestFormManageAppMapper.java @@ -1,7 +1,12 @@ package com.openhis.web.regdoctorstation.mapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.openhis.document.domain.RequestForm; import com.openhis.web.regdoctorstation.dto.ActivityOrganizationConfigDto; import com.openhis.web.regdoctorstation.dto.RequestFormDetailQueryDto; +import com.openhis.web.regdoctorstation.dto.RequestFormDto; +import com.openhis.web.regdoctorstation.dto.RequestFormPageDto; import com.openhis.web.regdoctorstation.dto.RequestFormQueryDto; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; @@ -41,4 +46,12 @@ public interface RequestFormManageAppMapper { List getActivityOrganizationConfig(@Param("activityCategoryCode") String activityCategoryCode); + /** + * 获取申请单分页数据 + * + * @param requestFormDto 申请单参数 + * @return 申请单分页列表 + */ + IPage getRequestFormPage( + @Param("requestFormDto") RequestFormDto requestFormDto,@Param("page") IPage page); } diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/clinicalmanage/SurgeryMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/clinicalmanage/SurgeryMapper.xml index 0212b06f..ad978677 100644 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/clinicalmanage/SurgeryMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/clinicalmanage/SurgeryMapper.xml @@ -75,7 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" s.surgery_no, s.patient_id, p.name as patient_name, - CASE p.gender_enum WHEN 1 THEN '男' WHEN 2 THEN '女' ELSE '未知' END as patient_gender, + CASE p.gender_enum WHEN 0 THEN '男' WHEN 1 THEN '女' ELSE '未知' END as patient_gender, EXTRACT(YEAR FROM AGE(p.birth_date)) as patient_age, s.encounter_id, e.bus_no as encounter_no, @@ -194,7 +194,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" s.delete_flag = '0' - AND ${ew.sqlSegment.replace('tenant_id', 's.tenant_id').replace('create_time', 's.create_time').replace('surgery_no', 's.surgery_no').replace('surgery_name', 's.surgery_name').replace('patient_name', 'p.name').replace('main_surgeon_name', 's.main_surgeon_name').replace('anesthetist_name', 's.anesthetist_name').replace('org_name', 'o.name')} + diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/clinicalmanage/SurgicalScheduleAppMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/clinicalmanage/SurgicalScheduleAppMapper.xml new file mode 100644 index 00000000..adf68611 --- /dev/null +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/clinicalmanage/SurgicalScheduleAppMapper.xml @@ -0,0 +1,146 @@ + + + + + + + + + + insert into op_schedule(patient_id, doctor_id, schedule_time, schedule_status, create_time, update_time) + values(#{patientId}, #{doctorId}, #{scheduleTime}, #{scheduleStatus}, #{createTime}, #{updateTime}) + + + + update op_schedule set patient_id = #{patientId}, doctor_id = #{doctorId}, schedule_time = #{scheduleTime}, + schedule_status = #{scheduleStatus}, create_time = #{createTime}, update_time = #{updateTime} + where schedule_id = #{scheduleId} + + + + + + + diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/regdoctorstation/RequestFormManageAppMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/regdoctorstation/RequestFormManageAppMapper.xml index bf2d6768..1e981ba2 100644 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/regdoctorstation/RequestFormManageAppMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/regdoctorstation/RequestFormManageAppMapper.xml @@ -47,4 +47,62 @@ AND activity_category_code = #{activityCategoryCode} + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/surgicalschedule/domain/OpSchedule.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/surgicalschedule/domain/OpSchedule.java new file mode 100644 index 00000000..4f587d3c --- /dev/null +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/surgicalschedule/domain/OpSchedule.java @@ -0,0 +1,191 @@ +package com.openhis.surgicalschedule.domain; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.LocalDateTime; + +import com.baomidou.mybatisplus.annotation.*; + +import com.core.common.core.domain.HisBaseEntity; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import org.springframework.format.annotation.DateTimeFormat; + +/** + * 手术安排Entity实体 + * + * @author system + * @date 2026-01-28 + */ +@Data +@TableName("op_schedule") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +public class OpSchedule extends HisBaseEntity { + + /** 排程号(主键) */ + @TableId(type = IdType.ASSIGN_ID) + private Long scheduleId; + + /** 申请单ID */ + private Long applyId; + + /** 患者ID */ + private Long patientId; + + /** 就诊ID */ + private Long visitId; + + /** 手术编码 */ + private String operCode; + + /** 手术名称 */ + private String operName; + + /** 术前诊断 */ + private String preoperativeDiagnosis; + + /** 术后诊断 */ + private String postoperativeDiagnosis; + + /** 手术安排日期 */ + @DateTimeFormat(pattern = "yyyy-MM-dd") + private LocalDate scheduleDate; + + /** 手术台次序号 */ + private Integer sequenceNo; + + /** 是否首台手术 1-是 0-否 */ + private Integer isFirstSurgery; + + /** 是否有药物过敏 1-是 0-否 */ + private Integer isAllergyMedication; + + /** 过敏备注 */ + private String allergyRemark; + + /** 手术性质 */ + private String surgeryNature; + + /** 手术部位 */ + private String surgerySite; + + /** 入院时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime admissionTime; + + /** 入手术室时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime entryTime; + + /** 手术室编码 */ + private String roomCode; + + /** 手术台号 */ + private String tableNo; + + /** 麻醉方式 */ + private String anesMethod; + + /** 麻醉医生1编码 */ + private String anesDoctor1Code; + + /** 麻醉医生2编码 */ + private String anesDoctor2Code; + + /** 麻醉医生3编码 */ + private String anesDoctor3Code; + + /** 洗手护士编码 */ + private String scrubNurseCode; + + /** 巡回护士1编码 */ + private String circuNurse1Code; + + /** 巡回护士2编码 */ + private String circuNurse2Code; + + /** 器械护士1编码 */ + private String scrubNurse1Code; + + /** 器械护士2编码 */ + private String scrubNurse2Code; + + /** 主刀医生编码 */ + private String surgeonCode; + + /** 助手1编码 */ + private String assistant1Code; + + /** 助手2编码 */ + private String assistant2Code; + + /** 助手3编码 */ + private String assistant3Code; + + /** 手术开始时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime startTime; + + /** 手术结束时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime endTime; + + /** 麻醉开始时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime anesStart; + + /** 麻醉结束时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime anesEnd; + + /** 手术状态 */ + private Integer operStatus; + + /** 是否植入耗材 1-是 0-否 */ + private Integer implantFlag; + + /** 植入物序列号 */ + private String implantSerial; + + /** 失血量(ml) */ + private Integer bloodLoss; + + /** 输血量(ml) */ + private Integer bloodTrans; + + /** 感染诊断 */ + private String infectionDiagnosis; + + /** 隔离类型 */ + private String isolationType; + + /** 患者体重(kg) */ + private BigDecimal patientWeight; + + /** 患者身高(cm) */ + private BigDecimal patientHeight; + + /** 沟通信息 */ + private String communicationInfo; + + /** 备注信息 */ + private String remark; + + /** + * 创建人id + */ + private Long creatorId; + + /** + * 更新人id + */ + private Long updaterId; + /** + * 租户id + */ + private Integer tenantId; + +} \ No newline at end of file diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/surgicalschedule/mapper/OpScheduleMapper.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/surgicalschedule/mapper/OpScheduleMapper.java new file mode 100644 index 00000000..4e52e178 --- /dev/null +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/surgicalschedule/mapper/OpScheduleMapper.java @@ -0,0 +1,18 @@ +package com.openhis.surgicalschedule.mapper; + +import com.openhis.surgicalschedule.domain.OpSchedule; +import org.springframework.stereotype.Repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + + +/** + * 手术安排Mapper接口 + * + * @author system + * @date 2026-01-28 + */ +@Repository +public interface OpScheduleMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/surgicalschedule/service/IOpScheduleService.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/surgicalschedule/service/IOpScheduleService.java new file mode 100644 index 00000000..62bb4d99 --- /dev/null +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/surgicalschedule/service/IOpScheduleService.java @@ -0,0 +1,14 @@ +package com.openhis.surgicalschedule.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.openhis.surgicalschedule.domain.OpSchedule; + +/** + * 手术安排Service接口 + * + * @author system + * @date 2026-01-28 + */ +public interface IOpScheduleService extends IService { + +} \ No newline at end of file diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/surgicalschedule/service/impl/OpScheduleServiceImpl.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/surgicalschedule/service/impl/OpScheduleServiceImpl.java new file mode 100644 index 00000000..15aadab0 --- /dev/null +++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/surgicalschedule/service/impl/OpScheduleServiceImpl.java @@ -0,0 +1,18 @@ +package com.openhis.surgicalschedule.service.impl; + +import com.openhis.surgicalschedule.domain.OpSchedule; +import com.openhis.surgicalschedule.mapper.OpScheduleMapper; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.openhis.surgicalschedule.service.IOpScheduleService; + +/** + * 手术安排Service业务层处理 + * + * @author system + * @date 2026-01-28 + */ +@Service +public class OpScheduleServiceImpl extends ServiceImpl implements IOpScheduleService { + +} \ No newline at end of file diff --git a/openhis-ui-vue3/package-lock.json b/openhis-ui-vue3/package-lock.json index db9d77ff..027c17a8 100644 --- a/openhis-ui-vue3/package-lock.json +++ b/openhis-ui-vue3/package-lock.json @@ -25,6 +25,7 @@ "html2pdf.js": "^0.10.3", "js-cookie": "^3.0.5", "jsencrypt": "^3.3.2", + "json-bigint": "^1.0.0", "lodash": "^4.17.21", "lodash-es": "^4.17.21", "moment": "^2.30.1", @@ -2419,6 +2420,15 @@ "node": "*" } }, + "node_modules/bignumber.js": { + "version": "9.3.1", + "resolved": "https://registry.npmmirror.com/bignumber.js/-/bignumber.js-9.3.1.tgz", + "integrity": "sha512-Ko0uX15oIUS7wJ3Rb30Fs6SkVbLmPBAKdlm7q9+ak9bbIeFf0MwuBsQV6z7+X768/cHsfg+WlysDWJcmthjsjQ==", + "license": "MIT", + "engines": { + "node": "*" + } + }, "node_modules/binary-extensions": { "version": "2.3.0", "resolved": "https://registry.npmmirror.com/binary-extensions/-/binary-extensions-2.3.0.tgz", @@ -5456,6 +5466,15 @@ "integrity": "sha512-arQR1R1ESGdAxY7ZheWr12wCaF2yF47v5qpB76TtV64H1pyGudk9Hvw8Y9tb/FiTIaaTRUyaSnm5T/Y53Ghm/A==", "license": "MIT" }, + "node_modules/json-bigint": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/json-bigint/-/json-bigint-1.0.0.tgz", + "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", + "license": "MIT", + "dependencies": { + "bignumber.js": "^9.0.0" + } + }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmmirror.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", diff --git a/openhis-ui-vue3/package.json b/openhis-ui-vue3/package.json index f4b93127..eade869e 100644 --- a/openhis-ui-vue3/package.json +++ b/openhis-ui-vue3/package.json @@ -35,6 +35,7 @@ "html2pdf.js": "^0.10.3", "js-cookie": "^3.0.5", "jsencrypt": "^3.3.2", + "json-bigint": "^1.0.0", "lodash": "^4.17.21", "lodash-es": "^4.17.21", "moment": "^2.30.1", diff --git a/openhis-ui-vue3/src/api/surgicalschedule.js b/openhis-ui-vue3/src/api/surgicalschedule.js new file mode 100644 index 00000000..8616869c --- /dev/null +++ b/openhis-ui-vue3/src/api/surgicalschedule.js @@ -0,0 +1,62 @@ +import request from '@/utils/request' + +// 查询手术安排列表 +export function getSurgerySchedulePage(query) { + return request({ + url: '/clinical-manage/surgery-schedule/page', + method: 'get', + params: query + }) +} + +// 查询手术安排详情 +export function getSurgeryScheduleDetail(scheduleId) { + return request({ + url: `/clinical-manage/surgery-schedule/${scheduleId}`, + method: 'get' + }) +} + +// 新增手术安排 +export function addSurgerySchedule(data) { + return request({ + url: '/clinical-manage/surgery-schedule/create', + method: 'post', + data: data + }) +} + +// 修改手术安排 +export function updateSurgerySchedule(data) { + return request({ + url: '/clinical-manage/surgery-schedule/update', + method: 'put', + data: data + }) +} + +// 删除手术安排 +export function deleteSurgerySchedule(scheduleId) { + return request({ + url: `/clinical-manage/surgery-schedule/${scheduleId}`, + method: 'delete' + }) +} + +// 查询手术申请列表 +export function getSurgeryApplyList(query) { + return request({ + url: '/clinical-manage/surgery-schedule/apply-list', + method: 'post', + data: query + }) +} + +// 导出手术安排列表 +export function exportSurgerySchedule(query) { + return request({ + url: '/clinical-manage/surgery-schedule/export', + method: 'get', + params: query + }) +} \ No newline at end of file diff --git a/openhis-ui-vue3/src/utils/request.js b/openhis-ui-vue3/src/utils/request.js index a281a32c..a3a3aa18 100644 --- a/openhis-ui-vue3/src/utils/request.js +++ b/openhis-ui-vue3/src/utils/request.js @@ -6,6 +6,10 @@ import {blobValidate, tansParams} from '@/utils/openhis' import cache from '@/plugins/cache' import {saveAs} from 'file-saver' import useUserStore from '@/store/modules/user' +import JSONBig from 'json-bigint' + +// 初始化json-bigint,配置大数字转字符串(关键:storeAsString: true) +const jsonBig = JSONBig({ storeAsString: true }) let downloadLoadingInstance; // 是否显示重新登录 @@ -17,10 +21,26 @@ axios.defaults.headers['X-Tenant-ID'] = import.meta.env.VITE_APP_TENANT_ID || '1 axios.defaults.headers['Request-Method-Name'] = 'login' // 创建axios实例 const service = axios.create({ - // axios中请求配置有baseURL选项,表示请求URL公共部分 baseURL: import.meta.env.VITE_APP_BASE_API, - // 超时 - timeout: 60000 + timeout: 60000, + // 新增:重写响应解析逻辑,大数字自动转字符串(移到这里!) + transformResponse: [ + function (data) { + if (!data) return {} // 空数据直接返回,避免解析报错 + try { + return jsonBig.parse(data) + } catch (err) { + // 解析失败时用默认方式,兼容特殊情况 + return JSON.parse(data) + } + } + ], + // 可选:请求体序列化,无需额外处理,默认即可(保留也不影响) + transformRequest: [ + function (data) { + return JSON.stringify(data) + } + ] }) // request拦截器 diff --git a/openhis-ui-vue3/src/views/doctorstation/components/surgery/surgeryApplication.vue b/openhis-ui-vue3/src/views/doctorstation/components/surgery/surgeryApplication.vue index af818826..c95c5ef6 100644 --- a/openhis-ui-vue3/src/views/doctorstation/components/surgery/surgeryApplication.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/surgery/surgeryApplication.vue @@ -18,7 +18,7 @@ v-loading="loading" :data="surgeryList" border - row-key="id" + row-key="surgeryNo" :row-class-name="getRowClassName" height="calc(100vh - 250px)" style="width: 100%" @@ -758,7 +758,7 @@ function handleEdit(row) { loadDoctorList() } - getSurgeryDetail(row.id).then(res => { + getSurgeryDetail(row.surgeryNo).then(res => { if (res.code === 200) { console.log('【编辑手术】完整返回数据:', res.data) console.log('【编辑手术】手术指征字段值:', res.data.surgeryIndication) @@ -796,7 +796,7 @@ function handleEdit(row) { // 查看 function handleView(row) { viewOpen.value = true - getSurgeryDetail(row.id).then(res => { + getSurgeryDetail(row.surgeryNo).then(res => { if (res.code === 200) { console.log('【手术详情】完整返回数据:', res.data) console.log('【手术详情】手术指征字段值:', res.data.surgeryIndication) @@ -822,7 +822,7 @@ function handleDelete(row) { if (row.statusEnum === 0) { // 新开状态 - 直接删除 proxy.$modal.confirm('是否确认删除手术"' + row.surgeryName + '"?').then(() => { - return deleteSurgery(row.id) + return deleteSurgery(row.surgeryNo) }).then(() => { getList() proxy.$modal.msgSuccess('删除成功') @@ -833,7 +833,7 @@ function handleDelete(row) { } else if (row.statusEnum === 1) { // 已安排状态 - 更新为已取消 proxy.$modal.confirm('是否确认取消手术"' + row.surgeryName + '"?').then(() => { - return updateSurgeryStatus(row.id, 4) // 4 = 已取消 + return updateSurgeryStatus(row.surgeryNo, 4) // 4 = 已取消 }).then(() => { getList() proxy.$modal.msgSuccess('手术已取消') diff --git a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/applicationShow/api.js b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/applicationShow/api.js index acd2719b..16a0ef86 100644 --- a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/applicationShow/api.js +++ b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/applicationShow/api.js @@ -106,3 +106,17 @@ export function getTestResult(queryParams) { params: queryParams, }); } + +/** + * 分页查询检查报告 + */ +/** + * 分页查询检查报告 + */ +export function getTestResultPage(queryParams) { + return request({ + url: '/reg-doctorstation/request-form/get-page', + method: 'POST', + data: queryParams, + }); +} diff --git a/openhis-ui-vue3/src/views/surgerymanage/index.vue b/openhis-ui-vue3/src/views/surgerymanage/index.vue index bcbbaecf..8b386ac9 100644 --- a/openhis-ui-vue3/src/views/surgerymanage/index.vue +++ b/openhis-ui-vue3/src/views/surgerymanage/index.vue @@ -705,7 +705,13 @@ function getList() { } function getPageList() { - queryParams.value.pageNo = 1 + getList() +} + +// 处理分页参数 +function handlePagination(pagination) { + queryParams.value.pageNo = pagination.page + queryParams.value.pageSize = pagination.limit getList() } diff --git a/openhis-ui-vue3/src/views/surgicalschedule/index.vue b/openhis-ui-vue3/src/views/surgicalschedule/index.vue new file mode 100644 index 00000000..4e73b558 --- /dev/null +++ b/openhis-ui-vue3/src/views/surgicalschedule/index.vue @@ -0,0 +1,1505 @@ + + + + + \ No newline at end of file