增加日期查询

This commit is contained in:
Euni4U 2025-04-04 14:59:59 +08:00
parent 0e792b138b
commit 34593a58b3
9 changed files with 42 additions and 5 deletions

View File

@ -73,6 +73,7 @@ import javax.validation.Valid;
import com.fasterxml.jackson.databind.ObjectMapper;
import cn.iocoder.yudao.module.inspect.service.inspectapplylog.InspectApplylogService;
import org.springframework.format.annotation.DateTimeFormat;
@Tag(name = "管理后台 - 患者信息")
@RestController
@ -1223,8 +1224,10 @@ public class InspectPatientController {
@PutMapping("/updatePrintStatus")
@Operation(summary = "更新打印状态")
public CommonResult<Boolean> updatePrintStatus(@RequestParam("medicalSn") String medicalSn) {
patientService.isprintupdate(medicalSn);
public CommonResult<Boolean> updatePrintStatus(@RequestParam("medicalSn") String medicalSn,
@RequestParam(value = "printtime", required = false)
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) Date printtime) {
patientService.isprintupdate(medicalSn, printtime);
return success(true);
}
}

View File

@ -62,6 +62,9 @@ public class InspectPatientInfoVO {
@Schema(description = "是否打印导检单")
private Integer isprint;
@Schema(description = "打印时间")
private String printtime;
@Schema(description = "总检医生id")
private Integer chiefinspectorid;

View File

@ -121,6 +121,16 @@ public class InspectPatientPageReqVO extends PageParam {
@Schema(description = "是否打印导检单")
private Integer isprint;
@Schema(description = "打印时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss ", timezone = "GMT+8")
private LocalDateTime printtime;
@Schema(description = "打印时间范围")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss ", timezone = "GMT+8")
private LocalDateTime[] printTimeRange;
@Schema(description = "总检医生id")
private Integer chiefinspectorid;

View File

@ -139,6 +139,11 @@ public class InspectPatientRespVO {
@Schema(description = "是否打印导检单")
private Integer isprint;
@Schema(description = "打印时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss ", timezone = "GMT+8")
private LocalDateTime printtime;
@Schema(description = "总检医生id")
private Integer chiefinspectorid;

View File

@ -114,6 +114,9 @@ public class InspectPatientSaveReqVO {
@Schema(description = "是否打印导检单")
private Integer isprint;
@Schema(description = "打印时间")
private LocalDateTime printtime;
@Schema(description = "总检医生id")
private Integer chiefinspectorid;

View File

@ -200,7 +200,12 @@ public class InspectPatientDO {
@TableField("chiefinspector")
private String chiefinspector;
/**
* 打印时间
*/
@TableField("printtime")
@JsonFormat(pattern = "yyyy-MM-dd yyyy-MM-dd HH:mm:ss")
private LocalDateTime printtime;
}

View File

@ -43,6 +43,7 @@ public interface InspectPatientMapper extends BaseMapperX<InspectPatientDO> {
.eqIfPresent(InspectPatientDO::getInspectionOpinion, reqVO.getInspectionOpinion())
.eqIfPresent(InspectPatientDO::getIsprint, reqVO.getIsprint())
.betweenIfPresent(InspectPatientDO::getAuditorTime, reqVO.getAuditorTime())
.betweenIfPresent(InspectPatientDO::getPrinttime, reqVO.getPrintTimeRange())
.orderByDesc(InspectPatientDO::getId);
if (reqVO.getInspectionStatus() != null) {
if (reqVO.getInspectionStatus() == 0) {

View File

@ -54,7 +54,7 @@ public interface InspectPatientService {
/*
* 更新打印状态
* */
void isprintupdate(String medicalSn);
void isprintupdate(String medicalSn, Date printtime);
/**
* 删除患者信息

View File

@ -39,6 +39,7 @@ import java.awt.image.BufferedImage;
import java.io.*;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
@ -117,10 +118,16 @@ public class InspectPatientServiceImpl implements InspectPatientService {
patientMapper.update(null, updateWrapper);
}
@Override
public void isprintupdate(String medicalSn) {
public void isprintupdate(String medicalSn, Date printtime) {
LambdaUpdateWrapper<InspectPatientDO> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(InspectPatientDO::getMedicalSn, medicalSn)
.set(InspectPatientDO::getIsprint, 1); // 1 表示已打印
// 如果printtime不为null则设置打印时间
if (printtime != null) {
updateWrapper.set(InspectPatientDO::getPrinttime, printtime.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime());
}
patientMapper.update(null, updateWrapper);
}
@Override