提交代码

This commit is contained in:
2024-10-30 17:15:30 +08:00
parent a2afd22163
commit 254c7ac7c0
24 changed files with 1527 additions and 828 deletions
+201 -177
View File
@@ -889,183 +889,6 @@
}
#endregion
#region
public static string UpOperationReport(string businessReportId, Model.Person_Persons CurrUser)
{
string code = "0";
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
try
{
var upReport = from x in db.Environmental_OperationReport
where x.BusinessReportId == businessReportId
select new Model.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
};
//新接口Api
code = UpApiOperationReport(upReport).ToString();
if (code == "1")
{
var report = db.Environmental_OperationReport.FirstOrDefault(e => e.BusinessReportId == businessReportId);
if (report != null)
{
report.UpState = BLL.Const.UpState_3;
db.SubmitChanges();
}
LogService.AddSys_Log(CurrUser, "【中央企业环保产业企业基本情况和经营情况汇总表】上传到服务器" + upReport.Count().ToString() + "条数据;", null, BLL.Const.OperationReportMenuId, BLL.Const.BtnUploadResources);
}
else
{
LogService.AddSys_Log(CurrUser, "【中央企业环保产业企业基本情况和经营情况汇总表】上传到服务器失败;", null, BLL.Const.OperationReportMenuId, BLL.Const.BtnUploadResources);
}
}
catch (Exception ex)
{
ErrLogInfo.WriteLog("【中央企业环保产业企业基本情况和经营情况汇总表】上传到服务器", ex);
LogService.AddSys_Log(CurrUser, "【中央企业环保产业企业基本情况和经营情况汇总表】上传到服务器失败;", null, BLL.Const.OperationReportMenuId, BLL.Const.BtnUploadResources);
}
return code;
}
}
private static int UpApiOperationReport(IQueryable<Model.OperationReportDto> upReport)
{
string baseurl = "/api/InformationData/SaveOperationReport";
var resultJsonReport = JsonConvert.SerializeObject(upReport.FirstOrDefault());
var responeData = BLL.ServerService.PushCNCEC(resultJsonReport, baseurl);
return responeData.code;
}
#endregion
#region
/// <summary>
/// 中央企业节能环保产业企业生产和服务业务情况报表上报
/// </summary>
public static string UpEnergyReport(string energyReportId, Model.Person_Persons CurrUser)
{
string code = "0";
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
try
{
var upReport = from x in db.Environmental_EnergyReport
where x.EnergyReportId == energyReportId
select new Model.EnergyReport
{
EnergyReportId = x.EnergyReportId,
UnitId = x.UnitId,
Year = x.Year,
Quarters = x.Quarters,
FillingMan = x.FillingMan,
FillingDate = x.FillingDate,
DutyPerson = x.DutyPerson,
};
var upReportItem = from x in db.Environmental_EnergyReportItem
where x.EnergyReportId == energyReportId
select new Model.EnergyReportItem
{
EnergyReportItemId = x.EnergyReportItemId,
EnergyReportId = x.EnergyReportId,
SortIndex = x.SortIndex,
BusinessCategory = x.BusinessCategory,
Throughput_BasePeriod = x.Throughput_BasePeriod,
Throughput_LastPeriod = x.Throughput_LastPeriod,
Throughput_ThisPeriod = x.Throughput_ThisPeriod,
Throughput_UnitOfMeasurement = x.Throughput_UnitOfMeasurement,
Yield_BasePeriod = x.Yield_BasePeriod,
Yield_LastPeriod = x.Yield_LastPeriod,
Yield_ThisPeriod = x.Yield_ThisPeriod,
Yield_UnitOfMeasurement = x.Yield_UnitOfMeasurement,
OutputValue_BasePeriod = x.OutputValue_BasePeriod,
OutputValue_LastYear = x.OutputValue_LastYear,
OutputValue_ThisYear = x.OutputValue_ThisYear,
OperationScale_BasePeriod = x.OperationScale_BasePeriod,
OperationScale_LastYear = x.OperationScale_LastYear,
OperationScale_ThisYear = x.OperationScale_ThisYear,
OperationScale_UnitOfMeasurement = x.OperationScale_UnitOfMeasurement,
ServiceOperatingIncome_BasePeriod = x.ServiceOperatingIncome_BasePeriod,
ServiceOperatingIncome_LastYear = x.ServiceOperatingIncome_LastYear,
ServiceOperatingIncome_ThisYear = x.ServiceOperatingIncome_ThisYear,
};
//老接口Serveice
//var getR = hsseC.DataInsertInformation_ChemicalReportTable(upReport.ToList(), upReportItem.ToList());
//新接口Api
code = UpApiEnergyReport(upReport, upReportItem).ToString();
if (code == "1")
{
foreach (var item in upReport.Select(p => p.EnergyReportId))
{
var report = db.Environmental_EnergyReport.FirstOrDefault(e => e.EnergyReportId == item);
if (report != null)
{
report.UpState = BLL.Const.UpState_3;
db.SubmitChanges();
////更新 当前人要处理的意见
//ProjectDataFlowSetService.CloseFlowOperate(Const.ChemicalReportMenuId, item, string.Empty);
// //更新催报信息
//UrgeReportService.SetComplete(report.UnitId, Const.ReportType_1, report.Year.ToString(), report.Quarters.ToString());
}
}
LogService.AddSys_Log(CurrUser, "【中央企业节能环保产业企业生产和服务业务情况报表上报】上传到服务器" + upReport.Count().ToString() + "条数据;", null, BLL.Const.EnergyReportMenuId, BLL.Const.BtnUploadResources);
}
else
{
LogService.AddSys_Log(CurrUser, "【中央企业节能环保产业企业生产和服务业务情况报表上报】上传到服务器失败;", null, BLL.Const.EnergyReportMenuId, BLL.Const.BtnUploadResources);
}
}
catch (Exception ex)
{
ErrLogInfo.WriteLog("【中央企业节能环保产业企业生产和服务业务情况报表上报】上传到服务器", ex);
LogService.AddSys_Log(CurrUser, "【中央企业节能环保产业企业生产和服务业务情况报表上报】上传到服务器失败;", null, BLL.Const.EnergyReportMenuId, BLL.Const.BtnUploadResources);
}
return code;
}
}
/// <summary>
/// UpApiChemicalReportApi调用
/// </summary>
/// <param name="upReport">主表</param>
/// <param name="upReportItem">明细表</param>
/// <returns></returns>
private static int UpApiEnergyReport(IQueryable<Model.EnergyReport> upReport, IQueryable<Model.EnergyReportItem> upReportItem)
{
string baseurl = "/api/InformationData/SaveEnergyReport";
//合并
//var resultJson = JsonConvert.SerializeObject(new { upReport, ReportItem = upReportItem });
var resultJsonReport = JsonConvert.SerializeObject(upReport.FirstOrDefault());
var resultJsonReportItem = JsonConvert.SerializeObject(new { EnergyReportItem = upReportItem });
resultJsonReport = "{\"InformationDataItems\":[" + (resultJsonReport + resultJsonReportItem).Replace("}{", ",") + "]}";
var responeData = BLL.ServerService.PushCNCEC(resultJsonReport, baseurl);
return responeData.code;
}
#endregion
#region
/// <summary>
/// 建筑行业能源节约与生态环境保护汇总表上报
@@ -1158,8 +981,209 @@
}
#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.Person_Persons CurrUser)
{
string code = "0";
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
try
{
var upReport = from x in db.Environmental_OperationReport
where x.BusinessReportId == businessReportId
select new Model.Environmental_OperationReportDto
{
BusinessReportId = x.BusinessReportId,
UnitId = x.UnitId,
Year = x.Year,
Quarters = x.Quarters,
FillingMan = x.FillingMan,
FillingDate = x.FillingDate,
StatisticsDutyPerson = x.StatisticsDutyPerson,
UnitDutyPerson = x.UnitDutyPerson,
Remark = x.Remark,
reportItemList = getreportItemList(x.BusinessReportId)
};
//新接口Api
code = UpApiOperationReportNew(upReport).ToString();
if (code == "1")
{
var report = db.Environmental_OperationReport.FirstOrDefault(e => e.BusinessReportId == businessReportId);
if (report != null)
{
report.UpState = BLL.Const.UpState_3;
db.SubmitChanges();
}
LogService.AddSys_Log(CurrUser, "【中央企业环保产业企业基本情况和经营情况汇总表】上传到服务器" + upReport.Count().ToString() + "条数据;", null, BLL.Const.OperationReportMenuId, BLL.Const.BtnUploadResources);
}
else
{
LogService.AddSys_Log(CurrUser, "【中央企业环保产业企业基本情况和经营情况汇总表】上传到服务器失败;", null, BLL.Const.OperationReportMenuId, BLL.Const.BtnUploadResources);
}
}
catch (Exception ex)
{
ErrLogInfo.WriteLog("【中央企业环保产业企业基本情况和经营情况汇总表】上传到服务器", ex);
LogService.AddSys_Log(CurrUser, "【中央企业环保产业企业基本情况和经营情况汇总表】上传到服务器失败;", null, BLL.Const.OperationReportMenuId, BLL.Const.BtnUploadResources);
}
return code;
}
}
#region
private static int UpApiOperationReport(IQueryable<Model.OperationReportDto> upReport)
{
string baseurl = "/api/InformationData/SaveOperationReport";
var resultJsonReport = JsonConvert.SerializeObject(upReport.FirstOrDefault());
var responeData = BLL.ServerService.PushCNCEC(resultJsonReport, baseurl);
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
#region
/// <summary>
/// 中央企业节能环保产业企业生产和服务业务情况报表上报
/// </summary>
public static string UpEnergyReport(string energyReportId, Model.Person_Persons CurrUser)
{
string code = "0";
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
try
{
var upReport = from x in db.Environmental_EnergyReport
where x.EnergyReportId == energyReportId
select new Model.EnergyReport
{
EnergyReportId = x.EnergyReportId,
UnitId = x.UnitId,
Year = x.Year,
Quarters = x.Quarters,
FillingMan = x.FillingMan,
FillingDate = x.FillingDate,
DutyPerson = x.DutyPerson,
};
var upReportItem = from x in db.Environmental_EnergyReportItem
where x.EnergyReportId == energyReportId
select new Model.EnergyReportItem
{
EnergyReportItemId = x.EnergyReportItemId,
EnergyReportId = x.EnergyReportId,
SortIndex = x.SortIndex,
BusinessCategory = x.BusinessCategory,
Throughput_BasePeriod = x.Throughput_BasePeriod,
Throughput_LastPeriod = x.Throughput_LastPeriod,
Throughput_ThisPeriod = x.Throughput_ThisPeriod,
Throughput_UnitOfMeasurement = x.Throughput_UnitOfMeasurement,
Yield_BasePeriod = x.Yield_BasePeriod,
Yield_LastPeriod = x.Yield_LastPeriod,
Yield_ThisPeriod = x.Yield_ThisPeriod,
Yield_UnitOfMeasurement = x.Yield_UnitOfMeasurement,
OutputValue_BasePeriod = x.OutputValue_BasePeriod,
OutputValue_LastYear = x.OutputValue_LastYear,
OutputValue_ThisYear = x.OutputValue_ThisYear,
OperationScale_BasePeriod = x.OperationScale_BasePeriod,
OperationScale_LastYear = x.OperationScale_LastYear,
OperationScale_ThisYear = x.OperationScale_ThisYear,
OperationScale_UnitOfMeasurement = x.OperationScale_UnitOfMeasurement,
ServiceOperatingIncome_BasePeriod = x.ServiceOperatingIncome_BasePeriod,
ServiceOperatingIncome_LastYear = x.ServiceOperatingIncome_LastYear,
ServiceOperatingIncome_ThisYear = x.ServiceOperatingIncome_ThisYear,
SortUnit = x.SortUnit
};
//老接口Serveice
//var getR = hsseC.DataInsertInformation_ChemicalReportTable(upReport.ToList(), upReportItem.ToList());
//新接口Api
code = UpApiEnergyReport(upReport, upReportItem).ToString();
if (code == "1")
{
foreach (var item in upReport.Select(p => p.EnergyReportId))
{
var report = db.Environmental_EnergyReport.FirstOrDefault(e => e.EnergyReportId == item);
if (report != null)
{
report.UpState = BLL.Const.UpState_3;
db.SubmitChanges();
////更新 当前人要处理的意见
//ProjectDataFlowSetService.CloseFlowOperate(Const.ChemicalReportMenuId, item, string.Empty);
// //更新催报信息
//UrgeReportService.SetComplete(report.UnitId, Const.ReportType_1, report.Year.ToString(), report.Quarters.ToString());
}
}
LogService.AddSys_Log(CurrUser, "【中央企业节能环保产业企业生产和服务业务情况报表上报】上传到服务器" + upReport.Count().ToString() + "条数据;", null, BLL.Const.EnergyReportMenuId, BLL.Const.BtnUploadResources);
}
else
{
LogService.AddSys_Log(CurrUser, "【中央企业节能环保产业企业生产和服务业务情况报表上报】上传到服务器失败;", null, BLL.Const.EnergyReportMenuId, BLL.Const.BtnUploadResources);
}
}
catch (Exception ex)
{
ErrLogInfo.WriteLog("【中央企业节能环保产业企业生产和服务业务情况报表上报】上传到服务器", ex);
LogService.AddSys_Log(CurrUser, "【中央企业节能环保产业企业生产和服务业务情况报表上报】上传到服务器失败;", null, BLL.Const.EnergyReportMenuId, BLL.Const.BtnUploadResources);
}
return code;
}
}
/// <summary>
/// UpApiChemicalReportApi调用
/// </summary>
/// <param name="upReport">主表</param>
/// <param name="upReportItem">明细表</param>
/// <returns></returns>
private static int UpApiEnergyReport(IQueryable<Model.EnergyReport> upReport, IQueryable<Model.EnergyReportItem> upReportItem)
{
string baseurl = "/api/InformationData/SaveEnergyReport";
//合并
//var resultJson = JsonConvert.SerializeObject(new { upReport, ReportItem = upReportItem });
var resultJsonReport = JsonConvert.SerializeObject(upReport.FirstOrDefault());
var resultJsonReportItem = JsonConvert.SerializeObject(new { EnergyReportItem = upReportItem });
resultJsonReport = "{\"InformationDataItems\":[" + (resultJsonReport + resultJsonReportItem).Replace("}{", ",") + "]}";
var responeData = BLL.ServerService.PushCNCEC(resultJsonReport, baseurl);
return responeData.code;
}
#endregion
#region
/// <summary>
/// 安全管理工作总结报告
+2 -7
View File
@@ -63,13 +63,8 @@ namespace BLL
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)
{
responeData.code = 0;
responeData.message = returnData.message;
return responeData;
}
responeData.code = returnData.code;
responeData.message = returnData.message;
return responeData;
}
public static Model.TokenItem GetToken()
@@ -142,7 +142,7 @@ namespace BLL
}
public static void DeleteEnvironmental_EnergyReportById(string EnergyReportId)
{
Model.SGGLDB db = Funs.DB;
Model.Environmental_EnergyReport table = db.Environmental_EnergyReport.FirstOrDefault(x => x.EnergyReportId == EnergyReportId);
if (table != null)
{
@@ -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)
{
@@ -268,11 +269,12 @@ namespace BLL
}
public static void DeleteEnergyReportItemByChemicalReportId(string EnergyReportId)
{
Model.SGGLDB db = Funs.DB;
var q = from x in Funs.DB.Environmental_EnergyReportItem where x.EnergyReportId == EnergyReportId select x;
if (q != null)
{
Funs.DB.Environmental_EnergyReportItem.DeleteAllOnSubmit(q);
Funs.DB.SubmitChanges();
db.Environmental_EnergyReportItem.DeleteAllOnSubmit(q);
db.SubmitChanges();
}
}