Compare commits
No commits in common. "68821fa208aff17c588f663a4daab0f0e0ac70bd" and "b76a2a3f58622e3a16b7fd65b5c2611d8756a7f9" have entirely different histories.
68821fa208
...
b76a2a3f58
@ -58,7 +58,7 @@ export async function writeObjectOut(params,filePath?:string): Promise<WR> {
|
||||
await fileUtil.initFolder(filePath);
|
||||
fileUtil.editFile(`${filePath}/wuxi_exam_data.txt`,JSON.stringify({
|
||||
xtlb,jkxlh,jkid,drvexam:{...drvexam,zp:''},
|
||||
}) +`\n`);
|
||||
}));
|
||||
}
|
||||
|
||||
console.info('surenjun','调用旧监管')
|
||||
@ -93,11 +93,6 @@ export async function writeObjectOut(params,filePath?:string): Promise<WR> {
|
||||
method: 'post',
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
@ -41,16 +41,16 @@ export async function getliushuiNum(context) {
|
||||
// return str
|
||||
}
|
||||
}
|
||||
export async function deleteAllFIleLog(path){
|
||||
export async function deleteAllFIleLog(){
|
||||
let options = {
|
||||
"recursion": false,
|
||||
"listNum": 0,
|
||||
};
|
||||
let filenames = fs.listFileSync(path, options);
|
||||
let filenames = fs.listFileSync(GlobalConfig.comoonfileWriteAddress+'/PLC/', options);
|
||||
console.info("listFile succeed",JSON.stringify(filenames));
|
||||
for (let i = 0; i < filenames.length; i++) {
|
||||
if(isSevenDaysAgo(filenames[i])){
|
||||
fs.rmdir(path+filenames[i], (err) => {
|
||||
fs.rmdir(GlobalConfig.comoonfileWriteAddress+'/PLC/'+filenames[i], (err) => {
|
||||
if (err) {
|
||||
console.error("rmdir failed with error message: " + err.message + ", error code: " + err.code);
|
||||
} else {
|
||||
@ -157,47 +157,44 @@ export async function getDoubleCeneterTable(param) {
|
||||
//单中心存表
|
||||
export async function getSingleCenterTable(param) {
|
||||
return new Promise((reslove, reject) => {
|
||||
try{
|
||||
upDataZhongxinginitialization(param).then((result) => {
|
||||
console.log('teststetfinsh01',result)
|
||||
upDataZhongxinginitialization(param).then((result) => {
|
||||
console.log('teststetfinsh01')
|
||||
|
||||
if (result) {
|
||||
reslove(true)
|
||||
} else {
|
||||
// promptAction.showToast({
|
||||
// title: '提示',
|
||||
// message: '联网更新失败,请检查网络后重新更新',
|
||||
// buttons: [
|
||||
// {
|
||||
// text: '确认',
|
||||
// color: '#000000',
|
||||
// },
|
||||
// {
|
||||
// text: '取消',
|
||||
// color: '#000000',
|
||||
// }
|
||||
// ],
|
||||
// })
|
||||
// .then(data => {
|
||||
// reslove(false)
|
||||
// })
|
||||
// .catch(err => {
|
||||
// reslove(false)
|
||||
// })
|
||||
console.log('联网更新失败,请检查网络后重新更新')
|
||||
// promptAction.showToast({
|
||||
// message: `联网更新表数据失败,请重新更新`,
|
||||
// duration: 3000
|
||||
// });
|
||||
reslove(false)
|
||||
}
|
||||
}).catch((error) => {
|
||||
if (result) {
|
||||
reslove(true)
|
||||
} else {
|
||||
// promptAction.showToast({
|
||||
// title: '提示',
|
||||
// message: '联网更新失败,请检查网络后重新更新',
|
||||
// buttons: [
|
||||
// {
|
||||
// text: '确认',
|
||||
// color: '#000000',
|
||||
// },
|
||||
// {
|
||||
// text: '取消',
|
||||
// color: '#000000',
|
||||
// }
|
||||
// ],
|
||||
// })
|
||||
// .then(data => {
|
||||
// reslove(false)
|
||||
// })
|
||||
// .catch(err => {
|
||||
// reslove(false)
|
||||
// })
|
||||
console.log('联网更新失败,请检查网络后重新更新')
|
||||
// promptAction.showToast({
|
||||
// message: `联网更新表数据失败,请重新更新`,
|
||||
// duration: 3000
|
||||
// });
|
||||
reslove(false)
|
||||
console.log(error)
|
||||
})
|
||||
}catch (e){
|
||||
}
|
||||
}).catch((error) => {
|
||||
reslove(false)
|
||||
}
|
||||
console.log(error)
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@ -360,47 +360,42 @@ export async function upDataZhongxinginitialization(param) {
|
||||
resolve(flag)
|
||||
return
|
||||
}
|
||||
try{
|
||||
const str = {
|
||||
"carId": param.carId, // 表名
|
||||
"examinationRoomId": param.examinationRoomId, //考试平台kdid
|
||||
videoVersion: '1.0',
|
||||
judgeVersion: param.judgeVersion,
|
||||
shellVersion: param.shellVersion,
|
||||
host: param.host
|
||||
}
|
||||
console.log('daihai2', JSON.stringify(str))
|
||||
|
||||
initialization(str).then(async (res) => {
|
||||
console.log('daihai3', JSON.stringify(res))
|
||||
if (!res||res.initializationRsp.head.resultCode==1) {
|
||||
console.log('daihai34', JSON.stringify(res))
|
||||
resolve(false)
|
||||
return
|
||||
}
|
||||
let flag
|
||||
console.log('resposestart')
|
||||
|
||||
for (let key in res.initializationRsp.body) {
|
||||
if (!centerToMap[key]) {
|
||||
continue
|
||||
}
|
||||
const data = await setSyncCenterSqlData(key, res, param)
|
||||
if (!data) {
|
||||
resolve(false)
|
||||
}
|
||||
}
|
||||
resolve(true)
|
||||
|
||||
|
||||
console.log('resposestart')
|
||||
|
||||
}).catch((Error) => {
|
||||
resolve(false)
|
||||
})
|
||||
}catch (error){
|
||||
resolve(false)
|
||||
const str = {
|
||||
"carId": param.carId, // 表名
|
||||
"examinationRoomId": param.examinationRoomId, //考试平台kdid
|
||||
videoVersion: '1.0',
|
||||
judgeVersion: param.judgeVersion,
|
||||
shellVersion: param.shellVersion,
|
||||
host: param.host
|
||||
}
|
||||
console.log('daihai2', JSON.stringify(str))
|
||||
|
||||
initialization(str).then(async (res) => {
|
||||
console.log('daihai3', JSON.stringify(res))
|
||||
if (!res) {
|
||||
resolve(false)
|
||||
return
|
||||
}
|
||||
let flag
|
||||
console.log('resposestart')
|
||||
|
||||
for (let key in res.initializationRsp.body) {
|
||||
if (!centerToMap[key]) {
|
||||
continue
|
||||
}
|
||||
const data = await setSyncCenterSqlData(key, res, param)
|
||||
if (!data) {
|
||||
resolve(false)
|
||||
}
|
||||
}
|
||||
resolve(true)
|
||||
|
||||
|
||||
console.log('resposestart')
|
||||
|
||||
}).catch((Error) => {
|
||||
resolve(false)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@ -106,7 +106,8 @@ console.log('baoyihubaoyihu',video_uri,flag)
|
||||
// var snapResult = rtsp_server.getVideoSnapshot(context, video_uri, '', dir);
|
||||
if(flag==0){
|
||||
rtsp_server.detectVideoSnapshotSize(video_uri,fileName,(err,snapResult)=>{
|
||||
console.log("baohaowen_detectLoop round end size1:"+snapResult.fileSize);
|
||||
console.log("baohaowen_detectLoop round end size1:"+JSON.stringify(snapResult));
|
||||
//errorCode=0为正常
|
||||
callback({fileSize:snapResult.fileSize,errorCode:snapResult.errorCode })
|
||||
});
|
||||
|
||||
@ -116,6 +117,7 @@ console.log('baoyihubaoyihu',video_uri,flag)
|
||||
return new Promise<takePhotoParam>((resolve,reject)=>{
|
||||
rtsp_server.getVideoSnapshot(context, video_uri, fileName,dir,true,(err,snapResult)=>{
|
||||
console.log('baoyihubaoyihu',video_uri,flag,JSON.stringify(snapResult))
|
||||
//errorCode=-2拍照失败
|
||||
console.log('getPhtot',JSON.stringify(snapResult))
|
||||
resolve({base64: snapResult.dataString,name:snapResult.fileName,fileSize:snapResult.fileSize,errorCode:snapResult.errorCode })
|
||||
});
|
||||
|
||||
@ -103,12 +103,12 @@ export default class TcpClient {
|
||||
}, timeout: 6000
|
||||
});
|
||||
promise.then(() => {
|
||||
console.log('testTagtestTag000',)
|
||||
|
||||
this.tcp.setExtraOptions({
|
||||
keepAlive: true,
|
||||
}, err => {
|
||||
if (err) {
|
||||
console.log('testTagtestTag000,error')
|
||||
console.log('testTagtestTagerrrrr,success')
|
||||
if(this.num>3){
|
||||
return
|
||||
}
|
||||
@ -119,7 +119,7 @@ export default class TcpClient {
|
||||
return;
|
||||
}
|
||||
});
|
||||
console.log('testTagtestTag000,success')
|
||||
console.log('testTagtestTagconnect,success')
|
||||
|
||||
globalThis.getCloseTcp = false
|
||||
resolve(true)
|
||||
@ -133,7 +133,7 @@ export default class TcpClient {
|
||||
getTCP()
|
||||
resolve(false)
|
||||
}, 2000)
|
||||
console.log('testTagtestTag000,error')
|
||||
console.log('testTagtestTagconnect,error')
|
||||
|
||||
});
|
||||
})
|
||||
|
||||
@ -74,7 +74,7 @@ export const getMessageHeartbeat = async (msg) => {
|
||||
string2Bytes(serialIndex, 2 * 8),
|
||||
translateSignals,
|
||||
//@ts-ignore
|
||||
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),
|
||||
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),
|
||||
//GPS东向距离
|
||||
string2Bytes(0, 4 * 8),
|
||||
//GPS北向距离
|
||||
|
||||
@ -78,22 +78,19 @@ export default async function request(req: any) {
|
||||
message: decodeURIComponent(resultMessage),
|
||||
duration: 3000
|
||||
});
|
||||
return false
|
||||
return
|
||||
}
|
||||
}
|
||||
for( let i in res ) {
|
||||
resObj = res[i].head
|
||||
}
|
||||
console.info('jiangsong:res in request' + url + JSON.stringify(resObj))
|
||||
console.info('jiangsong:res in request' + url + JSON.stringify(res))
|
||||
if(resObj.resultCode === '0') {
|
||||
return res
|
||||
}else {
|
||||
globalThis.type='1'
|
||||
if(!host){
|
||||
AppStorage.SetOrCreate('errorMsg', 1);
|
||||
globalThis.title=decodeURIComponent(resObj.resultMessage)
|
||||
}
|
||||
|
||||
AppStorage.SetOrCreate('errorMsg', 1);
|
||||
globalThis.title=decodeURIComponent(resObj.resultMessage)
|
||||
prompt.showToast({
|
||||
message: decodeURIComponent(resObj.resultMessage),
|
||||
duration: 3000
|
||||
|
||||
@ -93,39 +93,30 @@ export default struct Index {
|
||||
this.errorDialog.open()
|
||||
this.limit=true
|
||||
console.log('carInfo', JSON.stringify(globalThis.carInfo))
|
||||
try{
|
||||
examinerLoginService(param).then(res => {
|
||||
console.log('res?.examinerLoginRsp?.head?.resultCode',res?.examinerLoginRsp?.head?.resultCode,JSON.stringify(res))
|
||||
this.errorDialog.close()
|
||||
|
||||
this.limit=false
|
||||
if(res?.examinerLoginRsp?.head?.resultCode=='1'){
|
||||
// this.type='1'
|
||||
// this.title=decodeURIComponent(res.examinerLoginRsp.head.resultMessage)
|
||||
// console.log('this.titlt',this.title)
|
||||
// this.errorDialog.open()
|
||||
return
|
||||
}
|
||||
router.pushUrl({
|
||||
url: 'pages/UserInfo',
|
||||
params:{
|
||||
type:1
|
||||
}
|
||||
}, router.RouterMode.Single);
|
||||
|
||||
console.log('res11', JSON.stringify(res))
|
||||
globalThis.username = this.inputTextArr[0]
|
||||
}).catch(err=>{
|
||||
console.log('jiangsong12',JSON.stringify(err))
|
||||
this.errorDialog.close()
|
||||
this.limit=false
|
||||
})
|
||||
}catch(eroor){
|
||||
console.log('erroreee')
|
||||
examinerLoginService(param).then(res => {
|
||||
console.log('res?.examinerLoginRsp?.head?.resultCode',res?.examinerLoginRsp?.head?.resultCode,JSON.stringify(res))
|
||||
this.errorDialog.close()
|
||||
this.limit=false
|
||||
}
|
||||
|
||||
this.limit=false
|
||||
if(res?.examinerLoginRsp?.head?.resultCode=='1'){
|
||||
// this.type='1'
|
||||
// this.title=decodeURIComponent(res.examinerLoginRsp.head.resultMessage)
|
||||
// console.log('this.titlt',this.title)
|
||||
// this.errorDialog.open()
|
||||
return
|
||||
}
|
||||
router.pushUrl({
|
||||
url: 'pages/UserInfo',
|
||||
params:{
|
||||
type:1
|
||||
}
|
||||
}, router.RouterMode.Single);
|
||||
|
||||
console.log('res11', JSON.stringify(res))
|
||||
globalThis.username = this.inputTextArr[0]
|
||||
}).catch(err=>{
|
||||
console.log('jiangsong12',JSON.stringify(err))
|
||||
})
|
||||
})
|
||||
} else {
|
||||
Image(item).width('18%').height('24%').onClick(() => {
|
||||
|
||||
@ -17,7 +17,6 @@ import promptAction from '@ohos.promptAction'
|
||||
import { voiceService } from '../common/service/voiceService';
|
||||
import errorMsgDialog from './compontents/errorMsgDialog'
|
||||
import { getSyncData } from '../common/service/initable';
|
||||
import { GlobalConfig } from '../config/index'
|
||||
|
||||
@Entry
|
||||
@Component
|
||||
@ -374,8 +373,13 @@ struct Index {
|
||||
this.isSingle = globalThis.singlePlay
|
||||
this.loading = false
|
||||
this.createAlbum()
|
||||
|
||||
this.num = 0
|
||||
|
||||
|
||||
//
|
||||
// const TcpClient: TcpClient =new TcpClient(result[0].tcplocalIp, result[0].tcplocalIpPort,result[0].tcpOppositeIp,result[0].tcpOppositePort)
|
||||
|
||||
console.info('Index onPageShow');
|
||||
globalThis.lsh = '1111111111111'
|
||||
}
|
||||
@ -412,7 +416,7 @@ struct Index {
|
||||
}
|
||||
|
||||
async initParams() {
|
||||
deleteAllFIleLog(GlobalConfig.comoonfileWriteAddress+'/PLC/')
|
||||
deleteAllFIleLog()
|
||||
//设置plc udp 同步requesthost
|
||||
await getUDP(this.context, false)
|
||||
this.loading = false
|
||||
|
||||
@ -291,13 +291,16 @@ struct Index {
|
||||
//项目开始数据是否上传过
|
||||
isUpload:false,
|
||||
}
|
||||
this.projectsObj[no2*1] = currentProject
|
||||
this.projectsCenterObj[txt2] = currentProject
|
||||
this.projects.push(currentProject);
|
||||
if(isInExam && !kStringArr.includes(txt2)){
|
||||
this.projectsObj[no2*1].type = '3'
|
||||
|
||||
// this.ddxkKsxmArr.push(txt2)
|
||||
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.projectsCenterObj[txt2] = currentProject
|
||||
this.projects.push(currentProject);
|
||||
}
|
||||
|
||||
}
|
||||
@ -903,6 +906,7 @@ struct Index {
|
||||
this.loadingPopupVisible = true
|
||||
clearInterval(this.timer);
|
||||
clearInterval(globalThis.judgeTimer)
|
||||
globalThis.windowClass.setWindowSystemBarEnable(['navigation'])
|
||||
this.judge.checkExamIsEnd(true);
|
||||
}
|
||||
})
|
||||
|
||||
@ -99,7 +99,7 @@ export default struct Index {
|
||||
kfdm,
|
||||
wayno,
|
||||
//TODO 真实监管项目
|
||||
// kString:'40200,40300,40400,40500,40700,41000,41100,41200,41300,41400,40600,41500,41700,40400,40800,40900'
|
||||
// kString:'40300,40500,40700,40800'
|
||||
}
|
||||
}, router.RouterMode.Single);
|
||||
|
||||
|
||||
@ -79,6 +79,7 @@ struct UserInfo {
|
||||
@State Param803Str: string = ''
|
||||
private title = ''
|
||||
private type = '2'
|
||||
|
||||
// 过程照片拍照
|
||||
getPhoto = async (empty?: boolean) => {
|
||||
const singlePlay = globalThis.singlePlay
|
||||
@ -117,10 +118,9 @@ struct UserInfo {
|
||||
alignment: DialogAlignment.Center,
|
||||
},
|
||||
)
|
||||
|
||||
async onPageShow() {
|
||||
this.updateTimeLimit = false
|
||||
this.ksksLimit = false
|
||||
this.updateTimeLimit=false
|
||||
this.ksksLimit=false
|
||||
console.log('响应头地址响应头地址')
|
||||
const mediaTest = new FilePhoto(this.context);
|
||||
this.filePhoto = new FilePhoto(this.context);
|
||||
@ -130,42 +130,42 @@ struct UserInfo {
|
||||
this.initData()
|
||||
//身份证读卡器初始化
|
||||
// this.openDeviceByIDCard()
|
||||
const routerParam = router.getParams() || { type: 0 };
|
||||
console.log('routerParam', JSON.stringify(routerParam))
|
||||
if (!globalThis.singlePlay) {
|
||||
const routerParam=router.getParams()||{type :0};
|
||||
console.log('routerParam',JSON.stringify(routerParam))
|
||||
if(!globalThis.singlePlay){
|
||||
// @ts-ignore
|
||||
if (routerParam.type != 1) {
|
||||
if(routerParam.type!=1){
|
||||
// @ts-ignore
|
||||
this.list = await getSyncData('USERLIST')
|
||||
this.list =await getSyncData('USERLIST')
|
||||
// @ts-ignore
|
||||
const data = await getSyncData('USER')
|
||||
const user = data[0]
|
||||
if (user && Number(user.kssycs)) {
|
||||
this.list.forEach(res => {
|
||||
if (res.sfzmhm == user.sfzmhm) {
|
||||
res.kssycs = user.kssycs
|
||||
const data=await getSyncData('USER')
|
||||
const user=data[0]
|
||||
if(user&&Number(user.kssycs)){
|
||||
this.list.forEach(res=>{
|
||||
if(res.sfzmhm==user.sfzmhm){
|
||||
res.kssycs=user.kssycs
|
||||
this.getCurrentStudent(res.sfzmhm)
|
||||
}
|
||||
})
|
||||
|
||||
} else if (user && (user.kssycs == '0' || user.kssycs == '')) {
|
||||
}else if(user&&(user.kssycs=='0'||user.kssycs=='')){
|
||||
console.log('datadatadatadata')
|
||||
this.list = this.list.filter(res => {
|
||||
return res.sfzmhm != user.sfzmhm
|
||||
this.list=this.list.filter(res=>{
|
||||
return res.sfzmhm!=user.sfzmhm
|
||||
})
|
||||
this.pageIndex = 0
|
||||
this.pageIndex=0
|
||||
this.dataList = this.list.slice(this.pageIndex * 4, this.pageIndex * 4 + 4)
|
||||
if (this.dataList.length) {
|
||||
this.currentUser = this.dataList[0]
|
||||
} else {
|
||||
this.currentUser = EmptyCandidateObject
|
||||
if(this.dataList.length){
|
||||
this.currentUser=this.dataList[0]
|
||||
}else{
|
||||
this.currentUser=EmptyCandidateObject
|
||||
}
|
||||
}
|
||||
this.list.forEach((res, index) => {
|
||||
res.id = index.toString()
|
||||
this.list.forEach((res,index)=>{
|
||||
res.id=index.toString()
|
||||
})
|
||||
await upDateTableByArray('USERLIST', this.list || [])
|
||||
} else {
|
||||
await upDateTableByArray('USERLIST', this.list||[])
|
||||
}else{
|
||||
this.getExaminationStudentInfoFn()
|
||||
}
|
||||
}
|
||||
@ -226,7 +226,7 @@ struct UserInfo {
|
||||
this.stopDeviceById()
|
||||
// globalThis.statue=4
|
||||
router.pushUrl({
|
||||
url: examSubject == 3 ? 'pages/c' : 'pages/Judge',
|
||||
url: examSubject == 3 ? 'pages/Roads' : 'pages/Judge',
|
||||
params: {
|
||||
sczb: Number(this.isBoardPrePareSetPopupOpen),
|
||||
kfdm: this.sczbkf,
|
||||
@ -243,7 +243,7 @@ struct UserInfo {
|
||||
if (!flag) {
|
||||
globalThis.lsh = '0000000000000'
|
||||
await upDateTableByArray('USER', [])
|
||||
this.currentUser = this.list[0]
|
||||
this.currentUser=this.list[0]
|
||||
// promptAction.showToast({
|
||||
// message: '未匹配到对应下载学员',
|
||||
// duration: 3000
|
||||
@ -401,7 +401,7 @@ struct UserInfo {
|
||||
that.openDeviceByIDCard()
|
||||
}
|
||||
}
|
||||
if (that.list.length) {
|
||||
if(that.list.length){
|
||||
return
|
||||
}
|
||||
//0不自动更新 1自动更新(不限次数) 2没有考生更新2次
|
||||
@ -460,78 +460,71 @@ struct UserInfo {
|
||||
return
|
||||
}
|
||||
await upDateTableByArray('USER', [])
|
||||
this.type = '2'
|
||||
this.type='2'
|
||||
this.errorDialog.open()
|
||||
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>`
|
||||
try {
|
||||
getExaminationStudentInfo(param).then(async (res) => {
|
||||
this.errorDialog.close()
|
||||
setTimeout(() => {
|
||||
this.updateTimeLimit = false
|
||||
}, 3000)
|
||||
if (!res || res?.getExaminationStudentInfoRsp?.head?.resultCode == '1') {
|
||||
return
|
||||
}
|
||||
let dataList = []
|
||||
this.list = []
|
||||
|
||||
for (let key in res.getExaminationStudentInfoRsp.body) {
|
||||
const a = res.getExaminationStudentInfoRsp.body[key]
|
||||
if (a instanceof Array) {
|
||||
dataList = a
|
||||
} else {
|
||||
dataList = [a]
|
||||
}
|
||||
}
|
||||
if (dataList.length) {
|
||||
this.numCount = 0
|
||||
}
|
||||
|
||||
this.list = JSON.parse(JSON.stringify(dataList))
|
||||
this.list.forEach((listData, index) => {
|
||||
listData.id = index.toString()
|
||||
for (let i in listData) {
|
||||
listData[i] = decodeURI(listData[i])
|
||||
}
|
||||
listData.kszp = this.photo + listData.kszp
|
||||
listData.ksmjzp = this.photo + listData.ksmjzp
|
||||
})
|
||||
await upDateTableByArray('USERLIST', this.list || [])
|
||||
dataList = this.list.length > 4 ? this.list.slice(this.pageIndex * 4, this.pageIndex * 4 + 4) : this.list;
|
||||
|
||||
this.dataList = dataList
|
||||
if (this.dataList.length) {
|
||||
this.currentUser = this.dataList[0]
|
||||
} else {
|
||||
this.currentUser = EmptyCandidateObject
|
||||
}
|
||||
|
||||
this.lsh = this.currentUser.lsh
|
||||
globalThis.lsh = this.lsh
|
||||
globalThis.ksyh = this.currentUser.ksy1sfzmhm || this.currentUser.ksy2sfzmhm
|
||||
console.log('this.currentUse3' + JSON.stringify(this.currentUser))
|
||||
this.pageIndex = 0
|
||||
getSyncData('USER').then(data => {
|
||||
if (data?.[0]) {
|
||||
this.getCurrentStudent(data[0].sfzmhm)
|
||||
}
|
||||
})
|
||||
}).catch((error) => {
|
||||
this.updateTimeLimit = false
|
||||
this.errorDialog.close()
|
||||
console.log('error12error' + error)
|
||||
})
|
||||
} catch (error) {
|
||||
this.updateTimeLimit = false
|
||||
getExaminationStudentInfo(param).then(async (res) => {
|
||||
this.errorDialog.close()
|
||||
console.log('error14error' + error)
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.updateTimeLimit = false
|
||||
}, 3000)
|
||||
if (!res||res?.getExaminationStudentInfoRsp?.head?.resultCode=='1') {
|
||||
return
|
||||
}
|
||||
let dataList = []
|
||||
this.list = []
|
||||
|
||||
for (let key in res.getExaminationStudentInfoRsp.body) {
|
||||
const a = res.getExaminationStudentInfoRsp.body[key]
|
||||
if (a instanceof Array) {
|
||||
dataList = a
|
||||
} else {
|
||||
dataList = [a]
|
||||
}
|
||||
}
|
||||
if (dataList.length) {
|
||||
this.numCount = 0
|
||||
}
|
||||
|
||||
this.list = JSON.parse(JSON.stringify(dataList))
|
||||
this.list.forEach((listData,index) => {
|
||||
listData.id=index.toString()
|
||||
for (let i in listData) {
|
||||
listData[i] = decodeURI(listData[i])
|
||||
}
|
||||
listData.kszp = this.photo + listData.kszp
|
||||
listData.ksmjzp = this.photo + listData.ksmjzp
|
||||
})
|
||||
await upDateTableByArray('USERLIST', this.list||[])
|
||||
dataList = this.list.length > 4 ? this.list.slice(this.pageIndex * 4, this.pageIndex * 4 + 4) : this.list;
|
||||
|
||||
this.dataList = dataList
|
||||
if (this.dataList.length) {
|
||||
this.currentUser = this.dataList[0]
|
||||
} else {
|
||||
this.currentUser = EmptyCandidateObject
|
||||
}
|
||||
|
||||
this.lsh = this.currentUser.lsh
|
||||
globalThis.lsh = this.lsh
|
||||
globalThis.ksyh = this.currentUser.ksy1sfzmhm || this.currentUser.ksy2sfzmhm
|
||||
console.log('this.currentUse3' + JSON.stringify(this.currentUser))
|
||||
this.pageIndex = 0
|
||||
getSyncData('USER').then(data => {
|
||||
if (data?.[0]) {
|
||||
this.getCurrentStudent(data[0].sfzmhm)
|
||||
}
|
||||
})
|
||||
}).catch((error) => {
|
||||
this.updateTimeLimit = false
|
||||
console.log('error12error' + error)
|
||||
})
|
||||
}
|
||||
|
||||
qkFn() {
|
||||
this.faceCompareSucess = 0
|
||||
this.ksksLimit = false
|
||||
this.ksksLimit=false
|
||||
if (globalThis.singlePlay) {
|
||||
this.qkFlag = false
|
||||
return
|
||||
@ -619,7 +612,7 @@ struct UserInfo {
|
||||
})
|
||||
return
|
||||
}
|
||||
this.currentUser.id = '0'
|
||||
this.currentUser.id='0'
|
||||
await upDateTableByArray('USER', [this.currentUser])
|
||||
this.stepFlag = false
|
||||
this.isLoadingPopupVisible = false
|
||||
@ -630,10 +623,10 @@ struct UserInfo {
|
||||
sczb: Number(this.isBoardPrePareSetPopupOpen),
|
||||
kfdm: this.sczbkf,
|
||||
//真实监管项目
|
||||
kString: keystr || ''
|
||||
kString:keystr || ''
|
||||
}
|
||||
}, router.RouterMode.Single);
|
||||
this.updateTimeLimit = false
|
||||
this.updateTimeLimit=false
|
||||
this.stopDeviceById()
|
||||
this.stepFlag = false
|
||||
})
|
||||
@ -825,7 +818,7 @@ struct UserInfo {
|
||||
.backgroundImageSize({ width: '100%', height: '100%' })
|
||||
.onClick(() => {
|
||||
globalThis.lsh = item.lsh;
|
||||
if (this.isExamStart && !globalThis.singlePlay) {
|
||||
if (this.isExamStart&&!globalThis.singlePlay) {
|
||||
return
|
||||
}
|
||||
this.currentUser = item
|
||||
@ -900,10 +893,10 @@ struct UserInfo {
|
||||
Image($r('app.media.qk_btn'))
|
||||
.commStyle()
|
||||
.onClick(() => {
|
||||
if (this.ksksLimit) {
|
||||
if(this.ksksLimit){
|
||||
return
|
||||
}
|
||||
this.ksksLimit = true
|
||||
this.ksksLimit=true
|
||||
this.qkFlag = true
|
||||
})
|
||||
|
||||
@ -913,7 +906,7 @@ struct UserInfo {
|
||||
try {
|
||||
await this.checkSignal()
|
||||
this.isExamStart = true
|
||||
this.currentUser.id = '0'
|
||||
this.currentUser.id='0'
|
||||
await upDateTableByArray('USER', [this.currentUser])
|
||||
globalThis.statue = 4
|
||||
this.isBoardPrePareSetPopupShow = true;
|
||||
@ -928,7 +921,7 @@ struct UserInfo {
|
||||
Image($r('app.media.ksks_btn'))
|
||||
.commStyle()
|
||||
.onClick(async () => {
|
||||
if (this.ksksLimit) {
|
||||
if(this.ksksLimit){
|
||||
return
|
||||
}
|
||||
console.log('routerParamrouterParam')
|
||||
@ -939,11 +932,11 @@ struct UserInfo {
|
||||
if (!this.currentUser.xm) {
|
||||
return
|
||||
}
|
||||
this.ksksLimit = true
|
||||
this.ksksLimit=true
|
||||
|
||||
if (globalThis.singlePlay) {
|
||||
const {examSubject} = globalThis.carInfo;
|
||||
this.currentUser.id = '0'
|
||||
this.currentUser.id='0'
|
||||
await upDateTableByArray('USER', [this.currentUser])
|
||||
router.pushUrl({
|
||||
url: examSubject == 3 ? 'pages/Roads' : 'pages/Judge',
|
||||
@ -952,7 +945,7 @@ struct UserInfo {
|
||||
kfdm: this.sczbkf,
|
||||
}
|
||||
}, router.RouterMode.Single);
|
||||
this.ksksLimit = false
|
||||
this.ksksLimit=false
|
||||
|
||||
this.stopDeviceById()
|
||||
return
|
||||
@ -993,7 +986,7 @@ struct UserInfo {
|
||||
}
|
||||
.commStyle()
|
||||
.onClick(() => {
|
||||
this.ksksLimit = false
|
||||
this.ksksLimit=false
|
||||
this.qkFlag = false
|
||||
})
|
||||
|
||||
@ -1095,11 +1088,7 @@ struct LabelBlock {
|
||||
Row() {
|
||||
Text(this.label).fontSize(20 * this.ratio).fontColor('#99948A')
|
||||
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()
|
||||
}.margin({ bottom: 10 * this.ratio })
|
||||
|
||||
@ -192,24 +192,6 @@ export async function examJudgeSoundEnd(param:{
|
||||
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通用处理函数
|
||||
*
|
||||
|
||||
@ -121,7 +121,7 @@ export default class Judge {
|
||||
}
|
||||
//日志回调
|
||||
console.info(judgeTag, '1.进入评判入口')
|
||||
await examJudgeSetLogCallback(3, async (level, info, len) => {
|
||||
await examJudgeSetLogCallback(6, async (level, info, len) => {
|
||||
console.log('评判日志:' + info)
|
||||
await fileLog.setExamJudgeLogData(info);
|
||||
})
|
||||
@ -177,8 +177,6 @@ export default class Judge {
|
||||
console.info('socketTag[PLC.UdpClient]', '收到udp回调数据')
|
||||
handleUdp(msg)
|
||||
})
|
||||
|
||||
//TODO 监听远程扣分
|
||||
}
|
||||
|
||||
// 获取评判初始化数据
|
||||
@ -235,7 +233,7 @@ export default class Judge {
|
||||
const {sczb,kfdm} = currentParams;
|
||||
const {isExam} = this;
|
||||
const judgeUI = this.judgeUI
|
||||
const {projects,carType,isDdxk,ddxkTime,projectsCenterObj,ddxkKsxmArr,ddxkKfArr,passingScore} = judgeUI;
|
||||
const {projects,carType,isDdxk,ddxkTime,projectsCenterObj,ddxkKsxmArr,ddxkKfArr} = judgeUI;
|
||||
const beginInfo = {
|
||||
kgid: '012',
|
||||
kgxm: decodeURI(examinerName || ''),
|
||||
@ -256,7 +254,6 @@ export default class Judge {
|
||||
wayno: judgeUI.wayno * 1,
|
||||
czlx: 0,
|
||||
kskssj: await systemTime.getCurrentTime(),
|
||||
passing:passingScore * 1,
|
||||
ksxm: projects.map(project => {
|
||||
return {
|
||||
xmdm: project.projectCode * 1,
|
||||
@ -840,7 +837,7 @@ export default class Judge {
|
||||
this.judgeUI.totalScore = isAllProjectsEnd ? totalScore : 0;
|
||||
const singlePlay = globalThis.singlePlay
|
||||
const param302 = judgeConfigObj['302'];
|
||||
// globalThis.windowClass.setWindowSystemBarEnable(['navigation'])
|
||||
globalThis.windowClass.setWindowSystemBarEnable(['navigation'])
|
||||
|
||||
//自动退出待验证并且不合格
|
||||
if (!isManual && examSubject == 3 && (param302 == 1 || (singlePlay && param302 == 2)) && totalScore < passingScore) {
|
||||
@ -916,58 +913,24 @@ export default class Judge {
|
||||
const param302 = judgeConfigObj['302'];
|
||||
judgeUI.loadingPopupVisible = true;
|
||||
|
||||
let currentKssycs =0;
|
||||
let voiceURL = ''
|
||||
if (examSubject == 2) {
|
||||
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 (isAllProjectsEnd) {
|
||||
if (totalScore < passingScore) {
|
||||
voiceURL = `voice/${kssycs == 1 ? 'exam_no_pass_finish' : 'exam_no_pass'}.mp3`
|
||||
currentKssycs = kssycs == 1 ? 0 : 1
|
||||
} else {
|
||||
voiceURL = 'voice/exam_pass.mp3'
|
||||
currentKssycs = 0
|
||||
}
|
||||
} else {
|
||||
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');
|
||||
await upDateTableByArray('USER', [{
|
||||
...USER[0],
|
||||
kssycs:currentKssycs
|
||||
}])
|
||||
const USER =await getSyncData('USER');
|
||||
await upDateTableByArray('USER', [{...USER[0],kssycs:kssycs == 2 ? 1 : 0}])
|
||||
|
||||
console.info(judgeTag, `考试成绩:${totalScore}`)
|
||||
if(!singlePlay){
|
||||
@ -1333,7 +1296,7 @@ export default class Judge {
|
||||
const udpIndex = globalThis.udpIndex;
|
||||
if (udpIndex % 5 === 0 && !isUdpEnd) {
|
||||
const judgeUdp = globalThis.judgeUdp
|
||||
const bytes = await this.getMessageHeartbeat(isExamEnd);
|
||||
const bytes = await this.getMessageHeartbeat();
|
||||
console.info(judgeTag+'UDP',JSON.stringify(bytes))
|
||||
judgeUdp.send(bytes)
|
||||
}
|
||||
|
||||
@ -163,7 +163,6 @@ export function promptWxCode(
|
||||
return
|
||||
}
|
||||
switch (jkid){
|
||||
|
||||
//项目开始
|
||||
case '17C52':
|
||||
switch (code){
|
||||
|
||||
@ -6,7 +6,7 @@ export const judgeConfig = {
|
||||
//是否开启拍照
|
||||
isPhotoOpen: true,
|
||||
//扣分语音是否强制开启
|
||||
kfVoiceOpen: false,
|
||||
kfVoiceOpen: true,
|
||||
//忽略的考试项目
|
||||
ignoreProjects:[],
|
||||
// 是否忽略考试前熄火、车门检查
|
||||
|
||||
@ -30,20 +30,15 @@ workerPort.onmessage = (e: MessageEvents): void => {
|
||||
console.log('baoyihu,onmessage',JSON.stringify(param))
|
||||
if(param.mode=='1'){
|
||||
//单中心
|
||||
try{
|
||||
getSingleCenterTable(param).then((ret) => {
|
||||
console.log('teststetfinsh1',ret)
|
||||
if (ret) {
|
||||
workerPort.postMessage({ isComplete: true });
|
||||
}else{
|
||||
workerPort.postMessage({ isComplete: false });
|
||||
|
||||
}
|
||||
})
|
||||
}catch(error){
|
||||
workerPort.postMessage({ isComplete: false });
|
||||
}
|
||||
getSingleCenterTable(param).then((ret) => {
|
||||
console.log('teststetfinsh1')
|
||||
if (ret) {
|
||||
workerPort.postMessage({ isComplete: true });
|
||||
}else{
|
||||
workerPort.postMessage({ isComplete: false });
|
||||
|
||||
}
|
||||
})
|
||||
}else if(param.mode=='3'){
|
||||
//双中心
|
||||
getDoubleCeneterTable(param).then((ret)=>{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user