Compare commits

...

11 Commits

41 changed files with 468 additions and 306 deletions

View File

@ -18,7 +18,8 @@ export async function download() {
interface WR{
message?:string
code:number
code?:number
keystr?:string
}
// 通用监管接口
export async function writeObjectOut(params,filePath?:string): Promise<WR> {
@ -56,7 +57,7 @@ export async function writeObjectOut(params,filePath?:string): Promise<WR> {
const fileUtil = new FileUtil(globalThis.context);
await fileUtil.initFolder(filePath);
fileUtil.editFile(`${filePath}/wuxi_exam_data.txt`,JSON.stringify({
xtlb,jkxlh,jkid,drvexam
xtlb,jkxlh,jkid,drvexam:{...drvexam,zp:''},
}));
}

View File

@ -25,7 +25,7 @@ CommonConstants {
*/
static readonly ACCOUNT_TABLE = {
tableName: 'accountTable',
sqlCreate: 'CREATE TABLE IF NOT EXISTS accountTable(sfzmhm INTEGER PRIMARY KEY AUTOINCREMENT,lsh TEXT, xm TEXT)',
sqlCreate: 'CREATE TABLE IF NOT EXISTS accountTable(sfzmhm TEXT,lsh TEXT, xm TEXT)',
columns: [ 'sfzmhm', 'xm','lsh']
};
// sqlCreate: 'CREATE TABLE IF NOT EXISTS accountTable(id INTEGER PRIMARY KEY AUTOINCREMENT,kaoShengXinXi TEXT, lsh TEXT, ' +

View File

@ -25,7 +25,7 @@ CommonConstants {
*/
static readonly ACCOUNT_TABLE = {
tableName: 'DeviceInfoTable',
sqlCreate: 'CREATE TABLE IF NOT EXISTS DeviceInfoTable(id INTEGER PRIMARY KEY AUTOINCREMENT,deviceId TEXT)',
sqlCreate: 'CREATE TABLE IF NOT EXISTS DeviceInfoTable(id TEXT,deviceId TEXT)',
columns: ['id','deviceId']
};

View File

@ -25,7 +25,7 @@ CommonConstants {
*/
static readonly ACCOUNT_TABLE = {
tableName: 'ES_CARINFO',
sqlCreate: 'CREATE TABLE IF NOT EXISTS ES_CARINFO(id INTEGER PRIMARY KEY AUTOINCREMENT,car_mac TEXT,status TEXT, voiceip TEXT, ' +
sqlCreate: 'CREATE TABLE IF NOT EXISTS ES_CARINFO(id TEXT,car_mac TEXT,status TEXT, voiceip TEXT, ' +
'carno TEXT, carcode TEXT,cartype TEXT,device_status TEXT,carip TEXT,pulse1 TEXT,pulse2 TEXT,isface TEXT,bk1 TEXT,ismapcollect TEXT,bk2 TEXT,exampointcode TEXT,software_version TEXT,typename TEXT,vin TEXT,voicetype TEXT,em TEXT,carclass TEXT,carid TEXT,flag TEXT,kscx TEXT,x_mch TEXT)',
columns: ['id','car_mac', 'status', 'voiceip', 'carno', 'carcode', 'cartype', 'device_status', 'carip', 'pulse1', 'pulse2', 'isface', 'bk1', 'ismapcollect', 'bk2', 'exampointcode', 'software_version', 'typename', 'vin', 'voicetype','em','carclass','carid','flag','kscx','x_mch']
};

View File

@ -25,7 +25,7 @@ CommonConstants {
*/
static readonly ACCOUNT_TABLE = {
tableName: 'ES_CAR_VIDEO_PARAMETER',
sqlCreate: 'CREATE TABLE IF NOT EXISTS ES_CAR_VIDEO_PARAMETER(id INTEGER PRIMARY KEY AUTOINCREMENT,video_mode TEXT,video_channel TEXT, first_channel TEXT, ' +
sqlCreate: 'CREATE TABLE IF NOT EXISTS ES_CAR_VIDEO_PARAMETER(id TEXT,video_mode TEXT,video_channel TEXT, first_channel TEXT, ' +
'second_port TEXT, first_port TEXT,third_ip TEXT,photo_overlay_text_size TEXT,second_ip TEXT,photo_overlay_text_content3 TEXT,video_range TEXT,fourth_port TEXT,line_type TEXT,third_port TEXT,fourth_channel TEXT,process_face_comparion_mode TEXT,second_password TEXT,first_username TEXT,third_username TEXT,photo_overlay_text_content2 TEXT,photo_overlay_text_content1 TEXT,process_face_comparion_enable TEXT,third_password TEXT,fourth_username TEXT,fourth_ip TEXT,first_password TEXT,second_username TEXT,video_synthesis_system_ip TEXT,photo_overlay_text_position TEXT,video_synthesis_server_port TEXT,car_mac TEXT,photo_overlay_text_enable TEXT,video_synthesis_system_port TEXT,second_channel TEXT,video_occlusion_range TEXT,fourth_password TEXT,photo_channel TEXT,video_synthesis_server_ip TEXT,photo_overlay_text_split TEXT,equipment_type TEXT,video_occlusion TEXT,third_channel TEXT,first_ip TEXT)',
columns: ['id','video_mode', 'video_channel','first_channel', 'second_port', 'first_port', 'third_ip', 'photo_overlay_text_size', 'second_ip', 'photo_overlay_text_content3', 'video_range', 'fourth_port', 'line_type', 'third_port', 'fourth_channel', 'process_face_comparion_mode', 'second_password', 'first_username', 'third_username','photo_overlay_text_content2','photo_overlay_text_content1','process_face_comparion_enable','third_password','fourth_username','fourth_ip','first_password','second_username','video_synthesis_system_ip','photo_overlay_text_position','video_synthesis_server_port','car_mac','photo_overlay_text_enable','video_synthesis_system_port','second_channel','video_occlusion_range','fourth_password','photo_channel','video_synthesis_server_ip','photo_overlay_text_split','equipment_type','video_occlusion','third_channel','first_ip']
};

View File

@ -25,7 +25,7 @@ CommonConstants {
*/
static readonly ACCOUNT_TABLE = {
tableName: 'ES_EXAMPOINTDETAIL',
sqlCreate: 'CREATE TABLE IF NOT EXISTS ES_EXAMPOINTDETAIL(id INTEGER PRIMARY KEY AUTOINCREMENT,code TEXT,type TEXT, name TEXT, ' +
sqlCreate: 'CREATE TABLE IF NOT EXISTS ES_EXAMPOINTDETAIL(id TEXT,code TEXT,type TEXT, name TEXT, ' +
'status TEXT, udpip TEXT,udpcommandport TEXT,udpvoiceport TEXT,udpdataport TEXT,fullname TEXT,exam_status TEXT,is_motor TEXT)',
columns: ['id','code', 'type', 'name','status','udpip', 'udpcommandport', 'udpvoiceport','udpdataport','fullname','exam_status','is_motor']
};

View File

@ -25,7 +25,7 @@ CommonConstants {
*/
static readonly ACCOUNT_TABLE = {
tableName: 'IpConfigTable',
sqlCreate: 'CREATE TABLE IF NOT EXISTS IpConfigTable(id INTEGER PRIMARY KEY AUTOINCREMENT,udplocalIp TEXT,udplocalIpPort TEXT, udpOppositeIp TEXT, udpOppositeIpPort TEXT,tcplocalIp TEXT,tcplocalIpPort TEXT,tcpOppositeIp TEXT,tcpOppositePort TEXT,gateway TEXT,netMask TEXT,dnsServers TEXT,centerPort TEXT,centerIp TEXT)',
sqlCreate: 'CREATE TABLE IF NOT EXISTS IpConfigTable(id TEXT,udplocalIp TEXT,udplocalIpPort TEXT, udpOppositeIp TEXT, udpOppositeIpPort TEXT,tcplocalIp TEXT,tcplocalIpPort TEXT,tcpOppositeIp TEXT,tcpOppositePort TEXT,gateway TEXT,netMask TEXT,dnsServers TEXT,centerPort TEXT,centerIp TEXT)',
columns: ['id','udplocalIp', 'udplocalIpPort', 'udpOppositeIp','udpOppositeIpPort','tcplocalIp','tcplocalIpPort','tcpOppositeIp','tcpOppositePort','gateway','netMask','dnsServers','centerPort','centerIp']
};

View File

@ -25,7 +25,7 @@ CommonConstants {
*/
static readonly ACCOUNT_TABLE = {
tableName: 'MA_CDSBINFO',
sqlCreate: 'CREATE TABLE IF NOT EXISTS MA_CDSBINFO(id INTEGER PRIMARY KEY AUTOINCREMENT,sbbm TEXT,itemsno TEXT, sbbh TEXT, kdid TEXT, bk3 TEXT)',
sqlCreate: 'CREATE TABLE IF NOT EXISTS MA_CDSBINFO(id TEXT,sbbm TEXT,itemsno TEXT, sbbh TEXT, kdid TEXT, bk3 TEXT)',
columns: ['id','sbbm', 'itemsno', 'sbbh', 'kdid', 'bk3']
};

View File

@ -25,7 +25,7 @@ CommonConstants {
*/
static readonly ACCOUNT_TABLE = {
tableName: 'MA_ITEMINFO',
sqlCreate: 'CREATE TABLE IF NOT EXISTS MA_ITEMINFO(id INTEGER PRIMARY KEY AUTOINCREMENT,cininfo TEXT,setup9 TEXT, nextinfo TEXT, ' +
sqlCreate: 'CREATE TABLE IF NOT EXISTS MA_ITEMINFO(id TEXT,cininfo TEXT,setup9 TEXT, nextinfo TEXT, ' +
'setup7 TEXT, setup8 TEXT,setup5 TEXT,carlist TEXT,setup6 TEXT,setup3 TEXT,setup4 TEXT,setup1 TEXT,setup2 TEXT,itemsno TEXT,end_cardsno TEXT,freqinfo TEXT)',
columns: ['id','cininfo', 'setup9', 'nextinfo', 'setup7', 'setup8', 'setup5', 'carlist', 'setup6', 'setup3', 'setup4', 'setup1', 'setup2', 'itemsno', 'end_cardsno', 'freqinfo']
};

View File

@ -25,7 +25,7 @@ CommonConstants {
*/
static readonly ACCOUNT_TABLE = {
tableName: 'MA_MAP_COLLECT',
sqlCreate: 'CREATE TABLE IF NOT EXISTS MA_MAP_COLLECT(id INTEGER PRIMARY KEY AUTOINCREMENT,l_no TEXT,s_no TEXT, s_no1 TEXT, ' +
sqlCreate: 'CREATE TABLE IF NOT EXISTS MA_MAP_COLLECT(id TEXT,l_no TEXT,s_no TEXT, s_no1 TEXT, ' +
'road_code TEXT, gps_e TEXT,gps_n TEXT,posx TEXT,posy TEXT,l_type TEXT,line_type TEXT,next_s_no TEXT,next_s_no1 TEXT,lane_attr TEXT,gps_h TEXT)',
columns: ['id','l_no', 's_no', 's_no1', 'road_code', 'gps_e', 'gps_n','posx','posy','l_type','line_type','next_s_no','next_s_no1','lane_attr','gps_h']
};

View File

@ -25,7 +25,7 @@ CommonConstants {
*/
static readonly ACCOUNT_TABLE = {
tableName: 'MA_MAP_COLLECT_SHAPE',
sqlCreate: 'CREATE TABLE IF NOT EXISTS MA_MAP_COLLECT_SHAPE(id INTEGER PRIMARY KEY AUTOINCREMENT,serial_no TEXT,l_no1 TEXT, l_no2 TEXT, ' +
sqlCreate: 'CREATE TABLE IF NOT EXISTS MA_MAP_COLLECT_SHAPE(id TEXT,serial_no TEXT,l_no1 TEXT, l_no2 TEXT, ' +
'l_no3 TEXT, l_no4 TEXT,attr_str TEXT,subtype TEXT)',
columns: ['id','serial_no', 'l_no1', 'l_no2', 'l_no3', 'l_no4', 'attr_str','subtype']
};

View File

@ -25,7 +25,7 @@ CommonConstants {
*/
static readonly ACCOUNT_TABLE = {
tableName: 'MA_MAP_ITEMCLASS',
sqlCreate: 'CREATE TABLE IF NOT EXISTS MA_MAP_ITEMCLASS(id INTEGER PRIMARY KEY AUTOINCREMENT,itemno TEXT,itemno1 TEXT, itemname TEXT, ' +
sqlCreate: 'CREATE TABLE IF NOT EXISTS MA_MAP_ITEMCLASS(id TEXT,itemno TEXT,itemno1 TEXT, itemname TEXT, ' +
'itemname1 TEXT, item_type TEXT,enabled TEXT)',
columns: ['id','itemno', 'itemno1', 'itemname', 'itemname', 'itemname1', 'item_type','enabled']
};

View File

@ -25,7 +25,7 @@ CommonConstants {
*/
static readonly ACCOUNT_TABLE = {
tableName: 'MA_MAP_POINT',
sqlCreate: 'CREATE TABLE IF NOT EXISTS MA_MAP_POINT(id INTEGER PRIMARY KEY AUTOINCREMENT,point_no TEXT,point_no_f TEXT, gps_e TEXT,' +
sqlCreate: 'CREATE TABLE IF NOT EXISTS MA_MAP_POINT(id TEXT,point_no TEXT,point_no_f TEXT, gps_e TEXT,' +
'gps_e_location TEXT,gps_n TEXT,gps_n_location TEXT,f_gps_e TEXT,f_gps_n TEXT,point_type TEXT,road_code TEXT,visible TEXT,passed TEXT)',
columns: ['id','point_no', 'point_no_f', 'gps_e', 'gps_e_location', 'gps_n', 'gps_n_location','f_gps_e','f_gps_n','point_type','road_code','visible','passed']
};

View File

@ -25,7 +25,7 @@ CommonConstants {
*/
static readonly ACCOUNT_TABLE = {
tableName: 'MA_MAP_POINT_ITEM',
sqlCreate: 'CREATE TABLE IF NOT EXISTS MA_MAP_POINT_ITEM(id INTEGER PRIMARY KEY AUTOINCREMENT,point_no TEXT,itemno TEXT,itemno1 TEXT,' +
sqlCreate: 'CREATE TABLE IF NOT EXISTS MA_MAP_POINT_ITEM(id TEXT,point_no TEXT,itemno TEXT,itemno1 TEXT,' +
'subname TEXT)',
columns: ['id','point_no', 'itemno', 'itemno1', 'subname']
};

View File

@ -25,7 +25,7 @@ CommonConstants {
*/
static readonly ACCOUNT_TABLE = {
tableName: 'MA_MAP_ROAD',
sqlCreate: 'CREATE TABLE IF NOT EXISTS MA_MAP_ROAD(id INTEGER PRIMARY KEY AUTOINCREMENT,road_code TEXT,road_code_no TEXT,lane_no TEXT,' +
sqlCreate: 'CREATE TABLE IF NOT EXISTS MA_MAP_ROAD(id TEXT,road_code TEXT,road_code_no TEXT,lane_no TEXT,' +
'point1y TEXT,point1x TEXT,point2y TEXT,point2x TEXT,pointmy TEXT,pointmx TEXT,point3y TEXT,point3x TEXT,point4y TEXT,point4x TEXT,pointny TEXT,pointnx TEXT)',
columns: ['id','road_code', 'road_code_no', 'lane_no', 'point1y', 'point1x', 'point2y','point2x','pointmy','pointmx','point3y','point3x','point4y','point4x','pointny','pointnx']
};

View File

@ -25,7 +25,7 @@ CommonConstants {
*/
static readonly ACCOUNT_TABLE = {
tableName: 'MA_MAP_ROAD_LANE',
sqlCreate: 'CREATE TABLE IF NOT EXISTS MA_MAP_ROAD_LANE(id INTEGER PRIMARY KEY AUTOINCREMENT,road_code TEXT,road_code_no TEXT,lane_no TEXT,' +
sqlCreate: 'CREATE TABLE IF NOT EXISTS MA_MAP_ROAD_LANE(id TEXT,road_code TEXT,road_code_no TEXT,lane_no TEXT,' +
'line_type TEXT,lane_attr TEXT,line_width TEXT,rightline TEXT)',
columns: ['id','road_code', 'road_code_no', 'lane_no','line_type','lane_attr', 'line_width', 'rightline']
};

View File

@ -25,7 +25,7 @@ CommonConstants {
*/
static readonly ACCOUNT_TABLE = {
tableName: 'MAP_SUBITEM',
sqlCreate: 'CREATE TABLE IF NOT EXISTS MAP_SUBITEM(id INTEGER PRIMARY KEY AUTOINCREMENT,itemno TEXT,posx1 TEXT, posx2 TEXT, ' +
sqlCreate: 'CREATE TABLE IF NOT EXISTS MAP_SUBITEM(id TEXT,itemno TEXT,posx1 TEXT, posx2 TEXT, ' +
'posx3 TEXT, posx4 TEXT,posy1 TEXT,posy2 TEXT,posy3 TEXT,posy4 TEXT,sno TEXT,subname TEXT)',
columns: ['id','itemno', 'posx1', 'posx2', 'posx3', 'posx4', 'posy1', 'posy2', 'posy3', 'posy4', 'sno', 'subname']
};

View File

@ -25,7 +25,7 @@ CommonConstants {
*/
static readonly ACCOUNT_TABLE = {
tableName: 'MA_MARKRULE',
sqlCreate: 'CREATE TABLE IF NOT EXISTS MA_MARKRULE(id INTEGER PRIMARY KEY AUTOINCREMENT,itemno TEXT,markserial TEXT, markdepend TEXT, ' +
sqlCreate: 'CREATE TABLE IF NOT EXISTS MA_MARKRULE(id TEXT,itemno TEXT,markserial TEXT, markdepend TEXT, ' +
'markcatalog TEXT, markstandard TEXT,markreal TEXT,markshow TEXT,car_sid TEXT,gyro_sid TEXT,gps_sid TEXT,magnet_sid TEXT,simu_sid TEXT,close_sid TEXT,notes TEXT,onlyoneid TEXT,nocancelid TEXT,kfxh TEXT)',
columns: ['id','itemno', 'markserial', 'markdepend', 'markcatalog', 'markstandard', 'markreal', 'markshow', 'car_sid', 'gyro_sid', 'gps_sid', 'magnet_sid', 'simu_sid', 'close_sid', 'notes', 'onlyoneid', 'nocancelid', 'kfxh']
};

View File

@ -25,7 +25,7 @@ CommonConstants {
*/
static readonly ACCOUNT_TABLE = {
tableName: 'MA_MARKRULESET',
sqlCreate: 'CREATE TABLE IF NOT EXISTS MA_MARKRULESET(id INTEGER PRIMARY KEY AUTOINCREMENT,itemno TEXT,markserial TEXT, markdepend TEXT, ' +
sqlCreate: 'CREATE TABLE IF NOT EXISTS MA_MARKRULESET(id TEXT,itemno TEXT,markserial TEXT, markdepend TEXT, ' +
'markcatalog TEXT, markstandard TEXT,markreal TEXT,markshow TEXT,txt1 TEXT,kfxh TEXT)',
columns: ['id','itemno', 'markserial', 'markdepend','markcatalog','markstandard', 'markreal', 'markshow', 'txt1', 'kfxh']
};

View File

@ -25,7 +25,7 @@ CommonConstants {
*/
static readonly ACCOUNT_TABLE = {
tableName: 'MA_SYSSET',
sqlCreate: 'CREATE TABLE IF NOT EXISTS MA_SYSSET(id INTEGER PRIMARY KEY AUTOINCREMENT,v_no TEXT,v_name TEXT, v_value TEXT)',
sqlCreate: 'CREATE TABLE IF NOT EXISTS MA_SYSSET(id TEXT,v_no TEXT,v_name TEXT, v_value TEXT)',
columns: ['id','v_no', 'v_name', 'v_value']
};

View File

@ -25,7 +25,7 @@ CommonConstants {
*/
static readonly ACCOUNT_TABLE = {
tableName: 'MA_SYSTEMPARM',
sqlCreate: 'CREATE TABLE IF NOT EXISTS MA_SYSTEMPARM(id INTEGER PRIMARY KEY AUTOINCREMENT,no1 TEXT,no2 TEXT, no3 TEXT, ' +
sqlCreate: 'CREATE TABLE IF NOT EXISTS MA_SYSTEMPARM(id TEXT,no1 TEXT,no2 TEXT, no3 TEXT, ' +
'txt1 TEXT, txt2 TEXT,txt3 TEXT)',
columns: ['id','no1', 'no2', 'no3', 'txt1', 'txt2', 'txt3']
};

View File

@ -25,7 +25,7 @@ CommonConstants {
*/
static readonly ACCOUNT_TABLE = {
tableName: 'MA_T_CARPARMSET',
sqlCreate: 'CREATE TABLE IF NOT EXISTS MA_T_CARPARMSET(id INTEGER PRIMARY KEY AUTOINCREMENT,carid TEXT,itemname TEXT, parmdesc TEXT, ' +
sqlCreate: 'CREATE TABLE IF NOT EXISTS MA_T_CARPARMSET(id TEXT,carid TEXT,itemname TEXT, parmdesc TEXT, ' +
'parmname TEXT, pdefault TEXT,pvalue TEXT)',
columns: ['id','carid', 'itemname', 'parmdesc', 'parmname', 'pdefault', 'pvalue']
};

View File

@ -18,15 +18,15 @@ CommonConstants {
/**
* Rdb database config.
*/
static readonly STORE_CONFIG = { name: 'user.db' };
static readonly STORE_CONFIG = { name: 'USER.db' };
/**
* Account table config.
*/
static readonly ACCOUNT_TABLE = {
tableName: 'USER',
sqlCreate: 'CREATE TABLE IF NOT EXISTS USER(id INTEGER PRIMARY KEY AUTOINCREMENT,sfzmhm TEXT,xm CHAR(20), lsh TEXT, kszp TEXT,ksdd TEXT,kssycs TEXT,kslx TEXT,kscx TEXT,ksxl TEXT)',
columns: ['id','sfzmhm','xm','lsh','kszp','ksdd','kssycs','kslx','kscx','ksxl']
sqlCreate: 'CREATE TABLE IF NOT EXISTS USER(id INTEGER PRIMARY KEY AUTOINCREMENT,sfzmhm TEXT,xm CHAR(20), lsh TEXT, kszp TEXT,ksdd TEXT,kssycs TEXT,kslx TEXT,kscx TEXT,ksxl TEXT,ksy1 TEXT)',
columns: ['id','sfzmhm','xm','lsh','kszp','ksdd','kssycs','kslx','kscx','ksxl','ksy1']
};
/**

View File

@ -42,6 +42,8 @@ import common from '@ohos.app.ability.common';
import contextConstant from '@ohos.app.ability.contextConstant';
import featureAbility from '@ohos.ability.featureAbility'
import USERLIST from '../constants/USERLIST';
// import { Logger } from '../utils/Logger';
export default class Rdb {
private rdbStore: any = null;
@ -93,6 +95,7 @@ export default class Rdb {
'MA_T_CARPARMSET': MA_T_CARPARMSET,
'ES_CAR_VIDEO_PARAMETER': ES_CAR_VIDEO_PARAMETER,
'USER':USER,
'USERLIST':USERLIST,
'IpConfigTable':IpConfigTable,
'DeviceInfoTable':DeviceInfoTable,
'CommonConstants':CommonConstants
@ -150,6 +153,7 @@ export default class Rdb {
'ES_CAR_VIDEO_PARAMETER': ES_CAR_VIDEO_PARAMETER,
'CommonConstants':CommonConstants,
'USER':USER,
'USERLIST':USERLIST,
'IpConfigTable':IpConfigTable,
'DeviceInfoTable':DeviceInfoTable
}

View File

@ -29,7 +29,6 @@ export default class AccountTable {
// this.CommonConstants=Constants
this.commonConstants=Constants
this.accountTable.getRdbStore(callback,context);
console.log('kkkkkkkk0')
}
getRdbStore(callback: Function = () => {},context?) {

View File

@ -5,7 +5,8 @@ import { examinerLogin,initCarInfoCache} from '../../api/index'
//考官登录信息
export async function examinerLoginService(params) {
let res:any = await examinerLogin(params)
globalThis.examinerInfo=res.examinerLoginRsp.body
globalThis.examinerInfo=res?.examinerLoginRsp?.body || {}
console.log('jiangsong1: examinerLoginService' + JSON.stringify(res))
//{"examinerLoginRsp":{"head":{"resultCode":"0","resultMessage":"%E8%80%83%E8%AF%95%E5%91%98%E7%99%BB%E5%BD%95-%E6%88%90%E5%8A%9F","time":"2023-06-01 10:06:39"},"body":{"code":"006","name":"%E8%80%836","statusRgpp":"1"}}}

View File

@ -24,6 +24,7 @@ import IpConfigTable from '../constants/IpConfigTable';
import CommonConstants from '../constants/CommonConstants';
import DeviceInfoTable from '../constants/DeviceInfoTable';
import USER from '../constants/USER';
import USERLIST from '../constants/USERLIST';
import util from '@ohos.util';
import FileModel from '../../pages/judgeSDK/utils/fileModel';
import FileUtil from '../../common/utils/File';
@ -52,6 +53,7 @@ const map = {
'MA_T_CARPARMSET': MA_T_CARPARMSET,
'ES_CAR_VIDEO_PARAMETER': ES_CAR_VIDEO_PARAMETER,
'USER': USER,
'USERLIST': USERLIST,
'IpConfigTable': IpConfigTable,
'DeviceInfoTable': DeviceInfoTable,
'CommonConstants': CommonConstants
@ -89,6 +91,11 @@ function sqlInsertCommonFn(tableName, resultArr, context?, delFlag = true) {
// console.log('表长度',result.length,tableName)
if (result.length == 0) {
console.log('sqlsqlinsert',resultArr.length)
if(resultArr.length==0){
resolve(false)
return
}
let INSERT_SQL = "INSERT INTO " + tableName
+ " (" + map[tableName].ACCOUNT_TABLE.columns.toString() + ") VALUES "
@ -97,9 +104,9 @@ function sqlInsertCommonFn(tableName, resultArr, context?, delFlag = true) {
let str = '('
map[tableName].ACCOUNT_TABLE.columns.map((res, index) => {
if (map[tableName].ACCOUNT_TABLE.columns.length - 1 == index) {
str += data[res] ? `"${data[res]}"` : 'NULL'
str += data[res] ? `'${data[res]}'` : 'NULL'
} else {
str += (data[res] ? `"${data[res]}"` : 'NULL') + ','
str += (data[res] ? `'${data[res]}'` : 'NULL') + ','
}
})
if (i == resultArr.length - 1) {
@ -334,15 +341,23 @@ export async function upDataZhongxinginitialization(param) {
resolve(false)
return
}
let flag=true
if (param.singlePlay) {
console.log('teststet0')
const fileUtil = new FileUtil(param.context)
const tableList = ['MA_SYSSET', 'MA_SYSTEMPARM', 'MA_MARKRULE', 'MA_MARKRULESET','ES_CARINFO','MA_MAP_ROAD','MA_MAP_ROAD_LANE','MAP_SUBITEM','MA_T_CARPARMSET','MA_MAP_ITEMCLASS','MA_MAP_POINT','MA_MAP_POINT_ITEM'];
for(let i=0;i<=tableList.length-1;i++){
const data = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + `/config/tableList/${tableList[i]}.txt`);
await sqlInsertCommonFn(tableList[i], JSON.parse(data) || [], param.context)
const result=await sqlInsertCommonFn(tableList[i], JSON.parse(data) || [], param.context)
flag=flag?result:false
}
resolve(true)
if(flag){
prompt.showToast({
message: '本地文件初始化数据库失败',
duration: 3000
});
}
resolve(flag)
return
}
const str = {

View File

@ -12,7 +12,6 @@ export async function getDeviceInfo(context) {
return new Promise(async (resolve, reject) => {
const fileUtil = new FileUtil(context)
const data = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + '/config/deviceNo.txt');
console.log('globalThis.deviceNoglobalThis.deviceNo',data)
if (data === '' || data === undefined) {
promptAction.showToast({
message: `请先进行设备注册`,

View File

@ -39,6 +39,7 @@ export default class UdpClientByCenter {
private lsh: string = null
private context
private stashFn: StashFunction
private interval
private headLenth: number = 9
//消息头长度
private isWorking: Boolean = false
@ -200,7 +201,7 @@ export default class UdpClientByCenter {
onError_Callback(callback?) {
this.udp.on('error', async err => {
this.isWorking = false;
console.log('getUDPUdpClientByCenter onError err:' + JSON.stringify(err));
console.log('getUDPUdpClientByCenter onError err:' + JSON.stringify(err),this.oppositeIpPort);
callback && callback()
});
}
@ -245,6 +246,10 @@ export default class UdpClientByCenter {
callback({
id, length, body: list, sendId: this.sendId
})
this.interval=setInterval(()=>{
},3000)
});
}

View File

@ -39,8 +39,12 @@ export const getMessageHeartbeat = async (msg) => {
const { examSubject,plateNo } = carInfo;
const ksyh='0000000000000'
const {fourInOneScreen:{gpsDigit}} = judgeConfig
const asclshArr = stringToASC(fillZero('0000000000000', 13));
const ascksyhArr = stringToASC(fillZero('0000000000000', 13))
const asclshArr = stringToASC(fillZero(
globalThis.singlePlay
?'1111111111111'
: globalThis.lsh,
13));
const ascksyhArr = stringToASC(fillZero('1111111111111', 13))
const ascsbxhArr = stringToASC('00000000')
// const ascsbxhArr = stringToASC('153216400880')
const serialIndex = globalThis.serialIndex
@ -70,7 +74,7 @@ export const getMessageHeartbeat = async (msg) => {
string2Bytes(serialIndex, 2 * 8),
translateSignals,
//@ts-ignore
string2Bytes(Math.floor(gps.sd*1.852) , 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北向距离
@ -142,20 +146,20 @@ const getTranslateProject = () => {
for (let i = 0; i <= 4; i++) {
const temp = tempItems.slice(i * 4, (i + 1) * 4);
let tempArr = temp.map(item => item.status)
if (i === 4 && examSubject) {
if (i === 4) {
tempArr = examSubject == 2
//bit36-bit39保留
? tempArr.concat(['00', '00'])
//bit30-bit39保留
: tempArr.concat(['00', '00','00','00'])
}
if (i === 3 && examSubject == 3) {
tempArr = tempArr.concat(['00'])
: tempArr.concat(['00', '00','00'])
}
// if (i === 3 && examSubject == 3) {
// tempArr = tempArr.concat(['00'])
// }
arr.push(tempArr.join(''));
}
return arr.map(numStr => parseInt(numStr, 2));
return arr
}
// 中心实时项目状态转换

View File

@ -75,7 +75,10 @@ export default async function request(req: any) {
if(res.head.resultCode === '0'){
return res
}else{
globalThis.type='1'
const resultMessage = res?.body?.resultMessage || res?.head?.resultMessage
AppStorage.SetOrCreate('errorMsg', 1);
globalThis.title=decodeURIComponent(resultMessage)
prompt.showToast({
message: decodeURIComponent(resultMessage),
duration: 3000
@ -90,10 +93,14 @@ export default async function request(req: any) {
if(resObj.resultCode === '0') {
return res
}else {
globalThis.type='1'
AppStorage.SetOrCreate('errorMsg', 1);
globalThis.title=decodeURIComponent(resObj.resultMessage)
prompt.showToast({
message: decodeURIComponent(resObj.resultMessage),
duration: 3000
});
return res
}
} catch (e) {
console.info('surenjun',JSON.stringify(e))
@ -101,7 +108,6 @@ export default async function request(req: any) {
return false
}
const code = e?.code;
prompt.showToast({
message: e?.message,
duration: 5000
@ -152,7 +158,7 @@ function handleCenterCode(msgXml,isNewCenter){
const msg = JSON.parse(msgXml);
const result = msg?.data[0]?.result;
if(result){
const {code,message} = result
const {code,message,keystr} = result
if(code != '1'){
const rMessage = decodeURIComponent(message as string)
prompt.showToast({
@ -161,7 +167,7 @@ function handleCenterCode(msgXml,isNewCenter){
});
return {code,message}
}else{
return { code }
return { code ,keystr}
}
}
}

View File

@ -3,6 +3,7 @@ import TopLogo from './compontents/TopLogo';
import { examinerLoginService } from '../common/service/ExaminerService';
import Md5 from '../common/utils/md5';
import promptAction from '@ohos.promptAction';
import errorMsgDialog from './compontents/errorMsgDialog'
@Entry
@Component
@ -15,7 +16,21 @@ export default struct Index {
@State currentInputIndex: number = 0
@State @Watch('outClick') outFlag: boolean = false;
private vocObj = null;
private title = ''
private type = '2'
errorDialog: CustomDialogController = new CustomDialogController({
builder: errorMsgDialog({
title: this.title,
type: this.type,
cancel: () => {
},
confirm: () => {
}
}),
customStyle: true,
alignment: DialogAlignment.Center,
},
)
build() {
Column() {
TopLogo({ outFlag: $outFlag })
@ -71,13 +86,27 @@ export default struct Index {
username: this.inputTextArr[0],
password: Md5.Instance.get_md5(this.inputTextArr[1])
}
this.type='2'
this.errorDialog.open()
console.log('carInfo', JSON.stringify(globalThis.carInfo))
examinerLoginService(param).then(res => {
console.log('res?.examinerLoginRsp?.head?.resultCode',res?.examinerLoginRsp?.head?.resultCode,JSON.stringify(res))
this.errorDialog.close()
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',
}, router.RouterMode.Single);
console.log('res11', JSON.stringify(res))
globalThis.username = this.inputTextArr[0]
}).catch(err=>{
console.log('jiangsong12',JSON.stringify(err))
})
})
} else {

View File

@ -10,12 +10,12 @@ import FileUtil from '../common/utils/File';
import { getUDP, getUDP2 } from '../common/utils/GlobalUdp';
import { initJudgeUdp } from '../common/utils/UdpJudge';
import { getTCP } from '../common/utils/GlobalTcp';
import { getliushuiNum, setliushuiNum,takePhotoFn } from '../common/service/indexService';
import { getliushuiNum, setliushuiNum, takePhotoFn } from '../common/service/indexService';
import abilityAccessCtrl, { Permissions } from '@ohos.abilityAccessCtrl';
import worker, { MessageEvents } from '@ohos.worker';
import promptAction from '@ohos.promptAction'
import { voiceService } from '../common/service/voiceService';
// import errorMsgDialog from './compontents/errorMsgDialog'
import errorMsgDialog from './compontents/errorMsgDialog'
import { getSyncData } from '../common/service/initable';
@Entry
@ -40,22 +40,31 @@ struct Index {
private vocObj = null;
private workerInstance = null;
private context = getContext(this) as common.UIAbilityContext;
private title = ''
private type = '2'
errorDialog: CustomDialogController = new CustomDialogController({
builder: errorMsgDialog({
title: globalThis.title,
type: globalThis.type,
cancel: () => {
},
confirm: () => {
}
}),
customStyle: true,
alignment: DialogAlignment.Center,
},
)
@Styles
commStyle(){
.width(220 * this.ratio*this.dialogRatio)
.height(69 * this.ratio*this.dialogRatio)
.width(220 * this.ratio * this.dialogRatio)
.height(69 * this.ratio * this.dialogRatio)
.backgroundImage($r('app.media.button_nor'))
.backgroundImageSize({ width: '100%', height: '100%' })
.margin({ bottom: 12 * this.ratio})
.margin({ bottom: 12 * this.ratio })
}
// dialogController: CustomDialogController | null = new CustomDialogController({
// builder: errorMsgDialog(
// title,
// isDialog,
// // cancel: ()=> { },
// // confirm: ()=> { }
// })
build() {
Column() {
Column() {
@ -67,14 +76,15 @@ struct Index {
if (this.loading) {
return
}
router.pushUrl({
url: 'pages/Settings',
}, router.RouterMode.Single);
})
Image($r('app.media.btn_back')).width('14.4%').height('12.2%')
.onClick(() => {
this.dialogVisiable=true
return
this.dialogVisiable = true
// promptAction.showDialog({
// title: '提示',
// message: '确认是否退出应用',
@ -107,58 +117,70 @@ struct Index {
Column() {
Row() {
if (!this.isSingle) {
Image($r('app.media.index_lw')).width('28%').height('71%').margin({left:80 * globalThis.ratio}).onClick(async () => {
if (this.loading) {
return
}
this.loading = true
setTimeout(() => {
this.angle = 360
}, 1000)
this.angle = 0
if (!globalThis.timeInfo) {
promptAction.showToast({
message: `时间同步接口连接失败`,
duration: 3000
});
this.loading = false
return
}
this.testXMLToJSONInWorker()
Image($r('app.media.index_lw'))
.width('28%')
.height('71%')
.margin({ left: 80 * globalThis.ratio })
.onClick(async () => {
if (this.loading) {
return
}
this.loading = true
setTimeout(() => {
this.angle = 360
}, 1000)
this.angle = 0
if (!globalThis.timeInfo) {
promptAction.showToast({
message: `时间同步接口连接失败`,
duration: 3000
});
this.loading = false
return
}
this.testXMLToJSONInWorker()
})
})
}
if (this.isSingle) {
Image($r('app.media.index_dj')).width('28%').height('71%').margin({left:80 * globalThis.ratio}).onClick(() => {
Image($r('app.media.index_dj'))
.width('28%')
.height('71%')
.margin({ left: 80 * globalThis.ratio })
.onClick(() => {
if (this.loading) {
return
}
//判断数据库是否有表数据,有则直接跳转,没有则读取本地数据
getSyncData('MA_SYSSET').then(data => {
console.log('datadata', JSON.stringify(data))
if (data?.[0]) {
router.pushUrl({
url: 'pages/UserInfo',
}, router.RouterMode.Single)
} else {
this.loading = true
this.testXMLToJSONInWorker()
}
})
;
})
}
Image($r('app.media.index_zj'))
.width('28%')
.height('71%')
.margin({ right: 80 * globalThis.ratio })
.onClick(() => {
if (this.loading) {
return
}
//判断数据库是否有表数据,有则直接跳转,没有则读取本地数据
getSyncData('MA_SYSSET').then(data => {
console.log('datadata',JSON.stringify(data))
if (data?.[0]) {
router.pushUrl({
url:'pages/UserInfo',
}, router.RouterMode.Single)
}else{
this.loading=true
this.testXMLToJSONInWorker()
}
})
;
router.pushUrl({
url: 'pages/CarCheck'
}, router.RouterMode.Single);
})
}
Image($r('app.media.index_zj')).width('28%').height('71%').margin({right:80* globalThis.ratio}).onClick(() => {
if (this.loading) {
return
}
router.pushUrl({
url: 'pages/CarCheck'
}, router.RouterMode.Single);
})
}
.width('100%')
.justifyContent(FlexAlign.SpaceAround)
@ -202,35 +224,41 @@ struct Index {
//
if (this.dialogVisiable) {
Flex({justifyContent:FlexAlign.Center}) {
Flex({ justifyContent: FlexAlign.Center }) {
Text('确认是否退出应用')
.fontSize(28 * this.ratio*this.dialogRatio)
.margin({top:100*this.ratio*this.dialogRatio})
.fontSize(28 * this.ratio * this.dialogRatio)
.margin({ top: 100 * this.ratio * this.dialogRatio })
Row() {
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
Text(' 取 消 ').fontSize(24 * this.ratio*this.dialogRatio).fontColor('#fff').width(100 * this.ratio*this.dialogRatio)
Text(' 取 消 ')
.fontSize(24 * this.ratio * this.dialogRatio)
.fontColor('#fff')
.width(100 * this.ratio * this.dialogRatio)
}
.commStyle()
.onClick(() => {
this.dialogVisiable = false
}).margin({right:10*this.ratio})
}).margin({ right: 10 * this.ratio })
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
Text(' 确 定 ').fontSize(24 * this.ratio*this.dialogRatio).fontColor('#fff').width(100 * this.ratio*this.dialogRatio)
Text(' 确 定 ')
.fontSize(24 * this.ratio * this.dialogRatio)
.fontColor('#fff')
.width(100 * this.ratio * this.dialogRatio)
}
.commStyle()
.onClick(() => {
router.back()
})
}.position({ y: 265 * this.ratio*this.dialogRatio, x: 115 * this.ratio*this.dialogRatio })
}.position({ y: 265 * this.ratio * this.dialogRatio, x: 115 * this.ratio * this.dialogRatio })
}
.width(660 * this.ratio*this.dialogRatio)
.height(360 * this.ratio*this.dialogRatio)
.position({ x: 220 * this.ratio, y: 98 * this.ratio-265/2*(1-this.ratio*this.dialogRatio) })
.width(660 * this.ratio * this.dialogRatio)
.height(360 * this.ratio * this.dialogRatio)
.position({ x: 220 * this.ratio, y: 98 * this.ratio - 265 / 2 * (1 - this.ratio * this.dialogRatio) })
.backgroundColor('#E6E3DF')
//
.borderRadius(19 * this.ratio*this.dialogRatio)
.borderRadius(19 * this.ratio * this.dialogRatio)
}
if (this.loading) {
Column() {
@ -272,10 +300,10 @@ struct Index {
}
aboutToAppear() {
this.dialogVisiable=false
this.dialogVisiable = false
this.angle = 0
this.loading = false
globalThis.lsh = '1111111111111'
}
async testXMLToJSONInWorker() {
@ -288,9 +316,9 @@ struct Index {
paraKdid: globalThis.timeInfo?.paraKdid,
mode: globalThis.timeInfo?.mode,
context: this.context,
host:globalThis.host,
centerHost:globalThis.timeInfo.url,
singlePlay:globalThis.singlePlay
host: globalThis.host,
centerHost: globalThis.timeInfo.url,
singlePlay: globalThis.singlePlay
}
workerInstance.postMessage(param);
workerInstance.onmessage = (e: MessageEvents): void => {
@ -298,7 +326,7 @@ struct Index {
let workData: WorkData = e.data;
if (workData.isComplete) {
router.pushUrl({
url: globalThis.singlePlay?'pages/UserInfo':'pages/ExaminerLogin',
url: globalThis.singlePlay ? 'pages/UserInfo' : 'pages/ExaminerLogin',
}, router.RouterMode.Single)
}
this.loading = false
@ -324,7 +352,7 @@ struct Index {
carNo: globalThis.carInfo.carNo,
placeId: globalThis.carInfo.examinationRoomId
}
console.log('paramparam',JSON.stringify(param))
console.log('paramparam', JSON.stringify(param))
// globalThis.udpClient2.initHeartSendMsg(param,this.context)
if (globalThis.udpClient2.getStatus()) {
globalThis.udpClient2.sendMsgExt(param, this.context)
@ -332,14 +360,14 @@ struct Index {
}
async onPageShow() {
console.log('ttttt',1111)
console.log('ttttt', 1111)
this.userAuth();
console.log('ttttt2222',1111)
console.log('ttttt2222', 1111)
this.vocObj = new voiceService(async (status, val, next) => {
});
console.log('globalThis.singlePlay',globalThis.singlePlay)
console.log('globalThis.singlePlay', globalThis.singlePlay)
if (globalThis.singlePlay == undefined || globalThis.singlePlay == null) {
this.vocObj.playAudio({
type: 1,
@ -351,7 +379,7 @@ struct Index {
this.loading = false
this.createAlbum()
this.num=0
this.num = 0
//
@ -394,29 +422,34 @@ struct Index {
async initParams() {
//设置plc udp 同步requesthost
await getUDP(this.context,false)
await getUDP(this.context, false)
this.loading = false
console.log('globalThis.deviceNo000')
await getDeviceInfo(this.context)
await getCarInfo()
await getUDP2(this.context,false)
await getUDP2(this.context, false)
getTCP()
this.deviceId= globalThis.carInfo.carNo
this.deviceId = globalThis.carInfo.carNo
await setCurrentTime();
this.carNum = globalThis.carInfo.plateNo;
this.version = globalThis.version;
this.hasAuth = globalThis.hasAuth;
initJudgeUdp()
takePhotoFn(this.context)
console.log('deviceIddeviceId',globalThis.deviceNo,this.deviceNo)
console.log('deviceIddeviceId', globalThis.deviceNo, this.deviceNo)
clearInterval(this.interval)
this.interval = setInterval(() => {
this.num++
setliushuiNum(this.context)
getliushuiNum(this.context)
if(this.num>=3){
if (this.num >= 3) {
this.heartMsg()
}
const data=AppStorage.Get('errorMsg'); // returns 47
console.log('1123',data)
if(data==1){
this.errorDialog.open()
}
}, 1000)
//下载模型
// await this.getModel()

View File

@ -50,7 +50,6 @@ struct Index {
this.time = await getCurrentTime();
this.examTime += 1;
}, 1000);
//初始化数据库表
await this.initDb()
//断点续考
@ -109,13 +108,14 @@ struct Index {
BK1: carInfo.bk1,
BK2: carInfo.bk2,
})
console.info('surenjun =>carinfoArrr',JSON.stringify( this.carinfoArrr))
}
// 获取考生信息
async initStudent() {
const students = await getSyncData('USER')
const stuInfo = students[0] || {};
const {xm,sfzmhm,lsh,kszp,ksdd,kssycs,kslx,ksxl} = stuInfo;
const {xm,sfzmhm,lsh,kszp,ksdd,kssycs,kslx,ksxl,xldm} = stuInfo;
this.name = xm || '测试考生';
this.idCard = sfzmhm || '01234567891010';
this.lsh = globalThis.singlePlay?'0000000000000':lsh;
@ -124,6 +124,7 @@ struct Index {
this.kssycs = kssycs;
this.ksxl = ksxl;
this.wayno = ksxl;
this.xldm = xldm;
this.kslx = kslx;
}
@ -221,6 +222,8 @@ struct Index {
//初始化systemParam表
async initSystemParam(sysParam?: SYSTEMPARMARR[]) {
const systemParms: any = sysParam || await getSyncData('MA_SYSTEMPARM')
console.info('surenjun => systemParms',JSON.stringify(systemParms));
let currentParams: any = router.getParams();
const {carName,carType,examSubject} = this;
//小车车型列表
@ -228,7 +231,10 @@ struct Index {
if (globalThis.singlePlay) {
this.wayno = currentParams.wayno || 1;
}
//真实监管下发的项目
let kStringArr: string[] = (currentParams.kString?.split(',') || []).filter(item => item);
console.info('surenjun kStringArr',JSON.stringify(kStringArr))
let isInExam = kStringArr.length > 0;
const {isTrajectoryOpen} = judgeConfig
let carNo = '', allItems = [];
systemParms.forEach((systemParm) => {
@ -254,7 +260,6 @@ struct Index {
if(no1 == 3 && no3 == 3 && carNo === no2){
this.passingScore = Number(txt1) || 0;
}
//获取当前考车的考试项目
if (carNo !== '' && no1 == 3 && no2 == carNo && no3 == 10) {
allItems = decodeURIComponent(systemParm.txt1).split(',').filter(txt => txt !== '')
@ -273,21 +278,31 @@ struct Index {
if (sCarTypes.includes(carType) && name === '夜间行驶') {
return
}
const currentProject = {
name,
abbreviation: decodeURI(systemParm.txt3),
projectCode: no2,
projectCodeCenter: txt2,
//是否是必考 加减档设置成非必考
isRequired: no2== 14?false:allItems.includes(no2 + ''),
isRequired: no2== 14 ? false : allItems.includes(no2 + ''),
//是否考过了
isEnd: false,
//项目开始数据是否上传过
isUpload:false,
}
this.projectsObj[no2*1] = currentProject
this.projectsCenterObj[txt2] = currentProject
this.projects.push(currentProject);
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);
}
}
this.systemparmArr.push({
'NO1': no1 * 1,
@ -457,7 +472,6 @@ struct Index {
const [initData, beginData] = [strArr[0], strArr[1]];
const initDataObj = JSON.parse(initData)
const beginDataObj = JSON.parse(beginData)
// initDataObj.systemparm =
const examSubject = globalThis.carInfo.examSubject;
this.examSubject = isTrajectoryOpen ? (initDataObj.kskm * 1) : examSubject;
globalThis.carInfo.examSubject = this.examSubject
@ -813,26 +827,6 @@ struct Index {
.margin({ bottom: 20 })
}.height('90%').justifyContent(FlexAlign.Start).padding({ top: 37, left: 60, bottom: 35, right: 60 })
if (this.signDisplayComVisible) {
Column() {
SignDisplayCom({
showBack: false,
scaleNum: 1.8,
msgStr: this.judge.plcStr || '',
}).margin({ top: 100 })
Row() {
}
.width(240)
.height(240)
.position({ x: '81%', y: 80 })
.backgroundImage($rawfile('judge/close.png'), ImageRepeat.NoRepeat)
.backgroundImageSize({ width: '33.33%', height: '33.33%' })
.onClick(() => {
this.signDisplayComVisible = false
})
}.width('100%').height('100%').position({ y: 0 }).backgroundColor('rgba(0,0,0,0.6)')
}
//科目三人工扣分弹窗
if (this.isDeductedPopShow && this.examSubject == 3 && this.judgeConfigObj['342'] == 0) {
@ -856,6 +850,28 @@ struct Index {
})
}
if (this.signDisplayComVisible) {
Column() {
SignDisplayCom({
showBack: false,
scaleNum: 1.8,
msgStr: this.judge.plcStr || '',
}).margin({ top: 100 })
Row() {
}
.width(240)
.height(240)
.position({ x: '81%', y: 80 })
.backgroundImage($rawfile('judge/close.png'), ImageRepeat.NoRepeat)
.backgroundImageSize({ width: '33.33%', height: '33.33%' })
.onClick(() => {
this.signDisplayComVisible = false
})
}.width('100%').height('100%').position({ y: 0 }).backgroundColor('rgba(0,0,0,0.6)')
}
//科目三人工项目确认框
if (this.isAmplifyPopShow && this.examSubject == 3) {
AmplifyPopup({
@ -990,6 +1006,9 @@ struct Index {
getProjectIsInRoad
} = this;
const projectCode = artSubject3ProjectsCodesArr[index];
if(projectsObj[projectCode] === undefined){
return false
}
const projectType = projectsObj[projectCode].type;
//不允许人工触发的项目列表,以","分隔
@ -1178,6 +1197,8 @@ struct Index {
@State kssycs: string = ''
@State ksxl: string = ''
@State kslx: string = ''
//监管线路代码
@State xldm: string = ''
//监管接口序列号
@State serialNumber: number = 0
@State carType: string = ''

View File

@ -97,7 +97,9 @@ export default struct Index {
params:{
sczb,
kfdm,
wayno
wayno,
//TODO 真实监管项目
// kString:'40300,40500,40700,40800'
}
}, router.RouterMode.Single);

View File

@ -22,6 +22,7 @@ import LoadingPopup from './compontents/judge/LoadingPopup';
import VoiceAnnounce from './judgeSDK/utils/voiceAnnouncements';
import { judgeConfig } from './judgeSDK/utils/judgeConfig';
import { initJudgeUdp } from '../common/utils/UdpJudge';
import errorMsgDialog from './compontents/errorMsgDialog'
@Entry
@Component
@ -75,6 +76,9 @@ struct UserInfo {
@State FaceOpenStatue: string = '0'; //是否开启人脸识别
@State faceCatchImg: string = ''
@State Param803Str: string = ''
private title = ''
private type = '2'
// 过程照片拍照
getPhoto = async (empty?: boolean) => {
const singlePlay = globalThis.singlePlay
@ -100,7 +104,19 @@ struct UserInfo {
{ label: '待考次数', key: 'kssycs' },
{ label: '考官姓名', key: 'ksy1' },
]
errorDialog: CustomDialogController = new CustomDialogController({
builder: errorMsgDialog({
title: this.title,
type: this.type,
cancel: () => {
},
confirm: () => {
}
}),
customStyle: true,
alignment: DialogAlignment.Center,
},
)
async onPageShow() {
this.updateTimeLimit=false
console.log('响应头地址响应头地址')
@ -112,19 +128,57 @@ struct UserInfo {
this.initData()
//身份证读卡器初始化
// this.openDeviceByIDCard()
// @ts-ignore
this.list =await getSyncData('USERLIST')
// @ts-ignore
const data=await getSyncData('USER')
console.log('datadata',JSON.stringify(data));
console.log('datadata2',JSON.stringify(this.list))
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=='')){
console.log('datadatadatadata')
this.list=this.list.filter(res=>{
return res.sfzmhm!=user.sfzmhm
})
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
}
}
this.list.forEach((res,index)=>{
res.id=index.toString()
})
await upDateTableByArray('USERLIST', this.list||[])
// 如果是单机模式则模拟假数据
//获取sysset表数据
this.initSysset()
//心跳处理
this.heartMsg()
getSyncData('USER').then(data => {
if (data?.[0]) {
this.getExaminationStudentInfoFn()
}
})
// if(user[0]){
// // @ts-ignore
// this.currentUser=user
// }
this.isExamStart = false
this.sczbkf = [];
this.avPlayer = new VoiceAnnounce();
initJudgeUdp()
}
//身份证读卡器初始化
@ -166,7 +220,8 @@ struct UserInfo {
url: examSubject == 3 ? 'pages/Roads' : 'pages/Judge',
params: {
sczb: Number(this.isBoardPrePareSetPopupOpen),
kfdm: this.sczbkf
kfdm: this.sczbkf,
}
}, router.RouterMode.Single);
return
@ -177,6 +232,7 @@ struct UserInfo {
})
this.dataList = this.list.slice(this.pageIndex * 4, this.pageIndex * 4 + 4)
if (!flag) {
globalThis.lsh = '0000000000000'
await upDateTableByArray('USER', [])
this.currentUser=this.list[0]
// promptAction.showToast({
@ -248,7 +304,7 @@ struct UserInfo {
this.stepFlag = false
this.faceCompareSucess = 0
this.showFaceCompare = false
this.lsh = '000000000000'
this.lsh = '1111111111111'
this.callBackFlag = false
globalThis.lsh = this.lsh
// this.currentUser = EmptyCandidateObject
@ -263,21 +319,10 @@ struct UserInfo {
this.lsh = this.currentUser.lsh
globalThis.ksyh = this.currentUser.ksy1sfzmhm || this.currentUser.ksy2sfzmhm
globalThis.lsh = this.lsh
} else {
// this.getExaminationStudentInfoFn()
}
const syssetParams = await getSyncData('MA_SYSSET');
// const syssetParams = await getSyncData('MA_SYSSET');
//@ts-ignore
syssetParams.forEach(sys => {
//364 绕车一周评判时机(1-开始考试后判 2-开始考试前判)
if (sys.v_no === '364' && decodeURIComponent(sys.v_value) == '2') {
this.isBoardPrePareSetPopupOpen = true;
}
// 开始考试前必须解开安全带或关车门
if (sys.v_no === '803') {
this.Param803Str = sys.v_value + '';
}
})
}
@ -328,6 +373,16 @@ struct UserInfo {
const openCheckFlag = openCheckFlagParam?.[0]?.v_value == '1' ? '1' : '0'
const faceParam = syssetParams.filter(sys => sys.v_no == '2413')
syssetParams.forEach(sys => {
//364 绕车一周评判时机(1-开始考试后判 2-开始考试前判)
if (sys.v_no === '364' && decodeURIComponent(sys.v_value) == '2') {
this.isBoardPrePareSetPopupOpen = true;
}
// 开始考试前必须解开安全带或关车门
if (sys.v_no === '803') {
this.Param803Str = sys.v_value + '';
}
})
// faceParam?.[0]?.v_value ||
// 1身份证读卡器 2指纹 3人脸
@ -338,11 +393,14 @@ struct UserInfo {
that.openDeviceByIDCard()
}
}
if(that.list.length){
return
}
//0不自动更新 1自动更新不限次数 2没有考生更新2次
if (that.studentRefreshStatue == '2') {
clearInterval(that.interval)
that.interval = setInterval(() => {
if (that.dataList.length == 0 && that.numCount < 3) {
if (that.list.length == 0 && that.numCount < 3) {
that.numCount++
that.getExaminationStudentInfoFn()
}
@ -350,12 +408,12 @@ struct UserInfo {
} else if (that.studentRefreshStatue == '1') {
clearInterval(that.interval)
that.interval = setInterval(() => {
if (that.dataList.length == 0) {
if (that.list.length == 0) {
that.getExaminationStudentInfoFn()
}
}, 5000)
} else {
this.getExaminationItemFn()
// this.getExaminationItemFn()
}
})
@ -367,6 +425,7 @@ struct UserInfo {
console.log('this.faceCompareSuces', this.faceCompareSucess, JSON.stringify(this.currentUser))
if (this.faceCompareSucess > 0) {
//人脸比对通过
globalThis.statue = 4
this.sfbdinterfaceFn()
}
}
@ -388,20 +447,21 @@ struct UserInfo {
}
//获取下载考生
getExaminationStudentInfoFn() {
async getExaminationStudentInfoFn() {
if (globalThis.singlePlay || this.updateTimeLimit) {
return
}
await upDateTableByArray('USER', [])
this.type='2'
this.errorDialog.open()
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>`
getExaminationStudentInfo(param).then(async (res) => {
this.errorDialog.close()
setTimeout(() => {
this.updateTimeLimit = true
}, 30000)
this.updateTimeLimit = false
if (!res) {
this.dataList = []
this.currentUser = EmptyCandidateObject
this.errorMsg = decodeURI(res.getExaminationStudentInfoRsp.head.resultMessage)
if (!res||res?.getExaminationStudentInfoRsp?.head?.resultCode=='1') {
return
}
let dataList = []
@ -420,13 +480,15 @@ struct UserInfo {
}
this.list = JSON.parse(JSON.stringify(dataList))
this.list.forEach(listData => {
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
@ -507,11 +569,11 @@ struct UserInfo {
this.dataList = []
this.currentUser = EmptyCandidateObject
}
}
//身份比对
async sfbdinterfaceFn() {
globalThis.statue = 4
this.stepFlag = true
const carInfo = globalThis.carInfo;
const {carId,examinationRoomId} = carInfo;
@ -530,17 +592,18 @@ struct UserInfo {
const avPlayer = this.avPlayer;
this.isLoadingPopupVisible = true
avPlayer.playAudio([`voice/监管通信中.mp3`], false, async () => {
const temp = await this.beginExam();
console.info('surenjun', JSON.stringify(temp))
if (temp.code != 1) {
//TODO 模拟
const {code,keystr,message} = await this.beginExam();
//@ts-ignore TODO code转换
if (code == '' && code == undefined) {
promptAction.showToast({
message: temp.message,
message,
duration: 4000
})
return
}
this.currentUser.id='0'
await upDateTableByArray('USER', [this.currentUser])
globalThis.statue = 4
this.stepFlag = false
this.isLoadingPopupVisible = false
router.pushUrl({
@ -548,7 +611,9 @@ struct UserInfo {
params: {
examItems: examItems?.getExaminationItemRsp?.body?.ykxx,
sczb: Number(this.isBoardPrePareSetPopupOpen),
kfdm: this.sczbkf
kfdm: this.sczbkf,
//真实监管项目
kString:keystr || ''
}
}, router.RouterMode.Single);
this.stopDeviceById()
@ -666,16 +731,14 @@ struct UserInfo {
const {carId,examinationRoomId} = carInfo;
const { examSubject,plateNo } = carInfo;
const date = new Date()
console.info('surenjun', 'photoBase64')
const photoBase64 = await this.getPhoto();
console.info('surenjun', 'photoBase64End')
const drvexam = {
lsh: this.currentUser.lsh || '',
kskm: examSubject,
ksxtbh: this.ksxtbh || '222',
sfzmhm: this.currentUser.sfzmhm || '',
ksysfzmhm: this.currentUser.ksy1sfzmhm || '',
ksxl: this.currentUser.ksxl,
ksxl: this.currentUser.xldm,
zp: photoBase64,
kssj: dateFormat(date) || '',
kchp: decodeURI(plateNo),
@ -743,10 +806,12 @@ struct UserInfo {
.backgroundImage(item.sfzmhm != this.currentUser.sfzmhm ? $r('app.media.userbox2') : $r('app.media.userboxbg'))
.backgroundImageSize({ width: '100%', height: '100%' })
.onClick(() => {
globalThis.lsh = item.lsh;
if (this.isExamStart&&!globalThis.singlePlay) {
return
}
this.currentUser = item
})
})
}.width(640 * this.ratio).margin({ left: 30 * this.ratio })
@ -826,13 +891,13 @@ struct UserInfo {
try {
await this.checkSignal()
this.isExamStart = true
this.currentUser.id='0'
await upDateTableByArray('USER', [this.currentUser])
globalThis.statue = 4
this.isBoardPrePareSetPopupShow = true;
this.isFirstBoardPrePareSetPopupBtnShow = true;
this.stepFlag = false
this.stopDeviceById()
initJudgeUdp()
} catch (e) {
}
@ -850,12 +915,13 @@ struct UserInfo {
}
if (globalThis.singlePlay) {
const {examSubject} = globalThis.carInfo;
this.currentUser.id='0'
await upDateTableByArray('USER', [this.currentUser])
router.pushUrl({
url: examSubject == 3 ? 'pages/Roads' : 'pages/Judge',
params: {
sczb: Number(this.isBoardPrePareSetPopupOpen),
kfdm: this.sczbkf
kfdm: this.sczbkf,
}
}, router.RouterMode.Single);
this.stopDeviceById()
@ -864,7 +930,6 @@ struct UserInfo {
if (this.FaceOpenStatue != '0') {
this.showFaceCompare = true
} else {
initJudgeUdp()
this.sfbdinterfaceFn()
}
} catch (e) {

View File

@ -179,7 +179,7 @@ export default struct FaceCompare {
async faceComparFn() {
console.log('mmmmm0', 2)
this.param.pztd=this.param.rlls
const data=await takePhoto(this.param, this.context, 'jt/', 1,)
const data=await takePhoto(this.param, this.context, 'jt/', 1,)
this.base64=this.imageBase64 + data.base64
console.log('mmmmt',this.base64)
faceCompare({

View File

@ -558,7 +558,7 @@ export const testUIAllitems = [
]
export const wuxiKm3Items = [
//3,5,9,12,14,15,16,
//3,5,9,12,14,15,16,
{projectCode:'1',projectCodeCenter:'40100',name:'上车准备',abbreviation:'上车准备'},
{projectCode:'2',projectCodeCenter:'40200',name:'起步',abbreviation:'起步'},
{projectCode:'3',projectCodeCenter:'40300',name:'直线行驶',abbreviation:'直线行驶'},
@ -571,7 +571,7 @@ export const wuxiKm3Items = [
{projectCode:'10',projectCodeCenter:'41400',name:'超车',abbreviation:'超车'},
{projectCode:'11',projectCodeCenter:'40600',name:'靠边停车',abbreviation:'靠边停车'},
{projectCode:'12',projectCodeCenter:'41500',name:'掉头',abbreviation:'掉头'},
{projectCode:'41',projectCodeCenter:'41600',name:'夜间行驶',abbreviation:'夜间行驶'},
{projectCode:'41',projectCodeCenter:'41700',name:'模拟夜间灯光',abbreviation:'模拟夜间灯光'},
{projectCode:'14',projectCodeCenter:'40400',name:'加减档位操作',abbreviation:'加减档位操作'},
{projectCode:'15',projectCodeCenter:'40800',name:'路口左转弯',abbreviation:'路口左转弯'},
{projectCode:'16',projectCodeCenter:'40900',name:'路口右转弯',abbreviation:'路口右转弯'},
@ -622,9 +622,9 @@ export const testKm3Items= [
{code:'41300',status:0},
{code:'41400',status:0},
{code:'41500',status:0},
{code:'41600',status:0},
{code:'41700',status:0},
{code:'41600',status:0},
]
export const testMarkRules = [{

View File

@ -53,7 +53,7 @@ import {
} from './api/index';
const judgeTag = 'SURENJUN_JUDGE'
import { getSyncData, upDateTableByArray } from '../../common/service/initable';
export default class Judge {
constructor(judgeUI) {
this.serialIndex = 1;
@ -129,15 +129,12 @@ export default class Judge {
console.info(judgeTag, '2.注册日志回调完成')
let initInfo = isTrajectoryOpen ? JSON.parse(strArr[0]) : await this.getJudgeInitData();
await fileLog.setExamJudgeData(initInfo)
//相关评判初始化只做一次
if (!isJudgeInitBool) {
await fileLog.setExamJudgeData(initInfo)
const tempJudge = await examJudgeInit(initInfo);
globalThis.isJudgeInitBool = true
console.info(judgeTag, '4.评判初始化完成')
} else {
await fileLog.setExamJudgeData(initInfo)
}
globalThis.isJudge = true
@ -315,7 +312,6 @@ export default class Judge {
this.judgeUI.currentXmdm = xmdm;
const xmmcStr = judgeUI.projectsObj[xmdm].name;
const xmmcCode = judgeUI.projectsObj[xmdm].projectCodeCenter;
console.info(judgeTag,JSON.stringify(judgeUI.projectsObj[xmdm]))
const xmmcSingleCode = judgeUI.projectsObj[xmdm].projectCode;
this.testKmItems[xmmcCode].status = 2;
this.xmmcStr = xmmcStr;
@ -344,7 +340,6 @@ export default class Judge {
//统计必考项目数量
this.xmmcStr = '无';
this.xmmcCode = '';
this.xmmcSingleCode = 0;
this.xmdm = '';
this.judgeUI.isDeductedPopShow = false
this.judgeUI.currentXmdm = undefined;
@ -462,14 +457,14 @@ export default class Judge {
}
//项目已考不上传监管信息
if (!isEnd) {
judgeTask.addTask(async () => {
console.info(judgeTag, `项目开始-${xmdm}-${projectsObj[xmdm].name}`)
await beginProject(xmdm)
},{isDelay: true})
judgeTask.addTask(async () => {
judgeTask.addTask(async () => {
console.info(judgeTag, `项目开始-${xmdm}-${projectsObj[xmdm].name}`)
await beginProject(xmdm)
},{isDelay: true})
judgeTask.addTask(async () => {
console.info(judgeTag, `项目-${xmdm}-上传照片 start`)
await uploadProgressPhoto(xmdm)
},{isDelay: true})
},{isDelay: true})
this.judgeUI.projectsObj[xmdm].isUpload = true;
}
break;
@ -490,6 +485,7 @@ export default class Judge {
judgeTask.addTask(async () => {
console.info(judgeTag, `项目结束-${xmdm}-${projectsObj[xmdm].name}`)
await endProject(xmdm);
this.xmmcSingleCode = 0;
}, {isDelay: true})
}
}
@ -581,7 +577,7 @@ export default class Judge {
const carInfo = globalThis.carInfo;
const { examSubject,plateNo } = carInfo;
const {judgeUI,fileLog,getSbbm,xmxh,filePath} = this;
const {lsh,idCard,serialNumber,projectsObj,ksdd,kslx,ksxl} = judgeUI
const {lsh,idCard,serialNumber,projectsObj,ksdd,kslx,xldm} = judgeUI
const time = await getCurrentTime();
const project = projectsObj[ksxm]
const sbxh = getSbbm(ksxm, xmxh)
@ -595,7 +591,7 @@ export default class Judge {
sfzmhm: idCard,
ksxm: project.projectCodeCenter,
sbxh,
ksxl,
ksxl:xldm,
kchp: encodeURI(plateNo),
// 开始时间
ksdd: encodeURI(ksdd),
@ -618,7 +614,7 @@ export default class Judge {
const deviceNo = globalThis.deviceNo;
const { examSubject,plateNo,carNo } = carInfo;
const {judgeUI,fileLog,getSbxh,xmxh,getSbbm,filePath} = this;
const {lsh,idCard,serialNumber,projectsObj,cdsbInfoObj,ksdd,kslx,ksxl,} = judgeUI
const {lsh,idCard,serialNumber,projectsObj,cdsbInfoObj,ksdd,kslx,xldm,} = judgeUI
const time = await getCurrentTime();
const project = projectsObj[ksxm]
const sbxh = examSubject == 3 ? undefined : getSbbm(ksxm, xmxh)
@ -633,7 +629,7 @@ export default class Judge {
sbxh,
//TODO 操作类型 1:正常 0:撤销该考试记录
czlx: '1',
ksxl,
ksxl:xldm,
kchp: encodeURI(plateNo),
ksdd: encodeURI(ksdd),
kslx: encodeURI(kslx) || '',
@ -654,29 +650,43 @@ export default class Judge {
const deviceNo = globalThis.deviceNo;
const { examSubject,plateNo,carNo } = carInfo;
const {judgeUI,getProjectInfo,fileLog,xmmcSingleCode,filePath} = this;
const {lsh,idCard,serialNumber,ksdd} = judgeUI
const {lsh,idCard,serialNumber,ksdd,projectsObj} = judgeUI
const time = await getCurrentTime();
const project = getProjectInfo(ksxm);
//科目三上车准备、模拟灯光、夜间行驶出现通用评判ksxm为当前进行的项目
const checkProjects = ['41600', '41700', '40100']
//科目三夜间行驶.模拟灯光、上车准备出现通用评判ksxm为当前进行的项目
const checkProjects = ['17', '41', '1'];
//获取正在进行的项目
const inProjects = Reflect.ownKeys(projectsObj).filter(projectKey => projectsObj[projectKey].type == 2);
let commonKsxm = '';
checkProjects.forEach(projectCode=>{
if(inProjects.includes(projectCode)){
commonKsxm = projectCode
}
})
const data = {
xtlb: '17', jkxlh: serialNumber, jkid: '17C53',
drvexam: {
lsh,
kskm: examSubject,
ksxm: project
? (checkProjects.includes(xmmcSingleCode + '') ? xmmcSingleCode : project.projectCodeCenter)
: (examSubject == 3 ? 30000 : 10000),
ksxm: project == undefined
? (commonKsxm
? (projectsObj[commonKsxm].projectCodeCenter)
: (examSubject == 3 ? 30000 : 10000))
: project.projectCodeCenter ,
kfxm: kf.markcatalog,
kfxmmx: `${ksxm},${kf.markserial}`,
sfzmhm: idCard,
kchp: encodeURI(carInfo.plateNo),
//扣分方式
kffs: kf.type == 0 ? 1 : 2,
ksdd: encodeURI(ksdd),
kfsj: time
}
}
console.info(judgeTag + 'ksxm=>',data.drvexam.ksxm)
const {code} = await writeObjectOut(data,filePath);
if (code === 2300007) {
this.isJudgeDisConnect = true
@ -726,15 +736,15 @@ export default class Judge {
//判断是不是模拟灯光语音
if (type == 1) {
avPlayer.playAudio([`voice/${code}.mp3`], false, () => {
examJudgeSoundEnd({
itemno: xmdm, code, type
})
fileLog.setExamJudgeData({
method: 'examJudgeSoundEnd',
itemno: xmdm,
code,
type,
})
examJudgeSoundEnd({
itemno: xmdm, code, type
})
fileLog.setExamJudgeData({
method: 'examJudgeSoundEnd',
itemno: xmdm,
code,
type,
})
})
}else{
avPlayer.playAudio([`voice/${code}.mp3`])
@ -778,7 +788,6 @@ export default class Judge {
const param302 = judgeConfigObj['302'];
const param342 = judgeConfigObj['342'];
const param512 = (judgeConfigObj['512'] || '').split(',');
//成绩不合格
if (totalScore < passingGrade) {
//科目三不合格报靠边停车
@ -791,13 +800,15 @@ export default class Judge {
return
}
//成绩合格
if (isAllProjectsEnd && totalScore >= passingGrade && isEndTip) {
if (isAllProjectsEnd && totalScore >= passingGrade && !isEndTip) {
//考试合格自动退出
if(examSubject == 3 && param302 == 4){
await examJudgeEndExam()
this.isExamEnd = true
return
}
if (examSubject == 3 && (param342 == 0 || param342 == 2) && (param302 != 6 || param302 != 7 || param302 != 8)) {
if(param512[7] != 0){
avPlayer.playAudio(['voice/综合评判.mp3'])
@ -819,24 +830,19 @@ export default class Judge {
this.judgeUI.loadingPopupVisible = true;
this.judgeUI.endPopupVisible = false;
this.judgeUI.isDeductedPopShow = false;
console.info(judgeTag,1)
const {qjjl,dcjl} = ksjs
const {judgeUI,endExam,handleSEP,kfArr,avPlayer,judgeTask,isManual} = this;
const {judgeConfigObj,examSubject,isAllProjectsEnd,totalScore,passingScore} = judgeUI;
//计算考试分数
console.info(judgeTag,2)
this.judgeUI.totalScore = isAllProjectsEnd ? totalScore : 0;
const singlePlay = globalThis.singlePlay
const param302 = judgeConfigObj['302'];
globalThis.windowClass.setWindowSystemBarEnable(['navigation'])
console.info(judgeTag,3)
//自动退出待验证并且不合格
if (!isManual && examSubject == 3 && (param302 == 1 || (singlePlay && param302 == 2)) && totalScore < passingScore) {
avPlayer.playAudio([`voice/考试结束.mp3`])
}
console.info(judgeTag,4)
//联网模式下手动结束的直接退出
if (!singlePlay && isManual && !isAllProjectsEnd) {
avPlayer.playAudio(['voice/empty.mp3'], true, () => {
@ -844,7 +850,6 @@ export default class Judge {
})
return
}
console.info(judgeTag,5)
if (examSubject == 3) {
const param302 = judgeConfigObj['302'];
if (totalScore < passingScore) {
@ -856,17 +861,13 @@ export default class Judge {
//考试合格
}
}
console.info(judgeTag,6)
await handleSEP(306);
console.info(judgeTag,7)
avPlayer.playAudio(['voice/exam_waiting.mp3'], true, async () => {
try {
if (!singlePlay) {
// TODO 待验证
const bytes = await this.getMessageHeartbeat(true);
globalThis.judgeUdp.send(bytes)
}
//TODO endExam函数逻辑待验证
await endExam()
} catch (e) {
console.info(judgeTag,JSON.stringify(e))
@ -903,7 +904,7 @@ export default class Judge {
kscj: (totalScore * 1) > 0 ? totalScore : 0,
kslc: Math.ceil(((ksjs?.qjjl + ksjs?.dcjl) || 0) / 100),
// 1,22;2,560;3,128;4,0;5,0;
dwlc: [d1,d2,d3,d4,d5].map((d,index) => `${index},${Math.floor(d /100)}`).join(';'),
dwlc: [d1,d2,d3,d4,d5].map((d,index) => `${index+1},${Math.floor(d /100)}`).join(';'),
}
}
const temp = await writeObjectOut(data,filePath);
@ -916,7 +917,6 @@ export default class Judge {
if (examSubject == 2) {
voiceURL = (totalScore < passingScore ? `voice/unqualified_${kssycs == 1 ? 'one' : 'two'}.wav` : 'voice/qualified.mp3')
}
if (examSubject == 3) {
if (isAllProjectsEnd) {
if (totalScore < passingScore) {
@ -929,6 +929,9 @@ export default class Judge {
}
}
const USER =await getSyncData('USER');
await upDateTableByArray('USER', [{...USER[0],kssycs:kssycs == 2 ? 1 : 0}])
console.info(judgeTag, `考试成绩:${totalScore}`)
if(!singlePlay){
await uploadProgressData();
@ -945,6 +948,7 @@ export default class Judge {
if (score <= (examSubject == 3 ? 10 : 20)) {
if (kfArr.length - 1 === index) {
avPlayer.playAudio([`voice/${kf.markcatalog}.mp3`, voiceURL], false, () => {
this.isUdpEnd = true
router.back();
})
throw new Error('End Loop')
@ -965,6 +969,7 @@ export default class Judge {
} else {
avPlayer.playAudio([voiceURL], true, () => {
setTimeout(() => {
this.isUdpEnd = true
router.back();
}, param302 == 8 ? 3000 : 0)
})
@ -992,7 +997,6 @@ export default class Judge {
getMessageHeartbeat = async (isEnd?: Boolean) => {
const carInfo = globalThis.carInfo;
const { examSubject,plateNo,ksyh } = carInfo;
console.info(judgeTag,1)
const {
judgeUI,
isExam,
@ -1007,32 +1011,25 @@ export default class Judge {
getTranslateProject,
getSbxh
} = this;
console.info(judgeTag,2)
const singlePlay = globalThis.singlePlay
const {lsh,startHourTime,totalScore,examTime} = judgeUI;
const {fourInOneScreen:{gpsDigit}} = judgeConfig
console.info(judgeTag,3)
const examType = examSubject == 2?2:3
const {sensor,gps} = tempData;
console.info(judgeTag,4)
console.info(judgeTag,JSON.stringify(tempData))
if(tempData.sensor === undefined){
return
}
const {zfxd,yfxd,shtd,ygd,jgd,skd,dh1,dh2,lhq,jsc,ssc,fsc,lb,mkg,aqd,ygq,cs,fdjzs,dw} = sensor
const {jd,wd, hxj, fyj, hbg,} = gps
console.info(judgeTag,5)
const translateProject = getTranslateProject();
const sbxh = getSbxh(xmdm, xmxh)
console.info(judgeTag,JSON.stringify(performInfo))
const {carzt,dcjl,qjjl,dxjl,bxjl} = performInfo || {};
const asclshArr = stringToASC(fillZero(lsh || 0, 13));
const asclshArr = stringToASC(
fillZero((singlePlay?1111111111111:lsh) || 0, 13)
);
//13不足要补0
console.info(judgeTag,6)
const ascksyhArr = stringToASC(fillZero(ksyh || 0, 13))
console.info(judgeTag,7)
const ascsbxhArr = stringToASC(sbxh)
console.info(judgeTag,8)
const translateSignals = getTranslateSignals(
[zfxd, yfxd, shtd, ygd, jgd, skd, dh1, dh2, lhq, jsc, ssc, fsc, lb, mkg, aqd].concat(getDwStatusType(dw)).concat(getCarStatusType(carzt)).concat([ygq, sensor.wd, 0])
)
@ -1042,15 +1039,8 @@ export default class Judge {
const translateWd = convertGpsCoord2(jd).toFixed(gpsDigit) * Math.pow(10, gpsDigit)
//@ts-ignore
const translateProjects = translateProject.map(numStr => string2Bytes(parseInt(numStr, 2), 8)[0])
console.info(judgeTag,6)
// console.info(judgeTag,JSON.stringify(translateProject))
//@ts-ignore
// const translateProjects= translateProject.map(num => string2Bytes(p,8)[0])
console.info('surenjunxstartHourTime' , startHourTime)
console.info('surenjunxmmcexamTime' , examTime)
const arr = [
//考生号
//考生号
asclshArr.map(lsh => string2Bytes(lsh, 8)[0]),
//考试员号
ascksyhArr.map(ksyh => string2Bytes(ksyh, 8)[0]),
@ -1079,9 +1069,6 @@ export default class Judge {
string2Bytes(Math.floor((dcjl + qjjl) / 100), 2 * 8),
//扣分
string2Bytes(100 - Math.abs(totalScore), 2 * 8),
//扣分数
//todo扣分值/扣分项
string2Bytes(0, 2 * 8),
//扣分项数量
string2Bytes(kfArr.length, 8),
//n个扣分序号
@ -1092,8 +1079,8 @@ export default class Judge {
string2Bytes(0, 2 * 8),
//TODO 摩托压线 Byte[20],
string2Bytes(0, 20 * 8),
//TODO 考试用时
string2Bytes(fillZero(examTime+'',4), 4 * 8),
//考试用时
string2Bytes(examTime, 4 * 8),
//TODO 项目用时
string2Bytes(fillZero(0,2), 2 * 8),
//TODO 设备信号状态
@ -1105,30 +1092,22 @@ export default class Judge {
tempArr = tempArr.concat(itemArr)
})
this.serialIndex += 1;
console.info('message-judge-udp' + Array2Byte(tempArr).toString());
return Array2Byte(tempArr)
}
//获取场地序号
getSbxh = (ksxm, xmxh) => {
const {judgeUI} = this;
console.info(judgeTag,10)
const {cdsbInfoObj,projectsObj} = judgeUI;
console.info(judgeTag,11)
const project = projectsObj[ksxm]
console.info(judgeTag,12)
if(project == 3){
return '0000000000'
}
if (project === undefined) {
return '0000000000'
}
console.info(judgeTag,13)
const projectType = project.sbxh;
const projectKey = `${ksxm}_${xmxh}`;
console.info(judgeTag,14)
const currentCdsb = cdsbInfoObj[projectKey] || {};
console.info(judgeTag,15)
const sbxh = currentCdsb.sbbh || '0000000000'
return sbxh
}
@ -1178,8 +1157,6 @@ export default class Judge {
arr.push(tempArr.join(''));
}
console.info(judgeTag,JSON.stringify(arr))
// return arr.map(numStr => parseInt(numStr, 2));
return arr
}
// 获取考试项目详情
@ -1297,10 +1274,9 @@ export default class Judge {
// 处理udp plc信号
handleUdp = async (msg) => {
console.info('plc信号', msg)
const {fileLog,getPlcData,usbService} = this
const {fileLog,getPlcData,usbService,isUdpEnd,isExamEnd} = this
const stachArr = msg.split(',')
const {isExamEnd} = this;
if (stachArr[0] != '#DN_GD' || isExamEnd) {
if (stachArr[0] != '#DN_GD' || isUdpEnd) {
return
}
const plcData = await getPlcData(msg);
@ -1314,9 +1290,11 @@ export default class Judge {
this.judgeUI.isDwztRight = plcData.gps.dwzt == 4;
this.judgeUI.sd = (Math.floor(((plcData.gps.sd as number) || 0) * 1.852)) + '';
this.judgeUI.dw = (Math.floor(plcData.sensor.dw as number) || 0) + ''
await examJudgeRealExam(plcData)
if(!isExamEnd){
await examJudgeRealExam(plcData)
}
const udpIndex = globalThis.udpIndex;
if (udpIndex % 5 === 0) {
if (udpIndex % 5 === 0 && !isUdpEnd) {
const judgeUdp = globalThis.judgeUdp
const bytes = await this.getMessageHeartbeat();
console.info(judgeTag+'UDP',JSON.stringify(bytes))
@ -1374,9 +1352,7 @@ export default class Judge {
console.info(judgeTag, '模拟数据考试结束')
globalThis.windowClass.setWindowSystemBarEnable(['navigation'])
clearInterval(judgeTimer)
await examJudgeEndExam()
this.isExamEnd = true
this.isManual = true
this.checkExamIsEnd(true)
return
}
const msg = JSON.parse(strArr[num]);
@ -1395,8 +1371,8 @@ export default class Judge {
setJudgeItem(msg.itemno, msg.serial)
}
await examJudgeRealExam(msg)
// const bytes = await this.getMessageHeartbeat();
// bytes && globalThis.judgeUdp.send(bytes)
const bytes = await this.getMessageHeartbeat();
bytes && globalThis.judgeUdp.send(bytes)
num++
}, 200)
@ -1465,6 +1441,8 @@ export default class Judge {
private isExam: boolean
//考试是否结束了
private isExamEnd: boolean
// 是否发送udp
private isUdpEnd: boolean = false
//是否手动结束考试
private isManual: boolean
//UDP服务序列号

View File

@ -6,7 +6,7 @@ export const judgeConfig = {
//是否开启拍照
isPhotoOpen: true,
//扣分语音是否强制开启
kfVoiceOpen: false,
kfVoiceOpen: true,
//忽略的考试项目
ignoreProjects:[],
// 是否忽略考试前熄火、车门检查
@ -16,7 +16,7 @@ export const judgeConfig = {
// 本地模型地址
modelPath: 'models/model_enc',
// 济南科目三
trajectoryPath: 'logs/2024_08_14/2024_08_14_11_30_20_9999805761528_344094918358022656_葛李弯/judge_exam_data.txt',
trajectoryPath: 'logs/2024_08_17/2024_08_17_16_51_24_9999282315477_203908531884520064_彭雯季/judge_exam_data.txt',
//四合一画面配置
fourInOneScreen:{
//gps位数

View File

@ -29,12 +29,12 @@ export default class JudgeTask {
await fn()
res(true)
} catch (e) {
console.info(TAG, JSON.stringify(e))
console.info(TAG, '过程任务执行失败=>' + JSON.stringify(e))
Prompt.showToast({
message: '过程数据接口解析错误',
message: '过程任务执行失败=>' + JSON.stringify(e),
duration: 3000
});
rej(false)
res(false)
}
}, isDelay ? delayTime : 0);
})