Browse Source

白条鲜品客户端 客户,线路,出库

master
luanhui 8 years ago
parent
commit
1cc22169bd
12 changed files with 715 additions and 505 deletions
  1. +2
    -8
      B3ButcherManageClient.sln
  2. +4
    -2
      BO/BO.csproj
  3. +23
    -0
      BO/BO/BaseInfo/Customer.cs
  4. +23
    -0
      BO/BO/BaseInfo/DeliverGoodsLine.cs
  5. +0
    -20
      BO/BO/LocalBO/LocalCustomer.cs
  6. +0
    -20
      BO/BO/LocalBO/LocalSendLine.cs
  7. +51
    -0
      BO/Utils/BillRpc/CustomerRpc.cs
  8. +51
    -0
      BO/Utils/BillRpc/DeliverGoodsLineRpc.cs
  9. +9
    -0
      Distribution/Distribution.csproj
  10. +456
    -455
      Distribution/DistributionForm.Designer.cs
  11. +7
    -0
      Distribution/DistributionForm.cs
  12. +89
    -0
      Distribution/LocalBo/LocalSaleOutStore.cs

+ 2
- 8
B3ButcherManageClient.sln View File

@ -1,7 +1,7 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.40629.0
# Visual Studio 15
VisualStudioVersion = 15.0.27004.2002
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BO", "BO\BO.csproj", "{8968F14A-C7C7-4751-96CE-B114FBFD65EF}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BO", "BO\BO.csproj", "{8968F14A-C7C7-4751-96CE-B114FBFD65EF}"
EndProject EndProject
@ -35,8 +35,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ByProductWeight", "ByProduc
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Distribution", "Distribution\Distribution.csproj", "{054F5E88-9AF0-430F-990E-17B8B268D59A}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Distribution", "Distribution\Distribution.csproj", "{054F5E88-9AF0-430F-990E-17B8B268D59A}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DropPigReOrder", "DropPigReOrder\DropPigReOrder.csproj", "{031BDA81-6DCE-41CD-B8FB-D5334A4940B0}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -105,10 +103,6 @@ Global
{054F5E88-9AF0-430F-990E-17B8B268D59A}.Debug|Any CPU.Build.0 = Debug|Any CPU {054F5E88-9AF0-430F-990E-17B8B268D59A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{054F5E88-9AF0-430F-990E-17B8B268D59A}.Release|Any CPU.ActiveCfg = Release|Any CPU {054F5E88-9AF0-430F-990E-17B8B268D59A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{054F5E88-9AF0-430F-990E-17B8B268D59A}.Release|Any CPU.Build.0 = Release|Any CPU {054F5E88-9AF0-430F-990E-17B8B268D59A}.Release|Any CPU.Build.0 = Release|Any CPU
{031BDA81-6DCE-41CD-B8FB-D5334A4940B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{031BDA81-6DCE-41CD-B8FB-D5334A4940B0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{031BDA81-6DCE-41CD-B8FB-D5334A4940B0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{031BDA81-6DCE-41CD-B8FB-D5334A4940B0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE


+ 4
- 2
BO/BO.csproj View File

@ -67,6 +67,8 @@
<Compile Include="BarCodeScan\BwpBarCodeUtil.cs" /> <Compile Include="BarCodeScan\BwpBarCodeUtil.cs" />
<Compile Include="BO\BackRpcObj.cs" /> <Compile Include="BO\BackRpcObj.cs" />
<Compile Include="BO\BaseInfo\BodyDiscontItem.cs" /> <Compile Include="BO\BaseInfo\BodyDiscontItem.cs" />
<Compile Include="BO\BaseInfo\Customer.cs" />
<Compile Include="BO\BaseInfo\DeliverGoodsLine.cs" />
<Compile Include="BO\Bill\CarcassStateWeight\CarcassStateWeight.cs" /> <Compile Include="BO\Bill\CarcassStateWeight\CarcassStateWeight.cs" />
<Compile Include="BO\Bill\GradeAndWeight\GradeAndWeight.cs" /> <Compile Include="BO\Bill\GradeAndWeight\GradeAndWeight.cs" />
<Compile Include="BO\Bill\GradeAndWeight\DetailLastIndex.cs" /> <Compile Include="BO\Bill\GradeAndWeight\DetailLastIndex.cs" />
@ -88,8 +90,6 @@
<Compile Include="BO\Dtos\ClientGoodsSetDto.cs" /> <Compile Include="BO\Dtos\ClientGoodsSetDto.cs" />
<Compile Include="BO\Dtos\ClientGoodsSetDtoExt.cs" /> <Compile Include="BO\Dtos\ClientGoodsSetDtoExt.cs" />
<Compile Include="BO\Dtos\SyncBaseDto.cs" /> <Compile Include="BO\Dtos\SyncBaseDto.cs" />
<Compile Include="BO\LocalBO\LocalCustomer.cs" />
<Compile Include="BO\LocalBO\LocalSendLine.cs" />
<Compile Include="BO\LocalSyncBase.cs" /> <Compile Include="BO\LocalSyncBase.cs" />
<Compile Include="BO\SyncBase.cs" /> <Compile Include="BO\SyncBase.cs" />
<Compile Include="CTuple.cs" /> <Compile Include="CTuple.cs" />
@ -98,6 +98,8 @@
<Compile Include="SyncToServerBase.cs" /> <Compile Include="SyncToServerBase.cs" />
<Compile Include="Utils\AfterLoginUtil.cs" /> <Compile Include="Utils\AfterLoginUtil.cs" />
<Compile Include="Utils\BillRpc\ClientGoodsSetRpc.cs" /> <Compile Include="Utils\BillRpc\ClientGoodsSetRpc.cs" />
<Compile Include="Utils\BillRpc\CustomerRpc.cs" />
<Compile Include="Utils\BillRpc\DeliverGoodsLineRpc.cs" />
<Compile Include="Utils\BillRpc\GradeAndWeightRpc.cs" /> <Compile Include="Utils\BillRpc\GradeAndWeightRpc.cs" />
<Compile Include="Utils\BillRpc\HouseAndSanctionRpc.cs" /> <Compile Include="Utils\BillRpc\HouseAndSanctionRpc.cs" />
<Compile Include="Utils\BillRpc\OrderDetailRpc.cs" /> <Compile Include="Utils\BillRpc\OrderDetailRpc.cs" />


+ 23
- 0
BO/BO/BaseInfo/Customer.cs View File

@ -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; }
}
}

+ 23
- 0
BO/BO/BaseInfo/DeliverGoodsLine.cs View File

@ -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; }
}
}

