|
@ -15,6 +15,7 @@ import com.yihu.iot.util.conceal.ConcealUtil;
|
|
|
import com.yihu.iot.util.excel.HibenateUtils;
|
|
|
import com.yihu.jw.entity.iot.dict.IotSystemDictDO;
|
|
|
import com.yihu.jw.entity.iot.equipment.IotEquipmentDetailDO;
|
|
|
import com.yihu.jw.entity.util.AesEncryptUtils;
|
|
|
import com.yihu.jw.restmodel.web.MixEnvelop;
|
|
|
import com.yihu.jw.util.common.LatitudeUtils;
|
|
|
import com.yihu.jw.util.http.HttpClientUtil;
|
|
@ -104,7 +105,7 @@ public class MonitorPlatformService {
|
|
|
JSONObject location = JSONObject.parseObject(map.get("location").toString());
|
|
|
GeoPoint geoPoint = new GeoPoint(Double.parseDouble(location.get("lat").toString()),Double.parseDouble(location.get("lon").toString()));
|
|
|
locationDataVO.setId(map.get("id").toString());
|
|
|
locationDataVO.setIdCard(map.get("idCard").toString());
|
|
|
locationDataVO.setIdCard(AesEncryptUtils.decrypt(map.get("idCard").toString()));
|
|
|
locationDataVO.setCategoryCode(map.get("categoryCode").toString());
|
|
|
locationDataVO.setDeviceSn(map.get("deviceSn").toString());
|
|
|
locationDataVO.setLocation(geoPoint);
|
|
@ -115,6 +116,7 @@ public class MonitorPlatformService {
|
|
|
// locationDataVO.setName(ConcealUtil.nameOrAddrConceal(map.get("name").toString()));
|
|
|
locationDataVO.setCode(null);
|
|
|
locationDataVO.setEquimentName((String) map.get("equimentName"));
|
|
|
locationDataVO = iotPatientDeviceService.addNameAndCodeToLocationVO(locationDataVO);
|
|
|
locationDataVOList.add(locationDataVO);
|
|
|
});
|
|
|
// JSONArray jsonArrayTemp = new JSONArray();
|
|
@ -130,8 +132,7 @@ public class MonitorPlatformService {
|
|
|
// jsonObject.put("size",size);
|
|
|
// List<LocationDataVO> locationDataVOList = iotPatientDeviceService.findDeviceLocationsByIdCard(jsonObject.toString());
|
|
|
//figureLabelSerachService.getFigureLabelByList(locationDataVOList);
|
|
|
List<LocationDataVO> list2 = iotPatientDeviceService.addNameAndCodeToList(locationDataVOList);
|
|
|
envelop.getDetailModelList().addAll(list2);
|
|
|
envelop.getDetailModelList().addAll(locationDataVOList);
|
|
|
}
|
|
|
envelop.setTotalCount(total);
|
|
|
return envelop;
|
|
@ -184,7 +185,7 @@ public class MonitorPlatformService {
|
|
|
JSONObject location = JSONObject.parseObject(map.get("location").toString());
|
|
|
GeoPoint geoPoint = new GeoPoint(Double.parseDouble(location.get("lat").toString()),Double.parseDouble(location.get("lon").toString()));
|
|
|
locationDataVO.setId(map.get("id").toString());
|
|
|
locationDataVO.setIdCard(map.get("idCard").toString());
|
|
|
locationDataVO.setIdCard(AesEncryptUtils.decrypt(map.get("idCard").toString()));
|
|
|
locationDataVO.setCategoryCode(map.get("categoryCode").toString());
|
|
|
locationDataVO.setDeviceSn(map.get("deviceSn").toString());
|
|
|
locationDataVO.setLocation(geoPoint);
|
|
@ -195,11 +196,10 @@ public class MonitorPlatformService {
|
|
|
// locationDataVO.setName(ConcealUtil.nameOrAddrConceal(map.get("name").toString()));
|
|
|
locationDataVO.setCode(null);
|
|
|
locationDataVO.setEquimentName((String) map.get("equimentName"));
|
|
|
locationDataVO = iotPatientDeviceService.addNameAndCodeToLocationVO(locationDataVO);
|
|
|
locationDataVOList.add(locationDataVO);
|
|
|
});
|
|
|
List<LocationDataVO> list2 = iotPatientDeviceService.addNameAndCodeToList(locationDataVOList);
|
|
|
envelop.getDetailModelList().addAll(list2);
|
|
|
|
|
|
envelop.getDetailModelList().addAll(locationDataVOList);
|
|
|
// for (String categoryCode:categoryCodes){
|
|
|
// JSONObject json = new JSONObject();
|
|
|
// JSONArray jsonArray = new JSONArray();
|
|
@ -864,7 +864,7 @@ public class MonitorPlatformService {
|
|
|
String sql = "SELECT d.device_sn,b.supplier_name supplierName,b.origin_place originPlace,e.product_img productImg" +
|
|
|
",e.description from iot_device d,iot_product_base_info b,iot_product_extend_info e" +
|
|
|
" WHERE d.device_sn = '"+deviceSn+"' and d.product_id = b.id and d.product_id = e.product_id";
|
|
|
List<JSONObject> list = myJdbcTemplate.queryJson(sql.toString(),new Object[]{});
|
|
|
List<JSONObject> list = myJdbcTemplate.queryJson(sql,new Object[]{});
|
|
|
if(list!=null&&list.size()>0){
|
|
|
JSONObject js = list.get(0);
|
|
|
tmp.put("supplierName",js.getString("supplierName"));
|
|
@ -1092,9 +1092,12 @@ public class MonitorPlatformService {
|
|
|
sql.append("from wlyy.wlyy_patient_device d,wlyy.wlyy_patient p ");
|
|
|
sql.append("WHERE d.`user` = p.`code` and d.del=0 ");
|
|
|
if(org.apache.commons.lang3.StringUtils.isNotBlank(name)){
|
|
|
sql.append("and (d.device_sn like '%"+name+"%' or p.`name` = '"+name+"') ");
|
|
|
sql.append("and (d.device_sn like '%"+name+"%' or p.`name` = '"+ AesEncryptUtils.encrypt(name)+"') ");
|
|
|
}
|
|
|
List<JSONObject> jsonArray = myJdbcTemplate.queryJson(sql.toString(),new Object[]{});
|
|
|
for (JSONObject obj:jsonArray){
|
|
|
obj.put("name",AesEncryptUtils.decrypt(obj.getString("name")));
|
|
|
}
|
|
|
if(jsonArray.size()==0){
|
|
|
sql= new StringBuffer(" select '5' as categoryCode, id,device_code as deviceSn,null as code,null as name,'健康小屋' as deviceName from xmiot.iot_equipmet_detail where device_code like '%"+name+"%'");
|
|
|
jsonArray = myJdbcTemplate.queryJson(sql.toString(),new Object[]{});
|
|
@ -1131,9 +1134,9 @@ public class MonitorPlatformService {
|
|
|
String sqlLocation = "select idcard idCard,category_code categoryCode,device_sn deviceSn,location,device_time deviceTime,disease_condition diseaseCondition,\n" +
|
|
|
"create_time createTime,device_name equimentName\n" +
|
|
|
"from device.wlyy_patient_device_location where del=0 and device_sn='"+deviceSn+"' limit 0,5 ";
|
|
|
|
|
|
try {
|
|
|
List<Map<String,Object>> locationDataVOList = jdbcTemplate.queryForList(sqlLocation);
|
|
|
|
|
|
JSONObject location = JSONObject.parseObject(locationDataVOList.get(0).get("location").toString());
|
|
|
if(locationDataVOList.size()>0){
|
|
|
data.put("locationData",location);
|