Przeglądaj źródła

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

wsl 2 lat temu
rodzic
commit
2ad39e4e66

+ 14 - 5
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/statistics/StatisticsService.java

@ -515,10 +515,19 @@ public class StatisticsService {
            }
        }
        String healthEquipmentSql = "SELECT COUNT(1) FROM wlyy_patient_device WHERE del = 0 AND (category_code = 1 OR category_code = 2)";
        Integer healthEquipmentNum = jdbcTemplate.queryForObject(healthEquipmentSql, Integer.class);
        String securityEquipmentSql = "SELECT COUNT(1) FROM wlyy_patient_device WHERE del = 0 AND category_code > 2";
        Integer securityEquipmentNum = jdbcTemplate.queryForObject(securityEquipmentSql, Integer.class);
        Integer healthEquipmentNum = 0;
        Integer securityEquipmentNum = 0;
        String equipmentSql = "SELECT count(DISTINCT device_code) c,device_type FROM wlyy_devices WHERE (device_code IS NOT NULL OR device_code <> '') GROUP BY device_type";
        List<Map<String,Object>> equipmentList = jdbcTemplate.queryForList(equipmentSql);
        for (Map<String,Object> map:equipmentList){
            Integer device_type = Integer.valueOf(map.get("device_type")+"");
            Integer c = Integer.valueOf(map.get("c")+"");
            if(device_type == 0){
                healthEquipmentNum = c;
            }else {
                securityEquipmentNum = c;
            }
        }
        sqltmp = "SELECT GROUP_CONCAT(dict_code) orgCodes from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_org' ";
        listtmp = jdbcTemplate.queryForList(sqltmp);
