|
|
@ -153,7 +153,8 @@ namespace BWP.B3ClientService.Rpcs.BillRpc |
|
|
query.Columns.Add(DQSelectColumn.Field("LiveColonyHouse_Name")); |
|
|
query.Columns.Add(DQSelectColumn.Field("LiveColonyHouse_Name")); |
|
|
query.Columns.Add(DQSelectColumn.Field("IsHurryButcher")); |
|
|
query.Columns.Add(DQSelectColumn.Field("IsHurryButcher")); |
|
|
query.Columns.Add(DQSelectColumn.Field("B3WeighBill_ID")); |
|
|
query.Columns.Add(DQSelectColumn.Field("B3WeighBill_ID")); |
|
|
query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("Date", date), DQCondition.EQ("DeleteState", false), DQCondition.EQ("SecondarySplit", false))); |
|
|
|
|
|
|
|
|
query.Columns.Add(DQSelectColumn.Field("SecondarySplit")); |
|
|
|
|
|
query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("Date", date), DQCondition.EQ("DeleteState", false))); |
|
|
if (minOrder.HasValue) |
|
|
if (minOrder.HasValue) |
|
|
query.Where.Conditions.Add(DQCondition.GreaterThanOrEqual("Order", minOrder)); |
|
|
query.Where.Conditions.Add(DQCondition.GreaterThanOrEqual("Order", minOrder)); |
|
|
var list = new List<OrderDetail>(); |
|
|
var list = new List<OrderDetail>(); |
|
|
@ -171,6 +172,7 @@ namespace BWP.B3ClientService.Rpcs.BillRpc |
|
|
entity.LiveColonyHouse_Name = (string)reader[4]; |
|
|
entity.LiveColonyHouse_Name = (string)reader[4]; |
|
|
entity.IsHurryButcher = (bool)reader[5]; |
|
|
entity.IsHurryButcher = (bool)reader[5]; |
|
|
entity.B3WeighBill_ID = (long?)reader[6]; |
|
|
entity.B3WeighBill_ID = (long?)reader[6]; |
|
|
|
|
|
entity.SecondarySplit = (bool)reader[7]; |
|
|
list.Add(entity); |
|
|
list.Add(entity); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -201,9 +203,10 @@ namespace BWP.B3ClientService.Rpcs.BillRpc |
|
|
{ |
|
|
{ |
|
|
insert = insert.ESerializeDateTime(); |
|
|
insert = insert.ESerializeDateTime(); |
|
|
var entity = serializer.Deserialize<OrderDetail>(insert); |
|
|
var entity = serializer.Deserialize<OrderDetail>(insert); |
|
|
entity.ModifyTime = DateTime.Now; |
|
|
|
|
|
using (var session = Dmo.NewSession()) |
|
|
using (var session = Dmo.NewSession()) |
|
|
{ |
|
|
{ |
|
|
|
|
|
CheckCanInsert(session, entity.Order, entity.Date.Value); |
|
|
|
|
|
entity.ModifyTime = DateTime.Now; |
|
|
UpdateOrder(session, entity.Order - 1, 1, entity.Date); |
|
|
UpdateOrder(session, entity.Order - 1, 1, entity.Date); |
|
|
session.Insert(entity); |
|
|
session.Insert(entity); |
|
|
session.Commit(); |
|
|
session.Commit(); |
|
|
@ -211,6 +214,16 @@ namespace BWP.B3ClientService.Rpcs.BillRpc |
|
|
return entity.ID; |
|
|
return entity.ID; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void CheckCanInsert(IDmoSession session, int order, DateTime date) |
|
|
|
|
|
{ |
|
|
|
|
|
var query = new DQueryDom(new JoinAlias(typeof(OrderDetail))); |
|
|
|
|
|
query.Range = SelectRange.Top(1); |
|
|
|
|
|
query.Columns.Add(DQSelectColumn.Create(DQExpression.Value(1), "c")); |
|
|
|
|
|
query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("Date", date), DQCondition.EQ("DeleteState", false), DQCondition.EQ("SecondarySplit", true), DQCondition.GreaterThanOrEqual("Order", order))); |
|
|
|
|
|
if (query.EExecuteScalar(session) != null) |
|
|
|
|
|
throw new Exception("不允许插入到已进行烫毛计数顺序之前"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
static void UpdateOrderDetailPartial(IDmoSession session, long id, string property, object value) |
|
|
static void UpdateOrderDetailPartial(IDmoSession session, long id, string property, object value) |
|
|
{ |
|
|
{ |
|
|
var update = new DQUpdateDom(typeof(OrderDetail)); |
|
|
var update = new DQUpdateDom(typeof(OrderDetail)); |
|
|
@ -222,11 +235,25 @@ namespace BWP.B3ClientService.Rpcs.BillRpc |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
[Rpc] |
|
|
[Rpc] |
|
|
public static int UpdateOrderProperty(long id, string property, object value) |
|
|
|
|
|
|
|
|
public static int UpdateNum(long id, int number) |
|
|
|
|
|
{ |
|
|
|
|
|
using (var session = Dmo.NewSession()) |
|
|
|
|
|
{ |
|
|
|
|
|
var secondSplit = InnerBLUtil.GetDmoPropertyByID<bool>(session, typeof(OrderDetail), "SecondarySplit", id); |
|
|
|
|
|
if (secondSplit) |
|
|
|
|
|
throw new Exception("已进行烫毛计数,不能修改"); |
|
|
|
|
|
UpdateOrderDetailPartial(session, id, "PlanNumber", number); |
|
|
|
|
|
session.Commit(); |
|
|
|
|
|
} |
|
|
|
|
|
return 1; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Rpc] |
|
|
|
|
|
public static int UpdateHurryFlag(long id, bool isHurryButcher) |
|
|
{ |
|
|
{ |
|
|
using (var session = Dmo.NewSession()) |
|
|
using (var session = Dmo.NewSession()) |
|
|
{ |
|
|
{ |
|
|
UpdateOrderDetailPartial(session, id, property, value); |
|
|
|
|
|
|
|
|
UpdateOrderDetailPartial(session, id, "IsHurryButcher", isHurryButcher); |
|
|
session.Commit(); |
|
|
session.Commit(); |
|
|
} |
|
|
} |
|
|
return 1; |
|
|
return 1; |
|
|
@ -237,7 +264,9 @@ namespace BWP.B3ClientService.Rpcs.BillRpc |
|
|
{ |
|
|
{ |
|
|
using (var session = Dmo.NewSession()) |
|
|
using (var session = Dmo.NewSession()) |
|
|
{ |
|
|
{ |
|
|
var entity = InnerBLUtil.GetSingleDmo<OrderDetail>(session, "ID", id, "Order", "Date"); |
|
|
|
|
|
|
|
|
var entity = InnerBLUtil.GetSingleDmo<OrderDetail>(session, "ID", id, "Order", "Date", "SecondarySplit"); |
|
|
|
|
|
if (entity.SecondarySplit) |
|
|
|
|
|
throw new Exception("已进行烫毛计数,不能修改"); |
|
|
UpdateOrder(session, entity.Order, -1, entity.Date); |
|
|
UpdateOrder(session, entity.Order, -1, entity.Date); |
|
|
UpdateOrderDetailPartial(session, id, "DeleteState", true); |
|
|
UpdateOrderDetailPartial(session, id, "DeleteState", true); |
|
|
session.Commit(); |
|
|
session.Commit(); |
|
|
@ -265,7 +294,7 @@ namespace BWP.B3ClientService.Rpcs.BillRpc |
|
|
update.Columns.Add(new DQUpdateColumn("Order", DQExpression.Add(DQExpression.Field("Order"), DQExpression.Value(offset)))); |
|
|
update.Columns.Add(new DQUpdateColumn("Order", DQExpression.Add(DQExpression.Field("Order"), DQExpression.Value(offset)))); |
|
|
update.Columns.Add(new DQUpdateColumn("Sync", false)); |
|
|
update.Columns.Add(new DQUpdateColumn("Sync", false)); |
|
|
update.Columns.Add(new DQUpdateColumn("ModifyTime", DateTime.Now)); |
|
|
update.Columns.Add(new DQUpdateColumn("ModifyTime", DateTime.Now)); |
|
|
update.Where.Conditions.Add(DQCondition.And(DQCondition.GreaterThan("Order", greaterThanOrder), DQCondition.EQ("Date", date), DQCondition.EQ("DeleteState", false), DQCondition.EQ("SecondarySplit", false))); |
|
|
|
|
|
|
|
|
update.Where.Conditions.Add(DQCondition.And(DQCondition.GreaterThan("Order", greaterThanOrder), DQCondition.EQ("Date", date), DQCondition.EQ("DeleteState", false))); |
|
|
session.ExecuteNonQuery(update); |
|
|
session.ExecuteNonQuery(update); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|