From 05f8798973a5bf1322d25ca4435f4645a6578084 Mon Sep 17 00:00:00 2001 From: surenjun Date: Mon, 19 Aug 2024 11:19:44 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/common/utils/UdpJudge.ts | 2 +- entry/src/main/ets/pages/judgeSDK/judge.ts | 25 ++++++++++++++------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/entry/src/main/ets/common/utils/UdpJudge.ts b/entry/src/main/ets/common/utils/UdpJudge.ts index 73d9ab70..d5db4e5f 100644 --- a/entry/src/main/ets/common/utils/UdpJudge.ts +++ b/entry/src/main/ets/common/utils/UdpJudge.ts @@ -74,7 +74,7 @@ export const getMessageHeartbeat = async (msg) => { string2Bytes(serialIndex, 2 * 8), translateSignals, //@ts-ignore - string2Bytes(Math.floor(gps.sd*1.852*100) , 2 * 8), string2Bytes(fdjzs / 100, 8), string2Bytes(translateJd, 4 * 8), string2Bytes(translateWd, 4 * 8), string2Bytes(1, 8), + string2Bytes(Math.floor((Math.floor(gps.sd))*1.852*100) , 2 * 8), string2Bytes(fdjzs / 100, 8), string2Bytes(translateJd, 4 * 8), string2Bytes(translateWd, 4 * 8), string2Bytes(1, 8), //GPS东向距离 string2Bytes(0, 4 * 8), //GPS北向距离 diff --git a/entry/src/main/ets/pages/judgeSDK/judge.ts b/entry/src/main/ets/pages/judgeSDK/judge.ts index b61e0da1..39b71eb1 100644 --- a/entry/src/main/ets/pages/judgeSDK/judge.ts +++ b/entry/src/main/ets/pages/judgeSDK/judge.ts @@ -650,27 +650,36 @@ export default class Judge { const deviceNo = globalThis.deviceNo; const { examSubject,plateNo,carNo } = carInfo; const {judgeUI,getProjectInfo,fileLog,xmmcSingleCode,filePath} = this; - const {lsh,idCard,serialNumber,ksdd} = judgeUI + const {lsh,idCard,serialNumber,ksdd,projectsObj} = judgeUI const time = await getCurrentTime(); const project = getProjectInfo(ksxm); - //科目三上车准备、模拟灯光、夜间行驶出现通用评判,ksxm为当前进行的项目 - const checkProjects = ['1', '41', '17'] - console.info(judgeTag + 'ksxm=>',ksxm) - console.info(judgeTag + 'xmmcSingleCode=>',xmmcSingleCode) + //科目三夜间行驶.模拟灯光、上车准备出现通用评判,ksxm为当前进行的项目 + const checkProjects = ['17', '41', '1']; + //获取正在进行的项目 + const inProjects = Reflect.ownKeys(projectsObj).filter(projectKey => projectsObj[projectKey].type == 2); + + let commonKsxm = ''; + checkProjects.forEach(projectCode=>{ + if(inProjects.includes(projectCode)){ + commonKsxm = projectCode + } + }) + const data = { xtlb: '17', jkxlh: serialNumber, jkid: '17C53', drvexam: { lsh, kskm: examSubject, ksxm: project == undefined - ? (checkProjects.includes(xmmcSingleCode + '') - ? '40100' + ? (commonKsxm + ? (projectsObj[commonKsxm].projectCodeCenter) : (examSubject == 3 ? 30000 : 10000)) : project.projectCodeCenter , kfxm: kf.markcatalog, kfxmmx: `${ksxm},${kf.markserial}`, sfzmhm: idCard, kchp: encodeURI(carInfo.plateNo), + //扣分方式 kffs: kf.type == 0 ? 1 : 2, ksdd: encodeURI(ksdd), kfsj: time @@ -1281,7 +1290,7 @@ export default class Judge { this.judgeUI.isDwztRight = plcData.gps.dwzt == 4; this.judgeUI.sd = (Math.floor(((plcData.gps.sd as number) || 0) * 1.852)) + ''; this.judgeUI.dw = (Math.floor(plcData.sensor.dw as number) || 0) + '' - if(isExamEnd){ + if(!isExamEnd){ await examJudgeRealExam(plcData) } const udpIndex = globalThis.udpIndex;