lv_chengmai #55

Merged
wangzhongjie merged 2 commits from lv_chengmai into main 2024-08-12 14:52:09 +08:00
4 changed files with 73 additions and 36 deletions

View File

@ -26,6 +26,8 @@ import DeviceInfoTable from '../constants/DeviceInfoTable';
import USER from '../constants/USER';
import util from '@ohos.util';
import FileModel from '../../pages/judgeSDK/utils/fileModel';
import FileUtil from '../../common/utils/File';
import { GlobalConfig } from '../../config/index';
// @ts-nocheck
//读表
@ -330,6 +332,27 @@ export async function upDataZhongxinginitialization(param) {
resolve(false)
return
}
if(param.singlePlay){
const fileUtil = new FileUtil(param.context)
const tableList=['MA_ITEMINFO','MA_MARKRULE','MA_SYSTEMPARM','MA_MAP_COLLECT','MA_MAP_COLLECT_SHAPE','MA_MAP_ITEMCLASS','MA_MAP_POINT','MA_MAP_POINT_ITEM','MA_MAP_ROAD','MA_MAP_ROAD_LANE','MAP_SUBITEM','MA_SYSSET','ES_CARINFO','MA_MARKRULESET','MA_CDSBINFO','MA_T_CARPARMSET'];
tableList.map(async(tableName)=>{
const data = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + `/config/tableList/${tableName}.txt`);
if(data&&JSON.parse(data)&&JSON.parse(data).length>0){
sqlInsertCommonFn(tableName, JSON.parse(data), param.context).then((result) => {
console.log(key, '单机表建立成功')
if (result) {
resolve(true)
} else {
resolve(false)
}
}).catch((msg) => {
reject(false)
console.log(key, '单机表建立失败')
})
}
})
return
}
const str = {
"carId": param.carId, // 表名
"examinationRoomId": param.examinationRoomId, //考试平台kdid
@ -370,7 +393,7 @@ export async function upDataZhongxinginitialization(param) {
}
function setSyncCenterSqlData(key, res, param) {
return new Promise((resolve, reject) => {
return new Promise(async(resolve, reject) => {
const mapName = {
'ItemInfo': 'MA_ITEMINFO',
'MarkRule': 'MA_MARKRULE',
@ -389,7 +412,6 @@ function setSyncCenterSqlData(key, res, param) {
'MarkRuleSet': 'MA_MARKRULESET',
'Cdsbinfo': 'MA_CDSBINFO',
'T_CarParmSet': 'MA_T_CARPARMSET',
// 'ES_CAR_VIDEO_PARAMETER':ES_CAR_VIDE0pO_PARAMETER
}
// const accountTable = new AccountTable(() => {
// }, centerToMap[key],param.context);
@ -399,6 +421,9 @@ function setSyncCenterSqlData(key, res, param) {
} else {
arrList = [res.initializationRsp.body[key].record]
}
const fileUtil = new FileUtil(param.context)
const folderPath = await fileUtil.initFolder(`/config/tableList`);
fileUtil.addFile(`${folderPath}/${mapName[key]}.txt`, JSON.stringify(arrList))
console.log('mapName[key]', mapName[key], key)
sqlInsertCommonFn(mapName[key], arrList, param.context).then((result) => {
console.log(key, '表建立成功')

View File

@ -1,5 +1,4 @@
// @ts-nocheck
import { VideoConfig } from './interfaces'
import common from '@ohos.app.ability.common';
import router from '@ohos.router';
import { getCarInfo, getDeviceInfo } from '../common/service/terminalService';
@ -16,7 +15,7 @@ import abilityAccessCtrl, { Permissions } from '@ohos.abilityAccessCtrl';
import worker, { MessageEvents } from '@ohos.worker';
import promptAction from '@ohos.promptAction'
import { voiceService } from '../common/service/voiceService';
// import errorMsgDialog from './compontents/errorMsgDialog'
@Entry
@Component
struct Index {
@ -48,7 +47,11 @@ struct Index {
.backgroundImageSize({ width: '100%', height: '100%' })
.margin({ bottom: 12 * this.ratio})
}
// dialogController: CustomDialogController | null = new CustomDialogController({
// builder: errorMsgDialog({
// cancel: ()=> { this.onCancel() },
// confirm: ()=> { this.onAccept() }
// })
build() {
Column() {
Column() {
@ -100,7 +103,7 @@ struct Index {
Column() {
Row() {
if (!this.isSingle) {
Image($r('app.media.index_lw')).width('28%').height('71%').margin({left:10 * globalThis.ratio}).onClick(async () => {
Image($r('app.media.index_lw')).width('28%').height('71%').margin({left:80 * globalThis.ratio}).onClick(async () => {
if (this.loading) {
return
}
@ -123,7 +126,7 @@ struct Index {
})
}
if (this.isSingle) {
Image($r('app.media.index_dj')).width('30.5%').height('74%').margin({left:10 * globalThis.ratio}).onClick(() => {
Image($r('app.media.index_dj')).width('28%').height('71%').margin({left:80 * globalThis.ratio}).onClick(() => {
if (this.loading) {
return
}
@ -133,7 +136,7 @@ struct Index {
}, router.RouterMode.Single);
})
}
Image($r('app.media.index_zj')).width('28%').height('71%').margin({right:10* globalThis.ratio}).onClick(() => {
Image($r('app.media.index_zj')).width('28%').height('71%').margin({right:80* globalThis.ratio}).onClick(() => {
if (this.loading) {
return
}
@ -257,8 +260,7 @@ struct Index {
this.dialogVisiable=false
this.angle = 0
this.loading = false
this.vocObj = new voiceService(async (status, val, next) => {
});
}
async testXMLToJSONInWorker() {
@ -272,7 +274,8 @@ struct Index {
mode: globalThis.timeInfo?.mode,
context: this.context,
host:globalThis.host,
centerHost:globalThis.timeInfo.url
centerHost:globalThis.timeInfo.url,
singlePlay:globalThis.singlePlay
}
workerInstance.postMessage(param);
workerInstance.onmessage = (e: MessageEvents): void => {
@ -313,6 +316,18 @@ struct Index {
}
async onPageShow() {
this.vocObj = new voiceService(async (status, val, next) => {
});
console.log('globalThis.singlePlay',globalThis.singlePlay)
if (globalThis.singlePlay == undefined || globalThis.singlePlay == null) {
this.vocObj.playAudio({
type: 1,
name: 'welcome.wav'
})
globalThis.singlePlay = false
}
this.isSingle = globalThis.singlePlay
this.loading = false
this.userAuth();
this.createAlbum()
@ -333,15 +348,6 @@ struct Index {
getTCP()
// const TcpClient: TcpClient =new TcpClient(result[0].tcplocalIp, result[0].tcplocalIpPort,result[0].tcpOppositeIp,result[0].tcpOppositePort)
if (globalThis.singlePlay == undefined || globalThis.singlePlay == null) {
this.vocObj.playAudio({
type: 1,
name: 'welcome.wav'
})
globalThis.singlePlay = false
}
this.isSingle = globalThis.singlePlay
console.info('Index onPageShow');
}

View File

@ -83,7 +83,7 @@ struct Index {
const fileUtil = new FileUtil(this.context)
const folderPath = await fileUtil.initFolder(`/config`);
const param={udplocalIp:this.inputTextList1[9],udplocalIpPort:this.inputTextList1[10],udpOppositeIp:this.inputTextList1[7],udpOppositeIpPort:this.inputTextList1[8],tcplocalIp:this.inputTextList1[9],tcplocalIpPort:'8088',tcpOppositeIp:this.inputTextList1[0],tcpOppositePort:this.inputTextList1[1],netMask:this.inputTextList1[4],gateway:this.inputTextList1[5],dnsServers:this.inputTextList1[6],centerIp:this.inputTextList1[2],centerPort:this.inputTextList1[3]}
fileUtil.addFile(`${folderPath}/ipConfig.txt`, JSON.stringify(param))
fileUtil.addFile(`${folderPath}/ipConfig.txt`, JSON.stringify(param),'')
// upDateTableByArray('IpConfigTable',[])
ethernet.setIfaceConfig("eth0", {
mode: 0,

View File

@ -163,7 +163,6 @@ struct UserInfo {
return
}
this.showFaceCompare = true
this.pageIndex = Math.floor(index / 4)
}
})
@ -314,16 +313,22 @@ struct UserInfo {
that.ksxtbh = ksxtbhArr?.[0]?.v_value || '222'
const studentRefreshParam = syssetParams.filter(sys => sys.v_no === '452')
that.studentRefreshStatue = studentRefreshParam?.[0]?.v_value || '0'
const openCheckFlagParam = syssetParams.filter(sys => sys.v_no == '17')
const openCheckFlag =openCheckFlagParam?.[0]?.v_value == '1' ? '1' : '0'
const faceParam = syssetParams.filter(sys => sys.v_no == '2413')
that.FaceOpenStatue = faceParam?.[0]?.v_value == '3' ? '1' : '0'
that.FaceOpenStatue = '0'
console.log('that.FaceOpenStatue', that.FaceOpenStatue)
// that.FaceOpenStatue = '0'
// faceParam?.[0]?.v_value ||
// 1身份证读卡器 2指纹 3人脸
this.faceFlag = faceParam?.[0]?.v_value || '0'
if (faceParam?.[0]?.v_value == '1') {
that.openDeviceByIDCard()
if(openCheckFlag=='1'){
that.FaceOpenStatue = faceParam?.[0]?.v_value == '3' ? '1' : '0'
this.faceFlag = faceParam?.[0]?.v_value || '0'
if (faceParam?.[0]?.v_value == '1') {
that.openDeviceByIDCard()
}
}
//0不自动更新 1自动更新不限次数 2没有考生更新2次
if (that.studentRefreshStatue == '2') {
clearInterval(that.interval)
@ -371,13 +376,6 @@ struct UserInfo {
}
this.pageIndex--;
this.dataList = this.list.slice(this.pageIndex * 4, this.pageIndex * 4 + 4)
this.dataList.forEach(listData => {
for (let i in listData) {
listData[i] = decodeURI(listData[i])
}
listData.kszp = this.photo + listData.kszp
listData.ksmjzp = this.photo + listData.ksmjzp
})
}
//获取下载考生
@ -386,7 +384,7 @@ struct UserInfo {
return
}
const param = `<getExaminationStudentInfoReq><head><checkCode>${Md5.Instance.get_md5(globalThis.carInfo.carId + globalThis.carInfo.examinationRoomId + globalThis.username)}</checkCode></head><body><carId>${globalThis.carInfo.carId}</carId><examinationRoomId>${globalThis.carInfo.examinationRoomId}</examinationRoomId><examinerName>${globalThis.username}</examinerName></body></getExaminationStudentInfoReq>`
getExaminationStudentInfo(param).then(async res => {
getExaminationStudentInfo(param).then(async(res) => {
setTimeout(() => {
this.updateTimeLimit = true
}, 30000)
@ -413,7 +411,15 @@ struct UserInfo {
}
this.list = JSON.parse(JSON.stringify(dataList))
this.list.forEach(listData => {
for (let i in listData) {
listData[i] = decodeURI(listData[i])
}
listData.kszp = this.photo + listData.kszp
listData.ksmjzp = this.photo + listData.ksmjzp
})
dataList = this.list.length > 4 ? this.list.slice(this.pageIndex * 4, this.pageIndex * 4 + 4) : this.list;
this.dataList = dataList
if (this.dataList.length) {
this.currentUser = this.dataList[0]