fix: 提交
This commit is contained in:
		
							parent
							
								
									3f8ebbd16d
								
							
						
					
					
						commit
						415f8c7fcb
					
				| @ -30,13 +30,13 @@ export async function writeObjectOut(params, filePath?: string): Promise<WR> { | ||||
|   if (singlePlay) { | ||||
|     return { code: 1 } | ||||
|   } | ||||
|   console.log('testsqlTag0') | ||||
|   console.log('daihaimm testsqlTag0') | ||||
|   //获取监管接口地址路径
 | ||||
|   if (!globalThis.JGPATH) { | ||||
|     console.log('testsqlTag1') | ||||
|     console.log('daihaimm testsqlTag1') | ||||
| 
 | ||||
|     const syssetParams = await getSyncData('MA_SYSSET') || []; | ||||
|     console.log('testsqlTag2') | ||||
|     console.log('daihaimm testsqlTag2') | ||||
| 
 | ||||
|     //@ts-ignore
 | ||||
|     syssetParams.forEach(sys => { | ||||
| @ -50,10 +50,11 @@ export async function writeObjectOut(params, filePath?: string): Promise<WR> { | ||||
|     }) | ||||
|   } | ||||
|   const {xtlb,jkxlh,jkid,drvexam} = params; | ||||
|   console.log('testsqlTag3') | ||||
|   console.log('daihaimm testsqlTag3') | ||||
| 
 | ||||
|   //新监管调用
 | ||||
|   if (globalThis.isJGNew) { | ||||
|     console.log('daihaimm testsqlTag4') | ||||
| 
 | ||||
|     return await writeObjectOutNew(params, filePath) | ||||
|   } | ||||
| @ -64,7 +65,7 @@ export async function writeObjectOut(params, filePath?: string): Promise<WR> { | ||||
|     .map((key: string) => ( | ||||
|       `<${key}>${drvexam[key]}</${key}>`)); | ||||
| 
 | ||||
|   console.log('surenjun filePath=>', filePath); | ||||
|   console.log('daihaimm surenjun filePath=>', filePath); | ||||
|   if (filePath) { | ||||
|     const fileUtil = new FileUtil(globalThis.context); | ||||
|     await fileUtil.initFolder(filePath); | ||||
|  | ||||
| @ -295,9 +295,7 @@ async function openChuankouFn() { | ||||
|   let ret = await testNapi.SerialSet(fd, 115200, 0, 8, 1, 0) | ||||
|   console.log('daihairet', ret) | ||||
| } | ||||
| 
 | ||||
| let readSerials = true | ||||
| 
 | ||||
| async function getChuankouFnMsg() { | ||||
|   if (!readSerials) { | ||||
|     return | ||||
|  | ||||
| @ -97,7 +97,8 @@ export function sqlInsertCommonFn(tableName, resultArr, delFlag = true) { | ||||
|   return new Promise((resolve, reject) => { | ||||
|     DB.clearTable(tableName).then((res) => { | ||||
|       if(!resultArr?.length){ | ||||
|         return | ||||
|         console.log('daihaimm sqlInsertCommonFn []') | ||||
|         resolve(true) | ||||
|       } | ||||
|       let INSERT_SQL = "INSERT INTO " + tableName | ||||
|         + " (" + map[tableName].ACCOUNT_TABLE.columns.toString() + ") VALUES " | ||||
| @ -191,6 +192,7 @@ export async function getDataBaseTable(params, reqParam) { | ||||
|         message: 'paraKdid获取失败', | ||||
|         duration: 3000 | ||||
|       }); | ||||
|       reject() | ||||
|       return | ||||
|     } | ||||
|     const str = { "head": { "time": dateFormat(date) }, | ||||
| @ -270,6 +272,7 @@ export async function getMySystemSetTable(params, reqParam) { | ||||
|         message: 'paraKdid获取失败', | ||||
|         duration: 3000 | ||||
|       }); | ||||
|       reject() | ||||
|       return | ||||
|     } | ||||
|     const str = { "head": { "time": dateFormat(date) }, | ||||
|  | ||||
| @ -1,4 +1,5 @@ | ||||
| import mediaLibrary from '@ohos.multimedia.mediaLibrary' | ||||
| // @ts-ignore
 | ||||
| import onvifclient from '@ohos.onvifclient'; | ||||
| import fs from '@ohos.file.fs' | ||||
| 
 | ||||
| @ -6,6 +7,7 @@ import fs from '@ohos.file.fs' | ||||
| import photoAccessHelper from '@ohos.file.photoAccessHelper' | ||||
| import dataSharePredicates from '@ohos.data.dataSharePredicates' | ||||
| import { dateFormat, getCurrentTime } from '../utils/tools' | ||||
| // @ts-ignore
 | ||||
| import record from '@ohos.rtsprecord'; | ||||
| // import record from '@ohos.rtsprecord';
 | ||||
| import { FileHelper } from './FileHelper'; | ||||
| @ -33,6 +35,44 @@ const FILE_ASSET_FETCH_COLUMNS = [photoAccessHelper.PhotoKeys.URI, | ||||
| 
 | ||||
| // const rtsp_server = record.createServer();
 | ||||
| 
 | ||||
| export async function delPic(day,type) { | ||||
|   let phAccessHelper = photoAccessHelper.getPhotoAccessHelper(globalThis.context); | ||||
|   console.info('albumGetAssetsDemoCallback'); | ||||
|   let predicates: dataSharePredicates.DataSharePredicates = new dataSharePredicates.DataSharePredicates(); | ||||
|   let albumFetchOptions: photoAccessHelper.FetchOptions = { | ||||
|     fetchColumns: [], | ||||
|     predicates: predicates | ||||
|   }; | ||||
|   let fetchOption: photoAccessHelper.FetchOptions = { | ||||
|     fetchColumns: [], | ||||
|     predicates: predicates | ||||
|   }; | ||||
|   let albumList: photoAccessHelper.FetchResult<photoAccessHelper.Album> = await phAccessHelper.getAlbums(photoAccessHelper.AlbumType.USER, photoAccessHelper.AlbumSubtype.USER_GENERIC, albumFetchOptions); | ||||
|   let albums = await albumList.getAllObjects(); | ||||
|   for(let i=0;i<=albums.length;i++){ | ||||
|     let albumName=albums[i].albumName | ||||
|     // isSevenDaysAgo(albumName, day)
 | ||||
|     console.log('albumNamealbumName',albumName) | ||||
|     if (isSevenDaysAgo(albumName, day)&&albumName!='jt'&&albumName!='pz') { | ||||
|       deleteAllFileByPiC(albumName, type) | ||||
| 
 | ||||
|     } | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| export  function isSevenDaysAgo(date,days=2) { | ||||
|   const today = new Date(); // 当前日期
 | ||||
|   const target = new Date(date); // 需要判断的日期
 | ||||
|   console.info("listFile succeed1",JSON.stringify(target)); | ||||
| 
 | ||||
|   const diff = today.getTime() - target.getTime(); // 计算两个日期之间的毫秒数差异
 | ||||
|   const diffDays = diff / (1000 * 60 * 60 * 24); // 将毫秒转换为天数
 | ||||
|   console.info("listFile succeed2",JSON.stringify(diffDays)); | ||||
|   // 如果差异天数正好是2,则原日期是当前日期的前2天
 | ||||
|   console.log('diffDays',diffDays,days) | ||||
|   return diffDays >= (Number(days) ); | ||||
| } | ||||
| 
 | ||||
| export async function saveStartRecordVideo(path) { | ||||
|   return new Promise(async (reslove, reject) => { | ||||
|     const fileUtil = new FileUtil(globalThis.context) | ||||
| @ -169,21 +209,28 @@ export async function takePhoto(param, context, dir, flag = 1, callback?) { | ||||
|     // });
 | ||||
|   } else { | ||||
|     return new Promise<takePhotoParam>((resolve, reject) => { | ||||
|       console.log('daihaimmm getVideoSnapshot start: ') | ||||
| 
 | ||||
|       // @ts-ignore
 | ||||
|       rtsp_server.getVideoSnapshot(context, video_uri, fileName, dir, true, (err, snapResult) => { | ||||
|         console.log('getPhtot') | ||||
|         if (err) { | ||||
|           console.log('daihaimmm getVideoSnapshot err: ' + JSON.stringify(err)) | ||||
|           reject(err) | ||||
|         } else { | ||||
|           console.log('daihaimmm getPhtot') | ||||
|           resolve({ base64: snapResult.dataString, name: snapResult.fileName, fileSize: snapResult.fileSize }) | ||||
|         } | ||||
|       }); | ||||
|     }) | ||||
|     console.log('getmyLog02') | ||||
| 
 | ||||
|   } | ||||
|   console.log('getmyLog03') | ||||
|   console.log('daihaimmm getmyLog03') | ||||
| } | ||||
| 
 | ||||
| export async function deleteAllFileByPiC(dirName) { | ||||
| export async function deleteAllFileByPiC(dirName, type=1) { | ||||
|   // const fileHelper = new FileHelper();
 | ||||
|   fileHelper.deleteFileOfAlbum(dirName, 1); | ||||
|   fileHelper.deleteFileOfAlbum(dirName, type); | ||||
| } | ||||
| 
 | ||||
| export async function deleteAllVideos(context, type: photoAccessHelper.AlbumType, subType: photoAccessHelper.AlbumSubtype): Promise<void> { | ||||
|  | ||||
| @ -1,3 +1,4 @@ | ||||
| // @ts-ignore
 | ||||
| import HiSerialSDK from '@ohos.hiserialsdk'; | ||||
| 
 | ||||
| // 打开串口工具
 | ||||
|  | ||||
| @ -122,9 +122,7 @@ export default async function tempRequest<T>(req: any): Promise<T> { | ||||
|       reject({ | ||||
|         code: e.code | ||||
|       }) | ||||
|     } finally { | ||||
|       httpRequest.destroy(); | ||||
|       console.log('httpRequest destroy finally') | ||||
| 
 | ||||
|     } | ||||
|   }) | ||||
| 
 | ||||
|  | ||||
| @ -2,6 +2,7 @@ import { voiceService } from '../common/service/voiceService'; | ||||
| import router from '@ohos.router'; | ||||
| import { carConfigurationInfo, uploadExamCarCheckResult } from '../api/checkCar'; | ||||
| import TopLogo from './compontents/TopLogo'; | ||||
| // @ts-ignore | ||||
| import testNapi from '@ohos.hiserialsdk'; | ||||
| import { dateFormat } from '../common/utils/tools'; | ||||
| import { DwMapData, PassData, RealNumData, StackValueData, WarnFlagData, WarnFlagTipData } from '../mock'; | ||||
|  | ||||
| @ -16,9 +16,10 @@ import promptAction from '@ohos.promptAction'; | ||||
| import errorMsgDialog from './compontents/errorMsgDialog'; | ||||
| import GetDistance from '../common/utils/GetDistance'; | ||||
| import UdpEvent from '../common/utils/UdpEvent'; | ||||
| import { delPic } from '../common/service/videoService'; | ||||
| import imageBtn from './compontents/imageBtn'; | ||||
| import VoiceAnnounce from './judgeSDK/utils/voiceAnnouncements'; | ||||
| // import {updateModelAndCar} from '../common/autoUpdate/index' | ||||
| import {updateModelAndCar} from '../common/autoUpdate/index' | ||||
| // import  {uploadLogFile} from '../common/service/indexService' | ||||
| import { getModalValueCdAndCar } from '../api'; | ||||
| 
 | ||||
| @ -44,7 +45,7 @@ struct Index { | ||||
|   @State fd: number = -1; | ||||
|   @State num: number = 0; | ||||
|   //模型是否下载 | ||||
|   @State isModelInit: boolean = true; | ||||
|   @State isModelInit: boolean = false; | ||||
|   fileHelper = null; | ||||
|   errorDialog: CustomDialogController = new CustomDialogController({ | ||||
|     builder: errorMsgDialog({ | ||||
| @ -399,6 +400,8 @@ struct Index { | ||||
|           console.log('syssyssyssys') | ||||
|           // this.delLoading=true | ||||
|           // globalThis.param854Str=sys.v_value | ||||
|           delPic(Number(sys.v_value), 1) | ||||
|           delPic(Number(sys.v_value), 2) | ||||
|           // this.delLoading=false | ||||
| 
 | ||||
|         } | ||||
| @ -641,14 +644,12 @@ struct Index { | ||||
|     // deleteAllFIleLog(GlobalConfig.comoonfileWriteAddress + '/PLC/') | ||||
|     //设置plc udp 同步requesthost | ||||
|     await getUDP(this.context, false) | ||||
|     getTCP() | ||||
| 
 | ||||
|     this.loading = false | ||||
|     await getDeviceInfo(this.context) | ||||
| 
 | ||||
|     await getCarInfo() | ||||
|     await getUDP2(this.context, false) | ||||
|     console.log('socket1111') | ||||
|     getTCP() | ||||
|     this.deviceId = globalThis.carInfo.carNo | ||||
|     await setCurrentTime(); | ||||
|     if (!globalThis.distanceClass) { | ||||
|  | ||||
| @ -38,13 +38,21 @@ import { getChuankouFn } from '../common/service/indexService'; | ||||
| @Entry | ||||
| @Component | ||||
| struct Index { | ||||
|   timerchuankou: number = undefined | ||||
|   timer: number = undefined | ||||
|   mileageTimer: number = undefined; | ||||
| 
 | ||||
|   async aboutToDisappear() { | ||||
|     console.log('daihaimm1111 Judge aboutToDisappear') | ||||
|     clearInterval(this.mileageTimer) | ||||
|     clearInterval(this.timer) | ||||
|     clearInterval(this.timerchuankou) | ||||
|     this.judge = null | ||||
|   } | ||||
| 
 | ||||
|   async aboutToAppear() { | ||||
|     getChuankouFn() | ||||
|     setInterval(() => { | ||||
|     this.timerchuankou = setInterval(() => { | ||||
|       console.log("chuankou 定时器2") | ||||
|       getChuankouFn() | ||||
|     }, 1000) | ||||
| @ -57,7 +65,7 @@ struct Index { | ||||
| 
 | ||||
|     this.startExamTime = time | ||||
| 
 | ||||
|     setInterval(async () => { | ||||
|     this.timer = setInterval(async () => { | ||||
|       this.time = await getCurrentTime(); | ||||
|       this.examTime += 1; | ||||
|     }, 1000); | ||||
| @ -144,6 +152,11 @@ struct Index { | ||||
|     const markRuleParams = markRules || (await getSyncData('MA_MARKRULE') as MarkRule[]) | ||||
| 
 | ||||
|     markRuleParams.forEach(mark => { | ||||
|       console.log("markrile item mark.onlyoneid: ", mark.onlyoneid); | ||||
|       console.log("markrile item mark.nocancelid: ", mark.nocancelid); | ||||
| 
 | ||||
|       console.log("markrile item mark.onlyoneid Number: ", Number(mark.onlyoneid)); | ||||
|       console.log("markrile item mark.nocancelid Number: ", Number(mark.nocancelid)); | ||||
|       const tempObj = { | ||||
|         itemno: mark.itemno * 1, | ||||
|         markcatalog: mark.markcatalog, | ||||
| @ -151,8 +164,8 @@ struct Index { | ||||
|         markreal: mark.markreal * 1, | ||||
|         markserial: mark.markserial, | ||||
|         kfxh: mark.kfxh, | ||||
|         OnlyOneKind: mark.onlyoneid * 1, | ||||
|         NoCancelId: mark.nocancelid * 1, | ||||
|         OnlyOneKind: !isNaN(Number(mark.onlyoneid)) ? Number(mark.onlyoneid) : 0, | ||||
|         NoCancelId: !isNaN(Number(mark.nocancelid)) ? Number(mark.nocancelid) : 0, | ||||
|         GPS_SID: mark.gps_sid == 0 ? false : true | ||||
|       } | ||||
| 
 | ||||
| @ -1384,7 +1397,6 @@ struct Index { | ||||
|   @State markRuleListObj: MarkRule = {} | ||||
|   @State cdsbInfoObj: CDSBInfo = {} | ||||
|   @State itemInfoObj: CDSBInfo = {} | ||||
|   @State timer: number = 0 | ||||
|   @State judgeConfig: { [k: string]: string }[] = [] | ||||
|   @State judgeConfigObj: { [k: string]: any } = defaultJudgeConfigObj | ||||
|   //流水号 | ||||
| @ -1446,7 +1458,6 @@ struct Index { | ||||
|   @State dw: string = '' | ||||
|   //速度 | ||||
|   @State sd: string = '' | ||||
|   @State mileageTimer: number = 0; | ||||
|   @State passingScore: number = 80 | ||||
|   @State dwztErrorVisible: boolean = false; | ||||
|   @State popTimer: number = 0; | ||||
|  | ||||
| @ -8,6 +8,7 @@ import { dateFormat, getCurrentHourTime, getCurrentTime, string2Bytes } from '.. | ||||
| import FaceCompare from './compontents/FaceCompare'; | ||||
| // import { initJudgeUdp } from '../common/utils/UdpJudge' | ||||
| import { writeObjectOut } from '../api/judge'; | ||||
| // @ts-ignore | ||||
| import testNapi from '@ohos.idcard'; | ||||
| import common from '@ohos.app.ability.common'; | ||||
| import { User } from './interfaces'; | ||||
| @ -192,6 +193,7 @@ struct UserInfo { | ||||
|   } | ||||
| 
 | ||||
|   async onPageShow() { | ||||
|     console.log('daihai userinfo onPageShow') | ||||
|     this.isExamStart = false | ||||
|     this.startExam = false | ||||
|     this.updateTimeLimit = false | ||||
| @ -205,7 +207,7 @@ struct UserInfo { | ||||
|     //身份证读卡器初始化 | ||||
|     // this.openDeviceByIDCard() | ||||
|     const routerParam = router.getParams() || { type: 0 }; | ||||
|     console.log('routerParam', JSON.stringify(routerParam)) | ||||
|     console.log('daihaim routerParam', JSON.stringify(routerParam)) | ||||
|     initJudgeUdp() | ||||
|     if (!globalThis.singlePlay) { | ||||
|       // @ts-ignore | ||||
| @ -215,8 +217,8 @@ struct UserInfo { | ||||
|         this.list = await getSyncData('USERLIST') | ||||
|         // @ts-ignore | ||||
|         const data = await getSyncData('USER') | ||||
|         console.log('surenjun useruser=>,', JSON.stringify(this.list)) | ||||
|         console.log('surenjun useruser1=>,', JSON.stringify(data)) | ||||
|         console.log('daihaim surenjun this.list=>,', JSON.stringify(this.list)) | ||||
|         console.log('daihaim surenjun useruser1=>,', JSON.stringify(data)) | ||||
| 
 | ||||
|         const user = data[0] | ||||
|         if(!Number(user.kssycs)){ | ||||
| @ -224,22 +226,35 @@ struct UserInfo { | ||||
|             return res.sfzmhm != user.sfzmhm | ||||
|           }) | ||||
|         } | ||||
|         console.log('daihaim 111,') | ||||
| 
 | ||||
|         this.pageIndex = 0 | ||||
|         this.dataList = this.list.slice(this.pageIndex * 4, this.pageIndex * 4 + 4) | ||||
|         console.log('daihaim 222 this.dataList length,' + this.dataList.length) | ||||
| 
 | ||||
| 
 | ||||
|         if (this.dataList.length) { | ||||
|           console.log('daihaim 222 this.dataList,' +JSON.stringify(this.dataList)) | ||||
| 
 | ||||
|           setTimeout(() => { | ||||
|             this.currentUser = this.dataList[0] | ||||
|             this.currentUser.ksy2 = globalThis.kgxm | ||||
|             globalThis.lsh = this.currentUser.lsh | ||||
|           }, 200) | ||||
|         } else { | ||||
|           console.log('daihaim 7777,') | ||||
| 
 | ||||
|           this.currentUser = EmptyCandidateObject | ||||
|           globalThis.lsh = '1111111111111' | ||||
| 
 | ||||
|         } | ||||
|         this.list.forEach((res, index) => { | ||||
|           res.id = index.toString() | ||||
|         }) | ||||
|         console.log('daihaim 8888,' + JSON.stringify(this.list)) | ||||
| 
 | ||||
|         await upDateTableByArray('USERLIST', this.list || []) | ||||
|         console.log('daihaim 999,') | ||||
| 
 | ||||
|         // if(this.) | ||||
|         // if (user && Number(user.kssycs)) { | ||||
| @ -274,9 +289,12 @@ struct UserInfo { | ||||
|         //     globalThis.lsh = '1111111111111' | ||||
|         //   } | ||||
|         // } | ||||
|         this.getExaminationStudentInfoFn() | ||||
| 
 | ||||
|       } else { | ||||
|         console.log('daihaim surenjun routerParam.type 11111') | ||||
|         await this.getExaminationStudentInfoFn() | ||||
| 
 | ||||
|       } | ||||
|     } | ||||
| 
 | ||||
| @ -504,6 +522,9 @@ struct UserInfo { | ||||
|       const ksxtbhArr = syssetParams.filter(sys => sys.v_no === '902') | ||||
|       that.ksxtbh = ksxtbhArr?.[0]?.v_value || '222' | ||||
|       const studentRefreshParam = syssetParams.filter(sys => sys.v_no === '452') //判断自动更新 | ||||
|       console.log('daihaimmm syssetParams syssetParams::' + JSON.stringify(syssetParams)) | ||||
|       console.log('daihaimmm syssetParams studentRefreshParam::' + JSON.stringify(studentRefreshParam)) | ||||
| 
 | ||||
|       that.studentRefreshStatue = studentRefreshParam?.[0]?.v_value || '0' | ||||
|       const openCheckFlagParam = syssetParams.filter(sys => sys.v_no == '17') //0 | ||||
|       const openCheckFlag = openCheckFlagParam?.[0]?.v_value == '1' ? '1' : '0' | ||||
| @ -518,6 +539,7 @@ struct UserInfo { | ||||
|           that.openDeviceByIDCard() | ||||
|         } | ||||
|       } | ||||
|       console.log('daihaimmm syssetParams len::' + syssetParams.length) | ||||
|       // let a = await this.fileUtil.initFolder("/config/temptable") | ||||
|       // this.fileUtil.addFile("temp.log", JSON.stringify(syssetParams)) | ||||
|       syssetParams.forEach(sys => { | ||||
| @ -592,11 +614,13 @@ struct UserInfo { | ||||
|       }) | ||||
| 
 | ||||
|       // faceParam?.[0]?.v_value || | ||||
|       console.log('daihaimmmm 11111 that.studentRefreshStatue:' +that.studentRefreshStatue) | ||||
| 
 | ||||
| 
 | ||||
|       //0不自动更新 1自动更新(不限次数) 2没有考生更新2次 | ||||
|       if (that.studentRefreshStatue == '2') { | ||||
|         if (that.list.length == 0) { | ||||
|           console.log('daihaimmmm 11111') | ||||
|           clearInterval(that.interval) | ||||
|           that.interval = setInterval(() => { | ||||
|             if (that.numCount < 3) { | ||||
| @ -611,6 +635,8 @@ struct UserInfo { | ||||
|         } | ||||
|       } else if (that.studentRefreshStatue == '1') { | ||||
|         if (that.list.length == 0) { | ||||
|           console.log('daihaimmmm 22222') | ||||
| 
 | ||||
|           clearInterval(that.interval) | ||||
|           that.interval = setInterval(() => { | ||||
|             if (that.list.length == 0) { | ||||
| @ -909,9 +935,9 @@ struct UserInfo { | ||||
|     this.isLoadingPopupVisible = true | ||||
| 
 | ||||
|     avPlayer.playAudio([`voice/监管通信中.mp3`], false, async () => { | ||||
|       console.info('surenjun', '播放结束开始考试接口调用') | ||||
|       console.info('daihaimm surenjun', '播放结束开始考试接口调用') | ||||
|       const {code,keystr,message} = await this.beginExam() || {}; | ||||
|       console.info('surenjun', '开始考试接口调用结束') | ||||
|       console.info('daihaimm surenjun', '开始考试接口调用结束', code,keystr,message) | ||||
|       // console.info('surenjun',code +'') | ||||
|       //@ts-ignore TODO code转换 | ||||
| 
 | ||||
| @ -926,7 +952,14 @@ struct UserInfo { | ||||
|         return | ||||
|       } | ||||
|       this.currentUser.id = '0' | ||||
|       console.log('daiihaimm upDateTableByArray start this.currentUser: ' + JSON.stringify(this.currentUser)) | ||||
|       if (this.currentUser.sfzmhm) { | ||||
|         await upDateTableByArray('USER', [this.currentUser]) | ||||
|       } else { | ||||
|         console.error('daiihaimm 当前考生为空') | ||||
|       } | ||||
|       console.log('daiihaimm upDateTableByArray end') | ||||
| 
 | ||||
|       this.stepFlag = false | ||||
|       this.isLoadingPopupVisible = false | ||||
|       router.pushUrl({ | ||||
| @ -1093,8 +1126,10 @@ struct UserInfo { | ||||
|       //接口标识 | ||||
|       jkid: '17C51', | ||||
|     } | ||||
|     console.info('surenjunjianguan', JSON.stringify(param)) | ||||
|     console.info('daihaimm surenjunjianguan', JSON.stringify(param)) | ||||
|     const temp = await writeObjectOut(param); | ||||
|     console.info('daihaimm surenjunjianguan end', JSON.stringify(temp)) | ||||
| 
 | ||||
|     globalThis.lsh = this.currentUser.lsh | ||||
|     globalThis.ksyh = this.currentUser.ksy1sfzmhm | ||||
|     return temp | ||||
|  | ||||
| @ -187,8 +187,8 @@ export default struct FaceCompare { | ||||
|     this.base64 = this.imageBase64 + data.base64 | ||||
|     faceCompare({ | ||||
|       sfzh: this.sfzh, | ||||
|       secondImage: this.firstImage.substr(22), | ||||
|       firstImage: data.base64, | ||||
|       secondImage: data.base64, | ||||
|       firstImage: '', | ||||
|       type: 2, | ||||
|       verifyType: 1 | ||||
|     }) | ||||
|  | ||||
| @ -25,11 +25,10 @@ export default struct SignDisplayCom { | ||||
|   @State interval: number = 0 | ||||
|   @State @Watch('outClick') outFlag: boolean = false; | ||||
|   @State url: string = '' | ||||
|   private timer = null | ||||
|   private udpClient: UdpClient = null | ||||
|   private FileLog: FileLog | ||||
|   private vocObj = null; | ||||
| 
 | ||||
|   timer: number = undefined | ||||
|   constructor() { | ||||
|     super() | ||||
|   } | ||||
| @ -325,13 +324,14 @@ export default struct SignDisplayCom { | ||||
| 
 | ||||
|   aboutToDisappear() { | ||||
|     // clearInterval(this.interval) | ||||
|     // clearInterval(this.timer) | ||||
|   } | ||||
| 
 | ||||
|   async aboutToAppear() { | ||||
|     setInterval(() => { | ||||
|       console.log("chuankou 定时器2") | ||||
|       getChuankouFn() | ||||
|     }, 1000) | ||||
|     // this.timer = setInterval(() => { | ||||
|     //   console.log("chuankou 定时器2") | ||||
|     //   getChuankouFn() | ||||
|     // }, 1000) | ||||
|     // const fileUtil = new FileUtil(globalThis.context) | ||||
|     // const data = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + '/config/ipConfig.txt') | ||||
|     // this.udplocalIp=JSON.parse(data)?.udplocalIp||'192.168.7.170' | ||||
|  | ||||
| @ -56,7 +56,9 @@ import { | ||||
| } from './api/index'; | ||||
| import { getSyncData, upDateTableByArray } from '../../common/service/initable'; | ||||
| import { GlobalConfig } from '../../config'; | ||||
| 
 | ||||
| const judgeTag = 'SURENJUN_JUDGE' | ||||
| const endExamTag = "endExam" | ||||
| 
 | ||||
| function ifNeedRetry(code: number | string): boolean { | ||||
|   let arr = ["B210010", "B210023", "B210024", "B210031", "B210033", "B210034", "B210041"] | ||||
| @ -65,6 +67,7 @@ function ifNeedRetry(code: number | string): boolean { | ||||
|   } | ||||
|   return false | ||||
| } | ||||
| 
 | ||||
| export default class Judge { | ||||
|   // 过程照片拍照
 | ||||
|   getPhoto = async (empty?: boolean) => { | ||||
| @ -320,13 +323,13 @@ export default class Judge { | ||||
|     const tWD = convertGpsCoord2(wd) | ||||
|     const {prevJd,prevWd} = this | ||||
|     if (prevJd && dwzt == 4 && jdzt == 3 && !globalThis.singlePlay) { | ||||
|       // const distance = await examCalcGpsDistance({
 | ||||
|       //   jd1: prevJd,
 | ||||
|       //   wd1: prevWd,
 | ||||
|       //   jd2: tJD,
 | ||||
|       //   wd2: tWD,
 | ||||
|       //   h: hxj || 1,
 | ||||
|       // })
 | ||||
|       const distance = await examCalcGpsDistance({ | ||||
|         jd1: prevJd, | ||||
|         wd1: prevWd, | ||||
|         jd2: tJD, | ||||
|         wd2: tWD, | ||||
|         h: hxj || 1, | ||||
|       }) | ||||
|       //@ts-ignore
 | ||||
|       // globalThis.distanceClass?.setTimeData(((distance / 100).toFixed(2)) * 1)
 | ||||
|     } | ||||
| @ -1151,7 +1154,7 @@ export default class Judge { | ||||
|           await endRecordVideo(this.videoData) | ||||
|         } | ||||
|         judgeTask.addTask(async () => { | ||||
|           console.info(judgeTag, '考试结束 start') | ||||
|           console.info(judgeTag, handEndExam, '考试结束 start') | ||||
|           globalThis.isJudge = false; | ||||
|           await handEndExam(ksjs) | ||||
|         }) | ||||
| @ -1258,6 +1261,7 @@ export default class Judge { | ||||
| 
 | ||||
|   // 处理考试结束
 | ||||
|   public handEndExam = async (ksjs: KSJS) => { | ||||
|     console.log(endExamTag, "handEndExam") | ||||
|     this.judgeUI.loadingPopupVisible = true; | ||||
|     this.judgeUI.endPopupVisible = false; | ||||
|     this.judgeUI.isDeductedPopShow = false; | ||||
| @ -1286,14 +1290,19 @@ export default class Judge { | ||||
|     } | ||||
| 
 | ||||
|     avPlayer.playAudio(['voice/exam_waiting.mp3'], globalThis.singlePlay, async () => { | ||||
|       console.log(endExamTag, "播放 exam_waiting") | ||||
|       try { | ||||
|         if (!singlePlay) { | ||||
|           console.log(endExamTag, "获取中心心跳1") | ||||
|           const bytes = await this.getMessageHeartbeat(true); | ||||
|           console.log(endExamTag, "获取中心心跳2") | ||||
|           globalThis.judgeUdp.send(bytes) | ||||
|           console.log(endExamTag, "获取中心心跳3") | ||||
|         } | ||||
|       } catch (e) { | ||||
|         console.info(judgeTag, JSON.stringify(e)) | ||||
|         console.info(judgeTag,endExamTag,"心跳错误", JSON.stringify(e)) | ||||
|       } | ||||
|       console.log(endExamTag,"开始调取结束考试") | ||||
|       await endExam() | ||||
| 
 | ||||
|     }); | ||||
| @ -1302,6 +1311,7 @@ export default class Judge { | ||||
| 
 | ||||
|   // 考试结束
 | ||||
|   public endExam = async (isManual?: Boolean) => { | ||||
|     console.log(endExamTag,"endExam start") | ||||
|     const carInfo = globalThis.carInfo; | ||||
|     const singlePlay = globalThis.singlePlay | ||||
|     const { examSubject ,plateNo} = carInfo; | ||||
| @ -1321,7 +1331,9 @@ export default class Judge { | ||||
|     //TODO 断网考试结束补传
 | ||||
|     // await uploadDisConnectData();
 | ||||
|     const time = await getCurrentTime(); | ||||
|     console.log(endExamTag,"获取图片1") | ||||
|     const photoBase64 = await getPhoto(); | ||||
|     console.log(endExamTag,"获取图片2") | ||||
|     const {d1,d2,d3,d4,d5} = ksjs | ||||
|     const data = { | ||||
|       xtlb: '17', jkxlh: serialNumber, jkid: '17C56', | ||||
| @ -1339,12 +1351,16 @@ export default class Judge { | ||||
|         dwlc: [d1, d2, d3, d4, d5].map((d, index) => `${index + 1},${Math.floor(d / 100)}`).join(';'), | ||||
|       } | ||||
|     } | ||||
| 
 | ||||
|     let backTimeOut = setTimeout(() => { | ||||
|       router.back() | ||||
|     }, 90 * 1000) | ||||
|     console.log(endExamTag,"上传结束考试1",JSON.stringify(data)) | ||||
|     const {code,keystr,message} = await this.sendWriteObjectOut(data, filePath); | ||||
|     console.log(endExamTag,"上传结束考试2",code,keystr,message) | ||||
|     console.log(endExamTag,"上传监管code1") | ||||
|     promptWxCode('17C56', code) | ||||
| 
 | ||||
|     console.log(endExamTag,"上传监管code2") | ||||
|     if (code != 1) { | ||||
|       avPlayer.playAudio(['voice/监管失败.mp3']) | ||||
|       this.judgeUI.errorMsg = decodeURIComponent(message) | ||||
|  | ||||
| @ -20,7 +20,7 @@ export default class FileModel{ | ||||
|   // 设置文件夹
 | ||||
|   public initFolder = async () => { | ||||
|     const {fileUtil} = this | ||||
|     await fileUtil.initFolder(`/models/model_enc`); | ||||
|     await fileUtil.initFolder(`/models`); | ||||
|     const folderPath =  await fileUtil.initFolder(`/models`); | ||||
|     this.folderPath = folderPath; | ||||
|   } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user