|  | @ -2,6 +2,7 @@ package com.yihu.jw.care.endpoint.doctor;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import com.alibaba.fastjson.JSONObject;
 | 
	
		
			
				|  |  | import com.yihu.jw.care.aop.ObserverRequired;
 | 
	
		
			
				|  |  | import com.yihu.jw.care.service.common.PermissionService;
 | 
	
		
			
				|  |  | import com.yihu.jw.care.service.consult.ConsultTeamService;
 | 
	
		
			
				|  |  | import com.yihu.jw.care.service.doctor.CareDoctorService;
 | 
	
		
			
				|  |  | import com.yihu.jw.care.service.doctor.DoctorServicePermissionsService;
 | 
	
	
		
			
				|  | @ -17,8 +18,10 @@ import io.swagger.annotations.Api;
 | 
	
		
			
				|  |  | import io.swagger.annotations.ApiOperation;
 | 
	
		
			
				|  |  | import io.swagger.annotations.ApiParam;
 | 
	
		
			
				|  |  | import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  | import org.springframework.beans.factory.annotation.Value;
 | 
	
		
			
				|  |  | import org.springframework.web.bind.annotation.*;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import javax.servlet.http.HttpServletRequest;
 | 
	
		
			
				|  |  | import java.util.List;
 | 
	
		
			
				|  |  | import java.util.Map;
 | 
	
		
			
				|  |  | 
 | 
	
	
		
			
				|  | @ -42,6 +45,9 @@ public class DoctorEndpoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  |     private EntranceUtil entranceUtil;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private DoctorServicePermissionsService doctorServicePermissionsService;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private PermissionService permissionService;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @PostMapping(value = "updOnline")
 | 
	
		
			
				|  |  |     @ApiOperation(value = "更新在线状态")
 | 
	
	
		
			
				|  | @ -52,6 +58,12 @@ public class DoctorEndpoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  |                              @RequestParam(value = "online", required = true)String online){
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         try{
 | 
	
		
			
				|  |  |             JSONObject param = new JSONObject();
 | 
	
		
			
				|  |  |             param.put("doctorId",doctorId);
 | 
	
		
			
				|  |  |             if(permissionService.noPermission(1,param)){
 | 
	
		
			
				|  |  |                 return Envelop.getError("该操作没有权限");
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             doctorService.updOnline(doctorId,online);
 | 
	
		
			
				|  |  |             return success("成功");
 | 
	
		
			
				|  |  |         }catch (Exception e){
 | 
	
	
		
			
				|  | @ -85,6 +97,12 @@ public class DoctorEndpoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  |             @ApiParam(name = "isRole", value = "是否返回角色(1是 0否)", required = false)
 | 
	
		
			
				|  |  |             @RequestParam(value = "isRole",required = false) String isRole){
 | 
	
		
			
				|  |  |         try{
 | 
	
		
			
				|  |  |             JSONObject param = new JSONObject();
 | 
	
		
			
				|  |  |             param.put("doctorId",doctorId);
 | 
	
		
			
				|  |  |             if(permissionService.noPermission(1,param)){
 | 
	
		
			
				|  |  |                 return ObjEnvelop.getError("该操作没有权限");
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             return ObjEnvelop.getSuccess("查询成功",doctorService.doctorInfo(doctorId,isRole));
 | 
	
		
			
				|  |  |         }catch (Exception e){
 | 
	
		
			
				|  |  |             return failedObjEnvelopException2(e);
 | 
	
	
		
			
				|  | @ -97,6 +115,12 @@ public class DoctorEndpoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  |             @ApiParam(name = "doctorId", value = "医生id", required = true)
 | 
	
		
			
				|  |  |             @RequestParam(value = "doctorId",required = true) String doctorId) {
 | 
	
		
			
				|  |  |         try{
 | 
	
		
			
				|  |  |             JSONObject param = new JSONObject();
 | 
	
		
			
				|  |  |             param.put("doctorId",doctorId);
 | 
	
		
			
				|  |  |             if(permissionService.noPermission(1,param)){
 | 
	
		
			
				|  |  |                 return ObjEnvelop.getError("该操作没有权限");
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             return ObjEnvelop.getSuccess("查询成功",doctorServicePermissionsService.findByDoctor(doctorId));
 | 
	
		
			
				|  |  |         }catch (Exception e){
 | 
	
		
			
				|  |  |             return failedObjEnvelopException2(e);
 | 
	
	
		
			
				|  | @ -109,6 +133,11 @@ public class DoctorEndpoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  |             @ApiParam(name = "doctorId", value = "医生id", required = true)
 | 
	
		
			
				|  |  |             @RequestParam(value = "doctorId",required = true) String doctorId){
 | 
	
		
			
				|  |  |         try{
 | 
	
		
			
				|  |  |             JSONObject param = new JSONObject();
 | 
	
		
			
				|  |  |             param.put("doctorId",doctorId);
 | 
	
		
			
				|  |  |             if(permissionService.noPermission(1,param)){
 | 
	
		
			
				|  |  |                 return ObjEnvelop.getError("该操作没有权限");
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             return ObjEnvelop.getSuccess("查询成功",capacityAssessmentRecordService.getPatientNum(doctorId));
 | 
	
		
			
				|  |  |         }catch (Exception e){
 | 
	
		
			
				|  |  |             return failedObjEnvelopException2(e);
 | 
	
	
		
			
				|  | @ -123,6 +152,13 @@ public class DoctorEndpoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  |             @RequestParam(value = "baseDoctorVo") String baseDoctorVo){
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             JSONObject jsonObject = JSONObject.parseObject(baseDoctorVo);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             JSONObject param = new JSONObject();
 | 
	
		
			
				|  |  |             param.put("doctorId",jsonObject.get("doctorId").toString());
 | 
	
		
			
				|  |  |             if(permissionService.noPermission(1,param)){
 | 
	
		
			
				|  |  |                 return ObjEnvelop.getError("该操作没有权限");
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             Boolean update = doctorService.update(jsonObject);
 | 
	
		
			
				|  |  |             if (!update){
 | 
	
		
			
				|  |  |                 return failed("保存失败,参数不可为空");
 | 
	
	
		
			
				|  | @ -144,7 +180,11 @@ public class DoctorEndpoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  |             @RequestParam(value = "orgType",defaultValue = "1,2") String orgType
 | 
	
		
			
				|  |  |     ){
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             JSONObject param = new JSONObject();
 | 
	
		
			
				|  |  |             param.put("doctorId",doctorId);
 | 
	
		
			
				|  |  |             if(permissionService.noPermission(1,param)){
 | 
	
		
			
				|  |  |                 return ListEnvelop.getError("该操作没有权限");
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             return ListEnvelop.getSuccess("查询成功", doctorService.getOrgList(doctorId,orgType));
 | 
	
		
			
				|  |  |         }catch (Exception e){
 | 
	
		
			
				|  |  |             return failedListEnvelopException2(e);
 | 
	
	
		
			
				|  | @ -205,6 +245,12 @@ public class DoctorEndpoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  |             @RequestParam(value = "size") int size
 | 
	
		
			
				|  |  |     ){
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             JSONObject param = new JSONObject();
 | 
	
		
			
				|  |  |             param.put("doctorId",doctor);
 | 
	
		
			
				|  |  |             if(permissionService.noPermission(1,param)){
 | 
	
		
			
				|  |  |                 return PageEnvelop.getError("该操作没有权限");
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             return doctorService.getTeacherChildren(doctor,searchType,name,page,size);
 | 
	
		
			
				|  |  |         }catch (Exception e){
 | 
	
		
			
				|  |  |             return failedPageEnvelopException2(e);
 | 
	
	
		
			
				|  | @ -217,6 +263,11 @@ public class DoctorEndpoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  |             @ApiParam(name = "doctor", value = "doctor")
 | 
	
		
			
				|  |  |             @RequestParam(value = "doctor",required = true) String doctor){
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             JSONObject param = new JSONObject();
 | 
	
		
			
				|  |  |             param.put("doctorId",doctor);
 | 
	
		
			
				|  |  |             if(permissionService.noPermission(1,param)){
 | 
	
		
			
				|  |  |                 return ObjEnvelop.getError("该操作没有权限");
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             return ObjEnvelop.getSuccess("查询成功",doctorService.getTeacherChildrenCount(doctor));
 | 
	
		
			
				|  |  |         }catch (Exception e){
 | 
	
		
			
				|  |  |             return failedObjEnvelopException2(e);
 | 
	
	
		
			
				|  | @ -230,6 +281,11 @@ public class DoctorEndpoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  | //            ,@ApiParam(name = "type", value = "type", defaultValue = "0") @RequestParam(value = "type",required = false) Integer type
 | 
	
		
			
				|  |  |     ){
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             JSONObject param = new JSONObject();
 | 
	
		
			
				|  |  |             param.put("doctorId",doctor);
 | 
	
		
			
				|  |  |             if(permissionService.noPermission(1,param)){
 | 
	
		
			
				|  |  |                 return ObjEnvelop.getError("该操作没有权限");
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             return ObjEnvelop.getSuccess("查询成功",doctorService.getNotificationCount(doctor));//,type
 | 
	
		
			
				|  |  |         }catch (Exception e){
 | 
	
		
			
				|  |  |             return failedObjEnvelopException2(e);
 | 
	
	
		
			
				|  | @ -249,6 +305,9 @@ public class DoctorEndpoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  |                                       @ApiParam(name = "size")
 | 
	
		
			
				|  |  |                                       @RequestParam(value = "size",required = true)Integer size){
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             if(permissionService.noPermission(0,null)){
 | 
	
		
			
				|  |  |                 return PageEnvelop.getError("该操作没有权限");
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             return doctorService.getArchiveList(type, signStatus,name,page, size);
 | 
	
		
			
				|  |  |         }catch (Exception e){
 | 
	
		
			
				|  |  |             return failedPageEnvelopException2(e);
 | 
	
	
		
			
				|  | @ -259,6 +318,9 @@ public class DoctorEndpoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  |     @ApiOperation(value = "管理员获取居民tab数量")
 | 
	
		
			
				|  |  |     public ObjEnvelop getArchiveNum(){
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             if(permissionService.noPermission(0,null)){
 | 
	
		
			
				|  |  |                 return ObjEnvelop.getError("该操作没有权限");
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             return ObjEnvelop.getSuccess("查询成功",doctorService.getArchiveNum()) ;
 | 
	
		
			
				|  |  |         }catch (Exception e){
 | 
	
		
			
				|  |  |             return failedObjEnvelopException2(e);
 | 
	
	
		
			
				|  | @ -269,6 +331,11 @@ public class DoctorEndpoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  |     @ApiOperation(value = "首页养老服务数量获取")
 | 
	
		
			
				|  |  |     public ObjEnvelop baseInfoCount(@ApiParam(name="doctor")@RequestParam(value = "doctor")String doctor){
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             JSONObject param = new JSONObject();
 | 
	
		
			
				|  |  |             param.put("doctorId",doctor);
 | 
	
		
			
				|  |  |             if(permissionService.noPermission(1,param)){
 | 
	
		
			
				|  |  |                 return ObjEnvelop.getError("该操作没有权限");
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             return ObjEnvelop.getSuccess("查询成功",doctorService.baseInfoCount(doctor)) ;
 | 
	
		
			
				|  |  |         }catch (Exception e){
 | 
	
		
			
				|  |  |             return failedObjEnvelopException2(e);
 | 
	
	
		
			
				|  | @ -303,6 +370,11 @@ public class DoctorEndpoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  |     @ApiOperation(value = "首页养老服务数量获取")
 | 
	
		
			
				|  |  |     public ObjEnvelop baseHelperInfoCount(@ApiParam(name="doctor")@RequestParam(value = "doctor")String doctor){
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             JSONObject param = new JSONObject();
 | 
	
		
			
				|  |  |             param.put("doctorId",doctor);
 | 
	
		
			
				|  |  |             if(permissionService.noPermission(1,param)){
 | 
	
		
			
				|  |  |                 return ObjEnvelop.getError("该操作没有权限");
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             return ObjEnvelop.getSuccess("查询成功",doctorService.baseHelperInfoCount(doctor)) ;
 | 
	
		
			
				|  |  |         }catch (Exception e){
 | 
	
		
			
				|  |  |             return failedObjEnvelopException2(e);
 | 
	
	
		
			
				|  | @ -315,6 +387,11 @@ public class DoctorEndpoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  |             @ApiParam(name = "doctorId", value = "医生id", required = true)
 | 
	
		
			
				|  |  |             @RequestParam(value = "doctorId",required = true) String doctorId){
 | 
	
		
			
				|  |  |         try{
 | 
	
		
			
				|  |  |             JSONObject param = new JSONObject();
 | 
	
		
			
				|  |  |             param.put("doctorId",doctorId);
 | 
	
		
			
				|  |  |             if(permissionService.noPermission(1,param)){
 | 
	
		
			
				|  |  |                 return ObjEnvelop.getError("该操作没有权限");
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             return ObjEnvelop.getSuccess("查询成功",capacityAssessmentRecordService.getHelperPatientNum(doctorId));
 | 
	
		
			
				|  |  |         }catch (Exception e){
 | 
	
		
			
				|  |  |             return failedObjEnvelopException2(e);
 |