This commit is contained in:
FanLian
2023-07-04 11:03:33 +08:00
27 changed files with 63 additions and 63 deletions

View File

@@ -50,7 +50,7 @@ namespace Tnb.WarehouseMgr
}
if (sRoads_EPointIds?.Count > 0)
{
var subRoads = roads.FindAll(x => sRoads_EPointIds.Contains(x.startpoint_id) && !isVisited[x.endpoint_id]);
var subRoads = roads?.FindAll(x => sRoads_EPointIds.Contains(x.startpoint_id) && !isVisited[x.endpoint_id]);
if (subRoads?.Count > 0)
{
for (int i = 0; i < subRoads.Count; i++)

View File

@@ -514,7 +514,7 @@ namespace Tnb.WarehouseMgr
await _db.Ado.CommitTranAsync();
}
}
catch (Exception ex)
catch (Exception)
{
await _db.Ado.RollbackTranAsync();
}

View File

@@ -151,7 +151,7 @@ namespace Tnb.WarehouseMgr
await _db.Ado.CommitTranAsync();
}
catch (Exception ex)
catch (Exception)
{
await _db.Ado.RollbackTranAsync();
throw;

View File

@@ -68,8 +68,8 @@ namespace Tnb.WarehouseMgr
//入库取终点
//var OutStockStrategyInput = new OutStockStrategyQuery { carry_id = input.data[nameof(OutStockStrategyQuery.carry_id)].ToString(), Size = 1 };
var carry = await _db.Queryable<WmsCarryH>().FirstAsync(it => it.id == input.data[nameof(WmsMoveOutstock.carry_id)].ToString());
WmsPointH sPoint = null;
WmsPointH ePoint = null;
WmsPointH? sPoint = null;
WmsPointH? ePoint = null;
if (input.data.ContainsKey(nameof(WmsPointH.location_id)))
{
ePoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == input.data[nameof(WmsPointH.location_id)].ToString());
@@ -118,7 +118,7 @@ namespace Tnb.WarehouseMgr
if (loc.is_sign ==0 ) {
preTasks[^1].is_sign = 0; // 修改最后一个元素的是否签收值
}
var isOk = await _wareHouseService.GenPreTask(preTasks,null);
var isOk = await _wareHouseService.GenPreTask(preTasks,null!);
if (isOk)
{
var preTaskUpInput = new GenPreTaskUpInput();
@@ -143,7 +143,7 @@ namespace Tnb.WarehouseMgr
await _db.Ado.CommitTranAsync();
}
catch (Exception ex)
catch (Exception)
{
await _db.Ado.RollbackTranAsync();
throw;

View File

@@ -181,7 +181,7 @@ namespace Tnb.WarehouseMgr
//删除载具条码
await _db.Deleteable<WmsCarryCode>().Where(it => it.carry_id == carryObj.id).ExecuteCommandHasChangeAsync();
}
catch (Exception ex)
catch (Exception)
{
}

View File

@@ -94,7 +94,7 @@ namespace Tnb.WarehouseMgr
}
carry.carry_status = ((int)EnumCarryStatus.).ToString();
row = await _db.Updateable(carry).ExecuteCommandAsync();
subCarry.carry_status = ((int)EnumCarryStatus.).ToString();
subCarry!.carry_status = ((int)EnumCarryStatus.).ToString();
row = await _db.Updateable(subCarry).ExecuteCommandAsync();
isOk = (row > 0);
if (!isOk) throw Oops.Oh(ErrorCode.COM1001);

View File

@@ -111,8 +111,8 @@ namespace Tnb.WarehouseMgr
await _runService.Create(templateEntity, input);
// 计算路径,插入预任务申请
WmsPointH sPoint = null;
WmsPointH ePoint = null;
WmsPointH? sPoint = null;
WmsPointH? ePoint = null;
if (input.data.ContainsKey(nameof(WmsDelivery.startlocation_id)))
{
sPoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == input.data[nameof(WmsTransfer.startlocation_id)].ToString());

