|
@ -33,18 +33,32 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase |
|
|
private readonly IBalanceAppService _balanceAppService; |
|
|
private readonly IBalanceAppService _balanceAppService; |
|
|
private readonly ILocationAppService _locationAppService; |
|
|
private readonly ILocationAppService _locationAppService; |
|
|
private readonly ISplitPackingRecAppService _splitPackingRecAppService; |
|
|
private readonly ISplitPackingRecAppService _splitPackingRecAppService; |
|
|
|
|
|
private readonly IPurchaseReceiptJobAppService _purchaseReceiptJobAppService; |
|
|
|
|
|
private readonly IPurchaseReceiptRequestAppService _purchaseReceiptRequestAppService; //采购收货
|
|
|
|
|
|
private readonly IInspectJobAppService _inspectJobAppService; //质检
|
|
|
|
|
|
private readonly IIssueJobAppService _issueJobAppService; //发料
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public TransferNoteAppService( |
|
|
public TransferNoteAppService( |
|
|
ITransferNoteRepository repository, |
|
|
ITransferNoteRepository repository, |
|
|
ITransferNoteManager transferNoteManager, |
|
|
ITransferNoteManager transferNoteManager, |
|
|
IBalanceAppService balanceAppService, |
|
|
IBalanceAppService balanceAppService, |
|
|
ILocationAppService locationAppService, |
|
|
ILocationAppService locationAppService, |
|
|
ISplitPackingRecAppService splitPackingRecAppService) : base(repository) |
|
|
ISplitPackingRecAppService splitPackingRecAppService, |
|
|
|
|
|
IPurchaseReceiptJobAppService purchaseReceiptJobAppService, |
|
|
|
|
|
IPurchaseReceiptRequestAppService purchaseReceiptRequestAppService, |
|
|
|
|
|
IInspectJobAppService inspectJobAppService, |
|
|
|
|
|
IIssueJobAppService issueJobAppService) : base(repository) |
|
|
{ |
|
|
{ |
|
|
_transferNoteManager = transferNoteManager; |
|
|
_transferNoteManager = transferNoteManager; |
|
|
_balanceAppService = balanceAppService; |
|
|
_balanceAppService = balanceAppService; |
|
|
_locationAppService = locationAppService; |
|
|
_locationAppService = locationAppService; |
|
|
_splitPackingRecAppService = splitPackingRecAppService; |
|
|
_splitPackingRecAppService = splitPackingRecAppService; |
|
|
|
|
|
_purchaseReceiptJobAppService = purchaseReceiptJobAppService; |
|
|
|
|
|
_purchaseReceiptRequestAppService = purchaseReceiptRequestAppService; |
|
|
|
|
|
_inspectJobAppService = inspectJobAppService; |
|
|
|
|
|
_issueJobAppService = issueJobAppService; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#region 东阳使用
|
|
|
#region 东阳使用
|
|
@ -126,36 +140,7 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase |
|
|
public async Task<TransferNoteDTO> SplitPackingAsync(TransferNoteEditInput transferNoteEditInput) |
|
|
public async Task<TransferNoteDTO> SplitPackingAsync(TransferNoteEditInput transferNoteEditInput) |
|
|
{ |
|
|
{ |
|
|
//插入拆箱记录表
|
|
|
//插入拆箱记录表
|
|
|
foreach (var inputDetail in transferNoteEditInput.Details) |
|
|
await WriteSplitPackingRec(transferNoteEditInput).ConfigureAwait(false); |
|
|
{ |
|
|
|
|
|
List<SplitPackingRecEditInput> recLst = new List<SplitPackingRecEditInput>(); |
|
|
|
|
|
SplitPackingRecEditInput packRec = new SplitPackingRecEditInput(); |
|
|
|
|
|
packRec.OprType = OprTypeEnum.SplitBox; |
|
|
|
|
|
packRec.FromPackingCode = inputDetail.FromPackingCode; |
|
|
|
|
|
//packRec.FromTopPackingCode = inputDetail.;
|
|
|
|
|
|
packRec.FromStdPackQty = inputDetail.StdPackQty; |
|
|
|
|
|
packRec.FromUom = inputDetail.Uom; |
|
|
|
|
|
packRec.FromQty = inputDetail.Qty; |
|
|
|
|
|
packRec.ToPackingCode = inputDetail.ToPackingCode; |
|
|
|
|
|
//packRec.ToTopPackingCode = inputDetail.;
|
|
|
|
|
|
packRec.ToStdPackQty = inputDetail.StdPackQty; |
|
|
|
|
|
packRec.ToUom = inputDetail.Uom; |
|
|
|
|
|
packRec.ToQty = inputDetail.Qty; |
|
|
|
|
|
packRec.ItemCode = inputDetail.ItemCode; |
|
|
|
|
|
packRec.ItemName = inputDetail.ItemName; |
|
|
|
|
|
packRec.ItemDesc1 = inputDetail.ItemDesc1; |
|
|
|
|
|
packRec.ItemDesc2 = inputDetail.ItemDesc2; |
|
|
|
|
|
packRec.FromLot = inputDetail.FromLot; |
|
|
|
|
|
packRec.ToLot = inputDetail.ToLot; |
|
|
|
|
|
//packRec.PurchaseInfo_PoNumber = inputDetail.; // 采购订单
|
|
|
|
|
|
//packRec.PurchaseInfo_AsnNumber = inputDetail.; //供应商发货单
|
|
|
|
|
|
//packRec.ArrivalNoticNumber = inputDetail.; //到货通知
|
|
|
|
|
|
//packRec.TaskOrderNumber = inputDetail.; //任务单
|
|
|
|
|
|
//packRec.ReceiptRecNumber = inputDetail.; //收货记录单
|
|
|
|
|
|
//packRec.PutOnShelfNumber = inputDetail.; //上架单
|
|
|
|
|
|
recLst.Add(packRec); |
|
|
|
|
|
await _splitPackingRecAppService.BatchInsertAsync(recLst).ConfigureAwait(false); |
|
|
|
|
|
} |
|
|
|
|
|
//更新库存
|
|
|
//更新库存
|
|
|
transferNoteEditInput.Type = EnumTransSubType.Transfer_SplitPacking.ToString(); |
|
|
transferNoteEditInput.Type = EnumTransSubType.Transfer_SplitPacking.ToString(); |
|
|
return await CreateAsync(transferNoteEditInput).ConfigureAwait(false); |
|
|
return await CreateAsync(transferNoteEditInput).ConfigureAwait(false); |
|
@ -389,5 +374,92 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase |
|
|
return dto; |
|
|
return dto; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 插入拆箱记录表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="transferNoteEditInput"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
private async Task<bool> WriteSplitPackingRec(TransferNoteEditInput transferNoteEditInput) |
|
|
|
|
|
{ |
|
|
|
|
|
List<SplitPackingRecEditInput> recLst = new List<SplitPackingRecEditInput>(); |
|
|
|
|
|
foreach (var inputDetail in transferNoteEditInput.Details) |
|
|
|
|
|
{ |
|
|
|
|
|
SplitPackingRecEditInput packRec = new SplitPackingRecEditInput(); |
|
|
|
|
|
packRec.OprType = OprTypeEnum.SplitBox; |
|
|
|
|
|
packRec.FromPackingCode = inputDetail.FromPackingCode; |
|
|
|
|
|
//packRec.FromTopPackingCode = inputDetail.;
|
|
|
|
|
|
packRec.FromStdPackQty = inputDetail.StdPackQty; |
|
|
|
|
|
packRec.FromUom = inputDetail.Uom; |
|
|
|
|
|
packRec.FromQty = inputDetail.Qty; |
|
|
|
|
|
packRec.ToPackingCode = inputDetail.ToPackingCode; |
|
|
|
|
|
//packRec.ToTopPackingCode = inputDetail.;
|
|
|
|
|
|
packRec.ToStdPackQty = inputDetail.StdPackQty; |
|
|
|
|
|
packRec.ToUom = inputDetail.Uom; |
|
|
|
|
|
packRec.ToQty = inputDetail.Qty; |
|
|
|
|
|
packRec.ItemCode = inputDetail.ItemCode; |
|
|
|
|
|
packRec.ItemName = inputDetail.ItemName; |
|
|
|
|
|
packRec.ItemDesc1 = inputDetail.ItemDesc1; |
|
|
|
|
|
packRec.ItemDesc2 = inputDetail.ItemDesc2; |
|
|
|
|
|
packRec.FromLot = inputDetail.FromLot; |
|
|
|
|
|
packRec.ToLot = inputDetail.ToLot; |
|
|
|
|
|
//packRec.PurchaseInfo_PoNumber = inputDetail.; // 采购订单
|
|
|
|
|
|
//packRec.PurchaseInfo_AsnNumber = inputDetail.; //供应商发货单
|
|
|
|
|
|
//packRec.ArrivalNoticNumber = inputDetail.; //到货通知
|
|
|
|
|
|
//packRec.TaskOrderNumber = inputDetail.; //任务单
|
|
|
|
|
|
//packRec.ReceiptRecNumber = inputDetail.; //收货记录单
|
|
|
|
|
|
//packRec.PutOnShelfNumber = inputDetail.; //上架单
|
|
|
|
|
|
recLst.Add(packRec); |
|
|
|
|
|
} |
|
|
|
|
|
var ret = await _splitPackingRecAppService.BatchInsertAsync(recLst).ConfigureAwait(false); |
|
|
|
|
|
return ret; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 采购收货拆箱,同时更新、插入PurchaseReceipt任务表、申请表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="transferNoteEditInput"></param>
|
|
|
|
|
|
/// <param name="updateJobDetailInput"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost("split-packing-purchase-receipt")] |
|
|
|
|
|
public async Task<bool> SplitPacking_PurchaseReceiptAsync(TransferNoteEditInput transferNoteEditInput, [FromQuery] SplitPacking_UpdateJobDetailInput updateJobDetailInput) |
|
|
|
|
|
{ |
|
|
|
|
|
var jobRet = await _purchaseReceiptJobAppService.SaveDetail_SplitPackingAsync(updateJobDetailInput).ConfigureAwait(false); |
|
|
|
|
|
var requestRet = await _purchaseReceiptRequestAppService.SaveDetail_SplitPackingAsync(updateJobDetailInput, jobRet.PurchaseReceiptRequestNumber).ConfigureAwait(false); |
|
|
|
|
|
bool ret = await WriteSplitPackingRec(transferNoteEditInput).ConfigureAwait(false); //采购收货-目检-拆箱时,还没有入库,不涉及库存操作
|
|
|
|
|
|
return ret; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 质检拆箱,同时更新、插入Inspect任务表(不更新申请表)
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="transferNoteEditInput"></param>
|
|
|
|
|
|
/// <param name="updateJobDetailInput"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost("split-packing-inspect")] |
|
|
|
|
|
public async Task<TransferNoteDTO> SplitPacking_InspectAsync(TransferNoteEditInput transferNoteEditInput, [FromQuery] SplitPacking_UpdateJobDetailInput updateJobDetailInput) |
|
|
|
|
|
{ |
|
|
|
|
|
var jobRet = await _inspectJobAppService.SaveDetail_SplitPackingAsync(updateJobDetailInput).ConfigureAwait(false); |
|
|
|
|
|
var ret = await SplitPackingAsync(transferNoteEditInput).ConfigureAwait(false); //库存操作
|
|
|
|
|
|
return ret; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 发料拆箱,同时更新、插入Inspect任务表(没有找到申请表//??)
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="transferNoteEditInput"></param>
|
|
|
|
|
|
/// <param name="updateJobDetailInput"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost("split-packing-issue")] |
|
|
|
|
|
public async Task<TransferNoteDTO> SplitPacking_IssueAsync(TransferNoteEditInput transferNoteEditInput, [FromQuery] SplitPacking_UpdateJobDetailInput updateJobDetailInput) |
|
|
|
|
|
{ |
|
|
|
|
|
var jobRet = await _issueJobAppService.SaveDetail_SplitPackingAsync(updateJobDetailInput).ConfigureAwait(false); |
|
|
|
|
|
var ret = await SplitPackingAsync(transferNoteEditInput).ConfigureAwait(false); //库存操作
|
|
|
|
|
|
return ret; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|