| @ -0,0 +1,23 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| using Forks.EnterpriseServices.DomainObjects2; | |||
| using TSingSoft.WebPluginFramework; | |||
| namespace BO.BO.BaseInfo | |||
| { | |||
| [Serializable, BOClass] | |||
| [KeyField("ID", KeyGenType.assigned)] | |||
| [MapToTable("Customer")] | |||
| public class Customer | |||
| { | |||
| public long ID { get; set; } | |||
| public string Name { get; set; } | |||
| public string Spell { get; set; } | |||
| } | |||
| } | |||
| @ -0,0 +1,23 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| using Forks.EnterpriseServices.DomainObjects2; | |||
| using TSingSoft.WebPluginFramework; | |||
| namespace BO.BO.BaseInfo | |||
| { | |||
| [Serializable, BOClass] | |||
| [KeyField("ID", KeyGenType.assigned)] | |||
| [MapToTable("DeliverGoodsLine")] | |||
| public class DeliverGoodsLine | |||
| { | |||
| public long ID { get; set; } | |||
| public string Name { get; set; } | |||
| public string Spell { get; set; } | |||
| } | |||
| } | |||
| @ -1,20 +0,0 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| using Forks.EnterpriseServices.DomainObjects2; | |||
| namespace BO.BO.LocalBO | |||
| { | |||
| [MapToTable("LocalCustomer")] | |||
| [KeyField("ID", KeyGenType.identity)] | |||
| public class LocalCustomer | |||
| { | |||
| public long ID { get; set; } | |||
| public long B3_ID { get; set; } | |||
| public long B3_Name { get; set; } | |||
| public long B3_Spell { get; set; } | |||
| } | |||
| } | |||
| @ -1,20 +0,0 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| using Forks.EnterpriseServices.DomainObjects2; | |||
| namespace BO.BO.LocalBO | |||
| { | |||
| [MapToTable("LocalSendLine")] | |||
| [KeyField("ID", KeyGenType.identity)] | |||
| public class LocalSendLine | |||
| { | |||
| public long ID { get; set; } | |||
| public long B3_ID { get; set; } | |||
| public long B3_Name { get; set; } | |||
| public long B3_Spell { get; set; } | |||
| } | |||
| } | |||
| @ -0,0 +1,51 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| using BO.BO.BaseInfo; | |||
| using Forks.EnterpriseServices.DomainObjects2.DQuery; | |||
| using Forks.JsonRpc.Client; | |||
| using Newtonsoft.Json; | |||
| namespace BO.Utils.BillRpc | |||
| { | |||
| public class CustomerRpc | |||
| { | |||
| /// <summary> | |||
| /// 获取客户档案 在线则在线查询 同时更新本地数据库 ,不在线则从本地数据查 | |||
| /// </summary> | |||
| /// <param name="input">查询用的</param> | |||
| /// <param name="updateLocalDb">是否更新本地数据库,如果更新则尽量减少使用该方法的次数, 因为客户会有很多</param> | |||
| /// <returns></returns> | |||
| public static List<Customer> SyncList(string input="", bool updateLocalDb=true) | |||
| { | |||
| if (LoginRpcUtil.TestConnection(1000)) | |||
| { | |||
| //在线 | |||
| var json = RpcFacade.Call<string>("/MainSystem/B3ClientService/Rpcs/BillRpc/BaseInfoRpc/SyncCustomer",input); | |||
| var list = JsonConvert.DeserializeObject<List<Customer>>(json); | |||
| if (updateLocalDb) | |||
| { | |||
| using (var session = LocalDmoSession.New()) | |||
| { | |||
| foreach (Customer dmo in list) | |||
| { | |||
| session.Insert(dmo); | |||
| } | |||
| session.Commit(); | |||
| } | |||
| } | |||
| return list; | |||
| } | |||
| var dmoquery = new DmoQuery(typeof(Customer)); | |||
| using (var session = LocalDmoSession.New()) | |||
| { | |||
| return session.ExecuteList(dmoquery).Cast<Customer>().ToList(); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,51 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| using BO.BO.BaseInfo; | |||
| using Forks.EnterpriseServices.DomainObjects2.DQuery; | |||
| using Forks.JsonRpc.Client; | |||
| using Newtonsoft.Json; | |||
| namespace BO.Utils.BillRpc | |||
| { | |||
| public class DeliverGoodsLineRpc | |||
| { | |||
| /// <summary> | |||
| /// 获取送货线路档案 在线则在线查询 同时更新本地数据库 ,不在线则从本地数据查 | |||
| /// </summary> | |||
| /// <param name="input">查询用的</param> | |||
| /// <param name="updateLocalDb">是否更新本地数据库,如果更新则尽量减少使用该方法的次数, 因为客户会有很多</param> | |||
| /// <returns></returns> | |||
| public static List<DeliverGoodsLine> SyncList(string input = "", bool updateLocalDb = true) | |||
| { | |||
| if (LoginRpcUtil.TestConnection(1000)) | |||
| { | |||
| //在线 | |||
| var json = RpcFacade.Call<string>("/MainSystem/B3ClientService/Rpcs/BillRpc/BaseInfoRpc/SyncDeliverGoodsLine", input); | |||
| var list = JsonConvert.DeserializeObject<List<DeliverGoodsLine>>(json); | |||
| if (updateLocalDb) | |||
| { | |||
| using (var session = LocalDmoSession.New()) | |||
| { | |||
| foreach (DeliverGoodsLine dmo in list) | |||
| { | |||
| session.Insert(dmo); | |||
| } | |||
| session.Commit(); | |||
| } | |||
| } | |||
| return list; | |||
| } | |||
| var dmoquery = new DmoQuery(typeof(DeliverGoodsLine)); | |||
| using (var session = LocalDmoSession.New()) | |||
| { | |||
| return session.ExecuteList(dmoquery).Cast<DeliverGoodsLine>().ToList(); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,89 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| using Forks.EnterpriseServices; | |||
| using Forks.EnterpriseServices.DomainObjects2; | |||
| namespace Distribution.LocalBo | |||
| { | |||
| [Serializable] | |||
| [KeyField("ID", KeyGenType.identity)]//自增标识 | |||
| [MapToTable("SaleOutStore")] | |||
| public class SaleOutStore | |||
| { | |||
| //自增ID | |||
| public long ID { get; set; } | |||
| [LogicName("出库单号")] | |||
| public long SaleOutStore_ID { get; set; } | |||
| [LogicName("购货客户")] | |||
| public string Customer_Name { get; set; } | |||
| [LogicName("送货地址")] | |||
| [DbColumn(Length = 100)] | |||
| public string DeliverAddress { get; set; } | |||
| [LogicName("仓库")] | |||
| public string Store_Name { get; set; } | |||
| [LogicName("运输车辆")] | |||
| public string Car { get; set; } | |||
| [LogicName("发货时间")] | |||
| public DateTime? LoadTime { get; set; } | |||
| [LogicName("单据状态")] | |||
| public string BillState { get; set; } | |||
| [LogicName("销售出库明细ID")] | |||
| public long SaleOutStoreDetail_ID { get; set; } | |||
| [LogicName("存货编码")] | |||
| public string Goods_Code { get; set; } | |||
| [LogicName("存货")] | |||
| public string Goods_Name { get; set; } | |||
| [LogicName("主数量")] | |||
| public decimal? Number { get; set; } | |||
| [LogicName("辅数量")] | |||
| public decimal? SecondNumber { get; set; } | |||
| [LogicName("报价单位")] | |||
| public string Unit { get; set; } | |||
| [LogicName("报价数量")] | |||
| public decimal? UnitNum { get; set; } | |||
| [LogicName("主单位比率")] | |||
| [DbColumn(DefaultValue = 1)] | |||
| public decimal LeftRatio { get; set; } | |||
| [LogicName("辅单位比率")] | |||
| [DbColumn(DefaultValue = 1)] | |||
| public decimal RightRatio { get; set; } | |||
| [LogicName("主单位")] | |||
| public string Goods_MainUnit { get; set; } | |||
| [LogicName("辅单位")] | |||
| public string Goods_SecondUnit { get; set; } | |||
| [LogicName("主辅转换方向")] | |||
| public string Goods_UnitConvertDirection { get; set; } | |||
| [LogicName("主辅换算主单位比例")] | |||
| public decimal? Goods_MainUnitRatio { get; set; } | |||
| [LogicName("主辅换算辅单位比例")] | |||
| public decimal? Goods_SecondUnitRatio { get; set; } | |||
| } | |||
| } | |||