This commit is contained in:
2025-09-01 09:33:47 +08:00
parent 1ddcd34c8b
commit bdd70b2d2c
20 changed files with 1058 additions and 771 deletions
@@ -45,28 +45,17 @@ namespace FineUIPro.Web.ZHGL.Environmental
{
this.GetButtonPower();
items.Clear();
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);
this.drpUnit.DataTextField = "UnitName";
drpUnit.DataValueField = "UnitId";
drpUnit.DataSource = BLL.UnitService.GetThisUnitDropDownList();
drpUnit.DataBind();
this.drpUnit.Readonly = true;
string unitId = Request.QueryString["UnitId"];
this.drpUnit.Readonly = true;
string year = Request.QueryString["Year"];
string quarters = Request.QueryString["Quarterss"];
string months = Request.QueryString["Months"];
ArchitectureReportId = Request.QueryString["ArchitectureReportId"];
if (!string.IsNullOrEmpty(Request.QueryString["type"]))
{
this.btnSave.Hidden = true;
this.btnUpdata.Hidden = false;
}
else
{
this.btnSave.Hidden = false;
this.btnUpdata.Hidden = true;
}
if (!String.IsNullOrEmpty(ArchitectureReportId))
if (!string.IsNullOrEmpty(ArchitectureReportId))
{
items = BLL.ProjectArchitectureReportItemService.GetShowItems(ArchitectureReportId);
this.Grid1.DataSource = items;
@@ -74,17 +63,12 @@ namespace FineUIPro.Web.ZHGL.Environmental
var report = BLL.ProjectArchitectureReportService.GetArchitectureReportByArchitectureReportId(ArchitectureReportId);
if (report != null)
{
//this.btnCopy.Hidden = true;
//if (this.CurrUser.PersonId == BLL.Const.sysglyId || this.CurrUser.PersonId == BLL.Const.hfnbdId)
//{
// this.btnSave.Hidden = false;
//}
if (report.UpState == BLL.Const.UpState_3)
if (report.UpState == BLL.Const.State_2)
{
this.btnSave.Hidden = true;
this.btnUpdata.Hidden = true;
this.btnSubmit.Hidden = true;
}
drpQuarters.SelectedValue = report.Quarters.ToString();
drpMonth.SelectedValue = report.Month.ToString();
drpYear.SelectedValue = report.Year.ToString();
this.CurrUser.LoginProjectId = report.ProjectId;
if (report.FillingDate != null)
@@ -97,12 +81,12 @@ namespace FineUIPro.Web.ZHGL.Environmental
else
{
//this.btnCopy.Hidden = false;
drpQuarters.SelectedValue = quarters;
drpMonth.SelectedValue = months;
drpYear.SelectedValue = year;
txtFillingDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
txtDutyPerson.Text = this.CurrUser.PersonName;
//增加明细集合
GetNewItems(year, quarters);
GetNewItems(year, months);
this.Grid1.DataSource = items;
this.Grid1.DataBind();
}
@@ -150,7 +134,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
var lastYearReport = ProjectArchitectureReportService.GetArchitectureReportByProjectIdYear(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue) - 1);
if (lastYearReport.Count > 0)
{
var lastYearReportItems = ProjectArchitectureReportItemService.GetLastYearItems(Funs.GetNewIntOrZero(drpYear.SelectedValue) - 1);
//var lastYearReportItems = ProjectArchitectureReportItemService.GetLastYearItems(Funs.GetNewIntOrZero(drpYear.SelectedValue) - 1);
//Grid1.Rows[1].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "02").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue));
//Grid1.Rows[2].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "03").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue));
//Grid1.Rows[3].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "04").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue));
@@ -208,16 +192,15 @@ namespace FineUIPro.Web.ZHGL.Environmental
//Grid1.Rows[57].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "58").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue));
//Grid1.Rows[59].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "60").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue));
//Grid1.Rows[60].Values[4] = lastYearReportItems.Where(x => x.SortIndex == "61").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue));
SetLastYearUnEditableRow();
//SetLastYearUnEditableRow();
}
else
{
DateTime? nowDate = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + (Funs.GetNewIntOrZero(this.drpQuarters.SelectedValue) * 3).ToString());
DateTime lastQuarters = nowDate.Value.AddMonths(-3);
Environmental_ProjectArchitectureReport lastQuartersReport = ProjectArchitectureReportService.GetArchitectureReportByProjectIdDate(this.CurrUser.LoginProjectId, lastQuarters.Year, Funs.GetNowQuarterlyByTime(lastQuarters));
DateTime lastMonth = Convert.ToDateTime(drpYear.SelectedValue + "-" + drpMonth.SelectedValue + "-01").AddYears(-1);
Environmental_ProjectArchitectureReport lastQuartersReport = ProjectArchitectureReportService.GetArchitectureReportByProjectIdDate(this.CurrUser.LoginProjectId, lastMonth.Year, lastMonth.Month);
if (lastQuartersReport != null)
{
var lastQuartersReportItems = BLL.ProjectArchitectureReportItemService.GetItems(lastQuartersReport.ArchitectureReportId);
//var lastQuartersReportItems = BLL.ProjectArchitectureReportItemService.GetItems(lastQuartersReport.ArchitectureReportId);
//Grid1.Rows[1].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "02").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue));
//Grid1.Rows[2].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "03").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue));
//Grid1.Rows[3].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "04").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue));
@@ -275,7 +258,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
//Grid1.Rows[57].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "58").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue));
//Grid1.Rows[59].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "60").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue));
//Grid1.Rows[60].Values[4] = lastQuartersReportItems.Where(x => x.SortIndex == "61").Sum(x => Funs.GetNewDecimalOrZero(x.ThisYearValue));
SetLastYearUnEditableRow();
//SetLastYearUnEditableRow();
}
}
}
@@ -964,23 +947,28 @@ namespace FineUIPro.Web.ZHGL.Environmental
{
ProjectId = this.CurrUser.LoginProjectId,
Year = Funs.GetNewIntOrZero(drpYear.SelectedValue),
Quarters = Funs.GetNewIntOrZero(drpQuarters.SelectedValue)
Month = Funs.GetNewIntOrZero(drpMonth.SelectedValue)
};
if (!string.IsNullOrEmpty(txtFillingDate.Text.Trim()))
{
report.FillingDate = Convert.ToDateTime(txtFillingDate.Text.Trim());
}
report.DutyPerson = txtDutyPerson.Text.Trim();
report.UpState = BLL.Const.State_0;
if (type == BLL.Const.BtnSubmit)
{
report.UpState = BLL.Const.State_2;
}
if (String.IsNullOrEmpty(ArchitectureReportId))
{
Environmental_ProjectArchitectureReport old = ProjectArchitectureReportService.GetArchitectureReportByProjectIdDate(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarters.SelectedValue));
Environmental_ProjectArchitectureReport old = ProjectArchitectureReportService.GetArchitectureReportByProjectIdDate(this.CurrUser.LoginProjectId, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpMonth.SelectedValue));
if (old == null)
{
report.ArchitectureReportId = SQLHelper.GetNewID(typeof(Model.Environmental_ProjectArchitectureReport));
report.UpState = BLL.Const.UpState_2;
report.FillingMan = this.CurrUser.PersonName;
ArchitectureReportId = report.ArchitectureReportId;
BLL.ProjectArchitectureReportService.AddArchitectureReport(report);
BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Quarters.ToString(), report.ArchitectureReportId, BLL.Const.ProjectArchitectureReportMenuId, BLL.Const.BtnAdd);
BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Month.ToString(), report.ArchitectureReportId, BLL.Const.ProjectArchitectureReportMenuId, BLL.Const.BtnAdd);
}
else
{
@@ -992,9 +980,8 @@ namespace FineUIPro.Web.ZHGL.Environmental
{
Model.Environmental_ProjectArchitectureReport oldReport = BLL.ProjectArchitectureReportService.GetArchitectureReportByArchitectureReportId(ArchitectureReportId);
report.ArchitectureReportId = ArchitectureReportId;
report.UpState = BLL.Const.UpState_2;
BLL.ProjectArchitectureReportService.UpdateArchitectureReport(report);
BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Quarters.ToString(), report.ArchitectureReportId, BLL.Const.ProjectArchitectureReportMenuId, BLL.Const.BtnModify);
BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Month.ToString(), report.ArchitectureReportId, BLL.Const.ProjectArchitectureReportMenuId, BLL.Const.BtnModify);
}
ArchitectureReportId = report.ArchitectureReportId;
BLL.ProjectArchitectureReportItemService.DeleteArchitectureReportItemByArchitectureReportId(report.ArchitectureReportId);
@@ -1013,45 +1000,20 @@ namespace FineUIPro.Web.ZHGL.Environmental
ProjectArchitectureReportItemService.AddArchitectureReportItem(newItem);
mReportItemList.Add(newItem);
}
if (type == "updata") //数据同步
{
if (report.UpState == BLL.Const.UpState_2)
{
string code = CNCECHSSEWebService.UpArchitectureReport(report.ArchitectureReportId, this.CurrUser);
if (code == "1")
{
ShowNotify("同步成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
return;
}
else
{
Alert.ShowInParent("同步异常,请退出后重试!", MessageBoxIcon.Error);
}
}
else
{
ShowNotify("当前单据状态不能同步!", MessageBoxIcon.Warning);
return;
}
}
}
protected void btnSave_Click(object sender, EventArgs e)
{
Save("add");
Save(Const.BtnSave);
ShowNotify("保存成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
protected void btnUpdata_Click(object sender, EventArgs e)
{
Save("updata");
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
Save("submit");
Save(Const.BtnSubmit);
ShowNotify("提交成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
#endregion
@@ -1157,12 +1119,12 @@ namespace FineUIPro.Web.ZHGL.Environmental
/// <param name="e"></param>
protected void btnCopy_Click(object sender, EventArgs e)
{
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();
showDate = nowDate.Value.AddMonths(-3);
Model.Environmental_ProjectArchitectureReport ArchitectureReport = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.CurrUser.LoginProjectId, showDate.Year, Funs.GetNowQuarterlyByTime(showDate));
Model.Environmental_ProjectArchitectureReport ArchitectureReport = BLL.ProjectArchitectureReportService.GetArchitectureReportByProjectIdAndYearAndQuarters(this.CurrUser.LoginProjectId, showDate.Year, showDate.Month);
if (ArchitectureReport != null)
{
Model.Environmental_ProjectArchitectureReport newArchitectureReport = new Environmental_ProjectArchitectureReport();
@@ -1170,11 +1132,11 @@ namespace FineUIPro.Web.ZHGL.Environmental
newArchitectureReport.ArchitectureReportId = this.ArchitectureReportId;
newArchitectureReport.ProjectId = this.CurrUser.LoginProjectId;
newArchitectureReport.Year = Convert.ToInt32(this.drpYear.SelectedValue);
newArchitectureReport.Quarters = Convert.ToInt32(this.drpQuarters.SelectedValue);
newArchitectureReport.Month = Convert.ToInt32(this.drpMonth.SelectedValue);
newArchitectureReport.FillingMan = this.CurrUser.PersonName;
newArchitectureReport.FillingDate = DateTime.Now;
newArchitectureReport.DutyPerson = this.CurrUser.PersonName;
newArchitectureReport.UpState = BLL.Const.UpState_2;
newArchitectureReport.UpState = BLL.Const.State_2;
BLL.ProjectArchitectureReportService.AddArchitectureReport(newArchitectureReport);
var oldItems = BLL.ProjectArchitectureReportItemService.GetItems(ArchitectureReport.ArchitectureReportId);
@@ -1209,7 +1171,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
var report = BLL.ProjectArchitectureReportService.GetArchitectureReportByArchitectureReportId(ArchitectureReportId);
if (report != null)
{
drpQuarters.SelectedValue = report.Quarters.ToString();
drpMonth.SelectedValue = report.Month.ToString();
drpYear.SelectedValue = report.Year.ToString();
this.CurrUser.LoginProjectId = report.ProjectId;
if (report.FillingDate != null)