完成93需求
This commit is contained in:
@@ -21,9 +21,11 @@ public interface ISurgeryAppService {
|
||||
* @param surgeryDto 查询条件
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页条数
|
||||
* @param plannedTimeStart 计划开始时间
|
||||
* @param plannedTimeEnd 计划结束时间
|
||||
* @return 手术列表
|
||||
*/
|
||||
IPage<SurgeryDto> getSurgeryPage(SurgeryDto surgeryDto, Integer pageNo, Integer pageSize);
|
||||
IPage<SurgeryDto> getSurgeryPage(SurgeryDto surgeryDto, Integer pageNo, Integer pageSize, String plannedTimeStart, String plannedTimeEnd);
|
||||
|
||||
/**
|
||||
* 根据ID查询手术详情
|
||||
|
||||
@@ -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<OpScheduleDto> getSurgerySchedulePage(OpScheduleDto opScheduleDto, Integer pageNo, Integer pageSize);
|
||||
|
||||
/**
|
||||
* 根据ID查询手术安排详情
|
||||
*
|
||||
* @param scheduleId 手术安排ID
|
||||
* @return 手术安排详情
|
||||
*/
|
||||
R<OpScheduleDto> 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;
|
||||
}
|
||||
@@ -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<SurgeryDto> getSurgeryPage(SurgeryDto surgeryDto, Integer pageNo, Integer pageSize) {
|
||||
public IPage<SurgeryDto> getSurgeryPage(SurgeryDto surgeryDto, Integer pageNo, Integer pageSize, String plannedTimeStart, String plannedTimeEnd) {
|
||||
QueryWrapper<SurgeryDto> queryWrapper = HisQueryUtils.buildQueryWrapper(surgeryDto, null,
|
||||
new HashSet<String>() {{
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -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<OpScheduleDto> getSurgerySchedulePage(OpScheduleDto opScheduleDto, Integer pageNo, Integer pageSize) {
|
||||
return surgicalScheduleAppMapper.getSurgerySchedulePage(new Page<>(pageNo, pageSize), opScheduleDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID查询手术安排详情
|
||||
*
|
||||
* @param scheduleId 手术安排ID
|
||||
* @return 手术安排详情
|
||||
*/
|
||||
@Override
|
||||
public R<OpScheduleDto> 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<OpScheduleDto> 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"));
|
||||
}
|
||||
}
|
||||
@@ -31,13 +31,18 @@ public class SurgeryController {
|
||||
* @param surgeryDto 查询条件
|
||||
* @param pageNo 当前页
|
||||
* @param pageSize 每页条数
|
||||
* @param plannedTimeStart 计划开始时间
|
||||
* @param plannedTimeEnd 计划结束时间
|
||||
* @return 手术列表
|
||||
*/
|
||||
@GetMapping(value = "/surgery-page")
|
||||
public R<IPage<SurgeryDto>> getSurgeryPage(SurgeryDto surgeryDto,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
IPage<SurgeryDto> 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<SurgeryDto> page = surgeryAppService.getSurgeryPage(surgeryDto, pageNo, pageSize, plannedTimeStart, plannedTimeEnd);
|
||||
return R.ok(page);
|
||||
}
|
||||
|
||||
|
||||
@@ -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<IPage<OpScheduleDto>> getSurgerySchedulePage(OpScheduleDto opScheduleDto,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
IPage<OpScheduleDto> page = surgicalScheduleAppService.getSurgerySchedulePage(opScheduleDto, pageNo, pageSize);
|
||||
return R.ok(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID查询手术安排详情
|
||||
*
|
||||
* @param scheduleId 手术安排ID
|
||||
* @return 手术安排详情
|
||||
*/
|
||||
@GetMapping(value = "/{scheduleId}")
|
||||
public R<OpScheduleDto> 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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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<SurgeryDto> {
|
||||
|
||||
/**
|
||||
* 分页查询手术列表
|
||||
|
||||
@@ -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<OpScheduleDto> getSurgerySchedulePage(Page<OpScheduleDto> 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<OpScheduleDto> getSurgeryScheduleList(@Param("dto") OpScheduleDto opScheduleDto);
|
||||
|
||||
/**
|
||||
* 查询手术间在该时段是否被占用
|
||||
*
|
||||
* @param startTime 手术开始时间
|
||||
* @param endTime 手术结束时间
|
||||
* @param surgeryRoomId 手术间ID
|
||||
* @return 是否存在冲突的手术安排
|
||||
*/
|
||||
Boolean isScheduleConflict(LocalDateTime startTime, LocalDateTime endTime, String surgeryRoomId);
|
||||
}
|
||||
@@ -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<RequestFormQueryDto> getRequestForm(Long encounterId, String typeCode);
|
||||
|
||||
/**
|
||||
* 分页查询申请单
|
||||
*
|
||||
* @param requestFormDto 查询条件
|
||||
* @return 申请单
|
||||
*/
|
||||
IPage<RequestFormPageDto> getRequestFormPage(RequestFormDto requestFormDto);
|
||||
}
|
||||
|
||||
@@ -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<RequestFormPageDto> getRequestFormPage(RequestFormDto requestFormDto) {
|
||||
Page<RequestFormPageDto> page = new Page<>(requestFormDto.getPageNo(), requestFormDto.getPageSize());
|
||||
return requestFormManageAppMapper.getRequestFormPage(requestFormDto, page);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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<IPage<RequestFormPageDto>> getRequestFormPage(@RequestBody RequestFormDto requestFormDto) {
|
||||
return R.ok(iRequestFormManageAppService.getRequestFormPage(requestFormDto));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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<String,Object> 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;
|
||||
}
|
||||
@@ -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<ActivityOrganizationConfigDto>
|
||||
getActivityOrganizationConfig(@Param("activityCategoryCode") String activityCategoryCode);
|
||||
|
||||
/**
|
||||
* 获取申请单分页数据
|
||||
*
|
||||
* @param requestFormDto 申请单参数
|
||||
* @return 申请单分页列表
|
||||
*/
|
||||
IPage<RequestFormPageDto> getRequestFormPage(
|
||||
@Param("requestFormDto") RequestFormDto requestFormDto,@Param("page") IPage<RequestFormPageDto> page);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user