lv_chengmai #56
@ -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) => {
 | 
				
			||||||
 | 
				
			|||||||
@ -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)&&JSON.parse(data).length>0){
 | 
					        if(data&&JSON.parse(data)){
 | 
				
			||||||
          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) {
 | 
				
			||||||
 | 
				
			|||||||
@ -3,7 +3,6 @@ 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'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -14,8 +13,6 @@ 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');
 | 
				
			||||||
@ -25,11 +22,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)
 | 
				
			||||||
 | 
				
			|||||||
@ -22,6 +22,7 @@ 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 {
 | 
				
			||||||
@ -59,7 +60,9 @@ 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
 | 
				
			||||||
@ -152,33 +155,31 @@ export default class UdpClientByCenter {
 | 
				
			|||||||
    console.log('getUDPsendHeadMsg exit')
 | 
					    console.log('getUDPsendHeadMsg exit')
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  sendMsg(msg, sendCallback?) {
 | 
					  sendMsg(msg, sendCallback?)
 | 
				
			||||||
    if (!this.isWorking && sendCallback) {
 | 
					  {
 | 
				
			||||||
      sendCallback()
 | 
					    console.log(`${TAG}getUDPudpCLient sendMsg enter oppositeIp:${this.oppositeIp},oppositeIpPort:${this.oppositeIpPort},localIp:${this.localIp},localIpPort:${this.localIpPort}`);
 | 
				
			||||||
    }
 | 
					    if (!this.isWorking ) {
 | 
				
			||||||
    this.udp.getState((err, data) => {
 | 
					      console.log(`${TAG}getUDPudpCLient sendMsg  is closed return `);
 | 
				
			||||||
      if (err) {
 | 
					      if(sendCallback) {
 | 
				
			||||||
        this.isWorking = false
 | 
					        sendCallback()
 | 
				
			||||||
        return;
 | 
					 | 
				
			||||||
      } 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));
 | 
					      return;
 | 
				
			||||||
    })
 | 
					    }
 | 
				
			||||||
 | 
					    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}`);
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  sendMsgExt(param, context?) {
 | 
					  sendMsgExt(param, context?) {
 | 
				
			||||||
@ -329,9 +330,8 @@ export default class UdpClientByCenter {
 | 
				
			|||||||
          num++
 | 
					          num++
 | 
				
			||||||
          console.log(TAG, 'plc udp信号丢失')
 | 
					          console.log(TAG, 'plc udp信号丢失')
 | 
				
			||||||
          if (num == 3) {
 | 
					          if (num == 3) {
 | 
				
			||||||
            await this.bindUdp()
 | 
					            getUDP(globalThis.context,true)
 | 
				
			||||||
            await this.sendMsg('111', null)
 | 
					
 | 
				
			||||||
            await this.onMessage_1(callback)
 | 
					 | 
				
			||||||
            num = 0
 | 
					            num = 0
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
          prompt.showToast({
 | 
					          prompt.showToast({
 | 
				
			||||||
 | 
				
			|||||||
@ -48,9 +48,11 @@ 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(
 | 
				
			||||||
  //     cancel: ()=> { this.onCancel() },
 | 
					  //     title,
 | 
				
			||||||
  //     confirm: ()=> { this.onAccept() }
 | 
					  //     isDialog,
 | 
				
			||||||
 | 
					  //     // cancel: ()=> { },
 | 
				
			||||||
 | 
					  //     // confirm: ()=> { }
 | 
				
			||||||
  //   })
 | 
					  //   })
 | 
				
			||||||
  build() {
 | 
					  build() {
 | 
				
			||||||
    Column() {
 | 
					    Column() {
 | 
				
			||||||
 | 
				
			|||||||
@ -6,6 +6,7 @@ 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
 | 
				
			||||||
@ -131,27 +132,30 @@ struct Index {
 | 
				
			|||||||
    .backgroundImageSize({ width: '100%', height: '100%' })
 | 
					    .backgroundImageSize({ width: '100%', height: '100%' })
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  aboutToAppear() {
 | 
					  async aboutToAppear() {
 | 
				
			||||||
    getSyncData('IpConfigTable').then((result:Array<any>)=>{
 | 
					    const fileUtil = new FileUtil(this.context)
 | 
				
			||||||
      console.log('result222',JSON.stringify(result))
 | 
					    const data = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + '/config/ipConfig.txt');
 | 
				
			||||||
      if(result.length){
 | 
					    if (data === '' || data === undefined) {
 | 
				
			||||||
 | 
					    }else{
 | 
				
			||||||
 | 
					      const result=JSON.parse(data)
 | 
				
			||||||
        console.log('tagtag',JSON.stringify(result))
 | 
					        console.log('tagtag',JSON.stringify(result))
 | 
				
			||||||
        this.inputTextList1[9]=result[0].udplocalIp
 | 
					        this.inputTextList1[9]=result.udplocalIp
 | 
				
			||||||
        this.inputTextList1[10]=result[0].udplocalIpPort
 | 
					        this.inputTextList1[10]=result.udplocalIpPort
 | 
				
			||||||
        this.inputTextList1[7]=result[0].udpOppositeIp
 | 
					        this.inputTextList1[7]=result.udpOppositeIp
 | 
				
			||||||
        this.inputTextList1[8]=result[0].udpOppositeIpPort
 | 
					        this.inputTextList1[8]=result.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[0].tcpOppositeIp
 | 
					        this.inputTextList1[0]=result.tcpOppositeIp
 | 
				
			||||||
        this.inputTextList1[1]=result[0].tcpOppositePort
 | 
					        this.inputTextList1[1]=result.tcpOppositePort
 | 
				
			||||||
        this.inputTextList1[5]=result[0].gateway
 | 
					        this.inputTextList1[5]=result.gateway
 | 
				
			||||||
        this.inputTextList1[4]=result[0].netMask
 | 
					        this.inputTextList1[4]=result.netMask
 | 
				
			||||||
        this.inputTextList1[6]=result[0].dnsServers
 | 
					        this.inputTextList1[6]=result.dnsServers
 | 
				
			||||||
        this.inputTextList1[2]=result[0].centerIp
 | 
					        this.inputTextList1[2]=result.centerIp
 | 
				
			||||||
        this.inputTextList1[3]=result[0].centerPort
 | 
					        this.inputTextList1[3]=result.centerPort
 | 
				
			||||||
      }
 | 
					    }
 | 
				
			||||||
    })
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ethernet.getIfaceConfig("eth0", (error, value) => {
 | 
					    ethernet.getIfaceConfig("eth0", (error, value) => {
 | 
				
			||||||
      if (error) {
 | 
					      if (error) {
 | 
				
			||||||
        // that.errorMsg='error'
 | 
					        // that.errorMsg='error'
 | 
				
			||||||
 | 
				
			|||||||
@ -28,7 +28,6 @@ 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
 | 
				
			||||||
@ -70,10 +69,9 @@ 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 = true
 | 
					  @State updateTimeLimit: boolean = false
 | 
				
			||||||
  @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 = ''
 | 
				
			||||||
  // 过程照片拍照
 | 
					  // 过程照片拍照
 | 
				
			||||||
@ -380,7 +378,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>`
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user