From 66dd7bcf3eb94fbfb1d51e68f8f1adbfbcc5d17b Mon Sep 17 00:00:00 2001
From: yibo <361071264@qq.com>
Date: Thu, 21 Sep 2017 10:50:27 +0800
Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E7=BB=8F=E6=A3=80=E8=B4=B9=20?=
=?UTF-8?q?=E7=8C=AA=E5=9C=BA=E6=89=A3=E6=AC=BE=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
B3ClientService/B3ClientService.csproj | 1 +
.../BO/Bill/WeightBill/WeightBill.cs | 4 ++++
.../BO/Bill/WeightBill/WeightDetail.cs | 24 +++++++++++++++++++
.../RpcBO/Bill/WeightBill/SWeightBill.cs | 4 ++++
B3ClientService/Rpcs/BillRpc/WeightBillRpc.cs | 24 ++++++++++++++++++-
5 files changed, 56 insertions(+), 1 deletion(-)
create mode 100644 B3ClientService/BO/Bill/WeightBill/WeightDetail.cs
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]