修改了治疗类型

This commit is contained in:
wucongxing8150 2025-07-03 17:25:35 +08:00
parent 5eaf4031bf
commit aaf5dfe921
5 changed files with 52 additions and 13 deletions

View File

@ -42,6 +42,13 @@ public class CaseplatformCaseExcelController {
public void exportEasyExcel(HttpServletResponse response, @Valid CaseplatformCaseQueryForm queryForm) {
try {
List<EasyExcelCaseDetailVO> list = caseplatformCaseService.excelList(queryForm);
// 处理数据
for (EasyExcelCaseDetailVO m : list) {
// 治疗类型
m.setCaseType(caseplatformCaseService.convertCaseTypeToLabel(m.getCaseType()));
}
// 1设置表头样式
WriteCellStyle headStyle = new WriteCellStyle();
// 1.1设置表头数据居中

View File

@ -34,8 +34,7 @@ public class CaseplatformCaseVO {
@ApiModelProperty(value = "入院时间")
private LocalDateTime admissionTime;
@ApiModelProperty(value = "病历类型")
@ApiModelPropertyEnum(value = CasetypeEnum.class, desc = "病历类型")
@ApiModelProperty(value = "治疗类型")
private String caseType;
@ApiModelProperty(value = "专家姓名")

View File

@ -59,9 +59,8 @@ public class EasyExcelCaseDetailVO {
@ExcelProperty("患者ID")
private String uid;
@ApiModelPropertyEnum(value = CasetypeEnum.class, desc = "病历类型")
@ExcelProperty(value = "病历类型", converter = CasetypeConverter.class)
private Integer caseType;
@ApiModelProperty(value = "治疗类型")
private String caseType;
@ApiModelProperty(value = "创建时间")
@ExcelProperty("提交时间")

View File

@ -1,6 +1,7 @@
package net.lab1024.sa.admin.module.business.caseplatformcase.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.databind.ObjectMapper;
import net.lab1024.sa.admin.module.business.area.domain.vo.ProvVO;
import net.lab1024.sa.admin.module.business.caseplatformcase.dao.CaseplatformCaseDao;
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.entity.CaseplatformCaseEntity;
@ -28,6 +29,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Objects;
import static net.lab1024.sa.common.common.code.UserErrorCode.NO_PERMISSION;
@ -166,4 +168,44 @@ public class CaseplatformCaseService {
detail.setDpmsList(dpmsVOS);
return ResponseDTO.ok(detail);
}
/**
* 将类似 ["2","1"] 格式的字符串转换为换行分隔的中文含义
* @param caseTypeJson 数据库存储的字符串比如 ["2","1"]
* @return 转换后的字符串比如
* CA280及联合模式
* DPMAS及联合模式
*/
public String convertCaseTypeToLabel(String caseTypeJson) {
if (caseTypeJson == null || caseTypeJson.isEmpty()) {
return "";
}
try {
ObjectMapper objectMapper = new ObjectMapper();
String[] caseTypes = objectMapper.readValue(caseTypeJson, String[].class);
StringBuilder result = new StringBuilder();
for (String code : caseTypes) {
if (Objects.equals(code, "1")){
result.append("DPMAS及联合模式\n");
}else if (Objects.equals(code, "2")){
result.append("CA280及联合模式\n");
}else{
result.append("未知类型: ").append(code).append("\n");
}
}
// 去掉末尾换行
if (result.length() > 0) {
result.setLength(result.length() - 1);
}
return result.toString();
} catch (Exception e) {
System.err.println("解析 caseTypeJson 出错:" + caseTypeJson);
return "解析失败";
}
}
}

View File

@ -24,10 +24,6 @@
OR INSTR(t_caseplatform_expert.name,#{queryForm.name})
)
</if>
<!--病历类型-->
<if test="queryForm.caseType != null">
AND t_caseplatform_case.case_type = #{queryForm.caseType}
</if>
<!--0待审核 1审核通过 2审核不通过-->
<if test="queryForm.status != null">
AND t_caseplatform_case.status = #{queryForm.status}
@ -87,10 +83,6 @@
OR INSTR(t_caseplatform_case.expert_name,#{queryForm.name})
)
</if>
<!--病历类型-->
<if test="queryForm.caseType != null">
AND t_caseplatform_case.case_type = #{queryForm.caseType}
</if>
<!--0待审核 1审核通过 2审核不通过-->
<if test="queryForm.status != null">
AND t_caseplatform_case.status = #{queryForm.status}