Browse Source

同步

master
luanhui 8 years ago
parent
commit
ed70a92a16
6 changed files with 204 additions and 0 deletions
  1. +5
    -0
      B3ClientService/B3ClientService.csproj
  2. +69
    -0
      B3ClientService/BO/ClientSyncBase.cs
  3. +17
    -0
      B3ClientService/BO/ClientSyncBaseDto.cs
  4. +27
    -0
      B3ClientService/BO/TrunksIousOutInStoreRecord_/TrunksIousOutInStoreRecord.cs
  5. +29
    -0
      B3ClientService/Rpcs/BillRpc/TrunksIousOutInStoreRecord_/TrunksIousOutInStoreRecordDto.cs
  6. +57
    -0
      B3ClientService/Rpcs/BillRpc/TrunksIousOutInStoreRecord_/TrunksIousOutInStoreRecordRpc.cs

+ 5
- 0
B3ClientService/B3ClientService.csproj View File

@ -105,6 +105,8 @@
<Compile Include="BO\ByProductWeightRecord_\ByProductWeightRecord.cs" /> <Compile Include="BO\ByProductWeightRecord_\ByProductWeightRecord.cs" />
<Compile Include="BO\ClientGoodsSet_\ClientGoodsSet.cs" /> <Compile Include="BO\ClientGoodsSet_\ClientGoodsSet.cs" />
<Compile Include="BO\ClientGoodsSet_\ClientGoodsSet_Detail.cs" /> <Compile Include="BO\ClientGoodsSet_\ClientGoodsSet_Detail.cs" />
<Compile Include="BO\ClientSyncBase.cs" />
<Compile Include="BO\ClientSyncBaseDto.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" />
<Compile Include="BO\SyncBase.cs" /> <Compile Include="BO\SyncBase.cs" />
@ -112,6 +114,7 @@
<Compile Include="BO\SyncBO\MinEmployee.cs" /> <Compile Include="BO\SyncBO\MinEmployee.cs" />
<Compile Include="BO\SyncBO\MinWPF_User.cs" /> <Compile Include="BO\SyncBO\MinWPF_User.cs" />
<Compile Include="BO\ServerHost.cs" /> <Compile Include="BO\ServerHost.cs" />
<Compile Include="BO\TrunksIousOutInStoreRecord_\TrunksIousOutInStoreRecord.cs" />
<Compile Include="ClientSerializerBo\OrderDetail\SelectHurryList.cs" /> <Compile Include="ClientSerializerBo\OrderDetail\SelectHurryList.cs" />
<Compile Include="ClientSerializerBo\WeightBill\HouseAndSanctionEdit.cs" /> <Compile Include="ClientSerializerBo\WeightBill\HouseAndSanctionEdit.cs" />
<Compile Include="ClientSerializerBo\WeightBill\HouseAndSanctionList.cs" /> <Compile Include="ClientSerializerBo\WeightBill\HouseAndSanctionList.cs" />
@ -123,6 +126,8 @@
<Compile Include="Rpcs\BillRpc\ClientGoodsSetRpc.cs" /> <Compile Include="Rpcs\BillRpc\ClientGoodsSetRpc.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" />
<Compile Include="Rpcs\BillRpc\TrunksIousOutInStoreRecord_\TrunksIousOutInStoreRecordDto.cs" />
<Compile Include="Rpcs\BillRpc\TrunksIousOutInStoreRecord_\TrunksIousOutInStoreRecordRpc.cs" />
<Compile Include="Rpcs\RpcBO\Bill\ClientGoodsSetDto.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" />


+ 69
- 0
B3ClientService/BO/ClientSyncBase.cs View File

@ -0,0 +1,69 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BWP.B3Frameworks.BO;
namespace BWP.B3ClientService.BO
{
public class ClientSyncBase:Base
{
/// <summary>
/// 是否同步到中间服务器上
/// </summary>
public bool IsSynced { get; set; }
/// <summary>
/// 客户端ID
/// </summary>
public long? Client_ID { get; set; }
/// <summary>
/// B3服务器ID
/// </summary>
public long? B3_ID { get; set; }
/// <summary>
/// 上传中间服务器时间
/// </summary>
public DateTime? SyncTime { get; set; }
/// <summary>
/// 是否要在服务器上删除 此字段为了删除服务器上的数据用的
/// </summary>
public bool WillBeDeleted { get; set; }
/// <summary>
/// 是否要在服务器上修改 此字段为了修改服务器上的数据用的
/// </summary>
public bool WillBeUpdated { get; set; }
//已经删除的记录 相当于作废的记录 查询的时候要过滤 为了保存原始的记录 用删除标记
public bool IsDeleted { get; set; }
/// <summary>
/// 设置删除的时间
/// </summary>
public DateTime? DeleteTime { get; set; }
protected DateTime mCreateTime = DateTime.Now;
/// <summary>
/// 每条记录都要记录创建时间
/// </summary>
public DateTime CreateTime
{
get { return mCreateTime; }
set { mCreateTime = value; }
}
/// <summary>
/// 每条记录都要记录创建人 将来可可以记录标识用
/// </summary>
public string CreateUserName { get; set; }
}
}

