衝突合併
This commit is contained in:
commit
201610b3f1
16
SolarPower/Controllers/ExceptionRecordController.cs
Normal file
16
SolarPower/Controllers/ExceptionRecordController.cs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace SolarPower.Controllers
|
||||||
|
{
|
||||||
|
public class ExceptionRecordController : MyBaseController<ExceptionRecordController>
|
||||||
|
{
|
||||||
|
public IActionResult Index()
|
||||||
|
{
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -405,6 +405,51 @@ namespace SolarPower.Controllers
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<ActionResult> GetExceptionTable2(ExceptionSent2 post)
|
||||||
|
{
|
||||||
|
List<ExceptionDataTable> exceptionDataTable = new List<ExceptionDataTable>();
|
||||||
|
ApiResult<List<ExceptionDataTable>> apiResult = new ApiResult<List<ExceptionDataTable>>();
|
||||||
|
|
||||||
|
//PowerStation powerStation = null;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//powerStation = await powerStationRepository.GetOneAsync(post.Id);
|
||||||
|
exceptionDataTable = await overviewRepository.GetExceptionTable2(post);
|
||||||
|
|
||||||
|
foreach (ExceptionDataTable a in exceptionDataTable)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(a.FormId))
|
||||||
|
{
|
||||||
|
if (a.Err_status == 1)
|
||||||
|
{
|
||||||
|
a.Function = @$"<a href='javascript:;' class='btn btn-success waves-effect waves-themed mb-3 mr-2 add-btn'>填寫表單</a>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
a.Function = @$"<a href='javascript:;' class='waves-effect waves-themed mb-3 mr-2 edit-btn'>{a.FormId}</a>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
apiResult.Code = "0000";
|
||||||
|
apiResult.Data = exceptionDataTable;
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
apiResult.Code = "9999";
|
||||||
|
apiResult.Msg = errorCode.GetString(apiResult.Code);
|
||||||
|
Logger.LogError("【" + controllerName + "/" + actionName + "】");
|
||||||
|
Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message);
|
||||||
|
}
|
||||||
|
var result = Json(new
|
||||||
|
{
|
||||||
|
data = apiResult
|
||||||
|
});
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
public async Task<ApiResult<InverterkwhBar>> GetInverterkwhBarAnalysis(PostInverterkwhBarAnalysis post)
|
public async Task<ApiResult<InverterkwhBar>> GetInverterkwhBarAnalysis(PostInverterkwhBarAnalysis post)
|
||||||
{
|
{
|
||||||
ApiResult<InverterkwhBar> apiResult = new ApiResult<InverterkwhBar>();
|
ApiResult<InverterkwhBar> apiResult = new ApiResult<InverterkwhBar>();
|
||||||
|
|||||||
16
SolarPower/Controllers/StationReportController.cs
Normal file
16
SolarPower/Controllers/StationReportController.cs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace SolarPower.Controllers
|
||||||
|
{
|
||||||
|
public class StationReportController : MyBaseController<StationReportController>
|
||||||
|
{
|
||||||
|
public IActionResult Index()
|
||||||
|
{
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1971,6 +1971,11 @@ ALTER TABLE `power_station`
|
|||||||
ADD COLUMN `Estimate_kwh` DECIMAL(10,2) NULL DEFAULT '0.00' COMMENT '預估發電度數' AFTER `line_token`,
|
ADD COLUMN `Estimate_kwh` DECIMAL(10,2) NULL DEFAULT '0.00' COMMENT '預估發電度數' AFTER `line_token`,
|
||||||
ADD COLUMN `EstimateEfficacy` DECIMAL(10,2) NULL DEFAULT '0.00' COMMENT '預估發電效能' AFTER `Estimate_kwh`;
|
ADD COLUMN `EstimateEfficacy` DECIMAL(10,2) NULL DEFAULT '0.00' COMMENT '預估發電效能' AFTER `Estimate_kwh`;
|
||||||
|
|
||||||
|
-- 判定是否有建立發送email資料 20210722
|
||||||
|
ALTER TABLE `operation_plan_create`
|
||||||
|
ADD COLUMN `IsDelivery` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0' COMMENT '是否建立 發送Email資料 0:否 1:是' AFTER `LastCreateTime`;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
|
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
|
||||||
|
|||||||
12
SolarPower/Models/ExceptionRecord.cs
Normal file
12
SolarPower/Models/ExceptionRecord.cs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace SolarPower.Models
|
||||||
|
{
|
||||||
|
public class ExceptionRecord
|
||||||
|
{
|
||||||
|
public string asd { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -55,6 +55,7 @@ namespace SolarPower.Models
|
|||||||
public int ScheduleNum { get; set; }
|
public int ScheduleNum { get; set; }
|
||||||
public int ScheduleType { get; set; }
|
public int ScheduleType { get; set; }
|
||||||
public int WorkDay { get; set; }
|
public int WorkDay { get; set; }
|
||||||
|
public int IsDelivery { get; set; }
|
||||||
public string StartTime
|
public string StartTime
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|||||||
@ -93,6 +93,15 @@ namespace SolarPower.Models
|
|||||||
public string StartTime { get; set; } //起始日期
|
public string StartTime { get; set; } //起始日期
|
||||||
public string EndTime { get; set; } //結束日期
|
public string EndTime { get; set; } //結束日期
|
||||||
}
|
}
|
||||||
|
public class ExceptionSent2
|
||||||
|
{
|
||||||
|
public List<int> Id { get; set; }
|
||||||
|
public int Status { get; set; }
|
||||||
|
public string Range { get; set; }
|
||||||
|
public string StartTime { get; set; } //起始日期
|
||||||
|
public string EndTime { get; set; } //結束日期
|
||||||
|
}
|
||||||
|
|
||||||
public class ExceptionInfo
|
public class ExceptionInfo
|
||||||
{
|
{
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
@ -110,6 +119,7 @@ namespace SolarPower.Models
|
|||||||
public string PowerStationName { get; set; }
|
public string PowerStationName { get; set; }
|
||||||
public int ErrorID { get; set; }
|
public int ErrorID { get; set; }
|
||||||
public string FormId { get; set; }
|
public string FormId { get; set; }
|
||||||
|
public int PowerStationId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class PostInverterHeatMapAnalysis
|
public class PostInverterHeatMapAnalysis
|
||||||
|
|||||||
@ -29,38 +29,24 @@ namespace SolarPower.Quartz.Jobs
|
|||||||
var getTime = await operationRepository.GetOperationSchedules();
|
var getTime = await operationRepository.GetOperationSchedules();
|
||||||
foreach (var a in getTime)
|
foreach (var a in getTime)
|
||||||
{
|
{
|
||||||
DateTime Updatedtime;
|
//最後製作紀錄時間
|
||||||
var useday = a.LastCreateTime;
|
var useday = a.LastCreateTime;
|
||||||
if (a.LastCreateTime == "0001-01-01 00:00:00")
|
if (a.LastCreateTime == "0001-01-01 00:00:00")
|
||||||
{
|
{
|
||||||
useday = a.StartTime;
|
useday = a.StartTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region 產生紀錄
|
||||||
if (a.ScheduleType == 0)//日
|
DateTime Updatedtime;//下次生成紀錄時間
|
||||||
|
Updatedtime = a.ScheduleType switch
|
||||||
{
|
{
|
||||||
Updatedtime = Convert.ToDateTime(useday).AddDays(a.ScheduleNum);
|
0 => Convert.ToDateTime(useday).AddDays(a.ScheduleNum),
|
||||||
}
|
1 => Convert.ToDateTime(useday).AddDays(a.ScheduleNum * 7),
|
||||||
else if (a.ScheduleType == 1)//周
|
2 => Convert.ToDateTime(useday).AddMonths(a.ScheduleNum),
|
||||||
{
|
3 => Convert.ToDateTime(useday).AddMonths(a.ScheduleNum * 3),
|
||||||
Updatedtime = Convert.ToDateTime(useday).AddDays(a.ScheduleNum * 7);
|
4 => Convert.ToDateTime(useday).AddYears(a.ScheduleNum),
|
||||||
}
|
_ => Convert.ToDateTime(useday).AddYears(999)
|
||||||
else if (a.ScheduleType == 2)//月
|
};
|
||||||
{
|
|
||||||
Updatedtime = Convert.ToDateTime(useday).AddMonths(a.ScheduleNum);
|
|
||||||
}
|
|
||||||
else if (a.ScheduleType == 3)//季
|
|
||||||
{
|
|
||||||
Updatedtime = Convert.ToDateTime(useday).AddMonths(a.ScheduleNum * 3);
|
|
||||||
}
|
|
||||||
else // 年
|
|
||||||
{
|
|
||||||
Updatedtime = Convert.ToDateTime(useday).AddYears(a.ScheduleNum);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (Updatedtime < DateTime.Now)
|
if (Updatedtime < DateTime.Now)
|
||||||
{
|
{
|
||||||
@ -77,7 +63,8 @@ namespace SolarPower.Quartz.Jobs
|
|||||||
PowerStationId = a.PowerStationId,
|
PowerStationId = a.PowerStationId,
|
||||||
Type = a.Type,
|
Type = a.Type,
|
||||||
UpdatedBy = a.UpdatedBy,
|
UpdatedBy = a.UpdatedBy,
|
||||||
LastCreateTime = Updatedtime.ToString("yyyy-MM-dd")
|
LastCreateTime = Updatedtime.ToString("yyyy-MM-dd"),
|
||||||
|
IsDelivery = 0
|
||||||
};
|
};
|
||||||
List<string> properties = new List<string>()
|
List<string> properties = new List<string>()
|
||||||
{
|
{
|
||||||
@ -91,7 +78,8 @@ namespace SolarPower.Quartz.Jobs
|
|||||||
"PowerStationId",
|
"PowerStationId",
|
||||||
"Type",
|
"Type",
|
||||||
"UpdatedBy",
|
"UpdatedBy",
|
||||||
"LastCreateTime"
|
"LastCreateTime",
|
||||||
|
"IsDelivery"
|
||||||
};
|
};
|
||||||
await operationRepository.UpdateOperationPlan(OperationPlan, properties);
|
await operationRepository.UpdateOperationPlan(OperationPlan, properties);
|
||||||
|
|
||||||
@ -128,8 +116,65 @@ namespace SolarPower.Quartz.Jobs
|
|||||||
"EndTime"
|
"EndTime"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
await operationRepository.AddToRecord(record, properties2);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region 發送Email
|
||||||
|
DateTime EmailNoticeDay;
|
||||||
|
string noticeName;
|
||||||
|
EmailNoticeDay = a.EmailType switch
|
||||||
|
{
|
||||||
|
0 => Updatedtime,
|
||||||
|
1 => Updatedtime.AddDays(-1),
|
||||||
|
2 => Updatedtime.AddDays(-2),
|
||||||
|
3 => Updatedtime.AddDays(-3),
|
||||||
|
_ => Updatedtime.AddYears(999)
|
||||||
|
};
|
||||||
|
noticeName = a.EmailType switch
|
||||||
|
{
|
||||||
|
0 => "此紀錄於當天建立",
|
||||||
|
1 => "此紀錄於一天後建立",
|
||||||
|
2 => "此紀錄於兩天後建立",
|
||||||
|
3 => "此紀錄於三天後建立",
|
||||||
|
_ => "此紀錄不建立"
|
||||||
|
};
|
||||||
|
string WorkType = a.Type switch
|
||||||
|
{
|
||||||
|
0 => "清洗",
|
||||||
|
1 => "巡檢",
|
||||||
|
_ => "維修"
|
||||||
|
};
|
||||||
|
if(EmailNoticeDay < DateTime.Now && a.IsDelivery == 0)
|
||||||
|
{
|
||||||
|
//Get所有運維人員
|
||||||
|
var personal = await operationRepository.GetOperationPersonnel(a.PowerStationId);
|
||||||
|
var Title = $@"編號:{a.PlanId} - {WorkType}單 - 作業紀錄建立通知";
|
||||||
|
var content = $@" {noticeName} {Environment.NewLine} 內容描述:{a.Description}";
|
||||||
|
await operationRepository.InsertNoticeSchedule(personal, Title, content);
|
||||||
|
|
||||||
|
var OperationPlans = new OperationCreatePlan()
|
||||||
|
{
|
||||||
|
Id = a.Id,
|
||||||
|
IsDelivery = 1
|
||||||
|
};
|
||||||
|
List<string> propertiess = new List<string>()
|
||||||
|
{
|
||||||
|
"Id",
|
||||||
|
"IsDelivery"
|
||||||
|
};
|
||||||
|
await operationRepository.UpdateOperationPlan(OperationPlans, propertiess);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
|
|||||||
18
SolarPower/Repository/Implement/ExceptionRecordRepository.cs
Normal file
18
SolarPower/Repository/Implement/ExceptionRecordRepository.cs
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
using SolarPower.Helper;
|
||||||
|
using SolarPower.Models;
|
||||||
|
using SolarPower.Repository.Interface;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace SolarPower.Repository.Implement
|
||||||
|
{
|
||||||
|
public class ExceptionRecordRepository : RepositoryBase<ExceptionRecord>, IExceptionRecordRepository
|
||||||
|
{
|
||||||
|
public ExceptionRecordRepository(IDatabaseHelper databaseHelper) : base(databaseHelper)
|
||||||
|
{
|
||||||
|
tableName = "power_station";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -541,5 +541,59 @@ namespace SolarPower.Repository.Implement
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public async Task<List<MyUser>> GetOperationPersonnel(int PowerStationId)
|
||||||
|
{
|
||||||
|
List<MyUser> result;
|
||||||
|
using (IDbConnection conn = this._databaseHelper.GetConnection())
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var sql = @$"SELECT us.* FROM power_station_operation_personnel ps LEFT JOIN user us ON ps.UserId = us.Id WHERE PowerStationId = {PowerStationId}";
|
||||||
|
result = (await conn.QueryAsync<MyUser>(sql)).ToList();
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
throw exception;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task InsertNoticeSchedule(List<MyUser> personal, string Title, string content)
|
||||||
|
{
|
||||||
|
using (IDbConnection conn = this._databaseHelper.GetConnection())
|
||||||
|
{
|
||||||
|
conn.Open();
|
||||||
|
using (var trans = conn.BeginTransaction())
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
List<string> value = new List<string>() ;
|
||||||
|
foreach (MyUser a in personal)
|
||||||
|
{
|
||||||
|
value.Add($@"(1,'{a.Name}','{a.Email}','{Title}','{content}')");
|
||||||
|
}
|
||||||
|
string values = string.Join(",", value.ToArray());
|
||||||
|
|
||||||
|
var sql = $"INSERT INTO `notice_schedule` (`Type`, `RecipientName`, `RecipientEmail`, `Subject`, `Content`) VALUES {values};";
|
||||||
|
|
||||||
|
await conn.ExecuteAsync(sql,trans);
|
||||||
|
|
||||||
|
trans.Commit();
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
trans.Rollback();
|
||||||
|
throw exception;
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
conn.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -382,6 +382,58 @@ namespace SolarPower.Repository.Implement
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<List<ExceptionDataTable>> GetExceptionTable2(ExceptionSent2 post)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
List<ExceptionDataTable> result;
|
||||||
|
using (IDbConnection conn = this._databaseHelper.GetConnection())
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
DateTime start;
|
||||||
|
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,
|
||||||
|
a.alarmClass, b.alarmClass as alarmClassName,ps.Name as PowerStationName,ps.Id as PowerStationId,
|
||||||
|
errDevice, err_valueKind, errValue, FROM_UNIXTIME( (a.lastUpdate / 1000), '%Y-%m-%d %H:%i:%s') lastUpdate,
|
||||||
|
case when c.errMsg_tw is null then d.errMsg_tw else c.errMsg_tw end errMsg
|
||||||
|
from err_main a
|
||||||
|
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
|
||||||
|
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 IN @PowerStationId";
|
||||||
|
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(post.Range))
|
||||||
|
{
|
||||||
|
post.StartTime = post.Range.Split('-')[0];
|
||||||
|
post.EndTime = post.Range.Split('-')[1];
|
||||||
|
start = Convert.ToDateTime(post.StartTime);
|
||||||
|
end = Convert.ToDateTime(post.EndTime);
|
||||||
|
var startime = (Int64)(start.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;
|
||||||
|
var endtime = (Int64)(end.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;
|
||||||
|
sql += @$" AND `timestamp` BETWEEN {startime * 1000} AND {endtime * 1000}";
|
||||||
|
}
|
||||||
|
|
||||||
|
result = (await conn.QueryAsync<ExceptionDataTable>(sql,
|
||||||
|
new
|
||||||
|
{
|
||||||
|
PowerStationId = post.Id,
|
||||||
|
Status = post.Status,
|
||||||
|
})).ToList();
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
throw exception;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public async Task<List<InverterHistory>> GetListInverterDayByPowerStationId(int powerStationId, string day)
|
public async Task<List<InverterHistory>> GetListInverterDayByPowerStationId(int powerStationId, string day)
|
||||||
{
|
{
|
||||||
List<InverterHistory> result;
|
List<InverterHistory> result;
|
||||||
|
|||||||
@ -0,0 +1,12 @@
|
|||||||
|
using SolarPower.Models;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace SolarPower.Repository.Interface
|
||||||
|
{
|
||||||
|
public interface IExceptionRecordRepository : IRepositoryBase<ExceptionRecord>
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -71,6 +71,10 @@ namespace SolarPower.Repository.Interface
|
|||||||
Task DeleteOneOperationRecodeFile(int id);
|
Task DeleteOneOperationRecodeFile(int id);
|
||||||
|
|
||||||
Task<List<OperationCreatePlan>> GetOperationSchedules();
|
Task<List<OperationCreatePlan>> GetOperationSchedules();
|
||||||
|
|
||||||
|
Task<List<MyUser>> GetOperationPersonnel(int PowerStationId);
|
||||||
|
|
||||||
|
Task InsertNoticeSchedule(List<MyUser> personal, string Title, string content);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,5 +29,6 @@ namespace SolarPower.Repository.Interface
|
|||||||
Task<List<InverterHistory>> GetListInverterQuaryerlyByPowerStationId(int powerStationId, string startMonth, string endMonth);
|
Task<List<InverterHistory>> GetListInverterQuaryerlyByPowerStationId(int powerStationId, string startMonth, string endMonth);
|
||||||
Task<List<InverterHistory>> GetListInverterYearByPowerStationId(int powerStationId, string year);
|
Task<List<InverterHistory>> GetListInverterYearByPowerStationId(int powerStationId, string year);
|
||||||
Task<List<HistoryTable>> GethistoryTable(HistorySent post);
|
Task<List<HistoryTable>> GethistoryTable(HistorySent post);
|
||||||
|
Task<List<ExceptionDataTable>> GetExceptionTable2(ExceptionSent2 post);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -77,6 +77,7 @@ namespace SolarPower
|
|||||||
services.AddTransient<IOperationRepository, OperationRepository>();
|
services.AddTransient<IOperationRepository, OperationRepository>();
|
||||||
services.AddTransient<IOverviewRepository, OverviewRepository>();
|
services.AddTransient<IOverviewRepository, OverviewRepository>();
|
||||||
services.AddTransient<IAnalysisStationCombineRepository,AnalysisStationCombineRepository>();
|
services.AddTransient<IAnalysisStationCombineRepository,AnalysisStationCombineRepository>();
|
||||||
|
services.AddTransient<IExceptionRecordRepository, ExceptionRecordRepository>();
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
double loginExpireMinute = this.Configuration.GetValue<double>("LoginExpireMinute");
|
double loginExpireMinute = this.Configuration.GetValue<double>("LoginExpireMinute");
|
||||||
|
|||||||
@ -5,3 +5,85 @@
|
|||||||
}
|
}
|
||||||
@using SolarPower.Models.Role
|
@using SolarPower.Models.Role
|
||||||
@model RoleLayerEnum
|
@model RoleLayerEnum
|
||||||
|
|
||||||
|
<ol class="breadcrumb page-breadcrumb">
|
||||||
|
<li class="breadcrumb-item"><a href="javascript:void(0);">交叉分析</a></li>
|
||||||
|
<li class="breadcrumb-item active">電站交叉分析</li>
|
||||||
|
<li class="position-absolute pos-top pos-right d-none d-sm-block"><span class="js-get-date"></span></li>
|
||||||
|
</ol>
|
||||||
|
<div class="subheader">
|
||||||
|
<h1 class="subheader-title">
|
||||||
|
<i class="subheader-icon fal fa-crosshairs"></i> 電站交叉分析
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xl-12">
|
||||||
|
<div id="panel-5" class="panel">
|
||||||
|
<div class="panel-container show">
|
||||||
|
<div class="panel-content">
|
||||||
|
<div class="mb-5 d-flex justify-content-start">
|
||||||
|
<div class="pr-3">
|
||||||
|
<div class="btn-group btn-group-md">
|
||||||
|
<button type="button" class="btn btn-success waves-effect waves-themed">日期</button>
|
||||||
|
<button type="button" class="btn btn-secondary waves-effect waves-themed">日區間</button>
|
||||||
|
<button type="button" class="btn btn-secondary waves-effect waves-themed">月</button>
|
||||||
|
<button type="button" class="btn btn-secondary waves-effect waves-themed">年</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="pr-3">
|
||||||
|
<div class="btn-group btn-group-md">
|
||||||
|
<button type="button" class="btn btn-success waves-effect waves-themed">今天</button>
|
||||||
|
<button type="button" class="btn btn-secondary waves-effect waves-themed">昨天</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="pr-3">
|
||||||
|
<div class="form-group">
|
||||||
|
<input class="form-control" id="example-date" type="date" name="date" value="2023-07-23">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="pr-3">
|
||||||
|
<button type="button" class="btn btn-secondary waves-effect waves-themed">查詢</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-5">
|
||||||
|
<div class="card p-3 w-100">
|
||||||
|
<div class="row mb-5 d-flex justify-content-end">
|
||||||
|
<div class="pr-3">
|
||||||
|
<div class="btn-group" id="js-demo-nesting" role="group" aria-label="Button group with nested dropdown">
|
||||||
|
<div class="btn-group" role="group">
|
||||||
|
<button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown">選擇比較欄位 </button>
|
||||||
|
<div class="dropdown-menu">
|
||||||
|
<a class="dropdown-item" href="javascript:void(0)">2021 四月</a>
|
||||||
|
<a class="dropdown-item" href="javascript:void(0)">2021 三月</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="pr-3">
|
||||||
|
<div class="btn-group" id="js-demo-nesting" role="group" aria-label="Button group with nested dropdown">
|
||||||
|
<div class="btn-group" role="group">
|
||||||
|
<button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown">下載 </button>
|
||||||
|
<div class="dropdown-menu">
|
||||||
|
<a class="dropdown-item" href="javascript:void(0)">2021 四月</a>
|
||||||
|
<a class="dropdown-item" href="javascript:void(0)">2021 三月</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="pr-3">
|
||||||
|
<button type="button" class="btn btn-secondary waves-effect waves-themed"><i class="fal fa-expand fs-md"></i></button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<p>放圖表</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
799
SolarPower/Views/ExceptionRecord/Index.cshtml
Normal file
799
SolarPower/Views/ExceptionRecord/Index.cshtml
Normal file
@ -0,0 +1,799 @@
|
|||||||
|
@{
|
||||||
|
ViewData["MainNum"] = "5";
|
||||||
|
ViewData["SubNum"] = "1";
|
||||||
|
ViewData["Title"] = "異常記錄查詢";
|
||||||
|
}
|
||||||
|
@using SolarPower.Models.Role
|
||||||
|
@model RoleLayerEnum
|
||||||
|
|
||||||
|
<ol class="breadcrumb page-breadcrumb">
|
||||||
|
<li class="breadcrumb-item"><a href="javascript:void(0);">即時告警</a></li>
|
||||||
|
<li class="breadcrumb-item active">@ViewData["Title"]</li>
|
||||||
|
<li class="position-absolute pos-top pos-right d-none d-sm-block"><span class="js-get-date"></span></li>
|
||||||
|
</ol>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xl-12">
|
||||||
|
<div id="panel-5" class="panel">
|
||||||
|
<div class="panel-container show">
|
||||||
|
<div class="panel-content">
|
||||||
|
<div class="subheader">
|
||||||
|
<h1 class="subheader-title">
|
||||||
|
<i class="subheader-icon fal fa-alarm-snooze"></i> 即時告警管理
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
<div class="tab-content p-3">
|
||||||
|
<div class="tab-pane fade show active" id="tab-001" role="tabpanel" aria-labelledby="tab-001">
|
||||||
|
<div class="row mb-3 ">
|
||||||
|
<div class="pr-3">
|
||||||
|
<div class="btn-group btn-group-md">
|
||||||
|
<button type="button" class="btn btn-success waves-effect waves-themed" onclick="ChangeType(1)" id="button1">未解決</button>
|
||||||
|
<button type="button" class="btn btn-secondary waves-effect waves-themed" onclick="ChangeType(0)" id="button0">已解決</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="pr-3">
|
||||||
|
<button type="button" class="btn btn-secondary waves-effect waves-themed" onclick="ChangeDate30()">近30天</button>
|
||||||
|
</div>
|
||||||
|
<div class="pr-3">
|
||||||
|
<div class="form-group">
|
||||||
|
<input class="form-control" id="date-range" type="text" name="date" value="" style="width: 205px;">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row mb-3 d-flex align-items-center">
|
||||||
|
<div class="pr-3">
|
||||||
|
<button type="button" class="btn btn-secondary waves-effect waves-themed" onclick="Allcity()">全部縣市</button>
|
||||||
|
</div>
|
||||||
|
<div class="pr-3">
|
||||||
|
<div class="frame-wrap" id="city">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row mb-5 d-flex align-items-top ">
|
||||||
|
<div class="col-1 p-0">
|
||||||
|
<button type="button" class="btn btn-secondary waves-effect waves-themed" onclick="Allpowerstation()">全選</button>
|
||||||
|
</div>
|
||||||
|
<div class="col-11">
|
||||||
|
<div class="row frame-wrap" id="CheckPowerStation">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row mb-5">
|
||||||
|
<div class="w-100">
|
||||||
|
<table class="table table-bordered table-hover m-0 text-center" id="Exception_Table">
|
||||||
|
<thead class="thead-themed">
|
||||||
|
<tr>
|
||||||
|
<th>電站名稱</th>
|
||||||
|
<th>異常ID號</th>
|
||||||
|
<th>發生時間</th>
|
||||||
|
<th>復歸時間</th>
|
||||||
|
<th>異常類別</th>
|
||||||
|
<th>設備編號</th>
|
||||||
|
<th>異常訊息</th>
|
||||||
|
<th>派工/維運單</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal fade" id="exception-form-modal" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" data-keyboard="false">
|
||||||
|
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h4 class="modal-title">
|
||||||
|
<span class="main-title"></span><span class="sub-title"></span>
|
||||||
|
</h4>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
|
<span aria-hidden="true"><i class="fal fa-times"></i></span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<form id="recode-form-exc">
|
||||||
|
<div class="row mb-3">
|
||||||
|
<div class="col-lg-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="form-label" for="power_station_select_modal_exc">電站</label>
|
||||||
|
<input class="form-control" id="power_station_select_modal_exc" type="text" name="power_station_select_modal_exc" />
|
||||||
|
@*<select class="form-control" id="power_station_select_modal_exc">
|
||||||
|
</select>*@
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="form-label" for="work_time_modal_exc">作業日期</label>
|
||||||
|
<input class="form-control" id="work_time_modal_exc" type="date" name="work_time_modal_exc" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row mb-3">
|
||||||
|
<div class="col-lg-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="form-label" for="example-select">狀態</label>
|
||||||
|
<div>
|
||||||
|
<div class="custom-control custom-radio custom-control-inline">
|
||||||
|
<input type="radio" class="custom-control-input ml-auto" id="status_none_complete_exc" name="status_modal" value="0" />
|
||||||
|
<label class="custom-control-label" for="status_none_complete_exc">未完成</label>
|
||||||
|
</div>
|
||||||
|
<div class="custom-control custom-radio custom-control-inline">
|
||||||
|
<input type="radio" class="custom-control-input ml-auto" id="status_complete_exc" name="status_modal" value="1" />
|
||||||
|
<label class="custom-control-label" for="status_complete_exc">完成</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="form-label" for="work_person_select_modal_exc">執行人員</label>
|
||||||
|
<select class="form-control" id="work_person_select_modal_exc">
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row mb-3 fix-div">
|
||||||
|
<div class="col-lg-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="form-label" for="error_code_modal_exc">異常編號</label>
|
||||||
|
<input class="form-control" id="error_code_modal_exc" type="text" name="error_code_modal_exc" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="form-label" for="fix_do_modal_exc">維修項目</label>
|
||||||
|
<input class="form-control" id="fix_do_modal_exc" type="text" name="fix_do_modal_exc" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row mb-3">
|
||||||
|
<div class="col-lg-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="form-label" for="notice_textarea_modal_exc">巡檢注意事項</label>
|
||||||
|
<textarea class="form-control" id="notice_textarea_modal_exc" rows="5"></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row mb-3">
|
||||||
|
<div class="col-lg-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="form-label" for="description_textarea_modal_exc">結果描述</label>
|
||||||
|
<textarea class="form-control" id="description_textarea_modal_exc" rows="5"></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<div class="row align-items-center">
|
||||||
|
<div class="col-2">
|
||||||
|
<p>檔案上傳</p>
|
||||||
|
</div>
|
||||||
|
<div id="recode_files_div_exc" class="col-10">
|
||||||
|
<div class="row px-3 mb-3 d-flex justify-content-start align-items-center img-zoom-div">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row px-3">
|
||||||
|
<form id="recode-file-form_exc" class="dropzone needsclick dz-clickable col-12" style="min-height: 7rem;">
|
||||||
|
<div class="fallback">
|
||||||
|
<input type="file" multiple />
|
||||||
|
</div>
|
||||||
|
<div class="dz-message needsclick">
|
||||||
|
<i class="fal fa-cloud-upload text-muted mb-3"></i> <br>
|
||||||
|
<span class="text-uppercase">將圖片拖曳至這裡或點擊選擇圖片.</span>
|
||||||
|
<br>
|
||||||
|
<span class="fs-sm text-muted">僅供預覽,並未實際上傳。</span>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
|
||||||
|
<button type="button" class="btn btn-primary" id="save-recode-btn" onclick="SaveException()">確定</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@section Scripts{
|
||||||
|
<script>
|
||||||
|
var ids = new Array(0);//當前選擇縣市
|
||||||
|
var powerids = new Array(0);//當前選擇電站
|
||||||
|
var Allids = new Array(0);//全部縣市
|
||||||
|
var Allpowerids = new Array(0);//全部電站
|
||||||
|
var Type = 1; // 項目
|
||||||
|
var datepicker;
|
||||||
|
var ExceptionTable;
|
||||||
|
var err_status = 1;//異常紀錄,1:未解決 0:已解決
|
||||||
|
var errortoID;
|
||||||
|
var selected_id;
|
||||||
|
var powerStationData_name;
|
||||||
|
var recode;
|
||||||
|
var psids;
|
||||||
|
var countOperationRecodeFile = 0;
|
||||||
|
|
||||||
|
//#region Array.Remove
|
||||||
|
Array.prototype.remove = function (val) {
|
||||||
|
var index = this.indexOf(val);
|
||||||
|
if (index > -1) {
|
||||||
|
this.splice(index, 1);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
|
||||||
|
//#region Date-Picker
|
||||||
|
datepicker = $('#date-range').daterangepicker({
|
||||||
|
autoUpdateInput: false,
|
||||||
|
locale: { format: 'YYYY/MM/DD' },
|
||||||
|
opens: 'left'
|
||||||
|
}, function (start, end, label) {
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#date-range').on('apply.daterangepicker', function (ev, picker) {
|
||||||
|
$(this).val(picker.startDate.format('YYYY/MM/DD') + ' - ' + picker.endDate.format('YYYY/MM/DD'));
|
||||||
|
$(this).trigger('change');
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#date-range').on('cancel.daterangepicker', function (ev, picker) {
|
||||||
|
$(this).val('');
|
||||||
|
$(this).trigger('change');
|
||||||
|
});
|
||||||
|
//#endregion
|
||||||
|
|
||||||
|
//#region 預設近30天
|
||||||
|
var today = new Date();
|
||||||
|
var dateLimit = new Date(new Date().setDate(today.getDate() - 30));
|
||||||
|
var today_format = today.toISOString().slice(0, 10).replace(/-/g, "/");
|
||||||
|
var dateLimit_format = dateLimit.toISOString().slice(0, 10).replace(/-/g, "/");
|
||||||
|
datepicker.data('daterangepicker').setStartDate(dateLimit_format);
|
||||||
|
datepicker.data('daterangepicker').setEndDate(today_format);
|
||||||
|
$('#date-range').val(dateLimit_format + ' - ' + today_format);
|
||||||
|
|
||||||
|
//#endregion
|
||||||
|
|
||||||
|
//#region 預設載入該使用者可以選擇的電站
|
||||||
|
var Nurl = "/PowerStation/GetSolarCitySummary";
|
||||||
|
$.post(Nurl, function (rel) {
|
||||||
|
if (rel.code != "0000") {
|
||||||
|
toast_error(rel.msg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (var i = 0; i < rel.data.length; i++) {
|
||||||
|
$('#city').append("<button type='button' class='btn btn-success waves-effect waves-themed ml-2' id='" + 'cityID_' + rel.data[i].cityId + "'>" +
|
||||||
|
rel.data[i].city +
|
||||||
|
"<span class= 'badge bg-success-700 ml-2' >" + rel.data[i].amount + "</span >" +
|
||||||
|
"</button >");
|
||||||
|
ids.push(String(rel.data[i].cityId));
|
||||||
|
Allids.push(String(rel.data[i].cityId));
|
||||||
|
}
|
||||||
|
var send_data = {
|
||||||
|
cityid: ids
|
||||||
|
}
|
||||||
|
ids.sort();
|
||||||
|
var Nurl = "/PowerStation/GetSolarByCity";
|
||||||
|
$.post(Nurl, send_data, function (rel) {
|
||||||
|
if (rel.code != "0000") {
|
||||||
|
toast_error(rel.msg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$('#CheckPowerStation').empty();
|
||||||
|
$.each(rel.data, function (index, val) {
|
||||||
|
$('#CheckPowerStation').append("<div class='col-2 mb-2 custom-control custom-checkbox custom-control-inline' id='station_" + val.id + "' ></div>");
|
||||||
|
$('#station_' + val.id).append("<input type='checkbox' class='custom-control-input' id='check_" + val.id + "' checked>");
|
||||||
|
$('#station_' + val.id).append("<label class='custom-control-label' for='check_" + val.id + "'>" + val.name + "</label>");
|
||||||
|
powerids.push(String(val.id));
|
||||||
|
Allpowerids.push(String(val.id));
|
||||||
|
});
|
||||||
|
datatable();
|
||||||
|
//operationRecodeTable.ajax.reload();
|
||||||
|
})
|
||||||
|
})
|
||||||
|
//#endregion
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
//#region 改變項目
|
||||||
|
function ChangeType(type) {
|
||||||
|
Type = type;
|
||||||
|
for (var i = 0; i < 2; i++) {
|
||||||
|
var name = "button" + i;
|
||||||
|
document.getElementById(name).setAttribute("class", "btn btn-secondary waves-effect waves-themed");
|
||||||
|
}
|
||||||
|
document.getElementById("button" + type).setAttribute("class", "btn btn-success waves-effect waves-themed");
|
||||||
|
ExceptionTable.ajax.reload();
|
||||||
|
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
|
||||||
|
//#region 改變日期
|
||||||
|
$('#date-range').on('change', function () {
|
||||||
|
ExceptionTable.ajax.reload();
|
||||||
|
});
|
||||||
|
//#endregion
|
||||||
|
|
||||||
|
//#region 縣市全選
|
||||||
|
function Allcity() {
|
||||||
|
var Newpowerids = new Array(0);
|
||||||
|
ids = [];
|
||||||
|
$.each(Allids, function (index, val) {
|
||||||
|
var cityid = 'cityID_' + val;
|
||||||
|
document.getElementById(cityid).setAttribute("class", 'btn btn-success waves-effect waves-themed ml-2');
|
||||||
|
ids.push(val);
|
||||||
|
});
|
||||||
|
var send_data = {
|
||||||
|
cityid: ids
|
||||||
|
}
|
||||||
|
var Nurl = "/PowerStation/GetSolarByCity";
|
||||||
|
$.post(Nurl, send_data, function (rel) {
|
||||||
|
if (rel.code != "0000") {
|
||||||
|
toast_error(rel.msg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$('#CheckPowerStation').empty();
|
||||||
|
Allpowerids = [];
|
||||||
|
$.each(rel.data, function (index, val) {
|
||||||
|
if (powerids.includes(String(val.id))) {
|
||||||
|
$('#CheckPowerStation').append("<div class='col-2 mb-2 custom-control custom-checkbox custom-control-inline' id='station_" + val.id + "' > ");
|
||||||
|
$('#station_' + val.id).append("<input type='checkbox' class='custom-control-input' id='check_" + val.id + "' checked>");
|
||||||
|
$('#station_' + val.id).append("<label class='custom-control-label' for='check_" + val.id + "'>" + val.name + "</label>");
|
||||||
|
Newpowerids.push(String(val.id));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$('#CheckPowerStation').append("<div class='col-2 mb-2 custom-control custom-checkbox custom-control-inline' id='station_" + val.id + "' > ");
|
||||||
|
$('#station_' + val.id).append("<input type='checkbox' class='custom-control-input' id='check_" + val.id + "'>");
|
||||||
|
$('#station_' + val.id).append("<label class='custom-control-label' for='check_" + val.id + "'>" + val.name + "</label>");
|
||||||
|
}
|
||||||
|
Allpowerids.push(String(val.id));
|
||||||
|
});
|
||||||
|
powerids = [];
|
||||||
|
powerids = Newpowerids;
|
||||||
|
})
|
||||||
|
ExceptionTable.ajax.reload();
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
|
||||||
|
//#region 查詢近30天
|
||||||
|
function ChangeDate30() {
|
||||||
|
var today = new Date();
|
||||||
|
var dateLimit = new Date(new Date().setDate(today.getDate() - 30));
|
||||||
|
|
||||||
|
var today_format = today.toISOString().slice(0, 10).replace(/-/g, "/");
|
||||||
|
var dateLimit_format = dateLimit.toISOString().slice(0, 10).replace(/-/g, "/");
|
||||||
|
|
||||||
|
datepicker.data('daterangepicker').setStartDate(dateLimit_format);
|
||||||
|
datepicker.data('daterangepicker').setEndDate(today_format);
|
||||||
|
|
||||||
|
$('#date-range').val(dateLimit_format + ' - ' + today_format);
|
||||||
|
$('#date-range').trigger('change');
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
|
||||||
|
//#region 電站全選
|
||||||
|
function Allpowerstation() {
|
||||||
|
powerids = [];
|
||||||
|
$.each(Allpowerids, function (index, val) {
|
||||||
|
$('#check_' + val).prop("checked", true);
|
||||||
|
powerids.push(val);
|
||||||
|
})
|
||||||
|
ExceptionTable.ajax.reload();
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
|
||||||
|
//#region 選擇縣市
|
||||||
|
$('#city').on("click", "button", function () {
|
||||||
|
var clickid = $(this).attr('id');
|
||||||
|
var classid = clickid.split("_");
|
||||||
|
var Newpowerids = new Array(0);
|
||||||
|
var value = document.getElementById(clickid).className;
|
||||||
|
ids.sort(function (a, b) {
|
||||||
|
return a - b;
|
||||||
|
});
|
||||||
|
var send_data = {
|
||||||
|
cityid: ids
|
||||||
|
}
|
||||||
|
if (value == 'btn btn-outline-success waves-effect waves-themed ml-2') { //選擇
|
||||||
|
document.getElementById(clickid).setAttribute("class", 'btn btn-success waves-effect waves-themed ml-2');
|
||||||
|
ids.push(classid[1]);
|
||||||
|
}
|
||||||
|
else { //取消
|
||||||
|
document.getElementById(clickid).setAttribute("class", 'btn btn-outline-success waves-effect waves-themed ml-2');
|
||||||
|
ids.remove(classid[1]);
|
||||||
|
}
|
||||||
|
ids.sort();
|
||||||
|
var Nurl = "/PowerStation/GetSolarByCity";
|
||||||
|
$.post(Nurl, send_data, function (rel) {
|
||||||
|
if (rel.code != "0000") {
|
||||||
|
toast_error(rel.msg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$('#CheckPowerStation').empty();
|
||||||
|
Allpowerids = [];
|
||||||
|
$.each(rel.data, function (index, val) {
|
||||||
|
if (powerids.includes(String(val.id))) {
|
||||||
|
$('#CheckPowerStation').append("<div class='col-2 mb-2 custom-control custom-checkbox custom-control-inline' id='station_" + val.id + "' > ");
|
||||||
|
$('#station_' + val.id).append("<input type='checkbox' class='custom-control-input' id='check_" + val.id + "' checked>");
|
||||||
|
$('#station_' + val.id).append("<label class='custom-control-label' for='check_" + val.id + "'>" + val.name + "</label>");
|
||||||
|
Newpowerids.push(String(val.id));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$('#CheckPowerStation').append("<div class='col-2 mb-2 custom-control custom-checkbox custom-control-inline' id='station_" + val.id + "' > ");
|
||||||
|
$('#station_' + val.id).append("<input type='checkbox' class='custom-control-input' id='check_" + val.id + "'>");
|
||||||
|
$('#station_' + val.id).append("<label class='custom-control-label' for='check_" + val.id + "'>" + val.name + "</label>");
|
||||||
|
}
|
||||||
|
Allpowerids.push(String(val.id));
|
||||||
|
});
|
||||||
|
powerids = [];
|
||||||
|
powerids = Newpowerids;
|
||||||
|
})
|
||||||
|
ExceptionTable.ajax.reload();
|
||||||
|
})
|
||||||
|
//#endregion
|
||||||
|
|
||||||
|
//#region 選擇電站checkbox
|
||||||
|
$('#CheckPowerStation').on("click", "input", function () {
|
||||||
|
var clickid = $(this).attr('id');
|
||||||
|
var classid = clickid.split("_");
|
||||||
|
var job = document.getElementById(clickid);
|
||||||
|
if (job.checked == true) {
|
||||||
|
powerids.push(classid[1]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
powerids.remove(classid[1]);
|
||||||
|
}
|
||||||
|
ExceptionTable.ajax.reload();
|
||||||
|
})
|
||||||
|
|
||||||
|
//#endregion
|
||||||
|
|
||||||
|
//#region DataTable
|
||||||
|
function datatable() {
|
||||||
|
ExceptionTable = $("#Exception_Table").DataTable({
|
||||||
|
"pageLength": 20,
|
||||||
|
"paging": true,
|
||||||
|
"lengthChange": false,
|
||||||
|
"searching": false,
|
||||||
|
"ordering": true,
|
||||||
|
"info": true,
|
||||||
|
"autoWidth": false,
|
||||||
|
"responsive": true,
|
||||||
|
"order": [[7, "desc"]],
|
||||||
|
"columns": [{
|
||||||
|
"data": "powerStationName"
|
||||||
|
}, {
|
||||||
|
"data": "id"
|
||||||
|
}, {
|
||||||
|
"data": "dev_time"
|
||||||
|
}, {
|
||||||
|
"data": "normalTime"
|
||||||
|
}, {
|
||||||
|
"data": "alarmClassName"
|
||||||
|
}, {
|
||||||
|
"data": "errDevice"
|
||||||
|
}, {
|
||||||
|
"data": "errMsg"
|
||||||
|
}, {
|
||||||
|
"data": "function"
|
||||||
|
}],
|
||||||
|
"language": {
|
||||||
|
"emptyTable": "查無資料",
|
||||||
|
"processing": "處理中...",
|
||||||
|
"loadingRecords": "載入中...",
|
||||||
|
"lengthMenu": "顯示 _MENU_ 項結果",
|
||||||
|
"zeroRecords": "沒有符合的結果",
|
||||||
|
"info": "顯示第 _START_ 至 _END_ 項結果,共 _TOTAL_ 項",
|
||||||
|
"infoEmpty": "顯示第 0 至 0 項結果,共 0 項",
|
||||||
|
"infoFiltered": "(從 _MAX_ 項結果中過濾)",
|
||||||
|
"infoPostFix": "",
|
||||||
|
"search": "搜尋:",
|
||||||
|
"paginate": {
|
||||||
|
"first": "第一頁",
|
||||||
|
"previous": "上一頁",
|
||||||
|
"next": "下一頁",
|
||||||
|
"last": "最後一頁"
|
||||||
|
},
|
||||||
|
"aria": {
|
||||||
|
"sortAscending": ": 升冪排列",
|
||||||
|
"sortDescending": ": 降冪排列"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'createdRow': function (row, data, dataIndex) {
|
||||||
|
$(row).attr('data-id', data.id);
|
||||||
|
$(row).attr('data-error', data.errorID);
|
||||||
|
$(row).attr('data-name', data.powerStationName);
|
||||||
|
$(row).attr('data-psid', data.powerStationId);
|
||||||
|
},
|
||||||
|
"ajax": {
|
||||||
|
"url": "/StationOverview/GetExceptionTable2",
|
||||||
|
"type": "POST",
|
||||||
|
"data": function (d) {
|
||||||
|
d.id = powerids,
|
||||||
|
d.status = Type,
|
||||||
|
d.range = $('#date-range').val()
|
||||||
|
},
|
||||||
|
"dataSrc": function (rel) {
|
||||||
|
if (rel.data.code == "9999") {
|
||||||
|
toast_error(rel.data.msg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
data = rel.data.data;
|
||||||
|
if (data == null || data.length == 0) {
|
||||||
|
this.data = [];
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
|
||||||
|
//#region 派工新增表單(異常)
|
||||||
|
$('#Exception_Table').on("click", "a.add-btn", function () {
|
||||||
|
powerStationData_name = $(this).parents('tr').attr('data-name');
|
||||||
|
$("#exception-form-modal .modal-title .main-title").html("維修單 - ");
|
||||||
|
$("#exception-form-modal .modal-title .sub-title").html(powerStationData_name);
|
||||||
|
$("#recode-form-exc").trigger("reset");
|
||||||
|
$("#power_station_select_modal_exc").val(powerStationData_name);
|
||||||
|
$("#power_station_select_modal_exc").attr("disabled", true);
|
||||||
|
selected_id = $(this).parents('tr').attr('data-id');
|
||||||
|
errortoID = $(this).parents('tr').attr('data-error');
|
||||||
|
$("input[name=status_modal][value='" + 0 + "']").prop('checked', true); //狀態
|
||||||
|
$("#error_code_modal_exc").val(selected_id);
|
||||||
|
$("#error_code_modal_exc").attr("disabled", true);
|
||||||
|
psids = selected_id = $(this).parents('tr').attr('data-psid');
|
||||||
|
//#region 維修單運維人員(異常紀錄)
|
||||||
|
var url_power_station_operation_personnel = "/PowerStation/GetOperationPersonnelSelectOptionList";
|
||||||
|
send_data = {
|
||||||
|
PowerStationId: parseInt(psids)
|
||||||
|
}
|
||||||
|
$.post(url_power_station_operation_personnel, send_data, function (rel) {
|
||||||
|
if (rel.code != "0000") {
|
||||||
|
toast_error(rel.msg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$("#work_person_select_modal_exc").empty();
|
||||||
|
|
||||||
|
if (rel.data.length > 0) {
|
||||||
|
|
||||||
|
$.each(rel.data, function (index, val) {
|
||||||
|
$("#work_person_select_modal_exc").append($("<option />").val(val.value).text(val.text));
|
||||||
|
});
|
||||||
|
|
||||||
|
if (recode != null || recode != undefined) {
|
||||||
|
$("#work_person_select_modal_exc").val(recode.workPersonId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$("#exception-form-modal").modal();
|
||||||
|
});
|
||||||
|
//#endregion
|
||||||
|
|
||||||
|
});
|
||||||
|
//#endregion
|
||||||
|
|
||||||
|
//#region 編輯異常表單內容(異常)
|
||||||
|
$('#Exception_Table').on("click", "a.edit-btn", function () {
|
||||||
|
psids = selected_id = $(this).parents('tr').attr('data-psid');
|
||||||
|
|
||||||
|
$("#exception-form-modal .modal-title .main-title").html("維修單 - ");
|
||||||
|
selected_id = $(this).parents('tr').attr('data-id');
|
||||||
|
powerStationData_name = $(this).parents('tr').attr('data-name');
|
||||||
|
errortoID = $(this).parents('tr').attr('data-error');
|
||||||
|
//取得單一記錄表單
|
||||||
|
var url = "/Operation/GetOneOperationRecode/";
|
||||||
|
|
||||||
|
var send_data = {
|
||||||
|
id: errortoID
|
||||||
|
}
|
||||||
|
|
||||||
|
$.post(url, send_data, function (rel) {
|
||||||
|
if (rel.code != "0000") {
|
||||||
|
toast_error(rel.msg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
recode = rel.data;
|
||||||
|
|
||||||
|
countOperationRecodeFile = recode.recodeFiles.length;
|
||||||
|
|
||||||
|
$("#exception-form-modal .modal-title .sub-title").html(powerStationData_name);
|
||||||
|
$("#power_station_select_modal_exc").val(powerStationData_name);
|
||||||
|
$("#power_station_select_modal_exc").attr("disabled", true);
|
||||||
|
|
||||||
|
$("#work_time_modal").val(recode.workTime);
|
||||||
|
var status = -1;
|
||||||
|
if (recode.status == 0 || recode.status == 2) {
|
||||||
|
status = 0;
|
||||||
|
} else if (recode.status == 1 || recode.status == 3) {
|
||||||
|
status = 1;
|
||||||
|
}
|
||||||
|
$("input[name=status_modal][value='" + status + "']").prop('checked', true); //狀態
|
||||||
|
$('#work_person_select_modal_exc').val(recode.workPersonId);
|
||||||
|
$(".fix-div").show();
|
||||||
|
$("#error_code_modal_exc").val(recode.errorCode);
|
||||||
|
$("#error_code_modal_exc").attr("disabled", true);
|
||||||
|
$("#fix_do_modal_exc").val(recode.fixDo);
|
||||||
|
$("#notice_textarea_modal_exc").val(recode.notice);
|
||||||
|
$("#description_textarea_modal_exc").val(recode.description);
|
||||||
|
|
||||||
|
var str = "";
|
||||||
|
|
||||||
|
RecodeFileBox = $("#recode_files_div_exc > .row");
|
||||||
|
RecodeFileBox.empty();
|
||||||
|
recode.recodeFiles.forEach(function (value, index) {
|
||||||
|
CreateRecodeFileBox(RecodeFileBox, value, true);
|
||||||
|
});
|
||||||
|
//#region 維修單運維人員(異常紀錄)
|
||||||
|
var url_power_station_operation_personnel = "/PowerStation/GetOperationPersonnelSelectOptionList";
|
||||||
|
send_data = {
|
||||||
|
PowerStationId: parseInt(psids)
|
||||||
|
}
|
||||||
|
$.post(url_power_station_operation_personnel, send_data, function (rel) {
|
||||||
|
if (rel.code != "0000") {
|
||||||
|
toast_error(rel.msg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$("#work_person_select_modal_exc").empty();
|
||||||
|
|
||||||
|
if (rel.data.length > 0) {
|
||||||
|
|
||||||
|
$.each(rel.data, function (index, val) {
|
||||||
|
$("#work_person_select_modal_exc").append($("<option />").val(val.value).text(val.text));
|
||||||
|
});
|
||||||
|
|
||||||
|
if (recode != null || recode != undefined) {
|
||||||
|
$("#work_person_select_modal_exc").val(recode.workPersonId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$("#exception-form-modal").modal();
|
||||||
|
});
|
||||||
|
//#endregion
|
||||||
|
|
||||||
|
}, 'json');
|
||||||
|
});
|
||||||
|
//#endregion
|
||||||
|
|
||||||
|
//#region 儲存表單資料(異常)
|
||||||
|
function SaveException() {
|
||||||
|
|
||||||
|
if ($("#recode-form-exc").valid()) {
|
||||||
|
var url = "/Operation/SaveOperationRecode";
|
||||||
|
|
||||||
|
var formData = new FormData();
|
||||||
|
|
||||||
|
formData.append("Id", errortoID);
|
||||||
|
formData.append("PowerStationId", parseInt(psids));
|
||||||
|
formData.append("WorkType", 2);
|
||||||
|
formData.append("ErrorCode", $("#error_code_modal_exc").val());
|
||||||
|
formData.append("FixDo", $("#fix_do_modal_exc").val());
|
||||||
|
formData.append("Status", $("input[name=status_modal]:checked").val());
|
||||||
|
formData.append("WorkPersonId", $("#work_person_select_modal_exc").val());
|
||||||
|
formData.append("WorkTime", $("#work_time_modal_exc").val());
|
||||||
|
formData.append("Notice", $("#notice_textarea_modal_exc").val());
|
||||||
|
formData.append("Description", $("#description_textarea_modal_exc").val());
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: url,
|
||||||
|
data: formData,
|
||||||
|
cache: false,
|
||||||
|
contentType: false,
|
||||||
|
processData: false,
|
||||||
|
success: function (rel) {
|
||||||
|
if (rel.code != "0000") {
|
||||||
|
toast_error(rel.msg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var myDropzone = Dropzone.forElement("#recode-file-form_exc");
|
||||||
|
|
||||||
|
if (myDropzone.files.length > 0) {
|
||||||
|
selected_id = rel.data;
|
||||||
|
myDropzone.processQueue();
|
||||||
|
|
||||||
|
myDropzone.on("successmultiple", function (file, rel) {
|
||||||
|
if (rel.code != "0000") {
|
||||||
|
toast_error(rel.msg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
toast_ok(rel.msg);
|
||||||
|
$('#exception-form-modal').modal('hide');
|
||||||
|
recodeFileDropzone.removeAllFiles();
|
||||||
|
|
||||||
|
ExceptionTable.ajax.reload();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
$('#exception-form-modal').modal('hide');
|
||||||
|
myDropzone.removeAllFiles();
|
||||||
|
|
||||||
|
ExceptionTable.ajax.reload();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
|
||||||
|
//#region 表單檔案資料(異常)
|
||||||
|
Dropzone.autoDiscover = false;
|
||||||
|
recodeFileDropzone = new Dropzone("#recode-file-form_exc", {
|
||||||
|
url: "/Operation/SaveOperationRecodeFile",
|
||||||
|
acceptedFiles: "image/*, application/pdf,.doc,.docx,.xls,.xlsx",
|
||||||
|
autoProcessQueue: false,
|
||||||
|
parallelUploads: 5,
|
||||||
|
maxFiles: 5,
|
||||||
|
addRemoveLinks: true,
|
||||||
|
uploadMultiple: true,
|
||||||
|
dictRemoveFile: "移除",
|
||||||
|
init: function (e) {
|
||||||
|
|
||||||
|
var myDropzone = this;
|
||||||
|
|
||||||
|
myDropzone.on("sending", function (file, xhr, data) {
|
||||||
|
if ((countOperationRecodeFile + myDropzone.files.length) > 5) {
|
||||||
|
toast_warning("檔案總數量不可超過 5 張");
|
||||||
|
myDropzone.removeFile(file);
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
|
||||||
|
data.append("Id", selected_id);
|
||||||
|
data.append("RecodeFiles", file);
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//#endregion
|
||||||
|
|
||||||
|
//#region 產生檔案html
|
||||||
|
function CreateRecodeFileBox(dom, value, show_del_btn) {
|
||||||
|
var str = "";
|
||||||
|
str += '<div class="col-auto px-0 py-2 mx-2">';
|
||||||
|
var split = value.fileName.split(".");
|
||||||
|
var excel_format = ["xls", "xlsx"];
|
||||||
|
var word_format = ["doc", "docx"];
|
||||||
|
if (split[split.length - 1].toLowerCase() == "pdf") {
|
||||||
|
str += '<a href="' + value.fileName + '" class="btn btn-info waves-effect waves-themed mb-3 mr-2" download><i class="fal fa-file-pdf" style="font-size: 1.5em; line-height: 2;"></i></a>';
|
||||||
|
} else if (excel_format.indexOf(split[split.length - 1].toLowerCase()) > -1) {
|
||||||
|
str += '<a href="' + value.fileName + '" class="btn btn-info waves-effect waves-themed mb-3 mr-2" download><i class="fal fa-file-excel" style="font-size: 1.5em; line-height: 2;"></i></a>';
|
||||||
|
} else if (word_format.indexOf(split[split.length - 1].toLowerCase()) > -1) {
|
||||||
|
str += '<a href="' + value.fileName + '" class="btn btn-info waves-effect waves-themed mb-3 mr-2" download><i class="fal fa-file-word" style="font-size: 1.5em; line-height: 2;"></i></a>';
|
||||||
|
} else {
|
||||||
|
str += '<img src="' + value.fileName + '" class="img-zoom" width="100%" />';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (show_del_btn) {
|
||||||
|
str += '<a href="javascript:;" class="del-operation-recode-file-btn" data-id="' + value.id + '">';
|
||||||
|
str += '<span class="badge border border-light rounded-pill bg-danger-500 position-absolute pos-top pos-right"><i class="fal fa-times"></i></span>';
|
||||||
|
str += '</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
str += '</div>';
|
||||||
|
dom.append(str);
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
}
|
||||||
1
SolarPower/Views/ExceptionRecord/_ExceptionRecord.cshtml
Normal file
1
SolarPower/Views/ExceptionRecord/_ExceptionRecord.cshtml
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
||||||
139
SolarPower/Views/ExceptionRecord/_NoticeSetting.cshtml
Normal file
139
SolarPower/Views/ExceptionRecord/_NoticeSetting.cshtml
Normal file
@ -0,0 +1,139 @@
|
|||||||
|
<div class="row mb-3 d-flex align-items-center">
|
||||||
|
<div class="pr-3">
|
||||||
|
<button type="button" class="btn btn-secondary waves-effect waves-themed">全部縣市</button>
|
||||||
|
</div>
|
||||||
|
<div class="pr-3">
|
||||||
|
<div class="frame-wrap">
|
||||||
|
<button type="button" class="btn btn-outline-success waves-effect waves-themed">
|
||||||
|
新北市
|
||||||
|
<span class="badge bg-success-700 ml-2">4</span>
|
||||||
|
</button>
|
||||||
|
<button type="button" class="btn btn-outline-success waves-effect waves-themed">
|
||||||
|
台北市
|
||||||
|
<span class="badge bg-success-700 ml-2">4</span>
|
||||||
|
</button>
|
||||||
|
<button type="button" class="btn btn-success waves-effect waves-themed">
|
||||||
|
新竹市
|
||||||
|
<span class="badge bg-success-700 ml-2">4</span>
|
||||||
|
</button>
|
||||||
|
<button type="button" class="btn btn-outline-success waves-effect waves-themed">
|
||||||
|
苗栗縣
|
||||||
|
<span class="badge bg-success-700 ml-2">4</span>
|
||||||
|
</button>
|
||||||
|
<button type="button" class="btn btn-outline-success waves-effect waves-themed">
|
||||||
|
台中市
|
||||||
|
<span class="badge bg-success-700 ml-2">4</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row mb-5 d-flex align-items-center">
|
||||||
|
<div class="pr-3">
|
||||||
|
<button type="button" class="btn btn-secondary waves-effect waves-themed">全選</button>
|
||||||
|
</div>
|
||||||
|
<div class="pr-3">
|
||||||
|
<div class="frame-wrap">
|
||||||
|
<div class="custom-control custom-checkbox custom-control-inline">
|
||||||
|
<input type="checkbox" class="custom-control-input" id="defaultInline6">
|
||||||
|
<label class="custom-control-label" for="defaultInline6">新竹交大站</label>
|
||||||
|
</div>
|
||||||
|
<div class="custom-control custom-checkbox custom-control-inline">
|
||||||
|
<input type="checkbox" class="custom-control-input" id="defaultInline7" checked="">
|
||||||
|
<label class="custom-control-label" for="defaultInline7">新竹巨城站</label>
|
||||||
|
</div>
|
||||||
|
<div class="custom-control custom-checkbox custom-control-inline">
|
||||||
|
<input type="checkbox" class="custom-control-input" id="defaultInline8" checked="">
|
||||||
|
<label class="custom-control-label" for="defaultInline8">新竹動物園站</label>
|
||||||
|
</div>
|
||||||
|
<div class="custom-control custom-checkbox custom-control-inline">
|
||||||
|
<input type="checkbox" class="custom-control-input" id="defaultInline9" checked="">
|
||||||
|
<label class="custom-control-label" for="defaultInline9">新竹城隍廟站</label>
|
||||||
|
</div>
|
||||||
|
<div class="custom-control custom-checkbox custom-control-inline">
|
||||||
|
<input type="checkbox" class="custom-control-input" id="defaultInline10" checked="">
|
||||||
|
<label class="custom-control-label" for="defaultInline10">新竹清大站</label>
|
||||||
|
</div>
|
||||||
|
<div class="custom-control custom-checkbox custom-control-inline">
|
||||||
|
<input type="checkbox" class="custom-control-input" id="defaultInline11" checked="">
|
||||||
|
<label class="custom-control-label" for="defaultInline11">新竹高鐵站</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<!-- datatable start -->
|
||||||
|
<div class="w-100">
|
||||||
|
<table class="table table-bordered table-hover m-0 text-center">
|
||||||
|
<thead class="thead-themed">
|
||||||
|
<tr>
|
||||||
|
<th>電站名稱</th>
|
||||||
|
<th>通知對象</th>
|
||||||
|
<th>逆變器異常</th>
|
||||||
|
<th>網路異常</th>
|
||||||
|
<th>設備斷線</th>
|
||||||
|
<th>PR值異常</th>
|
||||||
|
<th>異常等級</th>
|
||||||
|
<th>派工/維運單</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">新竹巨城站</th>
|
||||||
|
<th scope="row">鋼鐵人</th>
|
||||||
|
<td>
|
||||||
|
<a href="javascript:void(0);" class="btn btn-warning btn-sm btn-icon rounded-circle waves-effect waves-themed">
|
||||||
|
<i class="fal fa-exclamation"></i>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td><span class="color-danger-700">高</span></td>
|
||||||
|
<td>
|
||||||
|
<a href="javascript:;" type="button" class="btn btn-primary btn-pills waves-effect waves-themed" data-toggle="modal" data-target="#addpeople">修改</a>
|
||||||
|
<button type="button" class="btn btn-danger btn-pills waves-effect waves-themed">刪除</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">新竹巨城站</th>
|
||||||
|
<th scope="row">蜘蛛人</th>
|
||||||
|
<td></td>
|
||||||
|
<td>
|
||||||
|
<a href="javascript:void(0);" class="btn btn-warning btn-sm btn-icon rounded-circle waves-effect waves-themed">
|
||||||
|
<i class="fal fa-exclamation"></i>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td>中</td>
|
||||||
|
<td>
|
||||||
|
<a href="javascript:;" type="button" class="btn btn-primary btn-pills waves-effect waves-themed" data-toggle="modal" data-target="#addpeople">修改</a>
|
||||||
|
<button type="button" class="btn btn-danger btn-pills waves-effect waves-themed">刪除</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">新竹交大站</th>
|
||||||
|
<th scope="row">雷神索爾</th>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td>
|
||||||
|
<a href="javascript:void(0);" class="btn btn-warning btn-sm btn-icon rounded-circle waves-effect waves-themed">
|
||||||
|
<i class="fal fa-exclamation"></i>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>低</td>
|
||||||
|
<td>
|
||||||
|
<a href="javascript:;" type="button" class="btn btn-primary btn-pills waves-effect waves-themed" data-toggle="modal" data-target="#addpeople">修改</a>
|
||||||
|
<button type="button" class="btn btn-danger btn-pills waves-effect waves-themed">刪除</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@ -261,8 +261,8 @@
|
|||||||
<span class="nav-link-text" data-i18n="nav.category">報表查詢</span>
|
<span class="nav-link-text" data-i18n="nav.category">報表查詢</span>
|
||||||
</a>
|
</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li class="">
|
<li class="@(ViewData["MainNum"] == "4" && ViewData["SubNum"].ToString() == "1" ? "active" : "")">
|
||||||
<a href="javascript:void(0);" title="電站報表" data-filter-tags="utilities disabled item">
|
<a asp-controller="StationReport" asp-action="Index" title="電站報表" data-filter-tags="utilities disabled item">
|
||||||
<span class="nav-link-text" data-i18n="nav.utilities_disabled_item">電站報表</span>
|
<span class="nav-link-text" data-i18n="nav.utilities_disabled_item">電站報表</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@ -288,8 +288,8 @@
|
|||||||
<span class="nav-link-text" data-i18n="nav.category">即時告警</span>
|
<span class="nav-link-text" data-i18n="nav.category">即時告警</span>
|
||||||
</a>
|
</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li class="">
|
<li class="@(ViewData["MainNum"] == "5" && ViewData["SubNum"].ToString() == "1" ? "active" : "")">
|
||||||
<a href="0alert.html" title="即時告警管理" data-filter-tags="utilities disabled item">
|
<a asp-controller="ExceptionRecord" asp-action="Index" title="即時告警管理" data-filter-tags="utilities disabled item">
|
||||||
<span class="nav-link-text" data-i18n="nav.utilities_disabled_item">即時告警管理</span>
|
<span class="nav-link-text" data-i18n="nav.utilities_disabled_item">即時告警管理</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@ -149,11 +149,11 @@
|
|||||||
var recode;
|
var recode;
|
||||||
var selected_work_type = -1;
|
var selected_work_type = -1;
|
||||||
var err_status = 1;//異常紀錄,1:未解決 0:已解決
|
var err_status = 1;//異常紀錄,1:未解決 0:已解決
|
||||||
var err_status = 1;//異常紀錄,1:未解決 0:已解決
|
|
||||||
var groupType = 0; //0:日 1:月 2:年 3:歷年
|
var groupType = 0; //0:日 1:月 2:年 3:歷年
|
||||||
var historyRange = "";
|
var historyRange = "";
|
||||||
var selectInverterkwhBarType = 0;
|
var selectInverterkwhBarType = 0;
|
||||||
var HeapMapXAxis = [];
|
var HeapMapXAxis = [];
|
||||||
|
var countOperationRecodeFile = 0;
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
var url = new URL(location.href);
|
var url = new URL(location.href);
|
||||||
@ -2182,8 +2182,8 @@
|
|||||||
|
|
||||||
|
|
||||||
if (val.length != 0) {
|
if (val.length != 0) {
|
||||||
if (groupType != 0) {
|
if (groupType != 6) {
|
||||||
diffSOLARHOURALL += val.solarhour;
|
diffSOLARHOURALL = val.solarhour;
|
||||||
$('#HistoryDetailTable').append('<tr>' +
|
$('#HistoryDetailTable').append('<tr>' +
|
||||||
'<td>' + val.timestamp + '</td>' +
|
'<td>' + val.timestamp + '</td>' +
|
||||||
'<td>' + val.kwh.toFixed(2) + '</td>' +
|
'<td>' + val.kwh.toFixed(2) + '</td>' +
|
||||||
|
|||||||
234
SolarPower/Views/StationReport/Index.cshtml
Normal file
234
SolarPower/Views/StationReport/Index.cshtml
Normal file
@ -0,0 +1,234 @@
|
|||||||
|
@{
|
||||||
|
ViewData["MainNum"] = "4";
|
||||||
|
ViewData["SubNum"] = "1";
|
||||||
|
ViewData["Title"] = "電站報表";
|
||||||
|
}
|
||||||
|
@using SolarPower.Models.Role
|
||||||
|
@model RoleLayerEnum
|
||||||
|
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row flex-nowrap wrapper">
|
||||||
|
<div class="col-md-2 col-1 pl-0 pr-0 collapse width border-right sidebar vh-100">
|
||||||
|
|
||||||
|
<div class="list-group border-0 card text-center text-md-left" id="sidebar">
|
||||||
|
|
||||||
|
<div class="border bg-light rounded-top">
|
||||||
|
<div class="form-group p-2 m-0 rounded-top">
|
||||||
|
<input type="text" class="form-control form-control-lg shadow-inset-2 m-0" id="js_list_accordion_filter" placeholder="">
|
||||||
|
</div>
|
||||||
|
<div id="js_list_accordion" class="accordion accordion-hover accordion-clean js-list-filter">
|
||||||
|
<div class="card border-top-left-radius-0 border-top-right-radius-0">
|
||||||
|
<div class="card-header">
|
||||||
|
<a href="javascript:void(0);" class="card-title collapsed" data-toggle="collapse" data-target="#js_list_accordion-a" aria-expanded="false" data-filter-tags="settings">
|
||||||
|
<i class="fal fa-globe width-2 fs-xl"></i>
|
||||||
|
新北市
|
||||||
|
<span class="ml-auto">
|
||||||
|
<span class="collapsed-reveal">
|
||||||
|
<i class="fal fa-chevron-up fs-xl"></i>
|
||||||
|
</span>
|
||||||
|
<span class="collapsed-hidden">
|
||||||
|
<i class="fal fa-chevron-down fs-xl"></i>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div id="js_list_accordion-a" class="collapse" data-parent="#js_list_accordion" style="">
|
||||||
|
<div class="card-body">
|
||||||
|
<ul class="list-group list-group-flush">
|
||||||
|
<li class="list-group-item">
|
||||||
|
<div class="d-flex justify-content-between">
|
||||||
|
<h4 class="font-weight-bold"><i class="fal fa-charging-station"></i> 新竹交大站</h4>
|
||||||
|
<div class="">
|
||||||
|
<input type="checkbox" class="" id="defaultUnchecked">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<ul class="list-group list-group-flush">
|
||||||
|
<li class="list-group-item pr-0 d-flex justify-content-between">
|
||||||
|
<a href="#"><i class="fal fa-tachometer-alt-slow"></i> 電錶 R001</a>
|
||||||
|
<div class="">
|
||||||
|
<input type="checkbox" class="" id="defaultUnchecked">
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item pr-0 d-flex justify-content-between">
|
||||||
|
<a href="#"><i class="fal fa-sun"></i> 日照計 R002</a>
|
||||||
|
<div class="">
|
||||||
|
<input type="checkbox" class="" id="defaultUnchecked">
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item pr-0 d-flex justify-content-between">
|
||||||
|
<a href="#"><i class="fal fa-thermometer-half"></i> 環境溫度計 R003</a>
|
||||||
|
<div class="">
|
||||||
|
<input type="checkbox" class="" id="defaultUnchecked">
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item pr-0 d-flex justify-content-between">
|
||||||
|
<a href="#"><i class="fal fa-wind"></i> 風速計 R002</a>
|
||||||
|
<div class="">
|
||||||
|
<input type="checkbox" class="" id="defaultUnchecked">
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item pr-0 d-flex justify-content-between">
|
||||||
|
<a href="#"><i class="fal fa-sun-dust"></i> 落塵計 R002</a>
|
||||||
|
<div class="">
|
||||||
|
<input type="checkbox" class="" id="defaultUnchecked">
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item pr-0 d-flex justify-content-between">
|
||||||
|
<a href="#"><i class="fal fa-tint"></i> 濕度計 R002</a>
|
||||||
|
<div class="">
|
||||||
|
<input type="checkbox" class="" id="defaultUnchecked">
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item pr-0 d-flex justify-content-between">
|
||||||
|
<a href="#"><i class="fal fa-server"></i> 逆變器 R002</a>
|
||||||
|
<div class="">
|
||||||
|
<input type="checkbox" class="" id="defaultUnchecked">
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item">
|
||||||
|
<div class="d-flex justify-content-between">
|
||||||
|
<h4 class="font-weight-bold"><i class="fal fa-charging-station"></i> 新竹動物園站</h4>
|
||||||
|
<div class="">
|
||||||
|
<input type="checkbox" class="" id="defaultUnchecked">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<li class="list-group-item">
|
||||||
|
<div class="d-flex justify-content-between">
|
||||||
|
<h4 class="font-weight-bold"><i class="fal fa-charging-station"></i> 新竹火車站</h4>
|
||||||
|
<div class="">
|
||||||
|
<input type="checkbox" class="" id="defaultUnchecked">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header">
|
||||||
|
<a href="javascript:void(0);" class="card-title collapsed" data-toggle="collapse" data-target="#js_list_accordion-b" aria-expanded="false" data-filter-tags="merge">
|
||||||
|
<i class="fal fa-globe width-2 fs-xl"></i>
|
||||||
|
台南市
|
||||||
|
<span class="ml-auto">
|
||||||
|
<span class="collapsed-reveal">
|
||||||
|
<i class="fal fa-chevron-up fs-xl"></i>
|
||||||
|
</span>
|
||||||
|
<span class="collapsed-hidden">
|
||||||
|
<i class="fal fa-chevron-down fs-xl"></i>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div id="js_list_accordion-b" class="collapse" data-parent="#js_list_accordion">
|
||||||
|
<div class="card-body">
|
||||||
|
放台南市list
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header">
|
||||||
|
<a href="javascript:void(0);" class="card-title collapsed" data-toggle="collapse" data-target="#js_list_accordion-c" aria-expanded="false" data-filter-tags="backup">
|
||||||
|
<i class="fal fa-globe width-2 fs-xl"></i>
|
||||||
|
屏東縣
|
||||||
|
<span class="ml-auto">
|
||||||
|
<span class="collapsed-reveal">
|
||||||
|
<i class="fal fa-chevron-up fs-xl"></i>
|
||||||
|
</span>
|
||||||
|
<span class="collapsed-hidden">
|
||||||
|
<i class="fal fa-chevron-down fs-xl"></i>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div id="js_list_accordion-c" class="collapse" data-parent="#js_list_accordion">
|
||||||
|
<div class="card-body">
|
||||||
|
<ul class="list-group">
|
||||||
|
<li class="list-group-item">
|
||||||
|
<span data-filter-tags="reports file">Reports</span>
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item">
|
||||||
|
<span data-filter-tags="analytics graphs">Analytics</span>
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item">
|
||||||
|
<span data-filter-tags="export download">Export</span>
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item">
|
||||||
|
<span data-filter-tags="storage">Storage</span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<span class="filter-message js-filter-message"></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-auto px-0">
|
||||||
|
<a href="javascript:;" data-target=".sidebar" data-toggle="collapse" class="btn btn-default btn-xs btn-icon waves-effect waves-themed" style="border-radius: 0;"><i onclick="myfunc(this)" class="fal fa-angle-right fa-lg py-3"></i></a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<main class="col px-5 pl-md-2 main">
|
||||||
|
<div class="subheader">
|
||||||
|
<h1 class="subheader-title">
|
||||||
|
<i class="subheader-icon fal fa-file-chart-line"></i> @ViewData["Title"]
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xl-12">
|
||||||
|
<div id="panel-5" class="panel">
|
||||||
|
<div class="panel-container show">
|
||||||
|
<div class="panel-content">
|
||||||
|
<div class="mb-3 d-flex justify-content-start">
|
||||||
|
<div class="pr-3">
|
||||||
|
<div class="btn-group btn-group-md">
|
||||||
|
<button type="button" class="btn btn-success waves-effect waves-themed btn-change-searchType" id="Group0" onclick="changeType(0,this)">日</button>
|
||||||
|
<button type="button" class="btn btn-secondary waves-effect waves-themed btn-change-searchType" id="Group1" onclick="changeType(1,this)">日區間</button>
|
||||||
|
<button type="button" class="btn btn-secondary waves-effect waves-themed btn-change-searchType" id="Group2" onclick="changeType(2,this)">月</button>
|
||||||
|
<button type="button" class="btn btn-secondary waves-effect waves-themed btn-change-searchType" id="Group3" onclick="changeType(3,this)">年</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="pr-3" id="quickSearchOption">
|
||||||
|
<button type="button" class="btn btn-secondary waves-effect waves-themed btn-change-quickSearch1" onclick="quickSearch(0)">今天</button>
|
||||||
|
<button type="button" class="btn btn-secondary waves-effect waves-themed btn-change-quickSearch2" onclick="quickSearch(1)">昨天</button>
|
||||||
|
</div>
|
||||||
|
<div class="pr-3">
|
||||||
|
<div class="btn-group" id="js-demo-nesting" role="group" aria-label="Button group with nested dropdown">
|
||||||
|
<input type="date" class="form-control" id="DateGet" />
|
||||||
|
</div>
|
||||||
|
<div class="btn-group" id="DateGettextdiv" role="group" aria-label="Button group with nested dropdown">
|
||||||
|
<input type="text" class="form-control" id="DateGettext" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="pr-3" id="quickSearchOption">
|
||||||
|
<button type="button" class="btn btn-primary waves-effect waves-themed btn-change-quickSearch1 ml-6" onclick="quickSearch(0)">日報表</button>
|
||||||
|
<button type="button" class="btn btn-primary waves-effect waves-themed btn-change-quickSearch2 ml-6" onclick="quickSearch(1)">月報表</button>
|
||||||
|
<button type="button" class="btn btn-primary waves-effect waves-themed btn-change-quickSearch2 ml-6" onclick="quickSearch(1)">綜合報表</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="mb-3 d-flex justify-content-start">
|
||||||
|
<div class="pr-3">
|
||||||
|
<button type="button" class="btn btn-primary waves-effect waves-themed btn-change-quickSearch1" onclick="quickSearch(0)"><span class="fal fa-file-excel mr-1"></span> 匯出</button>
|
||||||
|
</div>
|
||||||
|
<div class="pr-3">
|
||||||
|
<button type='button' class='btn btn-success waves-effect waves-themed ml-2' id=''>新竹交大站</button>
|
||||||
|
<button type='button' class='btn btn-outline-success waves-effect waves-themed ml-2' id=''>新竹巨城站</button>
|
||||||
|
<button type='button' class='btn btn-outline-success waves-effect waves-themed ml-2' id=''>新竹交大站</button>
|
||||||
|
<button type='button' class='btn btn-outline-success waves-effect waves-themed ml-2' id=''>新竹交大站</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 7.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 7.2 KiB |
Loading…
Reference in New Issue
Block a user