From 0058f1b0a9a72f61cf5898ac79229b5a7969b4ef Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Sun, 21 Apr 2024 00:24:24 +0800 Subject: [PATCH] =?UTF-8?q?1078-=E8=A7=A3=E6=9E=90104...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/jt1078/bean/JTDeviceConfig.java | 184 ++++++++++++++++++ .../iot/vmp/jt1078/proc/request/J0104.java | 27 +-- 2 files changed, 199 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/jt1078/bean/JTDeviceConfig.java b/src/main/java/com/genersoft/iot/vmp/jt1078/bean/JTDeviceConfig.java index 4a95db38e..054ff9c9e 100644 --- a/src/main/java/com/genersoft/iot/vmp/jt1078/bean/JTDeviceConfig.java +++ b/src/main/java/com/genersoft/iot/vmp/jt1078/bean/JTDeviceConfig.java @@ -479,6 +479,190 @@ public class JTDeviceConfig { this.illegalDrivingPeriods = illegalDrivingPeriods; } + public String getPlatformPhoneNumber() { + return platformPhoneNumber; + } + + public void setPlatformPhoneNumber(String platformPhoneNumber) { + this.platformPhoneNumber = platformPhoneNumber; + } + + public String getPhoneNumberForReset() { + return phoneNumberForReset; + } + + public void setPhoneNumberForReset(String phoneNumberForReset) { + this.phoneNumberForReset = phoneNumberForReset; + } + + public String getPhoneNumberForFactoryReset() { + return phoneNumberForFactoryReset; + } + + public void setPhoneNumberForFactoryReset(String phoneNumberForFactoryReset) { + this.phoneNumberForFactoryReset = phoneNumberForFactoryReset; + } + + public String getPhoneNumberForSms() { + return phoneNumberForSms; + } + + public void setPhoneNumberForSms(String phoneNumberForSms) { + this.phoneNumberForSms = phoneNumberForSms; + } + + public String getPhoneNumberForReceiveTextAlarm() { + return phoneNumberForReceiveTextAlarm; + } + + public void setPhoneNumberForReceiveTextAlarm(String phoneNumberForReceiveTextAlarm) { + this.phoneNumberForReceiveTextAlarm = phoneNumberForReceiveTextAlarm; + } + + public Long getPhoneAnsweringPolicy() { + return phoneAnsweringPolicy; + } + + public void setPhoneAnsweringPolicy(Long phoneAnsweringPolicy) { + this.phoneAnsweringPolicy = phoneAnsweringPolicy; + } + + public Long getLongestCallTimeForPerSession() { + return longestCallTimeForPerSession; + } + + public void setLongestCallTimeForPerSession(Long longestCallTimeForPerSession) { + this.longestCallTimeForPerSession = longestCallTimeForPerSession; + } + + public Long getLongestCallTimeInMonth() { + return longestCallTimeInMonth; + } + + public void setLongestCallTimeInMonth(Long longestCallTimeInMonth) { + this.longestCallTimeInMonth = longestCallTimeInMonth; + } + + public String getPhoneNumbersForListen() { + return phoneNumbersForListen; + } + + public void setPhoneNumbersForListen(String phoneNumbersForListen) { + this.phoneNumbersForListen = phoneNumbersForListen; + } + + public String getPrivilegedSMSNumber() { + return privilegedSMSNumber; + } + + public void setPrivilegedSMSNumber(String privilegedSMSNumber) { + this.privilegedSMSNumber = privilegedSMSNumber; + } + + public Long getAlarmMaskingWord() { + return alarmMaskingWord; + } + + public void setAlarmMaskingWord(Long alarmMaskingWord) { + this.alarmMaskingWord = alarmMaskingWord; + } + + public Long getAlarmSendsTextSmsSwitch() { + return alarmSendsTextSmsSwitch; + } + + public void setAlarmSendsTextSmsSwitch(Long alarmSendsTextSmsSwitch) { + this.alarmSendsTextSmsSwitch = alarmSendsTextSmsSwitch; + } + + public Long getAlarmShootingSwitch() { + return alarmShootingSwitch; + } + + public void setAlarmShootingSwitch(Long alarmShootingSwitch) { + this.alarmShootingSwitch = alarmShootingSwitch; + } + + public Long getAlarmShootingStorageFlags() { + return alarmShootingStorageFlags; + } + + public void setAlarmShootingStorageFlags(Long alarmShootingStorageFlags) { + this.alarmShootingStorageFlags = alarmShootingStorageFlags; + } + + public Long getKeySign() { + return KeySign; + } + + public void setKeySign(Long keySign) { + KeySign = keySign; + } + + public Long getTopSpeed() { + return topSpeed; + } + + public void setTopSpeed(Long topSpeed) { + this.topSpeed = topSpeed; + } + + public Long getOverSpeedDuration() { + return overSpeedDuration; + } + + public void setOverSpeedDuration(Long overSpeedDuration) { + this.overSpeedDuration = overSpeedDuration; + } + + public Long getContinuousDrivingTimeThreshold() { + return continuousDrivingTimeThreshold; + } + + public void setContinuousDrivingTimeThreshold(Long continuousDrivingTimeThreshold) { + this.continuousDrivingTimeThreshold = continuousDrivingTimeThreshold; + } + + public Long getCumulativeDrivingTimeThresholdForTheDay() { + return cumulativeDrivingTimeThresholdForTheDay; + } + + public void setCumulativeDrivingTimeThresholdForTheDay(Long cumulativeDrivingTimeThresholdForTheDay) { + this.cumulativeDrivingTimeThresholdForTheDay = cumulativeDrivingTimeThresholdForTheDay; + } + + public Long getMinimumBreakTime() { + return minimumBreakTime; + } + + public void setMinimumBreakTime(Long minimumBreakTime) { + this.minimumBreakTime = minimumBreakTime; + } + + public Long getMaximumParkingTime() { + return maximumParkingTime; + } + + public void setMaximumParkingTime(Long maximumParkingTime) { + this.maximumParkingTime = maximumParkingTime; + } + + public Long getOverSpeedWarningDifference() { + return overSpeedWarningDifference; + } + + public void setOverSpeedWarningDifference(Long overSpeedWarningDifference) { + this.overSpeedWarningDifference = overSpeedWarningDifference; + } + + public Long getDrowsyDrivingWarningDifference() { + return drowsyDrivingWarningDifference; + } + + public void setDrowsyDrivingWarningDifference(Long drowsyDrivingWarningDifference) { + this.drowsyDrivingWarningDifference = drowsyDrivingWarningDifference; + } + @Override public String toString() { return "JTDeviceConfig{" + diff --git a/src/main/java/com/genersoft/iot/vmp/jt1078/proc/request/J0104.java b/src/main/java/com/genersoft/iot/vmp/jt1078/proc/request/J0104.java index 8838632d7..e79b6f2f2 100644 --- a/src/main/java/com/genersoft/iot/vmp/jt1078/proc/request/J0104.java +++ b/src/main/java/com/genersoft/iot/vmp/jt1078/proc/request/J0104.java @@ -12,6 +12,8 @@ import com.genersoft.iot.vmp.jt1078.service.Ijt1078Service; import com.genersoft.iot.vmp.jt1078.session.Session; import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufUtil; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.util.StringUtil; import org.springframework.context.ApplicationEvent; import java.lang.reflect.Field; @@ -57,25 +59,25 @@ public class J0104 extends Re { short length = buf.readUnsignedByte(); Field field = allFieldMap.get(id); try { - Method method = deviceConfig.getClass().getMethod("set" + field.getName().toLowerCase()); + Method method = deviceConfig.getClass().getDeclaredMethod("set" + StringUtils.capitalize(field.getName())); switch (allConfigAttributeMap.get(id).type()) { case "Long": - field.set(deviceConfig, buf.readUnsignedInt()); method.invoke(deviceConfig, buf.readUnsignedInt()); continue; case "String": String val = buf.readCharSequence(length, Charset.forName("GBK")).toString().trim(); - field.set(deviceConfig, val); + method.invoke(deviceConfig, val); + continue; + case "IllegalDrivingPeriods": + IllegalDrivingPeriods illegalDrivingPeriods = new IllegalDrivingPeriods(); + int startHour = buf.readUnsignedByte(); + int startMinute = buf.readUnsignedByte(); + int stopHour = buf.readUnsignedByte(); + int stopMinute = buf.readUnsignedByte(); + illegalDrivingPeriods.setStartTime(startHour + ":" + startMinute); + illegalDrivingPeriods.setEndTime(stopHour + ":" + stopMinute); + method.invoke(deviceConfig, illegalDrivingPeriods); continue; - case "IllegalDrivingPeriods": - IllegalDrivingPeriods illegalDrivingPeriods = new IllegalDrivingPeriods(); - int startHour = buf.readUnsignedByte(); - int startMinute = buf.readUnsignedByte(); - int stopHour = buf.readUnsignedByte(); - int stopMinute = buf.readUnsignedByte(); - illegalDrivingPeriods.setStartTime(startHour + ":" + startMinute); - illegalDrivingPeriods.setEndTime(stopHour + ":" + stopMinute); - continue; default: System.err.println(field.getGenericType().getTypeName()); continue; @@ -88,6 +90,7 @@ public class J0104 extends Re { throw new RuntimeException(e); } } + System.out.println(deviceConfig); return null; }