fix: 提交

This commit is contained in:
wangzhongjie 2025-09-22 13:07:32 +08:00
parent 3f8ebbd16d
commit 415f8c7fcb
14 changed files with 191 additions and 79 deletions

View File

@ -30,13 +30,13 @@ export async function writeObjectOut(params, filePath?: string): Promise<WR> {
if (singlePlay) { if (singlePlay) {
return { code: 1 } return { code: 1 }
} }
console.log('testsqlTag0') console.log('daihaimm testsqlTag0')
//获取监管接口地址路径 //获取监管接口地址路径
if (!globalThis.JGPATH) { if (!globalThis.JGPATH) {
console.log('testsqlTag1') console.log('daihaimm testsqlTag1')
const syssetParams = await getSyncData('MA_SYSSET') || []; const syssetParams = await getSyncData('MA_SYSSET') || [];
console.log('testsqlTag2') console.log('daihaimm testsqlTag2')
//@ts-ignore //@ts-ignore
syssetParams.forEach(sys => { syssetParams.forEach(sys => {
@ -50,10 +50,11 @@ export async function writeObjectOut(params, filePath?: string): Promise<WR> {
}) })
} }
const {xtlb,jkxlh,jkid,drvexam} = params; const {xtlb,jkxlh,jkid,drvexam} = params;
console.log('testsqlTag3') console.log('daihaimm testsqlTag3')
//新监管调用 //新监管调用
if (globalThis.isJGNew) { if (globalThis.isJGNew) {
console.log('daihaimm testsqlTag4')
return await writeObjectOutNew(params, filePath) return await writeObjectOutNew(params, filePath)
} }
@ -64,7 +65,7 @@ export async function writeObjectOut(params, filePath?: string): Promise<WR> {
.map((key: string) => ( .map((key: string) => (
`<${key}>${drvexam[key]}</${key}>`)); `<${key}>${drvexam[key]}</${key}>`));
console.log('surenjun filePath=>', filePath); console.log('daihaimm surenjun filePath=>', filePath);
if (filePath) { if (filePath) {
const fileUtil = new FileUtil(globalThis.context); const fileUtil = new FileUtil(globalThis.context);
await fileUtil.initFolder(filePath); await fileUtil.initFolder(filePath);

View File

@ -295,9 +295,7 @@ async function openChuankouFn() {
let ret = await testNapi.SerialSet(fd, 115200, 0, 8, 1, 0) let ret = await testNapi.SerialSet(fd, 115200, 0, 8, 1, 0)
console.log('daihairet', ret) console.log('daihairet', ret)
} }
let readSerials = true let readSerials = true
async function getChuankouFnMsg() { async function getChuankouFnMsg() {
if (!readSerials) { if (!readSerials) {
return return
@ -315,7 +313,7 @@ async function getChuankouFnMsg() {
readSerials = true readSerials = true
console.log('daihai', revTestInfo?.recevedBuf?.toString()) console.log('daihai', revTestInfo?.recevedBuf?.toString())
const message = revTestInfo?.recevedBuf?.toString() const message = revTestInfo?.recevedBuf?.toString()
console.log("chuankou xinxi", message) console.log("chuankou xinxi",message)
if (message == '') { if (message == '') {
return return
} }
@ -327,7 +325,7 @@ async function getChuankouFnMsg() {
return return
} }
console.log("chuankou xinxi 档位", msg[9]) console.log("chuankou xinxi 档位", msg[9])
if (msg[9] == 0 || msg[9] == 1 || msg[9] == 2 || msg[9] == 3 || msg[9] == 4 || msg[9] == 5) { if(msg[9]==0||msg[9]==1||msg[9]==2||msg[9]==3||msg[9]==4||msg[9]==5){
console.log("chuankou xinxi 111 message", message) console.log("chuankou xinxi 111 message", message)
globalThis.chuankoMsg = msg[9] globalThis.chuankoMsg = msg[9]
console.log("chuankou xinxi 111 档位", msg[9]) console.log("chuankou xinxi 111 档位", msg[9])

View File

@ -97,7 +97,8 @@ export function sqlInsertCommonFn(tableName, resultArr, delFlag = true) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
DB.clearTable(tableName).then((res) => { DB.clearTable(tableName).then((res) => {
if(!resultArr?.length){ if(!resultArr?.length){
return console.log('daihaimm sqlInsertCommonFn []')
resolve(true)
} }
let INSERT_SQL = "INSERT INTO " + tableName let INSERT_SQL = "INSERT INTO " + tableName
+ " (" + map[tableName].ACCOUNT_TABLE.columns.toString() + ") VALUES " + " (" + map[tableName].ACCOUNT_TABLE.columns.toString() + ") VALUES "
@ -191,6 +192,7 @@ export async function getDataBaseTable(params, reqParam) {
message: 'paraKdid获取失败', message: 'paraKdid获取失败',
duration: 3000 duration: 3000
}); });
reject()
return return
} }
const str = { "head": { "time": dateFormat(date) }, const str = { "head": { "time": dateFormat(date) },
@ -270,6 +272,7 @@ export async function getMySystemSetTable(params, reqParam) {
message: 'paraKdid获取失败', message: 'paraKdid获取失败',
duration: 3000 duration: 3000
}); });
reject()
return return
} }
const str = { "head": { "time": dateFormat(date) }, const str = { "head": { "time": dateFormat(date) },

View File

@ -1,4 +1,5 @@
import mediaLibrary from '@ohos.multimedia.mediaLibrary' import mediaLibrary from '@ohos.multimedia.mediaLibrary'
// @ts-ignore
import onvifclient from '@ohos.onvifclient'; import onvifclient from '@ohos.onvifclient';
import fs from '@ohos.file.fs' import fs from '@ohos.file.fs'
@ -6,6 +7,7 @@ import fs from '@ohos.file.fs'
import photoAccessHelper from '@ohos.file.photoAccessHelper' import photoAccessHelper from '@ohos.file.photoAccessHelper'
import dataSharePredicates from '@ohos.data.dataSharePredicates' import dataSharePredicates from '@ohos.data.dataSharePredicates'
import { dateFormat, getCurrentTime } from '../utils/tools' import { dateFormat, getCurrentTime } from '../utils/tools'
// @ts-ignore
import record from '@ohos.rtsprecord'; import record from '@ohos.rtsprecord';
// import record from '@ohos.rtsprecord'; // import record from '@ohos.rtsprecord';
import { FileHelper } from './FileHelper'; import { FileHelper } from './FileHelper';
@ -33,6 +35,44 @@ const FILE_ASSET_FETCH_COLUMNS = [photoAccessHelper.PhotoKeys.URI,
// const rtsp_server = record.createServer(); // const rtsp_server = record.createServer();
export async function delPic(day,type) {
let phAccessHelper = photoAccessHelper.getPhotoAccessHelper(globalThis.context);
console.info('albumGetAssetsDemoCallback');
let predicates: dataSharePredicates.DataSharePredicates = new dataSharePredicates.DataSharePredicates();
let albumFetchOptions: photoAccessHelper.FetchOptions = {
fetchColumns: [],
predicates: predicates
};
let fetchOption: photoAccessHelper.FetchOptions = {
fetchColumns: [],
predicates: predicates
};
let albumList: photoAccessHelper.FetchResult<photoAccessHelper.Album> = await phAccessHelper.getAlbums(photoAccessHelper.AlbumType.USER, photoAccessHelper.AlbumSubtype.USER_GENERIC, albumFetchOptions);
let albums = await albumList.getAllObjects();
for(let i=0;i<=albums.length;i++){
let albumName=albums[i].albumName
// isSevenDaysAgo(albumName, day)
console.log('albumNamealbumName',albumName)
if (isSevenDaysAgo(albumName, day)&&albumName!='jt'&&albumName!='pz') {
deleteAllFileByPiC(albumName, type)
}
}
}
export function isSevenDaysAgo(date,days=2) {
const today = new Date(); // 当前日期
const target = new Date(date); // 需要判断的日期
console.info("listFile succeed1",JSON.stringify(target));
const diff = today.getTime() - target.getTime(); // 计算两个日期之间的毫秒数差异
const diffDays = diff / (1000 * 60 * 60 * 24); // 将毫秒转换为天数
console.info("listFile succeed2",JSON.stringify(diffDays));
// 如果差异天数正好是2则原日期是当前日期的前2天
console.log('diffDays',diffDays,days)
return diffDays >= (Number(days) );
}
export async function saveStartRecordVideo(path) { export async function saveStartRecordVideo(path) {
return new Promise(async (reslove, reject) => { return new Promise(async (reslove, reject) => {
const fileUtil = new FileUtil(globalThis.context) const fileUtil = new FileUtil(globalThis.context)
@ -169,21 +209,28 @@ export async function takePhoto(param, context, dir, flag = 1, callback?) {
// }); // });
} else { } else {
return new Promise<takePhotoParam>((resolve, reject) => { return new Promise<takePhotoParam>((resolve, reject) => {
console.log('daihaimmm getVideoSnapshot start: ')
// @ts-ignore // @ts-ignore
rtsp_server.getVideoSnapshot(context, video_uri, fileName, dir, true, (err, snapResult) => { rtsp_server.getVideoSnapshot(context, video_uri, fileName, dir, true, (err, snapResult) => {
console.log('getPhtot') if (err) {
resolve({ base64: snapResult.dataString, name: snapResult.fileName, fileSize: snapResult.fileSize }) console.log('daihaimmm getVideoSnapshot err: ' + JSON.stringify(err))
reject(err)
} else {
console.log('daihaimmm getPhtot')
resolve({ base64: snapResult.dataString, name: snapResult.fileName, fileSize: snapResult.fileSize })
}
}); });
}) })
console.log('getmyLog02') console.log('getmyLog02')
} }
console.log('getmyLog03') console.log('daihaimmm getmyLog03')
} }
export async function deleteAllFileByPiC(dirName) { export async function deleteAllFileByPiC(dirName, type=1) {
// const fileHelper = new FileHelper(); // const fileHelper = new FileHelper();
fileHelper.deleteFileOfAlbum(dirName, 1); fileHelper.deleteFileOfAlbum(dirName, type);
} }
export async function deleteAllVideos(context, type: photoAccessHelper.AlbumType, subType: photoAccessHelper.AlbumSubtype): Promise<void> { export async function deleteAllVideos(context, type: photoAccessHelper.AlbumType, subType: photoAccessHelper.AlbumSubtype): Promise<void> {

View File

@ -1,3 +1,4 @@
// @ts-ignore
import HiSerialSDK from '@ohos.hiserialsdk'; import HiSerialSDK from '@ohos.hiserialsdk';
// 打开串口工具 // 打开串口工具

View File

@ -122,9 +122,7 @@ export default async function tempRequest<T>(req: any): Promise<T> {
reject({ reject({
code: e.code code: e.code
}) })
} finally {
httpRequest.destroy();
console.log('httpRequest destroy finally')
} }
}) })
@ -164,12 +162,12 @@ async function xmlToJson(result, url) {
if (result.length > 10000) { if (result.length > 10000) {
setTimeout(() => { setTimeout(() => {
let res = deeml(xmlArr); let res = deeml(xmlArr);
console.log("xmlToJson end", JSON.stringify(res)); console.log("xmlToJson end",JSON.stringify(res) );
resolve(res) resolve(res)
}, 10000) }, 10000)
} else { } else {
let res = deeml(xmlArr); let res = deeml(xmlArr);
console.log("xmlToJson end", JSON.stringify(res)); console.log("xmlToJson end",JSON.stringify(res) );
resolve(res) resolve(res)
} }

View File

@ -2,6 +2,7 @@ import { voiceService } from '../common/service/voiceService';
import router from '@ohos.router'; import router from '@ohos.router';
import { carConfigurationInfo, uploadExamCarCheckResult } from '../api/checkCar'; import { carConfigurationInfo, uploadExamCarCheckResult } from '../api/checkCar';
import TopLogo from './compontents/TopLogo'; import TopLogo from './compontents/TopLogo';
// @ts-ignore
import testNapi from '@ohos.hiserialsdk'; import testNapi from '@ohos.hiserialsdk';
import { dateFormat } from '../common/utils/tools'; import { dateFormat } from '../common/utils/tools';
import { DwMapData, PassData, RealNumData, StackValueData, WarnFlagData, WarnFlagTipData } from '../mock'; import { DwMapData, PassData, RealNumData, StackValueData, WarnFlagData, WarnFlagTipData } from '../mock';

View File

@ -16,9 +16,10 @@ 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 UdpEvent from '../common/utils/UdpEvent';
import { delPic } from '../common/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 {updateModelAndCar} from '../common/autoUpdate/index' import {updateModelAndCar} from '../common/autoUpdate/index'
// import {uploadLogFile} from '../common/service/indexService' // import {uploadLogFile} from '../common/service/indexService'
import { getModalValueCdAndCar } from '../api'; import { getModalValueCdAndCar } from '../api';
@ -44,7 +45,7 @@ struct Index {
@State fd: number = -1; @State fd: number = -1;
@State num: number = 0; @State num: number = 0;
//模型是否下载 //模型是否下载
@State isModelInit: boolean = true; @State isModelInit: boolean = false;
fileHelper = null; fileHelper = null;
errorDialog: CustomDialogController = new CustomDialogController({ errorDialog: CustomDialogController = new CustomDialogController({
builder: errorMsgDialog({ builder: errorMsgDialog({
@ -341,7 +342,7 @@ struct Index {
.width(80 * globalThis.ratio) .width(80 * globalThis.ratio)
.height(80 * globalThis.ratio) .height(80 * globalThis.ratio)
.position({ x: 288 * globalThis.ratio, y: 89 * globalThis.ratio }) .position({ x: 288 * globalThis.ratio, y: 89 * globalThis.ratio })
Text(this.loadingText || '获取考车信息,请稍候……') Text(this.loadingText ||'获取考车信息,请稍候……')
.fontSize(24 * globalThis.ratio) .fontSize(24 * globalThis.ratio)
.margin({ top: 20 * globalThis.ratio }) .margin({ top: 20 * globalThis.ratio })
.fontWeight(400) .fontWeight(400)
@ -399,6 +400,8 @@ struct Index {
console.log('syssyssyssys') console.log('syssyssyssys')
// this.delLoading=true // this.delLoading=true
// globalThis.param854Str=sys.v_value // globalThis.param854Str=sys.v_value
delPic(Number(sys.v_value), 1)
delPic(Number(sys.v_value), 2)
// this.delLoading=false // this.delLoading=false
} }
@ -435,9 +438,9 @@ struct Index {
this.loading = true this.loading = true
console.log("sql 1111") console.log("sql 1111")
getSingleCenterTable(param).then(async (ret: any) => { getSingleCenterTable(param).then(async (ret:any) => {
if (!this.isModelInit) { if(!this.isModelInit){
this.loading = true this.loading = true
this.loadingText = '正在下载考车模型,请稍候……' this.loadingText = '正在下载考车模型,请稍候……'
// await updateModelAndCar(false) // await updateModelAndCar(false)
@ -446,7 +449,7 @@ struct Index {
this.isModelInit = true this.isModelInit = true
} }
if (typeof ret == 'object' && ret.resultCode == '3') { if(typeof ret == 'object' && ret.resultCode == '3'){
this.loadingText = '正在下载考车最新版本,请稍候……' this.loadingText = '正在下载考车最新版本,请稍候……'
this.loading = true this.loading = true
// await updateModelAndCar(true) // await updateModelAndCar(true)
@ -466,7 +469,7 @@ struct Index {
if (globalThis.singlePlay) { if (globalThis.singlePlay) {
router.pushUrl({ router.pushUrl({
url: 'pages/userInfo' url: 'pages/userInfo'
}, router.RouterMode.Single) },router.RouterMode.Single)
return return
} }
if (globalThis.singlePlay) { if (globalThis.singlePlay) {
@ -641,14 +644,12 @@ struct Index {
// deleteAllFIleLog(GlobalConfig.comoonfileWriteAddress + '/PLC/') // deleteAllFIleLog(GlobalConfig.comoonfileWriteAddress + '/PLC/')
//设置plc udp 同步requesthost //设置plc udp 同步requesthost
await getUDP(this.context, false) await getUDP(this.context, false)
getTCP()
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)
console.log('socket1111') getTCP()
this.deviceId = globalThis.carInfo.carNo this.deviceId = globalThis.carInfo.carNo
await setCurrentTime(); await setCurrentTime();
if (!globalThis.distanceClass) { if (!globalThis.distanceClass) {

View File

@ -38,13 +38,21 @@ import { getChuankouFn } from '../common/service/indexService';
@Entry @Entry
@Component @Component
struct Index { struct Index {
timerchuankou: number = undefined
timer: number = undefined
mileageTimer: number = undefined;
async aboutToDisappear() { async aboutToDisappear() {
console.log('daihaimm1111 Judge aboutToDisappear')
clearInterval(this.mileageTimer) clearInterval(this.mileageTimer)
clearInterval(this.timer)
clearInterval(this.timerchuankou)
this.judge = null
} }
async aboutToAppear() { async aboutToAppear() {
getChuankouFn() getChuankouFn()
setInterval(() => { this.timerchuankou = setInterval(() => {
console.log("chuankou 定时器2") console.log("chuankou 定时器2")
getChuankouFn() getChuankouFn()
}, 1000) }, 1000)
@ -57,7 +65,7 @@ struct Index {
this.startExamTime = time this.startExamTime = time
setInterval(async () => { this.timer = setInterval(async () => {
this.time = await getCurrentTime(); this.time = await getCurrentTime();
this.examTime += 1; this.examTime += 1;
}, 1000); }, 1000);
@ -144,6 +152,11 @@ struct Index {
const markRuleParams = markRules || (await getSyncData('MA_MARKRULE') as MarkRule[]) const markRuleParams = markRules || (await getSyncData('MA_MARKRULE') as MarkRule[])
markRuleParams.forEach(mark => { markRuleParams.forEach(mark => {
console.log("markrile item mark.onlyoneid: ", mark.onlyoneid);
console.log("markrile item mark.nocancelid: ", mark.nocancelid);
console.log("markrile item mark.onlyoneid Number: ", Number(mark.onlyoneid));
console.log("markrile item mark.nocancelid Number: ", Number(mark.nocancelid));
const tempObj = { const tempObj = {
itemno: mark.itemno * 1, itemno: mark.itemno * 1,
markcatalog: mark.markcatalog, markcatalog: mark.markcatalog,
@ -151,8 +164,8 @@ struct Index {
markreal: mark.markreal * 1, markreal: mark.markreal * 1,
markserial: mark.markserial, markserial: mark.markserial,
kfxh: mark.kfxh, kfxh: mark.kfxh,
OnlyOneKind: mark.onlyoneid * 1, OnlyOneKind: !isNaN(Number(mark.onlyoneid)) ? Number(mark.onlyoneid) : 0,
NoCancelId: mark.nocancelid * 1, NoCancelId: !isNaN(Number(mark.nocancelid)) ? Number(mark.nocancelid) : 0,
GPS_SID: mark.gps_sid == 0 ? false : true GPS_SID: mark.gps_sid == 0 ? false : true
} }
@ -1384,7 +1397,6 @@ struct Index {
@State markRuleListObj: MarkRule = {} @State markRuleListObj: MarkRule = {}
@State cdsbInfoObj: CDSBInfo = {} @State cdsbInfoObj: CDSBInfo = {}
@State itemInfoObj: CDSBInfo = {} @State itemInfoObj: CDSBInfo = {}
@State timer: number = 0
@State judgeConfig: { [k: string]: string }[] = [] @State judgeConfig: { [k: string]: string }[] = []
@State judgeConfigObj: { [k: string]: any } = defaultJudgeConfigObj @State judgeConfigObj: { [k: string]: any } = defaultJudgeConfigObj
//流水号 //流水号
@ -1446,7 +1458,6 @@ struct Index {
@State dw: string = '' @State dw: string = ''
//速度 //速度
@State sd: string = '' @State sd: string = ''
@State mileageTimer: number = 0;
@State passingScore: number = 80 @State passingScore: number = 80
@State dwztErrorVisible: boolean = false; @State dwztErrorVisible: boolean = false;
@State popTimer: number = 0; @State popTimer: number = 0;

View File

@ -8,6 +8,7 @@ import { dateFormat, getCurrentHourTime, getCurrentTime, string2Bytes } from '..
import FaceCompare from './compontents/FaceCompare'; import FaceCompare from './compontents/FaceCompare';
// import { initJudgeUdp } from '../common/utils/UdpJudge' // import { initJudgeUdp } from '../common/utils/UdpJudge'
import { writeObjectOut } from '../api/judge'; import { writeObjectOut } from '../api/judge';
// @ts-ignore
import testNapi from '@ohos.idcard'; import testNapi from '@ohos.idcard';
import common from '@ohos.app.ability.common'; import common from '@ohos.app.ability.common';
import { User } from './interfaces'; import { User } from './interfaces';
@ -192,6 +193,7 @@ struct UserInfo {
} }
async onPageShow() { async onPageShow() {
console.log('daihai userinfo onPageShow')
this.isExamStart = false this.isExamStart = false
this.startExam = false this.startExam = false
this.updateTimeLimit = false this.updateTimeLimit = false
@ -205,7 +207,7 @@ struct UserInfo {
//身份证读卡器初始化 //身份证读卡器初始化
// this.openDeviceByIDCard() // this.openDeviceByIDCard()
const routerParam = router.getParams() || { type: 0 }; const routerParam = router.getParams() || { type: 0 };
console.log('routerParam', JSON.stringify(routerParam)) console.log('daihaim routerParam', JSON.stringify(routerParam))
initJudgeUdp() initJudgeUdp()
if (!globalThis.singlePlay) { if (!globalThis.singlePlay) {
// @ts-ignore // @ts-ignore
@ -215,8 +217,8 @@ struct UserInfo {
this.list = await getSyncData('USERLIST') this.list = await getSyncData('USERLIST')
// @ts-ignore // @ts-ignore
const data = await getSyncData('USER') const data = await getSyncData('USER')
console.log('surenjun useruser=>,', JSON.stringify(this.list)) console.log('daihaim surenjun this.list=>,', JSON.stringify(this.list))
console.log('surenjun useruser1=>,', JSON.stringify(data)) console.log('daihaim surenjun useruser1=>,', JSON.stringify(data))
const user = data[0] const user = data[0]
if(!Number(user.kssycs)){ if(!Number(user.kssycs)){
@ -224,22 +226,35 @@ struct UserInfo {
return res.sfzmhm != user.sfzmhm return res.sfzmhm != user.sfzmhm
}) })
} }
console.log('daihaim 111,')
this.pageIndex = 0 this.pageIndex = 0
this.dataList = this.list.slice(this.pageIndex * 4, this.pageIndex * 4 + 4) this.dataList = this.list.slice(this.pageIndex * 4, this.pageIndex * 4 + 4)
console.log('daihaim 222 this.dataList length,' + this.dataList.length)
if (this.dataList.length) { if (this.dataList.length) {
console.log('daihaim 222 this.dataList,' +JSON.stringify(this.dataList))
setTimeout(() => { setTimeout(() => {
this.currentUser = this.dataList[0] this.currentUser = this.dataList[0]
this.currentUser.ksy2 = globalThis.kgxm this.currentUser.ksy2 = globalThis.kgxm
globalThis.lsh = this.currentUser.lsh globalThis.lsh = this.currentUser.lsh
}, 200) }, 200)
} else { } else {
console.log('daihaim 7777,')
this.currentUser = EmptyCandidateObject this.currentUser = EmptyCandidateObject
globalThis.lsh = '1111111111111' globalThis.lsh = '1111111111111'
} }
this.list.forEach((res, index) => { this.list.forEach((res, index) => {
res.id = index.toString() res.id = index.toString()
}) })
console.log('daihaim 8888,' + JSON.stringify(this.list))
await upDateTableByArray('USERLIST', this.list || []) await upDateTableByArray('USERLIST', this.list || [])
console.log('daihaim 999,')
// if(this.) // if(this.)
// if (user && Number(user.kssycs)) { // if (user && Number(user.kssycs)) {
@ -274,9 +289,12 @@ struct UserInfo {
// globalThis.lsh = '1111111111111' // globalThis.lsh = '1111111111111'
// } // }
// } // }
this.getExaminationStudentInfoFn()
} else { } else {
console.log('daihaim surenjun routerParam.type 11111')
await this.getExaminationStudentInfoFn() await this.getExaminationStudentInfoFn()
} }
} }
@ -504,6 +522,9 @@ struct UserInfo {
const ksxtbhArr = syssetParams.filter(sys => sys.v_no === '902') const ksxtbhArr = syssetParams.filter(sys => sys.v_no === '902')
that.ksxtbh = ksxtbhArr?.[0]?.v_value || '222' that.ksxtbh = ksxtbhArr?.[0]?.v_value || '222'
const studentRefreshParam = syssetParams.filter(sys => sys.v_no === '452') //判断自动更新 const studentRefreshParam = syssetParams.filter(sys => sys.v_no === '452') //判断自动更新
console.log('daihaimmm syssetParams syssetParams::' + JSON.stringify(syssetParams))
console.log('daihaimmm syssetParams studentRefreshParam::' + JSON.stringify(studentRefreshParam))
that.studentRefreshStatue = studentRefreshParam?.[0]?.v_value || '0' that.studentRefreshStatue = studentRefreshParam?.[0]?.v_value || '0'
const openCheckFlagParam = syssetParams.filter(sys => sys.v_no == '17') //0 const openCheckFlagParam = syssetParams.filter(sys => sys.v_no == '17') //0
const openCheckFlag = openCheckFlagParam?.[0]?.v_value == '1' ? '1' : '0' const openCheckFlag = openCheckFlagParam?.[0]?.v_value == '1' ? '1' : '0'
@ -518,6 +539,7 @@ struct UserInfo {
that.openDeviceByIDCard() that.openDeviceByIDCard()
} }
} }
console.log('daihaimmm syssetParams len::' + syssetParams.length)
// let a = await this.fileUtil.initFolder("/config/temptable") // let a = await this.fileUtil.initFolder("/config/temptable")
// this.fileUtil.addFile("temp.log", JSON.stringify(syssetParams)) // this.fileUtil.addFile("temp.log", JSON.stringify(syssetParams))
syssetParams.forEach(sys => { syssetParams.forEach(sys => {
@ -592,11 +614,13 @@ struct UserInfo {
}) })
// faceParam?.[0]?.v_value || // faceParam?.[0]?.v_value ||
console.log('daihaimmmm 11111 that.studentRefreshStatue:' +that.studentRefreshStatue)
//0不自动更新 1自动更新不限次数 2没有考生更新2次 //0不自动更新 1自动更新不限次数 2没有考生更新2次
if (that.studentRefreshStatue == '2') { if (that.studentRefreshStatue == '2') {
if (that.list.length == 0) { if (that.list.length == 0) {
console.log('daihaimmmm 11111')
clearInterval(that.interval) clearInterval(that.interval)
that.interval = setInterval(() => { that.interval = setInterval(() => {
if (that.numCount < 3) { if (that.numCount < 3) {
@ -611,6 +635,8 @@ struct UserInfo {
} }
} else if (that.studentRefreshStatue == '1') { } else if (that.studentRefreshStatue == '1') {
if (that.list.length == 0) { if (that.list.length == 0) {
console.log('daihaimmmm 22222')
clearInterval(that.interval) clearInterval(that.interval)
that.interval = setInterval(() => { that.interval = setInterval(() => {
if (that.list.length == 0) { if (that.list.length == 0) {
@ -909,9 +935,9 @@ struct UserInfo {
this.isLoadingPopupVisible = true this.isLoadingPopupVisible = true
avPlayer.playAudio([`voice/监管通信中.mp3`], false, async () => { avPlayer.playAudio([`voice/监管通信中.mp3`], false, async () => {
console.info('surenjun', '播放结束开始考试接口调用') console.info('daihaimm surenjun', '播放结束开始考试接口调用')
const {code,keystr,message} = await this.beginExam() || {}; const {code,keystr,message} = await this.beginExam() || {};
console.info('surenjun', '开始考试接口调用结束') console.info('daihaimm surenjun', '开始考试接口调用结束', code,keystr,message)
// console.info('surenjun',code +'') // console.info('surenjun',code +'')
//@ts-ignore TODO code转换 //@ts-ignore TODO code转换
@ -926,7 +952,14 @@ struct UserInfo {
return return
} }
this.currentUser.id = '0' this.currentUser.id = '0'
await upDateTableByArray('USER', [this.currentUser]) console.log('daiihaimm upDateTableByArray start this.currentUser: ' + JSON.stringify(this.currentUser))
if (this.currentUser.sfzmhm) {
await upDateTableByArray('USER', [this.currentUser])
} else {
console.error('daiihaimm 当前考生为空')
}
console.log('daiihaimm upDateTableByArray end')
this.stepFlag = false this.stepFlag = false
this.isLoadingPopupVisible = false this.isLoadingPopupVisible = false
router.pushUrl({ router.pushUrl({
@ -1093,8 +1126,10 @@ struct UserInfo {
//接口标识 //接口标识
jkid: '17C51', jkid: '17C51',
} }
console.info('surenjunjianguan', JSON.stringify(param)) console.info('daihaimm surenjunjianguan', JSON.stringify(param))
const temp = await writeObjectOut(param); const temp = await writeObjectOut(param);
console.info('daihaimm surenjunjianguan end', JSON.stringify(temp))
globalThis.lsh = this.currentUser.lsh globalThis.lsh = this.currentUser.lsh
globalThis.ksyh = this.currentUser.ksy1sfzmhm globalThis.ksyh = this.currentUser.ksy1sfzmhm
return temp return temp

View File

@ -187,8 +187,8 @@ export default struct FaceCompare {
this.base64 = this.imageBase64 + data.base64 this.base64 = this.imageBase64 + data.base64
faceCompare({ faceCompare({
sfzh: this.sfzh, sfzh: this.sfzh,
secondImage: this.firstImage.substr(22), secondImage: data.base64,
firstImage: data.base64, firstImage: '',
type: 2, type: 2,
verifyType: 1 verifyType: 1
}) })

View File

@ -25,11 +25,10 @@ export default struct SignDisplayCom {
@State interval: number = 0 @State interval: number = 0
@State @Watch('outClick') outFlag: boolean = false; @State @Watch('outClick') outFlag: boolean = false;
@State url: string = '' @State url: string = ''
private timer = null
private udpClient: UdpClient = null private udpClient: UdpClient = null
private FileLog: FileLog private FileLog: FileLog
private vocObj = null; private vocObj = null;
timer: number = undefined
constructor() { constructor() {
super() super()
} }
@ -325,13 +324,14 @@ export default struct SignDisplayCom {
aboutToDisappear() { aboutToDisappear() {
// clearInterval(this.interval) // clearInterval(this.interval)
// clearInterval(this.timer)
} }
async aboutToAppear() { async aboutToAppear() {
setInterval(() => { // this.timer = setInterval(() => {
console.log("chuankou 定时器2") // console.log("chuankou 定时器2")
getChuankouFn() // getChuankouFn()
}, 1000) // }, 1000)
// const fileUtil = new FileUtil(globalThis.context) // const fileUtil = new FileUtil(globalThis.context)
// const data = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + '/config/ipConfig.txt') // const data = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + '/config/ipConfig.txt')
// this.udplocalIp=JSON.parse(data)?.udplocalIp||'192.168.7.170' // this.udplocalIp=JSON.parse(data)?.udplocalIp||'192.168.7.170'

View File

@ -56,7 +56,9 @@ import {
} from './api/index'; } from './api/index';
import { getSyncData, upDateTableByArray } from '../../common/service/initable'; import { getSyncData, upDateTableByArray } from '../../common/service/initable';
import { GlobalConfig } from '../../config'; import { GlobalConfig } from '../../config';
const judgeTag = 'SURENJUN_JUDGE' const judgeTag = 'SURENJUN_JUDGE'
const endExamTag = "endExam"
function ifNeedRetry(code: number | string): boolean { function ifNeedRetry(code: number | string): boolean {
let arr = ["B210010", "B210023", "B210024", "B210031", "B210033", "B210034", "B210041"] let arr = ["B210010", "B210023", "B210024", "B210031", "B210033", "B210034", "B210041"]
@ -65,6 +67,7 @@ function ifNeedRetry(code: number | string): boolean {
} }
return false return false
} }
export default class Judge { export default class Judge {
// 过程照片拍照 // 过程照片拍照
getPhoto = async (empty?: boolean) => { getPhoto = async (empty?: boolean) => {
@ -320,13 +323,13 @@ export default class Judge {
const tWD = convertGpsCoord2(wd) const tWD = convertGpsCoord2(wd)
const {prevJd,prevWd} = this const {prevJd,prevWd} = this
if (prevJd && dwzt == 4 && jdzt == 3 && !globalThis.singlePlay) { if (prevJd && dwzt == 4 && jdzt == 3 && !globalThis.singlePlay) {
// const distance = await examCalcGpsDistance({ const distance = await examCalcGpsDistance({
// jd1: prevJd, jd1: prevJd,
// wd1: prevWd, wd1: prevWd,
// jd2: tJD, jd2: tJD,
// wd2: tWD, wd2: tWD,
// h: hxj || 1, h: hxj || 1,
// }) })
//@ts-ignore //@ts-ignore
// globalThis.distanceClass?.setTimeData(((distance / 100).toFixed(2)) * 1) // globalThis.distanceClass?.setTimeData(((distance / 100).toFixed(2)) * 1)
} }
@ -390,10 +393,10 @@ export default class Judge {
//成绩不合格 //成绩不合格
if (totalScore < passingGrade) { if (totalScore < passingGrade) {
//科目三不合格报靠边停车 //科目三不合格报靠边停车
if (examSubject == 3 ) { if (examSubject == 3) {
if( param302 == 1){ if (param302 == 1) {
avPlayer.playAudio([`voice/考试结束.mp3`]); avPlayer.playAudio([`voice/考试结束.mp3`]);
}else if(param302 == 0){ } else if (param302 == 0) {
return return
} }
} }
@ -469,7 +472,7 @@ export default class Judge {
private testKmItems: any private testKmItems: any
private plcData: any private plcData: any
//特殊扣分标记 //特殊扣分标记
private specialkf:string = '' private specialkf: string = ''
// 获取plc数据 // 获取plc数据
getPlcData = async (plc: string) => { getPlcData = async (plc: string) => {
const {fileLog,mndgStr,rmndg} = this; const {fileLog,mndgStr,rmndg} = this;
@ -540,7 +543,7 @@ export default class Judge {
// 调代理接口是否断网了 // 调代理接口是否断网了
private isJudgeDisConnect: boolean; private isJudgeDisConnect: boolean;
// 项目开始接口同步 // 项目开始接口同步
beginProject = async (ksxm,xmxh?:string) => { beginProject = async (ksxm, xmxh?: string) => {
const carInfo = globalThis.carInfo; const carInfo = globalThis.carInfo;
const { examSubject,plateNo } = carInfo; const { examSubject,plateNo } = carInfo;
const {judgeUI,fileLog,getSbbm,filePath} = this; const {judgeUI,fileLog,getSbbm,filePath} = this;
@ -574,7 +577,7 @@ export default class Judge {
promptWxCode('17C52', code) promptWxCode('17C52', code)
} }
// 项目结束接口同步 // 项目结束接口同步
endProject = async (ksxm,xmxh?:string) => { endProject = async (ksxm, xmxh?: string) => {
const carInfo = globalThis.carInfo; const carInfo = globalThis.carInfo;
const deviceNo = globalThis.deviceNo; const deviceNo = globalThis.deviceNo;
const { examSubject,plateNo,carNo } = carInfo; const { examSubject,plateNo,carNo } = carInfo;
@ -604,7 +607,7 @@ export default class Judge {
const {code} = await this.sendWriteObjectOut(data, filePath) const {code} = await this.sendWriteObjectOut(data, filePath)
//科三 & 432=3 //科三 & 432=3
if(examSubject == 3 && this.judgeUI.judgeConfigObj['432'] == 2){ if (examSubject == 3 && this.judgeUI.judgeConfigObj['432'] == 2) {
this.judgeUI.uploadMileage() this.judgeUI.uploadMileage()
} }
@ -750,12 +753,12 @@ export default class Judge {
allitems = Reflect.ownKeys(itemInfoObj).map(cdsbKey => { allitems = Reflect.ownKeys(itemInfoObj).map(cdsbKey => {
const cdsb = itemInfoObj[cdsbKey]; const cdsb = itemInfoObj[cdsbKey];
const {xmdm,xmxh,modelKey} = cdsb const {xmdm,xmxh,modelKey} = cdsb
const modelVal= getModelData(`${modelKey}.txt`) const modelVal = getModelData(`${modelKey}.txt`)
if(modelVal){ if (modelVal) {
return { return {
xmdm, xmxh, model: modelVal xmdm, xmxh, model: modelVal
} }
}else{ } else {
return undefined return undefined
} }
}).filter(item => item !== undefined) }).filter(item => item !== undefined)
@ -849,7 +852,7 @@ export default class Judge {
mfxx: false, mfxx: false,
mfxxn: false, mfxxn: false,
//科目三特殊扣分项 //科目三特殊扣分项
specialkf:judgeUI.specialkf, specialkf: judgeUI.specialkf,
} }
console.info(judgeTag, '5.获取开始考试数据完成') console.info(judgeTag, '5.获取开始考试数据完成')
return beginInfo return beginInfo
@ -1074,7 +1077,7 @@ export default class Judge {
if (!isEnd) { if (!isEnd) {
judgeTask.addTask(async () => { judgeTask.addTask(async () => {
console.info(judgeTag, `项目开始-${xmdm}-${projectsObj[xmdm].name}`) console.info(judgeTag, `项目开始-${xmdm}-${projectsObj[xmdm].name}`)
await beginProject(xmdm,xmxh) await beginProject(xmdm, xmxh)
}, { }, {
isDelay: true isDelay: true
}) })
@ -1103,7 +1106,7 @@ export default class Judge {
if (!projectIsEnd) { if (!projectIsEnd) {
judgeTask.addTask(async () => { judgeTask.addTask(async () => {
console.info(judgeTag, `项目结束-${xmdm}-${projectsObj[xmdm].name}`) console.info(judgeTag, `项目结束-${xmdm}-${projectsObj[xmdm].name}`)
await endProject(xmdm,xmxh) await endProject(xmdm, xmxh)
this.xmmcSingleCode = 0; this.xmmcSingleCode = 0;
this.xmmcEndCode = undefined; this.xmmcEndCode = undefined;
}, { }, {
@ -1151,7 +1154,7 @@ export default class Judge {
await endRecordVideo(this.videoData) await endRecordVideo(this.videoData)
} }
judgeTask.addTask(async () => { judgeTask.addTask(async () => {
console.info(judgeTag, '考试结束 start') console.info(judgeTag, handEndExam, '考试结束 start')
globalThis.isJudge = false; globalThis.isJudge = false;
await handEndExam(ksjs) await handEndExam(ksjs)
}) })
@ -1242,11 +1245,11 @@ export default class Judge {
}) })
} else { } else {
//收到综合评判语音时,显示综合评判弹窗 //收到综合评判语音时,显示综合评判弹窗
if(code[0] == 'zhpp'){ if (code[0] == 'zhpp') {
const param512 = (this.judgeUI.judgeConfigObj['512'] || '').split(','); const param512 = (this.judgeUI.judgeConfigObj['512'] || '').split(',');
this.judgeUI.isDeductedPopShow = false this.judgeUI.isDeductedPopShow = false
clearTimeout(this.deductedPopShowTimer) clearTimeout(this.deductedPopShowTimer)
if(param512[7] != 0){ if (param512[7] != 0) {
this.judgeUI.isDeductedPopShow = true this.judgeUI.isDeductedPopShow = true
this.judgeUI.defaultTabIndex = 1 this.judgeUI.defaultTabIndex = 1
} }
@ -1258,6 +1261,7 @@ export default class Judge {
// 处理考试结束 // 处理考试结束
public handEndExam = async (ksjs: KSJS) => { public handEndExam = async (ksjs: KSJS) => {
console.log(endExamTag, "handEndExam")
this.judgeUI.loadingPopupVisible = true; this.judgeUI.loadingPopupVisible = true;
this.judgeUI.endPopupVisible = false; this.judgeUI.endPopupVisible = false;
this.judgeUI.isDeductedPopShow = false; this.judgeUI.isDeductedPopShow = false;
@ -1286,14 +1290,19 @@ export default class Judge {
} }
avPlayer.playAudio(['voice/exam_waiting.mp3'], globalThis.singlePlay, async () => { avPlayer.playAudio(['voice/exam_waiting.mp3'], globalThis.singlePlay, async () => {
console.log(endExamTag, "播放 exam_waiting")
try { try {
if (!singlePlay) { if (!singlePlay) {
console.log(endExamTag, "获取中心心跳1")
const bytes = await this.getMessageHeartbeat(true); const bytes = await this.getMessageHeartbeat(true);
console.log(endExamTag, "获取中心心跳2")
globalThis.judgeUdp.send(bytes) globalThis.judgeUdp.send(bytes)
console.log(endExamTag, "获取中心心跳3")
} }
} catch (e) { } catch (e) {
console.info(judgeTag, JSON.stringify(e)) console.info(judgeTag,endExamTag,"心跳错误", JSON.stringify(e))
} }
console.log(endExamTag,"开始调取结束考试")
await endExam() await endExam()
}); });
@ -1302,6 +1311,7 @@ export default class Judge {
// 考试结束 // 考试结束
public endExam = async (isManual?: Boolean) => { public endExam = async (isManual?: Boolean) => {
console.log(endExamTag,"endExam start")
const carInfo = globalThis.carInfo; const carInfo = globalThis.carInfo;
const singlePlay = globalThis.singlePlay const singlePlay = globalThis.singlePlay
const { examSubject ,plateNo} = carInfo; const { examSubject ,plateNo} = carInfo;
@ -1321,7 +1331,9 @@ export default class Judge {
//TODO 断网考试结束补传 //TODO 断网考试结束补传
// await uploadDisConnectData(); // await uploadDisConnectData();
const time = await getCurrentTime(); const time = await getCurrentTime();
console.log(endExamTag,"获取图片1")
const photoBase64 = await getPhoto(); const photoBase64 = await getPhoto();
console.log(endExamTag,"获取图片2")
const {d1,d2,d3,d4,d5} = ksjs const {d1,d2,d3,d4,d5} = ksjs
const data = { const data = {
xtlb: '17', jkxlh: serialNumber, jkid: '17C56', xtlb: '17', jkxlh: serialNumber, jkid: '17C56',
@ -1339,12 +1351,16 @@ export default class Judge {
dwlc: [d1, d2, d3, d4, d5].map((d, index) => `${index + 1},${Math.floor(d / 100)}`).join(';'), dwlc: [d1, d2, d3, d4, d5].map((d, index) => `${index + 1},${Math.floor(d / 100)}`).join(';'),
} }
} }
let backTimeOut = setTimeout(() => { let backTimeOut = setTimeout(() => {
router.back() router.back()
}, 90 * 1000) }, 90 * 1000)
console.log(endExamTag,"上传结束考试1",JSON.stringify(data))
const {code,keystr,message} = await this.sendWriteObjectOut(data, filePath); const {code,keystr,message} = await this.sendWriteObjectOut(data, filePath);
console.log(endExamTag,"上传结束考试2",code,keystr,message)
console.log(endExamTag,"上传监管code1")
promptWxCode('17C56', code) promptWxCode('17C56', code)
console.log(endExamTag,"上传监管code2")
if (code != 1) { if (code != 1) {
avPlayer.playAudio(['voice/监管失败.mp3']) avPlayer.playAudio(['voice/监管失败.mp3'])
this.judgeUI.errorMsg = decodeURIComponent(message) this.judgeUI.errorMsg = decodeURIComponent(message)
@ -1838,7 +1854,7 @@ export default class Judge {
//TODO 待优化 跨组件传值不生效 //TODO 待优化 跨组件传值不生效
globalThis.laneData = performInfo.lane; globalThis.laneData = performInfo.lane;
//特殊扣分标记上传中心 //特殊扣分标记上传中心
if(performInfo.specialkf !== this.specialkf){ if (performInfo.specialkf !== this.specialkf) {
this.judgeUI.uploadMileage(performInfo.specialkf) this.judgeUI.uploadMileage(performInfo.specialkf)
this.specialkf = performInfo.specialkf this.specialkf = performInfo.specialkf
} }
@ -1920,7 +1936,7 @@ export default class Judge {
globalThis.udpEvent.onStopExam(async () => { globalThis.udpEvent.onStopExam(async () => {
const config392 = (this.judgeUI.judgeConfigObj['392'] || '20,81').split(','); const config392 = (this.judgeUI.judgeConfigObj['392'] || '20,81').split(',');
console.info(judgeTag, '开始远程终止考试扣分') console.info(judgeTag, '开始远程终止考试扣分')
this.setJudgeMark(config392[0]*1, config392[1], 2); this.setJudgeMark(config392[0] * 1, config392[1], 2);
}) })
this.checkExamIsEnd(); this.checkExamIsEnd();

View File

@ -20,7 +20,7 @@ export default class FileModel{
// 设置文件夹 // 设置文件夹
public initFolder = async () => { public initFolder = async () => {
const {fileUtil} = this const {fileUtil} = this
await fileUtil.initFolder(`/models/model_enc`); await fileUtil.initFolder(`/models`);
const folderPath = await fileUtil.initFolder(`/models`); const folderPath = await fileUtil.initFolder(`/models`);
this.folderPath = folderPath; this.folderPath = folderPath;
} }