增加集团报表
This commit is contained in:
parent
6ca0a319b1
commit
d02a7a1abc
|
@ -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';
|
|
@ -0,0 +1,7 @@
|
|||
--增加为了单位排序
|
||||
alter table Environmental_EnergyReportItem
|
||||
add SortUnit int NULL
|
||||
GO
|
||||
|
||||
update Environmental_EnergyReportItem set SortUnit=1 where EnergyReportId='template';
|
||||
|
|
@ -893,6 +893,27 @@
|
|||
#endregion
|
||||
|
||||
#region 中央企业环保产业企业基本情况和经营情况汇总表
|
||||
private static List<Model.reportItemListDto> 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<Model.OperationReportDto> upReport)
|
||||
{
|
||||
string baseurl = "/api/InformationData/SaveOperationReport";
|
||||
|
@ -959,6 +974,16 @@
|
|||
return responeData.code;
|
||||
}
|
||||
|
||||
private static int UpApiOperationReportNew(IQueryable<Model.Environmental_OperationReportDto> 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
|
||||
|
|
|
@ -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<Model.ResponeData>(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<Model.TokenItem>(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<Model.ResponeData>(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<Model.ResponeData>(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();
|
||||
|
|
|
@ -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<Model.Environmental_EnergyReportItem> newItems = new List<Model.Environmental_EnergyReportItem>();
|
||||
foreach (var item in q)
|
||||
{
|
||||
Model.Environmental_EnergyReportItem newItem = new Model.Environmental_EnergyReportItem();
|
||||
//List<Model.Environmental_EnergyReportItem> newItems = new List<Model.Environmental_EnergyReportItem>();
|
||||
//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)
|
||||
{
|
||||
|
|
|
@ -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<JObject>("values");
|
||||
|
@ -1299,7 +1303,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
|||
{
|
||||
ShowNotify("营业收入(可比价)、万元收入二氧化碳排放(可比价)和二氧化碳排放量不能为空,必须填报数据!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
}*/
|
||||
Save("add");
|
||||
ShowNotify("保存成功!", MessageBoxIcon.Success);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -161,6 +161,8 @@
|
|||
<script type="text/jscript">
|
||||
function renderIndexName(value) {
|
||||
return value.replace("\t", " ").replace("\t\t", "  ")
|
||||
.replace("A", " ")
|
||||
.replace("B", " ")
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
|
|
@ -86,35 +86,35 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
|||
var businessCategorys = EnergyreportItemService.GetItems("Template");
|
||||
//之前月度合计值集合
|
||||
List<Model.Environmental_EnergyReportItem> reportItems = BLL.EnergyreportItemService.GetItems(report.EnergyReportId);
|
||||
List<Model.Environmental_EnergyReportItem> newItemList = new List<Model.Environmental_EnergyReportItem>();
|
||||
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<Model.Environmental_EnergyReportItem> newItemList = new List<Model.Environmental_EnergyReportItem>();
|
||||
//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
|
||||
|
|
|
@ -48,8 +48,9 @@
|
|||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" EnableCollapse="true" runat="server"
|
||||
BoxFlex="1" DataKeyNames="EnergyReportItemId" AllowCellEditing="true" ForceFit="false"
|
||||
ClicksToEdit="1" DataIDField="EnergyReportItemId" EnableColumnLines="true" OnRowDataBound="Grid1_RowDataBound"
|
||||
EnableHeaderMenu="false" Height="380px">
|
||||
EnableHeaderMenu="false" Height="700px">
|
||||
<Columns>
|
||||
|
||||
<f:RenderField Width="400px" ColumnID="BusinessCategory" DataField="BusinessCategory" FieldType="String"
|
||||
HeaderText="业务类别" HeaderTextAlign="Center" TextAlign="Left" RendererFunction="renderIndexName">
|
||||
</f:RenderField>
|
||||
|
@ -191,6 +192,12 @@
|
|||
</f:RenderField>
|
||||
</Columns>
|
||||
</f:GroupField>
|
||||
|
||||
<f:RenderField Width="100px" ColumnID="SortUnit" DataField="SortUnit" FieldType="String" Hidden="true"
|
||||
HeaderText="排序" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
|
||||
|
||||
</Columns>
|
||||
</f:GroupField>
|
||||
</Columns>
|
||||
|
@ -209,7 +216,7 @@
|
|||
ValidateForms="SimpleForm1" OnClick="btnCopy_Click" Hidden="true">
|
||||
</f:Button>--%>
|
||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" Hidden="true" Text="保存"
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" Hidden="true" Text="计算合计并保存"
|
||||
ValidateForms="SimpleForm1" OnClick="btnSave_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnUpdata" Icon="PageSave" runat="server" ConfirmText="确定上报?" Text="上报" Hidden="true"
|
||||
|
@ -227,6 +234,8 @@
|
|||
<script type="text/jscript">
|
||||
function renderIndexName(value) {
|
||||
return value.replace("\t", " ").replace("\t\t", "  ")
|
||||
.replace("A", " ")
|
||||
.replace("B", " ")
|
||||
}
|
||||
|
||||
function onGridAfterEdit(event, value, params) {
|
||||
|
|
|
@ -5,6 +5,7 @@ using Org.BouncyCastle.Asn1.Ocsp;
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
|
@ -114,11 +115,11 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
|||
}
|
||||
else
|
||||
{
|
||||
string arg = GetRequestEventArgument(); // 此函数所在文件:PageBase.cs
|
||||
if (arg == "UPDATE_SUMMARY")
|
||||
{
|
||||
SaveData();
|
||||
}
|
||||
//string arg = GetRequestEventArgument(); // 此函数所在文件:PageBase.cs
|
||||
//if (arg == "UPDATE_SUMMARY")
|
||||
//{
|
||||
// SaveData();
|
||||
//}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -130,7 +131,8 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
|||
{
|
||||
JObject values = mergedRow.Value<JObject>("values");
|
||||
string sortIndex = values.Value<string>("SortIndex");
|
||||
var newItem = items.FirstOrDefault(x => x.SortIndex == sortIndex);
|
||||
var SortUnit = values.Value<int>("SortUnit");
|
||||
var newItem = items.FirstOrDefault(x => x.SortIndex == sortIndex && x.SortUnit == SortUnit);
|
||||
if (newItem != null)
|
||||
{
|
||||
newItem.EnergyReportItemId = SQLHelper.GetNewID();
|
||||
|
@ -138,17 +140,17 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
|||
newItem.SortIndex = values.Value<string>("SortIndex");
|
||||
newItem.BusinessCategory = values.Value<string>("BusinessCategory");
|
||||
newItem.Throughput_BasePeriod = Funs.GetNewDecimalOrZero(values.Value<string>("Throughput_BasePeriod")).ToString();
|
||||
newItem.Throughput_LastPeriod = Funs.GetNewDecimalOrZero(values.Value<string>("Throughput_LastPeriod")).ToString();
|
||||
newItem.Throughput_ThisPeriod = Funs.GetNewDecimalOrZero(values.Value<string>("Throughput_ThisPeriod")).ToString();
|
||||
newItem.Throughput_LastPeriod = Funs.GetNewDecimalOrZero(values.Value<string>("Throughput_LastPeriod")).ToString();
|
||||
newItem.Throughput_ThisPeriod = Funs.GetNewDecimalOrZero(values.Value<string>("Throughput_ThisPeriod")).ToString();
|
||||
newItem.Throughput_UnitOfMeasurement = values.Value<string>("Throughput_UnitOfMeasurement");
|
||||
newItem.Yield_BasePeriod = Funs.GetNewDecimalOrZero(values.Value<string>("Yield_BasePeriod")).ToString();
|
||||
newItem.Yield_LastPeriod = Funs.GetNewDecimalOrZero(values.Value<string>("Yield_LastPeriod")).ToString();
|
||||
newItem.Yield_ThisPeriod = Funs.GetNewDecimalOrZero(values.Value<string>("Yield_ThisPeriod")).ToString();
|
||||
newItem.Yield_BasePeriod = Funs.GetNewDecimalOrZero(values.Value<string>("Yield_BasePeriod")).ToString();
|
||||
newItem.Yield_LastPeriod = Funs.GetNewDecimalOrZero(values.Value<string>("Yield_LastPeriod")).ToString();
|
||||
newItem.Yield_ThisPeriod = Funs.GetNewDecimalOrZero(values.Value<string>("Yield_ThisPeriod")).ToString();
|
||||
newItem.Yield_UnitOfMeasurement = values.Value<string>("Yield_UnitOfMeasurement");
|
||||
newItem.OutputValue_BasePeriod = Funs.GetNewDecimalOrZero(values.Value<string>("OutputValue_BasePeriod")).ToString();
|
||||
newItem.OutputValue_LastYear = Funs.GetNewDecimalOrZero(values.Value<string>("OutputValue_LastYear")).ToString();
|
||||
newItem.OutputValue_ThisYear = Funs.GetNewDecimalOrZero(values.Value<string>("OutputValue_ThisYear")).ToString();
|
||||
newItem.OperationScale_BasePeriod = Funs.GetNewDecimalOrZero(values.Value<string>("OperationScale_BasePeriod")).ToString();
|
||||
newItem.OutputValue_BasePeriod = Funs.GetNewDecimalOrZero(values.Value<string>("OutputValue_BasePeriod")).ToString();
|
||||
newItem.OutputValue_LastYear = Funs.GetNewDecimalOrZero(values.Value<string>("OutputValue_LastYear")).ToString();
|
||||
newItem.OutputValue_ThisYear = Funs.GetNewDecimalOrZero(values.Value<string>("OutputValue_ThisYear")).ToString();
|
||||
newItem.OperationScale_BasePeriod = Funs.GetNewDecimalOrZero(values.Value<string>("OperationScale_BasePeriod")).ToString();
|
||||
newItem.OperationScale_LastYear = Funs.GetNewDecimalOrZero(values.Value<string>("OperationScale_LastYear")).ToString();
|
||||
newItem.OperationScale_ThisYear = Funs.GetNewDecimalOrZero(values.Value<string>("OperationScale_ThisYear")).ToString();
|
||||
newItem.OperationScale_UnitOfMeasurement = values.Value<string>("OperationScale_UnitOfMeasurement");
|
||||
|
@ -204,18 +206,27 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
|||
|
||||
protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
|
||||
{
|
||||
Model.Environmental_EnergyReportItem a = (Model.Environmental_EnergyReportItem)e.DataItem;
|
||||
Model.Environmental_EnergyReportItem a = (Model.Environmental_EnergyReportItem)e.DataItem;
|
||||
e.DataItem.ToString();
|
||||
|
||||
//string SortIndex = Convert.ToString(row["SortIndex"]);
|
||||
if (a.SortIndex == "01")
|
||||
{
|
||||
|
||||
|
||||
for (int i = 0; i < e.CellCssClasses.Count(); i++)
|
||||
{
|
||||
e.CellCssClasses[i] = "f-grid-cell-uneditable";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//合计行全部禁止输入
|
||||
if (a.SortUnit == 1)
|
||||
{
|
||||
for (int i = 0; i < e.CellCssClasses.Count(); i++)
|
||||
{
|
||||
e.CellCssClasses[i] = "f-grid-cell-uneditable";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -282,35 +293,14 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
|||
EnergyReportId = report.EnergyReportId;
|
||||
BLL.EnergyreportItemService.DeleteEnergyReportItemByChemicalReportId(report.EnergyReportId);
|
||||
GetItems(report.EnergyReportId);
|
||||
List<Model.Environmental_EnergyReportItem> mReportItemList = new List<Environmental_EnergyReportItem>();
|
||||
foreach (var item in items)
|
||||
if (items.Count > 0)
|
||||
{
|
||||
Model.Environmental_EnergyReportItem newItem = new 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;
|
||||
EnergyreportItemService.AddEnvironmental_EnergyReportItem(newItem);
|
||||
mReportItemList.Add(newItem);
|
||||
Funs.DB.Environmental_EnergyReportItem.InsertAllOnSubmit(items);
|
||||
Funs.DB.SubmitChanges();
|
||||
////计算合计
|
||||
//UpdateEnvironmental_EnergyReportItem(EnergyReportId);
|
||||
}
|
||||
|
||||
if (type == "updata") //数据同步
|
||||
{
|
||||
if (report.UpState == BLL.Const.UpState_2)
|
||||
|
@ -322,6 +312,10 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
|||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
return;
|
||||
}
|
||||
else if (code == "3")
|
||||
{
|
||||
Alert.ShowInParent("集团当前季度数据已锁定,无法上传!", MessageBoxIcon.Error);
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInParent("同步异常,请退出后重试!", MessageBoxIcon.Error);
|
||||
|
@ -362,7 +356,8 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
|||
{
|
||||
JObject values = mergedRow.Value<JObject>("values");
|
||||
string sortIndex = values.Value<string>("SortIndex");
|
||||
var newItem = items.FirstOrDefault(x => x.SortIndex == sortIndex);
|
||||
var SortUnit = values.Value<int>("SortUnit");
|
||||
var newItem = items.FirstOrDefault(x => x.SortIndex == sortIndex && x.SortUnit == SortUnit);
|
||||
if (newItem != null)
|
||||
{
|
||||
newItem.EnergyReportItemId = SQLHelper.GetNewID();
|
||||
|
@ -391,11 +386,63 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
|||
}
|
||||
}
|
||||
items = newItemLists;
|
||||
//计算合计
|
||||
getAllSum();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存明细之前计算合计
|
||||
private void getAllSum()
|
||||
{
|
||||
items.ForEach(x =>
|
||||
{
|
||||
//需要合计的时候
|
||||
if (x.SortUnit == 1)
|
||||
{
|
||||
if (x.BusinessCategory == "合计")
|
||||
{
|
||||
x.Throughput_BasePeriod = items.Where(y => y.SortUnit != 1).Sum(y => Funs.GetNewDecimalOrZero(y.Throughput_BasePeriod)).ToString();
|
||||
x.Throughput_LastPeriod = items.Where(y => y.SortUnit != 1).Sum(y => Funs.GetNewDecimalOrZero(y.Throughput_LastPeriod)).ToString();
|
||||
x.Throughput_ThisPeriod = items.Where(y => y.SortUnit != 1).Sum(y => Funs.GetNewDecimalOrZero(y.Throughput_ThisPeriod)).ToString();
|
||||
x.Yield_BasePeriod = items.Where(y => y.SortUnit != 1).Sum(y => Funs.GetNewDecimalOrZero(y.Yield_BasePeriod)).ToString();
|
||||
x.Yield_LastPeriod = items.Where(y => y.SortUnit != 1).Sum(y => Funs.GetNewDecimalOrZero(y.Yield_LastPeriod)).ToString();
|
||||
x.Yield_ThisPeriod = items.Where(y => y.SortUnit != 1).Sum(y => Funs.GetNewDecimalOrZero(y.Yield_ThisPeriod)).ToString();
|
||||
x.OutputValue_BasePeriod = items.Where(y => y.SortUnit != 1).Sum(y => Funs.GetNewDecimalOrZero(y.OutputValue_BasePeriod)).ToString();
|
||||
x.OutputValue_LastYear = items.Where(y => y.SortUnit != 1).Sum(y => Funs.GetNewDecimalOrZero(y.OutputValue_LastYear)).ToString();
|
||||
x.OutputValue_ThisYear = items.Where(y => y.SortUnit != 1).Sum(y => Funs.GetNewDecimalOrZero(y.OutputValue_ThisYear)).ToString();
|
||||
x.OperationScale_BasePeriod = items.Where(y => y.SortUnit != 1).Sum(y => Funs.GetNewDecimalOrZero(y.OperationScale_BasePeriod)).ToString();
|
||||
x.OperationScale_LastYear = items.Where(y => y.SortUnit != 1).Sum(y => Funs.GetNewDecimalOrZero(y.OperationScale_LastYear)).ToString();
|
||||
x.OperationScale_ThisYear = items.Where(y => y.SortUnit != 1).Sum(y => Funs.GetNewDecimalOrZero(y.OperationScale_ThisYear)).ToString();
|
||||
x.ServiceOperatingIncome_BasePeriod = items.Where(y => y.SortUnit != 1).Sum(y => Funs.GetNewDecimalOrZero(y.ServiceOperatingIncome_BasePeriod)).ToString();
|
||||
x.ServiceOperatingIncome_LastYear = items.Where(y => y.SortUnit != 1).Sum(y => Funs.GetNewDecimalOrZero(y.ServiceOperatingIncome_LastYear)).ToString();
|
||||
x.ServiceOperatingIncome_ThisYear = items.Where(y => y.SortUnit != 1).Sum(y => Funs.GetNewDecimalOrZero(y.ServiceOperatingIncome_ThisYear)).ToString();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
x.Throughput_BasePeriod = items.Where(y => y.SortUnit != 1 && y.SortIndex == x.SortIndex).Sum(y => Funs.GetNewDecimalOrZero(y.Throughput_BasePeriod)).ToString();
|
||||
x.Throughput_LastPeriod = items.Where(y => y.SortUnit != 1 && y.SortIndex == x.SortIndex).Sum(y => Funs.GetNewDecimalOrZero(y.Throughput_LastPeriod)).ToString();
|
||||
x.Throughput_ThisPeriod = items.Where(y => y.SortUnit != 1 && y.SortIndex == x.SortIndex).Sum(y => Funs.GetNewDecimalOrZero(y.Throughput_ThisPeriod)).ToString();
|
||||
x.Yield_BasePeriod = items.Where(y => y.SortUnit != 1 && y.SortIndex == x.SortIndex).Sum(y => Funs.GetNewDecimalOrZero(y.Yield_BasePeriod)).ToString();
|
||||
x.Yield_LastPeriod = items.Where(y => y.SortUnit != 1 && y.SortIndex == x.SortIndex).Sum(y => Funs.GetNewDecimalOrZero(y.Yield_LastPeriod)).ToString();
|
||||
x.Yield_ThisPeriod = items.Where(y => y.SortUnit != 1 && y.SortIndex == x.SortIndex).Sum(y => Funs.GetNewDecimalOrZero(y.Yield_ThisPeriod)).ToString();
|
||||
x.OutputValue_BasePeriod = items.Where(y => y.SortUnit != 1 && y.SortIndex == x.SortIndex).Sum(y => Funs.GetNewDecimalOrZero(y.OutputValue_BasePeriod)).ToString();
|
||||
x.OutputValue_LastYear = items.Where(y => y.SortUnit != 1 && y.SortIndex == x.SortIndex).Sum(y => Funs.GetNewDecimalOrZero(y.OutputValue_LastYear)).ToString();
|
||||
x.OutputValue_ThisYear = items.Where(y => y.SortUnit != 1 && y.SortIndex == x.SortIndex).Sum(y => Funs.GetNewDecimalOrZero(y.OutputValue_ThisYear)).ToString();
|
||||
x.OperationScale_BasePeriod = items.Where(y => y.SortUnit != 1 && y.SortIndex == x.SortIndex).Sum(y => Funs.GetNewDecimalOrZero(y.OperationScale_BasePeriod)).ToString();
|
||||
x.OperationScale_LastYear = items.Where(y => y.SortUnit != 1 && y.SortIndex == x.SortIndex).Sum(y => Funs.GetNewDecimalOrZero(y.OperationScale_LastYear)).ToString();
|
||||
x.OperationScale_ThisYear = items.Where(y => y.SortUnit != 1 && y.SortIndex == x.SortIndex).Sum(y => Funs.GetNewDecimalOrZero(y.OperationScale_ThisYear)).ToString();
|
||||
x.ServiceOperatingIncome_BasePeriod = items.Where(y => y.SortUnit != 1 && y.SortIndex == x.SortIndex).Sum(y => Funs.GetNewDecimalOrZero(y.ServiceOperatingIncome_BasePeriod)).ToString();
|
||||
x.ServiceOperatingIncome_LastYear = items.Where(y => y.SortUnit != 1 && y.SortIndex == x.SortIndex).Sum(y => Funs.GetNewDecimalOrZero(y.ServiceOperatingIncome_LastYear)).ToString();
|
||||
x.ServiceOperatingIncome_ThisYear = items.Where(y => y.SortUnit != 1 && y.SortIndex == x.SortIndex).Sum(y => Funs.GetNewDecimalOrZero(y.ServiceOperatingIncome_ThisYear)).ToString();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取明细
|
||||
private void GetNewItems(int year, int Quarters)
|
||||
private void GetNewItems(int year, int Quarters)
|
||||
{
|
||||
var indexNames = EnergyreportItemService.GetItems("Template");
|
||||
foreach (var indexName in indexNames)
|
||||
|
@ -406,11 +453,48 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
|||
EnergyReportItemId = SQLHelper.GetNewID(typeof(Model.Environmental_EnergyReportItem)),
|
||||
BusinessCategory = indexName.BusinessCategory,
|
||||
SortIndex = indexName.SortIndex,
|
||||
SortUnit = indexName.SortUnit
|
||||
};
|
||||
|
||||
items.Add(item);
|
||||
|
||||
//修改2024-10-23 14:15:06
|
||||
#region 循环再次增加各分单位
|
||||
if (item.BusinessCategory != "合计")
|
||||
{
|
||||
//第一个本单位
|
||||
var isthisUnit = CommonService.GetIsThisUnit();
|
||||
|
||||
var model = new Environmental_EnergyReportItem
|
||||
{
|
||||
EnergyReportItemId = SQLHelper.GetNewID(typeof(Model.Environmental_EnergyReportItem)),
|
||||
BusinessCategory = getLenthSpace(indexName.SortIndex) +isthisUnit.UnitName,
|
||||
SortIndex = item.SortIndex,
|
||||
SortUnit = 2,
|
||||
};
|
||||
items.Add(model);
|
||||
//加载分单位
|
||||
var unitList = Funs.DB.Base_Unit.Where(x => x.IsBranch == true).ToList();
|
||||
var j = 3;
|
||||
foreach (var unitItem in unitList)
|
||||
{
|
||||
model = new Environmental_EnergyReportItem
|
||||
{
|
||||
EnergyReportItemId = SQLHelper.GetNewID(typeof(Model.Environmental_EnergyReportItem)),
|
||||
BusinessCategory = getLenthSpace(indexName.SortIndex) +unitItem.UnitName,
|
||||
SortIndex = item.SortIndex,
|
||||
SortUnit = j,
|
||||
};
|
||||
items.Add(model);
|
||||
j++;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
var ListProjectEnergyItemReport= ProjectEnergyreportItemService.GetItemsByDate(year, Quarters);
|
||||
|
||||
var ListProjectEnergyItemReport = ProjectEnergyreportItemService.GetItemsByDate(year, Quarters);
|
||||
var q = from x in ListProjectEnergyItemReport
|
||||
group x by x.SortIndex into g
|
||||
select new
|
||||
|
@ -568,5 +652,20 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
|||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 取具体数量的空格
|
||||
private string getLenthSpace(string SortIndex) {
|
||||
string returnVal = "";
|
||||
if (SortIndex == "02" || SortIndex == "16" || SortIndex == "44")
|
||||
{
|
||||
returnVal += "A";
|
||||
}
|
||||
else {
|
||||
returnVal += "B";
|
||||
}
|
||||
|
||||
return returnVal;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -21,8 +21,7 @@
|
|||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="true" Title="中央企业节能环保和经营状况季报" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" EnableColumnLines="true" DataKeyNames="BusinessReportId"
|
||||
DataIDField="BusinessReportId" AllowSorting="true" ForceFit="true"
|
||||
SortField="FillingDate" SortDirection="DESC" OnSort="Grid1_Sort" AllowPaging="true"
|
||||
IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
|
||||
SortField="FillingDate" AllowPaging="true"
|
||||
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
|
||||
|
@ -49,7 +48,10 @@
|
|||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:RenderField Width="60px" ColumnID="Code" DataField="Code" SortField="Code"
|
||||
<f:RenderField Width="120px" ColumnID="UnitName" DataField="UnitName"
|
||||
FieldType="String" HeaderText="企业名称" HeaderTextAlign="Center" TextAlign="Left" />
|
||||
|
||||
<f:RenderField Width="60px" ColumnID="Code" DataField="Code"
|
||||
FieldType="String" HeaderText="代码" HeaderTextAlign="Center" TextAlign="Center" />
|
||||
|
||||
<f:GroupField EnableLock="true" HeaderText="企业基本情况" TextAlign="Center">
|
||||
|
@ -86,7 +88,7 @@
|
|||
<Listeners>
|
||||
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
|
||||
</Listeners>
|
||||
<PageItems>
|
||||
<%-- <PageItems>
|
||||
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
|
||||
</f:ToolbarSeparator>
|
||||
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
|
||||
|
@ -94,14 +96,14 @@
|
|||
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
|
||||
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
|
||||
</f:DropDownList>
|
||||
</PageItems>
|
||||
</PageItems>--%>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Window ID="Window1" Title="编辑安全生产数据季报" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="1000px" Height="560px">
|
||||
<f:Window ID="Window1" Title="编辑中央企业节能环保企业基本情况和经营状况" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="true" PercentWidth="100%" PercentHeight="100%">
|
||||
</f:Window>
|
||||
<f:Window ID="Window2" Title="打印安全生产数据季报" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
<f:Window ID="Window2" Title="打印中央企业节能环保企业基本情况和经营状况" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="1000px" Height="560px">
|
||||
</f:Window>
|
||||
<f:Menu ID="Menu1" runat="server">
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
|||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
Funs.DropDownPageSize(this.ddlPageSize);
|
||||
//Funs.DropDownPageSize(this.ddlPageSize);
|
||||
//权限按钮方法
|
||||
this.GetButtonPower();
|
||||
|
||||
|
@ -39,7 +39,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
|||
{
|
||||
Grid1.PageSize = this.CurrUser.PageSize.Value;
|
||||
}
|
||||
this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
|
||||
//this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
|
||||
// 绑定表格
|
||||
this.BindGrid();
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
|||
{
|
||||
string strSql = "select * from Environmental_OperationReport where 1=1 ";
|
||||
|
||||
strSql += " AND UnitId = '" + BLL.Const.UnitId_CWCEC + "'";
|
||||
strSql += " AND UnitId = '" + CommonService.GetThisUnitId() + "'";
|
||||
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
|
||||
|
@ -67,18 +67,25 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
|||
listStr.Add(new SqlParameter("@Quarters", Funs.GetNewInt(this.drpQuarters.SelectedValue)));
|
||||
}
|
||||
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
//SqlParameter[] parameter = listStr.ToArray();
|
||||
//DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
//Grid1.RecordCount = tb.Rows.Count;
|
||||
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
//var table = this.GetPagedDataTable(Grid1, tb);
|
||||
//Grid1.DataSource = table;
|
||||
//Grid1.DataBind();
|
||||
|
||||
Model.Environmental_OperationReport report = Funs.DB.Environmental_OperationReport.FirstOrDefault(e => e.UnitId == drpUnit.SelectedValue && e.Quarters == Funs.GetNewInt(this.drpQuarters.SelectedValue) && e.Year == Funs.GetNewInt(this.drpYear.SelectedValue));
|
||||
if (report != null)
|
||||
{
|
||||
//根据主表id加载子表
|
||||
var reportItem = Funs.DB.Environmental_OperationReportItem.Where(x => x.BusinessReportId == report.BusinessReportId)
|
||||
.OrderBy(x => x.SortIndex).ToList();
|
||||
|
||||
Grid1.DataSource = reportItem;
|
||||
Grid1.DataBind();
|
||||
|
||||
string upState = string.Empty;
|
||||
if (report.UpState == BLL.Const.UpState_3)
|
||||
{
|
||||
|
@ -90,6 +97,14 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
|||
}
|
||||
this.Grid1.Title = "中央企业节能环保和经营状况季报" + this.drpQuarters.SelectedItem.Text + this.drpYear.SelectedItem.Text + upState;
|
||||
}
|
||||
else {
|
||||
|
||||
var upState = "(未上报)";
|
||||
|
||||
this.Grid1.Title = "中央企业节能环保和经营状况季报" + this.drpQuarters.SelectedItem.Text + this.drpYear.SelectedItem.Text + upState;
|
||||
this.Grid1.DataSource = null;
|
||||
this.Grid1.DataBind();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
@ -123,8 +138,8 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
|||
/// <param name="e"></param>
|
||||
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue);
|
||||
BindGrid();
|
||||
//this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue);
|
||||
//BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -163,7 +178,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
|||
/// <param name="e"></param>
|
||||
protected void btnNew_Click(object sender, EventArgs e)
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("OperationReportEdit.aspx?UnitId={0}&&Year={1}&&Quarter={2}", BLL.Const.UnitId_CWCEC, this.drpYear.SelectedValue, this.drpQuarters.SelectedValue, "编辑 - ")));
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("OperationReportEdit.aspx?UnitId={0}&&Year={1}&&Quarter={2}", CommonService.GetThisUnitId(), this.drpYear.SelectedValue, this.drpQuarters.SelectedValue, "编辑 - ")));
|
||||
}
|
||||
/// <summary>
|
||||
/// 双击事件
|
||||
|
@ -199,7 +214,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
|||
var operationReport = Funs.DB.Environmental_OperationReport.FirstOrDefault(s => s.BusinessReportId == id);
|
||||
if (operationReport != null)
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("OperationReportEdit.aspx?UnitId={0}&&Year={1}&&Quarter={2}&&BusinessReportId={3}", BLL.Const.UnitId_CWCEC, this.drpYear.SelectedValue, this.drpQuarters.SelectedValue, id, "编辑 - ")));
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("OperationReportEdit.aspx?UnitId={0}&&Year={1}&&Quarter={2}&&BusinessReportId={3}", CommonService.GetThisUnitId(), this.drpYear.SelectedValue, this.drpQuarters.SelectedValue, id, "编辑 - ")));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -210,14 +225,19 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
|||
/// <param name="e"></param>
|
||||
protected void btnUpdata_Click(object sender, EventArgs e)
|
||||
{
|
||||
var currUnitId = BLL.Const.UnitId_CWCEC;
|
||||
var currUnitId = CommonService.GetThisUnitId();
|
||||
var year = this.drpYear.SelectedValue;
|
||||
var quarter = this.drpQuarters.SelectedValue;
|
||||
|
||||
Model.Environmental_OperationReport report = Funs.DB.Environmental_OperationReport.Where(s => s.UnitId == currUnitId && s.Year.ToString() == year && s.Quarters.ToString() == quarter).FirstOrDefault();
|
||||
if (report != null)
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("OperationReportEdit.aspx?UnitId={0}&&Year={1}&&Quarter={2}&&BusinessReportId={3}&type=Update", BLL.Const.UnitId_CWCEC, this.drpYear.SelectedValue, this.drpQuarters.SelectedValue, report.BusinessReportId, "编辑 - ")));
|
||||
if (report.UpState=="3")
|
||||
{
|
||||
ShowNotify("当前报表已经上报!不能重复上报。", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("OperationReportEdit.aspx?UnitId={0}&&Year={1}&&Quarter={2}&&BusinessReportId={3}&type=Update", CommonService.GetThisUnitId(), this.drpYear.SelectedValue, this.drpQuarters.SelectedValue, report.BusinessReportId, "编辑 - ")));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -264,15 +284,22 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
|||
var getD = Funs.DB.Environmental_OperationReport.FirstOrDefault(s => s.BusinessReportId == rowID);
|
||||
if (getD != null)
|
||||
{
|
||||
//先删子表
|
||||
var list = Funs.DB.Environmental_OperationReportItem.Where(x => x.BusinessReportId == getD.BusinessReportId).ToList();
|
||||
if (list.Count > 0)
|
||||
{
|
||||
Funs.DB.Environmental_OperationReportItem.DeleteAllOnSubmit(list);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, null, getD.BusinessReportId, BLL.Const.OperationReportMenuId, BLL.Const.BtnDelete);
|
||||
|
||||
Funs.DB.Environmental_OperationReport.DeleteOnSubmit(getD);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
this.BindGrid();
|
||||
ShowNotify("删除数据成功!", MessageBoxIcon.Success);
|
||||
this.BindGrid();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
@ -322,7 +349,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
|||
}
|
||||
}
|
||||
|
||||
var unitId = BLL.Const.UnitId_CWCEC;
|
||||
var unitId = CommonService.GetThisUnitId();
|
||||
var year = Funs.GetNewIntOrZero(drpYear.SelectedValue);
|
||||
var quarter = Funs.GetNewIntOrZero(drpQuarters.SelectedValue);
|
||||
|
||||
|
|
|
@ -113,33 +113,6 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
|||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnUpdata;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarSeparator1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarText1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarText ToolbarText1;
|
||||
|
||||
/// <summary>
|
||||
/// ddlPageSize 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlPageSize;
|
||||
|
||||
/// <summary>
|
||||
/// Window1 控件。
|
||||
/// </summary>
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" runat="server" AutoSizePanelID="Panel1" />
|
||||
<f:Panel ID="Panel1" BodyPadding="5px" runat="server" ShowHeader="false" EnableCollapse="True"
|
||||
Title="编辑环保与经营状况数据季报" AutoScroll="true">
|
||||
Title="编辑中央企业节能环保企业基本情况和经营状况" AutoScroll="true">
|
||||
<Items>
|
||||
<f:Form ID="Form2" runat="server" ShowHeader="false" BodyPadding="5px" RedStarPosition="BeforeText">
|
||||
<Items>
|
||||
|
@ -35,7 +35,132 @@
|
|||
</Items>
|
||||
</f:Form>
|
||||
|
||||
|
||||
|
||||
<f:Form ID="Form11" runat="server" ShowHeader="false" BodyPadding="5px">
|
||||
<Items>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtCompileMan" runat="server" Label="填报人" LabelAlign="Right" LabelWidth="140px">
|
||||
</f:TextBox>
|
||||
<f:TextBox ID="txtStatisticsDutyPerson" runat="server" Label="统计负责人" LabelAlign="Right" LabelWidth="140px">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtUnitDutyPerson" runat="server" Label="单位负责人" LabelAlign="Right" LabelWidth="140px">
|
||||
</f:TextBox>
|
||||
<f:DatePicker ID="txtFillingDate" runat="server" Label="填报日期" LabelAlign="Right" LabelWidth="140px"
|
||||
EnableEdit="true">
|
||||
</f:DatePicker>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Items>
|
||||
</f:Form>
|
||||
|
||||
<f:Form ID="Form6" runat="server" ShowHeader="false" BodyPadding="5px">
|
||||
<Items>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtRemark" runat="server" Label="备注" LabelAlign="Right" LabelWidth="140px">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Items>
|
||||
</f:Form>
|
||||
|
||||
<f:Form ID="Form4" runat="server" ShowHeader="false" BodyPadding="5px">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" runat="server" DataIDField="BusinessReportItemId"
|
||||
DataKeyNames="BusinessReportItemId" ShowGridHeader="true" SortField="SortIndex" SortDirection="ASC"
|
||||
AllowCellEditing="true" ClicksToEdit="1" AllowSorting="true" EnableColumnLines="true"
|
||||
EnableTextSelection="True">
|
||||
<Columns>
|
||||
<f:RenderField minWidth="300px" ColumnID="UnitName" DataField="UnitName"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="单位名称">
|
||||
<Editor>
|
||||
<f:TextBox ID="TextBox1" runat="server">
|
||||
</f:TextBox>
|
||||
</Editor>
|
||||
</f:RenderField>
|
||||
|
||||
<f:RenderField minWidth="100px" ColumnID="Code" DataField="Code"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="代码">
|
||||
<Editor>
|
||||
<f:TextBox ID="TextBox2" runat="server">
|
||||
</f:TextBox>
|
||||
</Editor>
|
||||
</f:RenderField>
|
||||
|
||||
<f:RenderField minWidth="100px" ColumnID="UnitLevel" DataField="UnitLevel"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="企业层级">
|
||||
<Editor>
|
||||
<f:TextBox ID="TextBox3" runat="server">
|
||||
</f:TextBox>
|
||||
</Editor>
|
||||
</f:RenderField>
|
||||
|
||||
<f:RenderField minWidth="120px" ColumnID="CreateDate" DataField="CreateDate" FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd"
|
||||
HeaderTextAlign="Center" TextAlign="Left" HeaderText="成立时间">
|
||||
<Editor>
|
||||
<f:DatePicker ID="DatePicker1" DateFormatString="yyyy-MM-dd" runat="server">
|
||||
</f:DatePicker>
|
||||
</Editor>
|
||||
</f:RenderField>
|
||||
|
||||
<f:RenderField minWidth="160px" ColumnID="Place" DataField="Place"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="所在地">
|
||||
<Editor>
|
||||
<f:TextBox ID="TextBox4" runat="server">
|
||||
</f:TextBox>
|
||||
</Editor>
|
||||
</f:RenderField>
|
||||
|
||||
<f:RenderField minWidth="120px" ColumnID="PersonNum" DataField="PersonNum"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="职工人数">
|
||||
<Editor>
|
||||
<f:NumberBox ID="txtPersonNum" runat="server" NoDecimal="false"
|
||||
NoNegative="false" EmptyText="0">
|
||||
</f:NumberBox>
|
||||
</Editor>
|
||||
</f:RenderField>
|
||||
|
||||
<f:RenderField minWidth="160px" ColumnID="TotalAssets" DataField="TotalAssets"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="资产总额(万元)">
|
||||
<Editor>
|
||||
<f:NumberBox ID="txtTotalAssets" runat="server"
|
||||
NoDecimal="false" NoNegative="false" EmptyText="0" DecimalPrecision="4">
|
||||
</f:NumberBox>
|
||||
</Editor>
|
||||
</f:RenderField>
|
||||
|
||||
<f:RenderField minWidth="160px" ColumnID="TotalValue" DataField="TotalValue"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="总产值(万元)">
|
||||
<Editor>
|
||||
<f:NumberBox ID="NumberBox1" runat="server"
|
||||
NoDecimal="false" NoNegative="false" EmptyText="0" DecimalPrecision="4">
|
||||
</f:NumberBox>
|
||||
</Editor>
|
||||
</f:RenderField>
|
||||
|
||||
<f:RenderField minWidth="160px" ColumnID="NewInvestment" DataField="NewInvestment"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="新增投资(万元)">
|
||||
<Editor>
|
||||
<f:NumberBox ID="NumberBox2" runat="server"
|
||||
NoDecimal="false" NoNegative="false" EmptyText="0" DecimalPrecision="4">
|
||||
</f:NumberBox>
|
||||
</Editor>
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Form>
|
||||
|
||||
|
||||
|
||||
|
||||
<%--<f:Form ID="Form4" runat="server" ShowHeader="false" BodyPadding="5px">
|
||||
<Items>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
|
@ -90,41 +215,7 @@
|
|||
</Rows>
|
||||
</f:Form>
|
||||
</Items>
|
||||
</f:GroupPanel>
|
||||
|
||||
<f:Form ID="Form6" runat="server" ShowHeader="false" BodyPadding="5px">
|
||||
<Items>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtRemark" runat="server" Label="备注" LabelAlign="Right" LabelWidth="140px">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Items>
|
||||
</f:Form>
|
||||
|
||||
<f:Form ID="Form11" runat="server" ShowHeader="false" BodyPadding="5px">
|
||||
<Items>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtCompileMan" runat="server" Label="填报人" LabelAlign="Right" LabelWidth="140px">
|
||||
</f:TextBox>
|
||||
<f:TextBox ID="txtStatisticsDutyPerson" runat="server" Label="统计负责人" LabelAlign="Right" LabelWidth="140px">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtUnitDutyPerson" runat="server" Label="单位负责人" LabelAlign="Right" LabelWidth="140px">
|
||||
</f:TextBox>
|
||||
<f:DatePicker ID="txtFillingDate" runat="server" Label="填报日期" LabelAlign="Right" LabelWidth="140px"
|
||||
EnableEdit="true">
|
||||
</f:DatePicker>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Items>
|
||||
</f:Form>
|
||||
|
||||
</f:GroupPanel>--%>
|
||||
</Items>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
using BLL;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
|
@ -61,8 +63,10 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
|||
this.btnSave.Hidden = false;
|
||||
this.btnUpdata.Hidden = true;
|
||||
}
|
||||
|
||||
ddlUnitId.SelectedValue = CommonService.GetThisUnitId();
|
||||
BindGrid(year, quarter, unitId);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -88,53 +92,59 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
|||
{
|
||||
this.txtCompileMan.Text = operationReport.FillingMan.ToString();
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(operationReport.UnitLevel))
|
||||
{
|
||||
this.txtUnitLevel.Text = operationReport.UnitLevel;
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(operationReport.Place))
|
||||
{
|
||||
this.txtPlace.Text = operationReport.Place;
|
||||
}
|
||||
//if (!string.IsNullOrWhiteSpace(operationReport.UnitLevel))
|
||||
//{
|
||||
// this.txtUnitLevel.Text = operationReport.UnitLevel;
|
||||
//}
|
||||
//if (!string.IsNullOrWhiteSpace(operationReport.Place))
|
||||
//{
|
||||
// this.txtPlace.Text = operationReport.Place;
|
||||
//}
|
||||
if (operationReport.FillingDate != null)
|
||||
{
|
||||
this.txtFillingDate.Text = operationReport.FillingDate.Value.ToString("yyyy-MM-dd");
|
||||
}
|
||||
if (operationReport.CreateDate != null)
|
||||
{
|
||||
this.txtCreateDate.Text = operationReport.CreateDate.Value.ToString("yyyy-MM-dd");
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(operationReport.Code))
|
||||
{
|
||||
this.txtCode.Text = operationReport.Code;
|
||||
}
|
||||
if (operationReport.PersonNum != null)
|
||||
{
|
||||
this.txtPersonNum.Text = operationReport.PersonNum.ToString();
|
||||
}
|
||||
if (operationReport.TotalAssets != null)
|
||||
{
|
||||
this.txtTotalAssets.Text = operationReport.TotalAssets.ToString();
|
||||
}
|
||||
if (operationReport.TotalValue != null)
|
||||
{
|
||||
this.txtTotalValue.Text = operationReport.TotalValue.ToString();
|
||||
}
|
||||
if (operationReport.NewInvestment != null)
|
||||
{
|
||||
this.txtNewInvestment.Text = operationReport.NewInvestment.ToString();
|
||||
}
|
||||
//if (operationReport.CreateDate != null)
|
||||
//{
|
||||
// this.txtCreateDate.Text = operationReport.CreateDate.Value.ToString("yyyy-MM-dd");
|
||||
//}
|
||||
//if (!string.IsNullOrWhiteSpace(operationReport.Code))
|
||||
//{
|
||||
// this.txtCode.Text = operationReport.Code;
|
||||
//}
|
||||
//if (operationReport.PersonNum != null)
|
||||
//{
|
||||
// this.txtPersonNum.Text = operationReport.PersonNum.ToString();
|
||||
//}
|
||||
//if (operationReport.TotalAssets != null)
|
||||
//{
|
||||
// this.txtTotalAssets.Text = operationReport.TotalAssets.ToString();
|
||||
//}
|
||||
//if (operationReport.TotalValue != null)
|
||||
//{
|
||||
// this.txtTotalValue.Text = operationReport.TotalValue.ToString();
|
||||
//}
|
||||
//if (operationReport.NewInvestment != null)
|
||||
//{
|
||||
// this.txtNewInvestment.Text = operationReport.NewInvestment.ToString();
|
||||
//}
|
||||
this.txtStatisticsDutyPerson.Text = operationReport.StatisticsDutyPerson;
|
||||
this.txtUnitDutyPerson.Text = operationReport.UnitDutyPerson;
|
||||
this.txtRemark.Text = operationReport.Remark;
|
||||
|
||||
//根据主表id加载子表
|
||||
var reportItem = Funs.DB.Environmental_OperationReportItem.Where(x => x.BusinessReportId == operationReport.BusinessReportId)
|
||||
.OrderBy(x => x.SortIndex).ToList();
|
||||
|
||||
Grid1.DataSource = reportItem;
|
||||
Grid1.DataBind();
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
#region 不存在则根据项目统计生成
|
||||
this.ddlUnitId.SelectedValue = unitId;
|
||||
//this.ddlUnitId.SelectedValue = unitId;
|
||||
this.drpYear.SelectedValue = year;
|
||||
this.ddlQuarter.SelectedValue = quarter;
|
||||
this.txtFillingDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
|
||||
|
@ -147,15 +157,57 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
|||
|
||||
if (items.Any())
|
||||
{
|
||||
this.txtPersonNum.Text = items.Sum(s => s.PersonNum ?? 0).ToString();
|
||||
this.txtTotalAssets.Text = items.Sum(s => s.TotalAssets ?? 0).ToString();
|
||||
this.txtTotalValue.Text = items.Sum(s => s.TotalValue ?? 0).ToString();
|
||||
this.txtNewInvestment.Text = items.Sum(s => s.NewInvestment ?? 0).ToString();
|
||||
//this.txtPersonNum.Text = items.Sum(s => s.PersonNum ?? 0).ToString();
|
||||
//this.txtTotalAssets.Text = items.Sum(s => s.TotalAssets ?? 0).ToString();
|
||||
//this.txtTotalValue.Text = items.Sum(s => s.TotalValue ?? 0).ToString();
|
||||
//this.txtNewInvestment.Text = items.Sum(s => s.NewInvestment ?? 0).ToString();
|
||||
}
|
||||
this.txtCompileMan.Text = this.CurrUser.UserName;
|
||||
this.txtStatisticsDutyPerson.Text = this.CurrUser.UserName;
|
||||
this.txtUnitDutyPerson.Text = this.CurrUser.UserName;
|
||||
|
||||
//加载子表
|
||||
var reportItemlist = new List<Model.Environmental_OperationReportItem>();
|
||||
//第一个本单位
|
||||
var isthisUnit = CommonService.GetIsThisUnit();
|
||||
var reportItemModel = new Model.Environmental_OperationReportItem() {
|
||||
BusinessReportItemId = Guid.NewGuid().ToString(),
|
||||
SortIndex = 1,
|
||||
UnitName = isthisUnit.UnitName,
|
||||
SortUnitName= isthisUnit.UnitName,
|
||||
Code = isthisUnit.UnitCode,
|
||||
UnitLevel = "",
|
||||
CreateDate=null,
|
||||
Place= isthisUnit.Address,
|
||||
PersonNum=0,
|
||||
TotalAssets=0,
|
||||
TotalValue=0,
|
||||
NewInvestment=0,
|
||||
};
|
||||
reportItemlist.Add(reportItemModel);
|
||||
//加载分单位
|
||||
var unitList = Funs.DB.Base_Unit.Where(x => x.IsBranch == true).ToList();
|
||||
foreach (var item in unitList)
|
||||
{
|
||||
var reportItemModelb = new Model.Environmental_OperationReportItem()
|
||||
{
|
||||
BusinessReportItemId = Guid.NewGuid().ToString(),
|
||||
SortIndex = 1,
|
||||
UnitName = item.UnitName,
|
||||
SortUnitName = isthisUnit.UnitName,
|
||||
Code = item.UnitCode,
|
||||
UnitLevel = "",
|
||||
CreateDate = null,
|
||||
Place = item.Address,
|
||||
PersonNum = 0,
|
||||
TotalAssets = 0,
|
||||
TotalValue = 0,
|
||||
NewInvestment = 0,
|
||||
};
|
||||
reportItemlist.Add(reportItemModelb);
|
||||
}
|
||||
Grid1.DataSource = reportItemlist;
|
||||
Grid1.DataBind();
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@ -216,14 +268,14 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
|||
operationReport.StatisticsDutyPerson = this.txtStatisticsDutyPerson.Text.Trim();
|
||||
operationReport.UnitDutyPerson = this.txtUnitDutyPerson.Text.Trim();
|
||||
operationReport.FillingDate = Funs.GetNewDateTime(this.txtFillingDate.Text);
|
||||
operationReport.Code = this.txtCode.Text.Trim();
|
||||
operationReport.PersonNum = Funs.GetNewInt(this.txtPersonNum.Text.Trim());
|
||||
operationReport.TotalAssets = Funs.GetNewDecimalOrZero(this.txtTotalAssets.Text.Trim());
|
||||
operationReport.TotalValue = Funs.GetNewDecimalOrZero(this.txtTotalValue.Text.Trim());
|
||||
operationReport.NewInvestment = Funs.GetNewDecimalOrZero(this.txtNewInvestment.Text.Trim());
|
||||
operationReport.UnitLevel = this.txtUnitLevel.Text.Trim();
|
||||
operationReport.CreateDate = Funs.GetNewDateTime(this.txtCreateDate.Text);
|
||||
operationReport.Place = this.txtPlace.Text.Trim();
|
||||
//operationReport.Code = this.txtCode.Text.Trim();
|
||||
//operationReport.PersonNum = Funs.GetNewInt(this.txtPersonNum.Text.Trim());
|
||||
//operationReport.TotalAssets = Funs.GetNewDecimalOrZero(this.txtTotalAssets.Text.Trim());
|
||||
//operationReport.TotalValue = Funs.GetNewDecimalOrZero(this.txtTotalValue.Text.Trim());
|
||||
//operationReport.NewInvestment = Funs.GetNewDecimalOrZero(this.txtNewInvestment.Text.Trim());
|
||||
//operationReport.UnitLevel = this.txtUnitLevel.Text.Trim();
|
||||
//operationReport.CreateDate = Funs.GetNewDateTime(this.txtCreateDate.Text);
|
||||
//operationReport.Place = this.txtPlace.Text.Trim();
|
||||
operationReport.Remark = this.txtRemark.Text.Trim();
|
||||
|
||||
if (!string.IsNullOrEmpty(this.BusinessReportId))
|
||||
|
@ -231,17 +283,17 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
|||
var model = Funs.DB.Environmental_OperationReport.FirstOrDefault(s => s.BusinessReportId == this.BusinessReportId);
|
||||
if (model != null)
|
||||
{
|
||||
model.Code = operationReport.Code;
|
||||
model.PersonNum = operationReport.PersonNum;
|
||||
model.TotalAssets = operationReport.TotalAssets;
|
||||
model.TotalValue = operationReport.TotalValue;
|
||||
model.NewInvestment = operationReport.NewInvestment;
|
||||
//model.Code = operationReport.Code;
|
||||
//model.PersonNum = operationReport.PersonNum;
|
||||
//model.TotalAssets = operationReport.TotalAssets;
|
||||
//model.TotalValue = operationReport.TotalValue;
|
||||
//model.NewInvestment = operationReport.NewInvestment;
|
||||
model.Quarters = operationReport.Quarters;
|
||||
model.Year = operationReport.Year;
|
||||
model.FillingMan = operationReport.FillingMan;
|
||||
model.FillingDate = operationReport.FillingDate;
|
||||
model.CreateDate = operationReport.CreateDate;
|
||||
model.Place = operationReport.Place;
|
||||
//model.CreateDate = operationReport.CreateDate;
|
||||
//model.Place = operationReport.Place;
|
||||
model.Remark = operationReport.Remark;
|
||||
model.StatisticsDutyPerson = operationReport.StatisticsDutyPerson;
|
||||
model.UnitDutyPerson = operationReport.UnitDutyPerson;
|
||||
|
@ -251,6 +303,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
|||
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, operationReport.Year.ToString() + "-" + operationReport.Quarters.ToString(), operationReport.BusinessReportId, BLL.Const.OperationReportMenuId, BLL.Const.BtnModify);
|
||||
Funs.DB.SubmitChanges();
|
||||
saveReportItem(operationReport.BusinessReportId);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -270,6 +323,7 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
|||
BLL.Const.OperationReportMenuId, BLL.Const.BtnAdd);
|
||||
|
||||
Funs.DB.SubmitChanges();
|
||||
saveReportItem(operationReport.BusinessReportId);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -289,6 +343,10 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
|||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
return;
|
||||
}
|
||||
else if (code == "3")
|
||||
{
|
||||
Alert.ShowInParent("集团当前季度数据已锁定,无法上传!", MessageBoxIcon.Error);
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInParent("同步异常,请退出后重试!", MessageBoxIcon.Error);
|
||||
|
@ -304,6 +362,49 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
|||
|
||||
#endregion
|
||||
|
||||
#region 保存子表
|
||||
private void saveReportItem(string BusinessReportId) {
|
||||
var list = Funs.DB.Environmental_OperationReportItem.Where(x => x.BusinessReportId == BusinessReportId).ToList();
|
||||
//先删除
|
||||
if (list.Count>0)
|
||||
{
|
||||
Funs.DB.Environmental_OperationReportItem.DeleteAllOnSubmit(list);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
//再保存
|
||||
JArray mergedData = Grid1.GetMergedData();
|
||||
var reportItemlist = new List<Model.Environmental_OperationReportItem>();
|
||||
var isthisUnit = CommonService.GetIsThisUnit();
|
||||
foreach (var item in mergedData)
|
||||
{
|
||||
JObject values = item.Value<JObject>("values");
|
||||
int i = item.Value<int>("index");
|
||||
var model = new Model.Environmental_OperationReportItem() {
|
||||
BusinessReportItemId= Grid1.Rows[i].DataKeys[0].ToString(),
|
||||
BusinessReportId= BusinessReportId,
|
||||
SortIndex= i+1,
|
||||
UnitName = values.Value<string>("UnitName").ToString(),
|
||||
SortUnitName= isthisUnit.UnitName,
|
||||
Code= values.Value<string>("Code").ToString(),
|
||||
UnitLevel= values.Value<string>("UnitLevel").ToString(),
|
||||
Place= values.Value<string>("Place").ToString(),
|
||||
PersonNum= values.Value<int>("PersonNum"),
|
||||
TotalAssets= values.Value<decimal>("TotalAssets"),
|
||||
TotalValue = values.Value<decimal>("TotalValue"),
|
||||
NewInvestment = values.Value<decimal>("NewInvestment"),
|
||||
|
||||
};
|
||||
if (!string.IsNullOrEmpty(values.Value<string>("CreateDate").ToString()))
|
||||
{
|
||||
model.CreateDate = Convert.ToDateTime(values.Value<string>("CreateDate").ToString());
|
||||
}
|
||||
reportItemlist.Add(model);
|
||||
}
|
||||
Funs.DB.Environmental_OperationReportItem.InsertAllOnSubmit(reportItemlist);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 年季度变化事件
|
||||
/// <summary>
|
||||
/// 年季度变化事件
|
||||
|
|
|
@ -77,141 +77,6 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
|||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlQuarter;
|
||||
|
||||
/// <summary>
|
||||
/// Form4 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form Form4;
|
||||
|
||||
/// <summary>
|
||||
/// txtCode 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtCode;
|
||||
|
||||
/// <summary>
|
||||
/// GroupPanel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.GroupPanel GroupPanel1;
|
||||
|
||||
/// <summary>
|
||||
/// Form3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form Form3;
|
||||
|
||||
/// <summary>
|
||||
/// txtUnitLevel 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtUnitLevel;
|
||||
|
||||
/// <summary>
|
||||
/// txtCreateDate 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtCreateDate;
|
||||
|
||||
/// <summary>
|
||||
/// txtPlace 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtPlace;
|
||||
|
||||
/// <summary>
|
||||
/// txtPersonNum 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtPersonNum;
|
||||
|
||||
/// <summary>
|
||||
/// GroupPanel2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.GroupPanel GroupPanel2;
|
||||
|
||||
/// <summary>
|
||||
/// Form5 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form Form5;
|
||||
|
||||
/// <summary>
|
||||
/// txtTotalAssets 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtTotalAssets;
|
||||
|
||||
/// <summary>
|
||||
/// txtTotalValue 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtTotalValue;
|
||||
|
||||
/// <summary>
|
||||
/// txtNewInvestment 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtNewInvestment;
|
||||
|
||||
/// <summary>
|
||||
/// Form6 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form Form6;
|
||||
|
||||
/// <summary>
|
||||
/// txtRemark 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtRemark;
|
||||
|
||||
/// <summary>
|
||||
/// Form11 控件。
|
||||
/// </summary>
|
||||
|
@ -257,6 +122,123 @@ namespace FineUIPro.Web.ZHGL.Environmental
|
|||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtFillingDate;
|
||||
|
||||
/// <summary>
|
||||
/// Form6 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form Form6;
|
||||
|
||||
/// <summary>
|
||||
/// txtRemark 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtRemark;
|
||||
|
||||
/// <summary>
|
||||
/// Form4 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form Form4;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// TextBox1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox TextBox1;
|
||||
|
||||
/// <summary>
|
||||
/// TextBox2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox TextBox2;
|
||||
|
||||
/// <summary>
|
||||
/// TextBox3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox TextBox3;
|
||||
|
||||
/// <summary>
|
||||
/// DatePicker1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker DatePicker1;
|
||||
|
||||
/// <summary>
|
||||
/// TextBox4 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox TextBox4;
|
||||
|
||||
/// <summary>
|
||||
/// txtPersonNum 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtPersonNum;
|
||||
|
||||
/// <summary>
|
||||
/// txtTotalAssets 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtTotalAssets;
|
||||
|
||||
/// <summary>
|
||||
/// NumberBox1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox NumberBox1;
|
||||
|
||||
/// <summary>
|
||||
/// NumberBox2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox NumberBox2;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar2 控件。
|
||||
/// </summary>
|
||||
|
|
|
@ -38,15 +38,6 @@ namespace Model
|
|||
set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 季度
|
||||
/// </summary>
|
||||
public int? Quarter
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
|
@ -125,5 +116,13 @@ namespace Model
|
|||
get;
|
||||
set;
|
||||
}
|
||||
/// <summary>
|
||||
/// 季度
|
||||
/// </summary>
|
||||
public int? Quarter
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -100,6 +100,7 @@ namespace Model
|
|||
/// 服务营业收入-本年
|
||||
///</summary>
|
||||
public string ServiceOperatingIncome_ThisYear { get; set; }
|
||||
public int? SortUnit { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Model
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class Environmental_OperationReportDto
|
||||
{
|
||||
public string BusinessReportId { get; set; }
|
||||
|
||||
public string UnitId { get; set; }
|
||||
|
||||
public int? Year { get; set; }
|
||||
|
||||
public int? Quarters { get; set; }
|
||||
|
||||
|
||||
|
||||
public string FillingMan { get; set; }
|
||||
|
||||
public DateTime? FillingDate { get; set; }
|
||||
|
||||
public string StatisticsDutyPerson { get; set; }
|
||||
|
||||
public string UnitDutyPerson { get; set; }
|
||||
|
||||
public string Remark { get; set; }
|
||||
|
||||
public string UpState { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 子表数据
|
||||
/// </summary>
|
||||
public List<reportItemListDto> reportItemList
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class reportItemListDto
|
||||
{
|
||||
public string BusinessReportItemId { get; set; }
|
||||
public string BusinessReportId { get; set; }
|
||||
public int? SortIndex { get; set; }
|
||||
public string Code { get; set; }
|
||||
|
||||
public string UnitLevel { get; set; }
|
||||
|
||||
public DateTime? CreateDate { get; set; }
|
||||
|
||||
public string Place { get; set; }
|
||||
|
||||
public int? PersonNum { get; set; }
|
||||
|
||||
public decimal? TotalAssets { get; set; }
|
||||
|
||||
public decimal? TotalValue { get; set; }
|
||||
|
||||
public decimal? NewInvestment { get; set; }
|
||||
|
||||
public string UnitName { get; set; }
|
||||
|
||||
public string SortUnitName { get; set; }
|
||||
}
|
||||
}
|
2950
SGGL/Model/Model.cs
2950
SGGL/Model/Model.cs
File diff suppressed because it is too large
Load Diff
|
@ -81,6 +81,7 @@
|
|||
<Compile Include="APIItem\DropDownItem.cs" />
|
||||
<Compile Include="APIItem\EnergyReport.cs" />
|
||||
<Compile Include="APIItem\EnergyReportItem.cs" />
|
||||
<Compile Include="APIItem\Environmental_OperationReportDto.cs" />
|
||||
<Compile Include="APIItem\EPSummaryReport.cs" />
|
||||
<Compile Include="APIItem\HJGL\JointCompreInfoItem.cs" />
|
||||
<Compile Include="APIItem\HJGL\ReportQueryItem.cs" />
|
||||
|
|
Loading…
Reference in New Issue