1
This commit is contained in:
@@ -186,16 +186,16 @@ namespace Tnb.WarehouseMgr
|
|||||||
var cols = new List<string>();
|
var cols = new List<string>();
|
||||||
var dic = new Dictionary<string, object>();
|
var dic = new Dictionary<string, object>();
|
||||||
dic[nameof(WmsEmptyInstock.id)] = SnowflakeIdHelper.NextId();
|
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.location_id)] = location.id;
|
||||||
dic[nameof(WmsEmptyInstock.bill_code)] = await _billRullService.GetBillNumber(WmsWareHouseConst.WMS_EMPTYINSTK_ENCODE);
|
dic[nameof(WmsEmptyInstock.bill_code)] = await _billRullService.GetBillNumber(WmsWareHouseConst.WMS_EMPTYINSTK_ENCODE);
|
||||||
dic[nameof(WmsEmptyInstock.status)] = WmsWareHouseConst.BILLSTATUS_ADD_ID;
|
dic[nameof(WmsEmptyInstock.status)] = WmsWareHouseConst.BILLSTATUS_ADD_ID;
|
||||||
dic[nameof(WmsEmptyInstock.carry_id)] = carry.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.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.create_time)] = DateTime.Now;
|
||||||
dic[nameof(WmsEmptyInstock.warehouse_id)] = input.warehouse_id;
|
dic[nameof(WmsEmptyInstock.warehouse_id)] = input.warehouse_id!;
|
||||||
|
|
||||||
VisualDevModelDataCrInput visualDevModelDataCrInput = new()
|
VisualDevModelDataCrInput visualDevModelDataCrInput = new()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -293,11 +293,11 @@ namespace Tnb.WarehouseMgr
|
|||||||
{
|
{
|
||||||
await _db.Ado.BeginTranAsync();
|
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);
|
throw new AppFriendlyException("数据不全!", 500);
|
||||||
@@ -498,9 +498,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
|
|
||||||
public override async Task ModifyAsync(WareHouseUpInput input)
|
public override async Task ModifyAsync(WareHouseUpInput input)
|
||||||
{
|
{
|
||||||
if (input == null) throw new ArgumentNullException("input");
|
if (input == null) throw new ArgumentNullException(nameof(input));
|
||||||
|
|
||||||
|
|
||||||
try
|
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 })
|
carryMats = carryMats.OrderBy(o => o.create_time).GroupBy(g => new { g.carry_id, g.material_id, g.code_batch })
|
||||||
.Select(x =>
|
.Select(x =>
|
||||||
{
|
{
|
||||||
WmsCarryMat? carryMat = x.FirstOrDefault()!;
|
WmsCarryMat? carryMat = x.FirstOrDefault();
|
||||||
carryMat.need_qty = x.Sum(d => d.need_qty);
|
carryMat.need_qty = x.Sum(d => d.need_qty);
|
||||||
return carryMat;
|
return carryMat;
|
||||||
})
|
})
|
||||||
.ToList();
|
.ToList();
|
||||||
await _db.Insertable(carryMats).ExecuteCommandAsync();
|
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();
|
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();
|
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();
|
||||||
|
|||||||
Reference in New Issue
Block a user