Browse Source

接口修改读取数据方式

master
qian 5 months ago
parent
commit
5e89767e44
  1. 31
      北京北汽/Controller/SCP_DC_UNI_CONTROLLER.cs

31
北京北汽/Controller/SCP_DC_UNI_CONTROLLER.cs

@ -17,6 +17,7 @@ using System.Threading.Tasks;
using System.Transactions;
using System.Data.Entity.Core;
using System.Security.Cryptography;
using System.Data.Entity;
//using WebSrvAPITest;
namespace CK.SCP.Controller
@ -175,7 +176,19 @@ namespace CK.SCP.Controller
return _ret;
}
/// <summary>
/// 获取
/// </summary>
/// <returns></returns>
public static List<TEA_TASK_SUB> Get_TEA_TASK_SUB_List(ExchangeCenterContext db,TEA_TASK_SUB p_entity)
{
List<TEA_TASK_SUB> list = new List<TEA_TASK_SUB>();
string _sql = "select * from TEA_TASK_SUB where TaskState = '{0}' and Subscriber = '{1}'";
_sql = string.Format(_sql, (int)p_entity.TaskState,p_entity.Subscriber);
list = db.Database.SqlQuery<TEA_TASK_SUB>(_sql).ToList();
return list;
}
public static ResultObject<List<TEA_TASK_SUB>> Get_TEA_TASK_SUB_List(TEA_TASK_SUB p_entity)
{
@ -199,7 +212,7 @@ namespace CK.SCP.Controller
}
if (!string.IsNullOrEmpty(p_entity.Subscriber))
{
q = q.Where(p => p.Subscriber.Contains(p_entity.Subscriber));
q = q.Where(p => p.Subscriber == p_entity.Subscriber);
}
if (p_entity.FailedCount != 0)
{
@ -394,16 +407,20 @@ namespace CK.SCP.Controller
public static void ReadService(Action<ResultObject<bool>> p_action)
{
ResultObject<bool> result = new ResultObject<bool>();
ExchangeCenterContext db = EntitiesFactory.CreateExchangeCenterInstance();
// ResultObject<List<LogModel>> result = new ResultObject<List<LogModel>>();
var _result = Get_TEA_TASK_SUB_List(new TEA_TASK_SUB() { TaskState = EnumTaskState.Unread, Subscriber = "SCP" });
if (_result.State == ReturnStatus.Succeed)
//var _result = Get_TEA_TASK_SUB_List(new TEA_TASK_SUB() { TaskState = EnumTaskState.Unread, Subscriber = "SCP"});
List<TEA_TASK_SUB> tasklist = Get_TEA_TASK_SUB_List(db,new TEA_TASK_SUB() { TaskState = EnumTaskState.Unread, Subscriber = "SCP" });
if (tasklist.Count()>0)
//if (_result.State == ReturnStatus.Succeed)
{
foreach (var _task in _result.Result)
foreach (var _task in tasklist)
//foreach (var _task in _result.Result)
{
ScpEntities scpdb = EntitiesFactory.CreateScpInstance();
ExchangeCenterContext db = EntitiesFactory.CreateExchangeCenterInstance();
DataCenterContext dc = EntitiesFactory.CreateDataCenterInstance();
AppBoxContext authdb = EntitiesFactory.CreateAppBoxInstance();
//ExchangeCenterContext db = EntitiesFactory.CreateExchangeCenterInstance();
using (var scope =
// 注释内容可去掉mdtc
//new TransactionScope(TransactionScopeOption.Suppress, new TransactionOptions()
@ -551,8 +568,8 @@ namespace CK.SCP.Controller
{
ScpEntities scpdb = EntitiesFactory.CreateScpInstance();
ExchangeCenterContext db = EntitiesFactory.CreateExchangeCenterInstance();
var _list = scpdb.TS_UNI_API.Where(p => p.State == (int)DataState.Enabled&&p.Domain== "CQBMPT").OrderBy(p => p.UID).ToList();
var _list1 = scpdb.TS_UNI_API.Where(p => p.State == (int)DataState.Enabled && p.Domain == "CQBMPT" && p.InterfaceType== "Price").OrderBy(p => p.UID).ToList();
var _list = scpdb.TS_UNI_API.Where(p => p.State == (int)DataState.Enabled&&p.Domain== "HFBMPT").OrderBy(p => p.UID).ToList();
var _list1 = scpdb.TS_UNI_API.Where(p => p.State == (int)DataState.Enabled && p.Domain == "HFBMPT" && p.InterfaceType== "Price").OrderBy(p => p.UID).ToList();
var apiii = _list1.Count();
if (apiii > 0) {

Loading…
Cancel
Save