@ -3881,7 +3890,7 @@ public class StatisticsService {
        //离线设备数量
        String offLineDeviceSql="select count(distinct pd.device_sn) total from wlyy_patient_device pd INNER JOIN wlyy_devices dev on pd.device_sn = dev.device_code " +
                "                 INNER JOIN base_patient p on pd.user = p.id and pd.del=0 and p.del=1 " + teamCodeSql +
                "                where dev.contact_status=0  and pd.device_type = "+type+"  AND pd.user NOT IN ("+testUsqlSql+") group by pd.device_type";
                "                where ( dev.contact_status=0 or dev.contact_status IS NULL )  and pd.device_type = "+type+"  AND pd.user NOT IN ("+testUsqlSql+") group by pd.device_type";
        //设备总数
        String deviceTotalSql = "SELECT count(DISTINCT device_code) FROM wlyy_devices WHERE (device_code IS NOT NULL OR device_code <> '') AND device_type = "+type+"";

+ 43 - 13
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/third/PatientInfoPlatFormService.java

@ -937,12 +937,30 @@ public class PatientInfoPlatFormService {
                    detailInfo.put("warnStatus",false);
                }
                com.alibaba.fastjson.JSONObject tmp = ysDeviceService.getDeviceLiveAddress(patient, deviceSn, 1, null);
                detailInfo.put("monitorInfoStatus", tmp.getIntValue(ResponseContant.resultFlag));
                if (tmp.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
                    detailInfo.put("monitorInfo", tmp.getString(ResponseContant.resultMsg));
                } else {
                    detailInfo.put("monitorInfo", tmp.getJSONObject(ResponseContant.resultMsg));
                if(bl){
                    //取之前时间的监控
                    try {
                        JSONObject tmp = ysDeviceService.deviceVideoTimeList(patient, deviceSn, 1,beforeTime.substring(0,10)+" 00:00:00",beforeTime.substring(0,10)+" 23:59:59",0, null);
                        //JSONObject tmp = ysDeviceService.deviceVideoUrlByTime(deviceSn, 1,"3","2",beforeTime,afterTime,1000, null);
                        detailInfo.put("monitorInfoStatus", tmp.getIntValue(ResponseContant.resultFlag));
                        if (tmp.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
                            detailInfo.put("monitorInfo", tmp.getString(ResponseContant.resultMsg));
                        } else {
                            detailInfo.put("monitorInfo", tmp.getJSONObject(ResponseContant.resultMsg));
                        }
                    } catch (Exception e) {
                        e.printStackTrace();
                        detailInfo.put("monitorInfoStatus", 0);
                        detailInfo.put("monitorInfo", "未获取到当天录像信息");
                    }
                }else {
                    com.alibaba.fastjson.JSONObject tmp = ysDeviceService.getDeviceLiveAddress(patient, deviceSn, 1, null);
                    detailInfo.put("monitorInfoStatus", tmp.getIntValue(ResponseContant.resultFlag));
                    if (tmp.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
                        detailInfo.put("monitorInfo", tmp.getString(ResponseContant.resultMsg));
                    } else {
                        detailInfo.put("monitorInfo", tmp.getJSONObject(ResponseContant.resultMsg));
                    }
                }
                break;
@ -995,7 +1013,11 @@ public class PatientInfoPlatFormService {
                    detailInfo.put("warnStatus",false);
                }
                //获取最新一次燃气浓度
                sql = " select value, DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%S') record_time  from base_device_health_index where device_sn='"+deviceSn+"' ORDER BY record_time desc limit 1 ";
                if(bl){
                    sql = " select value, DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%S') record_time  from base_device_health_index where device_sn='"+deviceSn+"' and record_time >= '"+beforeTime+"' and record_time <= '"+afterTime+"' ORDER BY record_time desc limit 1 ";
                }else {
                    sql = " select value, DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%S') record_time  from base_device_health_index where device_sn='"+deviceSn+"' ORDER BY record_time desc limit 1 ";
                }
                sqlResult = jdbcTemplate.queryForList(sql);
                if (sqlResult.size()>0){
                    detailInfo.putAll(sqlResult.get(0));
@ -1017,7 +1039,11 @@ public class PatientInfoPlatFormService {
                    detailInfo.put("warnStatus",false);
                }
                //获取最新一次烟雾浓度
                sql = " select value,DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%S') record_time  from base_device_health_index where device_sn='"+deviceSn+"' ORDER BY record_time desc limit 1 ";
                if(bl){
                    sql = " select value,DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%S') record_time  from base_device_health_index where device_sn='"+deviceSn+"' and record_time >='"+beforeTime+"' and record_time <= '"+afterTime+"'  ORDER BY record_time desc limit 1 ";
                }else {
                    sql = " select value,DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%S') record_time  from base_device_health_index where device_sn='"+deviceSn+"' ORDER BY record_time desc limit 1 ";
                }
                sqlResult = jdbcTemplate.queryForList(sql);
                if (sqlResult.size()>0){
                    detailInfo.putAll(sqlResult.get(0));
@ -1026,7 +1052,11 @@ public class PatientInfoPlatFormService {
                    detailInfo.put("value",null);
                    detailInfo.put("record_time",null);
                }
                sql = " select temperature_value ,record_time as temperature_value_record_time  from base_device_health_index where device_sn='"+deviceSn+"' and temperature_value is not null  ORDER BY record_time desc limit 1 ";
                if(bl){
                    sql = " select temperature_value ,record_time as temperature_value_record_time  from base_device_health_index where device_sn='"+deviceSn+"' and temperature_value is not null and record_time >= '"+beforeTime+"' and record_time<= '"+afterTime+"'  ORDER BY record_time desc limit 1 ";
                }else {
                    sql = " select temperature_value ,record_time as temperature_value_record_time  from base_device_health_index where device_sn='"+deviceSn+"' and temperature_value is not null  ORDER BY record_time desc limit 1 ";
                }
                sqlResult = jdbcTemplate.queryForList(sql);
                if (sqlResult.size()>0){
                    detailInfo.putAll(sqlResult.get(0));
@ -1247,7 +1277,7 @@ public class PatientInfoPlatFormService {
                " INNER JOIN base_patient p ON ord.patient = p.id \n" +
                " AND p.del = 1 \n" +
                " WHERE " +
                " ord.STATUS = 1 "+filter;
                " ord.STATUS = 1  AND NOT EXISTS ( SELECT 1 FROM base_emergency_warn_log log WHERE log.order_id = ord.id ) "+filter;
        String sql2 = " SELECT \n" +
                " '22' AS 'OrderType',\n" +
                " p.archive_type archiveType,\n" +
@ -1269,7 +1299,7 @@ public class PatientInfoPlatFormService {
                " FROM\n" +
                " base_security_monitoring_order ord \n" +
                " INNER JOIN base_patient p ON ord.patient = p.id \n" +
                " where ord.status = 1"+filter;
                " where ord.status = 1  AND NOT EXISTS ( SELECT 1 FROM base_emergency_warn_log log WHERE log.order_id = ord.id ) "+filter;
        String sql = "select * FROM (" +
                " "+sql1+" UNION "+sql2 +
@ -1362,13 +1392,13 @@ public class PatientInfoPlatFormService {
                " base_emergency_assistance_order ord " +
                " INNER JOIN base_patient p ON ord.patient = p.id and p.del=1  \n" +
                " WHERE\n" +
                "  ord.STATUS = 1"+filter;
                "  ord.STATUS = 1  AND NOT EXISTS ( SELECT 1 FROM base_emergency_warn_log log WHERE log.order_id = ord.id ) "+filter;
        //安防监护
        String securitySql = "SELECT count( ord.id ) warningCount \n" +
                " FROM\n" +
                " base_security_monitoring_order ord\n" +
                " INNER JOIN base_patient p ON ord.patient = p.id and p.del=1 \n" +
                " AND ord.STATUS = 1"+filter;
                " AND ord.STATUS = 1  AND NOT EXISTS ( SELECT 1 FROM base_emergency_warn_log log WHERE log.order_id = ord.id ) "+filter;
        String sqlCount = "SELECT\n" +
                " sum( warningCount ) warningCount\n" +
                " FROM\n" +