Browse Source

增加农行设备 配置表

master
luanhui 8 years ago
parent
commit
a6d4e3051b
9 changed files with 193 additions and 20 deletions
  1. +9
    -1
      B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj
  2. +67
    -0
      B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/CustomerDeviceSet_/CustomerDeviceSetEdit.cs
  3. +2
    -0
      B3QingDaoWanFu/B3QingDaoWanFu.csproj
  4. +33
    -0
      B3QingDaoWanFu/BL/CustomerDeviceSetBL.cs
  5. +55
    -0
      B3QingDaoWanFu/BO/CustomerDeviceSet.cs
  6. +6
    -12
      B3QingDaoWanFu/Rpc/GatheringRpc.cs
  7. +16
    -6
      B3WanFuSaleWebService/RpcHelper/RpcHelperUtil.cs
  8. +1
    -1
      B3WanFuSaleWebService/WebFolder/App_Data/PublishProfiles/WanFu.pubxml
  9. +4
    -0
      WebFolder/config/plugins/B3QingDaoWanFu.plugin

+ 9
- 1
B3QingDaoWanFu.Web/B3QingDaoWanFu.Web.csproj View File

@ -141,6 +141,9 @@
<Compile Include="DFGridReportPage.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Pages\B3QingDaoWanFu\CustomerDeviceSet_\CustomerDeviceSetEdit.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Pages\B3QingDaoWanFu\Overlays\SaleOutStoreEdit_Ext.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
@ -157,7 +160,12 @@
<Compile Include="PluginClass.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<ProjectReference Include="..\B3QingDaoWanFu\B3QingDaoWanFu.csproj">
<Project>{b47ce3c3-c269-48b8-84a7-32360e5a9e8e}</Project>
<Name>B3QingDaoWanFu</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Pages\B3QingDaoWanFu\Reports\ComprehensiveReport.xml" />
</ItemGroup>


+ 67
- 0
B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/CustomerDeviceSet_/CustomerDeviceSetEdit.cs View File

@ -0,0 +1,67 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;
using BWP.B3Frameworks.Utils;
using BWP.B3QingDaoWanFu.BL;
using BWP.B3QingDaoWanFu.BO;
using BWP.B3Sale.BO;
using BWP.B3Sale.Utils;
using Forks.EnterpriseServices.DataForm;
using Forks.Utils.Collections;
using TSingSoft.WebControls2;
namespace BWP.Web.Pages.B3QingDaoWanFu.CustomerDeviceSet_
{
class CustomerDeviceSetEdit: SingletonDmoEditPage<CustomerDeviceSet, ICustomerDeviceSetBL>
{
private DFEditGrid _grid;
protected override void BuildBody(VLayoutPanel vPanel)
{
var hPanel = vPanel.Add(new HLayoutPanel(), new VLayoutOption(HorizontalAlign.Center));
hPanel.Add(new SimpleLabel("结账客户"));
var chb = hPanel.Add(new ChoiceBox(B3SaleDataSources.));
chb.Width = 150;
chb.EnableInputArgument = true;
chb.EnableTopItem = true;
var bt = hPanel.Add(new TSButton("新增"));
bt.Click += delegate {
if (chb.IsEmpty)
throw new ApplicationException("结账客户");
if (Dmo.Details.Any(x => x.AccountCustomer_ID == short.Parse(chb.Value)))
return;
_grid.GetFromUI();
var detail = new CustomerDeviceSet_Detail();
detail.AccountCustomer_ID = short.Parse(chb.Value);
DmoUtil.RefreshDependency(detail, "AccountCustomer_ID");
Dmo.Details.Add(detail);
_grid.DataBind();
};
var detailEditor = new DFCollectionEditor<CustomerDeviceSet_Detail>(() => Dmo.Details);
detailEditor.AllowDeletionFunc = () => CanSave;
detailEditor.CanDeleteFunc = (detail) => CanSave;
detailEditor.IsEditableFunc = (field, detail) => CanSave;
_grid = vPanel.Add(new DFEditGrid(detailEditor) { Width = Unit.Percentage(50) }, new VLayoutOption(HorizontalAlign.Center));
_grid.Columns.Add(new DFEditGridColumn<DFValueLabel>("AccountCustomer_Name"));
_grid.Columns.EAdd(new DFEditGridColumn<DFTextBox>("DeviceCode")).InitEditControl += (send, e) => {
e.Control.Width=Unit.Percentage(100);
};
}
public override void AppToUI()
{
base.AppToUI();
_grid.DataBind();
}
public override void GetFromUI()
{
base.GetFromUI();
_grid.GetFromUI();
}
}
}

