From d02a7a1abc260eb67dc7fab3fe6f8e0602c952d4 Mon Sep 17 00:00:00 2001 From: "754998852@qq.com" <754998852@qq.com> Date: Fri, 25 Oct 2024 18:17:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=9B=86=E5=9B=A2=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../版本日志/SUBQHSE_V2024-10-16-phf.sql | 42 + .../版本日志/SUBQHSE_V2024-10-23-phf.sql | 7 + SGGL/BLL/WebService/CNCECHSSEWebService.cs | 50 +- SGGL/BLL/ZHGL/DataSync/ServerService.cs | 70 +- .../Environmental/EnergyreportItemService .cs | 63 +- .../ArchitectureReportSave.aspx.cs | 36 +- .../Environmental/ChemicalReportSave.aspx.cs | 4 + .../ZHGL/Environmental/EnergyReport.aspx | 2 + .../ZHGL/Environmental/EnergyReport.aspx.cs | 58 +- .../ZHGL/Environmental/EnergyReportSave.aspx | 13 +- .../Environmental/EnergyReportSave.aspx.cs | 195 +- .../ZHGL/Environmental/OperationReport.aspx | 18 +- .../Environmental/OperationReport.aspx.cs | 63 +- .../OperationReport.aspx.designer.cs | 27 - .../Environmental/OperationReportEdit.aspx | 163 +- .../Environmental/OperationReportEdit.aspx.cs | 207 +- .../OperationReportEdit.aspx.designer.cs | 252 +- SGGL/Model/APIItem/EPSummaryReport.cs | 17 +- SGGL/Model/APIItem/EnergyReportItem.cs | 1 + .../Environmental_OperationReportDto.cs | 74 + SGGL/Model/Model.cs | 2950 ++++++++--------- SGGL/Model/Model.csproj | 1 + 22 files changed, 2251 insertions(+), 2062 deletions(-) create mode 100644 DataBase/版本日志/SUBQHSE_V2024-10-16-phf.sql create mode 100644 DataBase/版本日志/SUBQHSE_V2024-10-23-phf.sql create mode 100644 SGGL/Model/APIItem/Environmental_OperationReportDto.cs diff --git a/DataBase/版本日志/SUBQHSE_V2024-10-16-phf.sql b/DataBase/版本日志/SUBQHSE_V2024-10-16-phf.sql new file mode 100644 index 00000000..58e8b765 --- /dev/null +++ b/DataBase/版本日志/SUBQHSE_V2024-10-16-phf.sql @@ -0,0 +1,42 @@ +alter table Environmental_OperationReport drop column Code +alter table Environmental_OperationReport drop column UnitLevel +alter table Environmental_OperationReport drop column CreateDate +alter table Environmental_OperationReport drop column Place +alter table Environmental_OperationReport drop column PersonNum +alter table Environmental_OperationReport drop column TotalAssets +alter table Environmental_OperationReport drop column TotalValue +alter table Environmental_OperationReport drop column NewInvestment +GO + +CREATE TABLE [dbo].[Environmental_OperationReportItem]( + [BusinessReportItemId] [nvarchar](50) NOT NULL, + [BusinessReportId] [nvarchar](50) NULL, + [SortIndex] [int] NULL, + [Code] [nvarchar](50) NULL, + [UnitLevel] [nvarchar](50) NULL, + [CreateDate] [datetime] NULL, + [Place] [nvarchar](200) NULL, + [PersonNum] [int] NULL, + [TotalAssets] [decimal](18, 4) NULL, + [TotalValue] [decimal](18, 4) NULL, + [NewInvestment] [decimal](18, 4) NULL, + [UnitName] [nvarchar](200) NULL, + [SortUnitName] [nvarchar](200) NULL, + CONSTRAINT [PK_Environmental_OperationReportItem] PRIMARY KEY CLUSTERED +( + [BusinessReportItemId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[Environmental_OperationReportItem] WITH CHECK ADD CONSTRAINT [FK_Environmental_OperationReportItem_Environmental_OperationReport] FOREIGN KEY([BusinessReportId]) +REFERENCES [dbo].[Environmental_OperationReport] ([BusinessReportId]) +GO + +ALTER TABLE [dbo].[Environmental_OperationReportItem] CHECK CONSTRAINT [FK_Environmental_OperationReportItem_Environmental_OperationReport] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ҵܻҵҵ;Ӫϸ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Environmental_OperationReportItem' +GO + +update sys_menu set IsUsed=0 where menuid='EFA6E45F-1267-4804-BEE7-41E0C5461204'; \ No newline at end of file diff --git a/DataBase/版本日志/SUBQHSE_V2024-10-23-phf.sql b/DataBase/版本日志/SUBQHSE_V2024-10-23-phf.sql new file mode 100644 index 00000000..4fdbb4c1 --- /dev/null +++ b/DataBase/版本日志/SUBQHSE_V2024-10-23-phf.sql @@ -0,0 +1,7 @@ +--Ϊ˵λ +alter table Environmental_EnergyReportItem +add SortUnit int NULL +GO + +update Environmental_EnergyReportItem set SortUnit=1 where EnergyReportId='template'; + diff --git a/SGGL/BLL/WebService/CNCECHSSEWebService.cs b/SGGL/BLL/WebService/CNCECHSSEWebService.cs index 43b374c5..ee7bcc3d 100644 --- a/SGGL/BLL/WebService/CNCECHSSEWebService.cs +++ b/SGGL/BLL/WebService/CNCECHSSEWebService.cs @@ -893,6 +893,27 @@ #endregion #region 中央企业环保产业企业基本情况和经营情况汇总表 + private static List getreportItemList(string BusinessReportId) + { + return Funs.DB.Environmental_OperationReportItem.Where(x => x.BusinessReportId == BusinessReportId) + .OrderBy(x => x.SortIndex).OrderBy(x => x.SortUnitName).Select(x => new Model.reportItemListDto() + { + BusinessReportItemId = x.BusinessReportItemId, + BusinessReportId = x.BusinessReportId, + SortIndex = x.SortIndex, + Code = x.Code, + UnitLevel = x.UnitLevel, + CreateDate = x.CreateDate, + Place = x.Place, + PersonNum = x.PersonNum, + TotalAssets = x.TotalAssets, + TotalValue = x.TotalValue, + NewInvestment = x.NewInvestment, + UnitName = x.UnitName, + SortUnitName = x.SortUnitName + }).ToList(); + } + public static string UpOperationReport(string businessReportId, Model.Sys_User CurrUser) { @@ -903,29 +924,22 @@ { var upReport = from x in db.Environmental_OperationReport where x.BusinessReportId == businessReportId - select new Model.OperationReportDto + select new Model.Environmental_OperationReportDto { BusinessReportId = x.BusinessReportId, UnitId = x.UnitId, Year = x.Year, Quarters = x.Quarters, - Code = x.Code, - UnitLevel = x.UnitLevel, - CreateDate = x.CreateDate, - Place = x.Place, - PersonNum = x.PersonNum, - TotalAssets = x.TotalAssets, - TotalValue = x.TotalValue, - NewInvestment = x.NewInvestment, FillingMan = x.FillingMan, FillingDate = x.FillingDate, StatisticsDutyPerson = x.StatisticsDutyPerson, UnitDutyPerson = x.UnitDutyPerson, - Remark = x.Remark + Remark = x.Remark, + reportItemList = getreportItemList(x.BusinessReportId) }; //新接口Api - code = UpApiOperationReport(upReport).ToString(); + code = UpApiOperationReportNew(upReport).ToString(); if (code == "1") { var report = db.Environmental_OperationReport.FirstOrDefault(e => e.BusinessReportId == businessReportId); @@ -951,6 +965,7 @@ } + #region 上报中央企业环保产业企业基本情况和经营情况季表 private static int UpApiOperationReport(IQueryable upReport) { string baseurl = "/api/InformationData/SaveOperationReport"; @@ -959,6 +974,16 @@ return responeData.code; } + private static int UpApiOperationReportNew(IQueryable upReport) + { + string baseurl = "/api/InformationData/SaveOperationReportNew"; + var resultJsonReport = JsonConvert.SerializeObject(upReport.FirstOrDefault()); + var responeData = BLL.ServerService.PushCNCEC(resultJsonReport, baseurl); + return responeData.code; + } + + + #endregion #endregion @@ -973,7 +998,7 @@ { try { - CNCECHSSEService.HSSEServiceClient hsseC = new CNCECHSSEService.HSSEServiceClient(); + var upReport = from x in db.Environmental_EnergyReport where x.EnergyReportId == energyReportId select new Model.EnergyReport @@ -1014,6 +1039,7 @@ ServiceOperatingIncome_BasePeriod = x.ServiceOperatingIncome_BasePeriod, ServiceOperatingIncome_LastYear = x.ServiceOperatingIncome_LastYear, ServiceOperatingIncome_ThisYear = x.ServiceOperatingIncome_ThisYear, + SortUnit = x.SortUnit }; //老接口Serveice diff --git a/SGGL/BLL/ZHGL/DataSync/ServerService.cs b/SGGL/BLL/ZHGL/DataSync/ServerService.cs index 77ad9f81..490d4fb8 100644 --- a/SGGL/BLL/ZHGL/DataSync/ServerService.cs +++ b/SGGL/BLL/ZHGL/DataSync/ServerService.cs @@ -11,7 +11,7 @@ using System.Threading.Tasks; namespace BLL { - public static class ServerService + public static class ServerService { public static Model.TokenItem GetCNCECToken() { @@ -30,47 +30,53 @@ namespace BLL Console.WriteLine(response.Content); var responeData = JsonConvert.DeserializeObject(response.Content.ToString()); TokenItem tokenItem = new TokenItem(); - if (responeData.code==1&&string .IsNullOrEmpty(responeData.message) ) + if (responeData.code == 1 && string.IsNullOrEmpty(responeData.message)) { var token = JsonConvert.DeserializeObject(responeData.data.ToString()); - tokenItem.Token=token.Token.ToString(); - tokenItem.ExpiryTime= token.ExpiryTime.ToString(); + tokenItem.Token = token.Token.ToString(); + tokenItem.ExpiryTime = token.ExpiryTime.ToString(); SysConstSetService.SetToken(tokenItem.Token); SysConstSetService.SetTokenExpirationTime(tokenItem.ExpiryTime); } return tokenItem; - - } - public static Model.ReturnData PushCNCEC(string JsonBody,string apiurl) - { - Model.ReturnData responeData = new Model.ReturnData(); - string CNCECPath = SysConstSetService.CNCECPath; - if (string.IsNullOrEmpty(CNCECPath)) - { - responeData.code = 0; - responeData.message = "接口地址为空,请配置!"; - return responeData; - } - string baseurl = CNCECPath + apiurl; - var client = new RestClient(baseurl); - client.Timeout = -1; - var request = new RestRequest(Method.POST); - ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; - var tokenItem = GetToken(); - request.AddHeader("token", tokenItem.Token); - request.AddJsonBody(JsonBody); - IRestResponse response = client.Execute(request); - APICommonService.SaveSysHttpLog("api_Out", baseurl, response.Content); - var returnData = JsonConvert.DeserializeObject(response.Content.ToString()); - if (returnData.code == 0) + } + public static Model.ReturnData PushCNCEC(string JsonBody, string apiurl) + { + try { - responeData.code = 0; + + + Model.ReturnData responeData = new Model.ReturnData(); + string CNCECPath = SysConstSetService.CNCECPath; + //string CNCECPath = "http://localhost:7143"; + if (string.IsNullOrEmpty(CNCECPath)) + { + responeData.code = 0; + responeData.message = "接口地址为空,请配置!"; + return responeData; + + } + string baseurl = CNCECPath + apiurl; + var client = new RestClient(baseurl); + client.Timeout = -1; + var request = new RestRequest(Method.POST); + ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; + var tokenItem = GetToken(); + request.AddHeader("token", tokenItem.Token); + request.AddJsonBody(JsonBody); + IRestResponse response = client.Execute(request); + APICommonService.SaveSysHttpLog("api_Out", baseurl, response.Content); + var returnData = JsonConvert.DeserializeObject(response.Content.ToString()); + responeData.code = returnData.code; responeData.message = returnData.message; return responeData; - } - return responeData; + catch (Exception ex) + { + + throw; + } } public static Model.TokenItem GetToken() { @@ -81,7 +87,7 @@ namespace BLL { //DateTime.Parse(SysConstSetService.CNCECTTokenExTime).AddMinutes(-10) > DateTime.Now tokenItem = GetCNCECToken(); - } + } else if (DateTime.Parse(SysConstSetService.CNCECTTokenExTime).AddMinutes(-10) < DateTime.Now) { tokenItem = GetCNCECToken(); diff --git a/SGGL/BLL/ZHGL/Environmental/EnergyreportItemService .cs b/SGGL/BLL/ZHGL/Environmental/EnergyreportItemService .cs index c08460be..832249c5 100644 --- a/SGGL/BLL/ZHGL/Environmental/EnergyreportItemService .cs +++ b/SGGL/BLL/ZHGL/Environmental/EnergyreportItemService .cs @@ -99,7 +99,7 @@ namespace BLL { return (from x in Funs.DB.Environmental_EnergyReportItem where x.EnergyReportId == EnergyReportId - orderby x.SortIndex + orderby x.SortIndex,x.SortUnit select x).ToList(); } @@ -141,38 +141,39 @@ namespace BLL { var q = (from x in Funs.DB.Environmental_EnergyReportItem where x.EnergyReportId == EnergyReportId - orderby x.SortIndex + orderby x.SortIndex,x.SortUnit select x).ToList(); - List newItems = new List(); - foreach (var item in q) - { - Model.Environmental_EnergyReportItem newItem = new Model.Environmental_EnergyReportItem(); + //List newItems = new List(); + //foreach (var item in q) + //{ + // Model.Environmental_EnergyReportItem newItem = new Model.Environmental_EnergyReportItem(); - newItem.EnergyReportItemId = item.EnergyReportItemId; - newItem.EnergyReportId = item.EnergyReportId; - newItem.SortIndex = item.SortIndex; - newItem.BusinessCategory = item.BusinessCategory; - newItem.Throughput_BasePeriod = item.Throughput_BasePeriod; - newItem.Throughput_LastPeriod = item.Throughput_LastPeriod; - newItem.Throughput_ThisPeriod = item.Throughput_ThisPeriod; - newItem.Throughput_UnitOfMeasurement = item.Throughput_UnitOfMeasurement; - newItem.Yield_BasePeriod = item.Yield_BasePeriod; - newItem.Yield_LastPeriod = item.Yield_LastPeriod; - newItem.Yield_ThisPeriod = item.Yield_ThisPeriod; - newItem.Yield_UnitOfMeasurement = item.Yield_UnitOfMeasurement; - newItem.OutputValue_BasePeriod = item.OutputValue_BasePeriod; - newItem.OutputValue_LastYear = item.OutputValue_LastYear; - newItem.OutputValue_ThisYear = item.OutputValue_ThisYear; - newItem.OperationScale_BasePeriod = item.OperationScale_BasePeriod; - newItem.OperationScale_LastYear = item.OperationScale_LastYear; - newItem.OperationScale_ThisYear = item.OperationScale_ThisYear; - newItem.OperationScale_UnitOfMeasurement = item.OperationScale_UnitOfMeasurement; - newItem.ServiceOperatingIncome_BasePeriod = item.ServiceOperatingIncome_BasePeriod; - newItem.ServiceOperatingIncome_LastYear = item.ServiceOperatingIncome_LastYear; - newItem.ServiceOperatingIncome_ThisYear = item.ServiceOperatingIncome_ThisYear; - newItems.Add(newItem); - } - return newItems; + // newItem.EnergyReportItemId = item.EnergyReportItemId; + // newItem.EnergyReportId = item.EnergyReportId; + // newItem.SortIndex = item.SortIndex; + // newItem.BusinessCategory = item.BusinessCategory; + // newItem.Throughput_BasePeriod = item.Throughput_BasePeriod; + // newItem.Throughput_LastPeriod = item.Throughput_LastPeriod; + // newItem.Throughput_ThisPeriod = item.Throughput_ThisPeriod; + // newItem.Throughput_UnitOfMeasurement = item.Throughput_UnitOfMeasurement; + // newItem.Yield_BasePeriod = item.Yield_BasePeriod; + // newItem.Yield_LastPeriod = item.Yield_LastPeriod; + // newItem.Yield_ThisPeriod = item.Yield_ThisPeriod; + // newItem.Yield_UnitOfMeasurement = item.Yield_UnitOfMeasurement; + // newItem.OutputValue_BasePeriod = item.OutputValue_BasePeriod; + // newItem.OutputValue_LastYear = item.OutputValue_LastYear; + // newItem.OutputValue_ThisYear = item.OutputValue_ThisYear; + // newItem.OperationScale_BasePeriod = item.OperationScale_BasePeriod; + // newItem.OperationScale_LastYear = item.OperationScale_LastYear; + // newItem.OperationScale_ThisYear = item.OperationScale_ThisYear; + // newItem.OperationScale_UnitOfMeasurement = item.OperationScale_UnitOfMeasurement; + // newItem.ServiceOperatingIncome_BasePeriod = item.ServiceOperatingIncome_BasePeriod; + // newItem.ServiceOperatingIncome_LastYear = item.ServiceOperatingIncome_LastYear; + // newItem.ServiceOperatingIncome_ThisYear = item.ServiceOperatingIncome_ThisYear; + + // newItems.Add(newItem); + //} + return q; } public static void AddEnvironmental_EnergyReportItem(Model.Environmental_EnergyReportItem newtable) { diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReportSave.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReportSave.aspx.cs index 1db3c6e5..b1ba052f 100644 --- a/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReportSave.aspx.cs +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ArchitectureReportSave.aspx.cs @@ -1093,11 +1093,11 @@ namespace FineUIPro.Web.ZHGL.Environmental { this.Grid1.Rows[0].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()), 2).ToString() + "%"; } - if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E20 > 0) + if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E20 != 0) { this.Grid1.Rows[14].Values[4] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()) * 10000 / E20, 4); } - if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F20 > 0) + if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F20 != 0) { this.Grid1.Rows[14].Values[5] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) * 10000 / F20, 4); } @@ -1105,11 +1105,11 @@ namespace FineUIPro.Web.ZHGL.Environmental { this.Grid1.Rows[14].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[14].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[14].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[14].Values[4].ToString()), 2).ToString() + "%"; } - if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E22 > 0) + if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E22 != 0) { this.Grid1.Rows[16].Values[4] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()) * 10000 / E22, 4); } - if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F22 > 0) + if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F22 != 0) { this.Grid1.Rows[16].Values[5] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) * 10000 / F22, 4); } @@ -1117,11 +1117,11 @@ namespace FineUIPro.Web.ZHGL.Environmental { this.Grid1.Rows[16].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[16].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[16].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[16].Values[4].ToString()), 2).ToString() + "%"; } - if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E24 > 0) + if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E24 != 0) { this.Grid1.Rows[18].Values[4] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()) * 10000 / E24, 4); } - if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F24 > 0) + if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F24 != 0) { this.Grid1.Rows[18].Values[5] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) * 10000 / F24, 4); } @@ -1129,11 +1129,11 @@ namespace FineUIPro.Web.ZHGL.Environmental { this.Grid1.Rows[18].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[18].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[18].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[18].Values[4].ToString()), 2).ToString() + "%"; } - if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E26 > 0) + if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E26 != 0) { this.Grid1.Rows[20].Values[4] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()) * 10000 / E26, 4); } - if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F26 > 0) + if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F26 != 0) { this.Grid1.Rows[20].Values[5] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) * 10000 / F26, 4); } @@ -1141,11 +1141,11 @@ namespace FineUIPro.Web.ZHGL.Environmental { this.Grid1.Rows[20].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[20].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[20].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[20].Values[4].ToString()), 2).ToString() + "%"; } - if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E28 > 0) + if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E28 != 0) { this.Grid1.Rows[22].Values[4] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()) * 10000 / E28, 4); } - if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F28 > 0) + if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F28 != 0) { this.Grid1.Rows[22].Values[5] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) * 10000 / F28, 4); } @@ -1153,11 +1153,11 @@ namespace FineUIPro.Web.ZHGL.Environmental { this.Grid1.Rows[22].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[22].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[22].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[22].Values[4].ToString()), 2).ToString() + "%"; } - if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E42 > 0) + if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[4].ToString()) && E42 != 0) { this.Grid1.Rows[36].Values[4] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[4].ToString()) * 10000 / E42, 4); } - if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F42 > 0) + if (!string.IsNullOrEmpty(this.Grid1.Rows[0].Values[5].ToString()) && F42 != 0) { this.Grid1.Rows[36].Values[5] = decimal.Round(Funs.GetNewDecimalOrZero(this.Grid1.Rows[0].Values[5].ToString()) * 10000 / F42, 4); } @@ -1165,11 +1165,11 @@ namespace FineUIPro.Web.ZHGL.Environmental { this.Grid1.Rows[36].Values[6] = decimal.Round((Funs.GetNewDecimalOrZero(this.Grid1.Rows[36].Values[5].ToString()) - Funs.GetNewDecimalOrZero(this.Grid1.Rows[36].Values[4].ToString())) * 100 / Funs.GetNewDecimalOrZero(this.Grid1.Rows[36].Values[4].ToString()), 2).ToString() + "%"; } - if (E64 > 0 && E65 > 0 && E20 > 0) + if (E64 != 0 && E65 != 0 && E20 != 0) { this.Grid1.Rows[58].Values[4] = decimal.Round((E64 + E65) / E20, 4); } - if (F64 > 0 && F65 > 0 && F20 > 0) + if (F64 != 0 && F65 != 0 && F20 != 0) { this.Grid1.Rows[58].Values[5] = decimal.Round((F64 + F65) / F20, 4); } @@ -1265,6 +1265,10 @@ namespace FineUIPro.Web.ZHGL.Environmental PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); return; } + else if (code=="3") + { + Alert.ShowInParent("集团当前季度数据已锁定,无法上传!", MessageBoxIcon.Error); + } else { Alert.ShowInParent("同步异常,请退出后重试!", MessageBoxIcon.Error); @@ -1280,7 +1284,7 @@ namespace FineUIPro.Web.ZHGL.Environmental protected void btnSave_Click(object sender, EventArgs e) { - bool isEmpty = false; + /* bool isEmpty = false; foreach (JObject mergedRow in Grid1.GetMergedData()) { JObject values = mergedRow.Value("values"); @@ -1299,7 +1303,7 @@ namespace FineUIPro.Web.ZHGL.Environmental { ShowNotify("营业收入(可比价)、万元收入二氧化碳排放(可比价)和二氧化碳排放量不能为空,必须填报数据!", MessageBoxIcon.Warning); return; - } + }*/ Save("add"); ShowNotify("保存成功!", MessageBoxIcon.Success); PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/ChemicalReportSave.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/ChemicalReportSave.aspx.cs index 9c54e727..5dddd492 100644 --- a/SGGL/FineUIPro.Web/ZHGL/Environmental/ChemicalReportSave.aspx.cs +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/ChemicalReportSave.aspx.cs @@ -1887,6 +1887,10 @@ namespace FineUIPro.Web.ZHGL.Environmental PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); return; } + else if (code == "3") + { + Alert.ShowInParent("集团当前季度数据已锁定,无法上传!", MessageBoxIcon.Error); + } else { Alert.ShowInParent("同步异常,请退出后重试!", MessageBoxIcon.Error); diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/EnergyReport.aspx b/SGGL/FineUIPro.Web/ZHGL/Environmental/EnergyReport.aspx index d84c07bb..3542c4d8 100644 --- a/SGGL/FineUIPro.Web/ZHGL/Environmental/EnergyReport.aspx +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/EnergyReport.aspx @@ -161,6 +161,8 @@ diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/EnergyReport.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/Environmental/EnergyReport.aspx.cs index abad4c6f..a71cd23c 100644 --- a/SGGL/FineUIPro.Web/ZHGL/Environmental/EnergyReport.aspx.cs +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/EnergyReport.aspx.cs @@ -86,35 +86,35 @@ namespace FineUIPro.Web.ZHGL.Environmental var businessCategorys = EnergyreportItemService.GetItems("Template"); //之前月度合计值集合 List reportItems = BLL.EnergyreportItemService.GetItems(report.EnergyReportId); - List newItemList = new List(); - foreach (var item in reportItems) - { - Model.Environmental_EnergyReportItem newItem = new Model.Environmental_EnergyReportItem(); - newItem.EnergyReportItemId = item.EnergyReportItemId; - newItem.EnergyReportId = item.EnergyReportId; - newItem.SortIndex = item.SortIndex; - newItem.BusinessCategory = item.BusinessCategory; - newItem.Throughput_BasePeriod = item.Throughput_BasePeriod; - newItem.Throughput_LastPeriod = item.Throughput_LastPeriod; - newItem.Throughput_ThisPeriod = item.Throughput_ThisPeriod; - newItem.Throughput_UnitOfMeasurement = item.Throughput_UnitOfMeasurement; - newItem.Yield_BasePeriod = item.Yield_BasePeriod; - newItem.Yield_LastPeriod = item.Yield_LastPeriod; - newItem.Yield_ThisPeriod = item.Yield_ThisPeriod; - newItem.Yield_UnitOfMeasurement = item.Yield_UnitOfMeasurement; - newItem.OutputValue_BasePeriod = item.OutputValue_BasePeriod; - newItem.OutputValue_LastYear = item.OutputValue_LastYear; - newItem.OutputValue_ThisYear = item.OutputValue_ThisYear; - newItem.OperationScale_BasePeriod = item.OperationScale_BasePeriod; - newItem.OperationScale_LastYear = item.OperationScale_LastYear; - newItem.OperationScale_ThisYear = item.OperationScale_ThisYear; - newItem.OperationScale_UnitOfMeasurement = item.OperationScale_UnitOfMeasurement; - newItem.ServiceOperatingIncome_BasePeriod = item.ServiceOperatingIncome_BasePeriod; - newItem.ServiceOperatingIncome_LastYear = item.ServiceOperatingIncome_LastYear; - newItem.ServiceOperatingIncome_ThisYear = item.ServiceOperatingIncome_ThisYear; - newItemList.Add(item); - } - Grid1.DataSource = newItemList; + //List newItemList = new List(); + //foreach (var item in reportItems) + //{ + // Model.Environmental_EnergyReportItem newItem = new Model.Environmental_EnergyReportItem(); + // newItem.EnergyReportItemId = item.EnergyReportItemId; + // newItem.EnergyReportId = item.EnergyReportId; + // newItem.SortIndex = item.SortIndex; + // newItem.BusinessCategory = item.BusinessCategory; + // newItem.Throughput_BasePeriod = item.Throughput_BasePeriod; + // newItem.Throughput_LastPeriod = item.Throughput_LastPeriod; + // newItem.Throughput_ThisPeriod = item.Throughput_ThisPeriod; + // newItem.Throughput_UnitOfMeasurement = item.Throughput_UnitOfMeasurement; + // newItem.Yield_BasePeriod = item.Yield_BasePeriod; + // newItem.Yield_LastPeriod = item.Yield_LastPeriod; + // newItem.Yield_ThisPeriod = item.Yield_ThisPeriod; + // newItem.Yield_UnitOfMeasurement = item.Yield_UnitOfMeasurement; + // newItem.OutputValue_BasePeriod = item.OutputValue_BasePeriod; + // newItem.OutputValue_LastYear = item.OutputValue_LastYear; + // newItem.OutputValue_ThisYear = item.OutputValue_ThisYear; + // newItem.OperationScale_BasePeriod = item.OperationScale_BasePeriod; + // newItem.OperationScale_LastYear = item.OperationScale_LastYear; + // newItem.OperationScale_ThisYear = item.OperationScale_ThisYear; + // newItem.OperationScale_UnitOfMeasurement = item.OperationScale_UnitOfMeasurement; + // newItem.ServiceOperatingIncome_BasePeriod = item.ServiceOperatingIncome_BasePeriod; + // newItem.ServiceOperatingIncome_LastYear = item.ServiceOperatingIncome_LastYear; + // newItem.ServiceOperatingIncome_ThisYear = item.ServiceOperatingIncome_ThisYear; + // newItemList.Add(item); + //} + Grid1.DataSource = reportItems; Grid1.DataBind(); } else diff --git a/SGGL/FineUIPro.Web/ZHGL/Environmental/EnergyReportSave.aspx b/SGGL/FineUIPro.Web/ZHGL/Environmental/EnergyReportSave.aspx index 7c96db24..748535a4 100644 --- a/SGGL/FineUIPro.Web/ZHGL/Environmental/EnergyReportSave.aspx +++ b/SGGL/FineUIPro.Web/ZHGL/Environmental/EnergyReportSave.aspx @@ -48,8 +48,9 @@ + EnableHeaderMenu="false" Height="700px"> + @@ -191,6 +192,12 @@ + + + + @@ -209,7 +216,7 @@ ValidateForms="SimpleForm1" OnClick="btnCopy_Click" Hidden="true"> --%> -