Commit 6ec67852cbcbfb796fc68c27ecf6175f7254b632

Authored by zhangchao
1 parent e82c33394d
Exists in dev

#fix:优化预约挂号列表,新增权限查询

Showing 6 changed files with 84 additions and 10 deletions

platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/AppointmentMapper.java View file @ 6ec6785
... ... @@ -7,6 +7,6 @@
7 7 import java.util.List;
8 8  
9 9 public interface AppointmentMapper {
10   - List<AppointmentModel> queryAppointment(@Param("doctor") String doctor, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("name")String name);
  10 + List<AppointmentModel> queryAppointment(@Param("doctor") String doctor, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("name")String name,@Param("dept")String dept);
11 11 }
platform-biz-service/src/main/java/com/lyms/platform/permission/service/AppointmentService.java View file @ 6ec6785
... ... @@ -5,7 +5,7 @@
5 5 import java.util.List;
6 6  
7 7 public interface AppointmentService {
8   - List<AppointmentModel> queryAppointment(String doctor, String startTime, String endTime,String name);
  8 + List<AppointmentModel> queryAppointment(String doctor, String startTime, String endTime,String name,String doctorName);
9 9  
10 10 }
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/AppointmentServiceImpl.java View file @ 6ec6785
... ... @@ -6,15 +6,20 @@
6 6 import org.springframework.beans.factory.annotation.Autowired;
7 7 import org.springframework.stereotype.Service;
8 8  
9   -import java.util.Date;
10 9 import java.util.List;
11 10 @Service("appointmentService")
12 11 public class AppointmentServiceImpl implements AppointmentService {
13 12 @Autowired
14 13 private AppointmentMapper appointmentMapper;
  14 +
15 15 @Override
16   - public List<AppointmentModel> queryAppointment(String doctor, String startTime, String endTime,String name) {
17   - return appointmentMapper.queryAppointment(doctor,startTime,endTime,name);
  16 + public List<AppointmentModel> queryAppointment(String doctor, String startTime, String endTime,String name,String doctorName) {
  17 + String dept=null;
  18 + if ("孙慧洁".equals(doctor)){
  19 + dept="产科门诊";
  20 + doctor=doctorName;
  21 + }
  22 + return appointmentMapper.queryAppointment(doctor,startTime,endTime,name,dept);
18 23 }
19 24 }
platform-biz-service/src/main/resources/mainOrm/master/AppointmentMapper.xml View file @ 6ec6785
... ... @@ -20,11 +20,19 @@
20 20  
21 21 <select id="queryAppointment" resultMap="BaseResultMap">
22 22 select * from appointment
23   - where doctor=#{doctor}
  23 + where
  24 + 1=1
  25 + <if test="doctor!=null">
  26 + and doctor=#{doctor}
  27 + </if>
  28 +
24 29 <if test="name!=null">
25 30 and name=#{name}
26 31 </if>
27   - and <![CDATA[checkTime>=#{startTime}]]>
  32 + <if test="dept!=null">
  33 + and dept=#{dept}
  34 + </if>
  35 + and <![CDATA[checkTime>=#{startTime}]]>
28 36 and <![CDATA[checkTime<=#{endTime}]]>
29 37 </select>
30 38 </mapper>
platform-dal/src/main/java/com/lyms/platform/pojo/AppointmentModel.java View file @ 6ec6785
... ... @@ -2,6 +2,8 @@
2 2  
3 3  
4 4  
  5 +import org.springframework.data.annotation.Transient;
  6 +
5 7 import java.util.Date;
6 8  
7 9 public class AppointmentModel {
... ... @@ -17,6 +19,9 @@
17 19 private Date checkTime;
18 20 private String doctor;
19 21 private String dept;
  22 + //是否建档 1为是 0为否
  23 + @Transient
  24 + private Integer isBuild;
20 25 private Date created;
21 26  
22 27 public Integer getId() {
... ... @@ -115,6 +120,14 @@
115 120 this.created = created;
116 121 }
117 122  
  123 + public Integer getIsBuild() {
  124 + return isBuild;
  125 + }
  126 +
  127 + public void setIsBuild(Integer isBuild) {
  128 + this.isBuild = isBuild;
  129 + }
  130 +
118 131 @Override
119 132 public String toString() {
120 133 return "AppointmentModel{" +
... ... @@ -129,6 +142,7 @@
129 142 ", checkTime=" + checkTime +
130 143 ", doctor='" + doctor + '\'' +
131 144 ", dept='" + dept + '\'' +
  145 + ", isBuild=" + isBuild +
132 146 ", created=" + created +
133 147 '}';
134 148 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientDtController.java View file @ 6ec6785
... ... @@ -487,13 +487,23 @@
487 487 return antenatalExaminationFacade.addPatientNipt(patientNiptDTO,userId);
488 488 }
489 489  
  490 + /**
  491 + * 预约挂号列表查询
  492 + * @param authorization
  493 + * @param doctor
  494 + * @param startTime
  495 + * @param endTime
  496 + * @param name
  497 + * @return
  498 + */
490 499 @RequestMapping(method = RequestMethod.GET, value = "/dt/appointment")
491 500 @ResponseBody
492 501 public BaseResponse getAppointment(@RequestHeader("Authorization")String authorization,
493 502 @RequestParam(required = true) String doctor,
494 503 @RequestParam(required = true) String startTime,
495 504 @RequestParam(required = true) String endTime,
496   - @RequestParam(required = false) String name
  505 + @RequestParam(required = false) String name,
  506 + @RequestParam(required = false) String doctorName
497 507  
498 508 ) {
499 509 if (!Authorization.equals(authorization)){
500 510  
... ... @@ -502,10 +512,47 @@
502 512 BaseResponse baseResponse=new BaseResponse();
503 513 startTime=startTime+" 00:00:00";
504 514 endTime=endTime+" 23:59:59";
505   - baseResponse.setObject(appointmentService.queryAppointment(doctor,startTime,endTime,name));
  515 + List<AppointmentModel> modelList= appointmentService.queryAppointment(doctor,startTime,endTime,name,doctorName);
  516 +
  517 + if (CollectionUtils.isNotEmpty(modelList)){
  518 + PatientsQuery patientsQuery =new PatientsQuery();
  519 + patientsQuery.setYn(1);
  520 + patientsQuery.setHospitalId(hospitalId);
  521 + for (int i = 0,j=modelList.size(); i < j; i++) {
  522 + AppointmentModel appointmentModel= modelList.get(i);
  523 + String idCard=appointmentModel.getIdCard();
  524 + String phone=appointmentModel.getPhone();
  525 + String username=appointmentModel.getName();
  526 + if (StringUtils.isNotEmpty(idCard)){
  527 + patientsQuery.setCardNo(idCard);
  528 + }else {
  529 + if (StringUtils.isNotEmpty(username)&&StringUtils.isNotEmpty(phone)){
  530 + patientsQuery.setName(username);
  531 + patientsQuery.setPhone(phone);
  532 + }else {
  533 + return baseResponse.setErrormsg("参数异常").setErrorcode(-1);
  534 + }
  535 + }
  536 + List<Patients> patientsList= patientsService.queryPatient(patientsQuery);
  537 + if (CollectionUtils.isNotEmpty(patientsList)){
  538 + appointmentModel.setIsBuild(1);
  539 + }else {
  540 + appointmentModel.setIsBuild(0);
  541 + }
  542 + }
  543 + }
  544 + baseResponse.setObject(modelList);
506 545 baseResponse.setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
507 546 return baseResponse;
508 547 }
  548 +
  549 + /**
  550 + * 挂号信息同步
  551 + * @param authorization
  552 + * @param doctor
  553 + * @param date
  554 + * @return
  555 + */
509 556 @RequestMapping(method = RequestMethod.GET, value = "/dt/sync/appointment")
510 557 @ResponseBody
511 558 public BaseResponse syncAppointmentList(@RequestHeader("Authorization")String authorization,
... ... @@ -518,7 +565,7 @@
518 565 params.put("doctor",doctor);
519 566 params.put("ksrq",date+" 00:00:00");
520 567 params.put("jsrq",date+" 23:59:59");
521   - String str= HttpClientUtil.doGet("/dtdyrm/getdtAppointment" ,params,"utf-8",null);
  568 + String str= HttpClientUtil.doGet("http://192.168.5.23:9090/dtdyrm/getdtAppointment" ,params,"utf-8",null);
522 569 System.out.println(str);
523 570 return new BaseResponse();
524 571 }