|
@ -5,22 +5,30 @@ import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.yihu.iot.dao.dict.IotSystemDictDao;
|
|
|
import com.yihu.iot.dao.equipment.IotEquipmentDetailDao;
|
|
|
import com.yihu.iot.dao.statistics.IotStatisticsCommonDao;
|
|
|
import com.yihu.iot.dao.statistics.IotStatisticsStockDao;
|
|
|
import com.yihu.iot.service.analyzer.WlyyIotTzDict;
|
|
|
import com.yihu.iot.service.analyzer.WlyyIotTzDictDao;
|
|
|
import com.yihu.iot.service.common.MyJdbcTemplate;
|
|
|
import com.yihu.iot.service.common.PermissionService;
|
|
|
import com.yihu.iot.service.device.IotPatientDeviceService;
|
|
|
import com.yihu.iot.service.equipment.IotEqtDetailService;
|
|
|
import com.yihu.iot.service.label.FigureLabelSerachService;
|
|
|
import com.yihu.iot.service.platform.IotInterfaceLogService;
|
|
|
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.iot.statistics.IotStatisticsAppDO;
|
|
|
import com.yihu.jw.entity.iot.statistics.IotStatisticsCommonDO;
|
|
|
import com.yihu.jw.entity.iot.statistics.IotStatisticsRealtimeDO;
|
|
|
import com.yihu.jw.entity.iot.statistics.IotStatisticsStockDO;
|
|
|
import com.yihu.jw.entity.util.AesEncryptUtils;
|
|
|
import com.yihu.jw.restmodel.web.MixEnvelop;
|
|
|
import com.yihu.jw.restmodel.web.PageEnvelop;
|
|
|
import com.yihu.jw.util.common.LatitudeUtils;
|
|
|
import com.yihu.jw.util.http.HttpClientUtil;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import iot.device.IotLocationDataVO;
|
|
|
import iot.device.LocationDataVO;
|
|
|
import org.apache.http.Consts;
|
|
|
import org.apache.http.client.utils.URLEncodedUtils;
|
|
@ -28,6 +36,7 @@ import org.apache.http.message.BasicNameValuePair;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.data.elasticsearch.core.geo.GeoPoint;
|
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.StringUtils;
|
|
@ -38,6 +47,7 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
import java.io.IOException;
|
|
|
import java.text.DecimalFormat;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import static cn.hutool.core.util.ObjectUtil.hasEmpty;
|
|
|
|
|
@ -66,7 +76,7 @@ public class MonitorPlatformService {
|
|
|
@Autowired
|
|
|
private MyJdbcTemplate myJdbcTemplate;
|
|
|
@Autowired
|
|
|
private FigureLabelSerachService figureLabelSerachService;
|
|
|
private IotStatisticsStockDao iotStatisticsStockDao;
|
|
|
@Autowired
|
|
|
private IotEqtDetailService iotEqtDetailService;
|
|
|
@Autowired
|
|
@ -81,6 +91,84 @@ public class MonitorPlatformService {
|
|
|
private JdbcTemplate jdbcTemplate;
|
|
|
@Autowired
|
|
|
private WlyyIotTzDictDao wlyyIotTzDictDao;
|
|
|
@Autowired
|
|
|
private IotStatisticsCommonDao iotStatisticsCommonDao;
|
|
|
@Autowired
|
|
|
private JdbcTemplate jdbcTempalte;
|
|
|
@Value("${spring.profiles}")
|
|
|
private String springProfiles;
|
|
|
|
|
|
/**
|
|
|
* 新的物联网大屏地理搜索
|
|
|
* @param deviceCommon 设备通用名编码
|
|
|
* @param page
|
|
|
* @param size
|
|
|
* @param use 用途
|
|
|
* @param combinationMethod 组合方式
|
|
|
* @param networkTransmission 网络传输
|
|
|
* @param town 地理区划
|
|
|
* @return
|
|
|
*/
|
|
|
public PageEnvelop<IotLocationDataVO> findLocationPage(String name,String deviceCommon, Integer page, Integer size,
|
|
|
String use, String combinationMethod, String networkTransmission, String town) {
|
|
|
String countSql = "select count(*) ";
|
|
|
String sql = "select * ";
|
|
|
String fileter = " from wlyy_patient_device_location where del=0 ";
|
|
|
|
|
|
if(!StringUtils.isEmpty(use)){
|
|
|
fileter += " and use_code = '"+use+"'";
|
|
|
}
|
|
|
if(!StringUtils.isEmpty(combinationMethod)){
|
|
|
fileter += " and combination_method = '"+combinationMethod+"'";
|
|
|
}
|
|
|
if(!StringUtils.isEmpty(networkTransmission)){
|
|
|
fileter += " and network_transmission = '"+networkTransmission+"'";
|
|
|
}
|
|
|
if(!StringUtils.isEmpty(town)&&!"350200".equals(town)){
|
|
|
fileter += " and town = '"+town+"'";
|
|
|
}
|
|
|
if(!StringUtils.isEmpty(deviceCommon)){
|
|
|
deviceCommon = deviceCommon.replace(",","','");
|
|
|
fileter += " and device_common in ('"+deviceCommon+"')";
|
|
|
}
|
|
|
if(!StringUtils.isEmpty(name)){
|
|
|
fileter += " and (name like '%"+name+"%' or device_sn like '%"+name+"%')";
|
|
|
}
|
|
|
|
|
|
String limit = " limit "+(page-1)*size+","+size;
|
|
|
Long totalCount = jdbcTemplate.queryForObject(countSql+fileter, Long.class);
|
|
|
List<Map<String, Object>> result = jdbcTemplate.queryForList(sql+fileter+limit);
|
|
|
List<IotLocationDataVO> locationDataVOList = new ArrayList<>();
|
|
|
result.forEach(map -> {
|
|
|
IotLocationDataVO locationDataVO = new IotLocationDataVO();
|
|
|
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.setName(map.get("name")+"");
|
|
|
locationDataVO.setDeviceName(map.get("device_name")+"");
|
|
|
locationDataVO.setIdCard(map.get("idcard")+"");
|
|
|
locationDataVO.setCategoryCode(map.get("category_code")+"");
|
|
|
locationDataVO.setDeviceSn(map.get("device_sn")+"");
|
|
|
locationDataVO.setLocation(geoPoint);
|
|
|
locationDataVO.setDeviceTime(map.get("device_time")+"");
|
|
|
locationDataVO.setLabel(map.get("label")+"");
|
|
|
if(map.get("disease_condition")!=null){
|
|
|
locationDataVO.setDiseaseCondition(Integer.parseInt(map.get("disease_condition").toString()));
|
|
|
}else {
|
|
|
locationDataVO.setDiseaseCondition(0);
|
|
|
}
|
|
|
locationDataVO.setCreateTime(map.get("create_time")+"");
|
|
|
locationDataVO.setPatient(map.get("patient")+"");
|
|
|
locationDataVO.setDeviceCommon(map.get("device_common")+"");
|
|
|
locationDataVO.setUseCode(map.get("use_code")+"");
|
|
|
locationDataVO.setCombinationMethod(map.get("xombination_method")+"");
|
|
|
locationDataVO.setTown(map.get("town")+"");
|
|
|
locationDataVO.setNetworkTransmission(map.get("network_transmission")+"");
|
|
|
locationDataVOList.add(locationDataVO);
|
|
|
});
|
|
|
|
|
|
return PageEnvelop.getSuccessListWithPage("获取成功",locationDataVOList,page,size,totalCount);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取位置信息
|
|
@ -1208,33 +1296,57 @@ public class MonitorPlatformService {
|
|
|
*/
|
|
|
public JSONObject getBrandsAndManufacturer() {
|
|
|
try {
|
|
|
String sql = "select count(DISTINCT A.device_name) as total,A.device_name, IF(A.manufacturer = '健康之路', '福建健康之路信息技术有限公司', A.manufacturer) manufacturer from (\n" +
|
|
|
"select pd.device_name,wd.manufacturer from wlyy.wlyy_patient_device pd,device.wlyy_devices wd\n" +
|
|
|
"where pd.device_sn = wd.device_code and pd.del=0 \n" +
|
|
|
"and wd.manufacturer_code is not null and wd.manufacturer_code <>'' and pd.device_name<>'血压计-null' and pd.device_name<>'血糖仪-自助体检一体机' \n" +
|
|
|
"GROUP BY wd.manufacturer_code,pd.device_name\n" +
|
|
|
"UNION\n" +
|
|
|
"select case device_name when '自助体检一体机' then '健康小屋' else device_name end AS device_name,manufacturer from xmiot.iot_equipmet_detail group BY manufacturer_code,device_name\n" +
|
|
|
")A\n" +
|
|
|
"GROUP BY A.manufacturer\n" +
|
|
|
"ORDER BY total desc";
|
|
|
List<Map<String, Object>> Manufacturers = jdbcTemplate.queryForList(sql);
|
|
|
JSONObject result = new JSONObject();
|
|
|
JSONArray arr = JSONArray.parseArray(JSON.toJSONString(Manufacturers));
|
|
|
result.put("Manufacturers", arr);
|
|
|
sql = "select count(DISTINCT A.device_name)from (\n" +
|
|
|
"select pd.device_name from wlyy.wlyy_patient_device pd,device.wlyy_devices wd\n" +
|
|
|
"where pd.device_sn = wd.device_code and pd.del=0 \n" +
|
|
|
"and wd.manufacturer_code is not null and wd.manufacturer_code <>'' and pd.device_name<>'血压计-null' and pd.device_name<>'血糖仪-自助体检一体机' \n" +
|
|
|
"GROUP BY wd.manufacturer_code,pd.device_name\n" +
|
|
|
"UNION\n" +
|
|
|
"select case device_name when '自助体检一体机' then '健康小屋' else device_name end AS device_name from xmiot.iot_equipmet_detail group BY manufacturer_code,device_name\n" +
|
|
|
")A";
|
|
|
Integer BrandsCount = jdbcTemplate.queryForObject(sql, Integer.class);
|
|
|
|
|
|
result.put("Brands", BrandsCount);
|
|
|
result.put("manufacturerCount", arr.size());
|
|
|
return result;
|
|
|
JSONObject object = new JSONObject();
|
|
|
String sql = "select * from iot_statistics_app where type = '3' or type='4' order by num desc";
|
|
|
List<IotStatisticsAppDO> appDOS = jdbcTempalte.query(sql,new BeanPropertyRowMapper<>(IotStatisticsAppDO.class));
|
|
|
if(appDOS.size()>0){
|
|
|
Map<String,List<IotStatisticsAppDO>> listMap = appDOS.stream().collect(Collectors.groupingBy(IotStatisticsAppDO::getType));
|
|
|
IotStatisticsAppDO appDO = listMap.get("4").get(0);
|
|
|
List<IotStatisticsAppDO> appDOList = listMap.get("3");
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
for (IotStatisticsAppDO app:appDOList){
|
|
|
JSONObject json = new JSONObject();
|
|
|
json.put("manufacturer",app.getName());
|
|
|
json.put("total",app.getNum());
|
|
|
jsonArray.add(json);
|
|
|
}
|
|
|
object.put("Brands",appDO.getNum());//产品数
|
|
|
object.put("Manufacturers",jsonArray);
|
|
|
object.put("manufacturerCount",appDO.getName());
|
|
|
}else {
|
|
|
object.put("Brands",0);
|
|
|
object.put("Manufacturers",new ArrayList<>());
|
|
|
object.put("manufacturerCount",40);//目前暂无医疗机构接入,默认0家。
|
|
|
}
|
|
|
return object;
|
|
|
|
|
|
// String sql = "select count(DISTINCT A.device_name) as total,A.device_name, IF(A.manufacturer = '健康之路', '福建健康之路信息技术有限公司', A.manufacturer) manufacturer from (\n" +
|
|
|
// "select pd.device_name,wd.manufacturer from wlyy.wlyy_patient_device pd,device.wlyy_devices wd\n" +
|
|
|
// "where pd.device_sn = wd.device_code and pd.del=0 \n" +
|
|
|
// "and wd.manufacturer_code is not null and wd.manufacturer_code <>'' and pd.device_name<>'血压计-null' and pd.device_name<>'血糖仪-自助体检一体机' \n" +
|
|
|
// "GROUP BY wd.manufacturer_code,pd.device_name\n" +
|
|
|
// "UNION\n" +
|
|
|
// "select case device_name when '自助体检一体机' then '健康小屋' else device_name end AS device_name,manufacturer from xmiot.iot_equipmet_detail group BY manufacturer_code,device_name\n" +
|
|
|
// ")A\n" +
|
|
|
// "GROUP BY A.manufacturer\n" +
|
|
|
// "ORDER BY total desc";
|
|
|
// List<Map<String, Object>> Manufacturers = jdbcTemplate.queryForList(sql);
|
|
|
// JSONObject result = new JSONObject();
|
|
|
// JSONArray arr = JSONArray.parseArray(JSON.toJSONString(Manufacturers));
|
|
|
// result.put("Manufacturers", arr);
|
|
|
// sql = "select count(DISTINCT A.device_name)from (\n" +
|
|
|
// "select pd.device_name from wlyy.wlyy_patient_device pd,device.wlyy_devices wd\n" +
|
|
|
// "where pd.device_sn = wd.device_code and pd.del=0 \n" +
|
|
|
// "and wd.manufacturer_code is not null and wd.manufacturer_code <>'' and pd.device_name<>'血压计-null' and pd.device_name<>'血糖仪-自助体检一体机' \n" +
|
|
|
// "GROUP BY wd.manufacturer_code,pd.device_name\n" +
|
|
|
// "UNION\n" +
|
|
|
// "select case device_name when '自助体检一体机' then '健康小屋' else device_name end AS device_name from xmiot.iot_equipmet_detail group BY manufacturer_code,device_name\n" +
|
|
|
// ")A";
|
|
|
// Integer BrandsCount = jdbcTemplate.queryForObject(sql, Integer.class);
|
|
|
//
|
|
|
// result.put("Brands", BrandsCount);
|
|
|
// result.put("manufacturerCount", arr.size());
|
|
|
// return result;
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
@ -1242,6 +1354,94 @@ public class MonitorPlatformService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//入驻设备管理
|
|
|
public IotStatisticsStockDO onboardingDeviceManagement(String type,String town){
|
|
|
IotStatisticsStockDO stockDO;
|
|
|
try {
|
|
|
String sql = "select sum(total) total,sum(useing) useing,SUM(stock) stock,SUM(iot_count) iot_count,SUM(lost_count) lost_count, " +
|
|
|
"SUM(intervene_count) intervene_count,SUM(issue_count) issue_count,SUM(binding_count) binding_count,SUM(disease_patient_count) disease_patient_count, " +
|
|
|
"SUM(disease_patient_device_count) disease_patient_device_count,SUM(disease_patient_use_count) disease_patient_use_count, " +
|
|
|
"SUM(fault_count) fault_count from iot_statistics_stock WHERE town = '"+town+"' ";
|
|
|
if("0".equals(type)){
|
|
|
sql += " and parent_type = '0' ";
|
|
|
}else {
|
|
|
sql += " and type = '"+type+"' ";
|
|
|
}
|
|
|
List<IotStatisticsStockDO> list = jdbcTemplate.query(sql,new BeanPropertyRowMapper<>(IotStatisticsStockDO.class));
|
|
|
if(list.size()>0){
|
|
|
stockDO = list.get(0);
|
|
|
stockDO.setBindingRate(rateLong(stockDO.getBindingCount(),stockDO.getTotal()));
|
|
|
stockDO.setDiseasePatientDeviceRate(rateLong(stockDO.getDiseasePatientDeviceCount(),stockDO.getDiseasePatientCount()));
|
|
|
stockDO.setDiseasePatientUseRate(rateLong(stockDO.getDiseasePatientUseCount(),stockDO.getDiseasePatientDeviceCount()));
|
|
|
stockDO.setFaultRate(rateLong(stockDO.getFaultCount(),stockDO.getTotal()));
|
|
|
stockDO.setInterveneRate(rateLong(stockDO.getInterveneCount(),stockDO.getTotal()));
|
|
|
stockDO.setIotRate(rateLong(stockDO.getIotCount(),stockDO.getIssueCount()));
|
|
|
stockDO.setIssueRate(rateLong(stockDO.getIssueCount(),stockDO.getTotal()));
|
|
|
stockDO.setLostRate(rateLong(stockDO.getLostCount(),stockDO.getIssueCount()));
|
|
|
return stockDO;
|
|
|
}else {
|
|
|
stockDO = new IotStatisticsStockDO();
|
|
|
stockDO.setBindingRate("0.00%");
|
|
|
stockDO.setDiseasePatientDeviceRate("0.00%");
|
|
|
stockDO.setDiseasePatientUseRate("0.00%");
|
|
|
stockDO.setFaultRate("0.00%");
|
|
|
stockDO.setInterveneRate("0.00%");
|
|
|
stockDO.setIotRate("0.00%");
|
|
|
stockDO.setIssueRate("0.00%");
|
|
|
stockDO.setLostRate("0.00%");
|
|
|
stockDO.setTotal(0l);//总数
|
|
|
stockDO.setUseing(0l);//使用数
|
|
|
stockDO.setStock(0l);//库存数
|
|
|
stockDO.setIotCount(0l);//物联数
|
|
|
stockDO.setLostCount(0l);//失联数
|
|
|
stockDO.setInterveneCount(0l);//干预数
|
|
|
stockDO.setIssueCount(0l);//发放数
|
|
|
stockDO.setBindingCount(0l);//绑定数
|
|
|
stockDO.setDiseasePatientCount(0l);//慢病患者数
|
|
|
stockDO.setDiseasePatientDeviceCount(0l);//慢病患者设备数
|
|
|
stockDO.setDiseasePatientUseCount(0l);//慢病患者设备使用数
|
|
|
stockDO.setFaultCount(0l);//设备故障数
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
stockDO = new IotStatisticsStockDO();
|
|
|
}
|
|
|
return stockDO;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 计算百分比
|
|
|
* @param molecule 分子
|
|
|
* @param denominator 分母
|
|
|
*/
|
|
|
public String rateLong(Long molecule,Long denominator){
|
|
|
if(molecule==null||denominator==null){
|
|
|
return "0.00%";
|
|
|
}
|
|
|
if (denominator == 0 && molecule > 0) {
|
|
|
return "100%";
|
|
|
} else if (molecule == 0 && denominator == 0) {
|
|
|
return "0.00%";
|
|
|
}
|
|
|
float size = (float) (molecule * 100) / denominator;
|
|
|
DecimalFormat df = new DecimalFormat("0.00");//格式化小数,不足的补0
|
|
|
String filesize = df.format(size);
|
|
|
return filesize + "%";
|
|
|
}
|
|
|
|
|
|
//设备库存、使用中、总备案、物联率、失联率
|
|
|
public List<Map<String,Object>> getEquipmentStock(){
|
|
|
List<Map<String,Object>> result = new ArrayList<>();
|
|
|
try {
|
|
|
String sql = "SELECT name,type,total,useing,stock from iot_statistics_stock WHERE parent_type = '0' and town = '350200'";
|
|
|
List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
return list;
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 谁设备库存、使用中、总备案、物联率、失联率
|
|
|
*
|
|
@ -1457,6 +1657,21 @@ public class MonitorPlatformService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//设备组合方式和设备网络传输
|
|
|
public JSONObject combinationMethodAndWeb(){
|
|
|
JSONObject json = new JSONObject();
|
|
|
IotStatisticsCommonDO iotStatisticsCommonDO1 = iotStatisticsCommonDao.findOne("Combination_method1");
|
|
|
IotStatisticsCommonDO iotStatisticsCommonDO2 = iotStatisticsCommonDao.findOne("Combination_method2");
|
|
|
|
|
|
JSONObject Combination_method1 = JSONObject.parseObject(iotStatisticsCommonDO1.getContent());
|
|
|
JSONObject Combination_method2 = JSONObject.parseObject(iotStatisticsCommonDO2.getContent());
|
|
|
json.put("Combination_method1",Combination_method1);//设备组合方式
|
|
|
json.put("Combination_method2",Combination_method2);//设备网络传输
|
|
|
return json;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public String getRange(int first, int second, int i) {
|
|
|
if (second == 0 && first > 0) {
|
|
|
return "100";
|
|
@ -1630,7 +1845,49 @@ public class MonitorPlatformService {
|
|
|
|
|
|
public JSONObject getDeviceData() {
|
|
|
JSONObject object = new JSONObject();
|
|
|
//血糖仪数量
|
|
|
int homeHealthEquipment = 0;//健康监测设备数(血压血糖)
|
|
|
int homePhysicalSignData = 0;//健康监测设备体征数
|
|
|
int homeAbnormalSignData = 0;//健康监测设备异常数
|
|
|
int medicalInstitutionIquipment = 0;//自助服务设备数(药柜)
|
|
|
int medicalPhysicalSignData = 0;//自助服务设备体征数
|
|
|
int medicalAbnormalSignData = 0;//自助服务设备异常数
|
|
|
int hospitalEquipment = 0;//临床医疗设备数(小屋)
|
|
|
int hospitalPhysicalSignData = 0;//临床医疗设备体征数
|
|
|
int hospitalAbnormalSignData = 0;//临床医疗设备异常数
|
|
|
String sql = " select * from iot_statistics_realtime";
|
|
|
List<IotStatisticsRealtimeDO> realtimeDOList = jdbcTemplate.query(sql,new BeanPropertyRowMapper<>(IotStatisticsRealtimeDO.class));
|
|
|
for (IotStatisticsRealtimeDO realtimeDO:realtimeDOList){
|
|
|
if("1".equals(realtimeDO.getType())){
|
|
|
homeHealthEquipment = Integer.parseInt(realtimeDO.getDeviceNum());//健康监测设备(血压血糖)
|
|
|
homePhysicalSignData = Integer.parseInt(realtimeDO.getSignNum());//
|
|
|
homeAbnormalSignData = Integer.parseInt(realtimeDO.getAbnormalNum());//
|
|
|
continue;
|
|
|
}
|
|
|
if("2".equals(realtimeDO.getType())){
|
|
|
medicalInstitutionIquipment = Integer.parseInt(realtimeDO.getDeviceNum());//健康监测设备(血压血糖)
|
|
|
medicalPhysicalSignData = Integer.parseInt(realtimeDO.getSignNum());//
|
|
|
medicalAbnormalSignData = Integer.parseInt(realtimeDO.getAbnormalNum());//
|
|
|
continue;
|
|
|
}
|
|
|
if("3".equals(realtimeDO.getType())){
|
|
|
hospitalEquipment = Integer.parseInt(realtimeDO.getDeviceNum());//健康监测设备(血压血糖)
|
|
|
hospitalPhysicalSignData = Integer.parseInt(realtimeDO.getSignNum());//
|
|
|
hospitalAbnormalSignData = Integer.parseInt(realtimeDO.getAbnormalNum());//
|
|
|
continue;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
object.put("homeHealthEquipment", homeHealthEquipment);
|
|
|
object.put("homePhysicalSignData", homePhysicalSignData);
|
|
|
object.put("homeAbnormalSignData", homeAbnormalSignData);
|
|
|
object.put("medicalInstitutionIquipment", medicalInstitutionIquipment);
|
|
|
object.put("medicalPhysicalSignData", medicalPhysicalSignData);
|
|
|
object.put("medicalAbnormalSignData", medicalAbnormalSignData);
|
|
|
object.put("hospitalEquipment", hospitalEquipment);
|
|
|
object.put("hospitalPhysicalSignData", hospitalPhysicalSignData);
|
|
|
object.put("hospitalAbnormalSignData", hospitalAbnormalSignData);
|
|
|
|
|
|
/* //血糖仪数量
|
|
|
String bloodGlucosemeterCount = "SELECT COUNT(1) FROM wlyy.wlyy_patient_device WHERE category_code = 1 AND del = 0";
|
|
|
//血压计数量
|
|
|
String sphygmomanometerCount = "SELECT COUNT(1) FROM wlyy.wlyy_patient_device WHERE category_code = 2 AND del = 0";
|
|
@ -1664,33 +1921,22 @@ public class MonitorPlatformService {
|
|
|
"or (d.`code`='LowPressure' and (d.`value` not BETWEEN 60.0 and 90))\n" +
|
|
|
");";
|
|
|
Integer gg = jdbcTemplate.queryForObject(abnormalSignDataOfCabin, Integer.class);
|
|
|
object.put("medicalAbnormalSignData", gg);
|
|
|
object.put("medicalAbnormalSignData", gg);*/
|
|
|
return object;
|
|
|
}
|
|
|
|
|
|
@Autowired
|
|
|
private PermissionService permissionService;
|
|
|
|
|
|
public JSONArray getSearchTags() {
|
|
|
String sql = "select id,`value` from xmiot.iot_system_dict where dict_name='DEVICE' and (value='组合一体机' or value ='单体征测量仪') and del=1;";
|
|
|
String sql = "SELECT dict_code code,dict_value name from "+permissionService.getDbName()+".wlyy_hospital_sys_dict WHERE dict_name = 'Device_common_name' and hospital='1' ";
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
JSONArray result = new JSONArray();
|
|
|
for (Map<String, Object> map : list) {
|
|
|
sql = "select `code`,`value` from xmiot.iot_system_dict where dict_name='DEVICE_TYPE' AND del=1 AND code!=10 AND code!=11 AND parent_code='" + map.get("id").toString() + "'";
|
|
|
StringBuffer buffer = new StringBuffer();
|
|
|
List<Map<String, Object>> reList = jdbcTemplate.queryForList(sql);
|
|
|
for (Map<String, Object> reMap : reList) {
|
|
|
JSONObject tmp = new JSONObject();
|
|
|
tmp.put("name", reMap.get("value").toString());
|
|
|
tmp.put("code", reMap.get("code").toString());
|
|
|
buffer.append("," + reMap.get("code").toString());
|
|
|
result.add(tmp);
|
|
|
}
|
|
|
//组合一体机 单体征测量仪 数据
|
|
|
// if (org.apache.commons.lang3.StringUtils.isNoneBlank(buffer.toString())) {
|
|
|
// buffer.deleteCharAt(0);
|
|
|
// JSONObject tmp = new JSONObject();
|
|
|
// tmp.put("name", map.get("value").toString());
|
|
|
// tmp.put("code", buffer.toString());
|
|
|
// result.add(tmp);
|
|
|
// }
|
|
|
JSONObject tmp = new JSONObject();
|
|
|
tmp.put("name", map.get("name").toString());
|
|
|
tmp.put("code", map.get("code").toString());
|
|
|
result.add(tmp);
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
@ -1818,7 +2064,7 @@ public class MonitorPlatformService {
|
|
|
JSONObject location = new JSONObject();
|
|
|
location.put("lat", Double.valueOf(json.get("lat")));
|
|
|
location.put("lon", Double.valueOf(json.get("lng")));
|
|
|
String insertSql = "INSERT INTO device.wlyy_patient_device_location(patient,idcard,disease_condition,device_sn,\n" +
|
|
|
String insertSql = "INSERT INTO wlyy_patient_device_location(patient,idcard,disease_condition,device_sn,\n" +
|
|
|
"device_name,category_code,device_time,create_time,location)\n" +
|
|
|
"VALUES('" + map.get("code").toString() + "','" + map.get("idcard").toString() + "','" + map.get("disease_condition").toString() + "','" + map.get("device_sn").toString() + "','" + map.get("device_name") + "',\n" +
|
|
|
"'" + map.get("category_code").toString() + "','" + map.get("create_time") + "','" + map.get("create_time").toString() + "','" + location.toJSONString() + "')\n";
|