+ 2
- 0
B3QingDaoWanFu/B3QingDaoWanFu.csproj View File

@ -131,6 +131,8 @@
<Link>Customer_version.cs</Link>
</Compile>
<Compile Include="BLActions\SaleForecastBLAction.cs" />
<Compile Include="BL\CustomerDeviceSetBL.cs" />
<Compile Include="BO\CustomerDeviceSet.cs" />
<Compile Include="DataPatchs\StatPaySetBillNeedValue20171123.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Rpc\GatheringRpc.cs" />


+ 33
- 0
B3QingDaoWanFu/BL/CustomerDeviceSetBL.cs View File

@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BWP.B3Frameworks.BL;
using BWP.B3QingDaoWanFu.BO;
using BWP.B3Sale.BO;
using Forks.EnterpriseServices.BusinessInterfaces;
namespace BWP.B3QingDaoWanFu.BL
{
[BusinessInterface(typeof(CustomerDeviceSetBL))]
public interface ICustomerDeviceSetBL : ISingletonDmoBL<CustomerDeviceSet>
{
long GetAccountCustomer_ID(string outcode);
}
public class CustomerDeviceSetBL:DomainSingletonDmoBL<CustomerDeviceSet>, ICustomerDeviceSetBL
{
public long GetAccountCustomer_ID(string outcode)
{
var dmo = Load();
var fd = dmo.Details.FirstOrDefault(x => x.DeviceCode == outcode);
if (fd == null)
{
return 0;
}
return fd.AccountCustomer_ID??0;
}
}
}

+ 55
- 0
B3QingDaoWanFu/BO/CustomerDeviceSet.cs View File

@ -0,0 +1,55 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BWP.B3Frameworks;
using BWP.B3Frameworks.BO;
using BWP.B3Sale.BO;
using BWP.B3Sale.Utils;
using Forks.EnterpriseServices;
using Forks.EnterpriseServices.DataForm;
using Forks.EnterpriseServices.DomainObjects2;
namespace BWP.B3QingDaoWanFu.BO
{
[DFClass,Serializable,LogicName("结账客户设备配置")]
public class CustomerDeviceSet:DomainSingletonDmo
{
readonly CustomerDeviceSet_DetailCollection _details = new CustomerDeviceSet_DetailCollection();
[OneToMany(typeof(CustomerDeviceSet_Detail), "ID")]
[Join("ID", "CustomerDeviceSet_ID")]
public CustomerDeviceSet_DetailCollection Details
{
get { return _details; }
}
}
[DFClass, Serializable, LogicName("结账客户设备配置")]
public class CustomerDeviceSet_Detail : Base
{
public long CustomerDeviceSet_ID { get; set; }
[LogicName("结账客户")]
[DFDataKind(B3SaleDataSources.结账客户)]
[DFExtProperty(B3FrameworksConsts.DFExtProperties.DisplayField, "AccountCustomer_Name")]
public long? AccountCustomer_ID { get; set; }
[LogicName("结账客户")]
[ReferenceTo(typeof(Customer), "Name")]
[Join("AccountCustomer_ID", "ID")]
public string AccountCustomer_Name { get; set; }
[LogicName("设备号")]
public string DeviceCode { get; set; }
}
[Serializable]
public class CustomerDeviceSet_DetailCollection : DmoCollection<CustomerDeviceSet_Detail>
{
}
}

+ 6
- 12
B3QingDaoWanFu/Rpc/GatheringRpc.cs View File

