|
|
|
@ -220,7 +220,7 @@ namespace BWP.B3ClientService.Rpcs.BillRpc |
|
|
|
return GetOrderDetailProperty<int>(id, "PlanNumber"); |
|
|
|
} |
|
|
|
|
|
|
|
static T GetOrderDetailProperty<T>(long id,string property) |
|
|
|
static T GetOrderDetailProperty<T>(long id, string property) |
|
|
|
{ |
|
|
|
var query = new DQueryDom(new JoinAlias(typeof(OrderDetail))); |
|
|
|
query.Columns.Add(DQSelectColumn.Field(property)); |
|
|
|
@ -419,14 +419,14 @@ namespace BWP.B3ClientService.Rpcs.BillRpc |
|
|
|
} |
|
|
|
|
|
|
|
[Rpc] |
|
|
|
public static string GetSelectHurryList() |
|
|
|
public static string GetSelectHurryList(DateTime butcherDate) |
|
|
|
{ |
|
|
|
var bill = new JoinAlias(typeof(WeightBill)); |
|
|
|
var detail = new JoinAlias(typeof(WeightBill_Detail)); |
|
|
|
var query = new DQueryDom(bill); |
|
|
|
query.From.AddJoin(JoinType.Left, new DQDmoSource(detail), DQCondition.And(DQCondition.EQ(bill, "ID", detail, "WeightBill_ID"), DQCondition.EQ(detail, "DeleteState", false))); |
|
|
|
var hurry = HurryOrderTemp.Register(query, bill, false); |
|
|
|
var start = StartOrderTemp.Register(query, bill); |
|
|
|
var start = StartOrderTemp.Register(query, bill, butcherDate); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("ID")); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("B3ID")); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("Supplier_Name")); |
|
|
|
@ -434,7 +434,7 @@ namespace BWP.B3ClientService.Rpcs.BillRpc |
|
|
|
query.Columns.Add(DQSelectColumn.Field("Number", detail)); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("Number", hurry)); |
|
|
|
|
|
|
|
query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("DeleteState", false), DQCondition.InEQ("HouseNames", ""), DQCondition.IsNull(DQExpression.Field(start, "WeightBill_ID")))); |
|
|
|
query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("DeleteState", false), DQCondition.InEQ("HouseNames", ""))); |
|
|
|
|
|
|
|
var list = new List<SelectHurryList>(); |
|
|
|
using (var session = Dmo.NewSession()) |
|
|
|
@ -462,17 +462,19 @@ namespace BWP.B3ClientService.Rpcs.BillRpc |
|
|
|
{ |
|
|
|
public long WeightBill_ID { get; set; } |
|
|
|
|
|
|
|
public static JoinAlias Register(DQueryDom rootQuery, JoinAlias rootAlias) |
|
|
|
public static JoinAlias Register(DQueryDom rootQuery, JoinAlias rootAlias, DateTime date) |
|
|
|
{ |
|
|
|
var query = new DQueryDom(new JoinAlias(typeof(OrderDetail))); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("WeightBill_ID")); |
|
|
|
query.GroupBy.Expressions.Add(DQExpression.Field("WeightBill_ID")); |
|
|
|
query.Where.Conditions.Add(DQCondition.EQ("DeleteState", false)); |
|
|
|
query.Having.Conditions.Add(DQCondition.GreaterThanOrEqual(DQExpression.Min(DQExpression.Field("OrderState")), DQExpression.Value(10))); |
|
|
|
var detail = new JoinAlias(typeof(WeightBill_Detail)); |
|
|
|
var order = new JoinAlias(typeof(OrderDetail)); |
|
|
|
var query = new DQueryDom(detail); |
|
|
|
query.From.AddJoin(JoinType.Left, new DQDmoSource(order), DQCondition.And(DQCondition.EQ(detail, "WeightBill_ID", order, "WeightBill_ID"), DQCondition.EQ(order, "DeleteState", false))); |
|
|
|
query.Columns.Add(DQSelectColumn.Field("WeightBill_ID", detail)); |
|
|
|
query.GroupBy.Expressions.Add(DQExpression.Field(detail, "WeightBill_ID")); |
|
|
|
query.Where.Conditions.Add(DQCondition.And(DQCondition.Or(DQCondition.IsNull(DQExpression.Field(order, "ID")), DQCondition.EQ(order, "Date", date)), DQCondition.EQ(detail, "DeleteState", false))); |
|
|
|
|
|
|
|
rootQuery.RegisterQueryTable(typeof(StartOrderTemp), new string[] { "WeightBill_ID" }, query); |
|
|
|
var alias = new JoinAlias(typeof(StartOrderTemp)); |
|
|
|
rootQuery.From.AddJoin(JoinType.Left, new DQDmoSource(alias), DQCondition.EQ(rootAlias, "ID", alias, "WeightBill_ID")); |
|
|
|
rootQuery.From.AddJoin(JoinType.Inner, new DQDmoSource(alias), DQCondition.EQ(rootAlias, "ID", alias, "WeightBill_ID")); |
|
|
|
return alias; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -492,7 +494,7 @@ namespace BWP.B3ClientService.Rpcs.BillRpc |
|
|
|
} |
|
|
|
|
|
|
|
[Rpc] |
|
|
|
public static long InsertByHurryRecord(string insert,long hurryID) |
|
|
|
public static long InsertByHurryRecord(string insert, long hurryID) |
|
|
|
{ |
|
|
|
insert = insert.ESerializeDateTime(); |
|
|
|
var entity = serializer.Deserialize<OrderDetail>(insert); |
|
|
|
@ -511,7 +513,7 @@ namespace BWP.B3ClientService.Rpcs.BillRpc |
|
|
|
static void SetHurryRecordToOrderID(IDmoSession session, long orderID, long hurryID) |
|
|
|
{ |
|
|
|
var update = new DQUpdateDom(typeof(HurryRecord)); |
|
|
|
update.Where.Conditions.Add(DQCondition.EQ("ID",hurryID)); |
|
|
|
update.Where.Conditions.Add(DQCondition.EQ("ID", hurryID)); |
|
|
|
update.Columns.Add(new DQUpdateColumn("ToOrderDetail_ID", orderID)); |
|
|
|
session.ExecuteNonQuery(update); |
|
|
|
} |
|
|
|
@ -521,7 +523,7 @@ namespace BWP.B3ClientService.Rpcs.BillRpc |
|
|
|
var update = new DQUpdateDom(typeof(HurryRecord)); |
|
|
|
update.Where.Conditions.Add(DQCondition.EQ("ToOrderDetail_ID", orderID)); |
|
|
|
update.Columns.Add(new DQUpdateColumn("ToOrderDetail_ID", DQExpression.NULL)); |
|
|
|
session.ExecuteNonQuery(update); |
|
|
|
session.ExecuteNonQuery(update); |
|
|
|
} |
|
|
|
#endregion
|
|
|
|
} |
|
|
|
|