Compare commits
	
		
			No commits in common. "3475fc9961c5ea91c8c09cd17c6de4f84c796e5d" and "329833c228491b3d3c2f29d3a2c03f37d5cb80f0" have entirely different histories.
		
	
	
		
			3475fc9961
			...
			329833c228
		
	
		
@ -1,6 +1,6 @@
 | 
			
		||||
import request from "../utils/Request"
 | 
			
		||||
import http from "@ohos.net.http"
 | 
			
		||||
import { InitializeTheCentralTableType, ObtainCarExamInfoParams, ResponseDataType } from "../model"
 | 
			
		||||
import { InitializeTheCentralTableType, ResponseDataType } from "../model"
 | 
			
		||||
 | 
			
		||||
interface timeSynchronizationParams {
 | 
			
		||||
  time: string
 | 
			
		||||
@ -50,9 +50,13 @@ export async function timeSynchronizationHTTP(params: timeSynchronizationHTTPPar
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
interface obtainCarExamInfoParams {
 | 
			
		||||
  time: string
 | 
			
		||||
  deviceNo: string
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//获取考车信息
 | 
			
		||||
export async function obtainCarExamInfo(params: ObtainCarExamInfoParams) {
 | 
			
		||||
export async function obtainCarExamInfo(params: obtainCarExamInfoParams) {
 | 
			
		||||
  return request<object>({
 | 
			
		||||
    url: '/der2/services/exam/obtainCarExamInfo.ws',
 | 
			
		||||
    data: `<?xml version="1.0" encoding="UTF-8" ?>
 | 
			
		||||
@ -84,7 +88,7 @@ export async function initCarInfoCache(params: initCarInfoCacheParams) {
 | 
			
		||||
 | 
			
		||||
//参数下发读表接口
 | 
			
		||||
export async function initCenterCache(params: object, url: string) {
 | 
			
		||||
  const timeInfo: string = AppStorage.get('timeInfo')
 | 
			
		||||
  const timeInfo = AppStorage.get('timeInfo')
 | 
			
		||||
  return await request<object>({
 | 
			
		||||
    url: '/para/initCenterCache.ws',
 | 
			
		||||
    data: params,
 | 
			
		||||
 | 
			
		||||
@ -4,8 +4,6 @@ import { getSyncData } from '../common/service/initable';
 | 
			
		||||
import writeObjectOutNew from './judgeNew';
 | 
			
		||||
import FileUtil from '../common/utils/File';
 | 
			
		||||
import http from '@ohos.net.http';
 | 
			
		||||
import { MASYSSETTableType, RegulatoryInterfaceParams } from '../model';
 | 
			
		||||
import { GetSyncData } from '../utils/table/Operation';
 | 
			
		||||
 | 
			
		||||
let baseHost: string = AppStorage.get('host');
 | 
			
		||||
 | 
			
		||||
@ -27,7 +25,7 @@ interface WR {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 通用监管接口
 | 
			
		||||
export async function writeObjectOut(params: RegulatoryInterfaceParams, filePath?: string): Promise<WR> {
 | 
			
		||||
export async function writeObjectOut(params: ESObject, filePath?: string): Promise<WR> {
 | 
			
		||||
  const singlePlay: boolean = AppStorage.get('singlePlay')
 | 
			
		||||
  if (singlePlay) {
 | 
			
		||||
    return { code: 1 }
 | 
			
		||||
@ -35,7 +33,7 @@ export async function writeObjectOut(params: RegulatoryInterfaceParams, filePath
 | 
			
		||||
  let JGHOST: string = AppStorage.get("JGHOST")
 | 
			
		||||
  //获取监管接口地址路径
 | 
			
		||||
  if (!JGHOST) {
 | 
			
		||||
    const syssetParams: MASYSSETTableType[] = await GetSyncData<MASYSSETTableType>("MA_SYSSET");
 | 
			
		||||
    const syssetParams = await getSyncData('MA_SYSSET') || [];
 | 
			
		||||
 | 
			
		||||
    syssetParams.forEach(sys => {
 | 
			
		||||
      if (sys.v_no == '839') {
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
import request from '../utils/Request'
 | 
			
		||||
import http from '@ohos.net.http'
 | 
			
		||||
import { FaceCompareResp, GetExaminationItemRsp, GetExaminationStudentInfoResponse } from '../model'
 | 
			
		||||
import { FaceCompareResp } from '../model'
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 照片比对
 | 
			
		||||
@ -39,8 +39,8 @@ export async function faceCompare(params: FaceCompareParams) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
export async function getExaminationStudentInfo(params: ESObject) {
 | 
			
		||||
  return request<GetExaminationStudentInfoResponse>({
 | 
			
		||||
export async function getExaminationStudentInfo(params: object) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/der2/services/exam/getExaminationStudentInfo.ws',
 | 
			
		||||
    data: params,
 | 
			
		||||
    method: http.RequestMethod.POST,
 | 
			
		||||
@ -67,7 +67,7 @@ interface GetExaminationItemParams {
 | 
			
		||||
 | 
			
		||||
//获取断点续考
 | 
			
		||||
export async function getExaminationItem(params: GetExaminationItemParams) {
 | 
			
		||||
  return request<GetExaminationItemRsp>({
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/der2/services/exam/getExaminationItem.ws',
 | 
			
		||||
    data: `<getExaminationItemReq>
 | 
			
		||||
             <head>
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										17
									
								
								entry/src/main/ets/common/service/ExaminerService.ets
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								entry/src/main/ets/common/service/ExaminerService.ets
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,17 @@
 | 
			
		||||
 | 
			
		||||
//考官登录信息
 | 
			
		||||
// export async function examinerLoginService(params) {
 | 
			
		||||
//   let res: any = await examinerLogin(params)
 | 
			
		||||
//   AppStorage.setOrCreate('examinerInfo', res?.examinerLoginRsp?.body)
 | 
			
		||||
//   console.log('jiangsong1: examinerLoginService' + JSON.stringify(res))
 | 
			
		||||
//   //{"examinerLoginRsp":{"head":{"resultCode":"0","resultMessage":"%E8%80%83%E8%AF%95%E5%91%98%E7%99%BB%E5%BD%95-%E6%88%90%E5%8A%9F","time":"2023-06-01 10:06:39"},"body":{"code":"006","name":"%E8%80%836","statusRgpp":"1"}}}
 | 
			
		||||
//   return res
 | 
			
		||||
// }
 | 
			
		||||
 | 
			
		||||
//获取考车信息
 | 
			
		||||
// export async function initParseCarInfo(params) {
 | 
			
		||||
//   let res: any = await initCarInfoCache(params)
 | 
			
		||||
//   console.log('jiangsong1: examinerLoginService' + JSON.stringify(res))
 | 
			
		||||
//   //{"examinerLoginRsp":{"head":{"resultCode":"0","resultMessage":"%E8%80%83%E8%AF%95%E5%91%98%E7%99%BB%E5%BD%95-%E6%88%90%E5%8A%9F","time":"2023-06-01 10:06:39"},"body":{"code":"006","name":"%E8%80%836","statusRgpp":"1"}}}
 | 
			
		||||
//   return res
 | 
			
		||||
// }
 | 
			
		||||
@ -1,8 +1,10 @@
 | 
			
		||||
// @ts-nocheck
 | 
			
		||||
import promptAction from '@ohos.promptAction'
 | 
			
		||||
import router from '@ohos.router'
 | 
			
		||||
import { dateFormat } from '../utils/tools'
 | 
			
		||||
import FileUtil from '../../common/utils/File'
 | 
			
		||||
import { deleteAllFileByPiC, takePhoto } from '../../service/videoService'
 | 
			
		||||
// import { VideoConfigData } from '../../mock';
 | 
			
		||||
import {
 | 
			
		||||
  delSyncTable,
 | 
			
		||||
  getDataBaseTable,
 | 
			
		||||
@ -88,6 +90,7 @@ export async function setVideoParam() {
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
let fileFd
 | 
			
		||||
 | 
			
		||||
//配置流水号
 | 
			
		||||
export async function setliushuiNum() {
 | 
			
		||||
@ -274,6 +277,7 @@ export async function takePhotoFn(context) {
 | 
			
		||||
  }, 3000)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
let fd
 | 
			
		||||
const devPath = "/dev/ttyS3"
 | 
			
		||||
let chuankoufd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										48
									
								
								entry/src/main/ets/common/service/terminalService.ets
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								entry/src/main/ets/common/service/terminalService.ets
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,48 @@
 | 
			
		||||
import { obtainCarExamInfo } from '../../api/index'
 | 
			
		||||
import { dateFormat } from '../utils/tools'
 | 
			
		||||
import promptAction from '@ohos.promptAction'
 | 
			
		||||
import { GlobalConfig } from '../../config/index'
 | 
			
		||||
import FileUtil from '../../common/utils/File'
 | 
			
		||||
 | 
			
		||||
//获取设备信息
 | 
			
		||||
export async function getDeviceInfo(context) {
 | 
			
		||||
  return new Promise(async (resolve, reject) => {
 | 
			
		||||
    const fileUtil = new FileUtil(context)
 | 
			
		||||
    const data = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + '/config/deviceNo.txt');
 | 
			
		||||
    if (data === '' || data === undefined) {
 | 
			
		||||
      promptAction.showToast({
 | 
			
		||||
        message: `请先进行设备注册`,
 | 
			
		||||
        duration: 3000
 | 
			
		||||
      });
 | 
			
		||||
      AppStorage.setOrCreate('type', 1)
 | 
			
		||||
      AppStorage.setOrCreate('title', '请先进行设备注册')
 | 
			
		||||
      globalThis.errorDialog.open()
 | 
			
		||||
      resolve('')
 | 
			
		||||
    } else {
 | 
			
		||||
      const fileData = JSON.parse(data)
 | 
			
		||||
 | 
			
		||||
      AppStorage.setOrCreate('deviceNo', fileData.deviceName)
 | 
			
		||||
      // getCarInfo()
 | 
			
		||||
      resolve(fileData.deviceName)
 | 
			
		||||
    }
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//获取考车信息
 | 
			
		||||
export async function getCarInfo() {
 | 
			
		||||
  let date = new Date();
 | 
			
		||||
 | 
			
		||||
  let params = { time: dateFormat(date), deviceNo: AppStorage.get('deviceNo') };
 | 
			
		||||
  let res: any = await obtainCarExamInfo(params)
 | 
			
		||||
  if (!res?.obtainCarExamInfoRsp?.body) {
 | 
			
		||||
    // router.pushUrl({
 | 
			
		||||
    //     url: 'pages/Register',
 | 
			
		||||
    // }, router.RouterMode.Single);
 | 
			
		||||
  } else {
 | 
			
		||||
    const carInfo=res.obtainCarExamInfoRsp.body
 | 
			
		||||
    carInfo.plateNo= decodeURIComponent(carInfo.plateNo)
 | 
			
		||||
    AppStorage.setOrCreate('carInfo',carInfo)
 | 
			
		||||
 | 
			
		||||
  }
 | 
			
		||||
  return res
 | 
			
		||||
}
 | 
			
		||||
@ -93,5 +93,4 @@ export interface BaseInfoType {
 | 
			
		||||
export interface RouteParamsType {
 | 
			
		||||
  sczb?: string;
 | 
			
		||||
  kfdm?: string;
 | 
			
		||||
  type?: string;
 | 
			
		||||
}
 | 
			
		||||
@ -88,7 +88,6 @@ interface JudgeFile {
 | 
			
		||||
 | 
			
		||||
/** 考试过程数据 */
 | 
			
		||||
export interface DrvexamType extends BaseExamFields {
 | 
			
		||||
  lsh?: string;
 | 
			
		||||
  zp?: string;
 | 
			
		||||
  sbxh?: string;
 | 
			
		||||
  kffs?: string;
 | 
			
		||||
@ -96,7 +95,4 @@ export interface DrvexamType extends BaseExamFields {
 | 
			
		||||
  kfxm?: string;
 | 
			
		||||
  kfxmmx?: string;
 | 
			
		||||
  ghks?: string;
 | 
			
		||||
  ksxtbh?: string;
 | 
			
		||||
  ksysfzmhm?: string;
 | 
			
		||||
  Ksy2sfzmhm?: string;
 | 
			
		||||
}
 | 
			
		||||
@ -78,16 +78,4 @@ export interface InitializeTheCentralTableType {
 | 
			
		||||
  host?: string
 | 
			
		||||
  videoVersion?: string
 | 
			
		||||
  context?: common.UIAbilityContext
 | 
			
		||||
  mode?: string
 | 
			
		||||
  paraKdid?: string
 | 
			
		||||
  kdid?: string
 | 
			
		||||
  centerHost?: string
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 以下是各个表的类型
 | 
			
		||||
export interface MASYSSETTableType {
 | 
			
		||||
  id?: string
 | 
			
		||||
  v_no?: string
 | 
			
		||||
  v_name?: string
 | 
			
		||||
  v_value?: string
 | 
			
		||||
}
 | 
			
		||||
@ -1,5 +1,3 @@
 | 
			
		||||
import { DrvexamType } from ".";
 | 
			
		||||
 | 
			
		||||
export interface RegistrationDeviceNoRsp {
 | 
			
		||||
  registrationDeviceNoRsp: RegistrationDeviceNoRspDetails;
 | 
			
		||||
}
 | 
			
		||||
@ -19,12 +17,9 @@ interface ImageCompareRsp {
 | 
			
		||||
  body: ESObject
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface GetExaminationStudentInfoResponse {
 | 
			
		||||
  getExaminationStudentInfoRsp: ImageCompareRsp
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface FaceCompareResp {
 | 
			
		||||
  imageCompareRsp?: ImageCompareRsp
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface ResponseDataType {
 | 
			
		||||
@ -39,9 +34,6 @@ export interface ExaminerLoginInfo {
 | 
			
		||||
  username?: string;
 | 
			
		||||
  kgxm?: string;
 | 
			
		||||
  ksyh?: string;
 | 
			
		||||
  plateNo?: string
 | 
			
		||||
  isNeedCheck?: string
 | 
			
		||||
  examSubject?: string
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface SpzdType {
 | 
			
		||||
@ -85,36 +77,3 @@ interface CarConfigurationInfoResponseBody {
 | 
			
		||||
interface ES_CHECK_CAR_ITEMItem {
 | 
			
		||||
  ITEMS: string;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface ObtainCarExamInfoParams {
 | 
			
		||||
  time: string
 | 
			
		||||
  deviceNo: string
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//监管接口参数
 | 
			
		||||
export interface RegulatoryInterfaceParams {
 | 
			
		||||
  xtlb?: string;
 | 
			
		||||
  jkxlh?: string;
 | 
			
		||||
  jkid?: string;
 | 
			
		||||
  drvexam?: DrvexamType
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface BeginExamRequest {
 | 
			
		||||
  keystr?: string;
 | 
			
		||||
  message?: string | Resource;
 | 
			
		||||
  code?: number
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// { getExaminationItemRsp: { body: { ykxx: '' } } }
 | 
			
		||||
export interface GetExaminationItemRsp {
 | 
			
		||||
  getExaminationItemRsp: GetExaminationItemRspDetails
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
interface GetExaminationItemRspDetails {
 | 
			
		||||
  head?: Head;
 | 
			
		||||
  body: GetExaminationItemRspBody;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
interface GetExaminationItemRspBody {
 | 
			
		||||
  ykxx: string;
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
import common from '@ohos.app.ability.common';
 | 
			
		||||
import router from '@ohos.router';
 | 
			
		||||
 | 
			
		||||
import { getCarInfo, getDeviceInfo } from '../common/service/terminalService';
 | 
			
		||||
import { getCurrentTime, setCurrentTime, string2Bytes } from '../common/utils/tools';
 | 
			
		||||
import { FileHelper } from '../common/service/FileHelper';
 | 
			
		||||
import { getEsCarModel, getSyncData, } from '../common/service/initable';
 | 
			
		||||
@ -14,16 +14,15 @@ import abilityAccessCtrl, { Permissions } from '@ohos.abilityAccessCtrl';
 | 
			
		||||
import promptAction from '@ohos.promptAction';
 | 
			
		||||
import errorMsgDialog from './compontents/errorMsgDialog';
 | 
			
		||||
import GetDistance from '../common/utils/GetDistance';
 | 
			
		||||
import UdpEvent from '../common/utils/UdpEvent';
 | 
			
		||||
import { delPic } from '../service/videoService';
 | 
			
		||||
import imageBtn from './compontents/imageBtn';
 | 
			
		||||
import VoiceAnnounce from './judgeSDK/utils/voiceAnnouncements';
 | 
			
		||||
import { BaseInfoType } from '../model/Common';
 | 
			
		||||
import { CarInfoType } from '../model/CarCheck';
 | 
			
		||||
import { InitializeTheCentralTableType, MASYSSETTableType, TimeInfo } from '../model';
 | 
			
		||||
import { GetCarInfo, GetDeviceInfo, UseAuth } from './Index/utils';
 | 
			
		||||
import { GetSyncData, InitializeTheCentralTable } from '../utils/table/Operation';
 | 
			
		||||
import { BusinessError } from '@ohos.base';
 | 
			
		||||
import { TimeInfo } from '../model';
 | 
			
		||||
 | 
			
		||||
// import VoiceAnnounce from './judgeSDK/utils/voiceAnnouncements';
 | 
			
		||||
 | 
			
		||||
@Entry
 | 
			
		||||
@Component
 | 
			
		||||
@ -57,7 +56,9 @@ struct Index {
 | 
			
		||||
    alignment: DialogAlignment.Center,
 | 
			
		||||
  },
 | 
			
		||||
  )
 | 
			
		||||
  private fileUtil: FileUtil
 | 
			
		||||
  private interval = -1;
 | 
			
		||||
  // private vocObj = null;
 | 
			
		||||
  private avPlayer: VoiceAnnounce
 | 
			
		||||
  private timeInfo: TimeInfo
 | 
			
		||||
  private context = getContext(this) as common.UIAbilityContext;
 | 
			
		||||
@ -363,20 +364,29 @@ struct Index {
 | 
			
		||||
    this.angle = 0
 | 
			
		||||
    this.loading = false
 | 
			
		||||
    AppStorage.set('lsh', '1111111111111')
 | 
			
		||||
    // TODO 未改
 | 
			
		||||
    // globalThis.errorDialog = this.errorDialog
 | 
			
		||||
    // globalThis.udpEvent = new UdpEvent();
 | 
			
		||||
    GetSyncData<MASYSSETTableType>("MA_SYSSET").then((res: MASYSSETTableType[]) => {
 | 
			
		||||
      res.forEach((element) => {
 | 
			
		||||
        if (element.v_no === "305") {
 | 
			
		||||
          delPic(Number(element.v_value), 1)
 | 
			
		||||
          delPic(Number(element.v_value), 2)
 | 
			
		||||
    globalThis.errorDialog = this.errorDialog
 | 
			
		||||
    globalThis.udpEvent = new UdpEvent();
 | 
			
		||||
    getSyncData('MA_SYSSET').then(async data => {
 | 
			
		||||
      data.forEach(async sys => {
 | 
			
		||||
        //判断是否能点开始考试
 | 
			
		||||
        if (sys.v_no === '305') {
 | 
			
		||||
          console.log('syssyssyssys')
 | 
			
		||||
          // this.delLoading=true
 | 
			
		||||
          // globalThis.param854Str=sys.v_value
 | 
			
		||||
          delPic(Number(sys.v_value), 1)
 | 
			
		||||
          delPic(Number(sys.v_value), 2)
 | 
			
		||||
          // this.delLoading=false
 | 
			
		||||
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
      })
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  aboutToDisappear() {
 | 
			
		||||
    // this.vocObj && this.vocObj.releasePlayer()
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  async testXMLToJSONInWorker() {
 | 
			
		||||
    if (this.loading) {
 | 
			
		||||
      return
 | 
			
		||||
@ -385,13 +395,13 @@ struct Index {
 | 
			
		||||
 | 
			
		||||
    // console.log('mode',mode)
 | 
			
		||||
 | 
			
		||||
    const param: InitializeTheCentralTableType = {
 | 
			
		||||
    const param = {
 | 
			
		||||
      carId: this.carInfo?.carId,
 | 
			
		||||
      examinationRoomId: this.carInfo?.examinationRoomId,
 | 
			
		||||
      judgeVersion: this.baseInfo.judgeVersion,
 | 
			
		||||
      shellVersion: this.baseInfo.version,
 | 
			
		||||
      paraKdid: this.timeInfo?.paraKdid || this.timeInfo?.kdid,
 | 
			
		||||
      kdid: this.timeInfo?.kdid || this.timeInfo?.paraKdid,
 | 
			
		||||
      kdid: this..timeInfo?.kdid || this.timeInfo?.paraKdid,
 | 
			
		||||
      mode: this.timeInfo?.mode,
 | 
			
		||||
      context: this.context,
 | 
			
		||||
      host: AppStorage.get('host'),
 | 
			
		||||
@ -401,16 +411,27 @@ struct Index {
 | 
			
		||||
    this.loading = true
 | 
			
		||||
    console.log("sql 1111")
 | 
			
		||||
 | 
			
		||||
    // getSingleCenterTable(param).then((ret) => {
 | 
			
		||||
    InitializeTheCentralTable(param).then((ret) => {
 | 
			
		||||
    getSingleCenterTable(param).then((ret) => {
 | 
			
		||||
      console.log('teststetfinsh1', ret)
 | 
			
		||||
      // DB.queryListBySql('select * from MA_SYSSET', [{
 | 
			
		||||
      //   name: "v_no",
 | 
			
		||||
      //   type: ColumnType.STRING,
 | 
			
		||||
      //   columnName: "v_no"
 | 
			
		||||
      // }]).then((res) => {
 | 
			
		||||
      //   console.log('sql success', JSON.stringify(res))
 | 
			
		||||
      // }).catch((err) => {
 | 
			
		||||
      //   console.log('sql error1', err)
 | 
			
		||||
      // })
 | 
			
		||||
      if (ret) {
 | 
			
		||||
        GetSyncData<MASYSSETTableType>("MA_SYSSET").then(data => {
 | 
			
		||||
        getSyncData('MA_SYSSET').then(data => {
 | 
			
		||||
          console.log('datadata', JSON.stringify(data))
 | 
			
		||||
          data.forEach(sys => {
 | 
			
		||||
            //判断是否能点开始考试
 | 
			
		||||
            if (sys.v_no === '854') {
 | 
			
		||||
              AppStorage.setOrCreate('param854Str', sys.v_value)
 | 
			
		||||
            }
 | 
			
		||||
            if (sys.v_no === '824' && decodeURIComponent(sys.v_value) == '0') {
 | 
			
		||||
              // this.Param612Str= decodeURIComponent(sys.v_value)
 | 
			
		||||
              router.pushUrl({
 | 
			
		||||
                url: 'pages/CarCheck',
 | 
			
		||||
                params: {
 | 
			
		||||
@ -427,7 +448,47 @@ struct Index {
 | 
			
		||||
 | 
			
		||||
      }
 | 
			
		||||
    })
 | 
			
		||||
 | 
			
		||||
    // workerInstance.postMessage(param);
 | 
			
		||||
    // workerInstance.onmessage = (e: MessageEvents): void => {
 | 
			
		||||
    //   console.log("baoyihu after postMessage :", JSON.stringify(e.data));
 | 
			
		||||
    //   // @ts-ignore
 | 
			
		||||
    //   let workData: WorkData = e.data;
 | 
			
		||||
    //   this.loading = false
 | 
			
		||||
    //   if (workData.isComplete) {
 | 
			
		||||
    //     if(globalThis.singlePlay){
 | 
			
		||||
    //       router.pushUrl({
 | 
			
		||||
    //         url: 'pages/UserInfo',
 | 
			
		||||
    //       }, router.RouterMode.Single)
 | 
			
		||||
    //       return
 | 
			
		||||
    //     }
 | 
			
		||||
    //     getSyncData('MA_SYSSET').then(data => {
 | 
			
		||||
    //       console.log('datadata', JSON.stringify(data))
 | 
			
		||||
    //       // @ts-ignore
 | 
			
		||||
    //       data.forEach(sys => {
 | 
			
		||||
    //         //判断是否能点开始考试
 | 
			
		||||
    //         if(sys.v_no === '854'){
 | 
			
		||||
    //           globalThis.param854Str=sys.v_value
 | 
			
		||||
    //         }
 | 
			
		||||
    //         if (sys.v_no === '824'&&decodeURIComponent(sys.v_value)=='0') {
 | 
			
		||||
    //           // this.Param612Str= decodeURIComponent(sys.v_value)
 | 
			
		||||
    //           router.pushUrl({
 | 
			
		||||
    //             url:'pages/CarCheck',
 | 
			
		||||
    //             params: {
 | 
			
		||||
    //               'fromIndex':true
 | 
			
		||||
    //             }
 | 
			
		||||
    //           }, router.RouterMode.Single)
 | 
			
		||||
    //         }else{
 | 
			
		||||
    //           router.pushUrl({
 | 
			
		||||
    //             url: 'pages/ExaminerLogin',
 | 
			
		||||
    //           }, router.RouterMode.Single)
 | 
			
		||||
    //         }
 | 
			
		||||
    //       })
 | 
			
		||||
    //     });
 | 
			
		||||
    //
 | 
			
		||||
    //   }
 | 
			
		||||
    //   workerInstance.terminate();
 | 
			
		||||
    //
 | 
			
		||||
    // }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  async heartMsg() {
 | 
			
		||||
@ -442,28 +503,24 @@ struct Index {
 | 
			
		||||
    for (let i = 0; i < str.length; i++) {
 | 
			
		||||
      tmpList.push(string2Bytes(str.charCodeAt(i), 1 * 8)[0])
 | 
			
		||||
    }
 | 
			
		||||
    // TODO 未改
 | 
			
		||||
    // const param = {
 | 
			
		||||
    //   id: 31,
 | 
			
		||||
    //   list: tmpList,
 | 
			
		||||
    //   carNo: this.carInfo.carNo,
 | 
			
		||||
    //   placeId: this.carInfo.examinationRoomId
 | 
			
		||||
    // }
 | 
			
		||||
 | 
			
		||||
    const param = {
 | 
			
		||||
      id: 31,
 | 
			
		||||
      list: tmpList,
 | 
			
		||||
      carNo: this.carInfo.carNo,
 | 
			
		||||
      placeId: this.carInfo.examinationRoomId
 | 
			
		||||
    }
 | 
			
		||||
    // globalThis.udpClient2.initHeartSendMsg(param,this.context)
 | 
			
		||||
    // if (globalThis.udpClient2.getStatus()) {
 | 
			
		||||
    //   globalThis.udpClient2.sendMsgExt(param, this.context)
 | 
			
		||||
    // }
 | 
			
		||||
    if (globalThis.udpClient2.getStatus()) {
 | 
			
		||||
      globalThis.udpClient2.sendMsgExt(param, this.context)
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  async onPageShow() {
 | 
			
		||||
    console.log('ttttt', 1111)
 | 
			
		||||
    this.singlePlay = AppStorage.get('singlePlay')
 | 
			
		||||
    this.baseInfo = AppStorage.get('baseInfo') as BaseInfoType
 | 
			
		||||
    // await this.userAuth();
 | 
			
		||||
    UseAuth(this.context).then(() => {
 | 
			
		||||
      this.initParams()
 | 
			
		||||
    }).catch(() => {
 | 
			
		||||
    });
 | 
			
		||||
    await this.userAuth();
 | 
			
		||||
    if (this.singlePlay == undefined || this.singlePlay == null) {
 | 
			
		||||
      // setVideoParam()
 | 
			
		||||
      console.log('diyidiy')
 | 
			
		||||
@ -477,7 +534,7 @@ struct Index {
 | 
			
		||||
          // })
 | 
			
		||||
          // let rawFile = value;
 | 
			
		||||
        })
 | 
			
		||||
        .catch((error: BusinessError) => {
 | 
			
		||||
        .catch(error => {
 | 
			
		||||
          console.log("getRawFileContent promise error is " + error);
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
@ -501,12 +558,45 @@ struct Index {
 | 
			
		||||
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  userAuth() {
 | 
			
		||||
    return new Promise((reslove, reject) => {
 | 
			
		||||
      const permissions: Array<Permissions> =
 | 
			
		||||
        ["ohos.permission.SET_TIME", "ohos.permission.READ_IMAGEVIDEO", "ohos.permission.DISTRIBUTED_DATASYNC",
 | 
			
		||||
          'ohos.permission.CONNECTIVITY_INTERNAL', 'ohos.permission.CAMERA', 'ohos.permission.READ_MEDIA',
 | 
			
		||||
          'ohos.permission.WRITE_MEDIA', 'ohos.permission.FILE_ACCESS_MANAGER'];
 | 
			
		||||
      let context = this.context;
 | 
			
		||||
      let atManager = abilityAccessCtrl.createAtManager();
 | 
			
		||||
      // requestPermissionsFromUser会判断权限的授权状态来决定是否唤起弹窗
 | 
			
		||||
 | 
			
		||||
      atManager.requestPermissionsFromUser(context, permissions).then((data) => {
 | 
			
		||||
        this.initParams()
 | 
			
		||||
        let grantStatus: Array<number> = data.authResults;
 | 
			
		||||
        let length: number = grantStatus.length;
 | 
			
		||||
        for (let i = 0; i < length; i++) {
 | 
			
		||||
          if (grantStatus[i] === 0) {
 | 
			
		||||
            // 用户授权,可以继续访问目标操作
 | 
			
		||||
            reslove(true)
 | 
			
		||||
          } else {
 | 
			
		||||
            reject()
 | 
			
		||||
            // 用户拒绝授权,提示用户必须授权才能访问当前页面的功能,并引导用户到系统设置中打开相应的权限
 | 
			
		||||
            return;
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
        // 授权成功
 | 
			
		||||
      }).catch((err) => {
 | 
			
		||||
        console.error(`Failed to request permissions from user. Code is ${err.code}, message is ${err.message}`);
 | 
			
		||||
      })
 | 
			
		||||
    })
 | 
			
		||||
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  async initParams() {
 | 
			
		||||
    //设置plc udp 同步requesthost
 | 
			
		||||
    await getUDP(this.context, false)
 | 
			
		||||
    this.loading = false
 | 
			
		||||
    await GetDeviceInfo(this.context)
 | 
			
		||||
    await GetCarInfo()
 | 
			
		||||
    await getDeviceInfo(this.context)
 | 
			
		||||
 | 
			
		||||
    await getCarInfo()
 | 
			
		||||
    await getUDP2(this.context, false)
 | 
			
		||||
    getTCP()
 | 
			
		||||
    this.carInfo = AppStorage.get('carInfo')
 | 
			
		||||
@ -536,6 +626,10 @@ struct Index {
 | 
			
		||||
      }
 | 
			
		||||
    }, 1000)
 | 
			
		||||
    this.createAlbum()
 | 
			
		||||
    //下载模型
 | 
			
		||||
    // await this.getModel()
 | 
			
		||||
    // const arr = [0x55, 0xaa, 0x01, 0x00, 0x02, 0x01, 0x03, 0x00]
 | 
			
		||||
    // globalThis.udpClientByTopLine.sendMsg(Array2Byte(arr).buffer)
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  async getModel() {
 | 
			
		||||
 | 
			
		||||
@ -1,71 +0,0 @@
 | 
			
		||||
import common from "@ohos.app.ability.common";
 | 
			
		||||
import FileUtil from "../../common/utils/File";
 | 
			
		||||
import { GlobalConfig } from "../../config";
 | 
			
		||||
import Prompt from "@system.prompt";
 | 
			
		||||
import { CarConfigurationParamsType, ObtainCarExamInfoParams } from "../../model";
 | 
			
		||||
import dayTs from "../../utils/Date";
 | 
			
		||||
import { obtainCarExamInfo } from "../../api";
 | 
			
		||||
import abilityAccessCtrl, { Permissions } from '@ohos.abilityAccessCtrl';
 | 
			
		||||
import { BusinessError } from "@ohos.base";
 | 
			
		||||
 | 
			
		||||
//获取设备信息
 | 
			
		||||
export async function GetDeviceInfo(context: common.UIAbilityContext): Promise<string> {
 | 
			
		||||
  return new Promise(async (resolve, reject) => {
 | 
			
		||||
    const fileUtil = new FileUtil(context)
 | 
			
		||||
    const data = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + '/config/deviceNo.txt');
 | 
			
		||||
    if (data === '' || data === undefined) {
 | 
			
		||||
      Prompt.showToast({
 | 
			
		||||
        message: "请先进行设备注册!",
 | 
			
		||||
        duration: 3000
 | 
			
		||||
      })
 | 
			
		||||
      AppStorage.setOrCreate('type', 1)
 | 
			
		||||
      AppStorage.setOrCreate('title', '请先进行设备注册')
 | 
			
		||||
      resolve("")
 | 
			
		||||
    } else {
 | 
			
		||||
      const fileData: CarConfigurationParamsType = JSON.parse(data)
 | 
			
		||||
      AppStorage.setOrCreate('deviceNo', fileData.deviceName)
 | 
			
		||||
      resolve(fileData.deviceName)
 | 
			
		||||
    }
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export async function GetCarInfo() {
 | 
			
		||||
  let date = new Date();
 | 
			
		||||
  let params: ObtainCarExamInfoParams = {
 | 
			
		||||
    time: dayTs(date).format("YYYY-MM-DD HH:mm:ss"),
 | 
			
		||||
    deviceNo: AppStorage.get('deviceNo')
 | 
			
		||||
  };
 | 
			
		||||
  // TODO 待完善
 | 
			
		||||
  let res: ESObject = await obtainCarExamInfo(params)
 | 
			
		||||
  if (res.obtainCarExamInfoRsp.body) {
 | 
			
		||||
    const carInfo: ESObject = res?.obtainCarExamInfoRsp?.body
 | 
			
		||||
    carInfo.plateNo = decodeURIComponent(carInfo.plateNo)
 | 
			
		||||
    AppStorage.setOrCreate('carInfo', carInfo)
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export async function UseAuth(context: common.UIAbilityContext): Promise<boolean> {
 | 
			
		||||
  return new Promise((resolve, reject) => {
 | 
			
		||||
    const permissions: Array<Permissions> =
 | 
			
		||||
      ["ohos.permission.SET_TIME", "ohos.permission.READ_IMAGEVIDEO", "ohos.permission.DISTRIBUTED_DATASYNC",
 | 
			
		||||
        'ohos.permission.CONNECTIVITY_INTERNAL', 'ohos.permission.CAMERA', 'ohos.permission.READ_MEDIA',
 | 
			
		||||
        'ohos.permission.WRITE_MEDIA', 'ohos.permission.FILE_ACCESS_MANAGER'];
 | 
			
		||||
    abilityAccessCtrl.createAtManager().requestPermissionsFromUser(context, permissions).then(res => {
 | 
			
		||||
      let grantStatus: Array<number> = res.authResults;
 | 
			
		||||
      let length: number = grantStatus.length;
 | 
			
		||||
      for (let i = 0; i < length; i++) {
 | 
			
		||||
        if (grantStatus[i] === 0) {
 | 
			
		||||
          // 用户授权,可以继续访问目标操作
 | 
			
		||||
          resolve(true)
 | 
			
		||||
        } else {
 | 
			
		||||
          reject(false)
 | 
			
		||||
          // 用户拒绝授权,提示用户必须授权才能访问当前页面的功能,并引导用户到系统设置中打开相应的权限
 | 
			
		||||
          return;
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    }).catch((err: BusinessError) => {
 | 
			
		||||
      console.log("获取权限失败", JSON.stringify(err))
 | 
			
		||||
      reject(false)
 | 
			
		||||
    })
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
@ -30,8 +30,7 @@ import { judgeConfig } from './judgeSDK/utils/judgeConfig';
 | 
			
		||||
import FileUtil from '../common/utils/File';
 | 
			
		||||
 | 
			
		||||
import SignDisplayCom from './compontents/signDisplayCom';
 | 
			
		||||
import { CarInfoType, CommonType, KfdmType, User } from '../model';
 | 
			
		||||
import { GetSyncData } from '../utils/table/Operation';
 | 
			
		||||
import { CarInfoType, CommonType, KfdmType } from '../model';
 | 
			
		||||
 | 
			
		||||
@Entry
 | 
			
		||||
@Component
 | 
			
		||||
@ -216,7 +215,7 @@ struct Index {
 | 
			
		||||
 | 
			
		||||
  // 获取考生信息
 | 
			
		||||
  async initStudent() {
 | 
			
		||||
    const students = await GetSyncData<User>('USER')
 | 
			
		||||
    const students = await getSyncData('USER')
 | 
			
		||||
    const stuInfo = students[0] || {};
 | 
			
		||||
    const { xm, sfzmhm, lsh, kszp, ksdd, kssycs, kslx, ksxl, xldm } = stuInfo;
 | 
			
		||||
    this.name = xm || '测试考生';
 | 
			
		||||
 | 
			
		||||
@ -10,7 +10,7 @@ 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 { getSyncData, sqlInsertCommonFn, upDateTableByArray } from '../common/service/initable';
 | 
			
		||||
import { CandidateData, EmptyCandidateObject } from '../mock/CandidateData';
 | 
			
		||||
import BoardPrePareSetPopup from './compontents/judge/BoardPrePareSetPopup';
 | 
			
		||||
import LoadingPopup from './compontents/judge/LoadingPopup';
 | 
			
		||||
@ -21,25 +21,8 @@ import errorMsgDialog from './compontents/errorMsgDialog';
 | 
			
		||||
import imageBtn from './compontents/imageBtn';
 | 
			
		||||
import FileUtil from '../common/utils/File';
 | 
			
		||||
import DB, { ColumnType } from '../common/database/DbSql';
 | 
			
		||||
import {
 | 
			
		||||
  BeginExamRequest,
 | 
			
		||||
  CarInfoType,
 | 
			
		||||
  DrvexamType,
 | 
			
		||||
  ExaminerLoginInfo,
 | 
			
		||||
  GetExaminationItemRsp,
 | 
			
		||||
  IdCard,
 | 
			
		||||
  LabelBlockType,
 | 
			
		||||
  MASYSSETTableType,
 | 
			
		||||
  QKParamType,
 | 
			
		||||
  RegulatoryInterfaceParams,
 | 
			
		||||
  RouteParamsType,
 | 
			
		||||
  SckType,
 | 
			
		||||
  SystemParamType,
 | 
			
		||||
  User
 | 
			
		||||
} from '../model';
 | 
			
		||||
import { CarInfoType, IdCard, LabelBlockType, QKParamType, SckType, SystemParamType, User } from '../model';
 | 
			
		||||
import { BusinessError } from '@ohos.base';
 | 
			
		||||
import { GetSyncData } from '../utils/table/Operation';
 | 
			
		||||
import { GetCurrentUserKeyValue } from './UserInfo/utils';
 | 
			
		||||
 | 
			
		||||
@Entry
 | 
			
		||||
@Component
 | 
			
		||||
@ -225,15 +208,13 @@ struct UserInfo {
 | 
			
		||||
    this.initData()
 | 
			
		||||
    //身份证读卡器初始化
 | 
			
		||||
    // this.openDeviceByIDCard()
 | 
			
		||||
    const routerParam: RouteParamsType = router.getParams() as RouteParamsType
 | 
			
		||||
    const routerParam = router.getParams() || { type: 0 };
 | 
			
		||||
    console.log('routerParam', JSON.stringify(routerParam))
 | 
			
		||||
 | 
			
		||||
    if (!this.singlePlay) {
 | 
			
		||||
      if (routerParam.type != "1") {
 | 
			
		||||
        // this.list = await getSyncData('USERLIST')
 | 
			
		||||
        this.list = await GetSyncData<User>("USERLIST")
 | 
			
		||||
        // const data = await getSyncData('USER')
 | 
			
		||||
        const data = await GetSyncData<User>("USER")
 | 
			
		||||
      if (routerParam.type != 1) {
 | 
			
		||||
        this.list = await getSyncData('USERLIST')
 | 
			
		||||
        const data = await getSyncData('USER')
 | 
			
		||||
        console.log('useruser,', JSON.stringify(this.list))
 | 
			
		||||
        console.log('useruser1,', JSON.stringify(data))
 | 
			
		||||
 | 
			
		||||
@ -290,16 +271,16 @@ struct UserInfo {
 | 
			
		||||
    // }
 | 
			
		||||
    this.sczbkf = [];
 | 
			
		||||
    initJudgeUdp()
 | 
			
		||||
    // TODO UDP更改
 | 
			
		||||
 | 
			
		||||
    //监听远程开始考试
 | 
			
		||||
    // globalThis.udpEvent.onBeginExam(async () => {
 | 
			
		||||
    //   console.info('surenjun', 'userInfo收到UdpEvent事件')
 | 
			
		||||
    //   if (this.isBoardPrePareSetPopupOpen && !this.isFirstBoardPrePareSetPopupBtnShow) {
 | 
			
		||||
    //     await this.prePareSCZB()
 | 
			
		||||
    //   } else {
 | 
			
		||||
    //     await this.prePareExam()
 | 
			
		||||
    //   }
 | 
			
		||||
    // })
 | 
			
		||||
    globalThis.udpEvent.onBeginExam(async () => {
 | 
			
		||||
      console.info('surenjun', 'userInfo收到UdpEvent事件')
 | 
			
		||||
      if (this.isBoardPrePareSetPopupOpen && !this.isFirstBoardPrePareSetPopupBtnShow) {
 | 
			
		||||
        await this.prePareSCZB()
 | 
			
		||||
      } else {
 | 
			
		||||
        await this.prePareExam()
 | 
			
		||||
      }
 | 
			
		||||
    })
 | 
			
		||||
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@ -317,12 +298,12 @@ struct UserInfo {
 | 
			
		||||
 | 
			
		||||
  stopDeviceById() {
 | 
			
		||||
    if (this.faceFlag == '1') {
 | 
			
		||||
      testNapi.StopReadCard()
 | 
			
		||||
      testNapi && testNapi.StopReadCard()
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // 通过身份证获取当前学员
 | 
			
		||||
  async getCurrentStudent(id: string) {
 | 
			
		||||
  async getCurrentStudent(id) {
 | 
			
		||||
    let flag = false
 | 
			
		||||
    // this.pageIndex
 | 
			
		||||
    console.log('currentidid', id)
 | 
			
		||||
@ -339,11 +320,13 @@ struct UserInfo {
 | 
			
		||||
        this.examinerLoginInfo.ksyh = res.ksy1sfzmhm
 | 
			
		||||
        AppStorage.setOrCreate('examinerLoginInfo', this.examinerLoginInfo)
 | 
			
		||||
        AppStorage.setOrCreate('lsh', res.lsh)
 | 
			
		||||
        // const { examSubject } = this.carInfo;
 | 
			
		||||
        const { examSubject } = this.carInfo;
 | 
			
		||||
        // this.currentUser.kszp=this.photo+res.kszp
 | 
			
		||||
        // this.currentUser.ksmjzp=this.photo+this.currentUser.ksmjzp
 | 
			
		||||
        if (this.singlePlay) {
 | 
			
		||||
          this.stopDeviceById()
 | 
			
		||||
          router.pushUrl({
 | 
			
		||||
            url: this.carInfo.examSubject == "3" ? 'pages/Roads' : 'pages/Judge',
 | 
			
		||||
            url: examSubject == 3 ? 'pages/Roads' : 'pages/Judge',
 | 
			
		||||
            params: {
 | 
			
		||||
              sczb: Number(this.isBoardPrePareSetPopupOpen),
 | 
			
		||||
              kfdm: this.sczbkf,
 | 
			
		||||
@ -406,7 +389,7 @@ struct UserInfo {
 | 
			
		||||
      thisVar.address = baseInfos[4];
 | 
			
		||||
      thisVar.idCard = baseInfos[5];
 | 
			
		||||
      setTimeout(() => {
 | 
			
		||||
        this.getCurrentStudent(baseInfos[5])
 | 
			
		||||
        thisVar.getCurrentStudent(baseInfos[5])
 | 
			
		||||
      }, 1000)
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -462,21 +445,20 @@ struct UserInfo {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  async heartMsg() {
 | 
			
		||||
    // TODO UDP缺失
 | 
			
		||||
    // globalThis.udpClient2 & globalThis.udpClient2.setMsgCallBack(async (val) => {
 | 
			
		||||
    //   if (val.id == '32') {
 | 
			
		||||
    //     AppStorage.setOrCreate('signNum', val.body[1])
 | 
			
		||||
    //     if (val.body[0] == '7') {
 | 
			
		||||
    //       //缺考处理
 | 
			
		||||
    //       this.getqkFn()
 | 
			
		||||
    //       this.signNum = val.body[1]
 | 
			
		||||
    //     }
 | 
			
		||||
    //   } else if (val.id == '42') {
 | 
			
		||||
    //     //收到中心缺考确认消息
 | 
			
		||||
    //     console.log('qkfnqkfn', val.body[0])
 | 
			
		||||
    //     this.qkFn()
 | 
			
		||||
    //   }
 | 
			
		||||
    // })
 | 
			
		||||
    globalThis.udpClient2 & globalThis.udpClient2.setMsgCallBack(async (val) => {
 | 
			
		||||
      if (val.id == '32') {
 | 
			
		||||
        AppStorage.setOrCreate('signNum', val.body[1])
 | 
			
		||||
        if (val.body[0] == '7') {
 | 
			
		||||
          //缺考处理
 | 
			
		||||
          this.getqkFn()
 | 
			
		||||
          this.signNum = val.body[1]
 | 
			
		||||
        }
 | 
			
		||||
      } else if (val.id == '42') {
 | 
			
		||||
        //收到中心缺考确认消息
 | 
			
		||||
        console.log('qkfnqkfn', val.body[0])
 | 
			
		||||
        this.qkFn()
 | 
			
		||||
      }
 | 
			
		||||
    })
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  //考点端查询缺考指令内容消息请求
 | 
			
		||||
@ -489,18 +471,16 @@ struct UserInfo {
 | 
			
		||||
      carNo: this.carInfo.carNo as string,
 | 
			
		||||
      placeId: this.carInfo.examinationRoomId as string
 | 
			
		||||
    }
 | 
			
		||||
    // TODO UDP缺失
 | 
			
		||||
    // globalThis.udpClient2.sendMsgExt(param, this.context)
 | 
			
		||||
    globalThis.udpClient2.sendMsgExt(param, this.context)
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  async initSysset() {
 | 
			
		||||
    const that = this;
 | 
			
		||||
    // DB.queryListBySql("select * from MA_SYSSET", ['id', 'v_no', 'v_name', 'v_value'].map(item => ({
 | 
			
		||||
    //   type: ColumnType.STRING,
 | 
			
		||||
    //   name: item,
 | 
			
		||||
    //   columnName: item
 | 
			
		||||
    // }))).then((syssetParams: any) => {
 | 
			
		||||
    GetSyncData<MASYSSETTableType>("MA_SYSSET").then((syssetParams: MASYSSETTableType[]) => {
 | 
			
		||||
    DB.queryListBySql("select * from MA_SYSSET", ['id', 'v_no', 'v_name', 'v_value'].map(item => ({
 | 
			
		||||
      type: ColumnType.STRING,
 | 
			
		||||
      name: item,
 | 
			
		||||
      columnName: item
 | 
			
		||||
    }))).then((syssetParams: any) => {
 | 
			
		||||
      const serialNumberArr = syssetParams.filter(sys => sys.v_no === '901')
 | 
			
		||||
      that.jkxlh = serialNumberArr?.[0]?.v_value || ''
 | 
			
		||||
      const ksxtbhArr = syssetParams.filter(sys => sys.v_no === '902')
 | 
			
		||||
@ -576,9 +556,15 @@ struct UserInfo {
 | 
			
		||||
          if (!Number(this.systemParam.Param305Str)) {
 | 
			
		||||
            that.systemParam.Param305Str = '2'
 | 
			
		||||
          }
 | 
			
		||||
          // console.log('Param305Str',that.systemParam.Param305Str)
 | 
			
		||||
          // delHilog(this.Param305Str)
 | 
			
		||||
          // delPic(that.systemParam.Param305Str,1)
 | 
			
		||||
          // delPic(that.systemParam.Param305Str,2)
 | 
			
		||||
        }
 | 
			
		||||
      })
 | 
			
		||||
 | 
			
		||||
      // faceParam?.[0]?.v_value ||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
      //0不自动更新 1自动更新(不限次数) 2没有考生更新2次
 | 
			
		||||
      if (that.studentRefreshStatue == '2') {
 | 
			
		||||
@ -610,6 +596,14 @@ struct UserInfo {
 | 
			
		||||
        // this.getExaminationItemFn()
 | 
			
		||||
      }
 | 
			
		||||
    })
 | 
			
		||||
    // const db = new AccountTable(() => {
 | 
			
		||||
    // }, MA_SYSSET);
 | 
			
		||||
    // db.getRdbStore(() => {
 | 
			
		||||
    //   db.query('0', (syssetParams) => {
 | 
			
		||||
    //
 | 
			
		||||
    //
 | 
			
		||||
    //   })
 | 
			
		||||
    // })
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  //人脸比对窗口关闭
 | 
			
		||||
@ -671,28 +665,23 @@ struct UserInfo {
 | 
			
		||||
        setTimeout(() => {
 | 
			
		||||
          this.updateTimeLimit = false
 | 
			
		||||
        }, 3000)
 | 
			
		||||
        // @ts-ignore
 | 
			
		||||
        if (!res || res?.getExaminationStudentInfoRsp?.head?.resultCode == '1') {
 | 
			
		||||
          this.dataList = []
 | 
			
		||||
          this.list = []
 | 
			
		||||
          return
 | 
			
		||||
        }
 | 
			
		||||
        let dataList: User[] = []
 | 
			
		||||
        let dataList = []
 | 
			
		||||
        this.list = []
 | 
			
		||||
 | 
			
		||||
        // for (let key in res.getExaminationStudentInfoRsp.body) {
 | 
			
		||||
        //   const a = res.getExaminationStudentInfoRsp.body[key]
 | 
			
		||||
        //   if (a instanceof Array) {
 | 
			
		||||
        //     dataList = a
 | 
			
		||||
        //   } else {
 | 
			
		||||
        //     dataList = [a]
 | 
			
		||||
        //   }
 | 
			
		||||
        // }
 | 
			
		||||
        for (const key of Object.keys(res.getExaminationStudentInfoRsp.body)) {
 | 
			
		||||
          const a: User[] | User = res.getExaminationStudentInfoRsp.body[key];
 | 
			
		||||
          if (Array.isArray(a)) {
 | 
			
		||||
            dataList = a;
 | 
			
		||||
        // @ts-ignore
 | 
			
		||||
        for (let key in res.getExaminationStudentInfoRsp.body) {
 | 
			
		||||
          // @ts-ignore
 | 
			
		||||
          const a = res.getExaminationStudentInfoRsp.body[key]
 | 
			
		||||
          if (a instanceof Array) {
 | 
			
		||||
            dataList = a
 | 
			
		||||
          } else {
 | 
			
		||||
            dataList = [a];
 | 
			
		||||
            dataList = [a]
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
        if (dataList.length) {
 | 
			
		||||
@ -709,10 +698,9 @@ struct UserInfo {
 | 
			
		||||
            this.startExam = true
 | 
			
		||||
          }
 | 
			
		||||
          listData.id = index.toString()
 | 
			
		||||
          // TODO 需要修改
 | 
			
		||||
          // for (let i in listData) {
 | 
			
		||||
          //   listData[i] = decodeURI(listData[i])
 | 
			
		||||
          // }
 | 
			
		||||
          for (let i in listData) {
 | 
			
		||||
            listData[i] = decodeURI(listData[i])
 | 
			
		||||
          }
 | 
			
		||||
          if (this.systemParam.Param828Str == '1' || this.systemParam.Param828Str == '2') {
 | 
			
		||||
            // listData.ksy2=listData.ksy1;
 | 
			
		||||
            listData.ksy2 = this.examinerLoginInfo.kgxm
 | 
			
		||||
@ -759,13 +747,12 @@ struct UserInfo {
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        this.pageIndex = 0
 | 
			
		||||
        // getSyncData('USER').then(data => {
 | 
			
		||||
        GetSyncData<User>("USER").then(data => {
 | 
			
		||||
        getSyncData('USER').then(data => {
 | 
			
		||||
          if (data?.[0]) {
 | 
			
		||||
            this.getCurrentStudent(data[0].sfzmhm)
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
      }).catch((error: BusinessError) => {
 | 
			
		||||
      }).catch((error) => {
 | 
			
		||||
        this.updateTimeLimit = false
 | 
			
		||||
        this.errorDialog.close()
 | 
			
		||||
        console.log('error12error' + error)
 | 
			
		||||
@ -806,6 +793,7 @@ struct UserInfo {
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      globalThis.udpClient2.sendMsgExt(param, this.context)
 | 
			
		||||
      // @ts-ignore
 | 
			
		||||
      if (res.examinationStuAbsentRsp.head.resultCode == '0') {
 | 
			
		||||
        this.pageIndex = 0
 | 
			
		||||
        this.qkFlag = false
 | 
			
		||||
@ -823,14 +811,15 @@ struct UserInfo {
 | 
			
		||||
    if (!this.currentUser.lsh || this.singlePlay) {
 | 
			
		||||
      return
 | 
			
		||||
    }
 | 
			
		||||
    // const { carId, examinationRoomId } = this.carInfo;
 | 
			
		||||
    const { carId, examinationRoomId } = this.carInfo;
 | 
			
		||||
    const examItems = await getExaminationItem({
 | 
			
		||||
      time: await getCurrentTime() || "",
 | 
			
		||||
      carId: this.carInfo.carId,
 | 
			
		||||
      time: getCurrentTime(),
 | 
			
		||||
      carId,
 | 
			
		||||
      lsh: this.currentUser.lsh || '',
 | 
			
		||||
      examinationRoomId: this.carInfo.examinationRoomId
 | 
			
		||||
      examinationRoomId
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    // @ts-ignore
 | 
			
		||||
    if (examItems?.getExaminationItemRsp?.body?.kssycs != 0) {
 | 
			
		||||
      this.getExaminationStudentInfoFn()
 | 
			
		||||
    } else {
 | 
			
		||||
@ -843,14 +832,16 @@ struct UserInfo {
 | 
			
		||||
  async sfbdinterfaceFn() {
 | 
			
		||||
    AppStorage.setOrCreate('statue', 4)
 | 
			
		||||
    this.stepFlag = true
 | 
			
		||||
    let examItems: GetExaminationItemRsp = { getExaminationItemRsp: { body: { ykxx: '' } } };
 | 
			
		||||
    const { carId, examinationRoomId } = this.carInfo;
 | 
			
		||||
    let examItems = { getExaminationItemRsp: { body: { ykxx: '' } } };
 | 
			
		||||
    if (!this.singlePlay) {
 | 
			
		||||
      //获取已考项目
 | 
			
		||||
      // @ts-ignore
 | 
			
		||||
      examItems = await getExaminationItem({
 | 
			
		||||
        time: await getCurrentTime(),
 | 
			
		||||
        carId: this.carInfo.carId,
 | 
			
		||||
        time: getCurrentTime(),
 | 
			
		||||
        carId,
 | 
			
		||||
        lsh: this.currentUser.lsh || '',
 | 
			
		||||
        examinationRoomId: this.carInfo.examinationRoomId
 | 
			
		||||
        examinationRoomId
 | 
			
		||||
      });
 | 
			
		||||
    }
 | 
			
		||||
    this.currentUser.id = '1'
 | 
			
		||||
@ -859,17 +850,17 @@ struct UserInfo {
 | 
			
		||||
 | 
			
		||||
    avPlayer.playAudio([`voice/监管通信中.mp3`], false, async () => {
 | 
			
		||||
      console.info('surenjun', '播放结束开始考试接口调用')
 | 
			
		||||
      // const { code, keystr, message } = await this.beginExam() || {};
 | 
			
		||||
      const res = await this.beginExam()
 | 
			
		||||
      const { code, keystr, message } = await this.beginExam() || {};
 | 
			
		||||
      console.info('surenjun', '开始考试接口调用结束')
 | 
			
		||||
      //TODO code转换
 | 
			
		||||
      // console.info('surenjun',code +'')
 | 
			
		||||
      //@ts-ignore TODO code转换
 | 
			
		||||
 | 
			
		||||
      if (res.code != 1) {
 | 
			
		||||
        avPlayer.playAudio([res.code == -200 ? 'voice/photo_error.mp3' : 'voice/监管审核未通过.mp3']);
 | 
			
		||||
      if (code != 1) {
 | 
			
		||||
        avPlayer.playAudio([code == -200 ? 'voice/photo_error.mp3' : 'voice/监管审核未通过.mp3']);
 | 
			
		||||
        this.isLoadingPopupVisible = false
 | 
			
		||||
        this.isExamStart = false
 | 
			
		||||
        promptAction.showToast({
 | 
			
		||||
          message: res.message,
 | 
			
		||||
          message,
 | 
			
		||||
          duration: 4000
 | 
			
		||||
        })
 | 
			
		||||
        return
 | 
			
		||||
@ -885,7 +876,7 @@ struct UserInfo {
 | 
			
		||||
          sczb: Number(this.isBoardPrePareSetPopupOpen),
 | 
			
		||||
          kfdm: this.sczbkf,
 | 
			
		||||
          //真实监管项目
 | 
			
		||||
          kString: decodeURIComponent(res.keystr || '')
 | 
			
		||||
          kString: decodeURIComponent(keystr || '')
 | 
			
		||||
        }
 | 
			
		||||
      }, router.RouterMode.Single);
 | 
			
		||||
      this.updateTimeLimit = false
 | 
			
		||||
@ -896,21 +887,19 @@ struct UserInfo {
 | 
			
		||||
 | 
			
		||||
  // 检测车门、熄火信号
 | 
			
		||||
  async checkSignal(): Promise<boolean> {
 | 
			
		||||
    // const { isCheckFireOpen } = judgeConfig
 | 
			
		||||
    // const { systemParam } = this;
 | 
			
		||||
    const Param803Str = this.systemParam.Param803Str
 | 
			
		||||
    const { isCheckFireOpen } = judgeConfig
 | 
			
		||||
    const { systemParam, isBoardPrePareSetPopupOpen } = this;
 | 
			
		||||
    const Param803Str = systemParam.Param803Str
 | 
			
		||||
    if (Param803Str === '') {
 | 
			
		||||
      return true
 | 
			
		||||
    }
 | 
			
		||||
    return new Promise((resolve, reject) => {
 | 
			
		||||
      if (judgeConfig.isCheckFireOpen) {
 | 
			
		||||
      if (isCheckFireOpen) {
 | 
			
		||||
        resolve(true)
 | 
			
		||||
        return
 | 
			
		||||
      }
 | 
			
		||||
      // TODO UDP缺失
 | 
			
		||||
      // let plcValue = globalThis.udpClient.getCurrentMessage();
 | 
			
		||||
      let plcValue = "";
 | 
			
		||||
      const msgArr = plcValue.split(',').map(Number) || ''
 | 
			
		||||
      let plcValue = globalThis.udpClient.getCurrentMessage();
 | 
			
		||||
      const msgArr = plcValue.split(',') || ''
 | 
			
		||||
      const mkg = msgArr[14];
 | 
			
		||||
      const fdjzs = msgArr[25];
 | 
			
		||||
      const aqd = msgArr[19];
 | 
			
		||||
@ -958,7 +947,7 @@ struct UserInfo {
 | 
			
		||||
 | 
			
		||||
        }
 | 
			
		||||
        //请点火
 | 
			
		||||
        if (fdjzs <= 0 && Param803Str.includes('5')) {
 | 
			
		||||
        if (fdjzs * 1 <= 0 && Param803Str.includes('5')) {
 | 
			
		||||
          this.avPlayer.playAudio(['voice/点火.mp3'])
 | 
			
		||||
          promptAction.showToast({
 | 
			
		||||
            message: '请点火',
 | 
			
		||||
@ -980,7 +969,7 @@ struct UserInfo {
 | 
			
		||||
      // if (isBoardPrePareSetPopupOpen) {
 | 
			
		||||
      if (false) {
 | 
			
		||||
        //请熄火
 | 
			
		||||
        if (fdjzs > 0) {
 | 
			
		||||
        if (fdjzs * 1 > 0) {
 | 
			
		||||
          this.avPlayer.playAudio(['voice/熄火.mp3'])
 | 
			
		||||
          promptAction.showToast({
 | 
			
		||||
            message: '请熄火',
 | 
			
		||||
@ -1002,8 +991,9 @@ struct UserInfo {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // 开始考试
 | 
			
		||||
  async beginExam(): Promise<BeginExamRequest> {
 | 
			
		||||
    // const { examSubject, plateNo } = this.carInfo;
 | 
			
		||||
  async beginExam() {
 | 
			
		||||
    const { carId, examinationRoomId } = this.carInfo;
 | 
			
		||||
    const { examSubject, plateNo } = this.carInfo;
 | 
			
		||||
    const date = new Date()
 | 
			
		||||
    const startHourTime = await getCurrentHourTime()
 | 
			
		||||
    AppStorage.setOrCreate('startHourTime', startHourTime)
 | 
			
		||||
@ -1013,19 +1003,19 @@ struct UserInfo {
 | 
			
		||||
      this.isLoadingPopupVisible = false
 | 
			
		||||
      return { code: -200 }
 | 
			
		||||
    }
 | 
			
		||||
    const drvexam: DrvexamType = {
 | 
			
		||||
      lsh: "this.currentUser.lsh",
 | 
			
		||||
      kskm: this.carInfo.examSubject,
 | 
			
		||||
    const drvexam = {
 | 
			
		||||
      lsh: this.currentUser.lsh || '',
 | 
			
		||||
      kskm: examSubject,
 | 
			
		||||
      ksxtbh: this.ksxtbh || '222',
 | 
			
		||||
      sfzmhm: this.currentUser.sfzmhm || '',
 | 
			
		||||
      ksysfzmhm: this.currentUser.ksy1sfzmhm || '',
 | 
			
		||||
      ksxl: this.currentUser.xldm,
 | 
			
		||||
      zp: photoBase64,
 | 
			
		||||
      kssj: dateFormat(date) || '',
 | 
			
		||||
      kchp: decodeURI(this.carInfo.plateNo),
 | 
			
		||||
      kchp: decodeURI(plateNo),
 | 
			
		||||
      Ksy2sfzmhm: this.currentUser.ksy2sfzmhm || ''
 | 
			
		||||
    }
 | 
			
		||||
    const param: RegulatoryInterfaceParams = {
 | 
			
		||||
    const param = {
 | 
			
		||||
      drvexam,
 | 
			
		||||
      xtlb: '17',
 | 
			
		||||
      //接口序列号
 | 
			
		||||
@ -1049,7 +1039,7 @@ struct UserInfo {
 | 
			
		||||
      this.currentUser.id = '0'
 | 
			
		||||
      DB.insertData("USER", this.currentUser).then(res => {
 | 
			
		||||
        console.log("USER insert success",)
 | 
			
		||||
      }).catch((err: BusinessError) => {
 | 
			
		||||
      }).catch(err => {
 | 
			
		||||
        console.log("USER insert fail", JSON.stringify(err))
 | 
			
		||||
      })
 | 
			
		||||
      // await upDateTableByArray('USER', [this.currentUser])
 | 
			
		||||
@ -1072,9 +1062,8 @@ struct UserInfo {
 | 
			
		||||
  outClick() {
 | 
			
		||||
    clearInterval(this.interval)
 | 
			
		||||
    this.stopDeviceById()
 | 
			
		||||
    // TODO 缺失UDP
 | 
			
		||||
    // globalThis.udpClient2 && globalThis.udpClient2?.setMsgCallBack(() => {
 | 
			
		||||
    // })
 | 
			
		||||
    globalThis.udpClient2 && globalThis.udpClient2?.setMsgCallBack(() => {
 | 
			
		||||
    })
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // 几个按钮公共样式
 | 
			
		||||
@ -1093,7 +1082,7 @@ struct UserInfo {
 | 
			
		||||
      TopLogo({ outFlag: $outFlag }).margin({ bottom: 10 })
 | 
			
		||||
      Row() {
 | 
			
		||||
        Row() {
 | 
			
		||||
          ForEach(this.dataList, (item: User) => {
 | 
			
		||||
          ForEach(this.dataList, (item) => {
 | 
			
		||||
            Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
 | 
			
		||||
              Column() {
 | 
			
		||||
                CommText({
 | 
			
		||||
@ -1148,10 +1137,10 @@ struct UserInfo {
 | 
			
		||||
      Flex({ justifyContent: FlexAlign.SpaceBetween }) {
 | 
			
		||||
        Row() {
 | 
			
		||||
          Column() {
 | 
			
		||||
            if (this.currentUser.kszp) {
 | 
			
		||||
            if (this.currentUser['kszp']) {
 | 
			
		||||
              Avatar({
 | 
			
		||||
                ratio: this.ratio,
 | 
			
		||||
                url: this.currentUser.kszp ? this.currentUser.kszp : ''
 | 
			
		||||
                url: this.currentUser['kszp'] ? this.currentUser['kszp'] : ''
 | 
			
		||||
              })
 | 
			
		||||
            } else {
 | 
			
		||||
              Avatar({
 | 
			
		||||
@ -1159,10 +1148,10 @@ struct UserInfo {
 | 
			
		||||
                url: ""
 | 
			
		||||
              })
 | 
			
		||||
            }
 | 
			
		||||
            if (this.currentUser.ksmjzp) {
 | 
			
		||||
            if (this.currentUser['ksmjzp']) {
 | 
			
		||||
              Avatar({
 | 
			
		||||
                ratio: this.ratio,
 | 
			
		||||
                url: this.currentUser.ksmjzp ? this.currentUser.ksmjzp : ''
 | 
			
		||||
                url: this.currentUser['ksmjzp'] ? this.currentUser['ksmjzp'] : ''
 | 
			
		||||
              })
 | 
			
		||||
            } else {
 | 
			
		||||
 | 
			
		||||
@ -1174,12 +1163,8 @@ struct UserInfo {
 | 
			
		||||
          }
 | 
			
		||||
 | 
			
		||||
          Column() {
 | 
			
		||||
            ForEach(this.labelBlocks, (item: LabelBlockType) => {
 | 
			
		||||
              LabelBlock({
 | 
			
		||||
                label: item.label,
 | 
			
		||||
                ratio: this.ratio,
 | 
			
		||||
                value: GetCurrentUserKeyValue(this.currentUser, item.key)
 | 
			
		||||
              })
 | 
			
		||||
            ForEach(this.labelBlocks, (item) => {
 | 
			
		||||
              LabelBlock({ label: item.label, ratio: this.ratio, value: this.currentUser[item.key] })
 | 
			
		||||
            })
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
@ -1299,10 +1284,10 @@ struct UserInfo {
 | 
			
		||||
      // 上车准备弹窗
 | 
			
		||||
      if (this.isBoardPrePareSetPopupShow) {
 | 
			
		||||
        BoardPrePareSetPopup({
 | 
			
		||||
          closePopup: () => {
 | 
			
		||||
          closePopup: (bool) => {
 | 
			
		||||
            this.isBoardPrePareSetPopupShow = false;
 | 
			
		||||
          },
 | 
			
		||||
          confirmMark: (kfdm: SckType[]) => {
 | 
			
		||||
          confirmMark: (kfdm) => {
 | 
			
		||||
            this.sczbkf = kfdm
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
 | 
			
		||||
@ -1,54 +0,0 @@
 | 
			
		||||
import { User } from "../../model";
 | 
			
		||||
 | 
			
		||||
export const GetCurrentUserKeyValue = (user: User, key: string): string => {
 | 
			
		||||
  switch (key) {
 | 
			
		||||
    case "sfzmhm":
 | 
			
		||||
      return user.sfzmhm;
 | 
			
		||||
    case "xm":
 | 
			
		||||
      return user.xm;
 | 
			
		||||
    case "lsh":
 | 
			
		||||
      return user.lsh;
 | 
			
		||||
    case "ksy1":
 | 
			
		||||
      return user.ksy1;
 | 
			
		||||
    case "ksy2":
 | 
			
		||||
      return user.ksy2;
 | 
			
		||||
    case "id":
 | 
			
		||||
      return user.id;
 | 
			
		||||
    case "kszp":
 | 
			
		||||
      return user.kszp;
 | 
			
		||||
    case "ksmjzp":
 | 
			
		||||
      return user.ksmjzp;
 | 
			
		||||
    case "bz1":
 | 
			
		||||
      return user.bz1;
 | 
			
		||||
    case "jxmc":
 | 
			
		||||
      return user.jxmc;
 | 
			
		||||
    case "kchp":
 | 
			
		||||
      return user.kchp;
 | 
			
		||||
    case "kscx":
 | 
			
		||||
      return user.kscx;
 | 
			
		||||
    case "ksdd":
 | 
			
		||||
      return user.ksdd;
 | 
			
		||||
    case "kssycs":
 | 
			
		||||
      return user.kssycs;
 | 
			
		||||
    case "ksxl":
 | 
			
		||||
      return user.ksxl;
 | 
			
		||||
    case "ksy1sfzmhm":
 | 
			
		||||
      return user.ksy1sfzmhm;
 | 
			
		||||
    case "kszt":
 | 
			
		||||
      return user.kszt;
 | 
			
		||||
    case "xb":
 | 
			
		||||
      return user.xb;
 | 
			
		||||
    case "xh":
 | 
			
		||||
      return user.xh;
 | 
			
		||||
    case "xldm":
 | 
			
		||||
      return user.xldm;
 | 
			
		||||
    case "yycs":
 | 
			
		||||
      return user.yycs;
 | 
			
		||||
    case "ksy2sfzmhm":
 | 
			
		||||
      return user.ksy2sfzmhm;
 | 
			
		||||
    case "kslx":
 | 
			
		||||
      return user.kslx || '';
 | 
			
		||||
    default:
 | 
			
		||||
      return '';
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -7,7 +7,6 @@ import { FileHelper } from '../common/service/FileHelper';
 | 
			
		||||
import FileUtil from '../common/utils/File';
 | 
			
		||||
import { GlobalConfig } from '../config';
 | 
			
		||||
import promptAction from '@ohos.promptAction';
 | 
			
		||||
import common from '@ohos.app.ability.common';
 | 
			
		||||
 | 
			
		||||
const rtsp_server = record.createServer();
 | 
			
		||||
//开始录屏
 | 
			
		||||
@ -83,7 +82,7 @@ export async function endRecordVideo(record_handleObj) {
 | 
			
		||||
 | 
			
		||||
export async function saveStartRecordVideo(path) {
 | 
			
		||||
  return new Promise(async (reslove, reject) => {
 | 
			
		||||
    const context = AppStorage.get('context')
 | 
			
		||||
    const context=AppStorage.get('context')
 | 
			
		||||
    const fileUtil = new FileUtil(context)
 | 
			
		||||
    const fileHelper = new FileHelper();
 | 
			
		||||
    const date = dateFormat(new Date).split(' ')[0]
 | 
			
		||||
@ -111,7 +110,7 @@ export async function saveStartRecordVideo(path) {
 | 
			
		||||
async function getfilehandleCode(td, param, dir, path, index) {
 | 
			
		||||
  return new Promise(async (reslove, reject) => {
 | 
			
		||||
    console.log('pathpath1', path)
 | 
			
		||||
    const context = AppStorage.get('context')
 | 
			
		||||
    const context=AppStorage.get('context')
 | 
			
		||||
 | 
			
		||||
    const record_handle = await startRecordVideo(param, td, context, dir, path, index)
 | 
			
		||||
    // this.rocordHandleObj['rocord_handle'+td] = record_handle
 | 
			
		||||
@ -133,7 +132,7 @@ export async function getUserAlbumItemByDisplayName(displayName: string, day?,
 | 
			
		||||
      fetchColumns: [],
 | 
			
		||||
      predicates: predicates
 | 
			
		||||
    };
 | 
			
		||||
    const context = AppStorage.get('context')
 | 
			
		||||
    const context=AppStorage.get('context')
 | 
			
		||||
    const userFileMgr = photoAccessHelper.getPhotoAccessHelper(context);
 | 
			
		||||
 | 
			
		||||
    fetchResult =
 | 
			
		||||
@ -183,8 +182,8 @@ interface takePhotoParam {
 | 
			
		||||
 */
 | 
			
		||||
const fileHelper = new FileHelper();
 | 
			
		||||
 | 
			
		||||
export async function delPic(day: number, type: number) {
 | 
			
		||||
  const context: common.UIAbilityContext = AppStorage.get('context')
 | 
			
		||||
export async function delPic(day, type) {
 | 
			
		||||
  const context=AppStorage.get('context')
 | 
			
		||||
  let phAccessHelper = photoAccessHelper.getPhotoAccessHelper(context);
 | 
			
		||||
  console.info('albumGetAssetsDemoCallback');
 | 
			
		||||
  let predicates: dataSharePredicates.DataSharePredicates = new dataSharePredicates.DataSharePredicates();
 | 
			
		||||
@ -256,7 +255,7 @@ export async function takePhoto(param, context, dir, flag = 1, callback?) {
 | 
			
		||||
 | 
			
		||||
export async function deleteAllPicturesFn() {
 | 
			
		||||
  fileHelper.deleteAllPictures();
 | 
			
		||||
  const context = AppStorage.get('context')
 | 
			
		||||
  const context=AppStorage.get('context')
 | 
			
		||||
  deleteAllVideos(context, photoAccessHelper.AlbumType.USER, photoAccessHelper.AlbumSubtype.VIDEO)
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -12,6 +12,15 @@ class UdpClient {
 | 
			
		||||
  private disconnectEvents: Array<Function> = []
 | 
			
		||||
  private dealMethod: DealMethod
 | 
			
		||||
 | 
			
		||||
  private dealMessage() {
 | 
			
		||||
    this.udp?.on("message", value => {
 | 
			
		||||
      let result = this?.dealMethod(value.message)
 | 
			
		||||
      this.messageEvents.forEach(cb => {
 | 
			
		||||
        cb(result)
 | 
			
		||||
      })
 | 
			
		||||
    })
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  init(udpLocalIp: string, udpLocalIpPort: string, udpOppositeIp: string, udpOppositeIpPort: string) {
 | 
			
		||||
    this.localIp = udpLocalIp
 | 
			
		||||
    this.oppositeIp = udpOppositeIp
 | 
			
		||||
@ -61,25 +70,12 @@ class UdpClient {
 | 
			
		||||
      })
 | 
			
		||||
    })
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  private dealMessage() {
 | 
			
		||||
    this.udp?.on("message", value => {
 | 
			
		||||
      let result = this?.dealMethod(value.message)
 | 
			
		||||
      this.messageEvents.forEach(cb => {
 | 
			
		||||
        cb(result)
 | 
			
		||||
      })
 | 
			
		||||
    })
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export const objUDPClient = new UdpClient()
 | 
			
		||||
 | 
			
		||||
// 中心心跳
 | 
			
		||||
export const centerUDPClient = new UdpClient()
 | 
			
		||||
 | 
			
		||||
// 中心GPS
 | 
			
		||||
// 顶灯
 | 
			
		||||
export const lightUDPClient = new UdpClient()
 | 
			
		||||
 | 
			
		||||
// 获取后置机信号
 | 
			
		||||
export const judgeUDPClient = new UdpClient()
 | 
			
		||||
 | 
			
		||||
@ -6,6 +6,7 @@ import Prompt from '@system.prompt';
 | 
			
		||||
import { initialization } from '../../api';
 | 
			
		||||
import FileUtil from '../../common/utils/File';
 | 
			
		||||
import { GlobalConfig } from '../../config';
 | 
			
		||||
import { sqlInsertCommonFn } from '../../common/service/initable';
 | 
			
		||||
 | 
			
		||||
// 建表操作
 | 
			
		||||
export async function InitTable() {
 | 
			
		||||
@ -53,7 +54,7 @@ export function UpdateTableByArray(tableName: string, arr: Array<User>): Promise
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
//依据表名同步获取数据
 | 
			
		||||
export async function GetSyncData<T>(tableName: string): Promise<T[]> {
 | 
			
		||||
export async function GetSyncData(tableName: string): Promise<boolean> {
 | 
			
		||||
  return new Promise((resolve, reject) => {
 | 
			
		||||
    const columns: ColumnInfo[] = ParameterPlatform[tableName].columns.map((res: string) => {
 | 
			
		||||
      return {
 | 
			
		||||
@ -61,13 +62,14 @@ export async function GetSyncData<T>(tableName: string): Promise<T[]> {
 | 
			
		||||
        columnName: res,
 | 
			
		||||
        type: ColumnType.STRING
 | 
			
		||||
      } as ColumnInfo
 | 
			
		||||
    });
 | 
			
		||||
    DB.queryListBySql<T>(`select * from ${tableName}`, columns).then((res: T[]) => {
 | 
			
		||||
      resolve(res);
 | 
			
		||||
    })
 | 
			
		||||
    // TODO 需要完善此处类型
 | 
			
		||||
    DB.queryListBySql<ESObject>(`select * from ${tableName}`, columns).then(() => {
 | 
			
		||||
      resolve(true)
 | 
			
		||||
    }).catch((err: BusinessError) => {
 | 
			
		||||
      reject(err);
 | 
			
		||||
    });
 | 
			
		||||
  });
 | 
			
		||||
      reject(err)
 | 
			
		||||
    })
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// TODO 后续废弃这个方法,直接调用DB.deleteByName
 | 
			
		||||
@ -134,7 +136,6 @@ export async function InitializeTheCentralTable(params: InitializeTheCentralTabl
 | 
			
		||||
      }
 | 
			
		||||
      const folderPath = await fileUtil.initFolder(`/config/tableList`);
 | 
			
		||||
      fileUtil.addFile(`${folderPath}/${RemappingTableName[key]}.txt`, JSON.stringify(arrList))
 | 
			
		||||
      try {
 | 
			
		||||
      const result = await SqlInsertTable(RemappingTableName[key], arrList)
 | 
			
		||||
      if (!result) {
 | 
			
		||||
        Prompt.showToast({
 | 
			
		||||
@ -142,9 +143,6 @@ export async function InitializeTheCentralTable(params: InitializeTheCentralTabl
 | 
			
		||||
        })
 | 
			
		||||
      }
 | 
			
		||||
      resolve(result)
 | 
			
		||||
      } catch (e) {
 | 
			
		||||
        reject(e)
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user