Browse Source

需求单No.137604:【畜类屠宰场管理】-【成品入库】B3ButcherManage.0022导用友12.1单据

master
gaowenwei 8 years ago
parent
commit
cd75d17ba2
7 changed files with 326 additions and 0 deletions
  1. +6
    -0
      BWP.B3ButcherManageExport.Web/BWP.B3ButcherManageExport.Web.csproj
  2. +123
    -0
      BWP.B3ButcherManageExport.Web/Pages/B3ButcherManageExport/U8/ProductInStoreToU8_/ProductInStoreToU8List.cs
  3. +80
    -0
      BWP.B3ButcherManageExport.Web/Pages/B3ButcherManageExport/U8/ProductInStoreToU8_/ProductInStoreToU8List.xml
  4. +1
    -0
      BWP.B3ButcherManageExport/B3ButcherManageExportConsts.cs
  5. +113
    -0
      BWP.B3ButcherManageExport/BL/U8/ProductInStoreU8BL_/ProductInStoreToU8BL.cs
  6. +2
    -0
      BWP.B3ButcherManageExport/BWP.B3ButcherManageExport.csproj
  7. +1
    -0
      WebFolder/Config/Plugins/B3ButcherManageExport.Plugin

+ 6
- 0
BWP.B3ButcherManageExport.Web/BWP.B3ButcherManageExport.Web.csproj View File

@ -89,6 +89,9 @@
<Compile Include="Pages\B3ButcherManageExport\U8\PayToU8_\PayToU8List.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Pages\B3ButcherManageExport\U8\ProductInStoreToU8_\ProductInStoreToU8List.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Pages\B3ButcherManageExport\U8\StatPayToU8_\StatPayToU8List.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
@ -136,6 +139,9 @@
<ItemGroup>
<EmbeddedResource Include="Pages\B3ButcherManageExport\U8\PayToU8_\PayToU8List.xml" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Pages\B3ButcherManageExport\U8\ProductInStoreToU8_\ProductInStoreToU8List.xml" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.


+ 123
- 0
BWP.B3ButcherManageExport.Web/Pages/B3ButcherManageExport/U8/ProductInStoreToU8_/ProductInStoreToU8List.cs View File

@ -0,0 +1,123 @@
using BWP.B3ButcherManage.BO;
using BWP.B3ButcherManageExport.BL;
using BWP.B3ExportBase;
using BWP.Web.Pages.B3ExportBase;
using Forks.EnterpriseServices.BusinessInterfaces;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TSingSoft.WebControls2;
using BWP.B3Frameworks;
using BWP.B3ExportBase.Utils;
namespace BWP.Web.Pages.B3ButcherManageExport.U8.ProductInStoreToU8_
{
public class ProductInStoreToU8List : ExportBaseList<ProductInStore, IProductInStoreToU8BL>
{
protected override string Caption
{
get { return "屠宰场成品入库导U8产成品入库"; }
}
protected override void AddQueryControls(VLayoutPanel vPanel)
{
vPanel.Add(CreateDefaultBillQueryControls((panel, config) =>
{
config.Add("AccountingUnit_ID");
config.Add("Department_ID");
config.Add("Employee_ID");
config.Add("Date");
config.Add("Store_ID");
config.Add("OtherInStoreType_ID");
config.Add("ProductBatch");
}));
}
protected override void AddDFBrowseGridColumn(DFBrowseGrid grid, string field)
{
base.AddDFBrowseGridColumn(grid, field);
if (field == "BillState")
{
AddDFBrowseGridColumn(grid, "AccountingUnit_Name");
AddDFBrowseGridColumn(grid, "Department_Name");
AddDFBrowseGridColumn(grid, "Employee_Name");
AddDFBrowseGridColumn(grid, "Date");
AddDFBrowseGridColumn(grid, "Store_Name");
AddDFBrowseGridColumn(grid, "OtherInStoreType_Name");
AddDFBrowseGridColumn(grid, "ProductBatch");
AddDFBrowseGridColumn(grid, "CheckUser_Name");
AddDFBrowseGridColumn(grid, "Remark");
}
}
protected override string DoExport(List<long> idList)
{
if (idList.Count == 0)
{
throw new ApplicationException("请选择单据!");
}
if (_dfcUrl.IsEmpty)
{
throw new ApplicationException("请选择外部系统!");
}
BL.Export(idList, long.Parse(_dfcUrl.Value), _billDate.Value);
return BIFactory.GetLastMessage();
}
private ChoiceBox _dfcUrl;
private DFDateInput _billDate;
protected override void AddExportControl(HLayoutPanel hbox)
{
hbox.Add(new SimpleLabel("外部系统"));
_dfcUrl = hbox.Add(new ChoiceBox());
_dfcUrl.DataKind = B3ExportBaseConsts.DataSources.;
_dfcUrl.EnableInputArgument = true;
_dfcUrl.SmartOrderEnabled = false;
_dfcUrl.EnableTopItem = true;
_dfcUrl.Width = 130;
hbox.Add(new SimpleLabel("单据日期"));
_billDate = hbox.Add(new DFDateInput());
_billDate.Value = DateTime.Today;
base.AddExportControl(hbox);
}
public override string Url
{
get { return "~/B3ButcherManageExport/U8/ProductInStoreToU8_/ProductInStoreToU8List.aspx"; }
}
protected override string EditUrl
{
get
{
return "B3ButcherManage/Bills/ProductInStore_/ProductInStoreEdit.aspx";
}
}
protected override DQueryDom GetQueryDom()
{
var dom = base.GetQueryDom();
dom.EAddCheckedCondition(dom.From.RootSource.Alias);
return dom;
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
if (!IsPostBack)
{
var tuple = ExportConfigUtil.LoadDefaultExtSystems(MethodID);
if (tuple != null)
{
_dfcUrl.Value = tuple.Item1.ToString();
_dfcUrl.DisplayValue = tuple.Item2;
}
}
}
}
}

