From 4705de01d03a694f4e13237a2d1a558714c3590a Mon Sep 17 00:00:00 2001 From: wangzhongjie Date: Fri, 27 Jun 2025 15:02:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AE=8C=E5=96=84=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 2 + entry/src/main/ets/pages/judgeSDK/judge.ets | 227 ++++++++++---------- release_note.md | 223 +++++++++++++++++++ 3 files changed, 338 insertions(+), 114 deletions(-) create mode 100644 Makefile create mode 100644 release_note.md diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..47842aa --- /dev/null +++ b/Makefile @@ -0,0 +1,2 @@ +gitLog: + git log --since="2025-06-23 11:00" --pretty=format:"
%n %s%n [提交人]:%an
%n [提交时间]:%ad
%n [提交版本]:%h%n
%n" --date=format:"%Y-%m-%d %H:%M" > release_note.md \ No newline at end of file diff --git a/entry/src/main/ets/pages/judgeSDK/judge.ets b/entry/src/main/ets/pages/judgeSDK/judge.ets index 8733fe6..63368ce 100644 --- a/entry/src/main/ets/pages/judgeSDK/judge.ets +++ b/entry/src/main/ets/pages/judgeSDK/judge.ets @@ -184,37 +184,6 @@ export default class Judge { private isExamEnd: boolean // 是否发送udp private isUdpEnd: boolean = false - // 处理udp plc信号 - handleUdp = async (msg: string) => { - const stachArr = msg.split(',') - if (stachArr[0] != '#DN_GD' || this.isUdpEnd) { - return - } - const plcData = await this.getPlcData(msg); - // 4.过程数据 - await this.fileLog?.setExamJudgeData(JSON.stringify(plcData)) - //检测到有无锡所设备接入,需要发送特定的数据,供检测 - // if (this.usbService.isWXUSBDevice) { - // const str = await senorToWXDataStr(msg); - // this.usbService.sendUSB(str) - // } - const param350: number = Reflect.get(this.judgeUI.judgeConfigObj, '350') - this.judgeUI.sd = ((param350 == 0 ? plcData.gps.sd : plcData.sensor.cs) as number * 1.852).toFixed(0) + '' - this.judgeUI.dw = (Math.floor(plcData.sensor.dw as number) || 0) + '' - //TODO 暂时关闭差分检测异常 - // await this.checkDwzt(plcData.gps.dwzt,plcData.gps.jdzt); - if (!this.isExamEnd) { - await examJudgeRealExam(plcData) - } - // let udpIndex = AppStorage.get('udpIndex') || 0; - // if (udpIndex % 5 === 0 && !this.isUdpEnd) { - // TODO UPD缺失 - // const judgeUdp = globalThis.judgeUdp - // const bytes = await this.getMessageHeartbeat(this.isExamEnd); - // judgeUdp.send(bytes) - // } - // AppStorage.setOrCreate('udpIndex', udpIndex++) - } //是否手动结束考试 private isManual: boolean = false //UDP服务序列号 @@ -261,60 +230,6 @@ export default class Judge { dConsole.info(JudgeTag, '过程数据文件上传 end') } private judgeTask: JudgeTask - // 检测扣分、结束项目时该项目是否开始 - checkProjectIsStart = async (xmdm: number, currentType: 1 | 2, kf?: MarkRule) => { - if (xmdm == 20) { - return true - } - const judgeUI = this.judgeUI; - const judgeTask = this.judgeTask; - const projectsObj: object = this.judgeUI.projectsObj - const currentProject: ProjectInfo = Reflect.get(projectsObj, xmdm) - const isUpload = currentProject.isUpload - - //如果项目没有开始 - dConsole.info(JudgeTag, 'surenjun isUpload=>', isUpload) - if (!isUpload) { - dConsole.info(JudgeTag, '项目补传开始') - //项目开始补传 - judgeTask.addTask(async () => { - await this.beginProject(xmdm) - }, { - isDelay: true - }) - judgeTask.addTask(async () => { - await this.uploadProgressPhoto(xmdm) - }, { - isDelay: true - }) - currentProject.isUpload = true; - Reflect.set(this.judgeUI.projectsObj, xmdm, currentProject) - //扣分补传 - if (currentType == 2) { - judgeTask.addTask(async () => { - await this.pointsDedute(xmdm, kf!) - }, { - isDelay: true - }) - } - //扣分补传判断是否合格 不合格补传项目结束 - if (currentType == 1 || (currentType == 2 && this.totalScore < judgeUI.passingScore)) { - judgeTask.addTask(async () => { - await this.endProject(xmdm) - }, { - isDelay: true - }) - currentProject.isEnd = true; - Reflect.set(this.judgeUI.projectsObj, xmdm, currentProject) - } - judgeTask.addTask(async () => { - this.checkExamIsEnd() - }) - return false; - } else { - return true - } - } private tempData?: PLCType //实时计算gps经纬度距离 handDistance = async () => { @@ -478,6 +393,37 @@ export default class Judge { AppStorage.setOrCreate('msgStr', plc) return tempData } + // 处理udp plc信号 + handleUdp = async (msg: string) => { + const stachArr = msg.split(',') + if (stachArr[0] != '#DN_GD' || this.isUdpEnd) { + return + } + const plcData = await this.getPlcData(msg); + // 4.过程数据 + await this.fileLog?.setExamJudgeData(JSON.stringify(plcData)) + //检测到有无锡所设备接入,需要发送特定的数据,供检测 + // if (this.usbService.isWXUSBDevice) { + // const str = await senorToWXDataStr(msg); + // this.usbService.sendUSB(str) + // } + const param350: number = Reflect.get(this.judgeUI.judgeConfigObj, '350') + this.judgeUI.sd = ((param350 == 0 ? plcData.gps.sd : plcData.sensor.cs) as number * 1.852).toFixed(0) + '' + this.judgeUI.dw = (Math.floor(plcData.sensor.dw as number) || 0) + '' + //TODO 暂时关闭差分检测异常 + // await this.checkDwzt(plcData.gps.dwzt,plcData.gps.jdzt); + if (!this.isExamEnd) { + await examJudgeRealExam(plcData) + } + // let udpIndex = AppStorage.get('udpIndex') || 0; + // if (udpIndex % 5 === 0 && !this.isUdpEnd) { + // TODO UPD缺失 + // const judgeUdp = globalThis.judgeUdp + // const bytes = await this.getMessageHeartbeat(this.isExamEnd); + // judgeUdp.send(bytes) + // } + // AppStorage.setOrCreate('udpIndex', udpIndex++) + } // 处理轨迹plc信号 handleTrajectoryUdp = async (strArr: string[]) => { let num = 2; @@ -515,9 +461,9 @@ export default class Judge { } //本地轨迹回放地址 private trajectoryPath: string - //当前科目二的考试项目 // private currentKm2ItemsObj: any private isTrajectoryOpen: boolean; + //当前科目二的考试项目 // 调代理接口是否断网了 private isJudgeDisConnect: boolean = false; // 断网数据补传 @@ -532,33 +478,6 @@ export default class Judge { const code = await writeObjectOut(JSON.parse(examDataStr), "", this.context); } } - private artSubject3ProjectsCodesArr: number[] = [3, 9, 4, 10, 12, 11] - private lane: LANE = { - road: '', num: 0, count: 0 - } - private videoData?: RecordHandleType - private disConnectNum: number = 0; - //调用监管接口 - sendWriteObjectOut: SendWriteObjectOut = async (data, filePath) => { - const temp = await writeObjectOut(data, filePath, this.context); - dConsole.log(JudgeTag, "wzj", JSON.stringify(temp)) - //断网&网络超时次数计算 - if (temp.code == 2300007 || temp.code == 2300028) { - this.disConnectNum += 1; - if (this.disConnectNum < 5) { - return await this.sendWriteObjectOut(data, filePath) - } - } - - if (this.disConnectNum >= 5) { - dConsole.info('surenjun', '123') - this.judgeUI.errorMsg = '当前的考试过程信息网络传输异常,程序点击确认将重启!'; - this.judgeUI.disConnectErrorOpen = true - } - - this.disConnectNum = 0 - return temp - } // 项目开始接口同步 beginProject = async (ksxm: number) => { const carInfo = AppStorage.get('carInfo'); @@ -662,6 +581,87 @@ export default class Judge { UploadRegulatoryCodeConversion('17C54', temp.code || 0) dConsole.info(JudgeTag, '上传照片 end') } + // 检测扣分、结束项目时该项目是否开始 + checkProjectIsStart = async (xmdm: number, currentType: 1 | 2, kf?: MarkRule) => { + if (xmdm == 20) { + return true + } + const judgeUI = this.judgeUI; + const judgeTask = this.judgeTask; + const projectsObj: object = this.judgeUI.projectsObj + const currentProject: ProjectInfo = Reflect.get(projectsObj, xmdm) + const isUpload = currentProject.isUpload + + //如果项目没有开始 + dConsole.info(JudgeTag, 'surenjun isUpload=>', isUpload) + if (!isUpload) { + dConsole.info(JudgeTag, '项目补传开始') + //项目开始补传 + judgeTask.addTask(async () => { + await this.beginProject(xmdm) + }, { + isDelay: true + }) + judgeTask.addTask(async () => { + await this.uploadProgressPhoto(xmdm) + }, { + isDelay: true + }) + currentProject.isUpload = true; + Reflect.set(this.judgeUI.projectsObj, xmdm, currentProject) + //扣分补传 + if (currentType == 2) { + judgeTask.addTask(async () => { + await this.pointsDedute(xmdm, kf!) + }, { + isDelay: true + }) + } + //扣分补传判断是否合格 不合格补传项目结束 + if (currentType == 1 || (currentType == 2 && this.totalScore < judgeUI.passingScore)) { + judgeTask.addTask(async () => { + await this.endProject(xmdm) + }, { + isDelay: true + }) + currentProject.isEnd = true; + Reflect.set(this.judgeUI.projectsObj, xmdm, currentProject) + } + judgeTask.addTask(async () => { + this.checkExamIsEnd() + }) + return false; + } else { + return true + } + } + private artSubject3ProjectsCodesArr: number[] = [3, 9, 4, 10, 12, 11] + private lane: LANE = { + road: '', num: 0, count: 0 + } + private videoData?: RecordHandleType + private disConnectNum: number = 0; + //调用监管接口 + sendWriteObjectOut: SendWriteObjectOut = async (data, filePath) => { + const temp = await writeObjectOut(data, filePath, this.context); + dConsole.log(JudgeTag, "wzj", JSON.stringify(temp)) + //断网&网络超时次数计算 + if (temp.code == 2300007 || temp.code == 2300028) { + this.disConnectNum += 1; + if (this.disConnectNum < 5) { + return await this.sendWriteObjectOut(data, filePath) + } + } + + if (this.disConnectNum >= 5) { + dConsole.info('surenjun', '123') + this.judgeUI.errorMsg = '当前的考试过程信息网络传输异常,程序点击确认将重启!'; + this.judgeUI.disConnectErrorOpen = true + } + + this.disConnectNum = 0 + return temp + } constructor(judgeUI: JudgeUI) { this.serialIndex = 1; @@ -1348,7 +1348,6 @@ export default class Judge { // this.judgeUI.totalScore = isAllProjectsEnd ? totalScore : 0; const singlePlay = AppStorage.get('singlePlay') const param302: string = Reflect.get(judgeConfigObj, '302') - // globalThis.windowClass.setWindowSystemBarEnable(['navigation']) //自动退出待验证并且不合格 if (!isManual && examSubject == '3' && (param302 == '1' || (singlePlay && param302 == '2')) && diff --git a/release_note.md b/release_note.md new file mode 100644 index 0000000..54eefe2 --- /dev/null +++ b/release_note.md @@ -0,0 +1,223 @@ +
+ fix: 增加调试模式设置 + [提交人]:wangzhongjie
+ [提交时间]:2025-06-27 15:02
+ [提交版本]:0809571 +
+ +
+ fix: 优化界面 + [提交人]:wangzhongjie
+ [提交时间]:2025-06-27 14:37
+ [提交版本]:d7d1c68 +
+ +
+ fix: 优化扣分bug + [提交人]:wangzhongjie
+ [提交时间]:2025-06-27 14:33
+ [提交版本]:344f74d +
+ +
+ fix: 设置界面优化 + [提交人]:wangzhongjie
+ [提交时间]:2025-06-26 18:10
+ [提交版本]:bc74a62 +
+ +
+ fix: 去掉一些东西 + [提交人]:wangzhongjie
+ [提交时间]:2025-06-26 18:05
+ [提交版本]:608ffca +
+ +
+ fix: 修改启动图 + [提交人]:wangzhongjie
+ [提交时间]:2025-06-26 17:51
+ [提交版本]:e1dcac0 +
+ +
+ fix: 组件复用 + [提交人]:wangzhongjie
+ [提交时间]:2025-06-26 17:33
+ [提交版本]:628671d +
+ +
+ fix: 优化了信号取值问题,优化了评判内部弹窗 + [提交人]:wangzhongjie
+ [提交时间]:2025-06-26 17:28
+ [提交版本]:edf7e07 +
+ +
+ fix: 解决评判一个问题 + [提交人]:wangzhongjie
+ [提交时间]:2025-06-26 16:13
+ [提交版本]:acd7aef +
+ +
+ fix: 解决评判一个问题 + [提交人]:wangzhongjie
+ [提交时间]:2025-06-26 16:13
+ [提交版本]:c3a27f6 +
+ +
+ fix: 优化登陆,太快延迟一下,防止动画太难看 + [提交人]:wangzhongjie
+ [提交时间]:2025-06-26 14:27
+ [提交版本]:ffe0dfd +
+ +
+ fix: 优化考生列表 + [提交人]:wangzhongjie
+ [提交时间]:2025-06-26 11:18
+ [提交版本]:7c0f24d +
+ +
+ fix: 重构登陆页面 + [提交人]:wangzhongjie
+ [提交时间]:2025-06-26 10:47
+ [提交版本]:019b582 +
+ +
+ fix: 重构登陆页面 + [提交人]:wangzhongjie
+ [提交时间]:2025-06-26 10:28
+ [提交版本]:0c0fc17 +
+ +
+ fix: 日志小优化 + [提交人]:wangzhongjie
+ [提交时间]:2025-06-25 14:50
+ [提交版本]:cb302cf +
+ +
+ fix: 优化打印结构 + [提交人]:wangzhongjie
+ [提交时间]:2025-06-25 14:27
+ [提交版本]:cd28204 +
+ +
+ fix: dConsole.log问题 + [提交人]:wangzhongjie
+ [提交时间]:2025-06-25 14:10
+ [提交版本]:80c715d +
+ +
+ fix: 优化数据库方面操作打印信息 + [提交人]:wangzhongjie
+ [提交时间]:2025-06-25 13:48
+ [提交版本]:9da3b0f +
+ +
+ fix: 优化初始化数据库操作 + [提交人]:wangzhongjie
+ [提交时间]:2025-06-25 13:42
+ [提交版本]:014c21a +
+ +
+ fix: 补充初始化代码 + [提交人]:wangzhongjie
+ [提交时间]:2025-06-25 13:38
+ [提交版本]:637e412 +
+ +
+ fix: 授权代码优化 + [提交人]:wangzhongjie
+ [提交时间]:2025-06-25 10:59
+ [提交版本]:84bf418 +
+ +
+ fix: 解决授权依次授权的问题 + [提交人]:wangzhongjie
+ [提交时间]:2025-06-25 10:35
+ [提交版本]:3f6137f +
+ +
+ fix: 优化一些工具函数 + [提交人]:wangzhongjie
+ [提交时间]:2025-06-25 10:03
+ [提交版本]:b4cd064 +
+ +
+ fix: 规范性优化 + [提交人]:wangzhongjie
+ [提交时间]:2025-06-24 10:58
+ [提交版本]:30e0d96 +
+ +
+ fix: 公司环境 + [提交人]:wangzhongjie
+ [提交时间]:2025-06-24 10:03
+ [提交版本]:cae695e +
+ +
+ fix: 日志打印替换 + [提交人]:wangzhongjie
+ [提交时间]:2025-06-23 17:24
+ [提交版本]:768b542 +
+ +
+ fix: 日志修改 + [提交人]:wangzhongjie
+ [提交时间]:2025-06-23 17:08
+ [提交版本]:0608d66 +
+ +
+ fix: 日志系统 + [提交人]:wangzhongjie
+ [提交时间]:2025-06-23 16:44
+ [提交版本]:4226dbf +
+ +
+ fix: 日志系统 + [提交人]:wangzhongjie
+ [提交时间]:2025-06-23 15:31
+ [提交版本]:47fb785 +
+ +
+ fix: 评判日志 + [提交人]:wangzhongjie
+ [提交时间]:2025-06-23 13:50
+ [提交版本]:a7bd343 +
+ +
+ fix: 完善Date工具函数 对毫秒的支持,以及完善judge工具函数的完善 + [提交人]:wangzhongjie
+ [提交时间]:2025-06-23 11:14
+ [提交版本]:d21cd89 +
+ +
+ fix: 完善Date工具函数 对毫秒的支持,以及完善judge工具函数的完善 + [提交人]:wangzhongjie
+ [提交时间]:2025-06-23 11:13
+ [提交版本]:11e738b +