修改BUG

This commit is contained in:
lxd 2025-03-31 17:47:21 +08:00
parent 41fc2d29b7
commit cad5193cbd

View File

@ -15,6 +15,7 @@ import cn.iocoder.yudao.module.inspect.service.exammodule.ExammoduleService;
import cn.iocoder.yudao.module.inspect.service.inspectpacsdata.InspectPacsDataService;
import cn.iocoder.yudao.module.inspect.service.inspectpatientitems.InspectPatientitemsService;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.rendering.PDFRenderer;
import org.apache.poi.ss.usermodel.*;
@ -951,14 +952,30 @@ public class InspectPatientController {
Map<String, Object> dataMap = (Map<String, Object>) responseMap.get("data");
if (dataMap != null)
{
inspectApiInfoVO.setIdCard(dataMap.get("idCard").toString());
inspectApiInfoVO.setName(dataMap.get("name").toString());
inspectApiInfoVO.setSex(dataMap.get("sex").toString());
inspectApiInfoVO.setAge(dataMap.get("age").toString());
inspectApiInfoVO.setBirthday(dataMap.get("birthday").toString());
inspectApiInfoVO.setGender(dataMap.get("gender").toString());
inspectApiInfoVO.setAddree(dataMap.get("addree").toString());
inspectApiInfoVO.setTelephone(dataMap.get("telephone").toString());
if (dataMap.get("idCard") != null) {
inspectApiInfoVO.setIdCard(dataMap.get("idCard").toString());
}
if (dataMap.get("name") != null) {
inspectApiInfoVO.setName(dataMap.get("name").toString());
}
if (dataMap.get("sex") != null) {
inspectApiInfoVO.setSex(dataMap.get("sex").toString());
}
if (dataMap.get("age") != null) {
inspectApiInfoVO.setAge(dataMap.get("age").toString());
}
if (dataMap.get("birthday") != null) {
inspectApiInfoVO.setBirthday(dataMap.get("birthday").toString());
}
if (dataMap.get("gender") != null) {
inspectApiInfoVO.setGender(dataMap.get("gender").toString());
}
if (dataMap.get("addree") != null) {
inspectApiInfoVO.setAddree(dataMap.get("addree").toString());
}
if (dataMap.get("telephone") != null) {
inspectApiInfoVO.setTelephone(dataMap.get("telephone").toString());
}
}
else
{
@ -971,46 +988,45 @@ public class InspectPatientController {
@PutMapping("/syncPatientZyInfo")
@Operation(summary = "同步中医体质结果项")
public CommonResult<Boolean> syncPatientZyInfo(@RequestParam("medicalSn") String medicalSn,@RequestParam("cardId") String cardId) throws JsonProcessingException {
public CommonResult<Boolean> syncPatientZyInfo(@RequestParam("medicalSn") String medicalSn, @RequestParam("cardId") String cardId) throws JsonProcessingException {
ConfigDO config = configService.getConfigByKey("url.zytz");
String url = config.getValue();
if(url!=null)
{
if (url != null) {
String response = HttpUtils.get(url + "?" + "idCard=" + cardId);
if(response!=null)
{
if (response != null) {
// 解析 JSON 响应
ObjectMapper objectMapper = new ObjectMapper();
Map<String, Object> responseMap = objectMapper.readValue(response, Map.class);
String msg = (String) responseMap.get("message");
if(msg.contains("查询成功"))
{
String data = (String) responseMap.get("data");
if(data!=null)
{
// data 字段解析为一个 Java 对象
Map<String, Object> dataMap = objectMapper.readValue(data, Map.class);
if (msg.contains("查询成功")) {
Object dataObj = responseMap.get("data");
if (dataObj != null) {
// data 字段解析为一个 List<Map<String, Object>>
List<Map<String, Object>> dataList = objectMapper.convertValue(dataObj, new TypeReference<List<Map<String, Object>>>() {});
InspectPatientSaveReqVO inspectPatientSaveReqVO = new InspectPatientSaveReqVO();
inspectPatientSaveReqVO.setMedicalSn(medicalSn);
// 根据图片中的 JSON 格式映射数据
if (dataMap.containsKey("physiquename")) {
inspectPatientSaveReqVO.setZybs((String) dataMap.get("physiquename"));
}
if (dataMap.containsKey("features")) {
inspectPatientSaveReqVO.setFeatures((String) dataMap.get("features"));
// 遍历 dataList 并提取所需信息
for (Map<String, Object> dataMap : dataList) {
// 根据图片中的 JSON 格式映射数据
if (dataMap.containsKey("physiquename")) {
inspectPatientSaveReqVO.setZybs((String) dataMap.get("physiquename"));
}
if (dataMap.containsKey("features")) {
inspectPatientSaveReqVO.setFeatures((String) dataMap.get("features"));
}
}
patientService.medicalSnfeaturesupdate(inspectPatientSaveReqVO);
}
}
}
}
return success(true);
}
@GetMapping("/page")
@Operation(summary = "获得患者信息分页")
public CommonResult<PageResult<InspectPatientRespVO>> getPatientPage(@Valid InspectPatientPageReqVO pageReqVO) {