Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
@@ -4,7 +4,7 @@ import com.core.common.core.domain.R;
|
||||
import com.openhis.web.reportManagement.dto.InfectiousCardParam;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
// import java.util.List; // 批量操作功能暂未实现
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 传染病报卡 AppService 接口
|
||||
@@ -41,44 +41,44 @@ public interface IInfectiousCardAppService {
|
||||
R<?> getByCardNo(String cardNo);
|
||||
|
||||
/**
|
||||
* 审核传染病报卡(功能暂未实现)
|
||||
* 审核传染病报卡
|
||||
*
|
||||
* @param cardNo 报卡编号
|
||||
* @param auditOpinion 审核意见
|
||||
* @param status 审核状态
|
||||
* @return 结果
|
||||
*/
|
||||
// R<?> audit(String cardNo, String auditOpinion, String status);
|
||||
R<?> audit(String cardNo, String auditOpinion, String status);
|
||||
|
||||
/**
|
||||
* 退回传染病报卡(功能暂未实现)
|
||||
* 退回传染病报卡
|
||||
*
|
||||
* @param cardNo 报卡编号
|
||||
* @param returnReason 退回原因
|
||||
* @param status 审核状态
|
||||
* @return 结果
|
||||
*/
|
||||
// R<?> returnCard(String cardNo, String returnReason, String status);
|
||||
R<?> returnCard(String cardNo, String returnReason, String status);
|
||||
|
||||
/**
|
||||
* 批量审核传染病报卡(功能暂未实现)
|
||||
* 批量审核传染病报卡
|
||||
*
|
||||
* @param cardNos 报卡编号列表
|
||||
* @param auditOpinion 审核意见
|
||||
* @param status 审核状态
|
||||
* @return 结果
|
||||
*/
|
||||
// R<?> batchAudit(List<String> cardNos, String auditOpinion, String status);
|
||||
R<?> batchAudit(List<String> cardNos, String auditOpinion, String status);
|
||||
|
||||
/**
|
||||
* 批量退回传染病报卡(功能暂未实现)
|
||||
* 批量退回传染病报卡
|
||||
*
|
||||
* @param cardNos 报卡编号列表
|
||||
* @param returnReason 退回原因
|
||||
* @param status 审核状态
|
||||
* @return 结果
|
||||
*/
|
||||
// R<?> batchReturn(List<String> cardNos, String returnReason, String status);
|
||||
R<?> batchReturn(List<String> cardNos, String returnReason, String status);
|
||||
|
||||
/**
|
||||
* 导出传染病报卡
|
||||
|
||||
@@ -4,9 +4,7 @@ import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.administration.domain.InfectiousDiseaseReport;
|
||||
import com.openhis.administration.domain.Organization;
|
||||
import com.openhis.administration.mapper.InfectiousDiseaseReportMapper;
|
||||
import com.openhis.administration.service.IOrganizationService;
|
||||
import com.openhis.web.reportManagement.appservice.IInfectiousCardAppService;
|
||||
import com.openhis.web.reportManagement.dto.InfectiousCardDto;
|
||||
@@ -17,9 +15,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 传染病报卡 AppService 实现
|
||||
@@ -34,9 +32,6 @@ public class InfectiousCardAppServiceImpl implements IInfectiousCardAppService {
|
||||
@Autowired
|
||||
private ReportManageCardMapper reportManageCardMapper;
|
||||
|
||||
@Autowired
|
||||
private InfectiousDiseaseReportMapper infectiousDiseaseReportMapper;
|
||||
|
||||
@Autowired
|
||||
private IOrganizationService organizationService;
|
||||
|
||||
@@ -104,110 +99,122 @@ public class InfectiousCardAppServiceImpl implements IInfectiousCardAppService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核传染病报卡(功能暂未实现)
|
||||
* 审核传染病报卡
|
||||
* @param cardNo 卡号
|
||||
* @param auditOpinion 审核意见
|
||||
* @param status 审核状态
|
||||
* @return 审核结果
|
||||
*/
|
||||
// @Override
|
||||
// public R<?> audit(String cardNo, String auditOpinion, String status) {
|
||||
// try {
|
||||
// InfectiousDiseaseReport report = infectiousDiseaseReportMapper.selectById(cardNo);
|
||||
// if (report == null) {
|
||||
// return R.fail("报卡不存在");
|
||||
// }
|
||||
@Override
|
||||
public R<?> audit(String cardNo, String auditOpinion, String status) {
|
||||
try {
|
||||
InfectiousCardDto dto = reportManageCardMapper.selectCardByCardNo(cardNo);
|
||||
if (dto == null) {
|
||||
return R.fail("报卡不存在");
|
||||
}
|
||||
|
||||
// report.setStatus(Integer.parseInt(status));
|
||||
// report.setUpdateTime(new Date());
|
||||
|
||||
// infectiousDiseaseReportMapper.updateById(report);
|
||||
|
||||
// return R.ok("审核成功");
|
||||
// } catch (Exception e) {
|
||||
// log.error("审核传染病报卡失败", e);
|
||||
// return R.fail("审核失败:" + e.getMessage());
|
||||
// }
|
||||
// }
|
||||
int rows = reportManageCardMapper.auditCard(cardNo, Integer.parseInt(status));
|
||||
if (rows > 0) {
|
||||
return R.ok("审核成功");
|
||||
} else {
|
||||
return R.fail("审核失败:未更新任何记录");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("审核传染病报卡失败", e);
|
||||
return R.fail("审核失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 退回传染病报卡(功能暂未实现)
|
||||
* 退回传染病报卡
|
||||
* @param cardNo 卡号
|
||||
* @param returnReason 退回原因
|
||||
* @param status 退回状态
|
||||
* @return 退回结果
|
||||
*/
|
||||
// @Override
|
||||
// public R<?> returnCard(String cardNo, String returnReason, String status) {
|
||||
// try {
|
||||
// InfectiousDiseaseReport report = infectiousDiseaseReportMapper.selectById(cardNo);
|
||||
// if (report == null) {
|
||||
// return R.fail("报卡不存在");
|
||||
// }
|
||||
@Override
|
||||
public R<?> returnCard(String cardNo, String returnReason, String status) {
|
||||
try {
|
||||
InfectiousCardDto dto = reportManageCardMapper.selectCardByCardNo(cardNo);
|
||||
if (dto == null) {
|
||||
return R.fail("报卡不存在");
|
||||
}
|
||||
|
||||
// report.setStatus(Integer.parseInt(status));
|
||||
// report.setWithdrawReason(returnReason);
|
||||
// report.setUpdateTime(new Date());
|
||||
|
||||
// infectiousDiseaseReportMapper.updateById(report);
|
||||
|
||||
// return R.ok("退回成功");
|
||||
// } catch (Exception e) {
|
||||
// log.error("退回传染病报卡失败", e);
|
||||
// return R.fail("退回失败:" + e.getMessage());
|
||||
// }
|
||||
// }
|
||||
int rows = reportManageCardMapper.returnCard(cardNo, Integer.parseInt(status), returnReason);
|
||||
if (rows > 0) {
|
||||
return R.ok("退回成功");
|
||||
} else {
|
||||
return R.fail("退回失败:未更新任何记录");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("退回传染病报卡失败", e);
|
||||
return R.fail("退回失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量审核传染病报卡(功能暂未实现)
|
||||
* 批量审核传染病报卡
|
||||
* @param cardNos 卡号列表
|
||||
* @param auditOpinion 审核意见
|
||||
* @param status 审核状态
|
||||
* @return 批量审核结果
|
||||
*/
|
||||
// @Override
|
||||
// public R<?> batchAudit(List<String> cardNos, String auditOpinion, String status) {
|
||||
// try {
|
||||
// for (String cardNo : cardNos) {
|
||||
// InfectiousDiseaseReport report = infectiousDiseaseReportMapper.selectById(cardNo);
|
||||
// if (report != null) {
|
||||
// report.setStatus(Integer.parseInt(status));
|
||||
// report.setUpdateTime(new Date());
|
||||
// infectiousDiseaseReportMapper.updateById(report);
|
||||
// }
|
||||
// }
|
||||
// return R.ok("批量审核成功");
|
||||
// } catch (Exception e) {
|
||||
// log.error("批量审核传染病报卡失败", e);
|
||||
// return R.fail("批量审核失败:" + e.getMessage());
|
||||
// }
|
||||
// }
|
||||
@Override
|
||||
public R<?> batchAudit(List<String> cardNos, String auditOpinion, String status) {
|
||||
try {
|
||||
int successCount = 0;
|
||||
int failCount = 0;
|
||||
for (String cardNo : cardNos) {
|
||||
try {
|
||||
int rows = reportManageCardMapper.auditCard(cardNo, Integer.parseInt(status));
|
||||
if (rows > 0) {
|
||||
successCount++;
|
||||
} else {
|
||||
failCount++;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("批量审核卡号 {} 失败", cardNo, e);
|
||||
failCount++;
|
||||
}
|
||||
}
|
||||
return R.ok(String.format("批量审核完成:成功 %d 条,失败 %d 条", successCount, failCount));
|
||||
} catch (Exception e) {
|
||||
log.error("批量审核传染病报卡失败", e);
|
||||
return R.fail("批量审核失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量退回传染病报卡(功能暂未实现)
|
||||
* 批量退回传染病报卡
|
||||
* @param cardNos 卡号列表
|
||||
* @param returnReason 退回原因
|
||||
* @param status 退回状态
|
||||
* @return 批量退回结果
|
||||
*/
|
||||
// @Override
|
||||
// public R<?> batchReturn(List<String> cardNos, String returnReason, String status) {
|
||||
// try {
|
||||
// for (String cardNo : cardNos) {
|
||||
// InfectiousDiseaseReport report = infectiousDiseaseReportMapper.selectById(cardNo);
|
||||
// if (report != null) {
|
||||
// report.setStatus(Integer.parseInt(status));
|
||||
// report.setWithdrawReason(returnReason);
|
||||
// report.setUpdateTime(new Date());
|
||||
// infectiousDiseaseReportMapper.updateById(report);
|
||||
// }
|
||||
// }
|
||||
// return R.ok("批量退回成功");
|
||||
// } catch (Exception e) {
|
||||
// log.error("批量退回传染病报卡失败", e);
|
||||
// return R.fail("批量退回失败:" + e.getMessage());
|
||||
// }
|
||||
// }
|
||||
@Override
|
||||
public R<?> batchReturn(List<String> cardNos, String returnReason, String status) {
|
||||
try {
|
||||
int successCount = 0;
|
||||
int failCount = 0;
|
||||
for (String cardNo : cardNos) {
|
||||
try {
|
||||
int rows = reportManageCardMapper.returnCard(cardNo, Integer.parseInt(status), returnReason);
|
||||
if (rows > 0) {
|
||||
successCount++;
|
||||
} else {
|
||||
failCount++;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("批量退回卡号 {} 失败", cardNo, e);
|
||||
failCount++;
|
||||
}
|
||||
}
|
||||
return R.ok(String.format("批量退回完成:成功 %d 条,失败 %d 条", successCount, failCount));
|
||||
} catch (Exception e) {
|
||||
log.error("批量退回传染病报卡失败", e);
|
||||
return R.fail("批量退回失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出传染病报卡数据
|
||||
@@ -216,7 +223,143 @@ public class InfectiousCardAppServiceImpl implements IInfectiousCardAppService {
|
||||
*/
|
||||
@Override
|
||||
public void export(InfectiousCardParam param, HttpServletResponse response) {
|
||||
log.warn("导出功能暂未实现");
|
||||
try {
|
||||
// 查询所有符合条件的数据
|
||||
List<InfectiousCardDto> list = reportManageCardMapper.selectAllCards(param);
|
||||
|
||||
// 设置响应头
|
||||
response.setContentType("text/csv;charset=UTF-8");
|
||||
response.setHeader("Content-Disposition",
|
||||
"attachment; filename=infectious_cards_" + System.currentTimeMillis() + ".csv");
|
||||
|
||||
// 写入 CSV 内容
|
||||
java.io.PrintWriter writer = response.getWriter();
|
||||
|
||||
// 写入 BOM,防止中文乱码
|
||||
writer.print('\uFEFF');
|
||||
|
||||
// 写入表头
|
||||
writer.println("报卡编号,报卡名称,病种名称,患者姓名,性别,年龄,上报科室,登记来源,上报时间,审核状态," +
|
||||
"身份证号,联系电话,现住地址,职业,病例分类,发病日期,诊断日期,报告单位,报告医生,填卡日期,备注");
|
||||
|
||||
// 写入数据
|
||||
for (InfectiousCardDto dto : list) {
|
||||
writer.println(String.format("%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s",
|
||||
escapeCsv(dto.getCardNo()),
|
||||
escapeCsv(dto.getCardName()),
|
||||
escapeCsv(dto.getDiseaseName()),
|
||||
escapeCsv(dto.getPatientName()),
|
||||
"1".equals(dto.getSex()) ? "男" : "2".equals(dto.getSex()) ? "女" : "未知",
|
||||
dto.getAge() + getAgeUnit(dto.getAgeUnit()),
|
||||
escapeCsv(dto.getDeptName()),
|
||||
getRegistrationSourceName(dto.getRegistrationSource()),
|
||||
dto.getReportDate(),
|
||||
getStatusName(dto.getStatus()),
|
||||
escapeCsv(dto.getIdNo()),
|
||||
escapeCsv(dto.getPhone()),
|
||||
escapeCsv(getFullAddress(dto)),
|
||||
escapeCsv(dto.getOccupation()),
|
||||
getCaseClassName(dto.getCaseClass()),
|
||||
dto.getOnsetDate(),
|
||||
dto.getDiagDate() != null ? dto.getDiagDate().toString().substring(0, 10) : "",
|
||||
escapeCsv(dto.getReportOrg()),
|
||||
escapeCsv(dto.getReportDoc()),
|
||||
dto.getReportDate(),
|
||||
escapeCsv(dto.getRemark() != null ? dto.getRemark() : "")
|
||||
));
|
||||
}
|
||||
|
||||
writer.flush();
|
||||
log.info("导出传染病报卡数据成功,共 {} 条", list.size());
|
||||
} catch (Exception e) {
|
||||
log.error("导出传染病报卡数据失败", e);
|
||||
throw new RuntimeException("导出失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* CSV 字段转义
|
||||
*/
|
||||
private String escapeCsv(String value) {
|
||||
if (value == null) {
|
||||
return "";
|
||||
}
|
||||
if (value.contains(",") || value.contains("\"") || value.contains("\n")) {
|
||||
return "\"" + value.replace("\"", "\"\"") + "\"";
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取年龄单位
|
||||
*/
|
||||
private String getAgeUnit(String unit) {
|
||||
if (unit == null) return "岁";
|
||||
switch (unit) {
|
||||
case "1": return "岁";
|
||||
case "2": return "月";
|
||||
case "3": return "天";
|
||||
default: return "岁";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取登记来源名称
|
||||
*/
|
||||
private String getRegistrationSourceName(Integer source) {
|
||||
if (source == null) return "未知";
|
||||
switch (source) {
|
||||
case 1: return "门诊";
|
||||
case 2: return "住院";
|
||||
case 3: return "急诊";
|
||||
case 4: return "体检";
|
||||
default: return "未知";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取状态名称
|
||||
*/
|
||||
private String getStatusName(Integer status) {
|
||||
if (status == null) return "未知";
|
||||
switch (status) {
|
||||
case 0: return "草稿";
|
||||
case 1: return "待审核";
|
||||
case 2: return "审核通过";
|
||||
case 3: return "已上报";
|
||||
case 4: return "已撤回";
|
||||
case 5: return "审核失败";
|
||||
default: return "未知";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取病例分类名称
|
||||
*/
|
||||
private String getCaseClassName(Integer caseClass) {
|
||||
if (caseClass == null) return "未知";
|
||||
switch (caseClass) {
|
||||
case 1: return "疑似病例";
|
||||
case 2: return "临床诊断病例";
|
||||
case 3: return "确诊病例";
|
||||
case 4: return "病原携带者";
|
||||
case 5: return "阳性检测结果";
|
||||
default: return "未知";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取完整地址
|
||||
*/
|
||||
private String getFullAddress(InfectiousCardDto dto) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (dto.getAddressProv() != null) sb.append(dto.getAddressProv());
|
||||
if (dto.getAddressCity() != null) sb.append(dto.getAddressCity());
|
||||
if (dto.getAddressCounty() != null) sb.append(dto.getAddressCounty());
|
||||
if (dto.getAddressTown() != null) sb.append(dto.getAddressTown());
|
||||
if (dto.getAddressVillage() != null) sb.append(dto.getAddressVillage());
|
||||
if (dto.getAddressHouse() != null) sb.append(dto.getAddressHouse());
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,11 +3,16 @@ package com.openhis.web.reportManagement.controller;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.reportManagement.appservice.IInfectiousCardAppService;
|
||||
import com.openhis.web.reportManagement.dto.InfectiousCardParam;
|
||||
import com.openhis.web.reportManagement.dto.AuditInfectiousCardRequest;
|
||||
import com.openhis.web.reportManagement.dto.ReturnInfectiousCardRequest;
|
||||
import com.openhis.web.reportManagement.dto.BatchAuditInfectiousCardRequest;
|
||||
import com.openhis.web.reportManagement.dto.BatchReturnInfectiousCardRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
// import java.util.List; // 批量操作功能暂未实现
|
||||
|
||||
/**
|
||||
@@ -62,64 +67,48 @@ public class reportManagementController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核传染病报卡(功能暂未实现)
|
||||
* 审核传染病报卡
|
||||
*
|
||||
* @param cardNo 报卡编号
|
||||
* @param auditOpinion 审核意见
|
||||
* @param status 审核状态
|
||||
* @param request 审核请求
|
||||
* @return 结果
|
||||
*/
|
||||
// @PostMapping("/audit")
|
||||
// public R<?> audit(@RequestParam String cardNo,
|
||||
// @RequestParam String auditOpinion,
|
||||
// @RequestParam String status) {
|
||||
// return infectiousCardAppService.audit(cardNo, auditOpinion, status);
|
||||
// }
|
||||
@PostMapping("/audit")
|
||||
public R<?> audit(@RequestBody AuditInfectiousCardRequest request) {
|
||||
return infectiousCardAppService.audit(request.getCardNo(), request.getAuditOpinion(), request.getStatus());
|
||||
}
|
||||
|
||||
/**
|
||||
* 退回传染病报卡(功能暂未实现)
|
||||
* 退回传染病报卡
|
||||
*
|
||||
* @param cardNo 报卡编号
|
||||
* @param returnReason 退回原因
|
||||
* @param status 审核状态
|
||||
* @param request 退回请求
|
||||
* @return 结果
|
||||
*/
|
||||
// @PostMapping("/return")
|
||||
// public R<?> returnCard(@RequestParam String cardNo,
|
||||
// @RequestParam String returnReason,
|
||||
// @RequestParam String status) {
|
||||
// return infectiousCardAppService.returnCard(cardNo, returnReason, status);
|
||||
// }
|
||||
@PostMapping("/return")
|
||||
public R<?> returnCard(@Valid @RequestBody ReturnInfectiousCardRequest request) {
|
||||
return infectiousCardAppService.returnCard(request.getCardNo(), request.getReturnReason(), request.getStatus());
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量审核传染病报卡(功能暂未实现)
|
||||
* 批量审核传染病报卡
|
||||
*
|
||||
* @param cardNos 报卡编号列表
|
||||
* @param auditOpinion 审核意见
|
||||
* @param status 审核状态
|
||||
* @param request 批量审核请求
|
||||
* @return 结果
|
||||
*/
|
||||
// @PostMapping("/batchAudit")
|
||||
// public R<?> batchAudit(@RequestBody List<String> cardNos,
|
||||
// @RequestParam String auditOpinion,
|
||||
// @RequestParam String status) {
|
||||
// return infectiousCardAppService.batchAudit(cardNos, auditOpinion, status);
|
||||
// }
|
||||
@PostMapping("/batchAudit")
|
||||
public R<?> batchAudit(@RequestBody BatchAuditInfectiousCardRequest request) {
|
||||
return infectiousCardAppService.batchAudit(request.getCardNos(), request.getAuditOpinion(), request.getStatus());
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量退回传染病报卡(功能暂未实现)
|
||||
* 批量退回传染病报卡
|
||||
*
|
||||
* @param cardNos 报卡编号列表
|
||||
* @param returnReason 退回原因
|
||||
* @param status 审核状态
|
||||
* @param request 批量退回请求
|
||||
* @return 结果
|
||||
*/
|
||||
// @PostMapping("/batchReturn")
|
||||
// public R<?> batchReturn(@RequestBody List<String> cardNos,
|
||||
// @RequestParam String returnReason,
|
||||
// @RequestParam String status) {
|
||||
// return infectiousCardAppService.batchReturn(cardNos, returnReason, status);
|
||||
// }
|
||||
@PostMapping("/batchReturn")
|
||||
public R<?> batchReturn(@Valid @RequestBody BatchReturnInfectiousCardRequest request) {
|
||||
return infectiousCardAppService.batchReturn(request.getCardNos(), request.getReturnReason(), request.getStatus());
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出传染病报卡
|
||||
@@ -127,7 +116,7 @@ public class reportManagementController {
|
||||
* @param param 查询参数
|
||||
* @param response 响应对象
|
||||
*/
|
||||
@PostMapping("/export")
|
||||
@GetMapping("/export")
|
||||
public void export(InfectiousCardParam param, HttpServletResponse response) {
|
||||
infectiousCardAppService.export(param, response);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.openhis.web.reportManagement.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 审核传染病报卡请求 DTO
|
||||
*
|
||||
* @author system
|
||||
* @date 2026-04-13
|
||||
*/
|
||||
@Data
|
||||
public class AuditInfectiousCardRequest {
|
||||
|
||||
/** 卡片编号(主键) */
|
||||
private String cardNo;
|
||||
|
||||
/** 审核意见 */
|
||||
private String auditOpinion;
|
||||
|
||||
/** 审核状态 (0 暂存/1 待审核/2 已审核/3 已上报/4 失败/5 退回) */
|
||||
private String status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.openhis.web.reportManagement.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 批量审核传染病报卡请求 DTO
|
||||
*
|
||||
* @author system
|
||||
* @date 2026-04-13
|
||||
*/
|
||||
@Data
|
||||
public class BatchAuditInfectiousCardRequest {
|
||||
|
||||
/** 卡片编号列表 */
|
||||
private List<String> cardNos;
|
||||
|
||||
/** 审核意见 */
|
||||
private String auditOpinion;
|
||||
|
||||
/** 审核状态 (0 暂存/1 待审核/2 已审核/3 已上报/4 失败/5 退回) */
|
||||
private String status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.openhis.web.reportManagement.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 批量退回传染病报卡请求 DTO
|
||||
*
|
||||
* @author system
|
||||
* @date 2026-04-13
|
||||
*/
|
||||
@Data
|
||||
public class BatchReturnInfectiousCardRequest {
|
||||
|
||||
/** 卡片编号列表 */
|
||||
private List<String> cardNos;
|
||||
|
||||
/** 退回原因 */
|
||||
@Size(max = 50, message = "退回原因不能超过50个字符")
|
||||
private String returnReason;
|
||||
|
||||
/** 审核状态 (0 暂存/1 待审核/2 已审核/3 已上报/4 失败/5 退回) */
|
||||
private String status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.openhis.web.reportManagement.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
/**
|
||||
* 退回传染病报卡请求 DTO
|
||||
*
|
||||
* @author system
|
||||
* @date 2026-04-13
|
||||
*/
|
||||
@Data
|
||||
public class ReturnInfectiousCardRequest {
|
||||
|
||||
/** 卡片编号(主键) */
|
||||
private String cardNo;
|
||||
|
||||
/** 退回原因 */
|
||||
@Size(max = 50, message = "退回原因不能超过50个字符")
|
||||
private String returnReason;
|
||||
|
||||
/** 审核状态 (0 暂存/1 待审核/2 已审核/3 已上报/4 失败/5 退回) */
|
||||
private String status;
|
||||
|
||||
}
|
||||
@@ -7,6 +7,8 @@ import com.openhis.web.reportManagement.dto.InfectiousCardParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 传染病报卡 Mapper 接口
|
||||
*
|
||||
@@ -30,4 +32,28 @@ public interface ReportManageCardMapper {
|
||||
* @return 报卡详情
|
||||
*/
|
||||
InfectiousCardDto selectCardByCardNo(@Param("cardNo") String cardNo);
|
||||
|
||||
/**
|
||||
* 审核传染病报卡
|
||||
* @param cardNo 卡号
|
||||
* @param status 审核状态
|
||||
* @return 影响行数
|
||||
*/
|
||||
int auditCard(@Param("cardNo") String cardNo, @Param("status") Integer status);
|
||||
|
||||
/**
|
||||
* 退回传染病报卡
|
||||
* @param cardNo 卡号
|
||||
* @param status 退回状态
|
||||
* @param returnReason 退回原因
|
||||
* @return 影响行数
|
||||
*/
|
||||
int returnCard(@Param("cardNo") String cardNo, @Param("status") Integer status, @Param("returnReason") String returnReason);
|
||||
|
||||
/**
|
||||
* 查询所有报卡数据(用于导出)
|
||||
* @param param 查询参数
|
||||
* @return 报卡列表
|
||||
*/
|
||||
List<InfectiousCardDto> selectAllCards(@Param("param") InfectiousCardParam param);
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
AND t1.pat_name LIKE CONCAT('%', #{param.patientName}, '%')
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND t1.status = #{param.status}
|
||||
AND t1.status::INTEGER = #{param.status}
|
||||
</if>
|
||||
<if test="param.registrationSource != null">
|
||||
AND t1.registration_source = #{param.registrationSource}
|
||||
@@ -150,4 +150,106 @@
|
||||
WHERE t1.delete_flag = '0' AND t1.card_no = #{cardNo}
|
||||
</select>
|
||||
|
||||
<!-- 审核传染病报卡 -->
|
||||
<update id="auditCard">
|
||||
UPDATE infectious_card
|
||||
SET status = #{status}::INTEGER,
|
||||
update_time = CURRENT_TIMESTAMP
|
||||
WHERE card_no = #{cardNo}
|
||||
</update>
|
||||
|
||||
<!-- 退回传染病报卡 -->
|
||||
<update id="returnCard">
|
||||
UPDATE infectious_card
|
||||
SET status = #{status}::INTEGER,
|
||||
return_reason = #{returnReason},
|
||||
update_time = CURRENT_TIMESTAMP
|
||||
WHERE card_no = #{cardNo}
|
||||
</update>
|
||||
|
||||
<!-- 查询所有报卡数据(用于导出) -->
|
||||
<select id="selectAllCards" resultType="com.openhis.web.reportManagement.dto.InfectiousCardDto">
|
||||
SELECT
|
||||
t1.card_no AS cardNo,
|
||||
'传染病报告卡' AS cardName,
|
||||
t1.disease_code AS diseaseCode,
|
||||
CASE
|
||||
WHEN t1.disease_code = '0101' THEN '鼠疫'
|
||||
WHEN t1.disease_code = '0102' THEN '霍乱'
|
||||
WHEN t1.disease_code = '0201' THEN '传染性非典型肺炎'
|
||||
WHEN t1.disease_code = '0202' THEN '艾滋病'
|
||||
WHEN t1.disease_code = '0203' THEN '病毒性肝炎'
|
||||
WHEN t1.disease_code = '0211' THEN '炭疽'
|
||||
WHEN t1.disease_code = '0213' THEN '肺结核'
|
||||
WHEN t1.disease_code = '0222' THEN '梅毒'
|
||||
WHEN t1.disease_code = '0224' THEN '血吸虫病'
|
||||
WHEN t1.disease_code = '0225' THEN '疟疾'
|
||||
WHEN t1.disease_code = '0301' THEN '流行性感冒'
|
||||
WHEN t1.disease_code = '0302' THEN '流行性腮腺炎'
|
||||
WHEN t1.disease_code = '0303' THEN '风疹'
|
||||
WHEN t1.disease_code = '0310' THEN '其它感染性腹泻病'
|
||||
WHEN t1.disease_code = '0311' THEN '手足口病'
|
||||
ELSE t1.disease_code
|
||||
END AS diseaseName,
|
||||
t1.pat_name AS patientName,
|
||||
t1.sex AS sex,
|
||||
t1.age AS age,
|
||||
t1.dept_id AS deptId,
|
||||
t2.name AS deptName,
|
||||
t1.registration_source AS registrationSource,
|
||||
t1.report_date AS reportDate,
|
||||
t1.status AS status,
|
||||
t1.id_type AS idType,
|
||||
t1.id_no AS idNo,
|
||||
t1.parent_name AS parentName,
|
||||
t1.birthday AS birthday,
|
||||
t1.age_unit AS ageUnit,
|
||||
t1.workplace AS workplace,
|
||||
t1.phone AS phone,
|
||||
t1.contact_phone AS contactPhone,
|
||||
t1.address_prov AS addressProv,
|
||||
t1.address_city AS addressCity,
|
||||
t1.address_county AS addressCounty,
|
||||
t1.address_town AS addressTown,
|
||||
t1.address_village AS addressVillage,
|
||||
t1.address_house AS addressHouse,
|
||||
t1.patient_belong AS patientBelong,
|
||||
t1.occupation AS occupation,
|
||||
t1.disease_type AS diseaseType,
|
||||
t1.case_class AS caseClass,
|
||||
t1.onset_date AS onsetDate,
|
||||
t1.diag_date AS diagDate,
|
||||
t1.death_date AS deathDate,
|
||||
t1.report_org AS reportOrg,
|
||||
t1.report_doc AS reportDoc,
|
||||
t1.withdraw_reason AS withdrawReason,
|
||||
t1.correct_name AS correctName,
|
||||
t1.other_disease AS otherDisease
|
||||
FROM infectious_card t1
|
||||
LEFT JOIN adm_organization t2 ON t1.dept_id = t2.id
|
||||
WHERE t1.delete_flag = '0'
|
||||
<if test="param.cardNo != null and param.cardNo != ''">
|
||||
AND t1.card_no = #{param.cardNo}
|
||||
</if>
|
||||
<if test="param.patientName != null and param.patientName != ''">
|
||||
AND t1.pat_name LIKE CONCAT('%', #{param.patientName}, '%')
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND t1.status::INTEGER = #{param.status}
|
||||
</if>
|
||||
<if test="param.registrationSource != null">
|
||||
AND t1.registration_source = #{param.registrationSource}
|
||||
</if>
|
||||
<if test="param.deptId != null">
|
||||
AND t1.dept_id = #{param.deptId}
|
||||
</if>
|
||||
<if test="param.startDate != null and param.startDate != ''">
|
||||
AND t1.report_date >= TO_DATE(#{param.startDate}, 'YYYY-MM-DD')
|
||||
</if>
|
||||
<if test="param.endDate != null and param.endDate != ''">
|
||||
AND t1.report_date <= TO_DATE(#{param.endDate}, 'YYYY-MM-DD')
|
||||
</if>
|
||||
ORDER BY t1.report_date DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.openhis.administration.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
@@ -121,7 +122,8 @@ public class InfectiousDiseaseReport extends HisBaseEntity {
|
||||
/** 订正病名(订正报告必填) */
|
||||
private String correctName;
|
||||
|
||||
/** 退卡原因(退卡时必填<EFBFBD>?*/
|
||||
/** 退卡原因(退卡时必填) */
|
||||
@TableField("return_reason")
|
||||
private String withdrawReason;
|
||||
|
||||
/** 报告单位(统一信用代码/医院名称<E5908D>?*/
|
||||
|
||||
Reference in New Issue
Block a user