| 
					
				 | 
			
			
				@ -1,12 +1,20 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				package com.yihu.jw.care.endpoint.third.patient; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.alibaba.fastjson.JSONObject; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.care.service.course.CourseService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.care.service.org.BaseOrgService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.care.service.sign.ServicePackageService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.wx.BasePatientWechatDo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.restmodel.web.Envelop; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.restmodel.web.ListEnvelop; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.restmodel.web.ObjEnvelop; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.rm.patient.PatientRequestMapping; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.wechat.dao.BasePatientWechatDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.wechat.service.WechatInfoService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import io.swagger.annotations.Api; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import io.swagger.annotations.ApiOperation; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import io.swagger.annotations.ApiParam; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.apache.axis.utils.StringUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.beans.factory.annotation.Autowired; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.beans.factory.annotation.Value; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -33,6 +41,13 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private WechatInfoService wechatInfoService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private BasePatientWechatDao basePatientWechatDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private CourseService courseService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private BaseOrgService orgService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private ServicePackageService servicePackageService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 获取微信openid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -75,4 +90,82 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return  failedException(e); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @GetMapping("getCourseByOrg") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "在线报名-根据机构展示") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public ObjEnvelop getCourseByOrg( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "longitude", value = "所在位置经度", defaultValue = "118.10388605") @RequestParam(value = "longitude", required = true) String longitude, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "latitude", value = "所在位置纬度", defaultValue = "24.48923061") @RequestParam(value = "latitude", required = true) String latitude 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//            @ApiParam(name = "pageSize", value = "页面大小", defaultValue = "2") @RequestParam(value = "pageSize", required = true) int pageSize, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//            @ApiParam(name = "currentPage", value = "当前页面", defaultValue = "1") @RequestParam(value = "currentPage", required = true) int currentPage 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    ) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            JSONObject json = courseService.getCourseByOrg(longitude,latitude); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return ObjEnvelop.getSuccess("获取成功",json); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } catch (Exception e) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return failedObjEnvelopException(e); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @GetMapping("getOrgInfoById") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "在线报名-获取机构详情") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public ObjEnvelop getOrgInfoById( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "id", value = "机构id", defaultValue = "808080eb7861c327017861d18d070011") @RequestParam(value = "id", required = true) String id, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "patient", value = "居民code") @RequestParam(value = "patient", required = true) String patient 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    ) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            JSONObject json = courseService.getOrgInfoById(id,patient); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return ObjEnvelop.getSuccess("获取成功",json); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } catch (Exception e) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return failedObjEnvelopException(e); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @GetMapping("getTecInfoById") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "在线报名-获取教师详情(根据教师id)") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public ObjEnvelop getTecInfoById( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "doctor", value = "教师id", defaultValue = "402803816babc778016babca89ea0032") @RequestParam(value = "doctor", required = true) String doctor, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "orgCode", value = "机构code", defaultValue = "xm10086") @RequestParam(value = "orgCode", required = true) String orgCode, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "page", value = "page", defaultValue = "1") @RequestParam(value = "page", required = true) int page, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "size", value = "size", defaultValue = "10") @RequestParam(value = "size", required = true) int size 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    ) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            JSONObject json = courseService.getTecInfoById(doctor,orgCode,page,size); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return ObjEnvelop.getSuccess("获取成功",json); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } catch (Exception e) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return failedObjEnvelopException(e); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value = "/findOrgList", method = RequestMethod.GET) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "获取机构成员") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public ListEnvelop findOrgList(@ApiParam(name = "type", value = "机构类型1. 等级医院2. 社区医院3.  养老机构") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                   @RequestParam(value = "type", required = false) String type, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                   @ApiParam(name = "name", value = "机构名称") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                   @RequestParam(value = "name", required = false) String name, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                   @ApiParam(name = "orgCode", value = "orgCode") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                   @RequestParam(value = "orgCode", required = false) String orgCode) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return ListEnvelop.getSuccess("获取成功",orgService.findOrgList(type,name,orgCode)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } catch (Exception e) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return failedListEnvelopException(e); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @GetMapping(value = "findSignOrg") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "查找签约机构") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public ListEnvelop findSignOrg ( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "patient", value = "医生code", required = true) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "patient",required = true) String patient, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "name", value = "机构名称", required = false) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "name",required = false) String name, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "type", value = "类型 3 养老 4 教育,1 医疗", required = false) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "type",required = false) String type) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        try{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return ListEnvelop.getSuccess("查询成功",servicePackageService.findSignOrg(patient,name,type)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }catch (Exception e){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return failedListEnvelopException(e); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				} 
			 |