Explorar o código

Merge branch 'dev' of liubing/wlyy2.0 into dev

liubing %!s(int64=2) %!d(string=hai) anos
pai
achega
c72ef12717

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

@ -426,18 +426,42 @@ public class StatisticsService {
        Integer emergencyCallNum = jdbcTemplate.queryForObject(emergencyCallSql, Integer.class);
        Integer emergencyCallNum = jdbcTemplate.queryForObject(emergencyCallSql, Integer.class);
        String securityMonitoringSql = "SELECT COUNT(1) FROM base_security_monitoring_order where 1=1 and hospital " + orgFilter;
        String securityMonitoringSql = "SELECT COUNT(1) FROM base_security_monitoring_order where 1=1 and hospital " + orgFilter;
        Integer securityMonitoringNum = jdbcTemplate.queryForObject(securityMonitoringSql, Integer.class);
        Integer securityMonitoringNum = jdbcTemplate.queryForObject(securityMonitoringSql, Integer.class);
        res.put("olderTotal", olderTotal);   //老人注册人数
        String oldTotalSql ="SELECT ((SELECT COUNT(distinct p.id) FROM base_patient p  WHERE p.sign_status = 1 AND p.del = 1 ) +(SELECT COUNT(distinct p.id) FROM base_patient p INNER JOIN " +
                " wlyy_patient_device d ON p.id = d.`user` WHERE p.sign_status = 0 AND p.del = 1  AND d.del = 0)) total";
        List<Integer> oldTotalList = jdbcTemplate.queryForList(oldTotalSql, Integer.class);
        res.put("olderTotal", oldTotalList.get(0));   //老人注册人数
        res.put("childTotal", childTotal);   //儿童注册人数
        res.put("childTotal", childTotal);   //儿童注册人数
        res.put("healthEquipmentNum", healthEquipmentNum);   //健康设备
        res.put("healthEquipmentNum", healthEquipmentNum);   //健康设备
        res.put("securityEquipmentNum", securityEquipmentNum);   //安防设备
        res.put("securityEquipmentNum", securityEquipmentNum);   //安防设备
        res.put("emergencyCallNum", emergencyCallNum);   //紧急呼叫的次数
        res.put("emergencyCallNum", emergencyCallNum);   //紧急呼叫的次数
        res.put("securityMonitoringNum", securityMonitoringNum);   //安防监护触发工单的次数
        res.put("securityMonitoringNum", securityMonitoringNum);   //安防监护触发工单的次数
        //离线的设备数 超过6小时未受理的预警数  超6小时未响应服务(审核照料发起6小时未接单)
        //离线的设备数 超过6小时未受理的预警数  超6小时未响应服务(审核照料发起6小时未接单)
        sqltmp = " select count(distinct pd.device_sn) from wlyy_patient_device pd INNER JOIN wlyy_devices dev on pd.device_sn = dev.device_code " +
        sqltmp = " select count(distinct pd.device_sn) total ,pd.device_type 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 " +
                " INNER JOIN base_patient p on pd.user = p.id and pd.del=0 and p.del=1 " +
                "where (dev.contact_status=0 or dev.contact_status is null ) and pd.user "+userfilter;
                "where (dev.contact_status=0 or dev.contact_status is null ) and pd.user "+userfilter;
        Long count = jdbcTemplate.queryForObject(sqltmp,Long.class);//离线设备
        sqltmp += " group by pd.device_type ";
        List<Map<String,Object>> offlineDevices = jdbcTemplate.queryForList(sqltmp);//离线设备
        Long count = 0l;
        Long offlineDevice0 = 0l;
        Long offlineDevice1 = 0l;
        for (Map<String,Object> tmp:offlineDevices){
            String deviceType =  tmp.get("device_type").toString();
            if ("0".equals(deviceType)){
                offlineDevice0 = Long.valueOf(tmp.get("total").toString());
            }
            if ("1".equals(deviceType)){
                offlineDevice1 = Long.valueOf(tmp.get("total").toString());
            }
        }
        count = offlineDevice0+offlineDevice1;
        res.put("offlineDevice", count);
        res.put("offlineDevice", count);
        res.put("offlineDevice0", offlineDevice0);//健康设备离线数
        res.put("offlineDevice1", offlineDevice1);//安防设备离线数
        sqltmp = " select sum(total) from ( " +
        sqltmp = " select sum(total) from ( " +
                "select count(o.id) total from  " +
                "select count(o.id) total from  " +
                "base_emergency_assistance_order o INNER JOIN base_patient p on o.patient = p.id where status=1 and o.patient " +userfilter+
                "base_emergency_assistance_order o INNER JOIN base_patient p on o.patient = p.id where status=1 and o.patient " +userfilter+
@ -1897,7 +1921,7 @@ public class StatisticsService {
            //能力评估 从签约时服务标签取  + 照护老人
            //能力评估 从签约时服务标签取  + 照护老人
            JSONArray jsonArray = cloudCareForTheElderly(endDate, area, level);
            JSONArray jsonArray = cloudCareForTheElderly(endDate, area, level);
            JSONObject oldTotalJson = new JSONObject();
            JSONObject oldTotalJson = new JSONObject();
            String oldTotalSql ="SELECT ((SELECT COUNT(*) FROM base_patient p  WHERE p.sign_status = 1 AND p.del = 1 ) +(SELECT COUNT(p.id) FROM base_patient p INNER JOIN " +
            String oldTotalSql ="SELECT ((SELECT COUNT(distinct p.id) FROM base_patient p  WHERE p.sign_status = 1 AND p.del = 1 ) +(SELECT COUNT(distinct p.id) FROM base_patient p INNER JOIN " +
                    " wlyy_patient_device d ON p.id = d.`user` WHERE p.sign_status = 0 AND p.del = 1  AND d.del = 0)) total";
                    " wlyy_patient_device d ON p.id = d.`user` WHERE p.sign_status = 0 AND p.del = 1  AND d.del = 0)) total";
            List<Integer> oldTotalList = jdbcTemplate.queryForList(oldTotalSql, Integer.class);
            List<Integer> oldTotalList = jdbcTemplate.queryForList(oldTotalSql, Integer.class);

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

@ -951,7 +951,7 @@ public class PatientInfoPlatFormService {
                    detailInfo.put("warnStatus",false);
                    detailInfo.put("warnStatus",false);
                }
                }
                //获取最新一次烟雾浓度
                //获取最新一次烟雾浓度
                sql = " select value,record_time  from base_device_health_index where device_sn='"+deviceSn+"' ORDER BY record_time desc limit 1 ";
                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);
                sqlResult = jdbcTemplate.queryForList(sql);
                if (sqlResult.size()>0){
                if (sqlResult.size()>0){
                    detailInfo.putAll(sqlResult.get(0));
                    detailInfo.putAll(sqlResult.get(0));