定时任务
This commit is contained in:
parent
d097f8d4d4
commit
6726cdfb52
|
|
@ -43,7 +43,7 @@ namespace BLL
|
|||
/// 数据库连接字符串
|
||||
/// </summary>
|
||||
private static string connString;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 数据库连结字符串。
|
||||
/// </summary>
|
||||
|
|
@ -134,7 +134,8 @@ namespace BLL
|
|||
{
|
||||
get
|
||||
{
|
||||
lock (locker) {
|
||||
lock (locker)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!DBList.ContainsKey(System.Threading.Thread.CurrentThread.ManagedThreadId))
|
||||
|
|
@ -194,7 +195,7 @@ namespace BLL
|
|||
DDL.Items.Insert(0, new FineUIPro.ListItem("- 请选择 -", BLL.Const._Null));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 为目标下拉框加上选择内容
|
||||
/// </summary>
|
||||
|
|
@ -575,7 +576,7 @@ namespace BLL
|
|||
Random rm = new Random(System.Environment.TickCount);
|
||||
if (dateTime.HasValue)
|
||||
{
|
||||
str= dateTime.Value.ToString("yyyyMMddhhmmss") + rm.Next(1000, 9999).ToString();
|
||||
str = dateTime.Value.ToString("yyyyMMddhhmmss") + rm.Next(1000, 9999).ToString();
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
|
@ -872,7 +873,7 @@ namespace BLL
|
|||
}
|
||||
|
||||
#region 获取大写金额事件
|
||||
public static string NumericCapitalization(decimal num)
|
||||
public static string NumericCapitalization(decimal num)
|
||||
{
|
||||
string str1 = "零壹贰叁肆伍陆柒捌玖"; //0-9所对应的汉字
|
||||
string str2 = "万仟佰拾亿仟佰拾万仟佰拾元角分"; //数字位所对应的汉字
|
||||
|
|
@ -1003,7 +1004,7 @@ namespace BLL
|
|||
return str.ToArray();
|
||||
}
|
||||
|
||||
public static string GetStringByArray(string[] array)
|
||||
public static string GetStringByArray(string[] array)
|
||||
{
|
||||
string str = string.Empty;
|
||||
foreach (var item in array)
|
||||
|
|
@ -1209,6 +1210,7 @@ namespace BLL
|
|||
}
|
||||
|
||||
IRestResponse response = client.Execute(request);
|
||||
|
||||
return response.Content;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,28 +14,6 @@ namespace BLL
|
|||
{
|
||||
private static Timer environmentTimer;
|
||||
|
||||
public static void StartEnvironmentSync()
|
||||
{
|
||||
ErrLogInfo.WriteLog("启用环境定时器开始!" );
|
||||
|
||||
if (environmentTimer != null)
|
||||
{
|
||||
environmentTimer.Stop();
|
||||
environmentTimer.Dispose();
|
||||
environmentTimer = null;
|
||||
}
|
||||
|
||||
environmentTimer = new Timer
|
||||
{
|
||||
AutoReset = true
|
||||
};
|
||||
environmentTimer.Elapsed += new ElapsedEventHandler(EnvironmentProcess);
|
||||
environmentTimer.Interval = 1000 * 60 * 10;// 60分钟 60000 * adTimeJ;
|
||||
environmentTimer.Start();
|
||||
ErrLogInfo.WriteLog("启用环境定时器结束!");
|
||||
|
||||
}
|
||||
|
||||
private static void EnvironmentProcess(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
try
|
||||
|
|
@ -54,35 +32,6 @@ namespace BLL
|
|||
/// </summary>
|
||||
private static Timer messageTimer;
|
||||
|
||||
/// <summary>
|
||||
/// 启动监视器,不一定能成功,根据系统设置决定对监视器执行的操作 系统启动5分钟
|
||||
/// </summary>
|
||||
public static void StartMonitor()
|
||||
{
|
||||
//int adTimeJ = 60;
|
||||
//if (adomain.AdTimeH.HasValue)
|
||||
//{
|
||||
// adTimeJ += adomain.AdTimeH.Value * 60;
|
||||
//}
|
||||
//if (adomain.AdTimeM.HasValue)
|
||||
//{
|
||||
// adTimeJ += adomain.AdTimeM.Value;
|
||||
//}
|
||||
if (messageTimer != null)
|
||||
{
|
||||
messageTimer.Stop();
|
||||
messageTimer.Dispose();
|
||||
messageTimer = null;
|
||||
}
|
||||
|
||||
messageTimer = new Timer
|
||||
{
|
||||
AutoReset = true
|
||||
};
|
||||
messageTimer.Elapsed += new ElapsedEventHandler(AdUserInProcess);
|
||||
messageTimer.Interval = 1000 * 60 * 120;// 60分钟 60000 * adTimeJ;
|
||||
messageTimer.Start();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 流程确认 定时执行 系统启动5分钟
|
||||
|
|
@ -112,27 +61,7 @@ namespace BLL
|
|||
/// </summary>
|
||||
private static Timer weatherTimer;
|
||||
|
||||
/// <summary>
|
||||
/// 启动监视器,不一定能成功,根据系统设置决定对监视器执行的操作 系统启动5分钟
|
||||
/// </summary>
|
||||
public static void StartWeather()
|
||||
{
|
||||
if (weatherTimer != null)
|
||||
{
|
||||
weatherTimer.Stop();
|
||||
weatherTimer.Dispose();
|
||||
weatherTimer = null;
|
||||
}
|
||||
|
||||
weatherTimer = new Timer
|
||||
{
|
||||
AutoReset = true
|
||||
};
|
||||
weatherTimer.Elapsed += new ElapsedEventHandler(AdWeather);
|
||||
weatherTimer.Interval = 1000 * 60 * 60;// 60分钟 60000 * adTimeJ;
|
||||
weatherTimer.Start();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 流程确认 定时执行 系统启动5分钟
|
||||
/// </summary>
|
||||
|
|
@ -197,27 +126,6 @@ namespace BLL
|
|||
/// </summary>
|
||||
private static Timer messageTimerEve;
|
||||
|
||||
/// <summary>
|
||||
/// 启动监视器,不一定能成功,根据系统设置决定对监视器执行的操作 定时
|
||||
/// </summary>
|
||||
public static void StartMonitorEve()
|
||||
{
|
||||
if (messageTimerEve != null)
|
||||
{
|
||||
messageTimerEve.Stop();
|
||||
messageTimerEve.Dispose();
|
||||
messageTimerEve = null;
|
||||
}
|
||||
|
||||
messageTimerEve = new Timer
|
||||
{
|
||||
AutoReset = true
|
||||
};
|
||||
messageTimerEve.Elapsed += new ElapsedEventHandler(ColligateFormConfirmProcessEve);
|
||||
messageTimerEve.Interval = GetMessageTimerEveNextInterval();
|
||||
messageTimerEve.Start();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 流程确认 定时执行 定时00:05 执行
|
||||
/// </summary>
|
||||
|
|
@ -286,27 +194,6 @@ namespace BLL
|
|||
/// </summary>
|
||||
private static Timer personQuarterCheckTimer;
|
||||
|
||||
/// <summary>
|
||||
/// 启动监视器,不一定能成功,根据系统设置决定对监视器执行的操作 定时
|
||||
/// </summary>
|
||||
public static void StartPersonQuarterCheck()
|
||||
{
|
||||
if (personQuarterCheckTimer != null)
|
||||
{
|
||||
personQuarterCheckTimer.Stop();
|
||||
personQuarterCheckTimer.Dispose();
|
||||
personQuarterCheckTimer = null;
|
||||
}
|
||||
|
||||
personQuarterCheckTimer = new Timer
|
||||
{
|
||||
AutoReset = true
|
||||
};
|
||||
personQuarterCheckTimer.Elapsed += new ElapsedEventHandler(AddQuarterCheck);
|
||||
personQuarterCheckTimer.Interval = 1000 * 3600 * 20;
|
||||
personQuarterCheckTimer.Start();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 流程确认 定时执行 定时每天执行
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ namespace BLL
|
|||
|
||||
public static class LogService
|
||||
{
|
||||
public static Model.CNPCDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 添加操作日志
|
||||
|
|
@ -81,28 +80,31 @@ namespace BLL
|
|||
/// <param name="opLog"></param>
|
||||
public static void AddLog(string userId, string opLog)
|
||||
{
|
||||
//SetOvertime(userId);
|
||||
Model.Sys_Log log = new Model.Sys_Log
|
||||
using (Model.CNPCDB db = new Model.CNPCDB(Funs.ConnString))
|
||||
{
|
||||
LogId = SQLHelper.GetNewID(typeof(Model.Sys_Log)),
|
||||
HostName = Dns.GetHostName()
|
||||
};
|
||||
IPAddress[] ips = Dns.GetHostAddresses(log.HostName);
|
||||
if (ips.Length > 0)
|
||||
{
|
||||
foreach (IPAddress ip in ips)
|
||||
//SetOvertime(userId);
|
||||
Model.Sys_Log log = new Model.Sys_Log
|
||||
{
|
||||
if (ip.ToString().IndexOf('.') != -1)
|
||||
LogId = SQLHelper.GetNewID(typeof(Model.Sys_Log)),
|
||||
HostName = Dns.GetHostName()
|
||||
};
|
||||
IPAddress[] ips = Dns.GetHostAddresses(log.HostName);
|
||||
if (ips.Length > 0)
|
||||
{
|
||||
foreach (IPAddress ip in ips)
|
||||
{
|
||||
log.Ip = ip.ToString();
|
||||
if (ip.ToString().IndexOf('.') != -1)
|
||||
{
|
||||
log.Ip = ip.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
log.OperationTime = DateTime.Now;
|
||||
log.OperationLog = opLog;
|
||||
log.UserId = userId;
|
||||
db.Sys_Log.InsertOnSubmit(log);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
log.OperationTime = DateTime.Now;
|
||||
log.OperationLog = opLog;
|
||||
log.UserId = userId;
|
||||
db.Sys_Log.InsertOnSubmit(log);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ namespace BLL
|
|||
|
||||
public static class DataForJTApiService
|
||||
{
|
||||
public static Model.CNPCDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 获取接口设置信息
|
||||
|
|
|
|||
|
|
@ -1,26 +1,20 @@
|
|||
using FineUIPro;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing.Printing;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
|
||||
public static class InterFaceLogService
|
||||
|
||||
public static class InterFaceLogService
|
||||
{
|
||||
public static Model.CNPCDB db = Funs.DB;
|
||||
|
||||
public const string Type1 = "上报";
|
||||
public const string Type2= "下发";
|
||||
public const string Type2 = "下发";
|
||||
public const string Type3 = "回调";
|
||||
|
||||
#region 获取列表
|
||||
|
||||
#region 获取列表
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
/// </summary>
|
||||
|
|
@ -29,25 +23,25 @@ namespace BLL
|
|||
get;
|
||||
set;
|
||||
}
|
||||
public static List<Model.InterFaceLog> GetInterFaceLogByModle(Model.InterFaceLog table)
|
||||
{
|
||||
var q= from x in db.InterFaceLog
|
||||
where
|
||||
( string.IsNullOrEmpty(table.InterFaceLogId)||x.InterFaceLogId.Contains(table.InterFaceLogId)) &&
|
||||
( string.IsNullOrEmpty(table.UserId)||x.UserId.Contains(table.UserId)) &&
|
||||
( string.IsNullOrEmpty(table.UnitId)||x.UnitId.Contains(table.UnitId)) &&
|
||||
( string.IsNullOrEmpty(table.InterFaceName)||x.InterFaceName.Contains(table.InterFaceName)) &&
|
||||
( string.IsNullOrEmpty(table.InterFaceUrl)||x.InterFaceUrl.Contains(table.InterFaceUrl)) &&
|
||||
( string.IsNullOrEmpty(table.InterFaceMehtod)||x.InterFaceMehtod.Contains(table.InterFaceMehtod)) &&
|
||||
( string.IsNullOrEmpty(table.InterFaceBody)||x.InterFaceBody.Contains(table.InterFaceBody)) &&
|
||||
( string.IsNullOrEmpty(table.InterFaceReturnData)||x.InterFaceReturnData.Contains(table.InterFaceReturnData)) &&
|
||||
( string.IsNullOrEmpty(table.InterFaceType)||x.InterFaceType.Contains(table.InterFaceType)) &&
|
||||
( string.IsNullOrEmpty(table.IP)||x.IP.Contains(table.IP))
|
||||
orderby x.InterFaceLogDate descending
|
||||
select x
|
||||
;
|
||||
|
||||
return q.ToList();
|
||||
public static IQueryable<Model.InterFaceLog> GetInterFaceLogByModle(Model.InterFaceLog table)
|
||||
{
|
||||
var q = from x in db.InterFaceLog
|
||||
where
|
||||
(string.IsNullOrEmpty(table.InterFaceLogId) || x.InterFaceLogId.Contains(table.InterFaceLogId)) &&
|
||||
(string.IsNullOrEmpty(table.UserId) || x.UserId.Contains(table.UserId)) &&
|
||||
(string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) &&
|
||||
(string.IsNullOrEmpty(table.InterFaceName) || x.InterFaceName.Contains(table.InterFaceName)) &&
|
||||
(string.IsNullOrEmpty(table.InterFaceUrl) || x.InterFaceUrl.Contains(table.InterFaceUrl)) &&
|
||||
(string.IsNullOrEmpty(table.InterFaceMehtod) || x.InterFaceMehtod.Contains(table.InterFaceMehtod)) &&
|
||||
(string.IsNullOrEmpty(table.InterFaceBody) || x.InterFaceBody.Contains(table.InterFaceBody)) &&
|
||||
(string.IsNullOrEmpty(table.InterFaceReturnData) || x.InterFaceReturnData.Contains(table.InterFaceReturnData)) &&
|
||||
(string.IsNullOrEmpty(table.InterFaceType) || x.InterFaceType.Contains(table.InterFaceType)) &&
|
||||
(string.IsNullOrEmpty(table.IP) || x.IP.Contains(table.IP))
|
||||
orderby x.InterFaceLogDate descending
|
||||
select x
|
||||
;
|
||||
|
||||
return q;
|
||||
}
|
||||
|
||||
/// 获取分页列表
|
||||
|
|
@ -57,62 +51,60 @@ namespace BLL
|
|||
/// <returns></returns>
|
||||
public static IEnumerable getListData(Model.InterFaceLog table, Grid Grid1)
|
||||
{
|
||||
var q= GetInterFaceLogByModle(table);
|
||||
var q = GetInterFaceLogByModle(table);
|
||||
count = q.Count();
|
||||
if (count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
q = q.Skip(Grid1.PageSize * (Grid1.PageIndex)).Take(Grid1.PageSize).ToList();
|
||||
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
q = q.Skip(Grid1.PageSize * (Grid1.PageIndex)).Take(Grid1.PageSize);
|
||||
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
return (from x in q
|
||||
select new
|
||||
{
|
||||
x.InterFaceLogId,
|
||||
x.UserId,
|
||||
x.UnitId,
|
||||
x.InterFaceName,
|
||||
x.InterFaceUrl,
|
||||
x.InterFaceMehtod,
|
||||
x.InterFaceBody,
|
||||
x.InterFaceReturnData,
|
||||
x.InterFaceLogDate,
|
||||
x.InterFaceType,
|
||||
x.LogSate,
|
||||
x.IP,
|
||||
|
||||
});
|
||||
select new
|
||||
{
|
||||
x.InterFaceLogId,
|
||||
x.UserId,
|
||||
x.UnitId,
|
||||
x.InterFaceName,
|
||||
x.InterFaceUrl,
|
||||
x.InterFaceMehtod,
|
||||
x.InterFaceBody,
|
||||
x.InterFaceReturnData,
|
||||
x.InterFaceLogDate,
|
||||
x.InterFaceType,
|
||||
x.LogSate,
|
||||
x.IP,
|
||||
|
||||
}).ToList();
|
||||
}
|
||||
#endregion
|
||||
|
||||
public static Model.InterFaceLog GetInterFaceLogById(string InterFaceLogId)
|
||||
{
|
||||
return db.InterFaceLog.FirstOrDefault(x=>x.InterFaceLogId==InterFaceLogId);
|
||||
public static Model.InterFaceLog GetInterFaceLogById(string InterFaceLogId)
|
||||
{
|
||||
return db.InterFaceLog.FirstOrDefault(x => x.InterFaceLogId == InterFaceLogId);
|
||||
}
|
||||
|
||||
|
||||
public static void AddInterFaceLog(Model.InterFaceLog newtable)
|
||||
{
|
||||
|
||||
|
||||
Model.InterFaceLog table = new Model.InterFaceLog{
|
||||
InterFaceLogId=newtable.InterFaceLogId,
|
||||
UserId=newtable.UserId,
|
||||
UnitId=newtable.UnitId,
|
||||
InterFaceName=newtable.InterFaceName,
|
||||
InterFaceUrl=newtable.InterFaceUrl,
|
||||
InterFaceMehtod=newtable.InterFaceMehtod,
|
||||
InterFaceBody=newtable.InterFaceBody,
|
||||
InterFaceReturnData=newtable.InterFaceReturnData,
|
||||
InterFaceLogDate=newtable.InterFaceLogDate,
|
||||
InterFaceType=newtable.InterFaceType,
|
||||
LogSate=newtable.LogSate,
|
||||
IP=newtable.IP,
|
||||
Model.InterFaceLog table = new Model.InterFaceLog
|
||||
{
|
||||
InterFaceLogId = newtable.InterFaceLogId,
|
||||
UserId = newtable.UserId,
|
||||
UnitId = newtable.UnitId,
|
||||
InterFaceName = newtable.InterFaceName,
|
||||
InterFaceUrl = newtable.InterFaceUrl,
|
||||
InterFaceMehtod = newtable.InterFaceMehtod,
|
||||
InterFaceBody = newtable.InterFaceBody,
|
||||
InterFaceReturnData = newtable.InterFaceReturnData,
|
||||
InterFaceLogDate = newtable.InterFaceLogDate,
|
||||
InterFaceType = newtable.InterFaceType,
|
||||
LogSate = newtable.LogSate,
|
||||
IP = newtable.IP,
|
||||
};
|
||||
Funs.DB.InterFaceLog.InsertOnSubmit(table);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
public static void WriteInterFaceLog(string InterFaceSetlId, string InterFaceBody, string ReturnData, string InterFaceType,bool isSuccess)
|
||||
public static void WriteInterFaceLog(string InterFaceSetlId, string InterFaceBody, string ReturnData, string InterFaceType, bool isSuccess)
|
||||
{
|
||||
var InterfaceSetModel = InterFaceSetService.GetInterFaceSetById(InterFaceSetlId);
|
||||
Model.InterFaceLog table = new Model.InterFaceLog();
|
||||
|
|
@ -131,7 +123,7 @@ namespace BLL
|
|||
table.UnitId = InterfaceSetModel.UnitId;
|
||||
table.InterFaceUrl = InterfaceSetModel.InterFaceUrl;
|
||||
table.InterFaceMehtod = InterfaceSetModel.UrlReqMethod;
|
||||
|
||||
|
||||
break;
|
||||
case Type2:
|
||||
table.UnitId = InterfaceSetModel.AuthUnitIds;
|
||||
|
|
@ -150,36 +142,34 @@ namespace BLL
|
|||
|
||||
public static void UpdateInterFaceLog(Model.InterFaceLog newtable)
|
||||
{
|
||||
|
||||
Model.InterFaceLog table = db.InterFaceLog.FirstOrDefault(x=>x.InterFaceLogId==newtable.InterFaceLogId);
|
||||
if (table != null)
|
||||
|
||||
Model.InterFaceLog table = db.InterFaceLog.FirstOrDefault(x => x.InterFaceLogId == newtable.InterFaceLogId);
|
||||
if (table != null)
|
||||
{
|
||||
table.InterFaceLogId=newtable.InterFaceLogId;
|
||||
table.UserId=newtable.UserId;
|
||||
table.UnitId=newtable.UnitId;
|
||||
table.InterFaceName=newtable.InterFaceName;
|
||||
table.InterFaceUrl=newtable.InterFaceUrl;
|
||||
table.InterFaceMehtod=newtable.InterFaceMehtod;
|
||||
table.InterFaceBody=newtable.InterFaceBody;
|
||||
table.InterFaceReturnData=newtable.InterFaceReturnData;
|
||||
table.InterFaceLogDate=newtable.InterFaceLogDate;
|
||||
table.InterFaceType=newtable.InterFaceType;
|
||||
table.LogSate=newtable.LogSate;
|
||||
table.IP=newtable.IP;
|
||||
table.InterFaceLogId = newtable.InterFaceLogId;
|
||||
table.UserId = newtable.UserId;
|
||||
table.UnitId = newtable.UnitId;
|
||||
table.InterFaceName = newtable.InterFaceName;
|
||||
table.InterFaceUrl = newtable.InterFaceUrl;
|
||||
table.InterFaceMehtod = newtable.InterFaceMehtod;
|
||||
table.InterFaceBody = newtable.InterFaceBody;
|
||||
table.InterFaceReturnData = newtable.InterFaceReturnData;
|
||||
table.InterFaceLogDate = newtable.InterFaceLogDate;
|
||||
table.InterFaceType = newtable.InterFaceType;
|
||||
table.LogSate = newtable.LogSate;
|
||||
table.IP = newtable.IP;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
public static void DeleteInterFaceLogById (string InterFaceLogId)
|
||||
{
|
||||
|
||||
Model.InterFaceLog table =Funs.DB.InterFaceLog.FirstOrDefault(x=>x.InterFaceLogId==InterFaceLogId);
|
||||
if (table != null)
|
||||
{
|
||||
public static void DeleteInterFaceLogById(string InterFaceLogId)
|
||||
{
|
||||
Model.InterFaceLog table = Funs.DB.InterFaceLog.FirstOrDefault(x => x.InterFaceLogId == InterFaceLogId);
|
||||
if (table != null)
|
||||
{
|
||||
Funs.DB.InterFaceLog.DeleteOnSubmit(table);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,187 @@
|
|||
namespace BLL
|
||||
{
|
||||
using Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
public static class InterFaceService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 获取接口设置信息
|
||||
/// </summary>
|
||||
/// <param name="InterFaceSetId">设置Id</param>
|
||||
/// <returns>接口设置信息</returns>
|
||||
public static Model.InterFaceSet GetFaceSetById(string InterFaceSetId)
|
||||
{
|
||||
return Funs.DB.InterFaceSet.FirstOrDefault(e => e.InterFaceSetId == InterFaceSetId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加接口设置信息
|
||||
/// </summary>
|
||||
/// <param name="faceset">接口设置</param>
|
||||
public static void AddFaceSet(Model.InterFaceSet faceset)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
string newKeyID = SQLHelper.GetNewID(typeof(Model.InterFaceSet));
|
||||
List<InterFaceDetail> detailList = new List<InterFaceDetail>();
|
||||
Model.InterFaceSet newSet = new Model.InterFaceSet
|
||||
{
|
||||
InterFaceSetId = newKeyID,
|
||||
InterFaceName = faceset.InterFaceName,
|
||||
AuthUnitIds = faceset.AuthUnitIds,
|
||||
AuthUnitName = faceset.AuthUnitName,
|
||||
InterFaceUrl = faceset.InterFaceUrl,
|
||||
InterFaceForUrl = faceset.InterFaceForUrl,
|
||||
ValidPeriod = faceset.ValidPeriod,
|
||||
UnitId = faceset.UnitId,
|
||||
TxtRemarks = faceset.TxtRemarks,
|
||||
IsOpen = faceset.IsOpen,
|
||||
IsReqPost = faceset.IsReqPost,
|
||||
IsCallBack= faceset.IsCallBack,
|
||||
InterFaceCallBackUrl= faceset.InterFaceCallBackUrl,
|
||||
};
|
||||
//明细表
|
||||
foreach (var AuthUnitId in newSet.AuthUnitIds.Split(','))
|
||||
{
|
||||
Model.InterFaceDetail deteil = new Model.InterFaceDetail
|
||||
{
|
||||
InterFaceDetailId = SQLHelper.GetNewID(typeof(Model.InterFaceDetail)),
|
||||
InterFaceName = newSet.InterFaceName,
|
||||
UnitId = newSet.UnitId,
|
||||
AuthUnitIds = AuthUnitId,
|
||||
InterFaceSetlId = newSet.InterFaceSetId,
|
||||
ReportState = false,
|
||||
GainState = false,
|
||||
};
|
||||
detailList.Add(deteil);
|
||||
}
|
||||
db.InterFaceDetail.InsertAllOnSubmit(detailList);
|
||||
db.InterFaceSet.InsertOnSubmit(newSet);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改接口设置信息
|
||||
/// </summary>
|
||||
/// <param name="user">接口设置实体</param>
|
||||
public static void UpdateFaceSet(Model.InterFaceSet user)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
List<InterFaceDetail> detailList = new List<InterFaceDetail>();
|
||||
Model.InterFaceSet newSet = db.InterFaceSet.FirstOrDefault(e => e.InterFaceSetId == user.InterFaceSetId);
|
||||
if (newSet != null)
|
||||
{
|
||||
newSet.InterFaceName = user.InterFaceName;
|
||||
newSet.AuthUnitIds = user.AuthUnitIds;
|
||||
newSet.AuthUnitName = user.AuthUnitName;
|
||||
newSet.InterFaceUrl = user.InterFaceUrl;
|
||||
newSet.InterFaceForUrl = user.InterFaceForUrl;
|
||||
newSet.UnitId = user.UnitId;
|
||||
newSet.ValidPeriod = user.ValidPeriod;
|
||||
newSet.UnitId = user.UnitId;
|
||||
newSet.TxtRemarks = user.TxtRemarks;
|
||||
newSet.IsOpen = user.IsOpen;
|
||||
newSet.IsReqPost = user.IsReqPost;
|
||||
newSet.IsCallBack = user.IsCallBack;
|
||||
newSet.InterFaceCallBackUrl= user.InterFaceCallBackUrl;
|
||||
var AuthUnitIds = newSet.AuthUnitIds.Split(',');
|
||||
//明细表
|
||||
List<Model.InterFaceDetail> FaceDetailList = db.InterFaceDetail.Where(e => e.InterFaceSetlId == user.InterFaceSetId).ToList();
|
||||
//删除无效明细
|
||||
var oldDetails = FaceDetailList.Where(p=> !AuthUnitIds.Equals(p.AuthUnitIds)) ;
|
||||
if (oldDetails.Count() > 0)
|
||||
{
|
||||
db.InterFaceDetail.DeleteAllOnSubmit(oldDetails);
|
||||
}
|
||||
foreach (var AuthUnitId in AuthUnitIds)
|
||||
{
|
||||
Model.InterFaceDetail deteil = new Model.InterFaceDetail
|
||||
{
|
||||
InterFaceDetailId = SQLHelper.GetNewID(typeof(Model.InterFaceDetail)),
|
||||
InterFaceName = newSet.InterFaceName,
|
||||
UnitId = newSet.UnitId,
|
||||
AuthUnitIds = AuthUnitId,
|
||||
InterFaceSetlId = newSet.InterFaceSetId,
|
||||
};
|
||||
var FaceDetail = FaceDetailList.FirstOrDefault(p => p.AuthUnitIds == AuthUnitId);
|
||||
if (FaceDetail == null)
|
||||
{
|
||||
detailList.Add(deteil);
|
||||
}
|
||||
}
|
||||
db.InterFaceDetail.InsertAllOnSubmit(detailList);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据Id删除信息
|
||||
/// </summary>
|
||||
/// <param name="SetId"></param>
|
||||
public static void DeleteFaceSet(string SetId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.InterFaceSet FaceSet = db.InterFaceSet.FirstOrDefault(e => e.InterFaceSetId == SetId);
|
||||
if (FaceSet != null)
|
||||
{
|
||||
var logs = from x in db.Sys_Log where x.UserId == SetId select x;
|
||||
if (logs.Count() > 0)
|
||||
{
|
||||
db.Sys_Log.DeleteAllOnSubmit(logs);
|
||||
}
|
||||
db.InterFaceSet.DeleteOnSubmit(FaceSet);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存上报数据记录
|
||||
/// </summary>
|
||||
/// <param name="newItem">上报数据</param>
|
||||
/// <returns></returns>
|
||||
public static string SaveUpData(Model.InterFaceItem newItem)
|
||||
{
|
||||
if (newItem.FaceLogDate.Count() == 0)
|
||||
return "数据不可为空!";
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
List<string> InterFaceLogIdList = new List<string>();
|
||||
List<Model.InterFaceLog> logList = new List<Model.InterFaceLog>();
|
||||
string message = string.Empty;
|
||||
var FaceDetailList = db.InterFaceDetail.Where(x => newItem.FaceLogDate.Select(p=>p.UnitId).Equals(x.UnitId));
|
||||
foreach (var item in newItem.FaceLogDate)
|
||||
{
|
||||
//如果配置接口名称存在 进行数据保存
|
||||
var faceDetail = FaceDetailList.FirstOrDefault(p => p.InterFaceName == item.InterFaceName);
|
||||
if (faceDetail != null)
|
||||
{
|
||||
faceDetail.ReportDate = DateTime.Now;
|
||||
faceDetail.ReportState = true;
|
||||
Model.InterFaceLog FaceLog = new Model.InterFaceLog();
|
||||
FaceLog.InterFaceLogId = SQLHelper.GetNewID(typeof(Model.InterFaceLog));
|
||||
FaceLog.TxtContent = item.TxtContent;
|
||||
FaceLog.InterFaceLogDate = Convert.ToDateTime(item.InterFaceLogDate);
|
||||
FaceLog.LogSate = false;
|
||||
FaceLog.CollCropCode = item.CollCropCode;
|
||||
FaceLog.IP = item.IP;
|
||||
FaceLog.UnitId = item.UnitId;
|
||||
FaceLog.InterFaceDetailId = faceDetail.InterFaceDetailId;
|
||||
logList.Add(FaceLog);
|
||||
}
|
||||
else //配置接口名称不存在 记录反馈给前端提示
|
||||
{
|
||||
InterFaceLogIdList.Add(item.InterFaceName);
|
||||
}
|
||||
}
|
||||
db.InterFaceLog.InsertAllOnSubmit(logList);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
return "数据同步成功";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -8,12 +8,9 @@ using System.Text;
|
|||
|
||||
namespace BLL
|
||||
{
|
||||
|
||||
public static class InterFaceSetService
|
||||
public static class InterFaceSetService
|
||||
{
|
||||
|
||||
|
||||
#region 获取列表
|
||||
#region 获取列表
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
/// </summary>
|
||||
|
|
@ -22,24 +19,24 @@ namespace BLL
|
|||
get;
|
||||
set;
|
||||
}
|
||||
public static List<Model.InterFaceSet> GetInterFaceSetByModle(Model.InterFaceSet table)
|
||||
{
|
||||
var q= from x in Funs.DB.InterFaceSet
|
||||
where
|
||||
( string.IsNullOrEmpty(table.InterFaceSetId)||x.InterFaceSetId.Contains(table.InterFaceSetId)) &&
|
||||
( string.IsNullOrEmpty(table.InterFaceName)||x.InterFaceName.Contains(table.InterFaceName)) &&
|
||||
( string.IsNullOrEmpty(table.InterFaceUrl)||x.InterFaceUrl.Contains(table.InterFaceUrl)) &&
|
||||
( string.IsNullOrEmpty(table.UnitId)||x.UnitId.Contains(table.UnitId)) &&
|
||||
( string.IsNullOrEmpty(table.AuthUnitIds)||x.AuthUnitIds.Contains(table.AuthUnitIds)) &&
|
||||
( string.IsNullOrEmpty(table.AuthUnitName)||x.AuthUnitName.Contains(table.AuthUnitName)) &&
|
||||
( string.IsNullOrEmpty(table.ValidPeriod)||x.ValidPeriod.Contains(table.ValidPeriod)) &&
|
||||
( string.IsNullOrEmpty(table.TxtRemarks)||x.TxtRemarks.Contains(table.TxtRemarks)) &&
|
||||
( string.IsNullOrEmpty(table.InterFaceForUrl)||x.InterFaceForUrl.Contains(table.InterFaceForUrl)) &&
|
||||
( string.IsNullOrEmpty(table.InterFaceCallBackUrl)||x.InterFaceCallBackUrl.Contains(table.InterFaceCallBackUrl))
|
||||
select x
|
||||
;
|
||||
|
||||
return q.ToList();
|
||||
public static List<Model.InterFaceSet> GetInterFaceSetByModle(Model.InterFaceSet table)
|
||||
{
|
||||
var q = from x in Funs.DB.InterFaceSet
|
||||
where
|
||||
(string.IsNullOrEmpty(table.InterFaceSetId) || x.InterFaceSetId.Contains(table.InterFaceSetId)) &&
|
||||
(string.IsNullOrEmpty(table.InterFaceName) || x.InterFaceName.Contains(table.InterFaceName)) &&
|
||||
(string.IsNullOrEmpty(table.InterFaceUrl) || x.InterFaceUrl.Contains(table.InterFaceUrl)) &&
|
||||
(string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) &&
|
||||
(string.IsNullOrEmpty(table.AuthUnitIds) || x.AuthUnitIds.Contains(table.AuthUnitIds)) &&
|
||||
(string.IsNullOrEmpty(table.AuthUnitName) || x.AuthUnitName.Contains(table.AuthUnitName)) &&
|
||||
(string.IsNullOrEmpty(table.ValidPeriod) || x.ValidPeriod.Contains(table.ValidPeriod)) &&
|
||||
(string.IsNullOrEmpty(table.TxtRemarks) || x.TxtRemarks.Contains(table.TxtRemarks)) &&
|
||||
(string.IsNullOrEmpty(table.InterFaceForUrl) || x.InterFaceForUrl.Contains(table.InterFaceForUrl)) &&
|
||||
(string.IsNullOrEmpty(table.InterFaceCallBackUrl) || x.InterFaceCallBackUrl.Contains(table.InterFaceCallBackUrl))
|
||||
select x
|
||||
;
|
||||
|
||||
return q.ToList();
|
||||
}
|
||||
|
||||
/// 获取分页列表
|
||||
|
|
@ -49,107 +46,113 @@ namespace BLL
|
|||
/// <returns></returns>
|
||||
public static IEnumerable getListData(Model.InterFaceSet table, Grid Grid1)
|
||||
{
|
||||
var q= GetInterFaceSetByModle(table);
|
||||
var q = GetInterFaceSetByModle(table);
|
||||
count = q.Count();
|
||||
if (count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
// q= q.Take(Grid1.PageSize * Grid1.PageIndex).Skip(Grid1.PageSize * (Grid1.PageIndex)).ToList();
|
||||
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
return from x in q
|
||||
select new
|
||||
{
|
||||
x.InterFaceSetId,
|
||||
x.InterFaceName,
|
||||
x.InterFaceUrl,
|
||||
x.UnitId,
|
||||
x.AuthUnitIds,
|
||||
x.AuthUnitName,
|
||||
x.IsOpen,
|
||||
x.ValidPeriod,
|
||||
x.TxtRemarks,
|
||||
x.InterFaceForUrl,
|
||||
x.IsCallBack,
|
||||
x.InterFaceCallBackUrl,
|
||||
x.UrlReqMethod,
|
||||
x.CallBackUrlReqMethod,
|
||||
x.ForUrlReqMethod
|
||||
|
||||
x.InterFaceSetId,
|
||||
x.InterFaceName,
|
||||
x.InterFaceUrl,
|
||||
x.UnitId,
|
||||
x.AuthUnitIds,
|
||||
x.AuthUnitName,
|
||||
x.IsOpen,
|
||||
x.ValidPeriod,
|
||||
x.TxtRemarks,
|
||||
x.InterFaceForUrl,
|
||||
x.IsCallBack,
|
||||
x.InterFaceCallBackUrl,
|
||||
x.UrlReqMethod,
|
||||
x.CallBackUrlReqMethod,
|
||||
x.ForUrlReqMethod
|
||||
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
public static Model.InterFaceSet GetInterFaceSetById(string InterFaceSetId)
|
||||
{
|
||||
return Funs.DB.InterFaceSet.FirstOrDefault(x=>x.InterFaceSetId==InterFaceSetId);
|
||||
}
|
||||
public static List<Model.InterFaceSet> GetInterFaceSets()
|
||||
public static Model.InterFaceSet GetInterFaceSetById(string InterFaceSetId)
|
||||
{
|
||||
var q = (from x in Funs.DB.InterFaceSet select x).ToList();
|
||||
return Funs.DB.InterFaceSet.FirstOrDefault(x => x.InterFaceSetId == InterFaceSetId);
|
||||
}
|
||||
public static List<Model.InterFaceSet> GetInterFaceSets()
|
||||
{
|
||||
var q = (from x in Funs.DB.InterFaceSet select x).ToList();
|
||||
return q;
|
||||
}
|
||||
|
||||
public static void AddInterFaceSet(Model.InterFaceSet newtable)
|
||||
{
|
||||
|
||||
Model.InterFaceSet table = new Model.InterFaceSet{
|
||||
InterFaceSetId=newtable.InterFaceSetId,
|
||||
InterFaceName=newtable.InterFaceName,
|
||||
InterFaceUrl=newtable.InterFaceUrl,
|
||||
UnitId=newtable.UnitId,
|
||||
AuthUnitIds=newtable.AuthUnitIds,
|
||||
AuthUnitName=newtable.AuthUnitName,
|
||||
IsOpen=newtable.IsOpen,
|
||||
ValidPeriod=newtable.ValidPeriod,
|
||||
TxtRemarks=newtable.TxtRemarks,
|
||||
InterFaceForUrl=newtable.InterFaceForUrl,
|
||||
IsCallBack=newtable.IsCallBack,
|
||||
InterFaceCallBackUrl=newtable.InterFaceCallBackUrl,
|
||||
UrlReqMethod=newtable.UrlReqMethod,
|
||||
ForUrlReqMethod=newtable.ForUrlReqMethod,
|
||||
CallBackUrlReqMethod= newtable.CallBackUrlReqMethod,
|
||||
|
||||
Model.InterFaceSet table = new Model.InterFaceSet
|
||||
{
|
||||
InterFaceSetId = newtable.InterFaceSetId,
|
||||
InterFaceName = newtable.InterFaceName,
|
||||
InterFaceUrl = newtable.InterFaceUrl,
|
||||
UnitId = newtable.UnitId,
|
||||
AuthUnitIds = newtable.AuthUnitIds,
|
||||
AuthUnitName = newtable.AuthUnitName,
|
||||
IsOpen = newtable.IsOpen,
|
||||
ValidPeriod = newtable.ValidPeriod,
|
||||
TxtRemarks = newtable.TxtRemarks,
|
||||
InterFaceForUrl = newtable.InterFaceForUrl,
|
||||
IsCallBack = newtable.IsCallBack,
|
||||
InterFaceCallBackUrl = newtable.InterFaceCallBackUrl,
|
||||
UrlReqMethod = newtable.UrlReqMethod,
|
||||
ForUrlReqMethod = newtable.ForUrlReqMethod,
|
||||
CallBackUrlReqMethod = newtable.CallBackUrlReqMethod,
|
||||
IsSingleRequest = newtable.IsSingleRequest,
|
||||
RequestJsonBody = newtable.RequestJsonBody,
|
||||
|
||||
};
|
||||
Funs.DB.InterFaceSet.InsertOnSubmit(table);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void UpdateInterFaceSet(Model.InterFaceSet newtable)
|
||||
{
|
||||
|
||||
Model.InterFaceSet table = Funs.DB.InterFaceSet.FirstOrDefault(x=>x.InterFaceSetId==newtable.InterFaceSetId);
|
||||
if (table != null)
|
||||
|
||||
Model.InterFaceSet table = Funs.DB.InterFaceSet.FirstOrDefault(x => x.InterFaceSetId == newtable.InterFaceSetId);
|
||||
if (table != null)
|
||||
{
|
||||
table.InterFaceSetId=newtable.InterFaceSetId;
|
||||
table.InterFaceName=newtable.InterFaceName;
|
||||
table.InterFaceUrl=newtable.InterFaceUrl;
|
||||
table.UnitId=newtable.UnitId;
|
||||
table.AuthUnitIds=newtable.AuthUnitIds;
|
||||
table.AuthUnitName=newtable.AuthUnitName;
|
||||
table.IsOpen=newtable.IsOpen;
|
||||
table.ValidPeriod=newtable.ValidPeriod;
|
||||
table.TxtRemarks=newtable.TxtRemarks;
|
||||
table.InterFaceForUrl=newtable.InterFaceForUrl;
|
||||
table.IsCallBack=newtable.IsCallBack;
|
||||
table.InterFaceCallBackUrl=newtable.InterFaceCallBackUrl;
|
||||
table.UrlReqMethod=newtable.UrlReqMethod;
|
||||
table.ForUrlReqMethod=newtable.ForUrlReqMethod;
|
||||
table.CallBackUrlReqMethod=newtable.CallBackUrlReqMethod;
|
||||
table.InterFaceSetId = newtable.InterFaceSetId;
|
||||
table.InterFaceName = newtable.InterFaceName;
|
||||
table.InterFaceUrl = newtable.InterFaceUrl;
|
||||
table.UnitId = newtable.UnitId;
|
||||
table.AuthUnitIds = newtable.AuthUnitIds;
|
||||
table.AuthUnitName = newtable.AuthUnitName;
|
||||
table.IsOpen = newtable.IsOpen;
|
||||
table.ValidPeriod = newtable.ValidPeriod;
|
||||
table.TxtRemarks = newtable.TxtRemarks;
|
||||
table.InterFaceForUrl = newtable.InterFaceForUrl;
|
||||
table.IsCallBack = newtable.IsCallBack;
|
||||
table.InterFaceCallBackUrl = newtable.InterFaceCallBackUrl;
|
||||
table.UrlReqMethod = newtable.UrlReqMethod;
|
||||
table.ForUrlReqMethod = newtable.ForUrlReqMethod;
|
||||
table.CallBackUrlReqMethod = newtable.CallBackUrlReqMethod;
|
||||
table.IsSingleRequest = newtable.IsSingleRequest;
|
||||
table.RequestJsonBody = newtable.RequestJsonBody;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
public static void DeleteInterFaceSetById (string InterFaceSetId)
|
||||
{
|
||||
|
||||
Model.InterFaceSet table =Funs.DB.InterFaceSet.FirstOrDefault(x=>x.InterFaceSetId==InterFaceSetId);
|
||||
if (table != null)
|
||||
{
|
||||
public static void DeleteInterFaceSetById(string InterFaceSetId)
|
||||
{
|
||||
|
||||
Model.InterFaceSet table = Funs.DB.InterFaceSet.FirstOrDefault(x => x.InterFaceSetId == InterFaceSetId);
|
||||
if (table != null)
|
||||
{
|
||||
Funs.DB.InterFaceSet.DeleteOnSubmit(table);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
public static void InitInterFaceDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using FineUIPro;
|
||||
using FastReport.Cloud.StorageClient.Dropbox;
|
||||
using FineUIPro;
|
||||
using Model;
|
||||
using Newtonsoft.Json;
|
||||
using Quartz;
|
||||
|
|
@ -7,18 +8,16 @@ using System;
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Policy;
|
||||
using System.Text;
|
||||
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
|
||||
public static class InterFaceTaskService
|
||||
public static class InterFaceTaskService
|
||||
{
|
||||
public static Model.CNPCDB db = Funs.DB;
|
||||
|
||||
|
||||
#region 获取列表
|
||||
|
||||
#region 获取列表
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
/// </summary>
|
||||
|
|
@ -27,19 +26,20 @@ namespace BLL
|
|||
get;
|
||||
set;
|
||||
}
|
||||
public static List<Model.InterFaceTask> GetInterFaceTaskByModle(Model.InterFaceTask table)
|
||||
{
|
||||
var q= from x in db.InterFaceTask
|
||||
where
|
||||
( string.IsNullOrEmpty(table.InterFaceTaskId)||x.InterFaceTaskId.Contains(table.InterFaceTaskId)) &&
|
||||
( string.IsNullOrEmpty(table.InterFaceName)||x.InterFaceName.Contains(table.InterFaceName)) &&
|
||||
( string.IsNullOrEmpty(table.InterFaceSetLists)||x.InterFaceSetLists.Contains(table.InterFaceSetLists)) &&
|
||||
( string.IsNullOrEmpty(table.Frequency)||x.Frequency.Contains(table.Frequency)) &&
|
||||
(table.Enable ==null|| x.Enable==table.Enable)
|
||||
select x
|
||||
;
|
||||
|
||||
return q.ToList();
|
||||
public static List<Model.InterFaceTask> GetInterFaceTaskByModle(Model.InterFaceTask table)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
var q = from x in db.InterFaceTask
|
||||
where
|
||||
(string.IsNullOrEmpty(table.InterFaceTaskId) || x.InterFaceTaskId.Contains(table.InterFaceTaskId)) &&
|
||||
(string.IsNullOrEmpty(table.InterFaceName) || x.InterFaceName.Contains(table.InterFaceName)) &&
|
||||
(string.IsNullOrEmpty(table.InterFaceSetLists) || x.InterFaceSetLists.Contains(table.InterFaceSetLists)) &&
|
||||
(string.IsNullOrEmpty(table.Frequency) || x.Frequency.Contains(table.Frequency)) &&
|
||||
(table.Enable == null || x.Enable == table.Enable)
|
||||
select x
|
||||
;
|
||||
|
||||
return q.ToList();
|
||||
}
|
||||
|
||||
/// 获取分页列表
|
||||
|
|
@ -49,79 +49,82 @@ namespace BLL
|
|||
/// <returns></returns>
|
||||
public static IEnumerable getListData(Model.InterFaceTask table, Grid Grid1)
|
||||
{
|
||||
var q= GetInterFaceTaskByModle(table);
|
||||
var q = GetInterFaceTaskByModle(table);
|
||||
count = q.Count();
|
||||
if (count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
// q= q.Take(Grid1.PageSize * Grid1.PageIndex).Skip(Grid1.PageSize * (Grid1.PageIndex)).ToList();
|
||||
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
return from x in q
|
||||
select new
|
||||
{
|
||||
x.InterFaceTaskId,
|
||||
x.InterFaceName,
|
||||
x.InterFaceSetLists,
|
||||
x.Frequency,
|
||||
x.CreateTime,
|
||||
x.Enable,
|
||||
|
||||
x.InterFaceTaskId,
|
||||
x.InterFaceName,
|
||||
x.InterFaceSetLists,
|
||||
x.Frequency,
|
||||
x.CreateTime,
|
||||
x.Enable,
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
public static Model.InterFaceTask GetInterFaceTaskById(string InterFaceTaskId)
|
||||
{
|
||||
return db.InterFaceTask.FirstOrDefault(x=>x.InterFaceTaskId==InterFaceTaskId);
|
||||
public static Model.InterFaceTask GetInterFaceTaskById(string InterFaceTaskId)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
return db.InterFaceTask.FirstOrDefault(x => x.InterFaceTaskId == InterFaceTaskId);
|
||||
}
|
||||
public static void AddInterFaceTask(Model.InterFaceTask newtable)
|
||||
{
|
||||
|
||||
Model.InterFaceTask table = new Model.InterFaceTask{
|
||||
InterFaceTaskId=newtable.InterFaceTaskId,
|
||||
InterFaceName=newtable.InterFaceName,
|
||||
InterFaceSetLists=newtable.InterFaceSetLists,
|
||||
Frequency=newtable.Frequency,
|
||||
CreateTime=newtable.CreateTime,
|
||||
Enable=newtable.Enable,
|
||||
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
Model.InterFaceTask table = new Model.InterFaceTask
|
||||
{
|
||||
InterFaceTaskId = newtable.InterFaceTaskId,
|
||||
InterFaceName = newtable.InterFaceName,
|
||||
InterFaceSetLists = newtable.InterFaceSetLists,
|
||||
Frequency = newtable.Frequency,
|
||||
CreateTime = newtable.CreateTime,
|
||||
Enable = newtable.Enable,
|
||||
};
|
||||
db.InterFaceTask.InsertOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void UpdateInterFaceTask(Model.InterFaceTask newtable)
|
||||
{
|
||||
|
||||
Model.InterFaceTask table = db.InterFaceTask.FirstOrDefault(x=>x.InterFaceTaskId==newtable.InterFaceTaskId);
|
||||
if (table != null)
|
||||
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
Model.InterFaceTask table = db.InterFaceTask.FirstOrDefault(x => x.InterFaceTaskId == newtable.InterFaceTaskId);
|
||||
if (table != null)
|
||||
{
|
||||
table.InterFaceTaskId=newtable.InterFaceTaskId;
|
||||
table.InterFaceName=newtable.InterFaceName;
|
||||
table.InterFaceSetLists=newtable.InterFaceSetLists;
|
||||
table.Frequency=newtable.Frequency;
|
||||
table.CreateTime=newtable.CreateTime;
|
||||
table.Enable=newtable.Enable;
|
||||
table.InterFaceTaskId = newtable.InterFaceTaskId;
|
||||
table.InterFaceName = newtable.InterFaceName;
|
||||
table.InterFaceSetLists = newtable.InterFaceSetLists;
|
||||
table.Frequency = newtable.Frequency;
|
||||
table.CreateTime = newtable.CreateTime;
|
||||
table.Enable = newtable.Enable;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
public static void DeleteInterFaceTaskById (string InterFaceTaskId)
|
||||
{
|
||||
|
||||
Model.InterFaceTask table =db.InterFaceTask.FirstOrDefault(x=>x.InterFaceTaskId==InterFaceTaskId);
|
||||
if (table != null)
|
||||
{
|
||||
public static void DeleteInterFaceTaskById(string InterFaceTaskId)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
Model.InterFaceTask table = db.InterFaceTask.FirstOrDefault(x => x.InterFaceTaskId == InterFaceTaskId);
|
||||
if (table != null)
|
||||
{
|
||||
db.InterFaceTask.DeleteOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
#region 执行任务
|
||||
public static void ExecuteTasks(string InterFaceTaskId)
|
||||
{
|
||||
|
||||
|
||||
var model = GetInterFaceTaskById(InterFaceTaskId);
|
||||
var InterFaceSetlIds = model.InterFaceSetLists.Split(',');
|
||||
foreach (var item in InterFaceSetlIds)
|
||||
|
|
@ -143,13 +146,16 @@ namespace BLL
|
|||
}
|
||||
try
|
||||
{
|
||||
if (InterfaceSetModel.IsSingleRequest == true)
|
||||
{
|
||||
var taskData = GetSingleRequestData(InterfaceSetModel.InterFaceUrl, InterfaceSetModel.RequestJsonBody, InterfaceSetModel.UrlReqMethod);
|
||||
bool taskSuccess = taskData.code == 1;
|
||||
InterFaceLogService.WriteInterFaceLog(InterFaceSetlId, InterfaceSetModel.RequestJsonBody, JsonConvert.SerializeObject(taskData), InterFaceLogService.Type1, taskSuccess);
|
||||
return;
|
||||
}
|
||||
|
||||
var sourseData = GetSourseData(InterfaceSetModel.InterFaceUrl, InterfaceSetModel.UrlReqMethod);
|
||||
bool sourseisSuccess = false;
|
||||
if (sourseData.code == 1)
|
||||
{
|
||||
sourseisSuccess = true;
|
||||
}
|
||||
bool sourseisSuccess = sourseData.code == 1;
|
||||
InterFaceLogService.WriteInterFaceLog(InterFaceSetlId, "", JsonConvert.SerializeObject(sourseData), InterFaceLogService.Type1, sourseisSuccess);
|
||||
if (sourseData.code == 0)
|
||||
{
|
||||
|
|
@ -157,11 +163,7 @@ namespace BLL
|
|||
}
|
||||
var TargetData = GetTargetData(InterfaceSetModel.InterFaceForUrl, sourseData, InterfaceSetModel.ForUrlReqMethod);
|
||||
|
||||
bool TargetisSuccess = false;
|
||||
if (TargetData.code == 1)
|
||||
{
|
||||
TargetisSuccess = true;
|
||||
}
|
||||
bool TargetisSuccess = TargetData.code == 1;
|
||||
InterFaceLogService.WriteInterFaceLog(InterFaceSetlId, JsonConvert.SerializeObject(sourseData.data), JsonConvert.SerializeObject(TargetData), InterFaceLogService.Type2, TargetisSuccess);
|
||||
|
||||
if (TargetData.code == 0 || InterfaceSetModel.IsCallBack == false)
|
||||
|
|
@ -178,27 +180,60 @@ namespace BLL
|
|||
InterFaceLogService.WriteInterFaceLog(InterFaceSetlId, JsonConvert.SerializeObject(sourseData.data), JsonConvert.SerializeObject(callbackData), InterFaceLogService.Type3, CallBackisSuccess);
|
||||
|
||||
}
|
||||
catch (Exception ex )
|
||||
catch (Exception ex)
|
||||
{
|
||||
Model.InterFaceLog interFaceLog=new InterFaceLog();
|
||||
interFaceLog.InterFaceLogId=Guid.NewGuid().ToString();
|
||||
Model.InterFaceLog interFaceLog = new InterFaceLog();
|
||||
interFaceLog.InterFaceLogId = Guid.NewGuid().ToString();
|
||||
interFaceLog.InterFaceType = "异常";
|
||||
interFaceLog.LogSate = false;
|
||||
interFaceLog.InterFaceLogDate= DateTime.Now;
|
||||
interFaceLog.InterFaceLogDate = DateTime.Now;
|
||||
interFaceLog.InterFaceName = InterfaceSetModel.InterFaceName;
|
||||
interFaceLog.InterFaceReturnData = ex.ToString();
|
||||
InterFaceLogService.AddInterFaceLog(interFaceLog);
|
||||
}
|
||||
|
||||
}
|
||||
public static Model.ReturnData GetSourseData(string baseurl,string ReqMethod)
|
||||
public static Model.ReturnData GetSingleRequestData(string baseurl, string requestJsonBody, string ReqMethod)
|
||||
{
|
||||
Model.ReturnData returnData = new ReturnData();
|
||||
string token = "C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0";
|
||||
string Content = "";
|
||||
switch (ReqMethod)
|
||||
{
|
||||
case "Get":
|
||||
case "Get":
|
||||
Content = Funs.RequestGet(baseurl, token);
|
||||
break;
|
||||
case "Post":
|
||||
Content = Funs.RequestPost(baseurl, token, requestJsonBody);
|
||||
break;
|
||||
}
|
||||
//var client = new RestClient(baseurl);
|
||||
//client.Timeout = -1;
|
||||
//var request = new RestRequest(Method.POST);
|
||||
//request.AddHeader("token", "AF17168B-87BD-4GLY-1111-F0A0A1158F9B");
|
||||
//IRestResponse response = client.Execute(request);
|
||||
//Console.WriteLine(response.Content);
|
||||
try
|
||||
{
|
||||
returnData = JsonConvert.DeserializeObject<Model.ReturnData>(Content);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
returnData.code = 0;
|
||||
returnData.message = "获取数据失败:" + Content;
|
||||
}
|
||||
|
||||
|
||||
return returnData;
|
||||
}
|
||||
|
||||
public static Model.ReturnData GetSourseData(string baseurl, string ReqMethod)
|
||||
{
|
||||
Model.ReturnData returnData = new ReturnData();
|
||||
string token = "C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0";
|
||||
string Content = "";
|
||||
switch (ReqMethod)
|
||||
{
|
||||
case "Get":
|
||||
Content = Funs.RequestGet(baseurl, token);
|
||||
break;
|
||||
case "Post":
|
||||
|
|
@ -213,7 +248,9 @@ namespace BLL
|
|||
//Console.WriteLine(response.Content);
|
||||
try
|
||||
{
|
||||
ErrLogInfo.WriteLog($"【Content】:{Content}");
|
||||
returnData = JsonConvert.DeserializeObject<Model.ReturnData>(Content);
|
||||
ErrLogInfo.WriteLog($"【Content222】:{Content}");
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
|
@ -278,12 +315,13 @@ namespace BLL
|
|||
}
|
||||
return responeData;
|
||||
}
|
||||
public static ReturnData ExecuteCallBack(string baseurl, ReturnData DataInput,string ReqMethod)
|
||||
public static ReturnData ExecuteCallBack(string baseurl, ReturnData DataInput, string ReqMethod)
|
||||
{
|
||||
Model.ReturnData returnData = new ReturnData();
|
||||
if (DataInput.code == 1)
|
||||
{
|
||||
string token = "AF17168B-87BD-4GLY-1111-F0A0A1158F9B";
|
||||
//string token = "C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0";
|
||||
string Content = "";
|
||||
switch (ReqMethod)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -14,14 +14,11 @@ namespace BLL
|
|||
// note: use context.MergedJobDataMap in production code
|
||||
JobDataMap dataMap = context.JobDetail.JobDataMap;
|
||||
string InterFaceTaskId = dataMap.GetString("InterFaceTaskId");
|
||||
|
||||
|
||||
//使用异步任务来实现
|
||||
await Task.Run(() =>
|
||||
{
|
||||
|
||||
InterFaceTaskService.ExecuteTasks(InterFaceTaskId);
|
||||
|
||||
|
||||
InterFaceTaskService.ExecuteTasks(InterFaceTaskId);
|
||||
//Console.WriteLine($"{DateTime.Now}【{Thread.CurrentThread.ManagedThreadId}】:自定义的工作正在执行... ...");
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,31 +1,25 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.Specialized;
|
||||
using System.Drawing.Printing;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Quartz;
|
||||
using Quartz.Impl;
|
||||
using Quartz;
|
||||
using Quartz.Impl;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
namespace BLL
|
||||
{
|
||||
public class QuartzServices
|
||||
{
|
||||
|
||||
public static async Task Init()
|
||||
{
|
||||
|
||||
|
||||
|
||||
//初始化计划者
|
||||
StdSchedulerFactory factory = new StdSchedulerFactory();
|
||||
// StdSchedulerFactory factory = new StdSchedulerFactory(properties);
|
||||
// StdSchedulerFactory factory = new StdSchedulerFactory(properties);
|
||||
IScheduler scheduler = await factory.GetScheduler();
|
||||
var jobAndTriggerMapping = new Dictionary<IJobDetail, IReadOnlyCollection<ITrigger>>();
|
||||
var jobAndTriggerMapping = new Dictionary<IJobDetail, IReadOnlyCollection<ITrigger>>();
|
||||
// 将映射关系包装成制度字典集合
|
||||
var model = new Model.InterFaceTask();
|
||||
model.Enable = true;
|
||||
|
|
@ -46,7 +40,7 @@ using System.Threading.Tasks;
|
|||
Funs.ScheduledTasks = scheduler;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static void ISchedulerShupDown(IScheduler scheduler)
|
||||
{
|
||||
scheduler.Shutdown();
|
||||
|
|
@ -74,15 +68,15 @@ using System.Threading.Tasks;
|
|||
{
|
||||
var jobDetail1 = GetJobDetailByInterFaceTaskId(model.InterFaceTaskId);
|
||||
var trigger1 = GetTriggerByTime(model.InterFaceTaskId, model.Frequency);
|
||||
await scheduler.ScheduleJob(jobDetail1, trigger1,true);
|
||||
await scheduler.ScheduleJob(jobDetail1, trigger1, true);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
var jobDetail1 = GetJobDetailByInterFaceTaskId(model.InterFaceTaskId);
|
||||
var trigger1 = GetTriggerByTime(model.InterFaceTaskId, model.Frequency);
|
||||
await scheduler.ScheduleJob(jobDetail1, trigger1,true);
|
||||
await scheduler.ScheduleJob(jobDetail1, trigger1, true);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -91,9 +85,9 @@ using System.Threading.Tasks;
|
|||
if (scheduler.GetJobDetail(jk, default) != null)
|
||||
{
|
||||
await scheduler.DeleteJob(jk, default);
|
||||
|
||||
|
||||
// SyncScheduledTasks(model.InterFaceTaskId, scheduler, 2);
|
||||
|
||||
// SyncScheduledTasks(model.InterFaceTaskId, scheduler, 2);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -119,16 +113,16 @@ using System.Threading.Tasks;
|
|||
{
|
||||
if (type == 0)
|
||||
{
|
||||
// Funs.ScheduledTasks.Add(InterFaceTaskId, scheduler);
|
||||
// Funs.ScheduledTasks.Add(InterFaceTaskId, scheduler);
|
||||
}
|
||||
else if (type == 1)
|
||||
{
|
||||
// Funs.ScheduledTasks.Remove(InterFaceTaskId);
|
||||
// Funs.ScheduledTasks.Add(InterFaceTaskId, scheduler);
|
||||
// Funs.ScheduledTasks.Remove(InterFaceTaskId);
|
||||
// Funs.ScheduledTasks.Add(InterFaceTaskId, scheduler);
|
||||
}
|
||||
else if (type == 2)
|
||||
{
|
||||
// Funs.ScheduledTasks.Remove(InterFaceTaskId);
|
||||
// Funs.ScheduledTasks.Remove(InterFaceTaskId);
|
||||
}
|
||||
}
|
||||
public static IJobDetail GetJobDetailByInterFaceTaskId(string InterFaceTaskId)
|
||||
|
|
@ -143,8 +137,9 @@ using System.Threading.Tasks;
|
|||
public static ReadOnlyCollection<ITrigger> GetTriggerByTime(string InterFaceTaskId, string time)
|
||||
{
|
||||
string cron = "0 0 0/& * * ? ";
|
||||
cron = cron.Replace("&", time);
|
||||
// cron = "0 0/1 * * * ? ";
|
||||
// cron = cron.Replace("&", time);
|
||||
cron = time;
|
||||
// cron = "0 0/1 * * * ? ";
|
||||
//创建触发器
|
||||
var trigger1 = new ReadOnlyCollection<ITrigger>(
|
||||
new List<ITrigger>()
|
||||
|
|
@ -160,6 +155,5 @@ using System.Threading.Tasks;
|
|||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -34,39 +34,12 @@
|
|||
//AppDomain.Unload(AppDomain.CurrentDomain);
|
||||
}
|
||||
|
||||
//////得到集团服务器路径
|
||||
try
|
||||
{
|
||||
string address = ConfigurationManager.AppSettings["endpoint"];
|
||||
Funs.SystemVersion = ConfigurationManager.AppSettings["SystemVersion"];
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ErrLogInfo.WriteLog("得到集团服务器地址失败!", ex);
|
||||
}
|
||||
////实名制同步定时器
|
||||
try
|
||||
{
|
||||
if (ConfigurationManager.AppSettings["EnableRealName"] == "True")
|
||||
{
|
||||
BLL.RealNameMonitorService.StartMonitor();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ErrLogInfo.WriteLog("实名制同步定时器启动失败!", ex);
|
||||
}
|
||||
////通用定时器
|
||||
try
|
||||
{
|
||||
ErrLogInfo.WriteLog("通用定时器开启!" );
|
||||
BLL.MonitorService.StartMonitor();
|
||||
BLL.MonitorService.StartWeather();
|
||||
BLL.MonitorService.StartMonitorEve();
|
||||
//BLL.MonitorService.StartPersonQuarterCheck();
|
||||
//BLL.MonitorService.StartEnvironmentSync();
|
||||
QuartzServices.Init();
|
||||
ErrLogInfo.WriteLog("通用定时器结束!");
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@
|
|||
</f:FormRow>
|
||||
<f:FormRow ID="rowFaceFor">
|
||||
<Items>
|
||||
<f:DropDownList runat="server" ID="drpAuthUnit" Label="目标单位" MaxLength="4000" EnableEdit="True">
|
||||
<f:DropDownList runat="server" ID="drpAuthUnit" Label="目标单位" MaxLength="4000" EnableEdit="True" AutoSelectFirstItem="false">
|
||||
</f:DropDownList>
|
||||
<f:TextBox ID="txtFaceForUrl" runat="server" Label="目标地址" Required="true" ShowRedStar="true">
|
||||
</f:TextBox>
|
||||
|
|
|
|||
|
|
@ -56,11 +56,11 @@
|
|||
</Toolbars>
|
||||
<Columns>
|
||||
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="50px" HeaderTextAlign="Center" TextAlign="Center"/>
|
||||
<f:RenderField Width="120px" ColumnID="InterFaceName" DataField="InterFaceName" EnableFilter="true"
|
||||
<f:RenderField Width="220px" ColumnID="InterFaceName" DataField="InterFaceName" EnableFilter="true"
|
||||
SortField="InterFaceName" FieldType="String" HeaderText="接口名称" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="230px" ColumnID="UnitId" DataField="UnitId" EnableFilter="true"
|
||||
<f:RenderField Width="380px" ColumnID="UnitId" DataField="UnitId" EnableFilter="true"
|
||||
SortField="UnitId" FieldType="String" HeaderText="源单位" HeaderTextAlign="Center"
|
||||
TextAlign="Left" >
|
||||
</f:RenderField>
|
||||
|
|
@ -70,7 +70,7 @@
|
|||
<asp:Label ID="Label2" runat="server" Text='<%# Bind("InterFaceUrl") %>' ToolTip='<%# Bind("InterFaceUrl") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:TemplateField Width="300px" HeaderText="目标地址" ColumnID="InterFaceForUrl" HeaderTextAlign="Center"
|
||||
<f:TemplateField Width="120px" HeaderText="目标地址" ColumnID="InterFaceForUrl" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label4" runat="server" Text='<%# Bind("InterFaceForUrl") %>' ToolTip='<%# Bind("InterFaceForUrl") %>'></asp:Label>
|
||||
|
|
@ -82,13 +82,13 @@
|
|||
<asp:Label ID="Label3" runat="server" Text='<%# Bind("ValidPeriod") %>' ToolTip='<%# Bind("ValidPeriod") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>--%>
|
||||
<f:TemplateField Width="350px" HeaderText="目标单位" ColumnID="AuthUnitName" HeaderTextAlign="Center"
|
||||
<f:TemplateField Width="200px" HeaderText="目标单位" ColumnID="AuthUnitName" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label1" runat="server" Text='<%# Bind("AuthUnitName") %>' ToolTip='<%# Bind("AuthUnitName") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:CheckBoxField Width="70px" SortField="IsOpen" RenderAsStaticField="true" DataField="IsOpen"
|
||||
<f:CheckBoxField Width="60px" SortField="IsOpen" RenderAsStaticField="true" DataField="IsOpen" TextAlign="Center"
|
||||
HeaderText="状态">
|
||||
</f:CheckBoxField>
|
||||
<f:TemplateField Width="100px" HeaderText="描述" ColumnID="TxtRemarks" HeaderTextAlign="Center"
|
||||
|
|
|
|||
|
|
@ -151,11 +151,11 @@ namespace FineUIPro.Web.InterFace
|
|||
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
|
||||
{
|
||||
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
|
||||
if (judgementDelete(rowID, false))
|
||||
{
|
||||
BLL.InterFaceSetService.DeleteInterFaceSetById(rowID);
|
||||
BLL.LogService.AddLog(this.CurrUser.UserId, "删除接口信息");
|
||||
}
|
||||
//if (judgementDelete(rowID, false))
|
||||
//{
|
||||
BLL.InterFaceSetService.DeleteInterFaceSetById(rowID);
|
||||
BLL.LogService.AddLog(this.CurrUser.UserId, "删除接口信息");
|
||||
//}
|
||||
}
|
||||
BindGrid();
|
||||
ShowNotify("删除数据成功!(表格数据已重新绑定)");
|
||||
|
|
|
|||
Loading…
Reference in New Issue