wms 消除warning
This commit is contained in:
@@ -14,15 +14,15 @@ namespace Tnb.WarehouseMgr.Entities.Dto
|
||||
/// <summary>
|
||||
/// 物料单位
|
||||
/// </summary>
|
||||
public string unit_id { get; set; }
|
||||
public string? unit_id { get; set; }
|
||||
/// <summary>
|
||||
/// 条码编号
|
||||
/// </summary>
|
||||
public string barcode { get; set; }
|
||||
public string? barcode { get; set; }
|
||||
/// <summary>
|
||||
/// 条码批次
|
||||
/// </summary>
|
||||
public string code_batch { get; set; }
|
||||
public string? code_batch { get; set; }
|
||||
/// <summary>
|
||||
/// 条码数量
|
||||
/// </summary>
|
||||
@@ -30,12 +30,12 @@ namespace Tnb.WarehouseMgr.Entities.Dto
|
||||
/// <summary>
|
||||
/// 物料编号
|
||||
/// </summary>
|
||||
public string material_code { get; set; }
|
||||
public string? material_code { get; set; }
|
||||
/// <summary>
|
||||
/// 物料名称
|
||||
/// </summary>
|
||||
public string material_name { get; set; }
|
||||
public string? material_name { get; set; }
|
||||
|
||||
public string material_id { get; set; }
|
||||
public string? material_id { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,31 +14,31 @@ namespace Tnb.WarehouseMgr.Entities.Dto
|
||||
/// <summary>
|
||||
/// 入库单明细Id
|
||||
/// </summary>
|
||||
public string id { get; set; }
|
||||
public string? id { get; set; }
|
||||
/// <summary>
|
||||
/// 入库单Id
|
||||
/// </summary>
|
||||
public string bill_id { get; set; }
|
||||
public string? bill_id { get; set; }
|
||||
/// <summary>
|
||||
/// 单位id
|
||||
/// </summary>
|
||||
public string unit_id { get; set; }
|
||||
public string? unit_id { get; set; }
|
||||
/// <summary>
|
||||
/// 批次
|
||||
/// </summary>
|
||||
public string code_batch { get; set; }
|
||||
public string? code_batch { get; set; }
|
||||
/// <summary>
|
||||
/// 入库仓库Id
|
||||
/// </summary>
|
||||
public string warehouse_id { get; set; }
|
||||
public string? warehouse_id { get; set; }
|
||||
/// <summary>
|
||||
/// 执行状态
|
||||
/// </summary>
|
||||
public string line_status { get; set; }
|
||||
public string? line_status { get; set; }
|
||||
/// <summary>
|
||||
/// 原因
|
||||
/// </summary>
|
||||
public string reason { get; set; }
|
||||
public string? reason { get; set; }
|
||||
/// <summary>
|
||||
/// 需求数量
|
||||
/// </summary>
|
||||
@@ -78,6 +78,6 @@ namespace Tnb.WarehouseMgr.Entities.Dto
|
||||
/// <summary>
|
||||
/// 条码明细
|
||||
/// </summary>
|
||||
public List<WmsInstockCode> CodeDetails { get; set; }
|
||||
public List<WmsInstockCode>? CodeDetails { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ public partial class WmsCarryCode : BaseEntity<string>, IWmsCarryEntity
|
||||
/// <summary>
|
||||
/// 上级载具ID
|
||||
/// </summary>
|
||||
public string? carry_id { get; set; }
|
||||
public string carry_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物品ID
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
if (input.data.ContainsKey(nameof(BasRegionUser.region_id)) && input.data.ContainsKey(nameof(BasRegionUser.user_id)))
|
||||
{
|
||||
var regionId = input.data[nameof(BasRegionUser.region_id)].ToString();
|
||||
var regionId = input.data[nameof(BasRegionUser.region_id)].ToString()!;
|
||||
var userId = input.data[nameof(BasRegionUser.user_id)].ToString();
|
||||
var user = await _db.Queryable<BasRegionUser>().Where(it => it.region_id == regionId && it.user_id == userId).FirstAsync();
|
||||
if (user != null)
|
||||
|
||||
@@ -25,9 +25,6 @@ namespace Tnb.WarehouseMgr
|
||||
/// <summary>
|
||||
/// 动态规划函数
|
||||
/// </summary>
|
||||
/// <param name="roads"></param>
|
||||
/// <param name="sPointId"></param>
|
||||
/// <param name="ePointId"></param>
|
||||
/// <returns></returns>
|
||||
public void DpFunc(List<WmsRoad> roads, List<string> pointIds, Dictionary<string, bool> isVisited, string sPointId, string ePointId, dynamic ArrivedEpoint)
|
||||
{
|
||||
@@ -37,7 +34,7 @@ namespace Tnb.WarehouseMgr
|
||||
if (!isVisited[sPointId])
|
||||
{
|
||||
pointIds.Add(sPointId);
|
||||
set.Add(roads.Find(x => x.startpoint_id == sPointId).startpoint_code);
|
||||
set.Add(roads?.Find(x => x.startpoint_id == sPointId)?.startpoint_code!);
|
||||
isVisited[sPointId] = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ namespace Tnb.WarehouseMgr
|
||||
x.bill_d_id = wmsInstockD.id;
|
||||
});
|
||||
}
|
||||
isOk = await _update(wmsInstockD, wmsInstockCodes);
|
||||
isOk = await _update(wmsInstockD, wmsInstockCodes!);
|
||||
break;
|
||||
case EnumInOutStockType.Out:
|
||||
var wmsOutstockD = input.Adapt<WmsOutstockD>();
|
||||
@@ -143,12 +143,11 @@ namespace Tnb.WarehouseMgr
|
||||
/// <summary>
|
||||
/// 根据明细Id获取出入库明细信息
|
||||
/// </summary>
|
||||
/// <param name="billDId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<dynamic> GetInOutStockCodesById([FromQuery] InOutStockDetailQuery input)
|
||||
public async Task<dynamic?> GetInOutStockCodesById([FromQuery] InOutStockDetailQuery input)
|
||||
{
|
||||
dynamic result = null;
|
||||
dynamic? result = null;
|
||||
var dic = await _dictionaryDataService.GetDictionaryByTypeId(WmsWareHouseConst.WMS_INSTOCK_D_BILL_STATUS_TYPEID);
|
||||
switch (input.inoutStockType)
|
||||
{
|
||||
@@ -175,7 +174,7 @@ namespace Tnb.WarehouseMgr
|
||||
all_amount = a.all_amount,
|
||||
CodeDetails = SqlFunc.Subqueryable<WmsInstockCode>().Where(it => it.bill_d_id == a.id).ToList(),
|
||||
})
|
||||
.Mapper(it => it.line_status = dic.ContainsKey(it.line_status) ? dic[it.line_status]?.ToString()! : "")
|
||||
.Mapper(it => it.line_status = dic.ContainsKey(it.line_status!) ? dic[it.line_status!]?.ToString()! : "")
|
||||
.ToListAsync();
|
||||
|
||||
break;
|
||||
@@ -218,9 +217,8 @@ namespace Tnb.WarehouseMgr
|
||||
items = await _db.Queryable<BasLocation>().Where(it => it.wh_id == input.warehouse_id && it.is_lock == 0 && it.is_type == "0" && it.is_use == (int)EnumCarryStatus.空闲).OrderBy(it => new { it.layers, it.loc_line, it.loc_column }, OrderByType.Asc).ToListAsync();
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
throw;
|
||||
}
|
||||
return items.Take(input.Size).ToList();
|
||||
@@ -232,7 +230,7 @@ namespace Tnb.WarehouseMgr
|
||||
[HttpGet]
|
||||
public async Task<dynamic> OutStockStrategy()
|
||||
{
|
||||
return Task.FromResult<dynamic>(true);
|
||||
return await Task.FromResult<dynamic>(true);
|
||||
}
|
||||
/// <summary>
|
||||
/// 生成任务执行
|
||||
@@ -475,11 +473,12 @@ namespace Tnb.WarehouseMgr
|
||||
await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH { is_lock = 0, location_id = multiList[i].endlocation_id, location_code = multiList[i].endlocation_code }).Where(it => it.id == multiList[i].carry_id).ExecuteCommandAsync();
|
||||
//更新条码的库位和仓库信息
|
||||
var carryCodes = await _db.Queryable<WmsCarryCode>().Where(it => it.id == multiList[i].carry_id).ToListAsync();
|
||||
if (carryCodes?.Count>0) {
|
||||
if (carryCodes?.Count > 0)
|
||||
{
|
||||
var loc = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == multiList[i].endlocation_id);
|
||||
await _db.Updateable<WmsCarryCode>().SetColumns(it => new WmsCarryCode { warehouse_id = loc.wh_id, location_id = multiList[i].endlocation_id, location_code = multiList[i].endlocation_code }).Where(it => it.id == multiList[i].carry_id).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
//更新库位信息,使用状态为 使用,锁定状态为未锁定
|
||||
@@ -503,7 +502,7 @@ namespace Tnb.WarehouseMgr
|
||||
foreach (var dt in disTasks)
|
||||
{
|
||||
var disTaskCodes = await _db.Queryable<WmsDistaskCode>().Where(it => it.bill_id == dt.id).ToListAsync();
|
||||
var upInput = new WareHouseUpInput { bizTypeId = dt.biz_type, requireId = dt.require_id, distaskCodes = disTaskCodes, carryIds = disTasks.Select(x => x.carry_id).ToList() };
|
||||
var upInput = new WareHouseUpInput { bizTypeId = dt.biz_type, requireId = dt.require_id!, distaskCodes = disTaskCodes, carryIds = disTasks.Select(x => x.carry_id).ToList() };
|
||||
upInput.loginType = !_userManager.LoginType.IsNullOrEmpty() ? "app" : "web";
|
||||
if (dt.is_sign == 1 && dt.chain_type == "3")
|
||||
{
|
||||
|
||||
@@ -122,7 +122,7 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
await _db.Ado.CommitTranAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception)
|
||||
{
|
||||
await _db.Ado.RollbackTranAsync();
|
||||
throw;
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace Tnb.WarehouseMgr
|
||||
// }
|
||||
//}
|
||||
}
|
||||
return data;
|
||||
return data!;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -69,10 +69,10 @@ namespace Tnb.WarehouseMgr
|
||||
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleConsts.MODULE_CARRYMOVEINSTOCK_ID, true);
|
||||
await _runService.Create(templateEntity, input);
|
||||
//入库取终点 //出库起点
|
||||
var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = input.data[nameof(InStockStrategyQuery.warehouse_id)].ToString(), Size = 1 };
|
||||
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());
|
||||
@@ -95,11 +95,11 @@ namespace Tnb.WarehouseMgr
|
||||
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.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();
|
||||
@@ -108,7 +108,7 @@ namespace Tnb.WarehouseMgr
|
||||
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID;
|
||||
preTask.carry_id = input.data[nameof(preTask.carry_id)]?.ToString()!;
|
||||
preTask.carry_code = input.data[nameof(preTask.carry_code)]?.ToString()!;
|
||||
preTask.area_id = sPoint?.area_id;
|
||||
preTask.area_id = sPoint?.area_id!;
|
||||
preTask.area_code = it.Key;
|
||||
preTask.require_id = input.data["ReturnIdentity"].ToString();
|
||||
preTask.require_code = input.data[nameof(preTask.bill_code)]?.ToString()!;
|
||||
@@ -116,24 +116,24 @@ 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();
|
||||
preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString();
|
||||
preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString()!;
|
||||
preTaskUpInput.CarryId = input.data[nameof(WmsCarryD.carry_id)]?.ToString()!;
|
||||
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id;
|
||||
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code;
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList();
|
||||
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault()!.location_id!;
|
||||
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault()!.location_code!;
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList()!;
|
||||
|
||||
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.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();
|
||||
handleH.carry_code = input.data[nameof(WmsHandleH.carry_code)]?.ToString();
|
||||
handleH.startlocation_id = input.data[nameof(WmsPointH.location_id)]?.ToString()!;
|
||||
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()!;
|
||||
handleH.carry_code = input.data[nameof(WmsHandleH.carry_code)]?.ToString()!;
|
||||
handleH.require_id = input.data["ReturnIdentity"].ToString();
|
||||
handleH.require_code = input.data[nameof(WmsHandleH.bill_code)]?.ToString()!;
|
||||
handleH.create_id = _userManager.UserId;
|
||||
|
||||
@@ -93,10 +93,10 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
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.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();
|
||||
@@ -105,7 +105,7 @@ namespace Tnb.WarehouseMgr
|
||||
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_OUTSTOCK_TYPE_ID;
|
||||
preTask.carry_id = input.data[nameof(preTask.carry_id)]?.ToString()!;
|
||||
preTask.carry_code = input.data[nameof(preTask.carry_code)]?.ToString()!;
|
||||
preTask.area_id = sPoint?.area_id;
|
||||
preTask.area_id = sPoint?.area_id!;
|
||||
preTask.area_code = it.Key;
|
||||
preTask.require_id = input.data["ReturnIdentity"].ToString();
|
||||
preTask.require_code = input.data[nameof(preTask.bill_code)]?.ToString()!;
|
||||
@@ -122,11 +122,11 @@ namespace Tnb.WarehouseMgr
|
||||
if (isOk)
|
||||
{
|
||||
var preTaskUpInput = new GenPreTaskUpInput();
|
||||
preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString();
|
||||
preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString()!;
|
||||
preTaskUpInput.CarryId = input.data[nameof(WmsCarryD.carry_id)]?.ToString()!;
|
||||
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id;
|
||||
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code;
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList();
|
||||
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault()!.location_id!;
|
||||
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault()!.location_code!;
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList()!;
|
||||
preTaskUpInput.PreTaskRecords = preTasks.Adapt<List<WmsHandleH>>();
|
||||
preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId());
|
||||
//根据载具移出Id,回更单据状态
|
||||
|
||||
@@ -113,7 +113,7 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
await _db.Ado.CommitTranAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception)
|
||||
{
|
||||
await _db.Ado.RollbackTranAsync();
|
||||
throw;
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
if (input.data.ContainsKey(nameof(WmsCollocationSchemeH.material_code)))
|
||||
{
|
||||
materialCode = input.data[nameof(WmsCollocationSchemeH.material_code)]?.ToString();
|
||||
materialCode = input.data[nameof(WmsCollocationSchemeH.material_code)]?.ToString()!;
|
||||
}
|
||||
if (input.data.ContainsKey(nameof(WmsCollocationSchemeH.seq)) && input.data[nameof(WmsCollocationSchemeH.seq)] != null)
|
||||
{
|
||||
|
||||
@@ -47,7 +47,6 @@ namespace Tnb.WarehouseMgr
|
||||
private readonly IWareHouseService _wareHouseService;
|
||||
private readonly IBillRullService _billRullService;
|
||||
private readonly IUserManager _userManager;
|
||||
public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc();
|
||||
public WmsDeliveryService(
|
||||
ISqlSugarRepository<WmsDelivery> repository,
|
||||
IRunService runService,
|
||||
@@ -137,10 +136,10 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
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.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();
|
||||
@@ -149,7 +148,7 @@ namespace Tnb.WarehouseMgr
|
||||
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_TRANSFER_TYPE_ID;
|
||||
preTask.carry_id = input.data[nameof(preTask.carry_id)]?.ToString()!;
|
||||
preTask.carry_code = input.data[nameof(preTask.carry_code)]?.ToString()!;
|
||||
preTask.area_id = sPoint?.area_id;
|
||||
preTask.area_id = sPoint?.area_id!;
|
||||
preTask.area_code = it.Key;
|
||||
preTask.require_id = input.data["ReturnIdentity"].ToString();
|
||||
preTask.require_code = input.data[nameof(preTask.bill_code)]?.ToString()!;
|
||||
@@ -157,7 +156,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)
|
||||
{
|
||||
if (input.data.ContainsKey(nameof(WmsDelivery.startlocation_id)) && input.data.ContainsKey(nameof(WmsDelivery.endlocation_id)) && input.data[nameof(WmsDelivery.endlocation_id)] != null && input.data[nameof(WmsDelivery.endlocation_id)] != null)
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace Tnb.WarehouseMgr
|
||||
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleConsts.MODULE_WMSEMPTYINSTOCK_ID, true);
|
||||
await _runService.Create(templateEntity, input);
|
||||
//入库取终点
|
||||
var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = input.data[nameof(InStockStrategyQuery.warehouse_id)].ToString(), Size = 1 };
|
||||
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;
|
||||
@@ -96,10 +96,10 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
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.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();
|
||||
@@ -108,7 +108,7 @@ namespace Tnb.WarehouseMgr
|
||||
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID;
|
||||
preTask.carry_id = input.data[nameof(preTask.carry_id)]?.ToString()!;
|
||||
preTask.carry_code = input.data[nameof(preTask.carry_code)]?.ToString()!;
|
||||
preTask.area_id = sPoint?.area_id;
|
||||
preTask.area_id = sPoint?.area_id!;
|
||||
preTask.area_code = it.Key;
|
||||
preTask.require_id = input.data["ReturnIdentity"].ToString();
|
||||
preTask.require_code = input.data[nameof(preTask.bill_code)]?.ToString()!;
|
||||
@@ -120,22 +120,22 @@ namespace Tnb.WarehouseMgr
|
||||
if (isOk)
|
||||
{
|
||||
var preTaskUpInput = new GenPreTaskUpInput();
|
||||
preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString();
|
||||
preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString()!;
|
||||
preTaskUpInput.CarryId = input.data[nameof(WmsCarryD.carry_id)]?.ToString()!;
|
||||
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id;
|
||||
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code;
|
||||
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault()!.location_id!;
|
||||
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault()!.location_code!;
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.id).ToList();
|
||||
preTaskUpInput.PreTaskRecords = preTasks.Adapt<List<WmsHandleH>>();
|
||||
preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId());
|
||||
|
||||
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.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();
|
||||
handleH.carry_code = input.data[nameof(WmsHandleH.carry_code)]?.ToString();
|
||||
handleH.startlocation_id = input.data[nameof(WmsPointH.location_id)]?.ToString()!;
|
||||
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()!;
|
||||
handleH.carry_code = input.data[nameof(WmsHandleH.carry_code)]?.ToString()!;
|
||||
handleH.require_id = input.data["ReturnIdentity"].ToString();
|
||||
handleH.require_code = input.data[nameof(WmsHandleH.bill_code)]?.ToString()!;
|
||||
handleH.create_id = _userManager.UserId;
|
||||
|
||||
@@ -143,18 +143,18 @@ namespace Tnb.WarehouseMgr
|
||||
if (isOk)
|
||||
{
|
||||
var preTaskUpInput = new GenPreTaskUpInput();
|
||||
preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString();
|
||||
preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString()!;
|
||||
preTaskUpInput.CarryId = carrys![i].id;
|
||||
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id;
|
||||
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code;
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList();
|
||||
preTaskUpInput.CarryStartLocationId = points!.FirstOrDefault()!.location_id!;
|
||||
preTaskUpInput.CarryStartLocationCode = points!.FirstOrDefault()!.location_code!;
|
||||
preTaskUpInput.LocationIds = points!.Select(x => x.location_id).ToList()!;
|
||||
|
||||
//更新明细表
|
||||
WmsEmptyOutstockD wmsEmptyOutstockD = new();
|
||||
wmsEmptyOutstockD.id = SnowflakeIdHelper.NextId();
|
||||
wmsEmptyOutstockD.bill_id = preTaskUpInput.RquireId;
|
||||
wmsEmptyOutstockD.biz_type = WmsWareHouseConst.BIZTYPE_WMSEPTYOUTSTK_ID;
|
||||
wmsEmptyOutstockD.location_id = ePoint.location_id;
|
||||
wmsEmptyOutstockD.location_id = ePoint.location_id!;
|
||||
wmsEmptyOutstockD.status = WmsWareHouseConst.BILLSTATUS_ON_ID;
|
||||
wmsEmptyOutstockD.carry_id = carrys[i].id;
|
||||
wmsEmptyOutstockD.carry_code = carrys[i].carry_code;
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace Tnb.WarehouseMgr
|
||||
.Select(a => new CarryCodeDetailOutput
|
||||
{
|
||||
barcode = a.barcode,
|
||||
code_batch = a.code_batch,
|
||||
code_batch = a.code_batch!,
|
||||
codeqty = a.codeqty,
|
||||
material_code = a.material_code,
|
||||
material_id = a.material_id,
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace Tnb.WarehouseMgr
|
||||
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleConsts.MODULE_WMSKITTINGINSTK_ID, true);
|
||||
await _runService.Create(templateEntity, input);
|
||||
//入库取终点 //出库起点
|
||||
var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = input.data[nameof(InStockStrategyQuery.warehouse_id)].ToString(), Size = 1 };
|
||||
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;
|
||||
@@ -97,10 +97,10 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
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.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();
|
||||
@@ -109,7 +109,7 @@ namespace Tnb.WarehouseMgr
|
||||
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID;
|
||||
preTask.carry_id = input.data[nameof(preTask.carry_id)]?.ToString()!;
|
||||
preTask.carry_code = input.data[nameof(preTask.carry_code)]?.ToString()!;
|
||||
preTask.area_id = sPoint?.area_id;
|
||||
preTask.area_id = sPoint?.area_id!;
|
||||
preTask.area_code = it.Key;
|
||||
preTask.require_id = input.data["ReturnIdentity"].ToString();
|
||||
preTask.require_code = input.data[nameof(preTask.bill_code)]?.ToString()!;
|
||||
@@ -143,20 +143,20 @@ namespace Tnb.WarehouseMgr
|
||||
if (isOk)
|
||||
{
|
||||
var preTaskUpInput = new GenPreTaskUpInput();
|
||||
preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString();
|
||||
preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString()!;
|
||||
preTaskUpInput.CarryId = input.data[nameof(WmsCarryD.carry_id)]?.ToString()!;
|
||||
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id;
|
||||
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code;
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList();
|
||||
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault()!.location_id!;
|
||||
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault()!.location_code!;
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList()!;
|
||||
|
||||
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.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();
|
||||
handleH.carry_code = input.data[nameof(WmsHandleH.carry_code)]?.ToString();
|
||||
handleH.startlocation_id = input.data[nameof(WmsPointH.location_id)]?.ToString()!;
|
||||
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()!;
|
||||
handleH.carry_code = input.data[nameof(WmsHandleH.carry_code)]?.ToString()!;
|
||||
handleH.require_id = input.data["ReturnIdentity"].ToString();
|
||||
handleH.require_code = input.data[nameof(WmsHandleH.bill_code)]?.ToString()!;
|
||||
handleH.create_id = _userManager.UserId;
|
||||
@@ -173,7 +173,7 @@ namespace Tnb.WarehouseMgr
|
||||
carryCodes.ForEach(x =>
|
||||
{
|
||||
x.id = SnowflakeIdHelper.NextId();
|
||||
x.carry_id = input.data[nameof(WmsHandleH.carry_id)].ToString();
|
||||
x.carry_id = input.data[nameof(WmsHandleH.carry_id)].ToString()!;
|
||||
x.create_id = _userManager.UserId;
|
||||
x.create_time = DateTime.Now;
|
||||
});
|
||||
|
||||
@@ -96,10 +96,10 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
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.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();
|
||||
@@ -108,7 +108,7 @@ namespace Tnb.WarehouseMgr
|
||||
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_OUTSTOCK_TYPE_ID;
|
||||
preTask.carry_id = input.data[nameof(preTask.carry_id)]?.ToString()!;
|
||||
preTask.carry_code = input.data[nameof(preTask.carry_code)]?.ToString()!;
|
||||
preTask.area_id = sPoint?.area_id;
|
||||
preTask.area_id = sPoint?.area_id!;
|
||||
preTask.area_code = it.Key;
|
||||
preTask.require_id = input.data["ReturnIdentity"].ToString();
|
||||
preTask.require_code = input.data[nameof(preTask.bill_code)]?.ToString()!;
|
||||
@@ -126,11 +126,11 @@ namespace Tnb.WarehouseMgr
|
||||
if (isOk)
|
||||
{
|
||||
var preTaskUpInput = new GenPreTaskUpInput();
|
||||
preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString();
|
||||
preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString()!;
|
||||
preTaskUpInput.CarryId = input.data[nameof(WmsCarryD.carry_id)]?.ToString()!;
|
||||
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id;
|
||||
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code;
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList();
|
||||
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault()!.location_id!;
|
||||
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault()!.location_code!;
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList()!;
|
||||
preTaskUpInput.PreTaskRecords = preTasks.Adapt<List<WmsHandleH>>();
|
||||
preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId());
|
||||
//根据载具移出Id,回更单据状态
|
||||
|
||||
@@ -292,16 +292,16 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
//bill_id,bill_line,bill_d_id,bill_d_line,code_qty
|
||||
|
||||
try
|
||||
{
|
||||
var dddd = await _db.Queryable<TestTT>().Where(it => it.status == 8).ToListAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//try
|
||||
//{
|
||||
// var dddd = await _db.Queryable<TestTT>().Where(it => it.status == 8).ToListAsync();
|
||||
//}
|
||||
//catch (Exception ex)
|
||||
//{
|
||||
|
||||
throw;
|
||||
}
|
||||
var str = "";
|
||||
// throw;
|
||||
//}
|
||||
//var str = "";
|
||||
}
|
||||
|
||||
|
||||
@@ -336,7 +336,7 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
x.id = SnowflakeIdHelper.NextId();
|
||||
x.bill_id = input.requireId;
|
||||
x.bill_d_id = billDId;
|
||||
x.bill_d_id = billDId!;
|
||||
x.org_id = _userManager.User.OrganizeId;
|
||||
x.create_id = _userManager.UserId;
|
||||
x.create_time = DateTime.Now;
|
||||
@@ -388,7 +388,7 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
x.id = SnowflakeIdHelper.NextId();
|
||||
x.bill_id = input.requireId;
|
||||
x.bill_d_id = billDId;
|
||||
x.bill_d_id = billDId!;
|
||||
x.org_id = _userManager.User.OrganizeId;
|
||||
x.create_id = _userManager.UserId;
|
||||
x.create_time = DateTime.Now;
|
||||
@@ -425,7 +425,7 @@ namespace Tnb.WarehouseMgr
|
||||
await _db.Updateable<WmsOutstockH>().SetColumns(it => new WmsOutstockH { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == input.requireId).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
var carryCodes = await _db.Queryable<WmsCarryCode>().Where(it => input.carryIds.Contains(it.carry_id)).ToListAsync();
|
||||
var carryCodes = await _db.Queryable<WmsCarryCode>().Where(it => input.carryIds.Contains(it.carry_id!)).ToListAsync();
|
||||
var dicCodeQty = carryCodes.GroupBy(g => g.barcode).ToDictionary(x => x.Key, x => x.First().codeqty);
|
||||
var dicUpdate = new Dictionary<string, decimal>();
|
||||
var delBarcodes = new List<string>();
|
||||
|
||||
@@ -29,17 +29,9 @@ namespace Tnb.WarehouseMgr
|
||||
[OverideVisualDev(ModuleConsts.MODULE_WMSBINDINGPDA_ID)]
|
||||
public class WmsPDABindService : WmsCarryService, IPdaStroage
|
||||
{
|
||||
private readonly ISqlSugarClient _db;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IBillRullService _billRullService;
|
||||
private readonly IRunService _runService;
|
||||
private readonly IVisualDevService _visualDevService;
|
||||
public WmsPDABindService(
|
||||
ISqlSugarRepository<WmsCarryH> repository,
|
||||
IUserManager userManager,
|
||||
IBillRullService billRullService,
|
||||
IRunService runService,
|
||||
IVisualDevService visualDevService) : base(repository, userManager, billRullService, runService, visualDevService)
|
||||
public WmsPDABindService(ISqlSugarRepository<WmsCarryH> repository, IUserManager userManager,
|
||||
IBillRullService billRullService, IRunService runService,
|
||||
IVisualDevService visualDevService) : base(repository, userManager, billRullService, runService, visualDevService)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace Tnb.WarehouseMgr
|
||||
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleId, true);
|
||||
await _runService.Create(templateEntity, input);
|
||||
//入库取终点 //出库起点
|
||||
var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = input.data[nameof(InStockStrategyQuery.warehouse_id)].ToString(), Size = 1 };
|
||||
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;
|
||||
@@ -96,10 +96,10 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
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.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();
|
||||
@@ -108,7 +108,7 @@ namespace Tnb.WarehouseMgr
|
||||
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID;
|
||||
preTask.carry_id = input.data[nameof(preTask.carry_id)]?.ToString()!;
|
||||
preTask.carry_code = input.data[nameof(preTask.carry_code)]?.ToString()!;
|
||||
preTask.area_id = sPoint?.area_id;
|
||||
preTask.area_id = sPoint?.area_id!;
|
||||
preTask.area_code = it.Key;
|
||||
preTask.require_id = input.data["ReturnIdentity"].ToString();
|
||||
preTask.require_code = input.data[nameof(preTask.bill_code)]?.ToString()!;
|
||||
@@ -120,11 +120,11 @@ namespace Tnb.WarehouseMgr
|
||||
if (isOk)
|
||||
{
|
||||
var preTaskUpInput = new GenPreTaskUpInput();
|
||||
preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString();
|
||||
preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString()!;
|
||||
preTaskUpInput.CarryId = input.data[nameof(WmsCarryD.carry_id)]?.ToString()!;
|
||||
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id;
|
||||
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code;
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList();
|
||||
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault()!.location_id!;
|
||||
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault()!.location_code!;
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList()!;
|
||||
preTaskUpInput.PreTaskRecords = preTasks.Adapt<List<WmsHandleH>>();
|
||||
preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId());
|
||||
//根据载具移入Id,回更单据状态
|
||||
|
||||
@@ -93,10 +93,10 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
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.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();
|
||||
@@ -105,7 +105,7 @@ namespace Tnb.WarehouseMgr
|
||||
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_OUTSTOCK_TYPE_ID;
|
||||
preTask.carry_id = input.data[nameof(preTask.carry_id)]?.ToString()!;
|
||||
preTask.carry_code = input.data[nameof(preTask.carry_code)]?.ToString()!;
|
||||
preTask.area_id = sPoint?.area_id;
|
||||
preTask.area_id = sPoint?.area_id!;
|
||||
preTask.area_code = it.Key;
|
||||
preTask.require_id = input.data["ReturnIdentity"].ToString();
|
||||
preTask.require_code = input.data[nameof(preTask.bill_code)]?.ToString()!;
|
||||
@@ -123,11 +123,11 @@ namespace Tnb.WarehouseMgr
|
||||
if (isOk)
|
||||
{
|
||||
var preTaskUpInput = new GenPreTaskUpInput();
|
||||
preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString();
|
||||
preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString()!;
|
||||
preTaskUpInput.CarryId = input.data[nameof(WmsCarryD.carry_id)]?.ToString()!;
|
||||
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id;
|
||||
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code;
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList();
|
||||
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault()!.location_id!;
|
||||
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault()!.location_code!;
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList()!;
|
||||
|
||||
preTaskUpInput.PreTaskRecords = preTasks.Adapt<List<WmsHandleH>>();
|
||||
preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId());
|
||||
|
||||
@@ -29,11 +29,6 @@ namespace Tnb.WarehouseMgr
|
||||
[OverideVisualDev(ModuleConsts.MODULE_WMSCARRYREPLACEPDA_ID)]
|
||||
public class WmsPDACarryReplaceService : WmsCarryService ,IPdaStroage
|
||||
{
|
||||
private readonly ISqlSugarClient _db;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IBillRullService _billRullService;
|
||||
private readonly IRunService _runService;
|
||||
private readonly IVisualDevService _visualDevService;
|
||||
public WmsPDACarryReplaceService(
|
||||
ISqlSugarRepository<WmsCarryH> repository,
|
||||
IUserManager userManager,
|
||||
|
||||
@@ -93,7 +93,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);
|
||||
|
||||
@@ -36,25 +36,30 @@ 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;
|
||||
public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc();
|
||||
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,
|
||||
IVisualDevService visualDevService,
|
||||
IBasLocationService basLocationService
|
||||
IBasLocationService basLocationService,
|
||||
IBillRullService billRullService,
|
||||
IWareHouseService wareHouseService,
|
||||
IUserManager userManager
|
||||
)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_runService = runService;
|
||||
_visualDevService = visualDevService;
|
||||
_basLocationService = basLocationService;
|
||||
_billRullService = billRullService;
|
||||
_wareHouseService = wareHouseService;
|
||||
_userManager = userManager;
|
||||
OverideFuncs.CreateAsync = Create;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -91,30 +96,30 @@ namespace Tnb.WarehouseMgr
|
||||
endLocationId = input.data[nameof(WmsDelivery.endlocation_id)]?.ToString()!;
|
||||
}
|
||||
var locIds = new[] { startLocationId, endLocationId };
|
||||
var locs = await _basLocationService.GetLocationInfobyIds(locIds);
|
||||
var locs = await _basLocationService?.GetLocationInfobyIds(locIds)!;
|
||||
if (locs?.Count > 0)
|
||||
{
|
||||
var isStoreLoc = locs.Where(x => !x.IsNullOrEmpty()).Select(x => x.is_type.ParseToInt()).Any(x => x == (int)EnumLocationType.存储库位);
|
||||
if (isStoreLoc) throw new AppFriendlyException("起始库位不能为存储库位", 500);
|
||||
}
|
||||
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleConsts.MODULE_WMSDELIVERYPDA_ID, true);
|
||||
VisualDevEntity? templateEntity = await _visualDevService?.GetInfoById(ModuleConsts.MODULE_WMSDELIVERYPDA_ID, true)!;
|
||||
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());
|
||||
sPoint = await _db?.Queryable<WmsPointH>().FirstAsync(it => it.location_id == input.data[nameof(WmsTransfer.startlocation_id)].ToString())!;
|
||||
}
|
||||
if (input.data.ContainsKey(nameof(WmsTransfer.endlocation_id)))
|
||||
{
|
||||
ePoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == input.data[nameof(WmsTransfer.endlocation_id)].ToString());
|
||||
ePoint = await _db!.Queryable<WmsPointH>().FirstAsync(it => it.location_id == input.data[nameof(WmsTransfer.endlocation_id)].ToString());
|
||||
}
|
||||
|
||||
if (sPoint != null && ePoint != null)
|
||||
{
|
||||
var points = await _wareHouseService.PathAlgorithms(sPoint.id, ePoint.id);
|
||||
var points = await _wareHouseService!.PathAlgorithms(sPoint.id, ePoint.id);
|
||||
//根据获取的路径点生成预任务,生成顺序必须预路径算法返回的起终点的顺序一致(预任务顺序)
|
||||
if (points?.Count > 0)
|
||||
{
|
||||
@@ -125,20 +130,20 @@ namespace Tnb.WarehouseMgr
|
||||
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.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.bill_code = _billRullService!.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult();
|
||||
preTask.status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID;
|
||||
preTask.biz_type = WmsWareHouseConst.BIZTYPE_WMSDELIVERY_ID;
|
||||
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_TRANSFER_TYPE_ID;
|
||||
preTask.carry_id = input.data[nameof(preTask.carry_id)]?.ToString()!;
|
||||
preTask.carry_code = input.data[nameof(preTask.carry_code)]?.ToString()!;
|
||||
preTask.area_id = sPoint?.area_id;
|
||||
preTask.area_id = sPoint?.area_id!;
|
||||
preTask.area_code = it.Key;
|
||||
preTask.require_id = input.data["ReturnIdentity"].ToString();
|
||||
preTask.require_code = input.data[nameof(preTask.bill_code)]?.ToString()!;
|
||||
@@ -146,7 +151,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)
|
||||
{
|
||||
if (input.data.ContainsKey(nameof(WmsDelivery.startlocation_id)) && input.data.ContainsKey(nameof(WmsDelivery.endlocation_id)) && input.data[nameof(WmsDelivery.endlocation_id)] != null && input.data[nameof(WmsDelivery.endlocation_id)] != null)
|
||||
|
||||
@@ -68,10 +68,10 @@ namespace Tnb.WarehouseMgr
|
||||
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleConsts.MODULE_WMSEMPTYINSTKPDA_ID, true);
|
||||
await _runService.Create(templateEntity, input);
|
||||
//入库取终点
|
||||
var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = input.data[nameof(InStockStrategyQuery.warehouse_id)].ToString(), Size = 1 };
|
||||
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());
|
||||
@@ -95,10 +95,10 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
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.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();
|
||||
@@ -107,7 +107,7 @@ namespace Tnb.WarehouseMgr
|
||||
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID;
|
||||
preTask.carry_id = input.data[nameof(preTask.carry_id)]?.ToString()!;
|
||||
preTask.carry_code = input.data[nameof(preTask.carry_code)]?.ToString()!;
|
||||
preTask.area_id = sPoint?.area_id;
|
||||
preTask.area_id = sPoint?.area_id!;
|
||||
preTask.area_code = it.Key;
|
||||
preTask.require_id = input.data["ReturnIdentity"].ToString();
|
||||
preTask.require_code = input.data[nameof(preTask.bill_code)]?.ToString()!;
|
||||
@@ -119,21 +119,21 @@ namespace Tnb.WarehouseMgr
|
||||
if (isOk)
|
||||
{
|
||||
var preTaskUpInput = new GenPreTaskUpInput();
|
||||
preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString();
|
||||
preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString()!;
|
||||
preTaskUpInput.CarryId = input.data[nameof(WmsCarryD.carry_id)]?.ToString()!;
|
||||
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id;
|
||||
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code;
|
||||
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault()!.location_id!;
|
||||
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault()!.location_code!;
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.id).ToList();
|
||||
preTaskUpInput.PreTaskRecords = preTasks.Adapt<List<WmsHandleH>>();
|
||||
preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId());
|
||||
WmsHandleH handleH = new();
|
||||
handleH.org_id = _userManager.User.OrganizeId;
|
||||
handleH.startlocation_id = input.data[nameof(WmsPointH.location_id)]?.ToString();
|
||||
handleH.startlocation_id = input.data[nameof(WmsPointH.location_id)]?.ToString()!;
|
||||
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();
|
||||
handleH.carry_code = input.data[nameof(WmsHandleH.carry_code)]?.ToString();
|
||||
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()!;
|
||||
handleH.carry_code = input.data[nameof(WmsHandleH.carry_code)]?.ToString()!;
|
||||
handleH.require_id = input.data["ReturnIdentity"].ToString();
|
||||
handleH.require_code = input.data[nameof(WmsHandleH.bill_code)]?.ToString()!;
|
||||
handleH.create_id = _userManager.UserId;
|
||||
@@ -151,7 +151,7 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
await _db.Ado.CommitTranAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception)
|
||||
{
|
||||
await _db.Ado.RollbackTranAsync();
|
||||
throw;
|
||||
|
||||
@@ -9,6 +9,7 @@ using JNPF.Common.Enums;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Logging;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using JNPF.VisualDev;
|
||||
using JNPF.VisualDev.Entitys;
|
||||
@@ -78,8 +79,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());
|
||||
@@ -139,18 +140,18 @@ namespace Tnb.WarehouseMgr
|
||||
if (isOk)
|
||||
{
|
||||
var preTaskUpInput = new GenPreTaskUpInput();
|
||||
preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString();
|
||||
preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString()!;
|
||||
preTaskUpInput.CarryId = carrys![i].id;
|
||||
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id;
|
||||
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code;
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList();
|
||||
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault()!.location_id!;
|
||||
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault()!.location_code!;
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList()!;
|
||||
|
||||
//更新明细表
|
||||
WmsEmptyOutstockD wmsEmptyOutstockD = new();
|
||||
wmsEmptyOutstockD.id = SnowflakeIdHelper.NextId();
|
||||
wmsEmptyOutstockD.bill_id = preTaskUpInput.RquireId;
|
||||
wmsEmptyOutstockD.biz_type = WmsWareHouseConst.BIZTYPE_WMSEPTYOUTSTK_ID;
|
||||
wmsEmptyOutstockD.location_id = ePoint.location_id;
|
||||
wmsEmptyOutstockD.location_id = ePoint!.location_id!;
|
||||
wmsEmptyOutstockD.status = WmsWareHouseConst.BILLSTATUS_COMPLETE_ID;
|
||||
wmsEmptyOutstockD.carry_id = carrys[i].id;
|
||||
wmsEmptyOutstockD.carry_code = carrys[i].carry_code;
|
||||
@@ -162,11 +163,11 @@ namespace Tnb.WarehouseMgr
|
||||
WmsHandleH handleH = new();
|
||||
handleH.org_id = _userManager.User.OrganizeId;
|
||||
handleH.startlocation_id = carrys?[i].location_id!;
|
||||
handleH.endlocation_id = ePoint.location_id;
|
||||
handleH.endlocation_id = ePoint!.location_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()!;
|
||||
handleH.carry_code = input.data[nameof(WmsHandleH.carry_code)]?.ToString();
|
||||
handleH.carry_code = input.data[nameof(WmsHandleH.carry_code)]?.ToString()!;
|
||||
handleH.require_id = input.data["ReturnIdentity"].ToString();
|
||||
handleH.require_code = input.data[nameof(WmsHandleH.bill_code)]?.ToString()!;
|
||||
handleH.create_id = _userManager.UserId;
|
||||
@@ -187,6 +188,7 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error("空载具出库错误",ex);
|
||||
await _db.Ado.RollbackTranAsync();
|
||||
throw;
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
await _db.Ado.CommitTranAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception)
|
||||
{
|
||||
await _db.Ado.RollbackTranAsync();
|
||||
throw;
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace Tnb.WarehouseMgr
|
||||
List<string> list = new();
|
||||
if (input.data.ContainsKey(nameof(WmsDistaskH.id)))
|
||||
{
|
||||
list.Add(input.data[nameof(WmsDistaskH.id)].ToString());
|
||||
list.Add(input.data[nameof(WmsDistaskH.id)].ToString()!);
|
||||
taskCompleUpInput.disTaskIds = list;
|
||||
await _wareHouseService.TaskComplate(taskCompleUpInput);
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace Tnb.WarehouseMgr
|
||||
//获取任务的协议,进行重新下发
|
||||
await _db.Ado.CommitTranAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception)
|
||||
{
|
||||
await _db.Ado.RollbackTranAsync();
|
||||
throw;
|
||||
|
||||
@@ -205,7 +205,7 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
x.id = SnowflakeIdHelper.NextId();
|
||||
x.is_out = 0;
|
||||
x.carry_id = input.data[nameof(WmsCarryCode.carry_id)]?.ToString();
|
||||
x.carry_id = input.data[nameof(WmsCarryCode.carry_id)]?.ToString()!;
|
||||
});
|
||||
//生成入库申请条码
|
||||
var instockDetails = await _db.Queryable<WmsInstockD>()
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace Tnb.WarehouseMgr
|
||||
//VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleConsts.MODULE_WMSINBALEINSTKPDA_ID, true);
|
||||
//await _runService.Create(templateEntity, input);
|
||||
//入库取终点 //出库起点
|
||||
var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = input.data[nameof(InStockStrategyQuery.warehouse_id)].ToString(), Size = 1 };
|
||||
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;
|
||||
@@ -97,10 +97,10 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
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.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();
|
||||
@@ -109,7 +109,7 @@ namespace Tnb.WarehouseMgr
|
||||
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID;
|
||||
preTask.carry_id = input.data[nameof(preTask.carry_id)]?.ToString()!;
|
||||
preTask.carry_code = input.data[nameof(preTask.carry_code)]?.ToString()!;
|
||||
preTask.area_id = sPoint?.area_id;
|
||||
preTask.area_id = sPoint?.area_id!;
|
||||
preTask.area_code = it.Key;
|
||||
preTask.require_id = inbaleItem.id;
|
||||
preTask.require_code = inbaleItem.bill_code;
|
||||
@@ -117,24 +117,24 @@ 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();
|
||||
preTaskUpInput.RquireId = inbaleItem.id;
|
||||
preTaskUpInput.CarryId = input.data[nameof(WmsCarryD.carry_id)]?.ToString()!;
|
||||
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id;
|
||||
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code;
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList();
|
||||
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault()!.location_id!;
|
||||
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault()!.location_code!;
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList()!;
|
||||
|
||||
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.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();
|
||||
handleH.carry_code = input.data[nameof(WmsHandleH.carry_code)]?.ToString();
|
||||
handleH.startlocation_id = input.data[nameof(WmsPointH.location_id)]?.ToString()!;
|
||||
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()!;
|
||||
handleH.carry_code = input.data[nameof(WmsHandleH.carry_code)]?.ToString()!;
|
||||
handleH.require_id = inbaleItem.id;
|
||||
handleH.require_code = inbaleItem.bill_code;
|
||||
handleH.create_id = _userManager.UserId;
|
||||
@@ -154,7 +154,7 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
await _db.Ado.CommitTranAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception)
|
||||
{
|
||||
await _db.Ado.RollbackTranAsync();
|
||||
throw;
|
||||
|
||||
@@ -32,14 +32,6 @@ namespace Tnb.WarehouseMgr
|
||||
[OverideVisualDev(ModuleConsts.MODULE_WMSKITTINGINSTKPDA_ID)]
|
||||
public class WmsPDAKittingInStkService : WmsKittingInStkService, IPdaStroage
|
||||
{
|
||||
private readonly ISqlSugarClient _db;
|
||||
private readonly IRunService _runService;
|
||||
private readonly IVisualDevService _visualDevService;
|
||||
private readonly IWareHouseService _wareHouseService;
|
||||
private readonly IBillRullService _billRullService;
|
||||
private readonly IUserManager _userManager;
|
||||
|
||||
|
||||
public WmsPDAKittingInStkService(
|
||||
ISqlSugarRepository<WmsCarryH> repository,
|
||||
IRunService runService,
|
||||
|
||||
@@ -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(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());
|
||||
@@ -93,10 +93,10 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
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.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();
|
||||
@@ -105,7 +105,7 @@ namespace Tnb.WarehouseMgr
|
||||
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_OUTSTOCK_TYPE_ID;
|
||||
preTask.carry_id = input.data[nameof(preTask.carry_id)]?.ToString()!;
|
||||
preTask.carry_code = input.data[nameof(preTask.carry_code)]?.ToString()!;
|
||||
preTask.area_id = sPoint?.area_id;
|
||||
preTask.area_id = sPoint?.area_id!;
|
||||
preTask.area_code = it.Key;
|
||||
preTask.require_id = input.data["ReturnIdentity"].ToString();
|
||||
preTask.require_code = input.data[nameof(preTask.bill_code)]?.ToString()!;
|
||||
@@ -119,15 +119,15 @@ 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();
|
||||
preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString();
|
||||
preTaskUpInput.RquireId = input.data["ReturnIdentity"].ToString()!;
|
||||
preTaskUpInput.CarryId = input.data[nameof(WmsCarryD.carry_id)]?.ToString()!;
|
||||
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault().location_id;
|
||||
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault().location_code;
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList();
|
||||
preTaskUpInput.CarryStartLocationId = points.FirstOrDefault()!.location_id!;
|
||||
preTaskUpInput.CarryStartLocationCode = points.FirstOrDefault()!.location_code!;
|
||||
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList()!;
|
||||
|
||||
preTaskUpInput.PreTaskRecords = preTasks.Adapt<List<WmsHandleH>>();
|
||||
preTaskUpInput.PreTaskRecords.ForEach(x => x.id = SnowflakeIdHelper.NextId());
|
||||
|
||||
@@ -93,10 +93,10 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
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.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();
|
||||
@@ -105,7 +105,7 @@ namespace Tnb.WarehouseMgr
|
||||
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_TRANSFER_TYPE_ID;
|
||||
preTask.carry_id = input.data[nameof(preTask.carry_id)]?.ToString()!;
|
||||
preTask.carry_code = input.data[nameof(preTask.carry_code)]?.ToString()!;
|
||||
preTask.area_id = sPoint?.area_id;
|
||||
preTask.area_id = sPoint?.area_id!;
|
||||
preTask.area_code = it.Key;
|
||||
preTask.require_id = input.data["ReturnIdentity"].ToString();
|
||||
preTask.require_code = input.data[nameof(preTask.bill_code)]?.ToString()!;
|
||||
|
||||
@@ -89,14 +89,14 @@ namespace Tnb.WarehouseMgr
|
||||
visualDevModelCrInput.data[nameof(InStockStrategyQuery.warehouse_id)] = kittingout.warehouse_id;
|
||||
visualDevModelCrInput.data[nameof(WmsKittingInstock.carry_id)] = input.carry_id;
|
||||
visualDevModelCrInput.data[nameof(WmsKittingInstock.carry_code)] = input.carry_code;
|
||||
visualDevModelCrInput.data[nameof(WmsKittingInstock.collocation_scheme_id)] = carry.collocation_scheme_id;
|
||||
visualDevModelCrInput.data[nameof(WmsKittingInstock.collocation_scheme_code)] = carry.collocation_scheme_code;
|
||||
visualDevModelCrInput.data[nameof(WmsKittingInstock.collocation_scheme_id)] = carry!.collocation_scheme_id!;
|
||||
visualDevModelCrInput.data[nameof(WmsKittingInstock.collocation_scheme_code)] = carry!.collocation_scheme_code!;
|
||||
visualDevModelCrInput.data[nameof(WmsKittingInstock.seq)] = kittingout.seq;
|
||||
visualDevModelCrInput.data[nameof(WmsKittingInstock.biz_type)] = WmsWareHouseConst.BIZTYPE_WMSKITTINGINSTK_ID;
|
||||
visualDevModelCrInput.data[nameof(WmsKittingInstock.status)] = WmsWareHouseConst.BILLSTATUS_ADD_ID;
|
||||
visualDevModelCrInput.data[nameof(WmsKittingInstock.create_id)] = _userManager.UserId;
|
||||
visualDevModelCrInput.data[nameof(WmsKittingInstock.create_time)] = DateTime.Now;
|
||||
visualDevModelCrInput.data[nameof(WmsKittingInstock.location_id)] = carry.location_id;
|
||||
visualDevModelCrInput.data[nameof(WmsKittingInstock.location_id)] = carry!.location_id!;
|
||||
visualDevModelCrInput.data[nameof(WmsKittingInstock.bill_code)] = _billRullService.GetBillNumber("WmsKittingInStk").GetAwaiter().GetResult();
|
||||
visualDevModelCrInput.data[nameof(WmsKittingInstock.source_id)] = kittingout.id;
|
||||
|
||||
|
||||
@@ -253,7 +253,7 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
x.id = SnowflakeIdHelper.NextId();
|
||||
x.bill_id = input.requireId;
|
||||
x.bill_d_id = billDId;
|
||||
x.bill_d_id = billDId!;
|
||||
x.org_id = _userManager.User.OrganizeId;
|
||||
x.create_id = _userManager.UserId;
|
||||
x.create_time = DateTime.Now;
|
||||
@@ -286,7 +286,7 @@ namespace Tnb.WarehouseMgr
|
||||
var carry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.id == carryId);
|
||||
if (carry != null)
|
||||
{
|
||||
if (carry.location_id.IsNotEmptyOrNull())
|
||||
if (carry!.location_id!.IsNotEmptyOrNull())
|
||||
{
|
||||
await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_use = (int)EnumCarryStatus.空闲 }).Where(it => it.id == carry.location_id).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace Tnb.WarehouseMgr
|
||||
var carry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.id == input.carryId);
|
||||
if (carry != null)
|
||||
{
|
||||
if (carry.location_id.IsNotEmptyOrNull())
|
||||
if (carry!.location_id!.IsNotEmptyOrNull())
|
||||
{
|
||||
var loc = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == carry.location_id);
|
||||
loc.is_use = (int)EnumCarryStatus.空闲;
|
||||
@@ -77,7 +77,7 @@ namespace Tnb.WarehouseMgr
|
||||
carry.location_id = null;
|
||||
carry.location_code = null;
|
||||
await _db.Updateable(carry).UpdateColumns(it => new { it.location_id, it.location_code }).ExecuteCommandAsync();
|
||||
var disTask = await _db.Queryable<WmsDistaskH>().SingleAsync(it => it.id == input.disTaskId);
|
||||
WmsDistaskH? disTask = await _db.Queryable<WmsDistaskH>().SingleAsync(it => it.id == input.disTaskId);
|
||||
if (disTask != null)
|
||||
{
|
||||
if (_dicBizType.ContainsKey(disTask.biz_type))
|
||||
@@ -86,33 +86,11 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
loginType = "web",
|
||||
bizTypeId = disTask.biz_type,
|
||||
requireId = disTask.require_id,
|
||||
requireId = disTask!.require_id!,
|
||||
carryIds = new List<string> { input.carryId },
|
||||
distaskCodes = input.distaskCodes
|
||||
};
|
||||
await DoUpdate(upInput); //回更业务
|
||||
//switch (_dicBizType[disTask.biz_type])
|
||||
//{
|
||||
// case "空载具出库":
|
||||
// case "寄存出库":
|
||||
// case "齐套出库":
|
||||
// case "一般出库":
|
||||
// {
|
||||
|
||||
// WareHouseUpInput upInput = new() { loginType = "web", bizTypeId = disTask.biz_type, requireId = disTask.require_id, carryIds = new List<string> { input.carryId }, distaskCodes = input.distaskCodes };
|
||||
// await DoUpdate(upInput); //回更业务
|
||||
|
||||
|
||||
// }
|
||||
// break;
|
||||
// case "载具移出":
|
||||
// {
|
||||
// WareHouseUpInput upInput = new() { loginType = "web", bizTypeId = disTask.biz_type, requireId = disTask.require_id, carryIds = new List<string> { input.carryId }, distaskCodes = input.distaskCodes };
|
||||
// await DoUpdate(upInput); //回更业务
|
||||
// }
|
||||
// break;
|
||||
|
||||
//}
|
||||
}
|
||||
disTask.is_sign = 1;
|
||||
await _db.Updateable(disTask).UpdateColumns(it => it.is_sign).ExecuteCommandAsync();
|
||||
|
||||
@@ -68,8 +68,8 @@ namespace Tnb.WarehouseMgr
|
||||
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleConsts.MODULE_WMSTRANSFER_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());
|
||||
@@ -93,10 +93,10 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
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.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();
|
||||
@@ -105,7 +105,7 @@ namespace Tnb.WarehouseMgr
|
||||
preTask.task_type = WmsWareHouseConst.WMS_PRETASK_TRANSFER_TYPE_ID;
|
||||
preTask.carry_id = input.data[nameof(preTask.carry_id)]?.ToString()!;
|
||||
preTask.carry_code = input.data[nameof(preTask.carry_code)]?.ToString()!;
|
||||
preTask.area_id = sPoint?.area_id;
|
||||
preTask.area_id = sPoint?.area_id!;
|
||||
preTask.area_code = it.Key;
|
||||
preTask.require_id = input.data["ReturnIdentity"].ToString();
|
||||
preTask.require_code = input.data[nameof(preTask.bill_code)]?.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)
|
||||
{
|
||||
//查询库位表
|
||||
@@ -141,7 +141,7 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
await _db.Ado.CommitTranAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception)
|
||||
{
|
||||
await _db.Ado.RollbackTranAsync();
|
||||
throw;
|
||||
|
||||
@@ -70,7 +70,7 @@ 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;
|
||||
@@ -161,19 +161,19 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
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.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.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;
|
||||
@@ -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 });
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user