From fff89ecf75b45c4c6eff8677f83ac34569865cbc Mon Sep 17 00:00:00 2001 From: wangzhongjie Date: Wed, 15 Oct 2025 13:44:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=AF=AD=E9=9F=B3=E6=92=AD=E6=8A=A5?= =?UTF-8?q?=E4=B8=A4=E8=BE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ets/pages/Judge/BaseJudgeBussines.ets | 154 +++++++++--------- entry/src/main/ets/pages/UserInfo.ets | 4 +- 2 files changed, 82 insertions(+), 76 deletions(-) diff --git a/entry/src/main/ets/pages/Judge/BaseJudgeBussines.ets b/entry/src/main/ets/pages/Judge/BaseJudgeBussines.ets index fd4a8a1..5e1065c 100644 --- a/entry/src/main/ets/pages/Judge/BaseJudgeBussines.ets +++ b/entry/src/main/ets/pages/Judge/BaseJudgeBussines.ets @@ -125,28 +125,30 @@ export class BaseJudge { ProjectStart(xmdm, that.xmxh, judgeUI) UploadProgressPhoto(xmdm, that.plcData!, judgeUI) } + // this.judgeUI.projectsObj[xmdm].isUpload = true + break; } case 2: { dConsole.log(JudgeTag, ExamProcessDataTag, "项目结束判定1") const project: ProjectInfo = Reflect.get(judgeUI.projectsObj, xmdm) - const isStart = await this.checkProjectIsStart(xmdm, 2, judgeUI, that) + // const isStart = await this.checkProjectIsStart(xmdm, 1, judgeUI, that, kf) - if (isStart) { - // 项目结束了就不再生成数据 - dConsole.info(JudgeTag, ExamProcessDataTag, ' 项目是否结束 =>', project.isEnd) - if (!project.isEnd) { - // judgeTask.addTask(async () => { - // dConsole.info(JudgeTag, `项目结束-${xmdm}-${project.name}`) - // await endProject(xmdm); - // this.xmmcSingleCode = '0'; - // this.xmmcEndCode = undefined; - // }, { - // isDelay: true - // }) - ProjectEnd(xmdm, that.xmxh, judgeUI) - } - } + // if (isStart) { + // // 项目结束了就不再生成数据 + // dConsole.info(JudgeTag, ExamProcessDataTag, ' 项目是否结束 =>', project.isEnd) + // if (!project.isEnd) { + // judgeTask.addTask(async () => { + // dConsole.info(JudgeTag, `项目结束-${xmdm}-${project.name}`) + // await endProject(xmdm); + // this.xmmcSingleCode = '0'; + // this.xmmcEndCode = undefined; + // }, { + // isDelay: true + // }) + ProjectEnd(xmdm, that.xmxh, judgeUI) + // } + // } dConsole.log(JudgeTag, ExamProcessDataTag, "项目结束判定3") try { const param512: JudgeConfigObj = (Reflect.get(judgeUI.judgeConfigObj, '512') || '').split(','); @@ -169,16 +171,19 @@ export class BaseJudge { that.avPlayer?.playAudio([`voice/${currentKf.markcatalog}.mp3`, `voice/mark_${Math.abs(currentKf?.score || 0)}.mp3`]) } - const isStart = await this.checkProjectIsStart(Number(currentKf.xmdm), 2, judgeUI, that); - if (isStart) { - // await judgeTask.addTask(async () => { - // dConsole.info(JudgeTag, `项目扣分-${currentKf.markcatalog}-${currentKf.desc}`) - // await pointsDedute(Number(currentKf.xmdm), currentKf) - // }, { - // isDelay: true - // }) - DeductPoints(Number(currentKf.xmdm), currentKf, that.xmmcEndCode || "", judgeUI) + // const isStart = await this.checkProjectIsStart(Number(currentKf.xmdm), 2, judgeUI, that, kf); + // if (isStart) { + // await judgeTask.addTask(async () => { + // dConsole.info(JudgeTag, `项目扣分-${currentKf.markcatalog}-${currentKf.desc}`) + // await pointsDedute(Number(currentKf.xmdm), currentKf) + // }, { + // isDelay: true + // }) + DeductPoints(Number(currentKf.xmdm), currentKf, that.xmmcEndCode || "", judgeUI) + if (judgeUI.totalScore < judgeUI.passingScore) { + ProjectEnd(xmdm, that.xmxh, judgeUI) } + // } break } case 5: { @@ -367,7 +372,6 @@ export class BaseJudge { }) return } - // that.avPlayer?.playAudio(['voice/exam_waiting.mp3'], judgeUI.singlePlay, async () => { try { if (!judgeUI.singlePlay) { @@ -393,7 +397,6 @@ export class BaseJudge { await this.endExam(judgeUI, that) } }) - await this.endExam(judgeUI, that) }) } @@ -402,7 +405,6 @@ export class BaseJudge { const singlePlay = judgeUI.singlePlay //TODO 断网考试结束补传 // await uploadDisConnectData(); - let backTimeOut = setTimeout(() => { router.back() }, 90 * 1000) @@ -506,58 +508,62 @@ export class BaseJudge { }, param302 === "8" ? 3000 : 0) }) } - } /** * 检测扣分、结束项目时该项目是否开始 * */ - async checkProjectIsStart(xmdm: number, currentType: 1 | 2, judgeUI: JudgePage, that: JudgeBusiness, kf?: MarkRule): Promise { - if (xmdm == 20) { - return true - } - const currentProject: ProjectInfo = Reflect.get(judgeUI.projectsObj, xmdm) - - if (!currentProject.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(judgeUI.projectsObj, xmdm, currentProject) - if (currentType == 2) { - //项目结束需要等补传完毕 - // judgeTask.addTask(async () => { - // await this.pointsDedute(xmdm, kf!) - // }, { - // isDelay: true - // }) - } - //扣分补传判断是否合格 不合格补传项目结束 - if (currentType == 1 || (currentType == 2 && that.totalScore < judgeUI.passingScore)) { - // judgeTask.addTask(async () => { - // await this.endProject(xmdm) - // }, { - // isDelay: true - // }) - currentProject.isEnd = true; - Reflect.set(judgeUI.projectsObj, xmdm, currentProject) - } - // judgeTask.addTask(async () => { - // this.checkExamIsEnd() - // }) - return false; - } - return true - } + // async checkProjectIsStart(xmdm: number, currentType: 1 | 2, judgeUI: JudgePage, that: JudgeBusiness, kf?: MarkRule[]): Promise { + // if (xmdm == 20) { + // return true + // } + // const currentProject: ProjectInfo = Reflect.get(judgeUI.projectsObj, xmdm) + // + // if (!currentProject.isUpload) { + // dConsole.info(JudgeTag, '项目补传开始') + // // judgeTask.addTask(async () => { + // // await this.beginProject(xmdm) + // // }, { + // // isDelay: true + // // }) + // // judgeTask.addTask(async () => { + // // await this.uploadProgressPhoto(xmdm) + // // }, { + // // isDelay: true + // // }) + // ProjectStart(xmdm, that.xmxh, judgeUI) + // UploadProgressPhoto(xmdm, that.plcData!, judgeUI) + // currentProject.isUpload = true; + // Reflect.set(judgeUI.projectsObj, xmdm, currentProject) + // if (currentType == 2) { + // //项目结束需要等补传完毕 + // // judgeTask.addTask(async () => { + // // await this.pointsDedute(xmdm, kf!) + // // }, { + // // isDelay: true + // // })\ + // const currentKf = kf[kf.length -1]; + // DeductPoints(Number(currentKf.xmdm), currentKf, that.xmmcEndCode || "", judgeUI) + // } + // //扣分补传判断是否合格 不合格补传项目结束 + // if (currentType == 1 || (currentType == 2 && that.totalScore < judgeUI.passingScore)) { + // // judgeTask.addTask(async () => { + // // await this.endProject(xmdm) + // // }, { + // // isDelay: true + // // }) + // ProjectEnd(xmdm, that.xmxh, judgeUI) + // currentProject.isEnd = true; + // Reflect.set(judgeUI.projectsObj, xmdm, currentProject) + // } + // // judgeTask.addTask(async () => { + // // this.checkExamIsEnd() + // // }) + // return false; + // } + // return true + // } async judgeStart(callBack: Function, judgeUI: JudgePage, that: JudgeBusiness, beginExamInfo: JudgeBeginObj, initInfo: JudgeInitObj) { const name = judgeUI.name diff --git a/entry/src/main/ets/pages/UserInfo.ets b/entry/src/main/ets/pages/UserInfo.ets index 17f5f74..e56374b 100644 --- a/entry/src/main/ets/pages/UserInfo.ets +++ b/entry/src/main/ets/pages/UserInfo.ets @@ -708,7 +708,7 @@ struct UserInfoPage { this.list = JSON.parse(JSON.stringify(dataList)) - dConsole.log("temp list", JSON.stringify(this.list)) + dConsole.log(UserInfoTag, "temp list", JSON.stringify(this.list)) this.list.forEach((listData, index) => { //考过一次不允许切换学员 if (listData.kssycs == '1') { @@ -730,7 +730,7 @@ struct UserInfoPage { }) // await upDateTableByArray('USERLIST', this.list || []) - dConsole.log("temp list", JSON.stringify(this.list)) + dConsole.log(UserInfoTag, "temp list", JSON.stringify(this.list)) // await sqlInsertCommonFn("USERLIST", this.list || []) await SqlInsertTable('USERLIST', this.list || [])