载具查询返回接口,新增 供应商ID,检验结论,入库时间
This commit is contained in:
@@ -64,6 +64,18 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Outputs
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string? collocation_scheme_code { get; set; }
|
public string? collocation_scheme_code { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// 供应商
|
||||||
|
/// </summary>
|
||||||
|
public string supplier_id { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 入库时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime instock_time { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 检验结论
|
||||||
|
/// </summary>
|
||||||
|
public int is_check { get; set; }
|
||||||
|
/// <summary>
|
||||||
/// 载具条码明细输出
|
/// 载具条码明细输出
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<CarryCodeQueryOutput>? wmsCarryCodes { get; set; }
|
public List<CarryCodeQueryOutput>? wmsCarryCodes { get; set; }
|
||||||
@@ -150,5 +162,7 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Outputs
|
|||||||
/// 仓库ID
|
/// 仓库ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string? warehouse_id { get; set; }
|
public string? warehouse_id { get; set; }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,4 +15,15 @@ public partial class WmsCarryH
|
|||||||
[SugarColumn(IsIgnore = true)]
|
[SugarColumn(IsIgnore = true)]
|
||||||
public int is_sign { get; set; }
|
public int is_sign { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 供应商
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsIgnore = true)]
|
||||||
|
public string supplier_id { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 入库时间
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsIgnore = true)]
|
||||||
|
public DateTime instock_time { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ using System.Text;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using JNPF;
|
using JNPF;
|
||||||
using JNPF.Common.Extension;
|
using JNPF.Common.Extension;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Tnb.WarehouseMgr.Entities.Attributes;
|
using Tnb.WarehouseMgr.Entities.Attributes;
|
||||||
using Tnb.WarehouseMgr.Entities.Dto;
|
using Tnb.WarehouseMgr.Entities.Dto;
|
||||||
using Tnb.WarehouseMgr.Interfaces;
|
using Tnb.WarehouseMgr.Interfaces;
|
||||||
@@ -17,21 +18,20 @@ namespace Tnb.WarehouseMgr
|
|||||||
[Caller("web")]
|
[Caller("web")]
|
||||||
public class PcStroageService : IWHStorageService
|
public class PcStroageService : IWHStorageService
|
||||||
{
|
{
|
||||||
private static Dictionary<string, Func<WareHouseUpInput, Task>> _serviceCallbackMap = new(StringComparer.OrdinalIgnoreCase);
|
private static Dictionary<string, BaseWareHouseService> _serviceMap = new(StringComparer.OrdinalIgnoreCase);
|
||||||
static PcStroageService()
|
static PcStroageService()
|
||||||
{
|
{
|
||||||
_serviceCallbackMap = App.EffectiveTypes.AsParallel().Where(u => u.IsClass && !u.IsInterface && !u.IsAbstract && !typeof(IPdaStroage).IsAssignableFrom(u)
|
|
||||||
|
_serviceMap = App.EffectiveTypes.AsParallel().Where(u => u.IsClass && !u.IsInterface && !u.IsAbstract && !typeof(IPdaStroage).IsAssignableFrom(u)
|
||||||
&& u.IsSubclassOf(typeof(BaseWareHouseService)) && u.GetCustomAttribute<ServiceModuleAttribute>() != null)
|
&& u.IsSubclassOf(typeof(BaseWareHouseService)) && u.GetCustomAttribute<ServiceModuleAttribute>() != null)
|
||||||
.ToDictionary(x => x.GetCustomAttribute<ServiceModuleAttribute>().BizTypeId,
|
.ToDictionary(x => x.GetCustomAttribute<ServiceModuleAttribute>().BizTypeId, x => (BaseWareHouseService)App.GetService(x));
|
||||||
x => (Func<WareHouseUpInput, Task>)Delegate.CreateDelegate(typeof(Func<WareHouseUpInput, Task>), App.GetService(x), x.GetMethod(nameof(WareHouseService.ModifyAsync))));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task Do(WareHouseUpInput input)
|
public async Task Do(WareHouseUpInput input)
|
||||||
{
|
{
|
||||||
if (_serviceCallbackMap.ContainsKey(input.bizTypeId))
|
if (_serviceMap.ContainsKey(input.bizTypeId))
|
||||||
{
|
await _serviceMap[input.bizTypeId].ModifyAsync(input);
|
||||||
await _serviceCallbackMap[input.bizTypeId].Invoke(input);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,7 +69,12 @@ namespace Tnb.WarehouseMgr
|
|||||||
var data = new CarryQueryOutput();
|
var data = new CarryQueryOutput();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var carry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.carry_code == input.carry_code && it.status == 1);
|
var carry = await _db.Queryable<WmsCarryH>().LeftJoin<WmsInstockH>((a, b) => a.id == b.carry_id).Where(a => a.carry_code == input.carry_code && a.status == 1)
|
||||||
|
.Select((a, b) => new WmsCarryH
|
||||||
|
{
|
||||||
|
instock_time = b.create_time
|
||||||
|
}, true)
|
||||||
|
.FirstAsync();
|
||||||
if (carry.IsNull()) throw new AppFriendlyException($"编号{input.carry_code},对应载具不存在或被禁用", 500);
|
if (carry.IsNull()) throw new AppFriendlyException($"编号{input.carry_code},对应载具不存在或被禁用", 500);
|
||||||
List<WmsCarryCode> carryCodes = new();
|
List<WmsCarryCode> carryCodes = new();
|
||||||
var carryDsLst = await _db.Queryable<WmsCarryD>().Where(it => it.carry_id == carry.id).ToListAsync();
|
var carryDsLst = await _db.Queryable<WmsCarryD>().Where(it => it.carry_id == carry.id).ToListAsync();
|
||||||
|
|||||||
Reference in New Issue
Block a user