發佈新版 異常查詢中文

This commit is contained in:
cesar liu 2022-09-07 11:07:49 +08:00
parent 61a830e421
commit 038f882591
13 changed files with 338 additions and 165 deletions

View File

@ -44,11 +44,12 @@ namespace SolarPower.Helper
//var passwordStr = ed.AESEncrypt("P@ssw0rd"); y4uPqlH9ncTgR/I07qpwaA== //var passwordStr = ed.AESEncrypt("P@ssw0rd"); y4uPqlH9ncTgR/I07qpwaA==
// FIC 測試機 2 // FIC 測試機 2
//var serverStr = ed.AESEncrypt("localhost"); //var serverStr = ed.AESEncrypt("localhost"); // MWAxcj1mgmbZ8tB6NgApnQ==
//var portStr = ed.AESEncrypt("3306"); //var portStr = ed.AESEncrypt("3306"); // CY1x+1WYXRCBab3wKnBCOQ==
//var databaseStr = ed.AESEncrypt("solar_master"); //var databaseStr = ed.AESEncrypt("solar_master"); // CEyYZnO8B5+yTXQcFSsiBA==
//var rootStr = ed.AESEncrypt("webUser"); //var rootStr = ed.AESEncrypt("root"); // 4koIJVzfp6veImONCwQy3A==
//var passwordStr = ed.AESEncrypt("ficAdmin99"); //var passwordStr = ed.AESEncrypt("P@ssw0rd"); // bOlWkSFsV3qNLkZTJ3UPog==
// server=MWAxcj1mgmbZ8tB6NgApnQ==;port=CY1x+1WYXRCBab3wKnBCOQ==;database=CEyYZnO8B5+yTXQcFSsiBA==;user=pBX64+ALGFnLiHGRFXNh7w==;password=bOlWkSFsV3qNLkZTJ3UPog==;charset=utf8;Allow User Variables=True;
var connStr = $"server={serverStr};port={portStr};database={databaseStr};user={rootStr};password={passwordStr};charset=utf8;Allow User Variables=True;"; var connStr = $"server={serverStr};port={portStr};database={databaseStr};user={rootStr};password={passwordStr};charset=utf8;Allow User Variables=True;";

View File

@ -17,10 +17,25 @@ namespace SolarPower
} }
public static IHostBuilder CreateHostBuilder(string[] args) => public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args) Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder => .ConfigureWebHostDefaults(webBuilder =>
{ {
webBuilder.UseStartup<Startup>(); webBuilder.UseStartup<Startup>();
}); });
//Host.CreateDefaultBuilder(args)
// .ConfigureWebHostDefaults(webBuilder =>
// {
// webBuilder.UseStartup<Startup>();
// })
// .ConfigureAppConfiguration((context, configuration) =>
// {
// configuration.Sources.Clear();
// var envName = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
// configuration.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);
// configuration.AddJsonFile($"appsettings{envName}.json", optional: true, reloadOnChange: true);
// configuration.AddCommandLine(args);
// });
} }
} }

View File

@ -21,10 +21,18 @@
"commandName": "Project", "commandName": "Project",
"launchBrowser": true, "launchBrowser": true,
"environmentVariables": { "environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development", "ASPNETCORE_ENVIRONMENT": "Product",
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation"
}, },
"applicationUrl": "https://localhost:5001;http://localhost:5000" "applicationUrl": "https://localhost:5001;http://localhost:5000"
},
"Staging": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Staging",
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation"
}
} }
} }
} }

View File

