Merge branch 'master' of https://codeup.aliyun.com/62ce7bca487c500c27f70a79/OPS/WMS-Api
This commit is contained in:
48
src/WMS.Web.Domain/Entitys/OutStockBoxsDetails.cs
Normal file
48
src/WMS.Web.Domain/Entitys/OutStockBoxsDetails.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text;
|
||||
using WMS.Web.Core;
|
||||
|
||||
namespace WMS.Web.Domain.Entitys
|
||||
{
|
||||
/// <summary>
|
||||
/// 对应金蝶的明细
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[Table("t_wms_outstock_boxs_details")]
|
||||
public class OutStockBoxsDetails : EntityBase
|
||||
{
|
||||
public OutStockBoxsDetails() { }
|
||||
/// <summary>
|
||||
/// 主键 订单编号
|
||||
/// </summary>
|
||||
[Column("Id")]
|
||||
public override int Id { get; set; }
|
||||
/// <summary>
|
||||
/// 任务单明细Id
|
||||
/// </summary>
|
||||
[Column("DetailId")]
|
||||
public int DetailId { get; set; }
|
||||
/// <summary>
|
||||
/// 任务单明细Id
|
||||
/// </summary>
|
||||
[Column("BoxId")]
|
||||
public int BoxId { get; set; }
|
||||
/// <summary>
|
||||
/// 序列号
|
||||
/// </summary>
|
||||
[Column("SerialNumbers")]
|
||||
public List<string> SerialNumbers { get; set; } = new List<string>();
|
||||
/// <summary>
|
||||
/// 仓位
|
||||
///</summary>
|
||||
[Column("SubStockId")]
|
||||
public int SubStockId { get; set; }
|
||||
/// <summary>
|
||||
/// 出库数量
|
||||
///</summary>
|
||||
[Column("Qty")]
|
||||
public decimal Qty { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -51,5 +51,9 @@ namespace WMS.Web.Domain.Entitys
|
||||
/// 对应erp明细 同一个物料 存在于不同的来源单中(合并后出现多条)
|
||||
/// </summary>
|
||||
public List<OutStockErpDetails> ErpDetails { get; set; } = new List<OutStockErpDetails>();
|
||||
/// <summary>
|
||||
/// 出库时对应箱信息
|
||||
/// </summary>
|
||||
public List<OutStockBoxsDetails> BoxsDetails { get; set; } = new List<OutStockBoxsDetails>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,8 @@ namespace WMS.Web.Domain.Mappers
|
||||
.ForMember(x => x.Id, ops => ops.Ignore())
|
||||
.ForMember(x => x.DetailId, ops => ops.Ignore())
|
||||
.ForMember(x => x.Qty, ops => ops.Ignore());
|
||||
|
||||
CreateMap<SaveOutStockDetailsRequest, OutStockBoxsDetails>();
|
||||
|
||||
|
||||
CreateMap<OutStockTask, GetOutStockTaskByNoResponse>();
|
||||
CreateMap<OutStockTaskDetails, GetOutStockTaskByNoDetailsResponse>();
|
||||
|
||||
@@ -48,6 +48,7 @@ namespace WMS.Web.Domain.Services
|
||||
public async Task<Result> Sync()
|
||||
{
|
||||
DateTime begin = await _erpOpsSyncDateRepositories.Get(ErpOpsSyncType.Ops);
|
||||
begin= begin.AddYears(-1);
|
||||
OpsBoxRequest request = new OpsBoxRequest(begin, DateTime.Now);
|
||||
var list = await _opsService.GetBox(request);
|
||||
var nos = list.Select(s => s.BoxBillNo).ToList();
|
||||
|
||||
@@ -95,6 +95,9 @@ namespace WMS.Web.Domain.Services
|
||||
oErpDetail.Qty = c.qty;
|
||||
outd.ErpDetails.Add(oErpDetail);
|
||||
}
|
||||
var boxs = dto.Details.Where(w => w.MaterialId == mid).ToList();
|
||||
outd.BoxsDetails = _mapper.Map<List<OutStockBoxsDetails>>(boxs);
|
||||
|
||||
outd.Qty = qty;
|
||||
outd.SerialNumbers.AddRange(dtoDetails.SelectMany(s => s.SerialNumbers));
|
||||
entity.Details.Add(outd);
|
||||
|
||||
Reference in New Issue
Block a user