|  | @ -15,6 +15,7 @@ import com.yihu.wlyy.web.BaseController;
 | 
	
		
			
				|  |  | import io.swagger.annotations.Api;
 | 
	
		
			
				|  |  | import io.swagger.annotations.ApiOperation;
 | 
	
		
			
				|  |  | import io.swagger.annotations.ApiParam;
 | 
	
		
			
				|  |  | import org.apache.commons.lang3.StringUtils;
 | 
	
		
			
				|  |  | import org.apache.commons.lang3.tuple.Pair;
 | 
	
		
			
				|  |  | import org.json.JSONArray;
 | 
	
		
			
				|  |  | import org.json.JSONObject;
 | 
	
	
		
			
				|  | @ -74,7 +75,7 @@ public class AdminTeamController extends BaseController {
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @RequestMapping(value = "/remove", method = RequestMethod.POST)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "删除团队信息")
 | 
	
		
			
				|  |  |     public String deleteTeam(@RequestParam("teamId") long teamId){
 | 
	
		
			
				|  |  |     public String deleteTeam(@RequestParam("teamId") long teamId) {
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             teamService.deleteTeam(teamId);
 | 
	
		
			
				|  |  | 
 | 
	
	
		
			
				|  | @ -162,7 +163,7 @@ public class AdminTeamController extends BaseController {
 | 
	
		
			
				|  |  | //  @ApiOperation(value = "获取团队成员,排除自己和专科医生")
 | 
	
		
			
				|  |  |     public String getTeamMembersExcludedThisAndLevel3(@PathVariable("team_id") long teamId) {
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             List<Doctor> members = memberService.getMembers(teamId,super.getUID());
 | 
	
		
			
				|  |  |             List<Doctor> members = memberService.getMembers(teamId, super.getUID());
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             return write(200, "OK", "data", new JSONArray(copyBeans(members, "id", "code", "name", "hospital",
 | 
	
		
			
				|  |  |                     "jobName", "level", "sex", "photo")));
 | 
	
	
		
			
				|  | @ -211,7 +212,7 @@ public class AdminTeamController extends BaseController {
 | 
	
		
			
				|  |  |     public String getLeaderTeam(@PathVariable("doctor_code") String doctorCode) {
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             AdminTeam team = teamService.findByLeaderCode(doctorCode);
 | 
	
		
			
				|  |  |             if(team == null){
 | 
	
		
			
				|  |  |             if (team == null) {
 | 
	
		
			
				|  |  |                 return error(-2, "没有找到数据!");
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             return write(200, "OK", "data", new JSONObject(team));
 | 
	
	
		
			
				|  | @ -238,7 +239,7 @@ public class AdminTeamController extends BaseController {
 | 
	
		
			
				|  |  |     @ApiOperation(value = "根据患者代码,获取医生团队信息")
 | 
	
		
			
				|  |  |     public String getTeam(@PathVariable("patient_code") String patientCode) {
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |            Map<String, Object> team = teamService.getPatientSigningTeam(patientCode,super.getUID());
 | 
	
		
			
				|  |  |             Map<String, Object> team = teamService.getPatientSigningTeam(patientCode, super.getUID());
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             return write(200, "OK", "data", new JSONObject(team));
 | 
	
		
			
				|  |  |         } catch (Exception e) {
 | 
	
	
		
			
				|  | @ -272,7 +273,7 @@ public class AdminTeamController extends BaseController {
 | 
	
		
			
				|  |  |             page = page <= 0 ? 0 : page - 1;
 | 
	
		
			
				|  |  |             List<Patient> patients = memberService.getMemberSigningPatients(teamId, healthDoctorCode, page, size);
 | 
	
		
			
				|  |  |             List<Map<String, Object>> simplifiedPatients = new ArrayList<>();
 | 
	
		
			
				|  |  |             for (Patient patient : patients){
 | 
	
		
			
				|  |  |             for (Patient patient : patients) {
 | 
	
		
			
				|  |  |                 Map<String, Object> simplified = new HashMap<>();
 | 
	
		
			
				|  |  |                 simplified.put("code", patient.getCode());
 | 
	
		
			
				|  |  |                 simplified.put("name", patient.getName());
 | 
	
	
		
			
				|  | @ -280,7 +281,7 @@ public class AdminTeamController extends BaseController {
 | 
	
		
			
				|  |  |                 simplified.put("photo", patient.getPhoto());
 | 
	
		
			
				|  |  |                 simplified.put("age", IdCardUtil.getAgeForIdcard(patient.getIdcard()));
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                 List<SignPatientLabelInfo>  diseases = signPatientLabelInfoService.getPatientLabelByLabelType(patient.getCode(),"3");
 | 
	
		
			
				|  |  |                 List<SignPatientLabelInfo> diseases = signPatientLabelInfoService.getPatientLabelByLabelType(patient.getCode(), "3");
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                 List<String> simplifiedDisease = diseases.stream().map(SignPatientLabelInfo::getLabelName).collect(Collectors.toList());
 | 
	
		
			
				|  |  | 
 | 
	
	
		
			
				|  | @ -296,4 +297,20 @@ public class AdminTeamController extends BaseController {
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @RequestMapping(value = "/teams/patient", method = RequestMethod.GET)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "查询居民与当前医生的签约团队")
 | 
	
		
			
				|  |  |     public String getPatientAndDoctorTeam(@RequestParam String patient) {
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             if (StringUtils.isEmpty(patient)) {
 | 
	
		
			
				|  |  |                 return error(-1, "居民不能为空");
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             JSONArray result = teamService.findPatientDoctorTeam(patient, getUID());
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             return write(200, "查询成功", "data", result);
 | 
	
		
			
				|  |  |         } catch (Exception e) {
 | 
	
		
			
				|  |  |             e.printStackTrace();
 | 
	
		
			
				|  |  |             return error(-1, "查询失败");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | }
 |