|
@ -306,38 +306,32 @@ public class DoctorInfoService extends BaseService {
|
|
|
/**
|
|
|
* 根据医院信息获取医生列表
|
|
|
*
|
|
|
* @param query 查询条件 :医生名称
|
|
|
* @param id
|
|
|
* @param hospital 医院标识
|
|
|
* 页数
|
|
|
* @return
|
|
|
*/
|
|
|
@Transactional
|
|
|
public Page<Doctor> getDoctorListByHospital(String query, String hospital,
|
|
|
long id, int pageSize) {
|
|
|
// 排序
|
|
|
Sort sort = new Sort(Direction.DESC, "evaluateScore","id");
|
|
|
// 分页信息
|
|
|
PageRequest pageRequest = new PageRequest(0, pageSize, sort);
|
|
|
// 查询全部
|
|
|
Map<String, SearchFilter> filters = new HashMap<String, SearchFilter>();
|
|
|
if (StringUtils.isNotEmpty(query)) {
|
|
|
filters.put("name", new SearchFilter("name", Operator.LIKE, query));
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(hospital)) {
|
|
|
hospital = hospital.substring(0, 8);
|
|
|
filters.put("hospital", new SearchFilter("hospital", Operator.LIKE,
|
|
|
hospital));
|
|
|
}
|
|
|
if (id > 0) {
|
|
|
filters.put("id", new SearchFilter("id", Operator.LT, id));
|
|
|
}
|
|
|
filters.put("level", new SearchFilter("level", Operator.EQ, 2));
|
|
|
Specification<Doctor> spec = DynamicSpecifications.bySearchFilter(
|
|
|
filters.values(), Doctor.class);
|
|
|
return doctorDao.findAll(spec, pageRequest);
|
|
|
}
|
|
|
|
|
|
// @Transactional
|
|
|
// public Page<Doctor> getDoctorListByHospital(String query, String hospital,
|
|
|
// int page, int pageSize) {
|
|
|
// page = page <= 0 ? 0 : page - 1;
|
|
|
// // 排序
|
|
|
// Sort sort = new Sort(Direction.DESC, "evaluateScore","id");
|
|
|
// // 分页信息
|
|
|
// PageRequest pageRequest = new PageRequest(page, pageSize);
|
|
|
// // 查询全部
|
|
|
// Map<String, SearchFilter> filters = new HashMap<String, SearchFilter>();
|
|
|
// if (StringUtils.isNotEmpty(query)) {
|
|
|
// query="%"+query+"%";
|
|
|
// }else{
|
|
|
// query="%";
|
|
|
// }
|
|
|
// if (StringUtils.isNotEmpty(hospital)) {
|
|
|
// hospital = "%"+hospital.substring(0, 8)+"%";
|
|
|
// }
|
|
|
//
|
|
|
// filters.put("level", new SearchFilter("level", Operator.EQ, 2));
|
|
|
// return doctorDao.getDoctorListByHospital(query,hospital,2, pageRequest);
|
|
|
// }
|
|
|
@Transactional
|
|
|
public List<Doctor> getDoctorCombobxByHospital(String type, String hospital) {
|
|
|
|
|
@ -358,7 +352,7 @@ public class DoctorInfoService extends BaseService {
|
|
|
}
|
|
|
|
|
|
@Transactional
|
|
|
public Page<Doctor> getDoctorListByHospital(String name, String paitentCode, Integer page, Integer pageSize) {
|
|
|
public Page<Doctor> getDoctorListByHospital(String name, String hospital, Integer page, Integer pageSize, Integer level) {
|
|
|
if (pageSize == null | pageSize <= 0) {
|
|
|
pageSize = 10;
|
|
|
}
|
|
@ -366,7 +360,7 @@ public class DoctorInfoService extends BaseService {
|
|
|
page = 1;
|
|
|
}
|
|
|
// 排序
|
|
|
Sort sort = new Sort(Sort.Direction.DESC, "name");
|
|
|
Sort sort = new Sort(Sort.Direction.DESC, "evaluateScore");
|
|
|
// 分页信息
|
|
|
PageRequest pageRequest = new PageRequest(page - 1, pageSize, sort);
|
|
|
// 查询全部
|
|
@ -374,9 +368,11 @@ public class DoctorInfoService extends BaseService {
|
|
|
if (StringUtils.isNotEmpty(name)) {
|
|
|
filters.put("name", new SearchFilter("name", SearchFilter.Operator.LIKE, name));
|
|
|
}
|
|
|
filters.put("status", new SearchFilter("status", SearchFilter.Operator.EQ, 1));
|
|
|
filters.put("level", new SearchFilter("level", SearchFilter.Operator.EQ, 1));
|
|
|
filters.put("iscertified", new SearchFilter("iscertified", SearchFilter.Operator.EQ, 1));
|
|
|
if (StringUtils.isNotEmpty(hospital)) {
|
|
|
filters.put("hospital", new SearchFilter("hospital", Operator.LIKE, "%" + hospital.substring(0, 8) + "%"));
|
|
|
}
|
|
|
filters.put("level", new SearchFilter("level", SearchFilter.Operator.EQ, level));
|
|
|
|
|
|
Specification<Doctor> spec = DynamicSpecifications.bySearchFilter(filters.values(), Doctor.class);
|
|
|
|
|
|
return doctorDao.findAll(spec, pageRequest);
|
|
@ -882,15 +878,15 @@ public class DoctorInfoService extends BaseService {
|
|
|
}
|
|
|
|
|
|
//判断是否判定openId,有没有发则查找家人发送
|
|
|
if(StringUtils.isNotBlank(p.getOpenid())){
|
|
|
if (StringUtils.isNotBlank(p.getOpenid())) {
|
|
|
PushMsgTask.getInstance().putWxMsg(accessTokenUtils.getAccessToken(), 10, p.getOpenid(), p.getName(), data);
|
|
|
}else{
|
|
|
JSONObject json = weiXinOpenIdUtils.getFamilyOpenId(p.getCode());
|
|
|
} else {
|
|
|
JSONObject json = weiXinOpenIdUtils.getFamilyOpenId(p.getCode());
|
|
|
Patient member = (Patient) json.get("member");
|
|
|
if(StringUtils.isNotBlank(member.getOpenid())){
|
|
|
if (StringUtils.isNotBlank(member.getOpenid())) {
|
|
|
String first = (String) data.get("first");
|
|
|
data.remove("first");
|
|
|
data.put("first",weiXinOpenIdUtils.getTitleMes(p,json.getInt("relation"),member.getName())+first);
|
|
|
data.put("first", weiXinOpenIdUtils.getTitleMes(p, json.getInt("relation"), member.getName()) + first);
|
|
|
PushMsgTask.getInstance().putWxMsg(accessTokenUtils.getAccessToken(), 10, member.getOpenid(), member.getName(), data);
|
|
|
|
|
|
}
|
|
@ -908,8 +904,8 @@ public class DoctorInfoService extends BaseService {
|
|
|
for (int i = 0; i < patiensString.length; i++) {
|
|
|
try {
|
|
|
updateTeamHealthDoctor(newDoctorCode, oldDoctorCode, patiensString[i]);
|
|
|
SignFamily signFamily = signFamilyDao.findByPatient( patiensString[i]);
|
|
|
ImUtill.deleteMucUser(newDoctorCode, oldDoctorCode, patiensString[i] + "_"+signFamily.getTeamCode()+"_2");
|
|
|
SignFamily signFamily = signFamilyDao.findByPatient(patiensString[i]);
|
|
|
ImUtill.deleteMucUser(newDoctorCode, oldDoctorCode, patiensString[i] + "_" + signFamily.getTeamCode() + "_2");
|
|
|
successs++;
|
|
|
} catch (Exception e) {
|
|
|
error++;
|
|
@ -942,7 +938,7 @@ public class DoctorInfoService extends BaseService {
|
|
|
hasNoTeam = true;
|
|
|
}
|
|
|
SignFamily signFamily = signFamilyDao.findByPatient(patient);
|
|
|
ImUtill.deleteMucUser(newDoctorCode, doctor, patient + "_"+signFamily.getTeamCode()+"_2");
|
|
|
ImUtill.deleteMucUser(newDoctorCode, doctor, patient + "_" + signFamily.getTeamCode() + "_2");
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
@ -997,16 +993,16 @@ public class DoctorInfoService extends BaseService {
|
|
|
data.put("remark", newD.getName() + "医生与" + signFamily.getDoctorName() + "医生一道,为您提供优质健康服务");
|
|
|
}
|
|
|
|
|
|
if(StringUtils.isNotBlank(p.getOpenid())){
|
|
|
if (StringUtils.isNotBlank(p.getOpenid())) {
|
|
|
PushMsgTask.getInstance().putWxMsg(accessTokenUtils.getAccessToken(), 10, p.getOpenid(), p.getName(), data);
|
|
|
}else{
|
|
|
} else {
|
|
|
JSONObject json = weiXinOpenIdUtils.getFamilyOpenId(p.getCode());
|
|
|
Patient member = (Patient)json.get("member");
|
|
|
Patient member = (Patient) json.get("member");
|
|
|
|
|
|
if(StringUtils.isNotBlank(member.getOpenid())){
|
|
|
if (StringUtils.isNotBlank(member.getOpenid())) {
|
|
|
String first = (String) data.get("first");
|
|
|
data.remove("first");
|
|
|
data.put("first",weiXinOpenIdUtils.getTitleMes(p,json.getInt("relation"),member.getName())+first);
|
|
|
data.put("first", weiXinOpenIdUtils.getTitleMes(p, json.getInt("relation"), member.getName()) + first);
|
|
|
PushMsgTask.getInstance().putWxMsg(accessTokenUtils.getAccessToken(), 10, member.getOpenid(), member.getName(), data);
|
|
|
}
|
|
|
}
|
|
@ -1128,7 +1124,7 @@ public class DoctorInfoService extends BaseService {
|
|
|
for (int i = 0; i < patiensString.length; i++) {
|
|
|
try {
|
|
|
SignFamily signFamily = signFamilyDao.findByPatient(patiensString[i]);
|
|
|
ImUtill.deleteMucUser(newDoctorCode, oldDoctorCode, patiensString[i] + "_"+signFamily.getTeamCode()+"_2");
|
|
|
ImUtill.deleteMucUser(newDoctorCode, oldDoctorCode, patiensString[i] + "_" + signFamily.getTeamCode() + "_2");
|
|
|
updateTeamDoctor(newDoctorCode, oldDoctorCode, patiensString[i]);
|
|
|
successs++;
|
|
|
} catch (Exception e) {
|
|
@ -1199,16 +1195,16 @@ public class DoctorInfoService extends BaseService {
|
|
|
data.put("remark", newD.getName() + "医生与" + signFamily.getDoctorHealthName() + "医生一道,为您提供优质健康服务");
|
|
|
}
|
|
|
|
|
|
if(StringUtils.isNotBlank(p.getOpenid())){
|
|
|
if (StringUtils.isNotBlank(p.getOpenid())) {
|
|
|
data.put("first", p.getName() + ",您好!因签约团队内分工调整,您的责任医生有变动," + oldDoctorName +
|
|
|
"医生无法继续为您服务,具体变动如下:");
|
|
|
PushMsgTask.getInstance().putWxMsg(accessTokenUtils.getAccessToken(), 10, p.getOpenid(), p.getName(), data);
|
|
|
}else{
|
|
|
} else {
|
|
|
//如果自己没有绑定,则发给家人
|
|
|
JSONObject json = weiXinOpenIdUtils.getFamilyOpenId(p.getCode());
|
|
|
Patient member = (Patient)json.get("member");
|
|
|
if(StringUtils.isNotBlank(member.getOpenid())){
|
|
|
data.put("first", weiXinOpenIdUtils.getTitleMes(p,(int)json.get("relation"),member.getName())+p.getName() + ",您好!因签约团队内分工调整,您的责任医生有变动," + oldDoctorName +
|
|
|
Patient member = (Patient) json.get("member");
|
|
|
if (StringUtils.isNotBlank(member.getOpenid())) {
|
|
|
data.put("first", weiXinOpenIdUtils.getTitleMes(p, (int) json.get("relation"), member.getName()) + p.getName() + ",您好!因签约团队内分工调整,您的责任医生有变动," + oldDoctorName +
|
|
|
"医生无法继续为您服务,具体变动如下:");
|
|
|
PushMsgTask.getInstance().putWxMsg(accessTokenUtils.getAccessToken(), 10, member.getOpenid(), member.getName(), data);
|
|
|
}
|