1
This commit is contained in:
@@ -160,5 +160,9 @@ public class ModuleConsts
|
||||
/// 模块标识-库存报表
|
||||
/// </summary>
|
||||
public const string MODULE_WMSSTOCKREPORT_ID = "27895417124373";
|
||||
/// <summary>
|
||||
/// 模块标识-载具台账
|
||||
/// </summary>
|
||||
public const string MODULE_WMSCARRY_ID = "26038721525029";
|
||||
|
||||
}
|
||||
@@ -194,16 +194,7 @@ namespace Tnb.WarehouseMgr
|
||||
FileStreamResult fileStreamResult = new FileStreamResult(ms2, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") { FileDownloadName = "template.xlsx" };
|
||||
return fileStreamResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 数据导入
|
||||
/// </summary>
|
||||
/// <param name="file"></param>
|
||||
/// <returns></returns>
|
||||
protected virtual Task DataImport(IFormFile file)
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
|
||||
[NonAction]
|
||||
protected async Task DoUpdate(WareHouseUpInput input)
|
||||
|
||||
@@ -18,88 +18,32 @@ using JNPF.Common.Extension;
|
||||
using JNPF.VisualDev.Entitys;
|
||||
using Aspose.Cells.Drawing;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace Tnb.WarehouseMgr
|
||||
{
|
||||
/// <summary>
|
||||
/// 载具台账服务
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Tag = ModuleConsts.Tag, Area = ModuleConsts.Area, Order = 700)]
|
||||
[Route("api/[area]/[controller]/[action]")]
|
||||
//[OverideVisualDev(ModuleId)]
|
||||
public class WmsCarryLedgerService : IOverideVisualDevService, IWmsCarryLedgerService, IDynamicApiController, ITransient
|
||||
[OverideVisualDev(ModuleConsts.MODULE_WMSCARRY_ID)]
|
||||
public class WmsCarryLedgerService : BaseWareHouseService, IWmsCarryLedgerService
|
||||
{
|
||||
private const string ModuleId = "26038721525029";
|
||||
private const string ModuleId = "";
|
||||
private readonly ISqlSugarClient _db;
|
||||
private readonly IRunService _runService;
|
||||
private readonly IVisualDevService _visualDevService;
|
||||
private static Dictionary<int, string> _dicCarryStatus = new(); //载具状态
|
||||
private static Dictionary<int, string> _dicOutStatus = new(); //出库类型
|
||||
private static Dictionary<int, string> _dicIsCheck = new() //是否检验
|
||||
{
|
||||
[0] = "未检验",
|
||||
[1] = "已检验",
|
||||
};
|
||||
private static Dictionary<int, string> _dicIsEnabled = new()
|
||||
{
|
||||
[0] = "启用",
|
||||
[1] = "禁用",
|
||||
};
|
||||
private static Dictionary<int, string> _dicIsLock = new()
|
||||
{
|
||||
[0] = "未锁定",
|
||||
[1] = "锁定",
|
||||
};
|
||||
|
||||
public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc();
|
||||
public WmsCarryLedgerService(ISqlSugarRepository<WmsCarryH> repository, IRunService runService, IVisualDevService visualDevService)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_runService = runService;
|
||||
_visualDevService = visualDevService;
|
||||
//OverideFuncs.GetListAsync = GetList;
|
||||
OverideFuncs.ImportAsync = DataImport;
|
||||
}
|
||||
|
||||
private async Task<dynamic> GetList(VisualDevModelListQueryInput input)
|
||||
private async Task<dynamic> DataImport(IFormFile file)
|
||||
{
|
||||
if (_dicCarryStatus.Count < 1)
|
||||
{
|
||||
_dicCarryStatus = typeof(EnumCarryStatus).GetEnumDictionary();
|
||||
}
|
||||
if (_dicOutStatus.Count < 1)
|
||||
{
|
||||
_dicOutStatus = typeof(EnumOutStatus).GetEnumDictionary();
|
||||
}
|
||||
|
||||
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleId, true);
|
||||
var data = await _runService.GetListResult(templateEntity, input);
|
||||
if (data?.list?.Count > 0)
|
||||
{
|
||||
//foreach (var item in data.list)
|
||||
//{
|
||||
// if (item.ContainsKey(nameof(WmsCarryH.carry_status)) && item[nameof(WmsCarryH.carry_status)].IsNotEmptyOrNull())
|
||||
// {
|
||||
// item[nameof(WmsCarryH.carry_status)] = _dicCarryStatus[item[nameof(WmsCarryH.carry_status)].ParseToInt()];
|
||||
// }
|
||||
// if (item.ContainsKey(nameof(WmsCarryH.out_status)) && item[nameof(WmsCarryH.out_status)].IsNotEmptyOrNull())
|
||||
// {
|
||||
// item[nameof(WmsCarryH.out_status)] = _dicOutStatus[item[nameof(WmsCarryH.out_status)].ParseToInt()];
|
||||
// }
|
||||
// if (item.ContainsKey(nameof(WmsCarryH.is_lock)) && item[nameof(WmsCarryH.is_lock)].IsNotEmptyOrNull())
|
||||
// {
|
||||
// item[nameof(WmsCarryH.is_lock)] = _dicIsLock[item[nameof(WmsCarryH.is_lock)].ParseToInt()];
|
||||
// }
|
||||
// if (item.ContainsKey(nameof(WmsCarryH.is_check)) && item[nameof(WmsCarryH.is_check)].IsNotEmptyOrNull())
|
||||
// {
|
||||
// item[nameof(WmsCarryH.is_check)] = _dicIsCheck[item[nameof(WmsCarryH.is_check)].ParseToInt()];
|
||||
// }
|
||||
// if (item.ContainsKey(nameof(WmsCarryH.status)) && item[nameof(WmsCarryH.status)].IsNotEmptyOrNull())
|
||||
// {
|
||||
// item[nameof(WmsCarryH.status)] = _dicIsEnabled[item[nameof(WmsCarryH.status)].ParseToInt()];
|
||||
// }
|
||||
//}
|
||||
}
|
||||
return data!;
|
||||
return Task.FromResult<dynamic>(null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user