Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
jump_hm_warehouse
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
毛勇泽
jump_hm_warehouse
Commits
3fafc5c4
Commit
3fafc5c4
authored
Jan 28, 2024
by
毛勇泽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增包裹
parent
51fe3548
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
456 行增加
和
19 行删除
+456
-19
BgglDto.ets
common/src/main/ets/bean/dto/BgglDto.ets
+19
-18
BgglDao.ets
common/src/main/ets/db/dao/BgglDao.ets
+57
-1
NativeSql.ets
common/src/main/ets/db/sql/NativeSql.ets
+12
-0
BgglModel.ets
entry/src/main/ets/model/BgglModel.ets
+10
-0
InputPayDailog.ets
entry/src/main/ets/pages/package/dialog/InputPayDailog.ets
+49
-0
AddPackagePage.ets
entry/src/main/ets/pages/package/scanpack/AddPackagePage.ets
+308
-0
main_pages.json
entry/src/main/resources/base/profile/main_pages.json
+1
-0
没有找到文件。
common/src/main/ets/bean/dto/BgglDto.ets
View file @
3fafc5c4
export interface newBgglDto {
guid: string;
ddh: string;
xs: number;
pc: number;
fwdw: string;
kfdm: string;
bgzt: string;
slr: string;
sldwdm: string;
sjh: number;
jssj: string;
cksj: string;
sfdc: string;
sfdf: string;
hwh: string;
qjm: string;
dfje: number;
kfmc: string;
guid
?
: string;
ddh
?
: string;
xs
?
: number;
pc
?
: number;
fwdw
?
: string;
kfdm
?
: string;
bgzt
?
: string;
slr
?
: string;
sldwdm
?
: string;
sjh
?
: number;
jssj
?
: string;
cksj
?
: string;
sfdc
?
: string;
sfdf
?
: string;
hwh
?
: string;
qjm
?
: string;
dfje
?
: number;
kfmc
?
: string;
}
\ No newline at end of file
common/src/main/ets/db/dao/BgglDao.ets
View file @
3fafc5c4
...
...
@@ -112,6 +112,7 @@ export class BgglDao extends BaseTable<Bggl> {
async SetYpfActive(guid?:string) {
try {
let val_sql = NativeSql.SetYpfActive(guid)
Logger.info('派发>>sql', val_sql)
let db = await this.futureDb;
let rs = await db.executeSql(val_sql);
return rs;
...
...
@@ -119,7 +120,39 @@ export class BgglDao extends BaseTable<Bggl> {
throw new Error('[插入异常]|' + e)
}
}
/*更新包裹状态*/
async updateBgSql(params?:any) {
try {
let val_sql = NativeSql.updateBgSql(params)
Logger.info('更新包裹状态>>sql', val_sql)
let db = await this.futureDb;
let rs = await db.executeSql(val_sql);
return rs;
} catch (e) {
throw new Error('[插入异常]|' + e)
}
}
/**
* // 检测包裹是否重复添加
*/
async testRepetitionBgSql(ddh?:string): Promise<newBgglDto[]> {
try {
let val_sql = NativeSql.testRepetitionBgSql(ddh);
Logger.info('检测包裹是否重复添加>>sql', val_sql)
let db = await this.futureDb;
let rs = await db.querySql(val_sql);
let items = []
if (rs.goToFirstRow()) {
do {
items.push(this.toPackageRef(rs))
} while (rs.goToNextRow())
}
Logger.info(this, '最新上架>>' + JSON.stringify(items))
return items;
} catch (e) {
throw new Error('[查询异常]|' + e)
}
}
toWzcrkRefWz(cursor: relationalStore.ResultSet): newBgglDto {
let info: newBgglDto = {
guid: cursor.getString(cursor.getColumnIndex('guid')),
...
...
@@ -143,4 +176,26 @@ export class BgglDao extends BaseTable<Bggl> {
};
return info;
}
toPackageRef(cursor: relationalStore.ResultSet): newBgglDto {
let info: newBgglDto = {
guid: cursor.getString(cursor.getColumnIndex('guid')),
ddh: cursor.getString(cursor.getColumnIndex('ddh')),
xs: cursor.getLong(cursor.getColumnIndex('xs')),
pc: cursor.getLong(cursor.getColumnIndex('pc')),
fwdw: cursor.getString(cursor.getColumnIndex('fwdw')),
bgzt: cursor.getString(cursor.getColumnIndex('bgzt')),
slr: cursor.getString(cursor.getColumnIndex('slr')),
sldwdm: cursor.getString(cursor.getColumnIndex('sldwdm')),
sjh: cursor.getLong(cursor.getColumnIndex('sjh')),
jssj: cursor.getString(cursor.getColumnIndex('jssj')),
cksj: cursor.getString(cursor.getColumnIndex('cksj')),
sfdc: cursor.getString(cursor.getColumnIndex('sfdc')),
sfdf: cursor.getString(cursor.getColumnIndex('sfdf')),
kfdm: cursor.getString(cursor.getColumnIndex('kfdm')),
qjm: cursor.getString(cursor.getColumnIndex('qjm')),
dfje: cursor.getLong(cursor.getColumnIndex('dfje')),
hwh: cursor.getString(cursor.getColumnIndex('hwh')),
};
return info;
}
}
\ No newline at end of file
common/src/main/ets/db/sql/NativeSql.ets
View file @
3fafc5c4
...
...
@@ -674,6 +674,18 @@ WHERE
`update TAB_BZGL_KNZY_APP_BGGL set BGZT = '已领取' , sfdc = '0' ,CKSJ = '${time}' where guid in ('${guid}') `
return sql
}
// 检测包裹是否重复添加
static testRepetitionBgSql (ddh?:string):string{
const sql = `select * from tab_bzgl_knzy_app_bggl where ddh = '${ddh}'`
return sql
}
// 更新包裹状态
static updateBgSql(params?:any):string {
const time = dateUtils.formatDateTime(new Date(), 'all')
const sql =
`update TAB_BZGL_KNZY_APP_BGGL set BGZT = '待上架', JSSJ =' ${time}' , XS = ${params.xs}, PC = ${params.pc} where ddh in ('${params.ddh}')`
return sql
}
}
entry/src/main/ets/model/BgglModel.ets
View file @
3fafc5c4
...
...
@@ -89,6 +89,16 @@ class BgglModel {
let res = await SQLiteContext.with(BgglDao).SetYpfActive(guid)
return res
}
/*更新包裹状态*/
async updateBgSql(params?:any) {
let res = await SQLiteContext.with(BgglDao).updateBgSql(params)
return res
}
// 检测包裹是否重复添加
async testRepetitionBgSql(ddh: string): Promise<newBgglDto[]> {
let res = await SQLiteContext.with(BgglDao).testRepetitionBgSql(ddh);
return res;
}
// 清空表
async clear() {
await SQLiteContext.with(BgglDao).clearTable()
...
...
entry/src/main/ets/pages/package/dialog/InputPayDailog.ets
0 → 100644
View file @
3fafc5c4
import { DividerTitle } from '../../../view/DividerTitle/DividerTitle';
@Extend(Button) function CommonButtonStyle() {
.backgroundColor('#fff')
.fontColor('#000')
}
@Entry
@Component
export struct InputPayDailog{
build(){
Column() {
Text("输入运费").fontSize(16).fontColor("#9C9C9C").lineHeight(18).padding(20)
TextInput({ text: "0" })
.enterKeyType(EnterKeyType.Search)
.borderColor("#454545")
.borderRadius(5)
.height(40)
.margin({left:20,right:20,top:10})
.flexGrow(1)
.borderColor('#bcc5d7')
.borderWidth(1)
.backgroundColor('#fff')
Divider()
.vertical(false)
.margin({top:12})
.height(14)
.strokeWidth(1)
.color('#989A9C')
.opacity(0.6)
Row() {
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Start }) {
Button("取消").CommonButtonStyle().width("50%").onClick(() => {
})
Divider()
.vertical(true)
.strokeWidth(2)
.color('#989A9C')
.opacity(0.6).height(40)
Button("确认").CommonButtonStyle().fontColor("#007dff").width("50%")
.onClick(async () => {
})
}
}.backgroundColor("#fff").height(40)
}.margin({left:20,right:20})
.borderRadius(10)
.backgroundColor('#fff')
}
}
\ No newline at end of file
entry/src/main/ets/pages/package/scanpack/AddPackagePage.ets
0 → 100644
View file @
3fafc5c4
import { TitleBar } from '../../../view/title/TitleBar'
import { Logger, KfInfo, Gldw, WzPositionClass,SearchData,WzPositionInfo,HWFromData} from '@ohos/common';
import router from '@ohos.router'
import IdentifyService from '../../../identify/IdentifySerivce'
import {analysisQrCode} from '../../../identify/analysis/analysis_QR_code'
import emitter from '@ohos.events.emitter';
import Prompt from '@system.prompt';
import bgglModel from '../../../model/BgglModel'
import { uuid } from '@ohos/common/src/main/ets/utils/util'
import {InputPayDailog} from '../../package/dialog/InputPayDailog'
@Entry
@Component
struct AddPackagePage{
@State isAutomation:boolean=true
@State dataList:Array<any>=[]
build() {
Column() {
TitleBar({ title: "新增包裹" })
Text('请扫描包裹').fontColor('#fff').fontSize(20).height("20").visibility(this.dataList.length>0?Visibility.None:Visibility.Visible)
Column() {
Flex({ justifyContent: FlexAlign.SpaceBetween , alignItems: ItemAlign.Start}) {
Row() {
List({ space: 2 }) {
ForEach(this.dataList, (item) => {
ListItem() {
Row() {
Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center }) {
Text('订单号: ' + item.ddh).fontSize(14).fontColor('#3b4144')
Text('批次: ' + String(1)).fontSize(14).fontColor('#3b4144')
}
.width('50%')
Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center }) {
Text('状态: ' + item.bgzt).fontSize(14).fontColor('#3b4144')
Row() {
Text('箱数: ' + item.bgzt).fontSize(14).fontColor('#3b4144')
Counter() {
Text(item.xs + '')
}
.width(120)
.onInc(() => {
item.xs = item.xs + 1
})
.onDec(() => {
if( item.xs == 0) {
return
}
item.xs = item.xs - 1
})
}.alignSelf(ItemAlign.End)
}
.width('50%')
}
.width('100%')
.backgroundColor('#fff')
.justifyContent(FlexAlign.SpaceBetween)
.padding({ left: 5, right: 5 })
}
.height(90)
})
}
.width('100%')
.backgroundColor('#fff')
.divider({ strokeWidth: 1, color: 'rgb(242,242,242)' }) // 每行之间的分界线
}.margin({ bottom: 50 })
}
.width('100%')
.height('100%')
.border({ width: 1, color: '#fff', style: BorderStyle.Dotted})
}
.padding(10)
.height('82%')
Flex({ justifyContent: FlexAlign.Center }) {
Button("接收包裹")
.borderRadius(4)
.type(ButtonType.Normal)
.width('90%')
.fontColor('#0fa983')
.backgroundColor('#fff')
.onClick(() => {
// this.onSubmit()
this.handlePutGoodsOnShelf()
console.log("接收数据")
// this.handleSave()
})
}
.height(70)
}.onKeyEvent((e: globalThis.KeyEvent) => {
console.error('keycode====》:' + e.keyCode)
if ((e.keyCode == 2096 || e.keyCode == 2093)) {
if(e.type==1){
IdentifyService.openScan()
}
}
console.error('keycode====》:' + e.keyCode)
}).height("100%").width("100%").linearGradient({
direction: GradientDirection.Right, // 渐变方向
repeating: true, // 渐变颜色是否重复
colors: [['#36a3c0', 0.0], ['#97c6a6', 1.0], ['#c7d799', 2.0]]// 数组末尾元素占比小于1时满足重复着色效果
})
}
scanCodeListen() {
var innerEvent = { eventId: 2 }
emitter.on(innerEvent, (eventData) => {
if (innerEvent.eventId == 2) {
let result = eventData.data.scancode
console.log("扫码校验", "收到扫码信息:" + result)
this.showQRDetail(result)
}
})
}
async showQRDetail(hwQrCode: string) {
Logger.info("扫码二维码===》"+hwQrCode)
this.isAutomation = false
this.handleanalysisQrCode(hwQrCode)
}
async handleanalysisQrCode(value:string) {
try {
const res = await analysisQrCode(value)
if (res.data && res.data.length > 0) {
res.data.forEach(async (item) => {
item.ddh = item.ddh.trim()
const {
bgzt,
ddh
} = item
console.log(' item.ddh', item.ddh)
// this.currentInfo = item
var type = 'SF'
if (item.ddh.indexOf('JD') !== -1) {
type = 'JD'
}
if (item.ddh.indexOf('SF') !== -1) {
type = 'SF'
}
if (item.ddh.indexOf('YZ') !== -1) {
type = 'YZ'
}
var count = item.ddh.indexOf(type)
console.log(count)
if (count == -1) {
count = 0
}
item.ddh = item.ddh.slice(count, item.ddh.length)
console.log('订单号', ddh)
if (ddh && bgzt) {
const textData = await bgglModel.testRepetitionBgSql(item)
console.log('textData', textData)
if (textData && textData.length == 0) {
Prompt.showToast({
message: '请检查当前订单是否导入'
})
return
} else {
if (textData[0].bgzt == '未领取' || textData[0].bgzt == '已领取' || textData[
0].bgzt == '待上架') {
var tip = ''
if (textData[0].bgzt == '未领取') {
tip = '已上架'
} else if (textData[0].bgzt == '待上架') {
tip = '已入库'
} else if (textData[0].bgzt == '已领取') {
tip = '已领取'
}
Prompt.showToast({
message: '当前扫描包裹已'
})
return
}
}
// console.log(testMaxPcSql(item))
// const textMaxPcData = await database.selectInformationType("GY_M_PMV3",
// testMaxPcSql(item))
// console.log(textMaxPcData, 'textMaxPcData')
// const textData = await database.selectInformationType("GY_M_PMV3",
// testRepetitionBgSql(item))
// if (textData && textData.length > 0) {
// uni.showToast({
// title: '订单号重复,请重新扫描',
// icon: 'none'
// })
// } else {
const [newData] = this.dataList.filter((ITEM) => ITEM.ddh == item.ddh)
if (newData) {
this.dataList.forEach((ITEM) => {
if (ITEM.ddh == item.ddh) {
ITEM.xs += 1
console.log('检验是否需要收费1:', item)
this.isTestSfSF(item, textData)
}
})
// uni.showToast({
// title: '当前订单号已扫描,请重新扫描',
// icon: 'none'
// })
} else {
// this.dataList.push({
// xs: 1,
// pc: textMaxPcData[0].PC,
// ...item
// })
this.dataList.push({
xs: 1,
pc: 1,
...item
})
console.log('检验是否需要收费2:', item)
this.isTestSfSF(item, textData)
}
// }
}
})
} else {
Prompt.showToast({
message: '请检查基础数据是否完善'
})
}
} catch (e) {
//TODO handle the exception
Prompt.showToast({
message: '解析失败'
})
}
}
/***
* @description: 是否需要收费或者是否没有收费
*/
async isTestSfSF(item, textData) {
try {
console.log('item', item)
console.log('检验是否需要收费', textData)
if (textData && textData.length > 0) {
const sfdf = textData[0].SFDF
const dfje = textData[0].DFJE
// this.play(textData[0])
if (textData[0].SFDF == '2') {
// 到付
if (!!textData[0].DFJE) {
// 到付金额已填
Prompt.showToast({
message: '到付金额已填'
})
} else {
// 暂无到付金额
// this.$refs.inputDialog.open()
Prompt.showToast({
message: '打开弹窗'
})
}
} else {
// 无需到付
Prompt.showToast({
message: '无需到付'
})
}
} else {
Prompt.showToast({
message: '请检查当前订单是否导入'
})
}
} catch (e) {
Prompt.showToast({
message: '检测失败'
})
}
}
async handlePutGoodsOnShelf() {
try {
if (this.dataList && this.dataList.length > 0) {
this.dataList.forEach(async (item) => {
let uuId = uuid()
item.guid = uuId
const params = {
...item
}
params.bgzt = '待上架'
// await database.createOrFindSQL("GY_M_PMV3", insertBgSql(params))
await bgglModel.updateBgSql(params)
})
Prompt.showToast({
message: '接收包裹成功'
})
router.back()
} else {
Prompt.showToast({
message: '请扫描订单,再进行接收包裹'
})
}
} catch (e) {
Prompt.showToast({
message: '接收包裹失败'
})
}
}
onPageShow() {
console.error("========onPageShow=========")
this.scanCodeListen()
IdentifyService.openScanPort()
}
onPageHide() {
IdentifyService.closeScan()
/*取消扫码订阅*/
emitter.off(2);
}
}
\ No newline at end of file
entry/src/main/resources/base/profile/main_pages.json
View file @
3fafc5c4
...
...
@@ -5,6 +5,7 @@
"pages/package/Pick"
,
"pages/package/Pack"
,
"pages/package/scanpack/ScanPackPage"
,
"pages/package/scanpack/AddPackagePage"
,
"pages/metailmange/WzInPage/WzInPage"
,
"pages/metailmange/WzOutPage/WzOutPage"
,
"pages/metailmange/WzExchangePage"
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论