Commit 85d4254d1ba26d65910c54a8d6f0a0742455ae9d

Authored by zhangchao
1 parent 01a17c5114
Exists in dev

#fix:优化五色专案管理新增挂号统计数据

Showing 2 changed files with 139 additions and 1 deletions

platform-dal/src/main/java/com/lyms/platform/pojo/AppointmentData.java View file @ 85d4254
  1 +package com.lyms.platform.pojo;
  2 +
  3 +public class AppointmentData {
  4 + private static final long serialVersionUID = 1L;
  5 + private String doctor;
  6 + //预约人数
  7 + private Integer appointmentNum;
  8 + //已经建立档案人数
  9 + private Integer buildNum;
  10 + //未建档人数
  11 + private Integer unBuildNum;
  12 + //新建档人数(当天建档人数)
  13 + private Integer newBuildNum;
  14 +
  15 + public Integer getUnBuildNum() {
  16 + return unBuildNum;
  17 + }
  18 +
  19 + public void setUnBuildNum(Integer unBuildNum) {
  20 + this.unBuildNum = unBuildNum;
  21 + }
  22 +
  23 + public String getDoctor() {
  24 + return doctor;
  25 + }
  26 +
  27 + public void setDoctor(String doctor) {
  28 + this.doctor = doctor;
  29 + }
  30 +
  31 + public Integer getAppointmentNum() {
  32 + return appointmentNum;
  33 + }
  34 +
  35 + public void setAppointmentNum(Integer appointmentNum) {
  36 + this.appointmentNum = appointmentNum;
  37 + }
  38 +
  39 + public Integer getBuildNum() {
  40 + return buildNum;
  41 + }
  42 +
  43 + public void setBuildNum(Integer buildNum) {
  44 + this.buildNum = buildNum;
  45 + }
  46 +
  47 + public Integer getNewBuildNum() {
  48 + return newBuildNum;
  49 + }
  50 +
  51 + public void setNewBuildNum(Integer newBuildNum) {
  52 + this.newBuildNum = newBuildNum;
  53 + }
  54 +
  55 +}
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientDtController.java View file @ 85d4254
... ... @@ -618,7 +618,7 @@
618 618 return antenatalExaminationFacade.addPatientNipt(patientNiptDTO,userId);
619 619 }
620 620 //大同需要特殊处理的护士名称
621   - private static final String doctors="孙慧洁,曹琴,温燕芳,牛冬燕,王改然,杜文瑞,习亚美,卫娜,施春花,胡雪娇";
  621 + private static final String doctors="孙慧洁,曹琴,温燕芳,牛冬燕,王改然,杜文瑞,习亚美,卫娜,施春花,胡雪娇,田保来";
622 622  
623 623 /**
624 624 * 预约挂号列表查询
... ... @@ -777,6 +777,89 @@
777 777 }
778 778 baseResponse.setObject(params);
779 779 }
  780 + baseResponse.setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
  781 + return baseResponse;
  782 + }
  783 +
  784 +
  785 + /**
  786 + * 预约统计管理列表
  787 + * @param authorization
  788 + * @param doctor
  789 + * @param startTime
  790 + * @param endTime
  791 + * @return
  792 + */
  793 + @RequestMapping(method = RequestMethod.GET, value = "/dt/appointment/statistics")
  794 + @ResponseBody
  795 + public BaseResponse appointmentStatistics(@RequestHeader("Authorization")String authorization,
  796 + @RequestParam String doctor,
  797 + @RequestParam String startTime,
  798 + @RequestParam String endTime){
  799 + if (!authorization.contains(Authorization)){
  800 + return new BaseObjectResponse().setErrorcode(-1).setErrormsg("权限异常");
  801 + }
  802 + BaseResponse baseResponse=new BaseResponse();
  803 + startTime=startTime+" 00:00:00";
  804 + endTime=endTime+" 23:59:59";
  805 + String dept=null;
  806 + if (doctor.equals("田保来")){
  807 + dept="产科";
  808 + }else {
  809 + return new BaseObjectResponse().setErrorcode(-1).setErrormsg("权限异常");
  810 + }
  811 + AppointmentQuery appointmentQuery=new AppointmentQuery();
  812 + appointmentQuery.setStartTime(startTime);
  813 + appointmentQuery.setEndTime(endTime);
  814 + appointmentQuery.setDept(dept);
  815 + List<AppointmentModel> modelList= appointmentService.queryAppointment(appointmentQuery);
  816 + if (CollectionUtils.isNotEmpty(modelList)){
  817 + Map<String,AppointmentData> params=new HashMap();
  818 + PatientsQuery patientsQuery =new PatientsQuery();
  819 + patientsQuery.setYn(1);
  820 + patientsQuery.setHospitalId(hospitalId);
  821 + for (int i = 0,j=modelList.size(); i < j; i++) {
  822 + AppointmentModel appointmentModel= modelList.get(i);
  823 + String doctorName=appointmentModel.getDoctor();
  824 + AppointmentData appointmentData= params.get(doctorName);
  825 + if (appointmentData==null){
  826 + appointmentData=new AppointmentData();
  827 + }
  828 + String idCard=appointmentModel.getIdCard();
  829 + String phone=appointmentModel.getPhone();
  830 + String username=appointmentModel.getName();
  831 + if (StringUtils.isNotEmpty(idCard)){
  832 + patientsQuery.setCardNo(idCard);
  833 + }else {
  834 + if (StringUtils.isNotEmpty(username)&&StringUtils.isNotEmpty(phone)){
  835 + patientsQuery.setName(username);
  836 + patientsQuery.setPhone(phone);
  837 + }else {
  838 + appointmentModel.setIsBuild(0);
  839 + //未建档
  840 + appointmentData.setUnBuildNum(appointmentData.getUnBuildNum()!=null?appointmentData.getUnBuildNum()+1:1);
  841 + }
  842 + }
  843 + if (appointmentModel.getIsBuild()==null){
  844 + List<Patients> patientsList= patientsService.queryPatient(patientsQuery);
  845 + if (CollectionUtils.isNotEmpty(patientsList)){
  846 + //已经建档
  847 + //新建档人数等于当天建档人数
  848 + Patients patients= patientsList.get(0);
  849 + if (DateUtil.isBetween(patients.getCreated(),DateUtil.parseYyyyMMddHHssmm(startTime),DateUtil.parseYyyyMMddHHssmm(endTime))){
  850 + appointmentData.setNewBuildNum(appointmentData.getNewBuildNum()!=null?appointmentData.getNewBuildNum()+1:1);
  851 + }
  852 + appointmentData.setBuildNum(appointmentData.getBuildNum()!=null?appointmentData.getBuildNum()+1:1);
  853 + }else {
  854 + //未建档
  855 + appointmentData.setUnBuildNum(appointmentData.getUnBuildNum()!=null?appointmentData.getUnBuildNum()+1:1);
  856 + }
  857 + }
  858 + appointmentData.setAppointmentNum(appointmentData.getAppointmentNum()!=null?appointmentData.getAppointmentNum()+1:1);
  859 + params.put(doctorName,appointmentData);
  860 + }
  861 + baseResponse.setObject(params);
  862 + }
780 863 baseResponse.setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
781 864 return baseResponse;
782 865 }