Files

104 lines
3.5 KiB
C#
Raw Permalink Normal View History

2021-01-21 13:42:23 +08:00
using NX.ERP.BLL.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NX.ERP.BLL.Store
{
2021-05-19 20:09:44 +08:00
/// <summary>
///
/// </summary>
2021-01-21 13:42:23 +08:00
public class SotreOut
{
2021-05-19 20:09:44 +08:00
/// <summary>
/// 添加出库单据
/// </summary>
/// <param name="outBound"></param>
/// <returns></returns>
2021-01-21 13:42:23 +08:00
public StoreResult AddVoucher(Model.OutBound outBound)
{
string ID = "";
2021-01-28 10:10:32 +08:00
if (outBound.OutboundType == Model.OutBoundType.MaterialOut)
2021-01-21 13:42:23 +08:00
{
2021-01-28 10:10:32 +08:00
var dal = new U8.Store.MaterialStoreOutDAL();
2021-03-15 15:50:14 +08:00
ID = dal.SaveVoucher(new ERP.Model.Request.MaterialStoreOut()
2021-01-21 13:42:23 +08:00
{
2021-03-16 09:27:13 +08:00
Id = outBound.OutboundId,
2021-03-15 13:34:02 +08:00
Code = outBound.OutboundNo,
2021-01-21 13:42:23 +08:00
Date = outBound.OutboundDate,
Maker = outBound.Maker,
Source = outBound.SourceName,
SourceCode = outBound.SourceNo,
Whcode = outBound.WarehouseCode,
Details = outBound.OutboundDtlLst.ConvertAll(m =>
{
2021-01-28 10:10:32 +08:00
return new ERP.Model.Request.MaterialStoreOutDetail()
2021-01-21 13:42:23 +08:00
{
InvCode = m.MaterialCode,
Position = m.BinCode,
Quantity = m.Qty,
SorceDetailId = m.SourceDtlId
};
})
});
}
2021-01-28 10:10:32 +08:00
if (outBound.OutboundType == Model.OutBoundType.SaleOut)
2021-01-21 13:42:23 +08:00
{
var dal = new U8.Store.SaleOutDAL();
2021-03-15 16:32:40 +08:00
ID = dal.SaveVoucher(new ERP.Model.Request.SaleStoreOut()
2021-01-21 13:42:23 +08:00
{
2021-03-16 09:27:13 +08:00
Id = outBound.OutboundId,
2021-03-15 13:34:02 +08:00
Code = outBound.OutboundNo,
2021-01-21 13:42:23 +08:00
Date = outBound.OutboundDate,
2021-02-06 10:32:05 +08:00
WhCode = outBound.WarehouseCode,
2021-01-21 13:42:23 +08:00
Source = outBound.SourceName,
SourceCode = outBound.SourceNo,
Maker = outBound.Maker,
Details = outBound.OutboundDtlLst.ConvertAll(m =>
{
return new ERP.Model.Request.SaleStoreOutDetail()
{
InvCode = m.MaterialCode,
Position = m.BinCode,
Quantity = m.Qty,
SourceDetailId = m.SourceDtlId
};
})
});
}
2021-01-28 10:10:32 +08:00
if (outBound.OutboundType == Model.OutBoundType.OtherOut)
2021-01-21 13:42:23 +08:00
{
var dal = new U8.Store.OtherStoreOutDAL();
2021-03-15 16:32:40 +08:00
ID = dal.SaveVoucher(new ERP.Model.Request.OtherStoreInOut()
2021-01-21 13:42:23 +08:00
{
Date = outBound.OutboundDate,
2021-03-03 14:29:15 +08:00
WhCode = outBound.WarehouseCode,
2021-03-16 09:27:13 +08:00
Id = outBound.OutboundId,
2021-03-15 13:34:02 +08:00
Code = outBound.OutboundNo,
2021-01-21 13:42:23 +08:00
Maker = outBound.Maker,
details = outBound.OutboundDtlLst.ConvertAll(m =>
{
return new ERP.Model.Request.OtherStoreInOutDetail()
{
InvCode = m.MaterialCode,
Position = m.BinCode,
Quantity = m.Qty,
};
})
});
}
2021-12-13 13:37:59 +08:00
return new StoreResult() { ID = ID };
2021-01-21 13:42:23 +08:00
}
}
}