|
@ -164,9 +164,9 @@ public class ImService {
|
|
* @param doctor 医生
|
|
* @param doctor 医生
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public Long getUnfinishedConsult(String patient, String doctor) {
|
|
|
|
|
|
public String getUnfinishedConsult(String patient, String doctor) {
|
|
|
|
|
|
String totalSql = "SELECT count(a.id) AS total " +
|
|
|
|
|
|
String totalSql = "SELECT a.consult as consultCode " +
|
|
"FROM wlyy_consult_team a,wlyy_consult_team_doctor b " +
|
|
"FROM wlyy_consult_team a,wlyy_consult_team_doctor b " +
|
|
"WHERE a.consult=b.consult " +
|
|
"WHERE a.consult=b.consult " +
|
|
"AND a.patient= '" +patient+"' "+
|
|
"AND a.patient= '" +patient+"' "+
|
|
@ -177,11 +177,11 @@ public class ImService {
|
|
|
|
|
|
List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(totalSql);
|
|
List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(totalSql);
|
|
|
|
|
|
Long count = 0L;
|
|
|
|
|
|
String consultCode = "";
|
|
if (rstotal != null && rstotal.size() > 0) {
|
|
if (rstotal != null && rstotal.size() > 0) {
|
|
count = (Long) rstotal.get(0).get("total");
|
|
|
|
|
|
consultCode = rstotal.get(0).get("consultCode").toString();
|
|
}
|
|
}
|
|
return count;
|
|
|
|
|
|
return consultCode;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -620,7 +620,7 @@ public class ImService {
|
|
*/
|
|
*/
|
|
public JSONObject addTeamConsult(ConsultTeamDo ct, String patient, String doctor) throws Exception {
|
|
public JSONObject addTeamConsult(ConsultTeamDo ct, String patient, String doctor) throws Exception {
|
|
JSONObject re = new JSONObject();
|
|
JSONObject re = new JSONObject();
|
|
if (getUnfinishedConsult(patient, doctor) > 0) {//判断是否有未结束的咨询移到同步方法中
|
|
|
|
|
|
if (!StringUtils.isEmpty(getUnfinishedConsult(patient, doctor))) {//判断是否有未结束的咨询移到同步方法中
|
|
// re.put("status", -3);
|
|
// re.put("status", -3);
|
|
// return re;
|
|
// return re;
|
|
throw new RuntimeException("居民还有未结束的专家咨询!");
|
|
throw new RuntimeException("居民还有未结束的专家咨询!");
|