Merge remote-tracking branch 'origin/api10' into api10
This commit is contained in:
		
						commit
						40e7655d87
					
				| @ -121,7 +121,7 @@ export async function writeObjectOut(params: RegulatoryInterfaceParams, filePath | |||||||
| interface UploadExamProgressDataParams { | interface UploadExamProgressDataParams { | ||||||
|   carId: string |   carId: string | ||||||
|   examinationRoomId: string |   examinationRoomId: string | ||||||
|   type: string |   type: number | ||||||
|   time: string |   time: string | ||||||
|   cardNo: string |   cardNo: string | ||||||
|   examData: string |   examData: string | ||||||
|  | |||||||
| @ -1,3 +1,4 @@ | |||||||
|  | import common from '@ohos.app.ability.common'; | ||||||
| // ------------------------------ | // ------------------------------ | ||||||
| // 基础共用类型 | // 基础共用类型 | ||||||
| // ------------------------------ | // ------------------------------ | ||||||
| @ -210,6 +211,12 @@ export interface Plc { | |||||||
|   vision: Vision, |   vision: Vision, | ||||||
|   radar: Radar, |   radar: Radar, | ||||||
|   extend: object |   extend: object | ||||||
|  | 
 | ||||||
|  |   //轨迹回放需要 | ||||||
|  |   method?:string | ||||||
|  |   itemno:string | ||||||
|  |   type:1|2 | ||||||
|  |   serial:1|2 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| interface Qfsj { | interface Qfsj { | ||||||
| @ -242,6 +249,8 @@ export interface DrvexamType extends BaseExamFields { | |||||||
|   ksxtbh?: string; |   ksxtbh?: string; | ||||||
|   ksysfzmhm?: string; |   ksysfzmhm?: string; | ||||||
|   Ksy2sfzmhm?: string; |   Ksy2sfzmhm?: string; | ||||||
|  |   ksdd:string | ||||||
|  |   kslx:string | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @ -410,9 +419,113 @@ export interface ProjectRoads{ | |||||||
|   param_12?:string[] |   param_12?:string[] | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | interface MAPPOINT{ | ||||||
|  |   point_no: number, | ||||||
|  |   gps_e: number, | ||||||
|  |   gps_n: number, | ||||||
|  |   point_no_f: number, | ||||||
|  |   point_type: number, | ||||||
|  |   road_code: string, | ||||||
|  |   gps_e_Location: number | ||||||
|  |   gps_n_Location: number | ||||||
|  |   f_gps_e: number, | ||||||
|  |   f_gps_n: number, | ||||||
|  |   passed: number | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | interface MAPITEMPOINTITEM { | ||||||
|  |   point_no: number, | ||||||
|  |   itemno: number, | ||||||
|  |   itemno1: number, | ||||||
|  |   subname: string | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | export interface JudgeUI{ | ||||||
|  |   context: common.UIAbilityContext; | ||||||
|  |   idCard:string | ||||||
|  |   startFullTime:string | ||||||
|  |   mapPointArr: MAPPOINT[] | ||||||
|  |   mapPointItemArr: MAPITEMPOINTITEM[] | ||||||
|  |   judgeConfigObj:object | ||||||
|  |   projectsObj:ProjectInfos | ||||||
|  | 
 | ||||||
|  |   lsh:string | ||||||
|  |   totalScore:number | ||||||
|  |   passingScore:number | ||||||
|  |   serialNumber:string | ||||||
|  |   xldm:string | ||||||
|  |   kslx:string | ||||||
|  |   ksdd:string | ||||||
|  | 
 | ||||||
|  |   isAllProjectsEnd:boolean | ||||||
|  |   examSubject:string | ||||||
|  |   singlePlay:boolean | ||||||
|  |   examMileage:string | ||||||
|  |   jl:number | ||||||
|  | 
 | ||||||
|  |   isDeductedPopShow:boolean | ||||||
|  |   defaultTabIndex:number | ||||||
|  |   isDwztRight:boolean | ||||||
|  |   draw:boolean | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |   sd:string | ||||||
|  |   dw:string | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | export interface Km3JudgeInitConfig{ | ||||||
|  |   map_point: MAPPOINT[] | ||||||
|  |   map_point_item: MAPITEMPOINTITEM[] | ||||||
|  |   iteminfo:[] | ||||||
|  |   roads:string | ||||||
|  |   sharps:string | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | export interface Ksjs{ | ||||||
|  |   // 累计前进距离 | ||||||
|  |   qjjl?: number, | ||||||
|  |   // 累计倒车距离 | ||||||
|  |   dcjl?: number | ||||||
|  |   d1?: number | ||||||
|  |   d2?: number | ||||||
|  |   d3?: number | ||||||
|  |   d4?: number | ||||||
|  |   d5?: number | ||||||
|  |   d6?: number | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | export interface CDSBInfo{ | ||||||
|  |   kdid?: string | ||||||
|  |   sbbh?: string | ||||||
|  |   sbbm?: string | ||||||
|  |   itemsno?: string | ||||||
|  |   modelKey?: string | ||||||
|  |   xmdm?:string, | ||||||
|  |   xmxh?:string | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // export const defaultCdsbInfoObj:DefaultJudgeConfigObj = { | ||||||
|  | // | ||||||
|  | // } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | export interface JudgeUI_I{ | ||||||
|  |   context:common.UIAbilityContext | ||||||
|  | } | ||||||
| 
 | 
 | ||||||
| /****** 评判开始考试数据*****/ | /****** 评判开始考试数据*****/ | ||||||
| export interface JudgeBeginObj{ | export interface JudgeBeginObj{ | ||||||
|   exam:0|1 |   exam:0|1 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | export interface DistanceClass{ | ||||||
|  |   setTimeData:(n:number)=> void | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | export interface WR { | ||||||
|  |   message?: string | ||||||
|  |   code?: number | ||||||
|  |   keystr?: string | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | |||||||
| @ -50,7 +50,8 @@ import { | |||||||
|   UploadExamMileage, |   UploadExamMileage, | ||||||
|   AmplifyItem, |   AmplifyItem, | ||||||
|   ProjectRoads, |   ProjectRoads, | ||||||
|   JudgeCallBacData |   JudgeCallBacData, | ||||||
|  |   JudgeUI | ||||||
| } from '../model'; | } from '../model'; | ||||||
| import { GetSyncData } from '../utils/table/Operation'; | import { GetSyncData } from '../utils/table/Operation'; | ||||||
| import dayTs from '../utils/Date'; | import dayTs from '../utils/Date'; | ||||||
| @ -99,8 +100,8 @@ struct Index { | |||||||
|   @State projectsObj: ProjectInfos = {} |   @State projectsObj: ProjectInfos = {} | ||||||
|   @State projectsCenterObj: ProjectInfo = {} |   @State projectsCenterObj: ProjectInfo = {} | ||||||
|   @State markRuleListObj: MarkRule = {} |   @State markRuleListObj: MarkRule = {} | ||||||
|   @State cdsbInfoObj: CDSBInfo = {} |   @State cdsbInfoObj?: CDSBInfo = {} | ||||||
|   @State itemInfoObj: CDSBInfo = {} |   @State itemInfoObj?: object = {} | ||||||
|   @State timer: number = 0 |   @State timer: number = 0 | ||||||
|   @State judgeConfig: SyssetConfig[] = [] |   @State judgeConfig: SyssetConfig[] = [] | ||||||
|   @State judgeConfigObj: object = defaultJudgeConfigObj |   @State judgeConfigObj: object = defaultJudgeConfigObj | ||||||
| @ -114,7 +115,7 @@ struct Index { | |||||||
|   //监管线路代码 |   //监管线路代码 | ||||||
|   @State xldm: string = '' |   @State xldm: string = '' | ||||||
|   //监管接口序列号 |   //监管接口序列号 | ||||||
|   @State serialNumber: number|string = 0 |   @State serialNumber: string = '' | ||||||
|   @State syssetParam623: boolean = false; |   @State syssetParam623: boolean = false; | ||||||
|   @State syssetParam211: string = ''; |   @State syssetParam211: string = ''; | ||||||
|   @State carType: string = '' |   @State carType: string = '' | ||||||
| @ -143,7 +144,8 @@ struct Index { | |||||||
|   @State currentXmdm: string = '' |   @State currentXmdm: string = '' | ||||||
|   // 必考项目除靠边停车是否全部完成 |   // 必考项目除靠边停车是否全部完成 | ||||||
|   @State isRequiredProjectsEnd: boolean = false; |   @State isRequiredProjectsEnd: boolean = false; | ||||||
|   // @State isAllProjectsEnd: boolean = false; |   @State isAllProjectsEnd: boolean = false; | ||||||
|  |   @State draw: boolean = false; | ||||||
|   @State lane: LANE = { road: '', num: 0, count: 0 } |   @State lane: LANE = { road: '', num: 0, count: 0 } | ||||||
|   //定位差分状态时候正常 |   //定位差分状态时候正常 | ||||||
|   @State isDwztRight: boolean = true; |   @State isDwztRight: boolean = true; | ||||||
| @ -162,7 +164,7 @@ struct Index { | |||||||
|   @State carInfo: CarInfoType = {} |   @State carInfo: CarInfoType = {} | ||||||
|   @State isErrorMsgEnd: boolean = false |   @State isErrorMsgEnd: boolean = false | ||||||
|   @State disConnectErrorOpen: boolean = false |   @State disConnectErrorOpen: boolean = false | ||||||
|   private context = getContext(this) as common.UIAbilityContext; |   public  context = getContext(this) as common.UIAbilityContext; | ||||||
| 
 | 
 | ||||||
|   async aboutToDisappear() { |   async aboutToDisappear() { | ||||||
|     clearInterval(this.mileageTimer) |     clearInterval(this.mileageTimer) | ||||||
| @ -177,7 +179,6 @@ struct Index { | |||||||
|     // this.startHourTime = await getCurrentHourTime() |     // this.startHourTime = await getCurrentHourTime() | ||||||
|     this.startTime = dayTs().format("HHmmssSSS") |     this.startTime = dayTs().format("HHmmssSSS") | ||||||
|     this.startExamTime = time |     this.startExamTime = time | ||||||
| 
 |  | ||||||
|     setInterval(async () => { |     setInterval(async () => { | ||||||
|       this.time =  GetCurrentTime(); |       this.time =  GetCurrentTime(); | ||||||
|       this.examTime += 1; |       this.examTime += 1; | ||||||
| @ -308,10 +309,10 @@ struct Index { | |||||||
|       const value = decodeURIComponent(sys.v_value) |       const value = decodeURIComponent(sys.v_value) | ||||||
|       if (v_no_num >= 10 && v_no_num <= 900) { |       if (v_no_num >= 10 && v_no_num <= 900) { | ||||||
|         const name = |         const name = | ||||||
|         syssetJudgeConfigArr.push({ |           syssetJudgeConfigArr.push({ | ||||||
|           key: v_no_num, value: value, |             key: v_no_num, value: value, | ||||||
|           name: decodeURI(sys.v_name) |             name: decodeURI(sys.v_name) | ||||||
|         }) |           }) | ||||||
|       } |       } | ||||||
| 
 | 
 | ||||||
|       //623 考试中是否可以查看轨迹画面(0-否+1-是) |       //623 考试中是否可以查看轨迹画面(0-否+1-是) | ||||||
| @ -530,7 +531,9 @@ struct Index { | |||||||
| 
 | 
 | ||||||
|   // 评判相关初始化 |   // 评判相关初始化 | ||||||
|   async initJudge() { |   async initJudge() { | ||||||
|     const judge = new Judge(this); |     const test:JudgeUI = this; | ||||||
|  |     const judge = new Judge(test); | ||||||
|  |     // await judge.init<typeof Index>() | ||||||
|     await judge.onJudgeFn(async (judgeData:JudgeCallBacData) => { |     await judge.onJudgeFn(async (judgeData:JudgeCallBacData) => { | ||||||
|       // const { xmmcStr, carztStr, kfArr } = judgeData; |       // const { xmmcStr, carztStr, kfArr } = judgeData; | ||||||
|       this.xmmcStr = judgeData.xmmcStr; |       this.xmmcStr = judgeData.xmmcStr; | ||||||
| @ -1213,7 +1216,7 @@ struct Index { | |||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   getProjectColor(project: ProjectInfo) { |   getProjectColor(project: ProjectInfo) { | ||||||
|   const type  = project.type; |     const type  = project.type; | ||||||
|     switch (type) { |     switch (type) { | ||||||
|       case '1': |       case '1': | ||||||
|         return '#E6DECF'; |         return '#E6DECF'; | ||||||
| @ -1468,3 +1471,5 @@ struct Index { | |||||||
|     } |     } | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  | 
 | ||||||
|  | export const JudgePage = Index | ||||||
|  | |||||||
| @ -203,7 +203,7 @@ export async function examCalcGpsDistance(param: { | |||||||
|   jd2: number, |   jd2: number, | ||||||
|   wd2: number, |   wd2: number, | ||||||
|   h: number |   h: number | ||||||
| }) { | }):Promise<number> { | ||||||
|   const { jd1, wd1, jd2, wd2, h } = param |   const { jd1, wd1, jd2, wd2, h } = param | ||||||
|   const temp = libJudgeSdk.examCalcGpsDistance(jd1, wd1, jd2, wd2, h); |   const temp = libJudgeSdk.examCalcGpsDistance(jd1, wd1, jd2, wd2, h); | ||||||
|   return await temp; |   return await temp; | ||||||
|  | |||||||
| @ -32,6 +32,7 @@ export interface MarkRule { | |||||||
|   xmmcStr?: string |   xmmcStr?: string | ||||||
|   desc?: string |   desc?: string | ||||||
|   xmdm?: string |   xmdm?: string | ||||||
|  |   type?: 0 | 1 | 2 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| export interface KF{ | export interface KF{ | ||||||
|  | |||||||
| @ -3,11 +3,10 @@ import router from '@ohos.router'; | |||||||
| import util from '@ohos.util'; | import util from '@ohos.util'; | ||||||
| import buffer from '@ohos.buffer'; | import buffer from '@ohos.buffer'; | ||||||
| import { testKm2Items, testKm3Items, testMarkRules } from './dataTest/index'; | import { testKm2Items, testKm3Items, testMarkRules } from './dataTest/index'; | ||||||
| import { EXAMDATA, KSJS, SOUND } from './api/judgeSDK'; | import { EXAMDATA, KSJS, Project, SOUND } from './api/judgeSDK'; | ||||||
| import VoiceAnnounce from './utils/voiceAnnouncements'; | import VoiceAnnounce from './utils/voiceAnnouncements'; | ||||||
| import FileModel from './utils/fileModel'; | import FileModel from './utils/fileModel'; | ||||||
| import FilePhoto from './utils/filePhoto'; | import FilePhoto from './utils/filePhoto'; | ||||||
| 
 |  | ||||||
| import FileLog from './utils/fileLog'; | import FileLog from './utils/fileLog'; | ||||||
| import JudgeTask from './utils/judgeTask'; | import JudgeTask from './utils/judgeTask'; | ||||||
| import { judgeConfig } from './utils/judgeConfig'; | import { judgeConfig } from './utils/judgeConfig'; | ||||||
| @ -41,45 +40,51 @@ import { | |||||||
|   examJudgeSoundEnd, |   examJudgeSoundEnd, | ||||||
|   examJudgeVersion |   examJudgeVersion | ||||||
| } from './api/index'; | } from './api/index'; | ||||||
| import { writeObjectOut } from '../../api/judge'; | 
 | ||||||
|  | import { writeObjectOut, uploadExamProgressData } from '../../api/judge'; | ||||||
| import { saveStartRecordVideo } from '../../utils/Video'; | import { saveStartRecordVideo } from '../../utils/Video'; | ||||||
| import common from '@ohos.app.ability.common'; | import common from '@ohos.app.ability.common'; | ||||||
| import { Array2Byte, convertGpsCoord2, deepClone, fillZero, string2Bytes } from './utils/Common'; | import { Array2Byte, convertGpsCoord2, deepClone, fillZero, string2Bytes } from './utils/Common'; | ||||||
| import { GetCurrentTime, StringToASCII } from '../../utils/Common'; | import { GetCurrentTime, StringToASCII } from '../../utils/Common'; | ||||||
| import UsbService from '../../utils/USB'; | import UsbService from '../../utils/USB'; | ||||||
| import FileUtils from '../../utils/FileUtils'; | import FileUtils from '../../utils/FileUtils'; | ||||||
| import { BaseInfoType, CarInfoType } from '../../model'; | import { BaseInfoType, CarInfoType, JudgeUI, Km3JudgeInitConfig ,ProjectInfo,Plc,DistanceClass,Ksjs,MarkRule,RegulatoryInterfaceParams,DrvexamType,WR} from '../../model'; | ||||||
| 
 | 
 | ||||||
| const judgeTag = 'SURENJUN_JUDGE' | const judgeTag = 'SURENJUN_JUDGE' | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
|  | type GetKm3JudgeInitConfig = ()=> Promise<Km3JudgeInitConfig> | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| export default class Judge { | export default class Judge { | ||||||
|   // 断网数据补传 |   // 断网数据补传 | ||||||
|   uploadDisConnectData = async () => { |   uploadDisConnectData = async () => { | ||||||
|     const { isJudgeDisConnect, fileLog, fileUtil } = this; |     if (!this.isJudgeDisConnect) { | ||||||
|     if (!isJudgeDisConnect) { |  | ||||||
|       return |       return | ||||||
|     } |     } | ||||||
|     const folderPath = fileLog.folderPath |     const folderPath = this.fileLog.folderPath | ||||||
|     const examDataStr = await fileUtil.readFile(`${folderPath}/wuxi_dis_progress_data.txt`); |     const examDataStr = await this.fileUtil.readFile(`${folderPath}/wuxi_dis_progress_data.txt`); | ||||||
|     const examDataArr = examDataStr.split('\n'); |     const examDataArr = examDataStr.split('\n'); | ||||||
|     for (let examDataStr of examDataArr) { |     for (let examDataStr of examDataArr) { | ||||||
|       const examData = JSON.parse(examDataStr) |       const code = await writeObjectOut(JSON.parse(examDataStr)); | ||||||
|       const code = await writeObjectOut(examData); |  | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|   //上传无锡所过程数据 |   //上传无锡所过程数据 | ||||||
|   uploadProgressData = async () => { |   uploadProgressData = async () => { | ||||||
|     const carInfo = AppStorage.get<CarInfoType>('carInfo') |     const carInfo = AppStorage.get<CarInfoType>('carInfo') | ||||||
|     const { judgeUI, fileUtil, fileLog } = this; |     const judgeUI = this.judgeUI | ||||||
|     const { idCard, startFullTime } = judgeUI |     const fileUtil = this.fileUtil | ||||||
|     const { carId, examinationRoomId } = carInfo |     const fileLog = this.fileLog | ||||||
|  |     const carId = carInfo.carId | ||||||
|  |     const examinationRoomId = carInfo.examinationRoomId | ||||||
|  | 
 | ||||||
|     const folderPath = fileLog.folderPath |     const folderPath = fileLog.folderPath | ||||||
|     const base64 = new util.Base64(); |     const base64 = new util.Base64(); | ||||||
|     const time = await GetCurrentTime(); |     const time = GetCurrentTime(); | ||||||
|     const endTime = await GetCurrentTime(1) |     const endTime = GetCurrentTime(1) | ||||||
|     let examDataBase64 |     let examDataBase64: string = '' | ||||||
|     //TODO try catch报错待优化 |     //TODO try catch报错待优化 | ||||||
|     const examDataStr: string = await fileUtil.readFile(`${folderPath}/wuxi_progress_data.txt`); |     const examDataStr: string = await this.fileUtil.readFile(`${folderPath}/wuxi_progress_data.txt`); | ||||||
|     try { |     try { | ||||||
|       let tempBuff = buffer.alloc(examDataStr.length, examDataStr) |       let tempBuff = buffer.alloc(examDataStr.length, examDataStr) | ||||||
|       let examData: Uint8Array = new Uint8Array(tempBuff.buffer) |       let examData: Uint8Array = new Uint8Array(tempBuff.buffer) | ||||||
| @ -91,13 +96,13 @@ export default class Judge { | |||||||
| 
 | 
 | ||||||
|     try { |     try { | ||||||
|       await uploadExamProgressData({ |       await uploadExamProgressData({ | ||||||
|         time, |  | ||||||
|         carId, |         carId, | ||||||
|         examinationRoomId, |         examinationRoomId, | ||||||
|         examData: examDataBase64, |  | ||||||
|         type: 1, |         type: 1, | ||||||
|         cardNo: idCard, |         time, | ||||||
|         examStartTime: startFullTime, |         cardNo: judgeUI.idCard, | ||||||
|  |         examData: examDataBase64, | ||||||
|  |         examStartTime: judgeUI.startFullTime, | ||||||
|         examEndTime: endTime, |         examEndTime: endTime, | ||||||
|       }) |       }) | ||||||
|     } catch (e) { |     } catch (e) { | ||||||
| @ -106,28 +111,20 @@ export default class Judge { | |||||||
|     console.info(judgeTag, '过程数据文件上传 end') |     console.info(judgeTag, '过程数据文件上传 end') | ||||||
|   } |   } | ||||||
|   //获取科目三的评判初始化配置 |   //获取科目三的评判初始化配置 | ||||||
|   getKm3JudgeInitConfig = async () => { |   getKm3JudgeInitConfig:GetKm3JudgeInitConfig = async () => { | ||||||
|     const { judgeUI, getModelData } = this; |  | ||||||
|     const { mapPointArr, mapPointItemArr } = judgeUI; |  | ||||||
|     return { |     return { | ||||||
|       map_point: mapPointArr, |       map_point: this.judgeUI.mapPointArr, | ||||||
|       map_point_item: mapPointItemArr, |       map_point_item: this.judgeUI.mapPointItemArr, | ||||||
|       //科目三暂时为空 |       //科目三暂时为空 | ||||||
|       iteminfo: [], |       iteminfo: [], | ||||||
|       roads: getModelData('km3/Roads.txt'), |       roads: this.getModelData('km3/Roads.txt'), | ||||||
|       sharps: getModelData('km3/Sharps.txt') |       sharps: this.getModelData('km3/Sharps.txt') | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|   // 处理特殊参数配置 |   // 处理特殊参数配置 | ||||||
|   handleSEP = async (code: number) => { |   handleSEP = async (code: number) => { | ||||||
|     const carInfo = AppStorage.get<CarInfoType>('carInfo') |     const judgeConfigObj = this.judgeUI.judgeConfigObj | ||||||
|     const { |     const avPlayer = this.avPlayer | ||||||
|       judgeUI:{ |  | ||||||
|         judgeConfigObj |  | ||||||
|       }, avPlayer |  | ||||||
|     } = this; |  | ||||||
|     const { examSubject } = carInfo; |  | ||||||
| 
 |  | ||||||
|     switch (code) { |     switch (code) { | ||||||
|     //结束考试方式 |     //结束考试方式 | ||||||
|       case 306: |       case 306: | ||||||
| @ -140,79 +137,87 @@ export default class Judge { | |||||||
|   } |   } | ||||||
|   public plcStr: string |   public plcStr: string | ||||||
|   private context: common.UIAbilityContext |   private context: common.UIAbilityContext | ||||||
|   private judgeUI |   public judgeUI: JudgeUI | ||||||
|   // 检测扣分、结束项目时该项目是否开始 |   // 检测扣分、结束项目时该项目是否开始 | ||||||
|   checkProjectIsStart = async (xmdm, currentType: 1 | 2, kf?: KF) => { |   checkProjectIsStart = async (xmdm:number, currentType: 1 | 2, kf?: KF) => { | ||||||
|     if (xmdm == 20) { |     if (xmdm == 20) { | ||||||
|       return true |       return true | ||||||
|     } |     } | ||||||
|     const { judgeTask, beginProject, pointsDedute, uploadProgressPhoto, endProject, checkExamIsEnd, totalScore } = this; |     const judgeUI= this.judgeUI; | ||||||
|     const { projectsObj, passingScore:passingGrade } = this.judgeUI |     const judgeTask= this.judgeTask; | ||||||
|     const { isUpload } = projectsObj[xmdm]; |     const projectsObj = this.judgeUI.projectsObj | ||||||
|  |     const currentProject:ProjectInfo = Reflect.get(projectsObj, xmdm) | ||||||
|  |     const isUpload = currentProject.isUpload | ||||||
|  | 
 | ||||||
|     //如果项目没有开始 |     //如果项目没有开始 | ||||||
|     console.info('surenjun isUpload=>', isUpload) |     console.info('surenjun isUpload=>', isUpload) | ||||||
|     if (!isUpload) { |     if (!isUpload) { | ||||||
|       console.info(judgeTag, '项目补传开始') |       console.info(judgeTag, '项目补传开始') | ||||||
|       //项目开始补传 |       //项目开始补传 | ||||||
|       judgeTask.addTask(async () => { |       judgeTask.addTask(async () => { | ||||||
|         await beginProject(xmdm) |         await this.beginProject(xmdm) | ||||||
|       }, { |       }, { | ||||||
|         isDelay: true |         isDelay: true | ||||||
|       }) |       }) | ||||||
|       judgeTask.addTask(async () => { |       judgeTask.addTask(async () => { | ||||||
|         await uploadProgressPhoto(xmdm) |         await this.uploadProgressPhoto(xmdm) | ||||||
|       }, { |       }, { | ||||||
|         isDelay: true |         isDelay: true | ||||||
|       }) |       }) | ||||||
|       this.judgeUI.projectsObj[xmdm].isUpload = true; |       currentProject.isUpload = true; | ||||||
|  |       Reflect.set(this.judgeUI.projectsObj,xmdm,currentProject) | ||||||
|       //扣分补传 |       //扣分补传 | ||||||
|       if (currentType == 2) { |       if (currentType == 2) { | ||||||
|         judgeTask.addTask(async () => { |         judgeTask.addTask(async () => { | ||||||
|           await pointsDedute(xmdm, kf) |           await this.pointsDedute(xmdm, kf) | ||||||
|         }, { |         }, { | ||||||
|           isDelay: true |           isDelay: true | ||||||
|         }) |         }) | ||||||
|       } |       } | ||||||
|       //扣分补传判断是否合格 不合格补传项目结束 |       //扣分补传判断是否合格 不合格补传项目结束 | ||||||
|       if (currentType == 1 || (currentType == 2 && totalScore < passingGrade)) { |       if (currentType == 1 || (currentType == 2 && this.totalScore < judgeUI.passingScore)) { | ||||||
|         judgeTask.addTask(async () => { |         judgeTask.addTask(async () => { | ||||||
|           await endProject(xmdm) |           await this.endProject(xmdm) | ||||||
|         }, { |         }, { | ||||||
|           isDelay: true |           isDelay: true | ||||||
|         }) |         }) | ||||||
|         this.judgeUI.projectsObj[xmdm].isEnd = true; |         currentProject.isEnd = true; | ||||||
|  |         Reflect.set(this.judgeUI.projectsObj,xmdm,currentProject) | ||||||
|       } |       } | ||||||
|       judgeTask.addTask(async () => { |       judgeTask.addTask(async () => { | ||||||
|         checkExamIsEnd() |         this.checkExamIsEnd() | ||||||
|       }) |       }) | ||||||
|       return false; |       return false; | ||||||
|     } else { |     } else { | ||||||
|       return true |       return true | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|   private fileLog |   private fileLog: FileLog | ||||||
|  | 
 | ||||||
|   //人工扣分 |   //人工扣分 | ||||||
|   public setJudgeMark = async (itemno, serial, type = 1) => { |   public setJudgeMark = async (itemno:string, serial:string, type = 1) => { | ||||||
|     await examJudgeArtificialMark(itemno * 1, serial, type); |     await examJudgeArtificialMark(Number(itemno), serial, type); | ||||||
|     console.info(judgeTag, `进入人工扣分-${itemno}-${serial}`) |     console.info(judgeTag, `进入人工扣分-${itemno}-${serial}`) | ||||||
|     await this.fileLog.setExamJudgeData({ |     const str = JSON.stringify({ | ||||||
|       method: 'examJudgeArtificialMark', |       method: 'examJudgeArtificialMark', | ||||||
|       itemno: itemno * 1, |       itemno: Number(itemno), | ||||||
|       serial, |       serial, | ||||||
|       type |       type | ||||||
|     }) |     }) | ||||||
| 
 |     await this.fileLog.setExamJudgeData(str) | ||||||
|     console.info(judgeTag, `人工扣分-${itemno}-${serial}`) |     console.info(judgeTag, `人工扣分-${itemno}-${serial}`) | ||||||
|   } |   } | ||||||
|  | 
 | ||||||
|   //人工操作项目 |   //人工操作项目 | ||||||
|   public setJudgeItem = async (itemno: string, type: 1 | 2) => { |   public setJudgeItem = async (itemno: string, type: 1 | 2) => { | ||||||
|     // const { fileLog } = this; |     // const { fileLog } = this; | ||||||
|     await examJudgeArtificialItem(Number(itemno), type); |     await examJudgeArtificialItem(Number(itemno), type); | ||||||
|     await this.fileLog.setExamJudgeData({ |     const str = JSON.stringify({ | ||||||
|       method: 'examJudgeArtificialItem', |       method: 'examJudgeArtificialItem', | ||||||
|       itemno: Number(itemno), |       itemno: Number(itemno), | ||||||
|       type |       type | ||||||
|     }) |     }) | ||||||
|  |     await this.fileLog.setExamJudgeData(str) | ||||||
|     console.info(judgeTag, `人工评判${type == 1 ? '进入' : '取消'}项目-${itemno}`) |     console.info(judgeTag, `人工评判${type == 1 ? '进入' : '取消'}项目-${itemno}`) | ||||||
|   } |   } | ||||||
|   private filePath: string |   private filePath: string | ||||||
| @ -263,23 +268,23 @@ export default class Judge { | |||||||
|   private serialIndex: number |   private serialIndex: number | ||||||
|   private fileUtil: FileUtils |   private fileUtil: FileUtils | ||||||
|   private judgeTask: JudgeTask |   private judgeTask: JudgeTask | ||||||
|   private tempData: any |   private tempData: Plc | ||||||
|   //实时计算gps经纬度距离 |   //实时计算gps经纬度距离 | ||||||
|   handDistance = async () => { |   handDistance = async () => { | ||||||
|     const { jd, wd, hxj, dwzt, jdzt } = this.tempData.gps; |     const dwzt = this.tempData.gps.dwzt; | ||||||
|     const tJD = convertGpsCoord2(jd) |     const jdzt = this.tempData.gps.jdzt; | ||||||
|     const tWD = convertGpsCoord2(wd) |     const tJD = convertGpsCoord2(this.tempData.gps.jd) | ||||||
|     const { prevJd, prevWd } = this |     const tWD = convertGpsCoord2(this.tempData.gps.wd) | ||||||
|     if (prevJd && dwzt == 4 && jdzt == 3) { |     if (this.prevJd && dwzt == 4 && jdzt == 3) { | ||||||
|       const distance = await examCalcGpsDistance({ |       const distance = await examCalcGpsDistance({ | ||||||
|         jd1: prevJd, |         jd1: this.prevJd, | ||||||
|         wd1: prevWd, |         wd1: this.prevWd, | ||||||
|         jd2: tJD, |         jd2: tJD, | ||||||
|         wd2: tWD, |         wd2: tWD, | ||||||
|         h: hxj || 1, |         h: (this.tempData.gps.hxj) || 1, | ||||||
|       }) |       }) | ||||||
|       const distanceClass = AppStorage.get('distanceClass') |       const distanceClass = AppStorage.get<DistanceClass>('distanceClass') | ||||||
|       distanceClass?.setTimeData(((distance / 100).toFixed(2)) * 1) |       distanceClass?.setTimeData( Number(((distance / 100).toFixed(2))) ) | ||||||
|     } |     } | ||||||
|     this.prevJd = tJD; |     this.prevJd = tJD; | ||||||
|     this.prevWd = tWD; |     this.prevWd = tWD; | ||||||
| @ -290,9 +295,18 @@ export default class Judge { | |||||||
|   // 校验考试是否结束 |   // 校验考试是否结束 | ||||||
|   checkExamIsEnd = |   checkExamIsEnd = | ||||||
|     async (isManual?: boolean) => { |     async (isManual?: boolean) => { | ||||||
|       const { judgeUI, avPlayer, isExamEnd, isEndTip, ksjs } = this; |       const judgeUI = this.judgeUI | ||||||
|       const { isAllProjectsEnd, examSubject, singlePlay, totalScore, judgeConfigObj, passingScore, examMileage, jl } = |       const avPlayer = this.avPlayer | ||||||
|         judgeUI; |       const isExamEnd = this.isExamEnd | ||||||
|  |       const isEndTip = this.isEndTip | ||||||
|  |       const isAllProjectsEnd = judgeUI.isAllProjectsEnd | ||||||
|  |       const examSubject = judgeUI.examSubject | ||||||
|  |       const singlePlay = judgeUI.singlePlay | ||||||
|  |       const totalScore = Number(judgeUI.totalScore) | ||||||
|  |       const judgeConfigObj = judgeUI.judgeConfigObj | ||||||
|  |       const examMileage = Number(judgeUI.examMileage) | ||||||
|  |       const passingScore = Number(judgeUI.examMileage) | ||||||
|  |       const jl = judgeUI.jl | ||||||
| 
 | 
 | ||||||
|       if (isExamEnd) { |       if (isExamEnd) { | ||||||
|         return |         return | ||||||
| @ -305,9 +319,9 @@ export default class Judge { | |||||||
|         this.isExamEnd = true |         this.isExamEnd = true | ||||||
|         this.isManual = true |         this.isManual = true | ||||||
|       } else { |       } else { | ||||||
|         const param302 = judgeConfigObj['302']; |         const param302:number = Reflect.get(judgeConfigObj,'302') | ||||||
|         const param342 = judgeConfigObj['342']; |         const param342:number = Reflect.get(judgeConfigObj,'342') | ||||||
|         const param512 = (judgeConfigObj['512'] || '').split(','); |         const param512:number[] =( Reflect.get(judgeConfigObj,'512')  || '').split(','); | ||||||
| 
 | 
 | ||||||
|         //单机模式 |         //单机模式 | ||||||
|         if (singlePlay) { |         if (singlePlay) { | ||||||
| @ -315,8 +329,8 @@ export default class Judge { | |||||||
|           if (isAllProjectsEnd && jl >= examMileage) { |           if (isAllProjectsEnd && jl >= examMileage) { | ||||||
|             //成绩合格 |             //成绩合格 | ||||||
|             if (totalScore >= passingGrade && !isEndTip) { |             if (totalScore >= passingGrade && !isEndTip) { | ||||||
|               if (examSubject == 3 && (param342 == 0 || param342 == 2) && |               if (examSubject == '3' && (param342 == 0 || param342 == 2) && | ||||||
|                 (param302 != 6 || param302 != 7 || param302 != 8)) { |                 (param302 != 6 &&  param302 != 7 && param302 != 8 )) { | ||||||
|                 if (param512[7] != 0) { |                 if (param512[7] != 0) { | ||||||
|                   clearTimeout(this.deductedPopShowTimer) |                   clearTimeout(this.deductedPopShowTimer) | ||||||
|                   avPlayer.playAudio(['voice/综合评判.mp3']) |                   avPlayer.playAudio(['voice/综合评判.mp3']) | ||||||
| @ -331,7 +345,7 @@ export default class Judge { | |||||||
|                 return |                 return | ||||||
|               } |               } | ||||||
|             } else { |             } else { | ||||||
|               if (examSubject == 3 && (param302 == 4 || param302 == 5 || param302 == 7 || param302 == 8)) { |               if (examSubject == '3' && (param302 == 4 || param302 == 5 || param302 == 7 || param302 == 8)) { | ||||||
|                 await examJudgeEndExam() |                 await examJudgeEndExam() | ||||||
|                 this.isExamEnd = true |                 this.isExamEnd = true | ||||||
|                 return |                 return | ||||||
| @ -344,7 +358,7 @@ export default class Judge { | |||||||
|           //成绩不合格 |           //成绩不合格 | ||||||
|           if (totalScore < passingGrade) { |           if (totalScore < passingGrade) { | ||||||
|             //科目三不合格报靠边停车 |             //科目三不合格报靠边停车 | ||||||
|             if (examSubject == 3 && param302 == 1) { |             if (examSubject == '3' && param302 == 1) { | ||||||
|               avPlayer.playAudio([`voice/考试结束.mp3`]); |               avPlayer.playAudio([`voice/考试结束.mp3`]); | ||||||
|               return |               return | ||||||
|             } |             } | ||||||
| @ -355,26 +369,26 @@ export default class Judge { | |||||||
| 
 | 
 | ||||||
|           //成绩合格 |           //成绩合格 | ||||||
|           if (isAllProjectsEnd && totalScore >= passingGrade && !isEndTip) { |           if (isAllProjectsEnd && totalScore >= passingGrade && !isEndTip) { | ||||||
|             if (examSubject == 2) { |             if (examSubject == '2') { | ||||||
|               await examJudgeEndExam() |               await examJudgeEndExam() | ||||||
|               this.isExamEnd = true |               this.isExamEnd = true | ||||||
|               return |               return | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             //考试里程判断 |             //考试里程判断 | ||||||
|             if (examSubject == 3 && jl < examMileage) { |             if (examSubject == '3' && jl < examMileage) { | ||||||
|               return |               return | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             //考试合格自动退出 |             //考试合格自动退出 | ||||||
|             if (examSubject == 3 && (param302 == 4 || param302 == 7) || param302 == 8) { |             if (examSubject == '3' && (param302 == 4 || param302 == 7) || param302 == 8) { | ||||||
|               await examJudgeEndExam() |               await examJudgeEndExam() | ||||||
|               this.isExamEnd = true |               this.isExamEnd = true | ||||||
|               return |               return | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             if (examSubject == 3 && (param342 == 0 || param342 == 2) && |             if (examSubject == '3' && (param342 == 0 || param342 == 2) && | ||||||
|               (param302 != 6 || param302 != 7 || param302 != 8)) { |               (param302 != 6 && param302 != 7 && param302 != 8)) { | ||||||
|               if (param512[7] != 0) { |               if (param512[7] != 0) { | ||||||
|                 clearTimeout(this.deductedPopShowTimer) |                 clearTimeout(this.deductedPopShowTimer) | ||||||
|                 this.judgeUI.isDeductedPopShow = false |                 this.judgeUI.isDeductedPopShow = false | ||||||
| @ -391,75 +405,47 @@ export default class Judge { | |||||||
|         } |         } | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|   private ksjs: { |   private ksjs: Ksjs | ||||||
|     // 累计前进距离 |   private kfArr: MarkRule[] | ||||||
|     qjjl: number, |  | ||||||
|     // 累计倒车距离 |  | ||||||
|     dcjl: number |  | ||||||
|     d1: number |  | ||||||
|     d2: number |  | ||||||
|     d3: number |  | ||||||
|     d4: number |  | ||||||
|     d5: number |  | ||||||
|     d6: number |  | ||||||
|   } |  | ||||||
|   private kfArr: { |  | ||||||
|     //项目名称 |  | ||||||
|     xmmcStr: string, |  | ||||||
|     xmdm: string | number, |  | ||||||
|     //扣分描述 |  | ||||||
|     desc: string, |  | ||||||
|     //扣分 |  | ||||||
|     score: string |  | ||||||
|     //无锡所扣分代码 |  | ||||||
|     markcatalog: string |  | ||||||
|     markserial: string |  | ||||||
|     kfxh: string |  | ||||||
|     type: 0 | 1 | 2 |  | ||||||
|   }[] |  | ||||||
|   private km2ItemsStatus: any[] |  | ||||||
|   //所有的科目考试项目(大车&小车) |   //所有的科目考试项目(大车&小车) | ||||||
|   private testKmItems: any |   private testKmItems: any | ||||||
|   private plcData: any |   private plcData: Plc | ||||||
|   // 获取plc数据 |   // 获取plc数据 | ||||||
|   getPlcData = async (plc: string) => { |   getPlcData = async (plc: string) => { | ||||||
|     const { fileLog, mndgStr, rmndg } = this; |     await this.fileLog.setPlcProgressData(plc) | ||||||
|     await fileLog.setPlcProgressData(plc) |  | ||||||
|     //plc字符串转化成评判初始化数据 |     //plc字符串转化成评判初始化数据 | ||||||
|     const tempData = await plcStrToJson(plc); |     const tempData = await plcStrToJson(plc); | ||||||
|     //模拟灯光回放时刻 |     //模拟灯光回放时刻 | ||||||
|     tempData.sensor.rmndg = rmndg; |     tempData.sensor.rmndg = this.rmndg; | ||||||
|     //模拟灯灯光灯光项目 |     //模拟灯灯光灯光项目 | ||||||
|     tempData.sensor.mndg = mndgStr; |     tempData.sensor.mndg = this.mndgStr; | ||||||
|     //plc字符串转化成无锡所过程数据 |     //plc字符串转化成无锡所过程数据 | ||||||
|     const wuXiDataStr = await plcStrToWXJson(plc) |     const wuXiDataStr = await plcStrToWXJson(plc) | ||||||
|     this.plcData = tempData |     this.plcData = tempData | ||||||
|     await fileLog.setExamJudgeWuxiProgressData(wuXiDataStr) |     await this.fileLog.setExamJudgeWuxiProgressData(wuXiDataStr) | ||||||
|     this.tempData = tempData |     this.tempData = tempData | ||||||
|     this.plcStr = plc; |     this.plcStr = plc; | ||||||
|     this.mndgStr = ''; |     this.mndgStr = ''; | ||||||
|     this.rmndg = 0; |     this.rmndg = 0; | ||||||
|     AppStorage.setOrCreate('msgStr', plc) |     AppStorage.setOrCreate('msgStr', plc) | ||||||
| 
 |  | ||||||
|     return tempData |     return tempData | ||||||
|   } |   } | ||||||
|   // 处理udp plc信号 |   // 处理udp plc信号 | ||||||
|   handleUdp = async (msg) => { |   handleUdp = async (msg:string) => { | ||||||
|     console.info('plc信号', msg) |     console.info('plc信号', msg) | ||||||
|     // const { fileLog, getPlcData, usbService, isUdpEnd, isExamEnd, judgeUI } = this |  | ||||||
|     const stachArr = msg.split(',') |     const stachArr = msg.split(',') | ||||||
|     if (stachArr[0] != '#DN_GD' || this.isUdpEnd) { |     if (stachArr[0] != '#DN_GD' || this.isUdpEnd) { | ||||||
|       return |       return | ||||||
|     } |     } | ||||||
|     const plcData = await this.getPlcData(msg); |     const plcData = await this.getPlcData(msg); | ||||||
|     // 4.过程数据 |     // 4.过程数据 | ||||||
|     await this.fileLog.setExamJudgeData(plcData) |     await this.fileLog.setExamJudgeData(JSON.stringify(plcData)) | ||||||
|     //检测到有无锡所设备接入,需要发送特定的数据,供检测 |     //检测到有无锡所设备接入,需要发送特定的数据,供检测 | ||||||
|     if (this.usbService.isWXUSBDevice) { |     // if (this.usbService.isWXUSBDevice) { | ||||||
|       const str = await senorToWXDataStr(msg); |     //   const str = await senorToWXDataStr(msg); | ||||||
|       this.usbService.sendUSB(str) |     //   this.usbService.sendUSB(str) | ||||||
|     } |     // } | ||||||
|     const param350 = this.judgeUI.judgeConfigObj['350'] |     const param350:number = Reflect.get(this.judgeUI.judgeConfigObj,'350') | ||||||
|     this.judgeUI.sd = ((param350 == 0 ? plcData.gps.sd : plcData.sensor.cs) as number * 1.852).toFixed(0) + '' |     this.judgeUI.sd = ((param350 == 0 ? plcData.gps.sd : plcData.sensor.cs) as number * 1.852).toFixed(0) + '' | ||||||
|     this.judgeUI.dw = (Math.floor(plcData.sensor.dw as number) || 0) + '' |     this.judgeUI.dw = (Math.floor(plcData.sensor.dw as number) || 0) + '' | ||||||
|     //TODO 暂时关闭差分检测异常 |     //TODO 暂时关闭差分检测异常 | ||||||
| @ -468,7 +454,6 @@ export default class Judge { | |||||||
|       await examJudgeRealExam(plcData) |       await examJudgeRealExam(plcData) | ||||||
|     } |     } | ||||||
|     let udpIndex = AppStorage.get<number>('udpIndex'); |     let udpIndex = AppStorage.get<number>('udpIndex'); | ||||||
|     let [prevJd, preWd] = [0, 0] |  | ||||||
|     if (udpIndex % 5 === 0 && !this.isUdpEnd) { |     if (udpIndex % 5 === 0 && !this.isUdpEnd) { | ||||||
|       // TODO UPD缺失 |       // TODO UPD缺失 | ||||||
|       // const judgeUdp = globalThis.judgeUdp |       // const judgeUdp = globalThis.judgeUdp | ||||||
| @ -478,7 +463,7 @@ export default class Judge { | |||||||
|     AppStorage.setOrCreate('udpIndex', udpIndex++) |     AppStorage.setOrCreate('udpIndex', udpIndex++) | ||||||
|   } |   } | ||||||
|   // 处理轨迹plc信号 |   // 处理轨迹plc信号 | ||||||
|   handleTrajectoryUdp = async (strArr) => { |   handleTrajectoryUdp = async (strArr:string[]) => { | ||||||
|     // const { fileLog, setJudgeItem, setJudgeMark, endExam } = this; |     // const { fileLog, setJudgeItem, setJudgeMark, endExam } = this; | ||||||
|     let num = 2; |     let num = 2; | ||||||
|     const judgeTimer = setInterval(async () => { |     const judgeTimer = setInterval(async () => { | ||||||
| @ -489,7 +474,7 @@ export default class Judge { | |||||||
|         this.checkExamIsEnd(true) |         this.checkExamIsEnd(true) | ||||||
|         return |         return | ||||||
|       } |       } | ||||||
|       const msg = JSON.parse(strArr[num]); |       const msg :Plc= JSON.parse(strArr[num]); | ||||||
|       num++ |       num++ | ||||||
|       // 4.过程数据 |       // 4.过程数据 | ||||||
|       this.tempData = msg |       this.tempData = msg | ||||||
| @ -521,43 +506,41 @@ export default class Judge { | |||||||
|   // 调代理接口是否断网了 |   // 调代理接口是否断网了 | ||||||
|   private isJudgeDisConnect: boolean; |   private isJudgeDisConnect: boolean; | ||||||
|   // 项目开始接口同步 |   // 项目开始接口同步 | ||||||
|   beginProject = async (ksxm) => { |   beginProject = async (ksxm:number) => { | ||||||
|     const carInfo = AppStorage.get<CarInfoType>('carInfo'); |     const carInfo = AppStorage.get<CarInfoType>('carInfo'); | ||||||
|     const { examSubject, plateNo } = carInfo; |     const judgeUI =  this.judgeUI | ||||||
|     const { judgeUI, fileLog, getSbbm, xmxh, filePath } = this; |     const time =  GetCurrentTime(); | ||||||
|     const { lsh, idCard, serialNumber, projectsObj, ksdd, kslx, xldm } = judgeUI |     const project:ProjectInfo = Reflect.get(judgeUI.projectsObj, ksxm) | ||||||
|     const time = await GetCurrentTime(); |     const sbxh = this.getSbbm(ksxm, this.xmxh) | ||||||
|     const project = projectsObj[ksxm] | 
 | ||||||
|     const sbxh = getSbbm(ksxm, xmxh) |     const drvexam:DrvexamType = { | ||||||
|     const data = { |       lsh:judgeUI.lsh, | ||||||
|  |       kskm: carInfo.examSubject, | ||||||
|  |       sfzmhm: judgeUI.idCard, | ||||||
|  |       ksxm: project.projectCodeCenter, | ||||||
|  |       sbxh, | ||||||
|  |       ksxl: judgeUI.xldm, | ||||||
|  |       kchp: encodeURI(carInfo.plateNo), | ||||||
|  |       ksdd: encodeURI(judgeUI.ksdd), | ||||||
|  |       kslx: encodeURI(judgeUI.kslx) || '', | ||||||
|  |       kssj: time | ||||||
|  |     } | ||||||
|  |     const data:RegulatoryInterfaceParams = { | ||||||
|       //系统类别   接口序列号             接口标识 |       //系统类别   接口序列号             接口标识 | ||||||
|       xtlb: '17', |       xtlb: '17', | ||||||
|       jkxlh: serialNumber, |       jkxlh: judgeUI.serialNumber, | ||||||
|       jkid: '17C52', |       jkid: '17C52', | ||||||
|       drvexam: { |       drvexam | ||||||
|         //   考试科目            身份证号码 |  | ||||||
|         lsh, |  | ||||||
|         kskm: examSubject, |  | ||||||
|         sfzmhm: idCard, |  | ||||||
|         ksxm: project.projectCodeCenter, |  | ||||||
|         sbxh, |  | ||||||
|         ksxl: xldm, |  | ||||||
|         kchp: encodeURI(plateNo), |  | ||||||
|         //                                                开始时间 |  | ||||||
|         ksdd: encodeURI(ksdd), |  | ||||||
|         kslx: encodeURI(kslx) || '', |  | ||||||
|         kssj: time |  | ||||||
|       } |  | ||||||
|     } |     } | ||||||
|     const { code } = await this.sendWriteObjectOut(data, filePath) |     const temp:WR = await this.sendWriteObjectOut(data, this.filePath) | ||||||
|     console.info(judgeTag, '项目开始 end') |     console.info(judgeTag, '项目开始 end') | ||||||
|     if (code === 2300007) { |     if (temp.code === 2300007) { | ||||||
|       this.isJudgeDisConnect = true; |       this.isJudgeDisConnect = true; | ||||||
|     } |     } | ||||||
|     promptWxCode('17C52', code) |     promptWxCode('17C52', temp.code) | ||||||
|   } |   } | ||||||
|   // 项目结束接口同步 |   // 项目结束接口同步 | ||||||
|   endProject = async (ksxm) => { |   endProject = async (ksxm:number) => { | ||||||
|     const carInfo = AppStorage.get<CarInfoType>('carInfo'); |     const carInfo = AppStorage.get<CarInfoType>('carInfo'); | ||||||
|     const { examSubject, plateNo, carNo } = carInfo; |     const { examSubject, plateNo, carNo } = carInfo; | ||||||
|     const { judgeUI, fileLog, getSbxh, xmxh, getSbbm, filePath } = this; |     const { judgeUI, fileLog, getSbxh, xmxh, getSbbm, filePath } = this; | ||||||
| @ -598,8 +581,9 @@ export default class Judge { | |||||||
|   } |   } | ||||||
|   private videoData: any |   private videoData: any | ||||||
|   private disConnectNum: number = 0; |   private disConnectNum: number = 0; | ||||||
|  | 
 | ||||||
|   //调用监管接口 |   //调用监管接口 | ||||||
|   sendWriteObjectOut = async (data, filePath) => { |   sendWriteObjectOut = async (data:RegulatoryInterfaceParams, filePath:string) => { | ||||||
|     const temp = await writeObjectOut(data, filePath); |     const temp = await writeObjectOut(data, filePath); | ||||||
|     console.log("wzj", JSON.stringify(temp)) |     console.log("wzj", JSON.stringify(temp)) | ||||||
|     //断网&网络超时次数计算 |     //断网&网络超时次数计算 | ||||||
| @ -654,7 +638,7 @@ export default class Judge { | |||||||
|     console.info(judgeTag, '上传照片 end') |     console.info(judgeTag, '上传照片 end') | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   constructor(judgeUI) { |   constructor(judgeUI: JudgeUI) { | ||||||
|     this.serialIndex = 1; |     this.serialIndex = 1; | ||||||
|     this.judgeUI = judgeUI |     this.judgeUI = judgeUI | ||||||
|     //语音播放工具 |     //语音播放工具 | ||||||
| @ -961,8 +945,7 @@ export default class Judge { | |||||||
| 
 | 
 | ||||||
|     //差分事件 |     //差分事件 | ||||||
|       case 11: { |       case 11: { | ||||||
|         const { type } = nongps |         this.checkDwzt(nongps.type) | ||||||
|         this.checkDwzt(type) |  | ||||||
|       } |       } | ||||||
|       default: |       default: | ||||||
|         break; |         break; | ||||||
| @ -1580,10 +1563,13 @@ export default class Judge { | |||||||
|     const sbxh = currentCdsb.sbbh || '0000000000' |     const sbxh = currentCdsb.sbbh || '0000000000' | ||||||
|     return sbxh |     return sbxh | ||||||
|   } |   } | ||||||
|   getSbbm = (ksxm, xmxh) => { | 
 | ||||||
|     const { judgeUI } = this; |   getSbbm = (ksxm:number, xmxh:string) => { | ||||||
|     const { cdsbInfoObj, projectsObj, examSubject } = judgeUI; |     const judgeUI = this.judgeUI; | ||||||
|     const project = projectsObj[ksxm] |     const cdsbInfoObj = judgeUI.cdsbInfoObj; | ||||||
|  |     const projectsObj = judgeUI.projectsObj; | ||||||
|  |     const {examSubject = judgeUI.examSubject; | ||||||
|  |     const project = Reflect.get(projectsObj, ksxm); | ||||||
|     //科目三不需要 |     //科目三不需要 | ||||||
|     if (examSubject == 3) { |     if (examSubject == 3) { | ||||||
|       return undefined |       return undefined | ||||||
| @ -1594,7 +1580,7 @@ export default class Judge { | |||||||
|     const projectKey = `${ksxm}_${xmxh}`; |     const projectKey = `${ksxm}_${xmxh}`; | ||||||
|     const currentCdsb = cdsbInfoObj[projectKey] || {}; |     const currentCdsb = cdsbInfoObj[projectKey] || {}; | ||||||
|     const sbxh = currentCdsb.sbbm || '00000000' |     const sbxh = currentCdsb.sbbm || '00000000' | ||||||
|     return sbxh |     // return sbxh | ||||||
|   } |   } | ||||||
|   // 中心所有项目转换 |   // 中心所有项目转换 | ||||||
|   getTranslateProject = () => { |   getTranslateProject = () => { | ||||||
| @ -1788,7 +1774,6 @@ export default class Judge { | |||||||
|       this.videoData = await saveStartRecordVideo(`${name}_${kssycs}`, this.context) |       this.videoData = await saveStartRecordVideo(`${name}_${kssycs}`, this.context) | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     const { examSubject, projectsObj } = this.judgeUI |  | ||||||
|     // if(examSubject == 3){ |     // if(examSubject == 3){ | ||||||
|     //   //不做模拟灯光,需要做上车准备 =>(请上车准备) |     //   //不做模拟灯光,需要做上车准备 =>(请上车准备) | ||||||
|     //   if(projectsObj[41]?.type == 3 && projectsObj[1]?.type != 3){ |     //   if(projectsObj[41]?.type == 3 && projectsObj[1]?.type != 3){ | ||||||
|  | |||||||
| @ -42,9 +42,9 @@ export default class FileLog { | |||||||
|     this.plcDataFd = await this.fileUtil.editFile(`${this.folderPath}/plc_data.txt`, JSON.stringify(str), this.plcDataFd); |     this.plcDataFd = await this.fileUtil.editFile(`${this.folderPath}/plc_data.txt`, JSON.stringify(str), this.plcDataFd); | ||||||
|   } |   } | ||||||
|   // 过程评判json数据 |   // 过程评判json数据 | ||||||
|   public setExamJudgeData = async (str: Object) => { |   public setExamJudgeData = async (str: string) => { | ||||||
|     this.examJudgeDataFd = |     this.examJudgeDataFd = | ||||||
|       await this.fileUtil.editFile(`${this.folderPath}/judge_exam_data.txt`, JSON.stringify(str), this.examJudgeDataFd); |       await this.fileUtil.editFile(`${this.folderPath}/judge_exam_data.txt`, str, this.examJudgeDataFd); | ||||||
|   } |   } | ||||||
|   // 过程评判回调数据 |   // 过程评判回调数据 | ||||||
|   public setExamJudgeCallbackData = async (str: string) => { |   public setExamJudgeCallbackData = async (str: string) => { | ||||||
|  | |||||||
| @ -736,4 +736,6 @@ export const defaultJudgeConfigObj:DefaultJudgeConfigObj = { | |||||||
|   param_387: '0', |   param_387: '0', | ||||||
|   //监管模式有扣分续考(0-否++1-是+把上次未考完的扣分带下来重新考试) |   //监管模式有扣分续考(0-否++1-是+把上次未考完的扣分带下来重新考试) | ||||||
|   param_432: '1' |   param_432: '1' | ||||||
| } | } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | |||||||
| @ -4,7 +4,7 @@ const TAG = 'SURENJUN_JUDGE' | |||||||
| 
 | 
 | ||||||
| interface DelayConfig{ | interface DelayConfig{ | ||||||
|   isDelay: boolean |   isDelay: boolean | ||||||
|   delayTime: number |   delayTime?: number | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| interface QUEUE { | interface QUEUE { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user