This commit is contained in:
b110212000 2021-08-04 18:39:14 +08:00
parent 7332e8d9d8
commit 69de707137
3 changed files with 42 additions and 6 deletions

View File

@ -1192,11 +1192,24 @@ namespace SolarPower.Controllers
return Path.Combine("\\" + "upload" ,"report", Datename, "FIC太陽能監控平台" + "_" + name + "報表" + "_" + postObject.Userid+ Datename + ".xlsx"); return Path.Combine("\\" + "upload" ,"report", Datename, "FIC太陽能監控平台" + "_" + name + "報表" + "_" + postObject.Userid+ Datename + ".xlsx");
} }
//public async Task<ApiResult<List<MaxFormbody>>> GetMaxForm (Select_table2 post) public async Task<ApiResult<List<MaxFormbody>>> GetMaxForm(Select_table2 post)
//{ {
ApiResult<List<MaxFormbody>> apiResult = new ApiResult<List<MaxFormbody>>();
// return; List<MaxFormbody> body = new List<MaxFormbody>();
//} try
{
var a = await stationReportRepository.GetMaxtablebody(post);
apiResult.Code = "0000";
apiResult.Data = a;
}
catch (Exception exception)
{
apiResult.Code = "9999";
Logger.LogError("【" + controllerName + "/" + actionName + "】");
Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message);
}
return apiResult;
}
} }
} }

View File

@ -85,7 +85,7 @@ namespace SolarPower.Models
public string AreaName { get; set; } public string AreaName { get; set; }
public string PowerstationName { get; set; } public string PowerstationName { get; set; }
public int PowerstationId { get; set; } public int PowerstationId { get; set; }
public double Kwp { get; set; } public double Kwh { get; set; }
public string PowerstationDB { get; set; } public string PowerstationDB { get; set; }
public double SolarHour { get; set; } public double SolarHour { get; set; }
public double AvgIrradiance { get; set; } public double AvgIrradiance { get; set; }

View File

@ -232,5 +232,28 @@ namespace SolarPower.Repository.Implement
return result; return result;
} }
} }
public async Task<List<MaxFormbody>> GetMaxtablebody(Select_table2 post)
{
List<MaxFormbody> result = new List<MaxFormbody>();
using (IDbConnection conn = _databaseHelper.GetConnection())
{
conn.Open();
try
{
string sql = @$"";
result = (await conn.QueryAsync<MaxFormbody>(sql)).ToList();
}
catch (Exception exception)
{
throw exception;
}
finally
{
conn.Close();
}
return result;
}
}
} }
} }