|  | @ -12,6 +12,7 @@ import org.springframework.http.MediaType;
 | 
	
		
			
				|  |  | import org.springframework.web.bind.annotation.*;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import java.util.List;
 | 
	
		
			
				|  |  | import java.util.Map;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | /**
 | 
	
		
			
				|  |  |  * Created by Trick on 2018/5/31.
 | 
	
	
		
			
				|  | @ -24,106 +25,161 @@ public class SpecialistController extends BaseController {
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private SpecialistService specialistService;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @RequestMapping(value = "setPatientLabelInfo",method = RequestMethod.POST)
 | 
	
		
			
				|  |  |     @RequestMapping(value = "setPatientLabelInfo", method = RequestMethod.POST)
 | 
	
		
			
				|  |  |     @ApiOperation("设置居民标签")
 | 
	
		
			
				|  |  |     public String setPatientLabelInfo(@ApiParam(name = "json", value = "居民标签实体") @RequestParam(required = true) String json){
 | 
	
		
			
				|  |  |     public String setPatientLabelInfo(@ApiParam(name = "json", value = "居民标签实体") @RequestParam(required = true) String json) {
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             List<SignPatientLabelInfo> info = (List<SignPatientLabelInfo>) JSONArray.parseArray(json, SignPatientLabelInfo.class);
 | 
	
		
			
				|  |  |             return write(200,"获取成功","data",specialistService.setPatientLabelInfo(info));
 | 
	
		
			
				|  |  |         }catch (Exception e){
 | 
	
		
			
				|  |  |             return write(200, "获取成功", "data", specialistService.setPatientLabelInfo(info));
 | 
	
		
			
				|  |  |         } catch (Exception e) {
 | 
	
		
			
				|  |  |             error(e);
 | 
	
		
			
				|  |  |             return error(-1,"请求失败");
 | 
	
		
			
				|  |  |             return error(-1, "请求失败");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @RequestMapping(value = "findHealthAssistant",method = RequestMethod.GET)
 | 
	
		
			
				|  |  |     @RequestMapping(value = "findHealthAssistant", method = RequestMethod.GET)
 | 
	
		
			
				|  |  |     @ApiOperation("获取所有计管师")
 | 
	
		
			
				|  |  |     public String findHealthAssistant(){
 | 
	
		
			
				|  |  |     public String findHealthAssistant() {
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             return write(200,"获取成功","data",specialistService.findHealthAssistant());
 | 
	
		
			
				|  |  |         }catch (Exception e){
 | 
	
		
			
				|  |  |             return write(200, "获取成功", "data", specialistService.findHealthAssistant());
 | 
	
		
			
				|  |  |         } catch (Exception e) {
 | 
	
		
			
				|  |  |             error(e);
 | 
	
		
			
				|  |  |             return error(-1,"请求失败");
 | 
	
		
			
				|  |  |             return error(-1, "请求失败");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @RequestMapping(value = "findHealthAssistantPatientCount", method = RequestMethod.GET)
 | 
	
		
			
				|  |  |     @ApiOperation("获取所有计管师下居民数目")
 | 
	
		
			
				|  |  |     public String findHealthAssistantPatientCount(){
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             return write(200, "获取成功", "data", specialistService.findHealthAssistantPatientCount());
 | 
	
		
			
				|  |  |         } catch (Exception e) {
 | 
	
		
			
				|  |  |             error(e);
 | 
	
		
			
				|  |  |             return error(-1, "请求失败");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @RequestMapping(value = "findLabelbyType",method = RequestMethod.GET)
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @RequestMapping(value = "findLabelbyType", method = RequestMethod.GET)
 | 
	
		
			
				|  |  |     @ResponseBody
 | 
	
		
			
				|  |  |     @ApiOperation("获取标签")
 | 
	
		
			
				|  |  |     public String findLabelbyType(@ApiParam(name = "type", value = "标签类型") @RequestParam(required = true)String type,
 | 
	
		
			
				|  |  |                                   @ApiParam(name = "teamCode", value = "团队id") @RequestParam(required = false)Long teamCode){
 | 
	
		
			
				|  |  |     public String findLabelbyType(@ApiParam(name = "type", value = "标签类型") @RequestParam(required = true) String type,
 | 
	
		
			
				|  |  |                                   @ApiParam(name = "teamCode", value = "团队id") @RequestParam(required = false) Long teamCode) {
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             return write(200,"获取成功","data",specialistService.findLabelbyType(type,teamCode));
 | 
	
		
			
				|  |  |         }catch (Exception e){
 | 
	
		
			
				|  |  |             return write(200, "获取成功", "data", specialistService.findLabelbyType(type, teamCode));
 | 
	
		
			
				|  |  |         } catch (Exception e) {
 | 
	
		
			
				|  |  |             error(e);
 | 
	
		
			
				|  |  |             return error(-1,"请求失败");
 | 
	
		
			
				|  |  |             return error(-1, "请求失败");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @RequestMapping(value = "findSpecialistPatientRelationCout",method = RequestMethod.GET)
 | 
	
		
			
				|  |  |     @RequestMapping(value = "findLabelAndPatientCount", method = RequestMethod.GET)
 | 
	
		
			
				|  |  |     @ResponseBody
 | 
	
		
			
				|  |  |     @ApiOperation("获取标签与居民数量")
 | 
	
		
			
				|  |  |     public String findLabelAndPatientCount(@ApiParam(name = "doctor", value = "医生") @RequestParam(required = true)String doctor,
 | 
	
		
			
				|  |  |                                            @ApiParam(name = "type", value = "标签类型") @RequestParam(required = true)String type,
 | 
	
		
			
				|  |  |                                            @ApiParam(name = "teamCode", value = "团队id") @RequestParam(required = false)Long teamCode) {
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             return write(200, "获取成功", "data", specialistService.findLabelAndPatientCount(doctor,type,teamCode));
 | 
	
		
			
				|  |  |         } catch (Exception e) {
 | 
	
		
			
				|  |  |             error(e);
 | 
	
		
			
				|  |  |             return error(-1, "请求失败");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         @RequestMapping(value = "findSpecialistPatientRelationCout", method = RequestMethod.GET)
 | 
	
		
			
				|  |  |     @ResponseBody
 | 
	
		
			
				|  |  |     @ApiOperation("获取专科医生下未分配标签居民数目")
 | 
	
		
			
				|  |  |     public String findSpecialistPatientRelationCout(@ApiParam(name = "doctor", value = "医生code") @RequestParam(required = true)String doctor){
 | 
	
		
			
				|  |  |     public String findSpecialistPatientRelationCout(@ApiParam(name = "doctor", value = "医生code") @RequestParam(required = true) String doctor) {
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             return write(200,"获取成功","data",specialistService.findSpecialistPatientRelationCout(doctor));
 | 
	
		
			
				|  |  |         }catch (Exception e){
 | 
	
		
			
				|  |  |             return write(200, "获取成功", "data", specialistService.findSpecialistPatientRelationCout(doctor));
 | 
	
		
			
				|  |  |         } catch (Exception e) {
 | 
	
		
			
				|  |  |             error(e);
 | 
	
		
			
				|  |  |             return error(-1,"请求失败");
 | 
	
		
			
				|  |  |             return error(-1, "请求失败");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @RequestMapping(value = "findNoLabelPatientRelation",method = RequestMethod.GET)
 | 
	
		
			
				|  |  |     @RequestMapping(value = "findNoLabelPatientRelation", method = RequestMethod.GET)
 | 
	
		
			
				|  |  |     @ResponseBody
 | 
	
		
			
				|  |  |     @ApiOperation("获取专科医生下未分配标签居民")
 | 
	
		
			
				|  |  |     public  String findNoLabelPatientRelation(@ApiParam(name = "doctor", value = "医生code") @RequestParam(required = true)String doctor){
 | 
	
		
			
				|  |  |     public String findNoLabelPatientRelation(@ApiParam(name = "doctor", value = "医生code") @RequestParam(required = true) String doctor) {
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             return write(200,"获取成功","data",specialistService.findNoLabelPatientRelation(doctor));
 | 
	
		
			
				|  |  |         }catch (Exception e){
 | 
	
		
			
				|  |  |             return write(200, "获取成功", "data", specialistService.findNoLabelPatientRelation(doctor));
 | 
	
		
			
				|  |  |         } catch (Exception e) {
 | 
	
		
			
				|  |  |             error(e);
 | 
	
		
			
				|  |  |             return error(-1,"请求失败");
 | 
	
		
			
				|  |  |             return error(-1, "请求失败");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @RequestMapping(value = "findPatientRelatioByAssistant",method = RequestMethod.GET)
 | 
	
		
			
				|  |  |     @RequestMapping(value = "findPatientRelatioByAssistant", method = RequestMethod.GET)
 | 
	
		
			
				|  |  |     @ResponseBody
 | 
	
		
			
				|  |  |     @ApiOperation("获取计管师下未分配标签居民")
 | 
	
		
			
				|  |  |     public String findPatientRelatioByAssistant(@ApiParam(name = "assistant", value = "计管师") @RequestParam(required = true)String assistant,
 | 
	
		
			
				|  |  |                                                 @ApiParam(name = "page", value = "第几页,1开始") @RequestParam(required = true)Integer page,
 | 
	
		
			
				|  |  |                                                 @ApiParam(name = "size", value = "每页大小") @RequestParam(required = true)Integer size)throws Exception {
 | 
	
		
			
				|  |  |     public String findPatientRelatioByAssistant(@ApiParam(name = "assistant", value = "计管师") @RequestParam(required = true) String assistant,
 | 
	
		
			
				|  |  |                                                 @ApiParam(name = "page", value = "第几页,1开始") @RequestParam(required = true) Integer page,
 | 
	
		
			
				|  |  |                                                 @ApiParam(name = "size", value = "每页大小") @RequestParam(required = true) Integer size) throws Exception {
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             return write(200,"获取成功","data",specialistService.findPatientRelatioByAssistant(assistant,page,size));
 | 
	
		
			
				|  |  |         }catch (Exception e){
 | 
	
		
			
				|  |  |             return write(200, "获取成功", "data", specialistService.findPatientRelatioByAssistant(assistant, page, size));
 | 
	
		
			
				|  |  |         } catch (Exception e) {
 | 
	
		
			
				|  |  |             error(e);
 | 
	
		
			
				|  |  |             return error(-1,"请求失败");
 | 
	
		
			
				|  |  |             return error(-1, "请求失败");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @RequestMapping(value = "saveHealthAssistant",method = RequestMethod.POST)
 | 
	
		
			
				|  |  |     @RequestMapping(value = "saveHealthAssistant", method = RequestMethod.POST)
 | 
	
		
			
				|  |  |     @ResponseBody
 | 
	
		
			
				|  |  |     @ApiOperation("分配计管师居民")
 | 
	
		
			
				|  |  |     public String saveHealthAssistant(String json){
 | 
	
		
			
				|  |  |     public String saveHealthAssistant(String json) {
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             return write(200,"获取成功","data",specialistService.saveHealthAssistant(json));
 | 
	
		
			
				|  |  |         }catch (Exception e){
 | 
	
		
			
				|  |  |             return write(200, "获取成功", "data", specialistService.saveHealthAssistant(json));
 | 
	
		
			
				|  |  |         } catch (Exception e) {
 | 
	
		
			
				|  |  |             error(e);
 | 
	
		
			
				|  |  |             return error(-1,"请求失败");
 | 
	
		
			
				|  |  |             return error(-1, "请求失败");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @RequestMapping(value = "getPatientByLabel",method = RequestMethod.POST)
 | 
	
		
			
				|  |  |     @RequestMapping(value = "getPatientByLabel", method = RequestMethod.POST)
 | 
	
		
			
				|  |  |     @ResponseBody
 | 
	
		
			
				|  |  |     @ApiOperation("获取标签下居民")
 | 
	
		
			
				|  |  |     public String getPatientByLabel(@ApiParam(name = "labelType", value = "标签类型")String labelType,
 | 
	
		
			
				|  |  |                                     @ApiParam(name = "labelCode", value = "标签code")String labelCode,
 | 
	
		
			
				|  |  |                                     @ApiParam(name = "page", value = "第几页,1开始")Integer page,
 | 
	
		
			
				|  |  |                                     @ApiParam(name = "size", value = "每页大小")Integer size) {
 | 
	
		
			
				|  |  |     public String getPatientByLabel(@ApiParam(name = "doctor", value = "医生code") @RequestParam(required = true)String doctor,
 | 
	
		
			
				|  |  |                                     @ApiParam(name = "labelType", value = "标签类型")@RequestParam(required = true) String labelType,
 | 
	
		
			
				|  |  |                                     @ApiParam(name = "labelCode", value = "标签code") @RequestParam(required = true)String labelCode,
 | 
	
		
			
				|  |  |                                     @ApiParam(name = "page", value = "第几页,1开始") @RequestParam(required = true)Integer page,
 | 
	
		
			
				|  |  |                                     @ApiParam(name = "size", value = "每页大小")@RequestParam(required = true) Integer size) {
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             return write(200,"获取成功","data",specialistService.getPatientByLabel(labelType,labelCode,page,size));
 | 
	
		
			
				|  |  |         }catch (Exception e){
 | 
	
		
			
				|  |  |             return write(200, "获取成功", "data", specialistService.getPatientByLabel(doctor,labelType, labelCode, page, size));
 | 
	
		
			
				|  |  |         } catch (Exception e) {
 | 
	
		
			
				|  |  |             error(e);
 | 
	
		
			
				|  |  |             return error(-1,"请求失败");
 | 
	
		
			
				|  |  |             return error(-1, "请求失败");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @RequestMapping(value = "findDoctorTeamMenmber", method = RequestMethod.GET)
 | 
	
		
			
				|  |  |     @ResponseBody
 | 
	
		
			
				|  |  |     @ApiOperation("获取团队成员")
 | 
	
		
			
				|  |  |     public String findDoctorTeamMenmber(@ApiParam(name = "doctor", value = "医生code") @RequestParam(required = true)String doctor) {
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             return write(200, "获取成功", "data", specialistService.findDoctorTeamMenmber(doctor));
 | 
	
		
			
				|  |  |         } catch (Exception e) {
 | 
	
		
			
				|  |  |             error(e);
 | 
	
		
			
				|  |  |             return error(-1, "请求失败");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @RequestMapping(value = "getDoctorInHospital", method = RequestMethod.GET)
 | 
	
		
			
				|  |  |     @ResponseBody
 | 
	
		
			
				|  |  |     @ApiOperation("获取院内工作人员")
 | 
	
		
			
				|  |  |     public String getDoctorInHospital(@ApiParam(name = "doctor", value = "医生code") @RequestParam(required = true)String doctor,
 | 
	
		
			
				|  |  |                                       @ApiParam(name = "name", value = "医生姓名模糊") @RequestParam(required = false)String name,
 | 
	
		
			
				|  |  |                                       @ApiParam(name = "page", value = "第几页,1开始") @RequestParam(required = true)Integer page,
 | 
	
		
			
				|  |  |                                       @ApiParam(name = "size", value = "每页大小") @RequestParam(required = true)Integer size){
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             return write(200, "获取成功", "data", specialistService.getDoctorInHospital(doctor,name,page,size));
 | 
	
		
			
				|  |  |         } catch (Exception e) {
 | 
	
		
			
				|  |  |             error(e);
 | 
	
		
			
				|  |  |             return error(-1, "请求失败");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | }
 |