Browse Source

加级别,加定价单。

master
yibo 7 years ago
parent
commit
769d2dafb3
19 changed files with 879 additions and 11 deletions
  1. +26
    -1
      B3SheepButcherManage.Web/B3SheepButcherManage.Web.csproj
  2. +51
    -0
      B3SheepButcherManage.Web/Pages/B3SheepButcherManage/BaseInfos/Livestock_/LivestockEdit.cs
  3. +57
    -0
      B3SheepButcherManage.Web/Pages/B3SheepButcherManage/BaseInfos/Livestock_/LivestockList.cs
  4. +55
    -0
      B3SheepButcherManage.Web/Pages/B3SheepButcherManage/BaseInfos/Livestock_/LivestockList.xml
  5. +243
    -0
      B3SheepButcherManage.Web/Pages/B3SheepButcherManage/Bills/FixedPrice_/FixedPriceEdit.cs
  6. +37
    -0
      B3SheepButcherManage.Web/Pages/B3SheepButcherManage/Bills/FixedPrice_/FixedPriceList.cs
  7. +69
    -0
      B3SheepButcherManage.Web/Pages/B3SheepButcherManage/Bills/FixedPrice_/FixedPriceList.xml
  8. +21
    -0
      B3SheepButcherManage.Web/Pages/B3SheepButcherManage/Bills/FixedPrice_/FixedPricePrint.cs
  9. +2
    -0
      B3SheepButcherManage.Web/PluginClass.cs
  10. +50
    -0
      B3SheepButcherManage.Web/Utils/B3SheepButcherManageChoiceBoxProvider.cs
  11. +10
    -4
      B3SheepButcherManage/B3SheepButcherManage.csproj
  12. +32
    -0
      B3SheepButcherManage/BL/BaseInfo/LivestockBL.cs
  13. +54
    -0
      B3SheepButcherManage/BL/Bill/FixedPriceBL/FixedPriceBL.cs
  14. +25
    -0
      B3SheepButcherManage/BO/BaseInfo/Livestock.cs
  15. +32
    -0
      B3SheepButcherManage/BO/Bill/FixedPrice/FixedPrice.cs
  16. +75
    -0
      B3SheepButcherManage/BO/Bill/FixedPrice/FixedPrice_Detail.cs
  17. +4
    -1
      B3SheepButcherManage/DmoTypeIDOffsets.cs
  18. +7
    -5
      WebFolder/config/Plugins/B3SheepButcherManage.Plugin
  19. +29
    -0
      WebFolder/config/billreports/B3SheepButcherManage/FixedPricePrint.xml

+ 26
- 1
B3SheepButcherManage.Web/B3SheepButcherManage.Web.csproj View File

@ -100,13 +100,38 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Pages\B3SheepButcherManage\BaseInfos\Livestock_\LivestockEdit.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Pages\B3SheepButcherManage\BaseInfos\Livestock_\LivestockList.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Pages\B3SheepButcherManage\Bills\FixedPrice_\FixedPriceEdit.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Pages\B3SheepButcherManage\Bills\FixedPrice_\FixedPriceList.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Pages\B3SheepButcherManage\Bills\FixedPrice_\FixedPricePrint.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="PluginClass.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Utils\B3SheepButcherManageChoiceBoxProvider.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="Pages\B3SheepButcherManage\Bills\" />
<Folder Include="Pages\B3SheepButcherManage\Reports\" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Pages\B3SheepButcherManage\BaseInfos\Livestock_\LivestockList.xml" />
<EmbeddedResource Include="Pages\B3SheepButcherManage\Bills\FixedPrice_\FixedPriceList.xml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\B3SheepButcherManage\B3SheepButcherManage.csproj">
<Project>{e4a988cc-58b2-4ed0-9387-a1cc477634ab}</Project>
<Name>B3SheepButcherManage</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\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.


+ 51
- 0
B3SheepButcherManage.Web/Pages/B3SheepButcherManage/BaseInfos/Livestock_/LivestockEdit.cs View File

@ -0,0 +1,51 @@
using BWP.B3ProduceUnitedInfos.NamedValueTemplate;
using BWP.B3SheepButcherManage;
using BWP.B3SheepButcherManage.BL;
using BWP.B3SheepButcherManage.BO;
using BWP.Web.CustomPageLayout;
using BWP.Web.Layout;
using BWP.Web.Utils;
using BWP.Web.WebControls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TSingSoft.WebControls2;
namespace BWP.Web.Pages.B3SheepButcherManage.BaseInfos.Livestock_
{
class LivestockEdit : BaseInfoEditPage<Livestock, ILivestockBL>
{
protected override void BuildBasePropertiesEditor(TitlePanel titlePanel, PageLayoutSection pageLayoutSection)
{
var layoutManager = new LayoutManager("", mDFInfo, mDFContainer);
layoutManager.Add("GoodsProperty_ID", InputCreator.DFChoiceBox(B3SheepButcherManageConsts.DataSources., "GoodsProperty_Name"));
var config = new AutoLayoutConfig();
layoutManager.Config = config;
config.Add("GoodsProperty_ID");
config.Add("Name");
config.Add("Code");
config.Add("LiveVarieties_ID");
config.Add("PrintShortName");
config.Add("Spec");
config.Add("Feature");
config.Add("Origin");
config.Add("Brand");
config.Add("TaxRate");
config.Add("MainUnit");
config.Add("SecondUnit");
config.Add("Remark");
pageLayoutSection.SetRequired("GoodsProperty_ID", "Name", "Code");
pageLayoutSection.ApplyLayout(layoutManager, config, mPageLayoutManager, mDFInfo);
titlePanel.Controls.Add(layoutManager.CreateLayout());
layoutManager.EnsureInputControlCreated<DFChoiceBox>("LiveVarieties_ID").CodeArgument = ..Value.ToString();
}
}
}

