聚合入库接口

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,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NX.ERP.BLL.Model
{
public class Inbound:NX.ERP.Model.BaseModel
{
public string InboundNo { get; set; }
public DateTime InboundDate { get; set; }
public InboundType InboundType { get; set; }
public string WarehouseCode { get; set; }
public string SourceNo { get; set; }
public string SourceName { get; set; }
public IEnumerable<InboundDetail> InboundDtlLst { get; set; }
public string Maker { get; set; }
}
}

View File

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NX.ERP.BLL.Model
{
public class InboundDetail
{
public string MaterialCode { get; set; }
public double Qty { get; set; }
public int SourceDtlId { get; set; }
public string BinCode { get; set; }
}
}

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NX.ERP.BLL.Model
{
public enum InboundType
{
PurchaseIn = 1,
productIn = 2,
OtherIn = 3
}
}

View File

@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NX.ERP.BLL.Model
{
public class OutBound
{
public string OutboundNo { get; set; }
public DateTime OutboundDate { get; set; }
public OutBoundType OutBoundType { get; set; }
public string WarehouseCode { get; set; }
public string SourceNo { get; set; }
public string SourceName { get; set; }
public string Maker { get; set; }
public List<OutBoundDetail> OutboundDtlLst { get; set; }
// outbound_no
//outbound_date
//outbound_type
//warehouse_code
//source_no
//source_name
//maker
}
}

View File

@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NX.ERP.BLL.Model
{
public class OutBoundDetail
{
public string MaterialCode { get; set; }
public double Qty { get; set; }
public string BinCode { get; set; }
public int SourceDtlId { get; set; }
// material_code
//qty
//source_dtl_id
//bin_code
}
}

View File

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NX.ERP.BLL.Model
{
public enum OutBoundType
{
SaleOut=1,
MaterielOut=2,
OtherOut=3
//1:销售出库;2:原材料出库;3:其它出库
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NX.ERP.BLL.Model
{
public class StoreResult
{
public int ID { get; set; }
}
}

View File

@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{C1FFE393-1879-4FC1-A99E-695F2882553D}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NX.ERP.BLL</RootNamespace>
<AssemblyName>NX.ERP.BLL</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Model\InboundDetail.cs" />
<Compile Include="Model\InboundType.cs" />
<Compile Include="Model\Inbound.cs" />
<Compile Include="Model\OutBound.cs" />
<Compile Include="Model\OutBoundDetail.cs" />
<Compile Include="Model\OutBoundType.cs" />
<Compile Include="Model\StoreResult.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Store\SotreIn.cs" />
<Compile Include="Store\SotreOut.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NX.ERP.Model\NX.ERP.Model.csproj">
<Project>{5d012e0a-afed-474e-81a9-5820890b1b29}</Project>
<Name>NX.ERP.Model</Name>
</ProjectReference>
<ProjectReference Include="..\NX.ERP.U8\NX.ERP.U8.csproj">
<Project>{bd673da9-0606-4bcf-a016-fb5c4e7b5d59}</Project>
<Name>NX.ERP.U8</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("NX.ERP.BLL")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("NX.ERP.BLL")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("c1ffe393-1879-4fc1-a99e-695f2882553d")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

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) };
}
}
}