出库单调整
This commit is contained in:
@@ -24,14 +24,14 @@ namespace WMS.Web.Api.Controllers
|
|||||||
private readonly IMapper _mapper;
|
private readonly IMapper _mapper;
|
||||||
private readonly ILoginService _loginService;
|
private readonly ILoginService _loginService;
|
||||||
private readonly IOutStockRepositories _repositories;
|
private readonly IOutStockRepositories _repositories;
|
||||||
private readonly IOutStockService _takeStockService;
|
private readonly IOutStockService _outStockService;
|
||||||
public OutStockController(IMapper mapper, ILoginService loginService,
|
public OutStockController(IMapper mapper, ILoginService loginService,
|
||||||
IOutStockRepositories repositories, IOutStockService takeStockService)
|
IOutStockRepositories repositories, IOutStockService outStockService)
|
||||||
{
|
{
|
||||||
_mapper = mapper;
|
_mapper = mapper;
|
||||||
_loginService = loginService;
|
_loginService = loginService;
|
||||||
_repositories = repositories;
|
_repositories = repositories;
|
||||||
_takeStockService = takeStockService;
|
_outStockService = outStockService;
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 列表
|
/// 列表
|
||||||
@@ -64,7 +64,7 @@ namespace WMS.Web.Api.Controllers
|
|||||||
if (loginInfo == null || loginInfo.UserInfo == null)
|
if (loginInfo == null || loginInfo.UserInfo == null)
|
||||||
return Result.ReFailure(ResultCodes.Token_Invalid_Error);
|
return Result.ReFailure(ResultCodes.Token_Invalid_Error);
|
||||||
|
|
||||||
return await _takeStockService.Save(dto, loginInfo);
|
return await _outStockService.Save(dto, loginInfo);
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 同步金蝶
|
/// 同步金蝶
|
||||||
|
|||||||
@@ -9,5 +9,66 @@ namespace WMS.Web.Core.Dto.OutStock
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class OutStockQueryInfoResponse
|
public class OutStockQueryInfoResponse
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 主键 订单编号
|
||||||
|
/// </summary>
|
||||||
|
public int Id { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 单据状态
|
||||||
|
/// </summary>
|
||||||
|
public string Status { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 单据类型
|
||||||
|
/// </summary>
|
||||||
|
public string Type { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建人
|
||||||
|
/// </summary>
|
||||||
|
public string Creator { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间(出库时间)
|
||||||
|
/// </summary>
|
||||||
|
public DateTime CreateTime { get; set; } = DateTime.Now;
|
||||||
|
/// <summary>
|
||||||
|
/// 同步成功或者失败 null 就是未同步
|
||||||
|
/// </summary>
|
||||||
|
public bool? SuccessSync { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 来源单号
|
||||||
|
///</summary>
|
||||||
|
public string SourceBillNo { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 销售订单号
|
||||||
|
///</summary>
|
||||||
|
public string SaleBillNo { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 发货组织
|
||||||
|
///</summary>
|
||||||
|
public string DeliveryOrg { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 收货客户
|
||||||
|
///</summary>
|
||||||
|
public string ReceiptCustomer { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 物料名称
|
||||||
|
/// </summary>
|
||||||
|
public string MaterialName { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 物料编码
|
||||||
|
/// </summary>
|
||||||
|
public string MaterialNumber { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 物料规格型号
|
||||||
|
/// </summary>
|
||||||
|
public string Specifications { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 仓库ID
|
||||||
|
///</summary>
|
||||||
|
public string Stock { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 出库数量
|
||||||
|
///</summary>
|
||||||
|
public decimal Qty { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,5 +9,45 @@ namespace WMS.Web.Core.Dto.OutStock
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class OutStockQueryRequest : PaginationBaseRequestDto
|
public class OutStockQueryRequest : PaginationBaseRequestDto
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 单据类型(出库单下拉列表)
|
||||||
|
/// </summary>
|
||||||
|
public int? Type { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 创建人
|
||||||
|
/// </summary>
|
||||||
|
public string Creator { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间(出库时间)
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? CreateBeginDate { get; set; } = null;
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间(出库时间)
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? CreateEndDate { get; set; } = null;
|
||||||
|
/// <summary>
|
||||||
|
/// 同步成功或者失败 null 就是未同步
|
||||||
|
/// </summary>
|
||||||
|
public bool? SuccessSync { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 来源单号
|
||||||
|
///</summary>
|
||||||
|
public string SourceBillNo { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 发货组织
|
||||||
|
///</summary>
|
||||||
|
public int? DeliveryOrgId { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 收货客户
|
||||||
|
///</summary>
|
||||||
|
public string ReceiptCustomer { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 物料编码
|
||||||
|
///</summary>
|
||||||
|
public string MaterialNumber { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 仓库ID
|
||||||
|
///</summary>
|
||||||
|
public int? StockId { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
using System;
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using WMS.Web.Core.Dto.Login;
|
||||||
|
using WMS.Web.Core.Dto.OutStock;
|
||||||
|
using WMS.Web.Core.Internal.Results;
|
||||||
|
|
||||||
namespace WMS.Web.Domain.IService
|
namespace WMS.Web.Domain.IService
|
||||||
{
|
{
|
||||||
@@ -9,5 +14,7 @@ namespace WMS.Web.Domain.IService
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IOutStockService
|
public interface IOutStockService
|
||||||
{
|
{
|
||||||
|
//出库单保存
|
||||||
|
Task<Result> Save(List<SaveOutStockRequest> dto, LoginInDto loginInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,42 @@
|
|||||||
using System;
|
using AutoMapper;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using WMS.Web.Core.Dto.Login;
|
||||||
|
using WMS.Web.Core.Dto.OutStock;
|
||||||
|
using WMS.Web.Core.Dto.TakeStock;
|
||||||
|
using WMS.Web.Core.Internal.Results;
|
||||||
|
using WMS.Web.Domain.Entitys;
|
||||||
|
using WMS.Web.Domain.Infrastructure;
|
||||||
using WMS.Web.Domain.IService;
|
using WMS.Web.Domain.IService;
|
||||||
|
using WMS.Web.Domain.IService.Public;
|
||||||
|
using WMS.Web.Domain.Values;
|
||||||
|
|
||||||
namespace WMS.Web.Domain.Services
|
namespace WMS.Web.Domain.Services
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 出库服务
|
/// 出库服务
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class OutStockService: IOutStockService
|
public class OutStockService : IOutStockService
|
||||||
{
|
{
|
||||||
|
private readonly IMapper _mapper;
|
||||||
|
private readonly ILoginService _loginService;
|
||||||
|
public readonly ITransactionRepositories _transactionRepositories;
|
||||||
|
private readonly IOutStockRepositories _outStockRepositories;
|
||||||
|
public OutStockService(IMapper mapper, ILoginService loginService,
|
||||||
|
ITransactionRepositories transactionRepositories,
|
||||||
|
IOutStockRepositories outStockRepositories)
|
||||||
|
{
|
||||||
|
_mapper = mapper;
|
||||||
|
_loginService = loginService;
|
||||||
|
_transactionRepositories = transactionRepositories;
|
||||||
|
_outStockRepositories = outStockRepositories;
|
||||||
|
}
|
||||||
|
public Task<Result> Save(List<SaveOutStockRequest> dto, LoginInDto loginInfo)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore.Storage;
|
using Microsoft.EntityFrameworkCore.Storage;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using WMS.Web.Core.Dto.OutStock;
|
using WMS.Web.Core.Dto.OutStock;
|
||||||
@@ -63,9 +65,40 @@ namespace WMS.Web.Repositories
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="dto"></param>
|
/// <param name="dto"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public Task<(List<OutStockQueryInfoResponse> list, int total)> GetListAsync(OutStockQueryRequest dto)
|
public async Task<(List<OutStockQueryInfoResponse> list, int total)> GetListAsync(OutStockQueryRequest dto)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
var query = _context.OutStock
|
||||||
|
.OrderByDescending(o => o.Id)
|
||||||
|
.Where(adv => 1 == 1);
|
||||||
|
|
||||||
|
if (dto.CreateBeginDate != null)
|
||||||
|
query = query.Where(w => w.CreateTime >= dto.CreateBeginDate);
|
||||||
|
if (dto.CreateEndDate != null)
|
||||||
|
query = query.Where(w => w.CreateTime <= dto.CreateEndDate);
|
||||||
|
//组装
|
||||||
|
int total = await query.CountAsync();
|
||||||
|
var list = await query.Select(s => new OutStockQueryInfoResponse()
|
||||||
|
{
|
||||||
|
#region dto组装
|
||||||
|
Id = 0,
|
||||||
|
Status = "",
|
||||||
|
Type = "",
|
||||||
|
Creator = "",
|
||||||
|
CreateTime=s.CreateTime,
|
||||||
|
SuccessSync = s.SuccessSync,
|
||||||
|
Stock = "",
|
||||||
|
SourceBillNo="",
|
||||||
|
SaleBillNo = "",
|
||||||
|
DeliveryOrg = "",
|
||||||
|
ReceiptCustomer = "",
|
||||||
|
MaterialName = "",
|
||||||
|
MaterialNumber = "",
|
||||||
|
Specifications = "",
|
||||||
|
Qty=0
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}).Skip((dto.PageNo - 1) * dto.PageSize).Take(dto.PageSize).ToListAsync();
|
||||||
|
return (list, total);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user