1
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,62 @@
|
||||
using System.Linq;
|
||||
using System.Timers;
|
||||
using System.Configuration;
|
||||
using System;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public class CNCECHSSEMonitorService
|
||||
{
|
||||
#region 启动监视器 系统启动5分钟
|
||||
/// <summary>
|
||||
/// 监视组件
|
||||
/// </summary>
|
||||
private static Timer messageTimer;
|
||||
|
||||
/// <summary>
|
||||
/// 启动监视器,不一定能成功,根据系统设置决定对监视器执行的操作 系统启动5分钟
|
||||
/// </summary>
|
||||
public static void StartMonitor()
|
||||
{
|
||||
int adTimeJ = 120;
|
||||
if (messageTimer != null)
|
||||
{
|
||||
messageTimer.Stop();
|
||||
messageTimer.Dispose();
|
||||
messageTimer = null;
|
||||
}
|
||||
if (adTimeJ > 0)
|
||||
{
|
||||
messageTimer = new Timer
|
||||
{
|
||||
AutoReset = true
|
||||
};
|
||||
messageTimer.Elapsed += new ElapsedEventHandler(AdUserInProcess);
|
||||
messageTimer.Interval = 1000 * 60 * adTimeJ;// 60000 * adTimeJ;
|
||||
messageTimer.Start();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 流程确认 定时执行 系统启动5分钟
|
||||
/// </summary>
|
||||
/// <param name="sender">Timer组件</param>
|
||||
/// <param name="e">事件参数</param>
|
||||
private static void AdUserInProcess(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
CNCECHSSEGetWebService.getSupervise_SubUnitReport();
|
||||
CNCECHSSEGetWebService.getCheck_CheckInfo_Table8Item();
|
||||
CNCECHSSEGetWebService.getCheck_CheckRectify();
|
||||
CNCECHSSEGetWebService.getInformation_UrgeReport();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
StartMonitor();
|
||||
ErrLogInfo.WriteLog(ex, "数据接口定时器", "RealNameMonitorService.AdUserInProcess");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,185 @@
|
||||
#region 中央企业安全生产治本攻坚三年行动工作台账上报
|
||||
/// <summary>
|
||||
/// 中央企业安全生产治本攻坚三年行动工作台账上报
|
||||
/// </summary>
|
||||
public static string UpActionWorkLedger(string actionWorkLedgerId, Model.Sys_User CurrUser)
|
||||
{
|
||||
string code = "0";
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
try
|
||||
{
|
||||
CNCECHSSEService.HSSEServiceClient hsseC = new CNCECHSSEService.HSSEServiceClient();
|
||||
var upReport = from x in db.Information_ActionWorkLedger
|
||||
where x.ActionWorkLedgerId == actionWorkLedgerId
|
||||
select new Model.ActionWorkLedger
|
||||
{
|
||||
ActionWorkLedgerId = x.ActionWorkLedgerId,
|
||||
UnitId = x.UnitId,
|
||||
ReportDate = x.ReportDate,
|
||||
Quarter = x.Quarter,
|
||||
YearId = x.YearId,
|
||||
CompileMan = x.CompileMan,
|
||||
};
|
||||
|
||||
var upReportItem = from x in db.Information_ActionWorkLedgerItem
|
||||
where x.ActionWorkLedgerId == actionWorkLedgerId
|
||||
select new Model.ActionWorkLedgerItem
|
||||
{
|
||||
ActionWorkLedgerItemId = x.ActionWorkLedgerItemId,
|
||||
ActionWorkLedgerId = x.ActionWorkLedgerId,
|
||||
SortIndex = x.SortIndex,
|
||||
Focus = x.Focus,
|
||||
SpecialTask = x.SpecialTask,
|
||||
WorkPoints = x.WorkPoints,
|
||||
FillingRequirements = x.FillingRequirements,
|
||||
CompletionDeadline = x.CompletionDeadline,
|
||||
ImplementationStatus = x.ImplementationStatus,
|
||||
};
|
||||
|
||||
//var getR = hsseC.DataInsertInformation_DrillConductedQuarterlyReportTable(upReport.ToList(), upReportItem.ToList());
|
||||
//新接口Api
|
||||
code = UpApiSaveActionWorkLedger(upReport, upReportItem).ToString();
|
||||
if (code == "1")
|
||||
{
|
||||
foreach (var item in upReport.Select(p => p.ActionWorkLedgerId))
|
||||
{
|
||||
var report = db.Information_ActionWorkLedger.FirstOrDefault(e => e.ActionWorkLedgerId == item);
|
||||
if (report != null)
|
||||
{
|
||||
report.UpState = BLL.Const.UpState_3;
|
||||
db.SubmitChanges();
|
||||
////更新 当前人要处理的意见
|
||||
ProjectDataFlowSetService.CloseFlowOperate(Const.ActionWorkLedgerMenuId, item, string.Empty);
|
||||
////更新催报信息
|
||||
UrgeReportService.SetComplete(report.UnitId, Const.ReportType_11, report.YearId.ToString(), report.Quarter.ToString());
|
||||
}
|
||||
}
|
||||
LogService.AddSys_Log(CurrUser, "【中央企业安全生产治本攻坚三年行动工作台账上报】上传到服务器" + upReport.Count().ToString() + "条数据;", null, BLL.Const.MillionsMonthlyReportMenuId, BLL.Const.BtnUploadResources);
|
||||
}
|
||||
else
|
||||
{
|
||||
LogService.AddSys_Log(CurrUser, "【中央企业安全生产治本攻坚三年行动工作台账上报】上传到服务器失败;", null, BLL.Const.MillionsMonthlyReportMenuId, BLL.Const.BtnUploadResources);
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ErrLogInfo.WriteLog("【中央企业安全生产治本攻坚三年行动工作台账上报】上传到服务器", ex);
|
||||
LogService.AddSys_Log(CurrUser, "【中央企业安全生产治本攻坚三年行动工作台账上报】上传到服务器失败;", null, BLL.Const.MillionsMonthlyReportMenuId, BLL.Const.BtnUploadResources);
|
||||
}
|
||||
|
||||
return code;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// DrillConductedQuarterlyReportApi调用
|
||||
/// </summary>
|
||||
/// <param name="upReport">主表</param>
|
||||
/// <param name="upReportItem">明细表</param>
|
||||
/// <returns></returns>
|
||||
private static int UpApiSaveActionWorkLedger(IQueryable<Model.ActionWorkLedger> upReport, IQueryable<Model.ActionWorkLedgerItem> upReportItem)
|
||||
{
|
||||
string baseurl = "/api/InformationData/SaveActionWorkLedger";
|
||||
//合并
|
||||
//var resultJson = JsonConvert.SerializeObject(new { upReport, ReportItem = upReportItem });
|
||||
var resultJson = JsonConvert.SerializeObject(upReport.FirstOrDefault());
|
||||
var resultJson1 = JsonConvert.SerializeObject(new { actionWorkLedgerItem = upReportItem });
|
||||
resultJson = "{\"InformationDataItems\":[" + (resultJson + resultJson1).Replace("}{", ",") + "]}";
|
||||
var responeData = BLL.ServerService.PushCNCEC(resultJson, baseurl);
|
||||
return responeData.code;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 中央企业安全生产管理评价工作调度台账上报
|
||||
/// <summary>
|
||||
/// 中央企业安全生产管理评价工作调度台账上报
|
||||
/// </summary>
|
||||
public static string UpSafetyProductionEvaluation(string safetyProductionEvaluationId, Model.Sys_User CurrUser)
|
||||
{
|
||||
string code = "0";
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
try
|
||||
{
|
||||
CNCECHSSEService.HSSEServiceClient hsseC = new CNCECHSSEService.HSSEServiceClient();
|
||||
var upReport = from x in db.Information_SafetyProductionEvaluation
|
||||
where x.SafetyProductionEvaluationId == safetyProductionEvaluationId
|
||||
select new Model.SafetyProductionEvaluation
|
||||
{
|
||||
SafetyProductionEvaluationId = x.SafetyProductionEvaluationId,
|
||||
UnitId = x.UnitId,
|
||||
ReportDate = x.ReportDate,
|
||||
Quarter = x.Quarter,
|
||||
YearId = x.YearId,
|
||||
CompileMan = x.CompileMan,
|
||||
};
|
||||
|
||||
var upReportItem = from x in db.Information_SafetyProductionEvaluationItem
|
||||
where x.SafetyProductionEvaluationId == safetyProductionEvaluationId
|
||||
select new Model.SafetyProductionEvaluationItem
|
||||
{
|
||||
SafetyProductionEvaluationItemId = x.SafetyProductionEvaluationItemId,
|
||||
SafetyProductionEvaluationId = x.SafetyProductionEvaluationId,
|
||||
SortIndex = x.SortIndex,
|
||||
Type = x.Type,
|
||||
EvaluateWork = x.EvaluateWork,
|
||||
EvaluationContent = x.EvaluationContent,
|
||||
FillingRequirements = x.FillingRequirements,
|
||||
CompletionDeadline = x.CompletionDeadline,
|
||||
ImplementationStatus = x.ImplementationStatus,
|
||||
};
|
||||
|
||||
//var getR = hsseC.DataInsertInformation_DrillConductedQuarterlyReportTable(upReport.ToList(), upReportItem.ToList());
|
||||
//新接口Api
|
||||
code = UpApiSaveSafetyProductionEvaluation(upReport, upReportItem).ToString();
|
||||
if (code == "1")
|
||||
{
|
||||
foreach (var item in upReport.Select(p => p.SafetyProductionEvaluationId))
|
||||
{
|
||||
var report = db.Information_SafetyProductionEvaluation.FirstOrDefault(e => e.SafetyProductionEvaluationId == item);
|
||||
if (report != null)
|
||||
{
|
||||
report.UpState = BLL.Const.UpState_3;
|
||||
db.SubmitChanges();
|
||||
////更新 当前人要处理的意见
|
||||
ProjectDataFlowSetService.CloseFlowOperate(Const.SafetyProductionEvaluationMenuId, item, string.Empty);
|
||||
////更新催报信息
|
||||
UrgeReportService.SetComplete(report.UnitId, Const.ReportType_12, report.YearId.ToString(), report.Quarter.ToString());
|
||||
}
|
||||
}
|
||||
LogService.AddSys_Log(CurrUser, "【中央企业安全生产管理评价工作调度台账上报】上传到服务器" + upReport.Count().ToString() + "条数据;", null, BLL.Const.MillionsMonthlyReportMenuId, BLL.Const.BtnUploadResources);
|
||||
}
|
||||
else
|
||||
{
|
||||
LogService.AddSys_Log(CurrUser, "【中央企业安全生产管理评价工作调度台账上报】上传到服务器失败;", null, BLL.Const.MillionsMonthlyReportMenuId, BLL.Const.BtnUploadResources);
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ErrLogInfo.WriteLog("【中央企业安全生产管理评价工作调度台账上报】上传到服务器", ex);
|
||||
LogService.AddSys_Log(CurrUser, "【中央企业安全生产管理评价工作调度台账上报】上传到服务器失败;", null, BLL.Const.MillionsMonthlyReportMenuId, BLL.Const.BtnUploadResources);
|
||||
}
|
||||
|
||||
return code;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// DrillConductedQuarterlyReportApi调用
|
||||
/// </summary>
|
||||
/// <param name="upReport">主表</param>
|
||||
/// <param name="upReportItem">明细表</param>
|
||||
/// <returns></returns>
|
||||
private static int UpApiSaveSafetyProductionEvaluation(IQueryable<Model.SafetyProductionEvaluation> upReport, IQueryable<Model.SafetyProductionEvaluationItem> upReportItem)
|
||||
{
|
||||
string baseurl = "/api/InformationData/SaveSafetyProductionEvaluation";
|
||||
//合并
|
||||
//var resultJson = JsonConvert.SerializeObject(new { upReport, ReportItem = upReportItem });
|
||||
var resultJson = JsonConvert.SerializeObject(upReport.FirstOrDefault());
|
||||
var resultJson1 = JsonConvert.SerializeObject(new { safetyProductionEvaluationItem = upReportItem });
|
||||
resultJson = "{\"InformationDataItems\":[" + (resultJson + resultJson1).Replace("}{", ",") + "]}";
|
||||
var responeData = BLL.ServerService.PushCNCEC(resultJson, baseurl);
|
||||
return responeData.code;
|
||||
}
|
||||
#endregion
|
||||
Reference in New Issue
Block a user