1
This commit is contained in:
@@ -171,7 +171,7 @@ namespace Tnb.WarehouseMgr
|
||||
[HttpPost]
|
||||
public async Task<dynamic> MesEmptyCarryInStock(MESEmptyCarryInStockInput input)
|
||||
{
|
||||
if(input.IsNull())throw new ArgumentNullException("input");
|
||||
if (input.IsNull()) throw new ArgumentNullException("input");
|
||||
try
|
||||
{
|
||||
var carry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.carry_code == input.carry_code);
|
||||
@@ -186,16 +186,16 @@ namespace Tnb.WarehouseMgr
|
||||
var cols = new List<string>();
|
||||
var dic = new Dictionary<string, object>();
|
||||
dic[nameof(WmsEmptyInstock.id)] = SnowflakeIdHelper.NextId();
|
||||
dic[nameof(WmsEmptyInstock.org_id)] = input.org_id;
|
||||
dic[nameof(WmsEmptyInstock.org_id)] = input.org_id ?? _userManager.User.OrganizeId;
|
||||
dic[nameof(WmsEmptyInstock.location_id)] = location.id;
|
||||
dic[nameof(WmsEmptyInstock.bill_code)] = await _billRullService.GetBillNumber(WmsWareHouseConst.WMS_EMPTYINSTK_ENCODE);
|
||||
dic[nameof(WmsEmptyInstock.status)] = WmsWareHouseConst.BILLSTATUS_ADD_ID;
|
||||
dic[nameof(WmsEmptyInstock.carry_id)] = carry.id;
|
||||
dic[nameof(WmsEmptyInstock.carry_code)] = input.carry_code;
|
||||
dic[nameof(WmsEmptyInstock.carry_code)] = input.carry_code!;
|
||||
dic[nameof(WmsEmptyInstock.biz_type)] = WmsWareHouseConst.BIZTYPE_WMSEMPTYINSTOCK_ID;
|
||||
dic[nameof(WmsEmptyInstock.create_id)] = input.create_id;
|
||||
dic[nameof(WmsEmptyInstock.create_id)] = input.create_id ?? _userManager.UserId;
|
||||
dic[nameof(WmsEmptyInstock.create_time)] = DateTime.Now;
|
||||
dic[nameof(WmsEmptyInstock.warehouse_id)] = input.warehouse_id;
|
||||
dic[nameof(WmsEmptyInstock.warehouse_id)] = input.warehouse_id!;
|
||||
|
||||
VisualDevModelDataCrInput visualDevModelDataCrInput = new()
|
||||
{
|
||||
|
||||
@@ -293,11 +293,11 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
await _db.Ado.BeginTranAsync();
|
||||
//出库申请主表
|
||||
WmsOutstockH outstock = input.outstock!;
|
||||
WmsOutstockH? outstock = input.outstock;
|
||||
//出库申请明细表
|
||||
List<WmsOutstockD> outstockDs = input.outstockDs!;
|
||||
List<WmsOutstockD>? outstockDs = input.outstockDs;
|
||||
//如果数据不全,
|
||||
if (outstock.IsNull() || outstock.location_id.IsNullOrWhiteSpace() || outstockDs?.Count < 1)
|
||||
if ((outstock?.location_id.IsNullOrWhiteSpace() ?? true) || outstockDs?.Count < 1)
|
||||
{
|
||||
//报错, 提示数据不全。
|
||||
throw new AppFriendlyException("数据不全!", 500);
|
||||
@@ -498,9 +498,7 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
public override async Task ModifyAsync(WareHouseUpInput input)
|
||||
{
|
||||
if (input == null) throw new ArgumentNullException("input");
|
||||
|
||||
|
||||
if (input == null) throw new ArgumentNullException(nameof(input));
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
@@ -113,13 +113,12 @@ namespace Tnb.WarehouseMgr
|
||||
carryMats = carryMats.OrderBy(o => o.create_time).GroupBy(g => new { g.carry_id, g.material_id, g.code_batch })
|
||||
.Select(x =>
|
||||
{
|
||||
WmsCarryMat? carryMat = x.FirstOrDefault()!;
|
||||
WmsCarryMat? carryMat = x.FirstOrDefault();
|
||||
carryMat.need_qty = x.Sum(d => d.need_qty);
|
||||
return carryMat;
|
||||
})
|
||||
.ToList();
|
||||
await _db.Insertable(carryMats).ExecuteCommandAsync();
|
||||
var dic = carryMats.DistinctBy(x => x.carry_id).ToDictionary(x => x.carry_id, x => x.need_qty);
|
||||
|
||||
carryIds = carryMats.Select(x => x.carry_id).Distinct().ToList();
|
||||
await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH { out_status = ((int)EnumOutStatus.全部出).ToString(), collocation_scheme_id = singleSorting.collocation_scheme_id, collocation_scheme_code = singleSorting.collocation_scheme_code }).Where(it => carryIds.Contains(it.id)).ExecuteCommandAsync();
|
||||
@@ -280,7 +279,7 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
}
|
||||
await _db.Updateable(curSortingDetails).ExecuteCommandAsync();
|
||||
if(curSortingDetails.All(it=>it.line_status == WmsWareHouseConst.BILLSTATUS_COMPLETE_ID))
|
||||
if (curSortingDetails.All(it => it.line_status == WmsWareHouseConst.BILLSTATUS_COMPLETE_ID))
|
||||
{
|
||||
|
||||
await _db.Updateable<WmsSetsortingH>().SetColumns(it => new WmsSetsortingH { status = WmsWareHouseConst.BILLSTATUS_COMPLETE_ID }).Where(it => it.id == input.requireId).ExecuteCommandAsync();
|
||||
|
||||
Reference in New Issue
Block a user