获取出入库记录数据功能接口添加
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
using DOAN.Model;
|
||||
using DOAN.Model.BZFM;
|
||||
using DOAN.Model.BZFM.Dto;
|
||||
using DOAN.Model.Mobile.Dto;
|
||||
using DOAN.Repository;
|
||||
using DOAN.Service.BZFM.IBZFMService;
|
||||
using Infrastructure.Attribute;
|
||||
using Infrastructure.Converter;
|
||||
using Infrastructure.Extensions;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
@@ -370,7 +372,7 @@ namespace DOAN.Service.BZFM
|
||||
LocationName = mmLocation.LocationName,
|
||||
WarehouseCode = mmLocation.WarehouseCode,
|
||||
WarehouseName = mmLocation.WarehouseName,
|
||||
|
||||
|
||||
//TODO 待调整(可能涉及记录汇总)
|
||||
Quantity = -delta,
|
||||
Unit = parm.Unit,
|
||||
@@ -674,15 +676,95 @@ namespace DOAN.Service.BZFM
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
public PagedInfo<InboundReceiptDto> GetInOrOutRecord()
|
||||
public PagedInfo<MmInventoryRecordDto> GetInOrOutRecord(MmInventoryRecordQueryDto parm)
|
||||
{
|
||||
var predicate = QueryExp();
|
||||
PagedInfo<MmInventoryRecordDto> result = new PagedInfo<MmInventoryRecordDto>();
|
||||
// 处理日期
|
||||
if (parm.StartTime != null && parm.StartTime.Value > DateTime.MinValue)
|
||||
{
|
||||
parm.StartTime = DOANConvertDate.ConvertLocalDate(parm.StartTime.Value);
|
||||
}
|
||||
if (parm.EndTime != null && parm.EndTime.Value > DateTime.MinValue)
|
||||
{
|
||||
parm.EndTime = DOANConvertDate.ConvertLocalDate(parm.EndTime.Value);
|
||||
}
|
||||
// 查询入库记录
|
||||
if (parm.SearchType == 1)
|
||||
{
|
||||
result = Context
|
||||
.Queryable<MmRecordInbound>()
|
||||
.WhereIF(
|
||||
parm.StartTime.Value > DateTime.MinValue,
|
||||
it => it.CreatedTime >= parm.StartTime
|
||||
)
|
||||
.WhereIF(
|
||||
parm.EndTime.Value > DateTime.MinValue,
|
||||
it => it.CreatedTime <= parm.EndTime
|
||||
)
|
||||
.Where(parm.MaterialCode = parm.MaterialCode)
|
||||
.Where(parm.SupplierCode = parm.SupplierCode)
|
||||
.Where(parm.LocationCode = parm.LocationCode)
|
||||
.Where(parm.BatchNo = parm.BatchNo)
|
||||
.Select(it => new MmInventoryRecordDto()
|
||||
{
|
||||
Id = it.Id,
|
||||
InboundNo = it.InboundNo,
|
||||
MaterialCode = it.MaterialCode,
|
||||
MaterialName = it.MaterialName,
|
||||
SupplierCode = it.SupplierCode,
|
||||
SupplierName = it.SupplierName,
|
||||
LocationCode = it.LocationCode,
|
||||
LocationName = it.LocationName,
|
||||
WarehouseCode = it.WarehouseCode,
|
||||
WarehouseName = it.WarehouseName,
|
||||
BatchNo = it.BatchNo,
|
||||
Quantity = it.Quantity,
|
||||
TransactionType = it.TransactionType,
|
||||
Operator = it.Operator,
|
||||
CreatedTime = it.CreatedTime,
|
||||
Workorder = it.Workorder,
|
||||
StoveCode = it.StoveCode
|
||||
})
|
||||
.ToPage(parm);
|
||||
}
|
||||
// 查询出库记录
|
||||
else if (parm.SearchType == 2)
|
||||
{
|
||||
result = Context
|
||||
.Queryable<MmRecordOutbound>()
|
||||
.WhereIF(
|
||||
parm.StartTime.Value > DateTime.MinValue,
|
||||
it => it.CreatedTime >= parm.StartTime
|
||||
)
|
||||
.WhereIF(
|
||||
parm.EndTime.Value > DateTime.MinValue,
|
||||
it => it.CreatedTime <= parm.EndTime
|
||||
)
|
||||
.Where(parm.MaterialCode = parm.MaterialCode)
|
||||
.Where(parm.SupplierCode = parm.SupplierCode)
|
||||
.Where(parm.LocationCode = parm.LocationCode)
|
||||
.Where(parm.BatchNo = parm.BatchNo)
|
||||
.Select(it => new MmInventoryRecordDto()
|
||||
{
|
||||
Id = it.Id,
|
||||
OutboundNo = it.OutboundNo,
|
||||
MaterialCode = it.MaterialCode,
|
||||
MaterialName = it.MaterialName,
|
||||
LocationCode = it.LocationCode,
|
||||
LocationName = it.LocationName,
|
||||
WarehouseCode = it.WarehouseCode,
|
||||
WarehouseName = it.WarehouseName,
|
||||
BatchNo = it.BatchNo,
|
||||
Quantity = it.Quantity,
|
||||
TransactionType = it.TransactionType,
|
||||
Operator = it.Operator,
|
||||
CreatedTime = it.CreatedTime,
|
||||
Workorder = it.Workorder
|
||||
})
|
||||
.ToPage(parm);
|
||||
}
|
||||
|
||||
var response = Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
.ToPage(parm);
|
||||
|
||||
return response;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user