|
|
@@ -216,8 +216,7 @@ |
|
|
|
//执行0015文件 |
|
|
|
tools.showLoadingAlert("执行指令"); |
|
|
|
|
|
|
|
// let cmdArr = [cmd.HOME_DIRECTORY, cmd.APPLICATION_DIRECTORY, cmd.CMD_READBINARY, cmd.CMD_GETBALANCE]; |
|
|
|
let cmdArr = ['00A40000023F00','00B0960037']; |
|
|
|
let cmdArr = [cmd.HOME_DIRECTORY, cmd.APPLICATION_DIRECTORY, cmd.CMD_READBINARY, cmd.CMD_GETBALANCE]; |
|
|
|
console.log(cmdArr); |
|
|
|
console.log(bluetoothUtil); |
|
|
|
bluetoothUtil.transCmd(cmdArr, '10', function(res) { //10:写卡 20:写OBU |
|
|
@@ -239,12 +238,10 @@ |
|
|
|
if (res[2].substring(18, 19) >= 4) { |
|
|
|
//4x卡 |
|
|
|
card.type = getVehicleType(parseInt(res[2].substring(84, 86), 16)); |
|
|
|
// card.vehiclePlateColor = parseInt(res[2].substring(82, 84), 16); |
|
|
|
card.color = getVehiclePlateColor(parseInt(res[2].substring(82, 84), 16)) |
|
|
|
} else { |
|
|
|
//2x卡--获取车牌颜色 |
|
|
|
card.type = "--"; |
|
|
|
// card.vehiclePlateColor = parseInt(res[2].substring(82, 84), 16); |
|
|
|
card.color = getVehiclePlateColor(parseInt(res[2].substring(82, 86), 16)) |
|
|
|
} |
|
|
|
state.vehicleId = card.vehiclePlate + "_" + parseInt(res[2].substring(82, 84), 16) |
|
|
@@ -333,43 +330,43 @@ |
|
|
|
obu.isJH = res[1].substring(53, 54) == "1" ? "是" : res[1].substring(53, 54) == "0" ? |
|
|
|
"否" : "其他:" + res[1].substring(53, 54); |
|
|
|
|
|
|
|
|
|
|
|
let rand = datas.generateMixed(16); |
|
|
|
let arr = [cmd.OBU_DF01, cmd.OBU_00B400000A + rand + cmd.OBU_4F00]; |
|
|
|
console.log("开始执行车辆信息识读"); |
|
|
|
let rand = res[1].substring(18, 20) >= 50?'40':'00'; |
|
|
|
var arr = [cmd.OBU_DF01, '00B400000A000000000000000045'+ rand]; |
|
|
|
bluetoothUtil.transCmd(arr, '20', function(res) { |
|
|
|
console.log(res); |
|
|
|
console.log("开始执行车辆信息识读成功"); |
|
|
|
let str2 = res[1].substring(res[1].length - 4, res[1].length); |
|
|
|
let obuVersion = res[1].substring(18, 20); |
|
|
|
let keyIndex = obuVersion > 50 ? '40' : '00'; |
|
|
|
let reqType = '00'; |
|
|
|
let proviceCode = '5201'; |
|
|
|
if (str2 == "9000") { |
|
|
|
console.log("===========", obu.num, res[1].substring(0, res[1].length - 4)) |
|
|
|
decryptObuVehicleInfo(obu.num, res[1].substring(0, res[1].length - 4), |
|
|
|
decryptObuVehicleInfo(obu.num, res[1].substring(0, res[1].length - 4), |
|
|
|
obuVersion, rand, reqType, proviceCode, |
|
|
|
function(res) { |
|
|
|
console.log("obu信息", '车辆类型', res, res.substring(28, 30), |
|
|
|
HexToInt(res.substring(28, 30))); |
|
|
|
obu.approvedCount = HexToInt(res.substring(48, 54)); |
|
|
|
obu.axleCount = HexToInt(res.substring(42, 44)); |
|
|
|
obu.axleDistance = HexToInt(res.substring(44, 48)); |
|
|
|
obu.engineNum = HexToStrig(res.substring(86, 118)); |
|
|
|
obu.type = getVehicleType(HexToInt(res.substring(28, 30))); |
|
|
|
if(HexToInt(res.substring(30, 32)) == 0){ |
|
|
|
|
|
|
|
obu.approvedCount = res.approvedCount; |
|
|
|
obu.axleCount = res.axleCount; |
|
|
|
obu.axleDistance = res.axleDistance; |
|
|
|
obu.engineNum = res.engineNumber; |
|
|
|
obu.type = getVehicleType(res.collectionType); |
|
|
|
if(res.userType == 0){ |
|
|
|
obu.userType = "普通车" ; |
|
|
|
}else if(HexToInt(res.substring(30, 32)) == 6){ |
|
|
|
}else if(res.userType == 6){ |
|
|
|
obu.userType = "公务车" ; |
|
|
|
} |
|
|
|
obu.vehiclePlate = HexToStrig(res.substring(0, 24), 2); |
|
|
|
obu.vehiclePlate = res.vehiclePlate; |
|
|
|
//获取车牌颜色 |
|
|
|
obu.vehiclePlateColor = getVehiclePlateColor(HexToInt(res |
|
|
|
.substring(24, 28))); |
|
|
|
obu.vin = HexToStrig(res.substring(54, 86)); |
|
|
|
obu.wheelCount = HexToInt(res.substring(40, 42)); |
|
|
|
obu.outsideDimensions = HexToInt(res.substring(32, 36))*100 + "x" + |
|
|
|
HexToInt(res.substring(36, 38))*100 + "x" + HexToInt(res |
|
|
|
.substring(38, 40))*100 |
|
|
|
obu.vehiclePlateColor = getVehiclePlateColor(res.vehiclePlateColor); |
|
|
|
obu.vin = res.vin; |
|
|
|
obu.wheelCount = res.wheelsCount; |
|
|
|
obu.outsideDimensions = res.carLong + "x" + res.carWidth + "x" + res.carHeight |
|
|
|
getObuList(); |
|
|
|
|
|
|
|
|
|
|
|
tools.hideLoadingAlert(); |
|
|
|
//提交设备信息 |
|
|
|
// that.submitDeviceInfo(); |
|
|
|
}); |
|
|
|
//断开蓝牙 |
|
|
|
bluetoothUtil.disconnectDevice(); |
|
|
@@ -393,12 +390,15 @@ |
|
|
|
/** |
|
|
|
* 解密OBU车辆信息 |
|
|
|
*/ |
|
|
|
const decryptObuVehicleInfo = (num, data, func) => { |
|
|
|
const decryptObuVehicleInfo = (num, data,obuVersion, keyIndex, reqType, proviceCode, func) => { |
|
|
|
const options = { |
|
|
|
type: 2, |
|
|
|
data: { |
|
|
|
obuSerailNo: num, |
|
|
|
fileData: data, |
|
|
|
contractSN: num, |
|
|
|
cipherData: data, |
|
|
|
reqType: reqType, |
|
|
|
keyIndex: keyIndex, |
|
|
|
proviceCode: proviceCode |
|
|
|
}, |
|
|
|
method: "POST", |
|
|
|
showLoading: true, |
|
|
@@ -406,8 +406,7 @@ |
|
|
|
requestNew(obuFileDataDecrypt, options).then((res) => { |
|
|
|
console.log("obuFileDataDecrypt",res) |
|
|
|
const data =res |
|
|
|
const FileData = data.data.FileData |
|
|
|
func(FileData) |
|
|
|
func(data) |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
@@ -449,7 +448,6 @@ |
|
|
|
requestNew(cardObuQuery, options).then((res) => { |
|
|
|
tools.hideLoadingAlert(); |
|
|
|
let result = res; |
|
|
|
console.log("153", result) |
|
|
|
state.obuStatus = result.obuStatus?result.obuStatus:"" |
|
|
|
state.cardStatus = result.cardStatus |
|
|
|
if (result.cardType == 1 && result.debitType == 1) { |