导出列表
This commit is contained in:
69
src/WMS.Web.Api/Controllers/FileDownManagerController.cs
Normal file
69
src/WMS.Web.Api/Controllers/FileDownManagerController.cs
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using WMS.Web.Core;
|
||||||
|
using WMS.Web.Core.Dto;
|
||||||
|
using WMS.Web.Core.Internal.Results;
|
||||||
|
using WMS.Web.Domain.Infrastructure;
|
||||||
|
using WMS.Web.Domain.IService.Public;
|
||||||
|
using WMS.Web.Domain.Values;
|
||||||
|
|
||||||
|
namespace WMS.Web.Api.Controllers
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 上传下载中心
|
||||||
|
/// </summary>
|
||||||
|
[Route("api/[controller]")]
|
||||||
|
[ApiController]
|
||||||
|
public class FileDownManagerController : ControllerBase
|
||||||
|
{
|
||||||
|
private readonly ILoginService _loginService;
|
||||||
|
private readonly IFileDownManagerRepositories _repositories;
|
||||||
|
public FileDownManagerController(ILoginService loginService, IFileDownManagerRepositories repositories)
|
||||||
|
{
|
||||||
|
_loginService = loginService;
|
||||||
|
_repositories = repositories;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取需要的状态列表
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
[Route("GetStatus")]
|
||||||
|
public Task<Result<FileDownManagerStatusResponse>> GetStatus()
|
||||||
|
{
|
||||||
|
FileDownManagerStatusResponse response = new FileDownManagerStatusResponse();
|
||||||
|
foreach (FileDownLoadOrderType enumv in Enum.GetValues(typeof(FileDownLoadOrderType)))
|
||||||
|
{
|
||||||
|
response.Type.Add((int)enumv, enumv.GetRemark());
|
||||||
|
}
|
||||||
|
foreach (ExportStatus enumv in Enum.GetValues(typeof(ExportStatus)))
|
||||||
|
{
|
||||||
|
response.Status.Add((int)enumv, enumv.GetRemark());
|
||||||
|
}
|
||||||
|
return Task.FromResult(Result<FileDownManagerStatusResponse>.ReSuccess(response));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[Route("FileDownManagerQuery")]
|
||||||
|
public async Task<Result<FileDownManagerResponse>> FileDownManagerQuery(FileDownManagerRequest dto)
|
||||||
|
{
|
||||||
|
var loginInfo = _loginService.GetLoginInfo(this.HttpContext.Request.Headers["Authorization"]);
|
||||||
|
if (loginInfo == null)
|
||||||
|
return Result<FileDownManagerResponse>.ReFailure(ResultCodes.Token_Invalid_Error);
|
||||||
|
dto.SupplierId = loginInfo.UserInfo.SupplierId;
|
||||||
|
|
||||||
|
var result = await _repositories.GetList(dto, loginInfo.UserInfo.CompanyId);
|
||||||
|
return Result<FileDownManagerResponse>.ReSuccess(result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -90,7 +90,14 @@ namespace WMS.Web.Api.Controllers
|
|||||||
{
|
{
|
||||||
response.ShelfMethod.Add((int)enumv, enumv.GetRemark());
|
response.ShelfMethod.Add((int)enumv, enumv.GetRemark());
|
||||||
}
|
}
|
||||||
|
foreach (FileDownLoadOrderType enumv in Enum.GetValues(typeof(OrderType)))
|
||||||
|
{
|
||||||
|
response.FileDownLoadOrderType.Add((int)enumv, enumv.GetRemark());
|
||||||
|
}
|
||||||
|
foreach (ExportStatus enumv in Enum.GetValues(typeof(ExportStatus)))
|
||||||
|
{
|
||||||
|
response.ExportStatus.Add((int)enumv, enumv.GetRemark());
|
||||||
|
}
|
||||||
//2
|
//2
|
||||||
//1
|
//1
|
||||||
return Task.FromResult(Result<EnumStatusResponse>.ReSuccess(response));
|
return Task.FromResult(Result<EnumStatusResponse>.ReSuccess(response));
|
||||||
|
|||||||
@@ -49,6 +49,24 @@
|
|||||||
<param name="dto"></param>
|
<param name="dto"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:WMS.Web.Api.Controllers.FileDownManagerController">
|
||||||
|
<summary>
|
||||||
|
上传下载中心
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:WMS.Web.Api.Controllers.FileDownManagerController.GetStatus">
|
||||||
|
<summary>
|
||||||
|
获取需要的状态列表
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:WMS.Web.Api.Controllers.FileDownManagerController.FileDownManagerQuery(WMS.Web.Core.Dto.FileDownManagerRequest)">
|
||||||
|
<summary>
|
||||||
|
列表
|
||||||
|
</summary>
|
||||||
|
<param name="dto"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="T:WMS.Web.Api.Controllers.InStockController">
|
<member name="T:WMS.Web.Api.Controllers.InStockController">
|
||||||
<summary>
|
<summary>
|
||||||
入库单-接口
|
入库单-接口
|
||||||
|
|||||||
@@ -272,7 +272,7 @@
|
|||||||
</member>
|
</member>
|
||||||
<member name="P:WMS.Web.Core.Dto.BoxResponse.Id">
|
<member name="P:WMS.Web.Core.Dto.BoxResponse.Id">
|
||||||
<summary>
|
<summary>
|
||||||
单据头ID
|
箱ID
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:WMS.Web.Core.Dto.BoxResponse.SupplierId">
|
<member name="P:WMS.Web.Core.Dto.BoxResponse.SupplierId">
|
||||||
@@ -480,6 +480,16 @@
|
|||||||
非采购上架方式
|
非采购上架方式
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.EnumStatusResponse.FileDownLoadOrderType">
|
||||||
|
<summary>
|
||||||
|
下载导出订单类型
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.EnumStatusResponse.ExportStatus">
|
||||||
|
<summary>
|
||||||
|
下载导出状态
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:WMS.Web.Core.Dto.Erp.Customer.ErpCustomerDto">
|
<member name="T:WMS.Web.Core.Dto.Erp.Customer.ErpCustomerDto">
|
||||||
<summary>
|
<summary>
|
||||||
客户
|
客户
|
||||||
@@ -1045,6 +1055,111 @@
|
|||||||
备注
|
备注
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:WMS.Web.Core.Dto.FileDownManagerRequest">
|
||||||
|
<summary>
|
||||||
|
上传下载列表
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.FileDownManagerRequest.Type">
|
||||||
|
<summary>
|
||||||
|
单据类型(任务类型)
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.FileDownManagerRequest.Status">
|
||||||
|
<summary>
|
||||||
|
状态
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.FileDownManagerRequest.BeginDate">
|
||||||
|
<summary>
|
||||||
|
下单时间 开始
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.FileDownManagerRequest.EndDate">
|
||||||
|
<summary>
|
||||||
|
下单时间 结束
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.FileDownManagerRequest.User">
|
||||||
|
<summary>
|
||||||
|
操作人
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.FileDownManagerRequest.SupplierId">
|
||||||
|
<summary>
|
||||||
|
供应商用户Id
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="T:WMS.Web.Core.Dto.FileDownManagerResponse">
|
||||||
|
<summary>
|
||||||
|
上传下载列表
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.FileDownManagerResponse.List">
|
||||||
|
<summary>
|
||||||
|
查询列表内容
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.FileDownManagerResponse.Total">
|
||||||
|
<summary>
|
||||||
|
总条数
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="T:WMS.Web.Core.Dto.FileDownInfoManagerResponse">
|
||||||
|
<summary>
|
||||||
|
上传下载列表
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.FileDownInfoManagerResponse.Id">
|
||||||
|
<summary>
|
||||||
|
主键 订单编号
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.FileDownInfoManagerResponse.Date">
|
||||||
|
<summary>
|
||||||
|
日期
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.FileDownInfoManagerResponse.Type">
|
||||||
|
<summary>
|
||||||
|
单据类型(任务类型)
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.FileDownInfoManagerResponse.StatusKey">
|
||||||
|
<summary>
|
||||||
|
状态(Key)
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.FileDownInfoManagerResponse.Status">
|
||||||
|
<summary>
|
||||||
|
状态
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.FileDownInfoManagerResponse.FilePath">
|
||||||
|
<summary>
|
||||||
|
文件地址
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.FileDownInfoManagerResponse.UserName">
|
||||||
|
<summary>
|
||||||
|
操作人
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.FileDownInfoManagerResponse.Reason">
|
||||||
|
<summary>
|
||||||
|
失败原因
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.FileDownManagerStatusResponse.Type">
|
||||||
|
<summary>
|
||||||
|
任务类型
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.FileDownManagerStatusResponse.Status">
|
||||||
|
<summary>
|
||||||
|
状态
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:WMS.Web.Core.Dto.InStockTask.ContrastMaterialsRequest">
|
<member name="T:WMS.Web.Core.Dto.InStockTask.ContrastMaterialsRequest">
|
||||||
<summary>
|
<summary>
|
||||||
采购订单物料明细和箱物料明细-对比请求对象
|
采购订单物料明细和箱物料明细-对比请求对象
|
||||||
|
|||||||
@@ -311,6 +311,56 @@
|
|||||||
最新一次同步时间
|
最新一次同步时间
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:WMS.Web.Domain.Entitys.FileDownManager">
|
||||||
|
<summary>
|
||||||
|
文件下载类型
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Domain.Entitys.FileDownManager.Id">
|
||||||
|
<summary>
|
||||||
|
主键 订单编号
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Domain.Entitys.FileDownManager.Date">
|
||||||
|
<summary>
|
||||||
|
日期
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Domain.Entitys.FileDownManager.Type">
|
||||||
|
<summary>
|
||||||
|
单据类型(任务类型)
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Domain.Entitys.FileDownManager.Status">
|
||||||
|
<summary>
|
||||||
|
状态
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Domain.Entitys.FileDownManager.CompanyId">
|
||||||
|
<summary>
|
||||||
|
公司Id
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Domain.Entitys.FileDownManager.FilePath">
|
||||||
|
<summary>
|
||||||
|
文件地址
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Domain.Entitys.FileDownManager.UserId">
|
||||||
|
<summary>
|
||||||
|
操作人
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Domain.Entitys.FileDownManager.Reason">
|
||||||
|
<summary>
|
||||||
|
失败原因
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Domain.Entitys.FileDownManager.SupplierId">
|
||||||
|
<summary>
|
||||||
|
是否供应商用户
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:WMS.Web.Domain.Entitys.InStock">
|
<member name="T:WMS.Web.Domain.Entitys.InStock">
|
||||||
<summary>
|
<summary>
|
||||||
wms入库单
|
wms入库单
|
||||||
@@ -1461,6 +1511,26 @@
|
|||||||
定时任务最新一次时间管理
|
定时任务最新一次时间管理
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:WMS.Web.Domain.Infrastructure.IFileDownManagerRepositories.Add(WMS.Web.Domain.Entitys.FileDownManager)">
|
||||||
|
<summary>
|
||||||
|
保存
|
||||||
|
</summary>
|
||||||
|
<param name="entity"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:WMS.Web.Domain.Infrastructure.IFileDownManagerRepositories.Edit(WMS.Web.Domain.Entitys.FileDownManager)">
|
||||||
|
<summary>
|
||||||
|
编辑
|
||||||
|
</summary>
|
||||||
|
<param name="entity"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:WMS.Web.Domain.Infrastructure.IFileDownManagerRepositories.GetList(WMS.Web.Core.Dto.FileDownManagerRequest,System.Int32)">
|
||||||
|
<summary>
|
||||||
|
获取销售列表
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="T:WMS.Web.Domain.Infrastructure.IInStockRepositories">
|
<member name="T:WMS.Web.Domain.Infrastructure.IInStockRepositories">
|
||||||
<summary>
|
<summary>
|
||||||
wms入库单-仓储接口
|
wms入库单-仓储接口
|
||||||
@@ -3777,6 +3847,36 @@
|
|||||||
客户
|
客户
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:WMS.Web.Domain.Values.ExportStatus">
|
||||||
|
<summary>
|
||||||
|
文件导出状态
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:WMS.Web.Domain.Values.ExportStatus.Ing">
|
||||||
|
<summary>
|
||||||
|
正在导出
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:WMS.Web.Domain.Values.ExportStatus.Success">
|
||||||
|
<summary>
|
||||||
|
导出成功
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:WMS.Web.Domain.Values.ExportStatus.Fail">
|
||||||
|
<summary>
|
||||||
|
导出失败
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="T:WMS.Web.Domain.Values.FileDownLoadOrderType">
|
||||||
|
<summary>
|
||||||
|
导出单据类型
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:WMS.Web.Domain.Values.FileDownLoadOrderType.OutStockTask">
|
||||||
|
<summary>
|
||||||
|
出库任务单
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:WMS.Web.Domain.Values.InstockStatus">
|
<member name="T:WMS.Web.Domain.Values.InstockStatus">
|
||||||
<summary>
|
<summary>
|
||||||
入库状态
|
入库状态
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ namespace WMS.Web.Core.Dto
|
|||||||
public class BoxResponse
|
public class BoxResponse
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 单据头ID
|
/// 箱ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -46,7 +46,14 @@ namespace WMS.Web.Core.Dto
|
|||||||
/// 非采购上架方式
|
/// 非采购上架方式
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Dictionary<int, string> ShelfMethod { get; set; } = new Dictionary<int, string>();
|
public Dictionary<int, string> ShelfMethod { get; set; } = new Dictionary<int, string>();
|
||||||
|
/// <summary>
|
||||||
|
/// 下载导出订单类型
|
||||||
|
/// </summary>
|
||||||
|
public Dictionary<int, string> FileDownLoadOrderType { get; set; } = new Dictionary<int, string>();
|
||||||
|
/// <summary>
|
||||||
|
/// 下载导出状态
|
||||||
|
/// </summary>
|
||||||
|
public Dictionary<int, string> ExportStatus { get; set; } = new Dictionary<int, string>();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
37
src/WMS.Web.Core/Dto/FileDownManagerRequest.cs
Normal file
37
src/WMS.Web.Core/Dto/FileDownManagerRequest.cs
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace WMS.Web.Core.Dto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 上传下载列表
|
||||||
|
/// </summary>
|
||||||
|
public class FileDownManagerRequest: PaginationBaseRequestDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 单据类型(任务类型)
|
||||||
|
/// </summary>
|
||||||
|
public int? Type { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 状态
|
||||||
|
/// </summary>
|
||||||
|
public int? Status { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 下单时间 开始
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? BeginDate { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 下单时间 结束
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? EndDate { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 操作人
|
||||||
|
/// </summary>
|
||||||
|
public string User { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 供应商用户Id
|
||||||
|
/// </summary>
|
||||||
|
public int? SupplierId { get; set; } = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
73
src/WMS.Web.Core/Dto/FileDownManagerResponse.cs
Normal file
73
src/WMS.Web.Core/Dto/FileDownManagerResponse.cs
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
using WMS.Web.Core.Help;
|
||||||
|
|
||||||
|
namespace WMS.Web.Core.Dto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 上传下载列表
|
||||||
|
/// </summary>
|
||||||
|
public class FileDownManagerResponse
|
||||||
|
{
|
||||||
|
public FileDownManagerResponse(List<FileDownInfoManagerResponse> list, int? total)
|
||||||
|
{
|
||||||
|
this.List = list;
|
||||||
|
this.Total = total;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查询列表内容
|
||||||
|
/// </summary>
|
||||||
|
public List<FileDownInfoManagerResponse> List { get; set; } = new List<FileDownInfoManagerResponse>();
|
||||||
|
/// <summary>
|
||||||
|
/// 总条数
|
||||||
|
/// </summary>
|
||||||
|
public int? Total { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 上传下载列表
|
||||||
|
/// </summary>
|
||||||
|
public class FileDownInfoManagerResponse
|
||||||
|
{
|
||||||
|
public FileDownInfoManagerResponse() { }
|
||||||
|
public FileDownInfoManagerResponse(FileDownInfoManagerResponse response)
|
||||||
|
{
|
||||||
|
response.CopyPropertiesToD(this);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 主键 订单编号
|
||||||
|
/// </summary>
|
||||||
|
public int Id { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 日期
|
||||||
|
/// </summary>
|
||||||
|
public string Date { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 单据类型(任务类型)
|
||||||
|
/// </summary>
|
||||||
|
public int Type { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 状态(Key)
|
||||||
|
/// </summary>
|
||||||
|
public int StatusKey { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 状态
|
||||||
|
/// </summary>
|
||||||
|
public string Status { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 文件地址
|
||||||
|
/// </summary>
|
||||||
|
public string FilePath { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 操作人
|
||||||
|
/// </summary>
|
||||||
|
public string UserName { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 失败原因
|
||||||
|
/// </summary>
|
||||||
|
public string Reason { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
19
src/WMS.Web.Core/Dto/FileDownManagerStatusResponse.cs
Normal file
19
src/WMS.Web.Core/Dto/FileDownManagerStatusResponse.cs
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace WMS.Web.Core.Dto
|
||||||
|
{
|
||||||
|
public class FileDownManagerStatusResponse
|
||||||
|
{
|
||||||
|
public FileDownManagerStatusResponse() { }
|
||||||
|
/// <summary>
|
||||||
|
/// 任务类型
|
||||||
|
/// </summary>
|
||||||
|
public Dictionary<int, string> Type { get; set; } = new Dictionary<int, string>();
|
||||||
|
/// <summary>
|
||||||
|
/// 状态
|
||||||
|
/// </summary>
|
||||||
|
public Dictionary<int, string> Status { get; set; } = new Dictionary<int, string>();
|
||||||
|
}
|
||||||
|
}
|
||||||
84
src/WMS.Web.Domain/Entitys/FileDownManager.cs
Normal file
84
src/WMS.Web.Domain/Entitys/FileDownManager.cs
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.Text;
|
||||||
|
using WMS.Web.Core;
|
||||||
|
using WMS.Web.Domain.Values;
|
||||||
|
|
||||||
|
namespace WMS.Web.Domain.Entitys
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 文件下载类型
|
||||||
|
/// </summary>
|
||||||
|
[Serializable]
|
||||||
|
[Table("t_wms_file_down_manager")]
|
||||||
|
public class FileDownManager : EntityBase
|
||||||
|
{
|
||||||
|
public FileDownManager() { }
|
||||||
|
public FileDownManager(int userId, int companyId, FileDownLoadOrderType type, string path, int? supplierId = null)
|
||||||
|
{
|
||||||
|
this.UserId = userId;
|
||||||
|
this.CompanyId = companyId;
|
||||||
|
this.Type = type;
|
||||||
|
this.FilePath = path;
|
||||||
|
this.SupplierId = supplierId;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 主键 订单编号
|
||||||
|
/// </summary>
|
||||||
|
[Column("Id")]
|
||||||
|
public override int Id { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 日期
|
||||||
|
/// </summary>
|
||||||
|
[Column("Date")]
|
||||||
|
public DateTime? Date { get; set; } = DateTime.Now;
|
||||||
|
/// <summary>
|
||||||
|
/// 单据类型(任务类型)
|
||||||
|
/// </summary>
|
||||||
|
[Column("Type")]
|
||||||
|
public FileDownLoadOrderType Type { get; set; } = FileDownLoadOrderType.OutStockTask;
|
||||||
|
/// <summary>
|
||||||
|
/// 状态
|
||||||
|
/// </summary>
|
||||||
|
[Column("Status")]
|
||||||
|
public ExportStatus Status { get; set; } = ExportStatus.Ing;
|
||||||
|
/// <summary>
|
||||||
|
/// 公司Id
|
||||||
|
/// </summary>
|
||||||
|
[Column("CompanyId")]
|
||||||
|
public int CompanyId { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 文件地址
|
||||||
|
/// </summary>
|
||||||
|
[Column("FilePath")]
|
||||||
|
public string FilePath { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 操作人
|
||||||
|
/// </summary>
|
||||||
|
[Column("UserId")]
|
||||||
|
public int UserId { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 失败原因
|
||||||
|
/// </summary>
|
||||||
|
[Column("Reason")]
|
||||||
|
public string Reason { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 是否供应商用户
|
||||||
|
/// </summary>
|
||||||
|
[Column("SupplierId")]
|
||||||
|
public int? SupplierId { get; set; }
|
||||||
|
|
||||||
|
public void Finish(bool IsSuccess, string reson)
|
||||||
|
{
|
||||||
|
if (IsSuccess)
|
||||||
|
this.Status = ExportStatus.Success;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.Status = ExportStatus.Fail;
|
||||||
|
this.Reason = reson;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using WMS.Web.Core.Dto;
|
||||||
|
using WMS.Web.Domain.Entitys;
|
||||||
|
|
||||||
|
namespace WMS.Web.Domain.Infrastructure
|
||||||
|
{
|
||||||
|
public interface IFileDownManagerRepositories
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 保存
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<FileDownManager> Add(FileDownManager entity);
|
||||||
|
/// <summary>
|
||||||
|
/// 编辑
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entity"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<FileDownManager> Edit(FileDownManager entity);
|
||||||
|
/// <summary>
|
||||||
|
/// 获取销售列表
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<FileDownManagerResponse> GetList(FileDownManagerRequest dto,int companyId);
|
||||||
|
}
|
||||||
|
}
|
||||||
30
src/WMS.Web.Domain/Values/ExportStatus.cs
Normal file
30
src/WMS.Web.Domain/Values/ExportStatus.cs
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
using WMS.Web.Core;
|
||||||
|
|
||||||
|
namespace WMS.Web.Domain.Values
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 文件导出状态
|
||||||
|
/// </summary>
|
||||||
|
public enum ExportStatus
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 正在导出
|
||||||
|
/// </summary>
|
||||||
|
[EnumRemark("正在导出")]
|
||||||
|
Ing = 0,
|
||||||
|
/// <summary>
|
||||||
|
/// 导出成功
|
||||||
|
/// </summary>
|
||||||
|
[EnumRemark("导出成功")]
|
||||||
|
Success = 1,
|
||||||
|
/// <summary>
|
||||||
|
/// 导出失败
|
||||||
|
/// </summary>
|
||||||
|
[EnumRemark("导出失败")]
|
||||||
|
Fail = 2
|
||||||
|
}
|
||||||
|
}
|
||||||
19
src/WMS.Web.Domain/Values/FileDownLoadOrderType.cs
Normal file
19
src/WMS.Web.Domain/Values/FileDownLoadOrderType.cs
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
using WMS.Web.Core;
|
||||||
|
|
||||||
|
namespace WMS.Web.Domain.Values
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 导出单据类型
|
||||||
|
/// </summary>
|
||||||
|
public enum FileDownLoadOrderType
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 出库任务单
|
||||||
|
/// </summary>
|
||||||
|
[EnumRemark("出库任务单")]
|
||||||
|
OutStockTask = 1,
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -68,6 +68,11 @@ namespace WMS.Web.Repositories.Configuration
|
|||||||
ent.ToTable("t_wms_sync_date");
|
ent.ToTable("t_wms_sync_date");
|
||||||
ent.HasKey(x => x.Id);
|
ent.HasKey(x => x.Id);
|
||||||
});
|
});
|
||||||
|
builder.Entity<FileDownManager>(ent =>
|
||||||
|
{
|
||||||
|
ent.ToTable("t_wms_file_down_manager");
|
||||||
|
ent.HasKey(x => x.Id);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
#region 出库单
|
#region 出库单
|
||||||
@@ -253,6 +258,7 @@ namespace WMS.Web.Repositories.Configuration
|
|||||||
base.OnModelCreating(builder);
|
base.OnModelCreating(builder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DbSet<FileDownManager> FileDownManager { get; set; }
|
||||||
public DbSet<SerialNumbers> SerialNumbers { get; set; }
|
public DbSet<SerialNumbers> SerialNumbers { get; set; }
|
||||||
public DbSet<ErpOpsSyncDate> ErpOpsSyncDate { get; set; }
|
public DbSet<ErpOpsSyncDate> ErpOpsSyncDate { get; set; }
|
||||||
public DbSet<SerialNumberOperate> SerialNumberOperate { get; set; }
|
public DbSet<SerialNumberOperate> SerialNumberOperate { get; set; }
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ namespace Microsoft.Extensions.DependencyInjection
|
|||||||
services.AddTransient<IInventoryDetailsRepositories, InventoryDetailsRepositories>();
|
services.AddTransient<IInventoryDetailsRepositories, InventoryDetailsRepositories>();
|
||||||
services.AddTransient<IInventoryInOutDetailsRepositories, InventoryInOutDetailsRepositories>();
|
services.AddTransient<IInventoryInOutDetailsRepositories, InventoryInOutDetailsRepositories>();
|
||||||
services.AddTransient<IBoxInventoryRepositories, BoxInventoryRepositories>();
|
services.AddTransient<IBoxInventoryRepositories, BoxInventoryRepositories>();
|
||||||
|
services.AddTransient<IFileDownManagerRepositories, FileDownManagerRepositories>();
|
||||||
|
|
||||||
services.AddTransient<ISerialNumbersRepositories, SerialNumbersRepositories>();
|
services.AddTransient<ISerialNumbersRepositories, SerialNumbersRepositories>();
|
||||||
services.AddTransient<ISerialNumberOperateRepositories, SerialNumberOperateRepositories>();
|
services.AddTransient<ISerialNumberOperateRepositories, SerialNumberOperateRepositories>();
|
||||||
|
|||||||
103
src/WMS.Web.Repositories/FileDownManagerRepositories.cs
Normal file
103
src/WMS.Web.Repositories/FileDownManagerRepositories.cs
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
using AutoMapper;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using WMS.Web.Core;
|
||||||
|
using WMS.Web.Core.Dto;
|
||||||
|
using WMS.Web.Domain.Entitys;
|
||||||
|
using WMS.Web.Domain.Infrastructure;
|
||||||
|
using WMS.Web.Domain.IService.Public;
|
||||||
|
using WMS.Web.Domain.Values;
|
||||||
|
using WMS.Web.Domain.Values.Single;
|
||||||
|
using WMS.Web.Repositories.Configuration;
|
||||||
|
|
||||||
|
namespace WMS.Web.Repositories
|
||||||
|
{
|
||||||
|
public class FileDownManagerRepositories : IFileDownManagerRepositories
|
||||||
|
{
|
||||||
|
private readonly IMapper _mapper;
|
||||||
|
private readonly RepositoryDbContext _context;
|
||||||
|
private readonly ISingleDataService _singleDataService;
|
||||||
|
public FileDownManagerRepositories(RepositoryDbContext context, IMapper mapper, ISingleDataService singleDataService)
|
||||||
|
{
|
||||||
|
_mapper = mapper;
|
||||||
|
_context = context;
|
||||||
|
_singleDataService = singleDataService;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<FileDownManager> Add(FileDownManager entity)
|
||||||
|
{
|
||||||
|
await _context.FileDownManager.AddAsync(entity);
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
|
||||||
|
return entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<FileDownManager> Edit(FileDownManager entity)
|
||||||
|
{
|
||||||
|
var res = await _context.FileDownManager
|
||||||
|
.FirstOrDefaultAsync(f => f.Id == entity.Id);
|
||||||
|
if (res == null) return null;
|
||||||
|
|
||||||
|
_mapper.Map(entity, res);
|
||||||
|
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<FileDownManagerResponse> GetList(FileDownManagerRequest dto, int companyId)
|
||||||
|
{
|
||||||
|
List<int> userIds = new List<int>();
|
||||||
|
if (!string.IsNullOrEmpty(dto.User))
|
||||||
|
userIds = _singleDataService.GetIdsBySingleName(SingleAction.Staffs, companyId, dto.User);
|
||||||
|
|
||||||
|
var res = _context.FileDownManager
|
||||||
|
//.GroupJoin(_context.UcStaff, manager => manager.UserId, user => user.Id, (manager, user) => new { manager, user })
|
||||||
|
// .SelectMany(x => x.user.DefaultIfEmpty(), (d, user) => new { d.manager, user })
|
||||||
|
.OrderByDescending(o => o.Date)
|
||||||
|
.Where(w => w.CompanyId == companyId);
|
||||||
|
|
||||||
|
|
||||||
|
#region 条件
|
||||||
|
if (!string.IsNullOrEmpty(dto.User))
|
||||||
|
res = res.Where(w => userIds.Contains(w.UserId));
|
||||||
|
if (dto.BeginDate != null)
|
||||||
|
res = res.Where(w => w.Date >= dto.BeginDate);
|
||||||
|
if (dto.EndDate != null)
|
||||||
|
res = res.Where(w => w.Date <= (dto.EndDate ?? DateTime.Now).AddHours(23).AddMinutes(59).AddSeconds(59));
|
||||||
|
if (dto.Type != null)
|
||||||
|
res = res.Where(w => w.Type == (FileDownLoadOrderType)dto.Type);
|
||||||
|
|
||||||
|
if (dto.SupplierId != null)
|
||||||
|
res = res.Where(w => w.SupplierId == dto.SupplierId);
|
||||||
|
|
||||||
|
if (dto.Status != null)
|
||||||
|
{
|
||||||
|
if ((ExportStatus)dto.Status == ExportStatus.Ing)
|
||||||
|
res = res.Where(w => w.Status == ExportStatus.Ing && w.Date >= DateTime.Now.AddHours(-1));
|
||||||
|
else if ((ExportStatus)dto.Status == ExportStatus.Fail)
|
||||||
|
res = res.Where(w => (w.Status == ExportStatus.Fail) || (w.Status == ExportStatus.Ing && w.Date < DateTime.Now.AddHours(-1)));
|
||||||
|
else
|
||||||
|
res = res.Where(w => w.Status == (ExportStatus)dto.Status);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
int total = await res.CountAsync();
|
||||||
|
var list = await res.Select(s => new FileDownInfoManagerResponse(_mapper.Map<FileDownInfoManagerResponse>(s))
|
||||||
|
{
|
||||||
|
StatusKey = (s.Status == ExportStatus.Ing && s.Date < DateTime.Now.AddHours(-1)) ? (int)ExportStatus.Fail : (int)s.Status,
|
||||||
|
Status = (s.Status == ExportStatus.Ing && s.Date < DateTime.Now.AddHours(-1)) ? ExportStatus.Fail.GetRemark() : s.Status.GetRemark(),
|
||||||
|
UserName = dto.SupplierId != null
|
||||||
|
? _singleDataService.GetSingleData(SingleAction.Users, companyId, s.UserId)
|
||||||
|
: _singleDataService.GetSingleData(SingleAction.Staffs, companyId, s.UserId),//s.StaffName
|
||||||
|
})
|
||||||
|
.Skip((dto.PageNo - 1) * dto.PageSize).Take(dto.PageSize)
|
||||||
|
.ToListAsync();
|
||||||
|
|
||||||
|
return new FileDownManagerResponse(list, total);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user