+ 57
- 0
B3SheepButcherManage.Web/Pages/B3SheepButcherManage/BaseInfos/Livestock_/LivestockList.cs View File

@ -0,0 +1,57 @@
using BWP.B3Frameworks.Utils;
using BWP.B3ProduceUnitedInfos.NamedValueTemplate;
using BWP.B3SheepButcherManage;
using BWP.B3SheepButcherManage.BL;
using BWP.B3SheepButcherManage.BO;
using BWP.B3UnitedInfos.BO;
using BWP.Web.Layout;
using BWP.Web.Utils;
using Forks.EnterpriseServices.DomainObjects2;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
using Forks.EnterpriseServices.SqlDoms;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TSingSoft.WebControls2;
namespace BWP.Web.Pages.B3SheepButcherManage.BaseInfos.Livestock_
{
class LivestockList : BaseInfoListPage<Livestock, ILivestockBL>
{
protected override DQueryDom GetQueryDom()
{
var dom = base.GetQueryDom();
var prop = new JoinAlias(typeof(GoodsProperty));
dom.From.AddJoin(JoinType.Inner, new DQDmoSource(prop), DQCondition.EQ(prop, "ID", dom.From.RootSource.Alias, "GoodsProperty_ID"));
dom.Where.Conditions.Add(DQCondition.EQ(prop, "IsButchery", true));
dom.Where.Conditions.Add(DQCondition.EQ("LiveVarieties_Nature", .));
DomainUtil.AddDomainPermissionLimit(dom, typeof(GoodsProperty), prop);
return dom;
}
protected override void AddQueryControls(VLayoutPanel vPanel)
{
LayoutManager manage = null;
vPanel.Add(CreateDefaultBaseInfoQueryControls((layoutManager, config) =>
{
layoutManager.Add("GoodsProperty_ID", QueryCreator.DFChoiceBox(mDFInfo.Fields["GoodsProperty_ID"], B3SheepButcherManageConsts.DataSources.));
config.AddAfter("GoodsProperty_ID", "ID");
config.Add("LiveVarieties_ID");
manage = layoutManager;
}));
manage.EnsureInputControlCreated<DFChoiceBox>("LiveVarieties_ID").CodeArgument = ..Value.ToString();
}
protected override void AddDFBrowseGridColumn(DFBrowseGrid grid, string field)
{
base.AddDFBrowseGridColumn(grid, field);
if (field == "Name")
{
AddDFBrowseGridColumn(grid, "LiveVarieties_Name");
}
}
}
}

+ 55
- 0
B3SheepButcherManage.Web/Pages/B3SheepButcherManage/BaseInfos/Livestock_/LivestockList.xml View File

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8" ?>
<Select xmlns="urn:XDQuery">
<Columns>
<Field name="ID"/>
</Columns>
<From>
<DmoClass class="BWP.B3SheepButcherManage.BO.Livestock, B3SheepButcherManage"/>
</From>
<Where>
<And>
<EQ>
<Field name="ID"/>
<QBE paramName="ID"/>
</EQ>
<EQ>
<Field name="GoodsProperty_ID"/>
<QBE paramName="GoodsProperty_ID"/>
</EQ>
<EQ>
<Field name="LiveVarieties_ID"/>
<QBE paramName="LiveVarieties_ID"/>
</EQ>
<Or>
<Contains>
<Field name="Name"/>
<QBE paramName="Name"/>
</Contains>
<Contains>
<Field name="Spell"/>
<QBE paramName="Name"/>
</Contains>
</Or>
<Contains>
<Field name="Code"/>
<QBE paramName="Code"/>
</Contains>
<Contains>
<Field name="Brand"/>
<QBE paramName="Brand"/>
</Contains>
<EQ>
<Field name="Stopped"/>
<QBE paramName="Stopped"/>
</EQ>
<EQ>
<Field name="IsLocked"/>
<QBE paramName="IsLocked"/>
</EQ>
<Contains>
<Field name="Remark"/>
<QBE paramName="Remark"/>
</Contains>
</And>
</Where>
</Select>