+ 80
- 0
BWP.B3ButcherManageExport.Web/Pages/B3ButcherManageExport/U8/ProductInStoreToU8_/ProductInStoreToU8List.xml View File

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="utf-8" ?>
<Select xmlns="urn:XDQuery">
<Columns>
<Field name="ID"/>
</Columns>
<From>
<DmoClass class="BWP.B3ButcherManage.BO.ProductInStore, B3ButcherManage"/>
</From>
<Where>
<And>
<EQ>
<Field name="ID"/>
<QBE paramName="ID"/>
</EQ>
<EQ>
<Field name="Store_ID"/>
<QBE paramName="Store_ID"/>
</EQ>
<EQ>
<Field name="OtherInStoreType_ID"/>
<QBE paramName="OtherInStoreType_ID"/>
</EQ>
<EQ>
<Field name="ProductBatch"/>
<QBE paramName="ProductBatch"/>
</EQ>
<EQ>
<Field name="AccountingUnit_ID"/>
<QBE paramName="AccountingUnit_ID"/>
</EQ>
<EQ>
<Field name="Department_ID"/>
<QBE paramName="Department_ID"/>
</EQ>
<EQ>
<Field name="Employee_ID"/>
<QBE paramName="Employee_ID"/>
</EQ>
<EQ>
<Field name="IsLocked"/>
<QBE paramName="IsLocked"/>
</EQ>
<Contains>
<Field name="Remark"/>
<QBE paramName="Remark"/>
</Contains>
<Contains>
<Field name="CreateUser_Name"/>
<QBE paramName="CreateUser_Name"/>
</Contains>
<Contains>
<Field name="CheckUser_Name"/>
<QBE paramName="CheckUser_Name"/>
</Contains>
<GreaterThanOrEqual>
<Field name="CreateTime"/>
<QBE paramName="MinCreateTime" />
</GreaterThanOrEqual>
<LessThanOrEqual>
<Field name="CreateTime"/>
<QBE paramName="MaxCreateTime"/>
</LessThanOrEqual>
<GreaterThanOrEqual>
<Field name="Date"/>
<QBE paramName="MinDate" />
</GreaterThanOrEqual>
<LessThanOrEqual>
<Field name="Date"/>
<QBE paramName="MaxDate"/>
</LessThanOrEqual>
<EQ>
<Field name="BillState"/>
<QBE paramName ="BillState"/>
</EQ>
</And>
</Where>
</Select>

+ 1
- 0
BWP.B3ButcherManageExport/B3ButcherManageExportConsts.cs View File

