diff --git a/B3ClientService/B3ClientService.csproj b/B3ClientService/B3ClientService.csproj index 449aa3f..09cba2a 100644 --- a/B3ClientService/B3ClientService.csproj +++ b/B3ClientService/B3ClientService.csproj @@ -86,6 +86,7 @@ + diff --git a/B3ClientService/BO/Bill/WeightBill/WeightBill.cs b/B3ClientService/BO/Bill/WeightBill/WeightBill.cs index 8bbda6e..f752ddb 100644 --- a/B3ClientService/BO/Bill/WeightBill/WeightBill.cs +++ b/B3ClientService/BO/Bill/WeightBill/WeightBill.cs @@ -61,6 +61,10 @@ namespace BWP.B3ClientService.BO } } + public decimal? JingJianFee { get; set; } + + public decimal? DiscontMoney { get; set; } + public string AnimalTestNumber { get; set; } public DateTime? AnimalTestDate { get; set; } diff --git a/B3ClientService/BO/Bill/WeightBill/WeightDetail.cs b/B3ClientService/BO/Bill/WeightBill/WeightDetail.cs new file mode 100644 index 0000000..d93d1f6 --- /dev/null +++ b/B3ClientService/BO/Bill/WeightBill/WeightDetail.cs @@ -0,0 +1,24 @@ +using BWP.B3Frameworks.BO; +using Forks.EnterpriseServices.DomainObjects2; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace BWP.B3ClientService.BO +{ + [Serializable] + public class WeightDetail : Base + { + public long WeightBill_Detail_ID { get; set; } + + public string Type { get; set; } + + public decimal Weight { get; set; } + + public DateTime? Time { get; set; } + + [NonDmoProperty] + public bool Delete { get; set; } + } +} diff --git a/B3ClientService/RpcBO/Bill/WeightBill/SWeightBill.cs b/B3ClientService/RpcBO/Bill/WeightBill/SWeightBill.cs index fb03d33..a68e000 100644 --- a/B3ClientService/RpcBO/Bill/WeightBill/SWeightBill.cs +++ b/B3ClientService/RpcBO/Bill/WeightBill/SWeightBill.cs @@ -36,6 +36,10 @@ namespace BWP.B3ClientService.RpcBO public decimal? ShackPrice { get; set; } + public decimal? JingJianFee { get; set; } + + public decimal? DiscontMoney { get; set; } + public string AnimalTestNumber { get; set; } public DateTime? AnimalTestDate { get; set; } diff --git a/B3ClientService/Rpcs/BillRpc/WeightBillRpc.cs b/B3ClientService/Rpcs/BillRpc/WeightBillRpc.cs index c3a9f6a..b74415e 100644 --- a/B3ClientService/Rpcs/BillRpc/WeightBillRpc.cs +++ b/B3ClientService/Rpcs/BillRpc/WeightBillRpc.cs @@ -10,6 +10,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Web.Script.Serialization; using TSingSoft.WebPluginFramework; namespace BWP.B3ClientService.Rpcs.BillRpc @@ -17,9 +18,14 @@ namespace BWP.B3ClientService.Rpcs.BillRpc [Rpc] public static class WeightBillRpc { + static JavaScriptSerializer serializer = new JavaScriptSerializer(); + [Rpc] - public static BackRpcObj UploadBill(WeightBill dmo) + public static BackRpcObj UploadBill(WeightBill dmo, string recordDetail) { + recordDetail = recordDetail.ESerializeDateTime(); + var records = serializer.Deserialize>(recordDetail); + using (var session = Dmo.NewSession()) { if (dmo.ID == 0) @@ -40,6 +46,13 @@ namespace BWP.B3ClientService.Rpcs.BillRpc session.Insert(item); else session.Update(item); + foreach (var r in records) + { + if (r.Delete) + session.Delete(r); + else + session.Insert(r); + } } dmo.FarmerDetails = new WeightBill_FarmerDetailCollection(); dmo.Details = new WeightBill_DetailCollection(); @@ -389,6 +402,15 @@ namespace BWP.B3ClientService.Rpcs.BillRpc } return result; } + + [Rpc] + public static string GetWeightRecord(long id) + { + var query = new DmoQuery(typeof(WeightDetail)); + query.Where.Conditions.Add(DQCondition.EQ("WeightBill_Detail_ID", id)); + var result = query.EExecuteList(); + return serializer.Serialize(result); + } } [RpcObject]