|
@ -2,7 +2,6 @@ package com.yihu.wlyy.web.doctor.team;
|
|
|
|
|
|
import com.yihu.wlyy.entity.doctor.profile.Doctor;
|
|
|
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
|
|
|
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeamMember;
|
|
|
import com.yihu.wlyy.service.app.account.DoctorInfoService;
|
|
|
import com.yihu.wlyy.service.app.team.AdminTeamService;
|
|
|
import com.yihu.wlyy.web.BaseController;
|
|
@ -13,12 +12,12 @@ import org.json.JSONObject;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
@Controller
|
|
|
@RestController
|
|
|
@RequestMapping(value = "/doctor/admin-teams", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
|
@Api(description = "医生行政团队")
|
|
|
public class AdminTeamController extends BaseController {
|
|
@ -31,7 +30,6 @@ public class AdminTeamController extends BaseController {
|
|
|
@Autowired
|
|
|
private AdminTeamService memberService;
|
|
|
|
|
|
@ResponseBody
|
|
|
@RequestMapping(value = "/count", method = RequestMethod.GET)
|
|
|
@ApiOperation(value = "团队数量")
|
|
|
public String teamCount() {
|
|
@ -58,7 +56,6 @@ public class AdminTeamController extends BaseController {
|
|
|
return null;
|
|
|
}*/
|
|
|
|
|
|
@ResponseBody
|
|
|
@RequestMapping(method = RequestMethod.POST)
|
|
|
@ApiOperation(value = "创建团队")
|
|
|
public String createTeam(@RequestParam("team_name") String teamName,
|
|
@ -76,7 +73,6 @@ public class AdminTeamController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@ResponseBody
|
|
|
@RequestMapping(value = "/{team_id}/name", method = RequestMethod.PUT)
|
|
|
@ApiOperation(value = "更新团队名称")
|
|
|
public String updateTeamName(@PathVariable("team_id") long teamId,
|
|
@ -91,7 +87,6 @@ public class AdminTeamController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@ResponseBody
|
|
|
@RequestMapping(value = "/{team_id}/leader", method = RequestMethod.PUT)
|
|
|
@ApiOperation(value = "更新团队领导")
|
|
|
public String updateTeamLeader(@PathVariable("team_id") long teamId,
|
|
@ -106,7 +101,6 @@ public class AdminTeamController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@ResponseBody
|
|
|
@RequestMapping(value = "/{team_id}", method = RequestMethod.GET)
|
|
|
@ApiOperation(value = "团队信息")
|
|
|
public String getTeam(@PathVariable("team_id") long teamId) {
|
|
@ -120,7 +114,6 @@ public class AdminTeamController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@ResponseBody
|
|
|
@RequestMapping(value = "/{team_id}/members", method = RequestMethod.POST)
|
|
|
@ApiOperation(value = "添加团队成员")
|
|
|
public String addMember(@PathVariable("team_id") long teamId,
|
|
@ -135,13 +128,11 @@ public class AdminTeamController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@ResponseBody
|
|
|
@RequestMapping(value = "/{team_id}/members", method = RequestMethod.GET)
|
|
|
@ApiOperation(value = "获取团队成员")
|
|
|
public String getTeamMembers(@PathVariable("team_id") long teamId,
|
|
|
@RequestParam(value = "doctor_role", required = false) String role) {
|
|
|
public String getTeamMembers(@PathVariable("team_id") long teamId) {
|
|
|
try {
|
|
|
List<Doctor> members = memberService.getMembers(teamId, role);
|
|
|
List<Doctor> members = memberService.getMembers(teamId);
|
|
|
|
|
|
return write(200, "OK", "data", new JSONArray(members));
|
|
|
} catch (Exception e) {
|
|
@ -150,7 +141,6 @@ public class AdminTeamController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@ResponseBody
|
|
|
@RequestMapping(value = "/{team_id}/members/{doctor_code}", method = RequestMethod.DELETE)
|
|
|
@ResponseStatus(HttpStatus.NO_CONTENT)
|
|
|
@ApiOperation(value = "移除成员")
|
|
@ -167,7 +157,6 @@ public class AdminTeamController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@ResponseBody
|
|
|
@RequestMapping(value = "/team/{doctor_code}/teams", method = RequestMethod.GET)
|
|
|
@ApiOperation(value = "获取医生团队列表")
|
|
|
public String getDoctorTeams(@PathVariable("doctor_code") String doctorCode) {
|
|
@ -180,4 +169,18 @@ public class AdminTeamController extends BaseController {
|
|
|
return error(-1, e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/teams/{team_id}/signing/count", method = RequestMethod.GET)
|
|
|
@ApiOperation(value = "获取团队医生的队内签约数量")
|
|
|
public String getDoctorSignPatientCount(@PathVariable("team_id") long teamId){
|
|
|
try{
|
|
|
List<Doctor> members = memberService.getMembers(teamId);
|
|
|
Map<String, Integer> counts = memberService.getMemberSigningCount(members);
|
|
|
|
|
|
return write(200, "OK", "data", new JSONObject(counts));
|
|
|
} catch (Exception e){
|
|
|
error(e);
|
|
|
return error(-1, e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
}
|