消除部分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(),
}, 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();
return data;
}
@@ -555,20 +555,13 @@ namespace Tnb.WarehouseMgr
//根据载具ID更新是否锁定和赋值起始库位
if (setCarryColumnsExp != null)
{
if (input.CarryIds?.Count > 0)
{
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();
}
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();
}
//根据所有库位更新库位的锁定状态为“锁定”
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();
}

View File

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

View File

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