Browse Source

添加客户端存货

master
wugang 8 years ago
parent
commit
6d8bfad5c0
6 changed files with 148 additions and 0 deletions
  1. +8
    -0
      B3ClientService/B3ClientService.csproj
  2. +26
    -0
      B3ClientService/BO/ClientGoodsSet_/ClientGoodsSet.cs
  3. +38
    -0
      B3ClientService/BO/ClientGoodsSet_/ClientGoodsSet_Detail.cs
  4. +41
    -0
      B3ClientService/Rpcs/BillRpc/ClientGoodsSetRpc.cs
  5. +17
    -0
      B3ClientService/Rpcs/RpcBO/Bill/ClientGoodsSetDto.cs
  6. +18
    -0
      B3ClientService/Tasks/SyncInfoFromServer.cs

+ 8
- 0
B3ClientService/B3ClientService.csproj View File

@ -47,6 +47,10 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\BwpB3Project\tsref\Debug\Forks.Utils.dll</HintPath> <HintPath>..\..\..\..\BwpB3Project\tsref\Debug\Forks.Utils.dll</HintPath>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json, Version=4.0.3.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\tsref\Debug\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Web" /> <Reference Include="System.Web" />
@ -98,6 +102,8 @@
<Compile Include="BO\Bill\WeightBill\WeightBill_HouseDetail.cs" /> <Compile Include="BO\Bill\WeightBill\WeightBill_HouseDetail.cs" />
<Compile Include="BO\Bill\WeightBill\WeightBill_SanctionDetail.cs" /> <Compile Include="BO\Bill\WeightBill\WeightBill_SanctionDetail.cs" />
<Compile Include="BO\Bill\WeightBill\WeightDetail.cs" /> <Compile Include="BO\Bill\WeightBill\WeightDetail.cs" />
<Compile Include="BO\ClientGoodsSet_\ClientGoodsSet.cs" />
<Compile Include="BO\ClientGoodsSet_\ClientGoodsSet_Detail.cs" />
<Compile Include="BO\SyncBase.cs" /> <Compile Include="BO\SyncBase.cs" />
<Compile Include="BO\SyncBill.cs" /> <Compile Include="BO\SyncBill.cs" />
<Compile Include="BO\SyncBO\MinEmployee.cs" /> <Compile Include="BO\SyncBO\MinEmployee.cs" />
@ -110,6 +116,8 @@
<Compile Include="ConvertUtil.cs" /> <Compile Include="ConvertUtil.cs" />
<Compile Include="CTuple.cs" /> <Compile Include="CTuple.cs" />
<Compile Include="NamedValueTemplate.cs" /> <Compile Include="NamedValueTemplate.cs" />
<Compile Include="Rpcs\BillRpc\ClientGoodsSetRpc.cs" />
<Compile Include="Rpcs\RpcBO\Bill\ClientGoodsSetDto.cs" />
<Compile Include="Rpcs\RpcBO\Bill\GradeAndWeight\GradeAndWeight.cs" /> <Compile Include="Rpcs\RpcBO\Bill\GradeAndWeight\GradeAndWeight.cs" />
<Compile Include="Rpcs\RpcBO\Bill\OrderDetail\NeedOrderEntity.cs" /> <Compile Include="Rpcs\RpcBO\Bill\OrderDetail\NeedOrderEntity.cs" />
<Compile Include="Rpcs\RpcBO\Bill\OrderDetail\RpcOrderBill.cs" /> <Compile Include="Rpcs\RpcBO\Bill\OrderDetail\RpcOrderBill.cs" />


+ 26
- 0
B3ClientService/BO/ClientGoodsSet_/ClientGoodsSet.cs View File

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BWP.B3Frameworks.BO;
using Forks.EnterpriseServices.DomainObjects2;
namespace BWP.B3ClientService.BO
{
[Serializable]
public class ClientGoodsSet:Base
{
public string Name { get; set; }
private readonly ClientGoodsSet_DetailCollection _details = new ClientGoodsSet_DetailCollection();
[OneToMany(typeof(ClientGoodsSet_Detail), "ID", false)]
[Join("ID", "ClientGoodsSet_ID")]
public ClientGoodsSet_DetailCollection Details
{
get { return _details; }
}
}
}

+ 38
- 0
B3ClientService/BO/ClientGoodsSet_/ClientGoodsSet_Detail.cs View File

