From 5e89767e44fdb05934607f04b92d8d906af36abc Mon Sep 17 00:00:00 2001 From: qian Date: Tue, 9 Jul 2024 14:22:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9=E8=AF=BB?= =?UTF-8?q?=E5=8F=96=E6=95=B0=E6=8D=AE=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/SCP_DC_UNI_CONTROLLER.cs | 35 ++++++++++++++----- 1 file changed, 26 insertions(+), 9 deletions(-) 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) {