增加盘点模式
This commit is contained in:
66
WCS.WebApi/Controllers/InOutRecordController.cs
Normal file
66
WCS.WebApi/Controllers/InOutRecordController.cs
Normal file
@ -0,0 +1,66 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using MiniExcelLibs;
|
||||
using NPOI.SS.UserModel;
|
||||
using SqlSugar;
|
||||
using System.Xml.Linq;
|
||||
using WCS.BLL.DbModels;
|
||||
using WCS.BLL.Manager;
|
||||
using WCS.BLL.Services.IService;
|
||||
using WCS.BLL.Services.Service;
|
||||
using WCS.DAL.Db;
|
||||
using WCS.Model;
|
||||
using WCS.Model.ApiModel;
|
||||
using WCS.Model.ApiModel.InOutRecord;
|
||||
using WCS.Model.ApiModel.MatInventoryDetail;
|
||||
using WCS.WebApi.Helper;
|
||||
|
||||
namespace WCS.WebApi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 接口记录
|
||||
/// </summary>
|
||||
[ApiController]
|
||||
[Route("[controller]")]
|
||||
public class InOutRecordController : ControllerBase
|
||||
{
|
||||
public IInOutRecordService _inOutRecordService { get; set; }
|
||||
|
||||
public InOutRecordController(IInOutRecordService inOutRecordService)
|
||||
{
|
||||
_inOutRecordService = inOutRecordService;
|
||||
}
|
||||
|
||||
[Route("getInOutRecord")]
|
||||
[HttpPost(Name = "getInOutRecord")]
|
||||
public async Task<ResponseBase> getInOutRecord(GetInOutRecordRequest request)
|
||||
{
|
||||
return await _inOutRecordService.getInOutRecord(request);
|
||||
}
|
||||
|
||||
[HttpPost("exportInOutRecord")]
|
||||
public async Task<IActionResult> exportInOutRecord([FromBody] GetInOutRecordRequest request)
|
||||
{
|
||||
var result = await _inOutRecordService.exportInOutRecord(request);
|
||||
var data = result.Data?.Lists;
|
||||
var columns = new[]
|
||||
{
|
||||
new ExportableColumn("序号","RowNumber"),
|
||||
new ExportableColumn("物料编码","MatCode"),
|
||||
new ExportableColumn("物料名称","MatName"),
|
||||
new ExportableColumn("规格","MatSpec"),
|
||||
new ExportableColumn("批次","MatBatch"),
|
||||
new ExportableColumn("数量","MatQty"),
|
||||
new ExportableColumn("库位","StoreCode"),
|
||||
new ExportableColumn("入库时间","InstoreTime"),
|
||||
new ExportableColumn("物料SN", "MatSN"),
|
||||
};
|
||||
if (data == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
else
|
||||
return ExportExcelHelper.Export("导出数据", columns, data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -13,10 +13,12 @@ namespace WebApi.Controllers
|
||||
public class OutstoreController : ControllerBase
|
||||
{
|
||||
private readonly IOutstoreService _outstoreService;
|
||||
private readonly IGenerateService _generateService;
|
||||
|
||||
public OutstoreController(IOutstoreService outstoreService)
|
||||
public OutstoreController(IOutstoreService outstoreService,IGenerateService generateService)
|
||||
{
|
||||
_outstoreService = outstoreService;
|
||||
_generateService = generateService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -30,6 +32,10 @@ namespace WebApi.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(request.OrderNumber))
|
||||
{
|
||||
request.OrderNumber = await _generateService.generateOutOrderNumber();
|
||||
}
|
||||
return await _outstoreService.SysOutOrderByMatCode(request);
|
||||
}
|
||||
catch (Exception ex)
|
||||
@ -54,6 +60,10 @@ namespace WebApi.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(request.OrderNumber))
|
||||
{
|
||||
request.OrderNumber = await _generateService.generateOutOrderNumber();
|
||||
}
|
||||
return await _outstoreService.SysOutOrderByMatSn(request);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
@ -42,6 +42,13 @@ namespace WCS.WebApi.Controllers
|
||||
return await _stockTakingService.getStockTakingOrders(request);
|
||||
}
|
||||
|
||||
[Route("getStockTakingOrdersByStatus")]
|
||||
[HttpPost(Name = "getStockTakingOrdersByStatus")]
|
||||
public async Task<ResponseBase> getStockTakingOrdersByStatus(GetStockTakingOrdersRequest request)
|
||||
{
|
||||
return await _stockTakingService.getStockTakingOrdersByStatus(request);
|
||||
}
|
||||
|
||||
[Route("getStockTakingOrderMatDetail")]
|
||||
[HttpPost(Name = "getStockTakingOrderMatDetail")]
|
||||
public async Task<ResponseBase> getStockTakingOrderMatDetail(GetStockTakingOrderMatDetailRequest request)
|
||||
|
@ -7,6 +7,7 @@ using System.Net.Http;
|
||||
using System.Net.Sockets;
|
||||
using System.Text;
|
||||
using WCS.BLL.Config;
|
||||
using WCS.BLL.DbModels;
|
||||
using WCS.BLL.Manager;
|
||||
using WCS.BLL.Services.IService;
|
||||
using WCS.BLL.Services.Service;
|
||||
@ -54,6 +55,7 @@ namespace WebApi
|
||||
builder.Services.AddScoped<IStockTakingService, StockTakingService>();
|
||||
builder.Services.AddScoped<ISelfCheckService, SelfCheckService>();
|
||||
builder.Services.AddScoped<IWarningService, WarningService>();
|
||||
builder.Services.AddScoped<IInOutRecordService, InOutRecordService>();
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>롢<EFBFBD><EBA1A2><EFBFBD>ɵ<EFBFBD><C9B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD><C3B5><EFBFBD>ģʽ
|
||||
builder.Services.AddSingleton<IGenerateService, GenerateService>();
|
||||
|
||||
|
Reference in New Issue
Block a user