From de5fd332791ddf02457092a5fdda59067a5d5541 Mon Sep 17 00:00:00 2001 From: dev02 Date: Sat, 5 Nov 2022 11:26:34 +0800 Subject: [PATCH] =?UTF-8?q?[webApi]=20=E9=81=8B=E7=B6=AD=E4=BD=9C=E6=A5=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ApiControllers/GraphManageController.cs | 2 +- .../ApiControllers/LoginController.cs | 4 +- .../ApiControllers/OperationController.cs | 962 +++++++++++++++--- .../ApiControllers/UserController.cs | 3 +- FrontendWebApi/Models/Operation.cs | 346 +------ .../wwwroot/upload/operation/image1.jpg | Bin 0 -> 7477 bytes 6 files changed, 857 insertions(+), 460 deletions(-) create mode 100644 FrontendWebApi/wwwroot/upload/operation/image1.jpg diff --git a/FrontendWebApi/ApiControllers/GraphManageController.cs b/FrontendWebApi/ApiControllers/GraphManageController.cs index 391c1cb..aa62a28 100644 --- a/FrontendWebApi/ApiControllers/GraphManageController.cs +++ b/FrontendWebApi/ApiControllers/GraphManageController.cs @@ -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 }; diff --git a/FrontendWebApi/ApiControllers/LoginController.cs b/FrontendWebApi/ApiControllers/LoginController.cs index f15efea..24b1435 100644 --- a/FrontendWebApi/ApiControllers/LoginController.cs +++ b/FrontendWebApi/ApiControllers/LoginController.cs @@ -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("userinfo", @$"account = '{login.account}' and deleted = 0"); + string SHA256Pwd = eDFunction.GetSHA256Encryption(login.password); + var User = await backendRepository.GetOneAsync("userinfo", @$"account = '{login.account}' and password = '{SHA256Pwd}' and deleted = 0"); if (User == null) { apiResult.Code = "9998"; diff --git a/FrontendWebApi/ApiControllers/OperationController.cs b/FrontendWebApi/ApiControllers/OperationController.cs index 4c4f218..e696406 100644 --- a/FrontendWebApi/ApiControllers/OperationController.cs +++ b/FrontendWebApi/ApiControllers/OperationController.cs @@ -1,21 +1,29 @@ using FrontendWebApi.Models; +using iTextSharp.text; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.Extensions.Logging; using Newtonsoft.Json; +using NPOI.HPSF; +using NPOI.SS.Formula.Functions; using NPOI.SS.UserModel; +using NPOI.Util; using NPOI.XSSF.UserModel; +using Org.BouncyCastle.Crypto.Agreement.JPake; using Repository.BackendRepository.Interface; using Repository.FrontendRepository.Interface; using System; using System.Collections.Generic; +using System.Drawing.Drawing2D; using System.IO; +using System.Linq; using System.Threading.Tasks; namespace FrontendWebApi.ApiControllers { - [Route("api/[controller]")] - [ApiController] + //[Route("api/[controller]")] + //[ApiController] public class OperationController : MyBaseApiController { private readonly IBackendRepository backendRepository; @@ -88,7 +96,493 @@ namespace FrontendWebApi.ApiControllers } /// - /// 廠商資料列表(搜寻) + /// 大樓列表 + /// + /// + [HttpPost] + public async Task>> BuiList() + { + ApiResult> apiResult = new ApiResult>(); + List bl = new List(); + + try + { + var sqlString = @$"select d.device_area_tag, d.device_building_tag, d.device_floor_tag, CONCAT(case when d.device_area_tag='TPE' then '台北市' else '新北市' end, b.full_name, d.device_floor_tag) as full_name + from device d + join building b on d.device_building_tag = b.building_tag + where d.deleted = 0 + group by d.device_area_tag, d.device_building_tag, d.device_floor_tag, b.full_name"; + + bl = await backendRepository.GetAllAsync(sqlString); + + apiResult.Code = "0000"; + apiResult.Data = bl; + } + catch (Exception exception) + { + apiResult.Code = "9999"; + apiResult.Msg = "系統內部錯誤,請聯絡管理者。"; + Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message); + } + + return apiResult; + } + + /// + /// 設備列表 + /// + /// + [HttpPost] + public async Task>> DevList(BuildingList bl) + { + ApiResult> apiResult = new ApiResult>(); + List d = new List(); + + try + { + var sqlString = @$"select device_number, concat(device_floor_tag, ' ', device_last_name, ' ', device_serial_tag) as device_name + from device where deleted = 0 and device_building_tag = @device_building_tag and device_floor_tag = @device_floor_tag"; + + var param = new { @device_building_tag = bl.device_building_tag, @device_floor_tag = bl.device_floor_tag }; + + d = await backendRepository.GetAllAsync(sqlString, param); + + apiResult.Code = "0000"; + apiResult.Data = d; + } + catch (Exception exception) + { + apiResult.Code = "9999"; + apiResult.Msg = "系統內部錯誤,請聯絡管理者。"; + Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message); + } + + return apiResult; + } + + /// + /// 汇出excel (work_type: null=廠商, 1=保養, 2=維修) + /// + /// + [HttpPost] + public FileResult OpeExportExcel(byte? work_type) + { + var workbook = new XSSFWorkbook(); + #region excel設定 + IFont font12 = workbook.CreateFont(); + font12.FontName = "新細明體"; + font12.FontHeightInPoints = 12; + ICellStyle style12 = workbook.CreateCellStyle(); + style12.SetFont(font12); + style12.Alignment = HorizontalAlignment.Center; + style12.VerticalAlignment = VerticalAlignment.Center; + IFont font12Times = workbook.CreateFont(); + font12Times.FontName = "Times New Roman"; + font12Times.FontHeightInPoints = 12; + IFont font18 = workbook.CreateFont(); + font18.FontName = "新細明體"; + font18.FontHeightInPoints = 18; + font18.IsBold = true; + ICellStyle styleTitle18 = workbook.CreateCellStyle(); + styleTitle18.SetFont(font18); + styleTitle18.Alignment = HorizontalAlignment.Center; + styleTitle18.VerticalAlignment = VerticalAlignment.Center; + ICellStyle styleLeft12 = workbook.CreateCellStyle(); + styleLeft12.SetFont(font12); + styleLeft12.Alignment = HorizontalAlignment.Left; + styleLeft12.VerticalAlignment = VerticalAlignment.Center; + ICellStyle styleLine12 = workbook.CreateCellStyle(); + styleLine12.SetFont(font12); + styleLine12.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center; + styleLine12.VerticalAlignment = VerticalAlignment.Center; + styleLine12.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin; + styleLine12.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin; + styleLine12.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin; + styleLine12.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin; + ICellStyle stylein12 = workbook.CreateCellStyle(); + stylein12.SetFont(font12Times); + stylein12.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Left; + stylein12.VerticalAlignment = VerticalAlignment.Center; + stylein12.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin; + stylein12.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin; + stylein12.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin; + stylein12.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin; + stylein12.WrapText = true; + #endregion + + if (string.IsNullOrEmpty(work_type.ToString())) + { + var sqlString = $@"select of.*, v2.system_key + from operation_firm of + left join variable v1 on of.device_system_category_layer2 = v1.system_value and v1.system_type = @main_system_type and v1.delted = 0 + left join variable v2 on v1.id = v2.system_parent_id and of.device_system_category_layer3 = v2.system_value and v2.system_type = @sub_system_type and v2.deleted = 0 + where of.deleted = 0"; + var sheet = workbook.CreateSheet("廠商資料"); + var operation_firm = backendRepository.GetAllAsync(sqlString, null); + int RowPosition = 0; + #region set cell + IRow row = sheet.CreateRow(RowPosition); + sheet.SetColumnWidth(0, 4 * 160 * 12); + sheet.SetColumnWidth(1, 4 * 160 * 12); + sheet.SetColumnWidth(3, 4 * 160 * 12); + sheet.SetColumnWidth(4, 4 * 160 * 12); + sheet.SetColumnWidth(5, 4 * 160 * 12); + sheet.SetColumnWidth(6, 4 * 160 * 12); + sheet.SetColumnWidth(7, 4 * 160 * 12); + ICell cell = row.CreateCell(0); + cell.SetCellValue("廠商類別"); + cell.CellStyle = styleLine12; + cell = row.CreateCell(1); + cell.SetCellValue("廠商名稱"); + cell.CellStyle = styleLine12; + cell = row.CreateCell(2); + cell.SetCellValue("聯絡人"); + cell.CellStyle = styleLine12; + cell = row.CreateCell(3); + cell.SetCellValue("電話"); + cell.CellStyle = styleLine12; + cell = row.CreateCell(4); + cell.SetCellValue("郵箱"); + cell.CellStyle = styleLine12; + cell = row.CreateCell(5); + cell.SetCellValue("統一編號"); + cell.CellStyle = styleLine12; + cell = row.CreateCell(6); + cell.SetCellValue("備注"); + cell.CellStyle = styleLine12; + cell = row.CreateCell(7); + cell.SetCellValue("建立時間"); + cell.CellStyle = styleLine12; + #endregion + + if (operation_firm.Result.Count > 0) + { + foreach (var of in operation_firm.Result) + { + RowPosition += 1; + row = sheet.CreateRow(RowPosition); + for (var i = 0; i < 8; i++) + { + cell = row.CreateCell(i); + if (i == 0) + { + cell.SetCellValue(of.system_key); + } + if (i == 1) + { + cell.SetCellValue(of.name); + } + if (i == 2) + { + cell.SetCellValue(of.contact_person); + } + if (i == 3) + { + cell.SetCellValue(of.phone); + } + if (i == 4) + { + cell.SetCellValue(of.email); + } + if (i == 5) + { + cell.SetCellValue(of.tax_id_number); + } + if (i == 6) + { + cell.SetCellValue(of.remark); + } + if (i == 7) + { + cell.SetCellValue(of.Created_at); + } + + cell.CellStyle = style12; + } + } + } + } + else if (work_type == 1) + { + var sqlString = $@"select opr.*, concat(d.device_floor_tag, ' ', d.device_last_name, ' ', d.device_serial_tag) as device_name, ui.full_name as user_full_name + from operation_record opr + left join device d on opr.fix_do_code = d.device_number + left join userinfo ui on opr.work_person_id = ui.id + where opr.deleted = 0 and opr.work_type = 1"; + var sheet = workbook.CreateSheet("廠商資料"); + var operation_record = backendRepository.GetAllAsync(sqlString, null); + List operation_record_file = new List(); + + if (operation_record.Result.Count > 0) + { + foreach (var or in operation_record.Result) + { + sqlString = $@"select * from operation_record_file where record_id = @record_id"; + var param = new { @record_id = or.id }; + operation_record_file = backendRepository.GetAllAsync(sqlString, param).Result; + or.lorf = operation_record_file; + } + + int RowPosition = 0; + #region set cell + IRow row = sheet.CreateRow(RowPosition); + sheet.SetColumnWidth(0, 4 * 160 * 12); + sheet.SetColumnWidth(1, 4 * 160 * 12); + sheet.SetColumnWidth(2, 4 * 160 * 12); + sheet.SetColumnWidth(3, 4 * 160 * 12); + sheet.SetColumnWidth(4, 4 * 160 * 12); + sheet.SetColumnWidth(5, 4 * 160 * 12); + sheet.SetColumnWidth(6, 4 * 160 * 12); + sheet.SetColumnWidth(7, 4 * 160 * 12); + sheet.SetColumnWidth(8, 4 * 160 * 12); + sheet.SetColumnWidth(9, 4 * 160 * 12); + ICell cell = row.CreateCell(0); + cell.SetCellValue("項目"); + cell.CellStyle = styleLine12; + cell = row.CreateCell(1); + cell.SetCellValue("位置"); + cell.CellStyle = styleLine12; + cell = row.CreateCell(2); + cell.SetCellValue("表單號"); + cell.CellStyle = styleLine12; + cell = row.CreateCell(3); + cell.SetCellValue("設備名稱"); + cell.CellStyle = styleLine12; + cell = row.CreateCell(4); + cell.SetCellValue("狀態"); + cell.CellStyle = styleLine12; + cell = row.CreateCell(5); + cell.SetCellValue("處理人員"); + cell.CellStyle = styleLine12; + cell = row.CreateCell(6); + cell.SetCellValue("預計施工時間"); + cell.CellStyle = styleLine12; + cell = row.CreateCell(7); + cell.SetCellValue("檔案上傳"); + cell.CellStyle = styleLine12; + cell = row.CreateCell(8); + cell.SetCellValue("完成時間"); + cell.CellStyle = styleLine12; + cell = row.CreateCell(9); + cell.SetCellValue("建立時間"); + cell.CellStyle = styleLine12; + #endregion + foreach (var or in operation_record.Result) + { + RowPosition += 1; + row = sheet.CreateRow(RowPosition); + for (var i = 0; i < 10; i++) + { + cell = row.CreateCell(i); + if (i == 0) + { + cell.SetCellValue(or.work_type_name); + } + if (i == 1) + { + cell.SetCellValue(or.location); + } + if (i == 2) + { + cell.SetCellValue(or.formId); + } + if (i == 3) + { + cell.SetCellValue(or.device_name); + } + if (i == 4) + { + cell.SetCellValue(or.status_name); + } + if (i == 5) + { + cell.SetCellValue(or.user_full_name); + } + if (i == 6) + { + cell.SetCellValue(or.start_time); + } + if (i == 7) + { + cell.SetCellValue(or.finish_time); // image + } + if (i == 8) + { + cell.SetCellValue(or.finish_time); + } + if (i == 9) + { + cell.SetCellValue(or.Created_at); + } + + cell.CellStyle = style12; + } + } + } + } + else if (work_type == 2) + { + var sqlString = $@"select opr.*, concat(d.device_floor_tag, ' ', d.device_last_name, ' ', d.device_serial_tag) as device_name, ui.full_name as user_full_name + from operation_record opr + left join device d on opr.fix_do_code = d.device_number + left join userinfo ui on opr.work_person_id = ui.id + where opr.deleted = 0 and opr.work_type = 2"; + var sheet = workbook.CreateSheet("廠商資料"); + var operation_record = backendRepository.GetAllAsync(sqlString, null); + List operation_record_file = new List(); + + if (operation_record.Result.Count > 0) + { + foreach(var or in operation_record.Result) + { + sqlString = $@"select * from operation_record_file where record_id = @record_id"; + var param = new { @record_id = or.id }; + operation_record_file = backendRepository.GetAllAsync(sqlString, param).Result; + or.lorf = operation_record_file; + } + + int RowPosition = 0; + #region set cell + IRow row = sheet.CreateRow(RowPosition); + sheet.SetColumnWidth(0, 4 * 160 * 12); + sheet.SetColumnWidth(1, 4 * 160 * 12); + sheet.SetColumnWidth(2, 4 * 160 * 12); + sheet.SetColumnWidth(3, 4 * 160 * 12); + sheet.SetColumnWidth(4, 4 * 160 * 12); + sheet.SetColumnWidth(5, 4 * 160 * 12); + sheet.SetColumnWidth(6, 4 * 160 * 12); + sheet.SetColumnWidth(7, 4 * 160 * 12); + sheet.SetColumnWidth(8, 4 * 160 * 12); + sheet.SetColumnWidth(9, 4 * 160 * 12); + sheet.SetColumnWidth(10, 4 * 160 * 12); + ICell cell = row.CreateCell(0); + cell.SetCellValue("項目"); + cell.CellStyle = styleLine12; + cell = row.CreateCell(1); + cell.SetCellValue("位置"); + cell.CellStyle = styleLine12; + cell = row.CreateCell(2); + cell.SetCellValue("異常代號"); + cell.CellStyle = styleLine12; + cell = row.CreateCell(3); + cell.SetCellValue("表單號"); + cell.CellStyle = styleLine12; + cell = row.CreateCell(4); + cell.SetCellValue("設備名稱"); + cell.CellStyle = styleLine12; + cell = row.CreateCell(5); + cell.SetCellValue("狀態"); + cell.CellStyle = styleLine12; + cell = row.CreateCell(6); + cell.SetCellValue("處理人員"); + cell.CellStyle = styleLine12; + cell = row.CreateCell(7); + cell.SetCellValue("預計施工時間"); + cell.CellStyle = styleLine12; + cell = row.CreateCell(8); + cell.SetCellValue("檔案上傳"); + cell.CellStyle = styleLine12; + cell = row.CreateCell(9); + cell.SetCellValue("完成時間"); + cell.CellStyle = styleLine12; + cell = row.CreateCell(10); + cell.SetCellValue("建立時間"); + cell.CellStyle = styleLine12; + var j = 0;//row + #endregion + foreach (var or in operation_record.Result) + { + RowPosition += 1; + row = sheet.CreateRow(RowPosition); + for (var i = 0; i < 10; i++)//column + { + cell = row.CreateCell(i); + if (i == 0) + { + cell.SetCellValue(or.work_type_name); + } + if (i == 1) + { + cell.SetCellValue(or.location); + } + if (i == 1) + { + cell.SetCellValue(or.error_code); + } + if (i == 3) + { + cell.SetCellValue(or.formId); + } + if (i == 4) + { + cell.SetCellValue(or.device_name); + } + if (i == 5) + { + cell.SetCellValue(or.status_name); + } + if (i == 6) + { + cell.SetCellValue(or.user_full_name); + } + if (i == 7) + { + cell.SetCellValue(or.start_time); + } + if (i == 8)//image + { + var image = or.lorf.FirstOrDefault().save_file_name; + var extName = "JPG"; //image.Split('.')[1]; + var fullPath = Path.Combine(operationFileSaveAsPath, "image1.jpg"); + var imageByte = System.IO.File.ReadAllBytes(fullPath); + int format = 0; + var drawing = sheet.CreateDrawingPatriarch(); + foreach (var v in Enum.GetNames(typeof(PictureType))) + { + if (v == extName) + format = Convert.ToInt32(Enum.Parse(typeof(PictureType), v)); + } + + if (format != 0) + { + var pictureIds = workbook.AddPicture(imageByte, format); + XSSFClientAnchor anchor = new XSSFClientAnchor(); + anchor.Col1 = i; + anchor.Row1 = j; + var picture = drawing.CreatePicture(anchor, pictureIds); + picture.Resize(); + } + } + if (i == 9) + { + cell.SetCellValue(or.finish_time); + } + if (i == 10) + { + cell.SetCellValue(or.Created_at); + } + + cell.CellStyle = style12; + j++; + } + } + } + } + + var ms = new NpoiMemoryStream + { + AllowClose = false + }; + workbook.Write(ms); + ms.Flush(); + ms.Seek(0, SeekOrigin.Begin); + + return File(ms, "application/vnd.ms-excel", "廠商資料.xlsx"); + } + + #region 廠商 + /// + /// 廠商資料列表(搜寻) / selection列表 ofl = null /// /// /// @@ -99,33 +593,41 @@ namespace FrontendWebApi.ApiControllers string sWhere = ""; try { - if (ofl.start_created_at != null || ofl.end_created_at != null) + if (ofl != null) { - sWhere += $@" and (of.created_at >= isnull(@start_created_at, of.created_at) AND of.created_at <= isnull(@end_created_at, of.created_at))"; - } - else if (ofl.today) - { - sWhere += $@" and convert(of.created_at, DATE) = convert(NOW(), DATE)"; - } - else if (ofl.yesterday) - { - sWhere += $@" and convert(of.created_at, DATE) = convert(ADDDATE(NOW(), -1), DATE)"; - } + if (ofl.start_created_at != null || ofl.end_created_at != null) + { + sWhere += $@" and (of.created_at >= isnull(@start_created_at, of.created_at) AND of.created_at <= isnull(@end_created_at, of.created_at))"; + } + else if (ofl.today) + { + sWhere += $@" and convert(of.created_at, DATE) = convert(NOW(), DATE)"; + } + else if (ofl.yesterday) + { + sWhere += $@" and convert(of.created_at, DATE) = convert(ADDDATE(NOW(), -1), DATE)"; + } - if (ofl.sub_system_tag != null || ofl.main_system_tag != null) - { - sWhere += $@" and (of.device_system_category_layer2 = isnull(@main_system_tag, device_system_category_layer2) AND of.device_system_category_layer3 = isnull(@sub_system_tag, device_system_category_layer3))"; - } + if (ofl.sub_system_tag != null || ofl.main_system_tag != null) + { + sWhere += $@" and (of.device_system_category_layer2 = isnull(@main_system_tag, device_system_category_layer2) AND of.device_system_category_layer3 = isnull(@sub_system_tag, device_system_category_layer3))"; + } - var sqlString = @$"select of.*, v2.system_key - from operation_firm of - left join variable v1 on of.device_system_category_layer2 = v1.system_value and v1.system_type = @main_system_type and v1.delted = 0 - left join variable v2 on v1.id = v2.system_parent_id and of.device_system_category_layer3 = v2.system_value and v2.system_type = @sub_system_type and v2.deleted = 0 - where of.deleted = 0" + sWhere; + var sqlString = @$"select of.*, v2.system_key + from operation_firm of + left join variable v1 on of.device_system_category_layer2 = v1.system_value and v1.system_type = @main_system_type and v1.delted = 0 + left join variable v2 on v1.id = v2.system_parent_id and of.device_system_category_layer3 = v2.system_value and v2.system_type = @sub_system_type and v2.deleted = 0 + where of.deleted = 0" + sWhere; - var param = new { @sub_system_type = sub_system_type, @start_created_at = ofl.start_created_at, @end_created_at = ofl.end_created_at, @today = ofl.today, @yesterday = ofl.yesterday, @sub_system_tag = ofl.sub_system_tag, @main_system_tag = ofl.main_system_tag }; - opList = await backendRepository.GetAllAsync(sqlString, param); + var param = new { @sub_system_type = sub_system_type, @start_created_at = ofl.start_created_at, @end_created_at = ofl.end_created_at, @sub_system_tag = ofl.sub_system_tag, @main_system_tag = ofl.main_system_tag }; + opList = await backendRepository.GetAllAsync(sqlString, param); + } + else + { + var sqlString = $@"select of.id, of.name from operation_firm where deleted = 0"; + opList = await backendRepository.GetAllAsync(sqlString); + } apiResult.Code = "0000"; apiResult.Data = opList; @@ -229,7 +731,6 @@ namespace FrontendWebApi.ApiControllers Dictionary operation_firm = new Dictionary() { - { "@deleted", of.deleted }, { "@device_system_category_layer2", of.device_system_category_layer2 }, { "@device_system_category_layer3", of.device_system_category_layer3 }, { "@name", of.name }, @@ -257,150 +758,291 @@ namespace FrontendWebApi.ApiControllers return apiResult; } + #endregion + #region 維修/保養 /// - /// 汇出excel + /// 維修/保養 列表(work_type) /// + /// /// - public FileResult ExportExcel() + public async Task>> OpeRecList(OperationFindList ofl) { - var workbook = new XSSFWorkbook(); - #region excel設定 - IFont font12 = workbook.CreateFont(); - font12.FontName = "新細明體"; - font12.FontHeightInPoints = 12; - ICellStyle style12 = workbook.CreateCellStyle(); - style12.SetFont(font12); - style12.Alignment = HorizontalAlignment.Center; - style12.VerticalAlignment = VerticalAlignment.Center; - IFont font12Times = workbook.CreateFont(); - font12Times.FontName = "Times New Roman"; - font12Times.FontHeightInPoints = 12; - IFont font18 = workbook.CreateFont(); - font18.FontName = "新細明體"; - font18.FontHeightInPoints = 18; - font18.IsBold = true; - ICellStyle styleTitle18 = workbook.CreateCellStyle(); - styleTitle18.SetFont(font18); - styleTitle18.Alignment = HorizontalAlignment.Center; - styleTitle18.VerticalAlignment = VerticalAlignment.Center; - ICellStyle styleLeft12 = workbook.CreateCellStyle(); - styleLeft12.SetFont(font12); - styleLeft12.Alignment = HorizontalAlignment.Left; - styleLeft12.VerticalAlignment = VerticalAlignment.Center; - ICellStyle styleLine12 = workbook.CreateCellStyle(); - styleLine12.SetFont(font12); - styleLine12.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center; - styleLine12.VerticalAlignment = VerticalAlignment.Center; - styleLine12.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin; - styleLine12.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin; - styleLine12.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin; - styleLine12.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin; - ICellStyle stylein12 = workbook.CreateCellStyle(); - stylein12.SetFont(font12Times); - stylein12.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Left; - stylein12.VerticalAlignment = VerticalAlignment.Center; - stylein12.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin; - stylein12.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin; - stylein12.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin; - stylein12.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin; - stylein12.WrapText = true; - #endregion - - var sqlString = $@"select of.*, v2.system_key - from operation_firm of - left join variable v1 on of.device_system_category_layer2 = v1.system_value and v1.system_type = @main_system_type and v1.delted = 0 - left join variable v2 on v1.id = v2.system_parent_id and of.device_system_category_layer3 = v2.system_value and v2.system_type = @sub_system_type and v2.deleted = 0 - where of.deleted = 0"; - var sheet = workbook.CreateSheet("廠商資料"); - var operation_firm = backendRepository.GetAllAsync(sqlString, null); - int RowPosition = 0; - IRow row = sheet.CreateRow(RowPosition); - sheet.SetColumnWidth(0, 4 * 160 * 12); - sheet.SetColumnWidth(1, 4 * 160 * 12); - sheet.SetColumnWidth(3, 4 * 160 * 12); - sheet.SetColumnWidth(4, 4 * 160 * 12); - sheet.SetColumnWidth(5, 4 * 160 * 12); - sheet.SetColumnWidth(6, 4 * 160 * 12); - sheet.SetColumnWidth(7, 4 * 160 * 12); - ICell cell = row.CreateCell(0); - cell.SetCellValue("廠商類別"); - cell.CellStyle = styleLine12; - cell = row.CreateCell(1); - cell.SetCellValue("廠商名稱"); - cell.CellStyle = styleLine12; - cell = row.CreateCell(2); - cell.SetCellValue("聯絡人"); - cell.CellStyle = styleLine12; - cell = row.CreateCell(3); - cell.SetCellValue("電話"); - cell.CellStyle = styleLine12; - cell = row.CreateCell(4); - cell.SetCellValue("郵箱"); - cell.CellStyle = styleLine12; - cell = row.CreateCell(5); - cell.SetCellValue("統一編號"); - cell.CellStyle = styleLine12; - cell = row.CreateCell(6); - cell.SetCellValue("備注"); - cell.CellStyle = styleLine12; - cell = row.CreateCell(2); - cell.SetCellValue("建立時間"); - cell.CellStyle = styleLine12; - - foreach (var of in operation_firm.Result) + ApiResult> apiResult = new ApiResult>(); + List orl = new List(); + string sWhere = ""; + try { - RowPosition += 1; - row = sheet.CreateRow(RowPosition); - for (var a = 0; a < 8; a++) + if (ofl.work_type != 1 || ofl.work_type != 2) { - cell = row.CreateCell(a); - if (a == 0) - { - cell.SetCellValue(of.system_key); - } - if (a == 1) - { - cell.SetCellValue(of.name); - } - if (a == 2) - { - cell.SetCellValue(of.contact_person); - } - if (a == 3) - { - cell.SetCellValue(of.phone); - } - if (a == 4) - { - cell.SetCellValue(of.email); - } - if (a == 5) - { - cell.SetCellValue(of.tax_id_number); - } - if (a == 2) - { - cell.SetCellValue(of.remark); - } - if (a == 7) - { - cell.SetCellValue(of.Created_at); - } - - cell.CellStyle = style12; + apiResult.Code = "0001"; + apiResult.Msg = "無此項目類別"; + return apiResult; } + + if (ofl.start_created_at != null || ofl.end_created_at != null) + { + sWhere += $@" and (opr.created_at >= isnull(@start_created_at, opr.created_at) AND opr.created_at <= isnull(@end_created_at, opr.created_at))"; + } + else if (ofl.today) + { + sWhere += $@" and convert(opr.created_at, DATE) = convert(NOW(), DATE)"; + } + else if (ofl.yesterday) + { + sWhere += $@" and convert(opr.created_at, DATE) = convert(ADDDATE(NOW(), -1), DATE)"; + } + + if (ofl.sub_system_tag != null || ofl.main_system_tag != null) + { + sWhere += $@" and (opr.device_system_category_layer2 = isnull(@main_system_tag, opr.device_system_category_layer2) AND opr.device_system_category_layer3 = isnull(@sub_system_tag, opr.device_system_category_layer3))"; + } + + if (ofl.serial_number != null) + { + sWhere += $@" and opr.formId like '%@formId%'"; + } + + var sqlString = $@"select opr.*, concat(d.device_floor_tag, ' ', d.device_last_name, ' ', d.device_serial_tag) as device_name, ui.full_name as user_full_name + from operation_record opr + left join device d on opr.fix_do_code = d.device_number + left join userinfo ui on opr.work_person_id = ui.id + where opr.deleted = 0 and opr.work_type = @work_type" + sWhere; + + var param = new { @work_type = ofl.work_type, @start_created_at = ofl.start_created_at, @end_created_at = ofl.end_created_at, @sub_system_tag = ofl.sub_system_tag, @main_system_tag = ofl.main_system_tag, @formId = ofl.serial_number }; + + orl = await backendRepository.GetAllAsync(sqlString, param); + + if (orl.Count > 0) + { + foreach(var or in orl) + { + sqlString = $@"select * from operation_record_file where record_id = @record_id and deleted = 0"; + var oParam = new { @record_id = or.id }; + var orfl = await backendRepository.GetAllAsync(sqlString, oParam); + or.lorf = orfl; + } + } + + apiResult.Code = "0000"; + apiResult.Data = orl; + } + catch (Exception exception) + { + apiResult.Code = "9999"; + apiResult.Msg = "系統內部錯誤,請聯絡管理者。"; + string json = System.Text.Json.JsonSerializer.Serialize(ofl); + Logger.LogError("【" + controllerName + "/" + actionName + "】" + json); + Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message); } - var ms = new NpoiMemoryStream - { - AllowClose = false - }; - workbook.Write(ms); - ms.Flush(); - ms.Seek(0, SeekOrigin.Begin); - - return File(ms, "application/vnd.ms-excel", "廠商資料.xlsx"); + return apiResult; } + + /// + /// 維修/保養---新增/編輯 + /// + /// + /// + public async Task> SavOpeRecord(Operation_Record or) + { + ApiResult apiResult = new ApiResult(); + + try + { + var sqlString = $@"select * from operation_record where id = @id"; + var param = new { @id = or.id }; + var ori = await backendRepository.GetOneAsync(sqlString, param); + + sqlString = $@"select formId from operation_record where convert(created_at, DATE) = convert(NOW(), DATE) order by id desc limit 1"; + var formId = await backendRepository.GetOneAsync(sqlString); + formId = formId != null ? "op" + DateTime.Now.ToString("yyyyMMdd") + (Int32.Parse(formId.Substring(10)) + 1) : "op" + DateTime.Now.ToString("yyyyMMdd") + "001"; + + if (ori == null) //create + { + var new_guid = new Guid(); + Dictionary operation_record = new Dictionary() + { + { "@deleted", 0}, + { "@formId", formId}, + { "@location", or.location}, + { "@location_code", or.location_code}, + { "@device_system_category_layer2", or.device_system_category_layer2}, + { "@device_system_category_layer3", or.device_system_category_layer3}, + { "@work_type", or.work_type}, + { "@error_code", or.work_type == 2 ? new_guid.ToString() : null}, + { "@fix_do_code", or.fix_do_code }, + { "@fix_firm", or.fix_firm}, + { "@status", or.status}, + { "@work_person_id", or.work_person_id}, + { "@start_time", or.start_time}, + { "@end_time", or.end_time}, + { "@work_time", or.work_time}, + { "@finish_time", or.finish_time}, + { "@notice", or.notice}, + { "@description", or.description}, + { "@created_by", myUser.userinfo_guid}, + { "@created_at", DateTime.Now} + }; + await backendRepository.AddOneByCustomTable(operation_record, "operation_record"); + + if (or.lorf.Count > 0) + { + foreach(var orf in or.lorf) + { + sqlString = $@"select id from operation_record where formId = @formId"; + var fParam = new { @formId = formId }; + var record_id = await backendRepository.GetOneAsync(sqlString, fParam); + Dictionary operation_record_file = new Dictionary() + { + { "@deleted", 0}, + { "@record_id", record_id}, + { "@ori_file_name", orf.ori_file_name}, + { "@save_file_name", orf.save_file_name}, + { "@created_by", myUser.userinfo_guid}, + { "@created_at", DateTime.Now} + }; + + if (!System.IO.Directory.Exists(operationFileSaveAsPath)) + System.IO.Directory.CreateDirectory(operationFileSaveAsPath); + + new_guid = new Guid(); + + var fileName = new_guid + "." + orf.ori_file_name.Split('.')[1]; + + var fullPath = Path.Combine(operationFileSaveAsPath, fileName); + + using (var stream = new FileStream(fullPath, FileMode.Create)) + { + orf.file.CopyTo(stream); + } + + await backendRepository.AddOneByCustomTable(operation_record_file, "operation_record_file"); + } + } + + apiResult.Data = "新增成功"; + } + else //edit + { + Dictionary operation_record = new Dictionary() + { + { "@location", or.location}, + { "@location_code", or.location_code}, + { "@device_system_category_layer2", or.device_system_category_layer2}, + { "@device_system_category_layer3", or.device_system_category_layer3}, + { "@fix_do_code", or.fix_do_code }, + { "@fix_firm", or.fix_firm}, + { "@status", or.status}, + { "@work_person_id", or.work_person_id}, + { "@start_time", or.start_time}, + { "@end_time", or.end_time}, + { "@work_time", or.work_time}, + { "@finish_time", or.finish_time}, + { "@notice", or.notice}, + { "@description", or.description}, + { "@updated_by", myUser.userinfo_guid}, + { "@updated_at", DateTime.Now} + }; + await backendRepository.UpdateOneByCustomTable(operation_record , "operation_record", "id = " + or.id + ""); + + if (or.lorf.Count > 0) + { + foreach(var orf in or.lorf) + { + if (orf.id == 0)//create + { + Dictionary operation_record_file = new Dictionary() + { + { "@deleted", 0}, + { "@formId", or.formId}, + { "@ori_file_name", orf.ori_file_name}, + { "@save_file_name", orf.save_file_name}, + { "@created_by", myUser.userinfo_guid}, + { "@created_at", DateTime.Now} + }; + + if (!System.IO.Directory.Exists(operationFileSaveAsPath)) + System.IO.Directory.CreateDirectory(operationFileSaveAsPath); + + var new_guid = new Guid(); + + var fileName = new_guid + "." + orf.ori_file_name.Split('.')[1]; + + var fullPath = Path.Combine(operationFileSaveAsPath, fileName); + + using (var stream = new FileStream(fullPath, FileMode.Create)) + { + orf.file.CopyTo(stream); + } + + await backendRepository.AddOneByCustomTable(operation_record_file, "operation_record_file"); + } + else//delete + { + Dictionary operation_record_file = new Dictionary() + { + { "@deleted", 1}, + }; + await backendRepository.UpdateOneByCustomTable(operation_record_file, "operation_record_file", "id = " + orf.id + ""); + } + } + } + + apiResult.Data = "修改成功"; + } + + apiResult.Code = "0000"; + } + catch (Exception exception) + { + apiResult.Code = "9999"; + apiResult.Msg = "系統內部錯誤,請聯絡管理者。"; + string json = System.Text.Json.JsonSerializer.Serialize(or); + Logger.LogError("【" + controllerName + "/" + actionName + "】" + json); + Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message); + } + + return apiResult; + } + + /// + /// 維修/保養---刪除 + /// + /// + /// + public async Task> DelOpeRecord(Operation_Record or) + { + ApiResult apiResult = new ApiResult(); + + try + { + var sqlString = $@"select formId from operation_record where id = @id"; + var param = new { @id = or.id }; + var formId = await backendRepository.GetOneAsync(sqlString, param); + + sqlString = @$"UPDATE operation_record_file SET deleted = 1 WHERE formId = @formId"; + var dParam = new { @formId = formId }; + await backendRepository.ExecuteSql(sqlString, dParam); + + sqlString = @$"UPDATE operation_record SET deleted = 1 WHERE id = @id"; + param = new { @id = or.id }; + await backendRepository.ExecuteSql(sqlString, param); + + apiResult.Code = "0000"; + apiResult.Data = "刪除成功"; + } + catch (Exception exception) + { + apiResult.Code = "9999"; + apiResult.Msg = "系統內部錯誤,請聯絡管理者。"; + string json = System.Text.Json.JsonSerializer.Serialize(or); + Logger.LogError("【" + controllerName + "/" + actionName + "】" + json); + Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message); + } + + return apiResult; + } + #endregion } } diff --git a/FrontendWebApi/ApiControllers/UserController.cs b/FrontendWebApi/ApiControllers/UserController.cs index a6756f6..3c42137 100644 --- a/FrontendWebApi/ApiControllers/UserController.cs +++ b/FrontendWebApi/ApiControllers/UserController.cs @@ -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> AddUser([FromBody]bool str) + public async Task> AddUser(bool str) { var a = User.Claims.Select(p => new { p.Type, p.Value }); ApiResult apiResult = new ApiResult(jwt_str); diff --git a/FrontendWebApi/Models/Operation.cs b/FrontendWebApi/Models/Operation.cs index df9c456..4f1c81a 100644 --- a/FrontendWebApi/Models/Operation.cs +++ b/FrontendWebApi/Models/Operation.cs @@ -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 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 name = new Dictionary() { - 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, "維修"}, + { 1 , "保養" }, + { 2 , "維修" } }; - - return pairs[WorkType]; + return name[work_type]; } - } //工作項目名稱 - public string StatusText + } + public string status_name { get { - Dictionary pairs = new Dictionary() + Dictionary name = new Dictionary() { { 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 HyperLinks { get; set; } - public string Function { get; set; } + } + public string device_name { get; } + public string user_full_name { get; } + public List lorf { 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 Operation_Record_File : Actor + { + 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; } - } - - /// - /// 針對運維作業記錄檔案 - /// - 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; } - } - } diff --git a/FrontendWebApi/wwwroot/upload/operation/image1.jpg b/FrontendWebApi/wwwroot/upload/operation/image1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c002f985ced70c6e4242e115b923ebe11c899072 GIT binary patch literal 7477 zcmeHLby!qiw>~q&z(@`uf(Q;Fk~(z5kb(jd0)lj>goK1Riqg_ClpsilfFcM=NrMOs zNQrcplqjIw1LDu;yYbik<9nX_+*V*!otoe z&4UIvX=4dR32-;ow$f75veHiQw6*n2D2@(|F7A8#w(oHN5NweDZ3l;q03`y7Apl?y z763{Kfl)#Zn}D-m1Te@^EdMkJi~tHJJRAWKzs-B4|3Lq}05_)auO$=QdvQ6U!fHJ9 z-LTz`BcXWzIE}-!@G9o759!kj#_NH5{#~jJB6n-(-#K3%+!E5MiR6Bvn=Ual-{vbV zQvR0>v`%fT`t79a^iKKSms<7i{S^MCE_y|0%S2n6sY`l1y|r-K=ZoIUX5(muJF73Pwh#RGI&*B(Y9zyQdp@+Lmsc;YTao`n|0TmhV#F0vz0U2P`xX+y+?<+o zcjYhm|I+`>3_zn!;yUvuz8uLh5A8*Zxe<}M$_sl+>O!-_LBr*c1TnvtKeXcI{*;9=YMB+8SnXi3a=efv+&HbuujN>Z4U z4v(jMlfXM!V8e#dv7jb@ZRn}!a>N=SmGQ3(Q$3xErP=~twRqc{Lhkafu#pq|C_AJ( z*emh1U~@C_eEznZ6PluK&ghiNm==b}~+&e}*a)1%P|DC)Sg2_^@2v z0C3*m#Cn|fWgy&?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