From e5dd0fdb745855b25740fa4957764a0c9f43e6a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ZR20090193-=E9=99=88=E6=95=AC=E5=8B=87?= Date: Fri, 21 Apr 2023 18:11:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=9B=B8=E5=85=B3=E6=B5=81?= =?UTF-8?q?=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/query/storeinquery/columns.tsx | 2 +- .../src/views/query/storeoutquery/columns.tsx | 2 +- .../src/views/query/storequery/columns.tsx | 2 +- .../wms/wmsclearance/WmsClearanceGoods.vue | 177 ++++++++++--- .../src/views/wms/wmsclearance/columns.tsx | 83 +++--- .../views/wms/wmsinplan/WmsInPlanGoods.vue | 42 +-- .../views/wms/wmsoutplan/WmsOutPlanGoods.vue | 137 +++++++--- .../src/views/wms/wmsoutplan/columns.tsx | 17 +- .../wms/wmsclearance/WmsClearanceModal.vue | 36 ++- .../src/views/wms/wmsoutdo/WmsOutDoModal.vue | 33 ++- .../System/Method/CommonService.cs | 2 + .../WmsModule/Dtos/WmsClearanceDetailInput.cs | 16 +- .../Dtos/WmsClearanceGoodsListViewModel.cs | 24 ++ .../WmsModule/Dtos/WmsOutPlanDetailInput.cs | 6 +- .../WmsModule/Dtos/WmsStoreListPagModel.cs | 28 +- .../Entity/OP_WMS_CLEARANCE_DETAIL.cs | 9 + .../WmsModule/Method/WmsClearanceService.cs | 12 +- .../WmsModule/Method/WmsOutPlanService.cs | 10 +- .../DS.WMS.WebApi/Logs/internal-nlog.txt | 130 +++++++++ .../Dtos/ClearanceMovePlanGoodsBatchInput.cs | 26 +- .../App/Dtos/ClearanceOutPlanGoodsInput.cs | 30 ++- .../Dtos/ClearanceOutPlanGoodsViewModel.cs | 17 ++ .../App/Dtos/StockInPlanGoodsInput.cs | 19 +- .../App/Dtos/StockOutPlanGoodsBatchInput.cs | 2 +- .../App/Dtos/StockOutPlanGoodsInput.cs | 36 ++- .../App/Dtos/StockOutPlanGoodsViewModel.cs | 77 ++---- .../DS.WMS.Core/App/Dtos/WmsSummaryInfo.cs | 8 + .../App/Method/AppClearanceService.cs | 84 ++++-- .../App/Method/AppStockInService.cs | 6 +- .../App/Method/AppStockOutService.cs | 19 +- .../Dtos/WmsClearanceGoodsListViewModel.cs | 10 + .../Entity/OP_WMS_CLEARANCE_DETAIL.cs | 8 + .../WmsModule/Entity/OP_WMS_OUT_DO_GOODS.cs | 5 + .../WmsModule/Entity/Op_Wms_Change.cs | 40 +++ .../WmsModule/Entity/Op_Wms_Physics_Change.cs | 38 +++ .../Interface/WmsCommonBaseService.cs | 78 ++++++ .../WmsModule/Method/WmsClearanceService.cs | 11 +- .../WmsModule/Method/WmsCommonService.cs | 250 +++++++++++++++++- .../WmsModule/Method/WmsOutDoService.cs | 8 +- .../WmsModule/Method/WmsOutPlanService.cs | 4 +- .../DS.WMS.WebApi/Logs/internal-nlog.txt | 80 ++++++ 41 files changed, 1332 insertions(+), 292 deletions(-) diff --git a/gslk-wms-web-client/src/views/query/storeinquery/columns.tsx b/gslk-wms-web-client/src/views/query/storeinquery/columns.tsx index 42f3902..31c9456 100644 --- a/gslk-wms-web-client/src/views/query/storeinquery/columns.tsx +++ b/gslk-wms-web-client/src/views/query/storeinquery/columns.tsx @@ -56,7 +56,7 @@ export const columns: BasicColumn[] = [ width: 100, }, { - title: '数量', + title: '计费数量', dataIndex: 'storageunitcount', width: 100, }, diff --git a/gslk-wms-web-client/src/views/query/storeoutquery/columns.tsx b/gslk-wms-web-client/src/views/query/storeoutquery/columns.tsx index dd9dd87..cd3ca0d 100644 --- a/gslk-wms-web-client/src/views/query/storeoutquery/columns.tsx +++ b/gslk-wms-web-client/src/views/query/storeoutquery/columns.tsx @@ -73,7 +73,7 @@ export const columns: BasicColumn[] = [ width: 100, }, { - title: '数量', + title: '计费数量', dataIndex: 'storageunitcount', width: 100, }, diff --git a/gslk-wms-web-client/src/views/query/storequery/columns.tsx b/gslk-wms-web-client/src/views/query/storequery/columns.tsx index 24946a2..bbdb9e0 100644 --- a/gslk-wms-web-client/src/views/query/storequery/columns.tsx +++ b/gslk-wms-web-client/src/views/query/storequery/columns.tsx @@ -51,7 +51,7 @@ export const columns: BasicColumn[] = [ width: 100, }, { - title: '数量', + title: '计费数量', dataIndex: 'storageunitcount', width: 100, }, diff --git a/gslk-wms-web-client/src/views/wms/wmsclearance/WmsClearanceGoods.vue b/gslk-wms-web-client/src/views/wms/wmsclearance/WmsClearanceGoods.vue index f622bac..54794d2 100644 --- a/gslk-wms-web-client/src/views/wms/wmsclearance/WmsClearanceGoods.vue +++ b/gslk-wms-web-client/src/views/wms/wmsclearance/WmsClearanceGoods.vue @@ -44,6 +44,8 @@ + + 提单号:{{ item.mblno }} + 批次号:{{ item.goodsmodeL2 }} 库位:{{ item.areaname }} - - - 可用数量:{{ item.storageunitcount }} + 可用件数:{{ item.pkgs }} + 占用件数:{{ item.lockpkgs }} + 可用计费数量:{{ item.storageunitcount }} 占用数量:{{ item.lockstorageunitcount }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + { + console.log(row) + row.minpkgs = row.pkgs * row.coefficient + } + + const netweightChangeEvent = ({ row }: any) => { + console.log(row) + if (row.storageUnitType == '净重') { + //同时变更计费数量 + if (row.storageunit == '吨') { + row.storageunitcount = parseFloat(row.netweight / 1000) + } + if (row.storageunit == '千克') { + row.storageunitcount = row.netweight + } + const $table = xTable.value + $table.reloadRow(row, {}) + } + // console.log(`${column.title} 触发 input 事件`) + } + const kgsChangeEvent = ({ row }: any) => { + if (row.storageUnitType == '毛重') { + //同时变更计费数量 + if (row.storageunit == '吨') { + row.storageunitcount = parseFloat(row.kgs / 1000) + } + if (row.storageunit == '千克') { + row.storageunitcount = row.kgs + } + const $table = xTable.value + $table.reloadRow(row, {}) + } + } + const palletsChangeEvent = ({ row }: any) => { + if (row.storageUnitType == '体积') { + //同时变更计费数量 + if (row.storageunit == '立方米') { + row.storageunitcount = row.pallets * 2 + } + const $table = xTable.value + $table.reloadRow(row, {}) + } + } const selectChange = (e, opt, row) => { // console.log(`selected ${e}`) console.log(opt) @@ -242,6 +330,7 @@ return v.wmsphysicsid == opt.key }) console.log(obj) + row.goodsId = obj.goodsId row.goodsname = obj.goodsname row.goodscode = obj.goodscode row.goodshscode = obj.goodshscode===null?'':obj.goodshscode @@ -257,7 +346,11 @@ row.cbm = obj.cbm row.netweight = obj.netweight row.pkgs = obj.pkgs + row.minpkgs = obj.minpkgs row.mblno = obj.mblno + row.goodsmodeL2 = obj.goodsmodeL2 + row.storageUnitType = obj.storageUnitType + row.coefficient = obj.coefficient // console.log(row) const $table = xTable.value $table.reloadRow(row, {}) @@ -277,6 +370,7 @@ wmsoutdetailid: '', wmsplanid: unref(rowId), mblno: '', + goodsId: '', goodscode: '', goodshscode: '', goodsname: '', @@ -285,6 +379,10 @@ netweight: 0, cbm: 0, pkgs: 0, + minpkgs: 0, + pallets: 0, + goodsmodeL2: '', + storageUnitType: '', kindpkgs: '', storageunit: '', storageunitcount: 0, @@ -295,6 +393,7 @@ areacode: '', areaname: '', truckno: '', + coefficient: 0, key: `${Date.now()}`, } $table.insertAt(record, row).then(({ row }) => { diff --git a/gslk-wms-web-client/src/views/wms/wmsclearance/columns.tsx b/gslk-wms-web-client/src/views/wms/wmsclearance/columns.tsx index 8a4c5d0..8935635 100644 --- a/gslk-wms-web-client/src/views/wms/wmsclearance/columns.tsx +++ b/gslk-wms-web-client/src/views/wms/wmsclearance/columns.tsx @@ -299,39 +299,39 @@ export const formSchema: FormSchema[] = [ }, slot: 'storehouseSelectSlot', }, - { - field: 'goodsname', - label: '商品名称', - component: 'Input', - colProps: { - span: 8, - }, - componentProps: { - disabled: true, - }, - }, - { - field: 'goodsmodel', - label: '规格型号', - component: 'Input', - colProps: { - span: 8, - }, - componentProps: { - disabled: true, - }, - }, - { - field: 'truckno', - label: '承运车辆', - component: 'Input', - colProps: { - span: 8, - }, - componentProps: { - disabled: true, - }, - }, + // { + // field: 'goodsname', + // label: '商品名称', + // component: 'Input', + // colProps: { + // span: 8, + // }, + // componentProps: { + // disabled: true, + // }, + // }, + // { + // field: 'goodsmodel', + // label: '规格型号', + // component: 'Input', + // colProps: { + // span: 8, + // }, + // componentProps: { + // disabled: true, + // }, + // }, + // { + // field: 'truckno', + // label: '承运车辆', + // component: 'Input', + // colProps: { + // span: 8, + // }, + // componentProps: { + // disabled: true, + // }, + // }, { field: 'moveStoreHouseName', label: '移库仓库', @@ -421,6 +421,11 @@ export const storecolumns: BasicColumn[] = [ dataIndex: 'goodsmodel', width: 80, }, + { + title: '批次号', + dataIndex: 'goodsmodeL2', + width: 80, + }, { title: '库位', dataIndex: 'areacodename', @@ -442,7 +447,17 @@ export const storecolumns: BasicColumn[] = [ width: 100, }, { - title: '数量', + title: '小件数', + dataIndex: 'minpkgs', + width: 100, + }, + { + title: '锁定件数', + dataIndex: 'lockpkgs', + width: 100, + }, + { + title: '计费数量', dataIndex: 'storageunitcount', width: 100, }, diff --git a/gslk-wms-web-client/src/views/wms/wmsinplan/WmsInPlanGoods.vue b/gslk-wms-web-client/src/views/wms/wmsinplan/WmsInPlanGoods.vue index f1f4f8f..f940f90 100644 --- a/gslk-wms-web-client/src/views/wms/wmsinplan/WmsInPlanGoods.vue +++ b/gslk-wms-web-client/src/views/wms/wmsinplan/WmsInPlanGoods.vue @@ -195,23 +195,23 @@ /> - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + @@ -328,10 +328,10 @@ if (row.storageUnitType == '净重') { //同时变更计费数量 if (row.storageunit == '吨') { - row.storageunitcount = parseFloat(row.pkgs * row.netweight / 1000) + row.storageunitcount = parseFloat(row.netweight / 1000) } if (row.storageunit == '千克') { - row.storageunitcount = row.pkgs * row.netweight + row.storageunitcount = row.netweight } const $table = xTable.value $table.reloadRow(row, {}) @@ -342,10 +342,10 @@ if (row.storageUnitType == '毛重') { //同时变更计费数量 if (row.storageunit == '吨') { - row.storageunitcount = parseFloat((row.pkgs * row.kgs) / 1000) + row.storageunitcount = parseFloat(row.kgs / 1000) } if (row.storageunit == '千克') { - row.storageunitcount = row.pkgs * row.kgs + row.storageunitcount = row.kgs } const $table = xTable.value $table.reloadRow(row, {}) diff --git a/gslk-wms-web-client/src/views/wms/wmsoutplan/WmsOutPlanGoods.vue b/gslk-wms-web-client/src/views/wms/wmsoutplan/WmsOutPlanGoods.vue index c3d57f2..cab5640 100644 --- a/gslk-wms-web-client/src/views/wms/wmsoutplan/WmsOutPlanGoods.vue +++ b/gslk-wms-web-client/src/views/wms/wmsoutplan/WmsOutPlanGoods.vue @@ -84,8 +84,8 @@ 提单号:{{ item.mblno }} 批次号:{{ item.goodsmodeL2 }} 库位:{{ item.areaname }} - - + 可用件数:{{ item.pkgs }} + 占用件数:{{ item.lockpkgs }} 可用计费数量:{{ item.storageunitcount }} 占用数量:{{ item.lockstorageunitcount }} @@ -93,23 +93,55 @@ - - - - - - - - - - + + + + + + + + + + - - - - + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + @@ -238,30 +276,59 @@ }) const pkgsChangeEvent = ({ row }: any) => { + console.log(row) + // if (row.storageUnitType == '净重') { + // //同时变更计费数量 + // if (row.storageunit == '吨') { + // row.storageunitcount = parseFloat(row.netweight / 1000) + // } + // if (row.storageunit == '千克') { + // row.storageunitcount = row.netweight + // } + // const $table = xTable.value + // $table.reloadRow(row, {}) + // } + // if (row.storageUnitType == '毛重') { + // //同时变更计费数量 + // if (row.storageunit == '吨') { + // row.storageunitcount = parseFloat(row.kgs / 1000) + // } + // if (row.storageunit == '千克') { + // row.storageunitcount = row.kgs + // } + // const $table = xTable.value + // $table.reloadRow(row, {}) + // } + row.minpkgs = row.pkgs * row.coefficient + } + + const netweightChangeEvent = ({ row }: any) => { console.log(row) if (row.storageUnitType == '净重') { //同时变更计费数量 if (row.storageunit == '吨') { - row.storageunitcount = parseFloat(row.pkgs * row.netweight / 1000) + row.storageunitcount = parseFloat(row.netweight / 1000) } if (row.storageunit == '千克') { - row.storageunitcount = row.pkgs * row.netweight + row.storageunitcount = row.netweight } const $table = xTable.value $table.reloadRow(row, {}) } + // console.log(`${column.title} 触发 input 事件`) + } + const kgsChangeEvent = ({ row }: any) => { if (row.storageUnitType == '毛重') { //同时变更计费数量 if (row.storageunit == '吨') { - row.storageunitcount = parseFloat((row.pkgs * row.kgs) / 1000) + row.storageunitcount = parseFloat(row.kgs / 1000) } if (row.storageunit == '千克') { - row.storageunitcount = row.pkgs * row.kgs + row.storageunitcount = row.kgs } const $table = xTable.value $table.reloadRow(row, {}) } - row.minpkgs = row.pkgs * row.coefficient } const palletsChangeEvent = ({ row }: any) => { if (row.storageUnitType == '体积') { @@ -317,8 +384,8 @@ row.goodsId = obj.goodsId row.goodsname = obj.goodsname row.goodscode = obj.goodscode - row.goodshscode = obj.goodshscode===null?'':obj.goodshscode - row.goodsmodel = obj.goodsmodel===null?'':obj.goodsmodel + row.goodshscode = obj.goodshscode === null ? '' : obj.goodshscode + row.goodsmodel = obj.goodsmodel === null ? '' : obj.goodsmodel row.areacode = obj.areacode row.areaname = obj.areaname row.storehouse = obj.storehouse diff --git a/gslk-wms-web-client/src/views/wms/wmsoutplan/columns.tsx b/gslk-wms-web-client/src/views/wms/wmsoutplan/columns.tsx index 2bcf347..5ae2a76 100644 --- a/gslk-wms-web-client/src/views/wms/wmsoutplan/columns.tsx +++ b/gslk-wms-web-client/src/views/wms/wmsoutplan/columns.tsx @@ -343,6 +343,11 @@ export const storecolumns: BasicColumn[] = [ dataIndex: 'goodsmodel', width: 80, }, + { + title: '批次号', + dataIndex: 'goodsmodeL2', + width: 80, + }, { title: '库位', dataIndex: 'areacodename', @@ -364,7 +369,17 @@ export const storecolumns: BasicColumn[] = [ width: 100, }, { - title: '数量', + title: '小件数', + dataIndex: 'minpkgs', + width: 100, + }, + { + title: '锁定件数', + dataIndex: 'lockpkgs', + width: 100, + }, + { + title: '计费数量', dataIndex: 'storageunitcount', width: 100, }, diff --git a/gslk-wms-web-server/src/views/wms/wmsclearance/WmsClearanceModal.vue b/gslk-wms-web-server/src/views/wms/wmsclearance/WmsClearanceModal.vue index 02e8435..499b321 100644 --- a/gslk-wms-web-server/src/views/wms/wmsclearance/WmsClearanceModal.vue +++ b/gslk-wms-web-server/src/views/wms/wmsclearance/WmsClearanceModal.vue @@ -129,25 +129,45 @@ width: 100, }, { - title: '毛重(千克)', - field: 'kgs', + title: '批次号', + field: 'goodsmodeL2', width: 100, }, { - title: '净重(千克)', - field: 'netweight', + title: '库位', + field: 'areaname', width: 100, }, { - title: '体积', - field: 'cbm', + title: '件数', + field: 'pkgs', width: 100, }, { - title: '件数', - field: 'pkgs', + title: '小件数', + field: 'minpkgs', + width: 100, + }, + // { + // title: '托盘数', + // field: 'pallets', + // width: 100, + // }, + { + title: '毛重(千克)', + field: 'kgs', + width: 100, + }, + { + title: '净重(千克)', + field: 'netweight', width: 100, }, + // { + // title: '体积', + // field: 'cbm', + // width: 100, + // }, { title: '计费单位', field: 'storageunit', diff --git a/gslk-wms-web-server/src/views/wms/wmsoutdo/WmsOutDoModal.vue b/gslk-wms-web-server/src/views/wms/wmsoutdo/WmsOutDoModal.vue index 9c0fae8..dac76d4 100644 --- a/gslk-wms-web-server/src/views/wms/wmsoutdo/WmsOutDoModal.vue +++ b/gslk-wms-web-server/src/views/wms/wmsoutdo/WmsOutDoModal.vue @@ -133,38 +133,53 @@ field: 'goodsmodel', width: 100, }, + { + title: '批次号', + field: 'goodsmodeL2', + width: 100, + }, { title: '库位', field: 'areaname', width: 100, }, { - title: '毛重(千克)', - field: 'kgs', + title: '件数', + field: 'pkgs', width: 100, }, { - title: '净重(千克)', - field: 'netweight', + title: '小件数', + field: 'minpkgs', width: 100, }, + // { + // title: '托盘数', + // field: 'pallets', + // width: 100, + // }, { - title: '体积', - field: 'cbm', + title: '毛重(千克)', + field: 'kgs', width: 100, }, { - title: '件数', - field: 'pkgs', + title: '净重(千克)', + field: 'netweight', width: 100, }, + // { + // title: '体积', + // field: 'cbm', + // width: 100, + // }, { title: '计费单位', field: 'storageunit', width: 100, }, { - title: '数量', + title: '计费数量', field: 'storageunitcount', width: 100, }, diff --git a/gslk-wmsapi-service-client/DS.WMS.Core/System/Method/CommonService.cs b/gslk-wmsapi-service-client/DS.WMS.Core/System/Method/CommonService.cs index 4e486ec..9a9412f 100644 --- a/gslk-wmsapi-service-client/DS.WMS.Core/System/Method/CommonService.cs +++ b/gslk-wmsapi-service-client/DS.WMS.Core/System/Method/CommonService.cs @@ -599,12 +599,14 @@ public class CommonService : ICommonService // .LeftJoin((a, b,c,d,e,f,g) => e.GoodsFeeTypeGID == g.GID) .Select((a, b,c,d,e,f) => new WmsStoreListPagModel() { + BILLTYPE = b.BILLTYPE, STORAGEUNITCOUNT = a.STORAGEUNITCOUNT, STOREHOUSENAME = c.AREANAME, //手动指定一列在自动映射 AREACODENAME = d.AREANAME, GOODSMODEL2 = f.GOODSMODEL2, }, true) + .MergeTable() .Where(whereList).Where(a => a.ClientId == companyId && a.STORAGEUNITCOUNT >0).ToQueryPage(request.PageCondition); return data; } diff --git a/gslk-wmsapi-service-client/DS.WMS.Core/WmsModule/Dtos/WmsClearanceDetailInput.cs b/gslk-wmsapi-service-client/DS.WMS.Core/WmsModule/Dtos/WmsClearanceDetailInput.cs index 8cef5de..dc52f02 100644 --- a/gslk-wmsapi-service-client/DS.WMS.Core/WmsModule/Dtos/WmsClearanceDetailInput.cs +++ b/gslk-wmsapi-service-client/DS.WMS.Core/WmsModule/Dtos/WmsClearanceDetailInput.cs @@ -75,6 +75,16 @@ public class WmsClearanceDetailInput public decimal? SMALLPKGS { get; set; } = 0; public decimal? MINPKGS { get; set; } = 0; + + /// + /// 批次号 + /// + public string GOODSMODEL2 { get; set; }= ""; + + /// + /// 托盘数 + /// + public decimal Pallets { get; set; } = 0; } /// @@ -87,12 +97,14 @@ public class WmsClearanceDetailInputValidator : AbstractValidator public WmsClearanceDetailInputValidator() { + this.RuleFor(o => o.PKGS) + .GreaterThan(0).WithName("件数必须大于零"); this.RuleFor(o => o.STORAGEUNITCOUNT) - .GreaterThan(0).WithMessage("数量必须大于0") + .GreaterThan(0).WithMessage("计费数量必须大于0") .Custom((weight, context) => { if (weight.ToDecimal()<0) { - context.AddFailure("数量必须为正数!"); + context.AddFailure("计费数量必须为正数!"); } }); } diff --git a/gslk-wmsapi-service-client/DS.WMS.Core/WmsModule/Dtos/WmsClearanceGoodsListViewModel.cs b/gslk-wmsapi-service-client/DS.WMS.Core/WmsModule/Dtos/WmsClearanceGoodsListViewModel.cs index 6542914..8f8684f 100644 --- a/gslk-wmsapi-service-client/DS.WMS.Core/WmsModule/Dtos/WmsClearanceGoodsListViewModel.cs +++ b/gslk-wmsapi-service-client/DS.WMS.Core/WmsModule/Dtos/WmsClearanceGoodsListViewModel.cs @@ -75,4 +75,28 @@ public class WmsClearanceGoodsListViewModel public decimal? MINPKGS { get; set; } = 0; public string AREANAME { get; set; } + + /// + /// 批次号 + /// + public string GOODSMODEL2 { get; set; } + + /// + /// 托盘数 + /// + public decimal Pallets { get; set; } + + public string StorageUnitType{ get; set; } + + /// + /// 系数 + /// + public decimal? Coefficient + { + get + { + return MINPKGS / PKGS; + } + + } } \ No newline at end of file diff --git a/gslk-wmsapi-service-client/DS.WMS.Core/WmsModule/Dtos/WmsOutPlanDetailInput.cs b/gslk-wmsapi-service-client/DS.WMS.Core/WmsModule/Dtos/WmsOutPlanDetailInput.cs index 4ff0330..563b2b8 100644 --- a/gslk-wmsapi-service-client/DS.WMS.Core/WmsModule/Dtos/WmsOutPlanDetailInput.cs +++ b/gslk-wmsapi-service-client/DS.WMS.Core/WmsModule/Dtos/WmsOutPlanDetailInput.cs @@ -166,14 +166,14 @@ public class WmsOutPlanDetailInput public string TRUCKNO { get; set; }= ""; /// - /// + /// 批次号 /// - public string GOODSMODEL2 { get; set; } + public string GOODSMODEL2 { get; set; }= ""; /// /// 托盘数 /// - public decimal Pallets { get; set; } + public decimal Pallets { get; set; } = 0; } /// diff --git a/gslk-wmsapi-service-client/DS.WMS.Core/WmsModule/Dtos/WmsStoreListPagModel.cs b/gslk-wmsapi-service-client/DS.WMS.Core/WmsModule/Dtos/WmsStoreListPagModel.cs index b4aa803..8317157 100644 --- a/gslk-wmsapi-service-client/DS.WMS.Core/WmsModule/Dtos/WmsStoreListPagModel.cs +++ b/gslk-wmsapi-service-client/DS.WMS.Core/WmsModule/Dtos/WmsStoreListPagModel.cs @@ -35,6 +35,10 @@ public class WmsStoreListPagModel /// public decimal? PKGS { get; set; } /// + /// 锁库件数 + /// + public decimal? LOCKPKGS { get; set; } = 0; + /// /// Desc: /// public decimal? MINPKGS { get; set; } @@ -57,7 +61,7 @@ public class WmsStoreListPagModel /// /// 锁库计费数量 /// - public decimal? LOCKSTORAGEUNITCOUNT { get; set; } + public decimal? LOCKSTORAGEUNITCOUNT { get; set; } = 0; /// /// 入库日期 @@ -125,15 +129,15 @@ public class WmsStoreListPagModel /// 计费单位类型 /// public string StorageUnitType{ get; set; } - /// - /// 系数 - /// - public decimal? Coefficient - { - get - { - return MINPKGS / PKGS; - } - - } + // /// + // /// 系数 + // /// + // public decimal? Coefficient + // { + // get + // { + // return MINPKGS / PKGS; + // } + // + // } } \ No newline at end of file diff --git a/gslk-wmsapi-service-client/DS.WMS.Core/WmsModule/Entity/OP_WMS_CLEARANCE_DETAIL.cs b/gslk-wmsapi-service-client/DS.WMS.Core/WmsModule/Entity/OP_WMS_CLEARANCE_DETAIL.cs index 5b04657..1bb799b 100644 --- a/gslk-wmsapi-service-client/DS.WMS.Core/WmsModule/Entity/OP_WMS_CLEARANCE_DETAIL.cs +++ b/gslk-wmsapi-service-client/DS.WMS.Core/WmsModule/Entity/OP_WMS_CLEARANCE_DETAIL.cs @@ -191,7 +191,16 @@ public class OP_WMS_CLEARANCE_DETAIL public decimal? MINPKGS { get; set; } public string GOODSMODEL { get; set; } + + /// + /// 批次号 + /// + public string GOODSMODEL2 { get; set; } + /// + /// 托盘数 + /// + public decimal Pallets { get; set; } /// /// 是否PDA执行 /// diff --git a/gslk-wmsapi-service-client/DS.WMS.Core/WmsModule/Method/WmsClearanceService.cs b/gslk-wmsapi-service-client/DS.WMS.Core/WmsModule/Method/WmsClearanceService.cs index 8a5a570..ab7dbba 100644 --- a/gslk-wmsapi-service-client/DS.WMS.Core/WmsModule/Method/WmsClearanceService.cs +++ b/gslk-wmsapi-service-client/DS.WMS.Core/WmsModule/Method/WmsClearanceService.cs @@ -257,9 +257,12 @@ public class WmsClearanceService : IWmsClearanceService { var data = db.Queryable() .LeftJoin((a, b) => a.AREACODE == b.AREACODE) - .Select((a, b) => new WmsClearanceGoodsListViewModel() + .LeftJoin((a, b,c) => a.GoodsId == c.GID && c.ISSTOP ==false) + .LeftJoin((a, b,c,d) => c.GoodsFeeTypeGID == d.GID) + .Select((a, b,c,d) => new WmsClearanceGoodsListViewModel() { - AREANAME = b.AREANAME //手动指定一列在自动映射 + AREANAME = b.AREANAME, //手动指定一列在自动映射 + StorageUnitType = d.STORAGEUNIT_TYPE, }, true) .Where(a => a.WMSPLANID == Guid.Parse(id)).ToList(); @@ -330,7 +333,7 @@ public class WmsClearanceService : IWmsClearanceService } var wmslist = db.Queryable().Where(x => stocklist.Select(x => x.WMSID).Contains(x.WMSID)).ToList(); - + var wmsbaselist = db.Queryable().Where(x => wmslist.Select(x=>x.WMSBASEID).Contains(x.WMSBASEID)).ToList(); if (wmslist.Any(x => x.BILLTYPE == "0")) { return DataResult.Failed("存在非保税库存信息!"); @@ -379,6 +382,7 @@ public class WmsClearanceService : IWmsClearanceService foreach (var item in stocklist) { var wms = wmslist.First(x => x.WMSID == item.WMSID); + var wmsbase = wmsbaselist.First(x => x.WMSBASEID == wms.WMSBASEID); var good = db.Queryable().First(x => x.GID == wms.GoodsId && x.ISSTOP ==false); var detail = item.Adapt(); detail.WMSCLEARANCEDETAILID = Guid.NewGuid(); @@ -389,6 +393,8 @@ public class WmsClearanceService : IWmsClearanceService detail.GOODSNAME = wms.GOODSNAME; detail.GOODSHSCODE = wms.GOODSHSCODE; detail.GOODSMODEL = good.GOODCODE; + detail.GOODSMODEL2 = wmsbase.GOODSMODEL2; + detail.MINPKGS = detail.PKGS *(wms.MINPKGS/wms.PKGS); detail.MBLNO = wms.MBLNO; db.Insertable(detail).ExecuteCommand(); diff --git a/gslk-wmsapi-service-client/DS.WMS.Core/WmsModule/Method/WmsOutPlanService.cs b/gslk-wmsapi-service-client/DS.WMS.Core/WmsModule/Method/WmsOutPlanService.cs index 0266b2d..1fe10dc 100644 --- a/gslk-wmsapi-service-client/DS.WMS.Core/WmsModule/Method/WmsOutPlanService.cs +++ b/gslk-wmsapi-service-client/DS.WMS.Core/WmsModule/Method/WmsOutPlanService.cs @@ -310,7 +310,10 @@ public class WmsOutPlanService : IWmsOutPlanService } var stocklist = db.Queryable().Where(x => model.Ids.Contains(x.WMSPHYSICSID.ToString())).ToList(); - + if (stocklist.Any(x=>x.PKGS == 0)) + { + return DataResult.Failed("存在件数为0的信息!"); + } if (stocklist.Any(x=>x.STORAGEUNITCOUNT == 0)) { return DataResult.Failed("存在库存为0的信息!"); @@ -324,6 +327,8 @@ public class WmsOutPlanService : IWmsOutPlanService var wmslist = db.Queryable().Where(x => stocklist.Select(x=>x.WMSID).Contains(x.WMSID)).ToList(); + var wmsbaselist = db.Queryable().Where(x => wmslist.Select(x=>x.WMSBASEID).Contains(x.WMSBASEID)).ToList(); + if (wmslist.Any(x=>x.BILLTYPE == "1")) { return DataResult.Failed("存在保税库存信息!"); @@ -370,6 +375,7 @@ public class WmsOutPlanService : IWmsOutPlanService foreach (var item in stocklist) { var wms = wmslist.First(x => x.WMSID == item.WMSID); + var wmsbase = wmsbaselist.First(x => x.WMSBASEID == wms.WMSBASEID); var good = db.Queryable().First(x => x.GID == wms.GoodsId && x.ISSTOP ==false); var detail = item.Adapt(); detail.WMSOUTDETAILID = Guid.NewGuid(); @@ -380,6 +386,8 @@ public class WmsOutPlanService : IWmsOutPlanService detail.GOODSNAME = wms.GOODSNAME; detail.GOODSHSCODE = wms.GOODSHSCODE; detail.GOODSMODEL = good.GOODSMODEL; + detail.GOODSMODEL2 = wmsbase.GOODSMODEL2; + detail.MINPKGS = detail.PKGS *(wms.MINPKGS/wms.PKGS); detail.MBLNO = wms.MBLNO; db.Insertable(detail).ExecuteCommand(); diff --git a/gslk-wmsapi-service-client/DS.WMS.WebApi/Logs/internal-nlog.txt b/gslk-wmsapi-service-client/DS.WMS.WebApi/Logs/internal-nlog.txt index f99fb57..47f17fd 100644 --- a/gslk-wmsapi-service-client/DS.WMS.WebApi/Logs/internal-nlog.txt +++ b/gslk-wmsapi-service-client/DS.WMS.WebApi/Logs/internal-nlog.txt @@ -5162,3 +5162,133 @@ 2023-04-20 19:10:52.3465 Info Adding target ColoredConsoleTarget(Name=console) 2023-04-20 19:10:52.4031 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\sdgslk-wms-solution\gslk-wmsapi-service-client\DS.WMS.WebApi\bin\Debug\net6.0\nlog.config 2023-04-20 19:10:52.4234 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2023-04-21 09:02:11.2570 Info Message Template Auto Format enabled +2023-04-21 09:02:11.3053 Info Loading assembly: NLog.Web.AspNetCore +2023-04-21 09:02:11.7852 Info Adding target FileTarget(Name=allfile) +2023-04-21 09:02:11.7967 Info Adding target FileTarget(Name=ownFile-web) +2023-04-21 09:02:11.8447 Info Adding target ColoredConsoleTarget(Name=console) +2023-04-21 09:02:12.1132 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\sdgslk-wms-solution\gslk-wmsapi-service-client\DS.WMS.WebApi\bin\Debug\net6.0\nlog.config +2023-04-21 09:02:12.1621 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2023-04-21 09:31:28.5693 Info Shutdown() called. Logger closing... +2023-04-21 09:31:28.5693 Info Closing old configuration. +2023-04-21 09:31:28.6056 Info Logger has been closed down. +2023-04-21 09:31:49.3080 Info Message Template Auto Format enabled +2023-04-21 09:31:49.3318 Info Loading assembly: NLog.Web.AspNetCore +2023-04-21 09:31:49.4528 Info Adding target FileTarget(Name=allfile) +2023-04-21 09:31:49.4528 Info Adding target FileTarget(Name=ownFile-web) +2023-04-21 09:31:49.4811 Info Adding target ColoredConsoleTarget(Name=console) +2023-04-21 09:31:49.5399 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\sdgslk-wms-solution\gslk-wmsapi-service-client\DS.WMS.WebApi\bin\Debug\net6.0\nlog.config +2023-04-21 09:31:49.5538 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2023-04-21 09:33:17.6703 Info Shutdown() called. Logger closing... +2023-04-21 09:33:17.6719 Info Closing old configuration. +2023-04-21 09:33:17.7158 Info Logger has been closed down. +2023-04-21 09:33:35.3397 Info Message Template Auto Format enabled +2023-04-21 09:33:35.3536 Info Loading assembly: NLog.Web.AspNetCore +2023-04-21 09:33:35.4390 Info Adding target FileTarget(Name=allfile) +2023-04-21 09:33:35.4390 Info Adding target FileTarget(Name=ownFile-web) +2023-04-21 09:33:35.4596 Info Adding target ColoredConsoleTarget(Name=console) +2023-04-21 09:33:35.5009 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\sdgslk-wms-solution\gslk-wmsapi-service-client\DS.WMS.WebApi\bin\Debug\net6.0\nlog.config +2023-04-21 09:33:35.5009 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2023-04-21 09:34:53.4368 Info Shutdown() called. Logger closing... +2023-04-21 09:34:53.4368 Info Closing old configuration. +2023-04-21 09:34:53.4992 Info Logger has been closed down. +2023-04-21 09:35:11.9490 Info Message Template Auto Format enabled +2023-04-21 09:35:11.9618 Info Loading assembly: NLog.Web.AspNetCore +2023-04-21 09:35:12.0452 Info Adding target FileTarget(Name=allfile) +2023-04-21 09:35:12.0452 Info Adding target FileTarget(Name=ownFile-web) +2023-04-21 09:35:12.0654 Info Adding target ColoredConsoleTarget(Name=console) +2023-04-21 09:35:12.1026 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\sdgslk-wms-solution\gslk-wmsapi-service-client\DS.WMS.WebApi\bin\Debug\net6.0\nlog.config +2023-04-21 09:35:12.1115 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2023-04-21 09:39:12.5963 Info Shutdown() called. Logger closing... +2023-04-21 09:39:12.5963 Info Closing old configuration. +2023-04-21 09:39:12.6234 Info Logger has been closed down. +2023-04-21 09:39:31.6836 Info Message Template Auto Format enabled +2023-04-21 09:39:31.6959 Info Loading assembly: NLog.Web.AspNetCore +2023-04-21 09:39:31.8028 Info Adding target FileTarget(Name=allfile) +2023-04-21 09:39:31.8109 Info Adding target FileTarget(Name=ownFile-web) +2023-04-21 09:39:31.8305 Info Adding target ColoredConsoleTarget(Name=console) +2023-04-21 09:39:31.8912 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\sdgslk-wms-solution\gslk-wmsapi-service-client\DS.WMS.WebApi\bin\Debug\net6.0\nlog.config +2023-04-21 09:39:31.9052 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2023-04-21 09:42:19.6229 Info Shutdown() called. Logger closing... +2023-04-21 09:42:19.6237 Info Closing old configuration. +2023-04-21 09:42:19.6573 Info Logger has been closed down. +2023-04-21 09:42:41.4795 Info Message Template Auto Format enabled +2023-04-21 09:42:41.4909 Info Loading assembly: NLog.Web.AspNetCore +2023-04-21 09:42:41.5682 Info Adding target FileTarget(Name=allfile) +2023-04-21 09:42:41.5682 Info Adding target FileTarget(Name=ownFile-web) +2023-04-21 09:42:41.5932 Info Adding target ColoredConsoleTarget(Name=console) +2023-04-21 09:42:41.6314 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\sdgslk-wms-solution\gslk-wmsapi-service-client\DS.WMS.WebApi\bin\Debug\net6.0\nlog.config +2023-04-21 09:42:41.6395 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2023-04-21 09:44:00.8643 Info Shutdown() called. Logger closing... +2023-04-21 09:44:00.8643 Info Closing old configuration. +2023-04-21 09:44:00.9105 Info Logger has been closed down. +2023-04-21 09:44:34.0569 Info Message Template Auto Format enabled +2023-04-21 09:44:34.0691 Info Loading assembly: NLog.Web.AspNetCore +2023-04-21 09:44:34.1490 Info Adding target FileTarget(Name=allfile) +2023-04-21 09:44:34.1490 Info Adding target FileTarget(Name=ownFile-web) +2023-04-21 09:44:34.1675 Info Adding target ColoredConsoleTarget(Name=console) +2023-04-21 09:44:34.2041 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\sdgslk-wms-solution\gslk-wmsapi-service-client\DS.WMS.WebApi\bin\Debug\net6.0\nlog.config +2023-04-21 09:44:34.2041 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2023-04-21 09:55:51.9989 Info Shutdown() called. Logger closing... +2023-04-21 09:55:51.9989 Info Closing old configuration. +2023-04-21 09:55:52.0441 Info Logger has been closed down. +2023-04-21 09:56:19.5660 Info Message Template Auto Format enabled +2023-04-21 09:56:19.5793 Info Loading assembly: NLog.Web.AspNetCore +2023-04-21 09:56:19.6739 Info Adding target FileTarget(Name=allfile) +2023-04-21 09:56:19.6739 Info Adding target FileTarget(Name=ownFile-web) +2023-04-21 09:56:19.7017 Info Adding target ColoredConsoleTarget(Name=console) +2023-04-21 09:56:19.7665 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\sdgslk-wms-solution\gslk-wmsapi-service-client\DS.WMS.WebApi\bin\Debug\net6.0\nlog.config +2023-04-21 09:56:19.7798 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2023-04-21 10:18:15.7577 Info Shutdown() called. Logger closing... +2023-04-21 10:18:15.7577 Info Closing old configuration. +2023-04-21 10:18:15.7961 Info Logger has been closed down. +2023-04-21 10:18:38.9054 Info Message Template Auto Format enabled +2023-04-21 10:18:38.9054 Info Loading assembly: NLog.Web.AspNetCore +2023-04-21 10:18:38.9929 Info Adding target FileTarget(Name=allfile) +2023-04-21 10:18:38.9988 Info Adding target FileTarget(Name=ownFile-web) +2023-04-21 10:18:38.9988 Info Adding target ColoredConsoleTarget(Name=console) +2023-04-21 10:18:39.0494 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\sdgslk-wms-solution\gslk-wmsapi-service-client\DS.WMS.WebApi\bin\Debug\net6.0\nlog.config +2023-04-21 10:18:39.0494 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2023-04-21 14:02:40.0189 Info Shutdown() called. Logger closing... +2023-04-21 14:02:40.0189 Info Closing old configuration. +2023-04-21 14:02:40.0486 Info Logger has been closed down. +2023-04-21 14:03:07.1602 Info Message Template Auto Format enabled +2023-04-21 14:03:07.1708 Info Loading assembly: NLog.Web.AspNetCore +2023-04-21 14:03:07.2479 Info Adding target FileTarget(Name=allfile) +2023-04-21 14:03:07.2479 Info Adding target FileTarget(Name=ownFile-web) +2023-04-21 14:03:07.2643 Info Adding target ColoredConsoleTarget(Name=console) +2023-04-21 14:03:07.3093 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\sdgslk-wms-solution\gslk-wmsapi-service-client\DS.WMS.WebApi\bin\Debug\net6.0\nlog.config +2023-04-21 14:03:07.3187 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2023-04-21 14:05:49.7769 Info Shutdown() called. Logger closing... +2023-04-21 14:05:49.7769 Info Closing old configuration. +2023-04-21 14:05:49.8072 Info Logger has been closed down. +2023-04-21 14:06:14.1587 Info Message Template Auto Format enabled +2023-04-21 14:06:14.1778 Info Loading assembly: NLog.Web.AspNetCore +2023-04-21 14:06:14.2694 Info Adding target FileTarget(Name=allfile) +2023-04-21 14:06:14.2694 Info Adding target FileTarget(Name=ownFile-web) +2023-04-21 14:06:14.2914 Info Adding target ColoredConsoleTarget(Name=console) +2023-04-21 14:06:14.3374 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\sdgslk-wms-solution\gslk-wmsapi-service-client\DS.WMS.WebApi\bin\Debug\net6.0\nlog.config +2023-04-21 14:06:14.3485 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2023-04-21 14:19:49.2826 Info Shutdown() called. Logger closing... +2023-04-21 14:19:49.2826 Info Closing old configuration. +2023-04-21 14:19:49.3169 Info Logger has been closed down. +2023-04-21 14:20:22.7722 Info Message Template Auto Format enabled +2023-04-21 14:20:22.8153 Info Loading assembly: NLog.Web.AspNetCore +2023-04-21 14:20:23.0954 Info Adding target FileTarget(Name=allfile) +2023-04-21 14:20:23.0954 Info Adding target FileTarget(Name=ownFile-web) +2023-04-21 14:20:23.1384 Info Adding target ColoredConsoleTarget(Name=console) +2023-04-21 14:20:23.2292 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\sdgslk-wms-solution\gslk-wmsapi-service-client\DS.WMS.WebApi\bin\Debug\net6.0\nlog.config +2023-04-21 14:20:23.2505 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2023-04-21 16:07:07.6220 Info Shutdown() called. Logger closing... +2023-04-21 16:07:07.6235 Info Closing old configuration. +2023-04-21 16:07:07.6708 Info Logger has been closed down. +2023-04-21 16:07:33.6407 Info Message Template Auto Format enabled +2023-04-21 16:07:33.6617 Info Loading assembly: NLog.Web.AspNetCore +2023-04-21 16:07:33.8348 Info Adding target FileTarget(Name=allfile) +2023-04-21 16:07:33.8431 Info Adding target FileTarget(Name=ownFile-web) +2023-04-21 16:07:33.8813 Info Adding target ColoredConsoleTarget(Name=console) +2023-04-21 16:07:33.9353 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\sdgslk-wms-solution\gslk-wmsapi-service-client\DS.WMS.WebApi\bin\Debug\net6.0\nlog.config +2023-04-21 16:07:33.9353 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2023-04-21 18:08:38.7095 Info Shutdown() called. Logger closing... +2023-04-21 18:08:38.7095 Info Closing old configuration. +2023-04-21 18:08:38.7710 Info Logger has been closed down. diff --git a/gslk-wmsapi-service-server/DS.WMS.Core/App/Dtos/ClearanceMovePlanGoodsBatchInput.cs b/gslk-wmsapi-service-server/DS.WMS.Core/App/Dtos/ClearanceMovePlanGoodsBatchInput.cs index 2ed3450..b353cb3 100644 --- a/gslk-wmsapi-service-server/DS.WMS.Core/App/Dtos/ClearanceMovePlanGoodsBatchInput.cs +++ b/gslk-wmsapi-service-server/DS.WMS.Core/App/Dtos/ClearanceMovePlanGoodsBatchInput.cs @@ -1,3 +1,6 @@ +using DS.Module.Core.Extensions; +using FluentValidation; + namespace DS.WMS.Core.App.Dtos; public class ClearanceMovePlanGoodsBatchInput @@ -94,9 +97,30 @@ public class ClearanceMovePlanGoodsInput /// 新库位 /// public string MOVEAREACODE { get; set; } = ""; - + /// + /// + /// + public string GOODSMODEL2 { get; set; } = ""; /// /// 是否PDA执行 /// public bool? ISEXECUTE { get; set; } = false; +} + +public class ClearanceMovePlanGoodsInputValidation : AbstractValidator +{ + public ClearanceMovePlanGoodsInputValidation() + { + this.RuleFor(o => o.PKGS) + .GreaterThan(0).WithName("件数必须大于零"); + this.RuleFor(o => o.STORAGEUNITCOUNT) + .GreaterThan(0).WithMessage("计费数量必须大于0") + .Custom((weight, context) => + { + if (weight.ToDecimal() < 0) + { + context.AddFailure("计费数量必须为正数!"); + } + }); + } } \ No newline at end of file diff --git a/gslk-wmsapi-service-server/DS.WMS.Core/App/Dtos/ClearanceOutPlanGoodsInput.cs b/gslk-wmsapi-service-server/DS.WMS.Core/App/Dtos/ClearanceOutPlanGoodsInput.cs index 8092831..0450d4b 100644 --- a/gslk-wmsapi-service-server/DS.WMS.Core/App/Dtos/ClearanceOutPlanGoodsInput.cs +++ b/gslk-wmsapi-service-server/DS.WMS.Core/App/Dtos/ClearanceOutPlanGoodsInput.cs @@ -1,3 +1,6 @@ +using DS.Module.Core.Extensions; +using FluentValidation; + namespace DS.WMS.Core.App.Dtos; public class ClearanceOutPlanGoodsInput @@ -11,7 +14,7 @@ public class ClearanceOutPlanGoodsInput public string MATERIALNO { get; set; } = ""; - public string GoodsId { get; set; } = ""; + public string GoodsId { get; set; } = ""; public string GOODSCODE { get; set; } = ""; public string GOODSNAME { get; set; } = ""; @@ -20,7 +23,7 @@ public class ClearanceOutPlanGoodsInput public string GOODSHSCODE { get; set; } = ""; public string GOODSMODEL { get; set; } = ""; - + public string MBLNO { get; set; } = ""; @@ -72,8 +75,31 @@ public class ClearanceOutPlanGoodsInput public decimal? MINPKGS { get; set; } = 0; + /// + /// + /// + public string GOODSMODEL2 { get; set; } = ""; + /// /// 是否PDA执行 /// public bool? ISEXECUTE { get; set; } = false; +} + +public class ClearanceOutPlanGoodsInputValidation : AbstractValidator +{ + public ClearanceOutPlanGoodsInputValidation() + { + this.RuleFor(o => o.PKGS) + .GreaterThan(0).WithName("件数必须大于零"); + this.RuleFor(o => o.STORAGEUNITCOUNT) + .GreaterThan(0).WithMessage("计费数量必须大于0") + .Custom((weight, context) => + { + if (weight.ToDecimal() < 0) + { + context.AddFailure("计费数量必须为正数!"); + } + }); + } } \ No newline at end of file diff --git a/gslk-wmsapi-service-server/DS.WMS.Core/App/Dtos/ClearanceOutPlanGoodsViewModel.cs b/gslk-wmsapi-service-server/DS.WMS.Core/App/Dtos/ClearanceOutPlanGoodsViewModel.cs index 9bb7b7c..556d058 100644 --- a/gslk-wmsapi-service-server/DS.WMS.Core/App/Dtos/ClearanceOutPlanGoodsViewModel.cs +++ b/gslk-wmsapi-service-server/DS.WMS.Core/App/Dtos/ClearanceOutPlanGoodsViewModel.cs @@ -91,4 +91,21 @@ public class ClearanceOutPlanGoodsViewModel /// 库位 /// public string AREANAME { get; set; } = ""; + + /// + /// 批次号 + /// + public string GOODSMODEL2 { get; set; } = ""; + public string StorageUnitType{ get; set; } + /// + /// 系数 + /// + public decimal? Coefficient + { + get + { + return MINPKGS / PKGS; + } + + } } \ No newline at end of file diff --git a/gslk-wmsapi-service-server/DS.WMS.Core/App/Dtos/StockInPlanGoodsInput.cs b/gslk-wmsapi-service-server/DS.WMS.Core/App/Dtos/StockInPlanGoodsInput.cs index 5181f78..d45f296 100644 --- a/gslk-wmsapi-service-server/DS.WMS.Core/App/Dtos/StockInPlanGoodsInput.cs +++ b/gslk-wmsapi-service-server/DS.WMS.Core/App/Dtos/StockInPlanGoodsInput.cs @@ -1,4 +1,5 @@ using DS.Module.Core; +using DS.Module.Core.Extensions; using FluentValidation; namespace DS.WMS.Core.App.Dtos; @@ -126,12 +127,22 @@ public class StockInPlanGoodsInputValidation : AbstractValidator o.PKGS) + // .NotEmpty().WithMessage("件数不能为空") + // .Must(PKGSCheck); + // this.RuleFor(o => o.STORAGEUNITCOUNT) + // .NotEmpty().WithMessage("计费数量不能为空") + // .Must(STORAGEUNITCOUNTCheck); this.RuleFor(o => o.PKGS) - .NotEmpty().WithMessage("件数不能为空") - .Must(PKGSCheck); + .GreaterThan(0).WithName("件数必须大于零"); this.RuleFor(o => o.STORAGEUNITCOUNT) - .NotEmpty().WithMessage("计费数量不能为空") - .Must(STORAGEUNITCOUNTCheck); + .GreaterThan(0).WithMessage("计费数量必须大于0") + .Custom((weight, context) => { + if (weight.ToDecimal()<0) + { + context.AddFailure("计费数量必须为正数!"); + } + }); } private bool KGSCheck(StockInPlanGoodsInput instance, decimal? amount, diff --git a/gslk-wmsapi-service-server/DS.WMS.Core/App/Dtos/StockOutPlanGoodsBatchInput.cs b/gslk-wmsapi-service-server/DS.WMS.Core/App/Dtos/StockOutPlanGoodsBatchInput.cs index a80315b..6a299de 100644 --- a/gslk-wmsapi-service-server/DS.WMS.Core/App/Dtos/StockOutPlanGoodsBatchInput.cs +++ b/gslk-wmsapi-service-server/DS.WMS.Core/App/Dtos/StockOutPlanGoodsBatchInput.cs @@ -1,6 +1,6 @@ namespace DS.WMS.Core.App.Dtos; -public class StockOutPlanGoodsBatchInput +public class StockOutPlanGoodsBatchInput { /// /// 主表ID diff --git a/gslk-wmsapi-service-server/DS.WMS.Core/App/Dtos/StockOutPlanGoodsInput.cs b/gslk-wmsapi-service-server/DS.WMS.Core/App/Dtos/StockOutPlanGoodsInput.cs index 7318df9..ccf0910 100644 --- a/gslk-wmsapi-service-server/DS.WMS.Core/App/Dtos/StockOutPlanGoodsInput.cs +++ b/gslk-wmsapi-service-server/DS.WMS.Core/App/Dtos/StockOutPlanGoodsInput.cs @@ -1,4 +1,5 @@ using DS.Module.Core; +using DS.Module.Core.Extensions; using FluentValidation; namespace DS.WMS.Core.App.Dtos; @@ -158,6 +159,11 @@ public class StockOutPlanGoodsInput /// /// public string GOODSMODEL { get; set; } = ""; + /// + /// + /// + public string GOODSMODEL2 { get; set; } = ""; + /// /// @@ -172,9 +178,19 @@ public class StockOutPlanGoodsInputValidation : AbstractValidator o.PKGS) // .NotEmpty().WithMessage("件数不能为空") // .Must(PKGSCheck); + // this.RuleFor(o => o.STORAGEUNITCOUNT) + // .NotEmpty().WithMessage("计费数量不能为空") + // .Must(STORAGEUNITCOUNTCheck); + this.RuleFor(o => o.PKGS) + .GreaterThan(0).WithName("件数必须大于零"); this.RuleFor(o => o.STORAGEUNITCOUNT) - .NotEmpty().WithMessage("数量不能为空") - .Must(STORAGEUNITCOUNTCheck); + .GreaterThan(0).WithMessage("计费数量必须大于0") + .Custom((weight, context) => { + if (weight.ToDecimal()<0) + { + context.AddFailure("计费数量必须为正数!"); + } + }); } private bool STORAGEUNITCOUNTCheck(StockOutPlanGoodsInput instance, decimal? amount, @@ -191,6 +207,22 @@ public class StockOutPlanGoodsInputValidation : AbstractValidator context) + { + // 必须是正数,且最多有6位小数 + if (amount.HasValue) + { + var moneyCheck = amount.Value.CheckMoney("件数", true, 6); + if (!moneyCheck.isSuccess) + { + context.AddFailure(moneyCheck.errMsg); + return false; + } + } + return true; } } \ No newline at end of file diff --git a/gslk-wmsapi-service-server/DS.WMS.Core/App/Dtos/StockOutPlanGoodsViewModel.cs b/gslk-wmsapi-service-server/DS.WMS.Core/App/Dtos/StockOutPlanGoodsViewModel.cs index 1fc76e8..ba7d182 100644 --- a/gslk-wmsapi-service-server/DS.WMS.Core/App/Dtos/StockOutPlanGoodsViewModel.cs +++ b/gslk-wmsapi-service-server/DS.WMS.Core/App/Dtos/StockOutPlanGoodsViewModel.cs @@ -144,65 +144,7 @@ public class StockOutPlanGoodsViewModel /// public string PALLET { get; set; } - /// - /// - /// - public bool? BOOLFIELD_01 { get; set; } - - /// - /// - /// - public bool? BOOLFIELD_02 { get; set; } - - /// - /// - /// - public bool? BOOLFIELD_03 { get; set; } - - /// - /// - /// - public bool? BOOLFIELD_04 { get; set; } - - /// - /// - /// - public bool? BOOLFIELD_05 { get; set; } - - /// - /// - /// - public bool? BOOLFIELD_06 { get; set; } - - /// - /// - /// - public string STRFIELD_01 { get; set; } - - /// - /// - /// - public string STRFIELD_02 { get; set; } - - /// - /// - /// - public string STRFIELD_03 { get; set; } - - /// - /// - /// - public string STRFIELD_04 { get; set; } - - /// - /// - /// - public string STRFIELD_05 { get; set; } - - /// - /// - /// - public string STRFIELD_06 { get; set; } + /// /// @@ -220,7 +162,10 @@ public class StockOutPlanGoodsViewModel /// /// public string GOODSMODEL { get; set; } = ""; - + /// + /// 批次号 + /// + public string GOODSMODEL2 { get; set; } = ""; /// /// /// @@ -244,4 +189,16 @@ public class StockOutPlanGoodsViewModel /// 库位 /// public string AREANAME { get; set; } = ""; + public string StorageUnitType{ get; set; } + /// + /// 系数 + /// + public decimal? Coefficient + { + get + { + return MINPKGS / PKGS; + } + + } } \ No newline at end of file diff --git a/gslk-wmsapi-service-server/DS.WMS.Core/App/Dtos/WmsSummaryInfo.cs b/gslk-wmsapi-service-server/DS.WMS.Core/App/Dtos/WmsSummaryInfo.cs index 61f2cb1..da95946 100644 --- a/gslk-wmsapi-service-server/DS.WMS.Core/App/Dtos/WmsSummaryInfo.cs +++ b/gslk-wmsapi-service-server/DS.WMS.Core/App/Dtos/WmsSummaryInfo.cs @@ -18,4 +18,12 @@ public class WmsSummaryInfo /// 库位选择数据源 /// public List AreaList { get; set; } + + + /// + /// + /// + public string MOVESTOREHOUSE { get; set; } + + public string MOVESTOREHOUSENAME { get; set; } } \ No newline at end of file diff --git a/gslk-wmsapi-service-server/DS.WMS.Core/App/Method/AppClearanceService.cs b/gslk-wmsapi-service-server/DS.WMS.Core/App/Method/AppClearanceService.cs index d988046..162f33d 100644 --- a/gslk-wmsapi-service-server/DS.WMS.Core/App/Method/AppClearanceService.cs +++ b/gslk-wmsapi-service-server/DS.WMS.Core/App/Method/AppClearanceService.cs @@ -7,6 +7,7 @@ using DS.WMS.Core.App.Interface; using DS.WMS.Core.BaseInfo.Entity; using DS.WMS.Core.System.Entity; using DS.WMS.Core.WmsModule.Entity; +using DS.WMS.Core.WmsModule.Interface; using Mapster; using Microsoft.Extensions.DependencyInjection; using SqlSugar; @@ -20,7 +21,7 @@ public class AppClearanceService : IAppClearanceService private readonly IServiceProvider _serviceProvider; private readonly ISqlSugarClient db; private readonly IUser user; - + private readonly IWmsCommonService _wmsCommonService; /// /// /// @@ -30,6 +31,7 @@ public class AppClearanceService : IAppClearanceService _serviceProvider = serviceProvider; db = _serviceProvider.GetRequiredService(); user = _serviceProvider.GetRequiredService(); + _wmsCommonService = _serviceProvider.GetRequiredService(); } public DataResult GetClearancePlanList(ClearancePlanQueryModel model) @@ -77,6 +79,7 @@ public class AppClearanceService : IAppClearanceService data.TRUCKNO = model.TRUCKNO; data.MBLNO = info.MBLNO; data.STOREHOUSENAME = store.AREANAME; + data.MOVESTOREHOUSENAME = db.Queryable().First(x => x.AREACODE == info.MoveStoreHouse).AREANAME; data.AreaList = db.Queryable() .LeftJoin((a, b) => a.Pid == b.Id) @@ -92,7 +95,7 @@ public class AppClearanceService : IAppClearanceService public DataResult GetClearanceGoodsInfo(StockGoodsQueryModel model) { - var goods = db.Queryable().Where(a => a.WMSPLANID == model.WMSPLANID) + var goods = db.Queryable().Where(a => a.WMSPLANID == model.WMSPLANID && a.ISEXECUTE ==false) .LeftJoin((a, b) => a.GoodsId == b.GID && b.ISSTOP ==false) .Where((a, b) => b.PinYinCode.Contains(model.Code)) .LeftJoin( @@ -100,17 +103,19 @@ public class AppClearanceService : IAppClearanceService "select WMSPLANDETAILID, sum(PKGS) AS PKGS,SUM(STORAGEUNITCOUNT) AS STORAGEUNITCOUNT from OP_WMS_OUT_DO_GOODS WHERE WMSPLANDETAILID is not null GROUP BY WMSPLANDETAILID"), (a, b, StockDoGoods) => a.WMSCLEARANCEDETAILID == StockDoGoods.WMSPLANDETAILID) .LeftJoin((a, b, StockDoGoods, d) => a.AREACODE == d.AREACODE) - .Select((a, b, StockDoGoods, d) => new ClearanceOutPlanGoodsViewModel() + .LeftJoin((a, b, StockDoGoods, d,f) => b.GoodsFeeTypeGID == f.GID) + .Select((a, b, StockDoGoods, d,f) => new ClearanceOutPlanGoodsViewModel() { PKGS = a.PKGS, STORAGEUNITCOUNT = a.STORAGEUNITCOUNT, DOSTORAGEUNITCOUNT = StockDoGoods.STORAGEUNITCOUNT, DOPKGS = StockDoGoods.PKGS, //手动指定一列在自动映射 - AREANAME = d.AREANAME + AREANAME = d.AREANAME, + StorageUnitType = f.STORAGEUNIT_TYPE, }, true) - .First(); - if (goods.IsNull()) + .Take(5).ToList(); + if (goods.Count == 0) { return DataResult.Failed("未检索到数据!"); } @@ -175,9 +180,14 @@ public class AppClearanceService : IAppClearanceService doGoods.WMSDODETAILID = Guid.NewGuid(); doGoods.WMSDOID = doId; doGoods.WMSPLANDETAILID = item.WMSCLEARANCEDETAILID; - // doGoods.PKGS = item.PKGS; + doGoods.PKGS = item.PKGS; + doGoods.MINPKGS = item.MINPKGS; + doGoods.KGS = item.KGS; + doGoods.NETWEIGHT = item.NETWEIGHT; + doGoods.KINDPKGS = item.KINDPKGS; doGoods.STORAGEUNITCOUNT = item.STORAGEUNITCOUNT; doGoods.STOREHOUSE = stockDo.STOREHOUSE; + doGoods.GOODSMODEL2 = item.GOODSMODEL2; doGoodsList.Add(doGoods); } @@ -217,36 +227,56 @@ public class AppClearanceService : IAppClearanceService var stockids = model.Goods.Select(x => x.WMSPHYSICSID).ToList(); var stocklist = db.Queryable().Where(x => stockids.Contains(x.WMSPHYSICSID)).ToList(); - // foreach (var item in model.Goods) - // { - // var stockinfo = stocklist.Where(x => x.WMSPHYSICSID == item.WMSPHYSICSID).First(); - // - // if (item.STORAGEUNITCOUNT > stockinfo.STORAGEUNITCOUNT) - // { - // return DataResult.Failed("清关计划明细商品[" + item.GOODSNAME +"]计费数量:" + stockinfo.STORAGEUNITCOUNT +" 不足,不能审批!"); - // } - // } + foreach (var item in model.Goods) + { + var stockinfo = stocklist.Where(x => x.WMSPHYSICSID == item.WMSPHYSICSID).First(); + + if (item.PKGS > stockinfo.LOCKPKGS) + { + return DataResult.Failed("清关计划明细商品[" + item.GOODSNAME +"]锁定库存数量:" + stockinfo.LOCKPKGS +" 不足,不能审批!"); + } + // if (item.STORAGEUNITCOUNT > stockinfo.LOCKSTORAGEUNITCOUNT) + // { + // return DataResult.Failed("清关计划明细商品[" + item.GOODSNAME +"]锁定计费数量:" + stockinfo.LOCKSTORAGEUNITCOUNT +" 不足,不能审批!"); + // } + } try { //开启事务 db.Ado.BeginTran(); - #region 处理锁库数量 + #region 处理移库相关逻辑 foreach (var item in model.Goods) { - var wms = db.Queryable().First(x => x.WMSID == item.WMSID); - wms.BILLTYPE = "0"; //改为非保税 - db.Updateable(wms).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand(); + var wms = db.Queryable().First(x => x.WMSID == item.WMSID); var stocking = stocklist.Where(x => x.WMSPHYSICSID == item.WMSPHYSICSID).First(); - stocking.STOREHOUSE = plan.MoveStoreHouse; - stocking.AREACODE = item.MOVEAREACODE; - stocking.STORAGEUNITCOUNT += item.STORAGEUNITCOUNT; - stocking.LOCKSTORAGEUNITCOUNT -= item.STORAGEUNITCOUNT; - - db.Updateable(stocking).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand(); - + + var oldwms = _wmsCommonService.OpWmsReduce_ClearanceMove(wms,item).Data; + db.Updateable(oldwms).ExecuteCommand(); + + var oldwmsChange = _wmsCommonService.OpWmsChange_ClearanceMove(wms,plan,item).Data; + db.Updateable(oldwmsChange).ExecuteCommand(); + + + var oldwmsPhysicsChange = _wmsCommonService.OpWmsPhysicsChange_ClearanceMove(stocking,plan,item).Data; + db.Updateable(oldwmsPhysicsChange).ExecuteCommand(); + + var oldphysics = _wmsCommonService.OpWmsPhysicsReduce_ClearanceMove(stocking,item).Data; + db.Updateable(oldphysics).ExecuteCommand(); + + var newWms = _wmsCommonService.OpWmsInit_ClearanceMove(wms,item).Data; + db.Insertable(newWms).ExecuteCommand(); + + var newWmsChange = _wmsCommonService.InitOpWmsChange_ClearanceMove(newWms,plan,item).Data; + db.Insertable(newWmsChange).ExecuteCommand(); + + var newphysics = _wmsCommonService.InitOpWmsPhysics_ClearanceMove(newWms,plan,item).Data; + db.Insertable(newphysics).ExecuteCommand(); + var newWmsPhysicsChange = _wmsCommonService.InitOpWmsPhysicsChange_ClearanceMove(newWms.WMSID,newphysics.WMSPHYSICSID,item).Data; + db.Insertable(newWmsPhysicsChange).ExecuteCommand(); + //处理执行标识 var detail = db.Queryable() .First(x => x.WMSCLEARANCEDETAILID == item.WMSCLEARANCEDETAILID); diff --git a/gslk-wmsapi-service-server/DS.WMS.Core/App/Method/AppStockInService.cs b/gslk-wmsapi-service-server/DS.WMS.Core/App/Method/AppStockInService.cs index 1a98222..ab0ca92 100644 --- a/gslk-wmsapi-service-server/DS.WMS.Core/App/Method/AppStockInService.cs +++ b/gslk-wmsapi-service-server/DS.WMS.Core/App/Method/AppStockInService.cs @@ -100,7 +100,7 @@ public class AppStockInService : IAppStockInService public DataResult GetStockInGoodsInfo(StockGoodsQueryModel model) { - var goods = db.Queryable().Where(a => a.WMSPLANID == model.WMSPLANID) + var goods = db.Queryable().Where(a => a.WMSPLANID == model.WMSPLANID && a.ISEXECUTE ==false) .LeftJoin((a, b) => a.GoodsId == b.GID && b.ISSTOP ==false) .Where((a, b) => b.PinYinCode.Contains(model.Code)) .LeftJoin((a, b,c) => b.GoodsFeeTypeGID == c.GID) @@ -120,6 +120,10 @@ public class AppStockInService : IAppStockInService // .Select() // .Where(a => a.STORAGEUNITCOUNT > b.DOSTORAGEUNITCOUNT) .Take(5).ToList(); + if (goods.Count == 0) + { + return DataResult.Failed("未检索到数据!"); + } return DataResult.Successed("获取数据成功", goods); } diff --git a/gslk-wmsapi-service-server/DS.WMS.Core/App/Method/AppStockOutService.cs b/gslk-wmsapi-service-server/DS.WMS.Core/App/Method/AppStockOutService.cs index cd53581..2a452b2 100644 --- a/gslk-wmsapi-service-server/DS.WMS.Core/App/Method/AppStockOutService.cs +++ b/gslk-wmsapi-service-server/DS.WMS.Core/App/Method/AppStockOutService.cs @@ -85,7 +85,7 @@ public class AppStockOutService:IAppStockOutService public DataResult GetStockOutGoodsInfo(StockGoodsQueryModel model) { - var goods = db.Queryable().Where(a => a.WMSPLANID == model.WMSPLANID) + var goods = db.Queryable().Where(a => a.WMSPLANID == model.WMSPLANID && a.ISEXECUTE ==false) .LeftJoin((a, b) => a.GoodsId == b.GID && b.ISSTOP ==false) .Where((a, b) => b.PinYinCode.Contains(model.Code)) .LeftJoin( @@ -93,17 +93,19 @@ public class AppStockOutService:IAppStockOutService "select WMSPLANDETAILID, sum(PKGS) AS PKGS,SUM(STORAGEUNITCOUNT) AS STORAGEUNITCOUNT from OP_WMS_OUT_DO_GOODS WHERE WMSPLANDETAILID is not null GROUP BY WMSPLANDETAILID"), (a, b, StockDoGoods) => a.WMSOUTDETAILID == StockDoGoods.WMSPLANDETAILID) .LeftJoin((a, b, StockDoGoods, d) => a.AREACODE == d.AREACODE) - .Select((a, b, StockDoGoods, d) => new StockOutPlanGoodsViewModel() + .LeftJoin((a, b, StockDoGoods, d,f) => b.GoodsFeeTypeGID == f.GID) + .Select((a, b, StockDoGoods, d,f) => new StockOutPlanGoodsViewModel() { PKGS = a.PKGS, STORAGEUNITCOUNT = a.STORAGEUNITCOUNT, DOSTORAGEUNITCOUNT = StockDoGoods.STORAGEUNITCOUNT, DOPKGS = StockDoGoods.PKGS, //手动指定一列在自动映射 - AREANAME = d.AREANAME + AREANAME = d.AREANAME, + StorageUnitType = f.STORAGEUNIT_TYPE, }, true) - .First(); - if (goods.IsNull()) + .Take(5).ToList(); + if (goods.Count == 0) { return DataResult.Failed("未检索到数据!"); } @@ -168,9 +170,14 @@ public class AppStockOutService:IAppStockOutService doGoods.WMSDODETAILID = Guid.NewGuid(); doGoods.WMSDOID = doId; doGoods.WMSPLANDETAILID = item.WMSOUTDETAILID; - // doGoods.PKGS = item.PKGS; + doGoods.PKGS = item.PKGS; + doGoods.MINPKGS = item.MINPKGS; + doGoods.KGS = item.KGS; + doGoods.NETWEIGHT = item.NETWEIGHT; + doGoods.KINDPKGS = item.KINDPKGS; doGoods.STORAGEUNITCOUNT = item.STORAGEUNITCOUNT; doGoods.STOREHOUSE = stockDo.STOREHOUSE; + doGoods.GOODSMODEL2 = item.GOODSMODEL2; doGoodsList.Add(doGoods); } diff --git a/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Dtos/WmsClearanceGoodsListViewModel.cs b/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Dtos/WmsClearanceGoodsListViewModel.cs index 3da7aa9..906f143 100644 --- a/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Dtos/WmsClearanceGoodsListViewModel.cs +++ b/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Dtos/WmsClearanceGoodsListViewModel.cs @@ -75,4 +75,14 @@ public class WmsClearanceGoodsListViewModel public decimal? MINPKGS { get; set; } = 0; public string AREANAME { get; set; } + + /// + /// 批次号 + /// + public string GOODSMODEL2 { get; set; }= ""; + + /// + /// 托盘数 + /// + public decimal Pallets { get; set; } = 0; } \ No newline at end of file diff --git a/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Entity/OP_WMS_CLEARANCE_DETAIL.cs b/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Entity/OP_WMS_CLEARANCE_DETAIL.cs index f54f572..9220d26 100644 --- a/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Entity/OP_WMS_CLEARANCE_DETAIL.cs +++ b/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Entity/OP_WMS_CLEARANCE_DETAIL.cs @@ -190,7 +190,15 @@ public class OP_WMS_CLEARANCE_DETAIL public decimal? MINPKGS { get; set; } public string GOODSMODEL { get; set; } + /// + /// 批次号 + /// + public string GOODSMODEL2 { get; set; }= ""; + /// + /// 托盘数 + /// + public decimal Pallets { get; set; } = 0; /// /// 是否PDA执行 /// diff --git a/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Entity/OP_WMS_OUT_DO_GOODS.cs b/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Entity/OP_WMS_OUT_DO_GOODS.cs index 06f2092..baaf423 100644 --- a/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Entity/OP_WMS_OUT_DO_GOODS.cs +++ b/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Entity/OP_WMS_OUT_DO_GOODS.cs @@ -42,6 +42,11 @@ /// /// public string GOODSMODEL { get; set; } + + /// + /// 批次号 + /// + public string GOODSMODEL2 { get; set; } /// /// diff --git a/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Entity/Op_Wms_Change.cs b/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Entity/Op_Wms_Change.cs index 34e02ce..e00d5ca 100644 --- a/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Entity/Op_Wms_Change.cs +++ b/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Entity/Op_Wms_Change.cs @@ -1,3 +1,5 @@ +using DS.WMS.Core.App.Dtos; + namespace DS.WMS.Core.WmsModule.Entity; public struct WMSCHANGTYPE @@ -69,6 +71,44 @@ public partial class OP_WMS_CHANGE CHANGETYPE = WMSCHANGTYPE.入库; } /// + /// 清关移库 入库 + /// + /// + public void setNew(ClearanceMovePlanGoodsInput ingoods) { + + KGS2 = 0; + NETWEIGHT2 = 0; + CBM2 = 0; + PKGS2 = 0; + SMALLPKGS2 = 0; + MINPKGS2 = 0; + KINDPKGS2 = ""; + PAYEDTAXES2 = false; + STORAGEUNIT2 = ""; + STORAGEUNITCOUNT2 = 0; + RULEUNIT2 = ""; + RULEUNITCOUNT2 = 0; + + + KGS3 = KGS; + NETWEIGHT3 = NETWEIGHT; + CBM3 = CBM; + PKGS3 = PKGS; + SMALLPKGS3 = SMALLPKGS; + MINPKGS3 = MINPKGS; + KINDPKGS3 = KINDPKGS; + PAYEDTAXES3 = false; + STORAGEUNIT3 = STORAGEUNIT; + STORAGEUNITCOUNT3 = STORAGEUNITCOUNT; + RULEUNIT3 = RULEUNIT; + RULEUNITCOUNT3 = RULEUNITCOUNT; + + DOBSNO = ingoods.WMSPLANID.ToString(); + DOGID = ingoods.WMSCLEARANCEDETAILID; + + CHANGETYPE = WMSCHANGTYPE.入库; + } + /// /// /// [SqlSugar.SugarColumn(IsPrimaryKey = true)] diff --git a/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Entity/Op_Wms_Physics_Change.cs b/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Entity/Op_Wms_Physics_Change.cs index b4e151c..a3dfebb 100644 --- a/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Entity/Op_Wms_Physics_Change.cs +++ b/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Entity/Op_Wms_Physics_Change.cs @@ -1,3 +1,5 @@ +using DS.WMS.Core.App.Dtos; + namespace DS.WMS.Core.WmsModule.Entity; /// @@ -49,6 +51,42 @@ public partial class OP_WMS_PHYSICS_CHANGE DOGID = ingoods.WMSDODETAILID.ToString(); CHANGETYPE = WMSCHANGTYPE.入库; } + + public void setNew(ClearanceMovePlanGoodsInput ingoods) + { + + KGS2 = 0; + NETWEIGHT2 = 0; + CBM2 = 0; + PKGS2 = 0; + SMALLPKGS2 = 0; + MINPKGS2 = 0; + KINDPKGS2 = ""; + STORAGEUNIT2 = ""; + STORAGEUNITCOUNT2 = 0; + RULEUNIT2 = ""; + RULEUNITCOUNT2 = 0; + STOREHOUSE2 = ingoods.STOREHOUSE; + AREACODE2 = ingoods.AREACODE; + + KGS3 = KGS; + NETWEIGHT3 = NETWEIGHT; + CBM3 = CBM; + PKGS3 = PKGS; + SMALLPKGS3 = SMALLPKGS; + MINPKGS3 = MINPKGS; + KINDPKGS3 = KINDPKGS; + STOREHOUSE3 = STOREHOUSE; + AREACODE3 = AREACODE; + STORAGEUNIT3 = STORAGEUNIT; + STORAGEUNITCOUNT3 = STORAGEUNITCOUNT; + RULEUNIT3 = RULEUNIT; + RULEUNITCOUNT3 = RULEUNITCOUNT; + + DOBSNO = ingoods.WMSPLANID.ToString(); + DOGID = ingoods.WMSCLEARANCEDETAILID.ToString(); + CHANGETYPE = WMSCHANGTYPE.入库; + } /// /// /// diff --git a/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Interface/WmsCommonBaseService.cs b/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Interface/WmsCommonBaseService.cs index 14b7e82..0104bf3 100644 --- a/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Interface/WmsCommonBaseService.cs +++ b/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Interface/WmsCommonBaseService.cs @@ -1,4 +1,5 @@ using DS.Module.Core; +using DS.WMS.Core.App.Dtos; using DS.WMS.Core.WmsModule.Entity; namespace DS.WMS.Core.WmsModule.Interface; @@ -75,4 +76,81 @@ public interface IWmsCommonService /// /// public DataResult OpWmsPhysicsOutReduce (OP_WMS_PHYSICS physics,OP_WMS_OUT_DO_GOODS doGoods); + + #region 清关移库 + + /// + /// 清关移库 原 OP_WMS减库存 + /// + /// + /// + /// + public DataResult OpWmsReduce_ClearanceMove(OP_WMS wms, ClearanceMovePlanGoodsInput doGoods); + /// + /// 清关移库 原库存 OP_WMS_CHANGE + /// + /// + /// + /// + /// + public DataResult OpWmsChange_ClearanceMove(OP_WMS wms, OP_WMS_CLEARANCE wmsClearance, + ClearanceMovePlanGoodsInput doGoods); + /// + /// 初始化 新库存 OP_WMS + /// + /// + /// + /// + public DataResult OpWmsInit_ClearanceMove(OP_WMS wms, ClearanceMovePlanGoodsInput doGoods); + /// + /// 清关移库 新库存 OP_WMS_CHANGE 初始化 + /// + /// + /// + /// + /// + public DataResult InitOpWmsChange_ClearanceMove(OP_WMS wms, OP_WMS_CLEARANCE wmsInDo, + ClearanceMovePlanGoodsInput doGoods); + /// + /// 清关移库 原库存 OP_WMS_PHYSICS减少 + /// + /// + /// + /// + public DataResult OpWmsPhysicsReduce_ClearanceMove(OP_WMS_PHYSICS physics, + ClearanceMovePlanGoodsInput doGoods); + /// + /// 清关移库 原库存 OP_WMS_PHYSICS_CHANGE + /// + /// + /// + /// + /// + public DataResult OpWmsPhysicsChange_ClearanceMove(OP_WMS_PHYSICS physics, + OP_WMS_CLEARANCE wmsClearance, + ClearanceMovePlanGoodsInput doGoods); + /// + /// 清关移库 新库存 初始化OP_WMS_PHYSICS + /// + /// + /// + /// + /// + public DataResult InitOpWmsPhysics_ClearanceMove(OP_WMS wms, OP_WMS_CLEARANCE wmsInDo, + ClearanceMovePlanGoodsInput doGoods); + /// + /// 清关移库 新库存 初始化OpWmsPhysicsChange + /// + /// + /// + /// + /// + /// + public DataResult InitOpWmsPhysicsChange_ClearanceMove(Guid wmsId, Guid physicsId, + ClearanceMovePlanGoodsInput doGoods); + + #endregion + + + } \ No newline at end of file diff --git a/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Method/WmsClearanceService.cs b/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Method/WmsClearanceService.cs index a5b3f4e..fb1f46e 100644 --- a/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Method/WmsClearanceService.cs +++ b/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Method/WmsClearanceService.cs @@ -96,10 +96,10 @@ public class WmsClearanceService:IWmsClearanceService foreach (var item in goods) { var stockinfo = stocklist.Where(x => x.WMSPHYSICSID == item.WMSPHYSICSID).First(); - // if (item.PKGS > stockinfo.PKGS) - // { - // return DataResult.Failed("清关计划明细商品[" + item.GOODSNAME +"]库存数量:" + stockinfo.PKGS +" 不足,不能审批!"); - // } + if (item.PKGS > stockinfo.PKGS) + { + return DataResult.Failed("清关计划明细商品[" + item.GOODSNAME +"]库存数量:" + stockinfo.PKGS +" 不足,不能审批!"); + } if (item.STORAGEUNITCOUNT > stockinfo.STORAGEUNITCOUNT) { return DataResult.Failed("清关计划明细商品[" + item.GOODSNAME +"]计费数量:" + stockinfo.STORAGEUNITCOUNT +" 不足,不能审批!"); @@ -124,8 +124,9 @@ public class WmsClearanceService:IWmsClearanceService { var stockinfo = stocklist.Where(x => x.WMSPHYSICSID == item.WMSPHYSICSID).First(); + stockinfo.PKGS -= item.PKGS; stockinfo.STORAGEUNITCOUNT -= item.STORAGEUNITCOUNT; - // item.LOCKPKGS += plangoods.PKGS; + stockinfo.LOCKPKGS += item.PKGS; stockinfo.LOCKSTORAGEUNITCOUNT += item.STORAGEUNITCOUNT; db.Updateable(stockinfo).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand(); } diff --git a/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Method/WmsCommonService.cs b/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Method/WmsCommonService.cs index 5ff2282..8ca2206 100644 --- a/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Method/WmsCommonService.cs +++ b/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Method/WmsCommonService.cs @@ -1,6 +1,7 @@ using DS.Module.Core; using DS.Module.Core.Extensions; using DS.Module.UserModule; +using DS.WMS.Core.App.Dtos; using DS.WMS.Core.WmsModule.Entity; using DS.WMS.Core.WmsModule.Interface; using Mapster; @@ -29,7 +30,9 @@ public class WmsCommonService : IWmsCommonService user = _serviceProvider.GetRequiredService(); } - /// + #region 入库确认 + + /// /// 初始化库存信息 /// /// @@ -146,6 +149,11 @@ public class WmsCommonService : IWmsCommonService return DataResult.Success(change); } + #endregion + + + #region 出库确认 + /// /// 出库确认变更OP_WMS_CHANGE /// @@ -227,10 +235,10 @@ public class WmsCommonService : IWmsCommonService change.CHANGETYPE = WMSCHANGTYPE.出库; change.CBM2 = physics.CBM; change.KGS2 = physics.KGS; - change.PKGS2 = physics.PKGS; + change.PKGS2 = physics.PKGS + doGoods.PKGS; change.SMALLPKGS2 = physics.SMALLPKGS; change.MINPKGS2 = physics.MINPKGS; - change.STORAGEUNITCOUNT2 = physics.STORAGEUNITCOUNT + physics.LOCKSTORAGEUNITCOUNT; + change.STORAGEUNITCOUNT2 = physics.STORAGEUNITCOUNT + doGoods.STORAGEUNITCOUNT; change.RULEUNITCOUNT2 = physics.RULEUNITCOUNT; change.NETWEIGHT2 = physics.NETWEIGHT; @@ -245,7 +253,7 @@ public class WmsCommonService : IWmsCommonService change.CBM3 = physics.CBM - doGoods.CBM; change.KGS3 = physics.KGS - doGoods.KGS; - change.PKGS3 = physics.PKGS - doGoods.PKGS; + change.PKGS3 = physics.PKGS + physics.LOCKPKGS - doGoods.PKGS; change.SMALLPKGS3 = physics.SMALLPKGS - doGoods.SMALLPKGS; change.MINPKGS3 = physics.MINPKGS - doGoods.MINPKGS; change.STORAGEUNITCOUNT3 = physics.STORAGEUNITCOUNT + physics.LOCKSTORAGEUNITCOUNT - doGoods.STORAGEUNITCOUNT; @@ -261,13 +269,243 @@ public class WmsCommonService : IWmsCommonService physics.CBM -= doGoods.CBM; physics.NETWEIGHT -= doGoods.NETWEIGHT; physics.KGS -= doGoods.KGS; - // physics.LOCKPKGS = - doGoods.PKGS; + physics.LOCKPKGS -= doGoods.PKGS; + physics.LOCKSTORAGEUNITCOUNT -= doGoods.STORAGEUNITCOUNT; + // physics.PKGS -= doGoods.PKGS; + physics.SMALLPKGS -= doGoods.SMALLPKGS; + physics.MINPKGS -= doGoods.MINPKGS; + // physics.STORAGEUNITCOUNT = physics.STORAGEUNITCOUNT - doGoods.STORAGEUNITCOUNT; + physics.RULEUNITCOUNT -= doGoods.RULEUNITCOUNT; + return DataResult.Success(physics); + } + + #endregion + + + #region 清关移库 + + /// + /// 清关移库 原 OP_WMS减库存 + /// + /// + /// + /// + public DataResult OpWmsReduce_ClearanceMove(OP_WMS wms, ClearanceMovePlanGoodsInput doGoods) + { + wms.KGS -= doGoods.KGS; + wms.NETWEIGHT -= doGoods.NETWEIGHT; + wms.CBM -= doGoods.CBM; + wms.PKGS -= doGoods.PKGS; + wms.SMALLPKGS -= doGoods.SMALLPKGS; + wms.MINPKGS -= doGoods.MINPKGS; + wms.STORAGEUNITCOUNT -= doGoods.STORAGEUNITCOUNT; + wms.RULEUNITCOUNT -= doGoods.RULEUNITCOUNT; + return DataResult.Success(wms); + } + /// + /// 清关移库 原库存 OP_WMS_CHANGE + /// + /// + /// + /// + /// + public DataResult OpWmsChange_ClearanceMove(OP_WMS wms, OP_WMS_CLEARANCE wmsClearance, ClearanceMovePlanGoodsInput doGoods) + { + OP_WMS_CHANGE change = doGoods.Adapt(); + change.WMSID = wms.WMSID; + change.DOBSNO = doGoods.WMSPLANID.ToString(); + change.DOGID = doGoods.WMSCLEARANCEDETAILID; + change.CHANGETYPE = WMSCHANGTYPE.出库; + change.KGS2 = wms.KGS; + change.NETWEIGHT2 = wms.NETWEIGHT; + change.CBM2 = wms.CBM; + change.PKGS2 = wms.PKGS; + change.SMALLPKGS2 = wms.SMALLPKGS; + change.MINPKGS2 = wms.MINPKGS; + change.STORAGEUNITCOUNT2 = wms.STORAGEUNITCOUNT; + change.RULEUNITCOUNT2 = wms.RULEUNITCOUNT; + + change.KGS -= doGoods.KGS; + change.NETWEIGHT -= doGoods.NETWEIGHT; + change.CBM -= doGoods.CBM; + change.PKGS -= doGoods.PKGS; + change.SMALLPKGS -= doGoods.SMALLPKGS; + change.MINPKGS -= doGoods.MINPKGS; + change.STORAGEUNITCOUNT -= doGoods.STORAGEUNITCOUNT; + change.RULEUNITCOUNT -= doGoods.RULEUNITCOUNT; + + change.KGS3 = wms.KGS - doGoods.KGS; + change.NETWEIGHT3 = wms.NETWEIGHT - doGoods.NETWEIGHT; + change.CBM3 = wms.CBM - doGoods.CBM; + change.PKGS3 = wms.PKGS - doGoods.PKGS; + change.SMALLPKGS3 = wms.SMALLPKGS - doGoods.SMALLPKGS; + change.MINPKGS3 = wms.MINPKGS - doGoods.MINPKGS; + change.STORAGEUNITCOUNT3 = wms.STORAGEUNITCOUNT - doGoods.STORAGEUNITCOUNT; + change.RULEUNITCOUNT3 = wms.RULEUNITCOUNT - doGoods.RULEUNITCOUNT; + return DataResult.Success(change); + } + /// + /// 初始化 新库存 OP_WMS + /// + /// + /// + /// + public DataResult OpWmsInit_ClearanceMove(OP_WMS wms, ClearanceMovePlanGoodsInput doGoods) + { + var billNo = NumUtil.GetBillNo(db, "WM10"); + if (billNo.IsNullOrEmpty()) + { + return DataResult.Failed("请设置编码规则-库存信息"); + } + Guid wmsid = Guid.NewGuid(); + var newWms = doGoods.Adapt(); + newWms.WMSID = wmsid; + newWms.BSNO = billNo; + newWms.CORPID = wms.CORPID; + newWms.CUSTOMERNAME = wms.CUSTOMERNAME; + newWms.ISCLEAR = false; + newWms.BSSTATUS = false; + newWms.FEESTATUS = false; + newWms.INDATE = DateTime.Now; + newWms.FEESTARTDATE = DateTime.Now; + newWms.FEERATESTARTDATE = DateTime.Now; + newWms.WMSINDATE = DateTime.Now; + newWms.CUSTOMNO = wms.CUSTOMNO; + newWms.BILLTYPE = "0"; + newWms.GOODSOWNER = wms.GOODSOWNER; + newWms.ARCLIENTWMSOUT = wms.ARCLIENTWMSOUT; + newWms.ClientId = wms.ClientId; + newWms.setsingle(); + newWms.WMSBASEID = wms.WMSBASEID; + return DataResult.Success(newWms); + } + /// + /// 清关移库 新库存 OP_WMS_CHANGE 初始化 + /// + /// + /// + /// + /// + public DataResult InitOpWmsChange_ClearanceMove(OP_WMS wms, OP_WMS_CLEARANCE wmsInDo, ClearanceMovePlanGoodsInput doGoods) + { + OP_WMS_CHANGE change = doGoods.Adapt(); + change.WMSID = wms.WMSID; + change.DODATE = DateTime.Now; + change.setNew(doGoods); + return DataResult.Success(change); + } + /// + /// 清关移库 原库存 OP_WMS_PHYSICS减少 + /// + /// + /// + /// + public DataResult OpWmsPhysicsReduce_ClearanceMove(OP_WMS_PHYSICS physics, ClearanceMovePlanGoodsInput doGoods) + { + physics.CBM -= doGoods.CBM; + physics.NETWEIGHT -= doGoods.NETWEIGHT; + physics.KGS -= doGoods.KGS; + physics.LOCKPKGS -= doGoods.PKGS; physics.LOCKSTORAGEUNITCOUNT -= doGoods.STORAGEUNITCOUNT; - physics.PKGS -= doGoods.PKGS; + // physics.PKGS -= doGoods.PKGS; physics.SMALLPKGS -= doGoods.SMALLPKGS; physics.MINPKGS -= doGoods.MINPKGS; // physics.STORAGEUNITCOUNT = physics.STORAGEUNITCOUNT - doGoods.STORAGEUNITCOUNT; physics.RULEUNITCOUNT -= doGoods.RULEUNITCOUNT; return DataResult.Success(physics); } + /// + /// 清关移库 原库存 OP_WMS_PHYSICS_CHANGE + /// + /// + /// + /// + /// + public DataResult OpWmsPhysicsChange_ClearanceMove(OP_WMS_PHYSICS physics, OP_WMS_CLEARANCE wmsClearance, + ClearanceMovePlanGoodsInput doGoods) + { + OP_WMS_PHYSICS_CHANGE change = doGoods.Adapt(); + change.WMSID = doGoods.WMSPHYSICSID; + change.WMSPHYSICSID = doGoods.WMSPHYSICSID; + change.DODATE = DateTime.Now; + change.WMSPHYSICS_LOGID = new Guid(); + change.DOBSNO = doGoods.WMSPLANID.ToString(); + change.DOGID = doGoods.WMSCLEARANCEDETAILID.ToString(); + + change.STOREHOUSE2 = physics.STOREHOUSE; + change.STOREHOUSE3 = physics.STOREHOUSE; + change.AREACODE2 = physics.AREACODE; + change.AREACODE3 = physics.AREACODE; + + change.CHANGETYPE = WMSCHANGTYPE.出库; + change.CBM2 = physics.CBM; + change.KGS2 = physics.KGS; + change.PKGS2 = physics.PKGS + doGoods.PKGS; + change.SMALLPKGS2 = physics.SMALLPKGS; + change.MINPKGS2 = physics.MINPKGS; + change.STORAGEUNITCOUNT2 = physics.STORAGEUNITCOUNT + doGoods.STORAGEUNITCOUNT; + change.RULEUNITCOUNT2 = physics.RULEUNITCOUNT; + change.NETWEIGHT2 = physics.NETWEIGHT; + + change.CBM = -doGoods.CBM; + change.KGS = -doGoods.KGS; + change.PKGS = -doGoods.PKGS; + change.SMALLPKGS = -doGoods.SMALLPKGS; + change.MINPKGS = -doGoods.MINPKGS; + change.STORAGEUNITCOUNT = -doGoods.STORAGEUNITCOUNT; + change.RULEUNITCOUNT = -doGoods.RULEUNITCOUNT; + change.NETWEIGHT = -doGoods.NETWEIGHT; + + change.CBM3 = physics.CBM - doGoods.CBM; + change.KGS3 = physics.KGS - doGoods.KGS; + change.PKGS3 = physics.PKGS + physics.LOCKPKGS - doGoods.PKGS; + change.SMALLPKGS3 = physics.SMALLPKGS - doGoods.SMALLPKGS; + change.MINPKGS3 = physics.MINPKGS - doGoods.MINPKGS; + change.STORAGEUNITCOUNT3 = physics.STORAGEUNITCOUNT + physics.LOCKSTORAGEUNITCOUNT - doGoods.STORAGEUNITCOUNT; + change.RULEUNITCOUNT3 = physics.RULEUNITCOUNT - doGoods.RULEUNITCOUNT; + change.NETWEIGHT3 = physics.NETWEIGHT - doGoods.NETWEIGHT; + + + return DataResult.Success(change); + } + + /// + /// 清关移库 新库存 初始化OP_WMS_PHYSICS + /// + /// + /// + /// + /// + public DataResult InitOpWmsPhysics_ClearanceMove(OP_WMS wms, OP_WMS_CLEARANCE wmsInDo, + ClearanceMovePlanGoodsInput doGoods) + { + OP_WMS_PHYSICS physics = doGoods.Adapt(); + physics.WMSPHYSICSID = Guid.NewGuid(); + physics.WMSID = wms.WMSID; + physics.STARTDATE = DateTime.Now; + physics.ClientId = wmsInDo.ClientId; + physics.STOREHOUSE = wmsInDo.MoveStoreHouse; + physics.AREACODE = doGoods.AREACODE; + physics.setsingle(); + return DataResult.Success(physics); + } + /// + /// 清关移库 新库存 初始化OpWmsPhysicsChange + /// + /// + /// + /// + /// + /// + public DataResult InitOpWmsPhysicsChange_ClearanceMove(Guid wmsId, Guid physicsId, + ClearanceMovePlanGoodsInput doGoods) + { + OP_WMS_PHYSICS_CHANGE change = doGoods.Adapt(); + change.WMSID = wmsId; + change.WMSPHYSICSID = physicsId; + change.DODATE = DateTime.Now; + change.setNew(doGoods); + return DataResult.Success(change); + } + #endregion } \ No newline at end of file diff --git a/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Method/WmsOutDoService.cs b/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Method/WmsOutDoService.cs index 9546a9b..35f24f6 100644 --- a/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Method/WmsOutDoService.cs +++ b/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Method/WmsOutDoService.cs @@ -101,10 +101,10 @@ public class WmsOutDoService:IWmsOutDoService foreach (var item in detail) { var stockinfo = stocklist.Where(x => x.WMSPHYSICSID == item.WMSPHYSICSID).First(); - // if (item.PKGS > stockinfo.LOCKPKGS) - // { - // return DataResult.Failed("出库确认明细商品[" + item.GOODSNAME +"]锁定库存数量:" + stockinfo.LOCKPKGS +" 不足,不能审批!"); - // } + if (item.PKGS > stockinfo.LOCKPKGS) + { + return DataResult.Failed("出库确认明细商品[" + item.GOODSNAME +"]锁定库存数量:" + stockinfo.LOCKPKGS +" 不足,不能审批!"); + } if (item.STORAGEUNITCOUNT > stockinfo.LOCKSTORAGEUNITCOUNT) { return DataResult.Failed("出库确认明细商品[" + item.GOODSNAME +"]锁定计费数量:" + stockinfo.LOCKSTORAGEUNITCOUNT +" 不足,不能审批!"); diff --git a/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Method/WmsOutPlanService.cs b/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Method/WmsOutPlanService.cs index afee3eb..86303c6 100644 --- a/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Method/WmsOutPlanService.cs +++ b/gslk-wmsapi-service-server/DS.WMS.Core/WmsModule/Method/WmsOutPlanService.cs @@ -128,9 +128,9 @@ public class WmsOutPlanService : IWmsOutPlanService foreach (var item in goods) { var stockinfo = stocklist.Where(x => x.WMSPHYSICSID == item.WMSPHYSICSID).First(); - + stockinfo.PKGS -= item.PKGS; stockinfo.STORAGEUNITCOUNT -= item.STORAGEUNITCOUNT; - // item.LOCKPKGS += plangoods.PKGS; + stockinfo.LOCKPKGS += item.PKGS; stockinfo.LOCKSTORAGEUNITCOUNT += item.STORAGEUNITCOUNT; db.Updateable(stockinfo).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand(); } diff --git a/gslk-wmsapi-service-server/DS.WMS.WebApi/Logs/internal-nlog.txt b/gslk-wmsapi-service-server/DS.WMS.WebApi/Logs/internal-nlog.txt index 6ed6f1a..21f763f 100644 --- a/gslk-wmsapi-service-server/DS.WMS.WebApi/Logs/internal-nlog.txt +++ b/gslk-wmsapi-service-server/DS.WMS.WebApi/Logs/internal-nlog.txt @@ -6098,3 +6098,83 @@ 2023-04-20 19:23:35.6654 Info Adding target ColoredConsoleTarget(Name=console) 2023-04-20 19:23:35.6911 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\sdgslk-wms-solution\gslk-wmsapi-service-server\DS.WMS.WebApi\bin\Debug\net6.0\nlog.config 2023-04-20 19:23:35.6911 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2023-04-21 09:15:08.0040 Info Message Template Auto Format enabled +2023-04-21 09:15:08.0216 Info Loading assembly: NLog.Web.AspNetCore +2023-04-21 09:15:08.1341 Info Adding target FileTarget(Name=allfile) +2023-04-21 09:15:08.1414 Info Adding target FileTarget(Name=ownFile-web) +2023-04-21 09:15:08.1572 Info Adding target ColoredConsoleTarget(Name=console) +2023-04-21 09:15:08.2198 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\sdgslk-wms-solution\gslk-wmsapi-service-server\DS.WMS.WebApi\bin\Debug\net6.0\nlog.config +2023-04-21 09:15:08.2198 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2023-04-21 09:21:33.9056 Info Shutdown() called. Logger closing... +2023-04-21 09:21:33.9056 Info Closing old configuration. +2023-04-21 09:21:33.9322 Info Logger has been closed down. +2023-04-21 09:22:00.3585 Info Message Template Auto Format enabled +2023-04-21 09:22:00.3749 Info Loading assembly: NLog.Web.AspNetCore +2023-04-21 09:22:00.4835 Info Adding target FileTarget(Name=allfile) +2023-04-21 09:22:00.4835 Info Adding target FileTarget(Name=ownFile-web) +2023-04-21 09:22:00.5069 Info Adding target ColoredConsoleTarget(Name=console) +2023-04-21 09:22:00.5555 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\sdgslk-wms-solution\gslk-wmsapi-service-server\DS.WMS.WebApi\bin\Debug\net6.0\nlog.config +2023-04-21 09:22:00.5664 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2023-04-21 11:03:37.1789 Info Shutdown() called. Logger closing... +2023-04-21 11:03:37.1789 Info Closing old configuration. +2023-04-21 11:03:37.2138 Info Logger has been closed down. +2023-04-21 11:03:56.8216 Info Message Template Auto Format enabled +2023-04-21 11:03:56.8370 Info Loading assembly: NLog.Web.AspNetCore +2023-04-21 11:03:56.9429 Info Adding target FileTarget(Name=allfile) +2023-04-21 11:03:56.9523 Info Adding target FileTarget(Name=ownFile-web) +2023-04-21 11:03:56.9711 Info Adding target ColoredConsoleTarget(Name=console) +2023-04-21 11:03:57.0258 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\sdgslk-wms-solution\gslk-wmsapi-service-server\DS.WMS.WebApi\bin\Debug\net6.0\nlog.config +2023-04-21 11:03:57.0395 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2023-04-21 11:14:40.0438 Info Shutdown() called. Logger closing... +2023-04-21 11:14:40.0438 Info Closing old configuration. +2023-04-21 11:14:40.0784 Info Logger has been closed down. +2023-04-21 11:15:01.8897 Info Message Template Auto Format enabled +2023-04-21 11:15:01.8897 Info Loading assembly: NLog.Web.AspNetCore +2023-04-21 11:15:01.9835 Info Adding target FileTarget(Name=allfile) +2023-04-21 11:15:01.9835 Info Adding target FileTarget(Name=ownFile-web) +2023-04-21 11:15:02.0018 Info Adding target ColoredConsoleTarget(Name=console) +2023-04-21 11:15:02.0434 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\sdgslk-wms-solution\gslk-wmsapi-service-server\DS.WMS.WebApi\bin\Debug\net6.0\nlog.config +2023-04-21 11:15:02.0523 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2023-04-21 14:30:49.1736 Info Shutdown() called. Logger closing... +2023-04-21 14:30:49.1736 Info Closing old configuration. +2023-04-21 14:30:49.2225 Info Logger has been closed down. +2023-04-21 14:31:24.1998 Info Message Template Auto Format enabled +2023-04-21 14:31:24.2147 Info Loading assembly: NLog.Web.AspNetCore +2023-04-21 14:31:24.3041 Info Adding target FileTarget(Name=allfile) +2023-04-21 14:31:24.3041 Info Adding target FileTarget(Name=ownFile-web) +2023-04-21 14:31:24.3253 Info Adding target ColoredConsoleTarget(Name=console) +2023-04-21 14:31:24.3645 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\sdgslk-wms-solution\gslk-wmsapi-service-server\DS.WMS.WebApi\bin\Debug\net6.0\nlog.config +2023-04-21 14:31:24.3735 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2023-04-21 14:38:00.1942 Info Shutdown() called. Logger closing... +2023-04-21 14:38:00.1942 Info Closing old configuration. +2023-04-21 14:38:00.2218 Info Logger has been closed down. +2023-04-21 14:38:09.1581 Info Message Template Auto Format enabled +2023-04-21 14:38:09.1775 Info Loading assembly: NLog.Web.AspNetCore +2023-04-21 14:38:09.2840 Info Adding target FileTarget(Name=allfile) +2023-04-21 14:38:09.2954 Info Adding target FileTarget(Name=ownFile-web) +2023-04-21 14:38:09.3133 Info Adding target ColoredConsoleTarget(Name=console) +2023-04-21 14:38:09.3685 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\sdgslk-wms-solution\gslk-wmsapi-service-server\DS.WMS.WebApi\bin\Debug\net6.0\nlog.config +2023-04-21 14:38:09.3824 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2023-04-21 14:40:10.2200 Info Shutdown() called. Logger closing... +2023-04-21 14:40:10.2200 Info Closing old configuration. +2023-04-21 14:40:10.2984 Info Logger has been closed down. +2023-04-21 14:40:38.9222 Info Message Template Auto Format enabled +2023-04-21 14:40:38.9222 Info Loading assembly: NLog.Web.AspNetCore +2023-04-21 14:40:39.0028 Info Adding target FileTarget(Name=allfile) +2023-04-21 14:40:39.0028 Info Adding target FileTarget(Name=ownFile-web) +2023-04-21 14:40:39.0206 Info Adding target ColoredConsoleTarget(Name=console) +2023-04-21 14:40:39.0576 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\sdgslk-wms-solution\gslk-wmsapi-service-server\DS.WMS.WebApi\bin\Debug\net6.0\nlog.config +2023-04-21 14:40:39.0652 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2023-04-21 14:43:11.1195 Info Shutdown() called. Logger closing... +2023-04-21 14:43:11.1195 Info Closing old configuration. +2023-04-21 14:43:11.1520 Info Logger has been closed down. +2023-04-21 14:43:41.7865 Info Message Template Auto Format enabled +2023-04-21 14:43:41.8003 Info Loading assembly: NLog.Web.AspNetCore +2023-04-21 14:43:41.8732 Info Adding target FileTarget(Name=allfile) +2023-04-21 14:43:41.8732 Info Adding target FileTarget(Name=ownFile-web) +2023-04-21 14:43:41.8894 Info Adding target ColoredConsoleTarget(Name=console) +2023-04-21 14:43:41.9216 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\sdgslk-wms-solution\gslk-wmsapi-service-server\DS.WMS.WebApi\bin\Debug\net6.0\nlog.config +2023-04-21 14:43:41.9216 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2023-04-21 18:08:27.5508 Info Shutdown() called. Logger closing... +2023-04-21 18:08:27.5508 Info Closing old configuration. +2023-04-21 18:08:27.6376 Info Logger has been closed down.