Commit 91106633 by 毛勇泽

射频扫码集成+扫码解析工具类

parent 438d2062
import relationalStore from '@ohos.data.relationalStore'; import relationalStore from '@ohos.data.relationalStore';
import { Wzhxdm } from '../../entity/Wzhxdm'; import { Wzhxdm } from '../../entity/Wzhxdm';
import { Logger } from '../../utils/Logger';
import BaseTable, { ValueType } from '../BaseTable'; import BaseTable, { ValueType } from '../BaseTable';
import { Table } from '../decorator/Decorators'; import { Table } from '../decorator/Decorators';
...@@ -58,12 +59,17 @@ export class WzhxdmDao extends BaseTable<Wzhxdm> { ...@@ -58,12 +59,17 @@ export class WzhxdmDao extends BaseTable<Wzhxdm> {
)`; )`;
return wzhxdm_sql; return wzhxdm_sql;
} }
async selectHXList(lsm?:string):Promise<Wzhxdm[]>{
let wp = this.getPredicates(); async selectHXList(sql?: string): Promise<Wzhxdm[]> {
if (lsm) { let db = await this.futureDb;
wp.equalTo('LSM', lsm); let rs = await db.querySql('', []);
let items: Wzhxdm[];
if (rs.goToFirstRow()) {
do {
Logger.info(this, 'queryAll rowIndex=' + rs.rowIndex)
items.push(this.toBean(rs))
} while (rs.goToNextRow())
} }
wp.orderByAsc('LSM'); return items;
return this.query(wp, this.getTableColumns())
} }
} }
\ No newline at end of file
...@@ -247,7 +247,7 @@ async function analysisQrCode(bqData, isData = false) { ...@@ -247,7 +247,7 @@ async function analysisQrCode(bqData, isData = false) {
// const allList = await selectInformationType("GY_M_PMV3", allsql) // const allList = await selectInformationType("GY_M_PMV3", allsql)
// const allList1 = await createOrFindSQL("GY_M_PMV3", allsql1)\ // const allList1 = await createOrFindSQL("GY_M_PMV3", allsql1)\
console.log('sql', sql) console.log('sql', sql)
let wzdmList = await bzhxModal.queryHXlist( sql) let wzdmList = await bzhxModal.queryHXlist(sql)
for (let j = 0; j < wzdmList.length; j++) { for (let j = 0; j < wzdmList.length; j++) {
let wzdm = wzdmList[j]; let wzdm = wzdmList[j];
Object.keys(hx_map).forEach((item) => { Object.keys(hx_map).forEach((item) => {
......
...@@ -19,8 +19,8 @@ class BzhxModal { ...@@ -19,8 +19,8 @@ class BzhxModal {
let res = await SQLiteContext.with(WzdmDao).selectWZDM(lsm); let res = await SQLiteContext.with(WzdmDao).selectWZDM(lsm);
return res; return res;
} }
async queryHXlist(lsm?: string):Promise<Wzhxdm[]> { async queryHXlist(sql?: string):Promise<Wzhxdm[]> {
let res = await SQLiteContext.with(WzhxdmDao).selectHXList(lsm); let res = await SQLiteContext.with(WzhxdmDao).selectHXList(sql);
return res; return res;
} }
} }
......
...@@ -2,12 +2,17 @@ ...@@ -2,12 +2,17 @@
"lockfileVersion": 1, "lockfileVersion": 1,
"ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
"specifiers": { "specifiers": {
"@ohos/hypium@1.0.6": "@ohos/hypium@1.0.6" "@ohos/hypium@1.0.6": "@ohos/hypium@1.0.6",
"@ohos/axios@^2.1.1": "@ohos/axios@2.1.1"
}, },
"packages": { "packages": {
"@ohos/hypium@1.0.6": { "@ohos/hypium@1.0.6": {
"resolved": "https://repo.harmonyos.com/ohpm/@ohos/hypium/-/hypium-1.0.6.tgz", "resolved": "https://repo.harmonyos.com/ohpm/@ohos/hypium/-/hypium-1.0.6.tgz",
"integrity": "sha512-bb3DWeWhYrFqj9mPFV3yZQpkm36kbcK+YYaeY9g292QKSjOdmhEIQR2ULPvyMsgSR4usOBf5nnYrDmaCCXirgQ==" "integrity": "sha512-bb3DWeWhYrFqj9mPFV3yZQpkm36kbcK+YYaeY9g292QKSjOdmhEIQR2ULPvyMsgSR4usOBf5nnYrDmaCCXirgQ=="
},
"@ohos/axios@2.1.1": {
"resolved": "https://repo.harmonyos.com/ohpm/@ohos/axios/-/axios-2.1.1.har",
"integrity": "sha512-EQax257+eKKT0Rx7h6N6xvmKbDRWDjCCWOP2vyyktySFwvjtypXuXmQKEvRjmAalR6cqf8mbfhWmpg0bD9OQ3w=="
} }
} }
} }
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论