vin hex to char
This commit is contained in:
parent
815da83f4e
commit
c0981a9989
@ -170,29 +170,39 @@ public class HexUtils {
|
||||
|
||||
byte[] bytes = toBytes(hex);
|
||||
final StringBuilder result = new StringBuilder();
|
||||
for (byte b: bytes) {
|
||||
for (int i=0; i<8; i++) {
|
||||
result. append((int)(b >> (8-(i+1)) & 0x0001));
|
||||
for (byte b : bytes) {
|
||||
for (int i = 0; i < 8; i++) {
|
||||
result.append(b >> (8 - (i + 1)) & 0x0001);
|
||||
}
|
||||
}
|
||||
return result. toString();
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
public static final String toAscii(String hex) {
|
||||
|
||||
if (hex == null) return null;
|
||||
byte[] bytes = toBytes(hex);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (byte b : bytes) {
|
||||
sb.append(Character.valueOf((char) b));
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
System.out.println(Long.valueOf(10L).toString());
|
||||
// System.out.println(Long.valueOf(10L).toString());
|
||||
// System.out.println(reverseHexInt("FF00"));
|
||||
// byte[] data1 = toBytes(reverseHex("10270000"));
|
||||
// System.out.println(toInteger(data1, 0, 4));
|
||||
System.out.println(reverseHexInt("D80E"));
|
||||
System.out.println(toHexInt(3800));
|
||||
// System.out.println(reverseHexInt("D80E"));
|
||||
// System.out.println(toHexInt(3800));
|
||||
// System.out.println(toHexInt(100000));
|
||||
// System.out.println(toBits("1000"));
|
||||
// System.out.println(toHex(new byte[]{104, 13, 19, 123, 0, 3, 105, -123, 71, -123, -106, 50, 84, 1, 0, 72, 106, 104,
|
||||
// -94, 19, 124, 0, 59, 105, -123, 71, -123, -106, 50, 84, 1, 33, 9, 24, 9, 67, 57, 0, 2, 105, -123, 71, -123, -106,
|
||||
// 50, 84, 1, -88, 97, 43, 9, 50, 9, 21, 48, 117, 50, 9, 50, 9, 21, -64, 87, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
// -40, 83, 1, 0}));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -30,6 +30,7 @@ import static com.xhpc.pp.utils.security.CacheDataUtils.reflectTranslate;
|
||||
public class OrderDataLogic implements ServiceLogic {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(OrderDataLogic.class);
|
||||
|
||||
@Autowired
|
||||
private PileOrderService pileOrderService;
|
||||
|
||||
|
||||
@ -40,6 +40,8 @@ public class CacheDataUtils {
|
||||
}
|
||||
} else if (tarFieldName.contains("ime")) {
|
||||
tarval = DateUtil.format(cp56toDate(srcval), NORM_DATETIME_FORMAT);
|
||||
} else if (tarFieldName.startsWith("vin")) {
|
||||
tarval = HexUtils.toAscii(srcval);
|
||||
} else {
|
||||
tarval = srcval;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user