Commit 3485b15d by 陈桂东

commit

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