From 85d4254d1ba26d65910c54a8d6f0a0742455ae9d Mon Sep 17 00:00:00 2001 From: zhangchao Date: Thu, 17 Oct 2024 13:55:34 +0800 Subject: [PATCH] =?UTF-8?q?#fix:=E4=BC=98=E5=8C=96=E4=BA=94=E8=89=B2?= =?UTF-8?q?=E4=B8=93=E6=A1=88=E7=AE=A1=E7=90=86=E6=96=B0=E5=A2=9E=E6=8C=82?= =?UTF-8?q?=E5=8F=B7=E7=BB=9F=E8=AE=A1=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/lyms/platform/pojo/AppointmentData.java | 55 ++++++++++++++ .../web/controller/PatientDtController.java | 85 +++++++++++++++++++++- 2 files changed, 139 insertions(+), 1 deletion(-) create mode 100644 platform-dal/src/main/java/com/lyms/platform/pojo/AppointmentData.java diff --git a/platform-dal/src/main/java/com/lyms/platform/pojo/AppointmentData.java b/platform-dal/src/main/java/com/lyms/platform/pojo/AppointmentData.java new file mode 100644 index 0000000..2315818 --- /dev/null +++ b/platform-dal/src/main/java/com/lyms/platform/pojo/AppointmentData.java @@ -0,0 +1,55 @@ +package com.lyms.platform.pojo; + +public class AppointmentData { + private static final long serialVersionUID = 1L; + private String doctor; + //预约人数 + private Integer appointmentNum; + //已经建立档案人数 + private Integer buildNum; + //未建档人数 + private Integer unBuildNum; + //新建档人数(当天建档人数) + private Integer newBuildNum; + + public Integer getUnBuildNum() { + return unBuildNum; + } + + public void setUnBuildNum(Integer unBuildNum) { + this.unBuildNum = unBuildNum; + } + + public String getDoctor() { + return doctor; + } + + public void setDoctor(String doctor) { + this.doctor = doctor; + } + + public Integer getAppointmentNum() { + return appointmentNum; + } + + public void setAppointmentNum(Integer appointmentNum) { + this.appointmentNum = appointmentNum; + } + + public Integer getBuildNum() { + return buildNum; + } + + public void setBuildNum(Integer buildNum) { + this.buildNum = buildNum; + } + + public Integer getNewBuildNum() { + return newBuildNum; + } + + public void setNewBuildNum(Integer newBuildNum) { + this.newBuildNum = newBuildNum; + } + +} diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientDtController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientDtController.java index 206f4d5..a31a058 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientDtController.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientDtController.java @@ -618,7 +618,7 @@ public class PatientDtController extends BaseController { return antenatalExaminationFacade.addPatientNipt(patientNiptDTO,userId); } //大同需要特殊处理的护士名称 - private static final String doctors="孙慧洁,曹琴,温燕芳,牛冬燕,王改然,杜文瑞,习亚美,卫娜,施春花,胡雪娇"; + private static final String doctors="孙慧洁,曹琴,温燕芳,牛冬燕,王改然,杜文瑞,习亚美,卫娜,施春花,胡雪娇,田保来"; /** * 预约挂号列表查询 @@ -781,6 +781,89 @@ public class PatientDtController extends BaseController { return baseResponse; } + + /** + * 预约统计管理列表 + * @param authorization + * @param doctor + * @param startTime + * @param endTime + * @return + */ + @RequestMapping(method = RequestMethod.GET, value = "/dt/appointment/statistics") + @ResponseBody + public BaseResponse appointmentStatistics(@RequestHeader("Authorization")String authorization, + @RequestParam String doctor, + @RequestParam String startTime, + @RequestParam String endTime){ + if (!authorization.contains(Authorization)){ + return new BaseObjectResponse().setErrorcode(-1).setErrormsg("权限异常"); + } + BaseResponse baseResponse=new BaseResponse(); + startTime=startTime+" 00:00:00"; + endTime=endTime+" 23:59:59"; + String dept=null; + if (doctor.equals("田保来")){ + dept="产科"; + }else { + return new BaseObjectResponse().setErrorcode(-1).setErrormsg("权限异常"); + } + AppointmentQuery appointmentQuery=new AppointmentQuery(); + appointmentQuery.setStartTime(startTime); + appointmentQuery.setEndTime(endTime); + appointmentQuery.setDept(dept); + List modelList= appointmentService.queryAppointment(appointmentQuery); + if (CollectionUtils.isNotEmpty(modelList)){ + Map params=new HashMap(); + PatientsQuery patientsQuery =new PatientsQuery(); + patientsQuery.setYn(1); + patientsQuery.setHospitalId(hospitalId); + for (int i = 0,j=modelList.size(); i < j; i++) { + AppointmentModel appointmentModel= modelList.get(i); + String doctorName=appointmentModel.getDoctor(); + AppointmentData appointmentData= params.get(doctorName); + if (appointmentData==null){ + appointmentData=new AppointmentData(); + } + String idCard=appointmentModel.getIdCard(); + String phone=appointmentModel.getPhone(); + String username=appointmentModel.getName(); + if (StringUtils.isNotEmpty(idCard)){ + patientsQuery.setCardNo(idCard); + }else { + if (StringUtils.isNotEmpty(username)&&StringUtils.isNotEmpty(phone)){ + patientsQuery.setName(username); + patientsQuery.setPhone(phone); + }else { + appointmentModel.setIsBuild(0); + //未建档 + appointmentData.setUnBuildNum(appointmentData.getUnBuildNum()!=null?appointmentData.getUnBuildNum()+1:1); + } + } + if (appointmentModel.getIsBuild()==null){ + List patientsList= patientsService.queryPatient(patientsQuery); + if (CollectionUtils.isNotEmpty(patientsList)){ + //已经建档 + //新建档人数等于当天建档人数 + Patients patients= patientsList.get(0); + if (DateUtil.isBetween(patients.getCreated(),DateUtil.parseYyyyMMddHHssmm(startTime),DateUtil.parseYyyyMMddHHssmm(endTime))){ + appointmentData.setNewBuildNum(appointmentData.getNewBuildNum()!=null?appointmentData.getNewBuildNum()+1:1); + } + appointmentData.setBuildNum(appointmentData.getBuildNum()!=null?appointmentData.getBuildNum()+1:1); + }else { + //未建档 + appointmentData.setUnBuildNum(appointmentData.getUnBuildNum()!=null?appointmentData.getUnBuildNum()+1:1); + } + } + appointmentData.setAppointmentNum(appointmentData.getAppointmentNum()!=null?appointmentData.getAppointmentNum()+1:1); + params.put(doctorName,appointmentData); + } + baseResponse.setObject(params); + } + baseResponse.setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); + return baseResponse; + } + /** * 挂号信息同步 * @param authorization -- 1.8.3.1