Files
U8-Import/NX.ERP.BLL/Store/SotreIn.cs

103 lines
3.6 KiB
C#
Raw 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
{
public class SotreIn
{
public StoreResult AddVoucher(Model.Inbound inbound)
{
var deptCode = "52";
string ID = "";
2021-01-22 09:19:51 +08:00
if (inbound.InboundType == Model.InboundType.PurchaseIn)
2021-01-21 13:42:23 +08:00
{
var dal = new NX.ERP.U8.Store.PuStoreInDAL();
2021-03-15 15:50:14 +08:00
ID = dal.SaveVoucher(new ERP.Model.Request.PuStoreIn()
2021-01-21 13:42:23 +08:00
{
2021-03-16 09:27:13 +08:00
Id = inbound.InboundId,
2021-03-15 13:34:02 +08:00
Code = inbound.InboundNo,
2021-01-21 13:42:23 +08:00
Date = inbound.InboundDate,
Source = inbound.SourceName,
SourceCode = inbound.SourceNo,
Whcode = inbound.WarehouseCode,
Ccheckcode= inbound.QmcheckCode,
2021-01-21 13:42:23 +08:00
Deptcode = deptCode,
Maker = inbound.Maker,
Details = inbound.InboundDtlLst.ToList().ConvertAll(m =>
{
return new ERP.Model.Request.PuStoreInDetail()
{
Invcode = m.MaterialCode,
SorceDetailId = m.SourceDtlId,
Position = m.BinCode,
2021-05-19 13:55:55 +08:00
Quantity = m.Qty,
2021-01-21 13:42:23 +08:00
};
})
});
}
2021-01-22 13:12:37 +08:00
if (inbound.InboundType == Model.InboundType.productIn)
2021-01-21 13:42:23 +08:00
{
var dal = new NX.ERP.U8.Store.ProductInDAL();
2021-03-15 16:32:40 +08:00
ID = dal.SaveVoucher(new ERP.Model.Request.ProductStoreIn()
2021-01-21 13:42:23 +08:00
{
2021-03-15 13:34:02 +08:00
2021-03-16 09:27:13 +08:00
Id = inbound.InboundId,
2021-03-15 13:34:02 +08:00
Code = inbound.InboundNo,
2021-01-21 13:42:23 +08:00
Date = inbound.InboundDate,
Source = inbound.SourceName,
SourceCode = inbound.SourceNo,
WhCode = inbound.WarehouseCode,
Deptcode = deptCode,
Maker = inbound.Maker,
Details = inbound.InboundDtlLst.ToList().ConvertAll(m =>
{
return new ERP.Model.Request.ProductStoreInDetail()
{
Batch = "",
InvCode = m.MaterialCode,
SourceDetailId = m.SourceDtlId,
Position = m.BinCode,
2021-05-19 13:55:55 +08:00
Quantity = m.Qty,
UniqueLabel = m.UniqueLabel
2021-01-21 13:42:23 +08:00
};
})
});
}
if (inbound.InboundType == Model.InboundType.OtherIn)
{
var dal = new NX.ERP.U8.Store.OtherStoreInDAL();
2021-03-15 16:32:40 +08:00
ID = dal.SaveVoucher(new ERP.Model.Request.OtherStoreInOut()
2021-01-21 13:42:23 +08:00
{
2021-03-16 09:27:13 +08:00
Id = inbound.InboundId,
2021-03-15 13:34:02 +08:00
Code = inbound.InboundNo,
2021-01-21 13:42:23 +08:00
Date = inbound.InboundDate,
WhCode = inbound.WarehouseCode,
Maker = inbound.Maker,
details = inbound.InboundDtlLst.ToList().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
}
}
}