From fd37a5db9296461772cd18208ec9dabcad1692fd Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Fri, 19 Jan 2018 13:14:23 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9C=80=E6=B1=82=E5=8D=95No.138390=20?= =?UTF-8?q?=E5=B1=A0=E5=AE=B0=E5=9C=BA=E7=AE=A1=E7=90=86=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=A1=A3=E6=A1=88=E2=80=9C=E6=94=B6=E8=B4=AD=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E2=80=9D=20=E6=8A=8A=E5=8E=9F=E6=9C=89=E7=9A=84NamedValue?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E6=8D=A2=E6=88=90=E6=A1=A3=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- B3ClientService/BO/BaseInfo/PurchaseType.cs | 5 +---- .../BO/Bill/WeightBill/WeightBill.cs | 2 +- .../DataPatch/UpdatePurchaseTypeColumn.cs | 19 +++++++++++++++++++ B3ClientService/Rpcs/BaseInfoRpc.cs | 17 +---------------- .../Rpcs/RpcBO/Bill/WeightBill/SWeightBill.cs | 2 +- B3ClientService/Tasks/SyncInfoFromServer.cs | 15 +-------------- 6 files changed, 24 insertions(+), 36 deletions(-) create mode 100644 B3ClientService/DataPatch/UpdatePurchaseTypeColumn.cs diff --git a/B3ClientService/BO/BaseInfo/PurchaseType.cs b/B3ClientService/BO/BaseInfo/PurchaseType.cs index 0dfa394..d9c3e01 100644 --- a/B3ClientService/BO/BaseInfo/PurchaseType.cs +++ b/B3ClientService/BO/BaseInfo/PurchaseType.cs @@ -8,10 +8,7 @@ using TSingSoft.WebPluginFramework; namespace BWP.B3ClientService.BO { [Serializable,BOClass] - public class PurchaseType + public class PurchaseType : BaseInfo { - public short ID { get; set; } - - public string Name { get; set; } } } diff --git a/B3ClientService/BO/Bill/WeightBill/WeightBill.cs b/B3ClientService/BO/Bill/WeightBill/WeightBill.cs index a646da9..8d04f7f 100644 --- a/B3ClientService/BO/Bill/WeightBill/WeightBill.cs +++ b/B3ClientService/BO/Bill/WeightBill/WeightBill.cs @@ -39,7 +39,7 @@ namespace BWP.B3ClientService.BO public string Zone_Name { get; set; } - public short? PurchaseType_ID { get; set; } + public long? PurchaseType_ID { get; set; } public string PurchaseType_Name { get; set; } diff --git a/B3ClientService/DataPatch/UpdatePurchaseTypeColumn.cs b/B3ClientService/DataPatch/UpdatePurchaseTypeColumn.cs new file mode 100644 index 0000000..c817560 --- /dev/null +++ b/B3ClientService/DataPatch/UpdatePurchaseTypeColumn.cs @@ -0,0 +1,19 @@ +using Forks.EnterpriseServices.BusinessInterfaces; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using TSingSoft.WebPluginFramework.Install; + +namespace BWP.B3ClientService.DataPatch +{ + [DataPatch] + public class UpdatePurchaseTypeColumn : IDataPatch + { + public void Execute(TransactionContext context) + { + var sql = @"update B3ClientService_WeightBill set PurchaseType_ID=PurchaseType_ID+1"; + context.Session.ExecuteSqlNonQuery(sql); + } + } +} diff --git a/B3ClientService/Rpcs/BaseInfoRpc.cs b/B3ClientService/Rpcs/BaseInfoRpc.cs index 8986ba3..678c08c 100644 --- a/B3ClientService/Rpcs/BaseInfoRpc.cs +++ b/B3ClientService/Rpcs/BaseInfoRpc.cs @@ -101,22 +101,7 @@ namespace BWP.B3ClientService.Rpcs [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; + return GetBaseInfoList(input, args, top); } [Rpc] diff --git a/B3ClientService/Rpcs/RpcBO/Bill/WeightBill/SWeightBill.cs b/B3ClientService/Rpcs/RpcBO/Bill/WeightBill/SWeightBill.cs index 8cfeaa0..226a41d 100644 --- a/B3ClientService/Rpcs/RpcBO/Bill/WeightBill/SWeightBill.cs +++ b/B3ClientService/Rpcs/RpcBO/Bill/WeightBill/SWeightBill.cs @@ -27,7 +27,7 @@ namespace BWP.B3ClientService.RpcBO public long? Zone_ID { get; set; } - public short? PurchaseType_ID { get; set; } + public long? PurchaseType_ID { get; set; } public long? Car_ID { get; set; } diff --git a/B3ClientService/Tasks/SyncInfoFromServer.cs b/B3ClientService/Tasks/SyncInfoFromServer.cs index da42200..8eb1842 100644 --- a/B3ClientService/Tasks/SyncInfoFromServer.cs +++ b/B3ClientService/Tasks/SyncInfoFromServer.cs @@ -336,20 +336,7 @@ namespace BWP.B3ClientService.Tasks 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(); - } + SyncBaseInfo("GetPurchaseType"); } void SyncSupplier()