+ 0
- 20
BO/BO/LocalBO/LocalCustomer.cs View File

@ -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; }
}
}

+ 0
- 20
BO/BO/LocalBO/LocalSendLine.cs View File

@ -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; }
}
}

+ 51
- 0
BO/Utils/BillRpc/CustomerRpc.cs View File

@ -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();
}
}
}
}

+ 51
- 0
BO/Utils/BillRpc/DeliverGoodsLineRpc.cs View File

@ -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();
}
}
}
}

+ 9
- 0
Distribution/Distribution.csproj View File

@ -30,7 +30,15 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Forks.EnterpriseServices, Version=3.1.0.0, Culture=neutral, PublicKeyToken=7254430f49d10aae, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Users\luanhui\source\repos\WinFormPrintTest\WinFormPrintTest\bin\Debug\Forks.EnterpriseServices.dll</HintPath>
</Reference>
<Reference Include="Forks.JsonRpc.Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7254430f49d10aae, processorArchitecture=MSIL" /> <Reference Include="Forks.JsonRpc.Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7254430f49d10aae, processorArchitecture=MSIL" />
<Reference Include="Forks.Utils, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7254430f49d10aae, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Users\luanhui\source\repos\WinFormPrintTest\WinFormPrintTest\bin\Debug\Forks.Utils.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" /> <Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" /> <Reference Include="PresentationFramework" />
<Reference Include="System" /> <Reference Include="System" />
@ -53,6 +61,7 @@
<Compile Include="DistributionForm.Designer.cs"> <Compile Include="DistributionForm.Designer.cs">
<DependentUpon>DistributionForm.cs</DependentUpon> <DependentUpon>DistributionForm.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="LocalBo\LocalSaleOutStore.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>


+ 456
- 455
Distribution/DistributionForm.Designer.cs
File diff suppressed because it is too large
View File


+ 7
- 0
Distribution/DistributionForm.cs View File

@ -12,6 +12,8 @@ namespace Distribution
{ {
public partial class DistributionForm : Form public partial class DistributionForm : Form
{ {
private bool mIsCustomerSynced,mIs;
public DistributionForm() public DistributionForm()
{ {
InitializeComponent(); InitializeComponent();
@ -24,5 +26,10 @@ namespace Distribution
{ {
} }
private void btnSearch_Click(object sender, EventArgs e)
{
}
} }
} }

+ 89
- 0
Distribution/LocalBo/LocalSaleOutStore.cs View File

@ -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; }
}
}

Loading…
Cancel
Save