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