增加集团报表
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user