綜合報表月報

發布錯誤修正
This commit is contained in:
b110212000 2022-03-01 13:55:52 +08:00
parent c7651dcd56
commit 36bf91da72
3 changed files with 43 additions and 26 deletions

View File

@ -1099,6 +1099,7 @@ namespace SolarPower.Controllers
var thour = ""; var tpr = ""; var tkwh = ""; var kWhkwp = ""; var ntd = ""; var ntdone = ""; var GeneratingCapacity = ""; var thour = ""; var tpr = ""; var tkwh = ""; var kWhkwp = ""; var ntd = ""; var ntdone = ""; var GeneratingCapacity = "";
foreach (dynamic body in Formbody.Result.Data) foreach (dynamic body in Formbody.Result.Data)
{ {
index = 0; index = 0;
var dbody = body as IDictionary<string, object>; var dbody = body as IDictionary<string, object>;
thour = Checknull(Math.Round(Convert.ToDouble(dbody["tothour"]), 2).ToString()); thour = Checknull(Math.Round(Convert.ToDouble(dbody["tothour"]), 2).ToString());

View File

@ -2,6 +2,7 @@
using Newtonsoft.Json; using Newtonsoft.Json;
using Quartz; using Quartz;
using SolarPower.Models; using SolarPower.Models;
using SolarPower.Models.User;
using SolarPower.Repository.Interface; using SolarPower.Repository.Interface;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -198,10 +199,25 @@ namespace SolarPower.Quartz.Jobs
#region #region
var users = userRepository.GetAllAsync(); var users = userRepository.GetAllAsync();
var ttt = new List<string>() {
"s506488@gmail.com", //var usertest = new List<User>();
"cesarliuc@gmail.com" //var oneuser = new User()
}; //{
// Account = "cesarliuc@gmail.com",
// Password = "np/F0eliIy3lPJe1tU18oiG7dzKRrpVw16/XZpHOph8=",
// Id = 13,
// Email = "cesarliuc@gmail.com",
// Status = 1,
// Name = "TEST"
//};
//usertest.Add(oneuser);
//var ttt = new List<string>() {
// "s506488@gmail.com",
// "cesarliuc@gmail.com"
//};
foreach (var user in users.Result) foreach (var user in users.Result)
{ {
@ -244,15 +260,15 @@ namespace SolarPower.Quartz.Jobs
Type = 1 Type = 1
}; };
List<string> properties = new List<string>() List<string> properties = new List<string>()
{ {
"UserId", "UserId",
"EmailType", "EmailType",
"RecipientEmail", "RecipientEmail",
"Subject", "Subject",
"Attachment", "Attachment",
"RecipientName", "RecipientName",
"Type" "Type"
}; };
await noticeScheduleRepository.AddOneAsync(DaySchedule, properties); await noticeScheduleRepository.AddOneAsync(DaySchedule, properties);
} }
} }
@ -279,24 +295,24 @@ namespace SolarPower.Quartz.Jobs
Type = 1 Type = 1
}; };
List<string> properties = new List<string>() List<string> properties = new List<string>()
{ {
"UserId", "UserId",
"EmailType", "EmailType",
"RecipientEmail", "RecipientEmail",
"Subject", "Subject",
"Attachment", "Attachment",
"RecipientName", "RecipientName",
"Type" "Type"
}; };
await noticeScheduleRepository.AddOneAsync(MaxSchedule, properties); await noticeScheduleRepository.AddOneAsync(MaxSchedule, properties);
if (DateTime.Now.ToString("dd") == "01") if (DateTime.Now.ToString("dd") == "01")
{ {
Select_table2 maxmonthexcel = new Select_table2() Select_table2 maxmonthexcel = new Select_table2()
{ {
FormType = 0, FormType = 1,
PowerStation = sentMaxpowerstations, PowerStation = sentMaxpowerstations,
SearchType = 0, SearchType = 1,
Time = DateTime.Now.AddDays(-1).ToString("yyyy-MM"), Time = DateTime.Now.AddDays(-1).ToString("yyyy-MM"),
Userid = user.Id Userid = user.Id
}; };

View File

@ -393,7 +393,7 @@ namespace SolarPower.Repository.Implement
GROUP BY a.Id,a.time GROUP BY a.Id,a.time
) n ON n.Id = ps.Id ) n ON n.Id = ps.Id
WHERE ps.Id IN @ids ORDER BY ps.CityId"; WHERE ps.Id IN @ids ORDER BY ps.CityId";
result = (await conn.QueryAsync<MaxFormbody>(sql,new { ids = ids})).ToList(); result = (await conn.QueryAsync<MaxFormbody>(sql,new { ids = ids}, commandTimeout: 300)).ToList();
} }
catch (Exception exception) catch (Exception exception)
{ {
@ -597,7 +597,7 @@ namespace SolarPower.Repository.Implement
break; break;
} }
a = await conn.QueryAsync<dynamic>(sql); a = await conn.QueryAsync<dynamic>(sql,commandTimeout: 300);
} }
catch (Exception exception) catch (Exception exception)
{ {