From ae9fcbdda50e29c5d1bf66d37769610416bcbe86 Mon Sep 17 00:00:00 2001
From: gaofei1985 <181547018@qq.com>
Date: Wed, 12 Jul 2023 15:58:52 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=9F=E6=80=81=E7=8E=AF?=
=?UTF-8?q?=E4=BF=9D=E6=8A=A5=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../版本日志/SGGLDB_WH_2023-07-11.sql | 4 +
SGGL/BLL/Common/CommonService.cs | 11 +++
.../ProjectEPSummaryReportService.cs | 2 +
SGGL/BLL/WebService/CNCECHSSEWebService.cs | 3 +-
.../Information/EPSummaryReportService.cs | 6 +-
.../InformationProject/EPSummaryReport.aspx | 17 ++++-
.../EPSummaryReport.aspx.cs | 12 ++-
.../EPSummaryReport.aspx.designer.cs | 9 +++
.../EPSummaryReportEdit.aspx | 2 +
.../EPSummaryReportEdit.aspx.cs | 20 +++--
.../EPSummaryReportEdit.aspx.designer.cs | 9 +++
.../ZHGL/Information/EPSummaryReport.aspx | 15 ++--
.../ZHGL/Information/EPSummaryReport.aspx.cs | 75 ++++++++++++-------
.../EPSummaryReport.aspx.designer.cs | 27 ++++---
.../ZHGL/Information/EPSummaryReportEdit.aspx | 6 +-
.../Information/EPSummaryReportEdit.aspx.cs | 45 +++++++++--
.../EPSummaryReportEdit.aspx.designer.cs | 9 +++
SGGL/Model/APIItem/EPSummaryReport.cs | 9 +++
SGGL/Model/Model.cs | 54 +++++++++++--
19 files changed, 268 insertions(+), 67 deletions(-)
create mode 100644 DataBase/版本日志/SGGLDB_WH_2023-07-11.sql
diff --git a/DataBase/版本日志/SGGLDB_WH_2023-07-11.sql b/DataBase/版本日志/SGGLDB_WH_2023-07-11.sql
new file mode 100644
index 00000000..15c8ecf2
--- /dev/null
+++ b/DataBase/版本日志/SGGLDB_WH_2023-07-11.sql
@@ -0,0 +1,4 @@
+alter table [dbo].[Information_EPSummaryReport] add Quarter int null
+GO
+alter table [dbo].[InformationProject_EPSummaryReport] add Quarter int null
+GO
\ No newline at end of file
diff --git a/SGGL/BLL/Common/CommonService.cs b/SGGL/BLL/Common/CommonService.cs
index b3b112fd..8dc7f996 100644
--- a/SGGL/BLL/Common/CommonService.cs
+++ b/SGGL/BLL/Common/CommonService.cs
@@ -605,5 +605,16 @@ namespace BLL
if (now.Month < birthDate.Month || (now.Month == birthDate.Month && now.Day < birthDate.Day)) age--;
return age;
}
+
+ ///
+ /// 得到本单位Id
+ ///
+ ///
+ public static string GetThisUnitId()
+ {
+ string unitId = Const.UnitId_CWCEC;
+
+ return unitId;
+ }
}
}
diff --git a/SGGL/BLL/HSSE/InformationProject/ProjectEPSummaryReportService.cs b/SGGL/BLL/HSSE/InformationProject/ProjectEPSummaryReportService.cs
index 54b63751..adc32ad9 100644
--- a/SGGL/BLL/HSSE/InformationProject/ProjectEPSummaryReportService.cs
+++ b/SGGL/BLL/HSSE/InformationProject/ProjectEPSummaryReportService.cs
@@ -33,6 +33,7 @@ namespace BLL
ProjectId = ePSummaryReport.ProjectId,
UnitId = ePSummaryReport.UnitId,
YearId = ePSummaryReport.YearId,
+ Quarter= ePSummaryReport.Quarter,
ResponsiblePerson = ePSummaryReport.ResponsiblePerson,
ResponsiblePersonTel = ePSummaryReport.ResponsiblePersonTel,
ContactPerson = ePSummaryReport.ContactPerson,
@@ -63,6 +64,7 @@ namespace BLL
{
newReport.UnitId = ePSummaryReport.UnitId;
newReport.YearId = ePSummaryReport.YearId;
+ newReport.Quarter = ePSummaryReport.Quarter;
newReport.ResponsiblePerson = ePSummaryReport.ResponsiblePerson;
newReport.ResponsiblePersonTel = ePSummaryReport.ResponsiblePersonTel;
newReport.ContactPerson = ePSummaryReport.ContactPerson;
diff --git a/SGGL/BLL/WebService/CNCECHSSEWebService.cs b/SGGL/BLL/WebService/CNCECHSSEWebService.cs
index 90f6befc..f1da6f0c 100644
--- a/SGGL/BLL/WebService/CNCECHSSEWebService.cs
+++ b/SGGL/BLL/WebService/CNCECHSSEWebService.cs
@@ -1775,6 +1775,7 @@
EPSummaryReportId = x.EPSummaryReportId,
UnitId = x.UnitId,
YearId = x.YearId,
+ Quarter = x.Quarter,
ResponsiblePerson = x.ResponsiblePerson,
ResponsiblePersonTel = x.ResponsiblePersonTel,
ContactPerson = x.ContactPerson,
@@ -3286,4 +3287,4 @@
}
-}
+}
\ No newline at end of file
diff --git a/SGGL/BLL/ZHGL/Information/EPSummaryReportService.cs b/SGGL/BLL/ZHGL/Information/EPSummaryReportService.cs
index 0d0ac6e3..690e8fc2 100644
--- a/SGGL/BLL/ZHGL/Information/EPSummaryReportService.cs
+++ b/SGGL/BLL/ZHGL/Information/EPSummaryReportService.cs
@@ -27,9 +27,9 @@ namespace BLL
///
///
///
- public static Model.Information_EPSummaryReport GetEPSummaryReportByUnitIdAndYearId(string unitId, int yearId)
+ public static Model.Information_EPSummaryReport GetEPSummaryReportByUnitIdAndYearIdAndQuarters(string unitId, int yearId, int quarters)
{
- return Funs.DB.Information_EPSummaryReport.FirstOrDefault(e => e.UnitId == unitId && e.YearId == yearId);
+ return Funs.DB.Information_EPSummaryReport.FirstOrDefault(e => e.UnitId == unitId && e.YearId == yearId && e.Quarter == quarters);
}
///
@@ -43,6 +43,7 @@ namespace BLL
EPSummaryReportId = ePSummaryReport.EPSummaryReportId,
UnitId = ePSummaryReport.UnitId,
YearId = ePSummaryReport.YearId,
+ Quarter = ePSummaryReport.Quarter,
ResponsiblePerson = ePSummaryReport.ResponsiblePerson,
ResponsiblePersonTel = ePSummaryReport.ResponsiblePersonTel,
ContactPerson = ePSummaryReport.ContactPerson,
@@ -73,6 +74,7 @@ namespace BLL
{
newReport.UnitId = ePSummaryReport.UnitId;
newReport.YearId = ePSummaryReport.YearId;
+ newReport.Quarter = ePSummaryReport.Quarter;
newReport.ResponsiblePerson = ePSummaryReport.ResponsiblePerson;
newReport.ResponsiblePersonTel = ePSummaryReport.ResponsiblePersonTel;
newReport.ContactPerson = ePSummaryReport.ContactPerson;
diff --git a/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReport.aspx b/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReport.aspx
index b8e12ec3..5e7590ff 100644
--- a/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReport.aspx
+++ b/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReport.aspx
@@ -26,6 +26,9 @@
+
+
-
+
+
+
+
-
@@ -53,7 +64,7 @@
SortField="ContactPerson" FieldType="String" HeaderText="联系人" HeaderTextAlign="Center"
TextAlign="Left">
-
diff --git a/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReport.aspx.cs b/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReport.aspx.cs
index f163bd5a..a768f8f0 100644
--- a/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReport.aspx.cs
+++ b/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReport.aspx.cs
@@ -48,7 +48,7 @@ namespace FineUIPro.Web.HSSE.InformationProject
this.GetButtonPower();
BLL.ConstValue.InitConstValueDropDownList(this.drpYear, BLL.ConstValue.Group_0008, true);
-
+ BLL.ConstValue.InitConstValueDropDownList(this.drpQuarters, BLL.ConstValue.Group_0011, true);
this.btnNew.OnClientClick = Window1.GetShowReference("EPSummaryReportEdit.aspx") + "return false;";
if (this.CurrUser != null && this.CurrUser.PageSize.HasValue)
{
@@ -68,6 +68,9 @@ namespace FineUIPro.Web.HSSE.InformationProject
+ @"report.ProjectId,"
+ @"report.UnitId,"
+ @"report.YearId,"
+ + @"report.Quarter,"
+ + @"ConstY.ConstText as YearStr,"
+ + @"ConstQ.ConstText as QuarterStr,"
+ @"report.ResponsiblePerson,"
+ @"report.ResponsiblePersonTel,"
+ @"report.ContactPerson,"
@@ -84,6 +87,8 @@ namespace FineUIPro.Web.HSSE.InformationProject
+ @"report.Description9,"
+ @"Unit.UnitName "
+ @" FROM InformationProject_EPSummaryReport AS report "
+ + @" LEFT JOIN Sys_Const AS ConstY ON ConstY.ConstValue = report.YearId and ConstY.GroupId='0008' "
+ + @" LEFT JOIN Sys_Const AS ConstQ ON ConstQ.ConstValue = report.Quarter and ConstQ.GroupId='0011' "
+ @" LEFT JOIN Base_Unit AS Unit ON Unit.UnitId = report.UnitId WHERE 1=1 ";
List listStr = new List();
@@ -93,6 +98,11 @@ namespace FineUIPro.Web.HSSE.InformationProject
strSql += " AND report.YearId = @Year";
listStr.Add(new SqlParameter("@Year", Funs.GetNewInt(this.drpYear.SelectedValue)));
}
+ if (this.drpQuarters.SelectedValue != BLL.Const._Null)
+ {
+ strSql += " AND report.Quarter = @Quarter";
+ listStr.Add(new SqlParameter("@Quarter", Funs.GetNewInt(this.drpQuarters.SelectedValue)));
+ }
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
diff --git a/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReport.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReport.aspx.designer.cs
index 802a192d..afd22b0c 100644
--- a/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReport.aspx.designer.cs
+++ b/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReport.aspx.designer.cs
@@ -66,6 +66,15 @@ namespace FineUIPro.Web.HSSE.InformationProject {
///
protected global::FineUIPro.DropDownList drpYear;
+ ///
+ /// drpQuarters 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList drpQuarters;
+
///
/// ToolbarFill1 控件。
///
diff --git a/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReportEdit.aspx b/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReportEdit.aspx
index 6710b187..603c0060 100644
--- a/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReportEdit.aspx
+++ b/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReportEdit.aspx
@@ -18,6 +18,8 @@
+
+
diff --git a/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReportEdit.aspx.cs b/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReportEdit.aspx.cs
index 1721d65a..901ad4ed 100644
--- a/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReportEdit.aspx.cs
+++ b/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReportEdit.aspx.cs
@@ -59,7 +59,7 @@ namespace FineUIPro.Web.HSSE.InformationProject
this.ProjectId = Request.Params["projectId"];
}
BLL.ConstValue.InitConstValueDropDownList(this.ddlYearId, BLL.ConstValue.Group_0008, true);
-
+ BLL.ConstValue.InitConstValueDropDownList(this.ddlQuarter, BLL.ConstValue.Group_0011, true);
this.EPSummaryReportId = Request.Params["EPSummaryReportId"];
if (!string.IsNullOrEmpty(this.EPSummaryReportId))
{
@@ -71,6 +71,10 @@ namespace FineUIPro.Web.HSSE.InformationProject
if (report.YearId != null)
{
this.ddlYearId.SelectedValue = report.YearId.ToString();
+ if (report.Quarter.HasValue)
+ {
+ this.ddlQuarter.SelectedValue = report.Quarter.ToString();
+ }
this.txtReportDate.Text = report.ReportDate.HasValue ? string.Format("{0:yyyy-MM-dd}", report.ReportDate) : "";
this.txtResponsiblePerson.Text = report.ResponsiblePerson;
this.txtResponsiblePersonTel.Text = report.ResponsiblePersonTel;
@@ -91,7 +95,9 @@ namespace FineUIPro.Web.HSSE.InformationProject
}
else
{
+ DateTime showDate = DateTime.Now.AddMonths(-3);
this.ddlYearId.SelectedValue = DateTime.Now.Year.ToString();
+ this.ddlQuarter.SelectedValue = Funs.GetNowQuarterlyByTime(showDate).ToString();
this.txtReportDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
}
}
@@ -124,12 +130,16 @@ namespace FineUIPro.Web.HSSE.InformationProject
Model.InformationProject_EPSummaryReport report = new Model.InformationProject_EPSummaryReport
{
ProjectId = this.ProjectId,
- UnitId = string.IsNullOrEmpty(this.CurrUser.UnitId) ? BLL.Const.UnitId_CWCEC : this.CurrUser.UnitId,
+ UnitId = string.IsNullOrEmpty(this.CurrUser.UnitId) ? CommonService.GetThisUnitId() : this.CurrUser.UnitId,
};
if (this.ddlYearId.SelectedValue != BLL.Const._Null)
{
report.YearId = Funs.GetNewIntOrZero(this.ddlYearId.SelectedValue);
}
+ if (this.ddlQuarter.SelectedValue != BLL.Const._Null)
+ {
+ report.Quarter = Funs.GetNewIntOrZero(this.ddlQuarter.SelectedValue);
+ }
report.ResponsiblePerson = this.txtResponsiblePerson.Text.Trim();
report.ResponsiblePersonTel = this.txtResponsiblePersonTel.Text.Trim();
report.ContactPerson = this.txtContactPerson.Text.Trim();
@@ -153,8 +163,8 @@ namespace FineUIPro.Web.HSSE.InformationProject
else
{
Model.InformationProject_EPSummaryReport oldReport = (from x in Funs.DB.InformationProject_EPSummaryReport
- where x.ProjectId == report.ProjectId && x.YearId == report.YearId
- select x).FirstOrDefault();
+ where x.ProjectId == report.ProjectId && x.YearId == report.YearId && x.Quarter == report.Quarter
+ select x).FirstOrDefault();
if (oldReport == null)
{
this.EPSummaryReportId = SQLHelper.GetNewID(typeof(Model.InformationProject_EPSummaryReport));
@@ -165,7 +175,7 @@ namespace FineUIPro.Web.HSSE.InformationProject
}
else
{
- Alert.ShowInTop("该年度记录已存在", MessageBoxIcon.Warning);
+ Alert.ShowInTop("该季度记录已存在", MessageBoxIcon.Warning);
return;
}
}
diff --git a/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReportEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReportEdit.aspx.designer.cs
index a0c877c2..b7f2e02b 100644
--- a/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReportEdit.aspx.designer.cs
+++ b/SGGL/FineUIPro.Web/HSSE/InformationProject/EPSummaryReportEdit.aspx.designer.cs
@@ -48,6 +48,15 @@ namespace FineUIPro.Web.HSSE.InformationProject {
///
protected global::FineUIPro.DropDownList ddlYearId;
+ ///
+ /// ddlQuarter 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList ddlQuarter;
+
///
/// txtReportDate 控件。
///
diff --git a/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReport.aspx b/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReport.aspx
index c5266cac..cbefe966 100644
--- a/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReport.aspx
+++ b/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReport.aspx
@@ -28,11 +28,14 @@
-
+
+
-
+
@@ -53,10 +56,10 @@
-
-
-
+
+
+
diff --git a/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReport.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReport.aspx.cs
index 4b6365b3..17cca61a 100644
--- a/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReport.aspx.cs
+++ b/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReport.aspx.cs
@@ -40,12 +40,15 @@ namespace FineUIPro.Web.ZHGL.Information
drpYear.DataValueField = "ConstValue";
drpYear.DataSource = BLL.ConstValue.drpConstItemList(ConstValue.Group_0008);
drpYear.DataBind();
+ BLL.ConstValue.InitConstValueDropDownList(this.drpQuarter, ConstValue.Group_0011, false);
this.drpUnit.DataTextField = "UnitName";
drpUnit.DataValueField = "UnitId";
drpUnit.DataSource = BLL.UnitService.GetThisUnitDropDownList();
drpUnit.DataBind();
this.drpUnit.Readonly = true;
- drpYear.SelectedValue = System.DateTime.Now.Year.ToString();
+ DateTime showDate = System.DateTime.Now.AddMonths(-3);
+ this.drpQuarter.SelectedValue = Funs.GetNowQuarterlyByTime(showDate).ToString();
+ this.drpYear.SelectedValue = showDate.Year.ToString();
GetValue();
}
}
@@ -58,8 +61,8 @@ namespace FineUIPro.Web.ZHGL.Information
private void SetEmpty()
{
this.SimpleForm1.Title = string.Empty;
- lblUnitName.Text = string.Empty;
lblYearId.Text = string.Empty;
+ lblQuarter.Text = string.Empty;
lblResponsiblePerson.Text = string.Empty;
lblResponsiblePersonTel.Text = string.Empty;
lblContactPerson.Text = string.Empty;
@@ -75,7 +78,8 @@ namespace FineUIPro.Web.ZHGL.Information
{
this.SetEmpty();
int year = Funs.GetNewIntOrZero(drpYear.SelectedValue);
- Model.Information_EPSummaryReport report = Funs.DB.Information_EPSummaryReport.FirstOrDefault(e => e.UnitId == drpUnit.SelectedValue && e.YearId == year);
+ int quarter = Funs.GetNewIntOrZero(drpQuarter.SelectedValue);
+ Model.Information_EPSummaryReport report = Funs.DB.Information_EPSummaryReport.FirstOrDefault(e => e.UnitId == drpUnit.SelectedValue && e.YearId == year && e.Quarter == quarter);
if (report != null)
{
string upState = string.Empty;
@@ -88,12 +92,8 @@ namespace FineUIPro.Web.ZHGL.Information
upState = "(未上报)";
}
this.SimpleForm1.Title = "生态环保工作总结报告" + upState;
- if (!string.IsNullOrEmpty(report.UnitId))
- {
- this.lblUnitName.Text = BLL.UnitService.GetUnitNameByUnitId(report.UnitId);
- }
- this.lblYearId.Text = report.YearId.ToString();
-
+ this.lblYearId.Text = drpYear.SelectedItem.Text;
+ this.lblQuarter.Text = drpQuarter.SelectedItem.Text;
this.GetTxetValue(report);
}
else
@@ -163,7 +163,7 @@ namespace FineUIPro.Web.ZHGL.Information
///
protected void btnNew_Click(object sender, EventArgs e)
{
- PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("EPSummaryReportEdit.aspx?UnitId={0}&&Year={1}", this.CurrUser.UnitId, this.drpYear.SelectedValue, "编辑 - ")));
+ PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("EPSummaryReportEdit.aspx?UnitId={0}&Year={1}&Quarter={2}", this.CurrUser.UnitId, this.drpYear.SelectedValue, this.drpQuarter.SelectedValue, "编辑 - ")));
}
///
@@ -171,7 +171,8 @@ namespace FineUIPro.Web.ZHGL.Information
///
private void ShowEdit()
{
- Model.Information_EPSummaryReport report = BLL.EPSummaryReportService.GetEPSummaryReportByUnitIdAndYearId(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue));
+ int quarter = Funs.GetNewIntOrZero(drpQuarter.SelectedValue);
+ Model.Information_EPSummaryReport report = BLL.EPSummaryReportService.GetEPSummaryReportByUnitIdAndYearIdAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), quarter);
if (report == null)
{
Alert.ShowInTop("所选时间无报表记录!", MessageBoxIcon.Warning);
@@ -207,7 +208,8 @@ namespace FineUIPro.Web.ZHGL.Information
///
protected void btnDelete_Click(object sender, EventArgs e)
{
- Model.Information_EPSummaryReport report = BLL.EPSummaryReportService.GetEPSummaryReportByUnitIdAndYearId(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue));
+ int quarter = Funs.GetNewIntOrZero(drpQuarter.SelectedValue);
+ Model.Information_EPSummaryReport report = BLL.EPSummaryReportService.GetEPSummaryReportByUnitIdAndYearIdAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), quarter);
if (report != null)
{
BLL.LogService.AddSys_Log(this.CurrUser, this.lblYearId.Text, report.EPSummaryReportId, BLL.Const.EPSummaryReportMenuId, BLL.Const.BtnDelete);
@@ -274,8 +276,8 @@ namespace FineUIPro.Web.ZHGL.Information
// this.btnPrint.Hidden = false;
//}
int year = Funs.GetNewIntOrZero(drpYear.SelectedValue);
- //int quarter = Funs.GetNewIntOrZero(drpQuarter.SelectedValue);
- var report = BLL.EPSummaryReportService.GetEPSummaryReportByUnitIdAndYearId(this.drpUnit.SelectedValue, year);
+ int quarter = Funs.GetNewIntOrZero(drpQuarter.SelectedValue);
+ var report = BLL.EPSummaryReportService.GetEPSummaryReportByUnitIdAndYearIdAndQuarters(this.drpUnit.SelectedValue, year, quarter);
//this.btnAudit1.Hidden = true;
//this.btnAudit2.Hidden = true;
//this.btnUpdata.Hidden = true;
@@ -300,29 +302,51 @@ namespace FineUIPro.Web.ZHGL.Information
#endregion
- #region 上一年度、下一年度
+ #region 季度向前/向后
///
- /// 上一年度
+ /// 前一季度
///
///
///
protected void BtnBulletLeft_Click(object sender, EventArgs e)
{
- int y = Convert.ToInt32(drpYear.SelectedValue) - 1;
- drpYear.SelectedValue = y.ToString();
- GetValue();
+ SetMonthChange("-");
}
///
- /// 下一年度
+ /// 后一季度
///
///
///
- protected void BtnBulletRight_Click(object sender, EventArgs e)
+ protected void BulletRight_Click(object sender, EventArgs e)
{
- int y = Convert.ToInt32(drpYear.SelectedValue) + 1;
- drpYear.SelectedValue = y.ToString();
- GetValue();
+ SetMonthChange("+");
+ }
+
+ ///
+ /// 季度加减变化
+ ///
+ ///
+ private void SetMonthChange(string type)
+ {
+ DateTime? nowDate = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + (Funs.GetNewIntOrZero(this.drpQuarter.SelectedValue) * 3).ToString());
+ if (nowDate.HasValue)
+ {
+ DateTime showDate = new DateTime();
+ if (type == "+")
+ {
+ showDate = nowDate.Value.AddMonths(3);
+ }
+ else
+ {
+ showDate = nowDate.Value.AddMonths(-3);
+ }
+
+ this.drpYear.SelectedValue = showDate.Year.ToString();
+ this.drpQuarter.SelectedValue = Funs.GetNowQuarterlyByTime(showDate).ToString();
+ ///值变化
+ GetValue();
+ }
}
#endregion
@@ -336,6 +360,7 @@ namespace FineUIPro.Web.ZHGL.Information
{
string info = string.Empty;
int date = Convert.ToInt32(this.drpYear.SelectedValue);
+ int quarter = Funs.GetNewIntOrZero(drpQuarter.SelectedValue);
var projects = (from x in Funs.DB.Base_Project
where (x.ProjectState == BLL.Const.ProjectState_1 || x.ProjectState == null)
&& x.ProjectAttribute == "GONGCHENG"
@@ -343,7 +368,7 @@ namespace FineUIPro.Web.ZHGL.Information
select x).ToList();
foreach (var item in projects)
{
- var report = Funs.DB.InformationProject_EPSummaryReport.FirstOrDefault(x => x.ProjectId == item.ProjectId && x.YearId == date);
+ var report = Funs.DB.InformationProject_EPSummaryReport.FirstOrDefault(x => x.ProjectId == item.ProjectId && x.YearId == date && x.Quarter == quarter);
if (report == null)
{
info += item.ProjectCode + ":" + item.ProjectName + ",未填写报表;";
diff --git a/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReport.aspx.designer.cs b/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReport.aspx.designer.cs
index 623c0c5e..3dc0a387 100644
--- a/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReport.aspx.designer.cs
+++ b/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReport.aspx.designer.cs
@@ -84,6 +84,15 @@ namespace FineUIPro.Web.ZHGL.Information {
///
protected global::FineUIPro.DropDownList drpYear;
+ ///
+ /// drpQuarter 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList drpQuarter;
+
///
/// BtnBulletLeft 控件。
///
@@ -147,15 +156,6 @@ namespace FineUIPro.Web.ZHGL.Information {
///
protected global::FineUIPro.Button btnView;
- ///
- /// lblUnitName 控件。
- ///
- ///
- /// 自动生成的字段。
- /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
- ///
- protected global::FineUIPro.Label lblUnitName;
-
///
/// lblYearId 控件。
///
@@ -165,6 +165,15 @@ namespace FineUIPro.Web.ZHGL.Information {
///
protected global::FineUIPro.Label lblYearId;
+ ///
+ /// lblQuarter 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.Label lblQuarter;
+
///
/// lblResponsiblePerson 控件。
///
diff --git a/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReportEdit.aspx b/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReportEdit.aspx
index 16cb3897..42bc8559 100644
--- a/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReportEdit.aspx
+++ b/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReportEdit.aspx
@@ -14,12 +14,14 @@
-
+
+
+
@@ -125,7 +127,7 @@
-
diff --git a/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReportEdit.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReportEdit.aspx.cs
index 7c592764..f26b7606 100644
--- a/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReportEdit.aspx.cs
+++ b/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReportEdit.aspx.cs
@@ -45,9 +45,15 @@ namespace FineUIPro.Web.ZHGL.Information
ddlYearId.DataSource = BLL.ConstValue.drpConstItemList(ConstValue.Group_0008);
ddlYearId.DataBind();
+ this.ddlQuarter.DataTextField = "ConstText";
+ ddlQuarter.DataValueField = "ConstValue";
+ ddlQuarter.DataSource = BLL.ConstValue.drpConstItemList(ConstValue.Group_0011);
+ ddlQuarter.DataBind();
+
this.ddlUnitId.Readonly = true;
string unitId = Request.Params["UnitId"];
string year = Request.QueryString["Year"];
+ string quarter = Request.QueryString["Quarter"];
this.EPSummaryReportId = Request.Params["EPSummaryReportId"];
if (!string.IsNullOrEmpty(this.EPSummaryReportId))
{
@@ -66,6 +72,10 @@ namespace FineUIPro.Web.ZHGL.Information
this.ddlUnitId.SelectedValue = report.UnitId;
}
this.ddlYearId.SelectedValue = report.YearId.ToString();
+ if (report.Quarter.HasValue)
+ {
+ this.ddlQuarter.SelectedValue = report.Quarter.ToString();
+ }
this.txtReportDate.Text = report.ReportDate.HasValue ? string.Format("{0:yyyy-MM-dd}", report.ReportDate) : "";
this.txtResponsiblePerson.Text = report.ResponsiblePerson;
this.txtResponsiblePersonTel.Text = report.ResponsiblePersonTel;
@@ -88,6 +98,7 @@ namespace FineUIPro.Web.ZHGL.Information
this.btnCopy.Hidden = false;
this.ddlUnitId.SelectedValue = unitId;
this.ddlYearId.SelectedValue = year;
+ this.ddlQuarter.SelectedValue = quarter;
this.txtReportDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
#region 获取项目上报数据
@@ -97,7 +108,7 @@ namespace FineUIPro.Web.ZHGL.Information
string description4 = string.Empty;
string description5 = string.Empty;
string description6 = string.Empty;
- string description7= string.Empty;
+ string description7 = string.Empty;
string description8 = string.Empty;
string description9 = string.Empty;
@@ -109,7 +120,7 @@ namespace FineUIPro.Web.ZHGL.Information
select x).ToList();
foreach (var item in projects)
{
- var report = Funs.DB.InformationProject_EPSummaryReport.FirstOrDefault(x => x.ProjectId == item.ProjectId && x.YearId == date);
+ var report = Funs.DB.InformationProject_EPSummaryReport.FirstOrDefault(x => x.ProjectId == item.ProjectId && x.YearId == date && x.Quarter.ToString() == quarter);
if (report != null)
{
description1 += item.ProjectName + ":\r\n" + report.Description1 + "\r\n";
@@ -160,6 +171,15 @@ namespace FineUIPro.Web.ZHGL.Information
ShowNotify("请选择年度!", MessageBoxIcon.Warning);
return;
}
+ if (this.ddlQuarter.SelectedValue != BLL.Const._Null)
+ {
+ report.Quarter = Funs.GetNewIntOrZero(this.ddlQuarter.SelectedValue);
+ }
+ else
+ {
+ ShowNotify("请选择年度!", MessageBoxIcon.Warning);
+ return;
+ }
report.ResponsiblePerson = this.txtResponsiblePerson.Text.Trim();
report.ResponsiblePersonTel = this.txtResponsiblePersonTel.Text.Trim();
report.ContactPerson = this.txtContactPerson.Text.Trim();
@@ -174,9 +194,10 @@ namespace FineUIPro.Web.ZHGL.Information
report.Description7 = this.txtDescription7.Text.Trim();
report.Description8 = this.txtDescription8.Text.Trim();
report.Description9 = this.txtDescription9.Text.Trim();
+ int quarter = Funs.GetNewIntOrZero(ddlQuarter.SelectedValue);
if (string.IsNullOrEmpty(this.EPSummaryReportId))
{
- var s = BLL.EPSummaryReportService.GetEPSummaryReportByUnitIdAndYearId(this.ddlUnitId.SelectedValue, Funs.GetNewIntOrZero(this.ddlYearId.SelectedValue));
+ var s = BLL.EPSummaryReportService.GetEPSummaryReportByUnitIdAndYearIdAndQuarters(this.ddlUnitId.SelectedValue, Funs.GetNewIntOrZero(this.ddlYearId.SelectedValue), quarter);
if (s != null)
{
ShowNotify("该单位的该年度的该生态环保工作总结报告已经存在,不能重复编制!", MessageBoxIcon.Warning);
@@ -247,12 +268,20 @@ namespace FineUIPro.Web.ZHGL.Information
///
protected void btnCopy_Click(object sender, EventArgs e)
{
- int lastYear = 0;
+ int lastYear = 0, lastQuarter = 0;
int year = Convert.ToInt32(this.ddlYearId.SelectedValue);
-
- lastYear = year - 1;
-
- Model.Information_EPSummaryReport report = BLL.EPSummaryReportService.GetEPSummaryReportByUnitIdAndYearId(this.ddlUnitId.SelectedValue, lastYear);
+ int quarter = Convert.ToInt32(this.ddlQuarter.SelectedValue);
+ if (quarter == 1)
+ {
+ lastYear = year - 1;
+ lastQuarter = 4;
+ }
+ else
+ {
+ lastYear = year;
+ lastQuarter = quarter - 1;
+ }
+ Model.Information_EPSummaryReport report = BLL.EPSummaryReportService.GetEPSummaryReportByUnitIdAndYearIdAndQuarters(this.ddlUnitId.SelectedValue, lastYear, lastQuarter);
if (report != null)
{
Model.Information_EPSummaryReport newReport = new Model.Information_EPSummaryReport();
diff --git a/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReportEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReportEdit.aspx.designer.cs
index b35baeae..8dc357f0 100644
--- a/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReportEdit.aspx.designer.cs
+++ b/SGGL/FineUIPro.Web/ZHGL/Information/EPSummaryReportEdit.aspx.designer.cs
@@ -57,6 +57,15 @@ namespace FineUIPro.Web.ZHGL.Information {
///
protected global::FineUIPro.DropDownList ddlYearId;
+ ///
+ /// ddlQuarter 控件。
+ ///
+ ///
+ /// 自动生成的字段。
+ /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
+ ///
+ protected global::FineUIPro.DropDownList ddlQuarter;
+
///
/// txtReportDate 控件。
///
diff --git a/SGGL/Model/APIItem/EPSummaryReport.cs b/SGGL/Model/APIItem/EPSummaryReport.cs
index 76a87bbf..9e7a3d31 100644
--- a/SGGL/Model/APIItem/EPSummaryReport.cs
+++ b/SGGL/Model/APIItem/EPSummaryReport.cs
@@ -38,6 +38,15 @@ namespace Model
set;
}
+ ///
+ /// 季度
+ ///
+ public int? Quarter
+ {
+ get;
+ set;
+ }
+
///
///
///
diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs
index a87591a3..ba18af2c 100644
--- a/SGGL/Model/Model.cs
+++ b/SGGL/Model/Model.cs
@@ -29,11 +29,7 @@ namespace Model
#region 可扩展性方法定义
partial void OnCreated();
- partial void OnCreated()
- {
- this.CommandTimeout = 3600;
- }
- partial void InsertAccident_AccidentHandle(Accident_AccidentHandle instance);
+ partial void InsertAccident_AccidentHandle(Accident_AccidentHandle instance);
partial void UpdateAccident_AccidentHandle(Accident_AccidentHandle instance);
partial void DeleteAccident_AccidentHandle(Accident_AccidentHandle instance);
partial void InsertAccident_AccidentPersonRecord(Accident_AccidentPersonRecord instance);
@@ -175223,6 +175219,8 @@ namespace Model
private string _UpState;
+ private System.Nullable _Quarter;
+
private EntityRef _Base_Unit;
#region 可扩展性方法定义
@@ -175265,6 +175263,8 @@ namespace Model
partial void OnDescription9Changed();
partial void OnUpStateChanging(string value);
partial void OnUpStateChanged();
+ partial void OnQuarterChanging(System.Nullable value);
+ partial void OnQuarterChanged();
#endregion
public Information_EPSummaryReport()
@@ -175637,6 +175637,26 @@ namespace Model
}
}
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Quarter", DbType="Int")]
+ public System.Nullable Quarter
+ {
+ get
+ {
+ return this._Quarter;
+ }
+ set
+ {
+ if ((this._Quarter != value))
+ {
+ this.OnQuarterChanging(value);
+ this.SendPropertyChanging();
+ this._Quarter = value;
+ this.SendPropertyChanged("Quarter");
+ this.OnQuarterChanged();
+ }
+ }
+ }
+
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Information_EPSummaryReport_Base_Unit", Storage="_Base_Unit", ThisKey="UnitId", OtherKey="UnitId", IsForeignKey=true)]
public Base_Unit Base_Unit
{
@@ -186906,6 +186926,8 @@ namespace Model
private string _Description9;
+ private System.Nullable _Quarter;
+
private EntityRef _Base_Project;
private EntityRef _Base_Unit;
@@ -186950,6 +186972,8 @@ namespace Model
partial void OnDescription8Changed();
partial void OnDescription9Changing(string value);
partial void OnDescription9Changed();
+ partial void OnQuarterChanging(System.Nullable value);
+ partial void OnQuarterChanged();
#endregion
public InformationProject_EPSummaryReport()
@@ -187327,6 +187351,26 @@ namespace Model
}
}
+ [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Quarter", DbType="Int")]
+ public System.Nullable Quarter
+ {
+ get
+ {
+ return this._Quarter;
+ }
+ set
+ {
+ if ((this._Quarter != value))
+ {
+ this.OnQuarterChanging(value);
+ this.SendPropertyChanging();
+ this._Quarter = value;
+ this.SendPropertyChanged("Quarter");
+ this.OnQuarterChanged();
+ }
+ }
+ }
+
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_InformationProject_EPSummaryReport_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)]
public Base_Project Base_Project
{