聚合入库接口

This commit is contained in:
admin
2021-01-21 13:42:23 +08:00
parent 0e95475880
commit 9f9e429205
34 changed files with 722 additions and 15 deletions

View File

@@ -0,0 +1,92 @@
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 = "";
if (inbound.InboundType == Model.InboundType.productIn)
{
var dal = new NX.ERP.U8.Store.PuStoreInDAL();
ID = dal.AddVocher(new ERP.Model.Request.PuStoreIn()
{
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.PuStoreInDetail()
{
Invcode = m.MaterialCode,
SorceDetailId = m.SourceDtlId,
Position = m.BinCode,
Quantity = m.Qty
};
})
});
}
if (inbound.InboundType == Model.InboundType.PurchaseIn)
{
var dal = new NX.ERP.U8.Store.ProductInDAL();
ID = dal.AddVoucher(new ERP.Model.Request.ProductStoreIn()
{
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,
Quantity = m.Qty
};
})
});
}
if (inbound.InboundType == Model.InboundType.OtherIn)
{
var dal = new NX.ERP.U8.Store.OtherStoreInDAL();
ID = dal.AddVocher(new ERP.Model.Request.OtherStoreInOut()
{
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
};
})
});
}
return new StoreResult() { ID = int.Parse( ID) };
}
}
}

View File

@@ -0,0 +1,90 @@
using NX.ERP.BLL.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NX.ERP.BLL.Store
{
public class SotreOut
{
public StoreResult AddVoucher(Model.OutBound outBound)
{
string ID = "";
if (outBound.OutBoundType == Model.OutBoundType.MaterielOut)
{
var dal = new U8.Store.MaterielStoreOutDAL();
ID = dal.AddVocher(new ERP.Model.Request.MaterielStoreOut()
{
Date = outBound.OutboundDate,
Maker = outBound.Maker,
Source = outBound.SourceName,
SourceCode = outBound.SourceNo,
Whcode = outBound.WarehouseCode,
Details = outBound.OutboundDtlLst.ConvertAll(m =>
{
return new ERP.Model.Request.MaterielStoreOutDetail()
{
InvCode = m.MaterialCode,
Position = m.BinCode,
Quantity = m.Qty,
SorceDetailId = m.SourceDtlId
};
})
});
}
if (outBound.OutBoundType == Model.OutBoundType.SaleOut)
{
var dal = new U8.Store.SaleOutDAL();
ID = dal.AddVoucher(new ERP.Model.Request.SaleStoreOut()
{
Date = outBound.OutboundDate,
WhCode = outBound.Maker,
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
};
})
});
}
if (outBound.OutBoundType == Model.OutBoundType.OtherOut)
{
var dal = new U8.Store.OtherStoreOutDAL();
ID = dal.AddVocher(new ERP.Model.Request.OtherStoreInOut()
{
Date = outBound.OutboundDate,
WhCode = outBound.Maker,
Maker = outBound.Maker,
details = outBound.OutboundDtlLst.ConvertAll(m =>
{
return new ERP.Model.Request.OtherStoreInOutDetail()
{
InvCode = m.MaterialCode,
Position = m.BinCode,
Quantity = m.Qty,
};
})
});
}
return new StoreResult() { ID = int.Parse(ID) };
}
}
}