+ 243
- 0
B3SheepButcherManage.Web/Pages/B3SheepButcherManage/Bills/FixedPrice_/FixedPriceEdit.cs View File

@ -0,0 +1,243 @@
using BWP.B3Frameworks;
using BWP.B3Frameworks.BO.NamedValueTemplate;
using BWP.B3SheepButcherManage.BL;
using BWP.B3SheepButcherManage.BO;
using BWP.Web.CustomPageLayout;
using BWP.Web.Layout;
using BWP.Web.WebControls;
using Forks.EnterpriseServices.BusinessInterfaces;
using Forks.EnterpriseServices.DataForm;
using Forks.EnterpriseServices.DomainObjects2;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
using Forks.EnterpriseServices.SqlDoms;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI.WebControls;
using TSingSoft.WebControls2;
using TSingSoft.WebPluginFramework.Controls;
using TSingSoft.WebPluginFramework.Exports;
using Forks.Utils.Collections;
using BWP.B3ProduceUnitedInfos.NamedValueTemplate;
namespace BWP.Web.Pages.B3SheepButcherManage.Bills.FixedPrice_
{
class FixedPriceEdit : DepartmentWorkFlowBillEditPage<FixedPrice, IFixedPriceBL>
{
DFEditGrid _detailGrid;
protected override void BuildBasePropertiesEditor(TitlePanel titlePanel, PageLayoutSection pageLayoutSection)
{
var layoutManager = new LayoutManager("", mDFInfo, mDFContainer);
var config = new AutoLayoutConfig();
config.Add("AccountingUnit_ID");
config.Add("Department_ID");
config.Add("Employee_ID");
config.Add("ExeTime");
pageLayoutSection.ApplyLayout(layoutManager, config, mPageLayoutManager, mDFInfo);
layoutManager.Config = config;
titlePanel.Controls.Add(layoutManager.CreateLayout());
}
protected override void BuildBody(System.Web.UI.Control parent)
{
base.BuildBody(parent);
AddDetail(parent.EAdd(new TitlePanel("单据明细", "单据明细")));
}
private void AddDetail(TitlePanel titlePanel)
{
var vPanel = titlePanel.EAdd(new VLayoutPanel());
var hPanel = new HLayoutPanel();
vPanel.Add(hPanel, new VLayoutOption(HorizontalAlign.Left));
if (CanSave)
{
var btnAdd = new TSButton("新增");
btnAdd.Click += (sender, e) =>
{
_detailGrid.GetFromUI();
var detail = new FixedPrice_Detail();
Dmo.Details.Add(detail);
_detailGrid.DataBind();
};
hPanel.Add(btnAdd);
var exportOutBtn = new TSButton("导出定价单");
hPanel.Add(exportOutBtn);
var exporter = new Exporter();
hPanel.Add(exporter);
exportOutBtn.Click += delegate
{
var dom = QueryDetail();
var file = new DQueryExcelExporter(LogicName + "No." + Dmo.ID + ".xls", new LoadArguments(dom));
exporter.Export(file);
};
var exportPriceBtn = new TSButton("导入定价单");
hPanel.Add(exportPriceBtn);
hPanel.Add(new SimpleLabel("定价单ID"));
var txtbillID = hPanel.Add(new DFTextBox());
exportPriceBtn.Click += (sender, e) =>
{
_detailGrid.GetFromUI();
if (txtbillID.IsEmpty)
throw new Exception("请输入定价单单号");
var list = GetDetailDataList(long.Parse(txtbillID.Text));
foreach (var item in list)
{
var priceDetail = new FixedPrice_Detail();
priceDetail.ValuationArea_ID = item.ValuationArea_ID;
priceDetail.ValuationArea_Name = item.ValuationArea_Name;
priceDetail.LiveVarieties_ID = item.LiveVarieties_ID;
priceDetail.LiveVarieties_Name = item.LiveVarieties_Name;
priceDetail.Livestock_ID = item.Livestock_ID;
priceDetail.Livestock_Name = item.Livestock_Name;
priceDetail.OriginalPrice = item.Price;
priceDetail.Remark = item.Remark;
Dmo.Details.Add(priceDetail);
}
_detailGrid.DataBind();
};
if (CheckDefaultRole("调价"))
{
var txtPrice = new DFTextBox();
hPanel.Add(new SimpleLabel("调价"));
hPanel.Add(txtPrice);
var btnPrice = new TSButton("调价");
btnPrice.Click += delegate
{
if (string.IsNullOrWhiteSpace(txtPrice.Text))
{
return;
}
_detailGrid.GetFromUI();
foreach (FixedPrice_Detail detail in Dmo.Details)
{
detail.Price = detail.Price + decimal.Parse(txtPrice.Text);
}
_detailGrid.DataBind();
};
hPanel.Add(btnPrice);
}
}
if (MinDmo.BillState == .)
{
hPanel.Add(new TSButton("更新未审核账单单价", delegate
{
mBL.RsetPrice(Dmo);
AspUtil.Alert(this, "操作成功!");
}));
}
var editor = new DFCollectionEditor<FixedPrice_Detail>(() => Dmo.Details);
editor.AllowDeletionFunc = () => CanSave;
editor.CanDeleteFunc = detail => true;
editor.IsEditableFunc = (field, detail) => CanSave;
_detailGrid = new DFEditGrid(editor);
_detailGrid.DFGridSetEnabled = false;
_detailGrid.Width = Unit.Percentage(100);
_detailGrid.Columns.Add(new DFEditGridColumn("ValuationArea_ID"));
_detailGrid.Columns.EAdd(new DFEditGridColumn<DFChoiceBox>("LiveVarieties_ID")).InitEditControl += (sender, e) =>
{
e.Control.CodeArgument = ..Value.ToString();
};
_detailGrid.Columns.Add(new DFEditGridColumn("Livestock_ID"));
_detailGrid.Columns.Add(new DFEditGridColumn<DFValueLabel>("OriginalPrice"));
_detailGrid.Columns.Add(new DFEditGridColumn("Price"));
_detailGrid.Columns.Add(new DFEditGridColumn("Remark"));
mDFContainer.AddNonDFControl(_detailGrid, "$detailGrid");
var dic = new Dictionary<string, Unit>();
dic.Add("定价地区", Unit.Percentage(20));
dic.Add("品种", Unit.Percentage(20));
dic.Add("级别", Unit.Percentage(20));
dic.Add("原单价", Unit.Percentage(15));
dic.Add("单价", Unit.Percentage(15));
dic.Add("备注", Unit.Percentage(10));
_detailGrid.PreferWidthGridSet = dic;
var section = mPageLayoutManager.AddSection("DetaiColumns", "明细列");
titlePanel.SetPageLayoutSetting(mPageLayoutManager, section.Name);
section.ApplyLayout(_detailGrid, mPageLayoutManager, DFInfo.Get(typeof(FixedPrice_Detail)));
vPanel.Add(_detailGrid);
}
DQueryDom QueryDetail()
{
var dom = new DQueryDom(new JoinAlias(typeof(FixedPrice_Detail)));
dom.Columns.Add(DQSelectColumn.Field("ID"));
dom.Columns.Add(DQSelectColumn.Field("ValuationArea_Name"));
dom.Columns.Add(DQSelectColumn.Field("LiveVarieties_Name"));
dom.Columns.Add(DQSelectColumn.Field("Livestock_Name"));
dom.Columns.Add(DQSelectColumn.Field("Price"));
dom.Columns.Add(DQSelectColumn.Field("OriginalPrice"));
dom.Columns.Add(DQSelectColumn.Field("Remark"));
dom.Where.Conditions.Add(DQCondition.EQ("FixedPrice_ID", Dmo.ID));
return dom;
}
public override void AppToUI()
{
base.AppToUI();
_detailGrid.DataBind();
}
public override void GetFromUI()
{
base.GetFromUI();
_detailGrid.GetFromUI();
}
List<FixedPrice_Detail> GetDetailDataList(long? ID)
{
var alias = new JoinAlias(typeof(FixedPrice));
var detail = new JoinAlias(typeof(FixedPrice_Detail));
var dom = new DQueryDom(alias);
dom.From.AddJoin(JoinType.Left, new DQDmoSource(detail), DQCondition.And(DQCondition.EQ(alias, "ID", detail, "FixedPrice_ID")));
dom.Columns.Add(DQSelectColumn.Field("ValuationArea_ID", detail));
dom.Columns.Add(DQSelectColumn.Field("LiveVarieties_ID", detail));
dom.Columns.Add(DQSelectColumn.Field("Livestock_ID", detail));
dom.Columns.Add(DQSelectColumn.Field("OriginalPrice", detail));
dom.Columns.Add(DQSelectColumn.Field("Price", detail));
dom.Columns.Add(DQSelectColumn.Field("Remark", detail));
dom.Columns.Add(DQSelectColumn.Field("ValuationArea_Name", detail));
dom.Columns.Add(DQSelectColumn.Field("LiveVarieties_Name", detail));
dom.Columns.Add(DQSelectColumn.Field("Livestock_Name", detail));
dom.Where.Conditions.Add(DQCondition.EQ(alias, "Domain_ID", DomainContext.Current.ID));
dom.Where.Conditions.Add(DQCondition.EQ(alias, "BillState", .));
dom.Where.Conditions.Add(DQCondition.EQ(alias, "ID", ID));
var list = new List<FixedPrice_Detail>();
using (var context = new TransactionContext())
{
using (var reader = context.Session.ExecuteReader(dom))
{
while (reader.Read())
{
var priceDetail = new FixedPrice_Detail();
priceDetail.ValuationArea_ID = (long?)reader[0];
priceDetail.LiveVarieties_ID = (long?)reader[1];
priceDetail.Livestock_ID = (long?)reader[2];
priceDetail.OriginalPrice = (decimal?)reader[3];
priceDetail.Price = (decimal?)reader[4];
priceDetail.Remark = (string)reader[5];
priceDetail.ValuationArea_Name = (string)reader[6];
priceDetail.LiveVarieties_Name = (string)reader[7];
priceDetail.Livestock_Name = (string)reader[8];
list.Add(priceDetail);
}
}
}
return list;
}
}
}

