|
@ -15,7 +15,6 @@ import org.json.JSONObject;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@ -151,16 +150,16 @@ public class TeamEndpoint extends EnvelopRestEndpoint {
|
|
|
|
|
|
@RequestMapping(value = "/team/{doctorCode}/team", method = RequestMethod.GET)
|
|
|
@ApiOperation(value = "获取团队长团队")
|
|
|
public ObjEnvelop getLeaderTeam(@PathVariable("doctorCode") String doctorCode) {
|
|
|
public ListEnvelop getLeaderTeam(@PathVariable("doctorCode") String doctorCode) {
|
|
|
try {
|
|
|
BaseTeamDO team = teamDao.findByLeaderCode(doctorCode);
|
|
|
List<BaseTeamDO> team = teamDao.findByLeaderCode(doctorCode);
|
|
|
if (team == null) {
|
|
|
return ObjEnvelop.getError( "没有找到数据!",-2);
|
|
|
return ListEnvelop.getError( "没有找到数据!");
|
|
|
}
|
|
|
return ObjEnvelop.getSuccess("获取成功",team);
|
|
|
return ListEnvelop.getSuccess("获取成功",team);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return ObjEnvelop.getError("获取失败");
|
|
|
return ListEnvelop.getError("获取失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
@ -174,20 +173,8 @@ public class TeamEndpoint extends EnvelopRestEndpoint {
|
|
|
@ApiOperation(value = "获取医生团队列表")
|
|
|
public ListEnvelop getDoctorTeams(@PathVariable("doctorCode") String doctorCode) {
|
|
|
try {
|
|
|
ArrayList teams = new ArrayList();
|
|
|
List<BaseTeamDO> teamList = teamDao.findDoctorTeams(doctorCode);
|
|
|
BaseTeamDO team = teamDao.findByLeaderCode(doctorCode);
|
|
|
String teamCode = "";
|
|
|
if (team != null){
|
|
|
teams.add(team);
|
|
|
teamCode = team.getId();
|
|
|
}
|
|
|
for (BaseTeamDO list : teamList){
|
|
|
if (teamCode!=list.getId()){
|
|
|
teams.add(list);
|
|
|
}
|
|
|
}
|
|
|
return ListEnvelop.getSuccess("获取成功",teams);
|
|
|
return ListEnvelop.getSuccess("获取成功",teamList);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return ListEnvelop.getError("获取失败");
|