Browse Source

加 过磅单审核。

master
yibo 8 years ago
parent
commit
6098036886
5 changed files with 103 additions and 0 deletions
  1. +1
    -0
      B3ClientService/B3ClientService.csproj
  2. +59
    -0
      B3ClientService/BO/Bill/WeightBill/WeightBillCheck.cs
  3. +6
    -0
      B3ClientService/Rpcs/BillRpc/WeightBillRpc.cs
  4. +35
    -0
      B3ClientService/Tasks/UpdateLoad/DoCheckBills.cs
  5. +2
    -0
      B3ClientService/Tasks/UpdateLoad/UploadTest.cs

+ 1
- 0
B3ClientService/B3ClientService.csproj View File

@ -88,6 +88,7 @@
<Compile Include="BO\Bill\SecondOrder\SecondOrder.cs" /> <Compile Include="BO\Bill\SecondOrder\SecondOrder.cs" />
<Compile Include="BO\Bill\SecondOrder\SecondOrder_Detail.cs" /> <Compile Include="BO\Bill\SecondOrder\SecondOrder_Detail.cs" />
<Compile Include="BO\Bill\WeightBill\WeightBill.cs" /> <Compile Include="BO\Bill\WeightBill\WeightBill.cs" />
<Compile Include="BO\Bill\WeightBill\WeightBillCheck.cs" />
<Compile Include="BO\Bill\WeightBill\WeightBillShowRelate.cs" /> <Compile Include="BO\Bill\WeightBill\WeightBillShowRelate.cs" />
<Compile Include="BO\Bill\WeightBill\WeightBill_Detail.cs" /> <Compile Include="BO\Bill\WeightBill\WeightBill_Detail.cs" />
<Compile Include="BO\Bill\WeightBill\WeightBill_FarmerDetail.cs" /> <Compile Include="BO\Bill\WeightBill\WeightBill_FarmerDetail.cs" />


+ 59
- 0
B3ClientService/BO/Bill/WeightBill/WeightBillCheck.cs View File

@ -0,0 +1,59 @@
using Forks.EnterpriseServices.DomainObjects2;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TSingSoft.WebPluginFramework;
namespace BWP.B3ClientService.BO
{
[Serializable]
[BOClass]
public class WeightBillCheck
{
public long B3ID { get; set; }
/// <summary>
/// 单据创建人用户名
/// </summary>
public string Creator { get; set; }
/// <summary>
/// 同步状态
/// </summary>
public bool Sync { get; set; }
public DateTime ModifyTime { get; set; }
public static void Insert(long id, string creator)
{
if (Exist(id))
return;
var entity = new WeightBillCheck();
entity.B3ID = id;
entity.Creator = creator;
entity.ModifyTime = DateTime.Now;
using (var session = Dmo.NewSession())
{
session.Insert(entity);
session.Commit();
}
}
static bool Exist(long id)
{
var query = new DQueryDom(new JoinAlias(typeof(WeightBillCheck)));
query.Where.Conditions.Add(DQCondition.EQ("B3ID", id));
return query.EExists();
}
public static void SetSynced(long id)
{
var update = new DQUpdateDom(typeof(WeightBillCheck));
update.Columns.Add(new DQUpdateColumn("Sync", true));
update.Where.Conditions.Add(DQCondition.EQ("B3ID", id));
update.EExecute();
}
}
}

+ 6
- 0
B3ClientService/Rpcs/BillRpc/WeightBillRpc.cs View File

@ -301,5 +301,11 @@ namespace BWP.B3ClientService.Rpcs.BillRpc
entity.Details = s.Select(x => new PWeightBill_SanctionDetail { AbnormalItem_Name = x.Item1, Number = x.Item2, Money = x.Item3 }).ToList(); entity.Details = s.Select(x => new PWeightBill_SanctionDetail { AbnormalItem_Name = x.Item1, Number = x.Item2, Money = x.Item3 }).ToList();
return serializer.Serialize(entity); return serializer.Serialize(entity);
} }
[Rpc]
public static void DoCheck(long b3ID, string creator)
{
WeightBillCheck.Insert(b3ID, creator);
}
} }
} }

+ 35
- 0
B3ClientService/Tasks/UpdateLoad/DoCheckBills.cs View File

@ -0,0 +1,35 @@
using BWP.B3ClientService.BO;
using Forks.EnterpriseServices.DomainObjects2;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TSingSoft.WebPluginFramework.BWPClients;
using TSingSoft.WebPluginFramework;
namespace BWP.B3ClientService.Tasks.UpdateLoad
{
public static class DoCheckBills
{
public static void Execute(string uri)
{
var weightBills = GetWeightBillCheck();
foreach (var item in weightBills)
{
var bwpClient = new BWPClient(uri, item.Item2);
bwpClient.Call<int>("/MainSystem/B3ButcherManage/Rpcs/WeighBillRpc/DoCheck", item.Item1);
WeightBillCheck.SetSynced(item.Item1);
}
}
static List<Tuple<long, string>> GetWeightBillCheck()
{
var query = new DQueryDom(new JoinAlias(typeof(WeightBillCheck)));
query.Columns.Add(DQSelectColumn.Field("B3ID"));
query.Columns.Add(DQSelectColumn.Field("Creator"));
query.Where.Conditions.Add(DQCondition.EQ("Sync", false));
return query.EExecuteList<long, string>();
}
}
}

+ 2
- 0
B3ClientService/Tasks/UpdateLoad/UploadTest.cs View File

@ -25,6 +25,8 @@ namespace BWP.B3ClientService.Tasks
UpLoadWeightBill.Execute(serverUri); UpLoadWeightBill.Execute(serverUri);
UploadOrderDetail.Execute(serverUri); UploadOrderDetail.Execute(serverUri);
UploadSecondOrder.Execute(serverUri); UploadSecondOrder.Execute(serverUri);
DoCheckBills.Execute(serverUri);
} }
public string Name public string Name


Loading…
Cancel
Save