|
|
|
@ -0,0 +1,54 @@ |
|
|
|
using BWP.B3ClientService.BO; |
|
|
|
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; |
|
|
|
|
|
|
|
namespace BWP.B3ClientService.Rpcs.BillRpc |
|
|
|
{ |
|
|
|
[Rpc] |
|
|
|
public static class DropPigRpc |
|
|
|
{ |
|
|
|
static JavaScriptSerializer serializer = new JavaScriptSerializer(); |
|
|
|
[Rpc] |
|
|
|
public static string GetDropPigOrderList(DateTime butcherDate) |
|
|
|
{ |
|
|
|
var main = new JoinAlias(typeof(OrderDetail)); |
|
|
|
var second = new JoinAlias(typeof(SecondOrder)); |
|
|
|
var query = new DQueryDom(main); |
|
|
|
query.From.AddJoin(JoinType.Inner, new DQDmoSource(second), DQCondition.And(DQCondition.EQ(main, "ID", second, "OrderDetail_ID"))); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("B3WeighBill_ID")); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("ID")); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("Order")); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("PlanNumber")); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("HotFadeNumber", second)); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("IsDrop")); |
|
|
|
query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("Date", butcherDate), DQCondition.EQ("DeleteState", false))); |
|
|
|
var list = new List<DropPigOrderList>(); |
|
|
|
using (var session = Dmo.NewSession()) |
|
|
|
{ |
|
|
|
using (var reader = session.ExecuteReader(query)) |
|
|
|
{ |
|
|
|
while (reader.Read()) |
|
|
|
{ |
|
|
|
var entity = new DropPigOrderList(); |
|
|
|
entity.B3WeighBill_ID = (long?)reader[0]; |
|
|
|
entity.OrderDetail_ID = (long)reader[1]; |
|
|
|
entity.Order = (int)reader[2]; |
|
|
|
entity.PlanNumber = (int)reader[3]; |
|
|
|
entity.HotFadeNumber = (int)reader[4]; |
|
|
|
entity.IsDrop = (bool)reader[5]; |
|
|
|
list.Add(entity); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return serializer.Serialize(list); |
|
|
|
} |
|
|
|
} |
|
|
|
} |