@ -4,6 +4,7 @@ using System.Linq;
using System.Text;
using BWP.B3Frameworks;
using BWP.B3Frameworks.Utils;
using BWP.B3QingDaoWanFu.BL;
using BWP.B3QingDaoWanFu.Utils;
using BWP.B3Sale.BL;
using BWP.B3Sale.BO;
@ -26,16 +27,10 @@ namespace BWP.B3QingDaoWanFu.Rpc
var bl = BIFactory.Create<IGatheringBL>(context);
// bl.InitNewDmo(dmo);
dmo.Domain_ID = DomainContext.Current.ID;
var dom = new DQueryDom(new JoinAlias(typeof(Customer)));
dom.Columns.Add(DQSelectColumn.Field("AccountCustomer_ID"));
dom.Columns.Add(DQSelectColumn.Field("AccountCustomer_Name"));
dom.Where.Conditions.Add(DQCondition.EQ("OuterCode", dmo.AccountCustomer_OuterCode));//
//找到该客户对应的结账客户
var info = dom.EExecuteScalar<long, string>(context.Session);
if (info == null)
throw new ApplicationException(string.Format("没有配置外部编码{0}的对应结账客户", dmo.AccountCustomer_OuterCode));
dmo.AccountCustomer_ID = info.Item1;
dmo.AccountCustomer_Name = info.Item2;
var customerId = BIFactory.Create<ICustomerDeviceSetBL>().GetAccountCustomer_ID(dmo.AccountCustomer_OuterCode);
if (customerId == 0)
throw new ApplicationException(string.Format("没有设备号{0}的对应结账客户", dmo.AccountCustomer_OuterCode));
dmo.AccountCustomer_ID = customerId;
SetAccountCustomerInfo(dmo, context.Session);
@ -67,7 +62,6 @@ namespace BWP.B3QingDaoWanFu.Rpc
private static void SetAccountCustomerInfo(Gathering dmo, IDmoSessionWithTransaction session)
{
var dom = new DQueryDom(new JoinAlias(typeof(Customer)));
new Customer().Employee_ID = 1;
dom.Columns.Add(DQSelectColumn.Field("Department_ID"));
dom.Columns.Add(DQSelectColumn.Field("Employee_ID"));
dom.Columns.Add(DQSelectColumn.Field("Department_Name"));
@ -83,7 +77,7 @@ namespace BWP.B3QingDaoWanFu.Rpc
}
else
{
throw new ApplicationException(string.Format("不存在编号为{0}的客户", dmo.AccountCustomer_OuterCode));
throw new ApplicationException(string.Format("不存在ID为{0}的客户", dmo.AccountCustomer_ID));
}
}


+ 16
- 6
B3WanFuSaleWebService/RpcHelper/RpcHelperUtil.cs View File

@ -15,16 +15,26 @@ namespace RpcHelper {
public static string InsertGathering(string data) {
//测试用的
// using (var sr=new StreamReader("D:\\测试报文.txt"))
// {
// data=sr.ReadToEnd();
// }
if (data == "ceshi")
{
using (var sr = new StreamReader("D:\\测试报文.txt"))
{
data = sr.ReadToEnd();
}
}
var logName = DateTime.Today.Date.ToString("yyyyMMdd") + "Gatheringlog.txt";
var results = new Results();
var path = System.Web.HttpContext.Current.Request.PhysicalApplicationPath;
// var path = System.Web.HttpContext.Current.Request.PhysicalApplicationPath;
var path = "D:\\zhifutonglog\\";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string resultStr;
using (var textWriter = new StreamWriter(path + "\\log\\" + logName, true, Encoding.UTF8)) {
using (var textWriter = new StreamWriter(path + logName, true, Encoding.UTF8)) {
textWriter.WriteLine("{0} 收款单接口开始接收数据:------------------------------------", DateTime.Now);
textWriter.WriteLine(data);
Console.WriteLine("{0}:开始接受数据:", DateTime.Now);


+ 1
- 1
B3WanFuSaleWebService/WebFolder/App_Data/PublishProfiles/WanFu.pubxml View File

@ -6,7 +6,7 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedBuildConfiguration>Debug</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>


+ 4
- 0
WebFolder/config/plugins/B3QingDaoWanFu.plugin View File

@ -21,9 +21,13 @@
<FunctionGroup name="报表" roleSchemas="employee">
<Function index="0" name="收购综合报表"/>
</FunctionGroup>
<FunctionGroup name="配置" roleSchemas="employee">
<Function index="0" name="结账客户设备配置"/>
</FunctionGroup>
</Security>
<Menus>
<Menu id="0001" name="/B3青岛万福/报表/收购综合报表" roles="B3QingDaoWanFu.报表.收购综合报表" url="B3QingDaoWanFu/Reports/ComprehensiveReport.aspx"/>
<Menu id="0002" name="/B3青岛万福/结账客户设备配置" roles="B3QingDaoWanFu.配置.结账客户设备配置" url="B3QingDaoWanFu/CustomerDeviceSet_/CustomerDeviceSetEdit.aspx"/>
</Menus>
<Features>
</Features>


Loading…
Cancel
Save