|
@ -259,6 +259,32 @@ public class IotPatientDeviceService extends BaseJpaService<IotPatientDeviceDO,
|
|
|
JestResult esResult = elasticSearchHelper.search(ConstantUtils.deviceLocationIndex,ConstantUtils.deviceLocationType,queryStr.toString());
|
|
|
return getESResultBeanList(esResult);
|
|
|
}
|
|
|
public JSONObject getNameAndCode(String idCard,String snCode){
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
String sql = "select t.code as \"code\",t.name as \"name\" from wlyy.wlyy_patient t where 1=1 ";
|
|
|
String sqlEqt="select t.device_name as\"device_name\" from device.wlyy_devices t where 1=1";
|
|
|
if (StringUtils.isNotEmpty(idCard)){
|
|
|
sql = sql +" and t.idcard = '"+idCard+"'";
|
|
|
}if (StringUtils.isNotEmpty(snCode)){
|
|
|
sqlEqt = sqlEqt +" and t.device_code = '"+snCode+"'";
|
|
|
}
|
|
|
System.out.println("查询患者name和code开始");
|
|
|
List<Map<String,Object>> nameList = jdbcTempalte.queryForList(sql);
|
|
|
System.out.println("查询患者name和code结束:"+nameList);
|
|
|
System.out.println("查询设备名称开始");
|
|
|
List<Map<String,Object>> deviceList = jdbcTempalte.queryForList(sqlEqt);
|
|
|
System.out.println("查询设备名称结束:"+deviceList);
|
|
|
if(nameList.size()>0){
|
|
|
String code = null==nameList.get(0).get("code")?"":nameList.get(0).get("code").toString();
|
|
|
String name = null==nameList.get(0).get("name")?"":nameList.get(0).get("name").toString();
|
|
|
jsonObject.put("nameList",nameList);
|
|
|
}
|
|
|
if (deviceList.size()>0){
|
|
|
String equipmentName = null==deviceList.get(0).get("device_name")?"":deviceList.get(0).get("device_name").toString();
|
|
|
jsonObject.put("deviceList",deviceList);
|
|
|
}
|
|
|
return jsonObject;
|
|
|
}
|
|
|
public List<LocationDataVO> addNameAndCodeToList(List<LocationDataVO> list){
|
|
|
if(null!=list){
|
|
|
for (LocationDataVO locationDataVO:list){
|
|
@ -271,6 +297,8 @@ public class IotPatientDeviceService extends BaseJpaService<IotPatientDeviceDO,
|
|
|
}if (StringUtils.isNotEmpty(snCoed)){
|
|
|
sqlEqt = sqlEqt +" and t.device_code = '"+snCoed+"'";
|
|
|
}
|
|
|
System.out.println("idCard:="+idCard);
|
|
|
System.out.println("snCode:="+snCoed);
|
|
|
System.out.println("查询患者name和code开始");
|
|
|
List<Map<String,Object>> nameList = jdbcTempalte.queryForList(sql);
|
|
|
System.out.println("查询患者name和code结束:"+nameList);
|