View File

@@ -71,8 +71,8 @@ namespace Tnb.WarehouseMgr
//入库取终点
var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = input.data[nameof(InStockStrategyQuery.warehouse_id)].ToString()!, Size = 1 };
var endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput);
WmsPointH sPoint = null;
WmsPointH ePoint = null;
WmsPointH? sPoint = null;
WmsPointH? ePoint = null;
if (input.data.ContainsKey(nameof(WmsPointH.location_id)))
{
sPoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == input.data[nameof(WmsPointH.location_id)].ToString());
@@ -116,7 +116,7 @@ namespace Tnb.WarehouseMgr
preTask.create_time = DateTime.Now;
return preTask;
}).ToList();
var isOk = await _wareHouseService.GenPreTask(preTasks,null);
var isOk = await _wareHouseService.GenPreTask(preTasks,null!);
if (isOk)
{
var preTaskUpInput = new GenPreTaskUpInput();
@@ -154,7 +154,7 @@ namespace Tnb.WarehouseMgr
await _db.Ado.CommitTranAsync();
}
catch (Exception ex)
catch (Exception)
{
await _db.Ado.RollbackTranAsync();
throw;

View File

@@ -81,8 +81,8 @@ namespace Tnb.WarehouseMgr
&& a.carry_status == ((int)EnumCarryStatus.).ToString() && a.is_lock == 0 && b.is_lock == 0 && b.is_type == ((int)EnumLocationType.).ToString())
.ToListAsync();
WmsPointH sPoint = null;
WmsPointH ePoint = null;
WmsPointH? sPoint = null;
WmsPointH? ePoint = null;
if (input.data.ContainsKey(nameof(WmsPointH.location_id)))
{
ePoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == input.data[nameof(WmsPointH.location_id)].ToString());
@@ -137,7 +137,7 @@ namespace Tnb.WarehouseMgr
{
preTasks[^1].is_sign = 0; // 修改最后一个元素的是否签收值
}
isOk = await _wareHouseService.GenPreTask(preTasks, null);
isOk = await _wareHouseService.GenPreTask(preTasks, null!);
}
if (isOk)
@@ -175,7 +175,7 @@ namespace Tnb.WarehouseMgr
await _db.Ado.CommitTranAsync();
}
catch (Exception ex)
catch (Exception)
{
await _db.Ado.RollbackTranAsync();
throw;

View File

@@ -153,7 +153,7 @@ namespace Tnb.WarehouseMgr
await _db.Ado.CommitTranAsync();
}
catch (Exception ex)
catch (Exception)
{
await _db.Ado.RollbackTranAsync();
}

View File

@@ -72,8 +72,8 @@ namespace Tnb.WarehouseMgr
//入库取终点 //出库起点
var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = input.data[nameof(InStockStrategyQuery.warehouse_id)].ToString()!, Size = 1 };
var endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput);
WmsPointH sPoint = null;
WmsPointH ePoint = null;
WmsPointH? sPoint = null;
WmsPointH? ePoint = null;
if (input.data.ContainsKey(nameof(WmsPointH.location_id)))
{
sPoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == input.data[nameof(WmsPointH.location_id)].ToString());
@@ -197,9 +197,9 @@ namespace Tnb.WarehouseMgr
await _db.Ado.CommitTranAsync();
}
catch (Exception ex)
catch (Exception)
{
await _db.Ado.RollbackTranAsync();
await _db.Ado.RollbackTranAsync();
throw;
}
return Task.FromResult(true);

View File

