mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 19:15:35 +08:00
update 电单车
This commit is contained in:
@@ -13,6 +13,26 @@ import java.util.Arrays;
|
||||
@Slf4j
|
||||
public class YouDianUtils {
|
||||
|
||||
public static void main(String[] args) {
|
||||
String s = "1921ed07";
|
||||
|
||||
String s1 = resolvePhysicalId(s);
|
||||
System.out.println(s1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析物理id
|
||||
* 电单车二维码地址:https://api.jsowellcloud.com/app-xcx-h5/pile/pileDetail/1921ed07/ff
|
||||
* 1921ed07是前端解析出来的pileSn, 但不是实际的物理ID,需要通过识别码和编号计算出物理ID, 解析后为15540505
|
||||
* @param pileSN
|
||||
* @return
|
||||
*/
|
||||
public static String resolvePhysicalId(String pileSN) {
|
||||
byte[] bytes = BytesUtil.str2Bcd(pileSN);
|
||||
int i = convertToPhysicalId(bytes);
|
||||
return i + "";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 将byte数组转换为物理ID
|
||||
|
||||
Reference in New Issue
Block a user