Browse Source

加B3发货扫码

master
yibo 7 years ago
parent
commit
9b7a4afefa
4 changed files with 71 additions and 1 deletions
  1. +1
    -0
      B3QingDaoWanFu.Web/PluginClass.cs
  2. +1
    -0
      B3QingDaoWanFu/B3QingDaoWanFu.csproj
  3. +2
    -1
      B3QingDaoWanFu/Tasks/SyncSaleOutStoreInfoToMES.cs
  4. +67
    -0
      B3QingDaoWanFu/TypeIOCs/ScanInfoTypeIOC.cs

+ 1
- 0
B3QingDaoWanFu.Web/PluginClass.cs View File

@ -37,6 +37,7 @@ namespace BWP.B3QingDaoWanFu
GlobalFlags.On(B3ButcherManageConsts.GlobalFlags.);
GlobalFlags.On(B3SaleConsts.Flags.EnableABCPay);
GlobalFlags.On(B3ProduceUnitedInfosConsts.GlobalFlags.Car_UseDriver);
GlobalFlags.On(B3SaleConsts.Flags.SaleOutStoreEnableScan);
TimerConfig.Register(() => "* * * * *", new QueryTrustPayTask());
TimerConfig.Register(() => "*/5 * * * *", new QueryNoGatheringTrustPayTask());


+ 1
- 0
B3QingDaoWanFu/B3QingDaoWanFu.csproj View File

@ -178,6 +178,7 @@
<Compile Include="TypeIOCs\GoodsBLTypeIoc.cs" />
<Compile Include="TypeIOCs\PayBLTypeIoc.cs" />
<Compile Include="TypeIOCs\SaleOutStoreBLTypeIoc.cs" />
<Compile Include="TypeIOCs\ScanInfoTypeIOC.cs" />
<Compile Include="TypeIOCs\StatPayBLTypeIoc.cs" />
<Compile Include="TypeIOCs\WeightBillTypeIoc.cs" />
<Compile Include="Utils\B3QingDaoWanFuConsts.cs" />


+ 2
- 1
B3QingDaoWanFu/Tasks/SyncSaleOutStoreInfoToMES.cs View File

@ -98,7 +98,7 @@ namespace BWP.B3QingDaoWanFu.Tasks
query.Columns.Add(DQSelectColumn.Field("Flag", scan));
query.Where.Conditions.Add(DQCondition.And(DQCondition.GreaterThanOrEqual("BillState", .), DQCondition.IsNull(DQExpression.Field(relate, "SaleOutStore_ID")), DQCondition.IsNotNull(DQExpression.Field(scan, "ID"))));
query.Where.Conditions.Add(DQCondition.And(DQCondition.GreaterThan(scan, "Weight", 0), DQCondition.GreaterThan(scan, "Number", 0)));
query.Where.Conditions.Add(DQCondition.And(DQCondition.Or(DQCondition.EQ("Flag", -1), DQCondition.GreaterThan(scan, "Weight", 0)), DQCondition.GreaterThan(scan, "Number", 0)));
query.Where.Conditions.Add(DQCondition.InEQ(scan, "Flag", 2));
query.OrderBy.Expressions.Add(DQOrderByExpression.Create(main, "ID"));
using (var session = Dmo.NewSession())
@ -116,6 +116,7 @@ namespace BWP.B3QingDaoWanFu.Tasks
var flag = (int)reader[7];
switch (flag)
{
case -1://白条
case 0://白条
{
var entity = new CarcassSaleOutStoreObj();


+ 67
- 0
B3QingDaoWanFu/TypeIOCs/ScanInfoTypeIOC.cs View File

@ -0,0 +1,67 @@
using BWP.B3ButcherManage.BO;
using BWP.B3Frameworks;
using BWP.B3ProcurementInterface.Utils;
using BWP.B3Sale.Rpcs;
using Forks.EnterpriseServices.DomainObjects2;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
using Forks.JsonRpc.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TSingSoft.WebPluginFramework;
namespace BWP.B3QingDaoWanFu.TypeIOCs
{
[TypeIOC(typeof(SaleScanIoc), typeof(SaleScanIoc.AfterScan))]
public class ScanInfoTypeIOC : SaleScanIoc.AfterScan
{
static bool inited = false;
bool InitRpcFacade()
{
if (!inited)
{
var url = GetMesUrl();
if (string.IsNullOrEmpty(url))
return false;
try
{
RpcFacade.Init(url, "B3ClientService");
inited = true;
}
catch (Exception ex)
{
if (ex.Message == "Can only start once")
inited = true;
else
throw;
}
}
return inited;
}
string GetMesUrl()
{
var query = new DQueryDom(new JoinAlias(typeof(ClientConfig)));
query.Columns.Add(DQSelectColumn.Field("MesUrl"));
return query.EExecuteScalar<string>();
}
public string Invoke(string barCode)
{
if (!InitRpcFacade())
{
if (!ClientServerFacedRpcFacadeUtil.InitRpcFacade())
return string.Empty;
}
try
{
return RpcFacade.Call<string>("/MainSystem/B3ClientService/Rpcs/CarcassSaleOutStoreRpc/GetCarcassInstoreInfo", barCode);
}
catch {
return string.Empty;
}
}
}
}

Loading…
Cancel
Save