Browse Source

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

LAPTOP-KB9HII50\70708 3 years ago
parent
commit
5fa6c596df

+ 23 - 10
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/device/PatientDeviceService.java

@ -1049,6 +1049,17 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa
                    devInfoObj.put("routes", locations);
                    break;
                case "7"://报警器 紧急工单
                    com.alibaba.fastjson.JSONObject response = getAqgDeviceInfo2(deviceSn);
                    //电量
                    if (response.containsKey("remaining_power") && response.get("remaining_power") != null) {
                        devInfoObj.put("remaining_power", response.get("remaining_power"));
                    }
                    //在线状态实时获取
                    if (!response.getBoolean("online")) {//设备在线状态
                        devInfoObj.put("contactStatus",0);
                    } else {
                        devInfoObj.put("contactStatus",1);
                    }
                    break;
                case "12"://监控 视频地址
                    com.alibaba.fastjson.JSONObject tmp = ysDeviceService.getDeviceLiveAddress(patient, deviceSn, 1, null);
@ -1731,17 +1742,19 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa
    }
    public com.alibaba.fastjson.JSONObject getAqgDeviceInfo2(String imei){
        try {
            String url = MessageFormat.format(AqgConfig.deviceInfo, imei);
            HttpEntity<com.alibaba.fastjson.JSONObject> response = httpClientUtil.aqgCookieHttp(url, null, HttpMethod.GET, getCookie());
            com.alibaba.fastjson.JSONObject json = response.getBody();
            if(!json.getBoolean("success")){
                return  null;
        synchronized (imei.intern()){
            try {
                String url = MessageFormat.format(AqgConfig.deviceInfo, imei);
                HttpEntity<com.alibaba.fastjson.JSONObject> response = httpClientUtil.aqgCookieHttp(url, null, HttpMethod.GET, getCookie());
                com.alibaba.fastjson.JSONObject json = response.getBody();
                if(!json.getBoolean("success")){
                    return  null;
                }
                return json.getJSONObject("obj");
            }catch (Exception e){
                e.printStackTrace();
                return null;
            }
            return json.getJSONObject("obj");
        }catch (Exception e){
            e.printStackTrace();
            return null;
        }
    }

+ 10 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/security/SecurityMonitoringOrderService.java

@ -1925,8 +1925,10 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
                        Double lat = locationTmp.getJSONArray("coordinates").getDouble(1);
                        if (!response.getBoolean("online")) {//设备离线 取居民表定位
                            result.put("X1online", false);
                            result.put("contactStatus", 0);
                        } else {
                            result.put("X1online", true);
                            result.put("contactStatus", 1);
                        }
                        JSONObject tmp = gpsUtil.gcj02_To_Bd09(lat, lon);
                        tmp.put("city", response.getString("last_city"));
@ -2114,6 +2116,14 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
                        sleepInfo.put("sleepPlan", false);
                    }
                    sleepInfo.put("online", tmp.getBooleanValue("online"));
                    if(tmp.getBooleanValue("online")){
                        sleepInfo.put("contactStatus", 1);
                    }
                    else {
                        sleepInfo.put("contactStatus", 0);
                    }
                    if (tmp.getBooleanValue("onbed")) {
                        sleepInfo.put("bedStatus", 1);
                        sleepInfo.put("heartRate", tmp.getString("heartrate"));

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

@ -672,7 +672,7 @@ public class PatientInfoPlatFormService {
        String sql = " SELECT idx.id,idx.user,idx.`name`,p.archive_type archiveType,p.residential_area residentialArea,'健康监测' as serve_desc, " +
                "idx.czrq,value1,value2,value3,value4,value5,value6,value7,type FROM wlyy_patient_health_index idx " +
                " INNER JOIN base_patient p on idx.user = p.id and p.del=1\n" +
                " WHERE idx.del = 1 AND idx.type < 3 "+filter+" ORDER BY idx.czrq ";
                " WHERE idx.del = 1 AND idx.type < 3 "+filter+" ORDER BY idx.czrq desc ";
        String countSql = "select count(id) from ("+sql+")A ";
        long count = jdbcTemplate.queryForObject(countSql,long.class);
        sql +=" limit "+page*pageSize+","+pageSize;