|
|
@ -7321,8 +7321,9 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
|
if (result.Count() != 0) |
|
|
|
{ |
|
|
|
var _msg = string.Empty; |
|
|
|
|
|
|
|
if (recordNumber == null) _msg = "請輸入入庫箱號"; |
|
|
|
try |
|
|
|
{ |
|
|
|
if (recordNumber == null) _msg = "請輸入recordNumber"; |
|
|
|
if (AppSetting.Setting.Location == "9000" || AppSetting.Setting.Location == "0S08") |
|
|
|
{ |
|
|
|
if (recordNumber.Length != 10 || !recordNumber.StartsWith("50000")) |
|
|
@ -7334,29 +7335,35 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
|
} |
|
|
|
foreach (var item in result) |
|
|
|
{ |
|
|
|
var FlowStation_result = await _basApi.GetRuleStation(item.StationID); |
|
|
|
if (FlowStation_result.Count() != 0) |
|
|
|
{ |
|
|
|
var FlowRule_result = await _basApi.GetRuleStationsByFlow(FlowStation_result.Select(s => s.FlowRuleID).First()); |
|
|
|
if (FlowRule_result.Count() != 0) |
|
|
|
{ |
|
|
|
var LastStationID = FlowRule_result.Where(w => w.StationID != 1000).OrderBy(o => o.Sequence).Select(s => s.StationID).Last(); |
|
|
|
|
|
|
|
if (item.StationID != LastStationID || item.RuleStatus != "P" || item.StatusID != -1) |
|
|
|
//因已到入庫階段有帶出箱號才會進到此判斷,因此判斷流程是否流結束改如下條件
|
|
|
|
if (item.RuleStatus != "P" || item.StatusID != -1) |
|
|
|
{ |
|
|
|
_msg += "序號【" + item.BarcodeNo + "】,流程尚未完成,不可入庫!<br>"; |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
_msg = "查無序號" + item.BarcodeNo + "目前流程(flowID)"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
{ |
|
|
|
_msg = "查無序號" + item.BarcodeNo + "目前流程(rule_station_ID)"; |
|
|
|
} |
|
|
|
//var FlowStation_result = await _basApi.GetRuleStation(item.StationID);
|
|
|
|
//if (FlowStation_result.Count() != 0)
|
|
|
|
//{
|
|
|
|
// var FlowRule_result = await _basApi.GetRuleStationsByFlow(FlowStation_result.Select(s => s.FlowRuleID).First());
|
|
|
|
// if (FlowRule_result.Count() != 0)
|
|
|
|
// {
|
|
|
|
// var LastStationID = FlowRule_result.Where(w => w.StationID != 1000).OrderBy(o => o.Sequence).Select(s => s.StationID).Last();
|
|
|
|
|
|
|
|
// if (item.StationID != LastStationID || item.RuleStatus != "P" || item.StatusID != -1)
|
|
|
|
// {
|
|
|
|
// _msg += "序號【" + item.BarcodeNo + "】,流程尚未完成,不可入庫!<br>";
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// else
|
|
|
|
// {
|
|
|
|
// _msg = "查無序號" + item.BarcodeNo + "目前流程(flowID)";
|
|
|
|
// }
|
|
|
|
//}
|
|
|
|
|
|
|
|
//else
|
|
|
|
//{
|
|
|
|
// _msg = "查無序號" + item.BarcodeNo + "目前流程(rule_station_ID)";
|
|
|
|
//}
|
|
|
|
} |
|
|
|
if (_msg == string.Empty) |
|
|
|
{ |
|
|
@ -7366,6 +7373,8 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
|
{ |
|
|
|
var FlowRuleID = FlowRules_result.Select(s => s.FlowRuleID).First(); |
|
|
|
var ruleStations_result = await GetRuleStationByFlowRuleID(FlowRuleID); |
|
|
|
if (ruleStations_result.Count() != 0) |
|
|
|
{ |
|
|
|
var StationID = ruleStations_result.Select(s => s.StationID).First(); |
|
|
|
|
|
|
|
|
|
|
@ -7397,7 +7406,12 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
await _pcsApi.PutBarcodeInfoes(JsonConvert.SerializeObject(barcodeInfo)); |
|
|
|
var resultPutBInfo = await _pcsApi.PutBarcodeInfoes(JsonConvert.SerializeObject(barcodeInfo)); |
|
|
|
if (!resultPutBInfo.Success) |
|
|
|
{ |
|
|
|
_msg = resultPutBInfo.Msg; |
|
|
|
return new Result() { success = false, msg = _msg }; |
|
|
|
} |
|
|
|
|
|
|
|
var barcodeStations = new BarcodeStation |
|
|
|
{ |
|
|
@ -7424,8 +7438,12 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
|
|
|
|
|
} |
|
|
|
}; |
|
|
|
await _pcsApi.PostBarcodeStation(JsonConvert.SerializeObject(barcodeStations)); |
|
|
|
|
|
|
|
var resultPoutBStation = await _pcsApi.PostBarcodeStation(JsonConvert.SerializeObject(barcodeStations)); |
|
|
|
if (!resultPoutBStation.Success) |
|
|
|
{ |
|
|
|
_msg = resultPoutBStation.Msg; |
|
|
|
return new Result() { success = false, msg = _msg }; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
PTD101AMESModels.Add(new PTD101AMESModel |
|
|
@ -7455,18 +7473,30 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
|
Create_Date = DateTime.Now |
|
|
|
}; |
|
|
|
|
|
|
|
await _pcsApi.PostWareHouseing(JsonConvert.SerializeObject(Warehouseing)); |
|
|
|
// await _pcsApi.PostPTD101AMES(JsonConvert.SerializeObject(PTD101AMESModels));
|
|
|
|
var resultPostWH = await _pcsApi.PostWareHouseing(JsonConvert.SerializeObject(Warehouseing)); |
|
|
|
if (!resultPostWH.Success) |
|
|
|
{ |
|
|
|
_msg = resultPostWH.Msg; |
|
|
|
return new Result() { success = false, msg = _msg }; |
|
|
|
} |
|
|
|
|
|
|
|
var resultPTD101AMES = await _pcsApi.PostPTD101AMES(JsonConvert.SerializeObject(PTD101AMESModels)); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
_msg = "查無入庫代碼(W)"; |
|
|
|
_msg = "入庫代碼(W)查無設定站別"; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
_msg = "查無入庫代碼(W)"; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (_msg == string.Empty) |
|
|
|
{ |
|
|
|
//執行入庫作業
|
|
|
|
return new Result() { success = true, msg = "入庫完成" }; |
|
|
|
} |
|
|
@ -7474,7 +7504,17 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
|
{ |
|
|
|
return new Result() { success = false, msg = _msg }; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
return new Result() { success = false, msg = _msg }; |
|
|
|
} |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|
_msg = ex.ToString(); |
|
|
|
return new Result() { success = false, msg = _msg }; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
else |
|
|
@ -7483,6 +7523,7 @@ namespace AMESCoreStudio.Web.Controllers |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|