|
@ -17,6 +17,7 @@ import com.yihu.wlyy.repository.patient.SignFamilyDao;
|
|
import com.yihu.wlyy.repository.patient.SignFamilyRenewDao;
|
|
import com.yihu.wlyy.repository.patient.SignFamilyRenewDao;
|
|
import com.yihu.wlyy.service.BaseService;
|
|
import com.yihu.wlyy.service.BaseService;
|
|
import com.yihu.wlyy.service.third.jw.JwSignService;
|
|
import com.yihu.wlyy.service.third.jw.JwSignService;
|
|
|
|
import com.yihu.wlyy.util.PinYinUtil;
|
|
import org.apache.commons.lang3.tuple.ImmutablePair;
|
|
import org.apache.commons.lang3.tuple.ImmutablePair;
|
|
import org.apache.commons.lang3.tuple.Pair;
|
|
import org.apache.commons.lang3.tuple.Pair;
|
|
import org.json.JSONArray;
|
|
import org.json.JSONArray;
|
|
@ -131,6 +132,79 @@ public class AdminTeamService extends BaseService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 根据医生code返回所有团队的医生
|
|
|
|
* (pc端im使用)改为字母拍讯
|
|
|
|
* @author zd 2018-02-11
|
|
|
|
* * @param doctor
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
public Map<String,Object> getTeamMembersByDoctorCodeByAlpha(String doctor){
|
|
|
|
String sql = "SELECT " +
|
|
|
|
" d.code" +
|
|
|
|
" ,d.name" +
|
|
|
|
" ,d.hospital" +
|
|
|
|
" ,d.hospital_name hospitalName" +
|
|
|
|
" ,d.dept_name deptName" +
|
|
|
|
" ,d.job_name jobName" +
|
|
|
|
" ,d.level" +
|
|
|
|
" ,d.sex" +
|
|
|
|
" ,d.photo" +
|
|
|
|
" ,d.expertise" +
|
|
|
|
" ,d.introduce" +
|
|
|
|
" ,t.id teamCode" +
|
|
|
|
" FROM " +
|
|
|
|
" wlyy_admin_team_member m" +
|
|
|
|
" , wlyy_admin_team t" +
|
|
|
|
" , wlyy_doctor d" +
|
|
|
|
" ,(SELECT t1.id FROM wlyy_admin_team_member m1, wlyy_admin_team t1 WHERE m1.doctor_code = '"+doctor+"' AND t1.id = m1.team_id AND t1.available = true AND m1.available = true) te" +
|
|
|
|
" WHERE " +
|
|
|
|
" t.id = m.team_id AND " +
|
|
|
|
" m.doctor_code = d.code AND " +
|
|
|
|
" t.id = te.id AND " +
|
|
|
|
" t.available = true AND " +
|
|
|
|
" m.available = true ";
|
|
|
|
List<Map<String, Object>> doctors = jdbcTemplate.queryForList(sql);
|
|
|
|
Map<String, Map<String,Object>> result = new HashMap<>();
|
|
|
|
if(doctors!=null&&doctors.size()>0){
|
|
|
|
for (Map<String, Object> map:doctors){
|
|
|
|
String code = map.get("code").toString();
|
|
|
|
if(result.containsKey(code)){
|
|
|
|
Map<String,Object> map2 = result.get(code);
|
|
|
|
JSONArray ja = (JSONArray) map2.get("teams");
|
|
|
|
ja.put(map.get("teamCode"));
|
|
|
|
}else {
|
|
|
|
JSONArray ja = new JSONArray();
|
|
|
|
ja.put(map.get("teamCode"));
|
|
|
|
map.put("teams",ja);
|
|
|
|
result.put(code,map);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Map<String,Object> map = new LinkedHashMap <>();
|
|
|
|
JSONObject resultJson = new JSONObject();
|
|
|
|
String[] alphatables = {"a", "b", "c", "d", "e", "f", "g", "h", "i",
|
|
|
|
"j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"};
|
|
|
|
if (result.size() > 0) {
|
|
|
|
List<Map<String,Object>> list = Lists.newArrayList(result.values());
|
|
|
|
for (String alpha : alphatables){
|
|
|
|
List<Map<String,Object>> resultList = new ArrayList<>();
|
|
|
|
for (Map<String,Object> one : list){
|
|
|
|
String name = String.valueOf(one.get("name"));
|
|
|
|
String firstSpell = PinYinUtil.getFirstSpell(name).substring(0,1);
|
|
|
|
if (alpha.equals(firstSpell)){
|
|
|
|
resultList.add(one);
|
|
|
|
map.put(alpha,resultList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return map;
|
|
|
|
} else {
|
|
|
|
return map;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取团队数量。
|
|
* 获取团队数量。
|
|
*
|
|
*
|