Browse Source

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

叶仕杰 3 years ago
parent
commit
b4831b19bd

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

@ -1330,23 +1330,39 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
    }
    public void preventFire(JSONObject result,String patient){
        List<DevicePatientDevice> devicePatientDeviceDos = patientDeviceDao.findByUserAndCategoryCode(patient,"15");
        if (devicePatientDeviceDos.size()==0){}
        else {
            DevicePatientDevice deviceDo = devicePatientDeviceDos.get(0);
        String sql = "SELECT r.value from wlyy_patient_device pd,base_device_health_index r " +
                "WHERE pd.device_sn = r.device_sn and pd.`user` = '"+patient+"' ";
        sql += " and pd.category_code='15' ORDER BY r.create_time desc LIMIT 1";
        List<Map<String,Object>> list1 = jdbcTemplate.queryForList(sql);
        if(list1.size()==0){
            result.put("smoke","-1");
        }else{
            result.put("smoke",list1.get(0).get("value"));
        }
        result.put("orderNum",getOrder(patient,"preventFire"));
        monitorInfo(result, patient);
    }
    public void preventGasLeakage(JSONObject result,String patient){
        List<DevicePatientDevice> devicePatientDeviceDos = patientDeviceDao.findByUserAndCategoryCode(patient,"14");
        if (devicePatientDeviceDos.size()==0){}
        else {
            DevicePatientDevice deviceDo = devicePatientDeviceDos.get(0);
    public Integer getOrder(String patient,String topicItem){
        String sql = "select count(1) from base_security_monitoring_order " +
                "WHERE patient = '"+patient+"' and `status` = 1 and topic_item = '"+topicItem+"'";
        Integer num = jdbcTemplate.queryForObject(sql,Integer.class);
        return num;
    }
    public void preventGasLeakage(JSONObject result,String patient){
        String sql = "SELECT r.value from wlyy_patient_device pd,base_device_health_index r " +
                "WHERE pd.device_sn = r.device_sn and pd.`user` = '"+patient+"' ";
        sql += " and pd.category_code='14' ORDER BY r.create_time desc LIMIT 1";
        List<Map<String,Object>> list1 = jdbcTemplate.queryForList(sql);
        if(list1.size()==0){
            result.put("methane","-1");
        }else{
            result.put("methane",list1.get(0).get("value"));
        }
        result.put("orderNum",getOrder(patient,"preventGasLeakage"));
        monitorInfo(result, patient);
    }