+ 37
- 0
B3SheepButcherManage.Web/Pages/B3SheepButcherManage/Bills/FixedPrice_/FixedPriceList.cs View File

@ -0,0 +1,37 @@
using BWP.B3SheepButcherManage.BL;
using BWP.B3SheepButcherManage.BO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TSingSoft.WebControls2;
namespace BWP.Web.Pages.B3SheepButcherManage.Bills.FixedPrice_
{
class FixedPriceList : DomainBillListPage<FixedPrice, IFixedPriceBL>
{
protected override void AddQueryControls(VLayoutPanel vPanel)
{
vPanel.Add(CreateDefaultBillQueryControls((panel, config) =>
{
config.Add("ExeTime");
config.Add("AccountingUnit_ID");
config.Add("Department_ID");
config.Add("Employee_ID");
}));
}
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, "CheckUser_Name");
AddDFBrowseGridColumn(grid, "Remark");
}
}
}
}

+ 69
- 0
B3SheepButcherManage.Web/Pages/B3SheepButcherManage/Bills/FixedPrice_/FixedPriceList.xml View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8" ?>
<Select xmlns="urn:XDQuery">
<Columns>
<Field name="ID"/>
</Columns>
<From>
<DmoClass class="BWP.B3SheepButcherManage.BO.FixedPrice, B3SheepButcherManage"/>
</From>
<Where>
<And>
<EQ>
<Field name="ID"/>
<QBE paramName="ID"/>
</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="ExeTime"/>
<QBE paramName="MinExeTime" />
</GreaterThanOrEqual>
<LessThanOrEqual>
<Field name="ExeTime"/>
<QBE paramName="MaxExeTime"/>
</LessThanOrEqual>
<EQ>
<Field name="BillState"/>
<QBE paramName ="BillState"/>
</EQ>
</And>
</Where>
</Select>

