|
|
|
@ -1,72 +1,72 @@ |
|
|
|
using BWP.B3ClientService.BO; |
|
|
|
using Forks.EnterpriseServices.DomainObjects2.DQuery; |
|
|
|
using Forks.JsonRpc.Client; |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Linq; |
|
|
|
using System.Text; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using TSingSoft.WebPluginFramework.BWPClients; |
|
|
|
using TSingSoft.WebPluginFramework.TimerTasks; |
|
|
|
using TSingSoft.WebPluginFramework; |
|
|
|
using Forks.JsonRpc.Client.Data; |
|
|
|
using Forks.EnterpriseServices.DomainObjects2; |
|
|
|
//using BWP.B3ClientService.BO;
|
|
|
|
//using Forks.EnterpriseServices.DomainObjects2.DQuery;
|
|
|
|
//using Forks.JsonRpc.Client;
|
|
|
|
//using System;
|
|
|
|
//using System.Collections.Generic;
|
|
|
|
//using System.Linq;
|
|
|
|
//using System.Text;
|
|
|
|
//using System.Threading.Tasks;
|
|
|
|
//using TSingSoft.WebPluginFramework.BWPClients;
|
|
|
|
//using TSingSoft.WebPluginFramework.TimerTasks;
|
|
|
|
//using TSingSoft.WebPluginFramework;
|
|
|
|
//using Forks.JsonRpc.Client.Data;
|
|
|
|
//using Forks.EnterpriseServices.DomainObjects2;
|
|
|
|
|
|
|
|
namespace BWP.B3ClientService.Tasks |
|
|
|
{ |
|
|
|
public class UploadTest : ITimerTask |
|
|
|
{ |
|
|
|
public void Execute() |
|
|
|
{ |
|
|
|
var serverUri = ServerHost.GetServerUrl(); |
|
|
|
if (string.IsNullOrEmpty(serverUri)) |
|
|
|
throw new Exception("请配置服务器地址"); |
|
|
|
//namespace BWP.B3ClientService.Tasks
|
|
|
|
//{
|
|
|
|
// public class UploadTest : ITimerTask
|
|
|
|
// {
|
|
|
|
// public void Execute()
|
|
|
|
// {
|
|
|
|
// var serverUri = ServerHost.GetServerUrl();
|
|
|
|
// if (string.IsNullOrEmpty(serverUri))
|
|
|
|
// throw new Exception("请配置服务器地址");
|
|
|
|
|
|
|
|
var list = GetWeightBill(); |
|
|
|
foreach (var bill in list) |
|
|
|
{ |
|
|
|
BWPClient bwpClient = new BWPClient(serverUri, bill.CreaterName); |
|
|
|
var obj = ConvertToRpcObject(bill); |
|
|
|
var id =bwpClient.Call<long>("/MainSystem/B3ButcherManage/Rpcs/TouchScreenUploadRpc/InsertWeighBill", obj); |
|
|
|
using (var dmo = Dmo.NewSession()) |
|
|
|
{ |
|
|
|
// var list = GetWeightBill();
|
|
|
|
// foreach (var bill in list)
|
|
|
|
// {
|
|
|
|
// BWPClient bwpClient = new BWPClient(serverUri, bill.CreaterName);
|
|
|
|
// var obj = ConvertToRpcObject(bill);
|
|
|
|
// var id =bwpClient.Call<long>("/MainSystem/B3ButcherManage/Rpcs/TouchScreenUploadRpc/InsertWeighBill", obj);
|
|
|
|
// using (var dmo = Dmo.NewSession())
|
|
|
|
// {
|
|
|
|
|
|
|
|
} |
|
|
|
// }
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
IEnumerable<WeightBill> GetWeightBill() |
|
|
|
{ |
|
|
|
var query = new DmoQuery(typeof(WeightBill)); |
|
|
|
query.Where.Conditions.Add(DQCondition.EQ("Sync", false)); |
|
|
|
return query.EExecuteList().Cast<WeightBill>(); |
|
|
|
} |
|
|
|
// IEnumerable<WeightBill> GetWeightBill()
|
|
|
|
// {
|
|
|
|
// var query = new DmoQuery(typeof(WeightBill));
|
|
|
|
// query.Where.Conditions.Add(DQCondition.EQ("Sync", false));
|
|
|
|
// return query.EExecuteList().Cast<WeightBill>();
|
|
|
|
// }
|
|
|
|
|
|
|
|
Dictionary<string,object> ConvertToRpcObject(WeightBill bill) |
|
|
|
{ |
|
|
|
var dic = new Dictionary<string, object>(); |
|
|
|
dic.Add("AccountingUnit_ID", 1); |
|
|
|
dic.Add("Department_ID", 5); |
|
|
|
dic.Add("Domain_ID", 1); |
|
|
|
dic.Add("Zone_ID", bill.Zone_ID); |
|
|
|
dic.Add("Employee_ID", bill.Employee_ID); |
|
|
|
dic.Add("Supplier_ID", bill.Supplier_ID); |
|
|
|
dic.Add("WeighTime", bill.WeightTime); |
|
|
|
dic.Add("ShackPrice", bill.PenPrice); |
|
|
|
dic.Add("ShackWeight", bill.PenWeight); |
|
|
|
dic.Add("PurchaseType", bill.PurchaseType_ID); |
|
|
|
dic.Add("Inspector_ID", bill.Inspector_ID); |
|
|
|
dic.Add("Car_ID", bill.Car_ID); |
|
|
|
dic.Add("AnimalTestNumber", bill.AnimalTestNumber); |
|
|
|
dic.Add("AnimalTestDate", bill.AnimalTestDate); |
|
|
|
dic.Add("AnimalTestMan", bill.AnimalTestMan); |
|
|
|
return dic; |
|
|
|
} |
|
|
|
// Dictionary<string,object> ConvertToRpcObject(WeightBill bill)
|
|
|
|
// {
|
|
|
|
// var dic = new Dictionary<string, object>();
|
|
|
|
// dic.Add("AccountingUnit_ID", 1);
|
|
|
|
// dic.Add("Department_ID", 5);
|
|
|
|
// dic.Add("Domain_ID", 1);
|
|
|
|
// dic.Add("Zone_ID", bill.Zone_ID);
|
|
|
|
// dic.Add("Employee_ID", bill.Employee_ID);
|
|
|
|
// dic.Add("Supplier_ID", bill.Supplier_ID);
|
|
|
|
// dic.Add("WeighTime", bill.WeightTime);
|
|
|
|
// dic.Add("ShackPrice", bill.ShackPrice);
|
|
|
|
// dic.Add("ShackWeight", bill.ShackWeight);
|
|
|
|
// dic.Add("PurchaseType", bill.PurchaseType_ID);
|
|
|
|
// dic.Add("Inspector_ID", bill.Inspector_ID);
|
|
|
|
// dic.Add("Car_ID", bill.Car_ID);
|
|
|
|
// dic.Add("AnimalTestNumber", bill.AnimalTestNumber);
|
|
|
|
// dic.Add("AnimalTestDate", bill.AnimalTestDate);
|
|
|
|
// dic.Add("AnimalTestMan", bill.AnimalTestMan);
|
|
|
|
// return dic;
|
|
|
|
// }
|
|
|
|
|
|
|
|
public string Name |
|
|
|
{ |
|
|
|
get { return "测试上传"; } |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// public string Name
|
|
|
|
// {
|
|
|
|
// get { return "测试上传"; }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//}
|