载具查询返回接口,新增 供应商ID,检验结论,入库时间

This commit is contained in:
alex
2023-08-21 15:06:36 +08:00
parent 807f656792
commit 24fd778f28
4 changed files with 39 additions and 9 deletions

View File

@@ -64,6 +64,18 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Outputs
/// </summary>
public string? collocation_scheme_code { get; set; }
/// <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>
public List<CarryCodeQueryOutput>? wmsCarryCodes { get; set; }
@@ -150,5 +162,7 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Outputs
/// 仓库ID
/// </summary>
public string? warehouse_id { get; set; }
}
}

View File

@@ -15,4 +15,15 @@ public partial class WmsCarryH
[SugarColumn(IsIgnore = true)]
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; }
}

View File

@@ -8,6 +8,7 @@ using System.Text;
using System.Threading.Tasks;
using JNPF;
using JNPF.Common.Extension;
using Microsoft.Extensions.DependencyInjection;
using Tnb.WarehouseMgr.Entities.Attributes;
using Tnb.WarehouseMgr.Entities.Dto;
using Tnb.WarehouseMgr.Interfaces;
@@ -17,21 +18,20 @@ namespace Tnb.WarehouseMgr
[Caller("web")]
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()
{
_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)
.ToDictionary(x => x.GetCustomAttribute<ServiceModuleAttribute>().BizTypeId,
x => (Func<WareHouseUpInput, Task>)Delegate.CreateDelegate(typeof(Func<WareHouseUpInput, Task>), App.GetService(x), x.GetMethod(nameof(WareHouseService.ModifyAsync))));
.ToDictionary(x => x.GetCustomAttribute<ServiceModuleAttribute>().BizTypeId, x => (BaseWareHouseService)App.GetService(x));
}
public async Task Do(WareHouseUpInput input)
{
if (_serviceCallbackMap.ContainsKey(input.bizTypeId))
{
await _serviceCallbackMap[input.bizTypeId].Invoke(input);
}
if (_serviceMap.ContainsKey(input.bizTypeId))
await _serviceMap[input.bizTypeId].ModifyAsync(input);
}
}
}

View File

@@ -69,7 +69,12 @@ namespace Tnb.WarehouseMgr
var data = new CarryQueryOutput();
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);
List<WmsCarryCode> carryCodes = new();
var carryDsLst = await _db.Queryable<WmsCarryD>().Where(it => it.carry_id == carry.id).ToListAsync();