+ 21
- 0
B3SheepButcherManage.Web/Pages/B3SheepButcherManage/Bills/FixedPrice_/FixedPricePrint.cs View File

@ -0,0 +1,21 @@
using BWP.B3SheepButcherManage.BL;
using BWP.B3SheepButcherManage.BO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BWP.Web.Pages.B3SheepButcherManage.Bills.FixedPrice_
{
class FixedPricePrint : DomainTemplatePrintPage<FixedPrice, IFixedPriceBL>
{
protected override void AddParameters(IDictionary<string, object> dic)
{
dic.Add("$ID", Dmo.ID);
dic.Add("$Details", Dmo.Details);
dic.Add("$DetailType", typeof(FixedPrice_Detail));
}
}
}

+ 2
- 0
B3SheepButcherManage.Web/PluginClass.cs View File

@ -1,4 +1,5 @@
using BWP.B3System;
using BWP.Web.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
@ -17,6 +18,7 @@ namespace BWP.B3SheepButcherManage.Web
NotSelectedIconUrl = "~/Images/ChildSystemIcons/B3Butchery_NotSelected.png",
DisplayOrder = -600
});
B3SheepButcherManageChoiceBoxProvider.Register();
}
}
}

+ 50
- 0
B3SheepButcherManage.Web/Utils/B3SheepButcherManageChoiceBoxProvider.cs View File

@ -0,0 +1,50 @@
using BWP.B3Frameworks.Utils;
using BWP.B3SheepButcherManage;
using BWP.B3SheepButcherManage.BO;
using BWP.B3UnitedInfos.BO;
using Forks.EnterpriseServices.DomainObjects2;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
using Forks.EnterpriseServices.SqlDoms;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TSingSoft.WebControls2;
using TSingSoft.WebPluginFramework;
namespace BWP.Web.Utils
{
public static class B3SheepButcherManageChoiceBoxProvider
{
public static void Register()
{
ChoiceBoxSettings.Register(B3SheepButcherManageConsts.DataSources., (argu) =>
new ChoiceBoxQueryHelper<GoodsProperty>(argu, true)
{
BeforeQuery = query =>
{
query.Where.Conditions.Add(DQCondition.EQ("IsButchery", true));
DomainUtil.AddDomainPermissionLimit(query);
}
}.GetData());
ChoiceBoxSettings.Register(B3SheepButcherManageConsts.DataSources., argu =>
{
var goods = new JoinAlias(typeof(Livestock));
var goodsProperty = new JoinAlias(typeof(GoodsProperty));
var dom = new DQueryDom(goods);
dom.From.AddJoin(JoinType.Left, new DQDmoSource(goodsProperty), DQCondition.EQ(goods, "GoodsProperty_ID", goodsProperty, "ID"));
dom.Columns.Add(DQSelectColumn.Field("Name", goods));
dom.Columns.Add(DQSelectColumn.Field("ID", goods));
dom.Where.Conditions.Add(DQCondition.EQ(goodsProperty, "IsButchery", true));
dom.Where.Conditions.Add(DQCondition.EQ("Stopped", false));
DomainUtil.AddDomainPermissionLimit(dom, typeof(GoodsProperty), goodsProperty);
if (!string.IsNullOrEmpty(argu.InputArgument))
{
dom.Where.Conditions.Add(DQCondition.Or(DQCondition.Like("Name", argu.InputArgument), DQCondition.Like("Spell", argu.InputArgument), DQCondition.Like("Code", argu.InputArgument)));
}
return dom.EExecuteList<string, long>().Select(x => new WordPair(x.Item1.ToString(), x.Item2.ToString()));
});
}
}
}

