From d7ad9d01244edb394ca8ac3adeb8d13d66f962c3 Mon Sep 17 00:00:00 2001 From: dev01 Date: Tue, 1 Nov 2022 18:50:38 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[=E7=B8=BD=E7=AE=A1=E7=90=86=E5=BE=8C?= =?UTF-8?q?=E5=8F=B0][=E4=BD=BF=E7=94=A8=E8=80=85]=20API=20=E5=8A=A0?= =?UTF-8?q?=E4=B8=8A=20FromBody?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FrontendWebApi/ApiControllers/UserController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FrontendWebApi/ApiControllers/UserController.cs b/FrontendWebApi/ApiControllers/UserController.cs index 67811c5..a6756f6 100644 --- a/FrontendWebApi/ApiControllers/UserController.cs +++ b/FrontendWebApi/ApiControllers/UserController.cs @@ -114,7 +114,7 @@ namespace FrontendWebApi.ApiControllers /// /// [HttpPost] - public async Task> SaveUser(SaveUserManager post) + public async Task> SaveUser([FromBody] SaveUserManager post) { ApiResult apiResult = new ApiResult(); From a4346a6fb4bf80813e46e717b485aba3005c6c45 Mon Sep 17 00:00:00 2001 From: "Darren.NET" Date: Tue, 1 Nov 2022 18:57:24 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[=E5=89=8D=E5=8F=B0API]=20Models=E5=8A=A0?= =?UTF-8?q?=E5=85=A5Operation.cs(=E9=81=8B=E7=B6=AD=E7=B6=AD=E4=BF=AE?= =?UTF-8?q?=E4=BF=9D=E9=A4=8A)=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FrontendWebApi/Models/Operation.cs | 340 +++++++++++++++++++++++++++++ 1 file changed, 340 insertions(+) create mode 100644 FrontendWebApi/Models/Operation.cs diff --git a/FrontendWebApi/Models/Operation.cs b/FrontendWebApi/Models/Operation.cs new file mode 100644 index 0000000..6832294 --- /dev/null +++ b/FrontendWebApi/Models/Operation.cs @@ -0,0 +1,340 @@ +using Microsoft.AspNetCore.Http; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace FrontendWebApi.Models +{ + public enum OperationRecordStatusEnum : byte + { + NoneComplete = 0, //未完成 + Complete = 1, //完成 + NoneCompleteExpired = 2, //未完成-過期 + CompleteExpired = 3, //完成-過期 + } + + public enum OperationRecordWorkTypeEnum : byte + { + Clearn = 0, //清潔 + Inspection = 1, //巡檢 + Fix = 2, //維修 + } + + public class Operation : Actor + { + public int Id { get; set; }//流水號 + public byte Delete { get; set; }//刪除 + public string PlanId { get; set; }//計畫單號 + public int PowerStationId { get; set; }//電站編號 + public string SerialNumber { get; set; }//計畫單號用流水號 + public int ScheduleNum { get; set; }//排程數字 + public byte ScheduleType { get; set; }//排程屬性,0:天 1:周 2:月 3:季 4:年 + public int WorkDay { get; set; }//預期工作天數 + public DateTime StartTime { get; set; }//開始時間 + public byte Type { get; set; }//項目, 0:清洗 1:巡檢 + public byte EmailType { get; set; }//email提醒種類,0:當天 1:前一天 2:前兩天 3:前三天 + public string Description { get; set; }//描述 + + } + public class PowerStationIdList + { + public string Text { get; set; } + public string Value { get; set; } + } + public class SendData + { + public List id { get; set; } + } + public class OperationCreatePlanModal : Actor + { + private string startTime = "", endTime = ""; + public int Id { get; set; } + public int PowerStationId { get; set; } + public int Type { get; set; } + public int ScheduleNum { get; set; } + public int ScheduleType { get; set; } + public int WorkDay { get; set; } + public int IsDelivery { get; set; } + public string StartTime + { + get + { + if (!string.IsNullOrEmpty(startTime)) + { + return Convert.ToDateTime(startTime).ToString("yyyy-MM-dd"); + } + else + { + return null; + } + } + set { startTime = value; } + } + public string EndTime + { + get + { + if (!string.IsNullOrEmpty(endTime)) + { + return Convert.ToDateTime(endTime).ToString("yyyy-MM-dd"); + } + else + { + return null; + } + } + set { endTime = value; } + } + public string Description { get; set; } + public int EmailType { get; set; } + } + public class OperationCreatePlan : OperationCreatePlanModal + { + public string PlanId { get; set; } + public string SerialNumber { get; set; } + + private string updatedAt; + public int UpdatedBy { get; set; } //修改者 + public string UpdatedAt { get { return Convert.ToDateTime(updatedAt).ToString("yyyy-MM-dd HH:mm:ss"); } set { updatedAt = value; } } //修改時間 + private string lastCreateTime; + public string LastCreateTime { get { return Convert.ToDateTime(lastCreateTime).ToString("yyyy-MM-dd HH:mm:ss"); } set { lastCreateTime = value; } } + public string PowerStationName { get; set; } + } + public class OperationPlanTable : OperationCreatePlan + { + public string TypeName { get; set; } + public string Schedule { get; set; } + public string EmailTypeName { get; set; } + public string CreatedPerson { get; set; } + public string Function { get; set; }//功能 + public string ScheduleDay { get; set; } + public string StartTimeString { get; set; } + public string CreateTimeString { get; set; } + + + } + + public class PlanToRecord : Actor + { + public int PowerStationId { get; set; } + public int WorkType { get; set; } + public string StartTime { get; set; } + public string EndTime { get; set; } + public string Notice { get; set; } + } + + public class OperationRecord : UserInfo + { + private string startTime, endTime, finishTime, workTime; + public string FormId { get; set; } + public string SerialNumber { get; set; } + public int PowerStationId { get; set; } + public string PowerStationName { get; set; } + public byte WorkType { get; set; } + public string ErrorCode { get; set; } + public string FixDo { get; set; } + public byte FixFirm { get; set; } + public byte Status { get; set; } + public List WorkPersonIds { get; set; } + public string StartTime + { + get + { + if (!string.IsNullOrEmpty(startTime)) + { + return Convert.ToDateTime(startTime).ToString("yyyy-MM-dd"); + } + else + { + return null; + } + } + set { startTime = value; } + } //開始時間 + public string EndTime + { + get + { + if (!string.IsNullOrEmpty(endTime)) + { + return Convert.ToDateTime(endTime).ToString("yyyy-MM-dd"); + } + else + { + return null; + } + } + set { endTime = value; } + } // 結束時間 + public string FinishTime + { + get + { + if (!string.IsNullOrEmpty(finishTime)) + { + return Convert.ToDateTime(finishTime).ToString("yyyy-MM-dd"); + } + else + { + return null; + } + } + set { finishTime = value; } + } // 完成時間 + public string WorkTime + { + get + { + if (!string.IsNullOrEmpty(workTime)) + { + return Convert.ToDateTime(workTime).ToString("yyyy-MM-dd"); + } + else + { + return null; + } + } + set { workTime = value; } + } // 工作時間 + public string Notice { get; set; } + public string Description { get; set; } + public List RecordFiles { get; set; } + } + + public class OperationRecordFile : Actor + { + public int Id { get; set; } + public int RecordId { get; set; } + public string FileName { get; set; } + } + + /// + /// 運維作業記錄的搜尋條件 + /// + public class PostOperationRecordFilter + { + public List CityIds { get; set; } //縣市編號 + public List PowerStationIds { get; set; } //電站編號 + public byte WorkType { get; set; } //工作項目 + public string Range { get; set; } //取得搜尋範圍 + public string StartTime { get; set; } //起始日期 + public string EndTime { get; set; } //結束日期 + public byte Status { get; set; }//狀態 + } + + /// + /// 運維作業記錄的表單 + /// + public class OperationRecordDataTable : OperationRecord + { + public string WorkTypeText + { + get + { + Dictionary pairs = new Dictionary() + { + { 0, "清洗"}, + { 1, "巡檢"}, + { 2, "維修"}, + }; + + return pairs[WorkType]; + } + } //工作項目名稱 + public string StatusText + { + get + { + Dictionary pairs = new Dictionary() + { + { 0, "未完成"}, + { 1, "完成"}, + { 2, "未完成-過期"}, + { 3, "完成-過期"}, + }; + + return pairs[Status]; + } + } //狀態名稱 + public string WorkPersonName { get; set; } //處理人員 + public string OperationPredict + { + get + { + if (!string.IsNullOrEmpty(StartTime) || !string.IsNullOrEmpty(EndTime)) + { + return StartTime + " ~ " + EndTime; + } + else + { + return string.Empty; + } + } + } //本次作業預計 + public List HyperLinks { get; set; } + public string Function { get; set; } + } + + public class PostOperationRecord + { + public int Id { get; set; } + public int PowerStationId { get; set; } + public byte WorkType { get; set; } + public string ErrorCode { get; set; } + public string FixDo { get; set; } + public byte FixFirm { get; set; } + public byte Status { get; set; } + public List WorkPersonIds { get; set; } + public string StartTime { get; set; }//開始時間 + public string EndTime { get; set; } // 結束時間 + public string FinishTime { get; set; } // 完成時間 + public string WorkTime { get; set; } // 工作時間 + public string Notice { get; set; } + public string Description { get; set; } + public IFormFile[] RecordFiles { get; set; } + public byte Emailcheck { get; set; } + } + + public class UpdateOperationRecord : Actor + { + public string FormId { get; set; } + public string SerialNumber { get; set; } + public string ErrorCode { get; set; } + public string FixDo { get; set; } + public byte FixFirm { get; set; } + public byte Status { get; set; } + public int WorkPersonId { get; set; } + public string FinishTime { get; set; } // 完成時間 + public string WorkTime { get; set; } // 工作時間 + public string Notice { get; set; } + public string Description { get; set; } + } + + /// + /// 針對運維作業記錄檔案 + /// + public class PostOperationRecordIdAndSelectedId + { + public int ReocdeId { get; set; } + public int SelectedId { get; set; } + } + + public class OperationPlan + { + private string startTime; + public int Id { get; set; } + public int ScheduleNum { get; set; } + public int ScheduleType { get; set; } + public string StartTime { get { return Convert.ToDateTime(startTime).ToString("yyyy-MM-dd HH:mm:ss"); } set { startTime = value; } } //修改時間 + } + + public class OperationRecordPersonnel : Actor + { + public int Id { get; set; } + public byte Deleted { get; set; } + public int OperationRecordId { get; set; } + public int UserId { get; set; } + } + +}