Merge branch 'dev' of https://git.tuotong-tech.com/tnb/tnb.server into dev
This commit is contained in:
@@ -364,6 +364,10 @@ namespace Tnb.WarehouseMgr.Entities.Consts
|
||||
/// </summary>
|
||||
public const string BIZTYPE_WMSDELIVERY_ID = "26585291847957";
|
||||
/// <summary>
|
||||
/// 预任务生成业务类型-人工移库
|
||||
/// </summary>
|
||||
public const string BIZTYPE_PEOPLEDELIVERY_ID = "37760774435349";
|
||||
/// <summary>
|
||||
/// 预任务生成业务类型-销售出库
|
||||
/// </summary>
|
||||
public const string BIZTYPE_WMSSALERELEASE_ID = "25104446664213";
|
||||
|
||||
@@ -4,6 +4,8 @@ using JNPF.Common.Enums;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.EventBus;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Systems.Entitys.Model.DataInterFace;
|
||||
using JNPF.Systems.Entitys.System;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using JNPF.VisualDev;
|
||||
using JNPF.VisualDev.Entitys;
|
||||
@@ -19,6 +21,7 @@ using Tnb.WarehouseMgr.Entities.Consts;
|
||||
using Tnb.WarehouseMgr.Entities.Dto;
|
||||
using Tnb.WarehouseMgr.Entities.Enums;
|
||||
using Tnb.WarehouseMgr.Interfaces;
|
||||
using JNPF.Common.Security;
|
||||
|
||||
namespace Tnb.WarehouseMgr
|
||||
{
|
||||
@@ -89,13 +92,15 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
if (input.data.ContainsKey(nameof(WmsDelivery.endlocation_id)))
|
||||
{
|
||||
BasLocation endLocation = await _db.Queryable<BasLocation>().Where(x=>x.location_code==input.data[nameof(WmsDelivery.endlocation_id)].ToString()).FirstAsync();
|
||||
if (endLocation == null)
|
||||
{
|
||||
throw Oops.Bah("未找到目标库位");
|
||||
}
|
||||
//BasLocation endLocation = await _db.Queryable<BasLocation>().Where(x=>x.location_code==input.data[nameof(WmsDelivery.endlocation_id)].ToString()).FirstAsync();
|
||||
//if (endLocation == null)
|
||||
//{
|
||||
// throw Oops.Bah("未找到目标库位");
|
||||
//}
|
||||
|
||||
endLocationId = endLocation.id;
|
||||
//endLocationId = endLocation.id;
|
||||
|
||||
endLocationId = input.data[nameof(WmsDelivery.endlocation_id)]?.ToString()!;
|
||||
}
|
||||
string[] locIds = new[] { startLocationId, endLocationId };
|
||||
List<BasLocation> locs = await _basLocationService?.GetLocationInfobyIds(locIds)!;
|
||||
@@ -108,8 +113,8 @@ namespace Tnb.WarehouseMgr
|
||||
throw new AppFriendlyException("起始库位不能为存储库位", 500);
|
||||
}*/
|
||||
}
|
||||
VisualDevEntity? templateEntity = await _visualDevService?.GetInfoById(ModuleConsts.MODULE_WMSDELIVERYPDA_ID, true)!;
|
||||
await _runService.Create(templateEntity, input);
|
||||
//VisualDevEntity? templateEntity = await _visualDevService?.GetInfoById(ModuleConsts.MODULE_WMSDELIVERYPDA_ID, true)!;
|
||||
//await _runService.Create(templateEntity, input);
|
||||
|
||||
// 计算路径,插入预任务申请
|
||||
WmsPointH sPoint = null!;
|
||||
@@ -120,7 +125,9 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
if (input.data.ContainsKey(nameof(WmsTransfer.endlocation_id)))
|
||||
{
|
||||
ePoint = await _db!.Queryable<WmsPointH>().FirstAsync(it => it.location_code == input.data[nameof(WmsTransfer.endlocation_id)].ToString());
|
||||
//ePoint = await _db!.Queryable<WmsPointH>().FirstAsync(it => it.location_code == 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)
|
||||
@@ -163,14 +170,14 @@ namespace Tnb.WarehouseMgr
|
||||
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_WMSDELIVERY_ID,
|
||||
biz_type = WmsWareHouseConst.BIZTYPE_PEOPLEDELIVERY_ID,
|
||||
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.carry_id = input.data.ContainsKey(nameof(preTask.carry_id)) ? input.data[nameof(preTask.carry_id)]?.ToString()! : "";
|
||||
preTask.carry_code = input.data.ContainsKey(nameof(preTask.carry_code)) ? input.data[nameof(preTask.carry_code)]?.ToString()! : "";
|
||||
preTask.area_id = sPoint?.area_id!;
|
||||
preTask.area_code = it.Key;
|
||||
preTask.require_id = input.data["ReturnIdentity"].ToString();
|
||||
//preTask.require_id = input.data["ReturnIdentity"].ToString();
|
||||
preTask.require_code = input.data[nameof(preTask.bill_code)]?.ToString()!;
|
||||
preTask.create_id = _userManager.UserId;
|
||||
preTask.create_time = DateTime.Now;
|
||||
@@ -181,18 +188,18 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
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)
|
||||
{
|
||||
//查询库位表
|
||||
BasLocation location = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == input.data[nameof(WmsDelivery.startlocation_id)].ToString());
|
||||
{
|
||||
//载具加锁,增加库位信息
|
||||
_ = await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH
|
||||
{
|
||||
carry_status = ((int)EnumCarryStatus.占用).ToString(),
|
||||
is_lock = 1,
|
||||
location_id = input.data[nameof(WmsDelivery.startlocation_id)].ToString(),
|
||||
location_code = location.location_code
|
||||
}).Where(it => it.id == input.data[nameof(WmsDelivery.carry_id)].ToString()).ExecuteCommandAsync();
|
||||
}
|
||||
////查询库位表
|
||||
//BasLocation location = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == input.data[nameof(WmsDelivery.startlocation_id)].ToString());
|
||||
//{
|
||||
// //载具加锁,增加库位信息
|
||||
// _ = await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH
|
||||
// {
|
||||
// carry_status = ((int)EnumCarryStatus.占用).ToString(),
|
||||
// is_lock = 1,
|
||||
// location_id = input.data[nameof(WmsDelivery.startlocation_id)].ToString(),
|
||||
// location_code = location.location_code
|
||||
// }).Where(it => it.id == input.data[nameof(WmsDelivery.carry_id)].ToString()).ExecuteCommandAsync();
|
||||
//}
|
||||
|
||||
//所有库位加锁
|
||||
string?[] ids = new[] { input.data[nameof(WmsDelivery.startlocation_id)].ToString(), input.data[nameof(WmsDelivery.endlocation_id)].ToString() };
|
||||
@@ -238,5 +245,25 @@ namespace Tnb.WarehouseMgr
|
||||
throw Oops.Oh(ErrorCode.COM1001);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据区域以及扫描的库位编码获取库位信息
|
||||
/// </summary>
|
||||
/// <param name="dic"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<dynamic> LocationbyCode(Dictionary<string, string> dic)
|
||||
{
|
||||
var id = dic["id"];
|
||||
var code = dic["code"];
|
||||
|
||||
var dataInterE = await _db.Queryable<DataInterfaceEntity>().FirstAsync(x => x.Id == id && x.DeleteMark == null);
|
||||
if (dataInterE == null)
|
||||
throw Oops.Bah("未找到对应实体");
|
||||
|
||||
var reqParameters = dataInterE.RequestParameters.ToList<DataInterfaceReqParameter>();
|
||||
var basLocation = await _db.Queryable<BasLocation>().Where(r => r.location_code.Contains(code) && r.region_id == reqParameters.First().defaultValue).FirstAsync();
|
||||
|
||||
return basLocation;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user