fix: 优化文件关闭

This commit is contained in:
wangzhongjie 2025-10-29 09:05:30 +08:00
parent 6eb48607ba
commit 268623c6e4
11 changed files with 20 additions and 21 deletions

View File

@ -12,6 +12,7 @@ import {
} from '../model'; } from '../model';
import FileUtils from '../utils/FileUtils'; import FileUtils from '../utils/FileUtils';
import { GetSyncData } from '../utils/table/Operation'; import { GetSyncData } from '../utils/table/Operation';
import { JudgeTag } from '../config';
//监管接口序列号映射 //监管接口序列号映射
const gjxlhObj: Record<string, string> = { const gjxlhObj: Record<string, string> = {
@ -52,7 +53,7 @@ export default async function writeObjectOutNew(data: RegulatoryInterfaceParams,
} }
// let connectTimeout = sjbs === '02-21-000014' ?60000:1 // let connectTimeout = sjbs === '02-21-000014' ?60000:1
console.info('surenjun', '调用新监管') console.info(JudgeTag, '调用新监管')
let temp: WR let temp: WR
try { try {
const JGHOST: string = AppStorage.get<string>('JGHOST') || "" const JGHOST: string = AppStorage.get<string>('JGHOST') || ""

View File

@ -271,7 +271,7 @@ export struct JudgePage {
BK2: carInfo.bk2!, BK2: carInfo.bk2!,
X_MCH: carInfo.x_mch || "", X_MCH: carInfo.x_mch || "",
}) })
dConsole.info(JudgeTag, 'surenjun =>carinfoArrr', JSON.stringify(this.carinfoArr)) dConsole.info(JudgeTag, '=>carinfoArrr', JSON.stringify(this.carinfoArr))
} }
// 获取考生信息 // 获取考生信息
@ -320,7 +320,7 @@ export struct JudgePage {
async initSysset(sysset?: SYSSET[]) { async initSysset(sysset?: SYSSET[]) {
const syssetParams: SYSSET[] | MASYSSETTableType[] = sysset || await GetSyncData<MASYSSETTableType>('MA_SYSSET') const syssetParams: SYSSET[] | MASYSSETTableType[] = sysset || await GetSyncData<MASYSSETTableType>('MA_SYSSET')
const serialNumberArr = (syssetParams as SYSSET[]).filter(sys => sys.v_no === '901'); const serialNumberArr = (syssetParams as SYSSET[]).filter(sys => sys.v_no === '901');
dConsole.info(JudgeTag, 'surenjun serialNumberArr' + JSON.stringify(serialNumberArr)) dConsole.info(JudgeTag, 'serialNumberArr' + JSON.stringify(serialNumberArr))
this.serialNumber = (serialNumberArr[0] && serialNumberArr[0].v_value) || ''; this.serialNumber = (serialNumberArr[0] && serialNumberArr[0].v_value) || '';
const syssetJudgeConfigArr: SyssetConfig[] = [] const syssetJudgeConfigArr: SyssetConfig[] = []
@ -471,7 +471,7 @@ export struct JudgePage {
const examItems: string | undefined = currentParams?.examItems; const examItems: string | undefined = currentParams?.examItems;
// 2024-01-03 16:29:26;0;20300,;2,4^2,4;null; // 2024-01-03 16:29:26;0;20300,;2,4^2,4;null;
if (examItems !== '' && examItems !== undefined) { if (examItems !== '' && examItems !== undefined) {
dConsole.info(JudgeTag, 'surenjun examItems=>', examItems) dConsole.info(JudgeTag, 'examItems=>', examItems)
const examItemsArrs = examItems.split(';'); const examItemsArrs = examItems.split(';');
const startTime = examItemsArrs[0] const startTime = examItemsArrs[0]
const ddxkKsxmArr = examItemsArrs[2]?.split(',').filter(item => item) || [] const ddxkKsxmArr = examItemsArrs[2]?.split(',').filter(item => item) || []
@ -570,7 +570,7 @@ export struct JudgePage {
const projectCode = artSubject3ProjectsCodesArr[index] const projectCode = artSubject3ProjectsCodesArr[index]
let sideParkingStatus = GetIsExitManualProject(index, this.judgeConfigObj, this.artSubject3ProjectsCodesArr, this.projectsObj, this.carztStr, this.isManualProjectIn, this.isProjectIn, this.jl, this.examMileage, this.isRequiredProjectsEnd, this.lane) let sideParkingStatus = GetIsExitManualProject(index, this.judgeConfigObj, this.artSubject3ProjectsCodesArr, this.projectsObj, this.carztStr, this.isManualProjectIn, this.isProjectIn, this.jl, this.examMileage, this.isRequiredProjectsEnd, this.lane)
if (index === 5) { if (index === 5) {
dConsole.info(JudgeTag, 'surenjun 靠边停车状态=> ', sideParkingStatus) dConsole.info(JudgeTag, '靠边停车状态=> ', sideParkingStatus)
} }
const currentProject: ProjectInfo = Reflect.get(projectsObj, projectCode) const currentProject: ProjectInfo = Reflect.get(projectsObj, projectCode)
if (sideParkingStatus) { if (sideParkingStatus) {
@ -594,7 +594,7 @@ export struct JudgePage {
if (xmmcStr == '无' || xmmcStr == '') { if (xmmcStr == '无' || xmmcStr == '') {
//512[6] 人工项目按钮放大确认 //512[6] 人工项目按钮放大确认
const param512: string[] = (Reflect.get(this.judgeConfigObj, '512') || '').split(','); const param512: string[] = (Reflect.get(this.judgeConfigObj, '512') || '').split(',');
dConsole.info(JudgeTag, 'surenjun', param512) dConsole.info(JudgeTag, param512)
if (param512[6] !== '0') { if (param512[6] !== '0') {
this.amplifiedImgIndex = index; this.amplifiedImgIndex = index;
this.isAmplifyPopShow = true this.isAmplifyPopShow = true

View File

@ -79,7 +79,7 @@ export class BaseJudge {
} }
async goJudgeVoice(sound: JudgeSound, avPlayer: VoiceAnnounce) { async goJudgeVoice(sound: JudgeSound, avPlayer: VoiceAnnounce) {
dConsole.info(JudgeTag, 'surenjun code=>', JSON.stringify(sound.code)) dConsole.info(JudgeTag, 'code=>', JSON.stringify(sound.code))
//判断是不是模拟灯光语音 //判断是不是模拟灯光语音
if (sound.type == 1) { if (sound.type == 1) {
avPlayer?.playAudio([`voice/${sound.code[0]}.mp3`], false, () => { avPlayer?.playAudio([`voice/${sound.code[0]}.mp3`], false, () => {
@ -751,7 +751,8 @@ export class BaseJudge {
} }
async judgeEnd(judgeUI: JudgePage, that: JudgeBusiness, isManual?: boolean) { async judgeEnd(judgeUI: JudgePage, that: JudgeBusiness, isManual?: boolean) {
dConsole.info("lixiao", 'surenjun 收到远程结束考试消息3') dConsole.info(JudgeTag, '收到远程结束考试消息3')
dConsole.closeProcessData()
const isAllProjectsEnd = judgeUI.isAllProjectsEnd const isAllProjectsEnd = judgeUI.isAllProjectsEnd
const examSubject = judgeUI.examSubject const examSubject = judgeUI.examSubject
const singlePlay = judgeUI.singlePlay const singlePlay = judgeUI.singlePlay

View File

@ -126,7 +126,7 @@ export default class JudgeBusiness {
// 结束考试 // 结束考试
public JudgeEnd(isManual?: boolean) { public JudgeEnd(isManual?: boolean) {
dConsole.info("lixiao", 'surenjun 收到远程结束考试消息1') dConsole.info("lixiao", '收到远程结束考试消息1')
this.judgeBusiness.JudgeEnd(this.judgeUI, this, isManual) this.judgeBusiness.JudgeEnd(this.judgeUI, this, isManual)
} }

View File

@ -115,8 +115,6 @@ export async function examJudgeBeginExam(data: JudgeBeginObj) {
} }
/* /*
* @desc结束考试 * @desc结束考试
* *
@ -205,7 +203,7 @@ async function handle(temp: number, fnName: string): Promise<number> {
if (temp == 0) { if (temp == 0) {
resolve(temp); resolve(temp);
} else { } else {
dConsole.error('surenjun error:' + `调用c++函数 ${fnName} 异常:` + libJudgeSdk.examJudgeErrorInfo(temp * 1)) dConsole.error('error:' + `调用c++函数 ${fnName} 异常:` + libJudgeSdk.examJudgeErrorInfo(temp * 1))
reject(temp) reject(temp)
} }
}) })

View File

@ -252,8 +252,7 @@ export class SmallJudge extends BaseJudge implements BaseJudgeImpl {
const no2Num = Number(no2) const no2Num = Number(no2)
//真实监管下发考试项目 //真实监管下发考试项目
if (isInExam && !(kStringArr.includes(txt2) || kStringArr.includes(no2 + ''))) { if (isInExam && !(kStringArr.includes(txt2) || kStringArr.includes(no2 + ''))) {
dConsole.info(JudgeTag, 'surenjun =>', txt2) dConsole.info(JudgeTag, '=> no2', no2)
dConsole.info(JudgeTag, 'surenjun => no2', no2)
currentProject.type = '3' currentProject.type = '3'
currentProject.isUpload = true currentProject.isUpload = true
currentProject.isEnd = true currentProject.isEnd = true
@ -330,7 +329,7 @@ export class SmallJudge extends BaseJudge implements BaseJudgeImpl {
} }
public async JudgeEnd(judgeUI: JudgePage, that: JudgeBusiness, isManual?: boolean) { public async JudgeEnd(judgeUI: JudgePage, that: JudgeBusiness, isManual?: boolean) {
dConsole.info("lixiao", 'surenjun 收到远程结束考试消息2') dConsole.info(JudgeTag, '收到远程结束考试消息2')
super.judgeEnd(judgeUI, that, isManual) super.judgeEnd(judgeUI, that, isManual)
}; };
} }

View File

@ -126,7 +126,7 @@ export function getKmProjectVoice(
const param544Str: number[] = (Reflect.get(judgeConfig, '544')?.split(',')) || [] const param544Str: number[] = (Reflect.get(judgeConfig, '544')?.split(',')) || []
const param405Str: number = Reflect.get(judgeConfig, '405') || 0; const param405Str: number = Reflect.get(judgeConfig, '405') || 0;
dConsole.info('surenjun => param544Str.length', param544Str.length) dConsole.info('param544Str.length', param544Str.length)
const num: number = lane?.num const num: number = lane?.num
const count: number = lane?.count const count: number = lane?.count

View File

@ -865,7 +865,7 @@ struct UserInfoPage {
let result = JSON.parse(msg) as WorkerBackMessage let result = JSON.parse(msg) as WorkerBackMessage
if (result.type === WorkerBackMessageType.RemoteStartExam) { if (result.type === WorkerBackMessageType.RemoteStartExam) {
dConsole.log('surenjun', 'userInfo收到开始考试事件') dConsole.log('userInfo收到开始考试事件')
if (this.isBoardPrePareSetPopupOpen && !this.isFirstBoardPrePareSetPopupBtnShow) { if (this.isBoardPrePareSetPopupOpen && !this.isFirstBoardPrePareSetPopupBtnShow) {
this.prePareSCZB() this.prePareSCZB()
} else { } else {

View File

@ -190,7 +190,7 @@ export default struct DeductedPopup {
// const carInfo = this.carInfo; // const carInfo = this.carInfo;
// const { examSubject, plateNo, carNo } = carInfo; // const { examSubject, plateNo, carNo } = carInfo;
const time = GetCurrentTime(); const time = GetCurrentTime();
dConsole.info('surenjun uploadProgressPhoto',) dConsole.info('uploadProgressPhoto',)
const photoBase64 = await GetPhotoBase64(this.context) const photoBase64 = await GetPhotoBase64(this.context)
const photoData: RegulatoryInterfaceParams = { const photoData: RegulatoryInterfaceParams = {
xtlb: '17', xtlb: '17',
@ -210,7 +210,7 @@ export default struct DeductedPopup {
} }
}; };
const code = await writeObjectOut(photoData, "", this.context); const code = await writeObjectOut(photoData, "", this.context);
dConsole.info('surenjun uploadProgressPhoto end',) dConsole.info('uploadProgressPhoto end',)
} }
// 扣分 // 扣分

View File

@ -55,7 +55,7 @@ export default class FileModel {
try { try {
return this.fileUtil?.getFileContent(`${folderPath}/${fileName}`); return this.fileUtil?.getFileContent(`${folderPath}/${fileName}`);
} catch (e) { } catch (e) {
dConsole.info('surenjun', JSON.stringify(e)); dConsole.info(JSON.stringify(e));
promptAction.showToast({ promptAction.showToast({
message: `请检查模型路径${folderPath}/${fileName}是否正确!`, message: `请检查模型路径${folderPath}/${fileName}是否正确!`,
duration: 4000 duration: 4000

View File

@ -16,7 +16,7 @@ export default class GetDistance {
public initFolder = async () => { public initFolder = async () => {
const time = GetCurrentTime() const time = GetCurrentTime()
const folderPath = await this.fileUtil.initFolder(`/车辆行驶距离统计`); const folderPath = await this.fileUtil.initFolder(`/车辆行驶距离统计`);
console.info('surenjun folderPath=>', folderPath); console.info('folderPath=>', folderPath);
const date = time.split(' ')[0].split('-').join('_') const date = time.split(' ')[0].split('-').join('_')
const timeStr = time.split(' ')[1] const timeStr = time.split(' ')[1]
this.timeStr = timeStr this.timeStr = timeStr