mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-13 03:39:55 +08:00
update 预约启动
This commit is contained in:
@@ -8,6 +8,7 @@ import javax.xml.bind.DatatypeConverter;
|
|||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Stack;
|
import java.util.Stack;
|
||||||
|
|
||||||
@@ -403,6 +404,11 @@ public class BytesUtil {
|
|||||||
return rightPadBytes(target, len, b);
|
return rightPadBytes(target, len, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ASCII转字符串 小端模式
|
||||||
|
* @param ascs
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public static String ascii2StrLittle(byte[] ascs) {
|
public static String ascii2StrLittle(byte[] ascs) {
|
||||||
byte[] data = revert(ascs);
|
byte[] data = revert(ascs);
|
||||||
String asciiStr = null;
|
String asciiStr = null;
|
||||||
@@ -414,6 +420,11 @@ public class BytesUtil {
|
|||||||
return asciiStr;
|
return asciiStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ASCII转字符串
|
||||||
|
* @param ascs
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public static String ascii2Str(byte[] ascs) {
|
public static String ascii2Str(byte[] ascs) {
|
||||||
byte[] data = ascs;
|
byte[] data = ascs;
|
||||||
String asciiStr = null;
|
String asciiStr = null;
|
||||||
@@ -425,17 +436,20 @@ public class BytesUtil {
|
|||||||
return asciiStr;
|
return asciiStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
/**
|
||||||
String vin1 = "SAITER00000000001";
|
* 字符串转ASCII 小端模式
|
||||||
byte[] bytes = str2Asc(vin1);
|
* @param str
|
||||||
String s = ascii2Str(bytes);
|
* @return
|
||||||
System.out.println(s);
|
*/
|
||||||
}
|
|
||||||
|
|
||||||
public static byte[] str2AscLittle(String str) {
|
public static byte[] str2AscLittle(String str) {
|
||||||
return revert(str2Asc(str));
|
return revert(str2Asc(str));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字符串转ASCII
|
||||||
|
* @param str
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public static byte[] str2Asc(String str) {
|
public static byte[] str2Asc(String str) {
|
||||||
byte[] bytes = null;
|
byte[] bytes = null;
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ public class PileReservationInfoServiceImpl implements PileReservationInfoServic
|
|||||||
}
|
}
|
||||||
// 如果 vinCodes 的数量少于 3,用 "0" 补足
|
// 如果 vinCodes 的数量少于 3,用 "0" 补足
|
||||||
while (vinCodes.size() < 3) {
|
while (vinCodes.size() < 3) {
|
||||||
vinCodes.add("0");
|
vinCodes.add("");
|
||||||
}
|
}
|
||||||
|
|
||||||
String type = StringUtils.equals(pileReservationInfo.getReservationType(), "single") ? "00" : "01";
|
String type = StringUtils.equals(pileReservationInfo.getReservationType(), "single") ? "00" : "01";
|
||||||
|
|||||||
@@ -508,24 +508,14 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
|
|||||||
|
|
||||||
// VIN1
|
// VIN1
|
||||||
String vin1 = command.getVin1();
|
String vin1 = command.getVin1();
|
||||||
if (StringUtils.isBlank(vin1)) {
|
|
||||||
vin1 = Constants.ZERO;
|
|
||||||
}
|
|
||||||
// byte[] vin1ByteArr = BytesUtil.str2Bcd(vin1);
|
|
||||||
byte[] vin1ByteArr = BytesUtil.str2Asc(vin1);
|
byte[] vin1ByteArr = BytesUtil.str2Asc(vin1);
|
||||||
vin1ByteArr = BytesUtil.ensureLength(vin1ByteArr, 17);
|
vin1ByteArr = BytesUtil.ensureLength(vin1ByteArr, 17);
|
||||||
|
|
||||||
String vin2 = command.getVin2();
|
String vin2 = command.getVin2();
|
||||||
if (StringUtils.isBlank(vin2)) {
|
|
||||||
vin2 = Constants.ZERO;
|
|
||||||
}
|
|
||||||
byte[] vin2ByteArr = BytesUtil.str2Asc(vin2);
|
byte[] vin2ByteArr = BytesUtil.str2Asc(vin2);
|
||||||
vin2ByteArr = BytesUtil.ensureLength(vin2ByteArr, 17);
|
vin2ByteArr = BytesUtil.ensureLength(vin2ByteArr, 17);
|
||||||
|
|
||||||
String vin3 = command.getVin3();
|
String vin3 = command.getVin3();
|
||||||
if (StringUtils.isBlank(vin3)) {
|
|
||||||
vin3 = Constants.ZERO;
|
|
||||||
}
|
|
||||||
byte[] vin3ByteArr = BytesUtil.str2Asc(vin3);
|
byte[] vin3ByteArr = BytesUtil.str2Asc(vin3);
|
||||||
vin3ByteArr = BytesUtil.ensureLength(vin3ByteArr, 17);
|
vin3ByteArr = BytesUtil.ensureLength(vin3ByteArr, 17);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user