@ -11,6 +11,7 @@ namespace BWP.B3ButcherManageExport {
public const byte PayToNc = 4;
public const byte StatPayToU8 = 5;
public const byte PayToU8 = 6;
public const byte ProductInStoreToU8 = 7;
}
public class DmoTypeID {


+ 113
- 0
BWP.B3ButcherManageExport/BL/U8/ProductInStoreU8BL_/ProductInStoreToU8BL.cs View File

@ -0,0 +1,113 @@
using BWP.B3ButcherManage.BO;
using BWP.B3ExportBase;
using BWP.B3ExportBase.BL;
using BWP.B3ExportBase.BO;
using BWP.B3Frameworks;
using Forks.EnterpriseServices;
using Forks.EnterpriseServices.BusinessInterfaces;
using Forks.EnterpriseServices.DomainObjects2;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TSingSoft.WebPluginFramework;
using TSingSoft.WebPluginFramework.BIPlugins.BLEvents;
namespace BWP.B3ButcherManageExport.BL
{
[BusinessInterface(typeof(ProductInStoreToU8BL))]
public interface IProductInStoreToU8BL : IExportU8BL
{
void Export(List<long> dmoIDs, long extSystemID, DateTime? date);
}
[LogicName("屠宰场成品入库导U8产成品入库")]
[BindToFeature("B3ButcherManageExport.0007")]
[ExportID(B3FrameworksConsts.DmoTypeIDBases.B3ButcherManageExport, B3ButcherManageExportConsts.ExportIDOffsets.ProductInStoreToU8)]
public class ProductInStoreToU8BL : ExportU8BL<ProductInStore>, IProductInStoreToU8BL
{
protected override Ufinterface CreateUfinterface(IList<ProductInStore> dmos)
{
if (string.IsNullOrEmpty(Config.Script))
throw new ApplicationException("脚本为空");
var scriptHelper = new PythonScriptHelper(string.Empty, Config.Script, this);
var inv = StatPayU8s.CreateStoreIn();
scriptHelper.AddLocalVar("dmos", dmos);
scriptHelper.AddLocalVar("vouchers", inv);
scriptHelper.Execute();
var i = 0;
foreach (var voucher in inv.Bills)
{
//回执文件里 会有这个信息,通过这个voucherid来判断单据是否导出成功
voucher.Head.Id = i.ToString();
BillIDs.Add(i, voucher.B2BillIDs);
i++;
}
return inv;
}
private DateTime _date;
public DateTime Date
{
get { return _date; }
set { _date = value; }
}
public void Export(List<long> dmoIDs, long extSystemID, DateTime? date)
{
_date = date ?? BLContext.Today;
Export(dmoIDs, extSystemID);
}
protected override Action<List<ProductInStore>> FillDetail
{
get
{
return dmos =>
{
var dmoType = typeof(ProductInStore_Detail);
var dom = new DQueryDom(new JoinAlias(dmoType));
dom.Columns.Add(DQSelectColumn.Field("ID"));
foreach (string property in MinDetailProperties)
{
dom.Columns.Add(DQSelectColumn.Field(property));
}
var expressionList = new List<IDQExpression>();
foreach (var dmo in dmos)
expressionList.Add(DQExpression.Value(dmo.ID));
dom.Where.Conditions.Add(DQCondition.InList(DQExpression.Field("ProductInStore_ID"), expressionList.ToArray()));
var details = new List<ProductInStore_Detail>();
details.Clear();
using (IDQDataReader reader = Session.ExecuteReader(dom))
{
while (reader.Read())
{
var detail = new ProductInStore_Detail
{
ID = (long)reader[0]
};
int i = 1;
foreach (var property in MinDetailProperties)
{
dmoType.GetProperty(property).SetValue(detail, reader[i++], null);
}
details.Add(detail);
}
}
var groups = details.GroupBy(x => x.ProductInStore_ID);
foreach (var gDetail in groups)
{
var firstDmo = dmos.FirstOrDefault(x => x.ID == gDetail.Key);
if (firstDmo == null)
continue;
foreach (var billDetail in gDetail)
{
firstDmo.Details.Add(billDetail);
}
}
};
}
}
}
}

+ 2
- 0
BWP.B3ButcherManageExport/BWP.B3ButcherManageExport.csproj View File

@ -77,6 +77,7 @@
<Compile Include="BL\NC\AdvancePayToNcBL_\AdvancePayToNcBL.cs" />
<Compile Include="BL\NC\PayToNcBL_\PayToNcBL.cs" />
<Compile Include="BL\U8\PayToU8BL_\PayToU8BL.cs" />
<Compile Include="BL\U8\ProductInStoreU8BL_\ProductInStoreToU8BL.cs" />
<Compile Include="BL\U8\StatPayToU8BL_\StatPayToU8BL.cs" />
<Compile Include="BO\NC\NcUfinterface.cs" />
<Compile Include="BO\NC\NCVourcher.cs" />
@ -107,6 +108,7 @@
<ItemGroup>
<None Include="BL\NC\script\大红门预付款单导NC凭证.py" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.


+ 1
- 0
WebFolder/Config/Plugins/B3ButcherManageExport.Plugin View File

@ -22,6 +22,7 @@
<Feature id="0004" name="B3付款单导NC凭证"/>
<Feature id="0005" name="B3结算单导U8采购入库单"/>
<Feature id="0006" name="B3付款单导U8付款单"/>
<Feature id="0007" name="B3屠宰成品入库导U8产成品入库单"/>
</Features>
</Plugin>

Loading…
Cancel
Save