|
|
|
@ -1,4 +1,5 @@ |
|
|
|
using BWP.B3ClientService.BO; |
|
|
|
using BWP.B3Frameworks.Utils; |
|
|
|
using Forks.EnterpriseServices.DomainObjects2; |
|
|
|
using Forks.EnterpriseServices.DomainObjects2.DQuery; |
|
|
|
using Forks.EnterpriseServices.JsonRpc; |
|
|
|
@ -42,8 +43,9 @@ namespace BWP.B3ClientService.Rpcs.BillRpc |
|
|
|
} |
|
|
|
dmo.FarmerDetails = new WeightBill_FarmerDetailCollection(); |
|
|
|
dmo.Details = new WeightBill_DetailCollection(); |
|
|
|
FillServerUpdateFields(session, dmo); |
|
|
|
session.Update(dmo); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
session.Commit(); |
|
|
|
} |
|
|
|
@ -60,6 +62,18 @@ namespace BWP.B3ClientService.Rpcs.BillRpc |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
static void FillServerUpdateFields(IDmoSession session, WeightBill dmo) |
|
|
|
{ |
|
|
|
var min = InnerBLUtil.GetSingleDmo<WeightBill>(session, "ID", dmo.ID, "B3ID", "DeleteState", "AlreadyHouse", "Inspector_ID", "Inspector_Name"); |
|
|
|
dmo.B3ID = min.B3ID; |
|
|
|
dmo.DeleteState = min.DeleteState; |
|
|
|
dmo.AlreadyHouse = min.AlreadyHouse; |
|
|
|
dmo.Inspector_ID = min.Inspector_ID; |
|
|
|
dmo.Inspector_Name = min.Inspector_Name; |
|
|
|
dmo.Sync = false; |
|
|
|
dmo.ModifyTime = DateTime.Now; |
|
|
|
} |
|
|
|
|
|
|
|
[Rpc] |
|
|
|
public static bool DeleteBill(long id) |
|
|
|
{ |
|
|
|
@ -131,7 +145,7 @@ namespace BWP.B3ClientService.Rpcs.BillRpc |
|
|
|
entity.Supplier_Name = item.Item3; |
|
|
|
entity.AlreadyHouse = item.Item4; |
|
|
|
} |
|
|
|
var details = GetWeillHouseDetail(list.Select(x =>x.Bill.ID)); |
|
|
|
var details = GetWeightHouseDetail(list.Select(x => x.Bill.ID)); |
|
|
|
foreach (var item in list) |
|
|
|
{ |
|
|
|
var tags = details.Where(x => x.WeightBill_ID == item.Bill.ID); |
|
|
|
@ -141,7 +155,7 @@ namespace BWP.B3ClientService.Rpcs.BillRpc |
|
|
|
return list; |
|
|
|
} |
|
|
|
|
|
|
|
static IEnumerable<WeightBill_HouseDetail> GetWeillHouseDetail(IEnumerable<long> billIDs) |
|
|
|
static IEnumerable<WeightBill_HouseDetail> GetWeightHouseDetail(IEnumerable<long> billIDs) |
|
|
|
{ |
|
|
|
var query = new DmoQuery(typeof(WeightBill_HouseDetail)); |
|
|
|
query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("DeleteState", false), DQCondition.InList(DQExpression.Field("WeightBill_ID"), billIDs.Select(x => DQExpression.Value(x)).ToArray()))); |
|
|
|
|