1、新增预任务生成帮助类

2、齐套配送接口参数调整
This commit is contained in:
yang.lee
2023-11-23 14:13:03 +08:00
parent 242ec34a9a
commit 71c4dbd254
8 changed files with 217 additions and 37 deletions

View File

@@ -481,7 +481,7 @@ namespace Tnb.WarehouseMgr
{
ePoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == endLocs[0].id);
}
if (sPoint == null || ePoint == null) throw new AppFriendlyException("路径无效", 500);
if (sPoint == null || ePoint == null) throw new AppFriendlyException("起点或终点不能为空", 500);
List<WmsPointH> points = await _warehouseService.PathAlgorithms(sPoint.id, ePoint.id);
//根据获取的路径点生成预任务,生成顺序必须预路径算法返回的起终点的顺序一致(预任务顺序)
if (points?.Count > 0)
@@ -491,38 +491,41 @@ namespace Tnb.WarehouseMgr
throw new AppFriendlyException("该路径不存在", 500);
}
/* var genPreTask = BuildPreTaskHelper.GenPretaskCurried<WmsCheckstockH>(null, WmsWareHouseConst.BIZTYPE_CARRYMOVEINSTOCK_ID, WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID);
var genPreTaskUpInput = await genPreTask(carry, sPoint, ePoint);
*/
List<WmsPretaskH> preTasks = points.Where(it => !it.location_id.IsNullOrEmpty()).GroupBy(g => g.area_code).Select(it =>
{
WmsPointH? sPoint = it.FirstOrDefault();
WmsPointH? ePoint = it.LastOrDefault();
{
WmsPointH? sPoint = it.FirstOrDefault();
WmsPointH? ePoint = it.LastOrDefault();
WmsPretaskH preTask = new()
{
org_id = _userManager.User.OrganizeId!,
startlocation_id = sPoint?.location_id!,
startlocation_code = sPoint?.location_code!,
endlocation_id = ePoint?.location_id!,
endlocation_code = ePoint?.location_code!,
start_floor = sPoint?.floor.ToString(),
end_floor = ePoint?.floor.ToString(),
startpoint_id = sPoint?.id!,
startpoint_code = sPoint?.point_code!,
endpoint_id = ePoint?.id!,
endpoint_code = ePoint?.point_code!,
bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult(),
status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID,
biz_type = WmsWareHouseConst.BIZTYPE_CARRYMOVEINSTOCK_ID,
task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID,
carry_id = carry?.id ?? string.Empty,
carry_code = carry?.carry_code ?? string.Empty,
area_id = sPoint?.area_id!,
area_code = it.Key,
create_id = _userManager.UserId,
create_time = DateTime.Now
};
WmsPretaskH preTask = new()
{
org_id = _userManager.User.OrganizeId!,
startlocation_id = sPoint?.location_id!,
startlocation_code = sPoint?.location_code!,
endlocation_id = ePoint?.location_id!,
endlocation_code = ePoint?.location_code!,
start_floor = sPoint?.floor.ToString(),
end_floor = ePoint?.floor.ToString(),
startpoint_id = sPoint?.id!,
startpoint_code = sPoint?.point_code!,
endpoint_id = ePoint?.id!,
endpoint_code = ePoint?.point_code!,
bill_code = _billRullService.GetBillNumber(WmsWareHouseConst.WMS_PRETASK_H_ENCODE).GetAwaiter().GetResult(),
status = WmsWareHouseConst.PRETASK_BILL_STATUS_DXF_ID,
biz_type = WmsWareHouseConst.BIZTYPE_CARRYMOVEINSTOCK_ID,
task_type = WmsWareHouseConst.WMS_PRETASK_INSTOCK_TYPE_ID,
carry_id = carry?.id ?? string.Empty,
carry_code = carry?.carry_code ?? string.Empty,
area_id = sPoint?.area_id!,
area_code = it.Key,
create_id = _userManager.UserId,
create_time = DateTime.Now
};
return preTask;
}).ToList();
return preTask;
}).ToList();
bool isOk = await _warehouseService.GenPreTask(preTasks, null!);
if (isOk)
{