feat:科目三联网优化
This commit is contained in:
parent
438e8bc278
commit
f7717785a5
@ -25,8 +25,8 @@ CommonConstants {
|
|||||||
*/
|
*/
|
||||||
static readonly ACCOUNT_TABLE = {
|
static readonly ACCOUNT_TABLE = {
|
||||||
tableName: 'USER',
|
tableName: 'USER',
|
||||||
sqlCreate: 'CREATE TABLE IF NOT EXISTS USER(id INTEGER PRIMARY KEY AUTOINCREMENT,sfzmhm TEXT,xm CHAR(20), lsh TEXT, kszp TEXT,ksdd TEXT,kssycs TEXT,kslx TEXT,kscx TEXT,ksxl TEXT)',
|
sqlCreate: 'CREATE TABLE IF NOT EXISTS USER(id INTEGER PRIMARY KEY AUTOINCREMENT,sfzmhm TEXT,xm CHAR(20), lsh TEXT, kszp TEXT,ksdd TEXT,kssycs TEXT,kslx TEXT,kscx TEXT,ksxl TEXT,xldm TEXT)',
|
||||||
columns: ['id','sfzmhm','xm','lsh','kszp','ksdd','kssycs','kslx','kscx','ksxl']
|
columns: ['id','sfzmhm','xm','lsh','kszp','ksdd','kssycs','kslx','kscx','ksxl','xldm']
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -39,8 +39,8 @@ export const getMessageHeartbeat = async (msg) => {
|
|||||||
const { examSubject,plateNo } = carInfo;
|
const { examSubject,plateNo } = carInfo;
|
||||||
const ksyh='0000000000000'
|
const ksyh='0000000000000'
|
||||||
const {fourInOneScreen:{gpsDigit}} = judgeConfig
|
const {fourInOneScreen:{gpsDigit}} = judgeConfig
|
||||||
const asclshArr = stringToASC(fillZero('0000000000000', 13));
|
const asclshArr = stringToASC(fillZero('1111111111111', 13));
|
||||||
const ascksyhArr = stringToASC(fillZero('0000000000000', 13))
|
const ascksyhArr = stringToASC(fillZero('1111111111111', 13))
|
||||||
const ascsbxhArr = stringToASC('00000000')
|
const ascsbxhArr = stringToASC('00000000')
|
||||||
// const ascsbxhArr = stringToASC('153216400880')
|
// const ascsbxhArr = stringToASC('153216400880')
|
||||||
const serialIndex = globalThis.serialIndex
|
const serialIndex = globalThis.serialIndex
|
||||||
|
|||||||
@ -115,7 +115,7 @@ struct Index {
|
|||||||
async initStudent() {
|
async initStudent() {
|
||||||
const students = await getSyncData('USER')
|
const students = await getSyncData('USER')
|
||||||
const stuInfo = students[0] || {};
|
const stuInfo = students[0] || {};
|
||||||
const {xm,sfzmhm,lsh,kszp,ksdd,kssycs,kslx,ksxl} = stuInfo;
|
const {xm,sfzmhm,lsh,kszp,ksdd,kssycs,kslx,ksxl,xldm} = stuInfo;
|
||||||
this.name = xm || '测试考生';
|
this.name = xm || '测试考生';
|
||||||
this.idCard = sfzmhm || '01234567891010';
|
this.idCard = sfzmhm || '01234567891010';
|
||||||
this.lsh = globalThis.singlePlay?'0000000000000':lsh;
|
this.lsh = globalThis.singlePlay?'0000000000000':lsh;
|
||||||
@ -124,6 +124,7 @@ struct Index {
|
|||||||
this.kssycs = kssycs;
|
this.kssycs = kssycs;
|
||||||
this.ksxl = ksxl;
|
this.ksxl = ksxl;
|
||||||
this.wayno = ksxl;
|
this.wayno = ksxl;
|
||||||
|
this.xldm = xldm;
|
||||||
this.kslx = kslx;
|
this.kslx = kslx;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1178,6 +1179,8 @@ struct Index {
|
|||||||
@State kssycs: string = ''
|
@State kssycs: string = ''
|
||||||
@State ksxl: string = ''
|
@State ksxl: string = ''
|
||||||
@State kslx: string = ''
|
@State kslx: string = ''
|
||||||
|
//监管线路代码
|
||||||
|
@State xldm: string = ''
|
||||||
//监管接口序列号
|
//监管接口序列号
|
||||||
@State serialNumber: number = 0
|
@State serialNumber: number = 0
|
||||||
@State carType: string = ''
|
@State carType: string = ''
|
||||||
|
|||||||
@ -571,7 +571,7 @@ export const wuxiKm3Items = [
|
|||||||
{projectCode:'10',projectCodeCenter:'41400',name:'超车',abbreviation:'超车'},
|
{projectCode:'10',projectCodeCenter:'41400',name:'超车',abbreviation:'超车'},
|
||||||
{projectCode:'11',projectCodeCenter:'40600',name:'靠边停车',abbreviation:'靠边停车'},
|
{projectCode:'11',projectCodeCenter:'40600',name:'靠边停车',abbreviation:'靠边停车'},
|
||||||
{projectCode:'12',projectCodeCenter:'41500',name:'掉头',abbreviation:'掉头'},
|
{projectCode:'12',projectCodeCenter:'41500',name:'掉头',abbreviation:'掉头'},
|
||||||
{projectCode:'41',projectCodeCenter:'41600',name:'夜间行驶',abbreviation:'夜间行驶'},
|
{projectCode:'41',projectCodeCenter:'41600',name:'模拟夜间灯光',abbreviation:'模拟夜间灯光'},
|
||||||
{projectCode:'14',projectCodeCenter:'40400',name:'加减档位操作',abbreviation:'加减档位操作'},
|
{projectCode:'14',projectCodeCenter:'40400',name:'加减档位操作',abbreviation:'加减档位操作'},
|
||||||
{projectCode:'15',projectCodeCenter:'40800',name:'路口左转弯',abbreviation:'路口左转弯'},
|
{projectCode:'15',projectCodeCenter:'40800',name:'路口左转弯',abbreviation:'路口左转弯'},
|
||||||
{projectCode:'16',projectCodeCenter:'40900',name:'路口右转弯',abbreviation:'路口右转弯'},
|
{projectCode:'16',projectCodeCenter:'40900',name:'路口右转弯',abbreviation:'路口右转弯'},
|
||||||
@ -622,9 +622,9 @@ export const testKm3Items= [
|
|||||||
{code:'41300',status:0},
|
{code:'41300',status:0},
|
||||||
{code:'41400',status:0},
|
{code:'41400',status:0},
|
||||||
{code:'41500',status:0},
|
{code:'41500',status:0},
|
||||||
{code:'41600',status:0},
|
|
||||||
|
|
||||||
{code:'41700',status:0},
|
{code:'41700',status:0},
|
||||||
|
|
||||||
|
{code:'41600',status:0},
|
||||||
]
|
]
|
||||||
|
|
||||||
export const testMarkRules = [{
|
export const testMarkRules = [{
|
||||||
|
|||||||
@ -581,7 +581,7 @@ export default class Judge {
|
|||||||
const carInfo = globalThis.carInfo;
|
const carInfo = globalThis.carInfo;
|
||||||
const { examSubject,plateNo } = carInfo;
|
const { examSubject,plateNo } = carInfo;
|
||||||
const {judgeUI,fileLog,getSbbm,xmxh,filePath} = this;
|
const {judgeUI,fileLog,getSbbm,xmxh,filePath} = this;
|
||||||
const {lsh,idCard,serialNumber,projectsObj,ksdd,kslx,ksxl} = judgeUI
|
const {lsh,idCard,serialNumber,projectsObj,ksdd,kslx,xldm} = judgeUI
|
||||||
const time = await getCurrentTime();
|
const time = await getCurrentTime();
|
||||||
const project = projectsObj[ksxm]
|
const project = projectsObj[ksxm]
|
||||||
const sbxh = getSbbm(ksxm, xmxh)
|
const sbxh = getSbbm(ksxm, xmxh)
|
||||||
@ -595,7 +595,7 @@ export default class Judge {
|
|||||||
sfzmhm: idCard,
|
sfzmhm: idCard,
|
||||||
ksxm: project.projectCodeCenter,
|
ksxm: project.projectCodeCenter,
|
||||||
sbxh,
|
sbxh,
|
||||||
ksxl,
|
ksxl:xldm,
|
||||||
kchp: encodeURI(plateNo),
|
kchp: encodeURI(plateNo),
|
||||||
// 开始时间
|
// 开始时间
|
||||||
ksdd: encodeURI(ksdd),
|
ksdd: encodeURI(ksdd),
|
||||||
@ -618,7 +618,7 @@ export default class Judge {
|
|||||||
const deviceNo = globalThis.deviceNo;
|
const deviceNo = globalThis.deviceNo;
|
||||||
const { examSubject,plateNo,carNo } = carInfo;
|
const { examSubject,plateNo,carNo } = carInfo;
|
||||||
const {judgeUI,fileLog,getSbxh,xmxh,getSbbm,filePath} = this;
|
const {judgeUI,fileLog,getSbxh,xmxh,getSbbm,filePath} = this;
|
||||||
const {lsh,idCard,serialNumber,projectsObj,cdsbInfoObj,ksdd,kslx,ksxl,} = judgeUI
|
const {lsh,idCard,serialNumber,projectsObj,cdsbInfoObj,ksdd,kslx,xldm,} = judgeUI
|
||||||
const time = await getCurrentTime();
|
const time = await getCurrentTime();
|
||||||
const project = projectsObj[ksxm]
|
const project = projectsObj[ksxm]
|
||||||
const sbxh = examSubject == 3 ? undefined : getSbbm(ksxm, xmxh)
|
const sbxh = examSubject == 3 ? undefined : getSbbm(ksxm, xmxh)
|
||||||
@ -633,7 +633,7 @@ export default class Judge {
|
|||||||
sbxh,
|
sbxh,
|
||||||
//TODO 操作类型 1:正常 0:撤销该考试记录
|
//TODO 操作类型 1:正常 0:撤销该考试记录
|
||||||
czlx: '1',
|
czlx: '1',
|
||||||
ksxl,
|
ksxl:xldm,
|
||||||
kchp: encodeURI(plateNo),
|
kchp: encodeURI(plateNo),
|
||||||
ksdd: encodeURI(ksdd),
|
ksdd: encodeURI(ksdd),
|
||||||
kslx: encodeURI(kslx) || '',
|
kslx: encodeURI(kslx) || '',
|
||||||
@ -1008,6 +1008,7 @@ export default class Judge {
|
|||||||
getSbxh
|
getSbxh
|
||||||
} = this;
|
} = this;
|
||||||
console.info(judgeTag,2)
|
console.info(judgeTag,2)
|
||||||
|
const singlePlay = globalThis.singlePlay
|
||||||
const {lsh,startHourTime,totalScore,examTime} = judgeUI;
|
const {lsh,startHourTime,totalScore,examTime} = judgeUI;
|
||||||
|
|
||||||
const {fourInOneScreen:{gpsDigit}} = judgeConfig
|
const {fourInOneScreen:{gpsDigit}} = judgeConfig
|
||||||
@ -1026,7 +1027,9 @@ export default class Judge {
|
|||||||
const sbxh = getSbxh(xmdm, xmxh)
|
const sbxh = getSbxh(xmdm, xmxh)
|
||||||
console.info(judgeTag,JSON.stringify(performInfo))
|
console.info(judgeTag,JSON.stringify(performInfo))
|
||||||
const {carzt,dcjl,qjjl,dxjl,bxjl} = performInfo || {};
|
const {carzt,dcjl,qjjl,dxjl,bxjl} = performInfo || {};
|
||||||
const asclshArr = stringToASC(fillZero(lsh || 0, 13));
|
const asclshArr = stringToASC(
|
||||||
|
fillZero((singlePlay?1111111111111:lsh) || 0, 13)
|
||||||
|
);
|
||||||
//13不足要补0
|
//13不足要补0
|
||||||
console.info(judgeTag,6)
|
console.info(judgeTag,6)
|
||||||
const ascksyhArr = stringToASC(fillZero(ksyh || 0, 13))
|
const ascksyhArr = stringToASC(fillZero(ksyh || 0, 13))
|
||||||
@ -1046,7 +1049,6 @@ export default class Judge {
|
|||||||
// console.info(judgeTag,JSON.stringify(translateProject))
|
// console.info(judgeTag,JSON.stringify(translateProject))
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
// const translateProjects= translateProject.map(num => string2Bytes(p,8)[0])
|
// const translateProjects= translateProject.map(num => string2Bytes(p,8)[0])
|
||||||
console.info('surenjunxstartHourTime' , startHourTime)
|
|
||||||
console.info('surenjunxmmcexamTime' , examTime)
|
console.info('surenjunxmmcexamTime' , examTime)
|
||||||
|
|
||||||
const arr = [
|
const arr = [
|
||||||
@ -1079,9 +1081,6 @@ export default class Judge {
|
|||||||
string2Bytes(Math.floor((dcjl + qjjl) / 100), 2 * 8),
|
string2Bytes(Math.floor((dcjl + qjjl) / 100), 2 * 8),
|
||||||
//扣分
|
//扣分
|
||||||
string2Bytes(100 - Math.abs(totalScore), 2 * 8),
|
string2Bytes(100 - Math.abs(totalScore), 2 * 8),
|
||||||
//扣分数
|
|
||||||
//todo扣分值/扣分项
|
|
||||||
string2Bytes(0, 2 * 8),
|
|
||||||
//扣分项数量
|
//扣分项数量
|
||||||
string2Bytes(kfArr.length, 8),
|
string2Bytes(kfArr.length, 8),
|
||||||
//n个扣分序号
|
//n个扣分序号
|
||||||
@ -1092,8 +1091,8 @@ export default class Judge {
|
|||||||
string2Bytes(0, 2 * 8),
|
string2Bytes(0, 2 * 8),
|
||||||
//TODO 摩托压线 Byte[20],
|
//TODO 摩托压线 Byte[20],
|
||||||
string2Bytes(0, 20 * 8),
|
string2Bytes(0, 20 * 8),
|
||||||
//TODO 考试用时
|
//考试用时
|
||||||
string2Bytes(fillZero(examTime+'',4), 4 * 8),
|
string2Bytes(examTime, 4 * 8),
|
||||||
//TODO 项目用时
|
//TODO 项目用时
|
||||||
string2Bytes(fillZero(0,2), 2 * 8),
|
string2Bytes(fillZero(0,2), 2 * 8),
|
||||||
//TODO 设备信号状态
|
//TODO 设备信号状态
|
||||||
@ -1316,7 +1315,7 @@ export default class Judge {
|
|||||||
this.judgeUI.dw = (Math.floor(plcData.sensor.dw as number) || 0) + ''
|
this.judgeUI.dw = (Math.floor(plcData.sensor.dw as number) || 0) + ''
|
||||||
await examJudgeRealExam(plcData)
|
await examJudgeRealExam(plcData)
|
||||||
const udpIndex = globalThis.udpIndex;
|
const udpIndex = globalThis.udpIndex;
|
||||||
if (udpIndex % 5 === 0) {
|
if (udpIndex % 5 === 0 && !isExamEnd) {
|
||||||
const judgeUdp = globalThis.judgeUdp
|
const judgeUdp = globalThis.judgeUdp
|
||||||
const bytes = await this.getMessageHeartbeat();
|
const bytes = await this.getMessageHeartbeat();
|
||||||
console.info(judgeTag+'UDP',JSON.stringify(bytes))
|
console.info(judgeTag+'UDP',JSON.stringify(bytes))
|
||||||
@ -1395,8 +1394,8 @@ export default class Judge {
|
|||||||
setJudgeItem(msg.itemno, msg.serial)
|
setJudgeItem(msg.itemno, msg.serial)
|
||||||
}
|
}
|
||||||
await examJudgeRealExam(msg)
|
await examJudgeRealExam(msg)
|
||||||
// const bytes = await this.getMessageHeartbeat();
|
const bytes = await this.getMessageHeartbeat();
|
||||||
// bytes && globalThis.judgeUdp.send(bytes)
|
bytes && globalThis.judgeUdp.send(bytes)
|
||||||
num++
|
num++
|
||||||
}, 200)
|
}, 200)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user