diff --git a/AMESCoreStudio.Web/AMESCoreStudio.Web.csproj b/AMESCoreStudio.Web/AMESCoreStudio.Web.csproj index 67bc8342..0ab26e5e 100644 --- a/AMESCoreStudio.Web/AMESCoreStudio.Web.csproj +++ b/AMESCoreStudio.Web/AMESCoreStudio.Web.csproj @@ -41,8 +41,4 @@ - - - - diff --git a/AMESCoreStudio.Web/Controllers/SPCController.cs b/AMESCoreStudio.Web/Controllers/SPCController.cs new file mode 100644 index 00000000..a8365d1c --- /dev/null +++ b/AMESCoreStudio.Web/Controllers/SPCController.cs @@ -0,0 +1,886 @@ +using Microsoft.AspNetCore.Mvc; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using AMESCoreStudio.Web.Models; +using Newtonsoft.Json; +using AMESCoreStudio.WebApi; +using System.Collections.Generic; +using Microsoft.AspNetCore.Mvc.Rendering; +using AMESCoreStudio.WebApi.Models.AMES; +using AMESCoreStudio.WebApi.Models.BAS; +using AMESCoreStudio.CommonTools.Result; + +namespace AMESCoreStudio.Web.Controllers +{ + public class SPCController : Controller + { + private readonly ILogger _logger; + public readonly ISPC _spcApi; + public readonly IWHS _whsApi; + public readonly IBAS _basApi; + public readonly IPCS _pcsApi; + public readonly ISYS _sysApi; + public readonly IPPS _ppsApi; + + public SPCController(ILogger logger, ISPC spcApi, IWHS whsApi,IBAS basApi, IPCS pcsApi, ISYS sysApi, IPPS ppsApi) + { + _logger = logger; + _spcApi = spcApi; + _whsApi = whsApi; + _basApi = basApi; + _pcsApi = pcsApi; + _sysApi = sysApi; + _ppsApi = ppsApi; + } + + + #region + private void GetFlagList() + { + + var FlagList = new List(); + + + FlagList.Add(new SelectListItem("Y", "Y")); + FlagList.Add(new SelectListItem("N", "N")); + + ViewBag.FlagList = FlagList; + } + private async Task GetWorkGroupsList() + { + var result = await _whsApi.GetWorkGroups(); + + var GroupList = new List(); + for (int i = 0; i < result.Count; i++) + { + GroupList.Add(new SelectListItem(result[i].GroupName, result[i].GroupID.ToString())); + } + ViewBag.GroupList = GroupList; + } + private async Task GetWorkClassList() + { + var result = await _whsApi.GetWorkClasses(); + + var GroupList = new List(); + for (int i = 0; i < result.Count; i++) + { + GroupList.Add(new SelectListItem(result[i].ClassName, result[i].ClassID.ToString())); + } + ViewBag.WClassList = GroupList; + } + private async Task GetFactoryUnitsList() + { + var result = await _basApi.GetFactoryUnits(); + + var UnitItems = new List(); + UnitItems.Add(new SelectListItem("全部", "0")); + for (int i = 0; i < result.Count; i++) + { + UnitItems.Add(new SelectListItem(result[i].UnitName, result[i].UnitNo.ToString())); + } + ViewBag.FactoryUnit = UnitItems; + } + private async Task GetFactoryUnitsList2() + { + var result = await _basApi.GetFactoryUnits(); + + var UnitItems = new List(); + for (int i = 0; i < result.Count; i++) + { + UnitItems.Add(new SelectListItem(result[i].UnitName, result[i].UnitNo.ToString())); + } + UnitItems.Add(new SelectListItem("其他", "0")); + + ViewBag.FactoryUnit = UnitItems; + } + private async Task GetFactoryList() + { + var result = await _basApi.GetFactoryInfoes(); + + var FactoryItems = new List(); + for (int i = 0; i < result.Count; i++) + { + FactoryItems.Add(new SelectListItem(result[i].FactoryNameCh, result[i].FactoryID.ToString())); + } + ViewBag.FactoryList = FactoryItems; + } + private async Task GetLineList2() + { + var result = await _basApi.GetLineInfoes(); + + var LineItems = new List(); + for (int i = 0; i < result.Count; i++) + { + LineItems.Add(new SelectListItem(result[i].LineDesc, result[i].LineID.ToString())); + } + ViewBag.LineList = LineItems; + } + private async Task GetDeptList() + { + var result = await _sysApi.GetDeptInfoes(); + + var DeptItems = new List(); + DeptItems.Add(new SelectListItem("N/A", "0")); + for (int i = 0; i < result.Count; i++) + { + DeptItems.Add(new SelectListItem(result[i].DeptName, result[i].DeptID.ToString())); + } + ViewBag.DeptList = DeptItems; + } + private async Task GetDeptList2() + { + var result = await _sysApi.GetDeptInfoes(); + + var DeptItems = new List(); + for (int i = 0; i < result.Count; i++) + { + DeptItems.Add(new SelectListItem(result[i].DeptName, result[i].DeptID.ToString())); + } + ViewBag.DeptList = DeptItems; + } + private void GetSideList() + { + + var SideItems = new List() ; + SideItems.Add(new SelectListItem("N/A", "N/A")); + SideItems.Add(new SelectListItem("正面", "正面")); + SideItems.Add(new SelectListItem("背面", "背面")); + + ViewBag.SideList = SideItems; + } + private void GetClassList() + { + + var ClassItems = new List(); + ClassItems.Add(new SelectListItem("白班", "1")); + ClassItems.Add(new SelectListItem("夜班", "2")); + + ViewBag.ClassList = ClassItems; + } + private async Task GetStationListByUnit(string unit) + { + var result = await _basApi.GetStationses(); + + var StationItems = new List(); + StationItems.Add(new SelectListItem("N/A", "0")); + for (int i = 0; i < result.Count; i++) + { + if(result[i].UnitNo==unit) + StationItems.Add(new SelectListItem(result[i].StationName, result[i].StationID.ToString())); + } + if(StationItems.Count==0) + StationItems.Add(new SelectListItem("N/A", "")); + + ViewBag.StationList = StationItems; + } + + + #endregion + #region + private void GetTESTList() + { + + var FlagList = new List(); + + + FlagList.Add(new SelectListItem("Y", "Y")); + FlagList.Add(new SelectListItem("N", "N")); + + ViewBag.FlagList = FlagList; + } + private async Task GetInspectionTypesList() + { + var result = await _spcApi.GetInspectionTypes(); + + var GroupList = new List(); + for (int i = 0; i < result.Count; i++) + { + GroupList.Add(new SelectListItem(result[i].InspectionNo, result[i].InspectionTypeID.ToString())); + } + ViewBag.TypesList = GroupList; + } + private async Task GetInspectionFormsList() + { + var result = await _spcApi.GetInspectionForms(); + + var GroupList = new List(); + for (int i = 0; i < result.Count; i++) + { + GroupList.Add(new SelectListItem(result[i].InspectionName, result[i].InspectionFormID.ToString())); + } + ViewBag.FromsList = GroupList; + } + private async Task GetFactoryUnitsList3() + { + var result = await _basApi.GetFactoryUnits(); + + var UnitItems = new List(); + for (int i = 0; i < result.Count; i++) + { + UnitItems.Add(new SelectListItem(result[i].UnitName, result[i].UnitNo.ToString())); + } + ViewBag.FactoryUnit = UnitItems; + } + private async Task GetStationList() + { + var result = await _basApi.GetStationses(); + + var StationItems = new List(); + StationItems.Add(new SelectListItem("N/A", "0")); + for (int i = 0; i < result.Count; i++) + { + StationItems.Add(new SelectListItem(result[i].StationName, result[i].StationID.ToString())); + } + ViewBag.StationList = StationItems; + } + private async Task GetLineList() + { + var result = await _basApi.GetLineInfoes(); + + var LineItems = new List(); + LineItems.Add(new SelectListItem("N/A", "0")); + for (int i = 0; i < result.Count; i++) + { + LineItems.Add(new SelectListItem(result[i].LineDesc, result[i].LineID.ToString())); + } + ViewBag.LineList = LineItems; + } + + #endregion + + #region SPC001 巡檢類別維護相關 + + public IActionResult SPC001() + { + return View(); + } + + //新增頁面 + public IActionResult SPC001C() + { + return View(); + } + + //修改页面 + [HttpGet] + public async Task SPC001UAsync(int id) + { + var result = await _spcApi.GetInspectionType(id); + + if (result.Count == 0) + { + return View(); + } + return View(result[0]); + } + + public async Task SPC001DAsync(int id) + { + var result = await _spcApi.DeleteInspectionType(id); + return Json(new Result() { success = true, msg = "" }); + } + + //頁面提交,id=0 添加,id>0 修改 + [HttpPost] + public async Task SPC001CSaveAsync(InspectionType model) + { + if (ModelState.IsValid) + { + IResultModel result; + + result = await _spcApi.PostInspectionType(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("SPC001C", model); + } + + public async Task SPC001USaveAsync(InspectionType model) + { + if (ModelState.IsValid) + { + IResultModel result; + + result = await _spcApi.PutInspectionType(model.InspectionTypeID, 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("SPC001U", model); + } + + [ResponseCache(Duration = 0)] + [HttpGet] + public async Task GetInspectionTypesAsync() + { + var result = await _spcApi.GetInspectionTypes(); + + 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 + + #region SPC002巡檢表單維護相關 + + public async Task SPC002() + { + await GetInspectionTypesList(); + return View(); + } + + //新增頁面 + public async Task SPC002C() + { + await GetInspectionTypesList(); + await GetFactoryUnitsList3(); + return View(); + } + + //修改页面 + [HttpGet] + public async Task SPC002UAsync(int id) + { + await GetInspectionTypesList(); + await GetFactoryUnitsList3(); + var result = await _spcApi.GetInspectionForm(id); + + if (result.Count == 0) + { + return View(); + } + return View(result[0]); + } + + public async Task SPC002DAsync(int id) + { + var result = await _spcApi.DeleteInspectionForm(id); + return Json(new Result() { success = true, msg = "" }); + } + + //頁面提交,id=0 添加,id>0 修改 + [HttpPost] + public async Task SPC002CSaveAsync(InspectionForm model) + { + if (ModelState.IsValid) + { + IResultModel result; + + result = await _spcApi.PostInspectionForm(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("SPC002C", model); + } + + public async Task SPC002USaveAsync(InspectionForm model) + { + if (ModelState.IsValid) + { + IResultModel result; + + result = await _spcApi.PutInspectionForm(model.InspectionFormID, 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("SPC002U", model); + } + + [ResponseCache(Duration = 0)] + [HttpGet] + public async Task GetInspectionFormsAsync() + { + var result = await _spcApi.GetInspectionForms(); + + if (result.Count > 0) + { + return Json(new Table() { code = 0, msg = "", data = result, count = result.Count }); + } + + return Json(new Table() { count = 0, data = null }); + } + [HttpGet] + public async Task GetInspectionFormsByQueryAsync(int id,string status) + { + if(id == 0) + return Json(new Table() { count = 0, data = null }); + + var result = await _spcApi.GetInspectionFormsByQuery(id, status); + + 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 + + #region SPC003巡檢細項維護相關 + public async Task SPC003() + { + await GetInspectionTypesList(); + await GetInspectionFormsList(); + return View(); + } + //新增頁面 + public async Task SPC003C(int id) + { + //await GetStationListByUnit(unit); + var result = await _spcApi.GetInspectionForm(id); + ViewBag.FormID = result[0].InspectionFormID; + ViewBag.FormName = "正在新增["+result[0].InspectionName+"]細項"; + return View(); + } + //修改页面 + [HttpGet] + public async Task SPC003UAsync(int id) + { + var result = await _spcApi.GetInspectionItem(id); + + if (result.Count == 0) + { + return View(); + } + + var resultForm = await _spcApi.GetInspectionForm(result[0].InspectionFormID); + ViewBag.FormID = resultForm[0].InspectionFormID; + ViewBag.FormName = "正在修改[" + resultForm[0].InspectionName + "]細項"; + return View(result[0]); + } + public async Task SPC003DAsync(int id) + { + var result = await _spcApi.DeleteInspectionItem(id); + return Json(new Result() { success = true, msg = "" }); + } + [HttpPost] + public async Task SPC003CSaveAsync(InspectionItem model) + { + if (ModelState.IsValid) + { + IResultModel result; + + result = await _spcApi.PostInspectionItem(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("SPC003C", model); + } + public async Task SPC003USaveAsync(InspectionItem model) + { + if (ModelState.IsValid) + { + IResultModel result; + + result = await _spcApi.PutInspectionItem(model.InspectionItemID, 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("SPC003U", model); + } + + [ResponseCache(Duration = 0)] + [HttpGet] + public async Task GetInspectionItemsAsync() + { + var result = await _spcApi.GetInspectionItems(); + + if (result.Count > 0) + { + return Json(new Table() { code = 0, msg = "", data = result, count = result.Count }); + } + + return Json(new Table() { count = 0, data = null }); + } + + public async Task GetInspectionItemsByFormIDAsync(int id) + { + var result = await _spcApi.GetInspectionItemsByFormID(id); + + 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 + + #region SPC004巡檢結果維護相關 + + public async Task SPC004() + { + await GetFactoryUnitsList2(); + await GetFactoryList(); + return View(); + } + //新增頁面 + public async Task SPC004C() + { + //製程單位 + await GetFactoryUnitsList2(); + //廠別 + await GetFactoryList(); + //線別 + await GetLineList(); + //站別 + await GetStationList(); + //班別 + GetClassList(); + //其他部門 + await GetDeptList(); + return View(); + } + //修改页面 + [HttpGet] + public async Task SPC004UAsync(int id,string type) + { + //製程單位 + await GetFactoryUnitsList2(); + //廠別 + await GetFactoryList(); + //線別 + await GetLineList(); + //站別 + await GetStationList(); + //班別 + GetClassList(); + //其他部門 + await GetDeptList(); + ViewBag.type = type; + + var result = await _whsApi.GetSupportUser(id); + + if (result.Count == 0) + { + return View(); + } + return View(result[0]); + } + public async Task SPC008DAsync(int id) + { + var result = await _whsApi.DeleteSupportUser(id); + return Json(new Result() { success = true, msg = "" }); + } + [HttpPost] + public async Task SPC008CSaveAsync(SupportUser model) + { + if (ModelState.IsValid) + { + IResultModel result; + + result = await _whsApi.PostSupportUser(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("SPC008C", model); + } + public async Task SPC008USaveAsync(SupportUser model) + { + if (ModelState.IsValid) + { + IResultModel result; + + result = await _whsApi.PutSupportUser(model.SupportID, 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("SPC008U", model); + } + [ResponseCache(Duration = 0)] + [HttpGet] + public async Task GetSupportUsersAsync() + { + var result = await _whsApi.GetSupportUsers(); + + if (result.Count > 0) + { + return Json(new Table() { code = 0, msg = "", data = result, count = result.Count }); + } + + return Json(new Table() { count = 0, data = null }); + } + public async Task GetSupportUser2Async(string f, string type, string unit, string sd, string ed) + { + + var result = await _whsApi.GetSupportUserByQuery( f,type, unit, sd, ed); + + 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 + + #region SPC005巡檢結果資料維護相關 + + public async Task SPC005() + { + + await GetInspectionTypesList(); + await GetInspectionFormsList(); + + return View(); + } + + //新增頁面 + public async Task SPC005C(int id) + { + var result = await _spcApi.GetInspectionForm(id); + ViewBag.FormID = result[0].InspectionFormID; + ViewBag.FormName = "正在新增[" + result[0].InspectionName + "]細項"; + await GetStationList(); + await GetLineList(); + return View(); + } + + //修改页面 + [HttpGet] + public async Task SPC005UAsync(int id) + { + //廠別 + await GetFactoryList(); + //製程單位 + await GetFactoryUnitsList3(); + //線別 + await GetLineList2(); + //站別 + await GetStationList(); + //班別 + GetClassList(); + var result = await _whsApi.GetWorkManPower(id); + + if (result.Count == 0) + { + return View(); + } + return View(result[0]); + } + + public async Task SPC005DAsync(int id) + { + var result = await _whsApi.DeleteWorkManPower(id); + return Json(new Result() { success = true, msg = "" }); + } + + //頁面提交,id=0 添加,id>0 修改 + [HttpPost] + public async Task SPC005CSaveAsync(WorkManPower model) + { + if (ModelState.IsValid) + { + IResultModel result; + + result = await _whsApi.PostWorkManPower(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); + } + + public async Task SPC005USaveAsync(WorkManPower model) + { + if (ModelState.IsValid) + { + IResultModel result; + + result = await _whsApi.PutWorkManPower(model.PowerID, 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("SPC006U", model); + } + + [ResponseCache(Duration = 0)] + [HttpGet] + public async Task GetInspectionResultMastersAsync() + { + var result = await _spcApi.GetInspectionResultMasters(); + + if (result.Count > 0) + { + return Json(new Table() { code = 0, msg = "", data = result, count = result.Count }); + } + + return Json(new Table() { count = 0, data = null }); + } + + public async Task GetInspectionResultMastersByFormIdAsync(int id) + { + var result = await _spcApi.GetInspectionResultMastersByFormId(id); + + 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 new file mode 100644 index 00000000..9f7539a1 --- /dev/null +++ b/AMESCoreStudio.Web/HttpApis/AMES/ISPC.cs @@ -0,0 +1,241 @@ +using System.Collections.Generic; +using WebApiClient; +using WebApiClient.Attributes; +using AMESCoreStudio.WebApi; +using Microsoft.AspNetCore.Mvc; +using AMESCoreStudio.WebApi.Models.AMES; +using AMESCoreStudio.WebApi.Models.BAS; +using AMESCoreStudio.CommonTools.Result; + +namespace AMESCoreStudio.Web +{ + [JsonReturn] + public interface ISPC:IHttpApi + { + #region SPC001 巡檢類別維護 + + /// + /// 新增巡檢類別 + /// + /// + [WebApiClient.Attributes.HttpPost("api/InspectionTypes")] + ITask> PostInspectionType([FromBody, RawJsonContent] string model); + + /// + /// 更新巡檢類別 + /// + /// + [WebApiClient.Attributes.HttpPut("api/InspectionTypes/{id}")] + ITask> PutInspectionType(int id, [FromBody, RawJsonContent] string model); + + /// + /// 刪除巡檢類別 + /// + /// + [WebApiClient.Attributes.HttpDelete("api/InspectionTypes/{id}")] + ITask> DeleteInspectionType(int id); + + /// + /// 根據ID獲取指定巡檢類別資料 + /// + /// + [WebApiClient.Attributes.HttpGet("api/InspectionTypes/{id}")] + ITask> GetInspectionType(int id); + + /// + /// 獲取巡檢類別資料 + /// + /// + [WebApiClient.Attributes.HttpGet("api/InspectionTypes")] + ITask> GetInspectionTypes(); + + #endregion + + #region SPC002 巡檢表單维護 + + /// + /// 新增巡檢表單 + /// + /// + [WebApiClient.Attributes.HttpPost("api/InspectionForms")] + ITask> PostInspectionForm([FromBody, RawJsonContent] string model); + + /// + /// 更新巡檢表單 + /// + /// + [WebApiClient.Attributes.HttpPut("api/InspectionForms/{id}")] + ITask> PutInspectionForm(int id, [FromBody, RawJsonContent] string model); + + /// + /// 刪除巡檢表單维 + /// + /// + [WebApiClient.Attributes.HttpDelete("api/InspectionForms/{id}")] + ITask> DeleteInspectionForm(int id); + + /// + /// 根據ID獲取指定巡檢表單資料 + /// + /// + [WebApiClient.Attributes.HttpGet("api/InspectionForms/{id}")] + ITask> GetInspectionForm(int id); + + /// + /// 獲取指定巡檢表單資料By Query + /// + /// + [WebApiClient.Attributes.HttpGet("api/InspectionForms/Query/{id}/{status}")] + ITask> GetInspectionFormsByQuery(int id,string status); + + /// + /// 獲取巡檢表單資料 + /// + /// + [WebApiClient.Attributes.HttpGet("api/InspectionForms")] + ITask> GetInspectionForms(); + + #endregion + + #region SPC003 巡檢細項維護 + + /// + /// 新增巡檢細項 + /// + /// + [WebApiClient.Attributes.HttpPost("api/InspectionItems")] + ITask> PostInspectionItem([FromBody, RawJsonContent] string model); + + /// + /// 更新巡檢細項 + /// + /// + [WebApiClient.Attributes.HttpPut("api/InspectionItems/{id}")] + ITask> PutInspectionItem(int id, [FromBody, RawJsonContent] string model); + + /// + /// 刪除巡檢細項 + /// + /// + [WebApiClient.Attributes.HttpDelete("api/InspectionItems/{id}")] + ITask DeleteInspectionItem(int id); + + /// + /// 根據ID獲取指定巡檢細項資料 + /// + /// + [WebApiClient.Attributes.HttpGet("api/InspectionItems/{id}")] + ITask> GetInspectionItem(int id); + + /// + /// 根據ID獲取指定巡檢細項資料 + /// + /// + [WebApiClient.Attributes.HttpGet("api/InspectionItems/Form/{id}")] + ITask> GetInspectionItemsByFormID(int id); + + /// + /// 獲取巡檢細項資料 + /// + /// + [WebApiClient.Attributes.HttpGet("api/InspectionItems")] + ITask> GetInspectionItems(); + + #endregion + + #region SPC004 每日工時資料維護 + + /// + /// 新增每日工時 + /// + /// + [WebApiClient.Attributes.HttpPost("api/WorkManPowers")] + ITask> PostWorkManPower([FromBody, RawJsonContent] string model); + + /// + /// 更新每日工時 + /// + /// + [WebApiClient.Attributes.HttpPut("api/WorkManPowers/{id}")] + ITask> PutWorkManPower(int id, [FromBody, RawJsonContent] string model); + + /// + /// 刪除每日工時 + /// + /// + [WebApiClient.Attributes.HttpDelete("api/WorkManPowers/{id}")] + ITask> DeleteWorkManPower(int id); + + /// + /// 根據ID獲取指定每日工時資料 + /// + /// + [WebApiClient.Attributes.HttpGet("api/WorkManPowers/{id}")] + ITask> GetWorkManPower(int id); + + /// + /// 獲取每日工時資料 + /// + /// + [WebApiClient.Attributes.HttpGet("api/WorkManPowers")] + ITask> GetWorkManPowers(); + + /// + /// 查詢每日工時 + /// + /// + [WebApiClient.Attributes.HttpGet("api/WorkManPowers/Query/{factoryid}/{unitid}/{lineid}/{classID}/{stationID}/{userNo}/{deptID}/{sdate}/{edate}")] + ITask> GetWorkManPowersByQuery(string factoryid, string unitid, string lineid, string classID, string stationID, string userNo, string deptID, string sdate, string edate); + + #endregion + + #region SPC005 巡檢結果維護 + + /// + /// 新增巡檢結果MASTER + /// + /// + [WebApiClient.Attributes.HttpPost("api/InspectionResultMasters")] + ITask> PostInspectionResultMaster([FromBody, RawJsonContent] string model); + + /// + /// 更新巡檢結果MASTER + /// + /// + [WebApiClient.Attributes.HttpPut("api/InspectionResultMasters/{id}")] + ITask> PutInspectionResultMaster(string id, [FromBody, RawJsonContent] string model); + + /// + /// 刪除巡檢結果MASTER + /// + /// + [WebApiClient.Attributes.HttpDelete("api/InspectionResultMasters/{id}")] + ITask> DeleteInspectionResultMaster(string id); + + /// + /// 根據ID獲取指定巡檢結果MASTER + /// + /// + [WebApiClient.Attributes.HttpGet("api/InspectionResultMasters/{id}")] + ITask> GetInspectionResultMaster(string id); + + /// + /// 獲取巡檢結果MASTER + /// + /// + [WebApiClient.Attributes.HttpGet("api/InspectionResultMasters")] + ITask> GetInspectionResultMasters(); + + /// + /// 根据巡檢結果MASTER + /// + /// + [WebApiClient.Attributes.HttpGet("api/InspectionResultMasters/Form/{id}")] + ITask> GetInspectionResultMastersByFormId(int id); + + #endregion + + + + } +} diff --git a/AMESCoreStudio.Web/Views/SPC/SPC001.cshtml b/AMESCoreStudio.Web/Views/SPC/SPC001.cshtml new file mode 100644 index 00000000..9d083825 --- /dev/null +++ b/AMESCoreStudio.Web/Views/SPC/SPC001.cshtml @@ -0,0 +1,94 @@ +@{ + ViewData["Title"] = "巡檢類別資料維護"; + Layout = "~/Views/Shared/_AMESLayout.cshtml"; +} + +
+
+
+
+
@ViewBag.Title
+
+
+
+
+
+
+
+ +@section Scripts{ + +} \ No newline at end of file diff --git a/AMESCoreStudio.Web/Views/SPC/SPC001C.cshtml b/AMESCoreStudio.Web/Views/SPC/SPC001C.cshtml new file mode 100644 index 00000000..e3c4425a --- /dev/null +++ b/AMESCoreStudio.Web/Views/SPC/SPC001C.cshtml @@ -0,0 +1,61 @@ +@model AMESCoreStudio.WebApi.Models.AMES.InspectionType + + +@{ ViewData["Title"] = "SPC001C"; + 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/SPC001U.cshtml b/AMESCoreStudio.Web/Views/SPC/SPC001U.cshtml new file mode 100644 index 00000000..520bf004 --- /dev/null +++ b/AMESCoreStudio.Web/Views/SPC/SPC001U.cshtml @@ -0,0 +1,61 @@ +@model AMESCoreStudio.WebApi.Models.AMES.InspectionType + + +@{ ViewData["Title"] = "SPC001U"; + 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/SPC002.cshtml b/AMESCoreStudio.Web/Views/SPC/SPC002.cshtml new file mode 100644 index 00000000..4a796aa5 --- /dev/null +++ b/AMESCoreStudio.Web/Views/SPC/SPC002.cshtml @@ -0,0 +1,159 @@ +@{ + ViewData["Title"] = "巡檢表單資料維護"; + Layout = "~/Views/Shared/_AMESLayout.cshtml"; +} + +
+
+
+
+
@ViewBag.Title
+
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+ +@section Scripts{ + +} \ No newline at end of file diff --git a/AMESCoreStudio.Web/Views/SPC/SPC002C.cshtml b/AMESCoreStudio.Web/Views/SPC/SPC002C.cshtml new file mode 100644 index 00000000..5e95e510 --- /dev/null +++ b/AMESCoreStudio.Web/Views/SPC/SPC002C.cshtml @@ -0,0 +1,70 @@ +@model AMESCoreStudio.WebApi.Models.AMES.InspectionForm + + +@{ ViewData["Title"] = "SPC002C"; + 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/SPC002U.cshtml b/AMESCoreStudio.Web/Views/SPC/SPC002U.cshtml new file mode 100644 index 00000000..d7ebd0bf --- /dev/null +++ b/AMESCoreStudio.Web/Views/SPC/SPC002U.cshtml @@ -0,0 +1,70 @@ +@model AMESCoreStudio.WebApi.Models.AMES.InspectionForm + + +@{ ViewData["Title"] = "SPC002U"; + 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/SPC003.cshtml b/AMESCoreStudio.Web/Views/SPC/SPC003.cshtml new file mode 100644 index 00000000..6ada3051 --- /dev/null +++ b/AMESCoreStudio.Web/Views/SPC/SPC003.cshtml @@ -0,0 +1,207 @@ +@{ + ViewData["Title"] = "巡檢表單細項資料維護"; + Layout = "~/Views/Shared/_AMESLayout.cshtml"; +} + +
+
+
+
+
@ViewBag.Title
+
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+ +@section Scripts{ + +} \ No newline at end of file diff --git a/AMESCoreStudio.Web/Views/SPC/SPC003C.cshtml b/AMESCoreStudio.Web/Views/SPC/SPC003C.cshtml new file mode 100644 index 00000000..dca6ea73 --- /dev/null +++ b/AMESCoreStudio.Web/Views/SPC/SPC003C.cshtml @@ -0,0 +1,60 @@ +@model AMESCoreStudio.WebApi.Models.AMES.InspectionItem + + +@{ ViewData["Title"] = "SPC003C"; + 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/SPC003U.cshtml b/AMESCoreStudio.Web/Views/SPC/SPC003U.cshtml new file mode 100644 index 00000000..67d0054c --- /dev/null +++ b/AMESCoreStudio.Web/Views/SPC/SPC003U.cshtml @@ -0,0 +1,60 @@ +@model AMESCoreStudio.WebApi.Models.AMES.InspectionItem + + +@{ ViewData["Title"] = "SPC003U"; + 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/SPC004.cshtml b/AMESCoreStudio.Web/Views/SPC/SPC004.cshtml new file mode 100644 index 00000000..1a7d60bb --- /dev/null +++ b/AMESCoreStudio.Web/Views/SPC/SPC004.cshtml @@ -0,0 +1,412 @@ +@{ + ViewData["Title"] = "巡檢表單細項資料維護"; + Layout = "~/Views/Shared/_AMESLayout.cshtml"; +} + +
+
+
+
+
@ViewBag.Title
+
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+ +@section Scripts{ + + + + + + +} + + + + diff --git a/AMESCoreStudio.Web/Views/SPC/SPC004C.cshtml b/AMESCoreStudio.Web/Views/SPC/SPC004C.cshtml new file mode 100644 index 00000000..dca6ea73 --- /dev/null +++ b/AMESCoreStudio.Web/Views/SPC/SPC004C.cshtml @@ -0,0 +1,60 @@ +@model AMESCoreStudio.WebApi.Models.AMES.InspectionItem + + +@{ ViewData["Title"] = "SPC003C"; + 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/SPC004U.cshtml b/AMESCoreStudio.Web/Views/SPC/SPC004U.cshtml new file mode 100644 index 00000000..3084bb0c --- /dev/null +++ b/AMESCoreStudio.Web/Views/SPC/SPC004U.cshtml @@ -0,0 +1,60 @@ +@model AMESCoreStudio.WebApi.Models.AMES.InspectionItem + + +@{ ViewData["Title"] = "SPC003U"; + 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/SPC005.cshtml b/AMESCoreStudio.Web/Views/SPC/SPC005.cshtml new file mode 100644 index 00000000..ac846d76 --- /dev/null +++ b/AMESCoreStudio.Web/Views/SPC/SPC005.cshtml @@ -0,0 +1,210 @@ +@{ + ViewData["Title"] = "巡檢結果資料維護"; + Layout = "~/Views/Shared/_AMESLayout.cshtml"; +} + +
+
+
+
+
@ViewBag.Title
+
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+ +@section Scripts{ + + + + + +} \ No newline at end of file diff --git a/AMESCoreStudio.Web/Views/SPC/SPC005C.cshtml b/AMESCoreStudio.Web/Views/SPC/SPC005C.cshtml new file mode 100644 index 00000000..e3e6c292 --- /dev/null +++ b/AMESCoreStudio.Web/Views/SPC/SPC005C.cshtml @@ -0,0 +1,248 @@ +@model AMESCoreStudio.WebApi.Models.AMES.InspectionResultMaster + + +@{ ViewData["Title"] = "SPC005C"; + Layout = "~/Views/Shared/_AMESLayout.cshtml"; + //Layout = "~/Views/Shared/_FormLayout.cshtml"; +} + + + + + +
+ @*
+
+
+ + + + + + + +
+ + + +
+
+ + + +
+
+ + + +
+ @Html.ValidationMessage("error") +
+ + +
+
+
*@ +
+ + +
+
+ + + + + + +
+
+
+ + + +
+
+ + + +
+
+ + + +
+
+
+
+
+ @Html.ValidationMessage("error") + +
+
+
+
+
+
+
+
+ +@section Scripts { + @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); + await Html.RenderPartialAsync("_FileinputScriptsPartial"); } + + + + + + + + + +} + diff --git a/AMESCoreStudio.Web/Views/SPC/SPC005U.cshtml b/AMESCoreStudio.Web/Views/SPC/SPC005U.cshtml new file mode 100644 index 00000000..3084bb0c --- /dev/null +++ b/AMESCoreStudio.Web/Views/SPC/SPC005U.cshtml @@ -0,0 +1,60 @@ +@model AMESCoreStudio.WebApi.Models.AMES.InspectionItem + + +@{ ViewData["Title"] = "SPC003U"; + Layout = "~/Views/Shared/_FormLayout.cshtml"; } + + + + +
+
+
+
+ + + + + + + + +
+ + + +
+
+ + + +
+ @Html.ValidationMessage("error") +
+ +
+ +
+
+
+ +@section Scripts { + @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); + await Html.RenderPartialAsync("_FileinputScriptsPartial"); } + + + + +} + diff --git a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.Views.dll b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.Views.dll index d80ac8d7..29f44568 100644 Binary files a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.Views.dll and b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.Views.dll differ diff --git a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.Views.pdb b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.Views.pdb index 35574d92..d9682652 100644 Binary files a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.Views.pdb and b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.Views.pdb differ diff --git a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.dll b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.dll index 0ef7e6d5..5498bf12 100644 Binary files a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.dll and b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.dll differ diff --git a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.pdb b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.pdb index 3648f405..f73ac0a7 100644 Binary files a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.pdb and b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.pdb differ diff --git a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.Views.dll b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.Views.dll index 1f48514c..e27f08bf 100644 Binary files a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.Views.dll and b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.Views.dll differ diff --git a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.Views.pdb b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.Views.pdb index 4a394e88..18db3cfa 100644 Binary files a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.Views.pdb and b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.Views.pdb differ diff --git a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.dll b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.dll index 1d4850c1..0eaca881 100644 Binary files a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.dll and b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.dll differ diff --git a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.pdb b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.pdb index 38236cc5..eb353bc3 100644 Binary files a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.pdb and b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.pdb differ diff --git a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.xml b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.xml index dba9d9bc..6adb3f4f 100644 --- a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.xml +++ b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.xml @@ -112,6 +112,12 @@ + + + 查詢工單站別在製條碼資料 + + + 用工單號碼获取该條碼资料 @@ -119,6 +125,20 @@ 工單號碼 + + + 用客戶序號找條碼资料 + + 客戶序號 + + + + + 用包裝箱號获取该條碼资料 + + 包裝箱號 + + 更新條碼资料 @@ -322,6 +342,12 @@ barcodeID + + + 查詢工單站別條碼資料 + + + 用工單ID查是否有過站紀錄 @@ -905,11 +931,49 @@ 檢驗單明細資料檔 + + + By 入庫單號 序號 + + 入庫單號 + 序號 + + 入庫單資料檔 + + + 取最新入庫單號 + + + + + + + FQC查詢 by Table + + 內部序號 + 工單號碼 + 外箱號碼 + 入庫單號碼 + 入庫時間起 + 入庫時間迄 + 抽驗結果 + 頁數 + 筆數 + + + + + FQC抽驗資料 + + 入庫單號碼 + 序號 + + 更新入庫單 @@ -976,11 +1040,306 @@ FQC檢驗結果明細資料檔 + + + + + FQCID + + + + + 更新FQC檢驗結果明細 + + + + + + + 新增FQC檢驗結果明細 + + + + 檢驗單結果資料檔 + + + 用入庫單號 and 序號找資料 + + 入庫單號 + 序號 + + + + + 更新FQC檢驗單結果 + + + + + + + 新增FQC檢驗單結果 + + + + + + + 巡檢表單维护 + + + + + + + + + + + 获取全部巡檢表單 + + + + + + 用ID获取该巡檢表單 + + + + + + + 获取该巡檢表單By Query + + + + + + + + 更新巡檢表單资料 + + + + + + + + 新增巡檢表單资料 + + + + + + + 删除巡檢表單资料 + + + + + + + 巡檢細項维护 + + + + + + + + + + + 获取全部巡檢細項 + + + + + + 用ID获取该巡檢細項资料 + + + + + + + 用FormID获取该巡檢細項资料 + + + + + + + 更新巡檢細項料 + + + + + + + + 新增巡檢細項资料 + + + + + + + 删除巡檢細項资料 + + + + + + + 巡檢類別資料维护 + + + + + + + + + + + 获取全部巡檢類別資料 + + + + + + 用ID获取该巡檢類別資料 + + + + + + + 更新巡檢類別資料 + + + + + + + + 新增巡檢類別資料 + + + + + + + 删除巡檢類別資料 + + + + + + + 巡檢類別資料维护 + + + + + + + + + + + 获取全部巡檢類別資料 + + + + + + 用ID获取该巡檢類別資料 + + + + + + + 用FormID获取该巡檢結果资料 + + + + + + + 更新巡檢類別資料 + + + + + + + + 新增巡檢類別資料 + + + + + + + 删除巡檢類別資料 + + + + + + + 巡檢類別資料维护 + + + + + + + + + + + 获取全部巡檢類別資料 + + + + + + 用ID获取该巡檢類別資料 + + + + + + + 更新巡檢類別資料 + + + + + + + + 新增巡檢類別資料 + + + + + + + 删除巡檢類別資料 + + + + @@ -1172,7 +1531,7 @@ - 料號基本資料檔Controller + 料號對應組件資料檔Controller @@ -1244,33 +1603,64 @@ ItemID - + - 料號站別工項資料檔 + + - + - 料號站別工項資料檔 by ItemID + SOPFile資料查詢 - ItemID - + - 料號属性代碼基本檔 + SOPFile資料查詢 by ID - + + - + - 料號属性代碼基本檔資料 + SOP文件查詢 + 料號 + 生產單位 + 檔案名稱 + 狀態 + 建立日期起 + 建立日期迄 - + - 料號属性代碼基本檔 + 料號站別工項資料檔 + + + + + 料號站別工項資料檔 by ItemID + + ItemID + + + + + 料號属性代碼基本檔 + + + + + + 料號属性代碼基本檔資料 + + + + + + 料號属性代碼基本檔 MatPropertyID @@ -1585,7 +1975,7 @@ - + @@ -1607,7 +1997,7 @@ - + @@ -1798,6 +2188,21 @@ 抽驗標準資料檔 + + + ByQuotID + + QuotID + + + + + 根據抽驗係數與數量 回傳CritID + + QuotID + 抽驗數量 + + 更新抽驗標準 @@ -1917,6 +2322,20 @@ 抽驗批退資料檔 + + + 更新抽驗批退 + + + + + + + 新增抽驗批退 + + + + 組件類別資料維護 @@ -2484,7 +2903,7 @@ - + 工單條碼區間設定檔 @@ -2538,6 +2957,25 @@ + + + 檢驗结果維護資料檔 + + + + + ByWipID + + WipID + + + + + 更新工單箱號資料檔 + + + + @@ -2555,6 +2993,12 @@ + + + 查詢工單資料QRS009 + + + 查詢工單資料 by SelectParameter @@ -2699,7 +3143,7 @@ - + 工單MAC資料檔 @@ -2729,18 +3173,11 @@ - SOPFile資料查詢 - - - - - - SOPFile資料查詢 by ID + 工單投產纪錄資料文件 - - + SOP文件查詢 @@ -2752,28 +3189,39 @@ 建立日期迄 - + - + 工單各站數量資料檔 - - + - 工單投產纪錄資料文件 + 基本查詢 + 工單ID + 流程ID - + - SOP文件查詢 + 基本查詢 - 料號 - 生產單位 - 檔案名稱 - 狀態 - 建立日期起 - 建立日期迄 + 工單ID + 流程ID + + + + + 更新工單各站數量 + + + + + + + 新增工單各站數量 + + @@ -3012,6 +3460,13 @@ + + + 過站判斷 + + + + 判斷工單狀態 @@ -3022,16 +3477,6 @@ 流程 - - - 判斷序號狀態 - - - - - - - 內部序號查詢工單號碼 @@ -3077,14 +3522,23 @@ 作業站編號 - + 確認工單狀態 - 工單號碼 - 生產單位 - 流程 - 線別 + 工單號碼 + 生產單位 + 流程 + 線別 + 作業站 + + + + + 判斷序號狀態 + + 工單號碼 + 內部序號 @@ -3106,16 +3560,24 @@ 內部序號找BarCodeID - + 內部條碼 + 0:找不到 + + + + 料號找料號ID + + 料號 0:找不到 - + 取得上一個作業站RuleStationID - 工單號碼 - 作業站ID - 0:沒有上一站 + 工單ID + 目前作業站ID + 該工單號碼過站資料 + true:false @@ -3629,6 +4091,13 @@ + + + 根據下一站別IDD查詢 + + + + 更新流程規則資料 @@ -4457,7 +4926,7 @@ - 條碼鎖定ID + 工單號碼 @@ -4467,12 +4936,12 @@ - 工單號碼 + 生產單位 - 鎖定狀態(0:鎖定;1:解鎖) + List @@ -4535,2704 +5004,3410 @@ 解鎖日期 - + - MaterialKpDtp Select Dto + 入庫單資料檔 Dto - + - 料號KP_ID + 入庫單號碼 - + - 料號Name + 序號 - + - KP料號名稱 + h入庫單號碼 - + - KP料號NO + h序號 - + - 順序 + FqcID - + - 前置碼 + 工單號碼 - + - 長度 + 料號 - + - 站(前段) + 品名/機種 - + - 創建者ID + 本批完成量 - + - 創建日期 + 抽驗狀態 P-PASS(允收);R-REJECT(批退); A-初始狀態 - + - 更新者ID + 抽驗數量 - + - 更新日期 + PASS數量 - + - 抽驗標準資料檔 DTO + 不良數 - + - 抽驗標準ID + 允收數量 - + - 係數名稱 + 拒收數量 - + - 抽樣代碼 + 判定備註 - + - 抽樣點數 + 手動判定備註 - + - 抽樣數量 + 入庫單備註 - + - 允收數量 + 箱號 - + - 拒收數量 + 總數量 - + - 建立日期 + 已抽驗數 - + - 更新UserID + PASS數量 - + - 更新日期 + FAIL數量 - + - 檢驗項目維護資料檔 DTO + 入庫單資料檔 Dto - + - 檢驗項目ID + 入庫單號碼 - + - 檢驗類別名稱 + 順序ID - + - 檢驗項目中文 + 工單號碼 - + - 檢驗項目英文 + 料號 - + - 建立UserID + 品名/機種 - + - 建立日期 + 箱號/條碼 - + - 更新UserID + 抽驗狀態 P-PASS(允收);R-REJECT(批退); A-初始狀態 - + - 更新日期 + 產品類別 STANDARD(標準品),Order(訂單) - + - WipInfo Select Dto + 建立UserID - + - 工單號碼 + 建立日期 - + - 生產單位 + 更新UserID - + - 線別ID + 更新日期 - + - 日期查詢開始 + 入庫單資料檔 Dto - + - 日期查詢結束 + 入庫單號碼 - + - 料號 + 序號 - + - WipInfo Select Dto + FqcID - + - 工單鎖定ID + 箱號 - + - 工單號碼 + 生產序號 - + - 鎖定狀態(0:鎖定;1:解鎖) + 外部序號 - + - 料號 + 狀態 P-PASS;F-FAIL;C-CPN - + - 鎖定原因 - - - - - 解鎖原因 - - - - - 站別ID + 不良代碼 - + - 鎖定類型 + 不良備註 - + - 鎖定原因類別(0-3C認證工單;1-驗證工單;3-維修換料待分析) + MaterialKpDtp Select Dto - + - 鎖定人員 + 料號KP_ID - + - 鎖定日期 + 料號Name - + - 解鎖人員 + KP料號名稱 - + - 解鎖日期 + KP料號NO - + - WipMasterData Dto + 順序 - + - 工單號碼 + 前置碼 - + - 生產單位 + 長度 - + - 線別ID + 站(前段) - + - 日期查詢開始 + 創建者ID - + - 日期查詢結束 + 創建日期 - + - 料號 + 更新者ID - + - 是否有過站 + 更新日期 - + WipInfo Select Dto - + - WIP_SOP_ID + MATERIAL_SOP_ID - + 料號 - + 生產單位 - + 上傳檔案名稱 - + 存放檔案名稱 - + 檔案路徑 - + Y:使用中N:停用 - + 建立UserID - + 建立日期 - + 更新UserID - + 更新日期 - + - + 抽驗標準資料檔 DTO - + - 编号 + 抽驗標準ID - + - 账户编号 + 係數名稱 - + - 登录平台 + 抽樣代碼 - + - 最后登录时间戳 + 抽樣點數 - + - 最后登录IP + 抽樣數量 - + - + 允收數量 - + - 公告編號 + 拒收數量 - + - 公告標題 + 建立日期 - + - 公告內容 + 更新UserID - + - 公告時間 + 更新日期 - + - 公告天數 + 檢驗項目維護資料檔 DTO - + - 建立人員 + 檢驗項目ID - + - 建立時間 + 檢驗類別名稱 - + - 修改人員 + 檢驗項目中文 - + - 修改時間 + 檢驗項目英文 - + - + 建立UserID - + - + 建立日期 - + - 用户名 + 更新UserID - + - 密码 + 更新日期 - + - 平台 + WipInfo Select Dto - + - 登錄IP + 工單號碼 - + - 报错信息 + 生產單位 - + - + 線別ID - + - 认证信息 + 日期查詢開始 - + - 账户类型 + 日期查詢結束 - + - 系统操作员 + 料號 - + - 普通管理员 + WipInfo Select Dto - + - 部门类别 + 工單鎖定ID - + - 廠別 + 工單號碼 - + - 部門 + 鎖定狀態(0:鎖定;1:解鎖) - + - + 料號 - + - 外部異常 + 鎖定原因 - + - 內部異常 + 解鎖原因 - + - 平台类型 + 站別ID - + - 未知 + 鎖定類型 - + - Web + 鎖定原因類別(0-3C認證工單;1-驗證工單;3-維修換料待分析) - + - Mobile + 鎖定人員 - + - WeChat + 鎖定日期 - + - 激活状态 + 解鎖人員 - + - 未激活 + 解鎖日期 - + - 正常 + WipMasterData Dto - + - 禁用 + 工單號碼 - + - 注销 + 生產單位 - + - + 線別ID - + - + 日期查詢開始 - - + - + 日期查詢結束 - - + - + 料號 - + - + 是否有過站 - + - + (過站資料)BarCodeCheck Dto - + - + 工單號碼 - + - + 內部條碼 - + - + 過站狀態 M:一般 S:維修 - + - + 生產單位 - + - + 作業站 - + - + 線別站 - + - + 紀錄組件或不良代碼 - + - + 治具條碼 - + - 工廠 + 紀錄組件或不良代碼 - + - 單位 + 刷入類型 NG or KP(Item_No) - - ClassInfo - 線別 + + + 刷入組件資料或不良代碼 - + - 班别資料 + 組件:舊組件序號 - - TIME_SEGMENT - 生產時段 + + + 治具條碼 - + - 工作臺類別 + 刷入治具條碼 - + - 工作臺 + - + - 責任單位資料 + 编号 - + - 郵件群组類别 + 账户编号 - + - 郵件群组資料 + 登录平台 - + - 測試代號 + 最后登录时间戳 - + - List + 最后登录IP - + - 正背面 + - + - 工單性質 + 公告編號 - + - 產品別 + 公告標題 - + - 工單機種資料 + 公告內容 - + - 工單基本資料文件 + 公告時間 - + - 流程資料 + 公告天數 - + - 流程站別資料 + 建立人員 - + - 流程規則資料 + 建立時間 - + - 條碼狀態資料 + 修改人員 - + - 異常群組資料 + 修改時間 - + - 異常類別資料 + - + - 工單狀態資料 + - + - 工單鎖定資料檔 + 用户名 - + - 工單條碼起迄資料檔 + 密码 - + - 異常原因資料 + 平台 - + - 工單投產纪錄資料文件 + 登錄IP - + - 工單投產纪錄資料文件 + 报错信息 - + - 工單投產纪錄資料文件 + - + - 維修群組資料 + 认证信息 - + - 維修類別資料 + 账户类型 - + - 維修原因資料 + 系统操作员 - + - 機種C/T資料 + 普通管理员 - + - 問題類別資料 + 部门类别 - + - 維修方式資料 + 廠別 - + - 組件類別資料 + 部門 - + - 序號料號資料 + - + - 組件料號序號資料 + 外部異常 - + - 組件類別資料 + 內部異常 - + - MAC資料 + 平台类型 - + - SOP文件維護 + 未知 - + - + Web - + - 工單資訊-板卡工程資訊 + Mobile - + - 工單資訊-系統組裝工程資訊 + WeChat - + - 工單資訊-系統組裝工程資訊 + 激活状态 - + - 工單對應SOP文件log + 未激活 - + - 工單資料-標籤 + 正常 - + - 工單MAC資料檔 + 禁用 - + - 工單條碼規則設定文件檔 + 注销 - + - 工單條碼區間設定檔(除内部SN) + - - - 條碼資料 - - - - - 條碼组件資料 - + + + + + - - - 工時群組資料 - + + + + + - - - 工作類別資料 - + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 工廠 + + + + + 單位 + + + + ClassInfo + 線別 + + + + + 班别資料 + + + + TIME_SEGMENT + 生產時段 + + + + + 工作臺類別 + + + + + 工作臺 + + + + + 責任單位資料 + + + + + 郵件群组類别 + + + + + 郵件群组資料 + + + + + 測試代號 + + + + + List + + + + + 正背面 + + + + + 工單性質 + + + + + 產品別 + + + + + 工單機種資料 + + + + + 工單基本資料文件 + + + + + 流程資料 + + + + + 流程站別資料 + + + + + 流程規則資料 + + + + + 條碼狀態資料 + + + + + 異常群組資料 + + + + + 異常類別資料 + + + + + 工單狀態資料 + + + + + 工單鎖定資料檔 + + + + + 工單條碼起迄資料檔 + + + + + 異常原因資料 + + + + + 工單投產纪錄資料文件 + + + + + 工單投產纪錄資料文件 + + + + + 工單投產纪錄資料文件 + + + + + 維修群組資料 + + + + + 維修類別資料 + + + + + 維修原因資料 + + + + + 機種C/T資料 + + + + + 問題類別資料 + + + + + 維修方式資料 + + + + + 組件類別資料 + + + + + 序號料號資料 + + + + + 組件料號序號資料 + + + + + 組件類別資料 + + + + + MAC資料 + + + + + SOP文件維護 + + + + + + + + + + 工單資訊-板卡工程資訊 + + + + + 工單資訊-系統組裝工程資訊 + + + + + 工單資訊-系統組裝工程資訊 + + + + + 工單對應SOP文件log + + + + + 工單資料-標籤 + + + + + 工單MAC資料檔 + + + + + 工單條碼規則設定文件檔 + + + + + 工單條碼區間設定檔(除内部SN) + + + + + 條碼資料 + + + + + 條碼组件資料 + + + + + 工時群組資料 + + + + + 工作類別資料 + + + + 標準工時資料 - - - 每日出勤資料 - + + + 每日出勤資料 + + + + + 援入援外資料 + + + + + 異常工時資料 + + + + + 重工工時資料 + + + + + 無效工時在線收集資料 + + + + + 條碼類別資料檔 + + + + + 料號属性代碼基本檔 + + + + + 條碼组件變更資料 + + + + + 料號站別工項資料檔 + + + + + 料號治具資訊資料檔 + + + + + 條碼鎖定資料表 + + + + + 檔案用途 條碼工單資料檔 + + + + + 測試不良基本資料檔 + + + + + 條碼過站資料檔 + + + + + 條碼關聯資料檔 + + + + + 料號流程資料檔 + + + + + 燒机時間資料檔 + + + + + 檢驗類別維護資料檔 + + + + + 檢驗項目維護資料檔 + + + + + 檢驗结果維護資料檔 + + + + + 抽驗係数資料檔 + + + + + 抽驗標準資料檔 + + + + + 入庫單資料檔 + + + + + 檢驗單明細資料檔 + + + + + 檢驗單結果資料檔 + + + + + FQC檢驗結果明細資料檔 + + + + + FQC條碼資料檔 + + + + + FQC细目資料檔 + + + + + 抽驗批退資料檔 + + + + + 測試不良基本資料檔 + + + + + 維修紀錄資料檔 + + + + + 不良維修資料檔 + + + + + 維修解碼上傳圖檔資料表 + + + + + 過站狀態檔 + + + + + 異常工時類別資料檔 + + + + + 異常工時CODE資料檔 + + + + + 異常工時REASON資料檔 + + + + + 工單箱號資料檔 + + + + + 巡檢類別資料檔 + + + + + 工單各站數量資料檔 + + + + + 巡檢表單資料檔 + + + + + 巡檢項目資料檔 + + + + + 巡檢項目資料檔 + + + + + 巡檢項目資料檔 + + + + + 巡檢項目資料檔 + + + + + 條碼變更資料表 + + + + + 條碼ID + + + + + 舊條碼序號 + + + + + 建立者 + + + + + 建立時間 + + + + + 修改時間 + + + + + 條碼關聯資料檔 + + + + + GROUP ID + + + + + 條碼ID + + + + + 順序 + + + + + 條碼變更資料表 + + + + + 條碼ID + + + + + 條碼序號 + + + + + 條碼狀態代碼 + + + + + 客戶條碼 + + + + + 存放位置ID + + + + + 條碼過站位置 + + + + + 條碼過站狀態 P:PASS F:不良 + + + + + 工單ID + + + + + 包装箱號 + + + + + 系统狀態 + + + + + 條碼流程狀態 + + + + + 建立者 + - - - 援入援外資料 - + + + 建立時間 + - - - 異常工時資料 - + + + 修改時間 + - - - 重工工時資料 - + + + 工單資料 + - - - 無效工時在線收集資料 - + + + 流程站別資料 + - + - 條碼類別資料檔 + 條碼组件資料檔 - + - 料號属性代碼基本檔 + 條碼組件ID - - - 條碼组件變更資料 - + + + 内部條碼ID + - + - 料號站別工項資料檔 + 工單ID - + - 料號治具資訊資料檔 + 流程站别ID - + - 條碼鎖定資料表 + 组件代碼 - + - 檔案用途 條碼工單資料檔 + 组件條碼 - + - 測試不良基本資料檔 + 系统狀態 - + - 條碼過站資料檔 + 组件料號 - + - 條碼關聯資料檔 + 建立者 - + - 料號流程資料檔 + 建立時間 - + - 燒机時間資料檔 + 修改時間 - + - 檢驗類別維護資料檔 + 條碼资料 - + - 檢驗項目維護資料檔 + 組件资料 - + - 檢驗结果維護資料檔 + 站別资料 - + - 抽驗係数資料檔 + 條碼组件變更資料檔 - + - 抽驗標準資料檔 + 内部條碼ID - + - 入庫單資料檔 + 内部條碼ID - + - 檢驗單明細資料檔 + 组件條碼 - + - 檢驗單結果資料檔 + 系统狀態 - + - FQC檢驗結果明細資料檔 + 组件代碼 - + - FQC條碼資料檔 + 流程站别ID - + - FQC细目資料檔 + 工單ID - + - 抽驗批退資料檔 + 组件料號 - + - 測試不良基本資料檔 + 建立者 - + - 維修紀錄資料檔 + 建立時間 - + - 不良維修資料檔 + 修改時間 - + - 維修解碼上傳圖檔資料表 + 條碼鎖定資料表 - + - 過站狀態檔 + 條鎖定ID - + - 異常工時類別資料檔 + 條碼ID - + - 異常工時CODE資料檔 + 工單ID - + - 異常工時REASON資料檔 + 條碼流程狀態 - + - 條碼變更資料表 + 鎖定原因 - + - 條碼ID + 解鎖原因 - + - 舊條碼序號 + 條碼鎖定狀態(0-鎖定; 1-解鎖) - + - 建立者 + 鎖定者 - + - 建立時間 + 鎖定時間 + + + + + 解鎖者 + + + + + 解鎖時間 + + + + + 條碼Info + + + + + 條碼過站資料檔 + + + + + 內部條碼ID + + + + + 工單ID + + + + + 流程站別ID + + + + + 規則狀態值 + + + + + 投入日期 + + + + + 系统狀態 + + + + + 線别ID + + + + + 站别的次數 + + + + + 過站次數(不限定工單) - + - 修改時間 + 建立者 - + - 條碼關聯資料檔 + 建立時間 - + - GROUP ID + 條碼狀態資料表 - + - 條碼ID + 條碼狀態代碼 - + - 順序 + 條碼狀態描述 - + - 條碼變更資料表 + 條碼類別資料檔 - + - 條碼ID + 條碼類別ID - + - 條碼序號 + 類別代碼 - + - 條碼狀態代碼 + 類別描述 - + - 客戶條碼 + 當前值 - + - 存放位置ID + 創建者ID - + - 條碼過站位置 + 創建日期 - + - 條碼過站狀態 + 更新者ID - + - 工單ID + 更新日期 - + - 包装箱號 + 檔案用途 條碼工單資料檔 - + - 系统狀態 + 內部條碼ID - + - 條碼流程狀態 + 工單ID - + 建立者 - + 建立時間 - + 修改時間 - + - 工單資料 + 機種C/T資料表 - + - 流程站別資料 + 料號 - + - 條碼组件資料檔 + 每個產出時間 - + - 條碼組件ID + 每分鐘產出個數 - + - 内部條碼ID + 線別ID - + - 工單ID + 生產單位 - + - 流程站别ID + 首件產出時間 - + - 组件代碼 + 良品產出時間 - + - 组件條碼 + 作業人數 - + - 系统狀態 + 日產能 - + - 组件料號 + 月產出 - + - 建立者 + 週產出 - + - 建立時間 + 備註 - + - 修改時間 + 建立者 - + - 條碼资料 + 建立日期 - + - 組件资料 + 修改日期 - + - 站別资料 + 線別資料 - + - 條碼组件變更資料檔 + 製程資料 - + - 内部條碼ID + 异常类别资料表 - + - 内部條碼ID + 異常類別代碼 - + - 组件條碼 + 異常群組代碼 - + - 系统狀態 + 異常類別名稱 - + - 组件代碼 + 异常群组资料表 - + - 流程站别ID + 異常群組代碼 - + - 工單ID + 異常群組名稱 - + - 组件料號 + 异常代码资料表 - + - 建立者 + 異常原因代碼 - + - 建立時間 + 異常類別代碼 - + - 修改時間 + 異常原因描述 - + - 條碼鎖定資料表 + 異常原因英文描述 - + - 條鎖定ID + 內外部損耗分類 - + - 條碼ID + 責任單位 - + - 工單ID + 內部流程代碼 - + - 條碼流程狀態 + 成本屬性代碼 - + - 鎖定原因 + 生產單位 - + - 解鎖原因 + 异常工時类别资料表 - + - 條碼鎖定狀態(0-鎖定; 1-解鎖) + 異常工時類別代碼 - + - 鎖定者 + 異常類別名稱 - + - 鎖定時間 + 異常群組代碼 - + - 解鎖者 + 建立UserID - + - 解鎖時間 + 建立日期 - + - 條碼Info + 更新UserID - + - 條碼過站資料檔 + 更新日期 - + - 內部條碼ID + 異常工時代碼資料檔 - + + + 異常工時代碼代碼 + + + - 工單ID + 異常工時群組代碼 - + - 流程站別ID + 異常工時描述 - + - 規則狀態值 + 異常工時描述 - + - 投入日期 + 備註 - + - 系统狀態 + 狀態 - + - 線别ID + 建立UserID - + - 站别的次數 + 建立日期 - + - 過站次數(不限定工單) + 更新UserID - + - 建立者 + 更新日期 - + - 建立時間 + 异常代码资料表 - + - 條碼狀態資料表 + 異常原因代碼 - + - 條碼狀態代碼 + 異常類別代碼 - + - 條碼狀態描述 + 異常原因描述 - + - 條碼類別資料檔 + 異常原因英文描述 - + - 條碼類別ID + 備註 - + - 類別代碼 + 狀態 - + - 類別描述 + 建立UserID - + - 當前值 + 建立日期 - + - 創建者ID + 更新UserID - + - 創建日期 + 更新日期 - + - 更新者ID + 異常工時資料 - + - 更新日期 + 異常工時ID - + - 檔案用途 條碼工單資料檔 + 廠別 - + - 內部條碼ID + 制程代碼 - + - 工單ID + 線別 - + - 建立者 + 異常日期 - + - 建立時間 + 異常班別 - + - 修改時間 + 異常代碼 - + - 機種C/T資料表 + 歸屬工單 - + - 料號 + 機種 - + - 每個產出時間 + 異常工時(Min) - + - 每分鐘產出個數 + 歸屬部門 - + - 線別ID + 異常備註 - + - 生產單位 + 站別ID - + - 首件產出時間 + T2站點姓名 - + - 良品產出時間 + 起始時間 - + - 作業人數 + 結束時間 - + - 日產能 + 判定單位 - + - 月產出 + 判定負責人 - + - 週產出 + 責任單位(回覆) - + - 備註 + 回覆: 回覆對策 - + - 建立者 + 異常人數 - + - 建立日期 + 回覆: 判定描述 - + + + 回覆: 判定類別 + + + - 修改日期 + 回覆: 回覆日期 - + - 線別資料 + 回覆: 回覆備註 - + - 製程資料 + 判定單位ID - + - 异常类别资料表 + 判定負責人ID - + - 異常類別代碼 + 責任單位ID - + - 異常群組代碼 + 責任人ID - + - 異常類別名稱 + 責任人工號 - + - 异常群组资料表 + 建立者 - + - 異常群組代碼 + 建立日期 - + - 異常群組名稱 + 修改者 - + - 异常代码资料表 + 修改日期 - + - 異常原因代碼 + 無效工時在線收集資料檔 - + - 異常類別代碼 + 異常工時ID - + - 異常原因描述 + 廠別 - + - 異常原因英文描述 + 制程代碼 - + - 內外部損耗分類 + 線別 - + - 責任單位 + 站別ID - + - 內部流程代碼 + 收集人員工號 - + - 成本屬性代碼 + 異常日期 - + - 生產單位 + 異常班別 - + - 异常工時类别资料表 + 異常代碼 - + - 異常工時類別代碼 + 工單號碼 - + - 異常類別名稱 + 機種 - + - 異常群組代碼 + 起始時間 - + - 建立UserID + 結束時間 - + - 建立日期 + 異常人數 - + - 更新UserID + 異常工時(Min) - + - 更新日期 + 歸屬部門 - + - 異常工時代碼資料檔 + 判定單位 - + - 異常工時代碼代碼 + 判定負責人 - + - 異常工時群組代碼 + 判定單位ID - + - 異常工時描述 + 判定負責人ID - + - 異常工時描述 + 判定類別 - + - 備註 + 判定描述 - + - 狀態 + 無效工時收集標誌 - + - 建立UserID + 建立者 - + 建立日期 - + - 更新UserID + 修改者 - + - 更新日期 + 修改日期 - + - 异常代码资料表 + FQC條碼資料檔 - + - 異常原因代碼 + FQC序號ID - + - 異常類別代碼 + 條碼序號ID - + - 異常原因描述 + 狀態 P-PASS;F-FAIL;C-CPN - + - 異常原因英文描述 + 建立UserID - + - 備註 + 建立日期 - + - 狀態 + 更新UserID - + - 建立UserID + 更新日期 - + - 建立日期 + 檢驗單明細資料檔 - + - 更新UserID + 入庫單號碼 - + - 更新日期 + 順序ID - + - 異常工時資料 + 箱號/條碼 - + - 異常工時ID + 單號產生類型 B-按箱號產生;A-按條碼產生 - + - 廠別 + 建立UserID - + - 制程代碼 + 建立日期 - + - 線別 + 更新UserID - + - 異常日期 + 更新日期 - + - 異常班別 + 入庫單資料檔 - + - 異常代碼 + 入庫單號碼 - + - 歸屬工單 + 順序ID - + - 機種 + 工單號碼 - + - 異常工時(Min) + 料號 - + - 歸屬部門 + 品名/機種 - + - 異常備註 + PCB版本 - + - 站別ID + 本批完成量 - + - T2站點姓名 + 工單總數量 - + - 起始時間 + 累計完成量 - + - 結束時間 + 入庫廠别 - + - 判定單位 + 庫位 - + - 判定負責人 + 抽驗標準ID - + - 責任單位(回覆) + 抽驗狀態 P-PASS(允收);R-REJECT(批退); A-初始狀態 - + - 回覆: 回覆對策 + 產品類別 STANDARD(標準品),Order(訂單) - + - 異常人數 + 原批退入庫單 - + - 回覆: 判定描述 + 原批退入庫單備註 - - - 回覆: 判定類別 - + + + 建立UserID + - + - 回覆: 回覆日期 + 建立日期 - + - 回覆: 回覆備註 + 更新UserID - + - 判定單位ID + 更新日期 - + - 判定負責人ID + FQC细目資料檔 - + - 責任單位ID + FQC檢驗結果ID - + - 責任人ID + 细目序號ID - + - 責任人工號 + 细目内容 - + - 建立者 + 建立UserID - + 建立日期 - + - 修改者 + 更新UserID - + - 修改日期 + 更新日期 - + - 無效工時在線收集資料檔 + 檢驗结果維護資料檔 - + - 異常工時ID + 檢驗结果編號 - + - 廠別 + 檢驗结果中文名 - + - 制程代碼 + 檢驗结果英文名 - + - 線別 + 狀態 P:PASS F:FAIL - + - 站別ID + 建立UserID - + - 收集人員工號 + 建立日期 - + - 異常日期 + 更新UserID - + - 異常班別 + 更新日期 - + - 異常代碼 + FQC檢驗結果明細資料檔 - + - 工單號碼 + FQC檢驗結果ID - + - 機種 + 箱號 - + - 起始時間 + 生產序號 - + - 結束時間 + 外部序號 - + - 異常人數 + 狀態 P-PASS;F-FAIL;C-CPN - + - 異常工時(Min) + 不良代碼 - + - 歸屬部門 + 不良備註 - + - 判定單位 + 建立UserID - + - 判定負責人 + 建立日期 - + - 判定單位ID + 更新UserID - + - 判定負責人ID + 更新日期 - + - 判定類別 + 檢驗單結果資料檔 - + - 判定描述 + FQC檢驗結果ID - + - 無效工時收集標誌 + 入庫單號碼 - + - 建立者 + 順序ID(序號) - + - 建立日期 + 特採單號 - + - 修改者 + 本批次總數量 - + - 修改日期 + 工單號碼 - + - FQC條碼資料檔 + 抽驗结果 P-PASS(允收);R-REJECT(批退);A初始狀態 - + - FQC序號ID + 抽驗數量 - + - 條碼序號ID + PASS數量 - + - 狀態 P-PASS;F-FAIL;C-CPN + FAIL數量 - + - 建立UserID + 入庫單備註 - + - 建立日期 + 料號 - + - 更新UserID + 判定備註 - + - 更新日期 + 手動判定備註 - + - 檢驗單明細資料檔 + 品名/機種 - + - 入庫單號碼 + 批退類型 M - 重缺;S - 次缺 - + - 順序ID + 開始抽驗時間 - + - 箱號/條碼 + 結束抽驗時間 - + - 單號產生類型 B-按箱號產生;A-按條碼產生 + AQL有效標誌 Y – 有效計算項; N –無效計算項;(每次抓取Y的有效計算項來計算是否要調整AQL) - + 建立UserID - + 建立日期 - + 更新UserID - + 更新日期 - + - 入庫單資料檔 + 巡檢表單資料檔 - + - 入庫單號碼 + 巡檢表單ID - + - 順序ID + 巡檢類別ID - + - 工單號碼 + 巡檢表單名稱 - + - 料號 + 巡檢文件編號 - + - 品名/機種 + 巡檢文件說明 - + - PCB版本 + 歸屬製程 - + - 本批完成量 + 狀態 - + - 工單總數量 + 創建者ID - + - 累計完成量 + 創建日期 - + - 入庫廠别 + 更新者ID - + - 庫位 + 更新日期 - + - 抽驗標準ID + 巡檢項目資料檔 - + - 抽驗狀態 P-PASS(允收);R-REJECT(批退); A-初始狀態 + 巡檢項目ID - + - 產品類別 STANDARD(標準品),Order(訂單) + 巡檢表單ID - + - 原批退入庫單 + 巡檢項目名稱 - + - 原批退入庫單備註 + 巡檢項目順序 - + - 建立UserID + 創建者ID - + - 建立日期 + 創建日期 - + - 更新UserID + 更新者ID - + 更新日期 - - - FQC细目資料檔 - - - - - FQC檢驗結果ID - - - - - 细目序號ID - - - + - 细目内容 + 巡檢表單資料檔 - + - 建立UserID + 巡檢表單ID - + - 建立日期 + 巡檢類別ID - + - 更新UserID + 生產序號 - + - 更新日期 + 巡檢文件編號 - + - 檢驗结果維護資料檔 + 創建者ID - + - 檢驗结果編號 + 創建日期 - + - 檢驗结果中文名 + 更新者ID - + - 檢驗结果英文名 + 更新日期 - + - 狀態 P:PASS F:FAIL + 巡檢結果回覆明細資料檔 - + - 建立UserID + 巡檢結果ID - + - 建立日期 + 巡檢項目ID - + - 更新UserID + 線別 - + - 更新日期 + 站別ID - + - FQC檢驗結果明細資料檔 + 稽核結果 + P-PASS(允收) ; F-FAIL(批退) ; NA-無 ; A初始狀態 ; - + - FQC檢驗結果ID + 區域 - + - 箱號 + 位置 - + - 生產序號 + 缺失單位 - + - 外部序號 + 缺失站別 - + - 狀態 P-PASS;F-FAIL;C-CPN + 缺失人員ID - + - 不良代碼 + 缺失類型 - + - 不良備註 + 缺失備註 - + - 建立UserID + 是否需要對策 METHOD : Y-YES : N-NO - + - 建立日期 + 回覆原因 - + - 更新UserID + 回覆對策 - + - 更新日期 + 回覆人員ID - + - 檢驗單結果資料檔 + 創建者ID - + - FQC檢驗結果ID + 創建日期 - + - 入庫單號碼 + 更新者ID - + - 順序ID(序號) + 更新日期 - + - 本批次總數量 + 巡檢結果回覆資料檔 - + - 工單號碼 + 巡檢結果ID - + - 抽驗结果 P-PASS(允收);R-REJECT(批退);A初始狀態 + 巡檢項目ID - + - 抽驗數量 + 生產序號 - + - PASS數量 + 工單號碼 - + - FAIL數量 + 料號 - + - 入庫單備註 + 料號 - + - 料號 + 創建者ID - + - 判定備註 + 創建日期 - + - 手動判定備註 + 更新者ID - + - 品名/機種 + 更新日期 - + - 批退類型 M - 重缺;S - 次缺 + 巡檢類別資料檔 - + - 開始抽驗時間 + 巡檢類別ID - + - 結束抽驗時間 + 巡檢類別 - + - AQL有效標誌 Y – 有效計算項; N –無效計算項;(每次抓取Y的有效計算項來計算是否要調整AQL) + 狀態 - + - 建立UserID + 創建者ID - + - 建立日期 + 創建日期 - + - 更新UserID + 更新者ID - + 更新日期 @@ -7567,6 +8742,71 @@ 料號主檔 + + + SOP文件紀錄 + + + + + MaterialSopID + + + + + 料號 + + + + + 生產單位ID + + + + + 上傳檔案名稱 + + + + + 存放檔案名稱 + + + + + 檔案路徑 + + + + + Y:使用中N:停用 + + + + + 建立UserID + + + + + 建立日期 + + + + + 更新UserID + + + + + 更新日期 + + + + + 生產單位資料 + + 料號站別工項資料檔 @@ -7932,9 +9172,9 @@ 內部條碼ID - + - 流程站別ID + 作業站ID @@ -8132,34 +9372,14 @@ 不良維修ID - - - 圖檔名稱1 - - - - - 圖檔1 - - - - - 圖檔名稱2 - - - - - 圖檔2 - - - + - 圖檔名稱3 + 圖檔名稱 - + - 圖檔3 + 圖檔 @@ -8502,7 +9722,7 @@ 客戶類別 1-醫療 2-VIP - + 條碼序號 @@ -8512,6 +9732,11 @@ 工單ID + + + 箱號 + + 流程站別ID @@ -8527,11 +9752,6 @@ 允收原因 - - - 特採單號 - - 批退典型 @@ -9312,6 +10532,61 @@ 更新日期 + + + 工單箱號資料檔 + + + + + 箱號ID + + + + + 箱號 + + + + + 工單ID + + + + + 單箱數量 + + + + + 箱號狀態(0 = 停用 ; 1= 使用中) + + + + + 重量 + + + + + 建立UserID + + + + + 建立日期 + + + + + 更新UserID + + + + + 更新日期 + + 工單基本資料文件 @@ -9749,42 +11024,22 @@ - SOP文件紀錄 - - - - - WIP_SOP_ID - - - - - 料號 - - - - - 生產單位ID - - - - - 上傳檔案名稱 + 工單對應SOP文件紀錄 - + - 存放檔案名稱 + WIP_ID - + - 檔案路徑 + MATERIAL_SOP_ID - + - Y:使用中N:停用 + 狀態 @@ -9807,59 +11062,59 @@ 更新日期 - + - 生產單位資料 + 工單資料 - + - 工單對應SOP文件紀錄 + SOP資料 - + - WIP_ID + 工單各站數量資料檔 - + - WIP_SOP_ID + 工單ID - + - 狀態 + 流程站?ID - + - 建立UserID + 過站狀態 - + - 建立日期 + 第一次過站數量 - + - 更新UserID + 過站數量 - + - 更新日期 + 建立UserID - + - 工單資料 + 建立日期 - + - SOP資料 + 更新日期 diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/InspectionFormsController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/InspectionFormsController.cs new file mode 100644 index 00000000..c95b281f --- /dev/null +++ b/AMESCoreStudio.WebApi/Controllers/AMES/InspectionFormsController.cs @@ -0,0 +1,203 @@ +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; + + +namespace AMESCoreStudio.WebApi.Controllers.AMES +{ + /// + /// 巡檢表單维护 + /// + [Route("api/[controller]")] + [ApiController] + public class InspectionFormsController : ControllerBase + { + private readonly AMESContext _context; + + /// + /// + /// + /// + public InspectionFormsController(AMESContext context) + { + _context = context; + } + + /// + /// 获取全部巡檢表單 + /// + /// + // GET: api/InspectionForms + [HttpGet] + public async Task>> GetInspectionForms() + { + IQueryable q = _context.InspectionForms; + q = q.OrderBy(p => p.InspectionFormID); + var InspectionForms = await q.ToListAsync(); + + if (InspectionForms == null) + { + return NotFound(); + } + + return InspectionForms; + } + + /// + /// 用ID获取该巡檢表單 + /// + /// + /// + // GET: api/InspectionForms/5 + [HttpGet("{id}")] + public async Task>> GetInspectionForms(int id) + { + + IQueryable q = _context.InspectionForms; + q = q.Where(p => p.InspectionFormID.Equals(id)); + var InspectionForm = await q.ToListAsync(); + + if (InspectionForm == null) + { + return NotFound(); + } + + return InspectionForm; + } + + /// + /// 获取该巡檢表單By Query + /// + /// + /// + /// + // GET: api/InspectionForms/Query/5 + [HttpGet("Query/{id}/{status}")] + public async Task>> GetInspectionFormsByQuery(int id,string status) + { + + IQueryable q = _context.InspectionForms; + q = q.Where(p => p.InspectionTypeID.Equals(id)); + q = q.Where(p => p.StatusNo.Equals(status)); + var InspectionForm = await q.ToListAsync(); + + if (InspectionForm == null) + { + return NotFound(); + } + + return InspectionForm; + } + + /// + /// 更新巡檢表單资料 + /// + /// + /// + /// + // PUT: api/InspectionForms/5 + // 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. + [HttpPut("{id}")] + public async Task> PutInspectionForms(int id, [FromBody] InspectionForm InspectionForm) + { + ResultModel result = new ResultModel(); + if (id != InspectionForm.InspectionFormID) + { + result.Success = false; + result.Msg = "序號錯誤"; + return result; + } + + _context.Entry(InspectionForm).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; + } + + /// + /// 新增巡檢表單资料 + /// + /// + /// + // POST: api/InspectionForms + // 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] + public async Task> PostInspectionForms(InspectionForm InspectionForm) + { + ResultModel result = new ResultModel(); + Helper helper = new Helper(_context); + var InspectionFormID = helper.GetIDKey("InspectionFormID").Result; + + InspectionForm.InspectionFormID = InspectionFormID; + _context.InspectionForms.Add(InspectionForm); + try + { + await _context.SaveChangesAsync(); + } + catch (Exception e) + { + result.Success = false; + result.Msg = e.Message; + return result; + } + + result.Success = true; + result.Msg = "OK"; + return result; + + } + + /// + /// 删除巡檢表單资料 + /// + /// + /// + // DELETE: api/InspectionForms/5 + [HttpDelete("{id}")] + public async Task> DeleteInspectionForms(int id) + { + ResultModel result = new ResultModel(); + var InspectionForm = await _context.InspectionForms.Where(m => m.InspectionFormID == id).FirstOrDefaultAsync(); + if (InspectionForm == null) + { + result.Success = false; + result.Msg = "序號不存在"; + return result; + } + + _context.InspectionForms.Remove(InspectionForm); + await _context.SaveChangesAsync(); + + result.Success = true; + result.Msg = "OK"; + return result; + } + + private bool InspectionFormsExists(int id) + { + return _context.InspectionForms.Any(e => e.InspectionFormID == id); + } + + } +} diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/InspectionItemsController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/InspectionItemsController.cs new file mode 100644 index 00000000..ea0d5cf9 --- /dev/null +++ b/AMESCoreStudio.WebApi/Controllers/AMES/InspectionItemsController.cs @@ -0,0 +1,211 @@ +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; + + +namespace AMESCoreStudio.WebApi.Controllers.AMES +{ + /// + /// 巡檢細項维护 + /// + [Route("api/[controller]")] + [ApiController] + public class InspectionItemsController : ControllerBase + { + private readonly AMESContext _context; + + /// + /// + /// + /// + public InspectionItemsController(AMESContext context) + { + _context = context; + } + + /// + /// 获取全部巡檢細項 + /// + /// + // GET: api/InspectionItems + [HttpGet] + public async Task>> GetInspectionItems() + { + IQueryable q = _context.InspectionItems; + q = q.OrderBy(p => p.InspectionItemID); + + var InspectionItems = await q.ToListAsync(); + + return InspectionItems; + } + + /// + /// 用ID获取该巡檢細項资料 + /// + /// + /// + // GET: api/InspectionItems/5 + [HttpGet("{id}")] + public async Task>> GetInspectionItems(int id) + { + + IQueryable q = _context.InspectionItems; + q = q.Where(p => p.InspectionItemID.Equals(id)); + var InspectionItem = await q.ToListAsync(); + + if (InspectionItem == null) + { + return NotFound(); + } + + return InspectionItem; + } + + /// + /// 用FormID获取该巡檢細項资料 + /// + /// + /// + // GET: api/InspectionItems/5 + [HttpGet("Form/{id}")] + public async Task>> GetInspectionItemsByFormID(int id) + { + + IQueryable q = _context.InspectionItems; + q = q.Where(p => p.InspectionFormID.Equals(id)); + var InspectionItem = await q.ToListAsync(); + + if (InspectionItem == null) + { + return NotFound(); + } + + return InspectionItem; + } + + /// + /// 更新巡檢細項料 + /// + /// + /// + /// + // PUT: api/InspectionItems/5 + // 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. + [HttpPut("{id}")] + public async Task> PutInspectionItems(int id, [FromBody] InspectionItem InspectionItem) + { + ResultModel result = new ResultModel(); + _context.Entry(InspectionItem).State = EntityState.Modified; + + try + { + await _context.SaveChangesAsync(); + result.Success = true; + result.Msg = "OK"; + } + catch (Exception ex) + { + result.Success = false; + result.Msg = ex.Message; + } + return result; + //if (id != InspectionItem.InspectionItemID) + //{ + // result.Success = false; + // result.Msg = "序號錯誤"; + // return result; + //} + + //_context.Entry(InspectionItem).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; + } + + /// + /// 新增巡檢細項资料 + /// + /// + /// + // POST: api/InspectionItems + // 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] + public async Task> PostInspectionItems(InspectionItem InspectionItem) + { + ResultModel result = new ResultModel(); + Helper helper = new Helper(_context); + var InspectionItemID = helper.GetIDKey("InspectionItemID").Result; + //請RITA加ID + InspectionItem.InspectionItemID = InspectionItemID; + _context.InspectionItems.Add(InspectionItem); + try + { + await _context.SaveChangesAsync(); + } + catch (Exception e) + { + result.Success = false; + result.Msg = e.Message; + return result; + } + + result.Success = true; + result.Msg = "OK"; + return result; + + } + + /// + /// 删除巡檢細項资料 + /// + /// + /// + // DELETE: api/InspectionItems/5 + [HttpDelete("{id}")] + public async Task> DeleteInspectionItems(int id) + { + ResultModel result = new ResultModel(); + var InspectionItem = await _context.InspectionItems.Where(m => m.InspectionItemID == id).FirstOrDefaultAsync(); + if (InspectionItem == null) + { + result.Success = false; + result.Msg = "序號不存在"; + return result; + } + + _context.InspectionItems.Remove(InspectionItem); + await _context.SaveChangesAsync(); + + result.Success = true; + result.Msg = "OK"; + return result; + } + + private bool InspectionItemsExists(int id) + { + return _context.InspectionItems.Any(e => e.InspectionItemID == id); + } + + } +} diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/InspectionResultDetailsController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/InspectionResultDetailsController.cs new file mode 100644 index 00000000..baf11102 --- /dev/null +++ b/AMESCoreStudio.WebApi/Controllers/AMES/InspectionResultDetailsController.cs @@ -0,0 +1,176 @@ +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; + + +namespace AMESCoreStudio.WebApi.Controllers.AMES +{ + /// + /// 巡檢類別資料维护 + /// + [Route("api/[controller]")] + [ApiController] + public class InspectionResultDetailsController : ControllerBase + { + private readonly AMESContext _context; + + /// + /// + /// + /// + public InspectionResultDetailsController(AMESContext context) + { + _context = context; + } + + /// + /// 获取全部巡檢類別資料 + /// + /// + // GET: api/InspectionResultDetails + [HttpGet] + public async Task>> GetInspectionResultDetails() + { + IQueryable q = _context.InspectionResultDetails; + q = q.OrderBy(p => p.InspectionID); + q = q.OrderBy(p => p.InspectionItemID); + + var InspectionResultDetails = await q.ToListAsync(); + + return InspectionResultDetails; + } + + /// + /// 用ID获取该巡檢類別資料 + /// + /// + /// + // GET: api/InspectionResultDetails/5 + [HttpGet("{id}")] + public async Task>> GetInspectionResultDetails(int id) + { + + IQueryable q = _context.InspectionResultDetails; + q = q.Where(p => p.InspectionID.Equals(id)); + var InspectionResultDetail = await q.ToListAsync(); + + if (InspectionResultDetail == null) + { + return NotFound(); + } + + return InspectionResultDetail; + } + + /// + /// 更新巡檢類別資料 + /// + /// + /// + /// + // PUT: api/InspectionResultDetails/5 + // 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. + [HttpPut("{id}")] + public async Task> PutInspectionResultDetails(int id, [FromBody] InspectionResultDetail InspectionResultDetail) + { + ResultModel result = new ResultModel(); + if (id != InspectionResultDetail.InspectionID) + { + result.Success = false; + result.Msg = "序號錯誤"; + return result; + } + + _context.Entry(InspectionResultDetail).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; + } + + /// + /// 新增巡檢類別資料 + /// + /// + /// + // POST: api/InspectionResultDetails + // 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] + public async Task> PostInspectionResultDetails(InspectionResultDetail InspectionResultDetail) + { + ResultModel result = new ResultModel(); + Helper helper = new Helper(_context); + var InspectionResultDetailID = helper.GetIDKey("InspectionResultDetailID").Result; + + InspectionResultDetail.InspectionID = InspectionResultDetailID; + _context.InspectionResultDetails.Add(InspectionResultDetail); + try + { + await _context.SaveChangesAsync(); + } + catch (Exception e) + { + result.Success = false; + result.Msg = e.Message; + return result; + } + + result.Success = true; + result.Msg = "OK"; + return result; + + } + + /// + /// 删除巡檢類別資料 + /// + /// + /// + // DELETE: api/InspectionResultDetails/5 + [HttpDelete("{id}")] + public async Task> DeleteInspectionResultDetails(int id) + { + ResultModel result = new ResultModel(); + var inspectionType = await _context.InspectionResultDetails.Where(m => m.InspectionID == id).FirstOrDefaultAsync(); + if (inspectionType == null) + { + result.Success = false; + result.Msg = "序號不存在"; + return result; + } + + _context.InspectionResultDetails.Remove(inspectionType); + await _context.SaveChangesAsync(); + + result.Success = true; + result.Msg = "OK"; + return result; + } + + private bool InspectionResultDetailsExists(int id) + { + return _context.InspectionResultDetails.Any(e => e.InspectionID == id); + } + + } +} diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/InspectionResultMastersController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/InspectionResultMastersController.cs new file mode 100644 index 00000000..3025e07f --- /dev/null +++ b/AMESCoreStudio.WebApi/Controllers/AMES/InspectionResultMastersController.cs @@ -0,0 +1,199 @@ +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; + + +namespace AMESCoreStudio.WebApi.Controllers.AMES +{ + /// + /// 巡檢類別資料维护 + /// + [Route("api/[controller]")] + [ApiController] + public class InspectionResultMastersController : ControllerBase + { + private readonly AMESContext _context; + + /// + /// + /// + /// + public InspectionResultMastersController(AMESContext context) + { + _context = context; + } + + /// + /// 获取全部巡檢類別資料 + /// + /// + // GET: api/InspectionResultMasters + [HttpGet] + public async Task>> GetInspectionResultMasters() + { + IQueryable q = _context.InspectionResultMasters; + q = q.OrderBy(p => p.InspectionID); + + var InspectionResultMasters = await q.ToListAsync(); + + return InspectionResultMasters; + } + + /// + /// 用ID获取该巡檢類別資料 + /// + /// + /// + // GET: api/InspectionResultMasters/5 + [HttpGet("{id}")] + public async Task>> GetInspectionResultMasters(int id) + { + + IQueryable q = _context.InspectionResultMasters; + q = q.Where(p => p.InspectionID.Equals(id)); + var InspectionResultMaster = await q.ToListAsync(); + + if (InspectionResultMaster == null) + { + return NotFound(); + } + + return InspectionResultMaster; + } + + /// + /// 用FormID获取该巡檢結果资料 + /// + /// + /// + // GET: api/InspectionItems/5 + [HttpGet("Form/{id}")] + public async Task>> GetInspectionResultMastersByFormID(int id) + { + + IQueryable q = _context.InspectionResultMasters; + q = q.Where(p => p.InspectionFormID.Equals(id)); + var InspectionResultMaster = await q.ToListAsync(); + + if (InspectionResultMaster == null) + { + return NotFound(); + } + + return InspectionResultMaster; + } + + /// + /// 更新巡檢類別資料 + /// + /// + /// + /// + // PUT: api/InspectionResultMasters/5 + // 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. + [HttpPut("{id}")] + public async Task> PutInspectionResultMasters(int id, [FromBody] InspectionResultMaster InspectionResultMaster) + { + ResultModel result = new ResultModel(); + if (id != InspectionResultMaster.InspectionID) + { + result.Success = false; + result.Msg = "序號錯誤"; + return result; + } + + _context.Entry(InspectionResultMaster).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; + } + + /// + /// 新增巡檢類別資料 + /// + /// + /// + // POST: api/InspectionResultMasters + // 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] + public async Task> PostInspectionResultMasters(InspectionResultMaster InspectionResultMaster) + { + ResultModel result = new ResultModel(); + Helper helper = new Helper(_context); + var InspectionResultMasterID = helper.GetIDKey("InspectionResultMasterID").Result; + //請RITA加ID + InspectionResultMaster.InspectionID = InspectionResultMasterID; + _context.InspectionResultMasters.Add(InspectionResultMaster); + try + { + await _context.SaveChangesAsync(); + } + catch (Exception e) //catch (DbUpdateException) + { + + result.Success = false; + result.Msg = e.Message; + return result; + + } + + result.Success = true; + result.Msg = "OK"; + return result; + + } + + /// + /// 删除巡檢類別資料 + /// + /// + /// + // DELETE: api/InspectionResultMasters/5 + [HttpDelete("{id}")] + public async Task> DeleteInspectionResultMasters(int id) + { + ResultModel result = new ResultModel(); + var inspectionType = await _context.InspectionResultMasters.Where(m => m.InspectionID == id).FirstOrDefaultAsync(); + if (inspectionType == null) + { + result.Success = false; + result.Msg = "序號不存在"; + return result; + } + + _context.InspectionResultMasters.Remove(inspectionType); + await _context.SaveChangesAsync(); + + result.Success = true; + result.Msg = "OK"; + return result; + } + + private bool InspectionResultMastersExists(int id) + { + return _context.InspectionResultMasters.Any(e => e.InspectionID == id); + } + + } +} diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/InspectionTypesController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/InspectionTypesController.cs new file mode 100644 index 00000000..1fa5a264 --- /dev/null +++ b/AMESCoreStudio.WebApi/Controllers/AMES/InspectionTypesController.cs @@ -0,0 +1,175 @@ +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; + + +namespace AMESCoreStudio.WebApi.Controllers.AMES +{ + /// + /// 巡檢類別資料维护 + /// + [Route("api/[controller]")] + [ApiController] + public class InspectionTypesController : ControllerBase + { + private readonly AMESContext _context; + + /// + /// + /// + /// + public InspectionTypesController(AMESContext context) + { + _context = context; + } + + /// + /// 获取全部巡檢類別資料 + /// + /// + // GET: api/InspectionTypes + [HttpGet] + public async Task>> GetInspectionTypes() + { + IQueryable q = _context.InspectionTypes; + q = q.OrderBy(p => p.InspectionTypeID); + + var InspectionTypes = await q.ToListAsync(); + + return InspectionTypes; + } + + /// + /// 用ID获取该巡檢類別資料 + /// + /// + /// + // GET: api/InspectionTypes/5 + [HttpGet("{id}")] + public async Task>> GetInspectionTypes(int id) + { + + IQueryable q = _context.InspectionTypes; + q = q.Where(p => p.InspectionTypeID.Equals(id)); + var InspectionType = await q.ToListAsync(); + + if (InspectionType == null) + { + return NotFound(); + } + + return InspectionType; + } + + /// + /// 更新巡檢類別資料 + /// + /// + /// + /// + // PUT: api/InspectionTypes/5 + // 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. + [HttpPut("{id}")] + public async Task> PutInspectionTypes(int id, [FromBody] InspectionType InspectionType) + { + ResultModel result = new ResultModel(); + if (id != InspectionType.InspectionTypeID) + { + result.Success = false; + result.Msg = "序號錯誤"; + return result; + } + + _context.Entry(InspectionType).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; + } + + /// + /// 新增巡檢類別資料 + /// + /// + /// + // POST: api/InspectionTypes + // 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] + public async Task> PostInspectionTypes(InspectionType InspectionType) + { + ResultModel result = new ResultModel(); + Helper helper = new Helper(_context); + var InspectionTypeID = helper.GetIDKey("InspectionTypeID").Result; + //請RITA加ID + InspectionType.InspectionTypeID = InspectionTypeID; + _context.InspectionTypes.Add(InspectionType); + try + { + await _context.SaveChangesAsync(); + } + catch (Exception e) + { + result.Success = false; + result.Msg = e.Message; + return result; + } + + result.Success = true; + result.Msg = "OK"; + return result; + + } + + /// + /// 删除巡檢類別資料 + /// + /// + /// + // DELETE: api/InspectionTypes/5 + [HttpDelete("{id}")] + public async Task> DeleteInspectionTypes(int id) + { + ResultModel result = new ResultModel(); + var inspectionType = await _context.InspectionTypes.Where(m => m.InspectionTypeID == id).FirstOrDefaultAsync(); + if (inspectionType == null) + { + result.Success = false; + result.Msg = "序號不存在"; + return result; + } + + _context.InspectionTypes.Remove(inspectionType); + await _context.SaveChangesAsync(); + + result.Success = true; + result.Msg = "OK"; + return result; + } + + private bool InspectionTypesExists(int id) + { + return _context.InspectionTypes.Any(e => e.InspectionTypeID == id); + } + + } +} diff --git a/AMESCoreStudio.WebApi/Models/AMES/InspectionForm.cs b/AMESCoreStudio.WebApi/Models/AMES/InspectionForm.cs new file mode 100644 index 00000000..37c25525 --- /dev/null +++ b/AMESCoreStudio.WebApi/Models/AMES/InspectionForm.cs @@ -0,0 +1,111 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; + +#nullable disable + +namespace AMESCoreStudio.WebApi.Models.AMES +{ + /// + /// 巡檢表單資料檔 + /// + [Table("INSPECTION_FORM", Schema = "JHAMES")] + public partial class InspectionForm + { + /// + /// 巡檢表單ID + /// + [Key] + [Column("INSPECTION_FORMID")] + [DataMember] + public int InspectionFormID { get; set; } + + /// + /// 巡檢類別ID + /// + [Column("INSPECTION_TYPEID")] + [DataMember] + public int InspectionTypeID { get; set; } + + /// + /// 巡檢表單名稱 + /// + + [Column("INSPECTION_NAME")] + [StringLength(10)] + [Display(Name = "巡檢表單名稱")] + [DataMember] + [Required(ErrorMessage = "{0},不能空白")] + public string InspectionName { get; set; } + + /// + /// 巡檢文件編號 + /// + + [Column("INSPECTION_NO")] + [StringLength(50)] + [Display(Name = "巡檢文件編號")] + [DataMember] + [Required(ErrorMessage = "{0},不能空白")] + public string InspectionNo { get; set; } + + /// + /// 巡檢文件說明 + /// + + [Column("INSPECTION_DESC")] + [StringLength(100)] + [Display(Name = "巡檢文件說明")] + [DataMember] + public string InspectionDesc { get; set; } + /// + /// 歸屬製程 + /// + [Column("UNIT_NO")] + [StringLength(20)] + [Required(ErrorMessage = "{0},不能空白")] + [Display(Name = "歸屬製程")] + [DataMember] + public string UnitNo { get; set; } + + /// + /// 狀態 + /// + [Column("STATUS_NO")] + [StringLength(2)] + [Required(ErrorMessage = "{0},不能空白")] + [Display(Name = "狀態")] + [DataMember] + public string StatusNo { get; set; } = "A"; + + + /// + /// 創建者ID + /// + [Column("CREATE_USERID")] + [DataMember] + public int CreateUserID { get; set; } = 0; + + /// + /// 創建日期 + /// + [Column("CREATE_DATE")] + [DataMember] + public DateTime CreateDate { get; set; } = System.DateTime.Now; + + /// + /// 更新者ID + /// + [Column("UPDATE_USERID")] + [DataMember] + public int UpdateUserID { get; set; } = 0; + + /// + /// 更新日期 + /// + [Column("UPDATE_DATE")] + [DataMember] + public DateTime UpdateDate { get; set; } = System.DateTime.Now; + } +} diff --git a/AMESCoreStudio.WebApi/Models/AMES/InspectionItem.cs b/AMESCoreStudio.WebApi/Models/AMES/InspectionItem.cs new file mode 100644 index 00000000..379dabdf --- /dev/null +++ b/AMESCoreStudio.WebApi/Models/AMES/InspectionItem.cs @@ -0,0 +1,82 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; + +#nullable disable + +namespace AMESCoreStudio.WebApi.Models.AMES +{ + /// + /// 巡檢項目資料檔 + /// + [Table("INSPECTION_ITEM", Schema = "JHAMES")] + public partial class InspectionItem + { + /// + /// 巡檢項目ID + /// + [Key] + [Column("INSPECTION_ITEMID")] + [DataMember] + public int InspectionItemID { get; set; } + + /// + /// 巡檢表單ID + /// + [Column("INSPECTION_FORMID")] + [DataMember] + public int InspectionFormID { get; set; } + + + /// + /// 巡檢項目名稱 + /// + + [Column("INSPECTION_ITEM_NAME")] + [StringLength(200)] + [Display(Name = "巡檢項目名稱")] + [DataMember] + [Required(ErrorMessage = "{0},不能空白")] + public string InspectionItemName { get; set; } + + /// + /// 巡檢項目順序 + /// + + [Column("INSPECTION_ITEM_SEQ")] + [Display(Name = "巡檢項目順序")] + [DataMember] + [Required(ErrorMessage = "{0},不能空白")] + public int InspectionItemSeq { get; set; } + + + /// + /// 創建者ID + /// + [Column("CREATE_USERID")] + [DataMember] + public int CreateUserID { get; set; } = 0; + + /// + /// 創建日期 + /// + [Column("CREATE_DATE")] + [DataMember] + public DateTime CreateDate { get; set; } = System.DateTime.Now; + + /// + /// 更新者ID + /// + [Column("UPDATE_USERID")] + [DataMember] + public int UpdateUserID { get; set; } = 0; + + /// + /// 更新日期 + /// + [Column("UPDATE_DATE")] + [DataMember] + public DateTime UpdateDate { get; set; } = System.DateTime.Now; + } +} diff --git a/AMESCoreStudio.WebApi/Models/AMES/InspectionResultBlob.cs b/AMESCoreStudio.WebApi/Models/AMES/InspectionResultBlob.cs new file mode 100644 index 00000000..63fa7b61 --- /dev/null +++ b/AMESCoreStudio.WebApi/Models/AMES/InspectionResultBlob.cs @@ -0,0 +1,79 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; + +#nullable disable + +namespace AMESCoreStudio.WebApi.Models.AMES +{ + /// + /// 巡檢表單資料檔 + /// + [Table("INSPECTION_RESULT_BLOB", Schema = "JHAMES")] + public partial class InspectionResultBlob + { + /// + /// 巡檢表單ID + /// + [Key] + [Column("INSPECTION_ID")] + [DataMember] + public int InspectionID { get; set; } + + /// + /// 巡檢類別ID + /// + [Column("INSPECTION_ITEMID")] + [DataMember] + public int InspectionItemID { get; set; } + + /// + /// 生產序號 + /// + [Column("IMAGE_NAME")] + [StringLength(50)] + [Display(Name = "生產序號")] + [DataMember] + [Required(ErrorMessage = "{0},不能空白")] + public string ImageName { get; set; } + + /// + /// 巡檢文件編號 + /// + [Column("IMAGE_BLOB")] + [StringLength(50)] + [Display(Name = "巡檢文件編號")] + [DataMember] + [Required(ErrorMessage = "{0},不能空白")] + public byte[] ImageBlob { get; set; } + + /// + /// 創建者ID + /// + [Column("CREATE_USERID")] + [DataMember] + public int CreateUserID { get; set; } = 0; + + /// + /// 創建日期 + /// + [Column("CREATE_DATE")] + [DataMember] + public DateTime CreateDate { get; set; } = System.DateTime.Now; + + /// + /// 更新者ID + /// + [Column("UPDATE_USERID")] + [DataMember] + public int UpdateUserID { get; set; } = 0; + + /// + /// 更新日期 + /// + [Column("UPDATE_DATE")] + [DataMember] + public DateTime UpdateDate { get; set; } = System.DateTime.Now; + } +} diff --git a/AMESCoreStudio.WebApi/Models/AMES/InspectionResultDetail.cs b/AMESCoreStudio.WebApi/Models/AMES/InspectionResultDetail.cs new file mode 100644 index 00000000..2d5c8979 --- /dev/null +++ b/AMESCoreStudio.WebApi/Models/AMES/InspectionResultDetail.cs @@ -0,0 +1,190 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; +using Microsoft.EntityFrameworkCore; + +#nullable disable + +namespace AMESCoreStudio.WebApi.Models.AMES +{ + /// + /// 巡檢結果回覆明細資料檔 + /// + [Keyless] + [Table("INSPECTION_RESULT_DETAIL", Schema = "JHAMES")] + public partial class InspectionResultDetail + { + /// + /// 巡檢結果ID + /// + [Column("INSPECTION_ID")] + [DataMember] + public int InspectionID { get; set; } + + /// + /// 巡檢項目ID + /// + [Column("INSPECTION_ITEMID")] + [DataMember] + public int InspectionItemID { get; set; } + + /// + /// 線別 + /// + [Column("LINE_ID")] + [Display(Name = "線別")] + [DataMember] + [Required(ErrorMessage = "{0},不能空白")] + public int LineID { get; set; } + + /// + /// 站別ID + /// + [Column("STATION_ID")] + [Display(Name = "抽驗站別")] + [DataMember] + [Required(ErrorMessage = "{0},不能空白")] + public int RuleStationID { get; set; } + + /// + /// 稽核結果 + /// P-PASS(允收) ; F-FAIL(批退) ; NA-無 ; A初始狀態 ; + /// + [Column("INSPECTION_RESULT")] + [StringLength(20)] + [Display(Name = "稽核結果")] + [DataMember] + [Required(ErrorMessage = "{0},不能空白")] + public string Result { get; set; } + + /// + /// 區域 + /// + [Column("AREA")] + [StringLength(10)] + [Display(Name = "區域")] + [DataMember] + public string Area { get; set; } + + /// + /// 位置 + /// + [Column("LOCATION")] + [StringLength(10)] + [Display(Name = "位置")] + [DataMember] + public string Location { get; set; } + + /// + /// 缺失單位 + /// + [Column("MISSING_UNIT_NO")] + [StringLength(2)] + [Display(Name = "缺失單位")] + [DataMember] + public string MissingUnitNo { get; set; } + + /// + /// 缺失站別 + /// + [Column("MISSING_STATION_ID")] + [Display(Name = "缺失站別")] + [DataMember] + [Required(ErrorMessage = "{0},不能空白")] + public int MissingStationID { get; set; } + + /// + /// 缺失人員ID + /// + [Column("MISSING_USERID")] + [Display(Name = "缺失人員")] + [DataMember] + [Required(ErrorMessage = "{0},不能空白")] + public int MissingUserID { get; set; } + + /// + /// 缺失類型 + /// + [Column("MISSING_TYPE")] + [StringLength(10)] + [Display(Name = "缺失類型")] + [DataMember] + public string MissingType { get; set; } + + /// + /// 缺失備註 + /// + [Column("MISSING_REMARK")] + [StringLength(100)] + [Display(Name = "缺失備註")] + [DataMember] + public string MissingRemark { get; set; } + + /// + /// 是否需要對策 METHOD : Y-YES : N-NO + /// + [Column("METHOD")] + [StringLength(100)] + [Display(Name = "是否需要對策")] + [DataMember] + public string Method { get; set; } + + + /// + /// 回覆原因 + /// + [Column("REPLY_REASON")] + [StringLength(100)] + [Display(Name = "回覆原因")] + [DataMember] + public string PeplyReason { get; set; } + + /// + /// 回覆對策 + /// + [Column("REPLY_METHOD")] + [StringLength(100)] + [Display(Name = "回覆對策")] + [DataMember] + public string PeplyMethod { get; set; } + + + /// + /// 回覆人員ID + /// + [Column("REPLY_USERID")] + [Display(Name = "回覆人員")] + [DataMember] + public int PeplyUserID { get; set; } + + + /// + /// 創建者ID + /// + [Column("CREATE_USERID")] + [DataMember] + public int CreateUserID { get; set; } = 0; + + /// + /// 創建日期 + /// + [Column("CREATE_DATE")] + [DataMember] + public DateTime CreateDate { get; set; } = System.DateTime.Now; + + /// + /// 更新者ID + /// + [Column("UPDATE_USERID")] + [DataMember] + public int UpdateUserID { get; set; } = 0; + + /// + /// 更新日期 + /// + [Column("UPDATE_DATE")] + [DataMember] + public DateTime UpdateDate { get; set; } = System.DateTime.Now; + } +} diff --git a/AMESCoreStudio.WebApi/Models/AMES/InspectionResultMaster.cs b/AMESCoreStudio.WebApi/Models/AMES/InspectionResultMaster.cs new file mode 100644 index 00000000..778518e1 --- /dev/null +++ b/AMESCoreStudio.WebApi/Models/AMES/InspectionResultMaster.cs @@ -0,0 +1,99 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; + +#nullable disable + +namespace AMESCoreStudio.WebApi.Models.AMES +{ + /// + /// 巡檢結果回覆資料檔 + /// + [Table("INSPECTION_RESULT_MASTER", Schema = "JHAMES")] + public partial class InspectionResultMaster + { + /// + /// 巡檢結果ID + /// + [Key] + [Column("INSPECTION_ID")] + [DataMember] + public int InspectionID { get; set; } + + /// + /// 巡檢項目ID + /// + [Column("INSPECTION_FORMID")] + [DataMember] + public int InspectionFormID { get; set; } + + /// + /// 生產序號 + /// + [Column("BARCODE_NO")] + [StringLength(30)] + [Display(Name = "生產序號")] + [DataMember] + [Required(ErrorMessage = "{0},不能空白")] + public string BarcodeNo { get; set; } + + /// + /// 工單號碼 + /// + [Column("WIP_NO")] + [StringLength(30)] + [Display(Name = "工單號碼")] + [DataMember] + [Required(ErrorMessage = "{0},不能空白")] + public string WipNo { get; set; } + + /// + /// 料號 + /// + [Column("ITEM_NO")] + [StringLength(20)] + [Display(Name = "料號")] + [DataMember] + [Required(ErrorMessage = "{0},不能空白")] + public string ItemNo { get; set; } + + /// + /// 料號 + /// + [Column("STATUS_NO")] + [StringLength(1)] + [Display(Name = "狀態")] + [DataMember] + [Required(ErrorMessage = "{0},不能空白")] + public string StatusNo { get; set; } + + /// + /// 創建者ID + /// + [Column("CREATE_USERID")] + [DataMember] + public int CreateUserID { get; set; } = 0; + + /// + /// 創建日期 + /// + [Column("CREATE_DATE")] + [DataMember] + public DateTime CreateDate { get; set; } = System.DateTime.Now; + + /// + /// 更新者ID + /// + [Column("UPDATE_USERID")] + [DataMember] + public int UpdateUserID { get; set; } = 0; + + /// + /// 更新日期 + /// + [Column("UPDATE_DATE")] + [DataMember] + public DateTime UpdateDate { get; set; } = System.DateTime.Now; + } +} diff --git a/AMESCoreStudio.WebApi/Models/AMES/InspectionType.cs b/AMESCoreStudio.WebApi/Models/AMES/InspectionType.cs new file mode 100644 index 00000000..87ae460f --- /dev/null +++ b/AMESCoreStudio.WebApi/Models/AMES/InspectionType.cs @@ -0,0 +1,74 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; + +#nullable disable + +namespace AMESCoreStudio.WebApi.Models.AMES +{ + /// + /// 巡檢類別資料檔 + /// + [Table("INSPECTION_TYPE", Schema = "JHAMES")] + public partial class InspectionType + { + /// + /// 巡檢類別ID + /// + [Key] + [Column("INSPECTION_TYPEID")] + [DataMember] + public int InspectionTypeID { get; set; } + + /// + /// 巡檢類別 + /// + + [Column("INSPECTION_NO")] + [StringLength(20)] + [Display(Name = "巡檢類別代碼")] + [DataMember] + [Required(ErrorMessage = "{0},不能空白")] + public string InspectionNo { get; set; } + + /// + /// 狀態 + /// + [Column("STATUS_NO")] + [StringLength(2)] + [Required(ErrorMessage = "{0},不能空白")] + [Display(Name = "狀態")] + [DataMember] + public string StatusNo { get; set; } = "A"; + + + /// + /// 創建者ID + /// + [Column("CREATE_USERID")] + [DataMember] + public int CreateUserID { get; set; } = 0; + + /// + /// 創建日期 + /// + [Column("CREATE_DATE")] + [DataMember] + public DateTime CreateDate { get; set; } = System.DateTime.Now; + + /// + /// 更新者ID + /// + [Column("UPDATE_USERID")] + [DataMember] + public int UpdateUserID { get; set; } = 0; + + /// + /// 更新日期 + /// + [Column("UPDATE_DATE")] + [DataMember] + public DateTime UpdateDate { get; set; } = System.DateTime.Now; + } +} diff --git a/AMESCoreStudio.WebApi/Models/AMESContext.cs b/AMESCoreStudio.WebApi/Models/AMESContext.cs index e5c0f52d..f3941269 100644 --- a/AMESCoreStudio.WebApi/Models/AMESContext.cs +++ b/AMESCoreStudio.WebApi/Models/AMESContext.cs @@ -94,6 +94,12 @@ namespace AMESCoreStudio.WebApi //modelBuilder.Entity().HasOne(r => r.User).WithMany().HasForeignKey(r => r.OperatorID).IsRequired(); modelBuilder.Entity().HasKey(c => new { c.WipID, c.RuleStationID, c.RuleStatus, c.CreateDate}); + + + + modelBuilder.Entity().HasKey(c => new { c.InspectionItemID, c.InspectionID,c.CreateDate }); + + } /// @@ -370,6 +376,7 @@ namespace AMESCoreStudio.WebApi /// /// SOP文件維護 /// + //public virtual DbSet WipSops { get; set; } public virtual DbSet MaterialSops { get; set; } public virtual DbSet MaterialItems { get; set; } @@ -636,11 +643,41 @@ namespace AMESCoreStudio.WebApi /// 工單箱號資料檔 /// public virtual DbSet WipBoxs { get; set; } + /// + /// 巡檢類別資料檔 + /// + public virtual DbSet InspectionTypes { get; set; } /// /// 工單各站數量資料檔 /// public virtual DbSet WipStations { get; set; } + /// + /// 巡檢表單資料檔 + /// + public virtual DbSet InspectionItems { get; set; } + + /// + /// 巡檢項目資料檔 + /// + public virtual DbSet InspectionForms { get; set; } + + /// + /// 巡檢項目資料檔 + /// + public virtual DbSet InspectionResultMasters { get; set; } + + /// + /// 巡檢項目資料檔 + /// + public virtual DbSet InspectionResultDetails { get; set; } + + /// + /// 巡檢項目資料檔 + /// + public virtual DbSet InspectionResultBlobs { get; set; } + + } } diff --git a/AMESCoreStudio.WebApi/appsettings.json b/AMESCoreStudio.WebApi/appsettings.json index 08513781..413c8ca6 100644 --- a/AMESCoreStudio.WebApi/appsettings.json +++ b/AMESCoreStudio.WebApi/appsettings.json @@ -7,8 +7,8 @@ } }, "ConnectionStrings": { - "AMESContext": "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.5)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=gdb)));User Id=JHSYS;Password=ASYS666;", - "AMESContext2": "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=61.216.68.18)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=jhdb)));User Id=system;Password=admin;" + "AMESContext2": "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.5)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=gdb)));User Id=JHSYS;Password=12345;", + "AMESContext": "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=61.216.68.18)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=jhdb)));User Id=system;Password=admin;" //"AMESContext": "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=61.216.68.18)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=cpadb)));User Id=JHSYS;Password=ASYS666;" }, "AllowedHosts": "*" diff --git a/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.Views.dll b/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.Views.dll index 1f48514c..e27f08bf 100644 Binary files a/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.Views.dll and b/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.Views.dll differ diff --git a/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.dll b/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.dll index 1d4850c1..0eaca881 100644 Binary files a/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.dll and b/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.dll differ diff --git a/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.pdb b/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.pdb index 38236cc5..eb353bc3 100644 Binary files a/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.pdb and b/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.pdb differ diff --git a/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.xml b/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.xml index ddfac69d..4b40f6df 100644 --- a/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.xml +++ b/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/AMESCoreStudio.WebApi.xml @@ -1069,6 +1069,258 @@ + + + 巡檢表單维护 + + + + + + + + + + + 获取全部巡檢表單 + + + + + + 用ID获取该巡檢表單 + + + + + + + 获取该巡檢表單By Query + + + + + + + + 更新巡檢表單资料 + + + + + + + + 新增巡檢表單资料 + + + + + + + 删除巡檢表單资料 + + + + + + + 巡檢細項维护 + + + + + + + + + + + 获取全部巡檢細項 + + + + + + 用ID获取该巡檢細項资料 + + + + + + + 用FormID获取该巡檢細項资料 + + + + + + + 更新巡檢細項料 + + + + + + + + 新增巡檢細項资料 + + + + + + + 删除巡檢細項资料 + + + + + + + 巡檢類別資料维护 + + + + + + + + + + + 获取全部巡檢類別資料 + + + + + + 用ID获取该巡檢類別資料 + + + + + + + 更新巡檢類別資料 + + + + + + + + 新增巡檢類別資料 + + + + + + + 删除巡檢類別資料 + + + + + + + 巡檢類別資料维护 + + + + + + + + + + + 获取全部巡檢類別資料 + + + + + + 用ID获取该巡檢類別資料 + + + + + + + 用FormID获取该巡檢結果资料 + + + + + + + 更新巡檢類別資料 + + + + + + + + 新增巡檢類別資料 + + + + + + + 删除巡檢類別資料 + + + + + + + 巡檢類別資料维护 + + + + + + + + + + + 获取全部巡檢類別資料 + + + + + + 用ID获取该巡檢類別資料 + + + + + + + 更新巡檢類別資料 + + + + + + + + 新增巡檢類別資料 + + + + + + + 删除巡檢類別資料 + + + + @@ -6102,6 +6354,36 @@ 異常工時REASON資料檔 + + + 巡檢類別資料檔 + + + + + 巡檢表單資料檔 + + + + + 巡檢項目資料檔 + + + + + 巡檢項目資料檔 + + + + + 巡檢項目資料檔 + + + + + 巡檢項目資料檔 + + 條碼變更資料表 @@ -7767,6 +8049,357 @@ 更新日期 + + + 巡檢表單資料檔 + + + + + 巡檢表單ID + + + + + 巡檢類別ID + + + + + 巡檢表單名稱 + + + + + 巡檢文件編號 + + + + + 巡檢文件說明 + + + + + 歸屬製程 + + + + + 狀態 + + + + + 創建者ID + + + + + 創建日期 + + + + + 更新者ID + + + + + 更新日期 + + + + + 巡檢項目資料檔 + + + + + 巡檢項目ID + + + + + 巡檢表單ID + + + + + 巡檢項目名稱 + + + + + 巡檢項目順序 + + + + + 創建者ID + + + + + 創建日期 + + + + + 更新者ID + + + + + 更新日期 + + + + + 巡檢表單資料檔 + + + + + 巡檢表單ID + + + + + 巡檢類別ID + + + + + 生產序號 + + + + + 巡檢文件編號 + + + + + 創建者ID + + + + + 創建日期 + + + + + 更新者ID + + + + + 更新日期 + + + + + 巡檢結果回覆明細資料檔 + + + + + 巡檢結果ID + + + + + 巡檢項目ID + + + + + 線別 + + + + + 站別ID + + + + + 稽核結果 + P-PASS(允收) ; F-FAIL(批退) ; NA-無 ; A初始狀態 ; + + + + + 區域 + + + + + 位置 + + + + + 缺失單位 + + + + + 缺失站別 + + + + + 缺失人員ID + + + + + 缺失類型 + + + + + 缺失備註 + + + + + 是否需要對策 METHOD : Y-YES : N-NO + + + + + 回覆原因 + + + + + 回覆對策 + + + + + 回覆人員ID + + + + + 創建者ID + + + + + 創建日期 + + + + + 更新者ID + + + + + 更新日期 + + + + + 巡檢結果回覆資料檔 + + + + + 巡檢結果ID + + + + + 巡檢項目ID + + + + + 生產序號 + + + + + 工單號碼 + + + + + 料號 + + + + + 料號 + + + + + 創建者ID + + + + + 創建日期 + + + + + 更新者ID + + + + + 更新日期 + + + + + 巡檢類別資料檔 + + + + + 巡檢類別ID + + + + + 巡檢類別 + + + + + 狀態 + + + + + 創建者ID + + + + + 創建日期 + + + + + 更新者ID + + + + + 更新日期 + + 組件類別资料表 diff --git a/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/Microsoft.EntityFrameworkCore.SqlServer.dll b/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/Microsoft.EntityFrameworkCore.SqlServer.dll index 2b881a55..fefacefd 100644 Binary files a/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/Microsoft.EntityFrameworkCore.SqlServer.dll and b/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/Microsoft.EntityFrameworkCore.SqlServer.dll differ diff --git a/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/Newtonsoft.Json.dll b/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/Newtonsoft.Json.dll index b8ea6e0e..e2118f9b 100644 Binary files a/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/Newtonsoft.Json.dll and b/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/Newtonsoft.Json.dll differ diff --git a/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/appsettings.json b/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/appsettings.json index bdac5b8c..08513781 100644 --- a/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/appsettings.json +++ b/AMESCoreStudio.WebApi/bin/Debug/netcoreapp3.1/appsettings.json @@ -7,8 +7,9 @@ } }, "ConnectionStrings": { - "AMESContext": "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1522))(CONNECT_DATA=(SERVICE_NAME=xe)));User Id=JHAMES;Password=AMES666;", - "AMESContext1": "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=61.216.68.18)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=JHDB)));User Id=JHSYS;Password=ASYS666;" + "AMESContext": "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.5)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=gdb)));User Id=JHSYS;Password=ASYS666;", + "AMESContext2": "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=61.216.68.18)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=jhdb)));User Id=system;Password=admin;" + //"AMESContext": "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=61.216.68.18)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=cpadb)));User Id=JHSYS;Password=ASYS666;" }, "AllowedHosts": "*" }