调整接口优化
This commit is contained in:
@@ -1398,6 +1398,11 @@
|
||||
改箱
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:WMS.Web.Domain.Mappers.InStockMapper">
|
||||
<summary>
|
||||
入库相关-映射
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:WMS.Web.Domain.Mappers.MapperList">
|
||||
<summary>
|
||||
集合映射
|
||||
|
||||
@@ -7,12 +7,12 @@ namespace WMS.Web.Core.Dto.InStockTask
|
||||
/// <summary>
|
||||
/// 修改-入库任务单-明细对象
|
||||
/// </summary>
|
||||
public class UpdateInStockTaskDetailsRequest
|
||||
public class UpdateInStockTaskDetailsRequest : EntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 明细ID
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
public override int Id { get; set; } = 0;
|
||||
/// <summary>
|
||||
/// 单据头ID
|
||||
/// </summary>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text;
|
||||
using WMS.Web.Core;
|
||||
|
||||
namespace WMS.Web.Domain.Entitys
|
||||
{
|
||||
@@ -10,12 +11,12 @@ namespace WMS.Web.Domain.Entitys
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[Table("t_erp_instock_task_details")]
|
||||
public class InStockTaskDetails
|
||||
public class InStockTaskDetails: EntityBase
|
||||
{
|
||||
/// <summary>
|
||||
/// ID
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
public override int Id { get; set; }
|
||||
/// <summary>
|
||||
/// 单据头ID
|
||||
/// </summary>
|
||||
|
||||
28
src/WMS.Web.Domain/Mappers/InStockMapper.cs
Normal file
28
src/WMS.Web.Domain/Mappers/InStockMapper.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using AutoMapper;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using WMS.Web.Core.Dto.InStock;
|
||||
using WMS.Web.Core.Dto.InStockTask;
|
||||
using WMS.Web.Domain.Entitys;
|
||||
|
||||
namespace WMS.Web.Domain.Mappers
|
||||
{
|
||||
/// <summary>
|
||||
/// 入库相关-映射
|
||||
/// </summary>
|
||||
public class InStockMapper: Profile
|
||||
{
|
||||
public InStockMapper()
|
||||
{
|
||||
CreateMap<UpdateInStockTaskRequest, InStockTask>()
|
||||
.ForMember(x => x.Details, opt => opt.Ignore())
|
||||
.ReverseMap();
|
||||
CreateMap<UpdateInStockTaskDetailsRequest, InStockTaskDetails>().ReverseMap();
|
||||
|
||||
CreateMap<SaveInStockDetailsRequest, InStockDetails>().ReverseMap();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,7 @@ using WMS.Web.Domain.Entitys;
|
||||
using WMS.Web.Domain.Infrastructure;
|
||||
using WMS.Web.Domain.IService;
|
||||
using WMS.Web.Domain.IService.Public;
|
||||
using WMS.Web.Domain.Mappers;
|
||||
using WMS.Web.Domain.Values;
|
||||
|
||||
namespace WMS.Web.Domain.Services
|
||||
@@ -148,6 +149,8 @@ namespace WMS.Web.Domain.Services
|
||||
return Result.ReFailure(ResultCodes.DateWriteError);
|
||||
|
||||
entity = _mapper.Map(dto, entity);
|
||||
//子集单独映射
|
||||
entity.Details = _mapper.ToMapList(dto.Details, entity.Details);
|
||||
if (isReceive)
|
||||
entity.Receive(staffId);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user