+ 10
- 4
B3SheepButcherManage/B3SheepButcherManage.csproj View File

@ -30,6 +30,10 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="B3CowButcherManage, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3a973053c7ebf11c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\tsref\Debug\B3CowButcherManage.dll</HintPath>
</Reference>
<Reference Include="B3Frameworks, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a04fa581c0f74d43, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\BwpB3Project\tsref\Debug\B3Frameworks.dll</HintPath>
@ -83,13 +87,15 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="BL\BaseInfo\LivestockBL.cs" />
<Compile Include="BL\Bill\FixedPriceBL\FixedPriceBL.cs" />
<Compile Include="BO\BaseInfo\Livestock.cs" />
<Compile Include="BO\Bill\FixedPrice\FixedPrice.cs" />
<Compile Include="BO\Bill\FixedPrice\FixedPrice_Detail.cs" />
<Compile Include="DmoTypeIDOffsets.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="BL\" />
<Folder Include="BO\" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\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.


+ 32
- 0
B3SheepButcherManage/BL/BaseInfo/LivestockBL.cs View File

@ -0,0 +1,32 @@
using BWP.B3Frameworks.BL;
using BWP.B3SheepButcherManage.BO;
using Forks.EnterpriseServices;
using Forks.EnterpriseServices.BusinessInterfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BWP.B3SheepButcherManage.BL
{
[BusinessInterface(typeof(LivestockBL))]
[LogicName("级别")]
public interface ILivestockBL : IBaseInfoBL<Livestock>
{
}
public class LivestockBL : BaseInfoBL<Livestock>, ILivestockBL
{
protected override void beforeSave(Livestock dmo)
{
if (dmo.GoodsProperty_ID == null)
{
throw new Exception("必须设置畜类属性(存货属性)");
}
base.beforeSave(dmo);
}
}
}

+ 54
- 0
B3SheepButcherManage/BL/Bill/FixedPriceBL/FixedPriceBL.cs View File

@ -0,0 +1,54 @@
using BWP.B3Frameworks.BL;
using BWP.B3Frameworks.BO.NamedValueTemplate;
using BWP.B3SheepButcherManage.BO;
using Forks.EnterpriseServices;
using Forks.EnterpriseServices.BusinessInterfaces;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BWP.B3SheepButcherManage.BL
{
[LogicName("羊定价单")]
[BusinessInterface(typeof(FixedPriceBL))]
public interface IFixedPriceBL : IDepartmentWorkFlowBillBL<FixedPrice>
{
void RsetPrice(FixedPrice dmo);
}
public class FixedPriceBL : DepartmentWorkFlowBillBL<FixedPrice>, IFixedPriceBL
{
public void RsetPrice(FixedPrice dmo)
{
//var dom = new DmoQuery(typeof(StatPay));
//dom.Where.Conditions.Add(DQCondition.EQ("BillState", 单据状态.未审核));
//dom.Where.Conditions.Add(DQCondition.EQ("FixedPrice_ID", dmo.ID));
//var statPayList = Session.ExecuteList(dom);
//var statPayBL = BIFactory.Create<IStatPayBL>(Session);
//foreach (StatPay statPay in statPayList)
//{
// var needUpdate = false;
// foreach (var butcherDetail in statPay.Details)
// {
// var pay = statPay;
// var detail = butcherDetail;
// var priceDetail = dmo.Details.FirstOrDefault(
// x => x.ValuationArea_ID == pay.ValuationArea_ID &&
// x.Livestock_ID == detail.Livestock_ID &&
// x.HogGrade_ID == detail.HogGrade_ID);
// if (priceDetail != null)
// {
// detail.Price = priceDetail.Price;
// needUpdate = true;
// }
// }
// if (needUpdate)
// {
// statPayBL.Update(statPay);
// }
//}
}
}
}

+ 25
- 0
B3SheepButcherManage/BO/BaseInfo/Livestock.cs View File

