|
@ -37,6 +37,7 @@ import com.yihu.wlyy.task.PushMsgTask;
|
|
|
import com.yihu.wlyy.util.DateUtil;
|
|
|
import com.yihu.wlyy.util.MD5;
|
|
|
import com.yihu.wlyy.wechat.util.WeiXinAccessTokenUtils;
|
|
|
import org.apache.commons.collections.map.HashedMap;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.json.JSONArray;
|
|
|
import org.json.JSONObject;
|
|
@ -872,15 +873,23 @@ public class DoctorInfoService extends BaseService {
|
|
|
}
|
|
|
|
|
|
@Transactional
|
|
|
public void updateTeamHealthDoctors(String newDoctorCode, String oldDoctorCode, String patients, String loginUser) throws Exception {
|
|
|
public Map<String, Integer> updateTeamHealthDoctors(String newDoctorCode, String oldDoctorCode, String patients, String loginUser) throws Exception {
|
|
|
Map<String, Integer> returnMap = new HashedMap();
|
|
|
String[] patiensString = patients.split(",");
|
|
|
Integer successs = 0;//转移成功
|
|
|
Integer error = 0;//转移失败
|
|
|
for (int i = 0; i < patiensString.length; i++) {
|
|
|
updateTeamHealthDoctor(newDoctorCode, oldDoctorCode, patiensString[i]);
|
|
|
try {
|
|
|
updateTeamHealthDoctor(newDoctorCode, oldDoctorCode, patiensString[i]);
|
|
|
successs++;
|
|
|
} catch (Exception e) {
|
|
|
error++;
|
|
|
}
|
|
|
}
|
|
|
OperatorLog operatorLog = new OperatorLog();
|
|
|
operatorLog.setCreateTime(new Date());
|
|
|
operatorLog.setMethod("/doctor/updateTeamHealthDoctors");
|
|
|
operatorLog.setMethodName("转换团队中的健康管理师");
|
|
|
operatorLog.setMethodName("转换团队中的健康管理师:成功:" + successs + ",失败:" + error);
|
|
|
operatorLog.setCreateUser(loginUser);
|
|
|
JSONObject jo = new JSONObject();
|
|
|
jo.put("newDoctorCode", newDoctorCode);
|
|
@ -888,6 +897,9 @@ public class DoctorInfoService extends BaseService {
|
|
|
jo.put("patients", patients);
|
|
|
operatorLog.setParams(jo.toString());
|
|
|
operatorLogDao.save(operatorLog);
|
|
|
returnMap.put("success", successs);
|
|
|
returnMap.put("error", error);
|
|
|
return returnMap;
|
|
|
}
|
|
|
|
|
|
@Transactional
|
|
@ -917,7 +929,7 @@ public class DoctorInfoService extends BaseService {
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
if(StringUtils.isNotEmpty(signFamily.getDoctorHealth())){
|
|
|
if (StringUtils.isNotEmpty(signFamily.getDoctorHealth())) {
|
|
|
return -2;
|
|
|
}
|
|
|
|
|
@ -1063,10 +1075,20 @@ public class DoctorInfoService extends BaseService {
|
|
|
}
|
|
|
|
|
|
@Transactional
|
|
|
public void updateTeamDoctors(String newDoctorCode, String oldDoctorCode, String patients, String loginUser) throws Exception {
|
|
|
public Map<String, Integer> updateTeamDoctors(String newDoctorCode, String oldDoctorCode, String patients, String loginUser) throws Exception {
|
|
|
Map<String, Integer> returnMap = new HashedMap();
|
|
|
String[] patiensString = patients.split(",");
|
|
|
|
|
|
Integer successs = 0;//转移成功
|
|
|
Integer error = 0;//转移失败
|
|
|
|
|
|
for (int i = 0; i < patiensString.length; i++) {
|
|
|
updateTeamDoctor(newDoctorCode, oldDoctorCode, patiensString[i]);
|
|
|
try {
|
|
|
updateTeamDoctor(newDoctorCode, oldDoctorCode, patiensString[i]);
|
|
|
successs++;
|
|
|
} catch (Exception e) {
|
|
|
error++;
|
|
|
}
|
|
|
}
|
|
|
OperatorLog operatorLog = new OperatorLog();
|
|
|
operatorLog.setCreateTime(new Date());
|
|
@ -1079,6 +1101,10 @@ public class DoctorInfoService extends BaseService {
|
|
|
jo.put("patients", patients);
|
|
|
operatorLog.setParams(jo.toString());
|
|
|
operatorLogDao.save(operatorLog);
|
|
|
|
|
|
returnMap.put("success", successs);
|
|
|
returnMap.put("error", error);
|
|
|
return returnMap;
|
|
|
}
|
|
|
|
|
|
private void updateTeamDoctor(String newDoctorCode, String oldDoctorCode, String patient) throws Exception {
|