yibo 8 years ago
parent
commit
e7befd5176
6 changed files with 45 additions and 32 deletions
  1. +3
    -2
      B3ClientService/B3ClientService.csproj
  2. +2
    -0
      B3ClientService/BO/BaseInfo/EmpInfoTable.cs
  3. +3
    -0
      B3ClientService/BO/Bill/WeightBill/WeightBill.cs
  4. +34
    -6
      B3ClientService/Rpcs/BillRpc/WeightBillRpc.cs
  5. +0
    -22
      B3ClientService/Tasks/DownLoad/LoadButcherOrder.cs
  6. +3
    -2
      B3ClientService/Tasks/SyncInfoFromServer.cs

+ 3
- 2
B3ClientService/B3ClientService.csproj View File

@ -93,12 +93,13 @@
<Compile Include="Rpcs\BillRpc\WeightBillRpc.cs" />
<Compile Include="Rpcs\ButcherOrderRpc.cs" />
<Compile Include="Rpcs\UserInfoRpc.cs" />
<Compile Include="Tasks\DownLoad\LoadButcherOrder.cs" />
<Compile Include="Tasks\SyncInfoFromServer.cs" />
<Compile Include="Tasks\UpdateLoad\UploadTest.cs" />
<Compile Include="WordPair.cs" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Folder Include="Tasks\DownLoad\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.


+ 2
- 0
B3ClientService/BO/BaseInfo/EmpInfoTable.cs View File

@ -19,5 +19,7 @@ namespace BWP.B3ClientService.BO
public string AccountingUnit_Name { get; set; }
public long? Department_ID { get; set; }
public string Department_Name { get; set; }
public string Role { get; set; }
}
}

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

@ -73,6 +73,9 @@ namespace BWP.B3ClientService.BO
public string Remark { get; set; }
[DbColumn(DefaultValue = 0)]
public bool AlreadyHouse { get; set; }
private readonly WeightBill_DetailCollection mDetails = new WeightBill_DetailCollection();
[OneToMany(typeof(WeightBill_Detail), "ID")]
[Join("ID", "WeightBill_ID")]


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

@ -60,19 +60,45 @@ namespace BWP.B3ClientService.Rpcs.BillRpc
return query.EExecuteList().Cast<WeightBill>().ToList();
}
[Rpc]
public static List<Tuple<long, long>> SyncBillB3Ids(List<long> ids)
{
return GetSyncBaseB3Ids<WeightBill>(ids);
}
[Rpc]
public static List<Tuple<long, long>> SyncWeightDetailB3Ids(List<long> ids)
{
return GetSyncBaseB3Ids<WeightBill_Detail>(ids);
}
[Rpc]
public static List<Tuple<long, long>> SyncFarmerDetailB3Ids(List<long> ids)
{
return GetSyncBaseB3Ids<WeightBill_FarmerDetail>(ids);
}
static List<Tuple<long, long>> GetSyncBaseB3Ids<T>(List<long> ids)
where T : SyncBase
{
var query = new DQueryDom(new JoinAlias(typeof(T)));
query.Columns.Add(DQSelectColumn.Field("ID"));
query.Columns.Add(DQSelectColumn.Field("B3ID"));
query.Where.Conditions.Add(DQCondition.And(DQCondition.IsNotNull(DQExpression.Field("B3ID")), DQCondition.InList(DQExpression.Field("ID"), ids.Select(x => DQExpression.Value(x)).ToArray())));
return query.EExecuteList<long, long>();
}
[Rpc]
public static List<WeightBill> GetNoHouseInfoWeightBills(DateTime date)
{
var main = new JoinAlias(typeof(WeightBill));
var detail = new JoinAlias(typeof(WeightBill_HouseDetail));
var query = new DQueryDom(main);
query.From.AddJoin(JoinType.Left, new DQDmoSource(detail), DQCondition.And(DQCondition.EQ(main, "ID", detail, "WeightBill_ID"), DQCondition.EQ(detail, "DeleteState", false)));
var query = new DQueryDom(new JoinAlias(typeof(WeightBill)));
query.Where.Conditions.Add(DQCondition.And(DQCondition.And(DQCondition.EQ("DeleteState", false), DQCondition.Between("WeighTime", date.Date, date.Date + new TimeSpan(23, 59, 29)))));
query.Where.Conditions.Add(DQCondition.IsNull(DQExpression.Field(detail, "ID")));
query.Columns.Add(DQSelectColumn.Field("ID"));
query.Columns.Add(DQSelectColumn.Field("B3ID"));
query.Columns.Add(DQSelectColumn.Field("Supplier_Name"));
var result = query.EExecuteList<long, long?, string>();
query.Columns.Add(DQSelectColumn.Field("AlreadyHouse"));
var result = query.EExecuteList<long, long?, string, bool>();
var list = new List<WeightBill>();
foreach (var item in result)
{
@ -81,6 +107,7 @@ namespace BWP.B3ClientService.Rpcs.BillRpc
entity.ID = item.Item1;
entity.B3ID = item.Item2;
entity.Supplier_Name = item.Item3;
entity.AlreadyHouse = item.Item4;
}
return list;
}
@ -100,6 +127,7 @@ namespace BWP.B3ClientService.Rpcs.BillRpc
update.Columns.Add(new DQUpdateColumn("HogGrade_Name", bo.HogGrade_Name));
update.Columns.Add(new DQUpdateColumn("Inspector_ID", bo.Inspector_ID));
update.Columns.Add(new DQUpdateColumn("Inspector_Name", bo.Inspector_Name));
update.Columns.Add(new DQUpdateColumn("AlreadyHouse", true));
update.Columns.Add(new DQUpdateColumn("Sync", false));
update.Columns.Add(new DQUpdateColumn("ModifyTime", DateTime.Now));
update.Where.Conditions.Add(DQCondition.EQ("ID", bo.ID));


+ 0
- 22
B3ClientService/Tasks/DownLoad/LoadButcherOrder.cs View File

@ -1,22 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TSingSoft.WebPluginFramework.TimerTasks;
namespace BWP.B3ClientService.Tasks
{
class LoadButcherOrder : ITimerTask
{
public void Execute()
{
}
public string Name
{
get { return "同步拍宰顺序"; }
}
}
}

+ 3
- 2
B3ClientService/Tasks/SyncInfoFromServer.cs View File

@ -48,7 +48,7 @@ namespace BWP.B3ClientService.Tasks
SyncHogGrade();
SyncLiveColonyHouse();
SyncSanction();
//SyncLiveVarieties();
SyncLiveVarieties();
}
//catch
{ }
@ -118,7 +118,7 @@ namespace BWP.B3ClientService.Tasks
entity.CreateTime = DateTime.Today;
entity.ModifyTime = entity.CreateTime;
context.Session.Insert(entity);
}
}
var sql2 = @"SET IDENTITY_INSERT [B3Frameworks_Employee] OFF;";
context.Session.ExecuteSqlNonQuery(sql2);
context.Commit();
@ -144,6 +144,7 @@ namespace BWP.B3ClientService.Tasks
entity.Department_Name = o.Get<string>("Department_Name");
entity.AccountingUnit_ID = o.Get<long?>("AccountingUnit_ID");
entity.AccountingUnit_Name = o.Get<string>("AccountingUnit_Name");
entity.Role = o.Get<string>("Role");
context.Session.Insert(entity);
}
context.Commit();


Loading…
Cancel
Save