wms 消除warning
This commit is contained in:
@@ -43,11 +43,19 @@ namespace Tnb.WarehouseMgr
|
||||
private readonly IWareHouseService _wareHouseService;
|
||||
private readonly IBillRullService _billRullService;
|
||||
private static Dictionary<string, object> _dicBillCodes = new();
|
||||
public WmsInStockService(ISqlSugarRepository<WmsInstockH> repository, IDictionaryDataService dictionaryDataService, IUserManager userManager)
|
||||
public WmsInStockService(
|
||||
ISqlSugarRepository<WmsInstockH> repository,
|
||||
IDictionaryDataService dictionaryDataService,
|
||||
IUserManager userManager,
|
||||
IBillRullService billRullService,
|
||||
IWareHouseService wareHouseService
|
||||
)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_dictionaryDataService = dictionaryDataService;
|
||||
_userManager = userManager;
|
||||
_billRullService = billRullService;
|
||||
_wareHouseService = wareHouseService;
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据入库申请单ID获取申请单明细信息
|
||||
@@ -151,7 +159,7 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<WmsTempCode> CreateInstock(WmsInstockD detail, int no)
|
||||
private Task<WmsTempCode> CreateInstock(WmsInstockD detail, int no)
|
||||
{
|
||||
WmsTempCode barCode = new();
|
||||
barCode.org_id = detail.org_id;
|
||||
@@ -168,7 +176,7 @@ namespace Tnb.WarehouseMgr
|
||||
barCode.require_code = _dicBillCodes.ContainsKey(detail.bill_id) ? _dicBillCodes[detail.bill_id]?.ToString() : "";
|
||||
barCode.create_id = _userManager.UserId;
|
||||
barCode.create_time = DateTime.Now;
|
||||
return barCode;
|
||||
return Task.FromResult(barCode);
|
||||
}
|
||||
|
||||
|
||||
@@ -242,8 +250,9 @@ namespace Tnb.WarehouseMgr
|
||||
List<WmsInstockD> instockds = new();
|
||||
List<WmsInstockCode> instockcodes = new();
|
||||
//入库申请主表
|
||||
if (input.data.ContainsKey("wmsInStockH")) {
|
||||
instock = input.data.ContainsKey("wmsInStockH").ToObject<WmsInstockH>();
|
||||
if (input.data.ContainsKey("wmsInStockH"))
|
||||
{
|
||||
instock = input.data.ContainsKey("wmsInStockH").ToObject<WmsInstockH>();
|
||||
}
|
||||
//入库申请物料明细表
|
||||
if (input.data.ContainsKey("wmsInStockds"))
|
||||
@@ -254,8 +263,10 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
}
|
||||
//入库申请条码明细表
|
||||
if (input.data.ContainsKey("wmsInStockCodes")) {
|
||||
if (input.data["wmsInStockCodes"] != null && input.data["wmsInStockCodes"].IsNotEmptyOrNull()) {
|
||||
if (input.data.ContainsKey("wmsInStockCodes"))
|
||||
{
|
||||
if (input.data["wmsInStockCodes"] != null && input.data["wmsInStockCodes"].IsNotEmptyOrNull())
|
||||
{
|
||||
instockcodes = input.data["wmsInStockCodes"].ToObject<List<WmsInstockCode>>();
|
||||
}
|
||||
}
|
||||
@@ -270,7 +281,7 @@ namespace Tnb.WarehouseMgr
|
||||
instock.biz_type = WmsWareHouseConst.BIZTYPE_WMSINSTOCK_ID;
|
||||
instock.bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_INSTOCK_ENCODE).GetAwaiter().GetResult();
|
||||
instock.generate_type = "1";// 自动
|
||||
instock.sync_status =WmsWareHouseConst.SYNC_STATUS__NOTSYNC;//未同步
|
||||
instock.sync_status = WmsWareHouseConst.SYNC_STATUS__NOTSYNC;//未同步
|
||||
instock.print_status = WmsWareHouseConst.PRINT_STATUS_PRINTCOMPLETE;//已打印
|
||||
instock.status = WmsWareHouseConst.BILLSTATUS_ADD_ID;// 新增
|
||||
instock.create_time = DateTime.Now;
|
||||
@@ -352,8 +363,8 @@ namespace Tnb.WarehouseMgr
|
||||
preTask.status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID;
|
||||
preTask.biz_type = instock.biz_type;
|
||||
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID;
|
||||
preTask.carry_id = instock.carry_id;
|
||||
preTask.carry_code = instock.carry_code;
|
||||
preTask.carry_id = instock.carry_id!;
|
||||
preTask.carry_code = instock.carry_code!;
|
||||
preTask.area_id = sPoint?.area_id!;
|
||||
preTask.area_code = it.Key;
|
||||
preTask.require_id = instock.id;
|
||||
@@ -388,11 +399,10 @@ namespace Tnb.WarehouseMgr
|
||||
var isOk = await _wareHouseService.GenPreTask(preTasks, pretaskCodes);
|
||||
if (isOk)
|
||||
{
|
||||
var requireIdField = "require_id";
|
||||
|
||||
var preTaskUpInput = new GenPreTaskUpInput();
|
||||
preTaskUpInput.RquireId = instock.id;
|
||||
preTaskUpInput.CarryId = instock.carry_id;
|
||||
preTaskUpInput.CarryId = instock.carry_id!;
|
||||
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault()!.location_id!;
|
||||
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault()!.location_code!;
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList()!;
|
||||
@@ -404,9 +414,9 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
var handleH = instock.Adapt<WmsHandleH>();
|
||||
operBillId = handleH.id = SnowflakeIdHelper.NextId();
|
||||
handleH.startlocation_id = instock.location_id;
|
||||
handleH.carry_id = instock.carry_id;
|
||||
handleH.carry_code = instock.carry_code;
|
||||
handleH.startlocation_id = instock.location_id!;
|
||||
handleH.carry_id = instock.carry_id!;
|
||||
handleH.carry_code = instock.carry_code!;
|
||||
preTaskUpInput.PreTaskRecord = handleH;
|
||||
}
|
||||
//创建预任务条码操作记录
|
||||
@@ -430,7 +440,7 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
x.id = SnowflakeIdHelper.NextId();
|
||||
x.is_out = 0;
|
||||
x.carry_id = instock.carry_id;
|
||||
x.carry_id = instock!.carry_id!;
|
||||
});
|
||||
await _db.Insertable(carryCodes).ExecuteCommandAsync();
|
||||
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput,
|
||||
@@ -439,7 +449,7 @@ namespace Tnb.WarehouseMgr
|
||||
if (instockCOdes?.Count > 0)
|
||||
{
|
||||
await _db.Updateable<WmsInstockD>().SetColumns(it => new WmsInstockD { line_status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => instockCOdes.Select(x => x.bill_d_id).Contains(it.id)).ExecuteCommandAsync();
|
||||
await _db.Updateable<WmsInstockH>().SetColumns(it => new WmsInstockH { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == instock.id).ExecuteCommandAsync();
|
||||
await _db.Updateable<WmsInstockH>().SetColumns(it => new WmsInstockH { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == instock!.id).ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user