Browse Source

1. 修改Home Refresh Msg顯示方式

2. 修正鎖定條碼
PTD
ray 3 years ago
parent
commit
ca6ef7d388
  1. 76
      AMESCoreStudio.Web/Controllers/PCSController.cs
  2. 7
      AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs
  3. 2
      AMESCoreStudio.Web/Views/Home/Refresh.cshtml

76
AMESCoreStudio.Web/Controllers/PCSController.cs

@ -2271,6 +2271,7 @@ namespace AMESCoreStudio.Web.Controllers
public async Task<IActionResult> PCS013Async(PCS013ViewModel model, string select) public async Task<IActionResult> PCS013Async(PCS013ViewModel model, string select)
{ {
IResultModel result; IResultModel result;
var _msg = string.Empty;
// 內部條碼 // 內部條碼
if (select == "0") if (select == "0")
{ {
@ -2307,7 +2308,7 @@ namespace AMESCoreStudio.Web.Controllers
result = await _pcsApi.PostBarcodeLock(JsonConvert.SerializeObject(barcodeLock)); result = await _pcsApi.PostBarcodeLock(JsonConvert.SerializeObject(barcodeLock));
if (result.Success) if (result.Success)
{ {
var _msg = "條碼鎖定成功!"; _msg = "條碼鎖定成功!";
return RedirectToAction("Refresh", "Home", new { msg = _msg }); return RedirectToAction("Refresh", "Home", new { msg = _msg });
} }
else else
@ -2335,7 +2336,7 @@ namespace AMESCoreStudio.Web.Controllers
} }
var q1 = await _pcsApi.GetBarcodeInfoesByWipNo(model.WipNo); var q1 = await _pcsApi.GetBarcodeInfoesByWipNo(model.WipNo);
var _msg = string.Empty;
foreach (var item in q1) foreach (var item in q1)
{ {
// 判斷是否有鎖定中 // 判斷是否有鎖定中
@ -2418,39 +2419,46 @@ namespace AMESCoreStudio.Web.Controllers
return View(model); return View(model);
} }
var _msg = string.Empty; var BarCode = model.BarCodeNoEnd.Substring(0, model.BarCodeNoEnd.Length - NoLength);
//foreach (var item in q1)
//{ for (int i = NoStr; i <= NoEnd; i++)
// // 判斷是否有鎖定中 {
// var q2 = await _pcsApi.GetBarcodeLockByBarCodeID(item.BarcodeID); var itemBarcodeNo = BarCode + i.ToString().PadLeft(NoLength, '0');
// if (q2.Where(w => w.LockStatus == 0).Any()) var q_BarcodeInfo = await _pcsApi.GetBarcodeInfoesByNo(itemBarcodeNo);
// {
// _msg += "目前內部序號【" + item.BarcodeNo + "】尚未解鎖</br>"; if (q_BarcodeInfo.Count != 0)
// } {
// else // 判斷是否有鎖定中
// { var q2 = await _pcsApi.GetBarcodeLockByBarCodeID(q_BarcodeInfo.FirstOrDefault().BarcodeID);
// BarcodeLock barcodeLock = new BarcodeLock if (q2.Where(w => w.LockStatus == 0).Any())
// { {
// BarcodeID = item.BarcodeID, _msg += "目前內部序號【" + itemBarcodeNo + "】尚未解鎖</br>";
// WipID = item.WipID, }
// StatusID = item.StatusID, else
// LockStatus = 0, {
// LockReason = model.LockReason, BarcodeLock barcodeLock = new BarcodeLock
// LockUserID = 0 {
// }; BarcodeID = q_BarcodeInfo.FirstOrDefault().BarcodeID,
// result = await _pcsApi.PostBarcodeLock(JsonConvert.SerializeObject(barcodeLock)); WipID = q_BarcodeInfo.FirstOrDefault().WipID,
// if (result.Success) StatusID = q_BarcodeInfo.FirstOrDefault().StatusID,
// { LockStatus = 0,
// _msg += "目前內部序號【" + model.BarCodeNo + "】條碼鎖定成功!</br>"; LockReason = model.LockReason,
LockUserID = 0
// } };
// else result = await _pcsApi.PostBarcodeLock(JsonConvert.SerializeObject(barcodeLock));
// { if (result.Success)
// _msg += "目前內部序號【" + model.BarCodeNo + "】條碼鎖定失敗!</br>"; {
// } _msg += "目前內部序號【" + itemBarcodeNo + "】條碼鎖定成功!</br>";
// }
//} }
else
{
_msg += "目前內部序號【" + itemBarcodeNo + "】條碼鎖定失敗!</br>";
}
}
}
}
return RedirectToAction("Refresh", "Home", new { msg = _msg }); return RedirectToAction("Refresh", "Home", new { msg = _msg });
} }
return View(model); return View(model);

7
AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs

@ -238,6 +238,13 @@ namespace AMESCoreStudio.Web
[WebApiClient.Attributes.HttpGet("api/WipBarcode/{id}")] [WebApiClient.Attributes.HttpGet("api/WipBarcode/{id}")]
ITask<IEnumerable<WipBarcode>> GetWipBarcode(string id); ITask<IEnumerable<WipBarcode>> GetWipBarcode(string id);
/// <summary>
/// 查詢工單資料Barcode By 條碼前置碼
/// </summary>
/// <returns></returns>
[WebApiClient.Attributes.HttpGet("api/WipBarcode/BarcodeNo/{id}")]
ITask<IEnumerable<WipBarcode>> GetWipBarcodeBarcodeNo(string id);
/// <summary> /// <summary>
/// 刪除工單內部條碼區間 /// 刪除工單內部條碼區間
/// </summary> /// </summary>

2
AMESCoreStudio.Web/Views/Home/Refresh.cshtml

@ -8,7 +8,7 @@
<script type="text/javascript"> <script type="text/javascript">
//关闭弹出层 //关闭弹出层
hg.close(); hg.close();
hg.msg('@ViewBag.Msg'); hg.msg('@Html.Raw(@ViewBag.Msg)');
@if(ViewBag.Data == "") @if(ViewBag.Data == "")
{ {
//刷新列表 //刷新列表

Loading…
Cancel
Save