2023-03-31 报表升级

This commit is contained in:
2023-03-31 10:21:00 +08:00
parent 5acee68633
commit 5ee3b089b7
175 changed files with 68864 additions and 2056 deletions
@@ -14,10 +14,10 @@ namespace FineUIPro.Web.ZHGL.Information
{
if (!IsPostBack)
{
BLL.ConstValue.InitConstValueDropDownList(this.drpMonth, ConstValue.Group_0009, false);
BLL.ConstValue.InitConstValueDropDownList(this.drpYear, ConstValue.Group_0008, false);
this.drpUnit.DataTextField = "UnitName";
drpUnit.DataValueField = "UnitId";
drpUnit.DataSource = BLL.UnitService.GetThisUnitDropDownList();
@@ -37,7 +37,7 @@ namespace FineUIPro.Web.ZHGL.Information
lbUnitName.Text = "填报企业:";
lbFillingDate.Text = "填报日期:";
lbDutyPerson.Text = "负责人:";
lbRecordableIncidentRate.Text = "百万工时总可记录事率:";
lbRecordableIncidentRate.Text = "百万工时总可记录事率:";
lbLostTimeRate.Text = "百万工时损失工时率:";
lbLostTimeInjuryRate.Text = "百万工时损失工时伤害事故率:";
lbDeathAccidentFrequency.Text = "百万工时死亡事故频率:";
@@ -65,7 +65,7 @@ namespace FineUIPro.Web.ZHGL.Information
{
upState = "(未上报)";
}
this.SimpleForm1.Title = "企业百万工时安全统计月报" + report.MonthStr + report.YearStr + upState;
this.SimpleForm1.Title = "企业企业安全数据统计月报" + report.MonthStr + report.YearStr + upState;
lbUnitName.Text = "填报企业:" + report.UnitName;
if (report.FillingDate != null)
{
@@ -85,7 +85,7 @@ namespace FineUIPro.Web.ZHGL.Information
this.lbHandleMan.Hidden = false;
lbHandleMan.Text = "下一步办理人:" + report.UserName;
}
lbRecordableIncidentRate.Text = "百万工时总可记录事率:" + (report.RecordableIncidentRate ?? 0).ToString();
lbRecordableIncidentRate.Text = "百万工时总可记录事率:" + (report.RecordableIncidentRate ?? 0).ToString();
lbLostTimeRate.Text = "百万工时损失工时率:" + (report.LostTimeRate ?? 0).ToString();
lbLostTimeInjuryRate.Text = "百万工时损失工时伤害事故率:" + (report.LostTimeInjuryRate ?? 0).ToString();
lbDeathAccidentFrequency.Text = "百万工时死亡事故频率:" + (report.DeathAccidentFrequency ?? 0).ToString();
@@ -109,17 +109,17 @@ namespace FineUIPro.Web.ZHGL.Information
yearTotalItem.SeriousInjuriesPersonNum = yearSumItems.Sum(x => x.SeriousInjuriesPersonNum ?? 0);
yearTotalItem.SeriousInjuriesLossHour = yearSumItems.Sum(x => x.SeriousInjuriesLossHour ?? 0);
yearTotalItem.MinorAccidentNum = yearSumItems.Sum(x => x.MinorAccidentNum ?? 0);
yearTotalItem.MinorAccidentPersonNum = yearSumItems.Sum(x => x.MinorAccidentPersonNum ?? 0);
yearTotalItem.MinorAccidentPersonNum = yearSumItems.Sum(x => x.MinorAccidentPersonNum ?? 0);
yearTotalItem.MinorAccidentLossHour = yearSumItems.Sum(x => x.MinorAccidentLossHour ?? 0);
yearTotalItem.OtherAccidentNum = yearSumItems.Sum(x => x.OtherAccidentNum ?? 0);
yearTotalItem.OtherAccidentPersonNum = yearSumItems.Sum(x => x.OtherAccidentPersonNum ?? 0);
yearTotalItem.OtherAccidentLossHour = yearSumItems.Sum(x => x.OtherAccidentLossHour ?? 0);
yearTotalItem.DeathAccidentNum = yearSumItems.Sum(x => x.DeathAccidentNum ?? 0);
yearTotalItem.DeathAccidentPersonNum = yearSumItems.Sum(x => x.DeathAccidentPersonNum ?? 0);
yearTotalItem.DeathAccidentLossHour = yearSumItems.Sum(x => x.DeathAccidentLossHour ?? 0);
yearTotalItem.RestrictedWorkPersonNum = yearSumItems.Sum(x => x.RestrictedWorkPersonNum ?? 0);
yearTotalItem.RestrictedWorkLossHour = yearSumItems.Sum(x => x.RestrictedWorkLossHour ?? 0);
yearTotalItem.MedicalTreatmentPersonNum = yearSumItems.Sum(x => x.MedicalTreatmentPersonNum ?? 0);
yearTotalItem.MedicalTreatmentLossHour = yearSumItems.Sum(x => x.MedicalTreatmentLossHour ?? 0);
yearTotalItem.FireNum = yearSumItems.Sum(x => x.FireNum ?? 0);
yearTotalItem.ExplosionNum = yearSumItems.Sum(x => x.ExplosionNum ?? 0);
yearTotalItem.EnvironmenNum = yearSumItems.Sum(x => x.EnvironmenNum ?? 0);
yearTotalItem.TrafficNum = yearSumItems.Sum(x => x.TrafficNum ?? 0);
yearTotalItem.EquipmentNum = yearSumItems.Sum(x => x.EquipmentNum ?? 0);
yearTotalItem.QualityNum = yearSumItems.Sum(x => x.QualityNum ?? 0);
@@ -140,6 +140,9 @@ namespace FineUIPro.Web.ZHGL.Information
Grid1.Rows[Grid1.Rows.Count - 1].Values[0] = "";
Grid1.Rows[Grid1.Rows.Count - 1].Values[1] = "";
}
var report2 = from x in Funs.DB.Information_MillionsMonthlyReport where x.MillionsMonthlyReportId== report.MillionsMonthlyReportId select x;
Grid2.DataSource = report2;
Grid2.DataBind();
}
else
{
@@ -177,7 +180,7 @@ namespace FineUIPro.Web.ZHGL.Information
/// <param name="e"></param>
protected void Window4_Close(object sender, WindowCloseEventArgs e)
{
GetValue();
}
#endregion
@@ -225,27 +228,31 @@ namespace FineUIPro.Web.ZHGL.Information
{
this.btnPrint.Hidden = false;
}
Model.Information_MillionsMonthlyReport report = BLL.MillionsMonthlyReportService.GetMillionsMonthlyReportByUnitIdAndYearAndMonth(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue));
this.btnAudit1.Hidden = true;
this.btnAudit2.Hidden = true;
this.btnUpdata.Hidden = true;
if (report != null)
}
var getReport = BLL.MillionsMonthlyReportService.GetMillionsMonthlyReportByUnitIdAndYearAndMonth(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue));
this.btnAudit1.Hidden = true;
this.btnAudit2.Hidden = true;
this.btnUpdata.Hidden = true;
if (getReport != null)
{
this.btnNew.Hidden = true;
if (getReport.HandleMan == this.CurrUser.UserId) //当前人是下一步办理入
{
this.btnNew.Hidden = true;
if (report.HandleMan == this.CurrUser.UserId) //当前人是下一步办理入
if (getReport.HandleState == BLL.Const.HandleState_2)
{
if (report.HandleState == BLL.Const.HandleState_2)
{
this.btnAudit1.Hidden = false;
}
else if (report.HandleState == BLL.Const.HandleState_3)
{
this.btnAudit2.Hidden = false;
}
else if (report.HandleState == BLL.Const.HandleState_4)
{
this.btnUpdata.Hidden = false;
}
this.btnAudit1.Hidden = false;
this.btnEdit.Hidden = true;
}
else if (getReport.HandleState == BLL.Const.HandleState_3)
{
this.btnAudit2.Hidden = false;
this.btnEdit.Hidden = true;
}
else if (getReport.HandleState == BLL.Const.HandleState_4)
{
this.btnUpdata.Hidden = false;
this.btnEdit.Hidden = true;
}
}
}
@@ -349,7 +356,7 @@ namespace FineUIPro.Web.ZHGL.Information
BLL.ProjectDataFlowSetService.DeleteFlowSetByDataId(report.MillionsMonthlyReportId);
BLL.MillionsMonthlyReportItemService.DeleteMillionsMonthlyReportItemByMillionsMonthlyReportId(report.MillionsMonthlyReportId);
BLL.MillionsMonthlyReportService.DeleteMillionsMonthlyReportByMillionsMonthlyReportId(report.MillionsMonthlyReportId);
SetEmpty();
this.btnNew.Hidden = false;
ShowNotify("删除数据成功!", MessageBoxIcon.Success);
@@ -406,7 +413,7 @@ namespace FineUIPro.Web.ZHGL.Information
var units = BLL.UnitService.GetUnitDropDownList();
if (units != null && !string.IsNullOrEmpty(this.drpUnit.SelectedText))
{
var unit = units.FirstOrDefault(x => x.UnitName.Contains(this.drpUnit.SelectedText));
var unit = units.FirstOrDefault(x => x.UnitName == this.drpUnit.SelectedText);
if (unit != null)
{
drpUnit.SelectedValue = unit.UnitId;
@@ -440,7 +447,7 @@ namespace FineUIPro.Web.ZHGL.Information
Model.Information_MillionsMonthlyReport report = BLL.MillionsMonthlyReportService.GetMillionsMonthlyReportByUnitIdAndYearAndMonth(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue));
if (report != null)
{
PageContext.RegisterStartupScript(Window3.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?reportId={0}&&replaceParameter={1}&&varValue={2}", Const.Information_MillionsMonthlyReportId, report.MillionsMonthlyReportId, "", "打印 - ")));
PageContext.RegisterStartupScript(Window5.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?reportId={0}&&replaceParameter={1}&&varValue={2}", Const.Information_MillionsMonthlyReportId, report.MillionsMonthlyReportId, "", "打印 - ")));
}
}
#endregion
@@ -521,8 +528,8 @@ namespace FineUIPro.Web.ZHGL.Information
protected void btnOut_Click(object sender, EventArgs e)
{
Response.ClearContent();
string filename = Funs.GetNewFileName();
Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("百万工时安全统计月报" + filename, System.Text.Encoding.UTF8) + ".xls");
string filename = Funs.GetNewFileName();
Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("企业安全数据统计月报" + filename, System.Text.Encoding.UTF8) + ".xls");
Response.ContentType = "application/excel";
Response.ContentEncoding = System.Text.Encoding.UTF8;
Response.Write(GetGridTableHtml(Grid1));
@@ -539,16 +546,17 @@ namespace FineUIPro.Web.ZHGL.Information
{
StringBuilder sb = new StringBuilder();
MultiHeaderTable mht = new MultiHeaderTable();
mht.ResolveMultiHeaderTable(Grid1.Columns);
sb.Append("<meta http-equiv=\"content-type\" content=\"application/excel; charset=UTF-8\"/>");
sb.Append("<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">");
mht.ResolveMultiHeaderTable(Grid1.Columns);
sb.Append("<meta http-equiv=\"content-type\" content=\"application/excel; charset=UTF-8\"/>");
sb.Append("<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">");
foreach (List<object[]> rows in mht.MultiTable)
{
sb.Append("<tr>");
foreach (object[] cell in rows)
{ int rowspan = Convert.ToInt32(cell[0]);
int colspan = Convert.ToInt32(cell[1]);
GridColumn column = cell[2] as GridColumn;
foreach (object[] cell in rows)
{
int rowspan = Convert.ToInt32(cell[0]);
int colspan = Convert.ToInt32(cell[1]);
GridColumn column = cell[2] as GridColumn;
sb.AppendFormat("<th{0}{1}{2}>{3}</th>",
rowspan != 1 ? " rowspan=\"" + rowspan + "\"" : "",
@@ -556,11 +564,11 @@ namespace FineUIPro.Web.ZHGL.Information
colspan != 1 ? " style=\"text-align:center;\"" : "",
column.HeaderText);
}
sb.Append("</tr>");
sb.Append("</tr>");
}
foreach (GridRow row in grid.Rows)
{
sb.Append("<tr>");
foreach (GridRow row in grid.Rows)
{
sb.Append("<tr>");
foreach (GridColumn column in mht.Columns)
{
string html = row.Values[column.ColumnIndex].ToString();
@@ -568,11 +576,11 @@ namespace FineUIPro.Web.ZHGL.Information
{
html = (row.FindControl("lblNumber") as AspNet.Label).Text;
}
sb.AppendFormat("<td>{0}</td>", html);
}
sb.Append("</tr>");
}
sb.Append("</table>");
sb.AppendFormat("<td>{0}</td>", html);
}
sb.Append("</tr>");
}
sb.Append("</table>");
return sb.ToString();
}
@@ -728,7 +736,7 @@ namespace FineUIPro.Web.ZHGL.Information
info += item.ProjectCode + ":" + item.ProjectName + ",未填写报表;</br>";
}
else
{
{
if (millionsMonthlyReport.States != BLL.Const.State_2)
{
info += item.ProjectCode + ":" + item.ProjectName + "报表未报;";