From b2f55cf3d52fb660fd0f741279d49a9dbbdcf837 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 27 Oct 2021 10:54:08 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E6=96=B0=E5=A2=9E=E5=B7=A5=E5=96=AE?= =?UTF-8?q?=E6=9F=A5=E8=A9=A2=20-=20=E6=AA=A2=E8=A6=96=202.=20=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3Web=20localhost:8081?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/PCSController.cs | 65 +- AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs | 34 +- .../Properties/launchSettings.json | 2 +- .../ViewModels/PCS/PCS001RViewModel.cs | 21 + AMESCoreStudio.Web/Views/PCS/PCS001.cshtml | 78 +- AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml | 880 ++++++++++++++++++ AMESCoreStudio.Web/Views/PCS/PCS004.cshtml | 18 +- AMESCoreStudio.Web/Views/PCS/PCS005.cshtml | 58 +- .../Controllers/AMES/WipAttsController.cs | 23 +- .../Controllers/AMES/WipBarcodeController.cs | 45 +- .../Controllers/AMES/WipInfosController.cs | 61 +- AMESCoreStudio.WebApi/Models/AMES/WipAtt.cs | 2 +- .../Models/AMES/WipBarcode.cs | 8 +- AMESCoreStudio.WebApi/Models/AMES/WipInfo.cs | 10 +- AMESCoreStudio.WebApi/Models/AMESContext.cs | 1 + AMESCoreStudio.WebApi/Startup.cs | 2 +- 16 files changed, 1187 insertions(+), 121 deletions(-) create mode 100644 AMESCoreStudio.Web/ViewModels/PCS/PCS001RViewModel.cs create mode 100644 AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs index 8ca0eae0..d17b0b2f 100644 --- a/AMESCoreStudio.Web/Controllers/PCSController.cs +++ b/AMESCoreStudio.Web/Controllers/PCSController.cs @@ -8,6 +8,7 @@ using System.Collections.Generic; using Microsoft.AspNetCore.Mvc.Rendering; using AMESCoreStudio.WebApi.Models.AMES; using AMESCoreStudio.Web.ViewModels; +using AMESCoreStudio.Web.ViewModels.PCS; using System.Linq; namespace AMESCoreStudio.Web.Controllers @@ -556,6 +557,7 @@ namespace AMESCoreStudio.Web.Controllers GetCustomerType(); GetPCSList1(); GetPCSOPList(); + //var result = new WipAllViewModel(); //return View(result); return View(); @@ -566,14 +568,14 @@ namespace AMESCoreStudio.Web.Controllers public async Task PCS001SaveAsync(WipAllViewModel model) { IResultModel result; + // Checkbox轉換 + model.WipInfo.ECNCheck = model.WipInfo.ECNCheck == "true" ? "Y" : "N"; + model.WipInfo.ModelCheck = model.WipInfo.ModelCheck == "true" ? "Y" : "N"; + model.WipInfo.InputFlag = model.WipInfo.InputFlag == "true" ? "Y" : "N"; + model.WipInfo.Priority = model.WipInfo.Priority == "true" ? "Y" : "N"; + if (model.WipInfo.WipID == 0) { - // Checkbox轉換 - model.WipInfo.ECNCheck = model.WipInfo.ECNCheck == "true" ? "Y" : "N"; - model.WipInfo.ModelCheck = model.WipInfo.ModelCheck == "true" ? "Y" : "N"; - model.WipInfo.InputFlag = model.WipInfo.InputFlag == "true" ? "Y" : "N"; - model.WipInfo.Priority = model.WipInfo.Priority == "true" ? "Y" : "N"; - result = await _pcsApi.PostWipInfo(JsonConvert.SerializeObject(model.WipInfo)); model.WipAtt.WipNO = model.WipInfo.WipNO; result = await _pcsApi.PostWipAtt(JsonConvert.SerializeObject(model.WipAtt)); @@ -614,6 +616,43 @@ namespace AMESCoreStudio.Web.Controllers return View("PCS001", model); } + public async Task PCS001R(string id) + { + await GetProductType(); + await GetFactoryInfo(); + await GetFactoryUnit(); + await GetLineInfo(); + await GetMFGType(); + await GetProcessTypes(); + GetSMDType(); + GetDIPType(); + GetWipSEQType(); + GetBurnType(); + GetPartsBakeType(); + GetPCBBakeType(); + GetPCBWorkingType(); + GetSolderPaste(); + GetWipType(); + GetCustomerType(); + GetPCSList1(); + GetPCSOPList(); + PCS001RViewModel model = new PCS001RViewModel(); + var q = await _pcsApi.GetWipInfo(decimal.Parse(id)); + if (q.Count != 0) + { + model.WipInfo = q.FirstOrDefault(); + model.WipAtt = await _pcsApi.GetWipAtt(model.WipInfo.WipNO); + model.WipBarcode = await _pcsApi.GetWipBarcode(model.WipInfo.WipNO); + model.RuleStation = await _basApi.GetRuleStationsByFlow(model.WipInfo.FlowRuleID); + model.RuleStation = model.RuleStation.OrderBy(o => o.Sequence); + } + if (model.WipInfo != null) + { + + } + return View(model); + } + #endregion #region PCS004 工單條碼區間設定 @@ -708,5 +747,19 @@ namespace AMESCoreStudio.Web.Controllers return View("PCS010", model); } #endregion + + [HttpPost] + public JsonResult TestFunc(string number) + { + string hashNumber = number; + string name = ""; + + if (number == "A12345") + { + name = "Annie"; + }; + + return Json(name); + } } } diff --git a/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs b/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs index 360d5ad0..075c94b3 100644 --- a/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs +++ b/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs @@ -9,7 +9,7 @@ using AMESCoreStudio.WebApi.Models.BAS; namespace AMESCoreStudio.Web { [JsonReturn] - public interface IPCS:IHttpApi + public interface IPCS : IHttpApi { #region 下拉選單 /// @@ -56,6 +56,7 @@ namespace AMESCoreStudio.Web #endregion + #region WipInfo 工單基本資料 PCS001 /// /// 新增工單基本資料 /// @@ -71,19 +72,38 @@ namespace AMESCoreStudio.Web ITask> GetWipInfo(); /// - /// 根据角色ID獲取角色模组資料 + /// 查詢工單基本資料-WipID + /// + /// + [WebApiClient.Attributes.HttpGet("api/WipInfos/{id}")] + ITask> GetWipInfo(decimal id); + + /// + /// 查詢工單基本資料 /// /// [WebApiClient.Attributes.HttpGet("api/WipInfos/{id}")] ITask> GetWipInfoByUnitNO(string id); + #endregion + #region WinAtt 工單基本資料-屬性 PCS001 /// - /// 新增系統 + /// 新增工單基本資料-屬性 /// /// [WebApiClient.Attributes.HttpPost("api/WipAtts")] ITask> PostWipAtt([FromBody, RawJsonContent] string model); + + /// + /// 查詢工單基本資料-WipID + /// + /// + [WebApiClient.Attributes.HttpGet("api/WipAtts/{id}")] + ITask GetWipAtt(string id); + #endregion + + #region WipBarcode 工單基本資料-條碼 PCS001 PCS004 /// /// 新增工單條碼起迄資料檔 /// @@ -91,6 +111,14 @@ namespace AMESCoreStudio.Web [WebApiClient.Attributes.HttpPost("api/WipBarcode")] ITask> PostWipBarcode([FromBody, RawJsonContent] string model); + /// + /// 查詢工單條碼資料-WipNo + /// + /// + [WebApiClient.Attributes.HttpGet("api/WipBarcode/{id}")] + ITask> GetWipBarcode(string id); + #endregion + /// /// 新增工單鎖定資料檔 /// diff --git a/AMESCoreStudio.Web/Properties/launchSettings.json b/AMESCoreStudio.Web/Properties/launchSettings.json index 662a54c1..f1ac5198 100644 --- a/AMESCoreStudio.Web/Properties/launchSettings.json +++ b/AMESCoreStudio.Web/Properties/launchSettings.json @@ -3,7 +3,7 @@ "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { - "applicationUrl": "http://localhost:8080", + "applicationUrl": "http://localhost:8081", "sslPort": 0 } }, diff --git a/AMESCoreStudio.Web/ViewModels/PCS/PCS001RViewModel.cs b/AMESCoreStudio.Web/ViewModels/PCS/PCS001RViewModel.cs new file mode 100644 index 00000000..a5ba74f4 --- /dev/null +++ b/AMESCoreStudio.Web/ViewModels/PCS/PCS001RViewModel.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using AMESCoreStudio.WebApi.Models.AMES; +using AMESCoreStudio.WebApi.Models.BAS; + +namespace AMESCoreStudio.Web.ViewModels.PCS +{ + public class PCS001RViewModel + { + public WipInfo WipInfo { get; set; } + + public WipAtt WipAtt { get; set; } + + public IEnumerable WipBarcode { get; set; } + + public IEnumerable RuleStation { get; set; } + + } +} diff --git a/AMESCoreStudio.Web/Views/PCS/PCS001.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS001.cshtml index 132d8f34..e0e1fb9f 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS001.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS001.cshtml @@ -197,12 +197,12 @@
- +
- +
@@ -251,6 +251,9 @@
+
+ +
@@ -786,37 +789,68 @@ await Html.RenderPartialAsync("_FileinputScriptsPartial"); } diff --git a/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml new file mode 100644 index 00000000..1a5b8248 --- /dev/null +++ b/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml @@ -0,0 +1,880 @@ +@model AMESCoreStudio.Web.ViewModels.PCS.PCS001RViewModel + + +@{ ViewData["Title"] = "PCS001C"; + Layout = "~/Views/Shared/_AMESLayout.cshtml"; } + + + +
+
+
+
+
+ +
+ +
+
+ +
+ + +
+ +
+ +
+ +
+ + +
+ +
+ + +
+
+
+ +
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ + +
+ +
+
+ +
+
+ +
+ +
+ +
+ + +
+ +
+ +
+
+
+ +
+
+ +
+ +
+ +
+ +
+ +
+ + +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ + + +
+ +
+
    +
  • 工單屬性
  • +
  • 生產流程
  • +
  • 序號編碼
  • +
  • Keypart組合
  • +
  • 板卡-工程資訊
  • +
  • 系統-工程資訊
  • +
  • 標籤選項
  • +
