24 changed files with 2365 additions and 1 deletions
@ -0,0 +1,496 @@ |
|||||
|
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; |
||||
|
|
||||
|
namespace AMESCoreStudio.Web.Controllers |
||||
|
{ |
||||
|
public class PPSController : Controller |
||||
|
{ |
||||
|
private readonly ILogger<PPSController> _logger; |
||||
|
public readonly IPPS _ppsApi; |
||||
|
public PPSController(ILogger<PPSController> logger, IPPS ppsApi) |
||||
|
{ |
||||
|
_logger = logger; |
||||
|
_ppsApi = ppsApi; |
||||
|
} |
||||
|
|
||||
|
private async Task GetErrorGroupListAll() |
||||
|
{ |
||||
|
var result = await _ppsApi.GetErrorGroups(); |
||||
|
|
||||
|
var ErrorGroupList = new List<SelectListItem>(); |
||||
|
ErrorGroupList.Add(new SelectListItem("全部", "*")); |
||||
|
|
||||
|
for (int i = 0; i < result.Count; i++) |
||||
|
{ |
||||
|
ErrorGroupList.Add(new SelectListItem(result[i].GroupName, result[i].GroupNo.ToString())); |
||||
|
} |
||||
|
ViewBag.ErrorGroupList = ErrorGroupList; |
||||
|
} |
||||
|
|
||||
|
private async Task GetErrorGroupList() |
||||
|
{ |
||||
|
var result = await _ppsApi.GetErrorGroups(); |
||||
|
|
||||
|
var ErrorGroupList = new List<SelectListItem>(); |
||||
|
|
||||
|
for (int i = 0; i < result.Count; i++) |
||||
|
{ |
||||
|
ErrorGroupList.Add(new SelectListItem(result[i].GroupName, result[i].GroupNo.ToString())); |
||||
|
} |
||||
|
ViewBag.ErrorGroupList = ErrorGroupList; |
||||
|
} |
||||
|
|
||||
|
#region PPS001工單狀態維護相關
|
||||
|
|
||||
|
public IActionResult PPS001() |
||||
|
{ |
||||
|
return View(); |
||||
|
} |
||||
|
|
||||
|
//新增頁面
|
||||
|
public IActionResult PPS001C() |
||||
|
{ |
||||
|
return View(); |
||||
|
} |
||||
|
|
||||
|
//修改页面
|
||||
|
[HttpGet] |
||||
|
public async Task<IActionResult> PPS001UAsync(string id) |
||||
|
{ |
||||
|
var result = await _ppsApi.GetWipStatus(id); |
||||
|
|
||||
|
if (result.Count == 0) |
||||
|
{ |
||||
|
return View(); |
||||
|
} |
||||
|
return View(result[0]); |
||||
|
} |
||||
|
|
||||
|
public async Task<IActionResult> PPS001DAsync(string id) |
||||
|
{ |
||||
|
var result = await _ppsApi.DeleteWipStatus(id); |
||||
|
return Json(new Result() { success = true, msg = "" }); |
||||
|
} |
||||
|
|
||||
|
//頁面提交,id=0 添加,id>0 修改
|
||||
|
[HttpPost] |
||||
|
public async Task<IActionResult> PPS001CSaveAsync(WipStatus model) |
||||
|
{ |
||||
|
if (ModelState.IsValid) |
||||
|
{ |
||||
|
IResultModel result; |
||||
|
|
||||
|
result = await _ppsApi.PostWipStatus(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("PPS001C", model); |
||||
|
} |
||||
|
|
||||
|
public async Task<IActionResult> PPS001USaveAsync(WipStatus model) |
||||
|
{ |
||||
|
if (ModelState.IsValid) |
||||
|
{ |
||||
|
IResultModel result; |
||||
|
|
||||
|
result = await _ppsApi.PutWipStatus(model.StatusNo, 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("PPS001U", model); |
||||
|
} |
||||
|
|
||||
|
[ResponseCache(Duration = 0)] |
||||
|
[HttpGet] |
||||
|
public async Task<IActionResult> GetWipStatusAsync() |
||||
|
{ |
||||
|
var result = await _ppsApi.GetWipStatus(); |
||||
|
|
||||
|
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 PPS002條碼狀態維護相關
|
||||
|
|
||||
|
public IActionResult PPS002() |
||||
|
{ |
||||
|
return View(); |
||||
|
} |
||||
|
|
||||
|
//新增頁面
|
||||
|
public IActionResult PPS002C() |
||||
|
{ |
||||
|
return View(); |
||||
|
} |
||||
|
|
||||
|
//修改页面
|
||||
|
[HttpGet] |
||||
|
public async Task<IActionResult> PPS002UAsync(string id) |
||||
|
{ |
||||
|
var result = await _ppsApi.GetBarcodeStatus(id); |
||||
|
|
||||
|
if (result.Count == 0) |
||||
|
{ |
||||
|
return View(); |
||||
|
} |
||||
|
return View(result[0]); |
||||
|
} |
||||
|
|
||||
|
public async Task<IActionResult> PPS002DAsync(string id) |
||||
|
{ |
||||
|
var result = await _ppsApi.DeleteBarcodeStatus(id); |
||||
|
return Json(new Result() { success = true, msg = "" }); |
||||
|
} |
||||
|
|
||||
|
//頁面提交,id=0 添加,id>0 修改
|
||||
|
[HttpPost] |
||||
|
public async Task<IActionResult> PPS002CSaveAsync(BarcodeStatus model) |
||||
|
{ |
||||
|
if (ModelState.IsValid) |
||||
|
{ |
||||
|
IResultModel result; |
||||
|
|
||||
|
result = await _ppsApi.PostBarcodeStatus(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("PPS002C", model); |
||||
|
} |
||||
|
|
||||
|
public async Task<IActionResult> PPS002USaveAsync(BarcodeStatus model) |
||||
|
{ |
||||
|
if (ModelState.IsValid) |
||||
|
{ |
||||
|
IResultModel result; |
||||
|
|
||||
|
result = await _ppsApi.PutBarcodeStatus(model.StatusNo, 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("PPS002U", model); |
||||
|
} |
||||
|
|
||||
|
[ResponseCache(Duration = 0)] |
||||
|
[HttpGet] |
||||
|
public async Task<IActionResult> GetBarcodeStatusAsync() |
||||
|
{ |
||||
|
var result = await _ppsApi.GetBarcodeStatus(); |
||||
|
|
||||
|
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 PPS005異常群組維護相關
|
||||
|
|
||||
|
public IActionResult PPS005() |
||||
|
{ |
||||
|
return View(); |
||||
|
} |
||||
|
|
||||
|
//新增頁面
|
||||
|
public IActionResult PPS005C() |
||||
|
{ |
||||
|
return View(); |
||||
|
} |
||||
|
|
||||
|
//修改页面
|
||||
|
[HttpGet] |
||||
|
public async Task<IActionResult> PPS005UAsync(string id) |
||||
|
{ |
||||
|
var result = await _ppsApi.GetErrorGroup(id); |
||||
|
|
||||
|
if (result.Count == 0) |
||||
|
{ |
||||
|
return View(); |
||||
|
} |
||||
|
return View(result[0]); |
||||
|
} |
||||
|
|
||||
|
public async Task<IActionResult> PPS005DAsync(string id) |
||||
|
{ |
||||
|
var result = await _ppsApi.DeleteErrorGroup(id); |
||||
|
return Json(new Result() { success = true, msg = "" }); |
||||
|
} |
||||
|
|
||||
|
//頁面提交,id=0 添加,id>0 修改
|
||||
|
[HttpPost] |
||||
|
public async Task<IActionResult> PPS005CSaveAsync(ErrorGroup model) |
||||
|
{ |
||||
|
if (ModelState.IsValid) |
||||
|
{ |
||||
|
IResultModel result; |
||||
|
|
||||
|
result = await _ppsApi.PostErrorGroup(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("PPS005C", model); |
||||
|
} |
||||
|
|
||||
|
public async Task<IActionResult> PPS005USaveAsync(ErrorGroup model) |
||||
|
{ |
||||
|
if (ModelState.IsValid) |
||||
|
{ |
||||
|
IResultModel result; |
||||
|
|
||||
|
result = await _ppsApi.PutErrorGroup(model.GroupNo, 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("PPS005U", model); |
||||
|
} |
||||
|
|
||||
|
[ResponseCache(Duration = 0)] |
||||
|
[HttpGet] |
||||
|
public async Task<IActionResult> GetErrorGroupsAsync() |
||||
|
{ |
||||
|
var result = await _ppsApi.GetErrorGroups(); |
||||
|
|
||||
|
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 PPS006異常類別維護相關
|
||||
|
|
||||
|
public async Task<IActionResult> PPS006() |
||||
|
{ |
||||
|
await GetErrorGroupListAll(); |
||||
|
|
||||
|
return View(); |
||||
|
} |
||||
|
|
||||
|
//新增頁面
|
||||
|
public async Task<IActionResult> PPS006C(string id) |
||||
|
{ |
||||
|
await GetErrorGroupList(); |
||||
|
|
||||
|
var model = new ErrorClass(); |
||||
|
if (id != null) |
||||
|
{ |
||||
|
if (id != "") |
||||
|
{ |
||||
|
model.GroupNo = id; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
return View(model); |
||||
|
} |
||||
|
|
||||
|
//修改页面
|
||||
|
[HttpGet] |
||||
|
public async Task<IActionResult> PPS006UAsync(string id) |
||||
|
{ |
||||
|
await GetErrorGroupList(); |
||||
|
var result = await _ppsApi.GetErrorClass(id); |
||||
|
|
||||
|
if (result.Count == 0) |
||||
|
{ |
||||
|
return View(); |
||||
|
} |
||||
|
return View(result[0]); |
||||
|
} |
||||
|
|
||||
|
public async Task<IActionResult> PPS006DAsync(string id) |
||||
|
{ |
||||
|
var result = await _ppsApi.DeleteErrorClass(id); |
||||
|
return Json(new Result() { success = true, msg = "" }); |
||||
|
} |
||||
|
|
||||
|
//頁面提交,id=0 添加,id>0 修改
|
||||
|
[HttpPost] |
||||
|
public async Task<IActionResult> PPS006CSaveAsync(ErrorClass model) |
||||
|
{ |
||||
|
if (ModelState.IsValid) |
||||
|
{ |
||||
|
IResultModel result; |
||||
|
|
||||
|
result = await _ppsApi.PostErrorClass(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("PPS006C", model); |
||||
|
} |
||||
|
|
||||
|
public async Task<IActionResult> PPS006USaveAsync(ErrorClass model) |
||||
|
{ |
||||
|
if (ModelState.IsValid) |
||||
|
{ |
||||
|
IResultModel result; |
||||
|
|
||||
|
result = await _ppsApi.PutErrorClass(model.ClassNo, 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("PPS006U", model); |
||||
|
} |
||||
|
|
||||
|
[ResponseCache(Duration = 0)] |
||||
|
[HttpGet] |
||||
|
public async Task<IActionResult> GetErrorClassesByGroupAsync(string errorGroupNo) |
||||
|
{ |
||||
|
if (errorGroupNo == null) |
||||
|
{ |
||||
|
errorGroupNo = "*"; |
||||
|
} |
||||
|
var result = await _ppsApi.GetErrorClassesByGroup(errorGroupNo); |
||||
|
|
||||
|
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
|
||||
|
} |
||||
|
} |
@ -0,0 +1,179 @@ |
|||||
|
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; |
||||
|
|
||||
|
namespace AMESCoreStudio.Web |
||||
|
{ |
||||
|
[JsonReturn] |
||||
|
public interface IPPS:IHttpApi |
||||
|
{ |
||||
|
#region PPS001 工單狀態維護
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 新增工單狀態
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[WebApiClient.Attributes.HttpPost("api/WipStatus")] |
||||
|
ITask<ResultModel<WipStatus>> PostWipStatus([FromBody, RawJsonContent] string model); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 更新工單狀態
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[WebApiClient.Attributes.HttpPut("api/WipStatus/{id}")] |
||||
|
ITask<ResultModel<WipStatus>> PutWipStatus(string id, [FromBody, RawJsonContent] string model); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 刪除工單狀態
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[WebApiClient.Attributes.HttpDelete("api/WipStatus/{id}")] |
||||
|
ITask<ResultModel<string>> DeleteWipStatus(string id); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 根據ID獲取指定工單狀態資料
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[WebApiClient.Attributes.HttpGet("api/WipStatus/{id}")] |
||||
|
ITask<List<WipStatus>> GetWipStatus(string id); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 獲取工單狀態資料
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[WebApiClient.Attributes.HttpGet("api/WipStatus")] |
||||
|
ITask<List<WipStatus>> GetWipStatus(); |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region PPS002 條碼狀態維護
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 新增條碼狀態
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[WebApiClient.Attributes.HttpPost("api/BarcodeStatus")] |
||||
|
ITask<ResultModel<BarcodeStatus>> PostBarcodeStatus([FromBody, RawJsonContent] string model); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 更新條碼狀態
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[WebApiClient.Attributes.HttpPut("api/BarcodeStatus/{id}")] |
||||
|
ITask<ResultModel<BarcodeStatus>> PutBarcodeStatus(string id, [FromBody, RawJsonContent] string model); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 刪除條碼狀態
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[WebApiClient.Attributes.HttpDelete("api/BarcodeStatus/{id}")] |
||||
|
ITask<ResultModel<string>> DeleteBarcodeStatus(string id); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 根據ID獲取指定條碼狀態資料
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[WebApiClient.Attributes.HttpGet("api/BarcodeStatus/{id}")] |
||||
|
ITask<List<BarcodeStatus>> GetBarcodeStatus(string id); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 獲取條碼狀態資料
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[WebApiClient.Attributes.HttpGet("api/BarcodeStatus")] |
||||
|
ITask<List<BarcodeStatus>> GetBarcodeStatus(); |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
|
||||
|
#region PPS005 異常群組維護
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 新增異常群組
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[WebApiClient.Attributes.HttpPost("api/ErrorGroups")] |
||||
|
ITask<ResultModel<ErrorGroup>> PostErrorGroup([FromBody, RawJsonContent] string model); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 更新異常群組
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[WebApiClient.Attributes.HttpPut("api/ErrorGroups/{id}")] |
||||
|
ITask<ResultModel<ErrorGroup>> PutErrorGroup(string id, [FromBody, RawJsonContent] string model); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 刪除異常群組
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[WebApiClient.Attributes.HttpDelete("api/ErrorGroups/{id}")] |
||||
|
ITask<ResultModel<string>> DeleteErrorGroup(string id); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 根據ID獲取指定異常群組資料
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[WebApiClient.Attributes.HttpGet("api/ErrorGroups/{id}")] |
||||
|
ITask<List<ErrorGroup>> GetErrorGroup(string id); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 獲取異常群組資料
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[WebApiClient.Attributes.HttpGet("api/ErrorGroups")] |
||||
|
ITask<List<ErrorGroup>> GetErrorGroups(); |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
|
||||
|
#region PPS006 異常類別維護
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 新增異常類別
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[WebApiClient.Attributes.HttpPost("api/ErrorClasses")] |
||||
|
ITask<ResultModel<ErrorClass>> PostErrorClass([FromBody, RawJsonContent] string model); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 更新異常類別
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[WebApiClient.Attributes.HttpPut("api/ErrorClasses/{id}")] |
||||
|
ITask<ResultModel<ErrorClass>> PutErrorClass(string id, [FromBody, RawJsonContent] string model); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 刪除異常類別
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[WebApiClient.Attributes.HttpDelete("api/ErrorClasses/{id}")] |
||||
|
ITask<ResultModel<string>> DeleteErrorClass(string id); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 根據ID獲取指定異常類別資料
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[WebApiClient.Attributes.HttpGet("api/ErrorClasses/{id}")] |
||||
|
ITask<List<ErrorClass>> GetErrorClass(string id); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 獲取異常類別資料
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[WebApiClient.Attributes.HttpGet("api/ErrorClasses")] |
||||
|
ITask<List<ErrorClass>> GetErrorClasses(); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 根据群組代碼獲取類別資料
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[WebApiClient.Attributes.HttpGet("api/ErrorClasses/Group/{no}")] |
||||
|
ITask<List<ErrorClass>> GetErrorClassesByGroup(string no); |
||||
|
|
||||
|
#endregion
|
||||
|
} |
||||
|
} |
@ -0,0 +1,90 @@ |
|||||
|
@{ |
||||
|
ViewData["Title"] = "工單狀態維護"; |
||||
|
Layout = "~/Views/Shared/_AMESLayout.cshtml"; |
||||
|
} |
||||
|
|
||||
|
<div class="layui-card"> |
||||
|
<div class="layui-card-header"> |
||||
|
<div class="layui-form"> |
||||
|
<div class="layui-form-item "> |
||||
|
<div class="layui-inline"><i class="fa fa-file-text-o fa-fw"></i> @ViewBag.Title</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="layui-card-body"> |
||||
|
<table class="layui-hide" id="test" lay-filter="test"></table> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
@section Scripts{ |
||||
|
<script type="text/javascript"> |
||||
|
//监听表单提交事件 |
||||
|
hg.form.onsubmit('querysubmit', function (data) { |
||||
|
table && table.reload(data); |
||||
|
}); |
||||
|
var tableCols = [[ |
||||
|
{ |
||||
|
field: 'statusNo', |
||||
|
width: 200, |
||||
|
title: '工單狀態代碼' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'statusDesc', |
||||
|
title: '工單狀態描述' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'right', |
||||
|
width: 200, |
||||
|
title: '操作', |
||||
|
fixed: 'right', |
||||
|
templet: function (d) { |
||||
|
return '<a class="layui-btn layui-btn-normal layui-btn-xs layui-icon layui-icon-edit" lay-event="edit">修改</a> <a class="layui-btn layui-btn-danger layui-btn-xs layui-icon layui-icon-delete" lay-event="del">删除</a>' |
||||
|
} |
||||
|
}] |
||||
|
]; |
||||
|
|
||||
|
//通过行tool编辑,lay-event="edit" |
||||
|
function edit(obj) { |
||||
|
if (obj.data.statusNo) { |
||||
|
hg.open('修改工單狀態', '/PPS/PPS001U/' + obj.data.statusNo, 640,320); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//通过行tool删除,lay-event="del" |
||||
|
function del(obj) { |
||||
|
if (obj.data.statusNo) { |
||||
|
hg.confirm("工單狀態:" + obj.data.statusDesc + ",确定要删除吗?", function () { |
||||
|
$.ajax({ |
||||
|
url: '/PPS/PPS001D', |
||||
|
data: { id: obj.data.statusNo }, |
||||
|
type: 'POST', |
||||
|
success: function (data) { |
||||
|
if (data.success) { |
||||
|
obj.del(); //只删本地数据 |
||||
|
hg.msghide("删除成功!"); |
||||
|
} |
||||
|
else { |
||||
|
hg.msg(data.msg); |
||||
|
} |
||||
|
}, |
||||
|
error: function () { |
||||
|
hg.msg("网络请求失败!"); |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
var toolbar = [{ |
||||
|
text: '新增', |
||||
|
layuiicon: '', |
||||
|
class: 'layui-btn-normal', |
||||
|
handler: function () { |
||||
|
hg.open('新增工單狀態', '/PPS/PPS001C', 640, 320); |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
]; |
||||
|
//基本数据表格 |
||||
|
var table = hg.table.datatable('test', '工單狀態維護', '/PPS/GetWipStatus', {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); |
||||
|
</script> |
||||
|
} |
@ -0,0 +1,53 @@ |
|||||
|
@model AMESCoreStudio.WebApi.Models.AMES.WipStatus |
||||
|
|
||||
|
|
||||
|
@{ ViewData["Title"] = "PPS001C"; |
||||
|
Layout = "~/Views/Shared/_FormLayout.cshtml"; } |
||||
|
|
||||
|
|
||||
|
<style> |
||||
|
.control-label { |
||||
|
justify-content: flex-end !important; |
||||
|
} |
||||
|
</style> |
||||
|
|
||||
|
<div class="row"> |
||||
|
<div class="col-sm-12"> |
||||
|
<form enctype="multipart/form-data" method="post" asp-action="PPS001CSave"> |
||||
|
<div asp-validation-summary="ModelOnly" class="text-danger"></div> |
||||
|
|
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="StatusNo" class="control-label col-sm-3"></label> |
||||
|
<input asp-for="StatusNo" class="form-control col-sm-9" placeholder="請輸入工單狀態代碼" /> |
||||
|
<span asp-validation-for="StatusNo" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="StatusDesc" class="control-label col-sm-3"></label> |
||||
|
<input asp-for="StatusDesc" class="form-control col-sm-9" placeholder="請輸入工單狀態描述" /> |
||||
|
<span asp-validation-for="StatusDesc" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<span style="color: firebrick;word-break: break-all;" class="text-danger offset-sm-3">@Html.ValidationMessage("error")</span> |
||||
|
<div class="form-group"> |
||||
|
<input type="submit" value="保存" class="btn btn-primary offset-sm-3" /> |
||||
|
</div> |
||||
|
|
||||
|
</form> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
@section Scripts { |
||||
|
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); |
||||
|
await Html.RenderPartialAsync("_FileinputScriptsPartial"); } |
||||
|
|
||||
|
<script type="text/javascript"> |
||||
|
$(document).ready(function () { |
||||
|
var error = '@Html.ValidationMessage("error")'; |
||||
|
if ($(error).text() != '') { |
||||
|
parent.hg.msg(error); |
||||
|
} |
||||
|
}); |
||||
|
</script> |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,53 @@ |
|||||
|
@model AMESCoreStudio.WebApi.Models.AMES.WipStatus |
||||
|
|
||||
|
|
||||
|
@{ ViewData["Title"] = "PPS001U"; |
||||
|
Layout = "~/Views/Shared/_FormLayout.cshtml"; } |
||||
|
|
||||
|
|
||||
|
<style> |
||||
|
.control-label { |
||||
|
justify-content: flex-end !important; |
||||
|
} |
||||
|
</style> |
||||
|
|
||||
|
<div class="row"> |
||||
|
<div class="col-sm-12"> |
||||
|
<form enctype="multipart/form-data" method="post" asp-action="PPS001USave"> |
||||
|
<div asp-validation-summary="ModelOnly" class="text-danger"></div> |
||||
|
|
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="StatusNo" class="control-label col-sm-3"></label> |
||||
|
<input asp-for="StatusNo" class="form-control col-sm-9" readonly="readonly" /> |
||||
|
<span asp-validation-for="StatusNo" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="StatusDesc" class="control-label col-sm-3"></label> |
||||
|
<input asp-for="StatusDesc" class="form-control col-sm-9" placeholder="請輸入工單狀態描述" /> |
||||
|
<span asp-validation-for="StatusDesc" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<span style="color: firebrick;word-break: break-all;" class="text-danger offset-sm-3">@Html.ValidationMessage("error")</span> |
||||
|
<div class="form-group"> |
||||
|
<input type="submit" value="保存" class="btn btn-primary offset-sm-3" /> |
||||
|
</div> |
||||
|
|
||||
|
</form> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
@section Scripts { |
||||
|
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); |
||||
|
await Html.RenderPartialAsync("_FileinputScriptsPartial"); } |
||||
|
|
||||
|
<script type="text/javascript"> |
||||
|
$(document).ready(function () { |
||||
|
var error = '@Html.ValidationMessage("error")'; |
||||
|
if ($(error).text() != '') { |
||||
|
parent.hg.msg(error); |
||||
|
} |
||||
|
}); |
||||
|
</script> |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,90 @@ |
|||||
|
@{ |
||||
|
ViewData["Title"] = "條碼狀態維護"; |
||||
|
Layout = "~/Views/Shared/_AMESLayout.cshtml"; |
||||
|
} |
||||
|
|
||||
|
<div class="layui-card"> |
||||
|
<div class="layui-card-header"> |
||||
|
<div class="layui-form"> |
||||
|
<div class="layui-form-item "> |
||||
|
<div class="layui-inline"><i class="fa fa-file-text-o fa-fw"></i> @ViewBag.Title</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="layui-card-body"> |
||||
|
<table class="layui-hide" id="test" lay-filter="test"></table> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
@section Scripts{ |
||||
|
<script type="text/javascript"> |
||||
|
//监听表单提交事件 |
||||
|
hg.form.onsubmit('querysubmit', function (data) { |
||||
|
table && table.reload(data); |
||||
|
}); |
||||
|
var tableCols = [[ |
||||
|
{ |
||||
|
field: 'statusNo', |
||||
|
width: 200, |
||||
|
title: '條碼狀態代碼' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'statusDesc', |
||||
|
title: '條碼狀態描述' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'right', |
||||
|
width: 200, |
||||
|
title: '操作', |
||||
|
fixed: 'right', |
||||
|
templet: function (d) { |
||||
|
return '<a class="layui-btn layui-btn-normal layui-btn-xs layui-icon layui-icon-edit" lay-event="edit">修改</a> <a class="layui-btn layui-btn-danger layui-btn-xs layui-icon layui-icon-delete" lay-event="del">删除</a>' |
||||
|
} |
||||
|
}] |
||||
|
]; |
||||
|
|
||||
|
//通过行tool编辑,lay-event="edit" |
||||
|
function edit(obj) { |
||||
|
if (obj.data.statusNo) { |
||||
|
hg.open('修改條碼狀態', '/PPS/PPS002U/' + obj.data.statusNo, 640,320); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//通过行tool删除,lay-event="del" |
||||
|
function del(obj) { |
||||
|
if (obj.data.statusNo) { |
||||
|
hg.confirm("條碼狀態:" + obj.data.statusDesc + ",确定要删除吗?", function () { |
||||
|
$.ajax({ |
||||
|
url: '/PPS/PPS002D', |
||||
|
data: { id: obj.data.statusNo }, |
||||
|
type: 'POST', |
||||
|
success: function (data) { |
||||
|
if (data.success) { |
||||
|
obj.del(); //只删本地数据 |
||||
|
hg.msghide("删除成功!"); |
||||
|
} |
||||
|
else { |
||||
|
hg.msg(data.msg); |
||||
|
} |
||||
|
}, |
||||
|
error: function () { |
||||
|
hg.msg("网络请求失败!"); |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
var toolbar = [{ |
||||
|
text: '新增', |
||||
|
layuiicon: '', |
||||
|
class: 'layui-btn-normal', |
||||
|
handler: function () { |
||||
|
hg.open('新增條碼狀態', '/PPS/PPS002C', 640, 320); |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
]; |
||||
|
//基本数据表格 |
||||
|
var table = hg.table.datatable('test', '條碼狀態維護', '/PPS/GetBarcodeStatus', {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); |
||||
|
</script> |
||||
|
} |
@ -0,0 +1,53 @@ |
|||||
|
@model AMESCoreStudio.WebApi.Models.AMES.BarcodeStatus |
||||
|
|
||||
|
|
||||
|
@{ ViewData["Title"] = "PPS002C"; |
||||
|
Layout = "~/Views/Shared/_FormLayout.cshtml"; } |
||||
|
|
||||
|
|
||||
|
<style> |
||||
|
.control-label { |
||||
|
justify-content: flex-end !important; |
||||
|
} |
||||
|
</style> |
||||
|
|
||||
|
<div class="row"> |
||||
|
<div class="col-sm-12"> |
||||
|
<form enctype="multipart/form-data" method="post" asp-action="PPS002CSave"> |
||||
|
<div asp-validation-summary="ModelOnly" class="text-danger"></div> |
||||
|
|
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="StatusNo" class="control-label col-sm-3"></label> |
||||
|
<input asp-for="StatusNo" class="form-control col-sm-9" placeholder="請輸入條碼狀態代碼" /> |
||||
|
<span asp-validation-for="StatusNo" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="StatusDesc" class="control-label col-sm-3"></label> |
||||
|
<input asp-for="StatusDesc" class="form-control col-sm-9" placeholder="請輸入條碼狀態描述" /> |
||||
|
<span asp-validation-for="StatusDesc" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<span style="color: firebrick;word-break: break-all;" class="text-danger offset-sm-3">@Html.ValidationMessage("error")</span> |
||||
|
<div class="form-group"> |
||||
|
<input type="submit" value="保存" class="btn btn-primary offset-sm-3" /> |
||||
|
</div> |
||||
|
|
||||
|
</form> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
@section Scripts { |
||||
|
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); |
||||
|
await Html.RenderPartialAsync("_FileinputScriptsPartial"); } |
||||
|
|
||||
|
<script type="text/javascript"> |
||||
|
$(document).ready(function () { |
||||
|
var error = '@Html.ValidationMessage("error")'; |
||||
|
if ($(error).text() != '') { |
||||
|
parent.hg.msg(error); |
||||
|
} |
||||
|
}); |
||||
|
</script> |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,53 @@ |
|||||
|
@model AMESCoreStudio.WebApi.Models.AMES.BarcodeStatus |
||||
|
|
||||
|
|
||||
|
@{ ViewData["Title"] = "PPS002U"; |
||||
|
Layout = "~/Views/Shared/_FormLayout.cshtml"; } |
||||
|
|
||||
|
|
||||
|
<style> |
||||
|
.control-label { |
||||
|
justify-content: flex-end !important; |
||||
|
} |
||||
|
</style> |
||||
|
|
||||
|
<div class="row"> |
||||
|
<div class="col-sm-12"> |
||||
|
<form enctype="multipart/form-data" method="post" asp-action="PPS002USave"> |
||||
|
<div asp-validation-summary="ModelOnly" class="text-danger"></div> |
||||
|
|
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="StatusNo" class="control-label col-sm-3"></label> |
||||
|
<input asp-for="StatusNo" class="form-control col-sm-9" readonly="readonly" /> |
||||
|
<span asp-validation-for="StatusNo" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="StatusDesc" class="control-label col-sm-3"></label> |
||||
|
<input asp-for="StatusDesc" class="form-control col-sm-9" placeholder="請輸入條碼狀態描述" /> |
||||
|
<span asp-validation-for="StatusDesc" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<span style="color: firebrick;word-break: break-all;" class="text-danger offset-sm-3">@Html.ValidationMessage("error")</span> |
||||
|
<div class="form-group"> |
||||
|
<input type="submit" value="保存" class="btn btn-primary offset-sm-3" /> |
||||
|
</div> |
||||
|
|
||||
|
</form> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
@section Scripts { |
||||
|
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); |
||||
|
await Html.RenderPartialAsync("_FileinputScriptsPartial"); } |
||||
|
|
||||
|
<script type="text/javascript"> |
||||
|
$(document).ready(function () { |
||||
|
var error = '@Html.ValidationMessage("error")'; |
||||
|
if ($(error).text() != '') { |
||||
|
parent.hg.msg(error); |
||||
|
} |
||||
|
}); |
||||
|
</script> |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,90 @@ |
|||||
|
@{ |
||||
|
ViewData["Title"] = "異常群組維護"; |
||||
|
Layout = "~/Views/Shared/_AMESLayout.cshtml"; |
||||
|
} |
||||
|
|
||||
|
<div class="layui-card"> |
||||
|
<div class="layui-card-header"> |
||||
|
<div class="layui-form"> |
||||
|
<div class="layui-form-item "> |
||||
|
<div class="layui-inline"><i class="fa fa-file-text-o fa-fw"></i> @ViewBag.Title</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="layui-card-body"> |
||||
|
<table class="layui-hide" id="test" lay-filter="test"></table> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
@section Scripts{ |
||||
|
<script type="text/javascript"> |
||||
|
//监听表单提交事件 |
||||
|
hg.form.onsubmit('querysubmit', function (data) { |
||||
|
table && table.reload(data); |
||||
|
}); |
||||
|
var tableCols = [[ |
||||
|
{ |
||||
|
field: 'groupNo', |
||||
|
width: 200, |
||||
|
title: '異常群組代碼' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'groupName', |
||||
|
title: '異常群組名稱' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'right', |
||||
|
width: 200, |
||||
|
title: '操作', |
||||
|
fixed: 'right', |
||||
|
templet: function (d) { |
||||
|
return '<a class="layui-btn layui-btn-normal layui-btn-xs layui-icon layui-icon-edit" lay-event="edit">修改</a> <a class="layui-btn layui-btn-danger layui-btn-xs layui-icon layui-icon-delete" lay-event="del">删除</a>' |
||||
|
} |
||||
|
}] |
||||
|
]; |
||||
|
|
||||
|
//通过行tool编辑,lay-event="edit" |
||||
|
function edit(obj) { |
||||
|
if (obj.data.groupNo) { |
||||
|
hg.open('修改異常群組', '/PPS/PPS005U/' + obj.data.groupNo, 640,320); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//通过行tool删除,lay-event="del" |
||||
|
function del(obj) { |
||||
|
if (obj.data.groupNo) { |
||||
|
hg.confirm("異常群組:" + obj.data.groupName + ",确定要删除吗?", function () { |
||||
|
$.ajax({ |
||||
|
url: '/PPS/PPS005D', |
||||
|
data: { id: obj.data.groupNo }, |
||||
|
type: 'POST', |
||||
|
success: function (data) { |
||||
|
if (data.success) { |
||||
|
obj.del(); //只删本地数据 |
||||
|
hg.msghide("删除成功!"); |
||||
|
} |
||||
|
else { |
||||
|
hg.msg(data.msg); |
||||
|
} |
||||
|
}, |
||||
|
error: function () { |
||||
|
hg.msg("网络请求失败!"); |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
var toolbar = [{ |
||||
|
text: '新增', |
||||
|
layuiicon: '', |
||||
|
class: 'layui-btn-normal', |
||||
|
handler: function () { |
||||
|
hg.open('新增異常群組', '/PPS/PPS005C', 640, 320); |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
]; |
||||
|
//基本数据表格 |
||||
|
var table = hg.table.datatable('test', '異常群組維護', '/PPS/GetErrorGroups', {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); |
||||
|
</script> |
||||
|
} |
@ -0,0 +1,53 @@ |
|||||
|
@model AMESCoreStudio.WebApi.Models.AMES.ErrorGroup |
||||
|
|
||||
|
|
||||
|
@{ ViewData["Title"] = "PPS005C"; |
||||
|
Layout = "~/Views/Shared/_FormLayout.cshtml"; } |
||||
|
|
||||
|
|
||||
|
<style> |
||||
|
.control-label { |
||||
|
justify-content: flex-end !important; |
||||
|
} |
||||
|
</style> |
||||
|
|
||||
|
<div class="row"> |
||||
|
<div class="col-sm-12"> |
||||
|
<form enctype="multipart/form-data" method="post" asp-action="PPS005CSave"> |
||||
|
<div asp-validation-summary="ModelOnly" class="text-danger"></div> |
||||
|
|
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="GroupNo" class="control-label col-sm-3"></label> |
||||
|
<input asp-for="GroupNo" class="form-control col-sm-9" placeholder="請輸入異常群組代碼" /> |
||||
|
<span asp-validation-for="GroupNo" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="GroupName" class="control-label col-sm-3"></label> |
||||
|
<input asp-for="GroupName" class="form-control col-sm-9" placeholder="請輸入異常群組名稱" /> |
||||
|
<span asp-validation-for="GroupName" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<span style="color: firebrick;word-break: break-all;" class="text-danger offset-sm-3">@Html.ValidationMessage("error")</span> |
||||
|
<div class="form-group"> |
||||
|
<input type="submit" value="保存" class="btn btn-primary offset-sm-3" /> |
||||
|
</div> |
||||
|
|
||||
|
</form> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
@section Scripts { |
||||
|
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); |
||||
|
await Html.RenderPartialAsync("_FileinputScriptsPartial"); } |
||||
|
|
||||
|
<script type="text/javascript"> |
||||
|
$(document).ready(function () { |
||||
|
var error = '@Html.ValidationMessage("error")'; |
||||
|
if ($(error).text() != '') { |
||||
|
parent.hg.msg(error); |
||||
|
} |
||||
|
}); |
||||
|
</script> |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,53 @@ |
|||||
|
@model AMESCoreStudio.WebApi.Models.AMES.ErrorGroup |
||||
|
|
||||
|
|
||||
|
@{ ViewData["Title"] = "PPS005U"; |
||||
|
Layout = "~/Views/Shared/_FormLayout.cshtml"; } |
||||
|
|
||||
|
|
||||
|
<style> |
||||
|
.control-label { |
||||
|
justify-content: flex-end !important; |
||||
|
} |
||||
|
</style> |
||||
|
|
||||
|
<div class="row"> |
||||
|
<div class="col-sm-12"> |
||||
|
<form enctype="multipart/form-data" method="post" asp-action="PPS005USave"> |
||||
|
<div asp-validation-summary="ModelOnly" class="text-danger"></div> |
||||
|
|
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="GroupNo" class="control-label col-sm-3"></label> |
||||
|
<input asp-for="GroupNo" class="form-control col-sm-9" readonly="readonly" /> |
||||
|
<span asp-validation-for="GroupNo" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="GroupName" class="control-label col-sm-3"></label> |
||||
|
<input asp-for="GroupName" class="form-control col-sm-9" placeholder="請輸入異常群組名稱" /> |
||||
|
<span asp-validation-for="GroupName" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<span style="color: firebrick;word-break: break-all;" class="text-danger offset-sm-3">@Html.ValidationMessage("error")</span> |
||||
|
<div class="form-group"> |
||||
|
<input type="submit" value="保存" class="btn btn-primary offset-sm-3" /> |
||||
|
</div> |
||||
|
|
||||
|
</form> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
@section Scripts { |
||||
|
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); |
||||
|
await Html.RenderPartialAsync("_FileinputScriptsPartial"); } |
||||
|
|
||||
|
<script type="text/javascript"> |
||||
|
$(document).ready(function () { |
||||
|
var error = '@Html.ValidationMessage("error")'; |
||||
|
if ($(error).text() != '') { |
||||
|
parent.hg.msg(error); |
||||
|
} |
||||
|
}); |
||||
|
</script> |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,128 @@ |
|||||
|
@{ |
||||
|
ViewData["Title"] = "異常類別維護"; |
||||
|
Layout = "~/Views/Shared/_AMESLayout.cshtml"; |
||||
|
} |
||||
|
|
||||
|
<div class="layui-card"> |
||||
|
<div class="layui-card-header"> |
||||
|
<div class="layui-form"> |
||||
|
<div class="layui-form-item "> |
||||
|
<div class="layui-inline"><i class="fa fa-file-text-o fa-fw"></i> @ViewBag.Title</div> |
||||
|
</div> |
||||
|
<div class="layui-form-item layui-layout-left"> |
||||
|
<div class="layui-inline"> |
||||
|
<label class="layui-form-label">請選擇群組</label> |
||||
|
<div class="layui-form-item layui-layout-left" style="width:300px;"> |
||||
|
<select id="errorGroup" lay-filter="errorGroup" lay-verify="required" lay-submit asp-items="@ViewBag.ErrorGroupList"> |
||||
|
</select> |
||||
|
</div> |
||||
|
<input id="errorGroupNo" type="hidden" name="errorGroupNo" value="0" /> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="layui-form-item layui-layout-right"> |
||||
|
<div class="layui-inline layui-show-xs-block"> |
||||
|
<button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit lay-filter="querysubmit"> |
||||
|
<i class="layui-icon layui-icon-sm"></i> |
||||
|
</button> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="layui-card-body"> |
||||
|
<table class="layui-hide" id="test" lay-filter="test"></table> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
@section Scripts{ |
||||
|
<script type="text/javascript"> |
||||
|
|
||||
|
layui.use(['form', 'layer'], function () { |
||||
|
form = layui.form; |
||||
|
|
||||
|
form.on('select(errorGroup)', function (data) { |
||||
|
$("#errorGroupNo").val(data.value); |
||||
|
|
||||
|
var qs = $('button[lay-filter="querysubmit"]'); |
||||
|
qs.click(); |
||||
|
|
||||
|
hg.msghide("刷新数据!"); |
||||
|
table && table.reload(); |
||||
|
}); |
||||
|
}); |
||||
|
|
||||
|
//监听表单提交事件 |
||||
|
hg.form.onsubmit('querysubmit', function (data) { |
||||
|
table && table.reload(data); |
||||
|
}); |
||||
|
var tableCols = [[ |
||||
|
{ |
||||
|
field: 'classNo', |
||||
|
width: 200, |
||||
|
title: '異常類別代碼' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'groupNo', |
||||
|
width: 200, |
||||
|
title: '異常群組代碼' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'className', |
||||
|
title: '異常類別名稱' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'right', |
||||
|
width: 200, |
||||
|
title: '操作', |
||||
|
fixed: 'right', |
||||
|
templet: function (d) { |
||||
|
return '<a class="layui-btn layui-btn-normal layui-btn-xs layui-icon layui-icon-edit" lay-event="edit">修改</a> <a class="layui-btn layui-btn-danger layui-btn-xs layui-icon layui-icon-delete" lay-event="del">删除</a>' |
||||
|
} |
||||
|
}] |
||||
|
]; |
||||
|
|
||||
|
//通过行tool编辑,lay-event="edit" |
||||
|
function edit(obj) { |
||||
|
if (obj.data.classNo) { |
||||
|
hg.open('修改異常類別', '/PPS/PPS006U/' + obj.data.classNo, 640,320); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//通过行tool删除,lay-event="del" |
||||
|
function del(obj) { |
||||
|
if (obj.data.classNo) { |
||||
|
hg.confirm("異常類別:" + obj.data.className + ",确定要删除吗?", function () { |
||||
|
$.ajax({ |
||||
|
url: '/PPS/PPS006D', |
||||
|
data: { id: obj.data.classNo }, |
||||
|
type: 'POST', |
||||
|
success: function (data) { |
||||
|
if (data.success) { |
||||
|
obj.del(); //只删本地数据 |
||||
|
hg.msghide("删除成功!"); |
||||
|
} |
||||
|
else { |
||||
|
hg.msg(data.msg); |
||||
|
} |
||||
|
}, |
||||
|
error: function () { |
||||
|
hg.msg("网络请求失败!"); |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
var toolbar = [{ |
||||
|
text: '新增', |
||||
|
layuiicon: '', |
||||
|
class: 'layui-btn-normal', |
||||
|
handler: function () { |
||||
|
var id = errorGroupNo.value; |
||||
|
hg.open('新增異常類別', '/PPS/PPS006C/' + id, 640, 320); |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
]; |
||||
|
//基本数据表格 |
||||
|
var table = hg.table.datatable('test', '異常類別維護', '/PPS/GetErrorClassesByGroup/' + errorGroupNo.value, {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); |
||||
|
</script> |
||||
|
} |
@ -0,0 +1,58 @@ |
|||||
|
@model AMESCoreStudio.WebApi.Models.AMES.ErrorClass |
||||
|
|
||||
|
|
||||
|
@{ ViewData["Title"] = "PPS006C"; |
||||
|
Layout = "~/Views/Shared/_FormLayout.cshtml"; } |
||||
|
|
||||
|
|
||||
|
<style> |
||||
|
.control-label { |
||||
|
justify-content: flex-end !important; |
||||
|
} |
||||
|
</style> |
||||
|
|
||||
|
<div class="row"> |
||||
|
<div class="col-sm-12"> |
||||
|
<form enctype="multipart/form-data" method="post" asp-action="PPS006CSave"> |
||||
|
<div asp-validation-summary="ModelOnly" class="text-danger"></div> |
||||
|
|
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="ClassNo" class="control-label col-sm-3"></label> |
||||
|
<input asp-for="ClassNo" class="form-control col-sm-9" placeholder="請輸入異常類別代碼" /> |
||||
|
<span asp-validation-for="ClassNo" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="GroupNo" class="control-label col-sm-3"></label> |
||||
|
<select asp-for="GroupNo" asp-items="@ViewBag.ErrorGroupList" class="custom-select col-sm-9"></select> |
||||
|
<span asp-validation-for="GroupNo" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="ClassName" class="control-label col-sm-3"></label> |
||||
|
<input asp-for="ClassName" class="form-control col-sm-9" placeholder="請輸入異常類別名稱" /> |
||||
|
<span asp-validation-for="ClassName" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<span style="color: firebrick;word-break: break-all;" class="text-danger offset-sm-3">@Html.ValidationMessage("error")</span> |
||||
|
<div class="form-group"> |
||||
|
<input type="submit" value="保存" class="btn btn-primary offset-sm-3" /> |
||||
|
</div> |
||||
|
|
||||
|
</form> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
@section Scripts { |
||||
|
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); |
||||
|
await Html.RenderPartialAsync("_FileinputScriptsPartial"); } |
||||
|
|
||||
|
<script type="text/javascript"> |
||||
|
$(document).ready(function () { |
||||
|
var error = '@Html.ValidationMessage("error")'; |
||||
|
if ($(error).text() != '') { |
||||
|
parent.hg.msg(error); |
||||
|
} |
||||
|
}); |
||||
|
</script> |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,58 @@ |
|||||
|
@model AMESCoreStudio.WebApi.Models.AMES.ErrorClass |
||||
|
|
||||
|
|
||||
|
@{ ViewData["Title"] = "PPS006U"; |
||||
|
Layout = "~/Views/Shared/_FormLayout.cshtml"; } |
||||
|
|
||||
|
|
||||
|
<style> |
||||
|
.control-label { |
||||
|
justify-content: flex-end !important; |
||||
|
} |
||||
|
</style> |
||||
|
|
||||
|
<div class="row"> |
||||
|
<div class="col-sm-12"> |
||||
|
<form enctype="multipart/form-data" method="post" asp-action="PPS006USave"> |
||||
|
<div asp-validation-summary="ModelOnly" class="text-danger"></div> |
||||
|
|
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="ClassNo" class="control-label col-sm-3"></label> |
||||
|
<input asp-for="ClassNo" class="form-control col-sm-9" placeholder="請輸入異常類別代碼" readonly="readonly" /> |
||||
|
<span asp-validation-for="ClassNo" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="GroupNo" class="control-label col-sm-3"></label> |
||||
|
<select asp-for="GroupNo" asp-items="@ViewBag.ErrorGroupList" class="custom-select col-sm-9"></select> |
||||
|
<span asp-validation-for="GroupNo" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<div class="form-group form-inline my-sm-1"> |
||||
|
<label asp-for="ClassName" class="control-label col-sm-3"></label> |
||||
|
<input asp-for="ClassName" class="form-control col-sm-9" placeholder="請輸入異常類別名稱" /> |
||||
|
<span asp-validation-for="ClassName" class="text-danger offset-sm-3 my-sm-1"></span> |
||||
|
</div> |
||||
|
<span style="color: firebrick;word-break: break-all;" class="text-danger offset-sm-3">@Html.ValidationMessage("error")</span> |
||||
|
<div class="form-group"> |
||||
|
<input type="submit" value="保存" class="btn btn-primary offset-sm-3" /> |
||||
|
</div> |
||||
|
|
||||
|
</form> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
@section Scripts { |
||||
|
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); |
||||
|
await Html.RenderPartialAsync("_FileinputScriptsPartial"); } |
||||
|
|
||||
|
<script type="text/javascript"> |
||||
|
$(document).ready(function () { |
||||
|
var error = '@Html.ValidationMessage("error")'; |
||||
|
if ($(error).text() != '') { |
||||
|
parent.hg.msg(error); |
||||
|
} |
||||
|
}); |
||||
|
</script> |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,160 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using AMESCoreStudio.WebApi.Models.AMES; |
||||
|
|
||||
|
namespace AMESCoreStudio.WebApi.Controllers.AMES |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 條碼狀態維護
|
||||
|
/// </summary>
|
||||
|
[Route("api/[controller]")]
|
||||
|
[ApiController] |
||||
|
public class BarcodeStatusController : ControllerBase |
||||
|
{ |
||||
|
private readonly AMESContext _context; |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <param name="context"></param>
|
||||
|
public BarcodeStatusController(AMESContext context) |
||||
|
{ |
||||
|
_context = context; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
// GET: api/BarcodeStatus
|
||||
|
[HttpGet] |
||||
|
public async Task<ActionResult<IEnumerable<BarcodeStatus>>> GetBarcodeStatus() |
||||
|
{ |
||||
|
IQueryable<BarcodeStatus> q = _context.BarcodeStatus; |
||||
|
q = q.OrderBy(p => p.StatusNo); |
||||
|
|
||||
|
var barcodeStatus = await q.ToListAsync(); |
||||
|
return barcodeStatus; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <param name="id"></param>
|
||||
|
/// <returns></returns>
|
||||
|
// GET: api/BarcodeStatus/5
|
||||
|
[HttpGet("{id}")] |
||||
|
public async Task<ActionResult<IEnumerable<BarcodeStatus>>> GetBarcodeStatus(string id) |
||||
|
{ |
||||
|
IQueryable<BarcodeStatus> q = _context.BarcodeStatus; |
||||
|
q = q.Where(p => p.StatusNo.Equals(id)); |
||||
|
|
||||
|
var barcodeStatus = await q.ToListAsync(); |
||||
|
|
||||
|
if (barcodeStatus == null) |
||||
|
{ |
||||
|
return NotFound(); |
||||
|
} |
||||
|
|
||||
|
return barcodeStatus; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <param name="id"></param>
|
||||
|
/// <param name="barcodeStatus"></param>
|
||||
|
/// <returns></returns>
|
||||
|
// PUT: api/BarcodeStatus/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<ActionResult<BarcodeStatus>> PutBarcodeStatus(string id, [FromBody] BarcodeStatus barcodeStatus) |
||||
|
{ |
||||
|
if (id != barcodeStatus.StatusNo) |
||||
|
{ |
||||
|
return BadRequest(); |
||||
|
} |
||||
|
|
||||
|
_context.Entry(barcodeStatus).State = EntityState.Modified; |
||||
|
|
||||
|
try |
||||
|
{ |
||||
|
await _context.SaveChangesAsync(); |
||||
|
} |
||||
|
catch (DbUpdateConcurrencyException) |
||||
|
{ |
||||
|
if (!BarcodeStatusExists(id)) |
||||
|
{ |
||||
|
return NotFound(); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
throw; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
return barcodeStatus; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <param name="barcodeStatus"></param>
|
||||
|
/// <returns></returns>
|
||||
|
// POST: api/BarcodeStatus
|
||||
|
// 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<ActionResult<BarcodeStatus>> PostBarcodeStatus([FromBody] BarcodeStatus barcodeStatus) |
||||
|
{ |
||||
|
_context.BarcodeStatus.Add(barcodeStatus); |
||||
|
try |
||||
|
{ |
||||
|
await _context.SaveChangesAsync(); |
||||
|
} |
||||
|
catch (DbUpdateException) |
||||
|
{ |
||||
|
if (BarcodeStatusExists(barcodeStatus.StatusNo)) |
||||
|
{ |
||||
|
return Conflict(); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
throw; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
return CreatedAtAction("GetBarcodeStatus", new { id = barcodeStatus.StatusNo }, barcodeStatus); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <param name="id"></param>
|
||||
|
/// <returns></returns>
|
||||
|
// DELETE: api/BarcodeStatus/5
|
||||
|
[HttpDelete("{id}")] |
||||
|
public async Task<ActionResult<BarcodeStatus>> DeleteBarcodeStatus(string id) |
||||
|
{ |
||||
|
var barcodeStatus = await _context.BarcodeStatus.Where(p => p.StatusNo == id).FirstOrDefaultAsync(); |
||||
|
if (barcodeStatus == null) |
||||
|
{ |
||||
|
return NotFound(); |
||||
|
} |
||||
|
|
||||
|
_context.BarcodeStatus.Remove(barcodeStatus); |
||||
|
await _context.SaveChangesAsync(); |
||||
|
|
||||
|
return barcodeStatus; |
||||
|
} |
||||
|
|
||||
|
private bool BarcodeStatusExists(string id) |
||||
|
{ |
||||
|
return _context.BarcodeStatus.Any(e => e.StatusNo == id); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,194 @@ |
|||||
|
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; |
||||
|
|
||||
|
namespace AMESCoreStudio.WebApi.Controllers.AMES |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 異常類別維護
|
||||
|
/// </summary>
|
||||
|
[Route("api/[controller]")]
|
||||
|
[ApiController] |
||||
|
public class ErrorClassesController : ControllerBase |
||||
|
{ |
||||
|
private readonly AMESContext _context; |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <param name="context"></param>
|
||||
|
public ErrorClassesController(AMESContext context) |
||||
|
{ |
||||
|
_context = context; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
// GET: api/ErrorClasses
|
||||
|
[HttpGet] |
||||
|
public async Task<ActionResult<IEnumerable<ErrorClass>>> GetErrorClass() |
||||
|
{ |
||||
|
IQueryable<ErrorClass> q = _context.ErrorClasses; |
||||
|
q = q.OrderBy(p => p.ClassNo); |
||||
|
|
||||
|
var errorClass = await q.ToListAsync(); |
||||
|
|
||||
|
return errorClass; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 根据製程單位代碼NO獲取該製程流程資料
|
||||
|
/// </summary>
|
||||
|
/// <param name="no"></param>
|
||||
|
/// <returns></returns>
|
||||
|
// GET: api/ErrorClasses/Group/S
|
||||
|
[HttpGet("Group/{no}")] |
||||
|
public async Task<ActionResult<IEnumerable<ErrorClass>>> GetErrorGroupByGroup(string no) |
||||
|
{ |
||||
|
IQueryable<ErrorClass> q = _context.ErrorClasses; |
||||
|
|
||||
|
if (no != null) |
||||
|
{ |
||||
|
if (no != "*") |
||||
|
{ |
||||
|
q = q.Where(p => p.GroupNo.Equals(no)); |
||||
|
} |
||||
|
} |
||||
|
q = q.OrderBy(p => p.GroupNo + p.ClassNo); |
||||
|
|
||||
|
var errorGroup = await q.ToListAsync(); |
||||
|
|
||||
|
if (errorGroup == null) |
||||
|
{ |
||||
|
return NotFound(); |
||||
|
} |
||||
|
|
||||
|
return errorGroup; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <param name="id"></param>
|
||||
|
/// <returns></returns>
|
||||
|
// GET: api/ErrorClasses/5
|
||||
|
[HttpGet("{id}")] |
||||
|
public async Task<ActionResult<IEnumerable<ErrorClass>>> GetErrorClass(string id) |
||||
|
{ |
||||
|
IQueryable<ErrorClass> q = _context.ErrorClasses; |
||||
|
q = q.Where(p => p.ClassNo.Equals(id)); |
||||
|
|
||||
|
var errorClass = await q.ToListAsync(); |
||||
|
|
||||
|
if (errorClass == null) |
||||
|
{ |
||||
|
return NotFound(); |
||||
|
} |
||||
|
|
||||
|
return errorClass; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <param name="id"></param>
|
||||
|
/// <param name="errorClass"></param>
|
||||
|
/// <returns></returns>
|
||||
|
// PUT: api/ErrorClasses/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<ActionResult<ErrorClass>> PutErrorClass(string id, [FromBody] ErrorClass errorClass) |
||||
|
{ |
||||
|
if (id != errorClass.ClassNo) |
||||
|
{ |
||||
|
return BadRequest(); |
||||
|
} |
||||
|
|
||||
|
_context.Entry(errorClass).State = EntityState.Modified; |
||||
|
|
||||
|
try |
||||
|
{ |
||||
|
await _context.SaveChangesAsync(); |
||||
|
} |
||||
|
catch (DbUpdateConcurrencyException) |
||||
|
{ |
||||
|
if (!ErrorClassExists(id)) |
||||
|
{ |
||||
|
return NotFound(); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
throw; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
return errorClass; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <param name="errorClass"></param>
|
||||
|
/// <returns></returns>
|
||||
|
// POST: api/ErrorClasses
|
||||
|
// 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<ActionResult<ErrorClass>> PostErrorClass([FromBody] ErrorClass errorClass) |
||||
|
{ |
||||
|
_context.ErrorClasses.Add(errorClass); |
||||
|
try |
||||
|
{ |
||||
|
await _context.SaveChangesAsync(); |
||||
|
} |
||||
|
catch (DbUpdateException) |
||||
|
{ |
||||
|
if (ErrorClassExists(errorClass.ClassNo)) |
||||
|
{ |
||||
|
return Conflict(); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
throw; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
return CreatedAtAction("GetErrorClass", new { id = errorClass.ClassNo }, errorClass); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <param name="id"></param>
|
||||
|
/// <returns></returns>
|
||||
|
// DELETE: api/ErrorClasses/5
|
||||
|
[HttpDelete("{id}")] |
||||
|
public async Task<ActionResult<ErrorClass>> DeleteErrorClass(string id) |
||||
|
{ |
||||
|
var errorClass = await _context.ErrorClasses.Where(p => p.ClassNo == id).FirstOrDefaultAsync(); |
||||
|
if (errorClass == null) |
||||
|
{ |
||||
|
return NotFound(); |
||||
|
} |
||||
|
|
||||
|
_context.ErrorClasses.Remove(errorClass); |
||||
|
await _context.SaveChangesAsync(); |
||||
|
|
||||
|
return errorClass; |
||||
|
} |
||||
|
|
||||
|
private bool ErrorClassExists(string id) |
||||
|
{ |
||||
|
return _context.ErrorClasses.Any(e => e.ClassNo == id); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,165 @@ |
|||||
|
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; |
||||
|
|
||||
|
namespace AMESCoreStudio.WebApi.Controllers.AMES |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 異常群組維護
|
||||
|
/// </summary>
|
||||
|
[Route("api/[controller]")]
|
||||
|
[ApiController] |
||||
|
public class ErrorGroupsController : ControllerBase |
||||
|
{ |
||||
|
private readonly AMESContext _context; |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <param name="context"></param>
|
||||
|
public ErrorGroupsController(AMESContext context) |
||||
|
{ |
||||
|
_context = context; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
// GET: api/ErrorGroups
|
||||
|
[HttpGet] |
||||
|
public async Task<ActionResult<IEnumerable<ErrorGroup>>> GetErrorGroup() |
||||
|
{ |
||||
|
IQueryable<ErrorGroup> q = _context.ErrorGroups; |
||||
|
|
||||
|
q = q.OrderBy(p => p.GroupNo); |
||||
|
|
||||
|
var errorGroup = await q.ToListAsync(); |
||||
|
|
||||
|
return errorGroup; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <param name="id"></param>
|
||||
|
/// <returns></returns>
|
||||
|
// GET: api/ErrorGroups/5
|
||||
|
[HttpGet("{id}")] |
||||
|
public async Task<ActionResult<IEnumerable<ErrorGroup>>> GetErrorGroup(string id) |
||||
|
{ |
||||
|
IQueryable<ErrorGroup> q = _context.ErrorGroups; |
||||
|
q = q.Where(p => p.GroupNo.Equals(id)); |
||||
|
|
||||
|
var errorGroup = await q.ToListAsync(); |
||||
|
|
||||
|
if (errorGroup == null) |
||||
|
{ |
||||
|
return NotFound(); |
||||
|
} |
||||
|
|
||||
|
return errorGroup; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <param name="id"></param>
|
||||
|
/// <param name="errorGroup"></param>
|
||||
|
/// <returns></returns>
|
||||
|
// PUT: api/ErrorGroups/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<ActionResult<ErrorGroup>> PutErrorGroup(string id, [FromBody] ErrorGroup errorGroup) |
||||
|
{ |
||||
|
if (id != errorGroup.GroupNo) |
||||
|
{ |
||||
|
return BadRequest(); |
||||
|
} |
||||
|
|
||||
|
_context.Entry(errorGroup).State = EntityState.Modified; |
||||
|
|
||||
|
try |
||||
|
{ |
||||
|
await _context.SaveChangesAsync(); |
||||
|
} |
||||
|
catch (DbUpdateConcurrencyException) |
||||
|
{ |
||||
|
if (!ErrorGroupExists(id)) |
||||
|
{ |
||||
|
return NotFound(); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
throw; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
return errorGroup; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <param name="errorGroup"></param>
|
||||
|
/// <returns></returns>
|
||||
|
// POST: api/ErrorGroups
|
||||
|
// 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<ActionResult<ErrorGroup>> PostErrorGroup([FromBody] ErrorGroup errorGroup) |
||||
|
{ |
||||
|
_context.ErrorGroups.Add(errorGroup); |
||||
|
try |
||||
|
{ |
||||
|
await _context.SaveChangesAsync(); |
||||
|
} |
||||
|
catch (DbUpdateException) |
||||
|
{ |
||||
|
if (ErrorGroupExists(errorGroup.GroupNo)) |
||||
|
{ |
||||
|
return Conflict(); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
throw; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
return CreatedAtAction("GetErrorGroup", new { id = errorGroup.GroupNo }, errorGroup); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <param name="id"></param>
|
||||
|
/// <returns></returns>
|
||||
|
// DELETE: api/ErrorGroups/5
|
||||
|
[HttpDelete("{id}")] |
||||
|
public async Task<ActionResult<ErrorGroup>> DeleteErrorGroup(string id) |
||||
|
{ |
||||
|
var errorGroup = await _context.ErrorGroups.Where(p => p.GroupNo == id).FirstOrDefaultAsync(); |
||||
|
if (errorGroup == null) |
||||
|
{ |
||||
|
return NotFound(); |
||||
|
} |
||||
|
|
||||
|
_context.ErrorGroups.Remove(errorGroup); |
||||
|
await _context.SaveChangesAsync(); |
||||
|
|
||||
|
return errorGroup; |
||||
|
} |
||||
|
|
||||
|
private bool ErrorGroupExists(string id) |
||||
|
{ |
||||
|
return _context.ErrorGroups.Any(e => e.GroupNo == id); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,160 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using AMESCoreStudio.WebApi.Models.AMES; |
||||
|
|
||||
|
namespace AMESCoreStudio.WebApi.Controllers.AMES |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 工單狀態維護
|
||||
|
/// </summary>
|
||||
|
[Route("api/[controller]")]
|
||||
|
[ApiController] |
||||
|
public class WipStatusController : ControllerBase |
||||
|
{ |
||||
|
private readonly AMESContext _context; |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <param name="context"></param>
|
||||
|
public WipStatusController(AMESContext context) |
||||
|
{ |
||||
|
_context = context; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
// GET: api/WipStatus
|
||||
|
[HttpGet] |
||||
|
public async Task<ActionResult<IEnumerable<WipStatus>>> GetWipStatus() |
||||
|
{ |
||||
|
IQueryable<WipStatus> q = _context.WipStatus; |
||||
|
q = q.OrderBy(p => p.StatusNo); |
||||
|
|
||||
|
var wipStatus = await q.ToListAsync(); |
||||
|
return wipStatus; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <param name="id"></param>
|
||||
|
/// <returns></returns>
|
||||
|
// GET: api/WipStatus/5
|
||||
|
[HttpGet("{id}")] |
||||
|
public async Task<ActionResult<IEnumerable<WipStatus>>> GetWipStatus(string id) |
||||
|
{ |
||||
|
IQueryable<WipStatus> q = _context.WipStatus; |
||||
|
q = q.Where(p => p.StatusNo.Equals(id)); |
||||
|
|
||||
|
var wipStatus = await q.ToListAsync(); |
||||
|
|
||||
|
if (wipStatus == null) |
||||
|
{ |
||||
|
return NotFound(); |
||||
|
} |
||||
|
|
||||
|
return wipStatus; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <param name="id"></param>
|
||||
|
/// <param name="wipStatus"></param>
|
||||
|
/// <returns></returns>
|
||||
|
// PUT: api/WipStatus/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<ActionResult<WipStatus>> PutWipStatus(string id, [FromBody] WipStatus wipStatus) |
||||
|
{ |
||||
|
if (id != wipStatus.StatusNo) |
||||
|
{ |
||||
|
return BadRequest(); |
||||
|
} |
||||
|
|
||||
|
_context.Entry(wipStatus).State = EntityState.Modified; |
||||
|
|
||||
|
try |
||||
|
{ |
||||
|
await _context.SaveChangesAsync(); |
||||
|
} |
||||
|
catch (DbUpdateConcurrencyException) |
||||
|
{ |
||||
|
if (!WipStatusExists(id)) |
||||
|
{ |
||||
|
return NotFound(); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
throw; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
return wipStatus; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <param name="wipStatus"></param>
|
||||
|
/// <returns></returns>
|
||||
|
// POST: api/WipStatus
|
||||
|
// 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<ActionResult<WipStatus>> PostWipStatus([FromBody] WipStatus wipStatus) |
||||
|
{ |
||||
|
_context.WipStatus.Add(wipStatus); |
||||
|
try |
||||
|
{ |
||||
|
await _context.SaveChangesAsync(); |
||||
|
} |
||||
|
catch (DbUpdateException) |
||||
|
{ |
||||
|
if (WipStatusExists(wipStatus.StatusNo)) |
||||
|
{ |
||||
|
return Conflict(); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
throw; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
return CreatedAtAction("GetWipStatus", new { id = wipStatus.StatusNo }, wipStatus); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <param name="id"></param>
|
||||
|
/// <returns></returns>
|
||||
|
// DELETE: api/WipStatus/5
|
||||
|
[HttpDelete("{id}")] |
||||
|
public async Task<ActionResult<WipStatus>> DeleteWipStatus(string id) |
||||
|
{ |
||||
|
var wipStatus = await _context.WipStatus.Where(p => p.StatusNo == id).FirstOrDefaultAsync(); |
||||
|
if (wipStatus == null) |
||||
|
{ |
||||
|
return NotFound(); |
||||
|
} |
||||
|
|
||||
|
_context.WipStatus.Remove(wipStatus); |
||||
|
await _context.SaveChangesAsync(); |
||||
|
|
||||
|
return wipStatus; |
||||
|
} |
||||
|
|
||||
|
private bool WipStatusExists(string id) |
||||
|
{ |
||||
|
return _context.WipStatus.Any(e => e.StatusNo == id); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,37 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.ComponentModel.DataAnnotations.Schema; |
||||
|
using System.Runtime.Serialization; |
||||
|
|
||||
|
namespace AMESCoreStudio.WebApi.Models.AMES |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 條碼狀態資料表
|
||||
|
/// </summary>
|
||||
|
[Table("BARCODE_STATUS", Schema = "JHAMES")] |
||||
|
[DataContract] |
||||
|
public class BarcodeStatus |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 條碼狀態代碼
|
||||
|
/// </summary>
|
||||
|
[Key] |
||||
|
[Column("STATUS_NO")] |
||||
|
[Required(ErrorMessage = "{0},不能空白")] |
||||
|
[Display(Name = "條碼狀態代碼")] |
||||
|
[StringLength(3, ErrorMessage = "{0},不能大于{1}")] |
||||
|
[DataMember] |
||||
|
public string StatusNo { get; set; } |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 條碼狀態描述
|
||||
|
/// </summary>
|
||||
|
[Column("STATUS_DESC")] |
||||
|
[DataMember] |
||||
|
[Required(ErrorMessage = "{0},不能空白")] |
||||
|
[Display(Name = "條碼狀態描述")] |
||||
|
[StringLength(30, ErrorMessage = "{0},不能大于{1}")] |
||||
|
public string StatusDesc { get; set; } |
||||
|
} |
||||
|
} |
@ -0,0 +1,48 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.ComponentModel.DataAnnotations.Schema; |
||||
|
using System.Runtime.Serialization; |
||||
|
|
||||
|
namespace AMESCoreStudio.WebApi.Models.AMES |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 异常类别资料表
|
||||
|
/// </summary>
|
||||
|
[Table("ERROR_CLASS", Schema = "JHAMES")] |
||||
|
[DataContract] |
||||
|
public class ErrorClass |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 異常類別代碼
|
||||
|
/// </summary>
|
||||
|
[Key] |
||||
|
[Column("CLASS_NO")] |
||||
|
[Required(ErrorMessage = "{0},不能空白")] |
||||
|
[Display(Name = "異常類別代碼")] |
||||
|
[StringLength(6, ErrorMessage = "{0},不能大于{1}")] |
||||
|
[DataMember] |
||||
|
public string ClassNo { get; set; } |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 異常群組代碼
|
||||
|
/// </summary>
|
||||
|
[Column("GROUP_NO")] |
||||
|
[Required(ErrorMessage = "{0},不能空白")] |
||||
|
[Display(Name = "異常群組代碼")] |
||||
|
[StringLength(6, ErrorMessage = "{0},不能大于{1}")] |
||||
|
[DataMember] |
||||
|
public string GroupNo { get; set; } |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 異常類別名稱
|
||||
|
/// </summary>
|
||||
|
[Column("CLASS_NAME")] |
||||
|
[DataMember] |
||||
|
[Required(ErrorMessage = "{0},不能空白")] |
||||
|
[Display(Name = "異常類別名稱")] |
||||
|
[StringLength(50, ErrorMessage = "{0},不能大于{1}")] |
||||
|
public string ClassName { get; set; } |
||||
|
} |
||||
|
} |
@ -0,0 +1,37 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.ComponentModel.DataAnnotations.Schema; |
||||
|
using System.Runtime.Serialization; |
||||
|
|
||||
|
namespace AMESCoreStudio.WebApi.Models.AMES |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 异常群组资料表
|
||||
|
/// </summary>
|
||||
|
[Table("ERROR_GROUP", Schema = "JHAMES")] |
||||
|
[DataContract] |
||||
|
public class ErrorGroup |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 異常群組代碼
|
||||
|
/// </summary>
|
||||
|
[Key] |
||||
|
[Column("GROUP_NO")] |
||||
|
[Required(ErrorMessage = "{0},不能空白")] |
||||
|
[Display(Name = "異常群組代碼")] |
||||
|
[StringLength(6, ErrorMessage = "{0},不能大于{1}")] |
||||
|
[DataMember] |
||||
|
public string GroupNo { get; set; } |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 異常群組名稱
|
||||
|
/// </summary>
|
||||
|
[Column("GROUP_NAME")] |
||||
|
[DataMember] |
||||
|
[Required(ErrorMessage = "{0},不能空白")] |
||||
|
[Display(Name = "異常群組名稱")] |
||||
|
[StringLength(50, ErrorMessage = "{0},不能大于{1}")] |
||||
|
public string GroupName { get; set; } |
||||
|
} |
||||
|
} |
@ -0,0 +1,37 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.ComponentModel.DataAnnotations.Schema; |
||||
|
using System.Runtime.Serialization; |
||||
|
|
||||
|
namespace AMESCoreStudio.WebApi.Models.AMES |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 工單狀態資料表
|
||||
|
/// </summary>
|
||||
|
[Table("WIP_STATUS", Schema = "JHAMES")] |
||||
|
[DataContract] |
||||
|
public class WipStatus |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 工單狀態代碼
|
||||
|
/// </summary>
|
||||
|
[Key] |
||||
|
[Column("STATUS_NO")] |
||||
|
[Required(ErrorMessage = "{0},不能空白")] |
||||
|
[Display(Name = "工單狀態代碼")] |
||||
|
[StringLength(3, ErrorMessage = "{0},不能大于{1}")] |
||||
|
[DataMember] |
||||
|
public string StatusNo { get; set; } |
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 工單狀態描述
|
||||
|
/// </summary>
|
||||
|
[Column("STATUS_DESC")] |
||||
|
[DataMember] |
||||
|
[Required(ErrorMessage = "{0},不能空白")] |
||||
|
[Display(Name = "工單狀態描述")] |
||||
|
[StringLength(30, ErrorMessage = "{0},不能大于{1}")] |
||||
|
public string StatusDesc { get; set; } |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue