收货接口
This commit is contained in:
Binary file not shown.
@@ -1035,11 +1035,6 @@
|
|||||||
ID
|
ID
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:WMS.Web.Core.Dto.InStockTask.UpdateInStockTaskBoxRequest.TaskId">
|
|
||||||
<summary>
|
|
||||||
单据ID(等同-入库任务单ID)
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:WMS.Web.Core.Dto.InStockTask.UpdateInStockTaskBoxRequest.BoxId">
|
<member name="P:WMS.Web.Core.Dto.InStockTask.UpdateInStockTaskBoxRequest.BoxId">
|
||||||
<summary>
|
<summary>
|
||||||
箱信息ID
|
箱信息ID
|
||||||
@@ -1060,11 +1055,6 @@
|
|||||||
明细ID
|
明细ID
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:WMS.Web.Core.Dto.InStockTask.UpdateInStockTaskDetailsRequest.Fid">
|
|
||||||
<summary>
|
|
||||||
单据ID(等同-入库任务单ID)
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:WMS.Web.Core.Dto.InStockTask.UpdateInStockTaskDetailsRequest.MaterialId">
|
<member name="P:WMS.Web.Core.Dto.InStockTask.UpdateInStockTaskDetailsRequest.MaterialId">
|
||||||
<summary>
|
<summary>
|
||||||
物料ID
|
物料ID
|
||||||
|
|||||||
@@ -410,12 +410,12 @@
|
|||||||
入库时间(上架时间)
|
入库时间(上架时间)
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="F:WMS.Web.Domain.Entitys.InStockTask.Boxs">
|
<member name="P:WMS.Web.Domain.Entitys.InStockTask.Boxs">
|
||||||
<summary>
|
<summary>
|
||||||
箱信息集合
|
箱信息集合
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="F:WMS.Web.Domain.Entitys.InStockTask.Details">
|
<member name="P:WMS.Web.Domain.Entitys.InStockTask.Details">
|
||||||
<summary>
|
<summary>
|
||||||
明细
|
明细
|
||||||
</summary>
|
</summary>
|
||||||
|
|||||||
@@ -13,10 +13,6 @@ namespace WMS.Web.Core.Dto.InStockTask
|
|||||||
/// ID
|
/// ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override int Id { get; set; } = 0;
|
public override int Id { get; set; } = 0;
|
||||||
/// <summary>
|
|
||||||
/// 单据ID(等同-入库任务单ID)
|
|
||||||
/// </summary>
|
|
||||||
public int TaskId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 箱信息ID
|
/// 箱信息ID
|
||||||
|
|||||||
@@ -14,10 +14,6 @@ namespace WMS.Web.Core.Dto.InStockTask
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public override int Id { get; set; } = 0;
|
public override int Id { get; set; } = 0;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 单据ID(等同-入库任务单ID)
|
|
||||||
/// </summary>
|
|
||||||
public int Fid { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// 物料ID
|
/// 物料ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int MaterialId { get; set; }
|
public int MaterialId { get; set; }
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace WMS.Web.Domain.Entitys
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[Serializable]
|
[Serializable]
|
||||||
[Table("t_erp_instock_task_box")]
|
[Table("t_erp_instock_task_box")]
|
||||||
public class InStockTaskBox:EntityBase
|
public class InStockTaskBox : EntityBase
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Id
|
/// Id
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using WMS.Web.Core;
|
||||||
using WMS.Web.Domain.Values;
|
using WMS.Web.Domain.Values;
|
||||||
|
|
||||||
namespace WMS.Web.Domain.Entitys
|
namespace WMS.Web.Domain.Entitys
|
||||||
@@ -11,12 +12,12 @@ namespace WMS.Web.Domain.Entitys
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[Serializable]
|
[Serializable]
|
||||||
[Table("t_erp_instock_task")]
|
[Table("t_erp_instock_task")]
|
||||||
public class InStockTask
|
public class InStockTask : EntityBase
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ID
|
/// ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int Id { get; set; }
|
public override int Id { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 单据编号
|
/// 单据编号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -53,12 +54,12 @@ namespace WMS.Web.Domain.Entitys
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 箱信息集合
|
/// 箱信息集合
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<InStockTaskBox> Boxs = new List<InStockTaskBox>();
|
public List<InStockTaskBox> Boxs { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 明细
|
/// 明细
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<InStockTaskDetails> Details = new List<InStockTaskDetails>();
|
public List<InStockTaskDetails> Details { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 创建
|
/// 创建
|
||||||
|
|||||||
@@ -11,12 +11,12 @@ namespace WMS.Web.Domain.Entitys
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[Serializable]
|
[Serializable]
|
||||||
[Table("t_erp_instock_task_details")]
|
[Table("t_erp_instock_task_details")]
|
||||||
public class InStockTaskDetails: EntityBase
|
public class InStockTaskDetails : EntityBase
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ID
|
/// ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override int Id { get; set; }
|
public override int Id { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 单据头ID
|
/// 单据头ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -17,13 +17,14 @@ namespace WMS.Web.Domain.Mappers
|
|||||||
public InStockMapper()
|
public InStockMapper()
|
||||||
{
|
{
|
||||||
CreateMap<UpdateInStockTaskRequest, InStockTask>()
|
CreateMap<UpdateInStockTaskRequest, InStockTask>()
|
||||||
.ForMember(x => x.Details, opt => opt.Ignore())
|
.ForMember(x => x.Boxs, opt => opt.Ignore())
|
||||||
.ReverseMap();
|
.ForMember(x => x.Details, opt => opt.Ignore());
|
||||||
CreateMap<UpdateInStockTaskDetailsRequest, InStockTaskDetails>().ReverseMap();
|
CreateMap<UpdateInStockTaskDetailsRequest, InStockTaskDetails>();
|
||||||
CreateMap<UpdateInStockTaskBoxRequest, InStockTaskBox>().ReverseMap();
|
CreateMap<UpdateInStockTaskBoxRequest, InStockTaskBox>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CreateMap<SaveInStockDetailsRequest, InStockDetails>().ReverseMap();
|
CreateMap<SaveInStockDetailsRequest, InStockDetails>().ReverseMap();
|
||||||
|
|
||||||
CreateMap<ErpPurchaseInStockResultDto, InStockTask>()
|
CreateMap<ErpPurchaseInStockResultDto, InStockTask>()
|
||||||
.ForMember(x => x.SourceBillNo, ops => ops.MapFrom(x => x.FBillNo));
|
.ForMember(x => x.SourceBillNo, ops => ops.MapFrom(x => x.FBillNo));
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ using System.Threading.Tasks;
|
|||||||
using WMS.Web.Core;
|
using WMS.Web.Core;
|
||||||
using WMS.Web.Core.Dto;
|
using WMS.Web.Core.Dto;
|
||||||
using WMS.Web.Core.Dto.InStockTask;
|
using WMS.Web.Core.Dto.InStockTask;
|
||||||
|
using WMS.Web.Core.Help;
|
||||||
using WMS.Web.Core.Internal.Results;
|
using WMS.Web.Core.Internal.Results;
|
||||||
using WMS.Web.Domain.Entitys;
|
using WMS.Web.Domain.Entitys;
|
||||||
using WMS.Web.Domain.Infrastructure;
|
using WMS.Web.Domain.Infrastructure;
|
||||||
@@ -125,9 +126,12 @@ namespace WMS.Web.Repositories
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<InStockTask> Get(int id)
|
public async Task<InStockTask> Get(int id)
|
||||||
{
|
{
|
||||||
return await _context.InStockTask
|
var entity =await _context.InStockTask
|
||||||
|
.Include(x=>x.Boxs)
|
||||||
.Include(s => s.Details)
|
.Include(s => s.Details)
|
||||||
.FirstOrDefaultAsync(f => f.Id == id);
|
.FirstOrDefaultAsync(f => f.Id == id);
|
||||||
|
|
||||||
|
return entity.Clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -137,11 +141,13 @@ namespace WMS.Web.Repositories
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<InStockTask> GetBy(string boxBillNo)
|
public async Task<InStockTask> GetBy(string boxBillNo)
|
||||||
{
|
{
|
||||||
return await _context.InStockTask
|
var entity= await _context.InStockTask
|
||||||
.Include(s => s.Boxs.Where(b => b.BoxBillNo == boxBillNo))
|
.Include(s => s.Boxs.Where(b => b.BoxBillNo == boxBillNo))
|
||||||
.Include(s => s.Details)
|
.Include(s => s.Details)
|
||||||
.Where(w => w.Boxs.Where(b => b.BoxBillNo == boxBillNo).Count() > 0).FirstOrDefaultAsync();
|
.Where(w => w.Boxs.Where(b => b.BoxBillNo == boxBillNo).Count() > 0).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
return entity.Clone();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -152,10 +158,10 @@ namespace WMS.Web.Repositories
|
|||||||
public async Task<bool> IsExist(string boxBillNo)
|
public async Task<bool> IsExist(string boxBillNo)
|
||||||
{
|
{
|
||||||
return await _context.InStockTask
|
return await _context.InStockTask
|
||||||
|
.AsNoTracking()
|
||||||
.Include(s => s.Boxs.Where(b => b.BoxBillNo == boxBillNo))
|
.Include(s => s.Boxs.Where(b => b.BoxBillNo == boxBillNo))
|
||||||
.Include(s => s.Details)
|
.Include(s => s.Details)
|
||||||
.Where(w =>(w.Status== InstockStatus.Part || w.Status== InstockStatus.Wait) && w.Boxs.Where(b => b.BoxBillNo == boxBillNo).Count() > 0).AnyAsync();
|
.Where(w => (w.Status == InstockStatus.Part || w.Status == InstockStatus.Wait) && w.Boxs.Where(b => b.BoxBillNo == boxBillNo).Count() > 0).AnyAsync();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -165,10 +171,11 @@ namespace WMS.Web.Repositories
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<List<InStockTask>> GetList(List<int> ids)
|
public async Task<List<InStockTask>> GetList(List<int> ids)
|
||||||
{
|
{
|
||||||
return await _context.InStockTask
|
var entitys= await _context.InStockTask
|
||||||
.Include(s => s.Details)
|
.Include(s => s.Details)
|
||||||
.Where(f => ids.Contains(f.Id))
|
.Where(f => ids.Contains(f.Id))
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
return entitys.Clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -178,10 +185,12 @@ namespace WMS.Web.Repositories
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<List<InStockTask>> GetListBy(List<string> sourceBillNos)
|
public async Task<List<InStockTask>> GetListBy(List<string> sourceBillNos)
|
||||||
{
|
{
|
||||||
return await _context.InStockTask
|
var entitys= await _context.InStockTask
|
||||||
.Include(s => s.Details)
|
.Include(s => s.Details)
|
||||||
.Where(w => sourceBillNos.Contains(w.SourceBillNo))
|
.Where(w => sourceBillNos.Contains(w.SourceBillNo))
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
|
return entitys.Clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -301,8 +310,8 @@ namespace WMS.Web.Repositories
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
List<int> list = entitys.Select(s => s.Id).ToList();
|
List<int> list = entitys.Select(s => s.Id).ToList();
|
||||||
var res = await _context.InStockTask.Include(x => x.Details).Where(f => list.Contains(f.Id)).ToListAsync();
|
var res = await _context.InStockTask.Include(x=>x.Boxs).Include(x => x.Details).Where(f => list.Contains(f.Id)).ToListAsync();
|
||||||
_mapper.Map(entitys, res);
|
_mapper.ToMapList(entitys, res);
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
if (_transaction != null)
|
if (_transaction != null)
|
||||||
_transaction.Commit();
|
_transaction.Commit();
|
||||||
@@ -330,18 +339,20 @@ namespace WMS.Web.Repositories
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
var model = await _context.InStockTask
|
var model = await _context.InStockTask
|
||||||
.AsNoTracking()
|
.Include(s=>s.Boxs)
|
||||||
.Include(s => s.Details)
|
.Include(s => s.Details)
|
||||||
.FirstOrDefaultAsync(f => f.Id == entity.Id);
|
.FirstOrDefaultAsync(f => f.Id == entity.Id);
|
||||||
if (model == null)
|
if (model == null)
|
||||||
return null;
|
return null;
|
||||||
_mapper.Map(entity, model);
|
_mapper.Map(entity, model);
|
||||||
await _context.SaveChangesAsync();
|
_mapper.ToMapList(entity.Boxs, model.Boxs);
|
||||||
|
_mapper.ToMapList(entity.Details, model.Details);
|
||||||
|
var result= await _context.SaveChangesAsync();
|
||||||
if (_transaction != null)
|
if (_transaction != null)
|
||||||
_transaction.Commit();
|
_transaction.Commit();
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
if (_transaction != null)
|
if (_transaction != null)
|
||||||
_transaction.Rollback();
|
_transaction.Rollback();
|
||||||
|
|||||||
Reference in New Issue
Block a user