修改心电功能接口参数

This commit is contained in:
lxd 2025-03-25 10:36:22 +08:00
parent b1ae70419d
commit 0cb1ddcf41
9 changed files with 65 additions and 16 deletions

View File

@ -67,7 +67,21 @@ public class CommonResult<T> implements Serializable {
result.msg = ""; result.msg = "";
return result; return result;
} }
public static <T> CommonResult<T> success(T data, String msg) {
CommonResult<T> result = new CommonResult<>();
result.code = GlobalErrorCodeConstants.SUCCESS.getCode();
result.data = data;
result.msg = msg;
return result;
}
public static <T> CommonResult<T> success( String msg) {
CommonResult<T> result = new CommonResult<>();
result.code = GlobalErrorCodeConstants.SUCCESS.getCode();
result.data = null;
result.msg = msg;
return result;
}
public static boolean isSuccess(Integer code) { public static boolean isSuccess(Integer code) {
return Objects.equals(code, GlobalErrorCodeConstants.SUCCESS.getCode()); return Objects.equals(code, GlobalErrorCodeConstants.SUCCESS.getCode());
} }

View File

@ -159,7 +159,6 @@ public class DoctorController {
@GetMapping("/getAlllist") @GetMapping("/getAlllist")
@Operation(summary = "获得医生全部list") @Operation(summary = "获得医生全部list")
@PreAuthorize("@ss.hasPermission('doctor::query')")
public CommonResult<List<DoctorDO>> getAlllist() { public CommonResult<List<DoctorDO>> getAlllist() {
List<DoctorDO> doctorDOs = Service.getDoctorList(null); List<DoctorDO> doctorDOs = Service.getDoctorList(null);
@ -168,7 +167,6 @@ public class DoctorController {
@GetMapping("/getlist") @GetMapping("/getlist")
@Operation(summary = "获得医生list") @Operation(summary = "获得医生list")
@PreAuthorize("@ss.hasPermission('doctor::query')")
public CommonResult<List<DoctorDO>> getlist() { public CommonResult<List<DoctorDO>> getlist() {
//当前登陆用户 //当前登陆用户

View File

@ -18,13 +18,13 @@ public class JwtTokenInterceptor implements HandlerInterceptor {
if (JwtTokenService.verifyToken(token.trim())) if (JwtTokenService.verifyToken(token.trim()))
_out = true; _out = true;
else { else {
params.put("code", "TokenError"); params.put("code", "500");
params.put("msg", "TokenError"); params.put("msg", "TokenError");
responseReturn(response, params); responseReturn(response, params);
_out = false; _out = false;
} }
} else { } else {
params.put("code", "TokenEmpty"); params.put("code", "500");
params.put("msg", "TokenEmpty"); params.put("msg", "TokenEmpty");
responseReturn(response, params); responseReturn(response, params);
_out = false; _out = false;

View File

@ -36,6 +36,8 @@ import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils; import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.error;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
@ -99,11 +101,11 @@ public class EcganalysisparasController {
} }
@GetMapping("/getIdCardEcgData") @GetMapping("/getIdCardEcgData")
@Operation(summary = "通过身份证获取心电数据") @Operation(summary = "通过身份证获取心电数据")
public CommonResult<List<EcgidCardDataVO>> getIdCardEcgData(@RequestParam("idCard") String idCard) public CommonResult<List<EcgidCardDataVO>> getIdCardEcgData(@RequestParam("idCard") String idCard,@RequestParam("date") String datestring)
{ {
List<EcgidCardDataVO> list1 = new ArrayList<>(); List<EcgidCardDataVO> list1 = new ArrayList<>();
List<EcganalysisparasDO> list =ecganalysisparasService.idCardEcgData(idCard); List<EcganalysisparasDO> list =ecganalysisparasService.idCardEcgData(idCard,datestring);
if (list!=null) if (list!=null&&list.size()>0)
{ {
for (EcganalysisparasDO ecganalysisparasDO:list) for (EcganalysisparasDO ecganalysisparasDO:list)
{ {
@ -120,6 +122,10 @@ public class EcganalysisparasController {
ecgidCardDataVO.setHeartRateUneven(heartRateUneven); ecgidCardDataVO.setHeartRateUneven(heartRateUneven);
list1.add(ecgidCardDataVO); list1.add(ecgidCardDataVO);
} }
}
else
{
return success("未获取到相关数据");
} }
return success(list1); return success(list1);
} }

View File

@ -348,16 +348,16 @@ public class PatientexamlistController {
@Operation(summary = "超声审核更新数据") @Operation(summary = "超声审核更新数据")
@PreAuthorize("@ss.hasPermission('tblist:patientexamlist:update')") @PreAuthorize("@ss.hasPermission('tblist:patientexamlist:update')")
@LogRecord(type = "超声审核", subType = "审核", bizNo = "1002", success = "审核ID为{{#id}}的患者") @LogRecord(type = "超声审核", subType = "审核", bizNo = "1002", success = "审核ID为{{#id}}的患者")
public CommonResult<Boolean> examine(@RequestParam("id") String id) { public CommonResult<Boolean> examine(@RequestParam("id") String id,@RequestParam("doctorid") String doctorid,@RequestParam("doctorname") String doctorname) {
LocalDateTime dateTime = LocalDateTime.parse(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")), LocalDateTime dateTime = LocalDateTime.parse(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")),
DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
//获取当前登陆用户 //获取当前登陆用户
AdminUserDO user = userService.getUser(getLoginUserId()); // AdminUserDO user = userService.getUser(getLoginUserId());
PatientexamlistSaveReqVO updateReqVO = new PatientexamlistSaveReqVO(); PatientexamlistSaveReqVO updateReqVO = new PatientexamlistSaveReqVO();
updateReqVO.setId(id); updateReqVO.setId(id);
updateReqVO.setReviewDoctorId(user.getDoctorID()); updateReqVO.setReviewDoctorId(doctorid);
updateReqVO.setReviewDoctor(user.getDoctorname()); updateReqVO.setReviewDoctor(doctorname);
updateReqVO.setReviewDate(dateTime); updateReqVO.setReviewDate(dateTime);
updateReqVO.setReviewStatus("1"); updateReqVO.setReviewStatus("1");
updateReqVO.setReportstatus("已审核"); updateReqVO.setReportstatus("已审核");

View File

@ -131,6 +131,12 @@ public class PatientexamlistDO extends BaseDO {
*/ */
@TableField(value = "diagDoctor") @TableField(value = "diagDoctor")
private String diagDoctor; private String diagDoctor;
/**
* 诊断医生
*/
@TableField(value = "diagDoctorId")
private String diagDoctorId;
/** /**
* 审核医生ID * 审核医生ID
*/ */

View File

@ -76,7 +76,7 @@ public interface EcganalysisparasService extends IService<EcganalysisparasDO> {
/* /*
* 根据身份证号获取心电分析数据 * 根据身份证号获取心电分析数据
* */ * */
List<EcganalysisparasDO> idCardEcgData(String idcard); List<EcganalysisparasDO> idCardEcgData(String idcard,String dateString);
/** /**
* 获取心电分析数据对应的pdf图像 * 获取心电分析数据对应的pdf图像

View File

@ -23,6 +23,9 @@ import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
import cn.iocoder.yudao.module.tblist.controller.admin.ecganalysisparas.vo.*; import cn.iocoder.yudao.module.tblist.controller.admin.ecganalysisparas.vo.*;
@ -130,9 +133,23 @@ public class EcganalysisparasServiceImpl extends ServiceImpl<EcganalysisparasMap
return ecganalysisparasMapper.selectOne(queryWrapper); return ecganalysisparasMapper.selectOne(queryWrapper);
} }
@Override @Override
public List<EcganalysisparasDO> idCardEcgData(String idcard) { public List<EcganalysisparasDO> idCardEcgData(String idcard,String dateString) {
// 创建 QueryWrapper 并添加条件
QueryWrapper<EcganalysisparasDO> queryWrapper = new QueryWrapper<>(); QueryWrapper<EcganalysisparasDO> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("idcard", idcard); queryWrapper.eq("idcard", idcard);
// 检查日期字符串是否为空
if (dateString != null && !dateString.trim().isEmpty()) {
// 将字符串日期转换为 LocalDate
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
LocalDate localDate = LocalDate.parse(dateString, formatter);
// 创建 LocalDateTime 对象表示当天的开始时间
LocalDateTime startOfDay = localDate.atStartOfDay();
// 添加时间条件
queryWrapper.ge("doctorDiagTime", startOfDay);
}
return ecganalysisparasMapper.selectList(queryWrapper); return ecganalysisparasMapper.selectList(queryWrapper);
} }
@Override @Override

View File

@ -45,6 +45,7 @@ import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.tblist.dal.mysql.patientexamlist.PatientexamlistMapper; import cn.iocoder.yudao.module.tblist.dal.mysql.patientexamlist.PatientexamlistMapper;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.net.ssl.SSLContext;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
@ -629,20 +630,27 @@ public class PatientexamlistServiceImpl extends ServiceImpl<PatientexamlistMappe
return out; return out;
} }
private Image getAcroField_Image(String url) { public Image getAcroField_Image(String url) {
Image out = null; Image out = null;
try { try {
// 创建忽略证书验证的HttpClient
SSLContext sslContext = SSLContextBuilder.create()
.loadTrustMaterial(null, (x509Certificates, s) -> true)
.build();
HttpClient httpClient = HttpClients.custom() HttpClient httpClient = HttpClients.custom()
.setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE) .setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE)
.setSSLContext(SSLContextBuilder.create().loadTrustMaterial(null, (x509Certificates, s) -> true).build()) .setSSLContext(sslContext)
.build(); .build();
HttpGet request = new HttpGet(safeString(url)); HttpGet request = new HttpGet(safeString(url));
try (CloseableHttpResponse response = (CloseableHttpResponse) httpClient.execute(request)) { try (CloseableHttpResponse response = (CloseableHttpResponse) httpClient.execute(request)) {
byte[] imageData = EntityUtils.toByteArray(response.getEntity()); byte[] imageData = EntityUtils.toByteArray(response.getEntity());
if (imageData != null) if (imageData != null) {
out = Image.getInstance(imageData); out = Image.getInstance(imageData);
}
} }
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); // 打印异常信息以便调试
out = null; out = null;
} }
return out; return out;