Compare commits
	
		
			29 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 7df90207e8 | ||
|  | 55155a370b | ||
|  | 3ee1b98b43 | ||
|  | 8d7173c545 | ||
|  | ed4b981807 | ||
|  | dc72d33536 | ||
|  | 0c2715821d | ||
| 0832262cd7 | |||
| 6b54e9da5c | |||
| 6de9d4bdcb | |||
| addf143396 | |||
| 448a16fab9 | |||
| e36b0f018b | |||
| f9beb54a28 | |||
| f420a9512f | |||
|  | 2d085b42bf | ||
| 920323bc78 | |||
| 6f3bdbf176 | |||
| 8251bed720 | |||
| 508c3f3954 | |||
|  | 2f524da992 | ||
|  | 7447ae3f4d | ||
|  | 5c9af2b914 | ||
|  | 818d2a775d | ||
|  | 5119c46963 | ||
|  | bc8017ff71 | ||
|  | 45772f0b49 | ||
|  | fc6f784db1 | ||
|  | afa4983725 | 
| @ -5,9 +5,9 @@ | ||||
|         "name": "default", | ||||
|         "material": { | ||||
|           "certpath": "/Users/wangzhongjie/.ohos/config/openharmony/default_subject-two_Kl4t-ZSvZeuUm9s8O-e6FIH2VFR_OaNyhDP8kPjIWgU=.cer", | ||||
|           "storePassword": "0000001B0A8E97F78561FFE1B2E5B57C296BFC3D297047253237158BC25CD7077892C41C1C83FAFFDE4A0A", | ||||
|           "storePassword": "0000001B16BF173FAE0A4B7B6556BEFBF019A66FA1332BD4CE16B85D6FDCDB05CDB01EBBC32A8B55F90168", | ||||
|           "keyAlias": "debugKey", | ||||
|           "keyPassword": "0000001B654E765B79C902CB9E3A6D97A40F5852412CEE5AC37E949F430C754DB02327838E925EDF861314", | ||||
|           "keyPassword": "0000001B2679DA5771C677985ED3A052179731797CD7638B37C0C5DE3D97C1041D0E80EB0D0947ADF133B0", | ||||
|           "profile": "/Users/wangzhongjie/.ohos/config/openharmony/default_subject-two_Kl4t-ZSvZeuUm9s8O-e6FIH2VFR_OaNyhDP8kPjIWgU=.p7b", | ||||
|           "signAlg": "SHA256withECDSA", | ||||
|           "storeFile": "/Users/wangzhongjie/.ohos/config/openharmony/default_subject-two_Kl4t-ZSvZeuUm9s8O-e6FIH2VFR_OaNyhDP8kPjIWgU=.p12" | ||||
|  | ||||
| @ -25,7 +25,7 @@ interface WR { | ||||
| } | ||||
| 
 | ||||
| // 通用监管接口
 | ||||
| export async function writeObjectOut(params, filePath?: string): Promise<WR> { | ||||
| export async function writeObjectOut(params, externalTransmission: boolean, filePath?: string): Promise<WR> { | ||||
|   const singlePlay = globalThis.singlePlay | ||||
|   if (singlePlay) { | ||||
|     return { code: 1 } | ||||
| @ -54,8 +54,7 @@ export async function writeObjectOut(params, filePath?: string): Promise<WR> { | ||||
| 
 | ||||
|   //新监管调用
 | ||||
|   if (globalThis.isJGNew) { | ||||
| 
 | ||||
|     return await writeObjectOutNew(params, filePath) | ||||
|     return await writeObjectOutNew(params, filePath, externalTransmission) | ||||
|   } | ||||
|   drvexam.zp = drvexam.zp === undefined ? undefined : encodeURIComponent(drvexam.zp) | ||||
| 
 | ||||
|  | ||||
| @ -1,8 +1,11 @@ | ||||
| import { getSyncData } from '../common/service/initable'; | ||||
| import request from "../common/utils/request" | ||||
| 
 | ||||
| let baseHost = globalThis.host; | ||||
| import FileUtil from '../common/utils/File'; | ||||
| import FileLog from '../pages/judgeSDK/utils/fileLog'; | ||||
| import pasteboard from '@ohos.pasteboard'; | ||||
| import Want from '@ohos.app.ability.Want'; | ||||
| 
 | ||||
| //监管接口序列号映射
 | ||||
| const gjxlhObj = { | ||||
| @ -19,7 +22,7 @@ interface WR{ | ||||
|   code: number | ||||
| } | ||||
| 
 | ||||
| export default async function writeObjectOutNew(data,filePath): Promise<WR> { | ||||
| export default async function writeObjectOutNew(data, filePath, externalTransmission): Promise<WR> { | ||||
|   const fileUtil = new FileUtil(globalThis.context); | ||||
|   const {jkid , drvexam} = data; | ||||
|   const basic = await getBasicConfig(jkid); | ||||
| @ -28,17 +31,22 @@ export default async function writeObjectOutNew(data,filePath): Promise<WR> { | ||||
| 
 | ||||
|   if (filePath) { | ||||
|     await fileUtil.editFile(`${filePath}/wuxi_exam_data.txt`, JSON.stringify({ | ||||
|       wglb,jkxlh,glbm,jgbh,sjbs, | ||||
|       wglb, | ||||
|       jkxlh, | ||||
|       glbm, | ||||
|       jgbh, | ||||
|       sjbs, | ||||
|       data: params.data, | ||||
|       file:{...params.file,param:[]}, | ||||
|       file: { | ||||
|         ...params.file, param: [] | ||||
|       }, | ||||
|     })); | ||||
|   } | ||||
| 
 | ||||
|   // let connectTimeout = sjbs === '02-21-000014' ?60000:1
 | ||||
|   console.info('surenjun', '调用新监管') | ||||
|   let temp | ||||
|   try { | ||||
|     temp = await request({ | ||||
|   let requestData = { | ||||
|     host: globalThis.JGHOST, | ||||
|     method: 'post', | ||||
|     //是否是新中心
 | ||||
| @ -63,7 +71,20 @@ export default async function writeObjectOutNew(data,filePath): Promise<WR> { | ||||
|                     </writeObjectOut> | ||||
|                  </SOAP-ENV:Body> | ||||
|                </SOAP-ENV:Envelope>`, | ||||
|     }) | ||||
|   } | ||||
|   try { | ||||
|     if (!externalTransmission) { | ||||
|       temp = await request(requestData) | ||||
|     } else { | ||||
|       let systemPasteboard = pasteboard.getSystemPasteboard() | ||||
|       let pasteData = pasteboard.createData(pasteboard.MIMETYPE_TEXT_PLAIN, JSON.stringify(requestData)) | ||||
|       await systemPasteboard.clear() | ||||
|       await systemPasteboard.setData(pasteData) | ||||
| 
 | ||||
|       temp = { | ||||
|         code: 1 | ||||
|       } | ||||
|     } | ||||
|   } catch (e) { | ||||
|     console.log("新监管错误") | ||||
|     temp = e | ||||
| @ -73,7 +94,6 @@ export default async function writeObjectOutNew(data,filePath): Promise<WR> { | ||||
|     await fileUtil.editFile(`${filePath}/wuxi_exam_data.txt`, JSON.stringify(temp) + `\n`); | ||||
|   } | ||||
|   return temp | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| export async function getParams(jkid, drvexam) { | ||||
|  | ||||
| @ -7,12 +7,14 @@ import { takePhoto, deleteAllFileByPiC } from '../../common/service/videoService | ||||
| // import { VideoConfigData } from '../../mock';
 | ||||
| import request from '@ohos.request' | ||||
| import Prompt from '@system.prompt'; | ||||
| import util from '@ohos.util'; | ||||
| 
 | ||||
| import { | ||||
|   delSyncTable, | ||||
|   getDataBaseTable, | ||||
|   getMySystemSetTable, | ||||
|   upDataZhongxinginitialization, | ||||
|   getSyncData, | ||||
|   upDateTable | ||||
| } from '../../common/service/initable' | ||||
| import { GlobalConfig } from '../../config/index' | ||||
| @ -433,9 +435,11 @@ let fd | ||||
| const devPath = "/dev/ttyS3" | ||||
| 
 | ||||
| function openChuankouFn(callback) { | ||||
|   console.log('SerialOpen in indexservice, path=' + devPath) | ||||
| 
 | ||||
|   //TODO 自动挡车不读取串口
 | ||||
|   getSyncData('ES_CARINFO').then(result => { | ||||
|     const carInfo = result[0] || {}; | ||||
|     globalThis.carInfo.kscx = carInfo.kscx | ||||
|     console.info('srj ES_CARINFO=>',JSON.stringify(carInfo)) | ||||
|     if(carInfo.kscx == 'C1'){ | ||||
|       testNapi.SerialOpenAsync(devPath, (fd) => { | ||||
|         globalThis.fd = fd; | ||||
|         globalThis.num = 0 | ||||
| @ -445,15 +449,17 @@ function openChuankouFn(callback) { | ||||
|         }); | ||||
|       }); | ||||
|     } | ||||
|   }) | ||||
| } | ||||
| 
 | ||||
| function getChuankouFnMsg() { | ||||
|   let timeout = 50000; // 2秒超时
 | ||||
|   let databuff = [0x61, 0xAA, 0x0A, 0X15, 0X00]; // send ABCDE
 | ||||
|   testNapi.SerialSendAsync(globalThis.fd, databuff, (ret) => { | ||||
|     testNapi.SerialRecvAsync(globalThis.fd, timeout, (revTestInfo) => { | ||||
| 
 | ||||
|       const message = revTestInfo?.recevedBuf?.toString() | ||||
|       if (message == '') { | ||||
|       let msgBuf = util.TextDecoder.create().decodeWithStream(new Uint8Array(revTestInfo?.recevedBuf)) | ||||
|       if (message == '' || msgBuf == '') { | ||||
|         globalThis.num = 1 | ||||
|         // clearInterval(chuankou)
 | ||||
|         testNapi.SerialClose(globalThis.fd); | ||||
| @ -464,16 +470,8 @@ function getChuankouFnMsg() { | ||||
|         return | ||||
|       } | ||||
|       const msg = message?.split(',') | ||||
|       if (!msg?.length) { | ||||
| 
 | ||||
|       } else if (msg[0] != '98' || msg[1] != '85' || msg.length < 9) { | ||||
| 
 | ||||
|       } else if (msg.length < 12) { | ||||
| 
 | ||||
|       } else { | ||||
|         globalThis.chuankoMsg = msg[9] | ||||
|       } | ||||
| 
 | ||||
|       let dang = Number(msgBuf?.split(",")?.[1]?.split('\r')[0] || 0) | ||||
|       globalThis.chuankoMsg =( msg[9] === '' || msg[9] >10 ) ? dang: msg[9] | ||||
|       setTimeout(() => { | ||||
|         getChuankouFnMsg() | ||||
|       }, 500) | ||||
|  | ||||
| @ -3,7 +3,7 @@ import { getSyncData } from '../service/initable'; | ||||
| import hilog from '@ohos.hilog'; | ||||
| import FileUtil from '../../common/utils/File' | ||||
| import { GlobalConfig } from '../../config/index' | ||||
| 
 | ||||
| const TAG = 'socketTag[TcpDemo.TcpClient]' | ||||
| export async function getTCP(flag=false) { | ||||
|   globalThis.getCloseTcp=true | ||||
|   const fileUtil = new FileUtil(globalThis.context) | ||||
| @ -35,10 +35,16 @@ export async function getTCP(flag=false) { | ||||
|           console.log('ttttttt00') | ||||
| 
 | ||||
|           clearInterval(globalThis.intervalSendmsg) | ||||
|           globalThis.intervalSendmsg=setInterval(()=>{ | ||||
|           globalThis.intervalSendmsg=setInterval(async()=>{ | ||||
|             console.log('getCloseTcp',globalThis.carInfo.carNo) | ||||
|             if(!globalThis.getCloseTcp){ | ||||
|               globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002
 | ||||
|               await globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002
 | ||||
|               globalThis.tcpStep+=1 | ||||
|               if(globalThis.tcpStep>30){ | ||||
|                 console.log(TAG,'tcp重连开始') | ||||
|                 globalThis.tcpStep=0 | ||||
|                 getTCP() | ||||
|               } | ||||
|             } | ||||
|           },1000/3) | ||||
|           globalThis.TcpClient.onError((val) => { | ||||
| @ -68,10 +74,16 @@ export async function getTCP(flag=false) { | ||||
|       console.log('ttttttt12') | ||||
| 
 | ||||
|       clearInterval(globalThis.intervalSendmsg) | ||||
|       globalThis.intervalSendmsg=setInterval(()=>{ | ||||
|       globalThis.intervalSendmsg=setInterval(async()=>{ | ||||
|         // console.log('getCloseTcp',globalThis.getCloseTcp)
 | ||||
|         if(!globalThis.getCloseTcp){ | ||||
|           globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002
 | ||||
|           await globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002
 | ||||
|           globalThis.tcpStep+=1 | ||||
|           if(globalThis.tcpStep>30){ | ||||
|             console.log(TAG,'tcp重连开始') | ||||
|             globalThis.tcpStep=0 | ||||
|             getTCP() | ||||
|           } | ||||
|         } | ||||
|       },1000/3) | ||||
|       globalThis.TcpClient.onError((val) => { | ||||
|  | ||||
| @ -148,13 +148,12 @@ export default class TcpClient { | ||||
|           this.tcpSendNum=0 | ||||
|           return | ||||
|         } | ||||
|         globalThis.getCloseTcp=true | ||||
|         console.log(`${TAG} TCPsend error ${JSON.stringify(err)}`) | ||||
|         // this.writeLog({
 | ||||
|         //   time:dateFormat(new Date()),
 | ||||
|         //   message: `${TAG} TCPsend error ${JSON.stringify(err)}`,
 | ||||
|         // })
 | ||||
|         reslove(false) | ||||
|         reject(false) | ||||
|       }); | ||||
|     }) | ||||
|   } | ||||
| @ -165,6 +164,7 @@ export default class TcpClient { | ||||
|       //   time:dateFormat(new Date()),
 | ||||
|       //   PLC:`${TAG} Tcponmessage`,
 | ||||
|       // })
 | ||||
|       globalThis.tcpStep=0 | ||||
|       globalThis.tcpUdpError = false | ||||
|       if (value) { | ||||
|         callback && callback(value.message) | ||||
|  | ||||
| @ -38,7 +38,7 @@ export default class EntryAbility extends UIAbility { | ||||
|     // Main window is created, set main page for this ability
 | ||||
|     hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); | ||||
|     await tcpUtil.init() | ||||
| 
 | ||||
|     globalThis.tcpStep=0 | ||||
| 
 | ||||
|     globalThis.carInfo = {} | ||||
|     globalThis.examinerInfo = {} | ||||
|  | ||||
| @ -677,6 +677,11 @@ struct Index { | ||||
|     }, 1000) | ||||
|     this.createAlbum() | ||||
| 
 | ||||
|     getSyncData('ES_CARINFO').then(result => { | ||||
|       const carInfo = result[0] || {}; | ||||
|       globalThis.carInfo.kscx = carInfo.kscx | ||||
|     }) | ||||
| 
 | ||||
|     //  clearInterval(globalThis.demo) | ||||
|     // globalThis.demo= setInterval(()=>{ | ||||
|     //   const str= {"carId":"1062","examinationRoomId":"2","videoVersion":"1.0","judgeVersion":"2023.09.30.1","shellVersion":"2023.12.13.01","host":"http://172.37.55.191:8082"} | ||||
|  | ||||
| @ -442,7 +442,7 @@ struct Index { | ||||
|         const ddxkKsxmArr = examItemsArrs[2]?.split(',').filter(item => item) || [] | ||||
|         const ddxkKfArr = examItemsArrs[3]?.split('^').filter(item => item) || [] | ||||
|         if (judgeConfigObj['432'] == 2 || examSubject == 2) { | ||||
|           //TODO 带项目带里程 | ||||
| 
 | ||||
|           if (ddxkKsxmArr?.length) { | ||||
|             //断点续考 | ||||
|             ddxkKsxmArr.forEach(xmdm => { | ||||
| @ -455,6 +455,8 @@ struct Index { | ||||
|             }) | ||||
|             this.ddxkKsxmArr = ddxkKsxmArr | ||||
|           } | ||||
|           this.specialkf = examItemsArrs[4]; | ||||
|           this.yklc = Number(examItemsArrs[1]) || 0 | ||||
|         } | ||||
|         //扣分续考 | ||||
|         ddxkKfArr.forEach((kf) => { | ||||
| @ -480,6 +482,7 @@ struct Index { | ||||
|         this.ddxkKfArr = ddxkKfArr | ||||
|         this.ddxkTime = Date.parse(startTime); | ||||
|         this.isDdxk = true | ||||
| 
 | ||||
|       } | ||||
|     } | ||||
| 
 | ||||
| @ -572,7 +575,7 @@ struct Index { | ||||
|   } | ||||
| 
 | ||||
|   // 上传考试里程 | ||||
|   async uploadMileage() { | ||||
|   async uploadMileage(specialkf) { | ||||
|     if (!globalThis.singlePlay) { | ||||
|       const {lsh,startExamTime:kskssj,jl:kslc} = this | ||||
|       const { carId ,examinationRoomId} = globalThis.carInfo; | ||||
| @ -581,7 +584,9 @@ struct Index { | ||||
|         examinationRoomId, | ||||
|         lsh, | ||||
|         kskssj, | ||||
|         kslc | ||||
|         //考试里程,单位cm | ||||
|         kslc:kslc * 100, | ||||
|         specialkf | ||||
|       }) | ||||
|     } | ||||
|   } | ||||
| @ -1443,4 +1448,8 @@ struct Index { | ||||
|   @State errorMsg: string = '' | ||||
|   @State isErrorMsgEnd: boolean = false | ||||
|   @State disConnectErrorOpen: boolean = false | ||||
|   //开始考试特殊标记 | ||||
|   @State specialkf:string = '' | ||||
|   //已考里程 | ||||
|   @State yklc:number = 0 | ||||
| } | ||||
|  | ||||
| @ -91,6 +91,7 @@ struct UserInfo { | ||||
|     'Param398': '0', //考前上车准备 | ||||
|     'Param835': '0', //考前上车准备 | ||||
|     'Param850': '0', //考前上车准备 | ||||
|     'Param853': '0', //未熄火不能开始考试 | ||||
|   } | ||||
|   @State startExam: boolean = false | ||||
|   // 过程照片拍照 | ||||
| @ -537,6 +538,9 @@ struct UserInfo { | ||||
|         if (sys.v_no === '770') { | ||||
|           that.systemParam.Param770Str = sys.v_value; | ||||
|         } | ||||
|         if(sys.v_no === '853'){ | ||||
|           that.systemParam.Param853 = sys.v_value; | ||||
|         } | ||||
|         if (sys.v_no === '835') { | ||||
|           that.systemParam.Param835 = sys.v_value; | ||||
|         } | ||||
| @ -946,8 +950,10 @@ struct UserInfo { | ||||
|     const {isCheckFireOpen} = judgeConfig | ||||
|     const {systemParam,isBoardPrePareSetPopupOpen} = this; | ||||
|     const Param803Str = systemParam.Param803Str | ||||
|     if (Param803Str === '') { | ||||
|     const Param853Str = systemParam.Param853 | ||||
|     if (Param803Str === '' && Param853Str != '1') { | ||||
|       return true | ||||
| 
 | ||||
|     } | ||||
|     return new Promise((resolve, reject) => { | ||||
|       if (isCheckFireOpen) { | ||||
| @ -963,6 +969,14 @@ struct UserInfo { | ||||
|       const ygd = msgArr[8]; | ||||
|       const ssc = msgArr[13]; | ||||
|       const dw = msgArr[28]; | ||||
|       if(Param853Str == '1'){ | ||||
|         this.avPlayer.playAudio(['voice/熄火.mp3']) | ||||
|         promptAction.showToast({ | ||||
|           message: '请熄火', | ||||
|           duration: 4000 | ||||
|         }) | ||||
|         reject(false) | ||||
|       } | ||||
|       // 开始考试信号检测 | ||||
|       if (Param803Str !== '') { | ||||
|         //安全带 | ||||
| @ -1080,7 +1094,7 @@ struct UserInfo { | ||||
|       jkid: '17C51', | ||||
|     } | ||||
|     console.info('surenjunjianguan', JSON.stringify(param)) | ||||
|     const temp = await writeObjectOut(param); | ||||
|     const temp = await writeObjectOut(param,false); | ||||
|     globalThis.lsh = this.currentUser.lsh | ||||
|     globalThis.ksyh = this.currentUser.ksy1sfzmhm | ||||
|     return temp | ||||
| @ -1482,4 +1496,5 @@ type systemParam = { | ||||
|   'Param398': string, //考前上车准备 | ||||
|   'Param835': string, //考前上车准备 | ||||
|   'Param850': string, //考前上车准备 | ||||
|   'Param853': string, //未熄火不能开始考试 | ||||
| } | ||||
| @ -226,7 +226,7 @@ export default struct DeductedPopup { | ||||
|         kssj: time | ||||
|       }, | ||||
|     } | ||||
|     const code = await writeObjectOut(beginData) | ||||
|     const code = await writeObjectOut(beginData,false) | ||||
|     //TODO code待处理 | ||||
|     // if (code == 1) { | ||||
|     // | ||||
| @ -257,7 +257,7 @@ export default struct DeductedPopup { | ||||
|         ksdd: decodeURI(ksdd) | ||||
|       } | ||||
|     }; | ||||
|     const code = await writeObjectOut(photoData); | ||||
|     const code = await writeObjectOut(photoData,false); | ||||
|     console.info('surenjun uploadProgressPhoto end',) | ||||
|   } | ||||
| 
 | ||||
| @ -285,7 +285,7 @@ export default struct DeductedPopup { | ||||
|         kfsj: time | ||||
|       } | ||||
|     } | ||||
|     const code = await writeObjectOut(kfData); | ||||
|     const code = await writeObjectOut(kfData,false); | ||||
|   } | ||||
| 
 | ||||
|   // 项目结束 | ||||
| @ -309,7 +309,7 @@ export default struct DeductedPopup { | ||||
|         jssj: time | ||||
|       } | ||||
|     } | ||||
|     const code = await writeObjectOut(endProjectData); | ||||
|     const code = await writeObjectOut(endProjectData,false); | ||||
|   } | ||||
| 
 | ||||
|   //考试结束 | ||||
| @ -335,7 +335,7 @@ export default struct DeductedPopup { | ||||
|         dwlc: '', | ||||
|       } | ||||
|     } | ||||
|     const code = await writeObjectOut(endData); | ||||
|     const code = await writeObjectOut(endData,false); | ||||
|   } | ||||
| 
 | ||||
|   //获取sysset表数据 | ||||
|  | ||||
| @ -1,4 +1,5 @@ | ||||
| import libJudgeSdk from 'libJudgeSdk.so' | ||||
| 
 | ||||
| //@ts-ignore
 | ||||
| // import libJudgeSdk from '@ohos.judgesdk'
 | ||||
| /** | ||||
| @ -224,3 +225,11 @@ async  function handle(temp,fnName):Promise<string>{ | ||||
|     } | ||||
|   }) | ||||
| } | ||||
| 
 | ||||
| /** | ||||
|  * 获取cpu内存使用情况 | ||||
|  * @returns | ||||
|  */ | ||||
| export function examPeerOccupy() { | ||||
|   return libJudgeSdk.examPeerOccupy() | ||||
| } | ||||
| @ -73,7 +73,6 @@ export interface CARINFO { | ||||
|   FLAG: string, | ||||
|   BK1: string, | ||||
|   BK2: string | ||||
|   //脉冲里程设置
 | ||||
|   X_MCH: string | ||||
| } | ||||
| 
 | ||||
|  | ||||
| @ -56,6 +56,8 @@ import { | ||||
| } from './api/index'; | ||||
| import { getSyncData, upDateTableByArray } from '../../common/service/initable'; | ||||
| import { GlobalConfig } from '../../config'; | ||||
| import Want from '@ohos.app.ability.Want'; | ||||
| 
 | ||||
| const judgeTag = 'SURENJUN_JUDGE' | ||||
| 
 | ||||
| function ifNeedRetry(code: number | string): boolean { | ||||
| @ -115,7 +117,7 @@ export default class Judge { | ||||
|     const examDataArr = examDataStr.split('\n'); | ||||
|     for (let examDataStr of examDataArr) { | ||||
|       const examData = JSON.parse(examDataStr) | ||||
|       const code = await writeObjectOut(examData); | ||||
|       const code = await writeObjectOut(examData,false); | ||||
|     } | ||||
|   } | ||||
|   //上传无锡所过程数据
 | ||||
| @ -468,6 +470,8 @@ export default class Judge { | ||||
|   //所有的科目考试项目(大车&小车)
 | ||||
|   private testKmItems: any | ||||
|   private plcData: any | ||||
|   //特殊扣分标记
 | ||||
|   private specialkf:string = '' | ||||
|   // 获取plc数据
 | ||||
|   getPlcData = async (plc: string) => { | ||||
|     const {fileLog,mndgStr,rmndg} = this; | ||||
| @ -526,7 +530,7 @@ export default class Judge { | ||||
|       const bytes = await this.getMessageHeartbeat(); | ||||
|       bytes && globalThis.judgeUdp.send(bytes) | ||||
| 
 | ||||
|     }, 50) | ||||
|     }, 1000) | ||||
| 
 | ||||
|     globalThis.judgeTimer = judgeTimer; | ||||
|   } | ||||
| @ -538,14 +542,14 @@ export default class Judge { | ||||
|   // 调代理接口是否断网了
 | ||||
|   private isJudgeDisConnect: boolean; | ||||
|   // 项目开始接口同步
 | ||||
|   beginProject = async (ksxm) => { | ||||
|   beginProject = async (ksxm,xmxh?:string) => { | ||||
|     const carInfo = globalThis.carInfo; | ||||
|     const { examSubject,plateNo } = carInfo; | ||||
|     const {judgeUI,fileLog,getSbbm,xmxh,filePath} = this; | ||||
|     const {judgeUI,fileLog,getSbbm,filePath} = this; | ||||
|     const {lsh,idCard,serialNumber,projectsObj,ksdd,kslx,xldm} = judgeUI | ||||
|     const time = await getCurrentTime(); | ||||
|     const project = projectsObj[ksxm] | ||||
|     const sbxh = getSbbm(ksxm, xmxh) | ||||
|     const sbxh = getSbbm(ksxm, xmxh || this.xmxh) | ||||
|     const data = { | ||||
|       //系统类别   接口序列号             接口标识
 | ||||
|       xtlb: '17', jkxlh: serialNumber, jkid: '17C52', | ||||
| @ -572,15 +576,15 @@ export default class Judge { | ||||
|     promptWxCode('17C52', code) | ||||
|   } | ||||
|   // 项目结束接口同步
 | ||||
|   endProject = async (ksxm) => { | ||||
|   endProject = async (ksxm,xmxh?:string) => { | ||||
|     const carInfo = globalThis.carInfo; | ||||
|     const deviceNo = globalThis.deviceNo; | ||||
|     const { examSubject,plateNo,carNo } = carInfo; | ||||
|     const {judgeUI,fileLog,getSbxh,xmxh,getSbbm,filePath} = this; | ||||
|     const {judgeUI,fileLog,getSbxh,getSbbm,filePath} = this; | ||||
|     const {lsh,idCard,serialNumber,projectsObj,cdsbInfoObj,ksdd,kslx,xldm,} = judgeUI | ||||
|     const time = await getCurrentTime(); | ||||
|     const project = projectsObj[ksxm] | ||||
|     const sbxh = examSubject == 3 ? undefined : getSbbm(ksxm, xmxh) | ||||
|     const sbxh = examSubject == 3 ? undefined : getSbbm(ksxm, xmxh || this.xmxh) | ||||
| 
 | ||||
|     const data = { | ||||
|       xtlb: '17', jkxlh: serialNumber, jkid: '17C55', | ||||
| @ -600,6 +604,12 @@ export default class Judge { | ||||
|       } | ||||
|     } | ||||
|     const {code} = await this.sendWriteObjectOut(data, filePath) | ||||
| 
 | ||||
|     //科三 & 432=3
 | ||||
|     if(examSubject == 3 && this.judgeUI.judgeConfigObj['432'] == 2){ | ||||
|       this.judgeUI.uploadMileage() | ||||
|     } | ||||
| 
 | ||||
|     if (code === 2300007) { | ||||
|       this.isJudgeDisConnect = true; | ||||
|     } | ||||
| @ -613,10 +623,12 @@ export default class Judge { | ||||
|   private videoData: any | ||||
|   private disConnectNum: number = 0; | ||||
|   //调用监管接口
 | ||||
| 
 | ||||
|   private externalTransmission: boolean = false | ||||
|   // 计算是否启动
 | ||||
|   private whetherToStart: boolean | ||||
|   //调用监管接口
 | ||||
|   sendWriteObjectOut = async (data, filePath) => { | ||||
|     const temp = await writeObjectOut(data, filePath); | ||||
|     const temp = await writeObjectOut(data, this.externalTransmission, filePath); | ||||
|     console.log("wzj", JSON.stringify(temp)) | ||||
|     if (this.disConnectNum == 0) { | ||||
|       console.log("wzj", "第一次发送", JSON.stringify(data)) | ||||
| @ -633,12 +645,34 @@ export default class Judge { | ||||
|         } | ||||
|         return await this.sendWriteObjectOut(data, filePath) | ||||
|       } | ||||
|       if (this.disConnectNum >= 5) { | ||||
|         this.externalTransmission = true | ||||
|         let want: Want = { | ||||
|           bundleName: 'com.oh.upload', // 替换为你的应用包名
 | ||||
|           abilityName: 'EntryAbility', // 你的 Service Ability 名称
 | ||||
|           moduleName: 'entry', // 你的模块名称,通常是 'entry',
 | ||||
|           parameters: {} | ||||
|         }; | ||||
|         try { | ||||
|           let context = this.judgeUI.context; | ||||
|           context.startAbility(want) | ||||
|             .then(() => { | ||||
|             }) | ||||
|             .catch((error) => { | ||||
|               console.error(`拉起应用失败: ${error.code} - ${error.message}`); | ||||
|             }); | ||||
|         } catch (error) { | ||||
|           console.error(`启动Ability异常: ${error.message}`); | ||||
|         } | ||||
|         return await this.sendWriteObjectOut(data, filePath) | ||||
|       } | ||||
|     } | ||||
| 
 | ||||
|     if (this.disConnectNum >= 5) { | ||||
|       console.info('surenjun', '123') | ||||
|       this.judgeUI.errorMsg = '当前的考试过程信息网络传输异常,程序点击确认将重启!'; | ||||
|       this.judgeUI.disConnectErrorOpen = true | ||||
| 
 | ||||
|     } | ||||
| 
 | ||||
|     this.disConnectNum = 0 | ||||
| @ -833,15 +867,15 @@ export default class Judge { | ||||
|           xmdm: xmdm * 1, kfdm | ||||
|         } | ||||
|       })) : [], | ||||
|       //TODO 已考里程待修改
 | ||||
|       yklc: 0, | ||||
|       yklc: judgeUI.yklc, | ||||
|       special: [], | ||||
|       //TODO 科目三参数临时写死
 | ||||
|       sczb: (sczb === undefined || sczb == 0) ? 0 : 1, | ||||
|       sczbkf: kfdm, | ||||
|       dmndg: false, | ||||
|       mfxx: false, | ||||
|       mfxxn: false | ||||
|       mfxxn: false, | ||||
|       //科目三特殊扣分项
 | ||||
|       specialkf:judgeUI.specialkf, | ||||
|     } | ||||
|     console.info(judgeTag, '5.获取开始考试数据完成') | ||||
|     return beginInfo | ||||
| @ -1066,7 +1100,7 @@ export default class Judge { | ||||
|         if (!isEnd) { | ||||
|           judgeTask.addTask(async () => { | ||||
|             console.info(judgeTag, `项目开始-${xmdm}-${projectsObj[xmdm].name}`) | ||||
|             await beginProject(xmdm) | ||||
|             await beginProject(xmdm,xmxh) | ||||
|           }, { | ||||
|             isDelay: true | ||||
|           }) | ||||
| @ -1095,7 +1129,7 @@ export default class Judge { | ||||
|           if (!projectIsEnd) { | ||||
|             judgeTask.addTask(async () => { | ||||
|               console.info(judgeTag, `项目结束-${xmdm}-${projectsObj[xmdm].name}`) | ||||
|               await endProject(xmdm); | ||||
|               await endProject(xmdm,xmxh) | ||||
|               this.xmmcSingleCode = 0; | ||||
|               this.xmmcEndCode = undefined; | ||||
|             }, { | ||||
| @ -1173,8 +1207,8 @@ export default class Judge { | ||||
|     const {lsh,idCard,serialNumber,ksdd,projectsObj} = judgeUI | ||||
|     const time = await getCurrentTime(); | ||||
|     const project = getProjectInfo(ksxm); | ||||
|     //科目三夜间行驶.模拟灯光、上车准备出现通用评判,ksxm为当前进行的项目
 | ||||
|     const checkProjects = ['17', '41', '1']; | ||||
|     //科目三夜间行驶.模拟灯光、上车准备出现非本项目的扣分,ksxm需转换为为当前进行的项目
 | ||||
|     const checkProjects = ['1', '41', '17']; | ||||
|     //获取正在进行的项目
 | ||||
|     const inProjects = Reflect.ownKeys(projectsObj).filter(projectKey => projectsObj[projectKey].type == 2); | ||||
| 
 | ||||
| @ -1184,7 +1218,8 @@ export default class Judge { | ||||
|         commonKsxm = projectCode | ||||
|       } | ||||
|     }) | ||||
| 
 | ||||
|     console.info(judgeTag, 'commonKsxm=>' + commonKsxm) | ||||
|     console.info(judgeTag, 'project=>' + project) | ||||
|     const data = { | ||||
|       xtlb: '17', jkxlh: serialNumber, jkid: '17C53', | ||||
|       drvexam: { | ||||
| @ -1194,7 +1229,7 @@ export default class Judge { | ||||
|           ? (commonKsxm | ||||
|             ? (projectsObj[commonKsxm].projectCodeCenter) | ||||
|             : (examSubject == 3 ? 30000 : (xmmcEndCode == undefined ? 10000 : xmmcEndCode))) | ||||
|           : project.projectCodeCenter, | ||||
|           : (projectsObj[commonKsxm]?.projectCodeCenter || project.projectCodeCenter), | ||||
|         kfxm: kf.markcatalog, | ||||
|         kfxmmx: `${ksxm},${kf.markserial}`, | ||||
|         sfzmhm: idCard, | ||||
| @ -1714,7 +1749,7 @@ export default class Judge { | ||||
|   // 检测差分状态
 | ||||
|   checkDwzt = async (type) => { | ||||
|     const {avPlayer} = this; | ||||
|     const judgeConfig = this.judgeUI.judgeConfig; | ||||
|     const config499 = this.judgeUI.judgeConfigObj['499']; | ||||
|     switch (type) { | ||||
|       case 0: | ||||
|         this.judgeUI.isDwztRight = true; | ||||
| @ -1722,10 +1757,17 @@ export default class Judge { | ||||
| 
 | ||||
|       case 1: | ||||
|         this.judgeUI.dwztErrorVisible = true; | ||||
|         clearInterval(this.judgeUI.timer); | ||||
|         clearInterval(globalThis.judgeTimer) | ||||
|         avPlayer.playAudio([`voice/差分状态异常.mp3`], true) | ||||
|         setTimeout(() => { | ||||
|           try { | ||||
|             this.checkExamIsEnd(true); | ||||
|           } catch (e) { | ||||
|             this.closeAllFiles() | ||||
|             router.back() | ||||
|         }, 3000) | ||||
|           } | ||||
|         }, config499 * 1000) | ||||
|         break; | ||||
| 
 | ||||
|       case 2: | ||||
| @ -1810,6 +1852,7 @@ export default class Judge { | ||||
|       this.handleRealExam(strData, callBack) | ||||
|     }) | ||||
| 
 | ||||
| 
 | ||||
|     await examJudgeSetPerformCallback(async (info) => { | ||||
|       console.info('评判实时数据', info) | ||||
|       const performInfo = JSON.parse(info) | ||||
| @ -1821,6 +1864,11 @@ export default class Judge { | ||||
|       this.judgeUI.jl = jl | ||||
|       //TODO 待优化 跨组件传值不生效
 | ||||
|       globalThis.laneData = performInfo.lane; | ||||
|       //特殊扣分标记上传中心
 | ||||
|       if(performInfo.specialkf !== this.specialkf){ | ||||
|         this.judgeUI.uploadMileage(performInfo.specialkf) | ||||
|         this.specialkf = performInfo.specialkf | ||||
|       } | ||||
|     }) | ||||
| 
 | ||||
|     // 3.开始考试
 | ||||
|  | ||||
| @ -55,11 +55,10 @@ export default class FileModel{ | ||||
|       return content; | ||||
|     }catch (e){ | ||||
|       console.info('surenjun',JSON.stringify(e)) | ||||
|       // promptAction.showToast({
 | ||||
|       //   message:`请检查模型路径${folderPath}/${fileName}是否正确!`,
 | ||||
|       //   duration:4000
 | ||||
|       // })
 | ||||
|       return ''; | ||||
|       promptAction.showToast({ | ||||
|         message:`请检查模型路径${folderPath}/${fileName}是否正确!`, | ||||
|         duration:4000 | ||||
|       }) | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|  | ||||
| @ -13,25 +13,9 @@ interface Params{ | ||||
| } | ||||
| 
 | ||||
| export default class FilePhoto { | ||||
| 
 | ||||
|   public mediaTest | ||||
|   private params: Params | ||||
|   private context: any | ||||
|   private fileUtil:FileUtil | ||||
|   public mediaTest | ||||
| 
 | ||||
|   constructor(context) { | ||||
|     (async ()=>{ | ||||
|       //TODO 309参数 获取拍照摄像头拍照通道
 | ||||
|       const fileUtil = new FileUtil(context) | ||||
|       const strConfig = await fileUtil.readFile('/mnt/hmdfs/100/account/device_view/local/files/duolun/config/config3.txt'); | ||||
|       const config = JSON.parse(strConfig) | ||||
|       const  {userName,ip,pwd,port,rlls,pztd} = config | ||||
|       this.params = {userName,pwd,ip,port,rlls,pztd} | ||||
|       this.context = context | ||||
|       this.fileUtil = fileUtil | ||||
|     })() | ||||
|   } | ||||
| 
 | ||||
|   public getPhoto = async () => { | ||||
|     const { params } = this; | ||||
|     if (!judgeConfig.isPhotoOpen) { | ||||
| @ -52,5 +36,26 @@ export default class FilePhoto{ | ||||
|       } | ||||
|     } | ||||
|   } | ||||
|   private fileUtil: FileUtil | ||||
| 
 | ||||
|   constructor(context) { | ||||
|     (async () => { | ||||
|       //TODO 309参数 获取拍照摄像头拍照通道
 | ||||
|       const fileUtil = new FileUtil(context) | ||||
|       const strConfig = | ||||
|         await fileUtil.readFile('/mnt/hmdfs/100/account/device_view/local/files/duolun/config/config3.txt'); | ||||
|       const config = JSON.parse(strConfig) | ||||
|       const { userName, ip, pwd, port, rlls, pztd } = config | ||||
|       this.params = { | ||||
|         userName, | ||||
|         pwd, | ||||
|         ip, | ||||
|         port, | ||||
|         rlls, | ||||
|         pztd | ||||
|       } | ||||
|       this.context = context | ||||
|       this.fileUtil = fileUtil | ||||
|     })() | ||||
|   } | ||||
| } | ||||
| @ -107,6 +107,8 @@ export function getKmProjectVoice( | ||||
|   const param544Str = judgeConfig['544']?.split(',') || []; | ||||
|   const param405Str = judgeConfig['405'] || 0; | ||||
| 
 | ||||
|   console.info('surenjun => param544Str.length',param544Str.length) | ||||
| 
 | ||||
|   const {num,count,road} = lane | ||||
|   if(examSubject == 2){ | ||||
|     return projectCode | ||||
| @ -317,14 +319,12 @@ export const plcStrToJson = async (plc:string) =>{ | ||||
|     }, | ||||
|     gps:{ | ||||
|       //办卡类型    定位差分状态
 | ||||
|       bklx:Number(p[56]), dwzt:p[83], | ||||
|       bklx:p[56], dwzt:p[83], | ||||
|       //@ts-ignore 角度差分状态
 | ||||
|       jdzt:p[92].split('-')[0]*1, | ||||
|       //一代机、三代机经纬度数据兼容
 | ||||
|       //gps时间 经度                                       纬度
 | ||||
|       sj:time, jd:Math.max(Number(p[95]),Number(p[96])), wd:Math.min(Number(p[95]),Number(p[96])), | ||||
|       //航向角      俯仰角      海拔高       高度差     速度
 | ||||
|       hxj:p[90], fyj:p[91], hbg:p[85], gdc:p[86], sd:p[97], | ||||
|       //gps数据
 | ||||
|       //gps时间 经度      纬度       航向角      俯仰角      海拔高       高度差     速度
 | ||||
|       sj:time, jd:p[96], wd:p[95], hxj:p[90], fyj:p[91], hbg:p[85], gdc:p[86], sd:p[97], | ||||
|       //龄期      经度因子     纬度因子      定位搜星数
 | ||||
|       age:p[87], jdyz:p[89], wdyz:p[88], dwsxs:p[84] || 0, | ||||
|       //@ts-ignore 角度搜星数
 | ||||
| @ -350,7 +350,7 @@ export const plcStrToWXJson = async (plc:string) =>{ | ||||
|   const timeStr = p[93] + '' + p[94]; | ||||
|   const gps = { | ||||
|     //办卡类型    定位差分状态
 | ||||
|     bklx:Number(p[56]), dwzt:p[83], | ||||
|     bklx:p[56], dwzt:p[83], | ||||
|     // 经度      纬度       航向角      俯仰角      海拔高       高度差     速度
 | ||||
|     jd:p[96], wd:p[95], hxj:p[90], fyj:p[91], hbg:p[85], gdc:p[86], sd:p[97], | ||||
|     //龄期      经度因子     纬度因子      定位搜星数
 | ||||
|  | ||||
| @ -1,6 +1,7 @@ | ||||
| //考试回放开关
 | ||||
| export const judgeConfig = { | ||||
|   version:'2024.08.21.01', | ||||
|   // 外壳版本号
 | ||||
|   version: "2025.05.26.01", | ||||
|   //本地目录开关
 | ||||
|   isTrajectoryOpen: false, | ||||
|   //是否开启拍照
 | ||||
| @ -14,13 +15,13 @@ export const judgeConfig = { | ||||
|   //轨迹回放是否开启Udp
 | ||||
|   udpOpen: true, | ||||
|   // 本地模型地址
 | ||||
|   // modelPath: 'models/model_enc',
 | ||||
|   modelPath: 'models/model_enc', | ||||
|   // 济南科目三
 | ||||
|   trajectoryPath: 'logs/2025_04_23_09_50_55_2504755332926_320924199111132926_陈静/judge_exam_data.txt', | ||||
|   trajectoryPath: 'logs/2024_10_12/2024_10_12_11_50_10_9999427676823_744299437502336256_隋统/judge_exam_data.txt', | ||||
|   //四合一画面配置
 | ||||
|   fourInOneScreen: { | ||||
|     //gps位数
 | ||||
|     gpsDigit:7 | ||||
|     gpsDigit: 6 | ||||
|   }, | ||||
|   // 杭州科目二
 | ||||
|   // trajectoryPath: 'logs/2024_07_19/0000000000001_342323199501470011_测试学员1_2024_07_19_06_49_12/judge_exam_data.txt',
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user