Browse Source

fix: 出诊医生详情

matianxiang 3 months ago
parent
commit
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
 import com.eitc.common.core.domain.AjaxResult;
5
 import com.eitc.common.core.domain.AjaxResult;
6
 import com.eitc.common.utils.JWTUtil;
6
 import com.eitc.common.utils.JWTUtil;
7
 import com.eitc.patient.domain.CollectionDoctor;
7
 import com.eitc.patient.domain.CollectionDoctor;
8
+import com.eitc.patient.domain.PatientAppointment;
8
 import com.eitc.patient.service.ICollectionDoctorService;
9
 import com.eitc.patient.service.ICollectionDoctorService;
9
 import com.eitc.patient.service.IDoctorService;
10
 import com.eitc.patient.service.IDoctorService;
11
+import com.eitc.patient.service.IPatientAppointmentService;
10
 import com.eitc.patient.vo.DoctorVO;
12
 import com.eitc.patient.vo.DoctorVO;
11
 import io.swagger.annotations.Api;
13
 import io.swagger.annotations.Api;
12
 import io.swagger.annotations.ApiOperation;
14
 import io.swagger.annotations.ApiOperation;
@@ -37,6 +39,8 @@ public class AppDoctorController extends BaseController {
37
     private IDoctorService doctorService;
39
     private IDoctorService doctorService;
38
     @Resource
40
     @Resource
39
     private ICollectionDoctorService collectionDoctorService;
41
     private ICollectionDoctorService collectionDoctorService;
42
+    @Resource
43
+    private IPatientAppointmentService patientAppointmentService;
40
 
44
 
41
 
45
 
42
     @GetMapping("/list")
46
     @GetMapping("/list")
@@ -56,11 +60,25 @@ public class AppDoctorController extends BaseController {
56
                     .eq(CollectionDoctor::getDoctorId, doctorVO.getUserId())
60
                     .eq(CollectionDoctor::getDoctorId, doctorVO.getUserId())
57
                     .eq(CollectionDoctor::getAppUserId, JWTUtil.getAppUserId()));
61
                     .eq(CollectionDoctor::getAppUserId, JWTUtil.getAppUserId()));
58
             doctorVO.setIsCollection(counted > 0 ? 1 : 0);
62
             doctorVO.setIsCollection(counted > 0 ? 1 : 0);
59
-            doctorVO.setReceivePatientNum(666);
60
         }
63
         }
61
 
64
 
62
         return success(list);
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
 }