Compare commits
6 Commits
b76a2a3f58
...
68821fa208
| Author | SHA1 | Date | |
|---|---|---|---|
| 68821fa208 | |||
| 4380fce2ca | |||
| eac7d94b98 | |||
| bbd5edd1ea | |||
| 5dda1b57d3 | |||
| 2ab8521d54 |
@ -58,7 +58,7 @@ export async function writeObjectOut(params,filePath?:string): Promise<WR> {
|
|||||||
await fileUtil.initFolder(filePath);
|
await fileUtil.initFolder(filePath);
|
||||||
fileUtil.editFile(`${filePath}/wuxi_exam_data.txt`,JSON.stringify({
|
fileUtil.editFile(`${filePath}/wuxi_exam_data.txt`,JSON.stringify({
|
||||||
xtlb,jkxlh,jkid,drvexam:{...drvexam,zp:''},
|
xtlb,jkxlh,jkid,drvexam:{...drvexam,zp:''},
|
||||||
}));
|
}) +`\n`);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.info('surenjun','调用旧监管')
|
console.info('surenjun','调用旧监管')
|
||||||
@ -93,6 +93,11 @@ export async function writeObjectOut(params,filePath?:string): Promise<WR> {
|
|||||||
method: 'post',
|
method: 'post',
|
||||||
xml: true
|
xml: true
|
||||||
})
|
})
|
||||||
|
if(filePath){
|
||||||
|
const fileUtil = new FileUtil(globalThis.context);
|
||||||
|
await fileUtil.initFolder(filePath);
|
||||||
|
fileUtil.editFile(`${filePath}/wuxi_exam_data.txt`,JSON.stringify(temp) +`\n`);
|
||||||
|
}
|
||||||
return temp
|
return temp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -41,16 +41,16 @@ export async function getliushuiNum(context) {
|
|||||||
// return str
|
// return str
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export async function deleteAllFIleLog(){
|
export async function deleteAllFIleLog(path){
|
||||||
let options = {
|
let options = {
|
||||||
"recursion": false,
|
"recursion": false,
|
||||||
"listNum": 0,
|
"listNum": 0,
|
||||||
};
|
};
|
||||||
let filenames = fs.listFileSync(GlobalConfig.comoonfileWriteAddress+'/PLC/', options);
|
let filenames = fs.listFileSync(path, options);
|
||||||
console.info("listFile succeed",JSON.stringify(filenames));
|
console.info("listFile succeed",JSON.stringify(filenames));
|
||||||
for (let i = 0; i < filenames.length; i++) {
|
for (let i = 0; i < filenames.length; i++) {
|
||||||
if(isSevenDaysAgo(filenames[i])){
|
if(isSevenDaysAgo(filenames[i])){
|
||||||
fs.rmdir(GlobalConfig.comoonfileWriteAddress+'/PLC/'+filenames[i], (err) => {
|
fs.rmdir(path+filenames[i], (err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.error("rmdir failed with error message: " + err.message + ", error code: " + err.code);
|
console.error("rmdir failed with error message: " + err.message + ", error code: " + err.code);
|
||||||
} else {
|
} else {
|
||||||
@ -157,8 +157,9 @@ export async function getDoubleCeneterTable(param) {
|
|||||||
//单中心存表
|
//单中心存表
|
||||||
export async function getSingleCenterTable(param) {
|
export async function getSingleCenterTable(param) {
|
||||||
return new Promise((reslove, reject) => {
|
return new Promise((reslove, reject) => {
|
||||||
|
try{
|
||||||
upDataZhongxinginitialization(param).then((result) => {
|
upDataZhongxinginitialization(param).then((result) => {
|
||||||
console.log('teststetfinsh01')
|
console.log('teststetfinsh01',result)
|
||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
reslove(true)
|
reslove(true)
|
||||||
@ -194,7 +195,9 @@ export async function getSingleCenterTable(param) {
|
|||||||
reslove(false)
|
reslove(false)
|
||||||
console.log(error)
|
console.log(error)
|
||||||
})
|
})
|
||||||
|
}catch (e){
|
||||||
|
reslove(false)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -360,6 +360,7 @@ export async function upDataZhongxinginitialization(param) {
|
|||||||
resolve(flag)
|
resolve(flag)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
try{
|
||||||
const str = {
|
const str = {
|
||||||
"carId": param.carId, // 表名
|
"carId": param.carId, // 表名
|
||||||
"examinationRoomId": param.examinationRoomId, //考试平台kdid
|
"examinationRoomId": param.examinationRoomId, //考试平台kdid
|
||||||
@ -372,7 +373,8 @@ export async function upDataZhongxinginitialization(param) {
|
|||||||
|
|
||||||
initialization(str).then(async (res) => {
|
initialization(str).then(async (res) => {
|
||||||
console.log('daihai3', JSON.stringify(res))
|
console.log('daihai3', JSON.stringify(res))
|
||||||
if (!res) {
|
if (!res||res.initializationRsp.head.resultCode==1) {
|
||||||
|
console.log('daihai34', JSON.stringify(res))
|
||||||
resolve(false)
|
resolve(false)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -396,6 +398,9 @@ export async function upDataZhongxinginitialization(param) {
|
|||||||
}).catch((Error) => {
|
}).catch((Error) => {
|
||||||
resolve(false)
|
resolve(false)
|
||||||
})
|
})
|
||||||
|
}catch (error){
|
||||||
|
resolve(false)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -106,8 +106,7 @@ console.log('baoyihubaoyihu',video_uri,flag)
|
|||||||
// var snapResult = rtsp_server.getVideoSnapshot(context, video_uri, '', dir);
|
// var snapResult = rtsp_server.getVideoSnapshot(context, video_uri, '', dir);
|
||||||
if(flag==0){
|
if(flag==0){
|
||||||
rtsp_server.detectVideoSnapshotSize(video_uri,fileName,(err,snapResult)=>{
|
rtsp_server.detectVideoSnapshotSize(video_uri,fileName,(err,snapResult)=>{
|
||||||
console.log("baohaowen_detectLoop round end size1:"+JSON.stringify(snapResult));
|
console.log("baohaowen_detectLoop round end size1:"+snapResult.fileSize);
|
||||||
//errorCode=0为正常
|
|
||||||
callback({fileSize:snapResult.fileSize,errorCode:snapResult.errorCode })
|
callback({fileSize:snapResult.fileSize,errorCode:snapResult.errorCode })
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -117,7 +116,6 @@ console.log('baoyihubaoyihu',video_uri,flag)
|
|||||||
return new Promise<takePhotoParam>((resolve,reject)=>{
|
return new Promise<takePhotoParam>((resolve,reject)=>{
|
||||||
rtsp_server.getVideoSnapshot(context, video_uri, fileName,dir,true,(err,snapResult)=>{
|
rtsp_server.getVideoSnapshot(context, video_uri, fileName,dir,true,(err,snapResult)=>{
|
||||||
console.log('baoyihubaoyihu',video_uri,flag,JSON.stringify(snapResult))
|
console.log('baoyihubaoyihu',video_uri,flag,JSON.stringify(snapResult))
|
||||||
//errorCode=-2拍照失败
|
|
||||||
console.log('getPhtot',JSON.stringify(snapResult))
|
console.log('getPhtot',JSON.stringify(snapResult))
|
||||||
resolve({base64: snapResult.dataString,name:snapResult.fileName,fileSize:snapResult.fileSize,errorCode:snapResult.errorCode })
|
resolve({base64: snapResult.dataString,name:snapResult.fileName,fileSize:snapResult.fileSize,errorCode:snapResult.errorCode })
|
||||||
});
|
});
|
||||||
|
|||||||
@ -103,12 +103,12 @@ export default class TcpClient {
|
|||||||
}, timeout: 6000
|
}, timeout: 6000
|
||||||
});
|
});
|
||||||
promise.then(() => {
|
promise.then(() => {
|
||||||
|
console.log('testTagtestTag000',)
|
||||||
this.tcp.setExtraOptions({
|
this.tcp.setExtraOptions({
|
||||||
keepAlive: true,
|
keepAlive: true,
|
||||||
}, err => {
|
}, err => {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log('testTagtestTagerrrrr,success')
|
console.log('testTagtestTag000,error')
|
||||||
if(this.num>3){
|
if(this.num>3){
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -119,7 +119,7 @@ export default class TcpClient {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
console.log('testTagtestTagconnect,success')
|
console.log('testTagtestTag000,success')
|
||||||
|
|
||||||
globalThis.getCloseTcp = false
|
globalThis.getCloseTcp = false
|
||||||
resolve(true)
|
resolve(true)
|
||||||
@ -133,7 +133,7 @@ export default class TcpClient {
|
|||||||
getTCP()
|
getTCP()
|
||||||
resolve(false)
|
resolve(false)
|
||||||
}, 2000)
|
}, 2000)
|
||||||
console.log('testTagtestTagconnect,error')
|
console.log('testTagtestTag000,error')
|
||||||
|
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|||||||
@ -74,7 +74,7 @@ export const getMessageHeartbeat = async (msg) => {
|
|||||||
string2Bytes(serialIndex, 2 * 8),
|
string2Bytes(serialIndex, 2 * 8),
|
||||||
translateSignals,
|
translateSignals,
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
string2Bytes(Math.floor((Math.floor(gps.sd))*1.852*100) , 2 * 8), string2Bytes(fdjzs / 100, 8), string2Bytes(translateJd, 4 * 8), string2Bytes(translateWd, 4 * 8), string2Bytes(1, 8),
|
string2Bytes(Math.floor(gps.sd*1.852) * 100, 2 * 8), string2Bytes(fdjzs / 100, 8), string2Bytes(translateJd, 4 * 8), string2Bytes(translateWd, 4 * 8), string2Bytes(1, 8),
|
||||||
//GPS东向距离
|
//GPS东向距离
|
||||||
string2Bytes(0, 4 * 8),
|
string2Bytes(0, 4 * 8),
|
||||||
//GPS北向距离
|
//GPS北向距离
|
||||||
|
|||||||
@ -78,19 +78,22 @@ export default async function request(req: any) {
|
|||||||
message: decodeURIComponent(resultMessage),
|
message: decodeURIComponent(resultMessage),
|
||||||
duration: 3000
|
duration: 3000
|
||||||
});
|
});
|
||||||
return
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for( let i in res ) {
|
for( let i in res ) {
|
||||||
resObj = res[i].head
|
resObj = res[i].head
|
||||||
}
|
}
|
||||||
console.info('jiangsong:res in request' + url + JSON.stringify(res))
|
console.info('jiangsong:res in request' + url + JSON.stringify(resObj))
|
||||||
if(resObj.resultCode === '0') {
|
if(resObj.resultCode === '0') {
|
||||||
return res
|
return res
|
||||||
}else {
|
}else {
|
||||||
globalThis.type='1'
|
globalThis.type='1'
|
||||||
|
if(!host){
|
||||||
AppStorage.SetOrCreate('errorMsg', 1);
|
AppStorage.SetOrCreate('errorMsg', 1);
|
||||||
globalThis.title=decodeURIComponent(resObj.resultMessage)
|
globalThis.title=decodeURIComponent(resObj.resultMessage)
|
||||||
|
}
|
||||||
|
|
||||||
prompt.showToast({
|
prompt.showToast({
|
||||||
message: decodeURIComponent(resObj.resultMessage),
|
message: decodeURIComponent(resObj.resultMessage),
|
||||||
duration: 3000
|
duration: 3000
|
||||||
|
|||||||
@ -93,6 +93,7 @@ export default struct Index {
|
|||||||
this.errorDialog.open()
|
this.errorDialog.open()
|
||||||
this.limit=true
|
this.limit=true
|
||||||
console.log('carInfo', JSON.stringify(globalThis.carInfo))
|
console.log('carInfo', JSON.stringify(globalThis.carInfo))
|
||||||
|
try{
|
||||||
examinerLoginService(param).then(res => {
|
examinerLoginService(param).then(res => {
|
||||||
console.log('res?.examinerLoginRsp?.head?.resultCode',res?.examinerLoginRsp?.head?.resultCode,JSON.stringify(res))
|
console.log('res?.examinerLoginRsp?.head?.resultCode',res?.examinerLoginRsp?.head?.resultCode,JSON.stringify(res))
|
||||||
this.errorDialog.close()
|
this.errorDialog.close()
|
||||||
@ -116,7 +117,15 @@ export default struct Index {
|
|||||||
globalThis.username = this.inputTextArr[0]
|
globalThis.username = this.inputTextArr[0]
|
||||||
}).catch(err=>{
|
}).catch(err=>{
|
||||||
console.log('jiangsong12',JSON.stringify(err))
|
console.log('jiangsong12',JSON.stringify(err))
|
||||||
|
this.errorDialog.close()
|
||||||
|
this.limit=false
|
||||||
})
|
})
|
||||||
|
}catch(eroor){
|
||||||
|
console.log('erroreee')
|
||||||
|
this.errorDialog.close()
|
||||||
|
this.limit=false
|
||||||
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
Image(item).width('18%').height('24%').onClick(() => {
|
Image(item).width('18%').height('24%').onClick(() => {
|
||||||
|
|||||||
@ -17,6 +17,7 @@ import promptAction from '@ohos.promptAction'
|
|||||||
import { voiceService } from '../common/service/voiceService';
|
import { voiceService } from '../common/service/voiceService';
|
||||||
import errorMsgDialog from './compontents/errorMsgDialog'
|
import errorMsgDialog from './compontents/errorMsgDialog'
|
||||||
import { getSyncData } from '../common/service/initable';
|
import { getSyncData } from '../common/service/initable';
|
||||||
|
import { GlobalConfig } from '../config/index'
|
||||||
|
|
||||||
@Entry
|
@Entry
|
||||||
@Component
|
@Component
|
||||||
@ -373,13 +374,8 @@ struct Index {
|
|||||||
this.isSingle = globalThis.singlePlay
|
this.isSingle = globalThis.singlePlay
|
||||||
this.loading = false
|
this.loading = false
|
||||||
this.createAlbum()
|
this.createAlbum()
|
||||||
|
|
||||||
this.num = 0
|
this.num = 0
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
// const TcpClient: TcpClient =new TcpClient(result[0].tcplocalIp, result[0].tcplocalIpPort,result[0].tcpOppositeIp,result[0].tcpOppositePort)
|
// const TcpClient: TcpClient =new TcpClient(result[0].tcplocalIp, result[0].tcplocalIpPort,result[0].tcpOppositeIp,result[0].tcpOppositePort)
|
||||||
|
|
||||||
console.info('Index onPageShow');
|
console.info('Index onPageShow');
|
||||||
globalThis.lsh = '1111111111111'
|
globalThis.lsh = '1111111111111'
|
||||||
}
|
}
|
||||||
@ -416,7 +412,7 @@ struct Index {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async initParams() {
|
async initParams() {
|
||||||
deleteAllFIleLog()
|
deleteAllFIleLog(GlobalConfig.comoonfileWriteAddress+'/PLC/')
|
||||||
//设置plc udp 同步requesthost
|
//设置plc udp 同步requesthost
|
||||||
await getUDP(this.context, false)
|
await getUDP(this.context, false)
|
||||||
this.loading = false
|
this.loading = false
|
||||||
|
|||||||
@ -291,16 +291,13 @@ struct Index {
|
|||||||
//项目开始数据是否上传过
|
//项目开始数据是否上传过
|
||||||
isUpload:false,
|
isUpload:false,
|
||||||
}
|
}
|
||||||
if(isInExam){
|
|
||||||
if(kStringArr.includes(txt2)){
|
|
||||||
this.projectsObj[no2*1] = currentProject
|
|
||||||
this.projectsCenterObj[txt2] = currentProject
|
|
||||||
this.projects.push(currentProject);
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
this.projectsObj[no2*1] = currentProject
|
this.projectsObj[no2*1] = currentProject
|
||||||
this.projectsCenterObj[txt2] = currentProject
|
this.projectsCenterObj[txt2] = currentProject
|
||||||
this.projects.push(currentProject);
|
this.projects.push(currentProject);
|
||||||
|
if(isInExam && !kStringArr.includes(txt2)){
|
||||||
|
this.projectsObj[no2*1].type = '3'
|
||||||
|
|
||||||
|
// this.ddxkKsxmArr.push(txt2)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -906,7 +903,6 @@ struct Index {
|
|||||||
this.loadingPopupVisible = true
|
this.loadingPopupVisible = true
|
||||||
clearInterval(this.timer);
|
clearInterval(this.timer);
|
||||||
clearInterval(globalThis.judgeTimer)
|
clearInterval(globalThis.judgeTimer)
|
||||||
globalThis.windowClass.setWindowSystemBarEnable(['navigation'])
|
|
||||||
this.judge.checkExamIsEnd(true);
|
this.judge.checkExamIsEnd(true);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -99,7 +99,7 @@ export default struct Index {
|
|||||||
kfdm,
|
kfdm,
|
||||||
wayno,
|
wayno,
|
||||||
//TODO 真实监管项目
|
//TODO 真实监管项目
|
||||||
// kString:'40300,40500,40700,40800'
|
// kString:'40200,40300,40400,40500,40700,41000,41100,41200,41300,41400,40600,41500,41700,40400,40800,40900'
|
||||||
}
|
}
|
||||||
}, router.RouterMode.Single);
|
}, router.RouterMode.Single);
|
||||||
|
|
||||||
|
|||||||
@ -79,7 +79,6 @@ struct UserInfo {
|
|||||||
@State Param803Str: string = ''
|
@State Param803Str: string = ''
|
||||||
private title = ''
|
private title = ''
|
||||||
private type = '2'
|
private type = '2'
|
||||||
|
|
||||||
// 过程照片拍照
|
// 过程照片拍照
|
||||||
getPhoto = async (empty?: boolean) => {
|
getPhoto = async (empty?: boolean) => {
|
||||||
const singlePlay = globalThis.singlePlay
|
const singlePlay = globalThis.singlePlay
|
||||||
@ -118,6 +117,7 @@ struct UserInfo {
|
|||||||
alignment: DialogAlignment.Center,
|
alignment: DialogAlignment.Center,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
async onPageShow() {
|
async onPageShow() {
|
||||||
this.updateTimeLimit = false
|
this.updateTimeLimit = false
|
||||||
this.ksksLimit = false
|
this.ksksLimit = false
|
||||||
@ -226,7 +226,7 @@ struct UserInfo {
|
|||||||
this.stopDeviceById()
|
this.stopDeviceById()
|
||||||
// globalThis.statue=4
|
// globalThis.statue=4
|
||||||
router.pushUrl({
|
router.pushUrl({
|
||||||
url: examSubject == 3 ? 'pages/Roads' : 'pages/Judge',
|
url: examSubject == 3 ? 'pages/c' : 'pages/Judge',
|
||||||
params: {
|
params: {
|
||||||
sczb: Number(this.isBoardPrePareSetPopupOpen),
|
sczb: Number(this.isBoardPrePareSetPopupOpen),
|
||||||
kfdm: this.sczbkf,
|
kfdm: this.sczbkf,
|
||||||
@ -464,6 +464,7 @@ struct UserInfo {
|
|||||||
this.errorDialog.open()
|
this.errorDialog.open()
|
||||||
this.updateTimeLimit = true
|
this.updateTimeLimit = true
|
||||||
const param = `<getExaminationStudentInfoReq><head><checkCode>${Md5.Instance.get_md5(globalThis.carInfo.carId + globalThis.carInfo.examinationRoomId + globalThis.username)}</checkCode></head><body><carId>${globalThis.carInfo.carId}</carId><examinationRoomId>${globalThis.carInfo.examinationRoomId}</examinationRoomId><examinerName>${globalThis.username}</examinerName></body></getExaminationStudentInfoReq>`
|
const param = `<getExaminationStudentInfoReq><head><checkCode>${Md5.Instance.get_md5(globalThis.carInfo.carId + globalThis.carInfo.examinationRoomId + globalThis.username)}</checkCode></head><body><carId>${globalThis.carInfo.carId}</carId><examinationRoomId>${globalThis.carInfo.examinationRoomId}</examinationRoomId><examinerName>${globalThis.username}</examinerName></body></getExaminationStudentInfoReq>`
|
||||||
|
try {
|
||||||
getExaminationStudentInfo(param).then(async (res) => {
|
getExaminationStudentInfo(param).then(async (res) => {
|
||||||
this.errorDialog.close()
|
this.errorDialog.close()
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@ -518,8 +519,14 @@ struct UserInfo {
|
|||||||
})
|
})
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
this.updateTimeLimit = false
|
this.updateTimeLimit = false
|
||||||
|
this.errorDialog.close()
|
||||||
console.log('error12error' + error)
|
console.log('error12error' + error)
|
||||||
})
|
})
|
||||||
|
} catch (error) {
|
||||||
|
this.updateTimeLimit = false
|
||||||
|
this.errorDialog.close()
|
||||||
|
console.log('error14error' + error)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
qkFn() {
|
qkFn() {
|
||||||
@ -1088,7 +1095,11 @@ struct LabelBlock {
|
|||||||
Row() {
|
Row() {
|
||||||
Text(this.label).fontSize(20 * this.ratio).fontColor('#99948A')
|
Text(this.label).fontSize(20 * this.ratio).fontColor('#99948A')
|
||||||
Row() {
|
Row() {
|
||||||
Text(decodeURIComponent(this.value)).fontColor('#fff').textAlign(TextAlign.Center).width('100%').fontSize(18 * this.ratio)
|
Text(decodeURIComponent(this.value))
|
||||||
|
.fontColor('#fff')
|
||||||
|
.textAlign(TextAlign.Center)
|
||||||
|
.width('100%')
|
||||||
|
.fontSize(18 * this.ratio)
|
||||||
}
|
}
|
||||||
.commLabelStyle()
|
.commLabelStyle()
|
||||||
}.margin({ bottom: 10 * this.ratio })
|
}.margin({ bottom: 10 * this.ratio })
|
||||||
|
|||||||
@ -192,6 +192,24 @@ export async function examJudgeSoundEnd(param:{
|
|||||||
return await handle(temp,'examJudgeSoundEnd')
|
return await handle(temp,'examJudgeSoundEnd')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @desc 实时距离计算
|
||||||
|
*
|
||||||
|
* */
|
||||||
|
export async function examCalcGpsDistance(param:{
|
||||||
|
jd1:number,
|
||||||
|
wd1:number,
|
||||||
|
jd2:number,
|
||||||
|
wd2:number,
|
||||||
|
h:number
|
||||||
|
}){
|
||||||
|
const {jd1,wd1,jd2,wd2,h} = param
|
||||||
|
const temp = libJudgeSdk.examJudgeSoundEnd(jd1,wd1,jd2,wd2,h);
|
||||||
|
return await handle(temp,'examCalcGpsDistance')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @desc通用处理函数
|
* @desc通用处理函数
|
||||||
*
|
*
|
||||||
|
|||||||
@ -121,7 +121,7 @@ export default class Judge {
|
|||||||
}
|
}
|
||||||
//日志回调
|
//日志回调
|
||||||
console.info(judgeTag, '1.进入评判入口')
|
console.info(judgeTag, '1.进入评判入口')
|
||||||
await examJudgeSetLogCallback(6, async (level, info, len) => {
|
await examJudgeSetLogCallback(3, async (level, info, len) => {
|
||||||
console.log('评判日志:' + info)
|
console.log('评判日志:' + info)
|
||||||
await fileLog.setExamJudgeLogData(info);
|
await fileLog.setExamJudgeLogData(info);
|
||||||
})
|
})
|
||||||
@ -177,6 +177,8 @@ export default class Judge {
|
|||||||
console.info('socketTag[PLC.UdpClient]', '收到udp回调数据')
|
console.info('socketTag[PLC.UdpClient]', '收到udp回调数据')
|
||||||
handleUdp(msg)
|
handleUdp(msg)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
//TODO 监听远程扣分
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取评判初始化数据
|
// 获取评判初始化数据
|
||||||
@ -233,7 +235,7 @@ export default class Judge {
|
|||||||
const {sczb,kfdm} = currentParams;
|
const {sczb,kfdm} = currentParams;
|
||||||
const {isExam} = this;
|
const {isExam} = this;
|
||||||
const judgeUI = this.judgeUI
|
const judgeUI = this.judgeUI
|
||||||
const {projects,carType,isDdxk,ddxkTime,projectsCenterObj,ddxkKsxmArr,ddxkKfArr} = judgeUI;
|
const {projects,carType,isDdxk,ddxkTime,projectsCenterObj,ddxkKsxmArr,ddxkKfArr,passingScore} = judgeUI;
|
||||||
const beginInfo = {
|
const beginInfo = {
|
||||||
kgid: '012',
|
kgid: '012',
|
||||||
kgxm: decodeURI(examinerName || ''),
|
kgxm: decodeURI(examinerName || ''),
|
||||||
@ -254,6 +256,7 @@ export default class Judge {
|
|||||||
wayno: judgeUI.wayno * 1,
|
wayno: judgeUI.wayno * 1,
|
||||||
czlx: 0,
|
czlx: 0,
|
||||||
kskssj: await systemTime.getCurrentTime(),
|
kskssj: await systemTime.getCurrentTime(),
|
||||||
|
passing:passingScore * 1,
|
||||||
ksxm: projects.map(project => {
|
ksxm: projects.map(project => {
|
||||||
return {
|
return {
|
||||||
xmdm: project.projectCode * 1,
|
xmdm: project.projectCode * 1,
|
||||||
@ -837,7 +840,7 @@ export default class Judge {
|
|||||||
this.judgeUI.totalScore = isAllProjectsEnd ? totalScore : 0;
|
this.judgeUI.totalScore = isAllProjectsEnd ? totalScore : 0;
|
||||||
const singlePlay = globalThis.singlePlay
|
const singlePlay = globalThis.singlePlay
|
||||||
const param302 = judgeConfigObj['302'];
|
const param302 = judgeConfigObj['302'];
|
||||||
globalThis.windowClass.setWindowSystemBarEnable(['navigation'])
|
// globalThis.windowClass.setWindowSystemBarEnable(['navigation'])
|
||||||
|
|
||||||
//自动退出待验证并且不合格
|
//自动退出待验证并且不合格
|
||||||
if (!isManual && examSubject == 3 && (param302 == 1 || (singlePlay && param302 == 2)) && totalScore < passingScore) {
|
if (!isManual && examSubject == 3 && (param302 == 1 || (singlePlay && param302 == 2)) && totalScore < passingScore) {
|
||||||
@ -913,24 +916,58 @@ export default class Judge {
|
|||||||
const param302 = judgeConfigObj['302'];
|
const param302 = judgeConfigObj['302'];
|
||||||
judgeUI.loadingPopupVisible = true;
|
judgeUI.loadingPopupVisible = true;
|
||||||
|
|
||||||
|
let currentKssycs =0;
|
||||||
let voiceURL = ''
|
let voiceURL = ''
|
||||||
if (examSubject == 2) {
|
if (examSubject == 2) {
|
||||||
voiceURL = (totalScore < passingScore ? `voice/unqualified_${kssycs == 1 ? 'one' : 'two'}.wav` : 'voice/qualified.mp3')
|
voiceURL = (totalScore < passingScore ? `voice/unqualified_${kssycs == 1 ? 'one' : 'two'}.wav` : 'voice/qualified.mp3')
|
||||||
|
switch (voiceURL){
|
||||||
|
case 'voice/unqualified_one.wav':
|
||||||
|
currentKssycs = 0;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'voice/unqualified_two.wav':
|
||||||
|
currentKssycs = 1;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'voice/qualified.mp3':
|
||||||
|
currentKssycs = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (examSubject == 3) {
|
if (examSubject == 3) {
|
||||||
if (isAllProjectsEnd) {
|
if (isAllProjectsEnd) {
|
||||||
if (totalScore < passingScore) {
|
if (totalScore < passingScore) {
|
||||||
voiceURL = `voice/${kssycs == 1 ? 'exam_no_pass_finish' : 'exam_no_pass'}.mp3`
|
voiceURL = `voice/${kssycs == 1 ? 'exam_no_pass_finish' : 'exam_no_pass'}.mp3`
|
||||||
|
currentKssycs = kssycs == 1 ? 0 : 1
|
||||||
} else {
|
} else {
|
||||||
voiceURL = 'voice/exam_pass.mp3'
|
voiceURL = 'voice/exam_pass.mp3'
|
||||||
|
currentKssycs = 0
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
voiceURL = `voice/${kssycs == 1 ? 'exam_no_pass_finish' : 'exam_no_pass'}.mp3`
|
voiceURL = `voice/${kssycs == 1 ? 'exam_no_pass_finish' : 'exam_no_pass'}.mp3`
|
||||||
|
currentKssycs = kssycs == 1 ? 0 : 1
|
||||||
|
}
|
||||||
|
switch (voiceURL){
|
||||||
|
case 'voice/exam_no_pass_finish.mp3':
|
||||||
|
currentKssycs = 0;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'voice/exam_no_pass.mp3':
|
||||||
|
currentKssycs = 1;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'voice/exam_pass.mp3':
|
||||||
|
currentKssycs = 0;
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const USER = await getSyncData('USER');
|
const USER = await getSyncData('USER');
|
||||||
await upDateTableByArray('USER', [{...USER[0],kssycs:kssycs == 2 ? 1 : 0}])
|
await upDateTableByArray('USER', [{
|
||||||
|
...USER[0],
|
||||||
|
kssycs:currentKssycs
|
||||||
|
}])
|
||||||
|
|
||||||
console.info(judgeTag, `考试成绩:${totalScore}`)
|
console.info(judgeTag, `考试成绩:${totalScore}`)
|
||||||
if(!singlePlay){
|
if(!singlePlay){
|
||||||
@ -1296,7 +1333,7 @@ export default class Judge {
|
|||||||
const udpIndex = globalThis.udpIndex;
|
const udpIndex = globalThis.udpIndex;
|
||||||
if (udpIndex % 5 === 0 && !isUdpEnd) {
|
if (udpIndex % 5 === 0 && !isUdpEnd) {
|
||||||
const judgeUdp = globalThis.judgeUdp
|
const judgeUdp = globalThis.judgeUdp
|
||||||
const bytes = await this.getMessageHeartbeat();
|
const bytes = await this.getMessageHeartbeat(isExamEnd);
|
||||||
console.info(judgeTag+'UDP',JSON.stringify(bytes))
|
console.info(judgeTag+'UDP',JSON.stringify(bytes))
|
||||||
judgeUdp.send(bytes)
|
judgeUdp.send(bytes)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -163,6 +163,7 @@ export function promptWxCode(
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
switch (jkid){
|
switch (jkid){
|
||||||
|
|
||||||
//项目开始
|
//项目开始
|
||||||
case '17C52':
|
case '17C52':
|
||||||
switch (code){
|
switch (code){
|
||||||
|
|||||||
@ -6,7 +6,7 @@ export const judgeConfig = {
|
|||||||
//是否开启拍照
|
//是否开启拍照
|
||||||
isPhotoOpen: true,
|
isPhotoOpen: true,
|
||||||
//扣分语音是否强制开启
|
//扣分语音是否强制开启
|
||||||
kfVoiceOpen: true,
|
kfVoiceOpen: false,
|
||||||
//忽略的考试项目
|
//忽略的考试项目
|
||||||
ignoreProjects:[],
|
ignoreProjects:[],
|
||||||
// 是否忽略考试前熄火、车门检查
|
// 是否忽略考试前熄火、车门检查
|
||||||
|
|||||||
@ -30,8 +30,9 @@ workerPort.onmessage = (e: MessageEvents): void => {
|
|||||||
console.log('baoyihu,onmessage',JSON.stringify(param))
|
console.log('baoyihu,onmessage',JSON.stringify(param))
|
||||||
if(param.mode=='1'){
|
if(param.mode=='1'){
|
||||||
//单中心
|
//单中心
|
||||||
|
try{
|
||||||
getSingleCenterTable(param).then((ret) => {
|
getSingleCenterTable(param).then((ret) => {
|
||||||
console.log('teststetfinsh1')
|
console.log('teststetfinsh1',ret)
|
||||||
if (ret) {
|
if (ret) {
|
||||||
workerPort.postMessage({ isComplete: true });
|
workerPort.postMessage({ isComplete: true });
|
||||||
}else{
|
}else{
|
||||||
@ -39,6 +40,10 @@ workerPort.onmessage = (e: MessageEvents): void => {
|
|||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}catch(error){
|
||||||
|
workerPort.postMessage({ isComplete: false });
|
||||||
|
}
|
||||||
|
|
||||||
}else if(param.mode=='3'){
|
}else if(param.mode=='3'){
|
||||||
//双中心
|
//双中心
|
||||||
getDoubleCeneterTable(param).then((ret)=>{
|
getDoubleCeneterTable(param).then((ret)=>{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user