仓储-提交
This commit is contained in:
@@ -35,6 +35,18 @@
|
||||
<param name="dto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:WMS.Web.Api.Controllers.InStockTaskController">
|
||||
<summary>
|
||||
入库任务单-接口
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Api.Controllers.InStockTaskController.GetPagedList(WMS.Web.Core.Dto.InStockTaskQueryRequest)">
|
||||
<summary>
|
||||
列表
|
||||
</summary>
|
||||
<param name="dto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:WMS.Web.Api.Controllers.LoginController">
|
||||
<summary>
|
||||
登录接口
|
||||
@@ -72,12 +84,49 @@
|
||||
<param name="dto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Api.Controllers.MoveBoxRecordController.Save(WMS.Web.Core.Dto.ChangeBoxRecord.SaveChangeBoxRecordRequest)">
|
||||
<member name="M:WMS.Web.Api.Controllers.MoveBoxRecordController.Save(WMS.Web.Core.Dto.MoveBoxRecord.SaveMoveBoxRecordRequest)">
|
||||
<summary>
|
||||
保存
|
||||
</summary>
|
||||
<param name="dto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:WMS.Web.Api.Controllers.SysConfigController">
|
||||
<summary>
|
||||
系统配置
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Api.Controllers.SysConfigController.GetStatus">
|
||||
<summary>
|
||||
获取系统类型所需要下拉列表
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:WMS.Web.Api.Controllers.TakeStockController">
|
||||
<summary>
|
||||
盘点单
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Api.Controllers.TakeStockController.GetPagedList(WMS.Web.Core.Dto.TakeStock.TakeStockQueryRequest)">
|
||||
<summary>
|
||||
列表
|
||||
</summary>
|
||||
<param name="dto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Api.Controllers.TakeStockController.Save(System.Collections.Generic.List{WMS.Web.Core.Dto.TakeStock.SaveTakeStockRequest})">
|
||||
<summary>
|
||||
保存
|
||||
</summary>
|
||||
<param name="dto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Api.Controllers.TakeStockController.Sync(System.Int32)">
|
||||
<summary>
|
||||
同步金蝶
|
||||
</summary>
|
||||
<param name="id"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
||||
|
||||
@@ -225,6 +225,26 @@
|
||||
目标仓位ID
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:WMS.Web.Core.Dto.EnumStatusResponse">
|
||||
<summary>
|
||||
所有枚举信息
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.EnumStatusResponse.OutStockType">
|
||||
<summary>
|
||||
出库单类型
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.EnumStatusResponse.MoveBoxType">
|
||||
<summary>
|
||||
移库单类型
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.EnumStatusResponse.TakeStockType">
|
||||
<summary>
|
||||
盘点结果类型
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:WMS.Web.Core.Dto.Erp.ErpBillQueryDto">
|
||||
<summary>
|
||||
ERP:单据查询-dto
|
||||
@@ -895,9 +915,9 @@
|
||||
盘点单列表
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.TakeStock.TakeStockQueryInfoResponse.DetailId">
|
||||
<member name="P:WMS.Web.Core.Dto.TakeStock.TakeStockQueryInfoResponse.Id">
|
||||
<summary>
|
||||
明细编号
|
||||
单据头Id
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.TakeStock.TakeStockQueryInfoResponse.BillNo">
|
||||
|
||||
@@ -51,5 +51,30 @@ namespace WMS.Web.Domain.Entitys
|
||||
/// </summary>
|
||||
[NotMapped]
|
||||
public List<InStockTaskDetails> Details = new List<InStockTaskDetails>();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 创建订单号
|
||||
/// </summary>
|
||||
/// <param name="newId"></param>
|
||||
public void MakeBillNo(int newId)
|
||||
{
|
||||
//生成订单号
|
||||
var length = newId.ToString().Length;
|
||||
if (length >= 8)
|
||||
{
|
||||
this.BillNo = $"RKRW{newId.ToString()}";
|
||||
}
|
||||
else
|
||||
{
|
||||
var needLength = 8 - length;
|
||||
var needStr = "";
|
||||
for (int i = 0; i < needLength; i++)
|
||||
{
|
||||
needStr += "0";
|
||||
}
|
||||
this.BillNo = "RKRW" + needStr + newId.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using AutoMapper;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Storage;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -8,6 +9,7 @@ using System.Threading.Tasks;
|
||||
using WMS.Web.Core;
|
||||
using WMS.Web.Core.Dto;
|
||||
using WMS.Web.Core.Internal.Results;
|
||||
using WMS.Web.Domain.Entitys;
|
||||
using WMS.Web.Domain.Infrastructure;
|
||||
using WMS.Web.Repositories.Configuration;
|
||||
|
||||
@@ -16,7 +18,7 @@ namespace WMS.Web.Repositories
|
||||
/// <summary>
|
||||
/// 入库任务表-仓储
|
||||
/// </summary>
|
||||
public class InStockTaskRepositories: IInStockTaskRepositories
|
||||
public class InStockTaskRepositories : IInStockTaskRepositories
|
||||
{
|
||||
private readonly IMapper _mapper;
|
||||
private readonly IServiceProvider _serviceProvider;
|
||||
@@ -55,27 +57,94 @@ namespace WMS.Web.Repositories
|
||||
DetailsId = s.detail.Id,
|
||||
BillNo = s.order.BillNo,
|
||||
Type = s.order.Type.GetRemark(),
|
||||
Status=s.order.Status.GetRemark(),
|
||||
Status = s.order.Status.GetRemark(),
|
||||
SourceBillNo = s.detail.SourceBillNo,
|
||||
Supplier = "",
|
||||
Org = "",
|
||||
MaterialName = "",
|
||||
MaterialNumber = "",
|
||||
Specifications = "",
|
||||
FactoryPrice=s.detail.FactoryPrice,
|
||||
FactoryPrice = s.detail.FactoryPrice,
|
||||
Stock = "",
|
||||
AccruedQty = s.detail.AccruedQty,
|
||||
ReceiveQty = s.detail.ReceiveQty,
|
||||
RealityQty = s.detail.RealityQty,
|
||||
Receiver = "",
|
||||
ReceiveTime=s.order.ReceiveTime,
|
||||
Operator="",
|
||||
OperateTime=s.order.OperateTime,
|
||||
ReceiveTime = s.order.ReceiveTime,
|
||||
Operator = "",
|
||||
OperateTime = s.order.OperateTime,
|
||||
CreateTime = s.detail.CreateTime,
|
||||
}).OrderByDescending(x => x.Id).Skip((dto.PageNo - 1) * dto.PageSize).Take(dto.PageSize).ToListAsync();
|
||||
|
||||
response.Data = list;
|
||||
return response;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量添加
|
||||
/// </summary>
|
||||
/// <param name="entitys"></param>
|
||||
/// <param name="isTransaction"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> AddRange(List<InStockTask> entitys, bool isTransaction = true)
|
||||
{
|
||||
IDbContextTransaction _transaction = null;
|
||||
if (isTransaction)
|
||||
_transaction = _context.Database.BeginTransaction();
|
||||
try
|
||||
{
|
||||
if (entitys != null && entitys.Count != 0)
|
||||
{
|
||||
await _context.InStockTask.AddRangeAsync(entitys);
|
||||
await _context.SaveChangesAsync();
|
||||
foreach (var item in entitys)
|
||||
{
|
||||
if (string.IsNullOrEmpty(item.BillNo))
|
||||
//自动生成单据编号
|
||||
item.MakeBillNo(item.Id);
|
||||
}
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
if (_transaction != null)
|
||||
_transaction.Commit();
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
if (_transaction != null)
|
||||
_transaction.Rollback();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<InStockTask> Add(InStockTask entity, bool isTransaction = true)
|
||||
{
|
||||
IDbContextTransaction _transaction = null;
|
||||
if (isTransaction)
|
||||
_transaction = _context.Database.BeginTransaction();
|
||||
|
||||
try
|
||||
{
|
||||
//创建单据编号
|
||||
entity.MakeBillNo(entity.Id);
|
||||
await _context.InStockTask.AddAsync(entity);
|
||||
var res = await _context.SaveChangesAsync();
|
||||
if (_transaction != null)
|
||||
_transaction.Commit();
|
||||
return entity;
|
||||
}
|
||||
catch
|
||||
{
|
||||
if (_transaction != null)
|
||||
_transaction.Rollback();
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user