@ -45,14 +45,14 @@ namespace SolarPower.Quartz.Jobs
var ExceptionList = await overviewRepository.GetEmailExceptionList(); var ExceptionList = await overviewRepository.GetEmailExceptionList();
if(ExceptionList.Count > 0 ) if(ExceptionList.Count > 0 )
{ {
// 立刻發報
var ExceptionListex = ExceptionList.Where(x => x.sourceState == 1 && var ExceptionListex = ExceptionList.Where(x => x.sourceState == 1 &&
x.priority == 1 && x.priority == 1 ).ToList();
(DateTime.Now.Subtract(DateTime.Parse(x.dev_time)).TotalSeconds / 60) >= ExceptionTimes_Priority1).ToList(); // 12小時後發報
var ExceptionListex2 = ExceptionList.Where(x => x.sourceState == 1 && var ExceptionListex2 = ExceptionList.Where(x => x.sourceState == 1 &&
x.priority == 2 && x.priority == 2 &&
(DateTime.Now.Subtract(DateTime.Parse(x.dev_time)).TotalSeconds / 60) >= ExceptionTimes_Priority2).ToList(); (DateTime.Now.Subtract(DateTime.Parse(x.dev_time)).TotalMinutes/ 60) >= ExceptionTimes_Priority2).ToList();
// 24小時後發報
var ExceptionListex3 = ExceptionList.Where(x => x.sourceState == 1 && x.priority == 3 && var ExceptionListex3 = ExceptionList.Where(x => x.sourceState == 1 && x.priority == 3 &&
(DateTime.Now.Subtract(DateTime.Parse(x.dev_time)).TotalSeconds / 60) >= ExceptionTimes_Priority3).ToList(); (DateTime.Now.Subtract(DateTime.Parse(x.dev_time)).TotalSeconds / 60) >= ExceptionTimes_Priority3).ToList();
ExceptionListex.AddRange(ExceptionListex2); ExceptionListex.AddRange(ExceptionListex2);

View File

@ -351,8 +351,6 @@ namespace SolarPower.Repository.Implement
public async Task<List<ExceptionDataTable>> GetExceptionTable(ExceptionSent post) public async Task<List<ExceptionDataTable>> GetExceptionTable(ExceptionSent post)
{ {
List<ExceptionDataTable> result; List<ExceptionDataTable> result;
using (IDbConnection conn = this._databaseHelper.GetConnection()) using (IDbConnection conn = this._databaseHelper.GetConnection())
{ {
@ -360,10 +358,32 @@ namespace SolarPower.Repository.Implement
{ {
DateTime start; DateTime start;
DateTime end; DateTime end;
//var sql = @$"select pr.FormId as FormId, pr.Id as ErrorID, a.id, site_id, `timestamp`, FROM_UNIXTIME((`timestamp` / 1000), '%Y-%m-%d %H:%i:%s') dev_time , a.sourceState err_status, FROM_UNIXTIME( (a.normalTime / 1000), '%Y-%m-%d %H:%i:%s') normalTime, var sql = @$"select pr.FormId as FormId, pr.Id as ErrorID, a.id, site_id, `timestamp`, FROM_UNIXTIME((`timestamp` / 1000), '%Y-%m-%d %H:%i:%s') dev_time ,
// a.alarmClass, b.alarmClass as alarmClassName,ps.Name as PowerStationName, a.sourceState err_status, FROM_UNIXTIME( (a.normalTime / 1000), '%Y-%m-%d %H:%i:%s') normalTime,
// errDevice, err_valueKind, errValue, FROM_UNIXTIME( (a.lastUpdate / 1000), '%Y-%m-%d %H:%i:%s') lastUpdate, a.alarmClass, b.alarmClass_zh as alarmClassName,ps.Name as PowerStationName, errDevice, err_valueKind, errValue,
// case when c.errMsg_tw is null then d.errMsg_tw else c.errMsg_tw end errMsg FROM_UNIXTIME( (a.lastUpdate / 1000), '%Y-%m-%d %H:%i:%s') lastUpdate,
errMsg
from err_main a
left join alarmorion_orionalarmclass b on a.alarmclass = b.id
left join power_station ps on ps.Code = site_id
left join operation_record pr on pr.ErrorCode = a.id
WHERE a.sourceState = @Status AND ps.Id = @PowerStationId ";
//var sql = @$"select pr.FormId as FormId, pr.Id as ErrorID, a.id, site_id, `timestamp`, FROM_UNIXTIME((`timestamp` / 1000), '%Y-%m-%d %H:%i:%s') dev_time ,
// a.sourceState err_status, FROM_UNIXTIME( (a.normalTime / 1000), '%Y-%m-%d %H:%i:%s') normalTime,
// a.alarmClass, b.alarmClass_zh as alarmClassName,ps.Name as PowerStationName, errDevice, err_valueKind, errValue, FROM_UNIXTIME( (a.lastUpdate / 1000), '%Y-%m-%d %H:%i:%s') lastUpdate, c.errMsg_tw cerrMsg_tw, d.errMsg_tw derrMsg_tw,
// case when c.errMsg_tw is null then
// case when err_valueKind = 'b' then d.errMsg_tw
// when err_valueKind = 'd' then CONCAT(d.errMsg_tw, ': ', round(a.errValue, 2))
// when d.errMsg_tw is null then a.errValue
// when a.errValue is null then d.errMsg_tw
// else CONCAT(a.errValue, ', ' , ifNull(d.errMsg_tw, '')) end
// else
// case when err_valueKind = 'b' then c.errMsg_tw
// when err_valueKind = 'd' then CONCAT(c.errMsg_tw, ': ', round(a.errValue, 2))
// when c.errMsg_tw is null then a.errValue
// when a.errValue is null then c.errMsg_tw
// else CONCAT(a.errValue, ', ' , ifNull(c.errMsg_tw, '')) end
// end errMsg
// from err_main a // from err_main a
// left join alarmorion_orionalarmclass b on a.alarmclass = b.id // left join alarmorion_orionalarmclass b on a.alarmclass = b.id
// left join ref_err_device c on trim(b.alarmClass) = c.deviceType // left join ref_err_device c on trim(b.alarmClass) = c.deviceType
@ -373,31 +393,6 @@ namespace SolarPower.Repository.Implement
// left join power_station ps on ps.Code = site_id // left join power_station ps on ps.Code = site_id
// left join operation_record pr on pr.ErrorCode = a.id // left join operation_record pr on pr.ErrorCode = a.id
// WHERE a.sourceState = @Status AND ps.Id = @PowerStationId "; // WHERE a.sourceState = @Status AND ps.Id = @PowerStationId ";
var sql = @$"select pr.FormId as FormId, pr.Id as ErrorID, a.id, site_id, `timestamp`, FROM_UNIXTIME((`timestamp` / 1000), '%Y-%m-%d %H:%i:%s') dev_time ,
a.sourceState err_status, FROM_UNIXTIME( (a.normalTime / 1000), '%Y-%m-%d %H:%i:%s') normalTime,
a.alarmClass, b.alarmClass_zh as alarmClassName,ps.Name as PowerStationName, errDevice, err_valueKind, errValue, FROM_UNIXTIME( (a.lastUpdate / 1000), '%Y-%m-%d %H:%i:%s') lastUpdate, c.errMsg_tw cerrMsg_tw, d.errMsg_tw derrMsg_tw,
case when c.errMsg_tw is null then
case when err_valueKind = 'b' then d.errMsg_tw
when err_valueKind = 'd' then CONCAT(d.errMsg_tw, ': ', round(a.errValue, 2))
when d.errMsg_tw is null then a.errValue
when a.errValue is null then d.errMsg_tw
else CONCAT(a.errValue, ', ' , ifNull(d.errMsg_tw, '')) end
else
case when err_valueKind = 'b' then c.errMsg_tw
when err_valueKind = 'd' then CONCAT(c.errMsg_tw, ': ', round(a.errValue, 2))
when c.errMsg_tw is null then a.errValue
when a.errValue is null then c.errMsg_tw
else CONCAT(a.errValue, ', ' , ifNull(c.errMsg_tw, '')) end
end errMsg
from err_main a
left join alarmorion_orionalarmclass b on a.alarmclass = b.id
left join ref_err_device c on trim(b.alarmClass) = c.deviceType
left join ref_err_inv d on lower(b.alarmClass) = d.deviceType
# and case when lower(b.alarmClass) = 'inverter' and err_valuekind = 'e' then errvalue else '' end = d.errCode
and a.errDeviceBrand = d.brend and a.errDeviceModel = d.model and a.errValue = d.errCode
left join power_station ps on ps.Code = site_id
left join operation_record pr on pr.ErrorCode = a.id
WHERE a.sourceState = @Status AND ps.Id = @PowerStationId ";
if (!string.IsNullOrEmpty(post.Range)) if (!string.IsNullOrEmpty(post.Range))
{ {

View File

@ -29,6 +29,7 @@ using System.Threading.Tasks;
namespace SolarPower namespace SolarPower
{ {
// ref https://ithelp.ithome.com.tw/articles/10185314
public class Startup public class Startup
{ {
public IConfiguration Configuration { get; } public IConfiguration Configuration { get; }
@ -39,6 +40,11 @@ namespace SolarPower
{ {
CurrentEnvironment = env; CurrentEnvironment = env;
Configuration = configuration; Configuration = configuration;
var builder = new ConfigurationBuilder()
.SetBasePath(env.ContentRootPath)
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
.AddEnvironmentVariables();
dBConfig.Server = Configuration.GetValue<string>("DBConfig:Server"); dBConfig.Server = Configuration.GetValue<string>("DBConfig:Server");
dBConfig.Port = Configuration.GetValue<string>("DBConfig:Port"); dBConfig.Port = Configuration.GetValue<string>("DBConfig:Port");
@ -96,66 +102,66 @@ namespace SolarPower
#region ¥[¤J­I´º°õ¦æ #region ¥[¤J­I´º°õ¦æ
//services.AddHostedService<OperationScheduleBackgroundService>(); //services.AddHostedService<OperationScheduleBackgroundService>();
//if (envName == "Production") //if (envName == "Production")
//if (envName != "Production") if (envName != "Production")
//{ {
////²K¥[QuartzªA°È ////²K¥[QuartzªA°È
services.AddSingleton<IJobFactory, SingletonJobFactory>(); services.AddSingleton<IJobFactory, SingletonJobFactory>();
services.AddSingleton<ISchedulerFactory, StdSchedulerFactory>(); services.AddSingleton<ISchedulerFactory, StdSchedulerFactory>();
////添加Job ////添加Job
//#region 定期計畫 / 每日 email 報表服務 //#region 定期計畫 / 每日 email 報表服務
services.AddSingleton<OperationScheduleJob>(); services.AddSingleton<OperationScheduleJob>();
services.AddSingleton(
new JobSchedule(jobType: typeof(OperationScheduleJob), cronExpression: Configuration.GetValue<string>("BackgroundServiceCron:OperationScheduleJob"))
);
//#endregion
//#region 計算電站逆變器資訊(每整點2分開始執行15分鐘一個循環)
services.AddSingleton<CalcInverter15minJob>();
services.AddSingleton(
new JobSchedule(jobType: typeof(CalcInverter15minJob), cronExpression: Configuration.GetValue<string>("BackgroundServiceCron:CalcInverter15minJob"))
);
//#endregion
////#region 計算電站發電量等資訊(每整點5分執行)
//services.AddSingleton<CalcPowerStationJob>();
//services.AddSingleton(
//new JobSchedule(jobType: typeof(CalcPowerStationJob), cronExpression: Configuration.GetValue<string>("BackgroundServiceCron:CalcPowerStationJob"))
////new JobSchedule(jobType: typeof(CalcPowerStationJob), cronExpression: "0/10 * * * * ?")
//);
////#endregion
//#region 計算電站發電量等資訊(每整點5分執行)
services.AddSingleton<CalcPowerStationJobV2>();
services.AddSingleton(
new JobSchedule(jobType: typeof(CalcPowerStationJobV2), cronExpression: Configuration.GetValue<string>("BackgroundServiceCron:CalcPowerStationJobV2"))
//new JobSchedule(jobType: typeof(CalcPowerStationJobV2), cronExpression: "0/10 * * * * ?")
);
//#endregion
//#region 計算電站日照量、PR、kWP 30日平均、(每天凌晨2點執行)
services.AddSingleton<CalcAvgPowerStationJob>();
services.AddSingleton(
new JobSchedule(jobType: typeof(CalcAvgPowerStationJob), cronExpression: Configuration.GetValue<string>("BackgroundServiceCron:CalcAvgPowerStationJob"))
//new JobSchedule(jobType: typeof(CalcAvgPowerStationJob), cronExpression: "0 03 7 ? * * *")
);
//#endregion
//#region 寄送Email(每天凌晨2點執行)
services.AddSingleton<SendEmailJob>();
services.AddSingleton(
new JobSchedule(jobType: typeof(SendEmailJob), cronExpression: Configuration.GetValue<string>("BackgroundServiceCron:SendEmailJob"))
);
//#endregion
//#region 查詢異常新增至Email
services.AddSingleton<ExceptionSchedule>();
services.AddSingleton( services.AddSingleton(
new JobSchedule(jobType: typeof(ExceptionSchedule), cronExpression: Configuration.GetValue<string>("BackgroundServiceCron:ExceptionSchedule")) new JobSchedule(jobType: typeof(OperationScheduleJob), cronExpression: Configuration.GetValue<string>("BackgroundServiceCron:OperationScheduleJob"))
); );
//#endregion //#endregion
services.AddHostedService<QuartzHostedService>(); //#region 計算電站逆變器資訊(每整點2分開始執行15分鐘一個循環)
//} services.AddSingleton<CalcInverter15minJob>();
services.AddSingleton(
new JobSchedule(jobType: typeof(CalcInverter15minJob), cronExpression: Configuration.GetValue<string>("BackgroundServiceCron:CalcInverter15minJob"))
);
//#endregion
////#region 計算電站發電量等資訊(每整點5分執行)
//services.AddSingleton<CalcPowerStationJob>();
//services.AddSingleton(
//new JobSchedule(jobType: typeof(CalcPowerStationJob), cronExpression: Configuration.GetValue<string>("BackgroundServiceCron:CalcPowerStationJob"))
////new JobSchedule(jobType: typeof(CalcPowerStationJob), cronExpression: "0/10 * * * * ?")
//);
////#endregion
//#region 計算電站發電量等資訊(每整點5分執行)
services.AddSingleton<CalcPowerStationJobV2>();
services.AddSingleton(
new JobSchedule(jobType: typeof(CalcPowerStationJobV2), cronExpression: Configuration.GetValue<string>("BackgroundServiceCron:CalcPowerStationJobV2"))
//new JobSchedule(jobType: typeof(CalcPowerStationJobV2), cronExpression: "0/10 * * * * ?")
);
//#endregion
//#region 計算電站日照量、PR、kWP 30日平均、(每天凌晨2點執行)
services.AddSingleton<CalcAvgPowerStationJob>();
services.AddSingleton(
new JobSchedule(jobType: typeof(CalcAvgPowerStationJob), cronExpression: Configuration.GetValue<string>("BackgroundServiceCron:CalcAvgPowerStationJob"))
//new JobSchedule(jobType: typeof(CalcAvgPowerStationJob), cronExpression: "0 03 7 ? * * *")
);
//#endregion
//#region 寄送Email(每天凌晨2點執行)
services.AddSingleton<SendEmailJob>();
services.AddSingleton(
new JobSchedule(jobType: typeof(SendEmailJob), cronExpression: Configuration.GetValue<string>("BackgroundServiceCron:SendEmailJob"))
);
//#endregion
//#region 查詢異常新增至Email
services.AddSingleton<ExceptionSchedule>();
services.AddSingleton(
new JobSchedule(jobType: typeof(ExceptionSchedule), cronExpression: Configuration.GetValue<string>("BackgroundServiceCron:ExceptionSchedule"))
);
//#endregion
services.AddHostedService<QuartzHostedService>();
}
#endregion #endregion
services.AddApplicationInsightsTelemetry(); services.AddApplicationInsightsTelemetry();

View File

@ -0,0 +1,64 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"LoginExpireMinute": 60, //()
"GoBackDay": 1, //(())
//"DBConfig": {
// "Server": "MVgHWzR3rGDgD57TUoFunA==",
// "port": "r4AoXMUDodcQjIzofGNCcg==",
// "Database": "z8TVtiXZ6MwgWbUEAOXA/fiHzd7c0iUhFqn1mHzxhKo=",
// "Root": "mWlR2HshQNhRRE34jg4kdg==",
// "Password": "y4uPqlH9ncTgR/I07qpwaA=="
//},
//"mySql": "server=210.61.91.43;user=idafenweb;Database=solar_master;Port=10068;password=P@ssw0rd;charset='utf8';pooling=true;sslmode=none;",
"mySql": "server=60.251.164.103;user=webuser;Database=solar_master;Port=11306;password=FICadmin99;charset='utf8';pooling=true;sslmode=none;",
//
"DBConfig": {
"Server": "MWAxcj1mgmbZ8tB6NgApnQ==",
"port": "CY1x+1WYXRCBab3wKnBCOQ==",
"Database": "CEyYZnO8B5+yTXQcFSsiBA==",
"Root": "pBX64+ALGFnLiHGRFXNh7w==",
"Password": "y4uPqlH9ncTgR/I07qpwaA=="
},
// FIC
//"DBConfig": {
// "Server": "MWAxcj1mgmbZ8tB6NgApnQ==",
// "port": "CY1x+1WYXRCBab3wKnBCOQ==",
// "Database": "CEyYZnO8B5+yTXQcFSsiBA==",
// "Root": "4koIJVzfp6veImONCwQy3A==",
// "Password": "y4uPqlH9ncTgR/I07qpwaA=="
//},
"BackgroundServiceCron": {
"CalcPowerStationJob": "0 05 * * * ?",
"CalcPowerStationJobV2": "0 05 * * * ?",
"CalcAvgPowerStationJob": "0 12 0 * * ?",
"OperationScheduleJob": "0 0 8 * * ?",
"CalcInverter15minJob": "0 2/15 * * * ?",
"SendEmailJob": "0 0/5 * * * ?",
"ExceptionSchedule": "0 0/5 * * * ?"
},
"SMTPConfig": {
"Host": "smtp.gmail.com",
"Port": 25,
"UserName": "shanghohui@gmail.com",
"Password": "wswgnluvoodfexrb",
"EnableSsl": true
},
"ExceptionTimes": 240, //()
"ExceptionTimes_Priority1": 1440,
"ExceptionTimes_Priority2": 720,
"ExceptionTimes_Priority3": 0
//"SMTPConfig": {
// "Host": "smtp.gmail.com",
// "Port": 25,
// "UserName": "ficgreen01@gmail.com",
// "Password": "qwe2015qwe",
// "EnableSsl": true
//}
}

View File

@ -47,11 +47,11 @@
"Host": "smtp.gmail.com", "Host": "smtp.gmail.com",
"Port": 25, "Port": 25,
"UserName": "ficgreen01@gmail.com", "UserName": "ficgreen01@gmail.com",
"Password": "opuisjyxgyjbjtha", //2022-09-02 update by jiahao "Password": "opuisjyxgyjbjtha", //2022-09-02 update by jiahao
"EnableSsl": true "EnableSsl": true
}, },
"ExceptionTimes": 240, //() "ExceptionTimes": 240, //()
"ExceptionTimes_Priority1": 1440, "ExceptionTimes_Priority1": 0,
"ExceptionTimes_Priority2": 720, "ExceptionTimes_Priority2": 720,
"ExceptionTimes_Priority3": 0 "ExceptionTimes_Priority3": 1440
} }

View File

@ -36,34 +36,42 @@ namespace solarApp.Service
conn.Open(); conn.Open();
#region Normal time #region Normal time
dt_start = DateTime.Now; dt_start = DateTime.Now;
string sql = $@" update`err_main` a join alarmorion_orionalarmrecord b on a.id = b.id set //string sql = $@" update`err_main` a join alarmorion_orionalarmrecord b on a.id = b.id set
a.`sourcestate` = b.`sourcestate`, // a.`sourcestate` = b.`sourcestate`,
a.`ackstate` = b.`ackstate`, // a.`ackstate` = b.`ackstate`,
a.`priority` = b.`priority`, // a.`priority` = b.`priority`,
a.`normaltime` = b.`normaltime`, // a.`normaltime` = b.`normaltime`,
a.`acktime` = b.`acktime`, // a.`acktime` = b.`acktime`,
a.`lastupdate` = b.`lastupdate` // a.`lastupdate` = b.`lastupdate`
where a.sourcestate = 1 and b.datestamp >= '{ System.DateTime.Now.AddDays(-60).ToString("yyyy-MM-dd")}'";// and a.site_id is not null "; // ;"; // where b.datestamp >= '{ System.DateTime.Now.AddDays(-60).ToString("yyyy-MM-dd")}'";// and a.site_id is not null "; // ;";
int rowCount = conn.Execute(sql, commandTimeout: 600); string ss = $@" update`err_main` a join alarmorion_orionalarmrecord b on a.id = b.id set
a.`sourcestate` = b.`sourcestate`,
a.`ackstate` = b.`ackstate`,
a.`priority` = b.`priority`,
a.`normaltime` = b.`normaltime`,
a.`acktime` = b.`acktime`,
a.`lastupdate` = b.`lastupdate`
where FROM_UNIXTIME(b.normaltime/1000, '%Y-%m-%d') >= '{ System.DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd")}'";
int rowCount = conn.Execute(ss, commandTimeout: 600);
TimeSpan durationSec = DateTime.Now - dt_start; TimeSpan durationSec = DateTime.Now - dt_start;
arclog.insert_log("0", "syncError s0 normaltime", durationSec.TotalSeconds, "orionAlarmRecord", "err_main", "0", "", rowCount.ToString(), conn, null); arclog.insert_log("0", "syncError s0 normaltime", durationSec.TotalSeconds, "orionAlarmRecord", "err_main", "0", "", rowCount.ToString(), conn, null);
#endregion #endregion
#region #region
sql = $@" select max(id) new_id, (select max(id) old_id from err_main ) old_id ss = $@" select max(id) new_id, (select max(id) old_id from err_main ) old_id
from alarmorion_orionalarmrecord "; from alarmorion_orionalarmrecord ";
var ds_max = conn.Query<max_id>(sql, commandTimeout: 600).AsList<max_id>(); var ds_max = conn.Query<max_id>(ss, commandTimeout: 600).AsList<max_id>();
if (ds_max.Count == 0 ) return false; // 查無資料 if (ds_max.Count == 0 ) return false; // 查無資料
if (ds_max[0].new_id == ds_max[0].old_id) return true; // 無新資料 if (ds_max[0].new_id == ds_max[0].old_id) return true; // 無新資料
sql = $@" select * from alarmorion_orionalarmrecord ss = $@" select * from alarmorion_orionalarmrecord
where id > {ds_max[0].old_id}"; where id > {ds_max[0].old_id}";
// and datestamp >= '{System.DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd")}'"; // and datestamp >= '{System.DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd")}'";
//sql = $@"select * from err_main //sql = $@"select * from err_main
// where site_id is null and datestamp >= '{System.DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd")}'"; // where site_id is null and datestamp >= '{System.DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd")}'";
var ds = conn.Query<errMain_model>(sql, commandTimeout: 600).AsList<errMain_model>(); var ds = conn.Query<errMain_model>(ss, commandTimeout: 600).AsList<errMain_model>();
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
bool isfirst = true; bool isfirst = true;
foreach (var item in ds) foreach (var item in ds)
@ -81,7 +89,7 @@ namespace solarApp.Service
if (ds.Count > 0) if (ds.Count > 0)
{ {
#region err_main #region err_main
sql = ""; string sql = "";
string sql_header = "INSERT INTO `err_main`(`id`, `timestamp`, `datestamp`, `uuidHash`, `uuid`, `isOpen`, `sourceState`, `ackState`, `ackRequired`, `alarmClass`, `priority`, `normalTime`, `ackTime`, `userAccount`, `alarmTransition`, `lastUpdate`) "; string sql_header = "INSERT INTO `err_main`(`id`, `timestamp`, `datestamp`, `uuidHash`, `uuid`, `isOpen`, `sourceState`, `ackState`, `ackRequired`, `alarmClass`, `priority`, `normalTime`, `ackTime`, `userAccount`, `alarmTransition`, `lastUpdate`) ";
foreach (var item in ds) foreach (var item in ds)
{ // //{item.uuidHash}, '{Convert.ToBase64String(item.uuid)}' { // //{item.uuidHash}, '{Convert.ToBase64String(item.uuid)}'
@ -94,7 +102,7 @@ namespace solarApp.Service
arclog.insert_log("0", "syncError s1", duration.TotalSeconds, "orionAlarmRecord", "err_main", "0", "", rowCT.ToString(), conn, null); arclog.insert_log("0", "syncError s1", duration.TotalSeconds, "orionAlarmRecord", "err_main", "0", "", rowCT.ToString(), conn, null);
#endregion #endregion
#region update site_id, inverterID #region update site_id, inverterID
dt_start = DateTime.Now; dt_start = DateTime.Now;
sql = $@"update err_main a join alarmorion_orionalarmfacetvalue b on a.id = b.alarm sql = $@"update err_main a join alarmorion_orionalarmfacetvalue b on a.id = b.alarm
set err_valuekind = left(`value`, 1), set err_valuekind = left(`value`, 1),
@ -108,7 +116,7 @@ namespace solarApp.Service
#endregion #endregion
#region update site_id, device_id #region update site_id, device_id
dt_start = DateTime.Now; dt_start = DateTime.Now;
sql = $@"update err_main a join alarmorion_orionalarmfacetvalue b on a.id = b.alarm sql = $@"update err_main a join alarmorion_orionalarmfacetvalue b on a.id = b.alarm
set err_valuekind = left(`value`, 1), set err_valuekind = left(`value`, 1),
@ -125,15 +133,24 @@ namespace solarApp.Service
#endregion #endregion
#region update // #region update 設備廠牌
dt_start = DateTime.Now; // dt_start = DateTime.Now;
sql = $@"update err_main a join v_company_inv b on a.errDevice = b.INVERTERID set // sql = $@"update err_main a join v_company_inv b on a.errDevice = b.INVERTERID set
errDeviceBrand = b.brand, //errDeviceBrand = b.brand,
errDeviceModel = b.Model //errDeviceModel = b.Model
where errDevice is not null and datestamp >= '{System.DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd")}';"; // where errDevice is not null and datestamp >= '{System.DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd")}';";
rowCT = conn.Execute(sql, commandTimeout: 600); // rowCT = conn.Execute(sql, commandTimeout: 600);
duration = DateTime.Now - dt_start; // duration = DateTime.Now - dt_start;
arclog.insert_log("0", "syncError s4 site_id", duration.TotalSeconds, "v_company_inv", "err_main", "0", "", rowCT.ToString(), conn, null); // arclog.insert_log("0", "syncError s4 site_id", duration.TotalSeconds, "v_company_inv", "err_main", "0", "", rowCT.ToString(), conn, null);
// #endregion
#region update
sql = $@" update err_main a join alarmorion_orionalarmfacetvalue b on a.id = b.alarm
set errMsg = unicode_decode(`value`)
where facetName = 6 and alarm in ({sb.ToString()});";
rowCT = conn.Execute(sql, commandTimeout: 600);
duration = DateTime.Now - dt_start;
arclog.insert_log("0", "syncError s4 errMsg", duration.TotalSeconds, "facetvalue", "err_main", "0", "", rowCT.ToString(), conn, null);
#endregion #endregion
#region #region

View File

@ -30,8 +30,8 @@ namespace solarApp
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage(); this.tabPage1 = new System.Windows.Forms.TabPage();
this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.splitContainer1 = new System.Windows.Forms.SplitContainer();
@ -59,6 +59,7 @@ namespace solarApp
this.gv_inv_detail = new System.Windows.Forms.DataGridView(); this.gv_inv_detail = new System.Windows.Forms.DataGridView();
this.gv_rpt_invDay = new System.Windows.Forms.DataGridView(); this.gv_rpt_invDay = new System.Windows.Forms.DataGridView();
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.lbMsgStatus = new System.Windows.Forms.Label();
this.lbMsgTitle = new System.Windows.Forms.Label(); this.lbMsgTitle = new System.Windows.Forms.Label();
this.bt_invDay = new System.Windows.Forms.Button(); this.bt_invDay = new System.Windows.Forms.Button();
this.btVerifyData = new System.Windows.Forms.Button(); this.btVerifyData = new System.Windows.Forms.Button();
@ -89,7 +90,6 @@ namespace solarApp
this.tabPage4 = new System.Windows.Forms.TabPage(); this.tabPage4 = new System.Windows.Forms.TabPage();
this.btSyncErr = new System.Windows.Forms.Button(); this.btSyncErr = new System.Windows.Forms.Button();
this.timer1 = new System.Windows.Forms.Timer(this.components); this.timer1 = new System.Windows.Forms.Timer(this.components);
this.lbMsgStatus = new System.Windows.Forms.Label();
this.tabControl1.SuspendLayout(); this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout(); this.tabPage1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
@ -395,8 +395,8 @@ namespace solarApp
// //
this.gv_inv_detail.AllowUserToAddRows = false; this.gv_inv_detail.AllowUserToAddRows = false;
this.gv_inv_detail.AllowUserToDeleteRows = false; this.gv_inv_detail.AllowUserToDeleteRows = false;
dataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
this.gv_inv_detail.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle5; this.gv_inv_detail.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
this.gv_inv_detail.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.gv_inv_detail.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.gv_inv_detail.Dock = System.Windows.Forms.DockStyle.Fill; this.gv_inv_detail.Dock = System.Windows.Forms.DockStyle.Fill;
this.gv_inv_detail.Location = new System.Drawing.Point(768, 75); this.gv_inv_detail.Location = new System.Drawing.Point(768, 75);
@ -412,8 +412,8 @@ namespace solarApp
// //
this.gv_rpt_invDay.AllowUserToAddRows = false; this.gv_rpt_invDay.AllowUserToAddRows = false;
this.gv_rpt_invDay.AllowUserToDeleteRows = false; this.gv_rpt_invDay.AllowUserToDeleteRows = false;
dataGridViewCellStyle6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); dataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
this.gv_rpt_invDay.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6; this.gv_rpt_invDay.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle2;
this.gv_rpt_invDay.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.gv_rpt_invDay.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.gv_rpt_invDay.Dock = System.Windows.Forms.DockStyle.Left; this.gv_rpt_invDay.Dock = System.Windows.Forms.DockStyle.Left;
this.gv_rpt_invDay.Location = new System.Drawing.Point(0, 75); this.gv_rpt_invDay.Location = new System.Drawing.Point(0, 75);
@ -442,6 +442,15 @@ namespace solarApp
this.panel1.Size = new System.Drawing.Size(1358, 75); this.panel1.Size = new System.Drawing.Size(1358, 75);
this.panel1.TabIndex = 0; this.panel1.TabIndex = 0;
// //
// lbMsgStatus
//
this.lbMsgStatus.AutoSize = true;
this.lbMsgStatus.Location = new System.Drawing.Point(520, 49);
this.lbMsgStatus.Name = "lbMsgStatus";
this.lbMsgStatus.Size = new System.Drawing.Size(18, 19);
this.lbMsgStatus.TabIndex = 16;
this.lbMsgStatus.Text = "...";
//
// lbMsgTitle // lbMsgTitle
// //
this.lbMsgTitle.AutoSize = true; this.lbMsgTitle.AutoSize = true;
@ -757,15 +766,6 @@ namespace solarApp
// //
this.timer1.Interval = 10000; this.timer1.Interval = 10000;
// //
// lbMsgStatus
//
this.lbMsgStatus.AutoSize = true;
this.lbMsgStatus.Location = new System.Drawing.Point(520, 49);
this.lbMsgStatus.Name = "lbMsgStatus";
this.lbMsgStatus.Size = new System.Drawing.Size(18, 19);
this.lbMsgStatus.TabIndex = 16;
this.lbMsgStatus.Text = "...";
//
// fmArchive // fmArchive
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 19F); this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 19F);
@ -773,7 +773,7 @@ namespace solarApp
this.ClientSize = new System.Drawing.Size(1782, 953); this.ClientSize = new System.Drawing.Size(1782, 953);
this.Controls.Add(this.tabControl1); this.Controls.Add(this.tabControl1);
this.Name = "fmArchive"; this.Name = "fmArchive";
this.Text = "fmArchive 0822"; this.Text = "fmArchive 0907";
this.Load += new System.EventHandler(this.fmArchive_Load); this.Load += new System.EventHandler(this.fmArchive_Load);
this.tabControl1.ResumeLayout(false); this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false); this.tabPage1.ResumeLayout(false);

View File

@ -109,9 +109,15 @@ namespace solarApp
lbMsgStatus.Text = (autoTask) ? "autoTask = true" : "autoTask = false"; lbMsgStatus.Text = (autoTask) ? "autoTask = true" : "autoTask = false";
lbMsgStatus.Text += " timespan = " + (DateTime.Now - doTimerTaskTime).TotalMinutes.ToString(); lbMsgStatus.Text += " timespan = " + (DateTime.Now - doTimerTaskTime).TotalMinutes.ToString();
if (DateTime.Now.Hour >= 2 && DateTime.Now.Minute == 0)
{
doTimerTaskTime = DateTime.Now;
autoTask = false;
}
// 凌晨 2點後如果間隔30分鐘 沒有跑異常同步 就啟動啟動 // 凌晨 2點後如果間隔30分鐘 沒有跑異常同步 就啟動啟動
doTaskDuratin = DateTime.Now - doTimerTaskTime; // 1200 sec = 20 分鐘 doTaskDuratin = DateTime.Now - doTimerTaskTime; //
if (System.DateTime.Now.Hour >= 2 && doTaskDuratin.TotalSeconds > 1200 && (autoTask == true)) if (DateTime.Now.Hour >= 2 && doTaskDuratin.TotalMinutes > 15 && (autoTask == true))
{ {
doTimerTaskTime = DateTime.Now; doTimerTaskTime = DateTime.Now;
autoTask = false; autoTask = false;

View File

@ -83,6 +83,10 @@ namespace solarApp
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle52 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle52 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle53 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle53 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle54 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle54 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle55 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle56 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle57 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle58 = new System.Windows.Forms.DataGridViewCellStyle();
this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabControl1 = new System.Windows.Forms.TabControl();
this.tb_inv = new System.Windows.Forms.TabPage(); this.tb_inv = new System.Windows.Forms.TabPage();
this.sp_main_inv = new System.Windows.Forms.SplitContainer(); this.sp_main_inv = new System.Windows.Forms.SplitContainer();
@ -174,6 +178,7 @@ namespace solarApp
this.label13 = new System.Windows.Forms.Label(); this.label13 = new System.Windows.Forms.Label();
this.label12 = new System.Windows.Forms.Label(); this.label12 = new System.Windows.Forms.Label();
this.btLoadData = new System.Windows.Forms.Button(); this.btLoadData = new System.Windows.Forms.Button();
this.splitContainer4 = new System.Windows.Forms.SplitContainer();
this.gv_all_data = new System.Windows.Forms.DataGridView(); this.gv_all_data = new System.Windows.Forms.DataGridView();
this.gv_notice_data = new System.Windows.Forms.DataGridView(); this.gv_notice_data = new System.Windows.Forms.DataGridView();
this.tabControl1.SuspendLayout(); this.tabControl1.SuspendLayout();
@ -237,6 +242,10 @@ namespace solarApp
this.splitContainer3.Panel1.SuspendLayout(); this.splitContainer3.Panel1.SuspendLayout();
this.splitContainer3.Panel2.SuspendLayout(); this.splitContainer3.Panel2.SuspendLayout();
this.splitContainer3.SuspendLayout(); this.splitContainer3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer4)).BeginInit();
this.splitContainer4.Panel1.SuspendLayout();
this.splitContainer4.Panel2.SuspendLayout();
this.splitContainer4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.gv_all_data)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.gv_all_data)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gv_notice_data)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.gv_notice_data)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
@ -611,7 +620,6 @@ namespace solarApp
this.panel1.Controls.Add(this.lb_inv_hour); this.panel1.Controls.Add(this.lb_inv_hour);
this.panel1.Dock = System.Windows.Forms.DockStyle.Top; this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(0, 0); this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Margin = new System.Windows.Forms.Padding(4);
this.panel1.Name = "panel1"; this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(660, 38); this.panel1.Size = new System.Drawing.Size(660, 38);
this.panel1.TabIndex = 0; this.panel1.TabIndex = 0;
@ -695,7 +703,6 @@ namespace solarApp
this.panel2.Controls.Add(this.lb_raw_inv_hour); this.panel2.Controls.Add(this.lb_raw_inv_hour);
this.panel2.Dock = System.Windows.Forms.DockStyle.Top; this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
this.panel2.Location = new System.Drawing.Point(0, 0); this.panel2.Location = new System.Drawing.Point(0, 0);
this.panel2.Margin = new System.Windows.Forms.Padding(4);
this.panel2.Name = "panel2"; this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(690, 38); this.panel2.Size = new System.Drawing.Size(690, 38);
this.panel2.TabIndex = 1; this.panel2.TabIndex = 1;
@ -1661,6 +1668,7 @@ namespace solarApp
// //
// splitContainer3 // splitContainer3
// //
this.splitContainer3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.splitContainer3.Cursor = System.Windows.Forms.Cursors.HSplit; this.splitContainer3.Cursor = System.Windows.Forms.Cursors.HSplit;
this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill; this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer3.Location = new System.Drawing.Point(3, 3); this.splitContainer3.Location = new System.Drawing.Point(3, 3);
@ -1676,8 +1684,7 @@ namespace solarApp
// //
// splitContainer3.Panel2 // splitContainer3.Panel2
// //
this.splitContainer3.Panel2.Controls.Add(this.gv_all_data); this.splitContainer3.Panel2.Controls.Add(this.splitContainer4);
this.splitContainer3.Panel2.Controls.Add(this.gv_notice_data);
this.splitContainer3.Size = new System.Drawing.Size(1729, 1017); this.splitContainer3.Size = new System.Drawing.Size(1729, 1017);
this.splitContainer3.SplitterDistance = 91; this.splitContainer3.SplitterDistance = 91;
this.splitContainer3.TabIndex = 0; this.splitContainer3.TabIndex = 0;
@ -1722,41 +1729,91 @@ namespace solarApp
this.btLoadData.UseVisualStyleBackColor = true; this.btLoadData.UseVisualStyleBackColor = true;
this.btLoadData.Click += new System.EventHandler(this.button1_Click_1); this.btLoadData.Click += new System.EventHandler(this.button1_Click_1);
// //
// splitContainer4
//
this.splitContainer4.Cursor = System.Windows.Forms.Cursors.VSplit;
this.splitContainer4.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer4.Location = new System.Drawing.Point(0, 0);
this.splitContainer4.Name = "splitContainer4";
//
// splitContainer4.Panel1
//
this.splitContainer4.Panel1.Controls.Add(this.gv_all_data);
//
// splitContainer4.Panel2
//
this.splitContainer4.Panel2.Controls.Add(this.gv_notice_data);
this.splitContainer4.Size = new System.Drawing.Size(1727, 920);
this.splitContainer4.SplitterDistance = 733;
this.splitContainer4.SplitterWidth = 15;
this.splitContainer4.TabIndex = 1;
//
// gv_all_data // gv_all_data
// //
this.gv_all_data.AllowUserToAddRows = false; this.gv_all_data.AllowUserToAddRows = false;
this.gv_all_data.AllowUserToDeleteRows = false; this.gv_all_data.AllowUserToDeleteRows = false;
dataGridViewCellStyle53.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); dataGridViewCellStyle53.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
this.gv_all_data.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle53; this.gv_all_data.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle53;
dataGridViewCellStyle54.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle54.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle54.Font = new System.Drawing.Font("Microsoft JhengHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
dataGridViewCellStyle54.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle54.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle54.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle54.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.gv_all_data.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle54;
this.gv_all_data.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.gv_all_data.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.gv_all_data.Cursor = System.Windows.Forms.Cursors.Arrow; this.gv_all_data.Cursor = System.Windows.Forms.Cursors.Arrow;
dataGridViewCellStyle55.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle55.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle55.Font = new System.Drawing.Font("Microsoft JhengHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
dataGridViewCellStyle55.ForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle55.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle55.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle55.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.gv_all_data.DefaultCellStyle = dataGridViewCellStyle55;
this.gv_all_data.Dock = System.Windows.Forms.DockStyle.Fill; this.gv_all_data.Dock = System.Windows.Forms.DockStyle.Fill;
this.gv_all_data.Location = new System.Drawing.Point(0, 0); this.gv_all_data.Location = new System.Drawing.Point(0, 0);
this.gv_all_data.Name = "gv_all_data"; this.gv_all_data.Name = "gv_all_data";
this.gv_all_data.ReadOnly = true; this.gv_all_data.ReadOnly = true;
this.gv_all_data.RowHeadersWidth = 51; this.gv_all_data.RowHeadersWidth = 51;
this.gv_all_data.RowTemplate.Height = 29; this.gv_all_data.RowTemplate.Height = 29;
this.gv_all_data.Size = new System.Drawing.Size(863, 922); this.gv_all_data.Size = new System.Drawing.Size(733, 920);
this.gv_all_data.TabIndex = 1; this.gv_all_data.TabIndex = 2;
// //
// gv_notice_data // gv_notice_data
// //
this.gv_notice_data.AllowUserToAddRows = false; this.gv_notice_data.AllowUserToAddRows = false;
this.gv_notice_data.AllowUserToDeleteRows = false; this.gv_notice_data.AllowUserToDeleteRows = false;
this.gv_notice_data.AllowUserToOrderColumns = true; this.gv_notice_data.AllowUserToOrderColumns = true;
dataGridViewCellStyle54.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); dataGridViewCellStyle56.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
this.gv_notice_data.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle54; this.gv_notice_data.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle56;
dataGridViewCellStyle57.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle57.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle57.Font = new System.Drawing.Font("Microsoft JhengHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
dataGridViewCellStyle57.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle57.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle57.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle57.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.gv_notice_data.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle57;
this.gv_notice_data.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.gv_notice_data.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.gv_notice_data.Cursor = System.Windows.Forms.Cursors.Arrow; this.gv_notice_data.Cursor = System.Windows.Forms.Cursors.Arrow;
this.gv_notice_data.Dock = System.Windows.Forms.DockStyle.Right; dataGridViewCellStyle58.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
this.gv_notice_data.Location = new System.Drawing.Point(863, 0); dataGridViewCellStyle58.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle58.Font = new System.Drawing.Font("Microsoft JhengHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
dataGridViewCellStyle58.ForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle58.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle58.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle58.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.gv_notice_data.DefaultCellStyle = dataGridViewCellStyle58;
this.gv_notice_data.Dock = System.Windows.Forms.DockStyle.Fill;
this.gv_notice_data.Location = new System.Drawing.Point(0, 0);
this.gv_notice_data.Name = "gv_notice_data"; this.gv_notice_data.Name = "gv_notice_data";
this.gv_notice_data.ReadOnly = true; this.gv_notice_data.ReadOnly = true;
this.gv_notice_data.RowHeadersWidth = 51; this.gv_notice_data.RowHeadersWidth = 51;
this.gv_notice_data.RowTemplate.Height = 29; this.gv_notice_data.RowTemplate.Height = 29;
this.gv_notice_data.Size = new System.Drawing.Size(866, 922); this.gv_notice_data.Size = new System.Drawing.Size(979, 920);
this.gv_notice_data.TabIndex = 0; this.gv_notice_data.TabIndex = 1;
this.gv_notice_data.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.gv_notice_test_data_CellFormatting);
// //
// fmMain // fmMain
// //
@ -1848,6 +1905,10 @@ namespace solarApp
this.splitContainer3.Panel2.ResumeLayout(false); this.splitContainer3.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).EndInit();
this.splitContainer3.ResumeLayout(false); this.splitContainer3.ResumeLayout(false);
this.splitContainer4.Panel1.ResumeLayout(false);
this.splitContainer4.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer4)).EndInit();
this.splitContainer4.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.gv_all_data)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.gv_all_data)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gv_notice_data)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.gv_notice_data)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
@ -1952,10 +2013,11 @@ namespace solarApp
private System.Windows.Forms.TabPage tabPage1; private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.SplitContainer splitContainer3; private System.Windows.Forms.SplitContainer splitContainer3;
private System.Windows.Forms.Button btLoadData; private System.Windows.Forms.Button btLoadData;
private System.Windows.Forms.DataGridView gv_all_data;
private System.Windows.Forms.DataGridView gv_notice_data;
private System.Windows.Forms.Label label13; private System.Windows.Forms.Label label13;
private System.Windows.Forms.Label label12; private System.Windows.Forms.Label label12;
private System.Windows.Forms.Button button1; private System.Windows.Forms.Button button1;
private System.Windows.Forms.SplitContainer splitContainer4;
private System.Windows.Forms.DataGridView gv_all_data;
private System.Windows.Forms.DataGridView gv_notice_data;
} }
} }

View File

@ -7,7 +7,6 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Remove="fmExcel.resx" />
<EmbeddedResource Remove="fmTest.resx" /> <EmbeddedResource Remove="fmTest.resx" />
</ItemGroup> </ItemGroup>