|
@ -668,7 +668,7 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
|
|
|
throw new Exception(failMsg);
|
|
|
}
|
|
|
|
|
|
//已取消的订单也可以申请
|
|
|
//判断师傅存在为完成的上门服务订单
|
|
|
boolean bool = wlyyDoorServiceOrderDao.existsByPatientAndStatusIn(orderDO.getPatient(),
|
|
|
new Integer[]{WlyyDoorServiceOrderDO.Status.waitForSend.getType(),
|
|
|
WlyyDoorServiceOrderDO.Status.waitForAccept.getType(),
|
|
@ -1968,17 +1968,23 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
|
|
|
oneMap.put("serviceCount", serviceCount);
|
|
|
oneMap.put("isInSession", false);
|
|
|
String sessionId = String.valueOf(oneMap.get("sessionId"));
|
|
|
JSONArray parArray = imUtill.getParticipants(sessionId);
|
|
|
parArray.forEach(
|
|
|
oneParObj -> {
|
|
|
org.json.JSONObject oneParJson = (org.json.JSONObject) oneParObj;
|
|
|
if (StringUtils.equalsIgnoreCase(oneParJson.getString("id"), dispatcher)) {
|
|
|
oneMap.put("isInSession", true);
|
|
|
JSONArray parArray = null;
|
|
|
try {
|
|
|
parArray = imUtill.getParticipants(sessionId);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
if (parArray!=null){
|
|
|
parArray.forEach(
|
|
|
oneParObj -> {
|
|
|
org.json.JSONObject oneParJson = (org.json.JSONObject) oneParObj;
|
|
|
if (StringUtils.equalsIgnoreCase(oneParJson.getString("id"), dispatcher)) {
|
|
|
oneMap.put("isInSession", true);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
);
|
|
|
);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
result.put(ResponseContant.resultFlag, ResponseContant.success);
|
|
|
result.put(ResponseContant.resultMsg, sqlResultlist);
|
|
|
JSONObject countItem = new JSONObject();
|
|
@ -2022,15 +2028,18 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
|
|
|
" FROM " +
|
|
|
" base_doctor d " +
|
|
|
" LEFT JOIN wlyy_door_doctor_status ds ON d.`id` = ds.doctor " +
|
|
|
" LEFT JOIN wlyy_door_service_order o on o.doctor = d.id " +
|
|
|
" LEFT JOIN wlyy_door_service_order o on o.doctor = d.id and o.`status` in (2,3,4) " +
|
|
|
" LEFT JOIN base_doctor_hospital a ON d.id=a.doctor_code " +
|
|
|
" WHERE 1=1 " +
|
|
|
" and o.`status` in (2,3,4) " +
|
|
|
" and d.enabled = 1 " +
|
|
|
// " AND d.level <> 11" +
|
|
|
" AND a.org_code = '{hospital}' " +
|
|
|
" AND d.`name` like '%{doctorName}%' " +
|
|
|
" AND (ds.`status` in ({status}) or '-100' = '{status}')" +
|
|
|
" AND a.org_code = '{hospital}' ";
|
|
|
|
|
|
if (StringUtils.isNotBlank(doctorName)) {
|
|
|
sql += " AND d.`name` like '%{doctorName}%' ";
|
|
|
}
|
|
|
|
|
|
sql += " AND (ds.`status` in ({status}) or '-100' = '{status}')" +
|
|
|
" AND d.del=1 " +
|
|
|
" GROUP BY d.`id` " +
|
|
|
" ORDER BY ds.create_time DESC " +
|
|
@ -2050,9 +2059,12 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
|
|
|
" LEFT JOIN base_doctor_hospital a ON d.id=a.doctor_code " +
|
|
|
" WHERE d.enabled = 1" +
|
|
|
// " AND d.level <> 4" +
|
|
|
" AND a.org_code = '{hospital}' " +
|
|
|
" AND d.`name` like '%{doctorName}%' " +
|
|
|
" AND d.del=1 and d.enabled=1 " +
|
|
|
" AND a.org_code = '{hospital}' ";
|
|
|
if (StringUtils.isNotBlank(doctorName)) {
|
|
|
countSql += " AND d.`name` like '%{doctorName}%' ";
|
|
|
}
|
|
|
|
|
|
countSql += " AND d.del=1 and d.enabled=1 " +
|
|
|
" AND (ds.`status` in ({status}) or '-100' = '{status}')";
|
|
|
|
|
|
String finalCountSql = countSql.replace("{hospital}", hospital)
|
|
@ -2851,8 +2863,8 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
public JSONObject getDoctorInfo(ParamQvo qvo) {
|
|
|
JSONObject result = new JSONObject();
|
|
|
public Map<String, Object> getDoctorInfo(ParamQvo qvo) {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
String sql = "SELECT\n" +
|
|
|
" a.*,\n" +
|
|
|
" b.dept_name 'deptName',\n" +
|
|
@ -2867,11 +2879,11 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
|
|
|
" LEFT JOIN dict_hospital_dept h ON b.dept_code = h.CODE \n" +
|
|
|
"WHERE\n" +
|
|
|
" 1 = 1 \n" +
|
|
|
" AND a.id='" + qvo.getLoginUserCode() + "' " +
|
|
|
" AND b.org_code = '922b9636-5aff-11e6-8344-fa163e8aee56'";
|
|
|
" AND a.id='" + qvo.getLoginUserCode() + "' ";
|
|
|
// " AND b.org_code = '922b9636-5aff-11e6-8344-fa163e8aee56'";
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
if (!list.isEmpty()) {
|
|
|
Map<String, Object> map = list.get(0);
|
|
|
map = list.get(0);
|
|
|
//查询角色
|
|
|
String roleSql = "SELECT " +
|
|
|
" t.CODE AS \"roleCode\", " +
|
|
@ -2884,12 +2896,12 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
|
|
|
List<Map<String, Object>> roleList = jdbcTemplate.queryForList(roleSql);
|
|
|
|
|
|
if (roleList != null && roleList.size() > 0) {
|
|
|
map.put("roles", list);
|
|
|
map.put("roles", roleList);
|
|
|
} else {
|
|
|
map.put("roles", null);
|
|
|
}
|
|
|
result.put("data", map);
|
|
|
|
|
|
}
|
|
|
return result;
|
|
|
return map;
|
|
|
}
|
|
|
}
|