|
@@ -181,20 +181,12 @@ public class AmqpClient1 {
|
|
|
JSONObject localJson = null;
|
|
JSONObject localJson = null;
|
|
|
|
|
|
|
|
String hospitalCode = items.containsKey("userId") ? "" : items.getString("userId");
|
|
String hospitalCode = items.containsKey("userId") ? "" : items.getString("userId");
|
|
|
- if(StringUtils.isEmpty(hospitalCode)) {
|
|
|
|
|
-// String sql = "SELECT h.code FROM bus_hospital h inner join bus_device d on d.tenant_id = h.tenant_id where device_id=? limit 1";
|
|
|
|
|
-// try {
|
|
|
|
|
-// hospitalCode = nbJdbcTemplate.queryForObject(sql, String.class, deviceName);
|
|
|
|
|
-// }catch (Exception e) {
|
|
|
|
|
-// // TODO: handle exception
|
|
|
|
|
-// }
|
|
|
|
|
- hospitalCode = remoteUtil.getHospitalCode(deviceName);
|
|
|
|
|
- if(StringUtils.isEmpty(hospitalCode)) {
|
|
|
|
|
- log.info("设备没有对应医院:"+deviceName);
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
|
|
+ User owner = userMapper.selectByCode(hospitalCode);
|
|
|
|
|
+ if(owner == null) {
|
|
|
|
|
+ log.info("不存在该医院:"+hospitalCode);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
String ci = items.containsKey("ci") ? "" : items.getString("ci");
|
|
String ci = items.containsKey("ci") ? "" : items.getString("ci");
|
|
|
String lac = items.containsKey("lac") ? "" : items.getString("lac");
|
|
String lac = items.containsKey("lac") ? "" : items.getString("lac");
|
|
|
if(!"".equals(ci) && !"".equals(lac)) {
|
|
if(!"".equals(ci) && !"".equals(lac)) {
|
|
@@ -202,12 +194,7 @@ public class AmqpClient1 {
|
|
|
localJson = getLocation(mnc,lac,ci);
|
|
localJson = getLocation(mnc,lac,ci);
|
|
|
items.put("location", localJson);
|
|
items.put("location", localJson);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- User owner = userMapper.selectByCode(hospitalCode);
|
|
|
|
|
- if(owner == null) {
|
|
|
|
|
- log.info("不存在该医院:"+hospitalCode);
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
JSONObject mongoJson = new JSONObject();
|
|
JSONObject mongoJson = new JSONObject();
|
|
|
Device exist = deviceMapper.selectByMac(deviceName);
|
|
Device exist = deviceMapper.selectByMac(deviceName);
|
|
|
if(exist == null) {
|
|
if(exist == null) {
|