|
@ -1358,14 +1358,15 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 取出貨序號
|
|
|
/// 取出貨序號 取到資料先儲存出貨序號
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
/// <param name="itemNo">料號</param>
|
|
|
/// <param name="itemNo">料號</param>
|
|
|
/// <param name="lotNo">生產序號</param>
|
|
|
/// <param name="lotNo">生產序號</param>
|
|
|
/// <param name="num">生產數量</param>
|
|
|
/// <param name="num">生產數量</param>
|
|
|
|
|
|
/// <param name="wipNo">工單號碼</param>
|
|
|
/// <returns>RuleStation </returns>
|
|
|
/// <returns>RuleStation </returns>
|
|
|
[HttpPost] |
|
|
[HttpPost] |
|
|
public async Task<JsonResult> GetBarcodeOther(string itemNo, string lotNo, int num) |
|
|
public async Task<JsonResult> GetBarcodeOther(string itemNo, string lotNo, int num ,string wipNo) |
|
|
{ |
|
|
{ |
|
|
var result = await _pcsApi.GetSerialRuleByQurey(itemNo, lotNo.Trim().ToUpper(), num); |
|
|
var result = await _pcsApi.GetSerialRuleByQurey(itemNo, lotNo.Trim().ToUpper(), num); |
|
|
string StartNO = ""; |
|
|
string StartNO = ""; |
|
@ -1375,6 +1376,24 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
{ |
|
|
{ |
|
|
StartNO = result.Msg.Split('~')[0]; |
|
|
StartNO = result.Msg.Split('~')[0]; |
|
|
EndNO = result.Msg.Split('~')[1] ?? result.Msg.Split('~')[0]; |
|
|
EndNO = result.Msg.Split('~')[1] ?? result.Msg.Split('~')[0]; |
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(StartNO) && !string.IsNullOrWhiteSpace(EndNO)) |
|
|
|
|
|
{ |
|
|
|
|
|
var type_no = await _pcsApi.GetBarcodeTypeByTypeName("客戶條碼區間"); |
|
|
|
|
|
if (type_no != null) |
|
|
|
|
|
{ |
|
|
|
|
|
WipBarcodeOther wipBarcodeOther = new WipBarcodeOther |
|
|
|
|
|
{ |
|
|
|
|
|
WipNO = wipNo, |
|
|
|
|
|
TypeNO = type_no.TypeNo, |
|
|
|
|
|
StartNO = StartNO, |
|
|
|
|
|
EndNO = EndNO, |
|
|
|
|
|
CreateUserID = GetLogInUserID(), |
|
|
|
|
|
UpdateUserID = GetLogInUserID() |
|
|
|
|
|
}; |
|
|
|
|
|
await _pcsApi.PostWipBarcodeOther(JsonConvert.SerializeObject(wipBarcodeOther)); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return Json(new Result() { success = result.Success, msg = result.Msg, data = new { StartNO, EndNO } }); |
|
|
return Json(new Result() { success = result.Success, msg = result.Msg, data = new { StartNO, EndNO } }); |
|
@ -2232,20 +2251,20 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 出貨序號
|
|
|
//// 出貨序號 改換點出貨序號時有資料就先儲存
|
|
|
if (!string.IsNullOrWhiteSpace(model.wipBarcodeOther.StartNO) && !string.IsNullOrWhiteSpace(model.wipBarcodeOther.EndNO)) |
|
|
//if (!string.IsNullOrWhiteSpace(model.wipBarcodeOther.StartNO) && !string.IsNullOrWhiteSpace(model.wipBarcodeOther.EndNO))
|
|
|
{ |
|
|
//{
|
|
|
var type_no = await _pcsApi.GetBarcodeTypeByTypeName("客戶條碼區間"); |
|
|
// var type_no = await _pcsApi.GetBarcodeTypeByTypeName("客戶條碼區間");
|
|
|
if (type_no != null) |
|
|
// if (type_no != null)
|
|
|
{ |
|
|
// {
|
|
|
model.wipBarcodeOther.WipNO = model.wipInfo.WipNO; |
|
|
// model.wipBarcodeOther.WipNO = model.wipInfo.WipNO;
|
|
|
model.wipBarcodeOther.TypeNO = type_no.TypeNo; |
|
|
// model.wipBarcodeOther.TypeNO = type_no.TypeNo;
|
|
|
if (model.wipBarcodeOther.OtherID != 0) |
|
|
// if (model.wipBarcodeOther.OtherID != 0)
|
|
|
result = await _pcsApi.PutWipBarcodeOther(JsonConvert.SerializeObject(model.wipBarcodeOther)); |
|
|
// result = await _pcsApi.PutWipBarcodeOther(JsonConvert.SerializeObject(model.wipBarcodeOther));
|
|
|
else |
|
|
// else
|
|
|
result = await _pcsApi.PostWipBarcodeOther(JsonConvert.SerializeObject(model.wipBarcodeOther)); |
|
|
// result = await _pcsApi.PostWipBarcodeOther(JsonConvert.SerializeObject(model.wipBarcodeOther));
|
|
|
} |
|
|
// }
|
|
|
} |
|
|
//}
|
|
|
|
|
|
|
|
|
// MAC
|
|
|
// MAC
|
|
|
if (!string.IsNullOrWhiteSpace(model.wipMAC.StartNO) && !string.IsNullOrWhiteSpace(model.wipMAC.EndNO)) |
|
|
if (!string.IsNullOrWhiteSpace(model.wipMAC.StartNO) && !string.IsNullOrWhiteSpace(model.wipMAC.EndNO)) |
|
@ -4556,7 +4575,8 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
WipReturn wipReturn = new WipReturn{ |
|
|
WipReturn wipReturn = new WipReturn |
|
|
|
|
|
{ |
|
|
WipNo = model.WipNo.Trim().ToUpper(), |
|
|
WipNo = model.WipNo.Trim().ToUpper(), |
|
|
GoruleStationId = model.GoByRuleStation, |
|
|
GoruleStationId = model.GoByRuleStation, |
|
|
ReruleStationId = model.RetrueRuleStation, |
|
|
ReruleStationId = model.RetrueRuleStation, |
|
|