diff --git a/B3ClientService/B3ClientService.csproj b/B3ClientService/B3ClientService.csproj index d0c916d..78f1df9 100644 --- a/B3ClientService/B3ClientService.csproj +++ b/B3ClientService/B3ClientService.csproj @@ -105,6 +105,8 @@ + + @@ -112,6 +114,7 @@ + @@ -123,6 +126,8 @@ + + diff --git a/B3ClientService/BO/ClientSyncBase.cs b/B3ClientService/BO/ClientSyncBase.cs new file mode 100644 index 0000000..60c1573 --- /dev/null +++ b/B3ClientService/BO/ClientSyncBase.cs @@ -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 + { + /// + /// 是否同步到中间服务器上 + /// + public bool IsSynced { get; set; } + + /// + /// 客户端ID + /// + public long? Client_ID { get; set; } + + /// + /// B3服务器ID + /// + public long? B3_ID { get; set; } + + + /// + /// 上传中间服务器时间 + /// + public DateTime? SyncTime { get; set; } + + /// + /// 是否要在服务器上删除 此字段为了删除服务器上的数据用的 + /// + public bool WillBeDeleted { get; set; } + + /// + /// 是否要在服务器上修改 此字段为了修改服务器上的数据用的 + /// + public bool WillBeUpdated { get; set; } + + + //已经删除的记录 相当于作废的记录 查询的时候要过滤 为了保存原始的记录 用删除标记 + public bool IsDeleted { get; set; } + + /// + /// 设置删除的时间 + /// + public DateTime? DeleteTime { get; set; } + + protected DateTime mCreateTime = DateTime.Now; + + /// + /// 每条记录都要记录创建时间 + /// + public DateTime CreateTime + { + get { return mCreateTime; } + set { mCreateTime = value; } + } + + + /// + /// 每条记录都要记录创建人 将来可可以记录标识用 + /// + public string CreateUserName { get; set; } + + } +} diff --git a/B3ClientService/BO/ClientSyncBaseDto.cs b/B3ClientService/BO/ClientSyncBaseDto.cs new file mode 100644 index 0000000..2f4b2f9 --- /dev/null +++ b/B3ClientService/BO/ClientSyncBaseDto.cs @@ -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; } + + } +} diff --git a/B3ClientService/BO/TrunksIousOutInStoreRecord_/TrunksIousOutInStoreRecord.cs b/B3ClientService/BO/TrunksIousOutInStoreRecord_/TrunksIousOutInStoreRecord.cs new file mode 100644 index 0000000..e1b2ff1 --- /dev/null +++ b/B3ClientService/BO/TrunksIousOutInStoreRecord_/TrunksIousOutInStoreRecord.cs @@ -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; }// 胴体状态 + + } +} diff --git a/B3ClientService/Rpcs/BillRpc/TrunksIousOutInStoreRecord_/TrunksIousOutInStoreRecordDto.cs b/B3ClientService/Rpcs/BillRpc/TrunksIousOutInStoreRecord_/TrunksIousOutInStoreRecordDto.cs new file mode 100644 index 0000000..5cc3bf6 --- /dev/null +++ b/B3ClientService/Rpcs/BillRpc/TrunksIousOutInStoreRecord_/TrunksIousOutInStoreRecordDto.cs @@ -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; }// 胴体状态 + + } +} diff --git a/B3ClientService/Rpcs/BillRpc/TrunksIousOutInStoreRecord_/TrunksIousOutInStoreRecordRpc.cs b/B3ClientService/Rpcs/BillRpc/TrunksIousOutInStoreRecord_/TrunksIousOutInStoreRecordRpc.cs new file mode 100644 index 0000000..1705997 --- /dev/null +++ b/B3ClientService/Rpcs/BillRpc/TrunksIousOutInStoreRecord_/TrunksIousOutInStoreRecordRpc.cs @@ -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(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(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; + } + + } +}