commit fa30dd2ad4125aeb23aabc0058e4abd366b2785f
Author: yibo <361071264@qq.com>
Date: Thu Sep 7 08:07:32 2017 +0800
Init
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..c87bf84
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,7 @@
+.*
+*.TMP
+*.suo
+*.user
+obj
+bin
+_ReSharper.B3ClientService
diff --git a/B3ClientService.Web/B3ClientService.Web.csproj b/B3ClientService.Web/B3ClientService.Web.csproj
new file mode 100644
index 0000000..412914c
--- /dev/null
+++ b/B3ClientService.Web/B3ClientService.Web.csproj
@@ -0,0 +1,95 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {3E6BA750-6C00-441D-A877-3958DF83A3B2}
+ Library
+ Properties
+ BWP.Web
+ B3ClientService.Web
+ v4.5
+ 512
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ False
+ ..\..\..\..\BwpB3Project\tsref\Debug\B3Frameworks.dll
+
+
+ False
+ ..\..\..\..\BwpB3Project\tsref\Debug\B3Frameworks.Web.dll
+
+
+ False
+ ..\..\..\..\BwpB3Project\tsref\Debug\Forks.EnterpriseServices.dll
+
+
+ False
+ ..\..\..\..\BwpB3Project\tsref\Debug\Forks.Utils.dll
+
+
+
+
+
+
+
+
+
+
+ False
+ ..\..\..\..\BwpB3Project\tsref\Debug\TSingSoft.WebControls2.dll
+
+
+ False
+ ..\..\..\..\BwpB3Project\tsref\Debug\Wpf.dll
+
+
+ False
+ ..\..\..\..\BwpB3Project\tsref\Debug\Wpf.System.dll
+
+
+ False
+ ..\..\..\..\BwpB3Project\tsref\Debug\Wpf.System.Web.dll
+
+
+
+
+ ASPXCodeBehind
+
+
+
+
+
+
+ {08f9760a-17fa-4908-8963-61137c051caf}
+ B3ClientService
+
+
+
+
+
\ No newline at end of file
diff --git a/B3ClientService.Web/Pages/B3ClientService/ServerHostConfig.cs b/B3ClientService.Web/Pages/B3ClientService/ServerHostConfig.cs
new file mode 100644
index 0000000..478b9bd
--- /dev/null
+++ b/B3ClientService.Web/Pages/B3ClientService/ServerHostConfig.cs
@@ -0,0 +1,59 @@
+using BWP.B3ClientService.BO;
+using System;
+using System.Web.UI.HtmlControls;
+using System.Web.UI.WebControls;
+using TSingSoft.WebControls2;
+using TSingSoft.WebPluginFramework.Controls;
+using TSingSoft.WebPluginFramework.Pages;
+using Forks.EnterpriseServices.DomainObjects2;
+using Forks.EnterpriseServices.DomainObjects2.DQuery;
+using TSingSoft.WebPluginFramework;
+using BWP.B3ClientService.Tasks;
+
+namespace BWP.Web.Pages.B3ClientService
+{
+ class ServerHostConfig : ServerPage
+ {
+ DFTextBox serverUrlInput;
+ protected override void InitForm(HtmlForm form)
+ {
+ form.Controls.Add(new PageTitle("服务器地址配置"));
+ var hPanel = new HLayoutPanel();
+ form.Controls.Add(hPanel);
+
+ hPanel.Add(new SimpleLabel("地址"));
+ serverUrlInput = hPanel.Add(new DFTextBox() { Width = Unit.Pixel(300) });
+ hPanel.Add(new TSButton("保存", delegate
+ {
+ if (serverUrlInput.IsEmpty)
+ throw new Exception("地址不能为空");
+ using (var session = Dmo.NewSession())
+ {
+ var entity = new ServerHost() { ServerUrl = serverUrlInput.Text.Trim() };
+ if (Exist())
+ session.Update(entity);
+ else
+ session.Insert(entity);
+ session.Commit();
+ }
+ AspUtil.Alert(this, "保存成功!");
+
+ }));
+ }
+
+ bool Exist()
+ {
+ var query = new DQueryDom(new JoinAlias(typeof(ServerHost)));
+ return query.EExists();
+ }
+
+ protected override void OnLoad(EventArgs e)
+ {
+ base.OnLoad(e);
+ if (!IsPostBack)
+ {
+ serverUrlInput.Text = ServerHost.GetServerUrl();
+ }
+ }
+ }
+}
diff --git a/B3ClientService.Web/PluginClass.cs b/B3ClientService.Web/PluginClass.cs
new file mode 100644
index 0000000..c562ce2
--- /dev/null
+++ b/B3ClientService.Web/PluginClass.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using TSingSoft.WebPluginFramework;
+
+namespace BWP.B3ClientService
+{
+ class PluginClass:IPluginClass
+ {
+ public void OnInit()
+ {
+ }
+ }
+}
diff --git a/B3ClientService.Web/Properties/AssemblyInfo.cs b/B3ClientService.Web/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..83b1581
--- /dev/null
+++ b/B3ClientService.Web/Properties/AssemblyInfo.cs
@@ -0,0 +1,35 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的常规信息通过以下
+// 特性集控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("B3ClientService.Web")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("B3ClientService.Web")]
+[assembly: AssemblyCopyright("Copyright © 2017")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 使此程序集中的类型
+// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
+// 则将该类型上的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("a86fdc64-cf43-4b58-915e-fe86b8b7762b")]
+
+// 程序集的版本信息由下面四个值组成:
+//
+// 主版本
+// 次版本
+// 生成号
+// 修订号
+//
+// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
+// 方法是按如下所示使用“*”:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
diff --git a/B3ClientService.sln b/B3ClientService.sln
new file mode 100644
index 0000000..413fcb5
--- /dev/null
+++ b/B3ClientService.sln
@@ -0,0 +1,54 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2013
+VisualStudioVersion = 12.0.40629.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "B3ClientService", "B3ClientService\B3ClientService.csproj", "{08F9760A-17FA-4908-8963-61137C051CAF}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "B3ClientService.Web", "B3ClientService.Web\B3ClientService.Web.csproj", "{3E6BA750-6C00-441D-A877-3958DF83A3B2}"
+EndProject
+Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "WebFolder(35)", "http://localhost:3252", "{45C3DB02-7DF0-42FD-B7CB-64F241CA2C71}"
+ ProjectSection(WebsiteProperties) = preProject
+ UseIISExpress = "true"
+ TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.5"
+ Debug.AspNetCompiler.VirtualPath = "/localhost_3252"
+ Debug.AspNetCompiler.PhysicalPath = "WebFolder\"
+ Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_3252\"
+ Debug.AspNetCompiler.Updateable = "true"
+ Debug.AspNetCompiler.ForceOverwrite = "true"
+ Debug.AspNetCompiler.FixedNames = "false"
+ Debug.AspNetCompiler.Debug = "True"
+ Release.AspNetCompiler.VirtualPath = "/localhost_3252"
+ Release.AspNetCompiler.PhysicalPath = "WebFolder\"
+ Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_3252\"
+ Release.AspNetCompiler.Updateable = "true"
+ Release.AspNetCompiler.ForceOverwrite = "true"
+ Release.AspNetCompiler.FixedNames = "false"
+ Release.AspNetCompiler.Debug = "False"
+ SlnRelativePath = "WebFolder\"
+ DefaultWebSiteLanguage = "Visual C#"
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {08F9760A-17FA-4908-8963-61137C051CAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {08F9760A-17FA-4908-8963-61137C051CAF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {08F9760A-17FA-4908-8963-61137C051CAF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {08F9760A-17FA-4908-8963-61137C051CAF}.Release|Any CPU.Build.0 = Release|Any CPU
+ {3E6BA750-6C00-441D-A877-3958DF83A3B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {3E6BA750-6C00-441D-A877-3958DF83A3B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3E6BA750-6C00-441D-A877-3958DF83A3B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {3E6BA750-6C00-441D-A877-3958DF83A3B2}.Release|Any CPU.Build.0 = Release|Any CPU
+ {45C3DB02-7DF0-42FD-B7CB-64F241CA2C71}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {45C3DB02-7DF0-42FD-B7CB-64F241CA2C71}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {45C3DB02-7DF0-42FD-B7CB-64F241CA2C71}.Release|Any CPU.ActiveCfg = Debug|Any CPU
+ {45C3DB02-7DF0-42FD-B7CB-64F241CA2C71}.Release|Any CPU.Build.0 = Debug|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/B3ClientService/B3ClientService.csproj b/B3ClientService/B3ClientService.csproj
new file mode 100644
index 0000000..c53de64
--- /dev/null
+++ b/B3ClientService/B3ClientService.csproj
@@ -0,0 +1,103 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {08F9760A-17FA-4908-8963-61137C051CAF}
+ Library
+ Properties
+ BWP.B3ClientService
+ B3ClientService
+ v4.5
+ 512
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ False
+ ..\..\..\..\BwpB3Project\tsref\Debug\B3Frameworks.dll
+
+
+ False
+ ..\..\..\..\BwpB3Project\tsref\Debug\Forks.EnterpriseServices.dll
+
+
+ False
+ ..\..\..\..\BwpB3Project\tsref\Debug\Forks.JsonRpc.Client.dll
+
+
+ False
+ ..\..\..\..\BwpB3Project\tsref\Debug\Forks.Utils.dll
+
+
+
+
+
+
+
+
+
+ False
+ ..\..\..\..\BwpB3Project\tsref\Debug\TSingSoft.WebControls2.dll
+
+
+ False
+ ..\..\..\..\BwpB3Project\tsref\Debug\Wpf.System.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/B3ClientService/BO/BaseInfo/BaseInfo.cs b/B3ClientService/BO/BaseInfo/BaseInfo.cs
new file mode 100644
index 0000000..82818a8
--- /dev/null
+++ b/B3ClientService/BO/BaseInfo/BaseInfo.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using TSingSoft.WebPluginFramework;
+
+namespace BWP.B3ClientService.BO
+{
+ [Serializable, BOClass]
+ public abstract class BaseInfo
+ {
+ public long ID { get; set; }
+
+ public string Name { get; set; }
+
+ public string Spell { get; set; }
+ }
+}
diff --git a/B3ClientService/BO/BaseInfo/Car.cs b/B3ClientService/BO/BaseInfo/Car.cs
new file mode 100644
index 0000000..15a85c7
--- /dev/null
+++ b/B3ClientService/BO/BaseInfo/Car.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BWP.B3ClientService.BO
+{
+ [Serializable]
+ public class Car : BaseInfo
+ {
+ }
+}
diff --git a/B3ClientService/BO/BaseInfo/EmpInfoTable.cs b/B3ClientService/BO/BaseInfo/EmpInfoTable.cs
new file mode 100644
index 0000000..459e8a0
--- /dev/null
+++ b/B3ClientService/BO/BaseInfo/EmpInfoTable.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using TSingSoft.WebPluginFramework;
+
+namespace BWP.B3ClientService.BO
+{
+ [Serializable, BOClass]
+ public class EmpInfoTable
+ {
+ public long User_ID { get; set; }
+ public string User_Name { get; set; }
+ public long Domain_ID { get; set; }
+ public long Employee_ID { get; set; }
+ public string Employee_Name { get; set; }
+ public long? AccountingUnit_ID { get; set; }
+ public string AccountingUnit_Name { get; set; }
+ public long? Department_ID { get; set; }
+ public string Department_Name { get; set; }
+ }
+}
diff --git a/B3ClientService/BO/BaseInfo/Farmer.cs b/B3ClientService/BO/BaseInfo/Farmer.cs
new file mode 100644
index 0000000..1252d6a
--- /dev/null
+++ b/B3ClientService/BO/BaseInfo/Farmer.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BWP.B3ClientService.BO
+{
+ [Serializable]
+ public class Farmer : BaseInfo
+ {
+ }
+}
diff --git a/B3ClientService/BO/BaseInfo/HogGrade.cs b/B3ClientService/BO/BaseInfo/HogGrade.cs
new file mode 100644
index 0000000..26b7983
--- /dev/null
+++ b/B3ClientService/BO/BaseInfo/HogGrade.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BWP.B3ClientService.BO
+{
+ [Serializable]
+ public class HogGrade : BaseInfo
+ {
+ }
+}
diff --git a/B3ClientService/BO/BaseInfo/LiveColonyHouse.cs b/B3ClientService/BO/BaseInfo/LiveColonyHouse.cs
new file mode 100644
index 0000000..2933f7b
--- /dev/null
+++ b/B3ClientService/BO/BaseInfo/LiveColonyHouse.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BWP.B3ClientService.BO
+{
+ [Serializable]
+ public class LiveColonyHouse : BaseInfo
+ {
+ }
+}
diff --git a/B3ClientService/BO/BaseInfo/LiveVarieties.cs b/B3ClientService/BO/BaseInfo/LiveVarieties.cs
new file mode 100644
index 0000000..7f02719
--- /dev/null
+++ b/B3ClientService/BO/BaseInfo/LiveVarieties.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BWP.B3ClientService.BO
+{
+ [Serializable]
+ public class LiveVarieties : BaseInfo
+ {
+ }
+}
diff --git a/B3ClientService/BO/BaseInfo/Livestock.cs b/B3ClientService/BO/BaseInfo/Livestock.cs
new file mode 100644
index 0000000..9f8a857
--- /dev/null
+++ b/B3ClientService/BO/BaseInfo/Livestock.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BWP.B3ClientService.BO
+{
+ [Serializable]
+ public class Livestock : BaseInfo
+ {
+ }
+}
diff --git a/B3ClientService/BO/BaseInfo/PurchaseType.cs b/B3ClientService/BO/BaseInfo/PurchaseType.cs
new file mode 100644
index 0000000..0dfa394
--- /dev/null
+++ b/B3ClientService/BO/BaseInfo/PurchaseType.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using TSingSoft.WebPluginFramework;
+
+namespace BWP.B3ClientService.BO
+{
+ [Serializable,BOClass]
+ public class PurchaseType
+ {
+ public short ID { get; set; }
+
+ public string Name { get; set; }
+ }
+}
diff --git a/B3ClientService/BO/BaseInfo/Sanction.cs b/B3ClientService/BO/BaseInfo/Sanction.cs
new file mode 100644
index 0000000..6dd76ab
--- /dev/null
+++ b/B3ClientService/BO/BaseInfo/Sanction.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using TSingSoft.WebPluginFramework;
+
+namespace BWP.B3ClientService.BO
+{
+ [Serializable, BOClass]
+ public class Sanction
+ {
+ public long ID { get; set; }
+
+ public long AbnormalItem_ID { get; set; }
+
+ public string AbnormalItem_Name { get; set; }
+ }
+}
diff --git a/B3ClientService/BO/BaseInfo/Supplier.cs b/B3ClientService/BO/BaseInfo/Supplier.cs
new file mode 100644
index 0000000..715d167
--- /dev/null
+++ b/B3ClientService/BO/BaseInfo/Supplier.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using TSingSoft.WebPluginFramework;
+
+namespace BWP.B3ClientService.BO
+{
+ [Serializable]
+ public class Supplier : BaseInfo
+ {
+ }
+}
diff --git a/B3ClientService/BO/BaseInfo/Zone.cs b/B3ClientService/BO/BaseInfo/Zone.cs
new file mode 100644
index 0000000..6a30819
--- /dev/null
+++ b/B3ClientService/BO/BaseInfo/Zone.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BWP.B3ClientService.BO
+{
+ [Serializable]
+ public class Zone : BaseInfo
+ {
+ }
+}
diff --git a/B3ClientService/BO/Bill/WeightBill/WeightBill.cs b/B3ClientService/BO/Bill/WeightBill/WeightBill.cs
new file mode 100644
index 0000000..8a9a412
--- /dev/null
+++ b/B3ClientService/BO/Bill/WeightBill/WeightBill.cs
@@ -0,0 +1,66 @@
+using Forks.EnterpriseServices.DomainObjects2;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using TSingSoft.WebPluginFramework;
+
+namespace BWP.B3ClientService.BO
+{
+ [Serializable, BOClass]
+ public class WeightBill
+ {
+ public string CreaterName { get; set; }
+ public long? Supplier_ID { get; set; }
+
+ public string Supplier_Name { get; set; }
+
+ public short? PurchaseType_ID { get; set; }
+
+ public string PurchaseType_Name { get; set; }
+
+ public DateTime? WeightTime { get; set; }
+
+ public long? Car_ID { get; set; }
+
+ public string Car_Name { get; set; }
+
+ public long? Livestock_ID { get; set; }
+
+ public string Livestock_Name { get; set; }
+
+ public long? Employee_ID { get; set; }
+
+ public string Employee_Name { get; set; }
+
+ public long? HogGrade_ID { get; set; }
+
+ public string HogGrade_Name { get; set; }
+
+ public long? Zone_ID { get; set; }
+
+ public string Zone_Name { get; set; }
+
+ public decimal? PenWeight { get; set; }
+
+ public decimal? PenPrice { get; set; }
+
+ public decimal? PenMoney { get; set; }
+
+ public string AnimalTestNumber { get; set; }
+
+ public DateTime? AnimalTestDate { get; set; }
+
+ public string AnimalTestMan { get; set; }
+
+ public string Remark { get; set; }
+
+ public long? Inspector_ID { get; set; }
+
+ public long? Inspector_Name { get; set; }
+
+ [DbColumn(DefaultValue = 0)]
+ public bool Sync { get; set; }
+ }
+}
diff --git a/B3ClientService/BO/ButcherOrder/ButcherOrder.cs b/B3ClientService/BO/ButcherOrder/ButcherOrder.cs
new file mode 100644
index 0000000..e111426
--- /dev/null
+++ b/B3ClientService/BO/ButcherOrder/ButcherOrder.cs
@@ -0,0 +1,29 @@
+using BWP.B3Frameworks.BO;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BWP.B3ClientService.BO
+{
+ [Serializable]
+ public class ButcherOrder : Base
+ {
+ public long BillID { get; set; }
+
+ public long BillDetailID { get; set; }
+
+ public int Order { get; set; }
+
+ public int PlanNumber { get; set; }
+
+ public DateTime Date { get; set; }
+
+ public int HotFadeNumber { get; set; }
+
+ public bool Sync { get; set; }
+
+ public bool UpLoad { get; set; }
+ }
+}
diff --git a/B3ClientService/BO/ButcherOrder/ButcherOrder_Detail.cs b/B3ClientService/BO/ButcherOrder/ButcherOrder_Detail.cs
new file mode 100644
index 0000000..5feabea
--- /dev/null
+++ b/B3ClientService/BO/ButcherOrder/ButcherOrder_Detail.cs
@@ -0,0 +1,19 @@
+using BWP.B3Frameworks.BO;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BWP.B3ClientService.BO
+{
+ [Serializable]
+ public class ButcherOrder_Detail : Base
+ {
+ public long ButcherOrder_ID { get; set; }
+
+ public DateTime Date { get; set; }
+
+ public int Number { get; set; }
+ }
+}
diff --git a/B3ClientService/BO/ServerHost.cs b/B3ClientService/BO/ServerHost.cs
new file mode 100644
index 0000000..5bd18bf
--- /dev/null
+++ b/B3ClientService/BO/ServerHost.cs
@@ -0,0 +1,33 @@
+using Forks.EnterpriseServices;
+using Forks.EnterpriseServices.DataForm;
+using Forks.EnterpriseServices.DomainObjects2;
+using Forks.EnterpriseServices.DomainObjects2.DQuery;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using TSingSoft.WebPluginFramework;
+
+namespace BWP.B3ClientService.BO
+{
+ [DFClass]
+ [Serializable]
+ [BOClass]
+ public class ServerHost
+ {
+ [LogicName("摘要")]
+ [DbColumn(Length = 1000)]
+ public string ServerUrl { get; set; }
+
+ public static string GetServerUrl()
+ {
+ using (var session = Dmo.NewSession())
+ {
+ var query = new DQueryDom(new JoinAlias(typeof(ServerHost)));
+ query.Columns.Add(DQSelectColumn.Field("ServerUrl"));
+ return query.EExecuteScalar();
+ }
+ }
+ }
+}
diff --git a/B3ClientService/BO/SyncBO/MinEmployee.cs b/B3ClientService/BO/SyncBO/MinEmployee.cs
new file mode 100644
index 0000000..4145587
--- /dev/null
+++ b/B3ClientService/BO/SyncBO/MinEmployee.cs
@@ -0,0 +1,36 @@
+using Forks.EnterpriseServices;
+using Forks.EnterpriseServices.DomainObjects2;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using TSingSoft.WebPluginFramework;
+
+namespace BWP.B3ClientService.BO
+{
+ [BOClass(Exclude = true)]
+ [Serializable]
+ [LogicName("")]
+ [MapToTable("B3Frameworks_Employee")]
+ public class MinEmployee
+ {
+ public long Domain_ID { get; set; }
+
+ public long ID { get; set; }
+
+ public string Name { get; set; }
+
+ public string Spell { get; set; }
+
+ public string Code { get; set; }
+
+ public bool Stopped { get; set; }
+
+ public bool IsLocked { get; set; }
+
+ public DateTime CreateTime { get; set; }
+
+ public DateTime ModifyTime { get; set; }
+ }
+}
diff --git a/B3ClientService/BO/SyncBO/MinWPF_User.cs b/B3ClientService/BO/SyncBO/MinWPF_User.cs
new file mode 100644
index 0000000..3db8852
--- /dev/null
+++ b/B3ClientService/BO/SyncBO/MinWPF_User.cs
@@ -0,0 +1,32 @@
+using Forks.EnterpriseServices;
+using Forks.EnterpriseServices.DomainObjects2;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using TSingSoft.WebPluginFramework;
+
+namespace BWP.B3ClientService.BO
+{
+ [BOClass(Exclude = true)]
+ [Serializable]
+ [LogicName("")]
+ [MapToTable("WPF_User")]
+ public class MinWPF_User
+ {
+ public long ID { get; set; }
+
+ public string Name { get; set; }
+
+ public bool Stopped { get; set; }
+
+ [DbColumn(AllowNull = false, DbType = SqlDbType.Binary, Length = 16)]
+ [SuppressMessage("Microsoft.Performance", "CA1819")]
+ public byte[] Password { get; set; }
+
+ public string RoleSchema { get; set; }
+ }
+}
diff --git a/B3ClientService/Properties/AssemblyInfo.cs b/B3ClientService/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..75e36c9
--- /dev/null
+++ b/B3ClientService/Properties/AssemblyInfo.cs
@@ -0,0 +1,39 @@
+using Forks.EnterpriseServices.DomainObjects2;
+using Forks.EnterpriseServices.Ert;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的常规信息通过以下
+// 特性集控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("B3ClientService")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("B3ClientService")]
+[assembly: AssemblyCopyright("Copyright © 2017")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 使此程序集中的类型
+// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
+// 则将该类型上的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("a45cd80c-4b93-474b-9f35-e4fc8550da4c")]
+
+// 程序集的版本信息由下面四个值组成:
+//
+// 主版本
+// 次版本
+// 生成号
+// 修订号
+//
+// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
+// 方法是按如下所示使用“*”:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyMapToTablePrefix("B3ClientService_")]
+[assembly: ErtAbbr("B3ClientService", "BWP.B3ClientService")]
diff --git a/B3ClientService/Rpcs/BaseInfoRpc.cs b/B3ClientService/Rpcs/BaseInfoRpc.cs
new file mode 100644
index 0000000..3de965f
--- /dev/null
+++ b/B3ClientService/Rpcs/BaseInfoRpc.cs
@@ -0,0 +1,141 @@
+using BWP.B3ClientService.BO;
+using Forks.EnterpriseServices.DomainObjects2;
+using Forks.EnterpriseServices.DomainObjects2.DQuery;
+using Forks.EnterpriseServices.JsonRpc;
+using Forks.EnterpriseServices.SqlDoms;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using TSingSoft.WebPluginFramework;
+
+namespace BWP.B3ClientService.Rpcs
+{
+ [Rpc]
+ public static class BaseInfoRpc
+ {
+ [Rpc]
+ public static List GetCarList(string input, string args, int top)
+ {
+ return GetBaseInfoList(input, args, top);
+ }
+
+ [Rpc]
+ public static List GetLivestockList(string input, string args, int top)
+ {
+ return GetBaseInfoList(input, args, top);
+ }
+
+ [Rpc]
+ public static List GetSupplierList(string input, string args, int top)
+ {
+ return GetBaseInfoList(input, args, top);
+ }
+
+ static List GetBaseInfoList(string input, string args, int top)
+ where T : BaseInfo
+ {
+ var query = new DQueryDom(new JoinAlias(typeof(T)));
+ if (top > 50)
+ top = 50;
+ query.Range = SelectRange.Top(top);
+ query.Columns.Add(DQSelectColumn.Field("ID"));
+ query.Columns.Add(DQSelectColumn.Field("Name"));
+ if (!string.IsNullOrEmpty(input))
+ query.Where.Conditions.Add(DQCondition.Or(DQCondition.Like("Name", input), DQCondition.Like("Spell", input)));
+ var list = new List();
+ using (var session = Dmo.NewSession())
+ {
+ using (var reader = session.ExecuteReader(query))
+ {
+ while (reader.Read())
+ list.Add(new WordPair(reader[1].ToString(), reader[0].ToString()));
+ }
+ }
+ return list;
+ }
+
+ [Rpc]
+ public static List GetPurchaseTypeList(string input, string args, int top)
+ {
+ var query = new DQueryDom(new JoinAlias(typeof(PurchaseType)));
+ if (top > 50)
+ top = 50;
+ query.Range = SelectRange.Top(top);
+ query.Columns.Add(DQSelectColumn.Field("ID"));
+ query.Columns.Add(DQSelectColumn.Field("Name"));
+ var list = new List();
+ using (var session = Dmo.NewSession())
+ {
+ using (var reader = session.ExecuteReader(query))
+ {
+ while (reader.Read())
+ list.Add(new WordPair(reader[1].ToString(), reader[0].ToString()));
+ }
+ }
+ return list;
+ }
+
+ [Rpc]
+ public static List GetEmployeeList(string input, string args, int top)
+ {
+ var query = new DQueryDom(new JoinAlias(typeof(BWP.B3Frameworks.BO.Employee)));
+ if (top > 50)
+ top = 50;
+ query.Range = SelectRange.Top(top);
+ query.Columns.Add(DQSelectColumn.Field("ID"));
+ query.Columns.Add(DQSelectColumn.Field("Name"));
+ query.Where.Conditions.Add(DQCondition.EQ("Stopped", false));
+ if (!string.IsNullOrEmpty(input))
+ query.Where.Conditions.Add(DQCondition.Or(DQCondition.Like("Name", input), DQCondition.Like("Spell", input)));
+ var list = new List();
+ using (var session = Dmo.NewSession())
+ {
+ using (var reader = session.ExecuteReader(query))
+ {
+ while (reader.Read())
+ list.Add(new WordPair(reader[1].ToString(), reader[0].ToString()));
+ }
+ }
+ return list;
+ }
+
+ [Rpc]
+ public static List GetZoneList(string input, string args, int top)
+ {
+ return GetBaseInfoList(input, args, top);
+ }
+
+ [Rpc]
+ public static List GetFarmerList(string input, string args, int top)
+ {
+ return GetBaseInfoList(input, args, top);
+ }
+
+ [Rpc]
+ public static List GetHogGradeList(string input, string args, int top)
+ {
+ return GetBaseInfoList(input, args, top);
+ }
+
+ [Rpc]
+ public static List GetLiveColonyHouseList(string input, string args, int top)
+ {
+ return GetBaseInfoList(input, args, top);
+ }
+
+ [Rpc]
+ public static List GetSanctionList()
+ {
+ var dmo = new DmoQuery(typeof(Sanction));
+ return dmo.EExecuteList().Cast().ToList();
+ }
+
+ [Rpc]
+ public static List GetLiveVarietiesList(string input, string args, int top)
+ {
+ return GetBaseInfoList(input, args, top);
+ }
+ }
+}
diff --git a/B3ClientService/Rpcs/BillRpc/WeightBillRpc.cs b/B3ClientService/Rpcs/BillRpc/WeightBillRpc.cs
new file mode 100644
index 0000000..8c57327
--- /dev/null
+++ b/B3ClientService/Rpcs/BillRpc/WeightBillRpc.cs
@@ -0,0 +1,26 @@
+using BWP.B3ClientService.BO;
+using Forks.EnterpriseServices.DomainObjects2;
+using Forks.EnterpriseServices.JsonRpc;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BWP.B3ClientService.Rpcs.BillRpc
+{
+ [Rpc]
+ public static class WeightBillRpc
+ {
+ [Rpc]
+ public static bool UploadBill(WeightBill dmo)
+ {
+ using (var session = Dmo.NewSession())
+ {
+ session.Insert(dmo);
+ session.Commit();
+ }
+ return true;
+ }
+ }
+}
diff --git a/B3ClientService/Rpcs/ButcherOrderRpc.cs b/B3ClientService/Rpcs/ButcherOrderRpc.cs
new file mode 100644
index 0000000..3fce921
--- /dev/null
+++ b/B3ClientService/Rpcs/ButcherOrderRpc.cs
@@ -0,0 +1,74 @@
+using BWP.B3ClientService.BO;
+using BWP.B3Frameworks.Utils;
+using Forks.EnterpriseServices.DomainObjects2;
+using Forks.EnterpriseServices.DomainObjects2.DQuery;
+using Forks.EnterpriseServices.JsonRpc;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using TSingSoft.WebPluginFramework;
+
+namespace BWP.B3ClientService.Rpcs
+{
+ [Rpc]
+ public static class ButcherOrderRpc
+ {
+ [Rpc]
+ public static List GetButcherOrder(DateTime date)
+ {
+ var query = new DmoQuery(typeof(ButcherOrder));
+ query.Where.Conditions.Add(DQCondition.EQ("Date", date));
+ return query.EExecuteList().Cast().ToList();
+ }
+
+ [Rpc]
+ public static List GetOrderDetail(long orderID)
+ {
+ var query = new DmoQuery(typeof(ButcherOrder_Detail));
+ query.Where.Conditions.Add(DQCondition.EQ("ButcherOrder_ID", orderID));
+ query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID"));
+ return query.EExecuteList().Cast().ToList();
+ }
+
+ static void UpdateButcherOrder(IDmoSession session, long id, int hotFadeNumber)
+ {
+ var order = InnerBLUtil.GetSingleDmo(session, "ID", id, "HotFadeNumber", "Sync");
+ order.HotFadeNumber += hotFadeNumber;
+ if (hotFadeNumber < 0 && order.Sync)
+ order.Sync = false;
+ var update = new DQUpdateDom(typeof(ButcherOrder));
+ update.Where.Conditions.Add(DQCondition.EQ("HotFadeNumber", order.HotFadeNumber));
+ update.Where.Conditions.Add(DQCondition.EQ("Sync", order.Sync));
+ update.Where.Conditions.Add(DQCondition.EQ("ID", id));
+ session.ExecuteNonQuery(update);
+ }
+
+ [Rpc]
+ public static void InsertOrderDetail(long orderID, int number)
+ {
+ using (var session = Dmo.NewSession())
+ {
+ var detail = new ButcherOrder_Detail();
+ detail.Number = number;
+ detail.Date = DateTime.Now;
+ detail.ButcherOrder_ID = orderID;
+ session.Insert(detail);
+ UpdateButcherOrder(session, orderID, detail.Number);
+ session.Commit();
+ }
+ }
+
+ [Rpc]
+ public static void DeleteOrderDetail(long id)
+ {
+ using (var session = Dmo.NewSession())
+ {
+ var detail = InnerBLUtil.GetSingleDmo(session, "ID", id, "ButcherOrder_ID", "Number");
+ UpdateButcherOrder(session, detail.ButcherOrder_ID, -detail.Number);
+ session.Commit();
+ }
+ }
+ }
+}
diff --git a/B3ClientService/Rpcs/UserInfoRpc.cs b/B3ClientService/Rpcs/UserInfoRpc.cs
new file mode 100644
index 0000000..891a64b
--- /dev/null
+++ b/B3ClientService/Rpcs/UserInfoRpc.cs
@@ -0,0 +1,36 @@
+using BWP.B3ClientService.BO;
+using BWP.B3Frameworks.BO;
+using Forks.EnterpriseServices.DomainObjects2;
+using Forks.EnterpriseServices.DomainObjects2.DQuery;
+using Forks.EnterpriseServices.JsonRpc;
+using Forks.EnterpriseServices.SqlDoms;
+using TSingSoft.WebPluginFramework;
+
+namespace BWP.B3ClientService.Rpcs
+{
+ [Rpc]
+ public static class UserInfoRpc
+ {
+ [Rpc(RpcFlags.SkipAuth)]
+ public static string GetUserName(string code)
+ {
+ var userEmp = new JoinAlias(typeof(EmpInfoTable));
+ var employee = new JoinAlias(typeof(Employee));
+ var query = new DQueryDom(userEmp);
+ query.From.AddJoin(JoinType.Inner, new DQDmoSource(employee), DQCondition.EQ(userEmp, "Employee_ID", employee, "ID"));
+ query.Columns.Add(DQSelectColumn.Field("User_Name", userEmp));
+ query.Where.Conditions.Add(DQCondition.EQ(employee, "Code", code));
+ query.Range = SelectRange.Top(1);
+ return query.EExecuteScalar();
+ }
+
+ [Rpc]
+ public static EmpInfoTable GetUserEmpInfo(string name)
+ {
+ var query = new DmoQuery(typeof(EmpInfoTable));
+ query.Where.Conditions.Add(DQCondition.EQ("User_Name", name));
+ query.Range = SelectRange.Top(1);
+ return query.EExecuteScalar();
+ }
+ }
+}
diff --git a/B3ClientService/Tasks/DownLoad/LoadButcherOrder.cs b/B3ClientService/Tasks/DownLoad/LoadButcherOrder.cs
new file mode 100644
index 0000000..4f04188
--- /dev/null
+++ b/B3ClientService/Tasks/DownLoad/LoadButcherOrder.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using TSingSoft.WebPluginFramework.TimerTasks;
+
+namespace BWP.B3ClientService.Tasks
+{
+ class LoadButcherOrder : ITimerTask
+ {
+ public void Execute()
+ {
+
+ }
+
+ public string Name
+ {
+ get { return "同步拍宰顺序"; }
+ }
+ }
+}
diff --git a/B3ClientService/Tasks/SyncInfoFromServer.cs b/B3ClientService/Tasks/SyncInfoFromServer.cs
new file mode 100644
index 0000000..912778d
--- /dev/null
+++ b/B3ClientService/Tasks/SyncInfoFromServer.cs
@@ -0,0 +1,259 @@
+using BWP.B3ClientService.BO;
+using BWP.B3Frameworks.BO;
+using Forks.EnterpriseServices.BusinessInterfaces;
+using Forks.EnterpriseServices.DomainObjects2;
+using Forks.EnterpriseServices.DomainObjects2.DQuery;
+using Forks.JsonRpc.Client;
+using Forks.JsonRpc.Client.Data;
+using Forks.Utils.Data;
+using System;
+using System.Collections.Generic;
+using System.Data.SqlClient;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using TSingSoft.WebPluginFramework;
+using TSingSoft.WebPluginFramework.TimerTasks;
+
+namespace BWP.B3ClientService.Tasks
+{
+ public class SyncInfoFromServer : ITimerTask
+ {
+ public void Execute()
+ {
+ var serverUri = ServerHost.GetServerUrl();
+ if (string.IsNullOrEmpty(serverUri))
+ throw new Exception("请配置服务器地址");
+ //try
+ {
+ try
+ {
+ RpcFacade.Init(serverUri, "B3ClientServer");
+ }
+ catch (Exception ex)
+ {
+ if (ex.Message != "Can only start once")
+ throw;
+ }
+ SyncWpfUser();
+ SyncUserEmployee();
+ SyncEmployee();
+ SyncEmpInfoTable();
+ SyncCar();
+ SyncLivestock();
+ SyncPurchaseType();
+ SyncSupplier();
+ SyncZone();
+ SyncFarmer();
+ SyncHogGrade();
+ SyncLiveColonyHouse();
+ SyncSanction();
+ //SyncLiveVarieties();
+ }
+ //catch
+ { }
+ }
+
+ static void SyncWpfUser()
+ {
+ var list = RpcFacade.Call>("/MainSystem/B3ButcherManage/Rpcs/TouchScreenRpcs/GetWpfUser");
+ using (var context = new TransactionContext())
+ {
+ var sql1 = @"truncate table [WPF_User];SET IDENTITY_INSERT [WPF_User] ON;
+";
+ context.Session.ExecuteSqlNonQuery(sql1);
+ foreach (RpcObject o in list)
+ {
+ var entity = new MinWPF_User();
+ entity.ID = o.Get("ID");
+ entity.Name = o.Get("Name");
+ entity.Stopped = o.Get("Stopped");
+ entity.Password = o.Get("Password");
+ entity.RoleSchema = o.Get("RoleSchema");
+ context.Session.Insert(entity);
+ }
+ var sql2 = @"SET IDENTITY_INSERT [WPF_User] OFF;";
+ context.Session.ExecuteSqlNonQuery(sql2);
+ context.Commit();
+ }
+ }
+
+ void SyncUserEmployee()
+ {
+ var list = RpcFacade.Call>("/MainSystem/B3ButcherManage/Rpcs/TouchScreenRpcs/GetUserEmployee");
+ using (var context = new TransactionContext())
+ {
+ var sql1 = @"truncate table [B3Frameworks_User_Employee];
+";
+ context.Session.ExecuteSqlNonQuery(sql1);
+ foreach (RpcObject o in list)
+ {
+ var entity = new User_Employee();
+ entity.Employee_ID = o.Get("Employee_ID");
+ entity.User_ID = o.Get("User_ID");
+ context.Session.Insert(entity);
+ }
+ context.Commit();
+ }
+ }
+
+ void SyncEmployee()
+ {
+ var list = RpcFacade.Call>("/MainSystem/B3ButcherManage/Rpcs/TouchScreenRpcs/GetEmployee");
+ using (var context = new TransactionContext())
+ {
+ var sql1 = @"truncate table [B3Frameworks_Employee];SET IDENTITY_INSERT [B3Frameworks_Employee] ON;
+";
+ context.Session.ExecuteSqlNonQuery(sql1);
+ foreach (RpcObject o in list)
+ {
+ var entity = new MinEmployee();
+ entity.ID = o.Get("ID");
+ entity.Spell = o.Get("Spell");
+ entity.Name = o.Get("Name");
+ entity.Code = o.Get("Code");
+ entity.Stopped = o.Get("Stopped");
+ entity.Domain_ID = o.Get("Domain_ID");
+ entity.IsLocked = false;
+ entity.CreateTime = DateTime.Today;
+ entity.ModifyTime = entity.CreateTime;
+ context.Session.Insert(entity);
+ }
+ var sql2 = @"SET IDENTITY_INSERT [B3Frameworks_Employee] OFF;";
+ context.Session.ExecuteSqlNonQuery(sql2);
+ context.Commit();
+ }
+ }
+
+ void SyncEmpInfoTable()
+ {
+ var list = RpcFacade.Call>("/MainSystem/B3ButcherManage/Rpcs/TouchScreenRpcs/GetEmpInfo");
+ using (var context = new TransactionContext())
+ {
+ var sql1 = @"truncate table [B3ClientService_EmpInfoTable];";
+ context.Session.ExecuteSqlNonQuery(sql1);
+ foreach (RpcObject o in list)
+ {
+ var entity = new EmpInfoTable();
+ entity.User_ID = o.Get("User_ID");
+ entity.User_Name = o.Get("User_Name");
+ entity.Domain_ID = o.Get("Domain_ID");
+ entity.Employee_ID = o.Get("Employee_ID");
+ entity.Employee_Name = o.Get("Employee_Name");
+ entity.Department_ID = o.Get("Department_ID");
+ entity.Department_Name = o.Get("Department_Name");
+ entity.AccountingUnit_ID = o.Get("AccountingUnit_ID");
+ entity.AccountingUnit_Name = o.Get("AccountingUnit_Name");
+ context.Session.Insert(entity);
+ }
+ context.Commit();
+ }
+ }
+
+ void SyncCar()
+ {
+ SyncBaseInfo("GetCar", "B3ClientService_Car");
+ }
+
+ void SyncLivestock()
+ {
+ SyncBaseInfo("GetLivestock", "B3ClientService_Livestock");
+ }
+
+ void SyncPurchaseType()
+ {
+ var list = RpcFacade.Call>("/MainSystem/B3ButcherManage/Rpcs/TouchScreenRpcs/GetPurchaseType");
+ using (var context = new TransactionContext())
+ {
+ var sql1 = @"truncate table [B3ClientService_PurchaseType];
+";
+ context.Session.ExecuteSqlNonQuery(sql1);
+ foreach (RpcObject o in list)
+ {
+ var entity = new PurchaseType();
+ entity.ID = o.Get("ID");
+ entity.Name = o.Get("Name");
+ context.Session.Insert(entity);
+ }
+ context.Commit();
+ }
+ }
+
+ void SyncSupplier()
+ {
+ SyncBaseInfo("GetSupplier", "B3ClientService_Supplier");
+ }
+
+ void SyncZone()
+ {
+ SyncBaseInfo("GetZone", "B3ClientService_Zone");
+ }
+
+ void SyncFarmer()
+ {
+ SyncBaseInfo("GetFarmer", "B3ClientService_Farmer");
+ }
+
+ void SyncHogGrade()
+ {
+ SyncBaseInfo("GetHogGrade", "B3ClientService_HogGrade");
+ }
+
+ void SyncLiveColonyHouse()
+ {
+ SyncBaseInfo("GetLiveColonyHouse", "B3ClientService_LiveColonyHouse");
+ }
+
+ void SyncSanction()
+ {
+ var list = RpcFacade.Call>("/MainSystem/B3ButcherManage/Rpcs/TouchScreenRpcs/GetSanctionSetting");
+ using (var context = new TransactionContext())
+ {
+ var sql1 = @"truncate table [B3ClientService_Sanction];
+";
+ context.Session.ExecuteSqlNonQuery(sql1);
+ foreach (RpcObject o in list)
+ {
+ var entity = new Sanction();
+ entity.ID = o.Get("ID");
+ entity.AbnormalItem_ID = o.Get("AbnormalItem_ID");
+ entity.AbnormalItem_Name = o.Get("AbnormalItem_Name");
+ context.Session.Insert(entity);
+ }
+ context.Commit();
+ }
+ }
+
+ void SyncLiveVarieties()
+ {
+ SyncBaseInfo("GetLiveVarieties", "B3ClientService_LiveVarieties");
+ }
+
+ void SyncBaseInfo(string rpcMethodName, string tableName, string rpcClassName = null)
+ where T : BWP.B3ClientService.BO.BaseInfo, new()
+ {
+ if (rpcClassName == null)
+ rpcClassName = "TouchScreenRpcs";
+ var list = RpcFacade.Call>(string.Format("/MainSystem/B3ButcherManage/Rpcs/{0}/{1}", rpcClassName, rpcMethodName));
+ using (var context = new TransactionContext())
+ {
+ var sql1 = string.Format(@"truncate table [{0}];", tableName);
+ context.Session.ExecuteSqlNonQuery(sql1);
+ foreach (RpcObject o in list)
+ {
+ var entity = new T();
+ entity.ID = o.Get("ID");
+ entity.Name = o.Get("Name");
+ entity.Spell = o.Get("Spell");
+ context.Session.Insert(entity);
+ }
+ context.Commit();
+ }
+ }
+
+ public string Name
+ {
+ get { return "从B3同步数据到Server服务器"; }
+ }
+ }
+}
diff --git a/B3ClientService/Tasks/UpdateLoad/UploadTest.cs b/B3ClientService/Tasks/UpdateLoad/UploadTest.cs
new file mode 100644
index 0000000..d57793d
--- /dev/null
+++ b/B3ClientService/Tasks/UpdateLoad/UploadTest.cs
@@ -0,0 +1,72 @@
+using BWP.B3ClientService.BO;
+using Forks.EnterpriseServices.DomainObjects2.DQuery;
+using Forks.JsonRpc.Client;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using TSingSoft.WebPluginFramework.BWPClients;
+using TSingSoft.WebPluginFramework.TimerTasks;
+using TSingSoft.WebPluginFramework;
+using Forks.JsonRpc.Client.Data;
+using Forks.EnterpriseServices.DomainObjects2;
+
+namespace BWP.B3ClientService.Tasks
+{
+ public class UploadTest : ITimerTask
+ {
+ public void Execute()
+ {
+ var serverUri = ServerHost.GetServerUrl();
+ if (string.IsNullOrEmpty(serverUri))
+ throw new Exception("请配置服务器地址");
+
+ var list = GetWeightBill();
+ foreach (var bill in list)
+ {
+ BWPClient bwpClient = new BWPClient(serverUri, bill.CreaterName);
+ var obj = ConvertToRpcObject(bill);
+ var id =bwpClient.Call("/MainSystem/B3ButcherManage/Rpcs/TouchScreenUploadRpc/InsertWeighBill", obj);
+ using (var dmo = Dmo.NewSession())
+ {
+
+ }
+
+ }
+ }
+
+ IEnumerable GetWeightBill()
+ {
+ var query = new DmoQuery(typeof(WeightBill));
+ query.Where.Conditions.Add(DQCondition.EQ("Sync", false));
+ return query.EExecuteList().Cast();
+ }
+
+ Dictionary ConvertToRpcObject(WeightBill bill)
+ {
+ var dic = new Dictionary();
+ dic.Add("AccountingUnit_ID", 1);
+ dic.Add("Department_ID", 5);
+ dic.Add("Domain_ID", 1);
+ dic.Add("Zone_ID", bill.Zone_ID);
+ dic.Add("Employee_ID", bill.Employee_ID);
+ dic.Add("Supplier_ID", bill.Supplier_ID);
+ dic.Add("WeighTime", bill.WeightTime);
+ dic.Add("ShackPrice", bill.PenPrice);
+ dic.Add("ShackWeight", bill.PenWeight);
+ dic.Add("PurchaseType", bill.PurchaseType_ID);
+ dic.Add("Inspector_ID", bill.Inspector_ID);
+ dic.Add("Car_ID", bill.Car_ID);
+ dic.Add("AnimalTestNumber", bill.AnimalTestNumber);
+ dic.Add("AnimalTestDate", bill.AnimalTestDate);
+ dic.Add("AnimalTestMan", bill.AnimalTestMan);
+ return dic;
+ }
+
+ public string Name
+ {
+ get { return "测试上传"; }
+ }
+ }
+}
diff --git a/B3ClientService/WordPair.cs b/B3ClientService/WordPair.cs
new file mode 100644
index 0000000..6758bea
--- /dev/null
+++ b/B3ClientService/WordPair.cs
@@ -0,0 +1,31 @@
+using Forks.EnterpriseServices.JsonRpc;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BWP.B3ClientService
+{
+ [RpcObject]
+ public class WordPair
+ {
+ public WordPair()
+ { }
+
+ public WordPair(string displayName)
+ {
+ DisplayName = displayName;
+ }
+
+ public WordPair(string displayName, string phyName)
+ {
+ DisplayName = displayName;
+ PhyName = phyName;
+ }
+
+ public string DisplayName { get; set; }
+
+ public string PhyName { get; set; }
+ }
+}
diff --git a/WebFolder/config/plugins/B3ClientService.plugin b/WebFolder/config/plugins/B3ClientService.plugin
new file mode 100644
index 0000000..6296580
--- /dev/null
+++ b/WebFolder/config/plugins/B3ClientService.plugin
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+