正在显示
3 个修改的文件
包含
16 行增加
和
2 行删除
| @@ -28,7 +28,7 @@ public class OperatingData { | @@ -28,7 +28,7 @@ public class OperatingData { | ||
| 28 | Object object = field.get(value); | 28 | Object object = field.get(value); |
| 29 | if(null != object) | 29 | if(null != object) |
| 30 | { | 30 | { |
| 31 | - if(object.getClass().isPrimitive()) | 31 | + if(isWrapperType(object)) |
| 32 | { | 32 | { |
| 33 | operatingDataType.setValue(field,object); | 33 | operatingDataType.setValue(field,object); |
| 34 | ifOperatingDataValueIsNotNull.exeValue(field.getName(),object); | 34 | ifOperatingDataValueIsNotNull.exeValue(field.getName(),object); |
| @@ -80,4 +80,10 @@ public class OperatingData { | @@ -80,4 +80,10 @@ public class OperatingData { | ||
| 80 | } | 80 | } |
| 81 | return null; | 81 | return null; |
| 82 | } | 82 | } |
| 83 | + | ||
| 84 | + public static boolean isWrapperType(Object object) { | ||
| 85 | + return object instanceof Integer || object instanceof Byte || object instanceof Short || | ||
| 86 | + object instanceof Long || object instanceof Float || object instanceof Double || | ||
| 87 | + object instanceof Character || object instanceof Boolean || object.getClass().isPrimitive(); | ||
| 88 | + } | ||
| 83 | } | 89 | } |
| @@ -49,6 +49,10 @@ public class DateListenService { | @@ -49,6 +49,10 @@ public class DateListenService { | ||
| 49 | if(null != data && data.size() != 0) | 49 | if(null != data && data.size() != 0) |
| 50 | { | 50 | { |
| 51 | Condata condata = BeanUtil.mapToBean(data, Condata.class,false,null); | 51 | Condata condata = BeanUtil.mapToBean(data, Condata.class,false,null); |
| 52 | + if(condata.getRunstate()==0) | ||
| 53 | + { | ||
| 54 | + condata.setRunstate(3); | ||
| 55 | + } | ||
| 52 | Info info = BeanUtil.mapToBean(data, Info.class,false,null); | 56 | Info info = BeanUtil.mapToBean(data, Info.class,false,null); |
| 53 | if(ObjectUtil.notEqual(OperatingData.feederConfig.getCondata(),condata)) | 57 | if(ObjectUtil.notEqual(OperatingData.feederConfig.getCondata(),condata)) |
| 54 | { | 58 | { |
| @@ -6,6 +6,9 @@ import com.zhonglai.luhui.smart.feeder.service.device.SerialPortService; | @@ -6,6 +6,9 @@ import com.zhonglai.luhui.smart.feeder.service.device.SerialPortService; | ||
| 6 | import com.zhonglai.luhui.smart.feeder.service.device.handle.CameraRtspHandle; | 6 | import com.zhonglai.luhui.smart.feeder.service.device.handle.CameraRtspHandle; |
| 7 | import com.zhonglai.luhui.smart.feeder.service.netty.NettyClient; | 7 | import com.zhonglai.luhui.smart.feeder.service.netty.NettyClient; |
| 8 | 8 | ||
| 9 | +import java.io.BufferedReader; | ||
| 10 | +import java.io.InputStreamReader; | ||
| 11 | + | ||
| 9 | public class InitService { | 12 | public class InitService { |
| 10 | public static SerialPortService serialPortService; | 13 | public static SerialPortService serialPortService; |
| 11 | 14 | ||
| @@ -63,6 +66,7 @@ public class InitService { | @@ -63,6 +66,7 @@ public class InitService { | ||
| 63 | //数据上报 | 66 | //数据上报 |
| 64 | mqttService = new MqttService(); | 67 | mqttService = new MqttService(); |
| 65 | mqttService.start(); | 68 | mqttService.start(); |
| 66 | - } | ||
| 67 | 69 | ||
| 70 | + | ||
| 71 | + } | ||
| 68 | } | 72 | } |
-
请 注册 或 登录 后发表评论