获取出入库记录数据功能接口添加
This commit is contained in:
@@ -61,7 +61,7 @@ namespace DOAN.Admin.WebApi.Controllers.BZFM
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ActionPermissionFilter(Permission = "mminventory:add")]
|
||||
[Log(Title = "库存表", BusinessType = BusinessType.INSERT)]
|
||||
[Log(Title = "添加库存表", BusinessType = BusinessType.INSERT)]
|
||||
public IActionResult AddMmInventory([FromBody] MmInventoryDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<MmInventory>().ToCreate(HttpContext);
|
||||
@@ -77,7 +77,7 @@ namespace DOAN.Admin.WebApi.Controllers.BZFM
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
[ActionPermissionFilter(Permission = "mminventory:edit")]
|
||||
[Log(Title = "库存表", BusinessType = BusinessType.UPDATE)]
|
||||
[Log(Title = "更新库存", BusinessType = BusinessType.UPDATE)]
|
||||
public IActionResult UpdateMmInventory([FromBody] MmInventoryDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<MmInventory>().ToUpdate(HttpContext);
|
||||
@@ -92,7 +92,7 @@ namespace DOAN.Admin.WebApi.Controllers.BZFM
|
||||
/// <returns></returns>
|
||||
[HttpPost("delete/{ids}")]
|
||||
[ActionPermissionFilter(Permission = "mminventory:delete")]
|
||||
[Log(Title = "库存表", BusinessType = BusinessType.DELETE)]
|
||||
[Log(Title = "删除库存", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult DeleteMmInventory([FromRoute]string ids)
|
||||
{
|
||||
var idArr = Tools.SplitAndConvert<int>(ids);
|
||||
@@ -250,7 +250,7 @@ namespace DOAN.Admin.WebApi.Controllers.BZFM
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost("GetInOrOutRecord")]
|
||||
public IActionResult GetInOrOutRecord(MmInventoryRecordDto parm)
|
||||
public IActionResult GetInOrOutRecord(MmInventoryRecordQueryDto parm)
|
||||
{
|
||||
var response = _MmInventoryService.GetInOrOutRecord(parm);
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ namespace DOAN.Model.BZFM.Dto
|
||||
/// <summary>
|
||||
/// 库存清单查询进出库记录对象
|
||||
/// </summary>
|
||||
public class MmInventoryRecordDto : PagerInfo
|
||||
public class MmInventoryRecordQueryDto : PagerInfo
|
||||
{
|
||||
public string MaterialCode { get; set; }
|
||||
|
||||
@@ -118,5 +118,99 @@ namespace DOAN.Model.BZFM.Dto
|
||||
public string SupplierCode { get; set; }
|
||||
|
||||
public string BatchNo { get; set; }
|
||||
|
||||
public int SearchType { get; set; }
|
||||
|
||||
public DateTime? StartTime { get; set; }
|
||||
public DateTime? EndTime { get; set; }
|
||||
}
|
||||
public class MmInventoryRecordDto : PagerInfo
|
||||
{
|
||||
[ExcelColumn(Name = "id")]
|
||||
[SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
|
||||
public int Id { get; set; }
|
||||
|
||||
[ExcelColumn(Name = "入库单号")]
|
||||
[SugarColumn(ColumnName = "inbound_no")]
|
||||
public string InboundNo { get; set; }
|
||||
|
||||
[ExcelColumn(Name = "出库单号")]
|
||||
[SugarColumn(ColumnName = "outbound_no")]
|
||||
public string OutboundNo { get; set; }
|
||||
|
||||
[ExcelColumn(Name = "物料编码")]
|
||||
[SugarColumn(ColumnName = "material_code")]
|
||||
public string MaterialCode { get; set; }
|
||||
|
||||
[ExcelColumn(Name = "物料名称")]
|
||||
[SugarColumn(ColumnName = "material_name")]
|
||||
public string MaterialName { get; set; }
|
||||
|
||||
[ExcelColumn(Name = "批次号")]
|
||||
[SugarColumn(ColumnName = "batch_no")]
|
||||
public string BatchNo { get; set; }
|
||||
|
||||
[ExcelColumn(Name = "仓库编码")]
|
||||
[SugarColumn(ColumnName = "warehouse_code")]
|
||||
public string WarehouseCode { get; set; }
|
||||
|
||||
[ExcelColumn(Name = "仓库名称")]
|
||||
[SugarColumn(ColumnName = "warehouse_name")]
|
||||
public string WarehouseName { get; set; }
|
||||
|
||||
[ExcelColumn(Name = "库位编码")]
|
||||
[SugarColumn(ColumnName = "location_code")]
|
||||
public string LocationCode { get; set; }
|
||||
|
||||
[ExcelColumn(Name = "库位名称")]
|
||||
[SugarColumn(ColumnName = "location_name")]
|
||||
public string LocationName { get; set; }
|
||||
|
||||
[ExcelColumn(Name = "供应商编码")]
|
||||
[SugarColumn(ColumnName = "supplier_Code")]
|
||||
public string SupplierCode { get; set; }
|
||||
|
||||
[ExcelColumn(Name = "供应商名称")]
|
||||
[SugarColumn(ColumnName = "supplier_Name")]
|
||||
public string SupplierName { get; set; }
|
||||
|
||||
[ExcelColumn(Name = "数量")]
|
||||
[SugarColumn(ColumnName = "quantity")]
|
||||
public decimal Quantity { get; set; }
|
||||
|
||||
[ExcelColumn(Name = "操作类型")]
|
||||
[SugarColumn(ColumnName = "transaction_Type")]
|
||||
public string TransactionType { get; set; }
|
||||
|
||||
[ExcelColumn(Name = "操作员")]
|
||||
[SugarColumn(ColumnName = "operator")]
|
||||
public string Operator { get; set; }
|
||||
|
||||
[ExcelColumn(Name = "创建时间")]
|
||||
[SugarColumn(ColumnName = "created_time")]
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 炉号
|
||||
/// </summary>
|
||||
[ExcelColumn(Name = "炉号")]
|
||||
[SugarColumn(ColumnName = "stove_code")]
|
||||
public string StoveCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 关联订单号
|
||||
/// </summary>
|
||||
[ExcelColumn(Name = "关联订单号")]
|
||||
[SugarColumn(ColumnName = "order_no")]
|
||||
public string OrderNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工单号(一旦确定,不可更改)
|
||||
/// </summary>
|
||||
[ExcelColumn(Name = "工单号")]
|
||||
[SugarColumn(ColumnName = "workorder")]
|
||||
public string Workorder { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,7 @@ namespace DOAN.Service.BZFM.IBZFMService
|
||||
/// <summary>
|
||||
/// 获取出/入库记录
|
||||
/// </summary>
|
||||
PagedInfo<InboundReceiptDto> GetInOrOutRecord(MmInventoryRecordDto parm);
|
||||
PagedInfo<MmInventoryRecordDto> GetInOrOutRecord(MmInventoryRecordQueryDto parm);
|
||||
|
||||
/// <summary>
|
||||
/// 创建入库单 成功返回ok ReceiptType = 1蓝单 ReceiptType = 2 红单(逆向)
|
||||
|
||||
@@ -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;
|
||||
@@ -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