From 1518de8c2017b31e853ee3818a358b26fbd15ae3 Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Sat, 10 Mar 2018 15:07:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=20=E8=B5=B6=E7=8C=AA=E7=A1=AE?= =?UTF-8?q?=E8=AE=A4=E3=80=82=E5=8A=A0=20=E7=AA=92=E6=99=95=E7=A1=AE?= =?UTF-8?q?=E8=AE=A4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- B3ClientService/B3ClientService.csproj | 4 ++ .../BO/Bill/OrderDetail/BeforeDeathDetail.cs | 21 +++++++ .../BO/Bill/OrderDetail/OrderDetail.cs | 6 ++ .../Rpcs/BillRpc/BeforeDeathRpc.cs | 49 +++++++++++++++ B3ClientService/Rpcs/BillRpc/OutHouseRpc.cs | 62 +++++++++++++++++++ .../RpcBO/Bill/OrderDetail/OutHouseObj.cs | 15 +++++ .../config/plugins/B3ClientService.plugin | 2 + 7 files changed, 159 insertions(+) create mode 100644 B3ClientService/BO/Bill/OrderDetail/BeforeDeathDetail.cs create mode 100644 B3ClientService/Rpcs/BillRpc/BeforeDeathRpc.cs create mode 100644 B3ClientService/Rpcs/BillRpc/OutHouseRpc.cs create mode 100644 B3ClientService/Rpcs/RpcBO/Bill/OrderDetail/OutHouseObj.cs diff --git a/B3ClientService/B3ClientService.csproj b/B3ClientService/B3ClientService.csproj index 9ec946d..f2c7e08 100644 --- a/B3ClientService/B3ClientService.csproj +++ b/B3ClientService/B3ClientService.csproj @@ -97,6 +97,7 @@ + @@ -136,10 +137,12 @@ + + @@ -150,6 +153,7 @@ + diff --git a/B3ClientService/BO/Bill/OrderDetail/BeforeDeathDetail.cs b/B3ClientService/BO/Bill/OrderDetail/BeforeDeathDetail.cs new file mode 100644 index 0000000..69f24f8 --- /dev/null +++ b/B3ClientService/BO/Bill/OrderDetail/BeforeDeathDetail.cs @@ -0,0 +1,21 @@ +using BWP.B3Frameworks.BO; +using Forks.EnterpriseServices.DomainObjects2; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Text; + +namespace BWP.B3ClientService.BO +{ + [Serializable] + public class BeforeDeathDetail : Base + { + public long Main_ID { get; set; } + + public int Number { get; set; } + + [DbColumn(DbType = SqlDbType.DateTime)] + public DateTime Time { get; set; } + } +} diff --git a/B3ClientService/BO/Bill/OrderDetail/OrderDetail.cs b/B3ClientService/BO/Bill/OrderDetail/OrderDetail.cs index 7597e26..d55120a 100644 --- a/B3ClientService/BO/Bill/OrderDetail/OrderDetail.cs +++ b/B3ClientService/BO/Bill/OrderDetail/OrderDetail.cs @@ -54,5 +54,11 @@ namespace BWP.B3ClientService.BO public short? Technics { get; set; } public string Technics_Name { get; set; } + + [DbColumn(DefaultValue = 1)] + public bool OutHouse { get; set; } + + [DbColumn(DefaultValue = 1)] + public bool AlreadyDeath { get; set; } } } diff --git a/B3ClientService/Rpcs/BillRpc/BeforeDeathRpc.cs b/B3ClientService/Rpcs/BillRpc/BeforeDeathRpc.cs new file mode 100644 index 0000000..51f1597 --- /dev/null +++ b/B3ClientService/Rpcs/BillRpc/BeforeDeathRpc.cs @@ -0,0 +1,49 @@ +using BWP.B3ClientService.BO; +using Forks.EnterpriseServices.DomainObjects2; +using Forks.EnterpriseServices.DomainObjects2.DQuery; +using Forks.EnterpriseServices.JsonRpc; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web.Script.Serialization; +using TSingSoft.WebPluginFramework; + +namespace BWP.B3ClientService.Rpcs.BillRpc +{ + [Rpc] + public static class BeforeDeathRpc + { + static JavaScriptSerializer serializer = new JavaScriptSerializer(); + [Rpc] + public static int InsertBeforeDeathDetail(string json) + { + var entity = serializer.Deserialize(json); + entity.Time = DateTime.Now; + using (var session = Dmo.NewSession()) + { + session.Insert(entity); + session.Commit(); + } + return 1; + } + + [Rpc] + public static string GetBeforeDeathDetails(long main_id) + { + var query = new DmoQuery(typeof(BeforeDeathDetail)); + query.Where.Conditions.Add(DQCondition.EQ("Main_ID", main_id)); + var r = query.EExecuteList(); + return serializer.Serialize(r); + } + + [Rpc] + public static int DeleteBeforeDeathDetail(long id) + { + var delete = new DQDeleteDom(typeof(BeforeDeathDetail)); + delete.Where.Conditions.Add(DQCondition.EQ("ID", id)); + delete.EExecute(); + return 1; + } + } +} diff --git a/B3ClientService/Rpcs/BillRpc/OutHouseRpc.cs b/B3ClientService/Rpcs/BillRpc/OutHouseRpc.cs new file mode 100644 index 0000000..42ee0ec --- /dev/null +++ b/B3ClientService/Rpcs/BillRpc/OutHouseRpc.cs @@ -0,0 +1,62 @@ +using BWP.B3ClientService.BO; +using BWP.B3ClientService.Rpcs.RpcBO; +using Forks.EnterpriseServices.DomainObjects2; +using Forks.EnterpriseServices.DomainObjects2.DQuery; +using Forks.EnterpriseServices.JsonRpc; +using Forks.EnterpriseServices.SqlDoms; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web.Script.Serialization; +using TSingSoft.WebPluginFramework; + +namespace BWP.B3ClientService.Rpcs.BillRpc +{ + [Rpc] + public static class OutHouseRpc + { + static JavaScriptSerializer serializer = new JavaScriptSerializer(); + + [Rpc] + public static string GetUnFinishList(string fieldName) + { + var query = new DQueryDom(new JoinAlias(typeof(OrderDetail))); + query.Columns.Add(DQSelectColumn.Field("ID")); + query.Columns.Add(DQSelectColumn.Field("Order")); + query.Columns.Add(DQSelectColumn.Field("PlanNumber")); + query.Columns.Add(DQSelectColumn.Field("LiveColonyHouse_Name")); + query.Range = SelectRange.Top(6); + query.OrderBy.Expressions.Add(DQOrderByExpression.Create("Order")); + + query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("DeleteState", false), DQCondition.EQ("IsHurryButcher", false), DQCondition.EQ(fieldName, false))); + var list = new List(); + using (var session = Dmo.NewSession()) + { + using (var reader = session.ExecuteReader(query)) + { + while (reader.Read()) + { + var entity = new OutHouseObj(); + entity.ID = (long)reader[0]; + entity.Order = (int)reader[1]; + entity.Number = (int)reader[2]; + entity.LiveColonyHouse_Name = (string)reader[3]; + list.Add(entity); + } + } + } + return serializer.Serialize(list); + } + + [Rpc] + public static int SetOrderFinish(long id, string fieldName) + { + var update = new DQUpdateDom(typeof(OrderDetail)); + update.Where.Conditions.Add(DQCondition.EQ("ID", id)); + update.Columns.Add(new DQUpdateColumn(fieldName, true)); + update.EExecute(); + return 1; + } + } +} diff --git a/B3ClientService/Rpcs/RpcBO/Bill/OrderDetail/OutHouseObj.cs b/B3ClientService/Rpcs/RpcBO/Bill/OrderDetail/OutHouseObj.cs new file mode 100644 index 0000000..7e5070f --- /dev/null +++ b/B3ClientService/Rpcs/RpcBO/Bill/OrderDetail/OutHouseObj.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace BWP.B3ClientService.Rpcs.RpcBO +{ + public class OutHouseObj + { + public long ID { get; set; } + public int Order { get; set; } + public int Number { get; set; } + public string LiveColonyHouse_Name { get; set; } + } +} diff --git a/WebFolder/config/plugins/B3ClientService.plugin b/WebFolder/config/plugins/B3ClientService.plugin index a5d806d..00c25c9 100644 --- a/WebFolder/config/plugins/B3ClientService.plugin +++ b/WebFolder/config/plugins/B3ClientService.plugin @@ -24,6 +24,8 @@ + +