diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index 38442c40..9757d767 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -504,7 +504,8 @@ struct Index { // await getUDP(this.context, false) ObtainSignalData.init(); CentralHeartbeat.init(); - CentralHeartbeat.getData((data: centerCallBackMsgType) => { + CentralHeartbeat.sendHeartData() + CentralHeartbeat.getData((data:centerCallBackMsgType)=>{ if (data.id == 32) { AppStorage.setOrCreate('signNum', data.body[1]) } diff --git a/entry/src/main/ets/pages/UserInfo.ets b/entry/src/main/ets/pages/UserInfo.ets index b30b9695..ccebb758 100644 --- a/entry/src/main/ets/pages/UserInfo.ets +++ b/entry/src/main/ets/pages/UserInfo.ets @@ -8,13 +8,13 @@ import IDCardSDK from '@ohos.idcard'; import common from '@ohos.app.ability.common'; import promptAction from '@ohos.promptAction'; import FilePhoto from './judgeSDK/utils/filePhoto'; -import { sqlInsertCommonFn, upDateTableByArray } from '../common/service/initable'; +// import { sqlInsertCommonFn, upDateTableByArray } from '../common/service/initable'; import { CandidateData, EmptyCandidateObject } from '../mock/CandidateData'; import BoardPrePareSetPopup from './compontents/judge/BoardPrePareSetPopup'; import LoadingPopup from './compontents/judge/LoadingPopup'; import VoiceAnnounce from './judgeSDK/utils/voiceAnnouncements'; import { judgeConfig } from './judgeSDK/utils/judgeConfig'; -import { initJudgeUdp } from '../common/utils/UdpJudge'; +// import { initJudgeUdp } from '../common/utils/UdpJudge'; import errorMsgDialog from './compontents/errorMsgDialog'; import imageBtn from './compontents/imageBtn'; import { CryptoJS } from '@ohos/crypto-js'; @@ -30,7 +30,6 @@ import { IdCard, LabelBlockType, MASYSSETTableType, - QKParamType, RegulatoryInterfaceParams, RouteParamsType, SckType, @@ -39,11 +38,10 @@ import { User } from '../model'; import { BusinessError } from '@ohos.base'; -import { GetSyncData } from '../utils/table/Operation'; +import { GetSyncData, SqlInsertTable } from '../utils/table/Operation'; import { GetCurrentUserKeyValue } from './UserInfo/utils'; import dayTs from '../utils/Date'; import { GetCurrentTime, NumberToByteArray } from '../utils/Common'; -import FileUtils from '../utils/FileUtils'; import DB from '../utils/DbSql'; import { CentralHeartbeat } from '../utils/business/CentralHeartbeat'; @@ -143,7 +141,8 @@ struct UserInfo { if (this.singlePlay) { // const { examSubject } = this.carInfo; this.currentUser.id = '0' - await upDateTableByArray('USER', [this.currentUser]) + // await upDateTableByArray('USER', [this.currentUser]) + await SqlInsertTable('USER', [this.currentUser]) router.pushUrl({ url: this.carInfo.examSubject == '3' ? 'pages/Roads' : 'pages/Judge', params: { @@ -189,7 +188,7 @@ struct UserInfo { ) private filePhoto: FilePhoto // 过程照片拍照 - getPhoto = async (empty?: boolean) => { + getPhoto = async () => { //单机模式返回空照片 if (this.singlePlay) { return '' @@ -210,7 +209,6 @@ struct UserInfo { ] aboutToAppear() { - this.fileUtil = new FileUtils(this.context) this.avPlayer = new VoiceAnnounce(); } @@ -275,7 +273,7 @@ struct UserInfo { this.list.forEach((res, index) => { res.id = index.toString() }) - await upDateTableByArray('USERLIST', this.list || []) + await SqlInsertTable("USERLIST", this.list || []) } else { await this.getExaminationStudentInfoFn() } @@ -294,7 +292,7 @@ struct UserInfo { // this.currentUser=user // } this.sczbkf = []; - initJudgeUdp() + // initJudgeUdp() // TODO UDP更改 //监听远程开始考试 // globalThis.udpEvent.onBeginExam(async () => { @@ -365,7 +363,7 @@ struct UserInfo { if (!flag) { AppStorage.setOrCreate('lsh', '0000000000000') - await upDateTableByArray('USER', []) + await SqlInsertTable('USER', []) setTimeout(() => { this.currentUser = this.list[0] this.currentUser.ksy2 = this.examinerLoginInfo.kgxm @@ -485,14 +483,14 @@ struct UserInfo { getqkFn() { let tmpList: Array = []; tmpList.push(NumberToByteArray(AppStorage.get('signNum'), 1 * 8)[0]) - const param: QKParamType = { + const param: UDPParamType = { id: 41, list: tmpList, carNo: this.carInfo.carNo as string, placeId: this.carInfo.examinationRoomId as string } - // TODO UDP缺失 // globalThis.udpClient2.sendMsgExt(param, this.context) + CentralHeartbeat.sendData(param) } async initSysset() { @@ -733,7 +731,8 @@ struct UserInfo { // await upDateTableByArray('USERLIST', this.list || []) console.log("temp list", JSON.stringify(this.list)) - await sqlInsertCommonFn("USERLIST", this.list || []) + // await sqlInsertCommonFn("USERLIST", this.list || []) + await SqlInsertTable('USERLIST', this.list || []) dataList = this.list.length > 4 ? this.list.slice(this.pageIndex * 4, this.pageIndex * 4 + 4) : this.list; this.dataList = dataList @@ -891,7 +890,8 @@ struct UserInfo { return } this.currentUser.id = '0' - await upDateTableByArray('USER', [this.currentUser]) + // await upDateTableByArray('USER', [this.currentUser]) + await SqlInsertTable('USER', [this.currentUser]) this.stepFlag = false this.isLoadingPopupVisible = false router.pushUrl({ @@ -1064,7 +1064,7 @@ struct UserInfo { await this.checkSignal() this.isExamStart = true this.currentUser.id = '0' - DB.insertData("USER", this.currentUser).then(res => { + DB.insertData("USER", this.currentUser).then(() => { console.log("USER insert success",) }).catch((err: BusinessError) => { console.log("USER insert fail", JSON.stringify(err)) @@ -1089,9 +1089,6 @@ struct UserInfo { outClick() { clearInterval(this.interval) this.stopDeviceById() - // TODO 缺失UDP - // globalThis.udpClient2 && globalThis.udpClient2?.setMsgCallBack(() => { - // }) } // 几个按钮公共样式 diff --git a/entry/src/main/ets/pages/compontents/FaceCompare.ets b/entry/src/main/ets/pages/compontents/FaceCompare.ets index bfd5e3d7..a56a330a 100644 --- a/entry/src/main/ets/pages/compontents/FaceCompare.ets +++ b/entry/src/main/ets/pages/compontents/FaceCompare.ets @@ -255,9 +255,6 @@ export default struct FaceCompare { placeId: this.carInfo.examinationRoomId, } CentralHeartbeat.sendData(param2) - - // TODO UDP缺失 - // globalThis.udpClient2 && globalThis.udpClient2.sendMsgExt(param2, this.context) } }, 1000) CentralHeartbeat.getData((val)=>{