From cd57e8c3d7fe79fcee7c5f53d141bd9f0b3fa415 Mon Sep 17 00:00:00 2001 From: Yiru Date: Sun, 17 Sep 2023 20:35:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8B=99=E6=80=A7IPQC=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/SPCController.cs | 192 +++++++++ AMESCoreStudio.Web/HttpApis/AMES/ISPC.cs | 38 ++ AMESCoreStudio.Web/Views/SPC/SPC006.cshtml | 254 ++++++++++++ AMESCoreStudio.Web/Views/SPC/SPC006C.cshtml | 208 ++++++++++ AMESCoreStudio.Web/Views/SPC/SPC006R.cshtml | 130 ++++++ AMESCoreStudio.Web/Views/SPC/SPC006U.cshtml | 93 +++++ .../AMES/IPQCTaskNoticeController.cs | 369 ++++++++++++++++++ .../Models/AMES/IPQCTaskNotice.cs | 164 ++++++++ AMESCoreStudio.WebApi/Models/AMESContext.cs | 5 + 9 files changed, 1453 insertions(+) create mode 100644 AMESCoreStudio.Web/Views/SPC/SPC006.cshtml create mode 100644 AMESCoreStudio.Web/Views/SPC/SPC006C.cshtml create mode 100644 AMESCoreStudio.Web/Views/SPC/SPC006R.cshtml create mode 100644 AMESCoreStudio.Web/Views/SPC/SPC006U.cshtml create mode 100644 AMESCoreStudio.WebApi/Controllers/AMES/IPQCTaskNoticeController.cs create mode 100644 AMESCoreStudio.WebApi/Models/AMES/IPQCTaskNotice.cs diff --git a/AMESCoreStudio.Web/Controllers/SPCController.cs b/AMESCoreStudio.Web/Controllers/SPCController.cs index e2e6c6dd..bc28832f 100644 --- a/AMESCoreStudio.Web/Controllers/SPCController.cs +++ b/AMESCoreStudio.Web/Controllers/SPCController.cs @@ -1415,6 +1415,198 @@ namespace AMESCoreStudio.Web.Controllers } #endregion + + + #region SPC006任務性IPQC提示 + + public async Task SPC006() + { + return View(); + } + + public async Task SPC006QueryAsync(string wipNo, string itemNo, int page = 0, int limit = 10) + { + IResultModel result = await _spcApi.GetIPQCTaskNoticesByQuery(wipNo: wipNo , itemNo: itemNo, page: page, limit: limit); + + if (result.Data != null) + { + return Json(new Table() { code = 0, msg = "", data = result.Data, count = result.DataTotal }); + } + return Json(new Table() { count = 0, data = null }); + } + //新增頁面 + public async Task SPC006C() + { + var tt = Request.Cookies["UserID"]; + ViewBag.UserID = tt; + return View(); + } + [HttpPost] + public async Task SPC006CSaveAsync(IPQCTaskNotice model) + { + if (ModelState.IsValid) + { + IResultModel result; + + result = await _spcApi.PostIPQCTaskNotice(JsonConvert.SerializeObject(model)); + + if (result.Success) + { + var _msg = "添加成功!"; + return RedirectToAction("Refresh", "Home", new { msg = _msg }); + } + else + { + if (result.Errors.Count > 0) + { + ModelState.AddModelError(result.Errors[0].Id, result.Errors[0].Msg); + } + else + { + ModelState.AddModelError("error", result.Msg); + } + } + } + return View("SPC006C", model); + } + //修改页面 + [HttpGet] + public async Task SPC006UAsync(int id) + { + var tt = Request.Cookies["UserID"]; + ViewBag.UserID = tt; + + + var result = await _spcApi.GetIPQCTaskNotice(id); + + if (result.Count == 0) + { + return View(); + } + string WipNO = result.Select(s => s.WipNo).FirstOrDefault(); + if (!string.IsNullOrWhiteSpace(WipNO)) + { + var result1 = await _pcsApi.GetWipInfoByWipNO(WipNO); + //站別 + var Wipinfo = await _basApi.GetRuleStationsByFlow(result1.Select(s=>s.FlowRuleID).FirstOrDefault(), 0, 20); + var StationItems = new List(); + + foreach (var item in Wipinfo) + { + StationItems.Add(new SelectListItem(item.StationDesc, item.StationID.ToString())); + } + ViewBag.StationList = StationItems; + } + return View(result[0]); + } + public async Task SPC006USaveAsync(IPQCTaskNotice model) + { + if (ModelState.IsValid) + { + IResultModel result; + + result = await _spcApi.PutIPQCTaskNotice(model.IPQCTaskNoticeID, JsonConvert.SerializeObject(model)); + + if (result.Success) + { + var _msg = "修改成功!"; + return RedirectToAction("Refresh", "Home", new { msg = _msg }); + } + else + { + var tt = Request.Cookies["UserID"]; + ViewBag.UserID = tt; + + //站別 + await GetStationList(); + + ModelState.AddModelError("error", result.Msg); + + } + } + return View("SPC006U", model); + + } + //修改页面 + [HttpGet] + public async Task SPC006RAsync(int id) + { + var tt = Request.Cookies["UserID"]; + ViewBag.UserID = tt; + //站別 + await GetStationList(); + + var result = await _spcApi.GetIPQCTaskNotice(id); + + if (result.Count == 0) + { + return View(); + } + return View(result[0]); + } + public async Task SPC006RSaveAsync(IPQCTaskNotice model) + { + if (ModelState.IsValid) + { + IResultModel result; + + result = await _spcApi.PutIPQCTaskNotice(model.IPQCTaskNoticeID, JsonConvert.SerializeObject(model)); + + if (result.Success) + { + var _msg = "修改成功!"; + return RedirectToAction("Refresh", "Home", new { msg = _msg }); + } + else + { + var tt = Request.Cookies["UserID"]; + ViewBag.UserID = tt; + + ModelState.AddModelError("error", result.Msg); + + } + } + return View("SPC006R", model); + + } + + public async Task SPC006DAsync(int id) + { + var result = await _spcApi.DeleteIPQCTaskNotices(id); + return Json(new Result() { success = result.Success, msg = result.Msg }); + } + + [ResponseCache(Duration = 0)] + [HttpGet] + public async Task GetWipInfoByWipNOAsync(string id) + { + var result = await _pcsApi.GetWipInfoByWipNO(id); + + if (result != null) + { + return Json(new Table() { code = 0, msg = "", data = result.FirstOrDefault(), count = 1 }); + } + + return Json(new Table() { count = 0, data = null }); + + + } + + [ResponseCache(Duration = 0)] + [HttpGet] + public async Task GetStationsesbyFlowAsync(int id) + { + var result = await _basApi.GetRuleStationsByFlow(id, 0, 10); + + if (result.Count > 0) + { + return Json(new Table() { code = 0, msg = "", data = result, count = result.Count }); + } + + return Json(new Table() { count = 0, data = null }); + } + + #endregion } diff --git a/AMESCoreStudio.Web/HttpApis/AMES/ISPC.cs b/AMESCoreStudio.Web/HttpApis/AMES/ISPC.cs index f5e5c96f..0c643b30 100644 --- a/AMESCoreStudio.Web/HttpApis/AMES/ISPC.cs +++ b/AMESCoreStudio.Web/HttpApis/AMES/ISPC.cs @@ -274,6 +274,44 @@ namespace AMESCoreStudio.Web ITask> GetIpqcQuery(int InspectionID); + + /// + /// 任務性IPCQ提示查詢 + /// + /// + [WebApiClient.Attributes.HttpGet("api/IPQCTaskNotice/ByQuery/")] + ITask> GetIPQCTaskNoticesByQuery(string wipNo,string itemNo, int page = 0, int limit = 10); + + + + /// + /// 停用啟用任務性IPCQ提示 + /// + /// + [WebApiClient.Attributes.HttpDelete("api/IPQCTaskNotice/{id}")] + ITask> DeleteIPQCTaskNotices(int id); + + /// + /// 根據ID獲取指定異常工時查詢資料 + /// + /// + [WebApiClient.Attributes.HttpGet("api/IPQCTaskNotice/{id}")] + ITask> GetIPQCTaskNotice(int id); + + /// + /// 新增任務性IPCQ提示 + /// + /// + [WebApiClient.Attributes.HttpPost("api/IPQCTaskNotice")] + ITask> PostIPQCTaskNotice([FromBody, RawJsonContent] string model); + + /// + /// 更新任務性IPCQ提示 + /// + /// + [WebApiClient.Attributes.HttpPut("api/IPQCTaskNotice/{id}")] + ITask> PutIPQCTaskNotice(int id, [FromBody, RawJsonContent] string model); + #endregion diff --git a/AMESCoreStudio.Web/Views/SPC/SPC006.cshtml b/AMESCoreStudio.Web/Views/SPC/SPC006.cshtml new file mode 100644 index 00000000..be7ac258 --- /dev/null +++ b/AMESCoreStudio.Web/Views/SPC/SPC006.cshtml @@ -0,0 +1,254 @@ +@{ + ViewData["Title"] = "任務性IPQC提示"; + Layout = "~/Views/Shared/_AMESLayout.cshtml"; +} + + + + +
+
+
+
+
@ViewBag.Title
+
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +@section Scripts{ + +} diff --git a/AMESCoreStudio.Web/Views/SPC/SPC006C.cshtml b/AMESCoreStudio.Web/Views/SPC/SPC006C.cshtml new file mode 100644 index 00000000..fd4c2383 --- /dev/null +++ b/AMESCoreStudio.Web/Views/SPC/SPC006C.cshtml @@ -0,0 +1,208 @@ +@model AMESCoreStudio.WebApi.Models.AMES.IPQCTaskNotice + + +@{ ViewData["Title"] = "SPC006C"; + Layout = "~/Views/Shared/_FormLayout.cshtml"; } + +
+
+
+
+ + + + + + + + + + + +
+ + + +
+
+ + + +
+
+ + + +
+ + +
+ + + +
+ @Html.ValidationMessage("error") +
+ +
+
+
+
+ +@section Scripts { + @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); + await Html.RenderPartialAsync("_FileinputScriptsPartial"); } + + + + +} + diff --git a/AMESCoreStudio.Web/Views/SPC/SPC006R.cshtml b/AMESCoreStudio.Web/Views/SPC/SPC006R.cshtml new file mode 100644 index 00000000..96873038 --- /dev/null +++ b/AMESCoreStudio.Web/Views/SPC/SPC006R.cshtml @@ -0,0 +1,130 @@ +@model AMESCoreStudio.WebApi.Models.AMES.IPQCTaskNotice + + +@{ ViewData["Title"] = "SPC006U"; + Layout = "~/Views/Shared/_FormLayout.cshtml"; } + +
+
+
+
+ + + + + + + + + + +
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+ @Html.ValidationMessage("error") + +
+ +
+
+
+
+ +@section Scripts { + @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); + await Html.RenderPartialAsync("_FileinputScriptsPartial"); } + + + + +} + diff --git a/AMESCoreStudio.Web/Views/SPC/SPC006U.cshtml b/AMESCoreStudio.Web/Views/SPC/SPC006U.cshtml new file mode 100644 index 00000000..ec9167ef --- /dev/null +++ b/AMESCoreStudio.Web/Views/SPC/SPC006U.cshtml @@ -0,0 +1,93 @@ +@model AMESCoreStudio.WebApi.Models.AMES.IPQCTaskNotice + + +@{ ViewData["Title"] = "SPC006U"; + Layout = "~/Views/Shared/_FormLayout.cshtml"; } + +
+
+
+
+ + + + + + + + + + +
+ + + +
+
+ + + +
+
+ + + +
+ +
+ + + +
+ @Html.ValidationMessage("error") +
+ +
+
+
+
+ +@section Scripts { + @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); + await Html.RenderPartialAsync("_FileinputScriptsPartial"); } + + + + +} + diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/IPQCTaskNoticeController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/IPQCTaskNoticeController.cs new file mode 100644 index 00000000..e7b40d09 --- /dev/null +++ b/AMESCoreStudio.WebApi/Controllers/AMES/IPQCTaskNoticeController.cs @@ -0,0 +1,369 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using AMESCoreStudio.WebApi; +using AMESCoreStudio.WebApi.Models.AMES; +using AMESCoreStudio.CommonTools.Result; +using AMESCoreStudio.WebApi.Controllers.BLL; +using Microsoft.Extensions.Configuration; +using System.Net; +using System.Net.Mail; + +namespace AMESCoreStudio.WebApi.Controllers.AMES +{ + /// + /// 任務性IPQC表單维护 + /// + [Route("api/[controller]")] + [ApiController] + public class IPQCTaskNoticeController : ControllerBase + { + private readonly AMESContext _context; + private readonly IConfiguration _config; + + /// + /// + /// + /// + public IPQCTaskNoticeController(AMESContext context, IConfiguration config) + { + _config = _config = new ConfigurationBuilder().SetBasePath(Environment.CurrentDirectory).AddJsonFile("appsettings.json").Build(); + _context = context; + } + /// + /// + /// + /// + + + /// + /// 获取全部任務性IPQC表單 + /// + /// + // GET: api/IPQCTaskNotices + [HttpGet] + public async Task>> GetIPQCTaskNotices() + { + IQueryable q = _context.IPQCTaskNotices; + q = q.OrderBy(p => p.IPQCTaskNoticeID); + var IPQCTaskNotices = await q.ToListAsync(); + + if (IPQCTaskNotices == null) + { + return NotFound(); + } + + return IPQCTaskNotices; + } + + /// + /// 用ID获取该任務性IPQC表單 + /// + /// + /// + // GET: api/IPQCTaskNotices/5 + [HttpGet("{id}")] + public async Task>> GetIPQCTaskNotice(int id) + { + + IQueryable q = _context.IPQCTaskNotices; + q = q.Where(p => p.IPQCTaskNoticeID.Equals(id)); + var IPQCTaskNotice = await q.ToListAsync(); + + if (IPQCTaskNotice == null) + { + return NotFound(); + } + + return IPQCTaskNotice; + } + + /// + /// 获取该任務性IPQC表單By Query + /// + /// 工單號碼 + /// 料號 + /// + // GET: api/IPQCTaskNotices/Query/5 + [HttpGet("ByQuery")] + public async Task> GetIPQCTaskNoticesByQuery(string WipNo, string ItemNO ,int page = 0, int limit = 10) + { + ResultModel result = new ResultModel(); + + + + var q = from q1 in _context.IPQCTaskNotices + join q2 in _context.UserInfoes on q1.CreateUserID equals q2.UserID + join q3 in _context.UserInfoes on q1.CheckUserID equals q3.UserID into checkUsers + from q3 in checkUsers.DefaultIfEmpty() + join q4 in _context.Stationses on q1.StationID equals q4.StationID into Station + from q4 in Station.DefaultIfEmpty() + where q1.CreateUserID == q2.UserID + select new IPQCTaskNotice + { + IPQCTaskNoticeID= q1.IPQCTaskNoticeID, + WipNo = q1.WipNo, + ItemNo = q1.ItemNo, + StationID = q1.StationID, + NoticeContent = q1.NoticeContent, + CheckContent = q1.CheckContent, + CreateUserID = q1.CreateUserID, + CreateDate = q1.CreateDate, + CheckUserID = q1.CheckUserID, + CheckDate = q1.CheckDate, + UpdateUserID = q1.UpdateUserID, + UpdateDate = q1.UpdateDate, + StatusNo = q1.StatusNo, + UnitNo = q1.UnitNo, + CreateUserName = q2.UserName, + CheckUserName = q3.UserName, + StationName = q4.StationName + }; + + + if (!string.IsNullOrWhiteSpace(WipNo)) + { + q = q.Where(p => p.WipNo.Equals(WipNo)); + } + + if (!string.IsNullOrWhiteSpace(ItemNO)) + { + q = q.Where(p => p.ItemNo.Equals(ItemNO)); + } + + var IPQCTaskNotice = await q.ToListAsync(); + + + //紀錄筆數 + result.DataTotal = q.Count(); + + //Table 頁數 + if (page > 0) + { + q = q.Skip((page - 1) * limit).Take(limit); + } + + result.Data = await q.ToListAsync(); + + if (result == null) + { + result.Msg = "查無資料"; + result.Success = false; + return result; + } + + result.Success = true; + result.Msg = "OK"; + return result; + } + + /// + /// IPQC任務性Mail通知 + /// + /// 工單號碼 + /// 料號 + /// 站別ID + /// + // GET: api/IPQCTaskNotices/Query/5 + [HttpGet("CheckIPQCTaskNotice")] + public async Task> CheckIPQCTaskNotice(string WipNo, string ItemNO, int StationID ) + { + ResultModel result = new ResultModel(); + + var q = new List(); + if (!string.IsNullOrWhiteSpace(ItemNO)) + { + result.Msg = "料號不可為空白"; + result.Success = false; + return result; + } + q = _context.IPQCTaskNotices.Where(w=>w.ItemNo == ItemNO && w.StatusNo == "Y").ToList(); + q = q.Where(w => w.CheckContent == null && w.CheckUserID == -1).ToList(); + if (!string.IsNullOrWhiteSpace(WipNo)) + { + if (StationID > 0) + { + q = q.Where(w => w.WipNo == WipNo && w.StationID == StationID).ToList(); + } + else + { + result.Msg = "站別不可為空白"; + result.Success = false; + return result; + } + } + + foreach (var item in q) + { + string PlanQty = string.Empty; + if (!string.IsNullOrWhiteSpace(item.WipNo)) + { + var Wipinfo = _context.WipInfos.Where(w => w.WipNO == item.WipNo).FirstOrDefault(); + PlanQty = Wipinfo.PlanQTY.ToString(); + } + string MailGroup = "IPQC_TASK"; + string Subject = $"[AMES系統通知] ,任務性IPQC預警提前通知"; + string Body = @$"工單號碼 :{WipNo} | 料號 : {ItemNO} | 計畫產量 {PlanQty},目前已投產至監控站
+ 提示站別: {item.StationName}
+ 提示內容:{ item.CheckContent}
+ 請人員前去確認相關議題"; + + + await new MailController(_context, _config).PostMail(Subject, Body, MailGroup, "", false); + + //MailMessage mesMail = new MailMessage(); + //string mailFrom = _config["MailFrom"].ToString(); + //string mailSmtpServer = _config["MailSmtpServer"].ToString(); + //int mailSmtpPort = int.Parse(_config["MailSmtpPort"].ToString()); + //string mailUser = _config["MailUser"].ToString(); + //string mailPassword = _config["MailUserPassword"].ToString(); + //mesMail.From = new MailAddress(mailFrom); + //mesMail.Subject = Subject; + //mesMail.SubjectEncoding = System.Text.Encoding.UTF8; + //mesMail.Body = Body; + //mesMail.IsBodyHtml = true; + //mesMail.BodyEncoding = System.Text.Encoding.UTF8; + + //SmtpClient mailClient = new SmtpClient(mailSmtpServer, mailSmtpPort); + + ////mailClient.EnableSsl = true; + //NetworkCredential nc = new NetworkCredential(); + //nc.UserName = mailUser; + //nc.Password = mailPassword; + //mailClient.Credentials = nc; + + //mailClient.Send(mesMail); + + } + + + result.Success = true; + result.Msg = "OK"; + return result; + } + + + /// + /// 更新任務性IPQC表單资料 + /// + /// + /// + /// + [HttpPut("{id}")] + public async Task> PutIPQCTaskNotice(int id, [FromBody] IPQCTaskNotice IPQCTaskNotice) + { + ResultModel result = new ResultModel(); + if (id != IPQCTaskNotice.IPQCTaskNoticeID) + { + result.Success = false; + result.Msg = "號碼錯誤"; + return result; + } + + _context.Entry(IPQCTaskNotice).State = EntityState.Modified; + + try + { + await _context.SaveChangesAsync(); + } + catch (Exception e) + { + result.Success = false; + result.Msg = e.Message; + return result; + } + + result.Success = true; + result.Msg = "OK"; + return result; + } + + /// + /// 新增任務性IPQC表單资料 + /// + /// + /// + [HttpPost] + public async Task> PostIPQCTaskNotice(IPQCTaskNotice IPQCTaskNotice) + { + ResultModel result = new ResultModel(); + Helper helper = new Helper(_context); + var IPQCTaskNoticeID = helper.GetIDKey("IPQCTaskNoticeID").Result; + + IPQCTaskNotice.IPQCTaskNoticeID = IPQCTaskNoticeID; + _context.IPQCTaskNotices.Add(IPQCTaskNotice); + try + { + await _context.SaveChangesAsync(); + } + catch (Exception e) + { + result.Success = false; + result.Msg = e.Message; + return result; + } + + result.Success = true; + result.Msg = "OK"; + return result; + + } + + /// + /// 删除任務性IPQC表單资料 + /// + /// + /// + // DELETE: api/IPQCTaskNotices/5 + [HttpDelete("{id}")] + public async Task> DeleteIPQCTaskNotice(int id) + { + ResultModel result = new ResultModel(); + var IPQCTaskNotice = await _context.IPQCTaskNotices.Where(m => m.IPQCTaskNoticeID == id).FirstOrDefaultAsync(); + if (IPQCTaskNotice == null) + { + result.Success = false; + result.Msg = "ID不存在"; + return result; + } + + + IPQCTaskNotice newIPQCTaskNotice = new IPQCTaskNotice(); + newIPQCTaskNotice = IPQCTaskNotice; + + if (IPQCTaskNotice.StatusNo == "Y") + { + newIPQCTaskNotice.StatusNo = "N"; + } + else + { + newIPQCTaskNotice.StatusNo = "Y"; + } + _context.Entry(newIPQCTaskNotice).State = EntityState.Modified; + try + { + await _context.SaveChangesAsync(); + } + catch (Exception e) + { + result.Success = false; + result.Msg = e.Message; + return result; + } + + result.Success = true; + result.Msg = "OK"; + return result; + } + + private bool IPQCTaskNoticesExists(int id) + { + return _context.IPQCTaskNotices.Any(e => e.IPQCTaskNoticeID == id); + } + + } +} diff --git a/AMESCoreStudio.WebApi/Models/AMES/IPQCTaskNotice.cs b/AMESCoreStudio.WebApi/Models/AMES/IPQCTaskNotice.cs new file mode 100644 index 00000000..d6dac858 --- /dev/null +++ b/AMESCoreStudio.WebApi/Models/AMES/IPQCTaskNotice.cs @@ -0,0 +1,164 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; + +namespace AMESCoreStudio.WebApi.Models.AMES +{ + /// + /// 條碼變更資料表 + /// + [Table("IPQC_TASK_NOTICE", Schema = "JHAMES")] + [DataContract] + public class IPQCTaskNotice + { + /// + /// 任務性IPQC ID + /// + [Column("IPQC_TASK_NOTICE_ID")] + [DataMember] + [Display(Name = "IPQC_TASK_NOTICE_ID")] + [Key] + + public int IPQCTaskNoticeID { get; set; } + + /// + /// 工單號碼 + /// + [Column("WIP_NO")] + [DataMember] + [Display(Name = "工單號碼")] + + public string WipNo { get; set; } + + /// + /// 料號 + /// + [Column("ITEM_NO")] + [DataMember] + [Required(ErrorMessage = "{0},不能空白")] + [Display(Name = "料號")] + public string ItemNo { get; set; } + + /// + /// 站別ID + /// + [Column("STATION_ID")] + [DataMember] + [Required(ErrorMessage = "{0},不能空白")] + [Display(Name = "站別ID")] + public int StationID { get; set; } + + /// + /// 提醒說明 + /// + [Column("NOTICE_CONTENT")] + [DataMember] + [Display(Name = "提醒說明")] + [Required(ErrorMessage = "{0},不能空白")] + public string NoticeContent { get; set; } + + /// + /// 建立者 + /// + [Column("CREATE_USERID")] + [DataMember] + [Required(ErrorMessage = "{0},不能空白")] + [Display(Name = "建立者")] + public int CreateUserID { get; set; } = 0; + + /// + /// 建立時間 + /// + [Column("CREATE_DATE")] + [DataMember] + [Required(ErrorMessage = "{0},不能空白")] + [Display(Name = "建立時間")] + public DateTime CreateDate { get; set; } = DateTime.Now; + + /// + /// 更新者 + /// + [Column("UPDATE_USERID")] + [DataMember] + [Required(ErrorMessage = "{0},不能空白")] + [Display(Name = "更新者")] + public int UpdateUserID { get; set; } = 0; + + /// + /// 更新時間 + /// + [Column("UPDATE_DATE")] + [DataMember] + [Display(Name = "更新時間")] + public DateTime UpdateDate { get; set; } = DateTime.Now; + + + + /// + /// 確認者 + /// + [Column("CHECK_USERID")] + [DataMember] + [Required(ErrorMessage = "{0},不能空白")] + [Display(Name = "確認者")] + public int CheckUserID { get; set; } = 0; + + /// + /// 確認時間 + /// + [Column("CHECK_DATE")] + [DataMember] + [Display(Name = "確認時間")] + public DateTime CheckDate { get; set; } = DateTime.Now; + + + /// + /// 確認說明 + /// + [Column("CHECK_CONTENT")] + [DataMember] + [Display(Name = "確認說明")] + public string CheckContent { get; set; } + + /// + /// 狀態 Y:啟用 N:停用 + /// + [Column("STATUS_NO")] + [DataMember] + [Display(Name = "狀態")] + [Required(ErrorMessage = "{0},不能空白")] + public string StatusNo { get; set; } + + /// + /// 生產單位 + /// + [Column("UNIT_NO")] + [DataMember] + [Display(Name = "生產單位")] + public string UnitNo { get; set; } + + + /// + /// 建立者Name + /// + [NotMapped] + [DataMember] + public string CreateUserName { get; set; } + + + /// + /// 確認者Name + /// + [NotMapped] + [DataMember] + public string CheckUserName { get; set; } + + /// + /// 站別 + /// + [NotMapped] + [DataMember] + public string StationName { get; set; } + } +} diff --git a/AMESCoreStudio.WebApi/Models/AMESContext.cs b/AMESCoreStudio.WebApi/Models/AMESContext.cs index b5b048a0..a9bc0b8e 100644 --- a/AMESCoreStudio.WebApi/Models/AMESContext.cs +++ b/AMESCoreStudio.WebApi/Models/AMESContext.cs @@ -956,6 +956,11 @@ namespace AMESCoreStudio.WebApi /// 安勤轉拋 /// public virtual DbSet CSfisKeyparts { get; set; } + + /// + /// 任務性IPQC提示 + /// + public virtual DbSet IPQCTaskNotices { get; set; } } }