洛陽修改

This commit is contained in:
lvyuankang 2024-08-13 11:50:38 +08:00
parent 1b3093b067
commit 829a18a314
7 changed files with 65 additions and 64 deletions

View File

@ -152,10 +152,10 @@ export async function getSingleCenterTable(param) {
// reslove(false)
// })
console.log('联网更新失败,请检查网络后重新更新')
promptAction.showToast({
message: `联网更新表数据失败,请重新更新`,
duration: 3000
});
// promptAction.showToast({
// message: `联网更新表数据失败,请重新更新`,
// duration: 3000
// });
reslove(false)
}
}).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'];
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){
if(data&&JSON.parse(data)){
sqlInsertCommonFn(tableName, JSON.parse(data), param.context).then((result) => {
console.log(key, '单机表建立成功')
if (result) {

View File

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

View File

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

View File

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

View File

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

View File

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