@ -0,0 +1,25 @@
using BWP.B3Frameworks;
using BWP.B3ProduceUnitedInfos;
using BWP.B3ProduceUnitedInfos.BO;
using BWP.B3ProduceUnitedInfos.NamedValueTemplate;
using Forks.EnterpriseServices;
using Forks.EnterpriseServices.DataForm;
using Forks.EnterpriseServices.DomainObjects2;
using Forks.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BWP.B3SheepButcherManage.BO
{
[DFClass, Serializable]
[LogicName("级别")]
[MapToTable("B3UnitedInfos_Goods")]
[DmoTypeID(B3FrameworksConsts.DmoTypeIDBases.B3SheepButcherManage, B3SheepButcherManageConsts.DmoTypeIDOffsets.Livestock)]
[DFCPrompt("畜类属性", Property = "GoodsProperty_ID")]
[DFCPrompt("畜类属性", Property = "GoodsProperty_Name")]
public class Livestock : B3ProduceUnitedInfos.BO.GoodsExt
{
}
}

+ 32
- 0
B3SheepButcherManage/BO/Bill/FixedPrice/FixedPrice.cs View File

@ -0,0 +1,32 @@
using BWP.B3Frameworks;
using BWP.B3Frameworks.Attributes;
using BWP.B3Frameworks.BO;
using Forks.EnterpriseServices;
using Forks.EnterpriseServices.DataForm;
using Forks.EnterpriseServices.DomainObjects2;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BWP.B3SheepButcherManage.BO
{
[LogicName("羊定价单")]
[Serializable, DFClass]
[DmoTypeID(B3FrameworksConsts.DmoTypeIDBases.B3SheepButcherManage, B3SheepButcherManageConsts.DmoTypeIDOffsets.FixedPrice)]
[EditUrl("~/B3SheepButcherManage/Bills/FixedPrice_/FixedPriceEdit.aspx")]
public class FixedPrice : DepartmentWorkFlowBill
{
[LogicName("执行时间")]
public DateTime? ExeTime { get; set; }
private FixedPrice_DetailCollection _detail = new FixedPrice_DetailCollection();
[OneToMany(typeof(FixedPrice_Detail), "ID")]
[Join("ID", "FixedPrice_ID")]
public FixedPrice_DetailCollection Details
{
get { return this._detail; }
set { this._detail = value; }
}
}
}

+ 75
- 0
B3SheepButcherManage/BO/Bill/FixedPrice/FixedPrice_Detail.cs View File

@ -0,0 +1,75 @@
using BWP.B3CowButcherManage;
using BWP.B3CowButcherManage.BO;
using BWP.B3Frameworks;
using BWP.B3Frameworks.BO;
using BWP.B3ProduceUnitedInfos;
using BWP.B3ProduceUnitedInfos.BO;
using Forks.EnterpriseServices;
using Forks.EnterpriseServices.DataForm;
using Forks.EnterpriseServices.DomainObjects2;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TSingSoft.WebControls2;
namespace BWP.B3SheepButcherManage.BO
{
[DFClass, Serializable]
[LogicName("羊定价单_明细")]
public class FixedPrice_Detail : Base
{
public long FixedPrice_ID { get; set; }
[LogicName("定价地区")]
[DFExtProperty("WebControlType", DFEditControl.ChoiceBox)]
[DFDataKind(B3CowButcherManageConsts.DataSources.计价区域全部)]
[DFExtProperty(B3FrameworksConsts.DFExtProperties.DisplayField, "ValuationArea_Name")]
[DFExtProperty(B3FrameworksConsts.DFExtProperties.QueryDataKind, B3CowButcherManageConsts.DataSources.计价区域全部)]
public long? ValuationArea_ID { get; set; }
[LogicName("定价地区")]
[ReferenceTo(typeof(ValuationArea), "Name")]
[Join("ValuationArea_ID", "ID")]
public string ValuationArea_Name { get; set; }
[LogicName("品种")]
[DFExtProperty("WebControlType", DFEditControl.ChoiceBox)]
[DFDataKind(B3ProduceUnitedInfosDataSources.活体品种)]
[DFExtProperty(B3FrameworksConsts.DFExtProperties.DisplayField, "LiveVarieties_Name")]
[DFExtProperty(B3FrameworksConsts.DFExtProperties.QueryDataKind, B3ProduceUnitedInfosDataSources.活体品种)]
public long? LiveVarieties_ID { get; set; }
[LogicName("品种")]
[ReferenceTo(typeof(LiveVarieties), "Name")]
[Join("LiveVarieties_ID", "ID")]
public string LiveVarieties_Name { get; set; }
[LogicName("级别")]
[DFExtProperty("WebControlType", DFEditControl.ChoiceBox)]
[DFDataKind(B3SheepButcherManageConsts.DataSources.活体级别)]
[DFExtProperty(B3FrameworksConsts.DFExtProperties.DisplayField, "Livestock_Name")]
[DFExtProperty(B3FrameworksConsts.DFExtProperties.QueryDataKind, B3SheepButcherManageConsts.DataSources.活体级别)]
public long? Livestock_ID { get; set; }
[LogicName("级别")]
[ReferenceTo(typeof(Livestock), "Name")]
[Join("Livestock_ID", "ID")]
public string Livestock_Name { get; set; }
[LogicName("单价")]
public decimal? Price { get; set; }
[LogicName("原单价")]
public decimal? OriginalPrice { get; set; }
[LogicName("备注")]
public string Remark { get; set; }
}
[Serializable]
public class FixedPrice_DetailCollection : DmoCollection<FixedPrice_Detail>
{ }
}

