Merge branch 'master' of https://gitea.mjm-staging.developers-homelab.net/BIMS/BIMS
This commit is contained in:
		
						commit
						6e606c191b
					
				@ -140,7 +140,7 @@ namespace FrontendWebApi.ApiControllers
 | 
			
		||||
 | 
			
		||||
            try
 | 
			
		||||
            {
 | 
			
		||||
                var sqlString = @$"UPDATE graph_manage SET deleted = 0 WHERE code = @code AND sub_system_tag = @sub_system_tag AND main_system_tag = @main_system_tag";
 | 
			
		||||
                var sqlString = @$"UPDATE graph_manage SET deleted = 1 WHERE code = @code AND sub_system_tag = @sub_system_tag AND main_system_tag = @main_system_tag";
 | 
			
		||||
 | 
			
		||||
                var param = new { @code = gi.code, @sub_system_tag = gi.sub_system_tag, @main_system_tag = gi.main_system_tag };
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -56,8 +56,8 @@ namespace FrontendWebApi.ApiControllers
 | 
			
		||||
                ControllerContext.HttpContext.Response.Headers.Add("Access-Control-Allow-Origin", "*");
 | 
			
		||||
                EDFunction eDFunction = new EDFunction();
 | 
			
		||||
 | 
			
		||||
                //string SHA256Pwd = eDFunction.GetSHA256Encryption(login.password);
 | 
			
		||||
                var User = await backendRepository.GetOneAsync<User>("userinfo", @$"account = '{login.account}' and deleted = 0");
 | 
			
		||||
                string SHA256Pwd = eDFunction.GetSHA256Encryption(login.password);
 | 
			
		||||
                var User = await backendRepository.GetOneAsync<User>("userinfo", @$"account = '{login.account}' and password = '{SHA256Pwd}' and deleted = 0");
 | 
			
		||||
                if (User == null)
 | 
			
		||||
                {
 | 
			
		||||
                    apiResult.Code = "9998";
 | 
			
		||||
 | 
			
		||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -3,6 +3,7 @@ using FrontendWebApi.Models;
 | 
			
		||||
using Microsoft.AspNetCore.Http;
 | 
			
		||||
using Microsoft.AspNetCore.Mvc;
 | 
			
		||||
using Microsoft.Extensions.Logging;
 | 
			
		||||
using Newtonsoft.Json.Linq;
 | 
			
		||||
using Repository.BackendRepository.Interface;
 | 
			
		||||
using Repository.BaseRepository.Interface;
 | 
			
		||||
using Repository.FrontendRepository.Interface;
 | 
			
		||||
@ -32,7 +33,7 @@ namespace FrontendWebApi.ApiControllers
 | 
			
		||||
 | 
			
		||||
        [HttpPost]
 | 
			
		||||
        [Route("api/AddUser")]
 | 
			
		||||
        public async Task<ApiResult<JwtGet>> AddUser([FromBody]bool str)
 | 
			
		||||
        public async Task<ApiResult<JwtGet>> AddUser(bool str)
 | 
			
		||||
        {
 | 
			
		||||
            var a = User.Claims.Select(p => new { p.Type, p.Value });
 | 
			
		||||
            ApiResult<JwtGet> apiResult = new ApiResult<JwtGet>(jwt_str);
 | 
			
		||||
 | 
			
		||||
@ -45,322 +45,76 @@ namespace FrontendWebApi.Models
 | 
			
		||||
        public bool yesterday { get; set; }//昨天建立时间
 | 
			
		||||
        public string main_system_tag { get; set; }//大类tag
 | 
			
		||||
        public string sub_system_tag { get; set; }//小类tag
 | 
			
		||||
        public byte work_type { get; set; } // 1:保養, 2:維修
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public class Operation : Actor
 | 
			
		||||
    public class BuildingList
 | 
			
		||||
    {
 | 
			
		||||
        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 string device_building_tag { get; set; }
 | 
			
		||||
        public string device_floor_tag { get; set; }
 | 
			
		||||
        public string full_name { get; set; }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
    public class PowerStationIdList
 | 
			
		||||
    public class Operation_Record : Actor
 | 
			
		||||
    {
 | 
			
		||||
        public string Text { get; set; }
 | 
			
		||||
        public string Value { get; set; }
 | 
			
		||||
    }
 | 
			
		||||
    public class SendData
 | 
			
		||||
    {
 | 
			
		||||
        public List<int> 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
 | 
			
		||||
        public int id { get; set; }
 | 
			
		||||
        public byte deleted { get; set; }
 | 
			
		||||
        public string formId { get; set; }
 | 
			
		||||
        public string location { get; set; }
 | 
			
		||||
        public string location_code { get; set; }
 | 
			
		||||
        public string device_system_category_layer2 { get; set; }
 | 
			
		||||
        public string device_system_category_layer3 { get; set; }
 | 
			
		||||
        public byte work_type { get; set; }
 | 
			
		||||
        public string error_code { get; set; }
 | 
			
		||||
        public string fix_do { get; set; }
 | 
			
		||||
        public string fix_do_code { get; set; }
 | 
			
		||||
        public int fix_firm { get; set; }
 | 
			
		||||
        public byte status { get; set; }
 | 
			
		||||
        public int work_person_id { get; set; }
 | 
			
		||||
        public DateTime start_time { get; set; }
 | 
			
		||||
        public DateTime end_time { get; set; }
 | 
			
		||||
        public DateTime work_time { get; set; }
 | 
			
		||||
        public DateTime finish_time { get; set; }
 | 
			
		||||
        public string notice { get; set; }
 | 
			
		||||
        public string description { get; set; }
 | 
			
		||||
        public string work_type_name
 | 
			
		||||
        { 
 | 
			
		||||
            get
 | 
			
		||||
            {
 | 
			
		||||
                if (!string.IsNullOrEmpty(startTime))
 | 
			
		||||
                Dictionary<byte, string> name = new Dictionary<byte, string>()
 | 
			
		||||
                {
 | 
			
		||||
                    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<int> 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<OperationRecordFile> RecordFiles { get; set; }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public class OperationRecordFile : Actor
 | 
			
		||||
    {
 | 
			
		||||
        public int Id { get; set; }
 | 
			
		||||
        public int RecordId { get; set; }
 | 
			
		||||
        public string FileName { get; set; }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /// <summary>
 | 
			
		||||
    /// 運維作業記錄的搜尋條件
 | 
			
		||||
    /// </summary>
 | 
			
		||||
    public class PostOperationRecordFilter
 | 
			
		||||
    {
 | 
			
		||||
        public List<int> CityIds { get; set; } //縣市編號
 | 
			
		||||
        public List<int> 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; }//狀態
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /// <summary>
 | 
			
		||||
    /// 運維作業記錄的表單
 | 
			
		||||
    /// </summary>
 | 
			
		||||
    public class OperationRecordDataTable : OperationRecord
 | 
			
		||||
    {
 | 
			
		||||
        public string WorkTypeText
 | 
			
		||||
        {
 | 
			
		||||
            get
 | 
			
		||||
            {
 | 
			
		||||
                Dictionary<int, string> pairs = new Dictionary<int, string>()
 | 
			
		||||
                {
 | 
			
		||||
                    { 0, "清洗"},
 | 
			
		||||
                    { 1, "巡檢"},
 | 
			
		||||
                    { 2, "維修"},
 | 
			
		||||
                    { 1 , "保養" },
 | 
			
		||||
                    { 2 , "維修" }
 | 
			
		||||
                };
 | 
			
		||||
 | 
			
		||||
                return pairs[WorkType];
 | 
			
		||||
                return name[work_type];
 | 
			
		||||
            }
 | 
			
		||||
        } //工作項目名稱
 | 
			
		||||
        public string StatusText
 | 
			
		||||
        }
 | 
			
		||||
        public string status_name
 | 
			
		||||
        {
 | 
			
		||||
            get
 | 
			
		||||
            {
 | 
			
		||||
                Dictionary<int, string> pairs = new Dictionary<int, string>()
 | 
			
		||||
                Dictionary<byte, string> name = new Dictionary<byte, string>()
 | 
			
		||||
                {
 | 
			
		||||
                    { 0, "未完成"},
 | 
			
		||||
                    { 1, "完成"},
 | 
			
		||||
                    { 2, "未完成-過期"},
 | 
			
		||||
                    { 3, "完成-過期"},
 | 
			
		||||
                    { 3, "完成-過期"}
 | 
			
		||||
                };
 | 
			
		||||
 | 
			
		||||
                return pairs[Status];
 | 
			
		||||
                return name[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<string> HyperLinks { get; set; }
 | 
			
		||||
        public string Function { get; set; }
 | 
			
		||||
        }
 | 
			
		||||
        public string device_name { get; }
 | 
			
		||||
        public string user_full_name { get; }
 | 
			
		||||
        public List<Operation_Record_File> lorf { get; set; }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public class PostOperationRecord
 | 
			
		||||
    public class Operation_Record_File : Actor
 | 
			
		||||
    { 
 | 
			
		||||
        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<int> 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 int id { get; set; }
 | 
			
		||||
        public byte deleted { get; set; }
 | 
			
		||||
        public int record_id { get; set; }
 | 
			
		||||
        public IFormFile file { get; set; }
 | 
			
		||||
        public string ori_file_name { get; set; }
 | 
			
		||||
        public string save_file_name { 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; }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /// <summary>
 | 
			
		||||
    /// 針對運維作業記錄檔案
 | 
			
		||||
    /// </summary>
 | 
			
		||||
    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; }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								FrontendWebApi/wwwroot/upload/operation/image1.jpg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								FrontendWebApi/wwwroot/upload/operation/image1.jpg
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 7.3 KiB  | 
		Loading…
	
		Reference in New Issue
	
	Block a user