建筑行业报表

This commit is contained in:
geh
2025-09-02 10:13:15 +08:00
parent 1cce9ee9e2
commit 5c2ca7b809
26 changed files with 1013 additions and 666 deletions
@@ -16,17 +16,24 @@ namespace FineUIPro.Web.ZHGL.Environmental
if (!IsPostBack)
{
BLL.ConstValue.InitConstValueDropDownList(this.drpQuarters, ConstValue.Group_0011, false);
BLL.ConstValue.InitConstValueDropDownList(this.drpMonth, ConstValue.Group_0009, false);
BLL.ConstValue.InitConstValueDropDownList(this.drpYear, ConstValue.Group_0008, false);
if (this.CurrUser.UserId == BLL.Const.hfnbdId)
{
this.btnState.Hidden = false;
}
else
{
this.btnState.Hidden = true;
}
this.drpUnit.DataTextField = "UnitName";
drpUnit.DataValueField = "UnitId";
drpUnit.DataSource = BLL.UnitService.GetThisUnitDropDownList();
drpUnit.DataBind();
this.drpUnit.Readonly = true;
////取上个报表时间
DateTime showDate = System.DateTime.Now.AddMonths(-3);
this.drpQuarters.SelectedValue = Funs.GetNowQuarterlyByTime(showDate).ToString();
DateTime showDate = System.DateTime.Now.AddMonths(-1);
drpMonth.SelectedValue = showDate.Month.ToString();
drpYear.SelectedValue = showDate.Year.ToString();
GetValue();
}
@@ -48,8 +55,8 @@ namespace FineUIPro.Web.ZHGL.Environmental
private void GetValue()
{
int year = Funs.GetNewIntOrZero(drpYear.SelectedValue);
int Quarters = Funs.GetNewIntOrZero(drpQuarters.SelectedValue);
Model.Environmental_ArchitectureReport r = Funs.DB.Environmental_ArchitectureReport.FirstOrDefault(e => e.UnitId == drpUnit.SelectedValue && e.Quarters == Quarters && e.Year == year);
int month = Funs.GetNewIntOrZero(drpMonth.SelectedValue);
Model.Environmental_ArchitectureReport r = Funs.DB.Environmental_ArchitectureReport.FirstOrDefault(e => e.UnitId == drpUnit.SelectedValue && e.Month == month && e.Year == year);
if (r != null && r.UpState != BLL.Const.UpState_5)
{
string cncecAPIUrl = string.Empty;
@@ -62,7 +69,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
{
try
{
string getUrl = cncecAPIUrl + "/api/InformationData/GetArchitectureAuditState" + "?unitId=" + CommonService.GetThisUnitId() + "&year=" + year + "&quarters=" + Quarters;
string getUrl = cncecAPIUrl + "/api/InformationData/GetArchitectureAuditState" + "?unitId=" + CommonService.GetThisUnitId() + "&year=" + year + "&month=" + month;
var strJosn = APIGetHttpService.Http(getUrl);
if (!string.IsNullOrEmpty(strJosn))
{
@@ -79,7 +86,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
}
}
}
Model.View_Environmental_ArchitectureReport report = Funs.DB.View_Environmental_ArchitectureReport.FirstOrDefault(e => e.UnitId == drpUnit.SelectedValue && e.Quarters == Quarters && e.Year == year);
Model.View_Environmental_ArchitectureReport report = Funs.DB.View_Environmental_ArchitectureReport.FirstOrDefault(e => e.UnitId == drpUnit.SelectedValue && e.Month == month && e.Year == year);
if (report != null)
{
string upState = string.Empty;
@@ -95,7 +102,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
{
upState = "(未上报)";
}
this.SimpleForm1.Title = "企业建筑行业能源节约与生态环境保护汇总表" + report.QuartersStr + report.YearStr + upState;
this.SimpleForm1.Title = "企业建筑行业能源节约与生态环境保护汇总表" + report.MonthStr + report.YearStr + upState;
lbUnitName.Text = "填报企业:" + report.UnitName;
if (report.FillingDate != null)
{
@@ -214,7 +221,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
}
}
var getReport = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue));
var getReport = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue));
this.btnAudit1.Hidden = true;
this.btnAudit2.Hidden = true;
if (getReport != null)
@@ -249,7 +256,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
/// <param name="e"></param>
protected void btnNew_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ArchitectureReportSave.aspx?UnitId={0}&&Year={1}&&Quarterss={2}", this.CurrUser.UnitId, this.drpYear.SelectedValue, this.drpQuarters.SelectedValue, "编辑 - ")));
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ArchitectureReportSave.aspx?UnitId={0}&&Year={1}&&Months={2}", this.CurrUser.UnitId, this.drpYear.SelectedValue, this.drpMonth.SelectedValue, "编辑 - ")));
}
/// <summary>
@@ -259,7 +266,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
/// <param name="e"></param>
protected void btnEdit_Click(object sender, EventArgs e)
{
Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue));
Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue));
if (report != null)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ArchitectureReportSave.aspx?ArchitectureReportId={0}", report.ArchitectureReportId, "编辑 - ")));
@@ -277,7 +284,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
/// <param name="e"></param>
protected void btnAudit1_Click(object sender, EventArgs e)
{
Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue));
Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue));
if (report != null)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ArchitectureReportSave.aspx?ArchitectureReportId={0}", report.ArchitectureReportId, "编辑 - ")));
@@ -295,7 +302,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
/// <param name="e"></param>
protected void btnAudit2_Click(object sender, EventArgs e)
{
Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue));
Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue));
if (report != null)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ArchitectureReportSave.aspx?ArchitectureReportId={0}", report.ArchitectureReportId, "编辑 - ")));
@@ -313,7 +320,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
/// <param name="e"></param>
protected void btnUpdata_Click(object sender, EventArgs e)
{
Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue));
Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue));
if (report != null)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ArchitectureReportSave.aspx?ArchitectureReportId={0}&type=Updata", report.ArchitectureReportId, "编辑 - ")));
@@ -331,10 +338,10 @@ namespace FineUIPro.Web.ZHGL.Environmental
/// <param name="e"></param>
protected void btnDelete_Click(object sender, EventArgs e)
{
Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue));
Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue));
if (report != null)
{
BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Quarters.ToString(), report.ArchitectureReportId, BLL.Const.ArchitectureReportMenuId, BLL.Const.BtnDelete);
BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Month.ToString(), report.ArchitectureReportId, BLL.Const.ArchitectureReportMenuId, BLL.Const.BtnDelete);
BLL.ProjectDataFlowSetService.DeleteFlowSetByDataId(report.ArchitectureReportId);
BLL.ArchitectureReportItemService.DeleteArchitectureReportItemByArchitectureReportId(report.ArchitectureReportId);
BLL.ArchitectureReportService.DeleteArchitectureReportByArchitectureReportId(report.ArchitectureReportId);
@@ -377,7 +384,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByArchitectureReportId(ArchitectureReportId.ToString());
if (report != null)
{
return report.Year + "年" + report.Quarters + "月";
return report.Year + "年" + report.Month + "月";
}
}
return "";
@@ -414,7 +421,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
/// <param name="e"></param>
protected void BtnBulletLeft_Click(object sender, EventArgs e)
{
SetQuartersChange("-");
SetMonthChange("-");
}
/// <summary>
@@ -424,30 +431,30 @@ namespace FineUIPro.Web.ZHGL.Environmental
/// <param name="e"></param>
protected void BulletRight_Click(object sender, EventArgs e)
{
SetQuartersChange("+");
SetMonthChange("+");
}
/// <summary>
/// 月份加减变化
/// </summary>
/// <param name="type"></param>
private void SetQuartersChange(string type)
private void SetMonthChange(string type)
{
DateTime? nowDate = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + (Funs.GetNewIntOrZero(this.drpQuarters.SelectedValue) * 3).ToString());
DateTime? nowDate = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + this.drpMonth.SelectedValue);
if (nowDate.HasValue)
{
DateTime showDate = new DateTime();
if (type == "+")
{
showDate = nowDate.Value.AddMonths(3);
showDate = nowDate.Value.AddMonths(1);
}
else
{
showDate = nowDate.Value.AddMonths(-3);
showDate = nowDate.Value.AddMonths(-1);
}
this.drpYear.SelectedValue = showDate.Year.ToString();
this.drpQuarters.SelectedValue = Funs.GetNowQuarterlyByTime(showDate).ToString();
drpMonth.SelectedValue = showDate.Month.ToString();
///值变化
GetValue();
}
@@ -462,7 +469,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
/// <param name="e"></param>
protected void btnSee_Click(object sender, EventArgs e)
{
Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue));
Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue));
if (report != null)
{
PageContext.RegisterStartupScript(Window4.GetShowReference(String.Format("ReportAuditSee.aspx?Id={0}", report.ArchitectureReportId, "查看 - ")));
@@ -678,14 +685,14 @@ namespace FineUIPro.Web.ZHGL.Environmental
{
string info = string.Empty;
int year = Funs.GetNewIntOrZero(drpYear.SelectedValue);
int Quarters = Funs.GetNewIntOrZero(drpQuarters.SelectedValue);
int month = Funs.GetNewIntOrZero(drpMonth.SelectedValue);
var projects = (from x in Funs.DB.Base_Project
where (x.ProjectState == BLL.Const.ProjectState_1 || x.ProjectState == null)
&& (x.IsDelete == null || x.IsDelete == false)
select x).ToList();
foreach (var item in projects)
{
var projectArchitectureReport = Funs.DB.Environmental_ProjectArchitectureReport.FirstOrDefault(x => x.ProjectId == item.ProjectId && x.Year == year && x.Quarters == Quarters);
var projectArchitectureReport = Funs.DB.Environmental_ProjectArchitectureReport.FirstOrDefault(x => x.ProjectId == item.ProjectId && x.Year == year && x.Month == month);
if (projectArchitectureReport == null)
{
info += item.ProjectName + ",未填写报表;</br>";
@@ -719,5 +726,21 @@ namespace FineUIPro.Web.ZHGL.Environmental
}
#endregion
#region
/// <summary>
/// 恢复未上报状态
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnState_Click(object sender, EventArgs e)
{
Model.Environmental_ArchitectureReport report = BLL.ArchitectureReportService.GetArchitectureReportByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue));
report.UpState = "2";
BLL.ArchitectureReportService.UpdateArchitectureReport(report);
ShowNotify("恢复成功!", MessageBoxIcon.Success);
GetValue();
}
#endregion
}
}