消除部分warning

This commit is contained in:
alex
2023-07-17 10:09:20 +08:00
parent ee0b13bf7e
commit 713247236c
3 changed files with 32 additions and 39 deletions

View File

@@ -151,7 +151,7 @@ namespace Tnb.WarehouseMgr
{ {
CodeDetails = SqlFunc.Subqueryable<TStockCode>().Where(it => it.bill_d_id == a.id).ToList(), CodeDetails = SqlFunc.Subqueryable<TStockCode>().Where(it => it.bill_d_id == a.id).ToList(),
}, true) }, true)
.Mapper(it => it.line_status = dic.ContainsKey(key: it.line_status) ? dic[it.line_status]?.ToString() : "") .Mapper(it => it.line_status = dic.ContainsKey(key: it.line_status) ? dic[it.line_status]?.ToString() : "")
.ToListAsync(); .ToListAsync();
return data; return data;
} }
@@ -555,20 +555,13 @@ namespace Tnb.WarehouseMgr
//根据载具ID更新是否锁定和赋值起始库位 //根据载具ID更新是否锁定和赋值起始库位
if (setCarryColumnsExp != null) if (setCarryColumnsExp != null)
{ {
if (input.CarryIds?.Count > 0) Expression<Func<WmsCarryH, bool>> whereExp = input.CarryIds?.Count > 0 ? it => input.CarryIds.Contains(it.id) : it => it.id == input.CarryId;
{ await _db.Updateable<WmsCarryH>().SetColumns(setCarryColumnsExp).Where(whereExp).ExecuteCommandAsync();
await _db.Updateable<WmsCarryH>().SetColumns(setCarryColumnsExp).Where(it => input.CarryIds.Contains(it.id)).ExecuteCommandAsync();
}
else
{
await _db.Updateable<WmsCarryH>().SetColumns(setCarryColumnsExp).Where(it => it.id == input.CarryId).ExecuteCommandAsync();
}
} }
//根据所有库位更新库位的锁定状态为“锁定” //根据所有库位更新库位的锁定状态为“锁定”
if (setLocaionColumbExp != null) if (setLocaionColumbExp != null && input.LocationIds?.Count > 0)
{ {
await _db.Updateable<BasLocation>().SetColumns(setLocaionColumbExp).Where(it => input.LocationIds!.Contains(it.id)).ExecuteCommandAsync(); await _db.Updateable<BasLocation>().SetColumns(setLocaionColumbExp).Where(it => input.LocationIds.Contains(it.id)).ExecuteCommandAsync();
} }
await _db.Ado.CommitTranAsync(); await _db.Ado.CommitTranAsync();
} }

View File

@@ -443,10 +443,8 @@ namespace Tnb.WarehouseMgr
List<string> locIds = new(); List<string> locIds = new();
foreach (var carry in carrys) foreach (var carry in carrys)
{ {
WmsPointH sPoint = null!; WmsPointH sPoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == carry.location_id);
WmsPointH ePoint = null!; WmsPointH ePoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == outstock.location_id.ToString());
sPoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == carry.location_id);
ePoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == outstock.location_id.ToString());
if (sPoint != null && ePoint != null) if (sPoint != null && ePoint != null)
{ {

View File

@@ -76,11 +76,11 @@ namespace Tnb.WarehouseMgr
if (carrys?.Count > 0) if (carrys?.Count > 0)
{ {
var firstCarry = carrys.FirstOrDefault(); var firstCarry = carrys.FirstOrDefault();
GenPreTaskUpInput genPreTaskInput = new() { CarryId = firstCarry!.id! }; GenPreTaskUpInput genPreTaskInput = new() { CarryId = firstCarry?.id };
await _warehouseService.GenInStockTaskHandleAfter(genPreTaskInput, it => new WmsCarryH { is_lock = 1 }, null!); await _warehouseService.GenInStockTaskHandleAfter(genPreTaskInput, it => new WmsCarryH { is_lock = 1 }, null!);
ko.status = WmsWareHouseConst.BILLSTATUS_TOBESHIPPED_ID; ko.status = WmsWareHouseConst.BILLSTATUS_TOBESHIPPED_ID;
ko.carry_id = firstCarry.id; ko.carry_id = firstCarry?.id;
ko.carry_code = firstCarry.carry_code; ko.carry_code = firstCarry?.carry_code;
await _db.Updateable(ko).UpdateColumns(it => new { it.status, it.carry_id, it.carry_code }).ExecuteCommandAsync(); await _db.Updateable(ko).UpdateColumns(it => new { it.status, it.carry_id, it.carry_code }).ExecuteCommandAsync();
} }
else else
@@ -165,26 +165,28 @@ namespace Tnb.WarehouseMgr
var sPoint = it.FirstOrDefault(); var sPoint = it.FirstOrDefault();
var ePoint = it.LastOrDefault(); var ePoint = it.LastOrDefault();
WmsPretaskH preTask = new(); WmsPretaskH preTask = new()
preTask.org_id = _userManager.User.OrganizeId; {
preTask.startlocation_id = sPoint?.location_id!; org_id = _userManager.User.OrganizeId,
preTask.startlocation_code = sPoint?.location_code!; startlocation_id = sPoint?.location_id!,
preTask.endlocation_id = ePoint?.location_id!; startlocation_code = sPoint?.location_code!,
preTask.endlocation_code = ePoint?.location_code!; endlocation_id = ePoint?.location_id!,
preTask.start_floor = sPoint?.floor.ToString(); endlocation_code = ePoint?.location_code!,
preTask.end_floor = ePoint?.floor.ToString(); start_floor = sPoint?.floor.ToString(),
preTask.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult(); end_floor = ePoint?.floor.ToString(),
preTask.status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID; bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult(),
preTask.biz_type = ko.biz_type; status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID,
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID; biz_type = ko.biz_type,
preTask.carry_id = ko!.carry_id!; task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID,
preTask.carry_code = ko!.carry_code!; carry_id = ko!.carry_id!,
preTask.area_id = sPoint?.area_id!; carry_code = ko!.carry_code!,
preTask.area_code = it.Key; area_id = sPoint?.area_id!,
preTask.require_id = ko.id; area_code = it.Key,
preTask.require_code = ko.bill_code; require_id = ko.id,
preTask.create_id = _userManager.UserId; require_code = ko.bill_code,
preTask.create_time = DateTime.Now; create_id = _userManager.UserId,
create_time = DateTime.Now
};
return preTask; return preTask;
}).ToList(); }).ToList();
await _warehouseService.GenPreTask(preTasks, null!); await _warehouseService.GenPreTask(preTasks, null!);