增加接口输入限制
This commit is contained in:
@@ -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<dynamic> MESCarryQuery(MESCarryQueryInput input)
|
||||
{
|
||||
if (input.IsNull()) throw new ArgumentNullException("input");
|
||||
var results = new List<CarryQueryOutput>();
|
||||
try
|
||||
{
|
||||
var carrys = await _db.Queryable<WmsCarryH>()
|
||||
.InnerJoin<WmsCollocationSchemeH>((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<List<CarryQueryOutput>>();
|
||||
|
||||
var carrys = await _db.Queryable<WmsCarryH>()
|
||||
.InnerJoin<WmsCollocationSchemeH>((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<List<CarryQueryOutput>>();
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -58,6 +61,7 @@ namespace Tnb.WarehouseMgr
|
||||
[HttpPost]
|
||||
public async Task<dynamic> MESCarryQueryResult(MESCarryQueryResultInput input)
|
||||
{
|
||||
if (input.IsNull()) throw new ArgumentNullException("input");
|
||||
var result = new CarryQueryOutput();
|
||||
try
|
||||
{
|
||||
|
||||
@@ -90,6 +90,7 @@ namespace Tnb.WarehouseMgr
|
||||
[HttpPost]
|
||||
public async Task<dynamic> MESCollocationSchemeQuery(MESCollocationSchemeQueryInput input)
|
||||
{
|
||||
if (input.IsNull()) throw new ArgumentNullException("input");
|
||||
var results = new List<CollocationSchemeOutput>();
|
||||
try
|
||||
{
|
||||
|
||||
@@ -171,6 +171,7 @@ namespace Tnb.WarehouseMgr
|
||||
[HttpPost]
|
||||
public async Task<dynamic> MesEmptyCarryInStock(MESEmptyCarryInStockInput input)
|
||||
{
|
||||
if(input.IsNull())throw new ArgumentNullException("input");
|
||||
try
|
||||
{
|
||||
var carry = await _db.Queryable<WmsCarryH>().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)
|
||||
{
|
||||
|
||||
@@ -222,26 +222,27 @@ namespace Tnb.WarehouseMgr
|
||||
[HttpPost]
|
||||
public async Task<dynamic> MESEmptyCarryOutStk(MESEmptyCarryOutStkInput input)
|
||||
{
|
||||
if (input.IsNull()) throw new ArgumentNullException("input");
|
||||
try
|
||||
{
|
||||
var location = await _db.Queryable<BasLocation>().SingleAsync(it => it.location_code == input.location_code);
|
||||
var dic = new Dictionary<string, object>();
|
||||
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<BasLocation>().SingleAsync(it => it.location_code == input.location_code);
|
||||
var dic = new Dictionary<string, object>();
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -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<SignForDeliveryInput>();
|
||||
await SignForDelivery(signInput);
|
||||
}
|
||||
|
||||
@@ -54,6 +54,7 @@ namespace Tnb.WarehouseMgr
|
||||
[HttpPost]
|
||||
public async Task KittingOutByAdd()
|
||||
{
|
||||
if (input.IsNull()) throw new ArgumentNullException("input");
|
||||
try
|
||||
{
|
||||
await _db.Ado.BeginTranAsync();
|
||||
|
||||
Reference in New Issue
Block a user