+ 17
- 0
B3ClientService/BO/ClientSyncBaseDto.cs View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.AccessControl;
using System.Text;
namespace BWP.B3ClientService.BO
{
public class ClientSyncBaseDto
{
public long? Service_ID { get; set; }
public long? Client_ID { get; set; }
public long? B3_ID { get; set; }
public string CreateUserName { get; set; }
}
}

+ 27
- 0
B3ClientService/BO/TrunksIousOutInStoreRecord_/TrunksIousOutInStoreRecord.cs View File

@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BWP.B3ClientService.BO
{
[Serializable]
public class TrunksIousOutInStoreRecord: ClientSyncBase
{
public string BarCode { get; set; }
public long? Goods_ID { get; set; }
public string Goods_Name { get; set; }
private int mNumber = 1;
public int Number
{
get { return mNumber; }
set { mNumber = value; }
}
public decimal? Weight { get; set; }
public string CarcassStatus { get; set; }// 胴体状态
}
}

+ 29
- 0
B3ClientService/Rpcs/BillRpc/TrunksIousOutInStoreRecord_/TrunksIousOutInStoreRecordDto.cs View File

@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BWP.B3ClientService.BO;
using Forks.EnterpriseServices.DataForm;
namespace BWP.B3ClientService.Rpcs.BillRpc.TrunksIousOutInStoreRecord_
{
[Serializable,DFClass]
public class TrunksIousOutInStoreRecordDto: ClientSyncBaseDto
{
public string BarCode { get; set; }
public long? Goods_ID { get; set; }
public string Goods_Name { get; set; }
private int mNumber = 1;
public int Number
{
get { return mNumber; }
set { mNumber = value; }
}
public decimal? Weight { get; set; }
public string CarcassStatus { get; set; }// 胴体状态
}
}

+ 57
- 0
B3ClientService/Rpcs/BillRpc/TrunksIousOutInStoreRecord_/TrunksIousOutInStoreRecordRpc.cs View File

@ -0,0 +1,57 @@

using BWP.B3ClientService.BO;
using BWP.B3Frameworks.Utils;
using Forks.EnterpriseServices.DomainObjects2;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
using Forks.EnterpriseServices.JsonRpc;
using Newtonsoft.Json;
namespace BWP.B3ClientService.Rpcs.BillRpc.TrunksIousOutInStoreRecord_
{
//todo 这里需要维护大表
[Rpc]
public static class TrunksIousOutInStoreRecordRpc
{
[Rpc]
public static long Insert(string json)
{
var clientRecord = JsonConvert.DeserializeObject<TrunksIousOutInStoreRecordDto>(json);
using (var session=Dmo.NewSession())
{
var record = new TrunksIousOutInStoreRecord();
DmoUtil.CopyDmoFields(clientRecord, record, "ID", "B3_ID");
session.Insert(record);
session.Commit();
return record.ID;
}
}
[Rpc]
public static int Update(string json)
{
var clientRecord = JsonConvert.DeserializeObject<TrunksIousOutInStoreRecordDto>(json);
using (var session=Dmo.NewSession())
{
var record = session.Load(new DmoIdentity(typeof(TrunksIousOutInStoreRecord), clientRecord.Service_ID??0));
DmoUtil.CopyDmoFields(clientRecord,record,"ID", "B3_ID");
session.Update(record);
}
return 1;
}
[Rpc]
public static int Delete(long id)
{
var delDom = new DQDeleteDom(typeof(TrunksIousOutInStoreRecord));
delDom.Where.Conditions.Add(DQCondition.EQ("ID",id));
using (var session=Dmo.NewSession())
{
session.Update(delDom);
}
return 1;
}
}
}

Loading…
Cancel
Save