LAPTOP-KB9HII50\70708 3 rokov pred
rodič
commit
6914b06647

+ 6 - 6
svr/svr-cloud-device/src/main/java/com/yihu/jw/care/service/OnenetService.java

@ -174,11 +174,11 @@ public class OnenetService {
            String wEventType = valueTmp.substring(16,20);
            String wEventType = valueTmp.substring(16,20);
            String wParamType = valueTmp.substring(28,32);
            String wParamType = valueTmp.substring(28,32);
            String wParamValue = valueTmp.substring(32,36);
            String wParamValue = valueTmp.substring(32,36);
            if("0062".equals(wEventType)&&"0001".equals(wParamType)){
            if("0062".equals(wEventType)&&"0017".equals(wParamType)){
                String byTime = value.substring(18,26);//时间 秒
                String byTime = value.substring(18,26);//时间 秒
                String time = DateUtil.dateToStrLong(DateUtil.secondTransfor(Integer.valueOf(byTime,16)));
                String time = DateUtil.dateToStrLong(DateUtil.secondTransfor(Integer.valueOf(byTime,16)));
                //烟雾浓度
                //烟雾浓度
                String monitorValue = StringUtil.division(Integer.valueOf(wParamValue),10);
                String monitorValue = Integer.valueOf(wParamValue,16)+"";
                String resourceSerial = onenetDevice.getSn();
                String resourceSerial = onenetDevice.getSn();
                addDeviceIndex(resourceSerial,monitorValue,time,"2","%");
                addDeviceIndex(resourceSerial,monitorValue,time,"2","%");
                dataPushLogUtil.savePushLog(resourceSerial,jsonObject.toJSONString(jsonObject,SerializerFeature.WriteMapNullValue),"可燃气体探测器监测信息接收");
                dataPushLogUtil.savePushLog(resourceSerial,jsonObject.toJSONString(jsonObject,SerializerFeature.WriteMapNullValue),"可燃气体探测器监测信息接收");
@ -199,9 +199,9 @@ public class OnenetService {
            String wParamValue = valueTmp.substring(32,36);
            String wParamValue = valueTmp.substring(32,36);
            if("0064".equals(wEventType)&&"0002".equals(wEventValue)){
            if("0064".equals(wEventType)&&"0002".equals(wEventValue)){
                //报警
                //报警
                if("0001".equals(wParamType)){
                if("0017".equals(wParamType)){
                    //烟雾浓度
                    //烟雾浓度
                    String monitorValue = StringUtil.division(Integer.valueOf(wParamValue),10);
                    String monitorValue = Integer.valueOf(wParamValue,16)+"";
                    String resourceSerial = onenetDevice.getSn();
                    String resourceSerial = onenetDevice.getSn();
                    String sql = "select count(*) from base_device_health_index where device_sn = '"+resourceSerial+"'" +
                    String sql = "select count(*) from base_device_health_index where device_sn = '"+resourceSerial+"'" +
                            " and value>0 and create_time>='"+DateUtil.getNextMinute(-60)+"' ";
                            " and value>0 and create_time>='"+DateUtil.getNextMinute(-60)+"' ";
@ -262,7 +262,7 @@ public class OnenetService {
                String byTime = value.substring(18,26);//时间 秒
                String byTime = value.substring(18,26);//时间 秒
                String time = DateUtil.dateToStrLong(DateUtil.secondTransfor(Integer.valueOf(byTime,16)));
                String time = DateUtil.dateToStrLong(DateUtil.secondTransfor(Integer.valueOf(byTime,16)));
                //气感浓度
                //气感浓度
                String monitorValue = StringUtil.division(Integer.valueOf(wParamValue),10);
                String monitorValue = StringUtil.division(Integer.valueOf(wParamValue,16),10);
                String resourceSerial = onenetDevice.getSn();
                String resourceSerial = onenetDevice.getSn();
                addDeviceIndex(resourceSerial,monitorValue,time,"1","%LEL");
                addDeviceIndex(resourceSerial,monitorValue,time,"1","%LEL");
                dataPushLogUtil.savePushLog(resourceSerial,jsonObject.toJSONString(jsonObject,SerializerFeature.WriteMapNullValue),"可燃气体探测器监测信息接收");
                dataPushLogUtil.savePushLog(resourceSerial,jsonObject.toJSONString(jsonObject,SerializerFeature.WriteMapNullValue),"可燃气体探测器监测信息接收");
@ -285,7 +285,7 @@ public class OnenetService {
                //气感报警
                //气感报警
                if("0001".equals(wParamType)){
                if("0001".equals(wParamType)){
                    //气感浓度
                    //气感浓度
                    String monitorValue = StringUtil.division(Integer.valueOf(wParamValue),10);
                    String monitorValue = StringUtil.division(Integer.valueOf(wParamValue,16),10);
                    String resourceSerial = onenetDevice.getSn();
                    String resourceSerial = onenetDevice.getSn();
                    String sql = "select count(*) from base_device_health_index where device_sn = '"+resourceSerial+"'" +
                    String sql = "select count(*) from base_device_health_index where device_sn = '"+resourceSerial+"'" +
                            " and value>0 and create_time>='"+DateUtil.getNextMinute(-60)+"' ";
                            " and value>0 and create_time>='"+DateUtil.getNextMinute(-60)+"' ";