Browse Source

rpc

master
wugang 8 years ago
parent
commit
5c610be291
1 changed files with 12 additions and 5 deletions
  1. +12
    -5
      B3ClientService/Rpcs/BillRpc/SegmentationWeightRecord_/SegmentationWeightRecordRpc.cs

+ 12
- 5
B3ClientService/Rpcs/BillRpc/SegmentationWeightRecord_/SegmentationWeightRecordRpc.cs View File

@ -21,13 +21,15 @@ namespace BWP.B3ClientService.Rpcs.BillRpc
[Rpc]
public static bool CreateTodayB3OutputBill()
public static long CreateTodayB3OutputBill()
{
var serverUri = ServerHost.GetServerUrl();
if (string.IsNullOrEmpty(serverUri))
{
throw new Exception("请配置服务器地址");
}
//try
{
try
{
RpcFacade.Init(serverUri, "B3ClientServer");
@ -47,6 +49,10 @@ namespace BWP.B3ClientService.Rpcs.BillRpc
using (var session = Dmo.NewSession())
{
var list = session.ExecuteList(query).Cast<SegmentationWeightRecord>().ToList();
if (list.Count == 0)
{
return -1;
}
var json = JsonConvert.SerializeObject(list);
var b3Id = RpcFacade.Call<long>("/MainSystem/B3ButcherManage/Rpcs/TouchScreenRpcs/CreateB3OutPut", json);
if (b3Id > 0)
@ -58,11 +64,12 @@ namespace BWP.B3ClientService.Rpcs.BillRpc
update.Columns.Add(new DQUpdateColumn("B3_ID", b3Id));
update.Columns.Add(new DQUpdateColumn("SyncToB3DateTime", DateTime.Now));
session.ExecuteNonQuery(update);
return true;
session.Commit();
return b3Id;
}
}
return false;
}
return 0;
}
[Rpc]


Loading…
Cancel
Save