matianxiang пре 3 месеци
родитељ
комит
e95ccab6a7

+ 19 - 1
eitc-patient-app/src/main/java/com/eitc/patient/controller/AppDoctorController.java

@@ -5,8 +5,10 @@ import com.eitc.common.core.controller.BaseController;
5 5
 import com.eitc.common.core.domain.AjaxResult;
6 6
 import com.eitc.common.utils.JWTUtil;
7 7
 import com.eitc.patient.domain.CollectionDoctor;
8
+import com.eitc.patient.domain.PatientAppointment;
8 9
 import com.eitc.patient.service.ICollectionDoctorService;
9 10
 import com.eitc.patient.service.IDoctorService;
11
+import com.eitc.patient.service.IPatientAppointmentService;
10 12
 import com.eitc.patient.vo.DoctorVO;
11 13
 import io.swagger.annotations.Api;
12 14
 import io.swagger.annotations.ApiOperation;
@@ -37,6 +39,8 @@ public class AppDoctorController extends BaseController {
37 39
     private IDoctorService doctorService;
38 40
     @Resource
39 41
     private ICollectionDoctorService collectionDoctorService;
42
+    @Resource
43
+    private IPatientAppointmentService patientAppointmentService;
40 44
 
41 45
 
42 46
     @GetMapping("/list")
@@ -56,11 +60,25 @@ public class AppDoctorController extends BaseController {
56 60
                     .eq(CollectionDoctor::getDoctorId, doctorVO.getUserId())
57 61
                     .eq(CollectionDoctor::getAppUserId, JWTUtil.getAppUserId()));
58 62
             doctorVO.setIsCollection(counted > 0 ? 1 : 0);
59
-            doctorVO.setReceivePatientNum(666);
60 63
         }
61 64
 
62 65
         return success(list);
63 66
     }
64 67
 
68
+    @GetMapping("/detail")
69
+    @ApiOperation("出诊医生详情")
70
+    public AjaxResult detail(@RequestParam(name = "doctorId") Long doctorId) throws ParseException {
71
+        // 查询出诊医生
72
+        DoctorVO doctorVO = doctorService.getById(doctorId);
73
+
74
+        long counted = collectionDoctorService.count(Wrappers.<CollectionDoctor>lambdaQuery()
75
+                .eq(CollectionDoctor::getDoctorId, doctorVO.getUserId())
76
+                .eq(CollectionDoctor::getAppUserId, JWTUtil.getAppUserId()));
77
+        doctorVO.setIsCollection(counted > 0 ? 1 : 0);
78
+        doctorVO.setReceivePatientNum(patientAppointmentService.count(Wrappers.<PatientAppointment>lambdaQuery()
79
+                .eq(PatientAppointment::getAttendingDoctorId, doctorVO.getUserId())));
80
+
81
+        return success(doctorVO);
82
+    }
65 83
 
66 84
 }