Compare commits

..

No commits in common. "4bc2a88b7c391f6e1f03b49cbc7c3df45989784b" and "1b3093b067fb377b2285cd1bea2edbfa80be71e9" have entirely different histories.

7 changed files with 63 additions and 64 deletions

View File

@ -152,10 +152,10 @@ export async function getSingleCenterTable(param) {
// reslove(false) // reslove(false)
// }) // })
console.log('联网更新失败,请检查网络后重新更新') console.log('联网更新失败,请检查网络后重新更新')
// promptAction.showToast({ promptAction.showToast({
// message: `联网更新表数据失败,请重新更新`, message: `联网更新表数据失败,请重新更新`,
// duration: 3000 duration: 3000
// }); });
reslove(false) reslove(false)
} }
}).catch((error) => { }).catch((error) => {

View File

@ -337,7 +337,7 @@ export async function upDataZhongxinginitialization(param) {
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']; 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)=>{ tableList.map(async(tableName)=>{
const data = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + `/config/tableList/${tableName}.txt`); const data = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + `/config/tableList/${tableName}.txt`);
if(data&&JSON.parse(data)){ if(data&&JSON.parse(data)&&JSON.parse(data).length>0){
sqlInsertCommonFn(tableName, JSON.parse(data), param.context).then((result) => { sqlInsertCommonFn(tableName, JSON.parse(data), param.context).then((result) => {
console.log(key, '单机表建立成功') console.log(key, '单机表建立成功')
if (result) { if (result) {

View File

@ -3,6 +3,7 @@ import { obtainCarExamInfo } from '../../api/index'
import { dateFormat } from '../utils/tools' import { dateFormat } from '../utils/tools'
import router from '@ohos.router' import router from '@ohos.router'
import promptAction from '@ohos.promptAction' import promptAction from '@ohos.promptAction'
import { getSyncData } from '../../common/service/initable'
import { GlobalConfig } from '../../config/index' import { GlobalConfig } from '../../config/index'
import FileUtil from '../../common/utils/File' import FileUtil from '../../common/utils/File'
@ -13,6 +14,8 @@ export async function getDeviceInfo(context) {
// globalThis.deviceNo = '1649018001275'; //洛阳科目三设备 // globalThis.deviceNo = '1649018001275'; //洛阳科目三设备
// globalThis.deviceNo = 'MAC-36E6575F'; //杭州科目二设备 489 // globalThis.deviceNo = 'MAC-36E6575F'; //杭州科目二设备 489
// globalThis.deviceNo = 'MAC-C57C8966'; //杭州科目二设备 // globalThis.deviceNo = 'MAC-C57C8966'; //杭州科目二设备
globalThis.deviceNo = 'MAC-B2A3A8FD'; //杭州科目二设备
return
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
const fileUtil = new FileUtil(context) const fileUtil = new FileUtil(context)
const data = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + '/config/deviceNo.txt'); const data = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + '/config/deviceNo.txt');
@ -22,11 +25,11 @@ export async function getDeviceInfo(context) {
duration: 3000 duration: 3000
}); });
router.pushUrl({ router.pushUrl({
url: 'pages/Register', url: 'pages/Register',
}, router.RouterMode.Single); }, router.RouterMode.Single);
resolve('') resolve('')
} else { } else {
const fileData = JSON.parse(data) const fileData=JSON.parse(data)
globalThis.deviceNo = fileData.deviceName globalThis.deviceNo = fileData.deviceName
getCarInfo() getCarInfo()
resolve(fileData.deviceName) resolve(fileData.deviceName)

View File

@ -22,7 +22,6 @@ import { fillZero, string2Bytes } from '../utils/tools'
const TAG = '[UdpDemo.UdpClient]' const TAG = '[UdpDemo.UdpClient]'
import hilog from '@ohos.hilog'; import hilog from '@ohos.hilog';
import prompt from '@ohos.prompt' import prompt from '@ohos.prompt'
import { getUDP } from './GlobalUdp';
export default class UdpClientByCenter { export default class UdpClientByCenter {
@ -60,9 +59,7 @@ export default class UdpClientByCenter {
return this.isWorking return this.isWorking
} }
rebindUdp(localIp: string, localIpPort: string, oppositeIp: string, oppositeIpPort: string) rebindUdp(localIp: string, localIpPort: string, oppositeIp: string, oppositeIpPort: string) {
{
console.log(`${TAG}getUDPudpCLient rebindUdp enter localIp:${localIp},localIpPort:${localIpPort},oppositeIp:${oppositeIp},oppositeIpPort:${oppositeIpPort}`);
this.localIp = localIp this.localIp = localIp
this.oppositeIp = oppositeIp this.oppositeIp = oppositeIp
this.localIpPort = localIpPort this.localIpPort = localIpPort
@ -155,31 +152,33 @@ export default class UdpClientByCenter {
console.log('getUDPsendHeadMsg exit') console.log('getUDPsendHeadMsg exit')
} }
sendMsg(msg, sendCallback?) sendMsg(msg, sendCallback?) {
{ if (!this.isWorking && sendCallback) {
console.log(`${TAG}getUDPudpCLient sendMsg enter oppositeIp:${this.oppositeIp},oppositeIpPort:${this.oppositeIpPort},localIp:${this.localIp},localIpPort:${this.localIpPort}`); sendCallback()
if (!this.isWorking ) {
console.log(`${TAG}getUDPudpCLient sendMsg is closed return `);
if(sendCallback) {
sendCallback()
}
return;
} }
let promise = this.udp.send({ this.udp.getState((err, data) => {
data: msg, if (err) {
address: { this.isWorking = false
address: this.oppositeIp, return;
port: parseInt(this.oppositeIpPort), } else {
let promise = this.udp.send({
data: msg,
address: {
address: this.oppositeIp,
port: parseInt(this.oppositeIpPort),
}
});
promise.then(() => {
if (sendCallback) {
sendCallback()
}
console.log(`${TAG}getUDPudpCLient udp send success:oppositeIp${this.oppositeIp},oppositeIpPort:${this.oppositeIpPort},localIp:${this.localIp},localIpPort,${this.localIpPort}`);
}).catch(err => {
console.log(`${TAG}getUDPudpCLient udp send fail:oppositeIp${this.oppositeIp},oppositeIpPort:${this.oppositeIpPort},localIp:${this.localIp},localIpPort,${this.localIpPort}`);
});
} }
}); console.log('getUDPgetState success:' + JSON.stringify(data));
promise.then(() => { })
if (sendCallback) {
sendCallback()
}
console.log(`${TAG}getUDPudpCLient udp send success:oppositeIp${this.oppositeIp},oppositeIpPort:${this.oppositeIpPort},localIp:${this.localIp},localIpPort,${this.localIpPort}`);
}).catch(err => {
console.log(`${TAG}getUDPudpCLient udp send fail:oppositeIp${this.oppositeIp},oppositeIpPort:${this.oppositeIpPort},localIp:${this.localIp},localIpPort,${this.localIpPort}`);
});
} }
sendMsgExt(param, context?) { sendMsgExt(param, context?) {
@ -330,8 +329,9 @@ export default class UdpClientByCenter {
num++ num++
console.log(TAG, 'plc udp信号丢失') console.log(TAG, 'plc udp信号丢失')
if (num == 3) { if (num == 3) {
getUDP(globalThis.context,true) await this.bindUdp()
await this.sendMsg('111', null)
await this.onMessage_1(callback)
num = 0 num = 0
} }
prompt.showToast({ prompt.showToast({

View File

@ -48,11 +48,9 @@ struct Index {
.margin({ bottom: 12 * this.ratio}) .margin({ bottom: 12 * this.ratio})
} }
// dialogController: CustomDialogController | null = new CustomDialogController({ // dialogController: CustomDialogController | null = new CustomDialogController({
// builder: errorMsgDialog( // builder: errorMsgDialog({
// title, // cancel: ()=> { this.onCancel() },
// isDialog, // confirm: ()=> { this.onAccept() }
// // cancel: ()=> { },
// // confirm: ()=> { }
// }) // })
build() { build() {
Column() { Column() {

View File

@ -6,7 +6,6 @@ import { upDateTableByArray} from '../common/service/initable'
import { getSyncData} from '../common/service/initable' import { getSyncData} from '../common/service/initable'
import FileUtil from '../common/utils/File'; import FileUtil from '../common/utils/File';
import common from '@ohos.app.ability.common'; import common from '@ohos.app.ability.common';
import { GlobalConfig } from '../config';
@Entry @Entry
@ -132,30 +131,27 @@ struct Index {
.backgroundImageSize({ width: '100%', height: '100%' }) .backgroundImageSize({ width: '100%', height: '100%' })
} }
async aboutToAppear() { aboutToAppear() {
const fileUtil = new FileUtil(this.context) getSyncData('IpConfigTable').then((result:Array<any>)=>{
const data = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + '/config/ipConfig.txt'); console.log('result222',JSON.stringify(result))
if (data === '' || data === undefined) { if(result.length){
}else{
const result=JSON.parse(data)
console.log('tagtag',JSON.stringify(result)) console.log('tagtag',JSON.stringify(result))
this.inputTextList1[9]=result.udplocalIp this.inputTextList1[9]=result[0].udplocalIp
this.inputTextList1[10]=result.udplocalIpPort this.inputTextList1[10]=result[0].udplocalIpPort
this.inputTextList1[7]=result.udpOppositeIp this.inputTextList1[7]=result[0].udpOppositeIp
this.inputTextList1[8]=result.udpOppositeIpPort this.inputTextList1[8]=result[0].udpOppositeIpPort
// this.inputTextList1[0]=result[0].tcplocalIp // this.inputTextList1[0]=result[0].tcplocalIp
// this.inputTextList1[13]=result[0].tcplocalIpPort // this.inputTextList1[13]=result[0].tcplocalIpPort
this.inputTextList1[0]=result.tcpOppositeIp this.inputTextList1[0]=result[0].tcpOppositeIp
this.inputTextList1[1]=result.tcpOppositePort this.inputTextList1[1]=result[0].tcpOppositePort
this.inputTextList1[5]=result.gateway this.inputTextList1[5]=result[0].gateway
this.inputTextList1[4]=result.netMask this.inputTextList1[4]=result[0].netMask
this.inputTextList1[6]=result.dnsServers this.inputTextList1[6]=result[0].dnsServers
this.inputTextList1[2]=result.centerIp this.inputTextList1[2]=result[0].centerIp
this.inputTextList1[3]=result.centerPort this.inputTextList1[3]=result[0].centerPort
} }
})
ethernet.getIfaceConfig("eth0", (error, value) => { ethernet.getIfaceConfig("eth0", (error, value) => {
if (error) { if (error) {
// that.errorMsg='error' // that.errorMsg='error'

View File

@ -28,6 +28,7 @@ import { initJudgeUdp } from '../common/utils/UdpJudge';
struct UserInfo { struct UserInfo {
private filePhoto: FilePhoto private filePhoto: FilePhoto
private avPlayer private avPlayer
@State pageIndex: number = 0 @State pageIndex: number = 0
@State ratio: number = 1700 / 960 @State ratio: number = 1700 / 960
@State index: number = 0 @State index: number = 0
@ -69,9 +70,10 @@ struct UserInfo {
@State numCount: number = 0; @State numCount: number = 0;
@State signNum: number = 0; @State signNum: number = 0;
@State isCanClick: boolean = true; @State isCanClick: boolean = true;
@State updateTimeLimit: boolean = false @State updateTimeLimit: boolean = true
@State faceFlag: string = '0'; @State faceFlag: string = '0';
@State FaceOpenStatue: string = '0'; //是否开启人脸识别 @State FaceOpenStatue: string = '0'; //是否开启人脸识别
subscriber;
@State faceCatchImg: string = '' @State faceCatchImg: string = ''
@State Param803Str:string = '' @State Param803Str:string = ''
// 过程照片拍照 // 过程照片拍照
@ -378,7 +380,7 @@ struct UserInfo {
//获取下载考生 //获取下载考生
getExaminationStudentInfoFn() { getExaminationStudentInfoFn() {
if (globalThis.singlePlay || this.updateTimeLimit) { if (globalThis.singlePlay && this.updateTimeLimit) {
return 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>` 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>`