From fe387a9fc4668c9360731bbb334e51ccb9984c51 Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Sat, 25 Nov 2017 08:34:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GradeAndWeight/GradeAndWeight_Detail.cs | 3 +++ .../BO/Bill/WeightBill/WeightBill.cs | 2 ++ .../Rpcs/BillRpc/GradeAndWeightRpc.cs | 20 ++++++++++++++++++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/B3ClientService/BO/Bill/GradeAndWeight/GradeAndWeight_Detail.cs b/B3ClientService/BO/Bill/GradeAndWeight/GradeAndWeight_Detail.cs index 1429b1a..c12000a 100644 --- a/B3ClientService/BO/Bill/GradeAndWeight/GradeAndWeight_Detail.cs +++ b/B3ClientService/BO/Bill/GradeAndWeight/GradeAndWeight_Detail.cs @@ -34,5 +34,8 @@ namespace BWP.B3ClientService.BO [DbColumn(DefaultValue = 0)] public bool IsDrop { get; set; } + + [DbColumn(DefaultValue = 0)] + public long SID { get; set; } } } diff --git a/B3ClientService/BO/Bill/WeightBill/WeightBill.cs b/B3ClientService/BO/Bill/WeightBill/WeightBill.cs index 9c1fbfc..d486032 100644 --- a/B3ClientService/BO/Bill/WeightBill/WeightBill.cs +++ b/B3ClientService/BO/Bill/WeightBill/WeightBill.cs @@ -48,6 +48,8 @@ namespace BWP.B3ClientService.BO public decimal? ShackPrice { get; set; } + public decimal? ShackMoney { get; set; } + public decimal? JingJianFee { get; set; } public decimal? DiscontMoney { get; set; } diff --git a/B3ClientService/Rpcs/BillRpc/GradeAndWeightRpc.cs b/B3ClientService/Rpcs/BillRpc/GradeAndWeightRpc.cs index 8295229..bba757e 100644 --- a/B3ClientService/Rpcs/BillRpc/GradeAndWeightRpc.cs +++ b/B3ClientService/Rpcs/BillRpc/GradeAndWeightRpc.cs @@ -72,7 +72,16 @@ namespace BWP.B3ClientService.Rpcs.BillRpc else { if (entity.ID == 0) - session.Insert(entity); + { + var existID = GetIDIfExist(session, entity.SID); + if (existID.HasValue) + { + entity.ID = existID.Value; + session.Update(entity); + } + else + session.Insert(entity); + } else session.Update(entity); } @@ -81,6 +90,15 @@ namespace BWP.B3ClientService.Rpcs.BillRpc return entity.ID; } + static long? GetIDIfExist(IDmoSession session, long sid) + { + var query = new DQueryDom(new JoinAlias(typeof(GradeAndWeight_Detail))); + query.Where.Conditions.Add(DQCondition.EQ("SID", sid)); + query.Columns.Add(DQSelectColumn.Field("ID")); + query.Range = SelectRange.Top(1); + return query.EExecuteScalar(session); + } + [Rpc] public static string GetBodyDiscontItemSetting() {