Compare commits
10 Commits
48540ef01b
...
2a78525e42
| Author | SHA1 | Date | |
|---|---|---|---|
| 2a78525e42 | |||
| 1d14f2bf7d | |||
| 7c60a89f96 | |||
| 71ee2a79cb | |||
| ffe80d9d8f | |||
| 0a2e8e2dc9 | |||
| b3087769a1 | |||
| 26a787401d | |||
| d0e8ab90d0 | |||
| 908c579591 |
@ -83,8 +83,10 @@ function sqlInsertCommonFn(tableName, resultArr, context?, delFlag = true) {
|
||||
}, map[tableName], context);
|
||||
accountTable.getRdbStore(() => {
|
||||
accountTable.query('0', async (result) => {
|
||||
console.log('sqlsqlinsertresult',JSON.stringify(result))
|
||||
// console.log('表长度',result.length,tableName)
|
||||
if (result.length == 0) {
|
||||
console.log('sqlsqlinsert00000')
|
||||
let INSERT_SQL = "INSERT INTO " + tableName
|
||||
+ " (" + map[tableName].ACCOUNT_TABLE.columns.toString() + ") VALUES "
|
||||
|
||||
@ -105,6 +107,7 @@ function sqlInsertCommonFn(tableName, resultArr, context?, delFlag = true) {
|
||||
}
|
||||
INSERT_SQL += str
|
||||
})
|
||||
console.log('sqlsqlinsertINSERT_SQLINSERT_SQL', INSERT_SQL)
|
||||
accountTable.sqlOperate(INSERT_SQL, tableName, (val) => {
|
||||
console.log('sqlsqlinsert,', val, 'tableName', tableName)
|
||||
resolve(val)
|
||||
@ -113,6 +116,9 @@ function sqlInsertCommonFn(tableName, resultArr, context?, delFlag = true) {
|
||||
else {
|
||||
if (delFlag) {
|
||||
await delSyncTable(tableName, context)
|
||||
const result = await sqlInsertCommonFn(tableName, resultArr, context)
|
||||
resolve(result)
|
||||
return
|
||||
}
|
||||
const result = await sqlInsertCommonFn(tableName, resultArr, context)
|
||||
resolve(result)
|
||||
@ -159,7 +165,11 @@ export async function getDataBaseTable(params, reqParam) {
|
||||
|
||||
//依据数组和表名更新sql表
|
||||
export async function upDateTableByArray(tableName, arr) {
|
||||
sqlInsertCommonFn(tableName, arr)
|
||||
return new Promise(async (reslove,reject)=>{
|
||||
const data =await sqlInsertCommonFn(tableName, arr)
|
||||
console.log('sqlsqlinsertsqlsqlinsertkkk',data)
|
||||
reslove(data)
|
||||
})
|
||||
}
|
||||
|
||||
//更新双中心表
|
||||
|
||||
@ -23,11 +23,13 @@ import VoiceAnnounce from './judgeSDK/utils/voiceAnnouncements';
|
||||
import { JudgeConfig } from '../config/judge';
|
||||
import { judgeConfig } from './judgeSDK/utils/judgeConfig';
|
||||
|
||||
|
||||
@Entry
|
||||
@Component
|
||||
struct UserInfo {
|
||||
private filePhoto: FilePhoto
|
||||
private avPlayer
|
||||
|
||||
@State pageIndex: number = 0
|
||||
@State ratio: number = 1700 / 960
|
||||
@State index: number = 0
|
||||
@ -47,7 +49,7 @@ struct UserInfo {
|
||||
@State isFirstBoardPrePareSetPopupBtnShow: boolean = false
|
||||
@State isBoardPrePareSetPopupShow: boolean = false
|
||||
@State isLoadingPopupVisible:boolean = false;
|
||||
@State loadingText:string = '正在生成考试记录,请稍后...'
|
||||
@State loadingText:string = '正在认证监管信息,请稍后...'
|
||||
@State sczbkf:{xmdm:number,kfdm:string}[] = []
|
||||
@State currentUser: User = EmptyCandidateObject
|
||||
@State dataList: Array<User> = []
|
||||
@ -85,10 +87,7 @@ struct UserInfo {
|
||||
return photoBase64
|
||||
}
|
||||
}
|
||||
private filePhoto: FilePhoto
|
||||
private avPlayer
|
||||
private AccountTable = new AccountTable(() => {
|
||||
}, USER);
|
||||
private AccountTable = new AccountTable(() => {}, USER);
|
||||
private context = getContext(this) as common.UIAbilityContext;
|
||||
private labelBlocks = [
|
||||
{ label: '考生姓名', key: 'xm' },
|
||||
@ -513,16 +512,21 @@ struct UserInfo {
|
||||
});
|
||||
}
|
||||
this.currentUser.id = '1'
|
||||
//是否已经开始考试
|
||||
// if(!this.isExamStart){
|
||||
const avPlayer = this.avPlayer;
|
||||
this.isLoadingPopupVisible = true
|
||||
avPlayer.playAudio([`voice/监管通信中.mp3`],false,async ()=>{
|
||||
const code = await this.beginExam();
|
||||
if (code != 1) {
|
||||
promptAction.showToast({
|
||||
message:'开始考试接口调用失败!',
|
||||
duration:4000
|
||||
})
|
||||
return
|
||||
}
|
||||
// }
|
||||
await upDateTableByArray('USER', [this.currentUser])
|
||||
globalThis.statue = 4
|
||||
this.stepFlag = false
|
||||
this.isLoadingPopupVisible = false
|
||||
router.pushUrl({
|
||||
url: 'pages/Judge',
|
||||
params: {
|
||||
@ -533,42 +537,39 @@ struct UserInfo {
|
||||
}, router.RouterMode.Single);
|
||||
this.stopDeviceById()
|
||||
this.stepFlag = false
|
||||
})
|
||||
}
|
||||
|
||||
// 检测车门、熄火信号
|
||||
async checkSignal(): Promise<boolean> {
|
||||
const {isCheckFireOpen} = judgeConfig
|
||||
return new Promise((resolve, reject) => {
|
||||
if (isCheckFireOpen) {
|
||||
return new Promise((resolve,reject)=>{
|
||||
if(isCheckFireOpen){
|
||||
resolve(true)
|
||||
// return
|
||||
}
|
||||
globalThis.udpClient.onMessage_1(async (msg) => {
|
||||
const msgArr = msg.split(',')
|
||||
console.info('socketTag[PLC.UdpClient]', '注册udp回调')
|
||||
let plcValue = globalThis.udpClient.getCurrentMessage();
|
||||
console.info('surenjun',plcValue)
|
||||
const msgArr = plcValue.split(',') || ''
|
||||
const mkg = msgArr[14];
|
||||
const fdjzs = msgArr[25];
|
||||
globalThis.udpClient.onMessage_1(() => {
|
||||
});
|
||||
//TODO
|
||||
console.info('surenjun mkg=>', mkg)
|
||||
console.info('surenjun fdjzs=>', fdjzs)
|
||||
if (mkg == 1) {
|
||||
if(mkg == 1){
|
||||
this.avPlayer.playAudio(['voice/关门.mp3'])
|
||||
promptAction.showToast({
|
||||
message: '请关闭车门',
|
||||
duration: 4000
|
||||
message:'请关闭车门',
|
||||
duration:4000
|
||||
})
|
||||
reject(false)
|
||||
}
|
||||
if (fdjzs * 1 > 0) {
|
||||
if(fdjzs*1 > 0){
|
||||
this.avPlayer.playAudio(['voice/熄火.mp3'])
|
||||
promptAction.showToast({
|
||||
message: '请熄火',
|
||||
duration: 4000
|
||||
message:'请熄火',
|
||||
duration:4000
|
||||
})
|
||||
reject(false)
|
||||
}
|
||||
resolve(true)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
@ -838,16 +839,7 @@ struct UserInfo {
|
||||
BoardPrePareSetPopup({
|
||||
closePopup: (bool) => {
|
||||
this.isBoardPrePareSetPopupShow = false;
|
||||
// if(!globalThis.singlePlay){
|
||||
// this.isFirstBoardPrePareSetPopupBtnShow = !bool;
|
||||
// }
|
||||
},
|
||||
// endLoading:()=>{
|
||||
// this.isLoadingPopupVisible = false;
|
||||
// this.faceCompareSucess = 0
|
||||
// this.numCount = 0
|
||||
// this.getExaminationStudentInfoFn()
|
||||
// },
|
||||
confirmMark: (kfdm) => {
|
||||
this.sczbkf = kfdm
|
||||
}
|
||||
@ -855,12 +847,11 @@ struct UserInfo {
|
||||
}
|
||||
|
||||
// loading
|
||||
// if(this.isLoadingPopupVisible){
|
||||
// LoadingPopup({
|
||||
// title: this.loadingText,
|
||||
// })
|
||||
// }
|
||||
|
||||
if(this.isLoadingPopupVisible){
|
||||
LoadingPopup({
|
||||
title: this.loadingText,
|
||||
})
|
||||
}
|
||||
}
|
||||
.height('100%')
|
||||
.width('100%')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user