From d662984b38b0e9f71a47cecd1aa367c4c1da5418 Mon Sep 17 00:00:00 2001 From: FanLian Date: Mon, 10 Jul 2023 10:20:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8E=A5=E5=8F=A3=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Tnb.WarehouseMgr/WmsCarryQueryService.cs | 18 ++++++---- .../WmsCollocationSchemeSevice.cs | 1 + .../WmsEmptyInstockService.cs | 5 ++- .../WmsEmptyOutstockService .cs | 35 ++++++++++--------- .../WmsSignForDeliveryService.cs | 1 + .../Tnb.WarehouseMgr/WmskittingOutService.cs | 1 + 6 files changed, 34 insertions(+), 27 deletions(-) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryQueryService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryQueryService.cs index 793e4e37..26ab0f11 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryQueryService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCarryQueryService.cs @@ -5,6 +5,8 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Aop.Api.Domain; +using JNPF.Common.Extension; +using JNPF.FriendlyException; using Mapster; using Microsoft.AspNetCore.Mvc; using SqlSugar; @@ -32,16 +34,17 @@ namespace Tnb.WarehouseMgr [HttpPost] public async Task MESCarryQuery(MESCarryQueryInput input) { + if (input.IsNull()) throw new ArgumentNullException("input"); var results = new List(); try { - var carrys = await _db.Queryable() - .InnerJoin((a, b) => a.collocation_scheme_id == b.id) - .Where((a, b) => a.carry_code.Contains(input.carry_code) || b.bill_name.Contains(input.collocation_scheme_name)) - .ToListAsync(); - - results = carrys.Adapt>(); - + var carrys = await _db.Queryable() + .InnerJoin((a, b) => a.collocation_scheme_id == b.id) + .Where((a, b) => a.carry_code.Contains(input.carry_code) || b.bill_name.Contains(input.collocation_scheme_name)) + .ToListAsync(); + + results = carrys.Adapt>(); + } catch (Exception ex) { @@ -58,6 +61,7 @@ namespace Tnb.WarehouseMgr [HttpPost] public async Task MESCarryQueryResult(MESCarryQueryResultInput input) { + if (input.IsNull()) throw new ArgumentNullException("input"); var result = new CarryQueryOutput(); try { diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsCollocationSchemeSevice.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsCollocationSchemeSevice.cs index 2ade7c92..59c0986e 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsCollocationSchemeSevice.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsCollocationSchemeSevice.cs @@ -90,6 +90,7 @@ namespace Tnb.WarehouseMgr [HttpPost] public async Task MESCollocationSchemeQuery(MESCollocationSchemeQueryInput input) { + if (input.IsNull()) throw new ArgumentNullException("input"); var results = new List(); try { diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyInstockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyInstockService.cs index 75bbfd88..64d6f972 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyInstockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyInstockService.cs @@ -171,6 +171,7 @@ namespace Tnb.WarehouseMgr [HttpPost] public async Task MesEmptyCarryInStock(MESEmptyCarryInStockInput input) { + if(input.IsNull())throw new ArgumentNullException("input"); try { var carry = await _db.Queryable().SingleAsync(it => it.carry_code == input.carry_code); @@ -196,13 +197,11 @@ namespace Tnb.WarehouseMgr dic[nameof(WmsEmptyInstock.create_time)] = DateTime.Now; dic[nameof(WmsEmptyInstock.warehouse_id)] = input.warehouse_id; - VisualDevModelDataCrInput visualDevModelDataCrInput = new () + VisualDevModelDataCrInput visualDevModelDataCrInput = new() { data = dic }; await WmsEmptyIn(visualDevModelDataCrInput); - - } } catch (Exception ex) { diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyOutstockService .cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyOutstockService .cs index 9714d409..c4492840 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyOutstockService .cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyOutstockService .cs @@ -222,26 +222,27 @@ namespace Tnb.WarehouseMgr [HttpPost] public async Task MESEmptyCarryOutStk(MESEmptyCarryOutStkInput input) { + if (input.IsNull()) throw new ArgumentNullException("input"); try { - var location = await _db.Queryable().SingleAsync(it => it.location_code == input.location_code); - var dic = new Dictionary(); - dic[nameof(WmsEmptyOutstockH.id)] = SnowflakeIdHelper.NextId(); - dic[nameof(WmsEmptyOutstockH.org_id)] = input.org_id; - dic[nameof(WmsEmptyOutstockH.location_id)] = location.id; - dic[nameof(WmsEmptyOutstockH.carrystd_id)] = input.carrystd_id; - dic[nameof(WmsEmptyOutstockH.bill_code)] = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_EMPTYOUTSTK_ENCODE).GetAwaiter().GetResult(); - dic[nameof(WmsEmptyOutstockH.status)] = WmsWareHouseConst.BILLSTATUS_ADD_ID; - dic[nameof(WmsEmptyOutstockH.qty)] = input.qty; - dic[nameof(WmsEmptyOutstockH.biz_type)] = WmsWareHouseConst.BIZTYPE_WMSEPTYOUTSTK_ID; - dic[nameof(WmsEmptyOutstockH.create_id)] = input.create_id; - dic[nameof(WmsEmptyOutstockH.create_time)] = DateTime.Now; + var location = await _db.Queryable().SingleAsync(it => it.location_code == input.location_code); + var dic = new Dictionary(); + dic[nameof(WmsEmptyOutstockH.id)] = SnowflakeIdHelper.NextId(); + dic[nameof(WmsEmptyOutstockH.org_id)] = input.org_id; + dic[nameof(WmsEmptyOutstockH.location_id)] = location.id; + dic[nameof(WmsEmptyOutstockH.carrystd_id)] = input.carrystd_id; + dic[nameof(WmsEmptyOutstockH.bill_code)] = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_EMPTYOUTSTK_ENCODE).GetAwaiter().GetResult(); + dic[nameof(WmsEmptyOutstockH.status)] = WmsWareHouseConst.BILLSTATUS_ADD_ID; + dic[nameof(WmsEmptyOutstockH.qty)] = input.qty; + dic[nameof(WmsEmptyOutstockH.biz_type)] = WmsWareHouseConst.BIZTYPE_WMSEPTYOUTSTK_ID; + dic[nameof(WmsEmptyOutstockH.create_id)] = input.create_id; + dic[nameof(WmsEmptyOutstockH.create_time)] = DateTime.Now; - VisualDevModelDataCrInput visualDevModelDataCrInput = new VisualDevModelDataCrInput - { - data = dic, - }; - await PDAWmsEmptyOut(visualDevModelDataCrInput); + VisualDevModelDataCrInput visualDevModelDataCrInput = new VisualDevModelDataCrInput + { + data = dic, + }; + await PDAWmsEmptyOut(visualDevModelDataCrInput); } catch (Exception ex) { diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsSignForDeliveryService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsSignForDeliveryService.cs index eb5ed107..f9cacdac 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsSignForDeliveryService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsSignForDeliveryService.cs @@ -121,6 +121,7 @@ namespace Tnb.WarehouseMgr [HttpPost] public async Task MESCarrySign(MESCarrySignInput input) { + if (input.IsNull()) throw new ArgumentNullException("input"); var signInput = input.Adapt(); await SignForDelivery(signInput); } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmskittingOutService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmskittingOutService.cs index cf41c1dc..8588294e 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmskittingOutService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmskittingOutService.cs @@ -54,6 +54,7 @@ namespace Tnb.WarehouseMgr [HttpPost] public async Task KittingOutByAdd() { + if (input.IsNull()) throw new ArgumentNullException("input"); try { await _db.Ado.BeginTranAsync();