提交代码

This commit is contained in:
2024-09-04 09:09:36 +08:00
parent c409f8a86a
commit 9a40154abb
2 changed files with 428 additions and 201 deletions
@@ -1,6 +1,7 @@
using BLL;
using Model;
using Newtonsoft.Json.Linq;
using Org.BouncyCastle.Asn1.Ocsp;
using System;
using System.Collections.Generic;
using System.Data;
@@ -78,7 +79,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
if (report != null)
{
//this.btnCopy.Hidden = true;
//if (this.CurrUser.PersonId == BLL.Const.sysglyId || this.CurrUser.PersonId == BLL.Const.hfnbdId)
//if (this.CurrUser.UserId == BLL.Const.sysglyId || this.CurrUser.UserId == BLL.Const.hfnbdId)
//{
// this.btnSave.Hidden = false;
//}
@@ -103,7 +104,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
drpMonth.SelectedValue = months;
drpYear.SelectedValue = year;
txtFillingDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
txtDutyPerson.Text = this.CurrUser.PersonName;
txtDutyPerson.Text = this.CurrUser.UserName;
//增加明细集合
GetNewItems(year, months);
this.Grid1.DataSource = items;
@@ -123,8 +124,16 @@ namespace FineUIPro.Web.ZHGL.Environmental
Grid1.Rows[0].CellCssClasses[5] = "f-grid-cell-uneditable";
Grid1.Rows[15].CellCssClasses[4] = "f-grid-cell-uneditable";
Grid1.Rows[15].CellCssClasses[5] = "f-grid-cell-uneditable";
Grid1.Rows[17].CellCssClasses[4] = "f-grid-cell-uneditable";
Grid1.Rows[17].CellCssClasses[5] = "f-grid-cell-uneditable";
Grid1.Rows[19].CellCssClasses[4] = "f-grid-cell-uneditable";
Grid1.Rows[19].CellCssClasses[5] = "f-grid-cell-uneditable";
Grid1.Rows[21].CellCssClasses[4] = "f-grid-cell-uneditable";
Grid1.Rows[21].CellCssClasses[5] = "f-grid-cell-uneditable";
Grid1.Rows[23].CellCssClasses[4] = "f-grid-cell-uneditable";
Grid1.Rows[23].CellCssClasses[5] = "f-grid-cell-uneditable";
Grid1.Rows[68].CellCssClasses[4] = "f-grid-cell-uneditable";
Grid1.Rows[68].CellCssClasses[5] = "f-grid-cell-uneditable";
Grid1.Rows[96].CellCssClasses[4] = "f-grid-cell-uneditable";
Grid1.Rows[96].CellCssClasses[5] = "f-grid-cell-uneditable";
}
@@ -139,20 +148,22 @@ namespace FineUIPro.Web.ZHGL.Environmental
Grid1.Rows[0].CellCssClasses[5] = "f-grid-cell-uneditable";
Grid1.Rows[15].CellCssClasses[4] = "f-grid-cell-uneditable";
Grid1.Rows[15].CellCssClasses[5] = "f-grid-cell-uneditable";
//Grid1.Rows[17].CellCssClasses[4] = "f-grid-cell-uneditable";
//Grid1.Rows[17].CellCssClasses[5] = "f-grid-cell-uneditable";
Grid1.Rows[17].CellCssClasses[4] = "f-grid-cell-uneditable";
Grid1.Rows[17].CellCssClasses[5] = "f-grid-cell-uneditable";
//Grid1.Rows[18].CellCssClasses[4] = "f-grid-cell-uneditable";
//Grid1.Rows[18].CellCssClasses[5] = "f-grid-cell-uneditable";
Grid1.Rows[19].CellCssClasses[4] = "f-grid-cell-uneditable";
Grid1.Rows[19].CellCssClasses[5] = "f-grid-cell-uneditable";
//Grid1.Rows[21].CellCssClasses[4] = "f-grid-cell-uneditable";
//Grid1.Rows[21].CellCssClasses[5] = "f-grid-cell-uneditable";
Grid1.Rows[21].CellCssClasses[4] = "f-grid-cell-uneditable";
Grid1.Rows[21].CellCssClasses[5] = "f-grid-cell-uneditable";
//Grid1.Rows[22].CellCssClasses[4] = "f-grid-cell-uneditable";
//Grid1.Rows[22].CellCssClasses[5] = "f-grid-cell-uneditable";
//Grid1.Rows[23].CellCssClasses[4] = "f-grid-cell-uneditable";
//Grid1.Rows[23].CellCssClasses[5] = "f-grid-cell-uneditable";
Grid1.Rows[23].CellCssClasses[4] = "f-grid-cell-uneditable";
Grid1.Rows[23].CellCssClasses[5] = "f-grid-cell-uneditable";
//Grid1.Rows[33].CellCssClasses[4] = "f-grid-cell-uneditable";
//Grid1.Rows[33].CellCssClasses[5] = "f-grid-cell-uneditable";
Grid1.Rows[68].CellCssClasses[4] = "f-grid-cell-uneditable";
Grid1.Rows[68].CellCssClasses[5] = "f-grid-cell-uneditable";
Grid1.Rows[96].CellCssClasses[4] = "f-grid-cell-uneditable";
Grid1.Rows[96].CellCssClasses[5] = "f-grid-cell-uneditable";
}
@@ -791,10 +802,10 @@ namespace FineUIPro.Web.ZHGL.Environmental
private void GetData()
{
decimal E6 = 0, F6 = 0, E7 = 0, F7 = 0, E8, F8, E9, F9, E10 = 0, F10 = 0, E11 = 0, F11 = 0, E12 = 0, F12 = 0, E13 = 0, F13 = 0, E14 = 0, F14 = 0, E15 = 0, F15 = 0, E16 = 0, F16 = 0, E17 = 0, F17 = 0, E18 = 0, F18 = 0, E19 = 0, F19 = 0,
E21 = 0, F21 = 0, E22 = 0, F22 = 0, E23 = 0, F23 = 0, E25 = 0, F25 = 0, E26 = 0, F26 = 0, E27 = 0, F27 = 0, E28 = 0, F28 = 0, E29, F29, E30, F30, E31, F31, E32, F32, E33, F33, E34, F34, E35, F35, E36, F36, E37, F37, E38, F38, E39, F39, E40, F40, E41, F41,
E21 = 0, F21 = 0, E22 = 0, F22 = 0, E23 = 0, F23 = 0, E25 = 0, F25 = 0, E26 = 0, F26 = 0, E27 = 0, F27 = 0, E28 = 0, F28 = 0, E29 = 0, F29 = 0, E30, F30, E31, F31, E32, F32, E33, F33, E34, F34, E35, F35, E36, F36, E37, F37, E38, F38, E39, F39, E40, F40, E41, F41,
E42, F42, E43, F43, E44, F44, E45, F45, E46, F46, E47, F47, E48, F48, E49, F49, E50, F50, E51, F51, E52, F52, E53, F53, E54, F54, E55, F55,
E56, F56, E57, F57, E58, F58, E59, F59, E60, F60, E61, F61, E62, F62, E63, F63, E64, F64, E65, F65, E66, F66, E67, F67, E68, F68, E69, F69,
E70, F70, E71, F71, E72, F72, E73, F73, E74, F74, E75, F75, E76, F76, E77, F77, E78, F78, E79, F79, E80, F80, E81, F81, E82, F82, E83, F83,
E70, F70, E71, F71, E72, F72, E73, F73, E74 = 0, F74 = 0, E75, F75, E76, F76, E77, F77, E78, F78, E79, F79, E80, F80, E81, F81, E82, F82, E83, F83,
E84, F84, E85, F85, E86, F86, E87, F87, E88, F88, E89, F89, E90, F90, E91, F91, E92, F92, E93, F93, E94, F94, E95, F95, E96, F96, E97, F97,
E98, F98, E99, F99, E100, F100, E102 = 0, F102 = 0, E103 = 0, F103 = 0;
JArray mergedData = Grid1.GetMergedData();
@@ -1699,6 +1710,18 @@ namespace FineUIPro.Web.ZHGL.Environmental
{
this.Grid1.Rows[15].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[15].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[15].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[15].Values[4].ToString()), 2).ToString() + "%";
}
if (E6 > 0 && E23 > 0)
{
this.Grid1.Rows[17].Values[4] = decimal.Round(E6 * 10000 / E23, 4);
}
if (F6 > 0 && F23 > 0)
{
this.Grid1.Rows[17].Values[5] = decimal.Round(F6 * 10000 / F23, 4);
}
if (!string.IsNullOrEmpty(this.Grid1.Rows[17].Values[4].ToString()) && this.Grid1.Rows[17].Values[4].ToString() != "0" && !string.IsNullOrEmpty(this.Grid1.Rows[17].Values[5].ToString()))
{
this.Grid1.Rows[17].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[17].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[17].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[17].Values[4].ToString()), 2).ToString() + "%";
}
if (E6 > 0 && E25 > 0)
{
this.Grid1.Rows[19].Values[4] = decimal.Round(E6 * 10000 / E25, 4);
@@ -1711,6 +1734,42 @@ namespace FineUIPro.Web.ZHGL.Environmental
{
this.Grid1.Rows[19].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[19].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[19].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[19].Values[4].ToString()), 2).ToString() + "%";
}
if (E6 > 0 && E27 > 0)
{
this.Grid1.Rows[21].Values[4] = decimal.Round(E6 * 10000 / E27, 4);
}
if (F6 > 0 && F27 > 0)
{
this.Grid1.Rows[21].Values[5] = decimal.Round(F6 * 10000 / F27, 4);
}
if (!string.IsNullOrEmpty(this.Grid1.Rows[21].Values[4].ToString()) && this.Grid1.Rows[21].Values[4].ToString() != "0" && !string.IsNullOrEmpty(this.Grid1.Rows[21].Values[5].ToString()))
{
this.Grid1.Rows[21].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[21].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[21].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[21].Values[4].ToString()), 2).ToString() + "%";
}
if (E6 > 0 && E29 > 0)
{
this.Grid1.Rows[23].Values[4] = decimal.Round(E6 * 10000 / E29, 4);
}
if (F6 > 0 && F29 > 0)
{
this.Grid1.Rows[23].Values[5] = decimal.Round(F6 * 10000 / F29, 4);
}
if (!string.IsNullOrEmpty(this.Grid1.Rows[23].Values[4].ToString()) && this.Grid1.Rows[23].Values[4].ToString() != "0" && !string.IsNullOrEmpty(this.Grid1.Rows[23].Values[5].ToString()))
{
this.Grid1.Rows[23].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[23].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[23].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[23].Values[4].ToString()), 2).ToString() + "%";
}
if (E6 > 0 && E74 > 0)
{
this.Grid1.Rows[68].Values[4] = decimal.Round(E6 * 10000 / E74, 4);
}
if (F6 > 0 && F74 > 0)
{
this.Grid1.Rows[68].Values[5] = decimal.Round(F6 * 10000 / F74, 4);
}
if (!string.IsNullOrEmpty(this.Grid1.Rows[68].Values[4].ToString()) && this.Grid1.Rows[68].Values[4].ToString() != "0" && !string.IsNullOrEmpty(this.Grid1.Rows[68].Values[5].ToString()))
{
this.Grid1.Rows[68].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[68].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[68].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[68].Values[4].ToString()), 2).ToString() + "%";
}
if (E102 > 0 && E103 > 0 && E21 > 0)
{
this.Grid1.Rows[96].Values[4] = decimal.Round((E102 + E103) / E21, 4);
@@ -1782,7 +1841,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
{
report.ChemicalReportId = SQLHelper.GetNewID(typeof(Model.Environmental_ChemicalReport));
report.UpState = BLL.Const.UpState_2;
report.FillingMan = this.CurrUser.PersonName;
report.FillingMan = this.CurrUser.UserName;
BLL.ChemicalReportService.AddChemicalReport(report);
BLL.LogService.AddSys_Log(this.CurrUser, report.Year.ToString() + "-" + report.Month.ToString(), report.ChemicalReportId, BLL.Const.ProjectChemicalReportMenuId, BLL.Const.BtnAdd);
}
@@ -1843,6 +1902,26 @@ namespace FineUIPro.Web.ZHGL.Environmental
protected void btnSave_Click(object sender, EventArgs e)
{
bool isEmpty = false;
foreach (JObject mergedRow in Grid1.GetMergedData())
{
JObject values = mergedRow.Value<JObject>("values");
int rowIndex = mergedRow.Value<int>("index");
string sortIndex = values.Value<string>("SortIndex");
if (sortIndex == "19" || sortIndex == "69" || sortIndex == "70")
{
if (Funs.GetNewDecimalOrZero(System.Web.HttpUtility.HtmlDecode(values.Value<string>("ThisYearValue"))) == 0)
{
isEmpty = true;
break;
}
}
}
if (isEmpty)
{
ShowNotify("工业总产值(可比价)、万元产值二氧化碳排放(可比价)和二氧化碳排放量不能为空,必须填报数据!", MessageBoxIcon.Warning);
return;
}
Save("add");
ShowNotify("保存成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
@@ -1850,11 +1929,51 @@ namespace FineUIPro.Web.ZHGL.Environmental
protected void btnUpdata_Click(object sender, EventArgs e)
{
bool isEmpty = false;
foreach (JObject mergedRow in Grid1.GetMergedData())
{
JObject values = mergedRow.Value<JObject>("values");
int rowIndex = mergedRow.Value<int>("index");
string sortIndex = values.Value<string>("SortIndex");
if (sortIndex == "19" || sortIndex == "69" || sortIndex == "70")
{
if (Funs.GetNewDecimalOrZero(System.Web.HttpUtility.HtmlDecode(values.Value<string>("ThisYearValue"))) == 0)
{
isEmpty = true;
break;
}
}
}
if (isEmpty)
{
ShowNotify("工业总产值(可比价)、万元产值二氧化碳排放(可比价)和二氧化碳排放量不能为空,必须填报数据!", MessageBoxIcon.Warning);
return;
}
Save("updata");
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
bool isEmpty = false;
foreach (JObject mergedRow in Grid1.GetMergedData())
{
JObject values = mergedRow.Value<JObject>("values");
int rowIndex = mergedRow.Value<int>("index");
string sortIndex = values.Value<string>("SortIndex");
if (sortIndex == "19" || sortIndex == "69" || sortIndex == "70")
{
if (Funs.GetNewDecimalOrZero(System.Web.HttpUtility.HtmlDecode(values.Value<string>("ThisYearValue"))) == 0)
{
isEmpty = true;
break;
}
}
}
if (isEmpty)
{
ShowNotify("工业总产值(可比价)、万元产值二氧化碳排放(可比价)和二氧化碳排放量不能为空,必须填报数据!", MessageBoxIcon.Warning);
return;
}
Save("submit");
}
#endregion
@@ -1937,7 +2056,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
/// <returns></returns>
private void GetButtonPower()
{
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.ProjectChemicalReportMenuId);
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ProjectChemicalReportMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnSave))
@@ -1975,9 +2094,9 @@ namespace FineUIPro.Web.ZHGL.Environmental
newChemicalReport.UnitId = this.drpUnit.SelectedValue;
newChemicalReport.Year = Convert.ToInt32(this.drpYear.SelectedValue);
newChemicalReport.Month = Convert.ToInt32(this.drpMonth.SelectedValue);
newChemicalReport.FillingMan = this.CurrUser.PersonName;
newChemicalReport.FillingMan = this.CurrUser.UserName;
newChemicalReport.FillingDate = DateTime.Now;
newChemicalReport.DutyPerson = this.CurrUser.PersonName;
newChemicalReport.DutyPerson = this.CurrUser.UserName;
newChemicalReport.UpState = BLL.Const.UpState_2;
BLL.ChemicalReportService.AddChemicalReport(newChemicalReport);