|
@ -82,7 +82,7 @@ public class AdminTeamService extends BaseService {
|
|
|
return team;
|
|
|
}
|
|
|
|
|
|
public Map<String, Object> getPatientSigningTeam(String patientCode, String currentDoctor){
|
|
|
public Map<String, Object> getPatientSigningTeam(String patientCode, String currentDoctor) {
|
|
|
|
|
|
List<Object> results = teamDao.findAdminTeamByPatientSignTeam(patientCode, new PageRequest(0, 1));
|
|
|
if (results == null || results.size() == 0) return null;
|
|
@ -172,21 +172,21 @@ public class AdminTeamService extends BaseService {
|
|
|
* @param doctorCode
|
|
|
*/
|
|
|
public Pair<Integer, String> removeMember(long teamId, String doctorCode) {
|
|
|
if(signingTeamMemberDao.isSanShiSigning(doctorCode)){
|
|
|
if (signingTeamMemberDao.isSanShiSigning(doctorCode)) {
|
|
|
return new ImmutablePair<>(403, "三师签约医生,不能删除");
|
|
|
}
|
|
|
|
|
|
Doctor doctor = doctorDao.findByCode(doctorCode);
|
|
|
if (!doctor.isProfessionalDoctor()){
|
|
|
if (doctor.isGeneralDoctor()){
|
|
|
if (!doctor.isProfessionalDoctor()) {
|
|
|
if (doctor.isGeneralDoctor()) {
|
|
|
List<Doctor> doctorList = new ArrayList<>();
|
|
|
doctorList.add(doctor);
|
|
|
|
|
|
Integer count = getMemberSigningCount(teamId, doctorList).get(doctorCode);
|
|
|
if (count != null || count > 0){
|
|
|
if (doctor.isGeneralDoctor()){
|
|
|
if (count != null || count > 0) {
|
|
|
if (doctor.isGeneralDoctor()) {
|
|
|
return new ImmutablePair<>(403, "全科医生有签约关系,不可删除");
|
|
|
} else if (doctor.isHealthDoctor()){
|
|
|
} else if (doctor.isHealthDoctor()) {
|
|
|
return new ImmutablePair<>(403, "健康管理师仍有签约居民,请先转移签约居民");
|
|
|
}
|
|
|
}
|
|
@ -203,8 +203,8 @@ public class AdminTeamService extends BaseService {
|
|
|
return memberDao.findAllMembers(teamId);
|
|
|
}
|
|
|
|
|
|
public List<Doctor> getMembers(long teamId,String doctorCode) {
|
|
|
return memberDao.findAllHeathExcludeThis(teamId,doctorCode);
|
|
|
public List<Doctor> getMembers(long teamId, String doctorCode) {
|
|
|
return memberDao.findAllHeathExcludeThis(teamId, doctorCode);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@ -288,7 +288,30 @@ public class AdminTeamService extends BaseService {
|
|
|
memberDao.save(member);
|
|
|
}
|
|
|
|
|
|
public AdminTeam findByLeaderCode(String leaderCode){
|
|
|
public AdminTeam findByLeaderCode(String leaderCode) {
|
|
|
return teamDao.findByLeaderCode(leaderCode);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 查询两个医生的共同团队
|
|
|
*
|
|
|
* @param doctorOne
|
|
|
* @param doctorTwo
|
|
|
* @return
|
|
|
*/
|
|
|
public List<AdminTeam> findDoctorsTeams(String doctorOne, String doctorTwo) {
|
|
|
List<AdminTeam> teams = memberDao.findDoctorTeams(doctorOne);
|
|
|
List<AdminTeam> teamsTogether = new ArrayList<>();
|
|
|
|
|
|
if (teams != null && teams.size() > 0) {
|
|
|
for (AdminTeam team : teams) {
|
|
|
if (memberDao.findByTeamIdAndDoctorCodeOrderByDoctorCodeAsc(team.getId(), doctorTwo) != null) {
|
|
|
teamsTogether.add(team);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return teamsTogether;
|
|
|
}
|
|
|
}
|