From 15c5686fd26706e78143b455e47782d52bd836e4 Mon Sep 17 00:00:00 2001
From: zhangnaisong <2434969829@qq.com>
Date: 星期三, 24 七月 2024 11:25:10 +0800
Subject: [PATCH] bug修改提交
---
ard-work/src/main/java/com/ruoyi/sy/gps31/PushClientImplSerialPort.java | 32 +++++++++-----------------------
1 files changed, 9 insertions(+), 23 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/sy/gps31/PushClientImplSerialPort.java b/ard-work/src/main/java/com/ruoyi/sy/gps31/PushClientImplSerialPort.java
index ce166a3..666b8bb 100644
--- a/ard-work/src/main/java/com/ruoyi/sy/gps31/PushClientImplSerialPort.java
+++ b/ard-work/src/main/java/com/ruoyi/sy/gps31/PushClientImplSerialPort.java
@@ -182,80 +182,66 @@
}
long cha = now.getTime() - sdf.parse(time).getTime();
- System.out.println("////////////////");
+ /*System.out.println("////////////////");
System.out.println(time);
- System.out.println(cha);
- /*if(Math.abs(cha) >= 5 * 1000){
+ System.out.println(cha);*/
+ if(Math.abs(cha) >= 5 * 1000){
//鏃堕棿鏍″噯
- String url = "http://" + ip + ":9999";
+ /*String url = "http://" + ip + ":9999";
String passwordMd5 = DigestUtils.md5Hex(password);
Map<String, Object> LogInResult = loginIn(url, userId, passwordMd5);
String sessionId = (String) LogInResult.get("sessionId");
//鑾峰彇鏃堕棿骞舵媶鍒嗗勾鏈堟棩鏃跺垎绉�
String nowTime = sdf.format(now);
String nowYear = nowTime.substring(2,4);
- System.out.println(nowYear);
String nowMonth = nowTime.substring(5,7);
- System.out.println(nowMonth);
String nowDay = nowTime.substring(8,10);
- System.out.println(nowDay);
String nowHour = nowTime.substring(11,13);
- System.out.println(nowHour);
String nowMinute = nowTime.substring(14,16);
- System.out.println(nowMinute);
String nowSecond = nowTime.substring(17,19);
- System.out.println(nowSecond);
String nowYearHex = Integer.toHexString(Integer.parseInt(nowYear));
if(nowYearHex.length() == 1){
nowYearHex = "0" + nowYearHex;
}
- System.out.println(nowYearHex);
String nowMonthHex = Integer.toHexString(Integer.parseInt(nowMonth));
if(nowMonthHex.length() == 1){
nowMonthHex = "0" + nowMonthHex;
}
- System.out.println(nowMonthHex);
String nowDayHex = Integer.toHexString(Integer.parseInt(nowDay));
if(nowDayHex.length() == 1){
nowDayHex = "0" + nowDayHex;
}
- System.out.println(nowDayHex);
String nowHourHex = Integer.toHexString(Integer.parseInt(nowHour));
if(nowHourHex.length() == 1){
nowHourHex = "0" + nowHourHex;
}
- System.out.println(nowHourHex);
String nowMinuteHex = Integer.toHexString(Integer.parseInt(nowMinute));
if(nowMinuteHex.length() == 1){
nowMinuteHex = "0" + nowMinuteHex;
}
- System.out.println(nowMinuteHex);
String nowSecondHex = Integer.toHexString(Integer.parseInt(nowSecond));
if(nowSecondHex.length() == 1){
nowSecondHex = "0" + nowSecondHex;
}
- System.out.println(nowSecondHex);
//16杩涘埗鏃堕棿
String timeHex = nowYearHex + nowMonthHex + nowDayHex + nowHourHex + nowMinuteHex + nowSecondHex;
- System.out.println(timeHex);
String lockNumHead = ardTankLockResult.get(0).getLockNum().substring(0,2);
String lockNumTail = ardTankLockResult.get(0).getLockNum().substring(2,4);
//璁$畻鏍¢獙
String checkNum = Integer.toHexString(Integer.parseInt(lockNumHead, 16) + Integer.parseInt(lockNumTail, 16) + Integer.parseInt("08", 16) +
Integer.parseInt(nowYearHex, 16) + Integer.parseInt(nowMonthHex, 16) + Integer.parseInt(nowDayHex, 16) +
Integer.parseInt(nowHourHex, 16) + Integer.parseInt(nowMinuteHex, 16) + Integer.parseInt(nowSecondHex, 16));
- System.out.println(checkNum);
if(checkNum.length() == 1){
checkNum = "0" + checkNum;
}else if(checkNum.length() > 2){
checkNum = checkNum.substring(checkNum.length() - 2,checkNum.length());
}
- System.out.println(checkNum);
String paramsStr = "%7B%22type%22%3A%22ff%22%2C%22dataCnt%22%3A%22" + ardTankLock.getLockNum() + "08" + timeHex + checkNum + "%22%7D";
System.out.println(ardTankLock.getLockNum() + "08" + timeHex + checkNum);
- sendCmd(url,userId,ardTankLockResult.get(0).getCarId(),199,"DataDownTransfer", paramsStr,sessionId);
- }else{*/
+ sendCmd(url,userId,ardTankLockResult.get(0).getCarId(),199,"DataDownTransfer", paramsStr,sessionId);*/
+ return;
+ }else{
ArdTankLockState ardTankLockState = new ArdTankLockState();
ardTankLockState.setId(IdUtils.simpleUUID());
ardTankLockState.setLockId(ardTankLockResult.get(0).getId());
@@ -264,6 +250,7 @@
case "01": ardTankLockState.setLockState("寮�閿佺姸鎬�");break;
case "02": ardTankLockState.setLockState("鍏抽攣鐘舵��");break;
case "03": ardTankLockState.setLockState("寮傚父鐘舵��");break;
+ case "04": ardTankLockState.setLockState("鍔ㄤ綔鐘舵��");break;
default:
break;
}
@@ -326,8 +313,7 @@
ardTankLockState.setUploadTime(time);
ardTankLockState.setUniqueMark(uniqueMark);
((ArdTankLockStateServiceImpl)SpringUtils.getBean("ardTankLockStateServiceImpl")).insertOrUpdateArdTankLockState(ardTankLockState);
-
- //}
+ }
}
}catch (Exception e){
e.printStackTrace();
--
Gitblit v1.9.3