wugang 8 years ago
parent
commit
76b29cb8ea
5 changed files with 76 additions and 7 deletions
  1. +2
    -0
      B3ClientService/B3ClientService.csproj
  2. +23
    -0
      B3ClientService/BO/ProductTask_/ProductTask.cs
  3. +7
    -7
      B3ClientService/Rpcs/BaseInfoRpc.cs
  4. +26
    -0
      B3ClientService/Rpcs/BillRpc/ProductTaskRpc.cs
  5. +18
    -0
      B3ClientService/Tasks/SyncBillFromServer.cs

+ 2
- 0
B3ClientService/B3ClientService.csproj View File

@ -114,6 +114,7 @@
<Compile Include="BO\ClientGoodsSet_\ClientGoodsSet_Detail.cs" /> <Compile Include="BO\ClientGoodsSet_\ClientGoodsSet_Detail.cs" />
<Compile Include="BO\ClientSyncBase.cs" /> <Compile Include="BO\ClientSyncBase.cs" />
<Compile Include="BO\ClientSyncBaseDto.cs" /> <Compile Include="BO\ClientSyncBaseDto.cs" />
<Compile Include="BO\ProductTask_\ProductTask.cs" />
<Compile Include="BO\SegmentationByPproductTrace_\SegmentationByPproductTrace.cs" /> <Compile Include="BO\SegmentationByPproductTrace_\SegmentationByPproductTrace.cs" />
<Compile Include="BO\SegmentationInStoreRecord_\SegmentationInStoreRecord.cs" /> <Compile Include="BO\SegmentationInStoreRecord_\SegmentationInStoreRecord.cs" />
<Compile Include="BO\SegmentationWeightRecord_\SegmentationWeightRecord.cs" /> <Compile Include="BO\SegmentationWeightRecord_\SegmentationWeightRecord.cs" />
@ -135,6 +136,7 @@
<Compile Include="Rpcs\BillRpc\ByProductWeightRecordRpc.cs" /> <Compile Include="Rpcs\BillRpc\ByProductWeightRecordRpc.cs" />
<Compile Include="Rpcs\BillRpc\ClientGoodsSetRpc.cs" /> <Compile Include="Rpcs\BillRpc\ClientGoodsSetRpc.cs" />
<Compile Include="Rpcs\BillRpc\DropPigRpc.cs" /> <Compile Include="Rpcs\BillRpc\DropPigRpc.cs" />
<Compile Include="Rpcs\BillRpc\ProductTaskRpc.cs" />
<Compile Include="Rpcs\BillRpc\SaleOutStoreRpc.cs" /> <Compile Include="Rpcs\BillRpc\SaleOutStoreRpc.cs" />
<Compile Include="Rpcs\BillRpc\SegmentationInStoreRecordRpc.cs" /> <Compile Include="Rpcs\BillRpc\SegmentationInStoreRecordRpc.cs" />
<Compile Include="Rpcs\BillRpc\SegmentationWeightRecordRpc.cs" /> <Compile Include="Rpcs\BillRpc\SegmentationWeightRecordRpc.cs" />


+ 23
- 0
B3ClientService/BO/ProductTask_/ProductTask.cs View File

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BWP.B3Frameworks.BO;
using Forks.EnterpriseServices.DataForm;
using Forks.EnterpriseServices.DomainObjects2;
using TSingSoft.WebPluginFramework;
namespace BWP.B3ClientService.BO
{
[KeyField("ID", KeyGenType.identity)]
[Serializable, BOClass, DFClass]
public class ProductTask
{
public long ID { get; set; }
public string ProductBatch { get; set; }
public long Goods_ID { get; set; }
public string Goods_Name { get; set; }
public decimal Number { get; set; }
public decimal SecondNumber { get; set; }
}
}

+ 7
- 7
B3ClientService/Rpcs/BaseInfoRpc.cs View File

@ -22,9 +22,11 @@ namespace BWP.B3ClientService.Rpcs
[Rpc] [Rpc]
public static List<WordPair> GetWorkShopList(string input, string args, int top)
public static string GetWorkShopList()
{ {
return GetBaseInfoList<WorkShop>(input, args, top);
var query = new DmoQuery(typeof(WorkShop));
var list = query.EExecuteList().Cast<WorkShop>().ToList();
return JsonConvert.SerializeObject(list);
} }
[Rpc] [Rpc]
@ -36,13 +38,11 @@ namespace BWP.B3ClientService.Rpcs
} }
[Rpc] [Rpc]
public static string GetProductBatchList(string input)
public static string GetProductBatchList()
{ {
//只查询5天前的批次
var query = new DmoQuery(typeof(ProductBatch)); var query = new DmoQuery(typeof(ProductBatch));
if (!string.IsNullOrEmpty(input))
{
query.Where.Conditions.Add(DQCondition.Like("Name", input));
}
query.Range=SelectRange.Top(5);
var list = query.EExecuteList().Cast<ProductBatch>().ToList(); var list = query.EExecuteList().Cast<ProductBatch>().ToList();
return JsonConvert.SerializeObject(list); return JsonConvert.SerializeObject(list);
} }


+ 26
- 0
B3ClientService/Rpcs/BillRpc/ProductTaskRpc.cs View File

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BWP.B3ClientService.BO;
using Forks.EnterpriseServices.DomainObjects2;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
using Forks.EnterpriseServices.JsonRpc;
using Newtonsoft.Json;
using TSingSoft.WebPluginFramework;
namespace BWP.B3ClientService.Rpcs.BillRpc
{
[Rpc]
public static class ProductTaskRpc
{
[Rpc]
public static string GetListByBatch(string batch)
{
var query=new DmoQuery(typeof(ProductTask));
query.Where.Conditions.Add(DQCondition.EQ("ProductBatch",batch));
var list = query.EExecuteList().Cast<ProductTask>().ToList();
return JsonConvert.SerializeObject(list);
}
}
}

+ 18
- 0
B3ClientService/Tasks/SyncBillFromServer.cs View File

@ -31,11 +31,29 @@ namespace BWP.B3ClientService.Tasks
} }
SyncSaleOutStore(); SyncSaleOutStore();
SyncProductTask();
} }
} }
private void SyncProductTask()
{
var json = RpcFacade.Call<string>("/MainSystem/B3ButcherManage/Rpcs/TouchScreenRpcs/SyncProductTask");
var list = JsonConvert.DeserializeObject<List<ProductTask>>(json);
using (var context = new TransactionContext())
{
var sql1 = @"truncate table [B3ClientService_ProductTask];";
context.Session.ExecuteSqlNonQuery(sql1);
foreach (ProductTask dmo in list)
{
context.Session.Insert(dmo);
}
context.Commit();
}
}
private void SyncSaleOutStore() private void SyncSaleOutStore()
{ {
//只更新一个星期的 //只更新一个星期的


Loading…
Cancel
Save