|
|
@ -4,6 +4,7 @@ using System.Linq; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using Microsoft.AspNetCore.Authorization; |
|
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
|
using Volo.Abp; |
|
|
|
using Volo.Abp.ObjectMapping; |
|
|
|
using Win_in.Sfs.Basedata.Application.Contracts; |
|
|
|
using Win_in.Sfs.Shared.Application.Contracts; |
|
|
@ -128,7 +129,7 @@ public class TransactionAppService |
|
|
|
/// <param name="startDateTime"></param>
|
|
|
|
/// <param name="endDateTime"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet("item-serial-list")] |
|
|
|
[HttpPost("item-serial-list")] |
|
|
|
public virtual async Task<List<ReportItemSerialDto>> GetItemSerialList(List<string> itemCodes,DateTime startDateTime,DateTime endDateTime) |
|
|
|
{ |
|
|
|
var itemSerialDtos = new List<ReportItemSerialDto>(); |
|
|
@ -137,6 +138,11 @@ public class TransactionAppService |
|
|
|
var itemSerialDto = new ReportItemSerialDto(); |
|
|
|
|
|
|
|
var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(itemCode).ConfigureAwait(false); |
|
|
|
if (itemBasicDto==null) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException($"物品代码{itemCode}不存在"); |
|
|
|
} |
|
|
|
|
|
|
|
itemSerialDto.ItemCode = itemBasicDto.Code; |
|
|
|
itemSerialDto.ItemDesc1 = itemBasicDto.Desc1; |
|
|
|
itemSerialDto.ItemDesc2 = itemBasicDto.Desc2; |
|
|
@ -191,8 +197,18 @@ public class TransactionAppService |
|
|
|
//期初库存
|
|
|
|
var tempFirstSum = transactions.Where(p => p.LocationCode == locationDto.Code && p.CreationTime<startDateTime).Sum(p=>p.Qty); |
|
|
|
//当前库存
|
|
|
|
var balanceDtos= await _balanceAppService.GetListByLocationCodeAndItemCodeAsync(locationDto.Code, itemSerialDto.ItemCode).ConfigureAwait(false); |
|
|
|
var tempNowSum = balanceDtos.Sum(p => p.Qty); |
|
|
|
decimal tempNowSum = 0; |
|
|
|
try |
|
|
|
{ |
|
|
|
var balanceDtos = await _balanceAppService |
|
|
|
.GetListByLocationCodeAndItemCodeAsync(locationDto.Code, itemSerialDto.ItemCode) |
|
|
|
.ConfigureAwait(false); |
|
|
|
tempNowSum = balanceDtos.Sum(p => p.Qty); |
|
|
|
} |
|
|
|
catch |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
//期末库存
|
|
|
|
var tempLastSum = transactions.Where(p => p.LocationCode == locationDto.Code && p.CreationTime < endDateTime).Sum(p => p.Qty); |
|
|
|
|
|
|
|