Browse Source

代码修改

liubing 3 years ago
parent
commit
ce5ce1969b

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

@ -2074,18 +2074,40 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
                " and m.doctor_code = '"+doctor+"' and m.del = '1' ";
        String filter = "";
        String deviceSn ="";
        String categoryCode ="";
        switch (topicItem){
            case "actionTrack":
                categoryCode="'4'";
                break;
            case "preventLost":
                categoryCode="'4'";
                break;
            case "preventFall":
                categoryCode="'12'";
                break;
            case "preventFire":
                categoryCode="'15'";
                break;
            case "preventGasLeakage":
                categoryCode="'14'";
                break;
            case "preventOutOfBed":
                categoryCode="'13'";
                break;
        }
        if ("actionTrack".equals(topicItem)){//行动轨迹
            filter =" and EXISTS (select 1 from wlyy_patient_device pd INNER JOIN dm_device dd on pd.device_id = dd.id  " +
                    " where  pd.user = sr.patient and pd.del=0 and  FIND_IN_SET('preventLost',dd.service_topic)) ";
                    " where  pd.user = sr.patient and pd.del=0 and pd.category_code in ("+categoryCode+") and FIND_IN_SET('preventLost',dd.service_topic)) ";
            List<String> deviceSns = jdbcTemplate.queryForList("select 1 from wlyy_patient_device pd INNER JOIN dm_device dd " +
                    " on pd.device_id = dd.id where  pd.user = sr.patient and pd.del=0 and  FIND_IN_SET('preventLost',dd.service_topic)",String.class);
                    " on pd.device_id = dd.id where  pd.user = sr.patient and pd.del=0 and  and pd.category_code in ("+categoryCode+") FIND_IN_SET('preventLost',dd.service_topic)",String.class);
            if (deviceSns.size()>0){
                deviceSn = deviceSns.get(0);
            }
        }
        else{
            filter =" and EXISTS (select 1 from wlyy_patient_device pd INNER JOIN dm_device dd on pd.device_id = dd.id  " +
                    " where  pd.user = sr.patient and pd.del=0 and  FIND_IN_SET('"+topicItem+"',dd.service_topic)) ";
                    " where  pd.user = sr.patient and pd.del=0 and and pd.category_code in ("+categoryCode+")  FIND_IN_SET('"+topicItem+"',dd.service_topic)) ";
        }
        if ("preventLost".equals(topicItem)){//有绑定围栏的居民
@ -2111,8 +2133,9 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
                JSONObject object = new JSONObject();
                switch (topicItem){
                    case "actionTrack":
                        List<Map<String , Object>> actionTracks = getActionTrack(deviceSn,day);
                        object.put("actionTrack",actionTracks);
                        org.json.JSONArray locations = patientDeviceService.getX1Locations(deviceSn, day);
                        object.put("routes", locations);
                        object.put("actionTrack",locations);
                        break;
                    default:
                        object = patientMonitoringInfo(patientTmp.get("id").toString(),topicItem,false);