feat(card): 新增传染病报卡管理系统
- 实现报卡管理服务接口和具体实现类 - 添加报卡统计、分页查询、详情查看功能 - 实现批量审核、批量退回、单条审核功能 - 添加审核记录查询和科室树获取功能 - 实现报卡数据导出Excel功能 - 创建报卡查询参数和统计数据显示对象 - 添加审核记录、传染病卡片等数据传输对象 - 实现报卡和审核记录的数据访问层 - 定义传染病卡片和审核记录领域实体模型 - 提供REST API控制器接口供前端调用
This commit is contained in:
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Copyright ©2026 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.cardmanagement.appservice;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.cardmanagement.dto.*;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 报卡管理 Service接口
|
||||
*
|
||||
* @author system
|
||||
* @date 2026-03-05
|
||||
*/
|
||||
public interface ICardManageAppService {
|
||||
|
||||
/**
|
||||
* 获取统计数据
|
||||
*
|
||||
* @return 统计数据
|
||||
*/
|
||||
CardStatisticsDto getStatistics();
|
||||
|
||||
/**
|
||||
* 分页查询报卡列表
|
||||
*
|
||||
* @param queryParams 查询参数
|
||||
* @return 分页数据
|
||||
*/
|
||||
R<?> getCardPage(CardQueryDto queryParams);
|
||||
|
||||
/**
|
||||
* 获取报卡详情
|
||||
*
|
||||
* @param cardNo 卡片编号
|
||||
* @return 报卡详情
|
||||
*/
|
||||
InfectiousCardDto getCardDetail(String cardNo);
|
||||
|
||||
/**
|
||||
* 获取审核记录
|
||||
*
|
||||
* @param cardNo 卡片编号
|
||||
* @return 审核记录列表
|
||||
*/
|
||||
List<AuditRecordDto> getAuditRecords(String cardNo);
|
||||
|
||||
/**
|
||||
* 批量审核
|
||||
*
|
||||
* @param batchAuditDto 批量审核参数
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> batchAudit(BatchAuditDto batchAuditDto);
|
||||
|
||||
/**
|
||||
* 批量退回
|
||||
*
|
||||
* @param batchReturnDto 批量退回参数
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> batchReturn(BatchReturnDto batchReturnDto);
|
||||
|
||||
/**
|
||||
* 单条审核通过
|
||||
*
|
||||
* @param auditDto 审核参数
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> auditPass(SingleAuditDto auditDto);
|
||||
|
||||
/**
|
||||
* 单条退回
|
||||
*
|
||||
* @param returnDto 退回参数
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> auditReturn(SingleReturnDto returnDto);
|
||||
|
||||
/**
|
||||
* 导出报卡列表
|
||||
*
|
||||
* @param queryParams 查询参数
|
||||
* @param response 响应
|
||||
*/
|
||||
void exportCards(CardQueryDto queryParams, HttpServletResponse response);
|
||||
|
||||
/**
|
||||
* 获取科室树
|
||||
*
|
||||
* @return 科室树数据
|
||||
*/
|
||||
R<?> getDeptTree();
|
||||
}
|
||||
@@ -0,0 +1,366 @@
|
||||
/*
|
||||
* Copyright ©2026 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.cardmanagement.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.utils.SecurityUtils;
|
||||
import com.openhis.infectious.domain.InfectiousAudit;
|
||||
import com.openhis.infectious.domain.InfectiousCard;
|
||||
import com.openhis.web.cardmanagement.appservice.ICardManageAppService;
|
||||
import com.openhis.web.cardmanagement.dto.*;
|
||||
import com.openhis.web.cardmanagement.mapper.InfectiousAuditMapper;
|
||||
import com.openhis.web.cardmanagement.mapper.InfectiousCardMapper;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 报卡管理 Service实现
|
||||
*
|
||||
* @author system
|
||||
* @date 2026-03-05
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class CardManageAppServiceImpl implements ICardManageAppService {
|
||||
|
||||
private final InfectiousCardMapper infectiousCardMapper;
|
||||
private final InfectiousAuditMapper infectiousAuditMapper;
|
||||
|
||||
@Override
|
||||
public CardStatisticsDto getStatistics() {
|
||||
CardStatisticsDto dto = new CardStatisticsDto();
|
||||
dto.setTodayPending(infectiousCardMapper.countTodayPending());
|
||||
dto.setMonthFailed(infectiousCardMapper.countMonthFailed());
|
||||
dto.setMonthSuccess(infectiousCardMapper.countMonthSuccess());
|
||||
dto.setMonthReported(infectiousCardMapper.countMonthReported());
|
||||
return dto;
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> getCardPage(CardQueryDto queryParams) {
|
||||
Page<InfectiousCard> page = new Page<>(queryParams.getPageNo(), queryParams.getPageSize());
|
||||
LambdaQueryWrapper<InfectiousCard> wrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
// 登记来源
|
||||
if (queryParams.getRegistrationSource() != null) {
|
||||
wrapper.eq(InfectiousCard::getRegistrationSource, queryParams.getRegistrationSource());
|
||||
}
|
||||
|
||||
// 状态
|
||||
if (StringUtils.hasText(queryParams.getStatus())) {
|
||||
wrapper.eq(InfectiousCard::getStatus, queryParams.getStatus());
|
||||
}
|
||||
|
||||
// 患者姓名模糊查询
|
||||
if (StringUtils.hasText(queryParams.getPatientName())) {
|
||||
wrapper.like(InfectiousCard::getPatName, queryParams.getPatientName());
|
||||
}
|
||||
|
||||
// 科室
|
||||
if (queryParams.getDeptId() != null) {
|
||||
wrapper.eq(InfectiousCard::getDeptId, queryParams.getDeptId());
|
||||
}
|
||||
|
||||
// 时间范围
|
||||
if (StringUtils.hasText(queryParams.getStartDate())) {
|
||||
wrapper.ge(InfectiousCard::getCreateTime, queryParams.getStartDate() + " 00:00:00");
|
||||
}
|
||||
if (StringUtils.hasText(queryParams.getEndDate())) {
|
||||
wrapper.le(InfectiousCard::getCreateTime, queryParams.getEndDate() + " 23:59:59");
|
||||
}
|
||||
|
||||
// 按创建时间倒序
|
||||
wrapper.orderByDesc(InfectiousCard::getCreateTime);
|
||||
|
||||
IPage<InfectiousCard> result = infectiousCardMapper.selectPage(page, wrapper);
|
||||
|
||||
// 转换为DTO
|
||||
List<InfectiousCardDto> list = result.getRecords().stream().map(this::convertToDto).collect(Collectors.toList());
|
||||
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
resultMap.put("list", list);
|
||||
resultMap.put("total", result.getTotal());
|
||||
return R.ok(resultMap);
|
||||
}
|
||||
|
||||
@Override
|
||||
public InfectiousCardDto getCardDetail(String cardNo) {
|
||||
InfectiousCard card = infectiousCardMapper.selectByCardNo(cardNo);
|
||||
if (card == null) {
|
||||
return null;
|
||||
}
|
||||
return convertToDto(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AuditRecordDto> getAuditRecords(String cardNo) {
|
||||
InfectiousCard card = infectiousCardMapper.selectByCardNo(cardNo);
|
||||
if (card == null) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<InfectiousAudit> records = infectiousAuditMapper.selectByCardId(card.getId());
|
||||
return records.stream().map(this::convertAuditToDto).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public R<?> batchAudit(BatchAuditDto batchAuditDto) {
|
||||
if (batchAuditDto.getCardNos() == null || batchAuditDto.getCardNos().isEmpty()) {
|
||||
return R.fail("请选择要审核的报卡");
|
||||
}
|
||||
|
||||
String auditorId = SecurityUtils.getUserId().toString();
|
||||
String auditorName = SecurityUtils.getUsername();
|
||||
|
||||
int successCount = 0;
|
||||
for (String cardNo : batchAuditDto.getCardNos()) {
|
||||
InfectiousCard card = infectiousCardMapper.selectByCardNo(cardNo);
|
||||
if (card == null) continue;
|
||||
if ("2".equals(card.getStatus()) || "3".equals(card.getStatus())) continue;
|
||||
|
||||
// 更新状态为已审核
|
||||
String oldStatus = card.getStatus();
|
||||
card.setStatus("2");
|
||||
card.setUpdateTime(new Date());
|
||||
infectiousCardMapper.updateById(card);
|
||||
|
||||
// 创建审核记录
|
||||
createAuditRecord(card.getId(), oldStatus, "2", "1", batchAuditDto.getAuditOpinion(),
|
||||
null, auditorId, auditorName, true, batchAuditDto.getCardNos().size());
|
||||
successCount++;
|
||||
}
|
||||
|
||||
return R.ok("批量审核成功,共审核" + successCount + "条");
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public R<?> batchReturn(BatchReturnDto batchReturnDto) {
|
||||
if (batchReturnDto.getCardNos() == null || batchReturnDto.getCardNos().isEmpty()) {
|
||||
return R.fail("请选择要退回的报卡");
|
||||
}
|
||||
|
||||
String auditorId = SecurityUtils.getUserId().toString();
|
||||
String auditorName = SecurityUtils.getUsername();
|
||||
|
||||
int successCount = 0;
|
||||
for (String cardNo : batchReturnDto.getCardNos()) {
|
||||
InfectiousCard card = infectiousCardMapper.selectByCardNo(cardNo);
|
||||
if (card == null) continue;
|
||||
if ("2".equals(card.getStatus()) || "3".equals(card.getStatus())) continue;
|
||||
|
||||
// 更新状态为退回(审核失败)
|
||||
String oldStatus = card.getStatus();
|
||||
card.setStatus("5");
|
||||
card.setReturnReason(batchReturnDto.getReturnReason());
|
||||
card.setUpdateTime(new Date());
|
||||
infectiousCardMapper.updateById(card);
|
||||
|
||||
// 创建审核记录
|
||||
createAuditRecord(card.getId(), oldStatus, "5", "3", null,
|
||||
batchReturnDto.getReturnReason(), auditorId, auditorName, true, batchReturnDto.getCardNos().size());
|
||||
successCount++;
|
||||
}
|
||||
|
||||
return R.ok("批量退回成功,共退回" + successCount + "条");
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public R<?> auditPass(SingleAuditDto auditDto) {
|
||||
InfectiousCard card = infectiousCardMapper.selectByCardNo(auditDto.getCardNo());
|
||||
if (card == null) {
|
||||
return R.fail("报卡不存在");
|
||||
}
|
||||
|
||||
String auditorId = SecurityUtils.getUserId().toString();
|
||||
String auditorName = SecurityUtils.getUsername();
|
||||
|
||||
// 更新状态
|
||||
String oldStatus = card.getStatus();
|
||||
card.setStatus("2");
|
||||
card.setUpdateTime(new Date());
|
||||
infectiousCardMapper.updateById(card);
|
||||
|
||||
// 创建审核记录
|
||||
createAuditRecord(card.getId(), oldStatus, "2", "2", auditDto.getAuditOpinion(),
|
||||
null, auditorId, auditorName, false, 1);
|
||||
|
||||
return R.ok("审核通过");
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public R<?> auditReturn(SingleReturnDto returnDto) {
|
||||
InfectiousCard card = infectiousCardMapper.selectByCardNo(returnDto.getCardNo());
|
||||
if (card == null) {
|
||||
return R.fail("报卡不存在");
|
||||
}
|
||||
|
||||
String auditorId = SecurityUtils.getUserId().toString();
|
||||
String auditorName = SecurityUtils.getUsername();
|
||||
|
||||
// 更新状态
|
||||
String oldStatus = card.getStatus();
|
||||
card.setStatus("5");
|
||||
card.setReturnReason(returnDto.getReturnReason());
|
||||
card.setUpdateTime(new Date());
|
||||
infectiousCardMapper.updateById(card);
|
||||
|
||||
// 创建审核记录
|
||||
createAuditRecord(card.getId(), oldStatus, "5", "4", null,
|
||||
returnDto.getReturnReason(), auditorId, auditorName, false, 1);
|
||||
|
||||
return R.ok("已退回");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportCards(CardQueryDto queryParams, HttpServletResponse response) {
|
||||
LambdaQueryWrapper<InfectiousCard> wrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
// 应用查询条件
|
||||
if (queryParams.getRegistrationSource() != null) {
|
||||
wrapper.eq(InfectiousCard::getRegistrationSource, queryParams.getRegistrationSource());
|
||||
}
|
||||
if (StringUtils.hasText(queryParams.getStatus())) {
|
||||
wrapper.eq(InfectiousCard::getStatus, queryParams.getStatus());
|
||||
}
|
||||
if (StringUtils.hasText(queryParams.getPatientName())) {
|
||||
wrapper.like(InfectiousCard::getPatName, queryParams.getPatientName());
|
||||
}
|
||||
if (queryParams.getDeptId() != null) {
|
||||
wrapper.eq(InfectiousCard::getDeptId, queryParams.getDeptId());
|
||||
}
|
||||
if (StringUtils.hasText(queryParams.getStartDate())) {
|
||||
wrapper.ge(InfectiousCard::getCreateTime, queryParams.getStartDate() + " 00:00:00");
|
||||
}
|
||||
if (StringUtils.hasText(queryParams.getEndDate())) {
|
||||
wrapper.le(InfectiousCard::getCreateTime, queryParams.getEndDate() + " 23:59:59");
|
||||
}
|
||||
wrapper.orderByDesc(InfectiousCard::getCreateTime);
|
||||
|
||||
List<InfectiousCard> cards = infectiousCardMapper.selectList(wrapper);
|
||||
|
||||
try (Workbook workbook = new XSSFWorkbook()) {
|
||||
Sheet sheet = workbook.createSheet("报卡列表");
|
||||
|
||||
// 创建表头
|
||||
Row headerRow = sheet.createRow(0);
|
||||
String[] headers = {"报卡编号", "患者姓名", "性别", "年龄", "疾病名称", "科室", "上报时间", "状态"};
|
||||
for (int i = 0; i < headers.length; i++) {
|
||||
Cell cell = headerRow.createCell(i);
|
||||
cell.setCellValue(headers[i]);
|
||||
}
|
||||
|
||||
// 填充数据
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
for (int i = 0; i < cards.size(); i++) {
|
||||
InfectiousCard card = cards.get(i);
|
||||
Row row = sheet.createRow(i + 1);
|
||||
row.createCell(0).setCellValue(card.getCardNo());
|
||||
row.createCell(1).setCellValue(card.getPatName());
|
||||
row.createCell(2).setCellValue("1".equals(card.getSex()) ? "男" : "2".equals(card.getSex()) ? "女" : "未知");
|
||||
row.createCell(3).setCellValue(card.getAge() != null ? card.getAge() + "岁" : "");
|
||||
row.createCell(4).setCellValue(card.getDiseaseName());
|
||||
row.createCell(5).setCellValue(card.getDeptName());
|
||||
row.createCell(6).setCellValue(card.getCreateTime() != null ? dateFormat.format(card.getCreateTime()) : "");
|
||||
row.createCell(7).setCellValue(getStatusText(card.getStatus()));
|
||||
}
|
||||
|
||||
// 设置响应头
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" +
|
||||
URLEncoder.encode("报卡列表.xlsx", StandardCharsets.UTF_8));
|
||||
workbook.write(response.getOutputStream());
|
||||
} catch (IOException e) {
|
||||
log.error("导出报卡列表失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> getDeptTree() {
|
||||
// 返回科室树数据,实际应从科室服务获取
|
||||
return R.ok(new ArrayList<>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换为DTO
|
||||
*/
|
||||
private InfectiousCardDto convertToDto(InfectiousCard card) {
|
||||
InfectiousCardDto dto = new InfectiousCardDto();
|
||||
BeanUtils.copyProperties(card, dto);
|
||||
return dto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换审核记录为DTO
|
||||
*/
|
||||
private AuditRecordDto convertAuditToDto(InfectiousAudit audit) {
|
||||
AuditRecordDto dto = new AuditRecordDto();
|
||||
BeanUtils.copyProperties(audit, dto);
|
||||
dto.setCardId(audit.getCardId() != null ? audit.getCardId().toString() : null);
|
||||
return dto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建审核记录
|
||||
*/
|
||||
private void createAuditRecord(Long cardId, String statusFrom, String statusTo, String auditType,
|
||||
String auditOpinion, String returnReason, String auditorId, String auditorName,
|
||||
Boolean isBatch, Integer batchSize) {
|
||||
InfectiousAudit audit = new InfectiousAudit();
|
||||
audit.setCardId(cardId);
|
||||
audit.setAuditSeq(infectiousAuditMapper.getNextAuditSeq(cardId));
|
||||
audit.setAuditType(auditType);
|
||||
audit.setAuditStatusFrom(statusFrom);
|
||||
audit.setAuditStatusTo(statusTo);
|
||||
audit.setAuditTime(LocalDateTime.now());
|
||||
audit.setAuditorId(auditorId);
|
||||
audit.setAuditorName(auditorName);
|
||||
audit.setAuditOpinion(auditOpinion);
|
||||
audit.setReasonForReturn(returnReason);
|
||||
audit.setIsBatch(isBatch);
|
||||
audit.setBatchSize(batchSize);
|
||||
infectiousAuditMapper.insert(audit);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取状态文本
|
||||
*/
|
||||
private String getStatusText(String status) {
|
||||
switch (status) {
|
||||
case "0": return "暂存";
|
||||
case "1": return "待审核";
|
||||
case "2": return "审核通过";
|
||||
case "3": return "已上报";
|
||||
case "4": return "失败";
|
||||
case "5": return "审核失败";
|
||||
default: return "未知";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
/*
|
||||
* Copyright ©2026 CJB-CNIT Team. All rights reserved
|
||||
*/
|
||||
package com.openhis.web.cardmanagement.controller;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.cardmanagement.appservice.ICardManageAppService;
|
||||
import com.openhis.web.cardmanagement.dto.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 报卡管理 Controller
|
||||
*
|
||||
* @author system
|
||||
* @date 2026-03-05
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/card-management")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class CardManageController {
|
||||
|
||||
private final ICardManageAppService cardManageAppService;
|
||||
|
||||
/**
|
||||
* 获取统计数据
|
||||
*
|
||||
* @return 统计数据
|
||||
*/
|
||||
@GetMapping("/statistics")
|
||||
public R<CardStatisticsDto> getStatistics() {
|
||||
return R.ok(cardManageAppService.getStatistics());
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询报卡列表
|
||||
*
|
||||
* @param queryParams 查询参数
|
||||
* @return 分页数据
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public R<?> getCardPage(CardQueryDto queryParams) {
|
||||
return cardManageAppService.getCardPage(queryParams);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取报卡详情
|
||||
*
|
||||
* @param cardNo 卡片编号
|
||||
* @return 报卡详情
|
||||
*/
|
||||
@GetMapping("/detail/{cardNo}")
|
||||
public R<InfectiousCardDto> getCardDetail(@PathVariable String cardNo) {
|
||||
return R.ok(cardManageAppService.getCardDetail(cardNo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取审核记录
|
||||
*
|
||||
* @param cardNo 卡片编号
|
||||
* @return 审核记录列表
|
||||
*/
|
||||
@GetMapping("/audit-records/{cardNo}")
|
||||
public R<List<AuditRecordDto>> getAuditRecords(@PathVariable String cardNo) {
|
||||
return R.ok(cardManageAppService.getAuditRecords(cardNo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量审核
|
||||
*
|
||||
* @param batchAuditDto 批量审核参数
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping("/batch-audit")
|
||||
public R<?> batchAudit(@RequestBody BatchAuditDto batchAuditDto) {
|
||||
return cardManageAppService.batchAudit(batchAuditDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量退回
|
||||
*
|
||||
* @param batchReturnDto 批量退回参数
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping("/batch-return")
|
||||
public R<?> batchReturn(@RequestBody BatchReturnDto batchReturnDto) {
|
||||
return cardManageAppService.batchReturn(batchReturnDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 单条审核通过
|
||||
*
|
||||
* @param auditDto 审核参数
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping("/audit-pass")
|
||||
public R<?> auditPass(@RequestBody SingleAuditDto auditDto) {
|
||||
return cardManageAppService.auditPass(auditDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 单条退回
|
||||
*
|
||||
* @param returnDto 退回参数
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping("/audit-return")
|
||||
public R<?> auditReturn(@RequestBody SingleReturnDto returnDto) {
|
||||
return cardManageAppService.auditReturn(returnDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出报卡列表
|
||||
*
|
||||
* @param queryParams 查询参数
|
||||
* @param response 响应
|
||||
*/
|
||||
@GetMapping("/export")
|
||||
public void exportCards(CardQueryDto queryParams, HttpServletResponse response) {
|
||||
cardManageAppService.exportCards(queryParams, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取科室树
|
||||
*
|
||||
* @return 科室树数据
|
||||
*/
|
||||
@GetMapping("/dept-tree")
|
||||
public R<?> getDeptTree() {
|
||||
return cardManageAppService.getDeptTree();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.openhis.web.cardmanagement.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 审核记录DTO
|
||||
*
|
||||
* @author system
|
||||
* @date 2026-03-05
|
||||
*/
|
||||
@Data
|
||||
public class AuditRecordDto {
|
||||
|
||||
/** 审核记录ID */
|
||||
private Long auditId;
|
||||
|
||||
/** 报卡ID */
|
||||
private String cardId;
|
||||
|
||||
/** 审核序号 */
|
||||
private Integer auditSeq;
|
||||
|
||||
/** 审核类型 */
|
||||
private String auditType;
|
||||
|
||||
/** 审核前状态 */
|
||||
private String auditStatusFrom;
|
||||
|
||||
/** 审核后状态 */
|
||||
private String auditStatusTo;
|
||||
|
||||
/** 审核时间 */
|
||||
private LocalDateTime auditTime;
|
||||
|
||||
/** 审核人账号 */
|
||||
private String auditorId;
|
||||
|
||||
/** 审核人姓名 */
|
||||
private String auditorName;
|
||||
|
||||
/** 审核意见 */
|
||||
private String auditOpinion;
|
||||
|
||||
/** 退回原因 */
|
||||
private String reasonForReturn;
|
||||
|
||||
/** 是否批量 */
|
||||
private Boolean isBatch;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.openhis.web.cardmanagement.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 批量审核参数DTO
|
||||
*
|
||||
* @author system
|
||||
* @date 2026-03-05
|
||||
*/
|
||||
@Data
|
||||
public class BatchAuditDto {
|
||||
|
||||
/** 卡片编号列表 */
|
||||
private List<String> cardNos;
|
||||
|
||||
/** 审核意见 */
|
||||
private String auditOpinion;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.openhis.web.cardmanagement.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 批量退回参数DTO
|
||||
*
|
||||
* @author system
|
||||
* @date 2026-03-05
|
||||
*/
|
||||
@Data
|
||||
public class BatchReturnDto {
|
||||
|
||||
/** 卡片编号列表 */
|
||||
private List<String> cardNos;
|
||||
|
||||
/** 退回原因 */
|
||||
private String returnReason;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.openhis.web.cardmanagement.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 报卡查询参数DTO
|
||||
*
|
||||
* @author system
|
||||
* @date 2026-03-05
|
||||
*/
|
||||
@Data
|
||||
public class CardQueryDto {
|
||||
|
||||
/** 当前页 */
|
||||
private Integer pageNo = 1;
|
||||
|
||||
/** 每页条数 */
|
||||
private Integer pageSize = 10;
|
||||
|
||||
/** 登记来源 */
|
||||
private Integer registrationSource;
|
||||
|
||||
/** 开始日期 */
|
||||
private String startDate;
|
||||
|
||||
/** 结束日期 */
|
||||
private String endDate;
|
||||
|
||||
/** 患者姓名 */
|
||||
private String patientName;
|
||||
|
||||
/** 审核状态 */
|
||||
private String status;
|
||||
|
||||
/** 科室ID */
|
||||
private Long deptId;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.openhis.web.cardmanagement.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 报卡统计数据DTO
|
||||
*
|
||||
* @author system
|
||||
* @date 2026-03-05
|
||||
*/
|
||||
@Data
|
||||
public class CardStatisticsDto {
|
||||
|
||||
/** 今日待审核 */
|
||||
private Integer todayPending;
|
||||
|
||||
/** 本月审核失败 */
|
||||
private Integer monthFailed;
|
||||
|
||||
/** 本月审核成功 */
|
||||
private Integer monthSuccess;
|
||||
|
||||
/** 本月已上报 */
|
||||
private Integer monthReported;
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
package com.openhis.web.cardmanagement.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 传染病报卡详情DTO
|
||||
*
|
||||
* @author system
|
||||
* @date 2026-03-05
|
||||
*/
|
||||
@Data
|
||||
public class InfectiousCardDto {
|
||||
|
||||
/** 卡片编号 */
|
||||
private String cardNo;
|
||||
|
||||
/** 患者姓名 */
|
||||
private String patName;
|
||||
|
||||
/** 家长姓名 */
|
||||
private String parentName;
|
||||
|
||||
/** 证件号码 */
|
||||
private String idNo;
|
||||
|
||||
/** 性别(1男/2女/0未知) */
|
||||
private String sex;
|
||||
|
||||
/** 出生日期 */
|
||||
private LocalDate birthday;
|
||||
|
||||
/** 实足年龄 */
|
||||
private Integer age;
|
||||
|
||||
/** 年龄单位(1岁/2月/3天) */
|
||||
private String ageUnit;
|
||||
|
||||
/** 工作单位 */
|
||||
private String workplace;
|
||||
|
||||
/** 联系电话 */
|
||||
private String phone;
|
||||
|
||||
/** 紧急联系人电话 */
|
||||
private String contactPhone;
|
||||
|
||||
/** 现住址省 */
|
||||
private String addressProv;
|
||||
|
||||
/** 现住址市 */
|
||||
private String addressCity;
|
||||
|
||||
/** 现住址县 */
|
||||
private String addressCounty;
|
||||
|
||||
/** 现住址街道 */
|
||||
private String addressTown;
|
||||
|
||||
/** 现住址村/居委 */
|
||||
private String addressVillage;
|
||||
|
||||
/** 现住址门牌号 */
|
||||
private String addressHouse;
|
||||
|
||||
/** 病人属于 */
|
||||
private String patientbelong;
|
||||
|
||||
/** 职业 */
|
||||
private String occupation;
|
||||
|
||||
/** 疾病编码 */
|
||||
private String diseaseCode;
|
||||
|
||||
/** 疾病名称 */
|
||||
private String diseaseName;
|
||||
|
||||
/** 分型 */
|
||||
private String diseaseSubtype;
|
||||
|
||||
/** 病例分类 */
|
||||
private String diseaseType;
|
||||
|
||||
/** 发病日期 */
|
||||
private LocalDate onsetDate;
|
||||
|
||||
/** 诊断日期 */
|
||||
private LocalDateTime diagDate;
|
||||
|
||||
/** 死亡日期 */
|
||||
private LocalDate deathDate;
|
||||
|
||||
/** 订正病名 */
|
||||
private String revisedDiseaseName;
|
||||
|
||||
/** 退卡原因 */
|
||||
private String returnReason;
|
||||
|
||||
/** 报告单位 */
|
||||
private String reportOrg;
|
||||
|
||||
/** 联系电话 */
|
||||
private String reportOrgPhone;
|
||||
|
||||
/** 报告医生 */
|
||||
private String reportDoc;
|
||||
|
||||
/** 填卡日期 */
|
||||
private LocalDate reportDate;
|
||||
|
||||
/** 状态 */
|
||||
private String status;
|
||||
|
||||
/** 报卡名称代码 */
|
||||
private Integer cardNameCode;
|
||||
|
||||
/** 登记来源 */
|
||||
private Integer registrationSource;
|
||||
|
||||
/** 科室名称 */
|
||||
private String deptName;
|
||||
|
||||
/** 创建时间 */
|
||||
private LocalDateTime createTime;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.openhis.web.cardmanagement.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 单条审核参数DTO
|
||||
*
|
||||
* @author system
|
||||
* @date 2026-03-05
|
||||
*/
|
||||
@Data
|
||||
public class SingleAuditDto {
|
||||
|
||||
/** 卡片编号 */
|
||||
private String cardNo;
|
||||
|
||||
/** 审核意见 */
|
||||
private String auditOpinion;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.openhis.web.cardmanagement.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 单条退回参数DTO
|
||||
*
|
||||
* @author system
|
||||
* @date 2026-03-05
|
||||
*/
|
||||
@Data
|
||||
public class SingleReturnDto {
|
||||
|
||||
/** 卡片编号 */
|
||||
private String cardNo;
|
||||
|
||||
/** 退回原因 */
|
||||
private String returnReason;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.openhis.web.cardmanagement.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.infectious.domain.InfectiousAudit;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 审核记录Mapper
|
||||
*
|
||||
* @author system
|
||||
* @date 2026-03-05
|
||||
*/
|
||||
@Mapper
|
||||
public interface InfectiousAuditMapper extends BaseMapper<InfectiousAudit> {
|
||||
|
||||
/**
|
||||
* 根据报卡ID查询审核记录
|
||||
*/
|
||||
@Select("SELECT * FROM infectious_audit WHERE card_id = #{cardId} ORDER BY audit_time DESC")
|
||||
List<InfectiousAudit> selectByCardId(@Param("cardId") Long cardId);
|
||||
|
||||
/**
|
||||
* 获取下一个审核序号
|
||||
*/
|
||||
@Select("SELECT COALESCE(MAX(audit_seq), 0) + 1 FROM infectious_audit WHERE card_id = #{cardId}")
|
||||
Integer getNextAuditSeq(@Param("cardId") Long cardId);
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.openhis.web.cardmanagement.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.openhis.infectious.domain.InfectiousCard;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 传染病报卡Mapper
|
||||
*
|
||||
* @author system
|
||||
* @date 2026-03-05
|
||||
*/
|
||||
@Mapper
|
||||
public interface InfectiousCardMapper extends BaseMapper<InfectiousCard> {
|
||||
|
||||
/**
|
||||
* 统计今日待审核数量
|
||||
*/
|
||||
@Select("SELECT COUNT(*) FROM infectious_card WHERE DATE(create_time) = CURRENT_DATE AND status = '1'")
|
||||
Integer countTodayPending();
|
||||
|
||||
/**
|
||||
* 统计本月审核失败数量
|
||||
*/
|
||||
@Select("SELECT COUNT(*) FROM infectious_card WHERE DATE_TRUNC('month', create_time) = DATE_TRUNC('month', CURRENT_DATE) AND status = '5'")
|
||||
Integer countMonthFailed();
|
||||
|
||||
/**
|
||||
* 统计本月审核成功数量
|
||||
*/
|
||||
@Select("SELECT COUNT(*) FROM infectious_card WHERE DATE_TRUNC('month', create_time) = DATE_TRUNC('month', CURRENT_DATE) AND status = '2'")
|
||||
Integer countMonthSuccess();
|
||||
|
||||
/**
|
||||
* 统计本月已上报数量
|
||||
*/
|
||||
@Select("SELECT COUNT(*) FROM infectious_card WHERE DATE_TRUNC('month', create_time) = DATE_TRUNC('month', CURRENT_DATE) AND status = '3'")
|
||||
Integer countMonthReported();
|
||||
|
||||
/**
|
||||
* 根据卡片编号查询
|
||||
*/
|
||||
@Select("SELECT * FROM infectious_card WHERE card_no = #{cardNo}")
|
||||
InfectiousCard selectByCardNo(@Param("cardNo") String cardNo);
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.openhis.infectious.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 审核记录Entity实体
|
||||
*
|
||||
* @author system
|
||||
* @date 2026-03-05
|
||||
*/
|
||||
@Data
|
||||
@TableName("infectious_audit")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class InfectiousAudit extends HisBaseEntity {
|
||||
|
||||
/** 审核记录ID */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long auditId;
|
||||
|
||||
/** 报卡ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long cardId;
|
||||
|
||||
/** 审核序号 */
|
||||
private Integer auditSeq;
|
||||
|
||||
/** 审核类型(1批量审核/2单审核通过/3批量退回/4单退回/5其他) */
|
||||
private String auditType;
|
||||
|
||||
/** 审核前状态 */
|
||||
private String auditStatusFrom;
|
||||
|
||||
/** 审核后状态 */
|
||||
private String auditStatusTo;
|
||||
|
||||
/** 审核时间 */
|
||||
private LocalDateTime auditTime;
|
||||
|
||||
/** 审核人账号 */
|
||||
private String auditorId;
|
||||
|
||||
/** 审核人姓名 */
|
||||
private String auditorName;
|
||||
|
||||
/** 审核意见 */
|
||||
private String auditOpinion;
|
||||
|
||||
/** 退回原因 */
|
||||
private String reasonForReturn;
|
||||
|
||||
/** 失败原因码 */
|
||||
private String failReasonCode;
|
||||
|
||||
/** 失败详情 */
|
||||
private String failReasonDesc;
|
||||
|
||||
/** 是否批量 */
|
||||
private Boolean isBatch;
|
||||
|
||||
/** 批量数量 */
|
||||
private Integer batchSize;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,174 @@
|
||||
package com.openhis.infectious.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 传染病报卡Entity实体
|
||||
*
|
||||
* @author system
|
||||
* @date 2026-03-05
|
||||
*/
|
||||
@Data
|
||||
@TableName("infectious_card")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class InfectiousCard extends HisBaseEntity {
|
||||
|
||||
/** 卡片编号 */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 卡片编号(业务编号) */
|
||||
private String cardNo;
|
||||
|
||||
/** 本次就诊ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long visitId;
|
||||
|
||||
/** 诊断记录ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long diagId;
|
||||
|
||||
/** 患者主索引 */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long patId;
|
||||
|
||||
/** 证件类型 */
|
||||
private Integer idType;
|
||||
|
||||
/** 证件号码 */
|
||||
private String idNo;
|
||||
|
||||
/** 患者姓名 */
|
||||
private String patName;
|
||||
|
||||
/** 家长姓名 */
|
||||
private String parentName;
|
||||
|
||||
/** 性别(1男/2女/0未知) */
|
||||
private String sex;
|
||||
|
||||
/** 出生日期 */
|
||||
private LocalDate birthday;
|
||||
|
||||
/** 实足年龄 */
|
||||
private Integer age;
|
||||
|
||||
/** 年龄单位(1岁/2月/3天) */
|
||||
private String ageUnit;
|
||||
|
||||
/** 工作单位 */
|
||||
private String workplace;
|
||||
|
||||
/** 联系电话 */
|
||||
private String phone;
|
||||
|
||||
/** 紧急联系人电话 */
|
||||
private String contactPhone;
|
||||
|
||||
/** 现住址省 */
|
||||
private String addressProv;
|
||||
|
||||
/** 现住址市 */
|
||||
private String addressCity;
|
||||
|
||||
/** 现住址县 */
|
||||
private String addressCounty;
|
||||
|
||||
/** 现住址街道 */
|
||||
private String addressTown;
|
||||
|
||||
/** 现住址村/居委 */
|
||||
private String addressVillage;
|
||||
|
||||
/** 现住址门牌号 */
|
||||
private String addressHouse;
|
||||
|
||||
/** 病人属于 */
|
||||
private String patientbelong;
|
||||
|
||||
/** 职业 */
|
||||
private String occupation;
|
||||
|
||||
/** 疾病编码 */
|
||||
private String diseaseCode;
|
||||
|
||||
/** 疾病名称 */
|
||||
private String diseaseName;
|
||||
|
||||
/** 分型 */
|
||||
private String diseaseSubtype;
|
||||
|
||||
/** 其他传染病 */
|
||||
private String otherDisease;
|
||||
|
||||
/** 病例分类 */
|
||||
private String diseaseType;
|
||||
|
||||
/** 发病日期 */
|
||||
private LocalDate onsetDate;
|
||||
|
||||
/** 诊断日期 */
|
||||
private LocalDateTime diagDate;
|
||||
|
||||
/** 死亡日期 */
|
||||
private LocalDate deathDate;
|
||||
|
||||
/** 订正病名 */
|
||||
private String revisedDiseaseName;
|
||||
|
||||
/** 退卡原因 */
|
||||
private String returnReason;
|
||||
|
||||
/** 报告单位 */
|
||||
private String reportOrg;
|
||||
|
||||
/** 联系电话 */
|
||||
private String reportOrgPhone;
|
||||
|
||||
/** 报告医生 */
|
||||
private String reportDoc;
|
||||
|
||||
/** 填卡日期 */
|
||||
private LocalDate reportDate;
|
||||
|
||||
/** 状态(0暂存/1已提交/2已审核/3已上报/4失败/5退回) */
|
||||
private String status;
|
||||
|
||||
/** 失败原因 */
|
||||
private String failMsg;
|
||||
|
||||
/** 上报XML */
|
||||
private String xmlContent;
|
||||
|
||||
/** 报卡名称代码 */
|
||||
private Integer cardNameCode;
|
||||
|
||||
/** 登记来源(1门诊/2住院) */
|
||||
private Integer registrationSource;
|
||||
|
||||
/** 科室ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long deptId;
|
||||
|
||||
/** 科室名称 */
|
||||
private String deptName;
|
||||
|
||||
/** 医生ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long doctorId;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user