Commit 3485b15d by 陈桂东

commit

parent 6cc0f352
...@@ -8,6 +8,13 @@ export { StatusBarManager } from './src/main/ets/components/StatusBarManager'; ...@@ -8,6 +8,13 @@ export { StatusBarManager } from './src/main/ets/components/StatusBarManager';
export {SQLiteContext} from './src/main/ets/db/SQLiteContext'; export {SQLiteContext} from './src/main/ets/db/SQLiteContext';
export {GldwDao} from './src/main/ets/db/dao/GldwDao'; export {GldwDao} from './src/main/ets/db/dao/GldwDao';
export {HjInfoDao} from './src/main/ets/db/dao/HjInfoDao'; export {HjInfoDao} from './src/main/ets/db/dao/HjInfoDao';
export {HwInfoDao} from './src/main/ets/db/dao/HwInfoDao';
export {BzhxDao} from './src/main/ets/db/dao/BzhxDao';
export {QyInfoDao} from './src/main/ets/db/dao/QyInfoDao';
export {KfInfoDao} from './src/main/ets/db/dao/KfInfoDao';
export {Gldw} from './src/main/ets/entity/Gldw' export {Gldw} from './src/main/ets/entity/Gldw'
export {HjInfo} from './src/main/ets/entity/HjInfo' export {HjInfo} from './src/main/ets/entity/HjInfo'
export {HwInfo} from './src/main/ets/entity/HwInfo'
export {Bzhx} from './src/main/ets/entity/Bzhx'
export {KfInfo} from './src/main/ets/entity/KfInfo'
export {QyInfo} from './src/main/ets/entity/QyInfo'
...@@ -52,4 +52,14 @@ export class BzhxDao extends BaseTable<Bzhx> { ...@@ -52,4 +52,14 @@ export class BzhxDao extends BaseTable<Bzhx> {
)`; )`;
return bzhx_sql; return bzhx_sql;
} }
// 获取被装号型列表
async getBzhxList(pmdmsix: string): Promise<Bzhx[]> {
let wp = this.getPredicates();
if (pmdmsix) {
wp.equalTo('PMDMSIX', pmdmsix);
}
wp.orderByAsc('GUID');
return this.query(wp, this.getTableColumns())
}
} }
\ No newline at end of file
...@@ -52,4 +52,13 @@ export class HwInfoDao extends BaseTable<HwInfo> { ...@@ -52,4 +52,13 @@ export class HwInfoDao extends BaseTable<HwInfo> {
)`; )`;
return hw_sql; return hw_sql;
} }
async getHwList(no: string): Promise<HwInfo[]> {
let wp = this.getPredicates();
if (no) {
wp.equalTo('HWH', no);
}
wp.orderByAsc('HWH');
return this.query(wp, this.getTableColumns())
}
} }
\ No newline at end of file
import relationalStore from '@ohos.data.relationalStore'; import relationalStore from '@ohos.data.relationalStore';
import { Hwgh } from '../../entity/Hwgh'; import { Hwgh } from '../../entity/Hwgh';
import { HwInfo } from '../../entity/HwInfo';
import BaseTable, { ValueType } from '../BaseTable'; import BaseTable, { ValueType } from '../BaseTable';
import { Table } from '../decorator/Decorators'; import { Table } from '../decorator/Decorators';
import { HwInfoDao } from './HwInfoDao';
/** /**
...@@ -40,4 +42,6 @@ export class HwghDao extends BaseTable<Hwgh> { ...@@ -40,4 +42,6 @@ export class HwghDao extends BaseTable<Hwgh> {
)`; )`;
return hwgh_sql; return hwgh_sql;
} }
}
\ No newline at end of file }
...@@ -45,4 +45,12 @@ export class QyInfoDao extends BaseTable<QyInfo> { ...@@ -45,4 +45,12 @@ export class QyInfoDao extends BaseTable<QyInfo> {
)`; )`;
return qy_sql; return qy_sql;
} }
async getQy(qydm: string): Promise<QyInfo[]> {
let wp = this.getPredicates();
if (qydm) {
wp.like('QYDM', qydm);
}
wp.orderByAsc("QYDM");
return this.query(wp, this.getTableColumns());
}
} }
\ No newline at end of file
...@@ -7,37 +7,37 @@ export interface Bzhx { ...@@ -7,37 +7,37 @@ export interface Bzhx {
/** /**
* 10位品名代码(存放10位品名代码或6位无号配号加“0000”) * 10位品名代码(存放10位品名代码或6位无号配号加“0000”)
*/ */
pmdmten?: string, pmdmten: string,
/** /**
* 6位品名代码 * 6位品名代码
*/ */
pmdmsix?: string, pmdmsix: string,
/** /**
* 物资品名 * 物资品名
*/ */
wzpm?: string, wzpm: string,
/** /**
* 无号配号品名填"无号配号" * 无号配号品名填"无号配号"
*/ */
hxmc?: string, hxmc: string,
/** /**
* 序号:1、2、3、4、5、6 ...,无号配号填-1 * 序号:1、2、3、4、5、6 ...,无号配号填-1
*/ */
xh?: number, xh: number,
/** /**
* 关联品名GUID * 关联品名GUID
*/ */
pmguid?: string, pmguid: string,
/** /**
* 关联号型GUID * 关联号型GUID
*/ */
hxguid?: string, hxguid: string,
/** /**
* 管理品名旧的GUID * 管理品名旧的GUID
*/ */
pmguid_old?: string, pmguid_old: string,
/** /**
* 货位状态|是否删除(11111111SF2禁用,11111111SF1正常) * 货位状态|是否删除(11111111SF2禁用,11111111SF1正常)
*/ */
hwzt?: string hwzt: string
} }
\ No newline at end of file
...@@ -10,7 +10,7 @@ export default class EntryAbility extends UIAbility { ...@@ -10,7 +10,7 @@ export default class EntryAbility extends UIAbility {
onCreate(want, launchParam) { onCreate(want, launchParam) {
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate');
// 初始化数据库 // 初始化数据库
database.initDB(this.context) // database.initDB(this.context)
} }
onDestroy() { onDestroy() {
......
import database from '../database/database' import { BzhxDao, SQLiteContext,Bzhx } from '@ohos/common'
import { Bzhx } from '@ohos/common/src/main/ets/entity/Bzhx'
import { importSql } from '../sql/index'
// 被装号型 // 被装号型
class BzhxModal { class BzhxModal {
private tableName = 'TAB_XTWH_JCSJ_BZHX' // 添加被装号型
// 添加号型
async set(data: Bzhx[]) { async set(data: Bzhx[]) {
for (let index = 0; index < data.length; index++) { await SQLiteContext.with(BzhxDao).batchInsert(data)
const item = data[index]; }
const sql = importSql.getBzhxSql(item)
await database.set(sql, this.tableName) // 查询被装号型
} async query(pmdmsix? : string): Promise<Bzhx[]> {
let res = await SQLiteContext.with(BzhxDao).getBzhxList(pmdmsix)
return res;
} }
} }
......
import database from '../database/database' import { Gldw, SQLiteContext,GldwDao } from '@ohos/common'
import { Gldw } from '@ohos/common/src/main/ets/entity/Gldw'
import { importSql } from '../sql/index'
// 管理单位 // 管理单位
class GldwModal { class GldwModal {
private tableName = 'TAB_BZGL_KNZY_APP_BGDDW' // 添加管理单位
// 添加单位
async set(data: Gldw[]) { async set(data: Gldw[]) {
for (let index = 0; index < data.length; index++) { await SQLiteContext.with(GldwDao).batchInsert(data)
const item = data[index]; }
const sql = importSql.getGldwSql(item)
await database.set(sql, this.tableName) // 查询管理单位
} async query(dwmc? : string): Promise<Gldw[]> {
let res = await SQLiteContext.with(GldwDao).getGldwList(dwmc)
return res;
} }
} }
......
import database from '../database/database' import { HjInfo, SQLiteContext, HjInfoDao } from '@ohos/common'
import { HjInfo, SQLiteContext, HjInfoDao, Logger } from '@ohos/common'
import { importSql } from '../sql/index'
// 货架管理 // 货架管理
class HjModal { class HjModal {
private tableName = 'TAB_BZGL_KNZY_APP_HJB' // 添加货架
// 添加货位
async set(data: HjInfo[]) { async set(data: HjInfo[]) {
SQLiteContext.with(HjInfoDao).batchInsert(data).then(result => { await SQLiteContext.with(HjInfoDao).batchInsert(data)
Logger.info(this, "插入成功" + result);
if (result > 0) {
Logger.info(this, "插入成功" + result);
}
})
// for (let index = 0; index < data.length; index++) {
// const item = data[index];
// const sql = importSql.getHjSql(item)
//
// //await database.set(sql, this.tableName)
// }
} }
// 查询货架
async query(no?: string):Promise< HjInfo[]> { async query(no?: string):Promise< HjInfo[]> {
let res = await SQLiteContext.with(HjInfoDao).getHjList(no); let res = await SQLiteContext.with(HjInfoDao).getHjList(no);
return res; return res;
......
import database from '../database/database' import { HwInfo, SQLiteContext,HwInfoDao } from '@ohos/common'
import { HwInfo } from '@ohos/common/src/main/ets/entity/HwInfo'
import { importSql } from '../sql/index'
// 货位管理 // 货位管理
class HwModal { class HwModal {
private tableName = 'TAB_BZGL_KNZY_APP_HWB'
// 添加货位 // 添加货位
async set(data: HwInfo[]) { async set(data: HwInfo[]) {
for (let index = 0; index < data.length; index++) { await SQLiteContext.with(HwInfoDao).batchInsert(data)
const item = data[index]; }
const sql = importSql.getHwSql(item)
await database.set(sql, this.tableName) // 查询货位
} async query(no? : string): Promise<HwInfo[]> {
let res = await SQLiteContext.with(HwInfoDao).getHwList(no)
return res;
} }
} }
......
import database from '../database/database' import { KfInfoDao, SQLiteContext,KfInfo } from '@ohos/common'
import { KfInfo } from '@ohos/common/src/main/ets/entity/KfInfo'
import { importSql, sqlCommon } from '../sql/index'
// 库房管理 // 库房管理
class KfModal { class KfModal {
private tableName = 'TAB_BZGL_KNZY_APP_DWKF'
// 添加库房 // 添加库房
async set(data: KfInfo[]) { async set(data: KfInfo[]) {
for (let index = 0; index < data.length; index++) { await SQLiteContext.with(KfInfoDao).batchInsert(data)
const item = data[index];
const sql = importSql.getCkkfSql(item)
await database.set(sql, this.tableName)
}
} }
// 查询库房 // 查询库房
async query(kfmc?: string) { async query(kfmc? : string): Promise<KfInfo[]> {
const sql = sqlCommon.getKf({ kfmc }) let res = await SQLiteContext.with(KfInfoDao).getKf(kfmc)
return await database.query<KfInfo>(sql, ['guid', 'kfdm', 'kfmc', 'kflx', 'yxj', 'isdefault'] ,this.tableName) return res;
} }
} }
......
import database from '../database/database' import { QyInfo, SQLiteContext,QyInfoDao } from '@ohos/common'
import { QyInfo } from '@ohos/common/src/main/ets/entity/QyInfo'
import { importSql } from '../sql/index'
// 区域 // 区域管理
class QyModal { class QyModal {
private tableName = 'TAB_BZGL_KNZY_APP_QYB' // 添加区域
async set(data: QyInfo[]) {
await SQLiteContext.with(QyInfoDao).batchInsert(data)
}
// 查询区域 // 查询区域
async set(data: QyInfo[]) { async query(qydm? : string): Promise<QyInfo[]> {
for (let index = 0; index < data.length; index++) { let res = await SQLiteContext.with(QyInfoDao).getQy(qydm)
const item = data[index]; return res;
const sql = importSql.getQySql(item)
await database.set(sql, this.tableName)
}
} }
} }
const qyModal = new QyModal() const qyModal = new QyModal()
export default qyModal export default qyModal
\ No newline at end of file
...@@ -80,7 +80,7 @@ export struct DataSynchronism { ...@@ -80,7 +80,7 @@ export struct DataSynchronism {
const allData = JSON.parse(res).bzhxList as Bzhx[] const allData = JSON.parse(res).bzhxList as Bzhx[]
// 添加品名 // 添加品名
await bzhxModal.set(allData) // await bzhxModal.set(allData)
// 获取基础信息 // 获取基础信息
const baseRes = await getBaseList({ dwguid: this.dwguid }) const baseRes = await getBaseList({ dwguid: this.dwguid })
...@@ -90,16 +90,16 @@ export struct DataSynchronism { ...@@ -90,16 +90,16 @@ export struct DataSynchronism {
await kfModel.set(ckkfList) await kfModel.set(ckkfList)
// 区域添加 // 区域添加
await qyModel.set(qyList) // await qyModel.set(qyList)
// 货架添加 // 货架添加
await hjModel.set(hjList) await hjModel.set(hjList)
// 货位添加 // 货位添加
await hwModel.set(hwList) // await hwModel.set(hwList)
// 添加管理单位 // 添加管理单位
await gldwModel.set(ddwAndJw) // await gldwModel.set(ddwAndJw)
......
...@@ -4,6 +4,9 @@ import { KfInfo } from '@ohos/common/src/main/ets/entity/KfInfo' ...@@ -4,6 +4,9 @@ import { KfInfo } from '@ohos/common/src/main/ets/entity/KfInfo'
export struct Demo { export struct Demo {
data: KfInfo[] data: KfInfo[]
arr = [1,2,3,4,5] arr = [1,2,3,4,5]
@Styles commonPadding() {
.padding({top:4, bottom:4})
}
build() { build() {
Column() { Column() {
List(){ List(){
...@@ -12,36 +15,38 @@ export struct Demo { ...@@ -12,36 +15,38 @@ export struct Demo {
Row() { Row() {
Column() { Column() {
Row(){ Row(){
Text("库房代码:") Text("库房代码:").commonPadding()
Text("2") Text("2").commonPadding()
} }
Row(){ Row(){
Text("库房名称:") Text("库房名称:").commonPadding()
Text("2") Text("2").commonPadding()
} }
}.width('30%') }.width('40%')
Column() {
Row() {
Text('凭证号: ')
Text('1')
}.alignSelf(ItemAlign.Start).padding({ top: 8, bottom: 8 })
Row() { Column() {
Text("数量: ") Row(){
Text('0').fontColor('#ff3d43') Text("库房类型:").commonPadding()
Text('/').fontColor('#ff3d43') Text("2").commonPadding()
Text('500').fontColor('#ff3d43') }
}.alignSelf(ItemAlign.Start) Row(){
}.width("30%").padding({ top: 8, bottom: 8 }) Text("优先级:").commonPadding()
Text("2").commonPadding()
}
}.width('40%')
Row() { Row() {
Text("状态: ") Radio({ value: 'Radio1', group: 'radioGroup' })
Text("未完成").fontColor('#ff3d43') .height(18)
} .width(18)
}.margin({ top: 10 }).border({ width: { bottom: '1lpx' }, color: "#717171" }) .onChange((isChecked: boolean) => {
console.log('Radio1 status is ' + isChecked)
})
}.width('10%')
}.commonPadding()
} }
}) })
} }.divider({strokeWidth:1,color:$r("app.color.home_grid_fontColor")})
}.width('100%').height('100%') }.width('100%').height('100%')
} }
......
import { BasicTable } from '../../../view/BasicTable/BasicTable' import { BasicTable } from '../../../view/BasicTable/BasicTable'
import { TitleBar } from '../../../view/title/TitleBar' import { TitleBar } from '../../../view/title/TitleBar'
import kfModel from '../../../model/KfModel' import kfModel from '../../../model/KfModel'
import { Logger } from '@ohos/common'
@Entry @Entry
@Component @Component
...@@ -12,9 +13,10 @@ export struct Warehouse { ...@@ -12,9 +13,10 @@ export struct Warehouse {
this.getWarehouseList() this.getWarehouseList()
} }
// 获取库数据 // 获取库数据
async getWarehouseList() { async getWarehouseList() {
const res = await kfModel.query() const res = await kfModel.query()
Logger.info(this, "库房数据>" + JSON.stringify(res));
} }
build() { build() {
......
...@@ -28,7 +28,7 @@ export const uniInitList: UniListItem[] = [ ...@@ -28,7 +28,7 @@ export const uniInitList: UniListItem[] = [
showExtraIcon: true, showExtraIcon: true,
showArrow: true, showArrow: true,
//extraIcon: '', //extraIcon: '',
url: 'pages/sub_systemMaintenance/Warehouse' url: 'pages/sub_systemMaintenance/Warehouse/Warehouse'
}, },
{ {
title: '货架查看', title: '货架查看',
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论