2024-08-21 16:47:57 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Web.UI;
|
|
|
|
|
using System.Web.UI.WebControls;
|
|
|
|
|
using BLL;
|
|
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
|
|
|
|
|
namespace FineUIPro.Web.HSSE.Manager
|
|
|
|
|
{
|
|
|
|
|
public partial class ManagerMonthCEdit : PageBase
|
|
|
|
|
{
|
|
|
|
|
#region 定义项
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 主键
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string MonthReportId
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return (string)ViewState["MonthReportId"];
|
|
|
|
|
}
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
ViewState["MonthReportId"] = value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string AddOrUpdate
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return (string)ViewState["AddOrUpdate"];
|
|
|
|
|
}
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
ViewState["AddOrUpdate"] = value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string ProjectId { get; set; }
|
|
|
|
|
|
|
|
|
|
private static DateTime months;
|
|
|
|
|
|
|
|
|
|
private static DateTime startTime;
|
|
|
|
|
|
|
|
|
|
private static DateTime endTime;
|
2024-08-23 08:58:55 +08:00
|
|
|
|
|
|
|
|
|
private static DateTime yearStartTime;
|
|
|
|
|
|
|
|
|
|
private static DateTime projectStartTime;
|
2024-08-21 16:47:57 +08:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region list集合
|
|
|
|
|
public List<Model.Base_Unit> unitList = new List<Model.Base_Unit>();
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 培训情况集合
|
|
|
|
|
/// </summary>
|
|
|
|
|
private static List<Model.Manager_TrainSortC> trainSorts = new List<Model.Manager_TrainSortC>();
|
2024-08-23 08:58:55 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 检查情况集合
|
|
|
|
|
/// </summary>
|
|
|
|
|
private static List<Model.Manager_CheckSortC> checkSorts = new List<Model.Manager_CheckSortC>();
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// HSE奖励与处罚
|
|
|
|
|
/// </summary>
|
|
|
|
|
private static List<Model.Manager_RewardAndPunishSortC> rewardAndPunishSortCs = new List<Model.Manager_RewardAndPunishSortC>();
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 4.10 HSE现场其他管理情况集合
|
|
|
|
|
/// </summary>
|
|
|
|
|
private static List<Model.Manager_Month_OtherManagementC> otherManagements = new List<Model.Manager_Month_OtherManagementC>();
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 5.1 五环HSE费用投入集合
|
|
|
|
|
/// </summary>
|
|
|
|
|
private static List<Model.Manager_Month_FiveExpenseC> fiveExpenses = new List<Model.Manager_Month_FiveExpenseC>();
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 7.1 其他HSE工作计划
|
|
|
|
|
/// </summary>
|
|
|
|
|
private static List<Model.Manager_Month_OtherWorkPlanC> otherWorkPlanCs = new List<Model.Manager_Month_OtherWorkPlanC>();
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 8 HSE合规义务识别与评价表
|
|
|
|
|
/// </summary>
|
|
|
|
|
private static List<Model.Manager_Month_ComplianceObligationsC> complianceObligationsCs = new List<Model.Manager_Month_ComplianceObligationsC>();
|
|
|
|
|
|
2024-08-21 16:47:57 +08:00
|
|
|
|
#endregion
|
|
|
|
|
public Model.SGGLDB db = Funs.DB;
|
|
|
|
|
|
|
|
|
|
#region 加载页面
|
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (!IsPostBack)
|
|
|
|
|
{
|
2024-08-23 08:58:55 +08:00
|
|
|
|
rewardAndPunishSortCs.Clear();
|
|
|
|
|
trainSorts.Clear();
|
|
|
|
|
checkSorts.Clear();
|
|
|
|
|
otherManagements.Clear();
|
|
|
|
|
fiveExpenses.Clear();
|
|
|
|
|
otherWorkPlanCs.Clear();
|
|
|
|
|
complianceObligationsCs.Clear();
|
|
|
|
|
|
2024-08-21 16:47:57 +08:00
|
|
|
|
ProjectId = CurrUser.LoginProjectId;
|
|
|
|
|
unitList = db.Base_Unit.ToList();
|
|
|
|
|
MonthReportId = Request.Params["MonthReportId"];
|
2024-08-23 08:58:55 +08:00
|
|
|
|
var project = BLL.ProjectService.GetProjectByProjectId(this.CurrUser.LoginProjectId);
|
|
|
|
|
|
2024-08-21 16:47:57 +08:00
|
|
|
|
if (!string.IsNullOrEmpty(MonthReportId))
|
|
|
|
|
{
|
|
|
|
|
var model = db.Manager_MonthReportC.FirstOrDefault(x => x.MonthReportId == MonthReportId);
|
|
|
|
|
if (model != null)
|
|
|
|
|
{
|
|
|
|
|
if (model.MonthReportCode != null)
|
|
|
|
|
{
|
|
|
|
|
this.txtPeriod.Text = Convert.ToString(model.MonthReportCode);
|
|
|
|
|
}
|
|
|
|
|
if (model.Months != null)
|
|
|
|
|
{
|
|
|
|
|
txtReportMonths.Text = string.Format("{0:yyyy-MM}", model.Months);
|
|
|
|
|
}
|
|
|
|
|
if (model.StartDate != null)
|
|
|
|
|
{
|
|
|
|
|
this.txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", model.StartDate);
|
|
|
|
|
}
|
|
|
|
|
if (model.EndDate != null)
|
|
|
|
|
{
|
|
|
|
|
this.txtEndDate.Text = string.Format("{0:yyyy-MM-dd}", model.EndDate);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
AddOrUpdate = "update";
|
|
|
|
|
|
|
|
|
|
#region 3.本月项目现场HSE人工日统计
|
|
|
|
|
//本月项目现场HSE人工日统计
|
|
|
|
|
Model.MonthReportCHSEDay hseDay = new Model.MonthReportCHSEDay
|
|
|
|
|
{
|
|
|
|
|
MonthHSEDay = model.MonthHSEDay ?? 0,
|
|
|
|
|
SumHSEDay = model.SumHSEDay ?? 0,
|
|
|
|
|
MonthHSEWorkDay = model.MonthHSEWorkDay ?? 0,
|
|
|
|
|
YearHSEWorkDay = model.YearHSEWorkDay ?? 0,
|
|
|
|
|
SumHSEWorkDay = model.SumHSEWorkDay ?? 0,
|
|
|
|
|
HseManhours = model.HseManhours ?? 0,
|
|
|
|
|
SubcontractManHours = model.SubcontractManHours ?? 0,
|
|
|
|
|
TotalHseManhoursYear = model.TotalHseManhoursYear ?? 0,
|
|
|
|
|
TotalHseManhours = model.TotalHseManhours ?? 0
|
|
|
|
|
};
|
|
|
|
|
List<Model.MonthReportCHSEDay> list = new List<Model.MonthReportCHSEDay>();
|
|
|
|
|
list.Add(hseDay);
|
|
|
|
|
this.gvHSEDay.DataSource = list;
|
|
|
|
|
this.gvHSEDay.DataBind();
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 4.1 培训情况
|
|
|
|
|
//培训情况
|
|
|
|
|
var trainSorts = BLL.TrainSortCService.GetTrainSortsByMonthReportId(MonthReportId);
|
|
|
|
|
if (trainSorts.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
this.gvTrainSort.DataSource = trainSorts;
|
|
|
|
|
this.gvTrainSort.DataBind();
|
|
|
|
|
|
|
|
|
|
if (this.gvTrainSort.Rows.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
JObject summary = new JObject();
|
|
|
|
|
summary.Add("TrainType", "培训人数合计:");
|
|
|
|
|
summary.Add("TotalPersonNum", trainSorts.Sum(x=>x.TotalPersonNum));
|
|
|
|
|
this.gvTrainSort.SummaryData = summary;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
this.gvTrainSort.SummaryData = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
2024-08-23 08:58:55 +08:00
|
|
|
|
|
|
|
|
|
#region 4.2现场HSE会议及检查统计
|
|
|
|
|
//检查情况
|
|
|
|
|
checkSorts = BLL.CheckSortCService.GetCheckSortsByMonthReportId(MonthReportId);
|
|
|
|
|
if (checkSorts.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
this.gvCheckSort.DataSource = checkSorts;
|
|
|
|
|
this.gvCheckSort.DataBind();
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 4.6.3其他应急管理工作描述
|
|
|
|
|
txtEmergencyManagementWorkDef.Text = model.EmergencyManagementWorkDef;
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 4.7HSE奖励与处罚
|
|
|
|
|
//HSE奖励与处罚
|
|
|
|
|
rewardAndPunishSortCs = BLL.RewardAndPunishSortCService.GetRewardAndPunishSortCByMontReportId(MonthReportId);
|
|
|
|
|
if (rewardAndPunishSortCs.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
this.gvRewardSortAndPunish.DataSource = rewardAndPunishSortCs;
|
|
|
|
|
this.gvRewardSortAndPunish.DataBind();
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 4.8HSE现场其他管理情况
|
|
|
|
|
otherManagements = BLL.OtherManagementCService.GetOtherManagementByMonthReportId(this.MonthReportId);
|
|
|
|
|
if (otherManagements.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
this.gvOtherManagement.DataSource = otherManagements;
|
|
|
|
|
this.gvOtherManagement.DataBind();
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 5.1 本月项目HSE费用投入统计
|
|
|
|
|
fiveExpenses = BLL.FiveExpenseCService.GetFiveExpenseByMonthReportId(MonthReportId);
|
|
|
|
|
if (fiveExpenses.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
this.gvFiveExpenseC.DataSource = fiveExpenses;
|
|
|
|
|
this.gvFiveExpenseC.DataBind();
|
|
|
|
|
OutputgvFiveExpenseCSummaryData();
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 6 HSE责任事故/事件描述
|
|
|
|
|
|
|
|
|
|
//6.2 HSE责任事故/事件描述
|
|
|
|
|
txtDef.Text = model.AccidentDef;
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 7.1下个月工作计划
|
|
|
|
|
otherWorkPlanCs = BLL.OtherWorkPlanCService.GetOtherWorkPlanByMonthReportId(MonthReportId);
|
|
|
|
|
if (otherWorkPlanCs.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
this.gvOtherWorkPlanC.DataSource = otherWorkPlanCs;
|
|
|
|
|
this.gvOtherWorkPlanC.DataBind();
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 8合规义务识别与评价
|
|
|
|
|
complianceObligationsCs = (from x in Funs.DB.Manager_Month_ComplianceObligationsC where x.MonthReportId == this.MonthReportId select x).ToList();
|
|
|
|
|
if (complianceObligationsCs.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
this.gvOperateComplianceObligations.DataSource = complianceObligationsCs;
|
|
|
|
|
this.gvOperateComplianceObligations.DataBind();
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
//9问题
|
|
|
|
|
txtQuestion.Text = model.Question;
|
|
|
|
|
|
2024-08-21 16:47:57 +08:00
|
|
|
|
//加载所有grid
|
|
|
|
|
lodAllGrid("1");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
MonthReportId = Guid.NewGuid().ToString();
|
|
|
|
|
months = Convert.ToDateTime(Request.Params["months"]);
|
|
|
|
|
this.txtReportMonths.Text = string.Format("{0:yyyy-MM}", months);
|
|
|
|
|
this.txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now.AddMonths(-1));
|
|
|
|
|
this.txtEndDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
|
|
|
|
|
this.txtPeriod.Text = BLL.CodeRecordsService.ReturnCodeByMenuIdProjectId(BLL.Const.ProjectManagerMonthCMenuId, this.ProjectId, this.CurrUser.UnitId);
|
|
|
|
|
AddOrUpdate = "add";
|
|
|
|
|
startTime = Convert.ToDateTime(txtStartDate.Text);
|
|
|
|
|
endTime = Convert.ToDateTime(txtEndDate.Text);
|
2024-08-23 08:58:55 +08:00
|
|
|
|
|
|
|
|
|
yearStartTime = Convert.ToDateTime(months.ToString("yyyy-01-01"));
|
|
|
|
|
|
|
|
|
|
if (project.StartDate != null)
|
|
|
|
|
{
|
|
|
|
|
projectStartTime = Convert.ToDateTime(project.StartDate);
|
|
|
|
|
}
|
2024-08-21 16:47:57 +08:00
|
|
|
|
//加载所有grid
|
|
|
|
|
lodAllGrid("0");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 加载1.项目概况
|
2024-08-23 08:58:55 +08:00
|
|
|
|
|
2024-08-21 16:47:57 +08:00
|
|
|
|
var mainUnit = BLL.UnitService.GetThisUnitDropDownList()[0];
|
|
|
|
|
this.lbProjectName.Text = project.ProjectName;
|
|
|
|
|
if (mainUnit != null)
|
|
|
|
|
{
|
|
|
|
|
this.lblMainUnitName.Text = mainUnit.UnitName;
|
|
|
|
|
}
|
|
|
|
|
this.lblProjectAddress.Text = project.ProjectAddress;
|
|
|
|
|
this.lblProjectCode.Text = project.ProjectCode;
|
|
|
|
|
this.lblContractNo.Text = project.ContractNo; //合同号
|
|
|
|
|
if (!string.IsNullOrEmpty(project.ProjectType))
|
|
|
|
|
{
|
|
|
|
|
var c = BLL.ConstValue.drpConstItemList(BLL.ConstValue.Group_ProjectType).
|
|
|
|
|
FirstOrDefault(x => x.ConstValue == project.ProjectType);
|
|
|
|
|
if (c != null)
|
|
|
|
|
{
|
|
|
|
|
this.lblProjectType.Text = c.ConstText;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.lblWorkRange.Text = project.WorkRange;//工程范围
|
|
|
|
|
if (project.Duration != null)
|
|
|
|
|
{
|
|
|
|
|
this.lblDuration.Text = project.Duration.ToString();//工期(月)
|
|
|
|
|
}
|
|
|
|
|
if (project.StartDate != null)
|
|
|
|
|
{
|
|
|
|
|
this.lblStartDate.Text = string.Format("{0:yyyy-MM-dd}", project.StartDate);
|
|
|
|
|
}
|
|
|
|
|
if (project.EndDate != null)
|
|
|
|
|
{
|
|
|
|
|
this.lblEndDate.Text = string.Format("{0:yyyy-MM-dd}", project.EndDate);
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
2024-08-23 08:58:55 +08:00
|
|
|
|
|
|
|
|
|
|
2024-08-21 16:47:57 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 时间选择事件
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 开始时间选择事件
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void txtStartDate_TextChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(this.txtStartDate.Text.Trim()))
|
|
|
|
|
{
|
|
|
|
|
string url = Request.Url.ToString();
|
|
|
|
|
if (url.Contains("?"))
|
|
|
|
|
{
|
|
|
|
|
url = Request.Url.ToString().Substring(0, Request.Url.ToString().LastIndexOf('?'));
|
|
|
|
|
}
|
|
|
|
|
Response.Redirect(url + "?startdate=" + txtStartDate.Text + "&enddate=" + txtEndDate.Text);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected void TextBox_TextChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(this.txtStartDate.Text.Trim()) && !string.IsNullOrEmpty(this.txtEndDate.Text.Trim()))
|
|
|
|
|
{
|
|
|
|
|
if (Funs.GetNewDateTime(this.txtStartDate.Text.Trim()) > Funs.GetNewDateTime(this.txtEndDate.Text.Trim()))
|
|
|
|
|
{
|
|
|
|
|
Alert.ShowInTop("开始时间不能大于结束时间!", MessageBoxIcon.Warning);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
PageContext.RegisterStartupScript("refresh();");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected void btnLoad_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (AddOrUpdate == "update")
|
|
|
|
|
{
|
|
|
|
|
lodAllGrid("1");
|
|
|
|
|
PageContext.RegisterStartupScript("rehiden();");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
lodAllGrid("0");
|
|
|
|
|
PageContext.RegisterStartupScript("rehiden();");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 保存
|
|
|
|
|
protected void btnSave_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
#region 保存主表
|
|
|
|
|
string MonthHSEDay = string.Empty, SumHSEDay = string.Empty, MonthHSEWorkDay = string.Empty, YearHSEWorkDay = string.Empty, SumHSEWorkDay = string.Empty,
|
|
|
|
|
HseManhours = string.Empty, SubcontractManHours = string.Empty, TotalHseManhours = string.Empty, TotalYearHseManhours=string.Empty;
|
|
|
|
|
JArray mergedData = gvHSEDay.GetMergedData();
|
|
|
|
|
foreach (JObject mergedRow in mergedData)
|
|
|
|
|
{
|
|
|
|
|
string status = mergedRow.Value<string>("status");
|
|
|
|
|
JObject values = mergedRow.Value<JObject>("values");
|
|
|
|
|
MonthHSEDay = values.Value<string>("MonthHSEDay").ToString();
|
|
|
|
|
SumHSEDay = values.Value<string>("SumHSEDay").ToString();
|
|
|
|
|
MonthHSEWorkDay = values.Value<string>("MonthHSEWorkDay").ToString();
|
|
|
|
|
YearHSEWorkDay = values.Value<string>("YearHSEWorkDay").ToString();
|
|
|
|
|
SumHSEWorkDay = values.Value<string>("SumHSEWorkDay").ToString();
|
|
|
|
|
HseManhours = values.Value<string>("HseManhours").ToString();
|
|
|
|
|
SubcontractManHours = values.Value<string>("SubcontractManHours").ToString();
|
|
|
|
|
TotalYearHseManhours = values.Value<string>("TotalHseManhoursYear").ToString();
|
|
|
|
|
TotalHseManhours = values.Value<string>("TotalHseManhours").ToString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var monthReport = new Model.Manager_MonthReportC();
|
|
|
|
|
monthReport.MonthReportId = MonthReportId;
|
|
|
|
|
monthReport.ProjectId = this.CurrUser.LoginProjectId;
|
|
|
|
|
monthReport.MonthReportCode = txtPeriod.Text;
|
|
|
|
|
monthReport.Months = Funs.GetNewDateTime(Request.Params["months"]);
|
|
|
|
|
monthReport.ReportMan = this.CurrUser.UserId;
|
|
|
|
|
monthReport.MonthReportDate = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
monthReport.StartDate = Funs.GetNewDateTime(txtStartDate.Text);
|
|
|
|
|
monthReport.EndDate = Funs.GetNewDateTime(txtEndDate.Text);
|
|
|
|
|
|
|
|
|
|
monthReport.MonthHSEDay = Funs.GetNewIntOrZero(MonthHSEDay);
|
|
|
|
|
monthReport.SumHSEDay = Funs.GetNewIntOrZero(SumHSEDay);
|
|
|
|
|
monthReport.MonthHSEWorkDay = Funs.GetNewIntOrZero(MonthHSEWorkDay);
|
|
|
|
|
monthReport.YearHSEWorkDay = Funs.GetNewIntOrZero(YearHSEWorkDay);
|
|
|
|
|
monthReport.SumHSEWorkDay = Funs.GetNewIntOrZero(SumHSEWorkDay);
|
|
|
|
|
monthReport.HseManhours = Funs.GetNewIntOrZero(HseManhours);
|
|
|
|
|
monthReport.SubcontractManHours = Funs.GetNewIntOrZero(SubcontractManHours);
|
|
|
|
|
monthReport.TotalHseManhours = Funs.GetNewIntOrZero(TotalHseManhours);
|
|
|
|
|
monthReport.TotalHseManhoursYear= Funs.GetNewIntOrZero(TotalYearHseManhours);
|
2024-08-23 08:58:55 +08:00
|
|
|
|
|
|
|
|
|
//4.6.3其他应急管理工作描述
|
|
|
|
|
monthReport.EmergencyManagementWorkDef = txtEmergencyManagementWorkDef.Text;
|
|
|
|
|
|
|
|
|
|
//6.2HSE责任事故/事件描述
|
|
|
|
|
monthReport.AccidentDef = txtDef.Text;
|
|
|
|
|
|
|
|
|
|
//9.问题
|
|
|
|
|
monthReport.Question = txtQuestion.Text;
|
2024-08-21 16:47:57 +08:00
|
|
|
|
if (AddOrUpdate == "add")
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
MonthReportCService.AddMonthReport(monthReport);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
MonthReportCService.UpdateMonthReport(monthReport);
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
#region 保存所有子表
|
|
|
|
|
//2
|
|
|
|
|
OperatePersonSort();
|
|
|
|
|
|
|
|
|
|
//4.1
|
|
|
|
|
OperateTrainSort();
|
2024-08-23 08:58:55 +08:00
|
|
|
|
|
|
|
|
|
//4.2
|
|
|
|
|
OperateCheckSort();
|
|
|
|
|
|
|
|
|
|
//4.7
|
|
|
|
|
OperateRewardAndPunishSort();
|
|
|
|
|
|
|
|
|
|
//4.8
|
|
|
|
|
OperateOtherManagementSort();
|
|
|
|
|
|
|
|
|
|
//5.1
|
|
|
|
|
OperateFiveExpenseSort();
|
|
|
|
|
|
|
|
|
|
//7.1
|
|
|
|
|
OperateOtherWorkPlanCSort();
|
|
|
|
|
|
|
|
|
|
//8
|
|
|
|
|
OperateComplianceObligationsCSort();
|
|
|
|
|
|
2024-08-21 16:47:57 +08:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
ShowNotify("保存成功!", MessageBoxIcon.Success);
|
|
|
|
|
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 2.保存人力投入情况
|
|
|
|
|
private void OperatePersonSort()
|
|
|
|
|
{
|
|
|
|
|
PersonSortCService.DeletePersonSortsByMonthReportId(MonthReportId);
|
|
|
|
|
JArray mergedData = gvPersonSort.GetMergedData();
|
|
|
|
|
foreach (JObject mergedRow in mergedData)
|
|
|
|
|
{
|
|
|
|
|
string status = mergedRow.Value<string>("status");
|
|
|
|
|
JObject values = mergedRow.Value<JObject>("values");
|
|
|
|
|
int i = mergedRow.Value<int>("index");
|
|
|
|
|
Model.Manager_PersonSortC personSort = new Model.Manager_PersonSortC
|
|
|
|
|
{
|
|
|
|
|
MonthReportId = MonthReportId,
|
|
|
|
|
UnitId = this.gvPersonSort.Rows[i].DataKeys[1].ToString(),
|
|
|
|
|
SumPersonNum = Funs.GetNewIntOrZero(values.Value<string>("SumPersonNum").ToString()),
|
|
|
|
|
SumOutPersonNum = Funs.GetNewIntOrZero(values.Value<string>("SumOutPersonNum").ToString()),
|
|
|
|
|
HSEPersonNum = Funs.GetNewIntOrZero(values.Value<string>("HSEPersonNum").ToString()),
|
|
|
|
|
ContractRange = values.Value<string>("ContractRange").ToString(),
|
|
|
|
|
Remark = values.Value<string>("Remark").ToString()
|
|
|
|
|
};
|
|
|
|
|
PersonSortCService.AddPersonSort(personSort);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 4.1保存培训
|
|
|
|
|
private void OperateTrainSort()
|
|
|
|
|
{
|
|
|
|
|
BLL.TrainSortCService.DeleteTrainSortsByMonthReportId(MonthReportId);
|
|
|
|
|
jerqueSaveTrainList();
|
|
|
|
|
foreach (Model.Manager_TrainSortC trainSort in trainSorts)
|
|
|
|
|
{
|
|
|
|
|
trainSort.MonthReportId = MonthReportId;
|
|
|
|
|
BLL.TrainSortCService.AddTrainSort(trainSort);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void jerqueSaveTrainList()
|
|
|
|
|
{
|
|
|
|
|
trainSorts.Clear();
|
|
|
|
|
JArray mergedData = gvTrainSort.GetMergedData();
|
|
|
|
|
foreach (JObject mergedRow in mergedData)
|
|
|
|
|
{
|
|
|
|
|
string status = mergedRow.Value<string>("status");
|
|
|
|
|
JObject values = mergedRow.Value<JObject>("values");
|
|
|
|
|
int i = mergedRow.Value<int>("index");
|
|
|
|
|
Model.Manager_TrainSortC trainSort = new Model.Manager_TrainSortC
|
|
|
|
|
{
|
|
|
|
|
TrainSortId = this.gvTrainSort.Rows[i].DataKeys[0].ToString(),
|
|
|
|
|
SortIndex = i,
|
|
|
|
|
TrainType = values.Value<string>("TrainType").ToString(),
|
|
|
|
|
//TrainContent = values.Value<string>("TrainContent").ToString(),
|
|
|
|
|
TeachHour = Funs.GetNewDecimalOrZero(values.Value<string>("TeachHour").ToString()),
|
|
|
|
|
//TeachMan = values.Value<string>("TeachMan").ToString(),
|
|
|
|
|
PersonNum = Funs.GetNewIntOrZero(values.Value<string>("PersonNum").ToString()),
|
|
|
|
|
TotalPersonNum = Funs.GetNewIntOrZero(values.Value<string>("TotalPersonNum").ToString())
|
|
|
|
|
};
|
|
|
|
|
trainSorts.Add(trainSort);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
2024-08-23 08:58:55 +08:00
|
|
|
|
#region 4.2保存现场HSE会议及检查
|
|
|
|
|
private void OperateCheckSort()
|
|
|
|
|
{
|
|
|
|
|
BLL.CheckSortCService.DeleteCheckSortsByMonthReportId(MonthReportId);
|
|
|
|
|
jerqueSaveCheckList();
|
|
|
|
|
foreach (Model.Manager_CheckSortC checkSort in checkSorts)
|
|
|
|
|
{
|
|
|
|
|
checkSort.MonthReportId = MonthReportId;
|
|
|
|
|
BLL.CheckSortCService.AddCheckSort(checkSort);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 检查并保存HSE检查集合
|
|
|
|
|
/// </summary>
|
|
|
|
|
private void jerqueSaveCheckList()
|
|
|
|
|
{
|
|
|
|
|
checkSorts.Clear();
|
|
|
|
|
JArray mergedData = gvCheckSort.GetMergedData();
|
|
|
|
|
foreach (JObject mergedRow in mergedData)
|
|
|
|
|
{
|
|
|
|
|
string status = mergedRow.Value<string>("status");
|
|
|
|
|
JObject values = mergedRow.Value<JObject>("values");
|
|
|
|
|
int i = mergedRow.Value<int>("index");
|
|
|
|
|
Model.Manager_CheckSortC checkSort = new Model.Manager_CheckSortC
|
|
|
|
|
{
|
|
|
|
|
CheckSortId = this.gvCheckSort.Rows[i].DataKeys[0].ToString(),
|
|
|
|
|
SortIndex = i,
|
|
|
|
|
CheckType = values.Value<string>("CheckType").ToString(),
|
|
|
|
|
CheckNumber = Funs.GetNewInt(values.Value<string>("CheckNumber").ToString()),
|
|
|
|
|
YearCheckNum = Funs.GetNewInt(values.Value<string>("YearCheckNum").ToString()),
|
|
|
|
|
TotalCheckNum = Funs.GetNewInt(values.Value<string>("TotalCheckNum").ToString())
|
|
|
|
|
};
|
|
|
|
|
checkSorts.Add(checkSort);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 4.7保存奖励惩罚
|
|
|
|
|
private void OperateRewardAndPunishSort()
|
|
|
|
|
{
|
|
|
|
|
BLL.RewardAndPunishSortCService.DeleteRewardAndPunishSortCByMonthReportId(MonthReportId);
|
|
|
|
|
jerqueSavePunishList();
|
|
|
|
|
foreach (Model.Manager_RewardAndPunishSortC rewardAndPunishSortC in rewardAndPunishSortCs)
|
|
|
|
|
{
|
|
|
|
|
rewardAndPunishSortC.MonthReportId = MonthReportId;
|
|
|
|
|
BLL.RewardAndPunishSortCService.AddRewardAndPunishSortC(rewardAndPunishSortC);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 4.8保存HSE现场其他管理情况
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// HSE现场其他管理情况
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="monthReportId"></param>
|
|
|
|
|
private void OperateOtherManagementSort()
|
|
|
|
|
{
|
|
|
|
|
BLL.OtherManagementCService.DeleteOtherManagementByMonthReportId(MonthReportId);
|
|
|
|
|
jerqueSaveOtherManagementList();
|
|
|
|
|
foreach (Model.Manager_Month_OtherManagementC otherManagement in otherManagements)
|
|
|
|
|
{
|
|
|
|
|
otherManagement.MonthReportId = MonthReportId;
|
|
|
|
|
BLL.OtherManagementCService.AddOtherManagement(otherManagement);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 5.1保存
|
|
|
|
|
private void OperateFiveExpenseSort() {
|
|
|
|
|
BLL.FiveExpenseCService.DeleteFiveExpenseByMonthReportId(MonthReportId);
|
|
|
|
|
jerqueSaveFiveExpenseList();
|
|
|
|
|
foreach (Model.Manager_Month_FiveExpenseC fiveExpendse in fiveExpenses)
|
|
|
|
|
{
|
|
|
|
|
fiveExpendse.MonthReportId = MonthReportId;
|
|
|
|
|
BLL.FiveExpenseCService.AddFiveExpense(fiveExpendse);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void jerqueSaveFiveExpenseList()
|
|
|
|
|
{
|
|
|
|
|
fiveExpenses.Clear();
|
|
|
|
|
JArray mergedData = gvFiveExpenseC.GetMergedData();
|
|
|
|
|
foreach (JObject mergedRow in mergedData)
|
|
|
|
|
{
|
|
|
|
|
string status = mergedRow.Value<string>("status");
|
|
|
|
|
JObject values = mergedRow.Value<JObject>("values");
|
|
|
|
|
int i = mergedRow.Value<int>("index");
|
|
|
|
|
Model.Manager_Month_FiveExpenseC trainSort = new Model.Manager_Month_FiveExpenseC
|
|
|
|
|
{
|
|
|
|
|
FiveExpenseId = this.gvFiveExpenseC.Rows[i].DataKeys[0].ToString(),
|
|
|
|
|
SortIndex = i,
|
|
|
|
|
InvestmentProject = values.Value<string>("InvestmentProject").ToString(),
|
|
|
|
|
PlanCostMonth = Funs.GetNewDecimal(values.Value<string>("PlanCostMonth").ToString()),
|
|
|
|
|
PlanCostYear = Funs.GetNewDecimal(values.Value<string>("PlanCostYear").ToString()),
|
|
|
|
|
ActualCostMonth = Funs.GetNewDecimal(values.Value<string>("ActualCostMonth").ToString()),
|
|
|
|
|
ActualCostYear = Funs.GetNewDecimal(values.Value<string>("ActualCostYear").ToString())
|
|
|
|
|
};
|
|
|
|
|
fiveExpenses.Add(trainSort);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 7.1保存下个月计划
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 7.2 其他HSE工作计划
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="monthReportId"></param>
|
|
|
|
|
private void OperateOtherWorkPlanCSort()
|
|
|
|
|
{
|
|
|
|
|
BLL.OtherWorkPlanCService.DeleteOtherWorkPlanByMonthReportId(MonthReportId);
|
|
|
|
|
jerqueSaveOtherWorkPlanCList();
|
|
|
|
|
foreach (Model.Manager_Month_OtherWorkPlanC item in otherWorkPlanCs)
|
|
|
|
|
{
|
|
|
|
|
item.MonthReportId = MonthReportId;
|
|
|
|
|
BLL.OtherWorkPlanCService.AddOtherWorkPlan(item);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void jerqueSaveOtherWorkPlanCList()
|
|
|
|
|
{
|
|
|
|
|
otherWorkPlanCs.Clear();
|
|
|
|
|
JArray mergedData = gvOtherWorkPlanC.GetMergedData();
|
|
|
|
|
foreach (JObject mergedRow in mergedData)
|
|
|
|
|
{
|
|
|
|
|
string status = mergedRow.Value<string>("status");
|
|
|
|
|
JObject values = mergedRow.Value<JObject>("values");
|
|
|
|
|
int i = mergedRow.Value<int>("index");
|
|
|
|
|
Model.Manager_Month_OtherWorkPlanC otherWorkPlanC = new Model.Manager_Month_OtherWorkPlanC
|
|
|
|
|
{
|
|
|
|
|
OtherWorkPlanId = this.gvOtherWorkPlanC.Rows[i].DataKeys[0].ToString(),
|
|
|
|
|
SortIndex = i,
|
|
|
|
|
WorkContent = values.Value<string>("WorkContent").ToString()
|
|
|
|
|
};
|
|
|
|
|
otherWorkPlanCs.Add(otherWorkPlanC);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 增加其他HSE工作计划
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void btnOtherWorkPlanC_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
jerqueSaveOtherWorkPlanCList();
|
|
|
|
|
Model.Manager_Month_OtherWorkPlanC otherWorkPlanC = new Model.Manager_Month_OtherWorkPlanC
|
|
|
|
|
{
|
|
|
|
|
OtherWorkPlanId = SQLHelper.GetNewID(typeof(Model.Manager_Month_OtherWorkPlanC))
|
|
|
|
|
};
|
|
|
|
|
otherWorkPlanCs.Add(otherWorkPlanC);
|
|
|
|
|
this.gvOtherWorkPlanC.DataSource = otherWorkPlanCs;
|
|
|
|
|
this.gvOtherWorkPlanC.DataBind();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 删除其他HSE工作计划
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void gvOtherWorkPlanC_RowCommand(object sender, GridCommandEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
jerqueSaveOtherWorkPlanCList();
|
|
|
|
|
string rowID = this.gvOtherWorkPlanC.DataKeys[e.RowIndex][0].ToString();
|
|
|
|
|
if (e.CommandName == "Delete")
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in otherWorkPlanCs)
|
|
|
|
|
{
|
|
|
|
|
if (item.OtherWorkPlanId == rowID)
|
|
|
|
|
{
|
|
|
|
|
otherWorkPlanCs.Remove(item);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
gvOtherWorkPlanC.DataSource = otherWorkPlanCs;
|
|
|
|
|
gvOtherWorkPlanC.DataBind();
|
|
|
|
|
ShowNotify("删除数据成功!", MessageBoxIcon.Success);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 8. 保存HSE合规义务识别与评价
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 保存HSE合规义务识别与评价
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="monthReportId"></param>
|
|
|
|
|
private void OperateComplianceObligationsCSort()
|
|
|
|
|
{
|
|
|
|
|
BLL.ComplianceObligationsCService.DeleteComplianceObligationsCByMonthReportId(MonthReportId);
|
|
|
|
|
jerqueSaveComplianceObligationsCList();
|
|
|
|
|
foreach (Model.Manager_Month_ComplianceObligationsC coc in complianceObligationsCs)
|
|
|
|
|
{
|
|
|
|
|
coc.MonthReportId = MonthReportId;
|
|
|
|
|
BLL.ComplianceObligationsCService.AddComplianceObligationsC(coc);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///// <summary>
|
|
|
|
|
///// 增加HSE合规义务识别与评价
|
|
|
|
|
///// </summary>
|
|
|
|
|
///// <param name="sender"></param>
|
|
|
|
|
///// <param name="e"></param>
|
|
|
|
|
protected void btnNew_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
jerqueSaveComplianceObligationsCList();
|
|
|
|
|
Model.Manager_Month_ComplianceObligationsC complianceObligationsC = new Model.Manager_Month_ComplianceObligationsC
|
|
|
|
|
{
|
|
|
|
|
ComplianceObligationsId = SQLHelper.GetNewID(typeof(Model.Manager_Month_ComplianceObligationsC))
|
|
|
|
|
};
|
|
|
|
|
complianceObligationsCs.Add(complianceObligationsC);
|
|
|
|
|
this.gvOperateComplianceObligations.DataSource = complianceObligationsCs;
|
|
|
|
|
this.gvOperateComplianceObligations.DataBind();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///// <summary>
|
|
|
|
|
///// 检查并保存危险源动态识别及控制集合
|
|
|
|
|
///// </summary>
|
|
|
|
|
private void jerqueSaveComplianceObligationsCList()
|
|
|
|
|
{
|
|
|
|
|
complianceObligationsCs.Clear();
|
|
|
|
|
JArray mergedData = gvOperateComplianceObligations.GetMergedData();
|
|
|
|
|
foreach (JObject mergedRow in mergedData)
|
|
|
|
|
{
|
|
|
|
|
string status = mergedRow.Value<string>("status");
|
|
|
|
|
JObject values = mergedRow.Value<JObject>("values");
|
|
|
|
|
int i = mergedRow.Value<int>("index");
|
|
|
|
|
Model.Manager_Month_ComplianceObligationsC hazardSort = new Model.Manager_Month_ComplianceObligationsC
|
|
|
|
|
{
|
|
|
|
|
ComplianceObligationsId = this.gvOperateComplianceObligations.Rows[i].DataKeys[0].ToString(),
|
|
|
|
|
InformationContent = values.Value<string>("InformationContent").ToString(),
|
|
|
|
|
ResponseMeasures = values.Value<string>("ResponseMeasures").ToString(),
|
|
|
|
|
ImplementationStatus = values.Value<string>("ImplementationStatus").ToString(),
|
|
|
|
|
EvaluationConclusion = values.Value<string>("EvaluationConclusion").ToString()
|
|
|
|
|
};
|
|
|
|
|
complianceObligationsCs.Add(hazardSort);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected void gvOperateComplianceObligations_RowCommand(object sender, GridCommandEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
jerqueSaveComplianceObligationsCList();
|
|
|
|
|
string rowID = this.gvOperateComplianceObligations.DataKeys[e.RowIndex][0].ToString();
|
|
|
|
|
if (e.CommandName == "Delete")
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in complianceObligationsCs)
|
|
|
|
|
{
|
|
|
|
|
if (item.ComplianceObligationsId == rowID)
|
|
|
|
|
{
|
|
|
|
|
complianceObligationsCs.Remove(item);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
gvOperateComplianceObligations.DataSource = complianceObligationsCs;
|
|
|
|
|
gvOperateComplianceObligations.DataBind();
|
|
|
|
|
ShowNotify("删除数据成功!", MessageBoxIcon.Success);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
2024-08-21 16:47:57 +08:00
|
|
|
|
#region 加载grid
|
|
|
|
|
void lodAllGrid(string objType)
|
|
|
|
|
{
|
|
|
|
|
if (objType == "0")
|
|
|
|
|
{
|
|
|
|
|
//添加的时候加载
|
|
|
|
|
//2.本月项目现场HSE人力投入情况
|
|
|
|
|
GetPersonSort();
|
|
|
|
|
//3.本月项目现场HSE人工日统计
|
|
|
|
|
getMonthReportCHSEDay();
|
2024-08-23 08:58:55 +08:00
|
|
|
|
//4.1培训
|
2024-08-21 16:47:57 +08:00
|
|
|
|
GetTrainSort();
|
2024-08-23 08:58:55 +08:00
|
|
|
|
//4.2现场HSE绩效数据统计
|
|
|
|
|
GetCheckSort();
|
|
|
|
|
//4.7HSE奖励与处罚
|
|
|
|
|
GetRewardAndPunishSort();
|
|
|
|
|
|
|
|
|
|
//5.1本月项目HSE费用投入统计
|
|
|
|
|
GetFiveExpenseList();
|
|
|
|
|
|
2024-08-21 16:47:57 +08:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//2.本月项目现场HSE人力投入情况
|
|
|
|
|
GetPersonSortEdit();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 2 人力投入情况
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 显示月报告人员投入情况
|
|
|
|
|
/// </summary>
|
|
|
|
|
private void GetPersonSort()
|
|
|
|
|
{
|
|
|
|
|
List<Model.Manager_PersonSortC> personSorts = new List<Model.Manager_PersonSortC>();
|
|
|
|
|
var units = from x in Funs.DB.Project_ProjectUnit
|
|
|
|
|
where x.ProjectId == this.ProjectId && (x.UnitType == "1" || x.UnitType == "2")
|
|
|
|
|
orderby x.UnitType
|
|
|
|
|
select x; //1为总包,2为施工分包
|
|
|
|
|
int totalSumPersonNum = 0;//总部
|
|
|
|
|
int totalSumOutPersonNum = 0;//外聘
|
|
|
|
|
int totalHSEPersonNum = 0;
|
|
|
|
|
if (units.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (Model.Project_ProjectUnit u in units)
|
|
|
|
|
{
|
|
|
|
|
Model.Manager_PersonSortC personSort = new Model.Manager_PersonSortC
|
|
|
|
|
{
|
|
|
|
|
PersonSortId = Guid.NewGuid().ToString(),
|
|
|
|
|
UnitId = u.UnitId,
|
|
|
|
|
SumPersonNum = BLL.PersonService.GetPersonCountByUnitId(u.UnitId, ProjectId, Convert.ToDateTime(txtEndDate.Text), false),//本部
|
|
|
|
|
SumOutPersonNum = BLL.PersonService.GetPersonCountByUnitId(u.UnitId, ProjectId, Convert.ToDateTime(txtEndDate.Text), true),//外聘
|
|
|
|
|
HSEPersonNum = BLL.PersonService.GetHSEPersonCountByUnitId(u.UnitId, ProjectId, Convert.ToDateTime(txtEndDate.Text)),
|
|
|
|
|
ContractRange = u.ContractRange
|
|
|
|
|
};
|
|
|
|
|
personSorts.Add(personSort);
|
|
|
|
|
totalSumPersonNum += Convert.ToInt32(personSort.SumPersonNum);
|
|
|
|
|
totalSumOutPersonNum += Convert.ToInt32(personSort.SumOutPersonNum);
|
|
|
|
|
totalHSEPersonNum += Convert.ToInt32(personSort.HSEPersonNum);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.gvPersonSort.DataSource = personSorts;
|
|
|
|
|
this.gvPersonSort.DataBind();
|
|
|
|
|
if (this.gvPersonSort.Rows.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
JObject summary = new JObject();
|
|
|
|
|
summary.Add("UnitId", "合计:");
|
|
|
|
|
summary.Add("SumPersonNum", totalSumPersonNum);
|
|
|
|
|
summary.Add("SumOutPersonNum", totalSumOutPersonNum);
|
|
|
|
|
summary.Add("HSEPersonNum", totalHSEPersonNum);
|
|
|
|
|
this.gvPersonSort.SummaryData = summary;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
this.gvPersonSort.SummaryData = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//修改的时候
|
|
|
|
|
void GetPersonSortEdit()
|
|
|
|
|
{
|
|
|
|
|
var q = from x in db.Manager_PersonSortC
|
|
|
|
|
where x.MonthReportId == MonthReportId
|
|
|
|
|
select x;
|
|
|
|
|
if (q.Count() > 0) //保存过数据
|
|
|
|
|
{
|
|
|
|
|
//人力投入情况
|
|
|
|
|
List<Model.Manager_PersonSortC> sorts = (from x in db.Manager_PersonSortC
|
|
|
|
|
join y in db.Project_ProjectUnit
|
|
|
|
|
on x.UnitId equals y.UnitId
|
|
|
|
|
where x.MonthReportId == MonthReportId && y.ProjectId == this.ProjectId
|
|
|
|
|
orderby y.UnitType
|
|
|
|
|
select x).Distinct().ToList();
|
|
|
|
|
List<Model.Manager_PersonSortC> personSorts = new List<Model.Manager_PersonSortC>();
|
|
|
|
|
var units = from x in db.Project_ProjectUnit
|
|
|
|
|
where x.ProjectId == this.ProjectId && (x.UnitType == "1" || x.UnitType == "2")
|
|
|
|
|
orderby x.UnitType
|
|
|
|
|
select x; //1为总包,2为施工分包
|
|
|
|
|
foreach (var unit in units)
|
|
|
|
|
{
|
|
|
|
|
Model.Manager_PersonSortC personSort = sorts.FirstOrDefault(x => x.UnitId == unit.UnitId);
|
|
|
|
|
if (personSort != null)
|
|
|
|
|
{
|
|
|
|
|
personSorts.Add(personSort);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.gvPersonSort.DataSource = personSorts;
|
|
|
|
|
this.gvPersonSort.DataBind();
|
|
|
|
|
if (this.gvPersonSort.Rows.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
JObject summary = new JObject();
|
|
|
|
|
summary.Add("UnitId", "合计:");
|
|
|
|
|
summary.Add("SumPersonNum", (from x in personSorts select x.SumPersonNum ?? 0).Sum());
|
|
|
|
|
summary.Add("SumOutPersonNum", (from x in personSorts select x.SumOutPersonNum ?? 0).Sum());
|
|
|
|
|
summary.Add("HSEPersonNum", (from x in personSorts select x.HSEPersonNum ?? 0).Sum());
|
|
|
|
|
this.gvPersonSort.SummaryData = summary;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
this.gvPersonSort.SummaryData = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
GetPersonSort();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 3.本月项目现场HSE人工日统计
|
|
|
|
|
private void getMonthReportCHSEDay()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
//本月项目现场HSE人工日统计
|
|
|
|
|
Model.MonthReportCHSEDay hseDay = new Model.MonthReportCHSEDay
|
|
|
|
|
{
|
|
|
|
|
MonthHSEDay = (endTime - startTime).Days + 1
|
|
|
|
|
};
|
|
|
|
|
Model.Manager_MonthReportC mr = BLL.MonthReportCService.GetLastMonthReportByDate(endTime, this.ProjectId);
|
|
|
|
|
if (mr != null)
|
|
|
|
|
{
|
|
|
|
|
if (mr.SumHSEDay != 0)
|
|
|
|
|
{
|
|
|
|
|
hseDay.SumHSEDay = (mr.SumHSEDay ?? 0) + hseDay.MonthHSEDay;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
hseDay.SumHSEDay = hseDay.MonthHSEDay;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
hseDay.SumHSEDay = hseDay.MonthHSEDay;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int? monthHSEWorkDay = 0;
|
|
|
|
|
int? yearHSEWorkDay = 0;
|
|
|
|
|
int? sumHSEWorkDay = 0;
|
|
|
|
|
decimal? hSEManhours = 0;
|
|
|
|
|
decimal? sumHseManhours = 0;
|
|
|
|
|
decimal? SubcontractManHours = 0;
|
|
|
|
|
|
|
|
|
|
decimal? YearHSEWorkDay = 0;
|
|
|
|
|
//年度安全人工时
|
|
|
|
|
var getProjectMonthReport = from x in db.SitePerson_MonthReport where x.ProjectId == ProjectId select x;
|
|
|
|
|
if (getProjectMonthReport.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
////人工时月报明细
|
|
|
|
|
var getMonthReportDetail = from x in db.SitePerson_MonthReportDetail
|
|
|
|
|
join y in getProjectMonthReport on x.MonthReportId equals y.MonthReportId
|
|
|
|
|
select x;
|
|
|
|
|
var yearMonthReport = from x in getProjectMonthReport
|
|
|
|
|
where x.CompileDate.Value.Year == months.Year
|
|
|
|
|
select x;
|
|
|
|
|
if (yearMonthReport.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in yearMonthReport)
|
|
|
|
|
{
|
|
|
|
|
////年度累计安全人工时
|
|
|
|
|
YearHSEWorkDay += getMonthReportDetail.Where(x => x.MonthReportId ==
|
|
|
|
|
item.MonthReportId).Sum(x => x.PersonWorkTime) ?? 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
YearHSEWorkDay = 0;
|
|
|
|
|
}
|
|
|
|
|
hseDay.YearHSEWorkDay = Convert.ToInt32(YearHSEWorkDay);
|
|
|
|
|
var monthReport = BLL.Funs.DB.SitePerson_MonthReport.FirstOrDefault(x => x.CompileDate == months && x.ProjectId == ProjectId); //当月人工时月报
|
|
|
|
|
if (monthReport != null)
|
|
|
|
|
{
|
|
|
|
|
monthHSEWorkDay = Convert.ToInt32((from x in Funs.DB.SitePerson_MonthReportDetail
|
|
|
|
|
where x.MonthReportId == monthReport.MonthReportId
|
|
|
|
|
select x.RealPersonNum ?? 0).Sum());
|
|
|
|
|
hSEManhours = (from x in Funs.DB.SitePerson_MonthReportDetail
|
|
|
|
|
join z in Funs.DB.Project_ProjectUnit
|
|
|
|
|
on x.UnitId equals z.UnitId
|
|
|
|
|
where z.UnitType == "1" && z.ProjectId == this.CurrUser.LoginProjectId && x.MonthReportId == monthReport.MonthReportId //总包
|
|
|
|
|
select x.PersonWorkTime ?? 0).Sum();
|
|
|
|
|
var q = (from x in Funs.DB.SitePerson_MonthReportDetail
|
|
|
|
|
join z in Funs.DB.Project_ProjectUnit
|
|
|
|
|
on x.UnitId equals z.UnitId
|
|
|
|
|
where z.UnitType == "2" && z.ProjectId == this.CurrUser.LoginProjectId && x.MonthReportId == monthReport.MonthReportId //分包
|
|
|
|
|
select x);
|
|
|
|
|
foreach (var item in q)
|
|
|
|
|
{
|
|
|
|
|
SubcontractManHours += item.PersonWorkTime ?? 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
monthHSEWorkDay = 0;
|
|
|
|
|
hSEManhours = 0;
|
|
|
|
|
SubcontractManHours = 0;
|
|
|
|
|
}
|
|
|
|
|
//年度人工日
|
|
|
|
|
if (months.Month == 1)
|
|
|
|
|
{
|
|
|
|
|
yearHSEWorkDay = monthHSEWorkDay;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (mr != null)
|
|
|
|
|
{
|
|
|
|
|
if (mr.YearHSEWorkDay != null)
|
|
|
|
|
{
|
|
|
|
|
yearHSEWorkDay = (mr.YearHSEWorkDay ?? 0) + monthHSEWorkDay;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
yearHSEWorkDay = monthHSEWorkDay;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
yearHSEWorkDay = monthHSEWorkDay;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (mr != null)
|
|
|
|
|
{
|
|
|
|
|
if (mr.SumHSEWorkDay != 0)
|
|
|
|
|
{
|
|
|
|
|
sumHSEWorkDay = (mr.SumHSEWorkDay ?? 0) + monthHSEWorkDay;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
sumHSEWorkDay = monthHSEWorkDay;
|
|
|
|
|
}
|
|
|
|
|
if (mr.TotalHseManhours != 0)
|
|
|
|
|
{
|
|
|
|
|
sumHseManhours = (mr.TotalHseManhours ?? 0) + hSEManhours + SubcontractManHours;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
sumHseManhours = hSEManhours + SubcontractManHours;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
sumHSEWorkDay = monthHSEWorkDay;
|
|
|
|
|
sumHseManhours = hSEManhours + SubcontractManHours;
|
|
|
|
|
}
|
|
|
|
|
hseDay.MonthHSEWorkDay = monthHSEWorkDay ?? 0;
|
|
|
|
|
hseDay.YearHSEWorkDay = yearHSEWorkDay ?? 0;
|
|
|
|
|
hseDay.SumHSEWorkDay = sumHSEWorkDay ?? 0;
|
|
|
|
|
if (hSEManhours.ToString().Contains("."))
|
|
|
|
|
{
|
|
|
|
|
hseDay.HseManhours = int.Parse(hSEManhours.ToString().Substring(0, hSEManhours.ToString().LastIndexOf(".")));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
hseDay.HseManhours = int.Parse(hSEManhours.ToString());
|
|
|
|
|
}
|
|
|
|
|
if (SubcontractManHours.ToString().Contains("."))
|
|
|
|
|
{
|
|
|
|
|
hseDay.SubcontractManHours = int.Parse(SubcontractManHours.ToString().Substring(0, SubcontractManHours.ToString().LastIndexOf(".")));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
hseDay.SubcontractManHours = int.Parse(SubcontractManHours.ToString());
|
|
|
|
|
}
|
|
|
|
|
if (sumHseManhours.ToString().Contains("."))
|
|
|
|
|
{
|
|
|
|
|
hseDay.TotalHseManhours = int.Parse(sumHseManhours.ToString().Substring(0, sumHseManhours.ToString().LastIndexOf(".")));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
hseDay.TotalHseManhours = int.Parse(sumHseManhours.ToString());
|
|
|
|
|
}
|
|
|
|
|
List<Model.MonthReportCHSEDay> list = new List<Model.MonthReportCHSEDay>();
|
|
|
|
|
list.Add(hseDay);
|
|
|
|
|
this.gvHSEDay.DataSource = list;
|
|
|
|
|
this.gvHSEDay.DataBind();
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region HSE培训
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 显示月报告HSE培训情况
|
|
|
|
|
/// </summary>
|
|
|
|
|
private void GetTrainSort()
|
|
|
|
|
{
|
|
|
|
|
trainSorts.Clear();
|
|
|
|
|
var TotalPersonNum = 0;
|
|
|
|
|
var list = db.Base_TrainType.ToList();
|
|
|
|
|
var listTrain = BLL.EduTrain_TrainRecordService.GetTrainingsByTrainDate(startTime, endTime, this.ProjectId);
|
|
|
|
|
var listAllTrain= BLL.EduTrain_TrainRecordService.GetTrainingsByTrainDate(endTime, this.ProjectId);
|
|
|
|
|
foreach (var item in list)
|
|
|
|
|
{
|
|
|
|
|
int i = 0;
|
|
|
|
|
var trainSort = new Model.Manager_TrainSortC
|
|
|
|
|
{
|
|
|
|
|
TrainSortId = SQLHelper.GetNewID(typeof(Model.Manager_TrainSortC)),
|
|
|
|
|
SortIndex = i
|
|
|
|
|
};
|
|
|
|
|
trainSort.TrainType = item.TrainTypeName;
|
|
|
|
|
if (listTrain.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
trainSort.TeachHour = listTrain.Where(x => x.TrainTypeId == item.TrainTypeId).Sum(x => x.TeachHour);
|
|
|
|
|
trainSort.PersonNum = listTrain.Where(x => x.TrainTypeId == item.TrainTypeId).Sum(x => x.TrainPersonNum);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
trainSort.TeachHour = 0;
|
|
|
|
|
trainSort.PersonNum = 0;
|
|
|
|
|
}
|
|
|
|
|
if (listAllTrain.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
trainSort.TotalPersonNum = listAllTrain.Where(x => x.TrainTypeId == item.TrainTypeId).Sum(x => x.TrainPersonNum);
|
|
|
|
|
TotalPersonNum += Convert.ToInt32(trainSort.TotalPersonNum);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
trainSort.TotalPersonNum = 0;
|
|
|
|
|
}
|
|
|
|
|
i++;
|
|
|
|
|
trainSorts.Add(trainSort);
|
|
|
|
|
}
|
|
|
|
|
this.gvTrainSort.DataSource = trainSorts;
|
|
|
|
|
this.gvTrainSort.DataBind();
|
|
|
|
|
if (this.gvTrainSort.Rows.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
JObject summary = new JObject();
|
|
|
|
|
summary.Add("TrainType", "培训人数合计:");
|
|
|
|
|
summary.Add("TotalPersonNum", TotalPersonNum);
|
|
|
|
|
this.gvTrainSort.SummaryData = summary;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
this.gvTrainSort.SummaryData = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
2024-08-23 08:58:55 +08:00
|
|
|
|
|
|
|
|
|
#region 4.2现场HSE会议及检查统计
|
|
|
|
|
private void GetCheckSort() {
|
|
|
|
|
int i = 0;
|
|
|
|
|
|
|
|
|
|
#region HSE会议 本月开展次数
|
|
|
|
|
int safetyLeaderGroup = BLL.SafetyLeaderGroupMeetingService.GetCountByTime(startTime, endTime, this.ProjectId);//安全领导小组会议
|
|
|
|
|
int weekMeeting = BLL.WeekMeetingService.GetCountByTime(startTime, endTime, this.ProjectId);//周例会
|
|
|
|
|
int monthMeeting = BLL.MonthMeetingService.GetCountByTime(startTime, endTime, this.ProjectId);//月例会
|
|
|
|
|
int specialMeeting = BLL.SpecialMeetingService.GetCountByTime(startTime, endTime, this.ProjectId);//专题例会
|
|
|
|
|
int attendMeeting = BLL.AttendMeetingService.GetCountByTime(startTime, endTime, this.ProjectId);//其他会议
|
|
|
|
|
int classMeeting = BLL.ClassMeetingService.GetCountByTime(startTime, endTime, this.ProjectId);//班前会
|
|
|
|
|
#endregion
|
|
|
|
|
#region HSE会议 年度累计次数
|
|
|
|
|
int yearSafetyLeaderGroup = BLL.SafetyLeaderGroupMeetingService.GetCountByTime(yearStartTime, endTime, this.ProjectId);//安全领导小组会议
|
|
|
|
|
int yearWeekMeeting = BLL.WeekMeetingService.GetCountByTime(yearStartTime, endTime, this.ProjectId);//周例会
|
|
|
|
|
int yearMonthMeeting = BLL.MonthMeetingService.GetCountByTime(yearStartTime, endTime, this.ProjectId);//月例会
|
|
|
|
|
int yearSpecialMeeting = BLL.SpecialMeetingService.GetCountByTime(yearStartTime, endTime, this.ProjectId);//专题例会
|
|
|
|
|
int yearAttendMeeting = BLL.AttendMeetingService.GetCountByTime(yearStartTime, endTime, this.ProjectId);//其他会议
|
|
|
|
|
int yearClassMeeting = BLL.ClassMeetingService.GetCountByTime(yearStartTime, endTime, this.ProjectId);//班前会
|
|
|
|
|
#endregion
|
|
|
|
|
#region HSE会议 项目总累计数
|
|
|
|
|
int projectSafetyLeaderGroup = BLL.SafetyLeaderGroupMeetingService.GetCountByTime(projectStartTime, endTime, this.ProjectId);//安全领导小组会议
|
|
|
|
|
int projectWeekMeeting = BLL.WeekMeetingService.GetCountByTime(projectStartTime, endTime, this.ProjectId);//周例会
|
|
|
|
|
int projectMonthMeeting = BLL.MonthMeetingService.GetCountByTime(projectStartTime, endTime, this.ProjectId);//月例会
|
|
|
|
|
int projectSpecialMeeting = BLL.SpecialMeetingService.GetCountByTime(projectStartTime, endTime, this.ProjectId);//专题例会
|
|
|
|
|
int projectAttendMeeting = BLL.AttendMeetingService.GetCountByTime(projectStartTime, endTime, this.ProjectId);//其他会议
|
|
|
|
|
int projectClassMeeting = BLL.ClassMeetingService.GetCountByTime(projectStartTime, endTime, this.ProjectId);//班前会
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
Model.Manager_CheckSortC checkSort1 = new Model.Manager_CheckSortC
|
|
|
|
|
{
|
|
|
|
|
CheckSortId = SQLHelper.GetNewID(typeof(Model.Manager_CheckSortC)),
|
|
|
|
|
SortIndex = i,
|
|
|
|
|
CheckType = "HSE会议",
|
|
|
|
|
CheckNumber = safetyLeaderGroup + weekMeeting + monthMeeting + specialMeeting + attendMeeting + classMeeting,
|
|
|
|
|
YearCheckNum = yearSafetyLeaderGroup + yearWeekMeeting + yearMonthMeeting + yearSpecialMeeting + yearSpecialMeeting + yearAttendMeeting + yearClassMeeting,
|
|
|
|
|
TotalCheckNum = projectSafetyLeaderGroup + projectWeekMeeting + projectMonthMeeting + projectSpecialMeeting + projectSpecialMeeting + projectAttendMeeting + projectClassMeeting,
|
|
|
|
|
};
|
|
|
|
|
checkSorts.Add(checkSort1);
|
|
|
|
|
i++;
|
|
|
|
|
Model.Manager_CheckSortC checkSort2 = new Model.Manager_CheckSortC
|
|
|
|
|
{
|
|
|
|
|
CheckSortId = SQLHelper.GetNewID(typeof(Model.Manager_CheckSortC)),
|
|
|
|
|
SortIndex = i,
|
|
|
|
|
CheckType = "开工前HSE检查",
|
|
|
|
|
CheckNumber = BLL.Check_CheckWorkService.GetCountByCheckTime(startTime, endTime, this.ProjectId),
|
|
|
|
|
YearCheckNum = BLL.Check_CheckWorkService.GetCountByCheckTime(yearStartTime, endTime, this.ProjectId),
|
|
|
|
|
TotalCheckNum = BLL.Check_CheckWorkService.GetCountByCheckTime(projectStartTime, endTime, this.ProjectId)
|
|
|
|
|
};
|
|
|
|
|
checkSorts.Add(checkSort2);
|
|
|
|
|
i++;
|
|
|
|
|
Model.Manager_CheckSortC checkSort3 = new Model.Manager_CheckSortC
|
|
|
|
|
{
|
|
|
|
|
CheckSortId = SQLHelper.GetNewID(typeof(Model.Manager_CheckSortC)),
|
|
|
|
|
SortIndex = i,
|
|
|
|
|
CheckType = "日巡检",
|
|
|
|
|
CheckNumber = BLL.Check_CheckDayService.GetCountByCheckTime(startTime, endTime, this.ProjectId),
|
|
|
|
|
YearCheckNum = BLL.Check_CheckDayService.GetCountByCheckTime(yearStartTime, endTime, this.ProjectId),
|
|
|
|
|
TotalCheckNum = BLL.Check_CheckDayService.GetCountByCheckTime(projectStartTime, endTime, this.ProjectId)
|
|
|
|
|
};
|
|
|
|
|
checkSorts.Add(checkSort3);
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
|
|
Model.Manager_CheckSortC checkSort4 = new Model.Manager_CheckSortC
|
|
|
|
|
{
|
|
|
|
|
CheckSortId = SQLHelper.GetNewID(typeof(Model.Manager_CheckSortC)),
|
|
|
|
|
SortIndex = i,
|
|
|
|
|
CheckType = "专项检查",
|
|
|
|
|
CheckNumber = BLL.Check_CheckSpecialService.GetCountByCheckTime(startTime, endTime, this.ProjectId),
|
|
|
|
|
YearCheckNum = BLL.Check_CheckSpecialService.GetCountByCheckTime(yearStartTime, endTime, this.ProjectId),
|
|
|
|
|
TotalCheckNum = BLL.Check_CheckSpecialService.GetCountByCheckTime(projectStartTime, endTime, this.ProjectId)
|
|
|
|
|
};
|
|
|
|
|
checkSorts.Add(checkSort4);
|
|
|
|
|
i++;
|
|
|
|
|
Model.Manager_CheckSortC checkSort5 = new Model.Manager_CheckSortC
|
|
|
|
|
{
|
|
|
|
|
CheckSortId = SQLHelper.GetNewID(typeof(Model.Manager_CheckSortC)),
|
|
|
|
|
SortIndex = i,
|
|
|
|
|
CheckType = "节假日前安全检查",
|
|
|
|
|
CheckNumber = BLL.Check_CheckHolidayService.GetCountByCheckTime(startTime, endTime, this.ProjectId),
|
|
|
|
|
YearCheckNum = BLL.Check_CheckHolidayService.GetCountByCheckTime(yearStartTime, endTime, this.ProjectId),
|
|
|
|
|
TotalCheckNum = BLL.Check_CheckHolidayService.GetCountByCheckTime(projectStartTime, endTime, this.ProjectId)
|
|
|
|
|
};
|
|
|
|
|
checkSorts.Add(checkSort5);
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
|
|
Model.Manager_CheckSortC checkSort6 = new Model.Manager_CheckSortC
|
|
|
|
|
{
|
|
|
|
|
CheckSortId = SQLHelper.GetNewID(typeof(Model.Manager_CheckSortC)),
|
|
|
|
|
SortIndex = i,
|
|
|
|
|
CheckType = "文明施工检查",
|
|
|
|
|
CheckNumber = 0,
|
|
|
|
|
YearCheckNum = 0,
|
|
|
|
|
TotalCheckNum = 0
|
|
|
|
|
};
|
|
|
|
|
checkSorts.Add(checkSort6);
|
|
|
|
|
i++;
|
|
|
|
|
Model.Manager_CheckSortC checkSort7 = new Model.Manager_CheckSortC
|
|
|
|
|
{
|
|
|
|
|
CheckSortId = SQLHelper.GetNewID(typeof(Model.Manager_CheckSortC)),
|
|
|
|
|
SortIndex = i,
|
|
|
|
|
CheckType = "联合检查",
|
|
|
|
|
CheckNumber = BLL.Check_CheckColligationService.GetCountByCheckTime(startTime, endTime, this.ProjectId),
|
|
|
|
|
YearCheckNum = BLL.Check_CheckColligationService.GetCountByCheckTime(yearStartTime, endTime, this.ProjectId),
|
|
|
|
|
TotalCheckNum = BLL.Check_CheckColligationService.GetCountByCheckTime(projectStartTime, endTime, this.ProjectId)
|
|
|
|
|
};
|
|
|
|
|
checkSorts.Add(checkSort7);
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
|
|
Model.Manager_CheckSortC checkSort11 = new Model.Manager_CheckSortC
|
|
|
|
|
{
|
|
|
|
|
CheckSortId = SQLHelper.GetNewID(typeof(Model.Manager_CheckSortC)),
|
|
|
|
|
SortIndex = i,
|
|
|
|
|
CheckType = "HSE管理文件/方案发布",
|
|
|
|
|
CheckNumber = BLL.ConstructSolutionService.GetConstructSolutionCountByDate(this.ProjectId, startTime, endTime),
|
|
|
|
|
YearCheckNum = BLL.ConstructSolutionService.GetConstructSolutionCountByDate(this.ProjectId, yearStartTime, endTime),
|
|
|
|
|
TotalCheckNum = BLL.ConstructSolutionService.GetConstructSolutionCountByDate(this.ProjectId, projectStartTime, endTime),
|
|
|
|
|
};
|
|
|
|
|
checkSorts.Add(checkSort11);
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
|
|
this.gvCheckSort.DataSource = checkSorts;
|
|
|
|
|
this.gvCheckSort.DataBind();
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 4.7 HSE奖励与处罚
|
|
|
|
|
private void GetRewardAndPunishSort()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
Model.Manager_RewardAndPunishSortC sortC = new Model.Manager_RewardAndPunishSortC
|
|
|
|
|
{
|
|
|
|
|
RewardAndPunishId = SQLHelper.GetNewID(typeof(Model.Manager_RewardAndPunishSortC)),
|
|
|
|
|
RewardNum = BLL.IncentiveNoticeService.GetCountByDate(startTime, endTime, this.ProjectId),
|
|
|
|
|
RewardMoney = BLL.IncentiveNoticeService.GetSumMoneyByDate(startTime, endTime, this.ProjectId),
|
|
|
|
|
ProjectRewardMoney = BLL.IncentiveNoticeService.GetSumMoneyByDate(projectStartTime, endTime, this.ProjectId),
|
|
|
|
|
PunishNum = BLL.PunishNoticeService.GetCountByDate(startTime, endTime, this.ProjectId),
|
|
|
|
|
PunishMoney = BLL.PunishNoticeService.GetSumMoneyByDate(startTime, endTime, this.ProjectId),
|
|
|
|
|
ProjectPunishMoney = BLL.PunishNoticeService.GetSumMoneyByDate(projectStartTime, endTime, this.ProjectId),
|
|
|
|
|
};
|
|
|
|
|
rewardAndPunishSortCs.Add(sortC);
|
|
|
|
|
|
|
|
|
|
this.gvRewardSortAndPunish.DataSource = rewardAndPunishSortCs;
|
|
|
|
|
this.gvRewardSortAndPunish.DataBind();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void jerqueSavePunishList()
|
|
|
|
|
{
|
|
|
|
|
rewardAndPunishSortCs.Clear();
|
|
|
|
|
JArray mergedData = gvRewardSortAndPunish.GetMergedData();
|
|
|
|
|
foreach (JObject mergedRow in mergedData)
|
|
|
|
|
{
|
|
|
|
|
string status = mergedRow.Value<string>("status");
|
|
|
|
|
JObject values = mergedRow.Value<JObject>("values");
|
|
|
|
|
int i = mergedRow.Value<int>("index");
|
|
|
|
|
Model.Manager_RewardAndPunishSortC punishSort = new Model.Manager_RewardAndPunishSortC
|
|
|
|
|
{
|
|
|
|
|
RewardAndPunishId = this.gvRewardSortAndPunish.Rows[i].DataKeys[0].ToString(),
|
|
|
|
|
RewardNum = Funs.GetNewInt(values.Value<string>("RewardNum").ToString()),
|
|
|
|
|
RewardMoney = Funs.GetNewDecimal(values.Value<string>("RewardMoney").ToString()),
|
|
|
|
|
ProjectRewardMoney = Funs.GetNewDecimal(values.Value<string>("ProjectRewardMoney").ToString()),
|
|
|
|
|
PunishNum = Funs.GetNewInt(values.Value<string>("PunishNum").ToString()),
|
|
|
|
|
PunishMoney = Funs.GetNewDecimal(values.Value<string>("PunishMoney").ToString()),
|
|
|
|
|
ProjectPunishMoney = Funs.GetNewDecimal(values.Value<string>("ProjectPunishMoney").ToString())
|
|
|
|
|
};
|
|
|
|
|
rewardAndPunishSortCs.Add(punishSort);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 4.8HSE现场其他管理情况
|
|
|
|
|
#region 其他HSE管理情况
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 增加其他HSE管理情况
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void btnNewOtherManagement_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
jerqueSaveOtherManagementList();
|
|
|
|
|
Model.Manager_Month_OtherManagementC otherManagementSort = new Model.Manager_Month_OtherManagementC
|
|
|
|
|
{
|
|
|
|
|
OtherManagementId = SQLHelper.GetNewID(typeof(Model.Manager_Month_OtherManagementC))
|
|
|
|
|
};
|
|
|
|
|
otherManagements.Add(otherManagementSort);
|
|
|
|
|
this.gvOtherManagement.DataSource = otherManagements;
|
|
|
|
|
this.gvOtherManagement.DataBind();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 检查并保存其他HSE管理情况集合
|
|
|
|
|
/// </summary>
|
|
|
|
|
private void jerqueSaveOtherManagementList()
|
|
|
|
|
{
|
|
|
|
|
otherManagements.Clear();
|
|
|
|
|
JArray mergedData = gvOtherManagement.GetMergedData();
|
|
|
|
|
foreach (JObject mergedRow in mergedData)
|
|
|
|
|
{
|
|
|
|
|
string status = mergedRow.Value<string>("status");
|
|
|
|
|
JObject values = mergedRow.Value<JObject>("values");
|
|
|
|
|
int i = mergedRow.Value<int>("index");
|
|
|
|
|
Model.Manager_Month_OtherManagementC otherManagementSort = new Model.Manager_Month_OtherManagementC
|
|
|
|
|
{
|
|
|
|
|
OtherManagementId = this.gvOtherManagement.Rows[i].DataKeys[0].ToString(),
|
|
|
|
|
SortIndex = i,
|
|
|
|
|
ManagementDes = values.Value<string>("ManagementDes").ToString()
|
|
|
|
|
};
|
|
|
|
|
otherManagements.Add(otherManagementSort);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected void gvOtherManagement_RowCommand(object sender, GridCommandEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
jerqueSaveOtherManagementList();
|
|
|
|
|
string rowID = this.gvOtherManagement.DataKeys[e.RowIndex][0].ToString();
|
|
|
|
|
if (e.CommandName == "Delete")
|
|
|
|
|
{
|
|
|
|
|
foreach (var item in otherManagements)
|
|
|
|
|
{
|
|
|
|
|
if (item.OtherManagementId == rowID)
|
|
|
|
|
{
|
|
|
|
|
otherManagements.Remove(item);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
gvOtherManagement.DataSource = otherManagements;
|
|
|
|
|
gvOtherManagement.DataBind();
|
|
|
|
|
ShowNotify("删除数据成功!", MessageBoxIcon.Success);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 5.1
|
|
|
|
|
private void GetFiveExpenseList() {
|
|
|
|
|
#region 五环(本月)
|
|
|
|
|
decimal? sMonthType1 = 0, sMonthType2 = 0, sMonthType3 = 0, sMonthType4 = 0, sMonthType5 = 0,
|
|
|
|
|
sMonthType6 = 0, sMonthType7 = 0, sMonthType8 = 0, sMonthType9 = 0, sMonthType10 = 0;
|
|
|
|
|
|
|
|
|
|
var payRegistrations = BLL.HseExpenseService.GetPayRegistrationByPayDate(startTime, endTime, this.ProjectId, BLL.Const.UnitId_CWCEC);
|
|
|
|
|
if (payRegistrations != null)
|
|
|
|
|
{
|
|
|
|
|
sMonthType1 += payRegistrations.Sum(x => x.SMonthType1) ?? 0;
|
|
|
|
|
sMonthType2 += payRegistrations.Sum(x => x.SMonthType2) ?? 0;
|
|
|
|
|
sMonthType3 += payRegistrations.Sum(x => x.SMonthType3) ?? 0;
|
|
|
|
|
sMonthType4 += payRegistrations.Sum(x => x.SMonthType4) ?? 0;
|
|
|
|
|
sMonthType5 += payRegistrations.Sum(x => x.SMonthType5) ?? 0;
|
|
|
|
|
sMonthType6 += payRegistrations.Sum(x => x.SMonthType6) ?? 0;
|
|
|
|
|
sMonthType7 += payRegistrations.Sum(x => x.SMonthType7) ?? 0;
|
|
|
|
|
sMonthType8 += payRegistrations.Sum(x => x.SMonthType8) ?? 0;
|
|
|
|
|
sMonthType9 += payRegistrations.Sum(x => x.SMonthType9) ?? 0;
|
|
|
|
|
sMonthType10 += payRegistrations.Sum(x => x.SMonthType10) ?? 0;
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 五环(项目)
|
|
|
|
|
decimal? sProjectType1 = 0, sProjectType2 = 0, sProjectType3 = 0, sProjectType4 = 0, sProjectType5 = 0,
|
|
|
|
|
sProjectType6 = 0, sProjectType7 = 0, sProjectType8 = 0, sProjectType9 = 0, sProjectType10 = 0;
|
|
|
|
|
|
|
|
|
|
var payRegistrationsPro = BLL.PayRegistrationService.GetPayRegistrationByPayDate(projectStartTime, endTime, this.ProjectId, BLL.Const.UnitId_CWCEC);
|
|
|
|
|
if (payRegistrationsPro != null)
|
|
|
|
|
{
|
|
|
|
|
sProjectType1 += payRegistrations.Sum(x => x.SMonthType1) ?? 0;
|
|
|
|
|
sProjectType2 += payRegistrations.Sum(x => x.SMonthType2) ?? 0;
|
|
|
|
|
sProjectType3 += payRegistrations.Sum(x => x.SMonthType3) ?? 0;
|
|
|
|
|
sProjectType4 += payRegistrations.Sum(x => x.SMonthType4) ?? 0;
|
|
|
|
|
sProjectType5 += payRegistrations.Sum(x => x.SMonthType5) ?? 0;
|
|
|
|
|
sProjectType6 += payRegistrations.Sum(x => x.SMonthType6) ?? 0;
|
|
|
|
|
sProjectType7 += payRegistrations.Sum(x => x.SMonthType7) ?? 0;
|
|
|
|
|
sProjectType8 += payRegistrations.Sum(x => x.SMonthType8) ?? 0;
|
|
|
|
|
sProjectType9 += payRegistrations.Sum(x => x.SMonthType9) ?? 0;
|
|
|
|
|
sProjectType10 += payRegistrations.Sum(x => x.SMonthType10) ?? 0;
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 施工分包(本月)
|
|
|
|
|
decimal? sConMonthType1 = 0, sConMonthType2 = 0, sConMonthType3 = 0, sConMonthType4 = 0, sConMonthType5 = 0,
|
|
|
|
|
sConMonthType6 = 0, sConMonthType7 = 0, sConMonthType8 = 0, sConMonthType9 = 0, sConMonthType10 = 0;
|
|
|
|
|
|
|
|
|
|
var payRegistrationsConMonth = BLL.PayRegistrationService.GetConPayRegistrationByPayDate(startTime, endTime, this.ProjectId);
|
|
|
|
|
if (payRegistrationsConMonth != null)
|
|
|
|
|
{
|
|
|
|
|
sConMonthType1 += payRegistrations.Sum(x => x.SMonthType1) ?? 0;
|
|
|
|
|
sConMonthType2 += payRegistrations.Sum(x => x.SMonthType2) ?? 0;
|
|
|
|
|
sConMonthType3 += payRegistrations.Sum(x => x.SMonthType3) ?? 0;
|
|
|
|
|
sConMonthType4 += payRegistrations.Sum(x => x.SMonthType4) ?? 0;
|
|
|
|
|
sConMonthType5 += payRegistrations.Sum(x => x.SMonthType5) ?? 0;
|
|
|
|
|
sConMonthType6 += payRegistrations.Sum(x => x.SMonthType6) ?? 0;
|
|
|
|
|
sConMonthType7 += payRegistrations.Sum(x => x.SMonthType7) ?? 0;
|
|
|
|
|
sConMonthType8 += payRegistrations.Sum(x => x.SMonthType8) ?? 0;
|
|
|
|
|
sConMonthType9 += payRegistrations.Sum(x => x.SMonthType9) ?? 0;
|
|
|
|
|
sConMonthType10 += payRegistrations.Sum(x => x.SMonthType10) ?? 0;
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 施工分包(项目)
|
|
|
|
|
decimal? sConProjectType1 = 0, sConProjectType2 = 0, sConProjectType3 = 0, sConProjectType4 = 0, sConProjectType5 = 0,
|
|
|
|
|
sConProjectType6 = 0, sConProjectType7 = 0, sConProjectType8 = 0, sConProjectType9 = 0, sConProjectType10 = 0;
|
|
|
|
|
|
|
|
|
|
var payRegistrationsConPro = BLL.PayRegistrationService.GetConPayRegistrationByPayDate(projectStartTime, endTime, this.ProjectId);
|
|
|
|
|
if (payRegistrationsConPro != null)
|
|
|
|
|
{
|
|
|
|
|
sConProjectType1 += payRegistrations.Sum(x => x.SMonthType1) ?? 0;
|
|
|
|
|
sConProjectType2 += payRegistrations.Sum(x => x.SMonthType2) ?? 0;
|
|
|
|
|
sConProjectType3 += payRegistrations.Sum(x => x.SMonthType3) ?? 0;
|
|
|
|
|
sConProjectType4 += payRegistrations.Sum(x => x.SMonthType4) ?? 0;
|
|
|
|
|
sConProjectType5 += payRegistrations.Sum(x => x.SMonthType5) ?? 0;
|
|
|
|
|
sConProjectType6 += payRegistrations.Sum(x => x.SMonthType6) ?? 0;
|
|
|
|
|
sConProjectType7 += payRegistrations.Sum(x => x.SMonthType7) ?? 0;
|
|
|
|
|
sConProjectType8 += payRegistrations.Sum(x => x.SMonthType8) ?? 0;
|
|
|
|
|
sConProjectType9 += payRegistrations.Sum(x => x.SMonthType9) ?? 0;
|
|
|
|
|
sConProjectType10 += payRegistrations.Sum(x => x.SMonthType10) ?? 0;
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
int i = 0;
|
|
|
|
|
var fiveExpense1 = new Model.Manager_Month_FiveExpenseC
|
|
|
|
|
{
|
|
|
|
|
FiveExpenseId = SQLHelper.GetNewID(typeof(Model.Manager_Month_FiveExpenseC)),
|
|
|
|
|
SortIndex = i,
|
|
|
|
|
InvestmentProject = "完善、改造和维护安全防护设备、设施",
|
|
|
|
|
PlanCostMonth = sMonthType1,//五环工程(本月)
|
|
|
|
|
PlanCostYear = sProjectType1, //五环工程(项目累计)
|
|
|
|
|
ActualCostMonth = sConMonthType1,//施工分包商(本月)
|
|
|
|
|
ActualCostYear = sConProjectType1//施工分包商(项目累计)
|
|
|
|
|
};
|
|
|
|
|
fiveExpenses.Add(fiveExpense1);
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
|
|
fiveExpense1 = new Model.Manager_Month_FiveExpenseC
|
|
|
|
|
{
|
|
|
|
|
FiveExpenseId = SQLHelper.GetNewID(typeof(Model.Manager_Month_FiveExpenseC)),
|
|
|
|
|
SortIndex = i,
|
|
|
|
|
InvestmentProject = "应急救援和演练",
|
|
|
|
|
PlanCostMonth = sMonthType2,//五环工程(本月)
|
|
|
|
|
PlanCostYear = sProjectType2, //五环工程(项目累计)
|
|
|
|
|
ActualCostMonth = sConMonthType2,//施工分包商(本月)
|
|
|
|
|
ActualCostYear = sConProjectType2//施工分包商(项目累计)
|
|
|
|
|
};
|
|
|
|
|
fiveExpenses.Add(fiveExpense1);
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
|
|
fiveExpense1 = new Model.Manager_Month_FiveExpenseC
|
|
|
|
|
{
|
|
|
|
|
FiveExpenseId = SQLHelper.GetNewID(typeof(Model.Manager_Month_FiveExpenseC)),
|
|
|
|
|
SortIndex = i,
|
|
|
|
|
InvestmentProject = "重大危险源管理;隐患整改;安全生产信息化",
|
|
|
|
|
PlanCostMonth = sMonthType3,//五环工程(本月)
|
|
|
|
|
PlanCostYear = sProjectType3, //五环工程(项目累计)
|
|
|
|
|
ActualCostMonth = sConMonthType3,//施工分包商(本月)
|
|
|
|
|
ActualCostYear = sConProjectType3//施工分包商(项目累计)
|
|
|
|
|
};
|
|
|
|
|
fiveExpenses.Add(fiveExpense1);
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
|
|
fiveExpense1 = new Model.Manager_Month_FiveExpenseC
|
|
|
|
|
{
|
|
|
|
|
FiveExpenseId = SQLHelper.GetNewID(typeof(Model.Manager_Month_FiveExpenseC)),
|
|
|
|
|
SortIndex = i,
|
|
|
|
|
InvestmentProject = "安全检查、评估评价、咨询与标准化建设",
|
|
|
|
|
PlanCostMonth = sMonthType4,//五环工程(本月)
|
|
|
|
|
PlanCostYear = sProjectType4, //五环工程(项目累计)
|
|
|
|
|
ActualCostMonth = sConMonthType4,//施工分包商(本月)
|
|
|
|
|
ActualCostYear = sConProjectType4//施工分包商(项目累计)
|
|
|
|
|
};
|
|
|
|
|
fiveExpenses.Add(fiveExpense1);
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
|
|
fiveExpense1 = new Model.Manager_Month_FiveExpenseC
|
|
|
|
|
{
|
|
|
|
|
FiveExpenseId = SQLHelper.GetNewID(typeof(Model.Manager_Month_FiveExpenseC)),
|
|
|
|
|
SortIndex = i,
|
|
|
|
|
InvestmentProject = "作业人员防护用品",
|
|
|
|
|
PlanCostMonth = sMonthType5,//五环工程(本月)
|
|
|
|
|
PlanCostYear = sProjectType5, //五环工程(项目累计)
|
|
|
|
|
ActualCostMonth = sConMonthType5,//施工分包商(本月)
|
|
|
|
|
ActualCostYear = sConProjectType5//施工分包商(项目累计)
|
|
|
|
|
};
|
|
|
|
|
fiveExpenses.Add(fiveExpense1);
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
|
|
fiveExpense1 = new Model.Manager_Month_FiveExpenseC
|
|
|
|
|
{
|
|
|
|
|
FiveExpenseId = SQLHelper.GetNewID(typeof(Model.Manager_Month_FiveExpenseC)),
|
|
|
|
|
SortIndex = i,
|
|
|
|
|
InvestmentProject = "安全生产宣传、教育、培训及奖励",
|
|
|
|
|
PlanCostMonth = sMonthType6,//五环工程(本月)
|
|
|
|
|
PlanCostYear = sProjectType6, //五环工程(项目累计)
|
|
|
|
|
ActualCostMonth = sConMonthType6,//施工分包商(本月)
|
|
|
|
|
ActualCostYear = sConProjectType6//施工分包商(项目累计)
|
|
|
|
|
};
|
|
|
|
|
fiveExpenses.Add(fiveExpense1);
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
|
|
fiveExpense1 = new Model.Manager_Month_FiveExpenseC
|
|
|
|
|
{
|
|
|
|
|
FiveExpenseId = SQLHelper.GetNewID(typeof(Model.Manager_Month_FiveExpenseC)),
|
|
|
|
|
SortIndex = i,
|
|
|
|
|
InvestmentProject = "“四新”推广应用支出",
|
|
|
|
|
PlanCostMonth = sMonthType7,//五环工程(本月)
|
|
|
|
|
PlanCostYear = sProjectType7, //五环工程(项目累计)
|
|
|
|
|
ActualCostMonth = sConMonthType7,//施工分包商(本月)
|
|
|
|
|
ActualCostYear = sConProjectType7//施工分包商(项目累计)
|
|
|
|
|
};
|
|
|
|
|
fiveExpenses.Add(fiveExpense1);
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
|
|
fiveExpense1 = new Model.Manager_Month_FiveExpenseC
|
|
|
|
|
{
|
|
|
|
|
FiveExpenseId = SQLHelper.GetNewID(typeof(Model.Manager_Month_FiveExpenseC)),
|
|
|
|
|
SortIndex = i,
|
|
|
|
|
InvestmentProject = "安全设施及特种设备检测检验、检定校准",
|
|
|
|
|
PlanCostMonth = sMonthType8,//五环工程(本月)
|
|
|
|
|
PlanCostYear = sProjectType8, //五环工程(项目累计)
|
|
|
|
|
ActualCostMonth = sConMonthType8,//施工分包商(本月)
|
|
|
|
|
ActualCostYear = sConProjectType8//施工分包商(项目累计)
|
|
|
|
|
};
|
|
|
|
|
fiveExpenses.Add(fiveExpense1);
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
|
|
fiveExpense1 = new Model.Manager_Month_FiveExpenseC
|
|
|
|
|
{
|
|
|
|
|
FiveExpenseId = SQLHelper.GetNewID(typeof(Model.Manager_Month_FiveExpenseC)),
|
|
|
|
|
SortIndex = i,
|
|
|
|
|
InvestmentProject = "安全生产责任保险",
|
|
|
|
|
PlanCostMonth = sMonthType9,//五环工程(本月)
|
|
|
|
|
PlanCostYear = sProjectType9, //五环工程(项目累计)
|
|
|
|
|
ActualCostMonth = sConMonthType9,//施工分包商(本月)
|
|
|
|
|
ActualCostYear = sConProjectType9//施工分包商(项目累计)
|
|
|
|
|
};
|
|
|
|
|
fiveExpenses.Add(fiveExpense1);
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
|
|
fiveExpense1 = new Model.Manager_Month_FiveExpenseC
|
|
|
|
|
{
|
|
|
|
|
FiveExpenseId = SQLHelper.GetNewID(typeof(Model.Manager_Month_FiveExpenseC)),
|
|
|
|
|
SortIndex = i,
|
|
|
|
|
InvestmentProject = "其他与安全生产直接相关的支出",
|
|
|
|
|
PlanCostMonth = sMonthType10,//五环工程(本月)
|
|
|
|
|
PlanCostYear = sProjectType10, //五环工程(项目累计)
|
|
|
|
|
ActualCostMonth = sConMonthType10,//施工分包商(本月)
|
|
|
|
|
ActualCostYear = sConProjectType10//施工分包商(项目累计)
|
|
|
|
|
};
|
|
|
|
|
fiveExpenses.Add(fiveExpense1);
|
|
|
|
|
i++;
|
|
|
|
|
this.gvFiveExpenseC.DataSource = fiveExpenses;
|
|
|
|
|
this.gvFiveExpenseC.DataBind();
|
|
|
|
|
|
|
|
|
|
OutputgvFiveExpenseCSummaryData();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 求和
|
|
|
|
|
/// </summary>
|
|
|
|
|
private void OutputgvFiveExpenseCSummaryData()
|
|
|
|
|
{
|
|
|
|
|
JObject summary = new JObject();
|
|
|
|
|
|
|
|
|
|
decimal TotalPlanCostMonth = 0, TotalPlanCostYear = 0, TotalActualCostMonth = 0, TotalActualCostYear = 0;
|
|
|
|
|
foreach (JObject mergedRow in gvFiveExpenseC.GetMergedData())
|
|
|
|
|
{
|
|
|
|
|
JObject values = mergedRow.Value<JObject>("values");
|
|
|
|
|
if (!string.IsNullOrEmpty(values["PlanCostMonth"].ToString()))
|
|
|
|
|
{
|
|
|
|
|
TotalPlanCostMonth += values.Value<decimal>("PlanCostMonth");
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(values["PlanCostYear"].ToString()))
|
|
|
|
|
{
|
|
|
|
|
TotalPlanCostYear += values.Value<decimal>("PlanCostYear");
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(values["ActualCostMonth"].ToString()))
|
|
|
|
|
{
|
|
|
|
|
TotalActualCostMonth += values.Value<decimal>("ActualCostMonth");
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(values["ActualCostYear"].ToString()))
|
|
|
|
|
{
|
|
|
|
|
TotalActualCostYear += values.Value<decimal>("ActualCostYear");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
summary.Add("InvestmentProject", "合计");
|
|
|
|
|
summary.Add("PlanCostMonth", TotalPlanCostMonth.ToString("F2"));
|
|
|
|
|
summary.Add("PlanCostYear", TotalPlanCostYear.ToString("F2"));
|
|
|
|
|
summary.Add("ActualCostMonth", TotalActualCostMonth.ToString("F2"));
|
|
|
|
|
summary.Add("ActualCostYear", TotalActualCostYear.ToString("F2"));
|
|
|
|
|
|
|
|
|
|
gvFiveExpenseC.SummaryData = summary;
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 转换字符串
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 把单位Id转换为单位名称
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="UnitId"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
protected string ConvertUnitName(object UnitId)
|
|
|
|
|
{
|
|
|
|
|
if (UnitId != null)
|
|
|
|
|
{
|
|
|
|
|
var u = unitList.FirstOrDefault(x => x.UnitId == UnitId.ToString());
|
|
|
|
|
if (u != null)
|
|
|
|
|
{
|
|
|
|
|
return u.UnitName;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
2024-08-21 16:47:57 +08:00
|
|
|
|
}
|
|
|
|
|
}
|