Compare commits

...

2 Commits

Author SHA1 Message Date
c3f0abae09 Merge pull request '济南修改' (#17) from lv into main
Reviewed-on: #17
2024-07-01 11:24:10 +08:00
0f42f45cb9 济南修改 2024-06-27 20:53:36 +08:00
27 changed files with 563 additions and 381 deletions

View File

@ -60,6 +60,7 @@ export async function initCenterCacheByKSPT(params){
}) })
} }
//从参数平台获取模型 //从参数平台获取模型
export async function initEsModel(params){ export async function initEsModel(params){
return await request({ return await request({
@ -78,4 +79,14 @@ export async function initialization(params){
method:'post', method:'post',
xml:true, xml:true,
}) })
}
//参数下发读表接口
export async function initCarParameter(params){
return await request({
url:'/der2/services/para/initCarParameter.ws',
data:params,
method:'post',
xml:false,
})
} }

View File

@ -37,9 +37,12 @@ import ES_CAR_VIDEO_PARAMETER from '../constants/ES_CAR_VIDEO_PARAMETER';
import IpConfigTable from '../constants/IpConfigTable'; import IpConfigTable from '../constants/IpConfigTable';
import DeviceInfoTable from '../constants/DeviceInfoTable' import DeviceInfoTable from '../constants/DeviceInfoTable'
import USER from '../constants/USER' import USER from '../constants/USER'
import common from '@ohos.app.ability.common';
import contextConstant from '@ohos.app.ability.contextConstant';
import featureAbility from '@ohos.ability.featureAbility' import featureAbility from '@ohos.ability.featureAbility'
// import { Logger } from '../utils/Logger'; // import { Logger } from '../utils/Logger';
import Logger from '../utils/Logger';
export default class Rdb { export default class Rdb {
private rdbStore: any = null; private rdbStore: any = null;
private tableName: string; private tableName: string;
@ -52,7 +55,7 @@ export default class Rdb {
this.columns = columns; this.columns = columns;
} }
getRdbStore(callback) { getRdbStore(callback?,content?) {
if (!callback || typeof callback == 'undefined' || callback == undefined) { if (!callback || typeof callback == 'undefined' || callback == undefined) {
// Logger.verbose(`${CommonConstants.RDB_TAG}`, 'getRdbStore() has no callback!'); // Logger.verbose(`${CommonConstants.RDB_TAG}`, 'getRdbStore() has no callback!');
return; return;
@ -62,7 +65,14 @@ export default class Rdb {
callback(); callback();
return return
} }
let context = getContext(this); let context
if(content){
context=content
}else{
context=getContext(this)
}
// let context = getContext(this) as common.UIAbilityContext;
// let context = contextConstant(this);
const map = { const map = {
'MA_MARKRULE': MA_MARKRULE, 'MA_MARKRULE': MA_MARKRULE,
'MA_SYSTEMPARM': MA_SYSTEMPARM, 'MA_SYSTEMPARM': MA_SYSTEMPARM,
@ -88,18 +98,21 @@ export default class Rdb {
'DeviceInfoTable':DeviceInfoTable 'DeviceInfoTable':DeviceInfoTable
} }
data_rdb.getRdbStore(context,map[this.tableName].STORE_CONFIG, 1, (err, rdb) => { data_rdb.getRdbStore(context,map[this.tableName].STORE_CONFIG, 1, (err, rdb) => {
console.log('getRdbStoregetRdbStore',err)
if (err) { if (err) {
// Logger.error(`${CommonConstants.RDB_TAG}`, 'gerRdbStore() failed, err: ' + err); // Logger.error(`${CommonConstants.RDB_TAG}`, 'gerRdbStore() failed, err: ' + err);
return; return;
} }
console.log('this.sqlCreateTable',this.sqlCreateTable)
this.rdbStore = rdb; this.rdbStore = rdb;
this.rdbStore.executeSql(this.sqlCreateTable); this.rdbStore.executeSql(this.sqlCreateTable);
// Logger.verbose(`${CommonConstants.RDB_TAG}`, 'getRdbStore() finished.'); // Logger.verbose(`${CommonConstants.RDB_TAG}`, 'getRdbStore() finished.');
callback(); callback();
}); });
} }
deleteTableData(callback,name){ deleteTableData(callback,name,content?){
if (!callback || typeof callback == 'undefined' || callback == undefined) { if (!callback || typeof callback == 'undefined' || callback == undefined) {
// Logger.verbose(`${CommonConstants.RDB_TAG}`, 'getRdbStore() has no callback!'); // Logger.verbose(`${CommonConstants.RDB_TAG}`, 'getRdbStore() has no callback!');
return; return;
@ -109,7 +122,13 @@ export default class Rdb {
callback(); callback();
return return
} }
let context = getContext(this); let context
if(content){
context=content
}else{
context=getContext(this)
}
// let context = getContext(this);
const map = { const map = {
'MA_MARKRULE': MA_MARKRULE, 'MA_MARKRULE': MA_MARKRULE,
'MA_SYSTEMPARM': MA_SYSTEMPARM, 'MA_SYSTEMPARM': MA_SYSTEMPARM,

View File

@ -18,25 +18,26 @@ import Rdb from '../Rdb';
import AccountData from '../../bean/AccountData'; import AccountData from '../../bean/AccountData';
//import CommonConstants from '../../constants/CommonConstants'; //import CommonConstants from '../../constants/CommonConstants';
export default class AccountTable { export default class AccountTable {
// private accountTable = new Rdb(CommonConstants.ACCOUNT_TABLE.tableName, CommonConstants.ACCOUNT_TABLE.sqlCreate, // private accountTable = new Rdb(CommonConstants.ACCOUNT_TABLE.tableName, CommonConstants.ACCOUNT_TABLE.sqlCreate,
// CommonConstants.ACCOUNT_TABLE.columns); // CommonConstants.ACCOUNT_TABLE.columns);
private commonConstants private commonConstants
private accountTable private accountTable
// private CommonConstants // private CommonConstants
constructor(callback: Function = () => {},Constants) { constructor(callback: Function = () => {},Constants,context?) {
this.accountTable= new Rdb(Constants.ACCOUNT_TABLE.tableName, Constants.ACCOUNT_TABLE.sqlCreate, this.accountTable= new Rdb(Constants.ACCOUNT_TABLE.tableName, Constants.ACCOUNT_TABLE.sqlCreate,
Constants.ACCOUNT_TABLE.columns) Constants.ACCOUNT_TABLE.columns)
// this.CommonConstants=Constants // this.CommonConstants=Constants
this.commonConstants=Constants this.commonConstants=Constants
this.accountTable.getRdbStore(callback); this.accountTable.getRdbStore(callback,context);
console.log('kkkkkkkk0')
} }
getRdbStore(callback: Function = () => {}) { getRdbStore(callback: Function = () => {},context?) {
this.accountTable.getRdbStore(callback); this.accountTable.getRdbStore(callback,context);
} }
//删除全部数据 //删除全部数据
deleteTableData(callback: Function,name) { deleteTableData(callback: Function,name,context?) {
this.accountTable.deleteTableData(callback,name); this.accountTable.deleteTableData(callback,name,context);
} }
insertData(account, callback: Function) { insertData(account, callback: Function) {
const valueBucket = generateBucket(this.commonConstants,account); const valueBucket = generateBucket(this.commonConstants,account);

View File

@ -16,26 +16,26 @@ import {
} from '../../common/service/initable' } from '../../common/service/initable'
import { GlobalConfig } from '../../config/index' import { GlobalConfig } from '../../config/index'
import testNapi from '@ohos.hiserialsdk' import testNapi from '@ohos.hiserialsdk'
let num=0
export async function getliushuiNum(){ export async function getliushuiNum(context){
console.log('getLiushuihao') console.log('getLiushuihao')
this.fileUtil = new FileUtil(this.context) const fileUtil = new FileUtil(context)
const data = await this.fileUtil.readFile(GlobalConfig.comoonfileWriteAddress+'/config/liushui.txt'); const data = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress+'/config/liushui.txt');
if(data === '' || data === undefined){ if(data === '' || data === undefined){
this.num=0 num=0
let str=this.num.toString() let str=num.toString()
for(let i=0;str.length<=5;i++){ for(let i=0;str.length<=5;i++){
str='0'+str str='0'+str
} }
this.lsh=str globalThis.lshNo=str
// return str // return str
}else{ }else{
this.num=Number(JSON.parse(data).value)+1 num=Number(JSON.parse(data).value)+1
let str=this.num.toString() let str=num.toString()
for(let i=0;str.length<=5;i++){ for(let i=0;str.length<=5;i++){
str='0'+str str='0'+str
} }
this.lsh=str globalThis.lshNo=str
// return str // return str
} }
} }
@ -75,7 +75,7 @@ export async function setliushuiNum(context) {
} }
//双中心表 //双中心表
export async function getDoubleCeneterTable() { export async function getDoubleCeneterTable(param) {
return new Promise(async (reslove, reject) => { return new Promise(async (reslove, reject) => {
// MA_SYSSET双中心下做合并表格操作 // MA_SYSSET双中心下做合并表格操作
const db = new AccountTable(() => { const db = new AccountTable(() => {
@ -84,15 +84,15 @@ export async function getDoubleCeneterTable() {
db.query('0', async (array) => { db.query('0', async (array) => {
if (array.length) { if (array.length) {
delSyncTable('MA_SYSSET').then(async () => { delSyncTable('MA_SYSSET').then(async () => {
await getDataBaseTable({ tableName: 'MA_SYSSET' }) await getDataBaseTable({ tableName: 'MA_SYSSET' },param)
await getMySystemSetTable({ tableName: 'MA_SYSSET' }) await getMySystemSetTable({ tableName: 'MA_SYSSET' },param)
}) })
} else { } else {
await getDataBaseTable({ tableName: 'MA_SYSSET' }) await getDataBaseTable({ tableName: 'MA_SYSSET' },param)
await getMySystemSetTable({ tableName: 'MA_SYSSET' }) await getMySystemSetTable({ tableName: 'MA_SYSSET' },param)
} }
}) })
}) },param.context)
const typeObj = { const typeObj = {
'MA_MARKRULE': false, 'MA_MARKRULE': false,
'MA_SYSTEMPARM': false, 'MA_SYSTEMPARM': false,
@ -113,7 +113,7 @@ export async function getDoubleCeneterTable() {
'MA_T_CARPARMSET': false 'MA_T_CARPARMSET': false
} }
for (let key in typeObj) { for (let key in typeObj) {
typeObj[key] = await upDateTable({ tableName: key }) typeObj[key] = await upDateTable({ tableName: key },param)
if (!typeObj[key]) { if (!typeObj[key]) {
promptAction.showToast({ promptAction.showToast({
message: `未能查询到${key}表数据, 请先检查网络是否连接正常`, message: `未能查询到${key}表数据, 请先检查网络是否连接正常`,
@ -131,13 +131,10 @@ export async function getDoubleCeneterTable() {
} }
//单中心存表 //单中心存表
export async function getSingleCenterTable() { export async function getSingleCenterTable(param) {
return new Promise((reslove, reject) => { return new Promise((reslove, reject) => {
upDataZhongxinginitialization().then((result) => { upDataZhongxinginitialization(param).then((result) => {
if (result) { if (result) {
router.pushUrl({
url: 'pages/ExaminerLogin',
}, router.RouterMode.Single)
reslove(true) reslove(true)
} else { } else {
promptAction.showDialog({ promptAction.showDialog({
@ -172,6 +169,7 @@ export async function getSingleCenterTable() {
} }
let interval let interval
export async function takePhotoFn(context) { export async function takePhotoFn(context) {
@ -309,11 +307,8 @@ function getChuankouFnMsg() {
console.log('zzc 5 sleep 1s') console.log('zzc 5 sleep 1s')
setTimeout(()=>{ setTimeout(()=>{
console.log(`x=${globalThis.num}`)
console.log('zzc 7 send next msg')
getChuankouFnMsg() getChuankouFnMsg()
},1000) },500)
// hilog.info(0x0000, 'testTag', 'Test NAPI SerialRecvAsync callback in'); // hilog.info(0x0000, 'testTag', 'Test NAPI SerialRecvAsync callback in');
// hilog.info(0x0000, 'testTag', 'Test NAPI SerialRecvAsync recevedLen = %{public}d', revTestInfo.recevedLen); // hilog.info(0x0000, 'testTag', 'Test NAPI SerialRecvAsync recevedLen = %{public}d', revTestInfo.recevedLen);

View File

@ -42,7 +42,7 @@ const map = {
'MA_MAP_POINT_ITEM': MA_MAP_POINT_ITEM, 'MA_MAP_POINT_ITEM': MA_MAP_POINT_ITEM,
'MA_MAP_ROAD': MA_MAP_ROAD, 'MA_MAP_ROAD': MA_MAP_ROAD,
'MA_MAP_ROAD_LANE': MA_MAP_ROAD_LANE, 'MA_MAP_ROAD_LANE': MA_MAP_ROAD_LANE,
'MA_MAP_SUBITEM': MA_MAP_SUBITEM, 'MAP_SUBITEM': MA_MAP_SUBITEM,
'MA_SYSSET': MA_SYSSET, 'MA_SYSSET': MA_SYSSET,
'ES_CARINFO': ES_CARINFO, 'ES_CARINFO': ES_CARINFO,
'ES_EXAMPOINTDETAIL': ES_EXAMPOINTDETAIL, 'ES_EXAMPOINTDETAIL': ES_EXAMPOINTDETAIL,
@ -77,24 +77,25 @@ const centerToMap={
// 'ES_CAR_VIDEO_PARAMETER':ES_CAR_VIDE0pO_PARAMETER // 'ES_CAR_VIDEO_PARAMETER':ES_CAR_VIDE0pO_PARAMETER
} }
function sqlInsertCommonFn(tableName,resultArr){ function sqlInsertCommonFn(tableName,resultArr,context?){
return new Promise((resolve,reject)=>{ return new Promise((resolve,reject)=>{
const accountTable = new AccountTable(() => { const accountTable = new AccountTable(() => {
}, map[tableName]); }, map[tableName],context);
accountTable.getRdbStore(() => { accountTable.getRdbStore(() => {
accountTable.query('0', async (result) => { accountTable.query('0', async (result) => {
// console.log('表长度',result.length,tableName)
if (result.length == 0) { if (result.length == 0) {
let INSERT_SQL = "INSERT INTO "+tableName let INSERT_SQL = "INSERT INTO "+tableName
+ " ("+ map[tableName].ACCOUNT_TABLE.columns.toString()+") VALUES " + " ("+ map[tableName].ACCOUNT_TABLE.columns.toString()+") VALUES "
resultArr.map((data,i) => { resultArr.map((data,i) => {
data.id=`${i}` data.id=`${i}`
let str='(' let str='('
map[tableName].ACCOUNT_TABLE.columns.map((res,index)=>{ map[tableName].ACCOUNT_TABLE.columns.map((res,index)=>{
if(map[tableName].ACCOUNT_TABLE.columns.length-1==index){ if(map[tableName].ACCOUNT_TABLE.columns.length-1==index){
str+=`"${data[res]||'1'}"` str+=`"${data[res]||'0'}"`
}else{ }else{
str+=`"${data[res]||'1'}"`+',' str+=`"${data[res]||'0'}"`+','
} }
}) })
if(i==resultArr.length-1){ if(i==resultArr.length-1){
@ -110,19 +111,19 @@ function sqlInsertCommonFn(tableName,resultArr){
}) })
} }
else { else {
await delSyncTable(tableName) await delSyncTable(tableName,context)
const result= await sqlInsertCommonFn(tableName,resultArr) const result= await sqlInsertCommonFn(tableName,resultArr,context)
resolve(result) resolve(result)
} }
}, true); }, true);
}); },context);
}) })
} }
//参数平台
export async function getDataBaseTable(params) { export async function getDataBaseTable(params,reqParam) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const accountTable = new AccountTable(() => { const accountTable = new AccountTable(() => {
}, map[params.tableName]); }, map[params.tableName],context);
accountTable.getRdbStore(() => { accountTable.getRdbStore(() => {
accountTable.query('0', async (result) => { accountTable.query('0', async (result) => {
if (result.length != 0) { if (result.length != 0) {
@ -130,7 +131,7 @@ export async function getDataBaseTable(params) {
return return
} else { } else {
const date = new Date() const date = new Date()
if(!globalThis.timeInfo?.paraKdid){ if(!reqParam?.paraKdid){
prompt.showToast({ prompt.showToast({
message: 'paraKdid获取失败', message: 'paraKdid获取失败',
duration: 3000 duration: 3000
@ -140,8 +141,8 @@ export async function getDataBaseTable(params) {
const str = { "head": { "time": dateFormat(date) }, const str = { "head": { "time": dateFormat(date) },
"body": "body":
{ "tableName": params.tableName, // 表名 { "tableName": params.tableName, // 表名
"paraKdid": globalThis.timeInfo?.paraKdid, //参数平台kdid "paraKdid": reqParam.paraKdid, //参数平台kdid
"examinationRoomId": globalThis.carInfo?.examinationRoomId, //考试平台kdid "examinationRoomId": reqParam.examinationRoomId, //考试平台kdid
"typeRsp": "0" // 赋默认值0无需改变 "typeRsp": "0" // 赋默认值0无需改变
} }
} }
@ -152,10 +153,16 @@ export async function getDataBaseTable(params) {
} }
let INSERT_SQL = "INSERT INTO "+params.tableName let INSERT_SQL = "INSERT INTO "+params.tableName
+ " ("+ map[params.tableName].ACCOUNT_TABLE.columns.toString()+") VALUES " + " ("+ map[params.tableName].ACCOUNT_TABLE.columns.toString()+") VALUES "
if(params.tableName=='MA_SYSSET'){
res.body[params.tableName]= res.body[params.tableName].filter(res=>{
return res['v_no']>=300&&res['v_no']<=700
})
}
res.body[params.tableName].map((data,i) => { res.body[params.tableName].map((data,i) => {
data.id=`${i}` // data.id=`${i}`
data.id=i
let str='(' let str='('
map[params.tableName].ACCOUNT_TABLE.columns.map((res,index)=>{ map[params.tableName].ACCOUNT_TABLE.columns.map((res,index)=>{
if(map[params.tableName].ACCOUNT_TABLE.columns.length-1==index){ if(map[params.tableName].ACCOUNT_TABLE.columns.length-1==index){
@ -177,7 +184,7 @@ export async function getDataBaseTable(params) {
}) })
} }
}, true); }, true);
}); },reqParam.context);
}) })
} }
//依据数组和表名更新sql表 //依据数组和表名更新sql表
@ -185,13 +192,11 @@ export async function upDateTableByArray(tableName,arr) {
sqlInsertCommonFn(tableName,arr) sqlInsertCommonFn(tableName,arr)
} }
//更新双中心表 //更新双中心表
export async function upDateTable(params) { export async function upDateTable(params,reqParam) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const date = new Date() const date = new Date()
let paraKdid='' let paraKdid=reqParam?.paraKdid||''
let examinationRoomId='' let examinationRoomId=reqParam?.examinationRoomId||''
paraKdid=globalThis.timeInfo?globalThis.timeInfo?.paraKdid:''
examinationRoomId= globalThis.carInfo?globalThis.carInfo.examinationRoomId:''
if(!paraKdid|| !examinationRoomId){ if(!paraKdid|| !examinationRoomId){
resolve(false) resolve(false)
return return
@ -213,7 +218,7 @@ export async function upDateTable(params) {
return return
} }
try { try {
const result=await sqlInsertCommonFn(params.tableName,res.body[params.tableName]) const result=await sqlInsertCommonFn(params.tableName,res.body[params.tableName],reqParam.context)
resolve(result) resolve(result)
}catch (error){ }catch (error){
console.log(error) console.log(error)
@ -223,10 +228,10 @@ export async function upDateTable(params) {
} }
//考试平台 //考试平台
export async function getMySystemSetTable(params) { export async function getMySystemSetTable(params,reqParam) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const date = new Date() const date = new Date()
if(!globalThis.timeInfo?.paraKdid){ if(!reqParam.paraKdid){
prompt.showToast({ prompt.showToast({
message: 'paraKdid获取失败', message: 'paraKdid获取失败',
duration: 3000 duration: 3000
@ -236,20 +241,25 @@ export async function getMySystemSetTable(params) {
const str = { "head": { "time": dateFormat(date) }, const str = { "head": { "time": dateFormat(date) },
"body": "body":
{ "tableName": params.tableName, // 表名 { "tableName": params.tableName, // 表名
"paraKdid": globalThis.timeInfo?.kdid, //考试平台kdid "paraKdid": reqParam?.kdid, //考试平台kdid
"examinationRoomId": globalThis.timeInfo?.kdid, //考试平台kdid "examinationRoomId": reqParam?.kdid, //考试平台kdid
"typeRsp": "0" // 赋默认值0无需改变 "typeRsp": "0" // 赋默认值0无需改变
} }
} }
initCenterCacheByKSPT(str).then((res)=>{ initCenterCacheByKSPT(str).then((res)=>{
if( res.body[params.tableName].length==0){ if( res.body[params.tableName].length==0){
resolve(); resolve();
return return
} }
sqlInsertCommonFn(params.tableName,res.body[params.tableName]).then((result)=>{ if(params.tableName=='MA_SYSSET'){
resolve(result) res.body[params.tableName]= res.body[params.tableName].filter(res=>{
}) return res['v_no']<300 || res['v_no']>700
}) })
}
sqlInsertCommonFn(params.tableName,res.body[params.tableName],reqParam.context).then((result)=>{
resolve(result)
})
})
}) })
@ -257,10 +267,10 @@ export async function getMySystemSetTable(params) {
} }
//依据表名同步获取数据 //依据表名同步获取数据
export async function getSyncData(tableName) { export async function getSyncData(tableName,context?) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const accountTable = new AccountTable(() => { const accountTable = new AccountTable(() => {
}, map[tableName]); }, map[tableName],context);
accountTable.getRdbStore(() => { accountTable.getRdbStore(() => {
accountTable.query('0', async (result) => { accountTable.query('0', async (result) => {
resolve(result) resolve(result)
@ -270,13 +280,14 @@ export async function getSyncData(tableName) {
} }
export async function delSyncTable(tableName){ export async function delSyncTable(tableName,context?){
return new Promise((resolve,reject)=>{ return new Promise((resolve,reject)=>{
const accountTable = new AccountTable(() => { const accountTable = new AccountTable(() => {
}, map[tableName]); }, map[tableName],context);
accountTable.deleteTableData(()=>{ accountTable.deleteTableData((ret)=>{
console.log('删除成功')
resolve(true) resolve(true)
},tableName) },tableName,context)
}) })
} }
@ -333,89 +344,98 @@ export async function getEsCarModel(context){
await fileModel.storingFiles(result.buffer) await fileModel.storingFiles(result.buffer)
} }
export async function upDataZhongxinginitialization(){ export async function upDataZhongxinginitialization(param){
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if(!globalThis.carInfo?.carId){ if(!param.carId){
resolve(false) resolve(false)
return return
} }
const str = { const str = {
"carId": globalThis.carInfo?.carId, // 表名 "carId": param.carId, // 表名
"examinationRoomId": globalThis.carInfo?.examinationRoomId, //考试平台kdid "examinationRoomId": param.examinationRoomId, //考试平台kdid
videoVersion:'1.0', videoVersion:'1.0',
judgeVersion:globalThis.judgeVersion, judgeVersion:param.judgeVersion,
shellVersion: globalThis.version shellVersion: param.shellVersion
} }
console.log('respose') console.log('daihai2')
initialization(str).then(async(res)=>{
initialization(str).then((res)=>{
console.log('daihai3',JSON.stringify(res))
if(!res){ if(!res){
resolve(false) resolve(false)
return return
} }
let flag let flag
console.log('resposestart')
for(let key in res.initializationRsp.body){ for(let key in res.initializationRsp.body){
if(!centerToMap[key]){ if(!centerToMap[key]){
continue continue
} }
try{ setSyncCenterSqlData(key,res,param).then((flag) => {
flag= await setSyncCenterSqlData(key,res) if(!flag){
}catch (error){ resolve(false)
console.log(error) return
} }{
if(!flag){ resolve(true)
}
}).catch ((error) => {
resolve(false) resolve(false)
return console.log(error)
} })
} }
console.log('daihai4')
resolve(true) resolve(true)
console.log('resposestart')
}).catch((Error)=>{ }).catch((Error)=>{
resolve(false) resolve(false)
}) })
}) })
} }
function setSyncCenterSqlData(key,res){ function setSyncCenterSqlData(key,res,param){
return new Promise((resolve,reject)=>{ return new Promise((resolve,reject)=>{
const mapName={ const mapName={
'ItemInfo':'MA_ITEMINFO', 'ItemInfo':'MA_ITEMINFO',
'MarkRule':'MA_MARKRULE', 'MarkRule':'MA_MARKRULE',
'SystemParm':'MA_SYSTEMPARM', 'SystemParm':'MA_SYSTEMPARM',
'mapCollectList':'MA_MAP_COLLECT', 'MA_MAP_COLLECT':'MA_MAP_COLLECT',
'mapCollectshapeList':'MA_MAP_COLLECT_SHAPE', 'MA_MAP_COLLECT_SHAPE':'MA_MAP_COLLECT_SHAPE',
'Map_ItemClass':'MA_MAP_ITEMCLASS', 'Map_ItemClass':'MA_MAP_ITEMCLASS',
'Map_Point':'MA_MAP_POINT', 'Map_Point':'MA_MAP_POINT',
'Map_Point_Item':'MA_MAP_POINT_ITEM', 'Map_Point_Item':'MA_MAP_POINT_ITEM',
'Map_Road':'MA_MAP_ROAD', 'Map_Road':'MA_MAP_ROAD',
'Map_Road_Lane':'MA_MAP_ROAD_LANE', 'Map_Road_Lane':'MA_MAP_ROAD_LANE',
'Map_SubItem':'MA_MAP_SUBITEM', 'Map_SubItem':'MAP_SUBITEM',
'Sysset':'MA_SYSSET', 'Sysset':'MA_SYSSET',
'CarInfo':'ES_CARINFO', 'CarInfo':'ES_CARINFO',
// 'ES_EXAMPOINTDETAIL':ES_EXAMPOINTDETAIL, // 'ES_EXAMPOINTDETAIL':ES_EXAMPOINTDETAIL,
'MarkRuleSet':'MA_MARKRULE', 'MarkRuleSet':'MA_MARKRULESET',
'Cdsbinfo':'MA_CDSBINFO', 'Cdsbinfo':'MA_CDSBINFO',
'T_CarParmSet':'MA_T_CARPARMSET', 'T_CarParmSet':'MA_T_CARPARMSET',
// 'ES_CAR_VIDEO_PARAMETER':ES_CAR_VIDE0pO_PARAMETER // 'ES_CAR_VIDEO_PARAMETER':ES_CAR_VIDE0pO_PARAMETER
} }
const accountTable = new AccountTable(() => { // const accountTable = new AccountTable(() => {
}, centerToMap[key]); // }, centerToMap[key],param.context);
let arrList console.log('kkkkkkkkk',key)
let arrList
if(res.initializationRsp.body[key].record instanceof Array){ if(res.initializationRsp.body[key].record instanceof Array){
arrList =res.initializationRsp.body[key].record arrList =res.initializationRsp.body[key].record
}else{ }else{
arrList=[res.initializationRsp.body[key].record] arrList=[res.initializationRsp.body[key].record]
} }
res sqlInsertCommonFn(mapName[key],arrList,param.context).then((result)=>{
sqlInsertCommonFn(mapName[key],arrList).then((result)=>{ console.log(key,'表建立成功')
console.log(key,'表建立成功') if(result){
if(result){ resolve(true)
resolve(true) }else{
}else{ resolve(false)
resolve(false) }
} }).catch((msg)=>{
}).catch((msg)=>{ reject(false)
reject(false) console.log(key,'表建立失败')
console.log(msg) })
})
}) })
} }

View File

@ -6,7 +6,8 @@ import { getSyncData } from '../../common/service/initable'
//获取设备信息 //获取设备信息
export async function getDeviceInfo() { export async function getDeviceInfo() {
globalThis.deviceNo = 'HM-AC76'; //科目三设备 globalThis.deviceNo = '153216400880'; //科目三设备
// globalThis.deviceNo = '150667400235'; //科目三设备
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
getSyncData('DeviceInfoTable').then((result: Array<any>) => { getSyncData('DeviceInfoTable').then((result: Array<any>) => {

View File

@ -11,6 +11,7 @@ export async function timeSynchronize() {
let res:any = await timeSynchronization(params) let res:any = await timeSynchronization(params)
res = res.timeSynchronizationRsp; res = res.timeSynchronizationRsp;
globalThis.timeInfo=res.body globalThis.timeInfo=res.body
console.log('timeInfo',JSON.stringify(res.body))

View File

@ -10,7 +10,7 @@ import { getCurrentTime } from '../utils/tools'
import record from '@ohos.rtsprecord'; import record from '@ohos.rtsprecord';
import { FileHelper } from './FileHelper'; import { FileHelper } from './FileHelper';
// const rtsp_server = record.createServer(); const rtsp_server = record.createServer();
//开始录屏 //开始录屏
const FILE_ASSET_FETCH_COLUMNS = [photoAccessHelper.PhotoKeys.URI, const FILE_ASSET_FETCH_COLUMNS = [photoAccessHelper.PhotoKeys.URI,
photoAccessHelper.PhotoKeys.PHOTO_TYPE, photoAccessHelper.PhotoKeys.PHOTO_TYPE,
@ -28,7 +28,7 @@ photoAccessHelper.PhotoKeys.TITLE,
photoAccessHelper.PhotoKeys.POSITION, photoAccessHelper.PhotoKeys.POSITION,
photoAccessHelper.PhotoKeys.DATE_TRASHED, photoAccessHelper.PhotoKeys.DATE_TRASHED,
photoAccessHelper.PhotoKeys.HIDDEN]; photoAccessHelper.PhotoKeys.HIDDEN];
const rtsp_server = record.createServer(); // const rtsp_server = record.createServer();
export async function startRecordVideo(param, td, context, dir) { export async function startRecordVideo(param, td, context, dir) {
return new Promise((reslove, reject) => { return new Promise((reslove, reject) => {

View File

@ -24,7 +24,7 @@ export default class TcpClient {
onError(callback?){ onError(callback?){
this.tcp.on('error', err => { this.tcp.on('error', err => {
hilog.info(0x0000, 'testTag', "on error, err:" + JSON.stringify(err)); hilog.info(0x0000, 'testTag', "on error, err:" + JSON.stringify(err));
callback() callback&&callback()
// this.closeUdp(()=>{ // this.closeUdp(()=>{
// this.bindUdp() // this.bindUdp()
// }) // })
@ -39,9 +39,11 @@ export default class TcpClient {
this.oppositeIpPort = oppositeIpPort this.oppositeIpPort = oppositeIpPort
let promise=this.tcp.bind({ address: this.localIp, port:parseInt(this.localIpPort), family: 1 }, err => { let promise=this.tcp.bind({ address: this.localIp, port:parseInt(this.localIpPort), family: 1 }, err => {
if (err) { if (err) {
hilog.info(0x0000, 'testTag', "tcpBinderror:" + JSON.stringify(err)); hilog.info(0x0000, 'testTag', "tcpreBinderror:" + JSON.stringify(err));
resolve(true) resolve(true)
} }
console.log('testTag,rebindtestTag tcp bind success');
resolve(false) resolve(false)
}) })
@ -80,12 +82,11 @@ export default class TcpClient {
} }
connectTcp(){ connectTcp(){
console.log('testTagtcpoppositeIp',this.oppositeIp,'localIp',this.localIp) console.log('testTagtcbpoppositeIp',this.oppositeIp,this.oppositeIpPort,'localIp',this.localIp,this.localIpPort)
console.log('22323') console.log('22323')
return new Promise((resolve,reject)=>{ return new Promise((resolve,reject)=>{
let promise = this.tcp.connect({ address: {address: this.oppositeIp, port: parseInt(this.oppositeIpPort), family: 1} , timeout: 6000}); let promise = this.tcp.connect({ address: {address: this.oppositeIp, port: parseInt(this.oppositeIpPort), family: 1} , timeout: 6000});
promise.then(() => { promise.then(() => {
console.log('testTagbindSuccess')
this.tcp.setExtraOptions({ this.tcp.setExtraOptions({
keepAlive: true, keepAlive: true,
@ -111,7 +112,7 @@ export default class TcpClient {
} }
sendMsg(msg: string) { sendMsg(msg: string) {
console.log('oppositeIp',this.oppositeIp) console.log('testTagsendoppositeIp',this.oppositeIp)
return new Promise((reslove,reject)=>{ return new Promise((reslove,reject)=>{
let promise = this.tcp.send({ let promise = this.tcp.send({
data:msg data:msg
@ -146,7 +147,7 @@ export default class TcpClient {
onMessage(callback?) { onMessage(callback?) {
this.tcp.on('message', value => { this.tcp.on('message', value => {
// console.log('messageLengt',,value.message.length)) // console.log('messageLengt',,value.message.length))
console.log('tcpmsg') console.log('testTagtcpmsg')
// console.log("on message, message:" + value.message+ ", remoteInfo:" ) // console.log("on message, message:" + value.message+ ", remoteInfo:" )
if (value) { if (value) {
let dataView = new DataView(value.message) let dataView = new DataView(value.message)
@ -181,17 +182,17 @@ export default class TcpClient {
// }); // });
} }
offTcp(callback) { offTcp(callback) {
this.tcp.off('message', callback); this.tcp.off('testTagofmessg', callback);
} }
closeTcp(callback) { closeTcp(callback) {
return new Promise((reslove,reject)=>{ return new Promise((reslove,reject)=>{
let promise = this.tcp.close(); let promise = this.tcp.close();
promise.then(() => { promise.then(() => {
console.log('close success'); console.log('testTagclose success');
callback() callback()
reslove(true) reslove(true)
}).catch(err => { }).catch(err => {
console.log('close fail'); console.log('testTagclose fail');
reslove(false) reslove(false)
}); });
}) })

View File

@ -64,9 +64,9 @@ export default class UdpClient {
hilog.info(0x0000, 'udpCLient', 'bind'+ this.localIp+this.localIpPort); hilog.info(0x0000, 'udpCLient', 'bind'+ this.localIp+this.localIpPort);
let promise = this.udp.bind({ let promise = this.udp.bind({
address: '192.168.7.170', port: 20122, family: 1 // address: '192.168.7.170', port: 20122, family: 1
// address: '192.168.7.170', port: 31013, family: 1 // address: '192.168.7.170', port: 31013, family: 1
// address: this.localIp, port: parseInt(this.localIpPort), family: 1 address: this.localIp, port: parseInt(this.localIpPort), family: 1
}); });
promise.then(() => { promise.then(() => {
console.log(`${TAG}udpCLient udp bind success`); console.log(`${TAG}udpCLient udp bind success`);
@ -88,10 +88,10 @@ export default class UdpClient {
address: { address: {
// address: '192.168.7.124', // address: '192.168.7.124',
// port: 30013, // port: 30013,
address: '192.168.7.124', // address: '192.168.7.124',
port: 20022, // port: 20022,
// address: this.oppositeIp, address: this.oppositeIp,
// port: parseInt(this.oppositeIpPort), port: parseInt(this.oppositeIpPort),
family: 1 family: 1
} }
}); });

View File

@ -68,6 +68,7 @@ export default class UdpClientByCenter {
}); });
} }
initHeartSendMsg(param,context){ initHeartSendMsg(param,context){
console.log('1111param',JSON.stringify(param))
this.initParam=param this.initParam=param
this.context=context this.context=context
} }
@ -116,9 +117,11 @@ export default class UdpClientByCenter {
} }
setMsgHead({id, list, placeId=62, carNo=489}){ setMsgHead({id, list, placeId=62, carNo=489}){
console.log('globalThis.lshNo',globalThis.lshNo)
let a = string2Bytes(`${id}${fillZero(placeId,3)}`, 2*8); let a = string2Bytes(`${id}${fillZero(placeId,3)}`, 2*8);
let b = string2Bytes(`${carNo}${this.lsh}`, 4*8); console.log('aaa',a)
let b = string2Bytes(`${fillZero(carNo,4)}${globalThis.lshNo}`, 4*8);
console.log('bbb',b)
let c = string2Bytes(list.length, 2*8); let c = string2Bytes(list.length, 2*8);
return [...a,...b,...c]; return [...a,...b,...c];
} }
@ -179,6 +182,7 @@ export default class UdpClientByCenter {
} }
onMessage(callback,type?) { onMessage(callback,type?) {
this.udp.on('message', value => { this.udp.on('message', value => {
console.log('tttttttt')
let arr=[] let arr=[]
let dataView = new DataView(value.message) let dataView = new DataView(value.message)
for (let i = 0;i < dataView?.byteLength; ++i) { for (let i = 0;i < dataView?.byteLength; ++i) {
@ -198,16 +202,7 @@ export default class UdpClientByCenter {
callback({id,length,body:list,sendId:this.sendId}) callback({id,length,body:list,sendId:this.sendId})
}); });
} }
onError(callback?){
this.udp.on('error', err => {
console.log('udpbycenterdiushierroring')
hilog.info(0x0000, 'udpCLientBycenteronerror', 'error'+ JSON.stringify(err));
console.log("on error, err:" + JSON.stringify(err))
// this.closeUdp(()=>{
// this.bindUdp()
// })
});
}
closeUdp(callback) { closeUdp(callback) {
this.udp.close(err=>{ this.udp.close(err=>{
if(err){ if(err){

View File

@ -1,7 +1,7 @@
import systemTime from '@ohos.systemDateTime'; import systemTime from '@ohos.systemDateTime';
import { Array2Byte, fillZero, string2Bytes, stringToASC } from '../../common/utils/tools'; import { Array2Byte, fillZero, string2Bytes, stringToASC } from '../../common/utils/tools';
import { testKmItems } from '../../pages/judgeSDK/dataTest/index'; import { testKmItems } from '../../pages/judgeSDK/dataTest/index';
import { setJudgeUdp, setTopLineUdp } from './GlobalUdp'; import { setJudgeUdp, setTopLineUdp } from './GlobleUdp';
import { convertGpsCoord2 } from '../utils/tools'; import { convertGpsCoord2 } from '../utils/tools';
@ -38,11 +38,12 @@ export const initJudgeUdp = async () => {
export const getMessageHeartbeat = async (msg) => { export const getMessageHeartbeat = async (msg) => {
const carInfo = globalThis.carInfo; const carInfo = globalThis.carInfo;
const { examSubject,plateNo,ksyh } = carInfo; const { examSubject,plateNo } = carInfo;
const ksyh='0000000000000'
const asclshArr = stringToASC(fillZero(globalThis.lsh || 0, 13)); const asclshArr = stringToASC(fillZero(globalThis.lsh || 0, 13));
const ascksyhArr = stringToASC(fillZero(globalThis.ksyh || 0, 13)) const ascksyhArr = stringToASC(fillZero(ksyh || 0, 13))
const ascsbxhArr = stringToASC('0000000000') const ascsbxhArr = stringToASC('00000000')
// const ascsbxhArr = stringToASC('153216400880')
const serialIndex = globalThis.serialIndex const serialIndex = globalThis.serialIndex
const tempData = await getPlcData(msg); const tempData = await getPlcData(msg);
const {sensor,gps} = tempData; const {sensor,gps} = tempData;
@ -51,6 +52,8 @@ export const getMessageHeartbeat = async (msg) => {
const translateSignals = getTranslateSignals( const translateSignals = getTranslateSignals(
[zfxd, yfxd, shtd, ygd, jgd, skd, dh1, dh2, lhq, jsc, ssc, fsc, lb, mkg, aqd, 0, 0, 0, 0, 0, 0, ygq, sensor.wd, 0] [zfxd, yfxd, shtd, ygd, jgd, skd, dh1, dh2, lhq, jsc, ssc, fsc, lb, mkg, aqd, 0, 0, 0, 0, 0, 0, ygq, sensor.wd, 0]
) )
console.log('jinweiduwaike',wd,jd,hxj,fyj,hbg)
const translateProject = getTranslateProject(); const translateProject = getTranslateProject();
//@ts-ignore //@ts-ignore
const translateJd = convertGpsCoord2(wd).toFixed(7) * Math.pow(10, 7) const translateJd = convertGpsCoord2(wd).toFixed(7) * Math.pow(10, 7)
@ -77,6 +80,7 @@ export const getMessageHeartbeat = async (msg) => {
//航向角 俯仰角 高程(海拔) //航向角 俯仰角 高程(海拔)
//@ts-ignore //@ts-ignore
string2Bytes((hxj + 90) * 100, 2 * 8), string2Bytes(fyj * 100, 2 * 8), string2Bytes(hbg * 100, 4 * 8), string2Bytes((hxj + 90) * 100, 2 * 8), string2Bytes(fyj * 100, 2 * 8), string2Bytes(hbg * 100, 4 * 8),
//dddd
translateProjects, translateProjects,
//当前项目编号 //当前项目编号
string2Bytes(0, 8), string2Bytes(0, 8),
@ -84,7 +88,9 @@ export const getMessageHeartbeat = async (msg) => {
ascsbxhArr.map(sbxh => string2Bytes(sbxh, 8)[0]), ascsbxhArr.map(sbxh => string2Bytes(sbxh, 8)[0]),
//本次考试行驶距离 //本次考试行驶距离
string2Bytes(0, 2 * 8), string2Bytes(0, 2 * 8),
//扣分 //扣分值
string2Bytes(0, 2 * 8),
//扣分数
string2Bytes(0, 2 * 8), string2Bytes(0, 2 * 8),
//扣分项数量 //扣分项数量
string2Bytes(0, 8), string2Bytes(0, 8),
@ -95,6 +101,8 @@ export const getMessageHeartbeat = async (msg) => {
arr.forEach(itemArr => { arr.forEach(itemArr => {
tempArr = tempArr.concat(itemArr) tempArr = tempArr.concat(itemArr)
}) })
console.log('kmkmkm',tempArr.length)
globalThis.serialIndex = 0; globalThis.serialIndex = 0;
return Array2Byte(tempArr) return Array2Byte(tempArr)
} }
@ -125,10 +133,10 @@ const getTranslateProject = () => {
status: getCenterProjectStatus(current.status) status: getCenterProjectStatus(current.status)
} }
}) })
const len = Math.floor(tempItems.length / 4); const len = Math.floor(tempItems.length / 8);
const arr = []; const arr = [];
for (let i = 0; i <= len; i++) { for (let i = 0; i <= len; i++) {
const temp = tempItems.slice(i * 4, (i + 1) * 4); const temp = tempItems.slice(i * 8, (i + 1) * 8);
let tempArr = temp.map(item => item.status) let tempArr = temp.map(item => item.status)
if (i === 4) { if (i === 4) {
tempArr = tempArr.concat(['00', '00']) tempArr = tempArr.concat(['00', '00'])

View File

@ -35,13 +35,14 @@ export default async function request(req: any) {
paramsStr = paramsStr.toString(); paramsStr = paramsStr.toString();
paramsStr = paramsStr.substring(0, paramsStr.length-1) paramsStr = paramsStr.substring(0, paramsStr.length-1)
try { try {
let baseUrl=host?host:(globalThis.host||config.host) let baseUrl=host?host:(globalThis.host||GlobalConfig.host)
// let baseUrl=host?config.csptHost:config.host' // let baseUrl=host?config.csptHost:config.host'
console.info('surenjun',baseUrl) console.info('surenjun',baseUrl)
const {result,responseCode} = await httpRequest.request(`${baseUrl}${url}${paramsStr}`, options); const {result,responseCode} = await httpRequest.request(`${baseUrl}${url}${paramsStr}`, options);
console.log('daihai5')
let res:any = xml ? xmlToJson(result) : result; let res:any = xml ? xmlToJson(result) : result;
console.log('daihai55')
console.log('响应头地址' + JSON.stringify(res)) console.log('响应头地址' + JSON.stringify(res))
let resObj = null; let resObj = null;
@ -52,7 +53,12 @@ export default async function request(req: any) {
//处理中心服务code //处理中心服务code
if(res.Envelope){ if(res.Envelope){
const msgXml = res.Envelope.Body.writeObjectOutResponse.return; const msgXml = res.Envelope.Body.writeObjectOutResponse.return;
return handleCenterCode(msgXml); console.log('daihai6')
const dd = handleCenterCode(msgXml);
console.log('daihai7')
return dd
} }
if(!xml){ if(!xml){

View File

@ -10,5 +10,5 @@ export const GlobalConfig={
comoonfileWriteAddress:'/mnt/hmdfs/100/account/device_view/local/files', comoonfileWriteAddress:'/mnt/hmdfs/100/account/device_view/local/files',
picSavePath:'/storage/cloud/100/files/Photo/', picSavePath:'/storage/cloud/100/files/Photo/',
videoSavePath:'/storage/cloud/100/files/Videos/', videoSavePath:'/storage/cloud/100/files/Videos/',
host:'http://112.80.35.83:11052' host:'http://172.37.55.191:8082'
} }

View File

@ -31,6 +31,9 @@ export default class EntryAbility extends UIAbility {
globalThis.version = '2024.11.22.14' globalThis.version = '2024.11.22.14'
globalThis.judgeVersion = '2024.11.22.14' globalThis.judgeVersion = '2024.11.22.14'
globalThis.videoVersion= '1.0' globalThis.videoVersion= '1.0'
// globalThis.version = '2023.12.13.01'
// globalThis.judgeVersion = '2023.09.30.1'
// globalThis.videoVersion= '1.0'
// globalThis.version = '2022.03.14.01' // globalThis.version = '2022.03.14.01'
//视频遮挡 //视频遮挡
globalThis.spzd={ globalThis.spzd={
@ -42,9 +45,11 @@ export default class EntryAbility extends UIAbility {
globalThis.singlePlay=false //单机模式 globalThis.singlePlay=false //单机模式
globalThis.signNum=0//心跳指令编号 globalThis.signNum=0//心跳指令编号
globalThis.lsh='0000000000000'//学员流水号 globalThis.lsh='0000000000000'//学员流水号
globalThis.ratio= 1700 / 960 //适配比例
globalThis.statue=1//考试状态 globalThis.statue=1//考试状态
globalThis.pathDir = this.context.filesDir; globalThis.pathDir = this.context.filesDir;
globalThis.context=this.context globalThis.context = this.context;
globalThis.isJudgeInitBool=false
console.info('jiangsong globalThis.pathDir = ' + globalThis.pathDir); console.info('jiangsong globalThis.pathDir = ' + globalThis.pathDir);
// this.requestPermission(this.context) // this.requestPermission(this.context)
// this.featureAbilityAuth() // this.featureAbilityAuth()
@ -52,7 +57,7 @@ export default class EntryAbility extends UIAbility {
const windowClass = await windowStage.getMainWindow(); const windowClass = await windowStage.getMainWindow();
globalThis.windowClass = windowClass globalThis.windowClass = windowClass
// await windowClass.setWindowLayoutFullScreen(true) // await windowClass.setWindowLayoutFullScreen(true)
await windowClass.setWindowSystemBarEnable([]) //全屏 // await windowClass.setWindowSystemBarEnable([]) //全屏
await windowClass.setWindowSystemBarEnable(['navigation']) await windowClass.setWindowSystemBarEnable(['navigation'])
windowStage.loadContent('pages/Index', (err, data) => { windowStage.loadContent('pages/Index', (err, data) => {

View File

@ -1,43 +1,73 @@
import { VideoConfig } from './interfaces'; // @ts-nocheck
import { VideoConfig } from './interfaces'
import common from '@ohos.app.ability.common'; import common from '@ohos.app.ability.common';
import router from '@ohos.router'; import router from '@ohos.router'
import { getCarInfo, getDeviceInfo } from '../common/service/terminalService'; import { getDeviceInfo ,getCarInfo} from '../common/service/terminalService'
import { setCurrentTime } from '../common/service/timeService'; import { setCurrentTime } from '../common/service/timeService'
import { string2Bytes } from '../common/utils/tools'; import {string2Bytes} from '../common/utils/tools'
import { FileHelper } from '../common/service/FileHelper'; import { FileHelper } from '../common/service/FileHelper';
import { getUDP, getUDP2 } from '../common/utils/GlobalUdp';
import { initJudgeUdp } from '../common/utils/UdpJudge';
import { getTCP } from '../common/utils/GlobalTcp';
import testNapi from '@ohos.hiserialsdk';
import { import {
getEsCarModel, getEsCarModel,
} from '../common/service/initable' } from '../common/service/initable'
import { import FileUtil from '../common/utils/File'
getDoubleCeneterTable, import { getUDP, getUDP2 } from '../common/utils/GlobleUdp'
getliushuiNum, import {initJudgeUdp} from '../common/utils/UdpJudge'
getSingleCenterTable, import { getTCP } from '../common/utils/GlobleTcp'
setliushuiNum, import TcpClient from '../common/utils/TcpClient';
takePhotoFn import testNapi from '@ohos.hiserialsdk'
} from '../common/service/indexService'; import {setliushuiNum,getliushuiNum,getSingleCenterTable,getDoubleCeneterTable,takePhotoFn} from '../common/service/indexService'
import abilityAccessCtrl, { Permissions } from '@ohos.abilityAccessCtrl'; import abilityAccessCtrl, { Permissions } from '@ohos.abilityAccessCtrl';
import promptAction from '@ohos.promptAction'; import worker, { MessageEvents } from '@ohos.worker';
import { VideoConfigData } from '../mock';
@Entry @Entry
@Component @Component
struct Index { struct Index {
private fileUtil: FileUtil
@State carNum: string = '' @State carNum: string = ''
@State version: string = '' @State version: string = ''
@State url: string = '' @State url: string = ''
@State hasAuth: boolean = false; @State hasAuth: boolean = false;
@State isSingle: boolean = false; @State isSingle: boolean = false;
@State deviceId: string = ''; @State deviceId: string = '';
private interval = null;
private workerInstance = null;
@State angle: number = 0 @State angle: number = 0
@State ratio: number = 1700 / 960 @State ratio: number = 1700 / 960
@State loading: boolean = true @State loading: boolean = true
@State fd: number = -1; @State fd: number = -1;
private interval=null;
private context = getContext(this) as common.UIAbilityContext; private context = getContext(this) as common.UIAbilityContext;
@State param: VideoConfig = {
videoNum:'1',
spls: '1',
wz: '0,0',
faceFlag: false,
shuiying: true,
pztd: '2',
ljlx: '',
ip: '192.168.36.94',
port: '554',
userName: 'admin',
pwd: '12345qwe',
td1: '1',
td2: '2',
td3: '3',
td4: '4',
videoRecord1: false,
videoRecord2: true,
videoRecord3: false,
videoRecord4: false,
text1: '',
text2: '',
text3: '',
dolt: '',
fontSize: '',
rlls: '1',
spzd4:false,
spzd3:false,
spzd2:false,
spzd1:false,
zdyz:'5',
}
fileHelper =null; fileHelper =null;
build() { build() {
Column() { Column() {
@ -70,7 +100,7 @@ struct Index {
Column() { Column() {
Row() { Row() {
if (!this.isSingle) { if (!this.isSingle) {
Image($r('app.media.index_lw')).width('30.5%').height('74%').onClick(async () => { Image($r('app.media.index_lw')).width('30.5%').height('74%').onClick(async() => {
if (this.loading) { if (this.loading) {
return return
} }
@ -79,21 +109,15 @@ struct Index {
this.angle = 360 this.angle = 360
}, 1000) }, 1000)
this.angle = 0 this.angle = 0
if(!globalThis.timeInfo){
//mode为3双中心下载表
if (globalThis.timeInfo?.mode == '3') {
await getDoubleCeneterTable()
} else if (globalThis.timeInfo?.mode == '1') {
//单中心
await getSingleCenterTable()
} else {
promptAction.showToast({ promptAction.showToast({
message: `网络连接失败`, message: `网络连接失败`,
duration: 3000 duration: 3000
}); });
this.loading = false this.loading=false
} }
this.loading = false this.testXMLToJSONInWorker()
}) })
} }
@ -129,12 +153,12 @@ struct Index {
Column() { Column() {
Text('V ' + globalThis.version) Text('V ' + globalThis.version)
.fontColor('#CCAE7A') .fontColor('#CCAE7A')
.fontSize(22 * this.ratio) .fontSize(22 * globalThis.ratio)
.width('30%') .width('30%')
.margin({ bottom: 10 }) .margin({ bottom: 10 })
Text('授权信息:' + (this.hasAuth ? '已授权' : '未授权')) Text('授权信息:' + (this.hasAuth ? '已授权' : '未授权'))
.fontColor('#CCAE7A') .fontColor('#CCAE7A')
.fontSize(22 * this.ratio) .fontSize(22 * globalThis.ratio)
.width('30%') .width('30%')
} }
.margin({ left: 24 }) .margin({ left: 24 })
@ -142,45 +166,47 @@ struct Index {
GestureGroup(GestureMode.Exclusive, GestureGroup(GestureMode.Exclusive,
TapGesture({ count: 2 }) TapGesture({ count: 2 })
.onAction(() => { .onAction(() => {
// takePhotoFn(this.context)
globalThis.singlePlay = !globalThis.singlePlay globalThis.singlePlay = !globalThis.singlePlay
this.isSingle = globalThis.singlePlay this.isSingle = globalThis.singlePlay
}) })
) )
) )
Text('考车号:' + globalThis.deviceNo).fontColor('#CCAE7A').fontSize(22 * this.ratio).margin({ right: 24 }) Text('考车号:' + globalThis.deviceNo).fontColor('#CCAE7A').fontSize(22 * globalThis.ratio).margin({ right: 24 })
} }
.width('100%') .width('100%')
.justifyContent(FlexAlign.SpaceBetween) .justifyContent(FlexAlign.SpaceBetween)
.margin({ bottom: 10 }) .margin({ bottom: 10 })
} }
// //
if (this.loading) { if (this.loading) {
Column() { Column() {
Image($r('app.media.open_loading')) Image($r('app.media.open_loading'))
.width(200 * this.ratio) .width(200 * globalThis.ratio)
.rotate({ angle: this.angle }) .rotate({ angle: this.angle })
.height(200 * this.ratio) .height(200 * globalThis.ratio)
.animation({ .animation({
duration: 5000, // 动画时长 duration: 5000, // 动画时长
curve: Curve.EaseOut, // 动画曲线 curve: Curve.EaseOut, // 动画曲线
delay: 500, // 动画延迟 delay: 500, // 动画延迟
iterations: -1, // 播放次数 iterations: -1, // 播放次数
playMode: PlayMode.Normal, // 动画模式 playMode: PlayMode.Normal, // 动画模式
}) })
.margin({ top: 30 * this.ratio }) .margin({ top: 30 * globalThis.ratio })
Image($r('app.media.car')) Image($r('app.media.car'))
.width(80 * this.ratio) .width(80 * globalThis.ratio)
.height(80 * this.ratio) .height(80 * globalThis.ratio)
.position({ x: 288 * this.ratio, y: 89 * this.ratio }) .position({ x: 288 * globalThis.ratio, y: 89 * globalThis.ratio })
Text('获取考车信息,请稍候……').fontSize(24 * this.ratio).margin({ top: 20 * this.ratio }).fontWeight(400) Text('获取考车信息,请稍候……').fontSize(24 * globalThis.ratio).margin({ top: 20 * globalThis.ratio }).fontWeight(400)
} }
.width(660 * this.ratio) .visibility(this.loading ? Visibility.Visible: Visibility.Hidden)
.height(360 * this.ratio) .width(660 * globalThis.ratio)
.position({ x: 150 * this.ratio, y: 98 * this.ratio }) .height(360 * globalThis.ratio)
.backgroundColor('#E6E3DF') .position({ x: 150 * globalThis.ratio, y: 98 * globalThis.ratio })
.borderRadius(19 * this.ratio) .backgroundColor('#E6E3DF')
.borderRadius(19 * globalThis.ratio)
} }
} }
.width('100%') .width('100%')
@ -192,13 +218,54 @@ struct Index {
} }
aboutToAppear() { aboutToAppear() {
globalThis.ratio= 1700 / 960
this.angle = 0 this.angle = 0
this.loading = false this.loading = false
// let workerInstance = new worker.ThreadWorker('entry/ets/pages/worker.ts', {
// name: 'FriendsMoments Worker'
// });
// this.workerInstance.onmessage = function(e) {
// console.log("onerror")
// router.pushUrl({
// url: 'pages/ExaminerLogin',
// }, router.RouterMode.Single)
// this.loading=false
// }
}
async testXMLToJSONInWorker(){
let workerInstance = new worker.ThreadWorker('entry/ets/workers/worker.ts', {
name: 'FriendsMoments Worker'
});
var xmlStr='123'
console.log("baoyihu before postMessage :");
const param={
carId:globalThis.carInfo?.carId,
examinationRoomId:globalThis.carInfo?.examinationRoomId,
judgeVersion:globalThis.judgeVersion,
shellVersion:globalThis.version,
paraKdid:globalThis.timeInfo?.paraKdid,
mode: globalThis.timeInfo?.mode,
context:this.context
}
workerInstance.postMessage(param);
workerInstance.onmessage = (e: MessageEvents): void => {
console.log("baoyihu after postMessage :",e.data);
console.log("onerror")
router.pushUrl({
url: 'pages/ExaminerLogin',
}, router.RouterMode.Single)
this.loading=false
// let workData: WorkData = e.data;
// if (workData) {
// this.isComplete = workData.isComplete;
// this.json_Str = workData.jsonStr;
// console.log("baoyihu after postMessage json_Str:"+this.json_Str);
// workerInstance.terminate();
// }
}
} }
async heartMsg() { async heartMsg() {
//心跳指令编号 //考试状态 const arr = [globalThis.signNum||0, globalThis.statue||1]
const arr = [globalThis.signNum || 0, globalThis.statue || 1]
let tmpList = []; let tmpList = [];
tmpList.push(string2Bytes(arr[0], 1 * 8)[0]) tmpList.push(string2Bytes(arr[0], 1 * 8)[0])
tmpList.push(string2Bytes(arr[1], 1 * 8)[0]) tmpList.push(string2Bytes(arr[1], 1 * 8)[0])
@ -206,27 +273,30 @@ struct Index {
for (let i = 0;i < str.length; i++) { for (let i = 0;i < str.length; i++) {
tmpList.push(string2Bytes(str.charCodeAt(i), 1 * 8)[0]) tmpList.push(string2Bytes(str.charCodeAt(i), 1 * 8)[0])
} }
const param= {id: 31,list:tmpList,carNo: globalThis.carInfo.carNo,placeId: globalThis.carInfo.examinationRomId} console.log('globalThis.carInfo',JSON.stringify(globalThis.carInfo))
const param= {id: 31,list:tmpList,carNo: globalThis.carInfo.carNo,placeId: globalThis.carInfo.examinationRoomId}
// globalThis.udpClient2.initHeartSendMsg(param,this.context)
globalThis.udpClient2.sendMsg(param, this.context) globalThis.udpClient2.sendMsg(param, this.context)
} }
onPageShow() { onPageShow() {
this.loading = false this.loading = false
this.createAlbum()
this.userAuth(); this.userAuth();
//plc
getUDP() getUDP()
//中心udp
getUDP2() getUDP2()
clearInterval(this.interval) clearInterval(this.interval)
this.interval=setInterval(() => { this.interval=setInterval(() => {
setliushuiNum(this.context) setliushuiNum(this.context)
getliushuiNum() getliushuiNum(this.context)
this.heartMsg() this.heartMsg()
}, 1000) }, 1000)
// 3s拍照 // takePhotoFn(this.context)
takePhotoFn(this.context)
//tcp差分转发如果差分通过udp转发可注释 //
getTCP() getTCP()
// const TcpClient: TcpClient =new TcpClient(result[0].tcplocalIp, result[0].tcplocalIpPort,result[0].tcpOppositeIp,result[0].tcpOppositePort)
if (globalThis.singlePlay == undefined || globalThis.singlePlay == null) { if (globalThis.singlePlay == undefined || globalThis.singlePlay == null) {
globalThis.singlePlay = false globalThis.singlePlay = false
@ -236,15 +306,15 @@ struct Index {
console.info('Index onPageShow'); console.info('Index onPageShow');
} }
//创建截图文件夹
async createAlbum() { async createAlbum() {
this.fileHelper = new FileHelper(); this.fileHelper = new FileHelper();
// this.fileHelper.createAlbum('jt') this.fileHelper.createAlbum('jt')
this.fileHelper.createAlbum('pz'); this.fileHelper.createAlbum('pz');
} }
userAuth() { userAuth() {
const permissions: Array<Permissions> = ["ohos.permission.READ_IMAGEVIDEO", "ohos.permission.DISTRIBUTED_DATASYNC" ,'ohos.permission.CONNECTIVITY_INTERNAL','ohos.permission.CAMERA','ohos.permission.READ_MEDIA','ohos.permission.WRITE_MEDIA','ohos.permission.FILE_ACCESS_MANAGER']; const permissions: Array<Permissions> = ["ohos.permission.SET_TIME","ohos.permission.READ_IMAGEVIDEO", "ohos.permission.DISTRIBUTED_DATASYNC" ,'ohos.permission.CONNECTIVITY_INTERNAL','ohos.permission.CAMERA','ohos.permission.READ_MEDIA','ohos.permission.WRITE_MEDIA','ohos.permission.FILE_ACCESS_MANAGER'];
let context = this.context; let context = this.context;
let atManager = abilityAccessCtrl.createAtManager(); let atManager = abilityAccessCtrl.createAtManager();
// requestPermissionsFromUser会判断权限的授权状态来决定是否唤起弹窗 // requestPermissionsFromUser会判断权限的授权状态来决定是否唤起弹窗
@ -268,10 +338,7 @@ struct Index {
} }
async initParams() { async initParams() {
this.loading=false this.loading=false
//获取设备信息
this.createAlbum()
await getDeviceInfo() await getDeviceInfo()
//车辆信息
getCarInfo() getCarInfo()
await setCurrentTime(); await setCurrentTime();
this.carNum = globalThis.carInfo.plateNo; this.carNum = globalThis.carInfo.plateNo;
@ -282,6 +349,7 @@ struct Index {
// await this.getModel() // await this.getModel()
// const arr = [0x55, 0xaa, 0x01, 0x00, 0x02, 0x01, 0x03, 0x00] // const arr = [0x55, 0xaa, 0x01, 0x00, 0x02, 0x01, 0x03, 0x00]
// globalThis.udpClientByTopLine.sendMsg(Array2Byte(arr).buffer) // globalThis.udpClientByTopLine.sendMsg(Array2Byte(arr).buffer)
console.info(testNapi)
} }
async getModel() { async getModel() {
const context = this.context; const context = this.context;

View File

@ -9,7 +9,7 @@ import Judge from './judgeSDK/judge'
import {defaultJudgeConfigObj} from './judgeSDK/utils//judge-common' import {defaultJudgeConfigObj} from './judgeSDK/utils//judge-common'
import { import {
Project, ProjectObj, MarkRule, CDSBInfo, Project, ProjectObj, MarkRule, CDSBInfo,
SYSTEMPARMARR,CARINFO ,MAPPOINT ,MAPITEMPOINTITEM SYSTEMPARMARR,CARINFO ,MAPPOINT ,MAPITEMPOINTITEM,SYSSET
} from './judgeSDK/api/judgeSDK.d' } from './judgeSDK/api/judgeSDK.d'
import { getCurrentTime, formatTime, getCurrentHourTime,chunkArr } from '../common/utils/tools' import { getCurrentTime, formatTime, getCurrentHourTime,chunkArr } from '../common/utils/tools'
import { examJudgeEndExam } from './judgeSDK/api/index' import { examJudgeEndExam } from './judgeSDK/api/index'
@ -29,9 +29,7 @@ struct Index {
async aboutToAppear() { async aboutToAppear() {
globalThis.windowClass.setWindowSystemBarEnable(['']) globalThis.windowClass.setWindowSystemBarEnable([''])
const time = await getCurrentTime() const time = await getCurrentTime()
const examSubject = globalThis.carInfo.examSubject
this.examSubject = examSubject
this.startTime = time.split(' ')[1] this.startTime = time.split(' ')[1]
this.startFullTime = await getCurrentTime(1); this.startFullTime = await getCurrentTime(1);
this.startHourTime = await getCurrentHourTime() this.startHourTime = await getCurrentHourTime()
@ -67,9 +65,8 @@ struct Index {
? await this.initSystemKm2Param() ? await this.initSystemKm2Param()
: await this.initSystemKm3Param() : await this.initSystemKm3Param()
await this.initMarkRules(); await this.initMarkRules();
await this.initSysset();
} }
await this.initSysset();
await this.initCDSBInfo() await this.initCDSBInfo()
// 科目三新增读取表数据 // 科目三新增读取表数据
@ -122,7 +119,6 @@ struct Index {
markreal:mark.markreal * 1, markreal:mark.markreal * 1,
markserial:mark.markserial, markserial:mark.markserial,
kfxh:mark.kfxh, kfxh:mark.kfxh,
//TODO 科目三评判新参数
OnlyOneKind:mark.onlyoneid * 1, OnlyOneKind:mark.onlyoneid * 1,
NoCancelId:mark.nocancelid * 1, NoCancelId:mark.nocancelid * 1,
GPS_SID:mark.gps_sid == 0 ? false : true GPS_SID:mark.gps_sid == 0 ? false : true
@ -141,34 +137,44 @@ struct Index {
} }
// 获取sysset表信息 // 获取sysset表信息
async initSysset() { async initSysset(sysset?:SYSSET[]) {
const syssetParams = await getSyncData('MA_SYSSET') const syssetParams = sysset || await getSyncData('MA_SYSSET')
//@ts-ignore //@ts-ignore
const serialNumberArr = syssetParams.filter(sys => sys.v_no === '901'); const serialNumberArr = syssetParams.filter(sys => sys.v_no === '901');
this.serialNumber = (serialNumberArr[0] && serialNumberArr[0].v_value) || '123456' this.serialNumber = (serialNumberArr[0] && serialNumberArr[0].v_value) || '123456'
const {isTrajectoryOpen} = judgeConfig
const judgeConfig = [] const syssetJudgeConfigArr = []
//@ts-ignore //@ts-ignore
syssetParams.forEach((sys) => { syssetParams.forEach((sys) => {
if(isTrajectoryOpen){
sys.v_no = sys.key;
sys.v_name = sys.name;
sys.v_value = sys.value
}
const {v_no,v_value} = sys; const {v_no,v_value} = sys;
const v_no_num = v_no * 1; const v_no_num = v_no * 1;
const value = decodeURIComponent(v_value) const value = decodeURIComponent(v_value)
if(v_no_num >= 10 &&v_no_num <= 900){ if(v_no_num >= 10 &&v_no_num <= 900){
judgeConfig.push({ syssetJudgeConfigArr.push({
key: v_no_num,value: value, key: v_no_num,value: value,
name: decodeURI(sys.v_name) name: decodeURI(sys.v_name)
}) })
} }
//科目三应行驶距离参数
if(sys.v_no == '303'){
this.examMileage = sys.v_value + '';
}
this.judgeConfigObj[sys.v_no] = value this.judgeConfigObj[sys.v_no] = value
}); });
this.judgeConfig = judgeConfig; this.judgeConfig = syssetJudgeConfigArr;
} }
// 初始化systemParam表 // 初始化systemParam表
async initSystemKm2Param(){ async initSystemKm2Param(sysParam?:SYSTEMPARMARR[]){
const systemParms:any = await getSyncData('MA_SYSTEMPARM') const systemParms:any = sysParam || await getSyncData('MA_SYSTEMPARM')
const carName = this.carName; const carName = this.carName;
let carNo2 = '',allItems = []; let carNo2 = '',allItems = [];
@ -217,7 +223,7 @@ struct Index {
//初始化systemParam表 //初始化systemParam表
async initSystemKm3Param(sysParam?:SYSTEMPARMARR[]) { async initSystemKm3Param(sysParam?:SYSTEMPARMARR[]) {
const systemParms: any = sysParam || await getSyncData('MA_SYSTEMPARM') const systemParms: any = sysParam || await getSyncData('MA_SYSTEMPARM')
console.log('systemParms',JSON.stringify(systemParms))
const {isTrajectoryOpen} = judgeConfig const {isTrajectoryOpen} = judgeConfig
systemParms.forEach((systemParm) => { systemParms.forEach((systemParm) => {
@ -232,7 +238,6 @@ struct Index {
} }
const {no1,no2,no3,} = systemParm; const {no1,no2,no3,} = systemParm;
this.systemparmArr.push({ this.systemparmArr.push({
'NO1':no1*1,'NO2':no2*1,'NO3':no3*1, 'NO1':no1*1,'NO2':no2*1,'NO3':no3*1,
'TXT1':decodeURIComponent(systemParm.txt1), 'TXT1':decodeURIComponent(systemParm.txt1),
@ -241,7 +246,6 @@ struct Index {
}) })
const txt2 = decodeURIComponent(systemParm.txt2) const txt2 = decodeURIComponent(systemParm.txt2)
if (no1 == 6) { if (no1 == 6) {
const currentProject = { const currentProject = {
name: decodeURI(systemParm.txt1), name: decodeURI(systemParm.txt1),
@ -253,11 +257,10 @@ struct Index {
this.projectsCenterObj[txt2] = currentProject this.projectsCenterObj[txt2] = currentProject
this.projects.push(currentProject) this.projects.push(currentProject)
} }
if(no1 == 3 && no2 == 1 && no3 == 15){ // if(no1 == 3 && no2 == 1 && no3 == 15){
this.examMileage = decodeURI(systemParm.txt1) // this.examMileage = decodeURI(systemParm.txt1)
} // }
}) })
const projects = this.projects; const projects = this.projects;
if (!projects.length) { if (!projects.length) {
prompt.showToast({ prompt.showToast({
@ -376,19 +379,17 @@ struct Index {
pointItemPoints.forEach(itemPoint => { pointItemPoints.forEach(itemPoint => {
const {point_no,itemno,itemno1,subname} = itemPoint const {point_no,itemno,itemno1,subname} = itemPoint
this.mapPointItemArr.push({ this.mapPointItemArr.push({
point_no:point_no * 1, point_no:point_no * 1,
itemno:itemno * 1, itemno:itemno * 1,
itemno1:itemno1 * 1, itemno1:itemno1 * 1,
subname subname
}) })
}) })
} }
// 初始化本地systemparam表、markrule表 // 初始化本地systemparam表、markrule表
async initTrajectoryParam(trajectoryPath:string){ async initTrajectoryParam(trajectoryPath:string){
const examSubject = globalThis.carInfo.examSubject; const {isTrajectoryOpen} = judgeConfig
//轨迹回放读取 systemparam表、markrule表 //轨迹回放读取 systemparam表、markrule表
const fileUtil = new FileUtil(this.context); const fileUtil = new FileUtil(this.context);
const folderPath = await fileUtil.initFolder(trajectoryPath); const folderPath = await fileUtil.initFolder(trajectoryPath);
@ -396,12 +397,16 @@ struct Index {
const strArr = str.split('\n'); const strArr = str.split('\n');
const [initData,beginData] = [strArr[0],strArr[1]]; const [initData,beginData] = [strArr[0],strArr[1]];
const initDataObj = JSON.parse(initData) const initDataObj = JSON.parse(initData)
const systemparm = initDataObj.systemparm;
const examSubject = globalThis.carInfo.examSubject;
this.examSubject = isTrajectoryOpen ? (initDataObj.kskm*1):examSubject;
globalThis.carInfo.examSubject = this.examSubject
examSubject == 2 examSubject == 2
? await this.initSystemKm2Param() ? await this.initSystemKm2Param(systemparm)
: await this.initSystemKm3Param(initDataObj.systemparm) : await this.initSystemKm3Param(systemparm)
//@ts-ignore //@ts-ignore
await this.initMarkRules(testMarkRules); await this.initMarkRules(testMarkRules);
await this.initSysset(initDataObj.sysset);
} }
@ -620,10 +625,10 @@ struct Index {
Row(){}.width(60).height(60).backgroundImage($rawfile('judge/manual_judge.png'), ImageRepeat.NoRepeat).backgroundImageSize({ width: '100%', height: '100%' }) Row(){}.width(60).height(60).backgroundImage($rawfile('judge/manual_judge.png'), ImageRepeat.NoRepeat).backgroundImageSize({ width: '100%', height: '100%' })
Text('人工评判').fontColor('#FFF').fontSize(32).padding({right:12}) Text('人工评判').fontColor('#FFF').fontSize(32).padding({right:12})
}.width(334).height(110).justifyContent(FlexAlign.Center).alignItems(VerticalAlign.Center) }.width(334).height(110).justifyContent(FlexAlign.Center).alignItems(VerticalAlign.Center)
.backgroundImage($rawfile('judge/button_nor.png'), ImageRepeat.NoRepeat) .backgroundImage($rawfile('judge/button_nor.png'), ImageRepeat.NoRepeat)
.backgroundImageSize({ width: '100%', height: '100%' }) .backgroundImageSize({ width: '100%', height: '100%' })
.margin({bottom:10}) .margin({bottom:10})
.onClick(()=>{ .onClick(()=>{
if(this.judgeConfigObj['342'] == 0){ if(this.judgeConfigObj['342'] == 0){
this.isDeductedPopShow = true this.isDeductedPopShow = true
}else{ }else{
@ -778,7 +783,7 @@ struct Index {
const unExitManualProjects = judgeConfigObj['332'].split(',') || []; const unExitManualProjects = judgeConfigObj['332'].split(',') || [];
const param348 = judgeConfigObj['348'] || '0'; const param348 = judgeConfigObj['348'] || '0';
const param387 = judgeConfigObj['348'] || '0'; const param387 = judgeConfigObj['387'] || '0';
if(judgeConfigObj['342'] === '3' || judgeConfigObj['342'] === '2'){ if(judgeConfigObj['342'] === '3' || judgeConfigObj['342'] === '2'){
return false return false
@ -818,7 +823,7 @@ struct Index {
@State startFullTime: string = '' @State startFullTime: string = ''
@State startHourTime: string = '' @State startHourTime: string = ''
//科目类型 //科目类型
@State examSubject: 2 | 3 = 2; @State examSubject: 2 | 3 = 3;
@State ddxkTime: number = 0; @State ddxkTime: number = 0;
@State ddxkKsxmArr: string[] = [''] @State ddxkKsxmArr: string[] = ['']
@State ddxkKfArr: string[] = [''] @State ddxkKfArr: string[] = ['']

View File

@ -20,17 +20,23 @@ export default struct Index {
onPageShow() { onPageShow() {
// this.plateNo=globalThis.carInfo.plateNo // this.plateNo=globalThis.carInfo.plateNo
deviceManager.createDeviceManager('com.oh.dts', (error, value) => { console.log('createDeviceManagerstart')
if (error) { try{
console.error('createDeviceManager failed.'); deviceManager.createDeviceManager('com.oh.dts', (error, value) => {
return; if (error) {
} console.error('createDeviceManager failed.');
let dvMgrObj = value; return;
this.deviceName = dvMgrObj.getLocalDeviceInfoSync().deviceName }
this.deviceNo = dvMgrObj.getLocalDeviceInfoSync().deviceId.substring(0, 10).toUpperCase() let dvMgrObj = value;
this.ip = 'MAC-' + this.deviceNo this.deviceName = dvMgrObj.getLocalDeviceInfoSync().deviceName
globalThis.deviceNo = 'MAC-' + this.deviceNo this.deviceNo = dvMgrObj.getLocalDeviceInfoSync().deviceId.substring(0, 10).toUpperCase()
}); this.ip = 'MAC-' + this.deviceNo
globalThis.deviceNo = 'MAC-' + this.deviceNo
});
}catch (error){
console.log('createDeviceManagererror',error)
}
} }
build() { build() {

View File

@ -19,7 +19,7 @@ struct Index {
// @State inputTextList2: string[] = ['192.168.7.124','20022'] // @State inputTextList2: string[] = ['192.168.7.124','20022']
@State inputTextList1: string[] = ['112.80.35.83','11055','112.80.35.83','11052','255.255.255.0','192.168.7.1','114.114.114.114','192.168.7.124','20022','192.168.7.170','20122','112.80.35.83','11050'] @State inputTextList1: string[] = ['172.37.55.191','18782','172.37.55.191','8082','255.255.255.0','192.168.7.1','114.114.114.114','192.168.7.124','20022','192.168.7.170','20122','172.37.55.191','11050']
// @State inputTextList2: string[] = [] // @State inputTextList2: string[] = []
// 112.80.35.83 11052 // 112.80.35.83 11052
// @State inputTextList1: string[] = ['192.168.36.2','8084','192.168.36.200','20122','255.255.255.0','192.168.36.1','','','114.114.114.114','192.168.36.139','8000'] // @State inputTextList1: string[] = ['192.168.36.2','8084','192.168.36.200','20122','255.255.255.0','192.168.36.1','','','114.114.114.114','192.168.36.139','8000']
@ -88,7 +88,7 @@ struct Index {
gateway: this.inputTextList1[5],//value.gateway网关 gateway: this.inputTextList1[5],//value.gateway网关
netMask: this.inputTextList1[4],//value.netMask网络掩码 netMask: this.inputTextList1[4],//value.netMask网络掩码
dnsServers: this.inputTextList1[6], dnsServers: this.inputTextList1[6],
// domain: "" domain: ""
}, (error) => { }, (error) => {
if (error) { if (error) {
prompt.showToast({ prompt.showToast({

View File

@ -19,7 +19,7 @@ import {string2Bytes} from '../common/utils/tools'
import { getSyncData } from '../common/service/initable' import { getSyncData } from '../common/service/initable'
@Entry @Entry
@Component @Component
export default struct UserInfo { struct UserInfo {
@State pageIndex: number = 0 @State pageIndex: number = 0
@State ratio: number = 1700 / 960 @State ratio: number = 1700 / 960
@State index: number = 0 @State index: number = 0
@ -182,7 +182,6 @@ export default struct UserInfo {
changeQkfn() { changeQkfn() {
this.qkFn() this.qkFn()
} }
//初始化数据
initData(){ initData(){
this.stepFlag = false this.stepFlag = false
this.faceCompareSucess = 0 this.faceCompareSucess = 0
@ -238,6 +237,7 @@ export default struct UserInfo {
} }
async initSysset() { async initSysset() {
const that = this; const that = this;
const db = new AccountTable(() => { const db = new AccountTable(() => {
@ -276,7 +276,7 @@ export default struct UserInfo {
that.getExaminationStudentInfoFn() that.getExaminationStudentInfoFn()
} }
}, 5000) }, 5000)
} else { }else{
this.getExaminationItemFn() this.getExaminationItemFn()
} }
@ -287,7 +287,7 @@ export default struct UserInfo {
changeFaceCompareSuccess() { changeFaceCompareSuccess() {
console.log('this.faceCompareSuces', this.faceCompareSucess, JSON.stringify(this.currentUser)) console.log('this.faceCompareSuces', this.faceCompareSucess, JSON.stringify(this.currentUser))
if (this.faceCompareSucess > 0) { if (this.faceCompareSucess > 0) {
//人脸比对通过 //人脸比对通过
this.sfbdinterfaceFn() this.sfbdinterfaceFn()
} }
} }
@ -360,7 +360,6 @@ export default struct UserInfo {
console.log('error12error' + error) console.log('error12error' + error)
}) })
} }
//缺考
qkFn() { qkFn() {
this.faceCompareSucess = 0 this.faceCompareSucess = 0
if (globalThis.singlePlay) { if (globalThis.singlePlay) {
@ -397,7 +396,6 @@ export default struct UserInfo {
}) })
} }
// 获取考试项目
async getExaminationItemFn(){ async getExaminationItemFn(){
console.info('surenjun', this.currentUser.lsh) console.info('surenjun', this.currentUser.lsh)
if(!this.currentUser.lsh||globalThis.singlePlay){ if(!this.currentUser.lsh||globalThis.singlePlay){
@ -411,10 +409,10 @@ export default struct UserInfo {
lsh: this.currentUser.lsh || '', lsh: this.currentUser.lsh || '',
examinationRoomId examinationRoomId
}); });
if (examItems?.getExaminationItemRsp?.body?.kssycs != 0) { if(examItems?.getExaminationItemRsp?.body?.kssycs!=0){
this.getExaminationStudentInfoFn() this.getExaminationStudentInfoFn()
} else { }else{
this.dataList = [] this.dataList=[]
this.currentUser = EmptyCandidateObject this.currentUser = EmptyCandidateObject
} }
@ -771,7 +769,7 @@ struct LabelBlock {
Row() { Row() {
Text(this.label).fontSize(16 * this.ratio).fontColor('#99948A') Text(this.label).fontSize(16 * this.ratio).fontColor('#99948A')
Row() { Row() {
Text(this.value).fontColor('#fff').textAlign(TextAlign.Center).width('100%') Text(decodeURIComponent(this.value)).fontColor('#fff').textAlign(TextAlign.Center).width('100%')
} }
.commLabelStyle() .commLabelStyle()
}.margin({ bottom: 10 * this.ratio }) }.margin({ bottom: 10 * this.ratio })

View File

@ -138,7 +138,7 @@ export default struct SignDisplayCom {
Row() { Row() {
if(this.showBack){ if(this.showBack){
Image($r('app.media.topB_back')).width('16.7%').height('12.2%') Image($r('app.media.topB_back')).height('12.2%')
.onClick(() => { .onClick(() => {
router.back() router.back()
// this.url='back' // this.url='back'

View File

@ -66,6 +66,14 @@ export interface VideoConfig{
spzd1:boolean, spzd1:boolean,
zdyz:string, zdyz:string,
} }
export interface initTableParam{
carId:string,
examinationRoomId:string,
judgeVersion:string,
shellVersion:string,
paraKdid:string,
mode: string
}

View File

@ -140,6 +140,11 @@ export interface SOUND {
//语音播放提示代码 //语音播放提示代码
code:string code:string
} }
export interface SYSSET {
v_no:string,
v_name:string,
v_value:string
}
export interface ProjectObj { export interface ProjectObj {
[k:any]:Project [k:any]:Project

View File

@ -20,7 +20,7 @@ import {writeObjectOut,uploadExamProgressData} from '../../api/judge'
import {deepClone,getCurrentTime,stringToASC,string2Bytes,fillZero,Array2Byte,convertGpsCoord2} from '../../common/utils/tools' import {deepClone,getCurrentTime,stringToASC,string2Bytes,fillZero,Array2Byte,convertGpsCoord2} from '../../common/utils/tools'
import {getTranslateSignals,getCarStatus,getCarStatusType,getCenterProjectStatus,plcStrToJson,plcStrToWXJson,promptWxCode,getKmProjectVoice} from './utils//judge-common' import {getTranslateSignals,getCarStatus,getCarStatusType,getCenterProjectStatus,plcStrToJson,plcStrToWXJson,promptWxCode,getKmProjectVoice} from './utils//judge-common'
import {examJudgeSetLogCallback,examJudgeBeginExam,examJudgeInit,examJudgeRealExam,examJudgeSetRealExamCallback,examJudgeSetPerformCallback,examJudgeEndExam,examJudgeArtificialMark,examJudgeArtificialItem} from './api/index' import {examJudgeSetLogCallback,examJudgeBeginExam,examJudgeInit,examJudgeRealExam,examJudgeSetRealExamCallback,examJudgeSetPerformCallback,examJudgeEndExam,examJudgeArtificialMark,examJudgeArtificialItem} from './api/index'
import Want from '@ohos.app.ability.Want';
import prompt from '@ohos.prompt'; import prompt from '@ohos.prompt';
const judgeTag = 'SURENJUN_JUDGE' const judgeTag = 'SURENJUN_JUDGE'
@ -129,6 +129,7 @@ export default class Judge{
await examJudgeBeginExam(beginExamInfo); await examJudgeBeginExam(beginExamInfo);
console.info(judgeTag,'6.开始考试注册完成') console.info(judgeTag,'6.开始考试注册完成')
avPlayer.playAudio(['voice/ksks.WAV'])
// 处理轨迹plc信息 // 处理轨迹plc信息
if(isTrajectoryOpen){ if(isTrajectoryOpen){
handleTrajectoryUdp(strArr); handleTrajectoryUdp(strArr);
@ -139,7 +140,7 @@ export default class Judge{
globalThis.udpClient.onMessage(async (msg) => { globalThis.udpClient.onMessage(async (msg) => {
handleUdp(msg) handleUdp(msg)
}) })
avPlayer.playAudio(['voice/ksks.WAV'])
} }
@ -706,8 +707,11 @@ export default class Judge{
// 消息心跳发送 // 消息心跳发送
getMessageHeartbeat = async (isEnd?:Boolean) => { getMessageHeartbeat = async (isEnd?:Boolean) => {
console.log('kkkkkkmmm')
const carInfo = globalThis.carInfo; const carInfo = globalThis.carInfo;
const { examSubject,plateNo,ksyh } = carInfo; const { examSubject,plateNo,ksyh } = carInfo;
// const ksyh='0000000000000'
// const ksyh=globalThis.ksyh ||'0000000000000'
const {judgeUI,isExam,serialIndex,tempData,xmmcCode,xmxh,xmmcSingleCode,xmdm,performInfo,kfArr,getTranslateProject,getSbxh} = this; const {judgeUI,isExam,serialIndex,tempData,xmmcCode,xmxh,xmmcSingleCode,xmdm,performInfo,kfArr,getTranslateProject,getSbxh} = this;
const {lsh,startHourTime,totalScore} = judgeUI; const {lsh,startHourTime,totalScore} = judgeUI;
const examType = isExam?examSubject:0; const examType = isExam?examSubject:0;
@ -716,25 +720,36 @@ export default class Judge{
const {jd,wd, hxj, fyj, hbg,} = gps const {jd,wd, hxj, fyj, hbg,} = gps
const translateProject = getTranslateProject(); const translateProject = getTranslateProject();
const sbxh = getSbxh(xmdm,xmxh) const sbxh = getSbxh(xmdm,xmxh)
console.log('sbxhsbxh',sbxh)
const {carzt,dcjl,qjjl,dxjl,bxjl} = performInfo; const {carzt,dcjl,qjjl,dxjl,bxjl} = performInfo;
console.log('performInfo',JSON.stringify(performInfo))
// const asclshArr = stringToASC(lsh);
const asclshArr = stringToASC(fillZero('0000000000000' || 0, 13));
const asclshArr = stringToASC(lsh);
//13不足要补0 //13不足要补0
const ascksyhArr = stringToASC(fillZero(ksyh || 0,13)) const ascksyhArr = stringToASC(fillZero(ksyh || 0,13))
const ascsbxhArr = stringToASC(sbxh) const ascsbxhArr = stringToASC(sbxh)
const translateSignals = getTranslateSignals( const translateSignals = getTranslateSignals(
[zfxd, yfxd, shtd, ygd, jgd, skd, dh1, dh2, lhq, jsc,ssc,fsc, lb, mkg, aqd, 0,0,0,0 ].concat(getCarStatusType(carzt)).concat([ ygq, sensor.wd, 0 ]) [zfxd, yfxd, shtd, ygd, jgd, skd, dh1, dh2, lhq, jsc,ssc,fsc, lb, mkg, aqd, 0,0,0,0 ].concat(getCarStatusType(carzt)).concat([ ygq, sensor.wd, 0 ])
) )
console.log('jinweidu111jdwd0')
//@ts-ignore //@ts-ignore
const translateJd = convertGpsCoord2(wd).toFixed(7) * Math.pow(10,7) const translateJd = convertGpsCoord2(wd).toFixed(7) * Math.pow(10,7);
//@ts-ignore //@ts-ignore
const translateWd = convertGpsCoord2(jd).toFixed(7) * Math.pow(10,7) const translateWd = convertGpsCoord2(jd).toFixed(7) * Math.pow(10, 7)
console.log('jinweidu111jdwd')
//@ts-ignore //@ts-ignore
const translateProjects= translateProject.map(num => string2Bytes(num,8)[0]) const translateProjects = translateProject.map(numStr => string2Bytes(parseInt(numStr, 2), 8)[0])
//@ts-ignore
// const translateProjects= translateProject.map(num => string2Bytes(p,8)[0])
console.log('jinweidu2222',`${examType}${startHourTime}`)
const arr = [ const arr = [
//考生号 TODO 考试员号 //考生号 TODO 考试员号
asclshArr.map(lsh => string2Bytes(lsh,8)[0]), ascksyhArr.map(ksyh => string2Bytes(ksyh,8)[0]), asclshArr.map(lsh => string2Bytes(lsh,8)[0]),
//考试员号
ascksyhArr.map(ksyh => string2Bytes(ksyh,8)[0]),
//科目类型(0:未考试 1:科目二 2:科目三) + 考试开始时间 //科目类型(0:未考试 1:科目二 2:科目三) + 考试开始时间
string2Bytes(`${examType}${startHourTime}`,4 * 8), string2Bytes(`${examType}${startHourTime}`,4 * 8),
// TODO 消息序号从1开始0结束 // TODO 消息序号从1开始0结束
@ -760,16 +775,20 @@ export default class Judge{
string2Bytes(Math.floor((dcjl + qjjl)/100),2*8), string2Bytes(Math.floor((dcjl + qjjl)/100),2*8),
//扣分 //扣分
string2Bytes(100 - Math.abs(totalScore),2*8), string2Bytes(100 - Math.abs(totalScore),2*8),
//扣分数
//todo扣分值/扣分项
string2Bytes(0, 2 * 8),
//扣分项数量 //扣分项数量
string2Bytes(kfArr.length,8), string2Bytes(kfArr.length,8),
//n个扣分序号 //n个扣分序号
kfArr.map(kf => string2Bytes(kf.kfxh,8)[0]) kfArr.map(kf => string2Bytes(kf.kfxh,8)[0])
] ]
let tempArr = []; let tempArr = [];
arr.forEach(itemArr =>{ tempArr = tempArr.concat(itemArr)}) arr.forEach(itemArr =>{ tempArr = tempArr.concat(itemArr)})
this.serialIndex += 1; this.serialIndex += 1;
console.log('kmkmkm2',tempArr.length)
return Array2Byte(tempArr) return Array2Byte(tempArr)
} }
@ -797,7 +816,7 @@ export default class Judge{
sfyk:0, sfyk:0,
ykkkcs:1, ykkkcs:1,
//TODO 考试路线待修改 //TODO 考试路线待修改
wayno:1, wayno:3,
czlx:0, czlx:0,
kskssj:await systemTime.getCurrentTime(), kskssj:await systemTime.getCurrentTime(),
ksxm:projects.map(project=>{ ksxm:projects.map(project=>{
@ -858,12 +877,12 @@ export default class Judge{
const {cdsbInfoObj,projectsObj} = judgeUI; const {cdsbInfoObj,projectsObj} = judgeUI;
const project = projectsObj[ksxm] const project = projectsObj[ksxm]
if(project === undefined){ if(project === undefined){
return '0000000000' return '00000000'
} }
const projectType = project.sbxh; const projectType = project.sbxh;
const projectKey = `${ksxm}_${xmxh}`; const projectKey = `${ksxm}_${xmxh}`;
const currentCdsb = cdsbInfoObj[projectKey] || {}; const currentCdsb = cdsbInfoObj[projectKey] || {};
const sbxh = currentCdsb.sbbh || '0000000000' const sbxh = currentCdsb.sbbh || '00000000'
return sbxh return sbxh
} }
@ -882,18 +901,18 @@ export default class Judge{
// 中心所有项目转换 // 中心所有项目转换
getTranslateProject = () => { getTranslateProject = () => {
const {testKmItems} = this; // const {testKmItems} = this;
const tempItems = testKmItems.map(item=>{ const tempItems = testKmItems.map(item=>{
const current = testKmItems[item.code]; const current = this.testKmItems[item.code];
return { return {
code:item.code, code:item.code,
status:getCenterProjectStatus(current.status) status:getCenterProjectStatus(current.status)
} }
}) })
const len = Math.floor(tempItems.length / 4); const len = Math.floor(tempItems.length / 8);
const arr = []; const arr = [];
for(let i = 0;i <= len;i++){ for(let i = 0;i <= len;i++){
const temp = tempItems.slice( i*4 , (i+1)*4 ); const temp = tempItems.slice( i*8 , (i+1)*8 );
let tempArr = temp.map(item => item.status) let tempArr = temp.map(item => item.status)
if(i === 4){ if(i === 4){
tempArr = tempArr.concat(['00','00']) tempArr = tempArr.concat(['00','00'])

View File

@ -8,7 +8,8 @@ export const judgeConfig = {
udpOpen:false, udpOpen:false,
// 本地模型地址 // 本地模型地址
modelPath: 'models/model_enc', modelPath: 'models/model_enc',
trajectoryPath: 'logs/2024_05_14/0000000000001_342323199501470011_测试学员1_2024_05_14_11_28_31/judge_exam_data.txt' // 轨迹回放地址
trajectoryPath: 'logs/2024_06_18/0000000000001_342323199501470011_测试学员1_2024_06_18_14_32_25/judge_exam_data.txt'
} }
//0000000000001_342323199501470011_测试学员1_2024_04_28_10_59_44 //0000000000001_342323199501470011_测试学员1_2024_04_28_10_59_44
@ -17,7 +18,6 @@ export const judgeConfig = {
// 济南轨迹回放 // 济南轨迹回放
// test_sub3_car_test_jinan-32038219990808021X-20240322173643.txt // test_sub3_car_test_jinan-32038219990808021X-20240322173643.txt
// test_sub3_car_test_jinan-32038219990808021X-20240322173643.track // test_sub3_car_test_jinan-32038219990808021X-20240322173643.track
// 2024_01_24_11_30_06_2210707689316_620502199005070478_马鸣五 // 2024_01_24_11_30_06_2210707689316_620502199005070478_马鸣五
// 2024_01_24_10_25_41_2231212226990_330184200208281821_金晓婷 // 2024_01_24_10_25_41_2231212226990_330184200208281821_金晓婷

View File

@ -1,4 +1,5 @@
import media from '@ohos.multimedia.media'; import media from '@ohos.multimedia.media';
import prompt from '@ohos.prompt';
const TAG = 'VoiceAnnounce' const TAG = 'VoiceAnnounce'
@ -18,7 +19,6 @@ export default class VoiceAnnounce{
async playAudio(urls:string[],shit,callback:Function){ async playAudio(urls:string[],shit,callback:Function){
const {isStopped,queue} = this; const {isStopped,queue} = this;
this.callback = callback this.callback = callback
console.info('surenjun',JSON.stringify(callback))
if(shit){ if(shit){
//队列清空,重新初始化 //队列清空,重新初始化
this.isStopped = true; this.isStopped = true;
@ -45,6 +45,7 @@ export default class VoiceAnnounce{
await go() await go()
return return
} }
await avPlayer.play(queue[0],callback); await avPlayer.play(queue[0],callback);
this.queue.shift(); this.queue.shift();
console.info(TAG,JSON.stringify(this.queue),'堆栈弹出'); console.info(TAG,JSON.stringify(this.queue),'堆栈弹出');
@ -73,14 +74,22 @@ class AVPlayer {
this.endCallback = callback this.endCallback = callback
const avPlayer = await media.createAVPlayer(); const avPlayer = await media.createAVPlayer();
this.avPlayer = avPlayer; this.avPlayer = avPlayer;
return new Promise(async (resolve)=>{ return new Promise(async (resolve,reject) => {
let url = ''
await this.setAVPlayerCallback(()=>{ await this.setAVPlayerCallback(()=>{
//@ts-ignore //@ts-ignore
resolve() resolve()
}); });
let url = await globalThis.context.resourceManager.getRawFd(name) try {
this.avPlayer.fdSrc = url; url = await globalThis.context.resourceManager.getRawFd(name);
this.avPlayer.fdSrc = url;
} catch (e) {
prompt.showToast({
message: `${name}语音文件不存在`,
duration: 4000
});
resolve(1)
}
}) })
} }
//音频播放队列 //音频播放队列

View File

@ -1,55 +1,56 @@
// import AccountTable from '../common/database/tables/AccountTable'; /*
// import worker from '@ohos.worker'; * Copyright (c) 2023 Huawei Device Co., Ltd.
// import { getDataBaseTable, upDateTable, getMySystemSetTable,getSyncData } from '../common/service/initable' * Licensed under the Apache License, Version 2.0 (the "License");
// import MA_SYSSET from '../common/constants/MA_SYSSET'; * you may not use this file except in compliance with the License.
// * You may obtain a copy of the License at
// *
// async function upDateTableFn(data) { * http://www.apache.org/licenses/LICENSE-2.0
// *
// // let flag * Unless required by applicable law or agreed to in writing, software
// await upDateTable({ tableName: 'MA_MARKRULE' },) * distributed under the License is distributed on an "AS IS" BASIS,
// await upDateTable({ tableName: 'MA_SYSTEMPARM' },) * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// * See the License for the specific language governing permissions and
// await upDateTable({ tableName: 'MA_MAP_COLLECT' },data) * limitations under the License.
// */
// await upDateTable({ tableName: 'MA_MAP_COLLECT_SHAPE' },data)
// await upDateTable({ tableName: 'MA_MAP_ITEMCLASS' },data) import worker, { MessageEvents } from '@ohos.worker';
// import zlib from '@ohos.zlib';
// await upDateTable({ tableName: 'MA_MAP_POINT' },data) import request from '@ohos.request';
// import type common from '@ohos.app.ability.common';
// await upDateTable({ tableName: 'MA_MAP_POINT_ITEM' },data) import ConvertXML from '@ohos.convertxml';
// import xml from '@ohos.xml';
// await upDateTable({ tableName: 'MA_MAP_ROAD' },data) import hilog from '@ohos.hilog';
// await upDateTable({ tableName: 'MA_MAP_ROAD_LANE' },data) import { getDoubleCeneterTable, getSingleCenterTable } from '../common/service/indexService';
// await upDateTable({ tableName: 'MA_MAP_SUBITEM' },data) import { initTableParam } from '../pages/interfaces';
// await upDateTable({ tableName: 'ES_CARINFO' },data)
// await upDateTable({ tableName: 'ES_EXAMPOINTDETAIL' },data) let workerPort = worker.workerPort;
// await upDateTable({ tableName: 'MA_MARKRULESET' },data)
// await upDateTable({ tableName: 'ES_CAR_VIDEO_PARAMETER' },data) workerPort.onmessage = (e: MessageEvents): void => {
// await upDateTable({ tableName: 'MA_CDSBINFO' },data) let param:initTableParam = e.data;
// await upDateTable({ tableName: 'MA_ITEMINFO' },data) console.log('baoyihu,onmessage',JSON.stringify(param))
// await upDateTable({ tableName: 'MA_T_CARPARMSET' },data) if(param.mode=='1'){
// workerPort.postMessage("receive data from main.js"); //单中心
// getSingleCenterTable(param).then((ret) => {
// if (ret) {
// } workerPort.postMessage({ isComplete: true });
// const workerPort = worker.workerPort; }else{
// workerPort.onmessage = function(e){ workerPort.postMessage({ isComplete: false });
// let data = e }
// console.log('e.data',e.data) })
// upDateTableFn(e.data); }else if(param.mode=='3'){
// } //双中心
// //console.log('1111111111') getDoubleCeneterTable(param).then((ret)=>{
// //accountTable.getRdbStore(() => { if (ret) {
// // accountTable.query(0, (result) => { workerPort.postMessage({ isComplete: true });
// //// this.accounts = result; }
// // }, true); })
// //}); }
// //parentPort.onmessage = function(e){
// // accountTable.insertData({ id: 0, accountType: 0, typeText: '', amount: 0 }, (id) => { // worker线程向主线程发送信息
// // parentPort.postMessage("receive data from main.js") //let context: common.UIAbilityContext = e.data.context;
// //// newAccount.id = id;
// //// this.accounts.push(newAccount);
// // });
// // // workerPort.postMessage({ isComplete: true, jsonStr: result });
// //}
};