diff --git a/北京北汽/Controller/SCP_DC_UNI_CONTROLLER.cs b/北京北汽/Controller/SCP_DC_UNI_CONTROLLER.cs index 47c1002..1d9cb86 100644 --- a/北京北汽/Controller/SCP_DC_UNI_CONTROLLER.cs +++ b/北京北汽/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; } + /// + /// 获取 + /// + /// + public static List Get_TEA_TASK_SUB_List(ExchangeCenterContext db,TEA_TASK_SUB p_entity) + { + List list = new List(); + 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(_sql).ToList(); + return list; + } public static ResultObject> 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> p_action) { ResultObject result = new ResultObject(); - // ResultObject> result = new ResultObject>(); - var _result = Get_TEA_TASK_SUB_List(new TEA_TASK_SUB() { TaskState = EnumTaskState.Unread, Subscriber = "SCP" }); - if (_result.State == ReturnStatus.Succeed) - { - foreach (var _task in _result.Result) + ExchangeCenterContext db = EntitiesFactory.CreateExchangeCenterInstance(); + // ResultObject> result = new ResultObject>(); + //var _result = Get_TEA_TASK_SUB_List(new TEA_TASK_SUB() { TaskState = EnumTaskState.Unread, Subscriber = "SCP"}); + List 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 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) {