+
+ @* 基本資料sheet *@ +
+
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+ +
+
+ +
+ + +
+ +
+ + +
+
+
+ +
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+
+ +
+
+ +
+ + +
+ +
+ + +
+
+
+ +
+ + @* 生產流程sheet *@ +
+
+
+ +
+ + +
+ + + + + + + + + + @foreach (var index in Model.RuleStation) + { + + + + + + } + +
+ 站別描述 + + 站別順序 + + 站別類型 +
+ @index.StationDesc + + @index.Sequence + + @index.StationType +
+
+
+
+ + @* 序號編碼sheet *@ +
+
+
+ + + + + + + + + + + @foreach (var index in Model.WipBarcode) + { + + + + + } + +
+ 起始生產序號 + + 結束生產序號 +
+ @index.StartNO + + @index.EndNO +
+ @*
+ +
+
-
+
+ +
+
+ +
*@ +
+
+ + @*
+
+ +
+ +
+ +
+ +
+
+
*@ +
+ @* Keypart組合sheet *@ +
+
+ + @* 板卡-工程資訊sheet *@ +
+
+
+ +
+ + +
+ + +
+ + +
+
+
+ +
+
+ +
+ + +
+
+
+ + +
+ +
+ +
+
+ +
+
+ +
+ +
+
+
+ +
+
+ +
+ +
+
+
+ +
+
+ +
+ +
+
+
+ +
+
+ +
+ +
+
+
+ +
+
+ +
+ +
+
+
+ +
+
+ +
+ +
+
+
+ +
+
+ +
+ +
+
+
+ +
+
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+
+ +
+
+ +
+ + +
+
+
+ +
+
+ +
+ + +
+
+
+ + @*
+
+ +
+ + +
+
+
+ +
+
+ +
+ + +
+
+
+ +
+
+ +
+ + +
+
+
*@ + +
+
+ +
+ + +
+
+
+ +
+
+ +
+ + +
+
+
+ +
+ +
+ +
+
+
+ + @* 系統-工程資訊sheet *@ +
+
+
+ +
+ + +
+ + +
+ + +
+
+
+ +
+
+ +
+ + +
+
+
+ +
+ +
+ +
+
+ +
+
+ +
+ +
+ +
+ + +
+ +
+ + +
+
+
+ +
+
+ +
+ + +
+
+
+ +
+
+ +
+ +
+ +
+ + +
+ +
+ + +
+
+
+ +
+
+ +
+ +
+ +
+ + +
+ +
+ + +
+
+
+ +
+
+ +
+ +
+ +
+ + +
+ +
+ + +
+
+
+ +
+
+ +
+ +
+ +
+ + +
+ +
+ + +
+
+
+ +
+
+ +
+ +
+ +
+ + +
+ +
+ + +
+
+
+ +
+
+ +
+ + +
+
+
+ +
+
+ +
+ + +
+
+
+ +
+ +
+ +
+
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+
+ +
+
+ +
+ +
+
+
+ +
+
+ +
+ +
+
+ + +
+
+
+ +
+
+ +
+ +
+
+ + +
+
+
+ +
+
+ +
+ +
+
+ + +
+
+
+ +
+
+ +
+ +
+
+ + +
+
+
+ +
+
+ +
+ +
+
+ + +
+
+
+ +
+
+ +
+ +
+
+ + +
+
+
+ +
+
+ +
+ +
+
+ + +
+
+
+ +
+ +
+ +
+
+
+ + @* 標籤選項sheet *@ +
+
+
+
+ + @Html.ValidationMessage("error") + @*
+
+ +
+
*@ +
+
+
+@section Scripts { + @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); + await Html.RenderPartialAsync("_FileinputScriptsPartial"); } + + + + +} diff --git a/AMESCoreStudio.Web/Views/PCS/PCS004.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS004.cshtml index a5ec786b..b8cebfa7 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS004.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS004.cshtml @@ -29,7 +29,7 @@
-
+
@ViewBag.Title
@@ -45,21 +45,23 @@
+
+ +
@*
- +
*@ -
-
- -
+ +
+
diff --git a/AMESCoreStudio.Web/Views/PCS/PCS005.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS005.cshtml index f40062c2..cff78466 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS005.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS005.cshtml @@ -35,56 +35,40 @@ { field: 'planQTY', title: '工單數' + }, + { + field: 'right', + width: 200, + title: '操作', + fixed: 'right', + templet: function (d) { + return '檢視修改 ' + } } - //{ - // field: 'right', - // width: 200, - // title: '操作', - // fixed: 'right', - // templet: function (d) { - // return '修改 删除' - // } - ] + ] ]; + //通过行tool檢視,lay-event="detail" + function detail(obj) { + if (obj.data.wipID) { + hg.open('檢視工單資料', '/PCS/PCS001R/' + obj.data.wipID,'', '',true); + } + } //通过行tool编辑,lay-event="edit" function edit(obj) { - if (obj.data.statusNo) { - hg.open('修改條碼狀態', '/PPS/PPS002U/' + obj.data.statusNo, 640,320); + if (obj.data.wipID) { + hg.open('修改工單資料', '/PCS/PCS001U/' + obj.data.wipID, '', '', true); } } - //通过行tool删除,lay-event="del" - function del(obj) { - if (obj.data.statusNo) { - hg.confirm("條碼狀態:" + obj.data.statusDesc + ",确定要删除吗?", function () { - $.ajax({ - url: '/PPS/PPS002D', - data: { id: obj.data.statusNo }, - type: 'POST', - success: function (data) { - if (data.success) { - obj.del(); //只删本地数据 - hg.msghide("删除成功!"); - } - else { - hg.msg(data.msg); - } - }, - error: function () { - hg.msg("网络请求失败!"); - } - }); - }); - } - } + + var toolbar = [{ text: '新增', layuiicon: '', class: 'layui-btn-normal', handler: function () { - hg.open('新增工單資料', '/PCS/PCS001', 800, 600); - + hg.open('新增工單資料', '/PCS/PCS001', '', '', true); } } ]; diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/WipAttsController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/WipAttsController.cs index 6b0370b2..a580adfb 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/WipAttsController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/WipAttsController.cs @@ -28,10 +28,10 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES } /// - /// 獲取產品別資料 + /// 查詢工單資料Att /// /// - // GET: api/SystemInfoes + // GET: api/WipAtts [HttpGet] public async Task>> GetWipAtt() { @@ -49,34 +49,33 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES } /// - /// 工單機種資料 to Wipatt_NO + /// 查詢工單資料Att By WipNO /// - /// + /// 工單號碼 /// - // GET: api/RolePrograms/5 + // GET: api/WipAtts/4 [HttpGet("{id}")] - public async Task>> GetWipAtt(int id) + public async Task> GetWipAtt(string id) { - IQueryable q = _context.WipAtts; - q = q.Where(p => p.WipNO.Equals(id)); + IQueryable q = _context.WipAtts.Where(p => p.WipNO == id); var WipAtt = await q.ToListAsync(); - if (WipAtt == null) + if (WipAtt == null || WipAtt.Count == 0) { return NotFound(); } - return WipAtt; + return WipAtt.FirstOrDefault(); } /// - /// 新增工單資料 + /// 新增工單資料Att /// /// /// - // POST: api/SystemInfoes + // POST: api/WipAtts // To protect from overposting attacks, enable the specific properties you want to bind to, for // more details, see https://go.microsoft.com/fwlink/?linkid=2123754. [HttpPost] diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/WipBarcodeController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/WipBarcodeController.cs index 2a13c340..12440c68 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/WipBarcodeController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/WipBarcodeController.cs @@ -27,11 +27,52 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES } /// - /// 新增工單資料-條碼 + /// 查詢工單資料Barcode + /// + /// + // GET: api/WipBarcode + [HttpGet] + public async Task>> GetWipBarcode() + { + IQueryable q = _context.WipBarcodes; + + q = q.OrderBy(p => p.WipNO); + + //q = q.OrderByDescending(p => p.SystemID); + + var WipBarcodes = await q.ToListAsync(); + + //return await _context.SystemInfoes.ToListAsync(); + + return WipBarcodes; + } + + /// + /// 查詢工單資料Barcode By WipNO + /// + /// 工單號碼 + /// + // GET: api/WipBarcode/4 + [HttpGet("{id}")] + public async Task>> GetWipBarcode(string id) + { + IQueryable q = _context.WipBarcodes.Where(p => p.WipNO == id); + var WipBarcodes = await q.ToListAsync(); + + if (WipBarcodes == null) + { + return NotFound(); + } + + return WipBarcodes; + } + + /// + /// 新增工單資料-條碼Barcode /// /// /// - // POST: api/SystemInfoes + // POST: api/WipBarcode // To protect from overposting attacks, enable the specific properties you want to bind to, for // more details, see https://go.microsoft.com/fwlink/?linkid=2123754. [HttpPost] diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/WipInfosController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/WipInfosController.cs index 388a5024..361d9a15 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/WipInfosController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/WipInfosController.cs @@ -28,7 +28,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES } /// - /// 獲取產品別資料 + /// 查詢工單資料Info /// /// // GET: api/SystemInfoes @@ -48,34 +48,55 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES return WipInfo; } + ///// + ///// 獲取產品別資料 + ///// + ///// + ///// + //// GET: api/RoleModules/Role/5 + //[HttpGet("{id}")] + //public async Task>> GetWipInfoByUnitNO(string UnitNO) + //{ + // //IQueryable q = _context.RoleModules.Include(r=>r.Module); + // IQueryable q = _context.WipInfos; + + + // //if (UnitNO > 0) + // //{ + // // q = q.Where(p => p.UnitNO.Equals(UnitNO)); + // //} + // //q.OrderBy(p => p.ModuleID); + + // var WipInfo = await q.ToListAsync(); + + // foreach (var data in WipInfo) + // { + // //data.ModuleName = _context.ModuleInfoes.Find(data.ModuleID).ModuleName; + // //data.Module = _context.ModuleInfoes.Where(p1 => p1.ModuleID.Equals(data.ModuleID)).FirstOrDefault(); + + // } + + // if (WipInfo == null) + // { + // return NotFound(); + // } + + // return WipInfo; + //} + /// - /// 獲取產品別資料 + /// 查詢工單資料Info By WipID /// - /// + /// WipID /// // GET: api/RoleModules/Role/5 [HttpGet("{id}")] - public async Task>> GetWipInfoByUnitNO(string UnitNO) + public async Task>> GetWipInfo(decimal id) { - //IQueryable q = _context.RoleModules.Include(r=>r.Module); - IQueryable q = _context.WipInfos; - - - //if (UnitNO > 0) - //{ - // q = q.Where(p => p.UnitNO.Equals(UnitNO)); - //} - //q.OrderBy(p => p.ModuleID); + IQueryable q = _context.WipInfos.Where(w => w.WipID == id); var WipInfo = await q.ToListAsync(); - foreach (var data in WipInfo) - { - //data.ModuleName = _context.ModuleInfoes.Find(data.ModuleID).ModuleName; - //data.Module = _context.ModuleInfoes.Where(p1 => p1.ModuleID.Equals(data.ModuleID)).FirstOrDefault(); - - } - if (WipInfo == null) { return NotFound(); diff --git a/AMESCoreStudio.WebApi/Models/AMES/WipAtt.cs b/AMESCoreStudio.WebApi/Models/AMES/WipAtt.cs index dc6e21b0..7f09df07 100644 --- a/AMESCoreStudio.WebApi/Models/AMES/WipAtt.cs +++ b/AMESCoreStudio.WebApi/Models/AMES/WipAtt.cs @@ -62,7 +62,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES [DataMember] [Required(ErrorMessage = "{0},不能空白")] [Display(Name = "聯板數")] - public decimal Boards { get; set; } = 1; + public int Boards { get; set; } = 1; /// /// Datecode diff --git a/AMESCoreStudio.WebApi/Models/AMES/WipBarcode.cs b/AMESCoreStudio.WebApi/Models/AMES/WipBarcode.cs index f4c2fe86..58419621 100644 --- a/AMESCoreStudio.WebApi/Models/AMES/WipBarcode.cs +++ b/AMESCoreStudio.WebApi/Models/AMES/WipBarcode.cs @@ -16,7 +16,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES /// 工單號碼 /// [Key] - [Column("WIP_NO")] + [Column("WIP_NO", Order = 0)] [Required(ErrorMessage = "{0},不能空白")] [DataMember] public string WipNO { get; set; } @@ -24,7 +24,8 @@ namespace AMESCoreStudio.WebApi.Models.AMES /// /// 起始條碼NO /// - [Column("START_NO")] + [Key] + [Column("START_NO", Order = 1)] [DataMember] [Required(ErrorMessage = "{0},不能空白")] [Display(Name = "起始條碼")] @@ -33,7 +34,8 @@ namespace AMESCoreStudio.WebApi.Models.AMES /// /// 結束條碼NO /// - [Column("END_NO")] + [Key] + [Column("END_NO", Order = 2)] [DataMember] [Required(ErrorMessage = "{0},不能空白")] [Display(Name = "結束條碼")] diff --git a/AMESCoreStudio.WebApi/Models/AMES/WipInfo.cs b/AMESCoreStudio.WebApi/Models/AMES/WipInfo.cs index dc4fa818..041ed5ea 100644 --- a/AMESCoreStudio.WebApi/Models/AMES/WipInfo.cs +++ b/AMESCoreStudio.WebApi/Models/AMES/WipInfo.cs @@ -37,7 +37,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES [DataMember] [Required(ErrorMessage = "{0},不能空白")] [Display(Name = "計劃數量")] - public decimal PlanQTY { get; set; } = 0; + public int PlanQTY { get; set; } = 0; /// /// 第一站完成數量 @@ -98,7 +98,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES [DataMember] [Required(ErrorMessage = "{0},不能空白")] [Display(Name = "流程ID")] - public decimal FlowRuleID { get; set; } = 0; + public int FlowRuleID { get; set; } = 0; /// /// 工單狀態 @@ -133,7 +133,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES [DataMember] [Required(ErrorMessage = "{0},不能空白")] [Display(Name = "單箱數量")] - public decimal BoxCNT { get; set; } = 1; + public int BoxCNT { get; set; } = 1; /// /// 判斷前製程是否已經投入 (Y-判斷;N-不判斷) @@ -235,7 +235,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES [Column("WIP_SCHEDULE_DATE")] [DataMember] [Required(ErrorMessage = "{0},不能空白")] - [DataType(DataType.Date), DisplayFormat(DataFormatString = "{0:yyyy/MM/dd}", ApplyFormatInEditMode = true)] + [DataType(DataType.Text), DisplayFormat(DataFormatString = "{0:yyyy/MM/dd}", ApplyFormatInEditMode = true)] [Display(Name = "預計開工日期")] public DateTime WipScheduleDate { get; set; } @@ -245,7 +245,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES [Column("WIP_DUE_DATE")] [DataMember] [Required(ErrorMessage = "{0},不能空白")] - [DataType(DataType.Date), DisplayFormat(DataFormatString = "{0:yyyy/MM/dd}", ApplyFormatInEditMode = true)] + [DataType(DataType.Text), DisplayFormat(DataFormatString = "{0:yyyy/MM/dd}", ApplyFormatInEditMode = true)] [Display(Name = "預計完工日期")] public DateTime WipDueDate { get; set; } diff --git a/AMESCoreStudio.WebApi/Models/AMESContext.cs b/AMESCoreStudio.WebApi/Models/AMESContext.cs index 505ca183..871e7149 100644 --- a/AMESCoreStudio.WebApi/Models/AMESContext.cs +++ b/AMESCoreStudio.WebApi/Models/AMESContext.cs @@ -82,6 +82,7 @@ namespace AMESCoreStudio.WebApi */ modelBuilder.Entity().HasKey(c => new { c.RuleStationID, c.RuleStatus }); + modelBuilder.Entity().HasKey(c => new { c.WipNO, c.StartNO, c.EndNO }); } /// diff --git a/AMESCoreStudio.WebApi/Startup.cs b/AMESCoreStudio.WebApi/Startup.cs index 20bd8822..3adfe683 100644 --- a/AMESCoreStudio.WebApi/Startup.cs +++ b/AMESCoreStudio.WebApi/Startup.cs @@ -55,7 +55,7 @@ namespace AMESCoreStudio.WebApi c.SwaggerDoc("v1", new OpenApiInfo { Version = "v1", - Title = "AMESCoreStudio ӿĵ", + Title = "AMESCoreStudio", Description = "RESTful API", TermsOfService = new Uri("https://example.com/terms"), Contact = new OpenApiContact