@@ -71,8 +71,8 @@ namespace Tnb.WarehouseMgr
//入库取终点
//var OutStockStrategyInput = new OutStockStrategyQuery { carry_id = input.data[nameof(OutStockStrategyQuery.carry_id)].ToString(), Size = 1 };
var carry = await _db.Queryable<WmsCarryH>().FirstAsync(it => it.id == input.data[nameof(WmsOutbale.carry_id)].ToString());
WmsPointH sPoint = null;
WmsPointH ePoint = null;
WmsPointH? sPoint = null;
WmsPointH? ePoint = null;
if (input.data.ContainsKey(nameof(WmsPointH.location_id)))
{
ePoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == input.data[nameof(WmsPointH.location_id)].ToString());
@@ -122,7 +122,7 @@ namespace Tnb.WarehouseMgr
{
preTasks[^1].is_sign = 0; // 修改最后一个元素的是否签收值
}
var isOk = await _wareHouseService.GenPreTask(preTasks, null);
var isOk = await _wareHouseService.GenPreTask(preTasks, null!);
if (isOk)
{
var preTaskUpInput = new GenPreTaskUpInput();
@@ -147,7 +147,7 @@ namespace Tnb.WarehouseMgr
await _db.Ado.CommitTranAsync();
}
catch (Exception ex)
catch (Exception)
{
await _db.Ado.RollbackTranAsync();
throw;

View File

@@ -84,7 +84,7 @@ namespace Tnb.WarehouseMgr
create_time = DateTime.Now
};
var row = await _db.Insertable(wmsCarryD).ExecuteCommandAsync();
carry.carry_status = ((int)EnumCarryStatus.).ToString();
carry!.carry_status = ((int)EnumCarryStatus.).ToString();
row = await _db.Updateable(carry).ExecuteCommandAsync();
subCarry.carry_status = ((int)EnumCarryStatus.).ToString();
row = await _db.Updateable(subCarry).ExecuteCommandAsync();
@@ -121,7 +121,7 @@ namespace Tnb.WarehouseMgr
}
await _db.Ado.CommitTranAsync();
}
catch (Exception ex)
catch (Exception)
{
await _db.Ado.RollbackTranAsync();
throw;

View File

@@ -71,8 +71,8 @@ namespace Tnb.WarehouseMgr
//入库取终点 //出库起点
var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = input.data[nameof(InStockStrategyQuery.warehouse_id)].ToString()!, Size = 1 };
var endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput);
WmsPointH sPoint = null;
WmsPointH ePoint = null;
WmsPointH? sPoint = null;
WmsPointH? ePoint = null;
if (input.data.ContainsKey(nameof(WmsPointH.location_id)))
{
sPoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == input.data[nameof(WmsPointH.location_id)].ToString());
@@ -116,7 +116,7 @@ namespace Tnb.WarehouseMgr
preTask.create_time = DateTime.Now;
return preTask;
}).ToList();
var isOk = await _wareHouseService.GenPreTask(preTasks, null);
var isOk = await _wareHouseService.GenPreTask(preTasks, null!);
if (isOk)
{
var preTaskUpInput = new GenPreTaskUpInput();
@@ -141,7 +141,7 @@ namespace Tnb.WarehouseMgr
await _db.Ado.CommitTranAsync();
}
catch (Exception ex)
catch (Exception)
{
await _db.Ado.RollbackTranAsync();
throw;

View File

@@ -67,8 +67,8 @@ namespace Tnb.WarehouseMgr
await _runService.Create(templateEntity, input);
//出库取起点
var carry = await _db.Queryable<WmsCarryH>().FirstAsync(it => it.id == input.data[nameof(WmsMoveOutstock.carry_id)].ToString());
WmsPointH sPoint = null;
WmsPointH ePoint = null;
WmsPointH? sPoint = null;
WmsPointH? ePoint = null;
if (input.data.ContainsKey(nameof(WmsPointH.location_id)))
{
ePoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == input.data[nameof(WmsPointH.location_id)].ToString());
@@ -119,7 +119,7 @@ namespace Tnb.WarehouseMgr
{
preTasks[^1].is_sign = 0; // 修改最后一个元素的是否签收值
}
var isOk = await _wareHouseService.GenPreTask(preTasks, null);
var isOk = await _wareHouseService.GenPreTask(preTasks, null!);
if (isOk)
{
var preTaskUpInput = new GenPreTaskUpInput();
@@ -143,7 +143,7 @@ namespace Tnb.WarehouseMgr
await _db.Ado.CommitTranAsync();
}
catch (Exception ex)
catch (Exception)
{
await _db.Ado.RollbackTranAsync();
throw;

View File

@@ -112,7 +112,7 @@ namespace Tnb.WarehouseMgr
await _db.Ado.CommitTranAsync();
}
catch (Exception ex)
catch (Exception)
{
await _db.Ado.RollbackTranAsync();
throw;

View File

@@ -36,13 +36,13 @@ namespace Tnb.WarehouseMgr
public class WmsPDADeliveryService : BaseWareHouseService, IPdaStroage
{
private const string BizTypeId = "26125644258853";
private readonly ISqlSugarClient? _db;
private readonly IRunService? _runService;
private readonly IVisualDevService? _visualDevService;
private readonly IBasLocationService? _basLocationService;
private readonly IWareHouseService? _wareHouseService;
private readonly IBillRullService? _billRullService;
private readonly IUserManager? _userManager;
private readonly ISqlSugarClient _db;
private readonly IRunService _runService;
private readonly IVisualDevService _visualDevService;
private readonly IBasLocationService _basLocationService;
private readonly IWareHouseService _wareHouseService;
private readonly IBillRullService _billRullService;
private readonly IUserManager _userManager;
public WmsPDADeliveryService(
ISqlSugarRepository<WmsDelivery> repository,
IRunService runService,
@@ -69,7 +69,7 @@ namespace Tnb.WarehouseMgr
/// <returns></returns>
public async Task<dynamic> GetUnStoreLocationListByCarryId([FromRoute] string carryId)
{
var items = await _db.Queryable<WmsCarryH>().LeftJoin<BasLocation>((a, b) => a.location_id == b.id)
var items = await _db!.Queryable<WmsCarryH>().LeftJoin<BasLocation>((a, b) => a.location_id == b.id)
.Where(a => a.id == carryId)
.Select((a, b) => new
{

View File

@@ -115,7 +115,7 @@ namespace Tnb.WarehouseMgr
preTask.create_time = DateTime.Now;
return preTask;
}).ToList();
var isOk = await _wareHouseService.GenPreTask(preTasks,null);
var isOk = await _wareHouseService.GenPreTask(preTasks,null!);
if (isOk)
{
var preTaskUpInput = new GenPreTaskUpInput();
@@ -129,7 +129,7 @@ namespace Tnb.WarehouseMgr
WmsHandleH handleH = new();
handleH.org_id = _userManager.User.OrganizeId;
handleH.startlocation_id = input.data[nameof(WmsPointH.location_id)]?.ToString()!;
handleH.endlocation_id = endLocations[0].id;
handleH.endlocation_id = endLocations![0].id;
handleH.bill_code = input.data[nameof(WmsHandleH.bill_code)]?.ToString()!;
handleH.biz_type = input.data[nameof(WmsHandleH.biz_type)]?.ToString()!;
handleH.carry_id = input.data[nameof(WmsHandleH.carry_id)]?.ToString()!;

View File

@@ -134,7 +134,7 @@ namespace Tnb.WarehouseMgr
{
preTasks[^1].is_sign = 0; // 修改最后一个元素的是否签收值
}
isOk = await _wareHouseService.GenPreTask(preTasks, null);
isOk = await _wareHouseService.GenPreTask(preTasks, null!);
}
if (isOk)

View File

@@ -73,7 +73,7 @@ namespace Tnb.WarehouseMgr
await _db.Ado.CommitTranAsync();
}
catch (Exception ex)
catch (Exception)
{
await _db.Ado.RollbackTranAsync();
throw;

View File

@@ -150,7 +150,7 @@ namespace Tnb.WarehouseMgr
//删除载具条码
await _db.Deleteable<WmsCarryCode>().Where(it => it.carry_id == carryObj.id).ExecuteCommandHasChangeAsync();
}
catch (Exception ex)
catch (Exception)
{
}

View File

@@ -76,7 +76,7 @@ namespace Tnb.WarehouseMgr
{
await _db.Ado.BeginTranAsync();
JArray jArr = null;
JArray? jArr = null;
if (input.data.ContainsKey("tablefield115"))
{
jArr = JArray.Parse(input.data["tablefield115"].ToString()!);
@@ -256,7 +256,7 @@ namespace Tnb.WarehouseMgr
await _db.Ado.CommitTranAsync();
}
catch (Exception ex)
catch (Exception)
{
await _db.Ado.RollbackTranAsync();
throw;

View File

@@ -72,8 +72,8 @@ namespace Tnb.WarehouseMgr
var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = input.data[nameof(InStockStrategyQuery.warehouse_id)].ToString()!, Size = 1 };
var inbaleItem = await _db.Queryable<WmsInbale>().SingleAsync(it => it.bill_code == input.data[nameof(WmsInbale.bill_code)].ToString());
var endLocations = await _wareHouseService.InStockStrategy(inStockStrategyInput);
WmsPointH sPoint = null;
WmsPointH ePoint = null;
WmsPointH? sPoint = null;
WmsPointH? ePoint = null;
if (input.data.ContainsKey(nameof(WmsPointH.location_id)))
{
sPoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == input.data[nameof(WmsPointH.location_id)].ToString());

View File

@@ -143,7 +143,7 @@ namespace Tnb.WarehouseMgr
await _db.Ado.CommitTranAsync();
}
catch (Exception ex)
catch (Exception)
{
await _db.Ado.RollbackTranAsync();
throw;

View File

@@ -68,8 +68,8 @@ namespace Tnb.WarehouseMgr
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleConsts.MODULE_WMSTRANSFERPDA_ID, true);
await _runService.Create(templateEntity, input);
// 计算路径,插入预任务申请
WmsPointH sPoint = null;
WmsPointH ePoint = null;
WmsPointH? sPoint = null;
WmsPointH? ePoint = null;
if (input.data.ContainsKey(nameof(WmsTransfer.startlocation_id)))
{
sPoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == input.data[nameof(WmsTransfer.startlocation_id)].ToString());
@@ -113,7 +113,7 @@ namespace Tnb.WarehouseMgr
preTask.create_time = DateTime.Now;
return preTask;
}).ToList();
var isOk = await _wareHouseService.GenPreTask(preTasks, null);
var isOk = await _wareHouseService.GenPreTask(preTasks, null!);
if (isOk)
{
//查询库位表
@@ -139,7 +139,7 @@ namespace Tnb.WarehouseMgr
await _db.Ado.CommitTranAsync();
}
catch (Exception ex)
catch (Exception)
{
await _db.Ado.RollbackTranAsync();
throw;

View File

@@ -169,7 +169,7 @@ namespace Tnb.WarehouseMgr
await _db.Ado.CommitTranAsync();
}
catch (Exception ex)
catch (Exception)
{
await _db.Ado.RollbackTranAsync();
throw;

View File

@@ -184,7 +184,7 @@ namespace Tnb.WarehouseMgr
await _warehouseService.GenPreTask(preTasks, null!);
var subCarrys = await _db.Queryable<WmsCarryD>().Where(it => it.carry_id == ko.carry_id).ToListAsync();
var carryIds = subCarrys.Select(x => x.carry_id).Concat(new[] { ko.carry_id }).Distinct().ToList();
GenPreTaskUpInput genPreTaskInput = new() { CarryIds = carryIds, LocationIds = new List<string> { carry.location_id!, ko.location_id! } };
GenPreTaskUpInput genPreTaskInput = new() { CarryIds = carryIds!, LocationIds = new List<string> { carry.location_id!, ko.location_id! } };
await _warehouseService.GenInStockTaskHandleAfter(genPreTaskInput, it => new WmsCarryH { is_lock = 1, carry_status = ((int)EnumCarryStatus.).ToString() }, it => new BasLocation { is_lock = 1 });
}