@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BWP.B3Frameworks.BO;
using Forks.EnterpriseServices;
using Forks.EnterpriseServices.DomainObjects2;
namespace BWP.B3ClientService.BO
{
[Serializable]
public class ClientGoodsSet_Detail : Base
{
public long ClientGoodsSet_ID { get; set; }
[LogicName("存货")]
public long Goods_ID { get; set; }
[LogicName("存货")]
public string Goods_Name { get; set; }
[LogicName("存货编码")]
public string Goods_Code { get; set; }
[LogicName("存货规格")]
public string Goods_Spec { get; set; }
public string Goods_Spell { get; set; }
}
[Serializable]
public class ClientGoodsSet_DetailCollection : DmoCollection<ClientGoodsSet_Detail>
{
}
}

+ 41
- 0
B3ClientService/Rpcs/BillRpc/ClientGoodsSetRpc.cs View File

@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BWP.B3ClientService.BO;
using BWP.B3ClientService.Rpcs.RpcBO.Bill;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
using Forks.EnterpriseServices.JsonRpc;
using Newtonsoft.Json;
using TSingSoft.WebPluginFramework;
namespace BWP.B3ClientService.Rpcs.BillRpc
{
[Rpc]
public static class ClientGoodsSetRpc
{
[Rpc]
public static string GetList()
{
var list=new List<ClientGoodsSetDto>();
var query=new DmoQuery(typeof(ClientGoodsSet));
var clist = query.EExecuteList().Cast<ClientGoodsSet>().ToList();
foreach (ClientGoodsSet set in clist)
{
var dto=new ClientGoodsSetDto();
dto.Name = set.Name;
foreach (ClientGoodsSet_Detail setDetail in set.Details)
{
dto.Goods_ID = setDetail.Goods_ID;
dto.Goods_Name = setDetail.Goods_Name;
dto.Goods_Code = setDetail.Goods_Code;
dto.Goods_Spec = setDetail.Goods_Spec;
list.Add(dto);
}
}
var json = JsonConvert.SerializeObject(list);
return json;
}
}
}

+ 17
- 0
B3ClientService/Rpcs/RpcBO/Bill/ClientGoodsSetDto.cs View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BWP.B3ClientService.Rpcs.RpcBO.Bill
{
[Serializable]
public class ClientGoodsSetDto
{
public string Name { get; set; }
public long Goods_ID { get; set; }
public string Goods_Name { get; set; }
public string Goods_Code { get; set; }
public string Goods_Spec { get; set; }
}
}

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

@ -13,6 +13,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Web.Script.Serialization; using System.Web.Script.Serialization;
using Newtonsoft.Json;
using TSingSoft.WebPluginFramework; using TSingSoft.WebPluginFramework;
using TSingSoft.WebPluginFramework.TimerTasks; using TSingSoft.WebPluginFramework.TimerTasks;
@ -53,11 +54,28 @@ namespace BWP.B3ClientService.Tasks
SyncSanction(); SyncSanction();
SyncLiveVarieties(); SyncLiveVarieties();
SyncBodyDiscontItem(); SyncBodyDiscontItem();
SyncClientGoodsSet();
} }
//catch //catch
{ } { }
} }
private void SyncClientGoodsSet()
{
var jsonStr = RpcFacade.Call<string>("/MainSystem/B3ButcherManageForClient/Rpcs/ClientGoodsSetRpc/GetList");
var list =JsonConvert.DeserializeObject<List<ClientGoodsSet>>(jsonStr);
using (var context = new TransactionContext())
{
var sql1 = @"truncate table [B3ClientService_ClientGoodsSet];truncate table [B3ClientService_ClientGoodsSet_Detail];";
context.Session.ExecuteSqlNonQuery(sql1);
foreach (ClientGoodsSet entity in list)
{
context.Session.Insert(entity);
}
context.Commit();
}
}
static void SyncWpfUser() static void SyncWpfUser()
{ {
var list = RpcFacade.Call<List<RpcObject>>("/MainSystem/B3ButcherManage/Rpcs/TouchScreenRpcs/GetWpfUser"); var list = RpcFacade.Call<List<RpcObject>>("/MainSystem/B3ButcherManage/Rpcs/TouchScreenRpcs/GetWpfUser");


Loading…
Cancel
Save