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() {