+ 4
- 1
B3SheepButcherManage/DmoTypeIDOffsets.cs View File

@ -9,12 +9,15 @@ namespace BWP.B3SheepButcherManage
{
internal static class DmoTypeIDOffsets
{
public const byte Livestock = 1;
public const byte FixedPrice = 2;
}
public static class DataSources
{
internal const string Prefix = "B3SheepButcherManager_";
//public const string 奖罚项目 = Prefix + "奖罚项目";
public const string = Prefix + "可屠宰存货属性";
public const string = Prefix + "活体级别";
}
public static class GlobalFlags


+ 7
- 5
WebFolder/config/Plugins/B3SheepButcherManage.Plugin View File

@ -20,7 +20,7 @@
<Profiles>
</Profiles>
<Security>
<!--<FunctionGroup name="计价区域" roleSchemas="employee">
<FunctionGroup name="级别" roleSchemas="employee">
<Function index="0" name="访问"/>
<Function index="1" name="新建"/>
<Function index="2" name="编辑"/>
@ -29,7 +29,7 @@
<Function index="5" name="启用"/>
<Function index="6" name="锁定"/>
<Function index="7" name="解锁"/>
</FunctionGroup>-->
</FunctionGroup>
<!--<FunctionGroup name="过磅单" roleSchemas="employee">
<Function index="0" name="访问" />
<Function index="1" name="新建" />
@ -61,7 +61,7 @@
<Function index="11" name="撤销完毕"/>
<Function index="12" name="打印"/>
</FunctionGroup>-->
<!--<FunctionGroup name="定价单" roleSchemas="employee">
<FunctionGroup name="定价单" roleSchemas="employee">
<Function index="0" name="访问" />
<Function index="1" name="新建" />
<Function index="2" name="编辑" />
@ -75,7 +75,8 @@
<Function index="10" name="完毕"/>
<Function index="11" name="撤销完毕"/>
<Function index="12" name="打印"/>
</FunctionGroup>-->
<Function index="13" name="调价"/>
</FunctionGroup>
<!--<FunctionGroup name="报表" roleSchemas="employee">
<Function index="0" name="过磅单分析" />
</FunctionGroup>-->
@ -95,7 +96,8 @@
</FunctionGroup>-->
</Security>
<Menus>
<!--<Menu id="0001" features="B3CowButcherManage.0001" name="/B3牛屠宰场管理/基础档案/计价区域/列表" roles="B3CowButcherManage.计价区域.访问" url="B3CowButcherManage/BaseInfo/ValuationArea_/ValuationAreaList.aspx"/>-->
<Menu id="0001" name="/B3羊屠宰场管理/基础档案/级别" roles="B3SheepButcherManage.级别.访问" url="B3SheepButcherManage/BaseInfos/Livestock_/LivestockList.aspx"/>
<Menu id="0002" name="/B3羊屠宰场管理/业务单据/羊定价单" roles="B3SheepButcherManage.羊定价单.访问" url="B3SheepButcherManage/Bills/FixedPrice_/FixedPriceList.aspx"/>
</Menus>
<Features>


+ 29
- 0
WebFolder/config/billreports/B3SheepButcherManage/FixedPricePrint.xml View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8" ?>
<BillReports xmlns="urn:BillReports" version="1.0" displayName="羊定价单" phyName="羊定价单">
<Report phyName="标准格式">
<BillReport xmlns="urn:BillReport" version="1" displayName="标准格式" >
<Bands>
<TextBand fontName="黑体" fontSize="15" align="Center">羊定价单№$Dmo.ID</TextBand>
<DFInfoBand object="$Dmo" cols="4">
<Field name="AccountingUnit_Name" lblWidth="4"/>
<Field name="Department_Name" lblWidth="4"/>
<Field name="ExeTime" lblWidth="4"/>
<Field name="Employee_Name" lblWidth="4"/>
<Field name="Remark" lblWidth="4"/>
</DFInfoBand>
<HtmlBand>
<![CDATA[<h2>定价明细</h2>]]>
</HtmlBand>
<DFListBand collection="$Details" itemType="$DetailType" enablePaging="true" >
<Field name="ValuationArea_Name"/>
<Field name="LiveVarieties_Name"/>
<Field name="Livestock_Name" />
<Field name="OriginalPrice" />
<Field name="Price"/>
<Field name="Remark" />
</DFListBand>
</Bands>
</BillReport>
</Report>
</BillReports>

Loading…
Cancel
Save