Merge branch 'dev' of https://git.tuotong-tech.com/tnb/tnb.server into dev
This commit is contained in:
@@ -9,6 +9,8 @@ using JNPF.FriendlyException;
|
||||
using JNPF.Logging;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using JNPF.VisualDev;
|
||||
using JNPF.VisualDev.Entitys;
|
||||
using JNPF.VisualDev.Interfaces;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SqlSugar;
|
||||
@@ -30,11 +32,20 @@ namespace Tnb.WarehouseMgr
|
||||
private readonly ISqlSugarClient _db;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IBillRullService _billRullService;
|
||||
public WmsCarryService(ISqlSugarRepository<WmsCarryH> repository, IUserManager userManager, IBillRullService billRullService)
|
||||
private readonly IRunService _runService;
|
||||
private readonly IVisualDevService _visualDevService;
|
||||
public WmsCarryService(
|
||||
ISqlSugarRepository<WmsCarryH> repository,
|
||||
IUserManager userManager,
|
||||
IBillRullService billRullService,
|
||||
IRunService runService,
|
||||
IVisualDevService visualDevService )
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_userManager = userManager;
|
||||
_billRullService = billRullService;
|
||||
_runService = runService;
|
||||
_visualDevService = visualDevService;
|
||||
OverideFuncs.CreateAsync = ExchangeCarry;
|
||||
}
|
||||
|
||||
@@ -52,10 +63,16 @@ namespace Tnb.WarehouseMgr
|
||||
/// <exception cref="ArgumentNullException"></exception>
|
||||
private async Task<dynamic> ExchangeCarry(VisualDevModelDataCrInput input)
|
||||
{
|
||||
|
||||
|
||||
var isOk = false;
|
||||
try
|
||||
{
|
||||
await _db.Ado.BeginTranAsync();
|
||||
|
||||
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleConsts.MODULE_WMSCARRYREPLACE_ID, true);
|
||||
await _runService.Create(templateEntity, input);
|
||||
|
||||
var oldCarryId = input.data.ContainsKey("carry_id") ? input.data["carry_id"]?.ToString() : "";
|
||||
var newCarryId = input.data.ContainsKey("newcarry_id") ? input.data["newcarry_id"]?.ToString() : "";
|
||||
var oldCarry = await _db.Queryable<WmsCarryH>().FirstAsync(it => it.id == oldCarryId);
|
||||
|
||||
@@ -9,6 +9,8 @@ using JNPF.FriendlyException;
|
||||
using JNPF.Logging;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using JNPF.VisualDev;
|
||||
using JNPF.VisualDev.Entitys;
|
||||
using JNPF.VisualDev.Interfaces;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SqlSugar;
|
||||
@@ -25,38 +27,52 @@ namespace Tnb.WarehouseMgr
|
||||
/// 载具服务
|
||||
/// </summary>
|
||||
[OverideVisualDev(ModuleConsts.MODULE_WMSBINDINGPDA_ID)]
|
||||
public class WmsPDABindService : BaseWareHouseService, IWmsCarryService
|
||||
public class WmsPDABindService : BaseWareHouseService, IWmsCarryService, IPdaStroage
|
||||
{
|
||||
//private const string ModuleId = "26496560237333";
|
||||
private readonly ISqlSugarClient _db;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IBillRullService _billRullService;
|
||||
public WmsPDABindService(ISqlSugarRepository<WmsCarryH> repository, IUserManager userManager, IBillRullService billRullService)
|
||||
private readonly IRunService _runService;
|
||||
private readonly IVisualDevService _visualDevService;
|
||||
public WmsPDABindService(
|
||||
ISqlSugarRepository<WmsCarryH> repository,
|
||||
IUserManager userManager,
|
||||
IBillRullService billRullService,
|
||||
IRunService runService,
|
||||
IVisualDevService visualDevService)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_userManager = userManager;
|
||||
_billRullService = billRullService;
|
||||
OverideFuncs.CreateAsync = WmsBind;
|
||||
_runService = runService;
|
||||
_visualDevService = visualDevService;
|
||||
OverideFuncs.CreateAsync = WmsPDABind;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 绑定操作
|
||||
/// PDA绑定操作
|
||||
/// </summary>
|
||||
/// <param name="input">
|
||||
/// 输入参数:
|
||||
/// <br/>{
|
||||
/// <br/> old_carry_id:老载具id
|
||||
/// <br/> new_carry_id:新载具ID
|
||||
/// <br/> old_carry_id: 载具料箱ID
|
||||
/// <br/> new_carry_id:载具小车ID
|
||||
/// <br/>}
|
||||
/// </param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="ArgumentNullException"></exception>
|
||||
private async Task<dynamic> WmsBind(VisualDevModelDataCrInput input)
|
||||
private async Task<dynamic> WmsPDABind(VisualDevModelDataCrInput input)
|
||||
{
|
||||
|
||||
|
||||
var isOk = false;
|
||||
try
|
||||
{
|
||||
await _db.Ado.BeginTranAsync();
|
||||
|
||||
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleConsts.MODULE_WMSBINDINGPDA_ID, true);
|
||||
await _runService.Create(templateEntity, input);
|
||||
|
||||
var oldCarryId = input.data.ContainsKey("carry_id") ? input.data["carry_id"]?.ToString() : "";
|
||||
var newCarryId = input.data.ContainsKey("newcarry_id") ? input.data["newcarry_id"]?.ToString() : "";
|
||||
var oldCarry = await _db.Queryable<WmsCarryH>().FirstAsync(it => it.id == oldCarryId);
|
||||
@@ -137,6 +153,7 @@ namespace Tnb.WarehouseMgr
|
||||
carryObj.source_id = null;
|
||||
carryObj.source_code = null;
|
||||
row = await _db.Updateable(carryObj).ExecuteCommandAsync();
|
||||
//删除对应明细表
|
||||
//删除载具明细
|
||||
await _db.Deleteable<WmsCarryD>().Where(it => it.carry_id == carryObj.id).ExecuteCommandHasChangeAsync();
|
||||
//删除载具分拣物料明细
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
if (input == null) throw new ArgumentNullException(nameof(input));
|
||||
var carryId = input.data.ContainsKey("carry_id") ? input.data["carry_id"]?.ToString() : "";
|
||||
var subCarryId = input.data.ContainsKey("newcarry_id") ? input.data["newcarry_id"]?.ToString() : "";
|
||||
var subCarryId = input.data.ContainsKey("membercarry_id") ? input.data["membercarry_id"]?.ToString() : "";
|
||||
var carry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.id == carryId);
|
||||
var subCarry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.id == subCarryId);
|
||||
WmsCarryD wmsCarryD = new()
|
||||
@@ -74,6 +74,7 @@ namespace Tnb.WarehouseMgr
|
||||
org_id = carry?.org_id!,
|
||||
membercarry_id = subCarry.id,
|
||||
membercarry_code = subCarry.carry_code,
|
||||
|
||||
loc = input.data[nameof(WmsCarrybindH.loc)].ParseToInt(1),
|
||||
create_id = _userManager.UserId,
|
||||
create_time = DateTime.Now
|
||||
|
||||
@@ -9,12 +9,13 @@ using JNPF.FriendlyException;
|
||||
using JNPF.Logging;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using JNPF.VisualDev;
|
||||
using JNPF.VisualDev.Entitys;
|
||||
using JNPF.VisualDev.Interfaces;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SqlSugar;
|
||||
using Tnb.Common.Utils;
|
||||
using Tnb.WarehouseMgr.Entities;
|
||||
using Tnb.WarehouseMgr.Entities.Attributes;
|
||||
using Tnb.WarehouseMgr.Entities.Consts;
|
||||
using Tnb.WarehouseMgr.Entities.Dto;
|
||||
using Tnb.WarehouseMgr.Entities.Enums;
|
||||
@@ -23,41 +24,55 @@ using Tnb.WarehouseMgr.Interfaces;
|
||||
namespace Tnb.WarehouseMgr
|
||||
{
|
||||
/// <summary>
|
||||
/// 载具服务
|
||||
/// PDA载具更换
|
||||
/// </summary>
|
||||
[OverideVisualDev(ModuleConsts.MODULE_WMSCARRYREPLACEPDA_ID)]
|
||||
public class WmsPDACarryReplaceService : BaseWareHouseService, IWmsCarryService, IPdaStroage
|
||||
public class WmsPDACarryService : BaseWareHouseService, IWmsCarryService, IPdaStroage
|
||||
{
|
||||
private readonly ISqlSugarClient _db;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IBillRullService _billRullService;
|
||||
public WmsPDACarryReplaceService(ISqlSugarRepository<WmsCarryH> repository, IUserManager userManager, IBillRullService billRullService)
|
||||
private readonly IRunService _runService;
|
||||
private readonly IVisualDevService _visualDevService;
|
||||
public WmsPDACarryService(
|
||||
ISqlSugarRepository<WmsCarryH> repository,
|
||||
IUserManager userManager,
|
||||
IBillRullService billRullService,
|
||||
IRunService runService,
|
||||
IVisualDevService visualDevService)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_userManager = userManager;
|
||||
_billRullService = billRullService;
|
||||
OverideFuncs.CreateAsync = PDACarryReplace;
|
||||
_runService = runService;
|
||||
_visualDevService = visualDevService;
|
||||
OverideFuncs.CreateAsync = WMSPDACarryReplace;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更换载具
|
||||
/// PDA载具更换
|
||||
/// </summary>
|
||||
/// <param name="input">
|
||||
/// 输入参数:
|
||||
/// <br/>{
|
||||
/// <br/> old_carry_id:老载具id
|
||||
/// <br/> old_carry_id:老载具ID
|
||||
/// <br/> new_carry_id:新载具ID
|
||||
/// <br/>}
|
||||
/// </param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="ArgumentNullException"></exception>
|
||||
|
||||
private async Task<dynamic> PDACarryReplace(VisualDevModelDataCrInput input)
|
||||
private async Task<dynamic> WMSPDACarryReplace(VisualDevModelDataCrInput input)
|
||||
{
|
||||
|
||||
|
||||
var isOk = false;
|
||||
try
|
||||
{
|
||||
await _db.Ado.BeginTranAsync();
|
||||
|
||||
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleConsts.MODULE_WMSCARRYREPLACEPDA_ID, true);
|
||||
await _runService.Create(templateEntity, input);
|
||||
|
||||
var oldCarryId = input.data.ContainsKey("carry_id") ? input.data["carry_id"]?.ToString() : "";
|
||||
var newCarryId = input.data.ContainsKey("newcarry_id") ? input.data["newcarry_id"]?.ToString() : "";
|
||||
var oldCarry = await _db.Queryable<WmsCarryH>().FirstAsync(it => it.id == oldCarryId);
|
||||
@@ -138,6 +153,7 @@ namespace Tnb.WarehouseMgr
|
||||
carryObj.source_id = null;
|
||||
carryObj.source_code = null;
|
||||
row = await _db.Updateable(carryObj).ExecuteCommandAsync();
|
||||
//删除对应明细表
|
||||
//删除载具明细
|
||||
await _db.Deleteable<WmsCarryD>().Where(it => it.carry_id == carryObj.id).ExecuteCommandHasChangeAsync();
|
||||
//删除载具分拣物料明细
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace Tnb.WarehouseMgr
|
||||
|
||||
if (input == null) throw new ArgumentNullException(nameof(input));
|
||||
var carryId = input.data.ContainsKey("carry_id") ? input.data["carry_id"]?.ToString() : "";
|
||||
var subCarryId = input.data.ContainsKey("newcarry_id") ? input.data["newcarry_id"]?.ToString() : "";
|
||||
var subCarryId = input.data.ContainsKey("membercarry_id") ? input.data["membercarry_id"]?.ToString() : "";
|
||||
var carry = await _db.Queryable<WmsCarryH>().FirstAsync(it => it.id == carryId);
|
||||
var subCarry = await _db.Queryable<WmsCarryH>().FirstAsync(it => it.id == subCarryId);
|
||||
//WmsCarryunbindH wmsCarryUnbindH = carry.Adapt<WmsCarryunbindH>();
|
||||
|
||||
@@ -9,11 +9,11 @@ using JNPF.FriendlyException;
|
||||
using JNPF.Logging;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using JNPF.VisualDev;
|
||||
using JNPF.VisualDev.Entitys;
|
||||
using JNPF.VisualDev.Interfaces;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Senparc.Weixin.Work.AdvancedAPIs.OaDataOpen;
|
||||
using SqlSugar;
|
||||
using Tnb.BasicData.Entities;
|
||||
using Tnb.Common.Utils;
|
||||
using Tnb.WarehouseMgr.Entities;
|
||||
using Tnb.WarehouseMgr.Entities.Consts;
|
||||
@@ -24,85 +24,101 @@ using Tnb.WarehouseMgr.Interfaces;
|
||||
namespace Tnb.WarehouseMgr
|
||||
{
|
||||
/// <summary>
|
||||
/// 载具服务
|
||||
/// PDA投料记录
|
||||
/// </summary>
|
||||
[OverideVisualDev(ModuleConsts.MODULE_WMSFEEDINGRECORDPDA_ID)]
|
||||
public class WmsPDAFeedingService : BaseWareHouseService, IWmsCarryService, IWmsFeedingService
|
||||
public class WmsPDAFeedingService : BaseWareHouseService, IWmsCarryService, IPdaStroage
|
||||
{
|
||||
//private const string ModuleId = "26496913096981";
|
||||
private readonly ISqlSugarClient _db;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IBillRullService _billRullService;
|
||||
private readonly WmsCarryService _wmsCarryService;
|
||||
private static Dictionary<string, object> dicMaterial = new Dictionary<string, object>();
|
||||
public WmsPDAFeedingService(ISqlSugarRepository<WmsCarryH> repository, IUserManager userManager, IBillRullService billRullService, WmsCarryService wmsCarryService)
|
||||
private readonly IRunService _runService;
|
||||
private readonly IVisualDevService _visualDevService;
|
||||
public WmsPDAFeedingService(
|
||||
ISqlSugarRepository<WmsCarryH> repository,
|
||||
IUserManager userManager,
|
||||
IBillRullService billRullService,
|
||||
IRunService runService,
|
||||
IVisualDevService visualDevService)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_userManager = userManager;
|
||||
_billRullService = billRullService;
|
||||
_wmsCarryService = wmsCarryService;
|
||||
OverideFuncs.CreateAsync = WmsPDAFeeding;
|
||||
_runService = runService;
|
||||
_visualDevService = visualDevService;
|
||||
OverideFuncs.CreateAsync = WmsPDABind;
|
||||
}
|
||||
|
||||
private async Task<dynamic> WmsPDAFeeding(VisualDevModelDataCrInput input)
|
||||
/// <summary>
|
||||
/// PDA投料记录
|
||||
/// </summary>
|
||||
/// <param name="input">
|
||||
/// 输入参数:
|
||||
/// <br/>{
|
||||
/// <br/> old_carry_id: 料箱ID
|
||||
/// <br/> new_carry_id:新载具ID
|
||||
/// <br/>}
|
||||
/// </param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="ArgumentNullException"></exception>
|
||||
private async Task<dynamic> WmsPDABind(VisualDevModelDataCrInput input)
|
||||
{
|
||||
|
||||
|
||||
var isOk = false;
|
||||
try
|
||||
{
|
||||
await _db.Ado.BeginTranAsync();
|
||||
var carryId = input.data.ContainsKey("carry_id") ? input.data["carry_id"]?.ToString() : "";
|
||||
var feedBoxCode = input.data.ContainsKey("feedbox_code") ? input.data["feedbox_code"]?.ToString() : "";
|
||||
var carry = await _db.Queryable<WmsCarryH>().FirstAsync(it => it.id == carryId);
|
||||
var feedBox = await _db.Queryable<WmsFeedbox>().FirstAsync(it => it.feedbox_code == feedBoxCode);
|
||||
var citem = await _db.Queryable<WmsCarryMat>().FirstAsync(it => it.carry_id == carryId);
|
||||
if (carry != null && feedBox != null)
|
||||
{
|
||||
feedBox.material_id = citem.material_id;
|
||||
feedBox.material_code = citem.material_code;
|
||||
feedBox.qty = citem.qty;
|
||||
feedBox.batch = citem?.code_batch!;
|
||||
var row = await _db.Updateable(feedBox).UpdateColumns(it => new
|
||||
{
|
||||
it.material_id,
|
||||
it.material_code,
|
||||
it.qty,
|
||||
it.batch
|
||||
}).ExecuteCommandAsync();
|
||||
/* var row = await _db.Updateable(feedBox).SetColumns(it => new
|
||||
{
|
||||
it.material_id == item.material_id,it.material_code
|
||||
}
|
||||
)*/
|
||||
|
||||
var items = await _db.Queryable<WmsCarryCode>().Where(it => it.carry_id == carryId).ToListAsync();
|
||||
foreach (var item in items)
|
||||
{
|
||||
WmsFeedingrecordCode wmsFeedingRecordCode = new();
|
||||
wmsFeedingRecordCode.id = SnowflakeIdHelper.NextId();
|
||||
wmsFeedingRecordCode.org_id = carry?.org_id!;
|
||||
wmsFeedingRecordCode.record_id = input.data["ReturnIdentity"]?.ToString()!;
|
||||
wmsFeedingRecordCode.material_id = item.material_id;
|
||||
wmsFeedingRecordCode.material_code = item.material_code;
|
||||
wmsFeedingRecordCode.barcode = item.barcode;
|
||||
wmsFeedingRecordCode.code_batch = item.code_batch;
|
||||
wmsFeedingRecordCode.codeqty = item.codeqty;
|
||||
wmsFeedingRecordCode.unit_id = item.unit_id;
|
||||
wmsFeedingRecordCode.unit_code = item.unit_code;
|
||||
wmsFeedingRecordCode.create_id = _userManager.UserId;
|
||||
wmsFeedingRecordCode.create_time = DateTime.Now;
|
||||
row = await _db.Insertable(wmsFeedingRecordCode).ExecuteCommandAsync();
|
||||
}
|
||||
row = await UpdateNullCarry(carry);
|
||||
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleConsts.MODULE_WMSFEEDINGRECORDPDA_ID, true);
|
||||
await _runService.Create(templateEntity, input);
|
||||
|
||||
var oldCarryId = input.data.ContainsKey("carry_id") ? input.data["carry_id"]?.ToString() : "";
|
||||
var newCarryId = input.data.ContainsKey("newcarry_id") ? input.data["newcarry_id"]?.ToString() : "";
|
||||
var oldCarry = await _db.Queryable<WmsCarryH>().FirstAsync(it => it.id == oldCarryId);
|
||||
var newCarry = await _db.Queryable<WmsCarryH>().FirstAsync(it => it.id == newCarryId);
|
||||
if (oldCarry != null && newCarry != null)
|
||||
{
|
||||
ExChangeCarryInput carryInput = new() { old_carry_id = oldCarry.id, new_carry_id = newCarry.id };
|
||||
isOk = await _updateSubCarry<WmsCarryD>(carryInput);
|
||||
isOk = await _updateSubCarry<WmsCarryMat>(carryInput);
|
||||
isOk = await _updateSubCarry<WmsCarryCode>(carryInput);
|
||||
|
||||
newCarry.status = oldCarry.status;
|
||||
newCarry.carry_status = oldCarry.carry_status;
|
||||
newCarry.location_id = oldCarry.location_id;
|
||||
newCarry.location_code = oldCarry.location_code;
|
||||
newCarry.is_lock = oldCarry.is_lock;
|
||||
newCarry.out_status = oldCarry.out_status;
|
||||
newCarry.is_check = oldCarry.is_check;
|
||||
newCarry.bale_num = oldCarry.bale_num;
|
||||
newCarry.collocation_scheme_id = oldCarry.collocation_scheme_id;
|
||||
newCarry.collocation_scheme_code = oldCarry.collocation_scheme_code;
|
||||
newCarry.source_id = oldCarry.source_id;
|
||||
newCarry.source_code = oldCarry.source_code;
|
||||
newCarry.create_id = _userManager.UserId;
|
||||
newCarry.create_time = DateTime.Now;
|
||||
var row = await _db.Updateable(newCarry).ExecuteCommandAsync();
|
||||
WmsCarryReplaceH wmsCarryReplaceH = oldCarry.Adapt<WmsCarryReplaceH>();
|
||||
wmsCarryReplaceH.id = SnowflakeIdHelper.NextId();
|
||||
wmsCarryReplaceH.org_id = oldCarry.org_id;
|
||||
wmsCarryReplaceH.bill_code = await _billRullService.GetBillNumber(WmsCarryConst.WMS_CARRY_REPLACE_ENCODE);
|
||||
wmsCarryReplaceH.carry_id = oldCarry.id;
|
||||
wmsCarryReplaceH.carry_code = oldCarry.carry_code;
|
||||
wmsCarryReplaceH.newcarry_id = newCarry.id;
|
||||
wmsCarryReplaceH.newcarry_code = newCarry.carry_code;
|
||||
row = await _db.Insertable(wmsCarryReplaceH).ExecuteCommandAsync();
|
||||
row = await UpdateNullCarry(oldCarry);
|
||||
isOk = (row > 0);
|
||||
if (!isOk) throw Oops.Oh(ErrorCode.COM1001);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (carry == null)
|
||||
if (oldCarry == null)
|
||||
{
|
||||
throw new AppFriendlyException("没有可用的旧载具", 500);
|
||||
}
|
||||
if (feedBox == null)
|
||||
if (newCarry == null)
|
||||
{
|
||||
throw new AppFriendlyException("没有可用的新载具", 500);
|
||||
}
|
||||
@@ -137,6 +153,7 @@ namespace Tnb.WarehouseMgr
|
||||
carryObj.source_id = null;
|
||||
carryObj.source_code = null;
|
||||
row = await _db.Updateable(carryObj).ExecuteCommandAsync();
|
||||
//删除对应明细表
|
||||
//删除载具明细
|
||||
await _db.Deleteable<WmsCarryD>().Where(it => it.carry_id == carryObj.id).ExecuteCommandHasChangeAsync();
|
||||
//删除载具分拣物料明细
|
||||
@@ -175,34 +192,5 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
return (row > 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据载具Id获取载具条码记录
|
||||
/// </summary>
|
||||
/// <param name="carryId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<dynamic> GetCarryCodeList([FromRoute] string carryId)
|
||||
{
|
||||
if (dicMaterial.Count < 1)
|
||||
{
|
||||
dicMaterial = await _db.Queryable<BasMaterial>().ToDictionaryAsync(x => x.id, x => x.name);
|
||||
}
|
||||
var items = await _db.Queryable<WmsCarryCode>().Where(a => a.carry_id == carryId)
|
||||
.Select(a => new CarryCodeDetailOutput
|
||||
{
|
||||
barcode = a.barcode,
|
||||
code_batch = a.code_batch,
|
||||
codeqty = a.codeqty,
|
||||
material_code = a.material_code,
|
||||
material_id = a.material_id,
|
||||
unit_id = a.unit_id,
|
||||
})
|
||||
.Mapper(it => it.material_name = dicMaterial.ContainsKey(it.material_id) ? dicMaterial[it.material_id].ToString()! : "")
|
||||
.ToListAsync();
|
||||
return items;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user