From efaad0e449f9148933c7056b7fcda6af4612ee7d Mon Sep 17 00:00:00 2001 From: wangzhongjie Date: Tue, 5 Nov 2024 09:47:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/{src/main/ets => }/.DS_Store | Bin 6148 -> 6148 bytes entry/src/{main/ets/pages => }/.DS_Store | Bin 6148 -> 6148 bytes entry/src/main/.DS_Store | Bin 0 -> 6148 bytes entry/src/main/ets/common/service/initable.ts | 10 +++--- entry/src/main/ets/common/utils/GlobalTcp.ts | 8 ++--- entry/src/main/ets/pages/Index.ets | 1 - .../ets/pages/compontents/SignDisplayCom.ets | 29 ++++++++++++++---- 7 files changed, 32 insertions(+), 16 deletions(-) rename entry/{src/main/ets => }/.DS_Store (88%) rename entry/src/{main/ets/pages => }/.DS_Store (82%) create mode 100644 entry/src/main/.DS_Store diff --git a/entry/src/main/ets/.DS_Store b/entry/.DS_Store similarity index 88% rename from entry/src/main/ets/.DS_Store rename to entry/.DS_Store index 3ce9dd10aa59164d02db1068318f7fba98b7bd17..d79217fd7c275a522689bf6fbcb784355b946a9c 100644 GIT binary patch delta 300 zcmZoMXfc=|#>B`mu~2NHo}wrd0|Nsi1A_oVaY0f}eiD$kBdK8G#^sX@L|E#X8HyQ- z7?P99ktK67i%Sd)t}!w(v#_$UbFg!8bHoN`r7fQWN`UP)qRUTP6oLuN`UP)SU9W?o8uxl?{=UP>`oZ!koHBaD-SGhRTVy4u9V zTt~sw!n{^Tq1w{OKu5vE%%rxKlS5Ql-#REhJ0~|UzYFMcAYcUg1q^thG>qy7GN9hs oI7^vrGdl-A2QU;iZv4(XnO{Vg2c!<9w*iPZ`-tpdp4h+w0Dyu_y#N3J delta 111 zcmZoMXfc=|#>CJzu~2NHo}w@#0|NsP3otMgmjxH)<>cq3Pb}1w1_`q=6fh(*q%))< wq(F){e`FM6+r;F}xS5@Up95$TP~bcBWPTA{PLQqxK+G`NhDUmHjK~sZ0LJ$kWB>pF diff --git a/entry/src/main/ets/pages/.DS_Store b/entry/src/.DS_Store similarity index 82% rename from entry/src/main/ets/pages/.DS_Store rename to entry/src/.DS_Store index 662bc11393d6b1c0a071c4b24d77be3fd614eddc..aba2928397001cdab0b66a907a0cb8828b58bb21 100644 GIT binary patch delta 223 zcmZoMXfc=|#>B`mu~2NHo)%A1d2vBfPJR*t1H+Dqh07-!h_INkFyt~MGGsF3AxkC| zB)qu~2NHo)!;7Dnl@X3xju3d2zvJMyBPAlMO^zd^i}g7)lvZ7}AlY zlXCKt7#J8%CKcpl7MBL^rO8X4#)m>8SY)^c))s~XyRCgfIDRoB$k z%>-Hl1dNOjnt>lm!>Cz628I(izhL~wvYDNOp9APSpjW;#Pv#e~jB$S%j~H_pV*(l?N2Ni~-56@wWJHc*6!R!k5m@ih+{S)8 z;J3F~!b(;|tFPamrA6twAH3D>?Cf?$SMi#5D~VpsDLEb>g{58$b@>nuWIfEXYKh=KpjfISyP z|9{g!t0xACfd&R}e~{1+J&Tn=y>&o`*Jq4(5K%zKw*;cJ=vk}`LIi}HQb1G6?GuBW za_~!==UJ=_nsUbV%rK6fxqiHGJv;cNPG{URNIfw?3~V#dHl~B;|2h0JjgS2860(Q^ zV&IQ4z&q1m>cgV!+4^mHc-Bg2_s~!X7GItPJ8P=-1_d ObP>>mP)7{>00W<$pGk@U literal 0 HcmV?d00001 diff --git a/entry/src/main/ets/common/service/initable.ts b/entry/src/main/ets/common/service/initable.ts index 29f647db..ab398c03 100644 --- a/entry/src/main/ets/common/service/initable.ts +++ b/entry/src/main/ets/common/service/initable.ts @@ -90,7 +90,7 @@ function sqlInsertCommonFn(tableName, resultArr, context?, delFlag = true) { console.log('teststet3',) // console.log('表长度',result.length,tableName) - if (result.length == 0) { + if (result.length == 0||!delFlag) { console.log('sqlsqlinsert',resultArr.length) if(resultArr.length==0){ resolve(true) @@ -100,7 +100,7 @@ function sqlInsertCommonFn(tableName, resultArr, context?, delFlag = true) { + " (" + map[tableName].ACCOUNT_TABLE.columns.toString() + ") VALUES " resultArr.map((data, i) => { - data.id = `${i}` + data.id = !delFlag?`${i+result.length }`:`${i}` let str = '(' map[tableName].ACCOUNT_TABLE.columns.map((res, index) => { if (map[tableName].ACCOUNT_TABLE.columns.length - 1 == index) { @@ -166,10 +166,10 @@ export async function getDataBaseTable(params, reqParam) { } if (params.tableName == 'MA_SYSSET') { res.body[params.tableName] = res.body[params.tableName].filter(res => { - return res['v_no'] >= 300 && res['v_no'] <= 700 + return res['v_no'] < 300 || res['v_no'] > 700 }) } - sqlInsertCommonFn(param.tableName, res.body[params.tableName]).then((val) => { + sqlInsertCommonFn(param.tableName, res.body[params.tableName],reqParam.context).then((val) => { reslove(val) }) }) @@ -245,7 +245,7 @@ export async function getMySystemSetTable(params, reqParam) { } if (params.tableName == 'MA_SYSSET') { res.body[params.tableName] = res.body[params.tableName].filter(res => { - return res['v_no'] < 300 || res['v_no'] > 700 + return res['v_no'] >= 300 && res['v_no'] <= 700 }) } sqlInsertCommonFn(params.tableName, res.body[params.tableName], reqParam.context, false).then((result) => { diff --git a/entry/src/main/ets/common/utils/GlobalTcp.ts b/entry/src/main/ets/common/utils/GlobalTcp.ts index 5cf440f1..acc5a373 100644 --- a/entry/src/main/ets/common/utils/GlobalTcp.ts +++ b/entry/src/main/ets/common/utils/GlobalTcp.ts @@ -19,7 +19,7 @@ export async function getTCP() { setTimeout(async () => { await globalThis.TcpClient.rebindTcp(result.tcplocalIp, result.tcplocalIpPort, result.tcpOppositeIp, result.tcpOppositePort) await globalThis.TcpClient.connectTcp() - await globalThis.TcpClient.sendMsg('1002') //1002 + await globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002 globalThis.TcpClient.onError((val) => { setTimeout(() => { getTCP() @@ -27,7 +27,7 @@ export async function getTCP() { }) await globalThis.TcpClient.onMessage((val) => { setTimeout(() => { - globalThis.TcpClient.sendMsg('1002') //1002 + globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002 if (val) { // const msg=val.substring(5,val.length-1) console.log('socketTag[PLC.UdpClient] status:', globalThis.udpClient.getStatus()) @@ -45,7 +45,7 @@ export async function getTCP() { globalThis.TcpClient = tcpClient await globalThis.TcpClient.bindTcp() await globalThis.TcpClient.connectTcp() - await globalThis.TcpClient.sendMsg('1002') //1002 + await globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002 globalThis.TcpClient.onError((val) => { setTimeout(() => { getTCP() @@ -54,7 +54,7 @@ export async function getTCP() { await globalThis.TcpClient.onMessage((val) => { hilog.info(0x0000, 'testTag', "valvalval2" + JSON.stringify(val)); setTimeout(() => { - globalThis.TcpClient.sendMsg('1002') //1002 + globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002 if (val && globalThis.udpClient?.sendMsg) { globalThis.udpClient?.sendMsg(val) } diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index b95daba7..a53c2797 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -388,7 +388,6 @@ struct Index { console.log('globalThis.singlePlay', globalThis.singlePlay) if (globalThis.singlePlay == undefined || globalThis.singlePlay == null) { this.context.resourceManager.getRawFileContent("welcome.wav").then(value => { - console.log('tttttttt') this.vocObj.playAudio({ type: 1, name: 'welcome.wav' diff --git a/entry/src/main/ets/pages/compontents/SignDisplayCom.ets b/entry/src/main/ets/pages/compontents/SignDisplayCom.ets index 4e85bf27..eddb8b63 100644 --- a/entry/src/main/ets/pages/compontents/SignDisplayCom.ets +++ b/entry/src/main/ets/pages/compontents/SignDisplayCom.ets @@ -4,6 +4,8 @@ import FileLog from '../judgeSDK/utils/fileLog'; import RealTime from '../compontents/judge/RealTime'; import { GPSData, SignalData } from '../../mock'; import { SignalDataType } from '../../model'; +// import { getSyncData } from '../../common/service/initable'; +import common from '@ohos.app.ability.common'; @Component export default struct SignDisplayCom { @@ -20,10 +22,15 @@ export default struct SignDisplayCom { @State interval: number = 0 @State @Watch('outClick') outFlag: boolean = false; @State url: string = '' + @State date: string = '' + @State time: string = '' + // @State sd: string = '' + @State param350Str: string = '' private timer = null private udpClient: UdpClient = null private FileLog: FileLog private vocObj = null; + private context = getContext(this) as common.UIAbilityContext; constructor() { super() @@ -166,7 +173,7 @@ export default struct SignDisplayCom { }.justifyContent(FlexAlign.Start).padding({ left: 10 * this.ratio }).margin({ top: 8 * this.ratio }) Row() { - Text("本机IP:" + this.signArr[53] || '0') + Text("后置机IP:" + this.signArr[53] || '0') .fontColor('#FFF5E5') .fontSize(14 * this.ratio) .width('25%') @@ -215,11 +222,11 @@ export default struct SignDisplayCom { .fontColor('#FFB433') .fontSize(14 * this.ratio) .height(18 * this.ratio) - Text('年月日:' + this.signArr[93]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) - Text('时分秒:' + this.signArr[94]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) + Text('年月日:' + this.date).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) + Text('时分秒:' + this.time).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) Text('经度:' + this.signArr[95]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) Text('纬度:' + this.signArr[96]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) - Text('速度:' + this.signArr[97]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) + Text('速度:' + (Number(this.signArr[97])*1.852).toFixed(2)).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) } .backgroundColor('#1A1A1A') .width(170 * this.ratio) @@ -346,8 +353,6 @@ export default struct SignDisplayCom { } onPageShow() { - console.info('SURENJUN', 123) - const getSignal = this.getSignal; const that = this const showBack = this.showBack; @@ -411,9 +416,21 @@ export default struct SignDisplayCom { this.GPSColum[t].value = this.signArr[i] t++ } + this.GPSColum[97].value= ((Number(this.GPSColum[97])*1.852).toFixed(2)).toString() this.sjxhColum = JSON.parse(JSON.stringify((this.sjxhColum))) that.signArr = JSON.parse(JSON.stringify((this.signArr))) that.GPSColum = JSON.parse(JSON.stringify((this.GPSColum))) + if(this.signArr.length) { + this.date = this.signArr[93].substr(4, 2) + this.signArr[93].substr(2, 2) + this.signArr[93].substr(0, 2) + const hours = (Number(this.signArr[94].substr(0, 2)) + 8).toString() + if (hours.length < 2) { + this.time = '0' + hours + this.signArr[93].substr(2, this.signArr[93].length) + } else { + this.time = hours + this.signArr[93].substr(2, this.signArr[93].length) + } + } + // this.sd=this.param350Str=='0'? this.signArr[97]: this.signArr[23] + } outClick() {