Browse Source

1. 修正出貨序號判斷

PTD
Ray 3 years ago
parent
commit
109adac469
  1. 4
      AMESCoreStudio.Web/Controllers/BASController.cs
  2. 21
      AMESCoreStudio.Web/Controllers/PCSController.cs
  3. 2
      AMESCoreStudio.WebApi/Controllers/AMES/WipBarcodeOthersController.cs
  4. 7
      AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs
  5. 6
      AMESCoreStudio.WebApi/DTO/BLL/BarCodeCheckDto.cs

4
AMESCoreStudio.Web/Controllers/BASController.cs

@ -9,6 +9,8 @@ using Microsoft.AspNetCore.Mvc.Rendering;
using AMESCoreStudio.WebApi.Models.BAS;
using AMESCoreStudio.WebApi.Models.AMES;
using AMESCoreStudio.CommonTools.Result;
using System.Collections.Generic;
using System.Linq;
namespace AMESCoreStudio.Web.Controllers
{
@ -249,7 +251,7 @@ namespace AMESCoreStudio.Web.Controllers
public async Task<JsonResult> GetUnitLineJson(string unit_no)
{
var result = await _basApi.GetLineInfoByUnit(unit_no);
result = result.OrderBy(o => o.LineID).ToList();
var item = new List<SelectListItem>();
for (int i = 0; i < result.Count; i++)

21
AMESCoreStudio.Web/Controllers/PCSController.cs

@ -1556,8 +1556,8 @@ namespace AMESCoreStudio.Web.Controllers
model.wipBarcode = model.wipBarcodes.FirstOrDefault();
model.ruleStations = await _pcsApi.GetRuleStationByWipNo(model.wipInfo.WipNO);
var q1 = await _pcsApi.GetMaterialSopQuery(itemNo: model.wipAtt.ItemNO);
model.materialSops = q1.Data;
//var q1 = await _pcsApi.GetMaterialSopQuery(itemNo: model.wipAtt.ItemNO);
//model.materialSops = q1.Data;
model.wipBoard = await _pcsApi.GetWipBoard(model.wipInfo.WipNO);
if (model.wipBoard != null)
@ -3439,7 +3439,6 @@ namespace AMESCoreStudio.Web.Controllers
// 抓作業站順序
model.RuleStation = RuleStations.Where(w => w.StationID == model.Station).Select(s => s.RuleStationID).FirstOrDefault();
model.StationSEQ = RuleStations.Where(w => w.StationID == model.Station).Select(s => s.Sequence).FirstOrDefault();
model.StationTestType = RuleStations.Where(w => w.StationID == model.Station).Select(s => s.Station.TestType).FirstOrDefault();
}
// 判斷是否有$符號,代表有不良代碼
if (model.Inputs.Where(w => w.Contains("$")).Any())
@ -3466,15 +3465,15 @@ namespace AMESCoreStudio.Web.Controllers
// 下一個作業站是完工站時再判斷是否都有刷組件
// 判斷組件是否都有輸入
if (Kp.Count() != 0)
{
var CheckBarCodeKP = await _pcsApi.CheckBarCodeKP(model.WipNO, model.Input, model.UnitNO, Kp);
if (!CheckBarCodeKP.Success)
return Json(new Result() { success = CheckBarCodeKP.Success, msg = CheckBarCodeKP.Msg, data = Data });
//if (Kp.Count() != 0)
//{
// var CheckBarCodeKP = await _pcsApi.CheckBarCodeKP(model.WipNO, model.Input, model.UnitNO, Kp);
// if (!CheckBarCodeKP.Success)
// return Json(new Result() { success = CheckBarCodeKP.Success, msg = CheckBarCodeKP.Msg, data = Data });
if (CheckBarCodeKP.Data != null)
ExtNo = CheckBarCodeKP.Data.FirstOrDefault();
}
// if (CheckBarCodeKP.Data != null)
// ExtNo = CheckBarCodeKP.Data.FirstOrDefault();
//}
var keyParts = new List<BarCodeCheckDto.inputItem>();
// 先查詢已綁定組件數量

2
AMESCoreStudio.WebApi/Controllers/AMES/WipBarcodeOthersController.cs

@ -75,7 +75,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES
public async Task<ActionResult<IEnumerable<WipBarcodeOther>>> CheckWipBarcodeOtherByNo(string wipNO, string No)
{
var wipBarcodeOther = _context.WipBarcodeOthers
.FromSqlInterpolated($" SELECT * FROM WIP_BARCODE_OTHER WHERE {No} BETWEEN START_NO AND END_NO ")
.FromSqlInterpolated($" SELECT * FROM JHAMES.WIP_BARCODE_OTHER WHERE {No} BETWEEN START_NO AND END_NO ")
.AsNoTracking().ToList();
wipBarcodeOther = wipBarcodeOther.Where(W => W.WipNO == wipNO).ToList();

7
AMESCoreStudio.WebApi/Controllers/BLL/BarCodeCheckController.cs

@ -154,6 +154,8 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES
var resultKeyParts = await CheckBarCodeKPAsync(barcodeItemKPDto);
if (!resultKeyParts.Success)
return (ResultModel<string>)resultKeyParts;
else
barCodeCheckDto.extNo = resultKeyParts.Msg;
}
#endregion
@ -506,6 +508,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES
barcodeInfo.RuleStatus = barCodeCheckDto.ruleStatus;
barcodeInfo.StatusNo = StatusNo;
barcodeInfo.WipID = barCodeCheckDto.wipID;
barcodeInfo.ExtraBarcodeNo = barCodeCheckDto.extNo;
if (CheckNextStopCloseStation(barCodeCheckDto.wipNo, barCodeCheckDto.unitNo, barCodeCheckDto.station).Result.Success)
{
barcodeInfo.StatusID = -1;
@ -1186,7 +1189,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES
return resultModel;
}
if (WipNoItem.Where(w => w.StatusNO == "Y").Any())
if (WipNoItem.Where(w => w.StatusNO == "E").Any())
{
resultModel.Msg = "工單號碼【" + wipNo + "】,該工單已經投入完工,請切換工單";
return resultModel;
@ -1411,7 +1414,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES
else
{
resultModel.Data = new List<string> { barcodeItemKPDto.inputKP[i] };
resultModel.Msg = "EXT_NO";
resultModel.Msg = barcodeItemKPDto.inputKP[i];
}
}
#endregion

6
AMESCoreStudio.WebApi/DTO/BLL/BarCodeCheckDto.cs

@ -96,6 +96,12 @@ namespace AMESCoreStudio.WebApi.DTO.AMES
[DataMember]
public List<Outfit> outfits { get; set; }
/// <summary>
/// 出貨序號
/// </summary>
[DataMember]
public string extNo { get; set; } = string.Empty;
/// <summary>
/// 紀錄組件或不良代碼

Loading…
Cancel
Save