master
nodyang@aliyun.com 1 month ago
parent 5de1806d67
commit f13f668783

@ -132,7 +132,7 @@ namespace SlnMesnac.RfidUpload.Business
catch (Exception ex) catch (Exception ex)
{ {
logHelper.Error($"容器入库接口处理异常:{ex.Message}", ex); logHelper.Error($"容器入库接口处理异常:{ex.Message}", ex);
res.status = "500";
res.message= $"新容器入库接口处理异常:{ex.Message}"; res.message= $"新容器入库接口处理异常:{ex.Message}";
return res; return res;
} }
@ -172,7 +172,7 @@ namespace SlnMesnac.RfidUpload.Business
catch (Exception ex) catch (Exception ex)
{ {
logHelper.Error($"新容器入库-调拨单号验证接口处理异常:{ex.Message}", ex); logHelper.Error($"新容器入库-调拨单号验证接口处理异常:{ex.Message}", ex);
res.status = "500"; //res.status = "500";
res.message= $"新容器入库-调拨单号验证接口处理异常:{ex.Message}"; res.message= $"新容器入库-调拨单号验证接口处理异常:{ex.Message}";
} }
@ -263,7 +263,7 @@ namespace SlnMesnac.RfidUpload.Business
catch (Exception ex) catch (Exception ex)
{ {
logHelper.Error($"容器封发-获取调拨单和封发计划接口处理异常:{ex.Message}", ex); logHelper.Error($"容器封发-获取调拨单和封发计划接口处理异常:{ex.Message}", ex);
res.status = "500"; // res.status = "500";
res.message= $"容器封发-获取调拨单和封发计划接口处理异常:{ex.Message}"; res.message= $"容器封发-获取调拨单和封发计划接口处理异常:{ex.Message}";
return res; return res;
} }
@ -295,7 +295,7 @@ namespace SlnMesnac.RfidUpload.Business
catch (Exception ex) catch (Exception ex)
{ {
logHelper.Error($"容器封发-验证封发计划接口处理异常:{ex.Message}", ex); logHelper.Error($"容器封发-验证封发计划接口处理异常:{ex.Message}", ex);
res.code = "500"; // res.code = "500";
res.message= $"容器封发-验证封发计划接口处理异常:{ex.Message}"; res.message= $"容器封发-验证封发计划接口处理异常:{ex.Message}";
return res; return res;
} }
@ -335,7 +335,7 @@ namespace SlnMesnac.RfidUpload.Business
catch (Exception ex) catch (Exception ex)
{ {
logHelper.Error($"容器封发-接收容器条码接口处理异常:{ex.Message}", ex); logHelper.Error($"容器封发-接收容器条码接口处理异常:{ex.Message}", ex);
res.status = "500"; //res.status = "500";
res.message= $"容器封发-接收容器条码接口处理异常:{ex.Message}"; res.message= $"容器封发-接收容器条码接口处理异常:{ex.Message}";
return res; return res;
} }
@ -370,7 +370,7 @@ namespace SlnMesnac.RfidUpload.Business
{ {
logHelper.Error($"容器封发-反馈接收结果接口处理异常:{ex.Message}", ex); logHelper.Error($"容器封发-反馈接收结果接口处理异常:{ex.Message}", ex);
res.message= $"容器封发-反馈接收结果接口处理异常:{ex.Message}"; res.message= $"容器封发-反馈接收结果接口处理异常:{ex.Message}";
res.status = "500"; //res.status = "500";
return res; return res;
} }
} }
@ -403,7 +403,7 @@ namespace SlnMesnac.RfidUpload.Business
{ {
logHelper.Error($"容器直连配发-获取邮路卸交站接口处理异常:{ex.Message}", ex); logHelper.Error($"容器直连配发-获取邮路卸交站接口处理异常:{ex.Message}", ex);
res.message = $"容器直连配发-获取邮路卸交站接口处理异常:{ex.Message}"; res.message = $"容器直连配发-获取邮路卸交站接口处理异常:{ex.Message}";
res.code = "500"; // res.code = "500";
return res; return res;
} }
} }
@ -441,7 +441,7 @@ namespace SlnMesnac.RfidUpload.Business
{ {
logHelper.Error($"容器直连配发-校验发运计划接口处理异常:{ex.Message}", ex); logHelper.Error($"容器直连配发-校验发运计划接口处理异常:{ex.Message}", ex);
res.message = $"容器直连配发-校验发运计划接口处理异常:{ex.Message}"; res.message = $"容器直连配发-校验发运计划接口处理异常:{ex.Message}";
res.code = "500"; // res.code = "500";
return res; return res;
} }
} }
@ -482,7 +482,7 @@ namespace SlnMesnac.RfidUpload.Business
{ {
logHelper.Error($"容器直连配发-开始配发接口处理异常:{ex.Message}", ex); logHelper.Error($"容器直连配发-开始配发接口处理异常:{ex.Message}", ex);
res.message = $"容器直连配发-开始配发接口处理异常:{ex.Message}"; res.message = $"容器直连配发-开始配发接口处理异常:{ex.Message}";
res.code = "500"; // res.code = "500";
return res; return res;
} }
} }
@ -516,7 +516,7 @@ namespace SlnMesnac.RfidUpload.Business
{ {
logHelper.Error($"容器直连配发-反馈接收结果接口处理异常:{ex.Message}", ex); logHelper.Error($"容器直连配发-反馈接收结果接口处理异常:{ex.Message}", ex);
res.message = $"容器直连配发-反馈接收结果接口处理异常:{ex.Message}"; res.message = $"容器直连配发-反馈接收结果接口处理异常:{ex.Message}";
res.code = "500"; // res.code = "500";
return res; return res;
} }
} }

@ -32,13 +32,13 @@ namespace SlnMesnac.RfidUpload.Model.apiParam
{ {
public class CsbResult public class CsbResult
{ {
public string status { get; set; } // public string status { get; set; }
public string msg { get; set; } public string msg { get; set; }
// public List<Object> @object { get; set; } // public List<Object> @object { get; set; }
public bool IsSuccess => code == "200"; public bool IsSuccess => status().StartsWith("0");
public List<T> ToObjectList<T>() public List<T> ToObjectList<T>()
{ {
@ -70,13 +70,26 @@ namespace SlnMesnac.RfidUpload.Model.apiParam
if (job != null) if (job != null)
{ {
var s = job?["msg"]?.ToString(); var s = job?["msg"]?.ToString();
var b = job?["status"].ToString(); var b = "";
return s +" "+ b??""; return s +" "+ b??"";
} }
return ""; return "";
} }
public string status()
{
var job = GetRetBodyJObject();
if (job != null)
{
var s = job?["status"]?.ToString();
var b = "";
return s + " " + b ?? "";
}
return "";
}
public string GetRetBody() public string GetRetBody()
{ {
JObject job = JObject.Parse(body); JObject job = JObject.Parse(body);
@ -89,7 +102,7 @@ namespace SlnMesnac.RfidUpload.Model.apiParam
return message; return message;
} }
public string code { get; set; } // public string code { get; set; }
public string csbCode { get; set; } public string csbCode { get; set; }
public string message { get; set; } public string message { get; set; }
} }

@ -67,21 +67,18 @@ namespace SlnMesnac.RfidUpload.UI
CsbResult res = csbHandleBusiness.findStationSequenceByCsb(_transferOrderInfo.ffjhNo, opBatch); CsbResult res = csbHandleBusiness.findStationSequenceByCsb(_transferOrderInfo.ffjhNo, opBatch);
this.PageMessage.Content = res.GetMsg(); this.PageMessage.Content = res.GetMsg();
if (res.code == "200") if (res.IsSuccess)
{ {
if (res.IsSuccess) List<Institution> institutionList = res.ToObjectList<Institution>();
int count = 1;
Console.WriteLine("机构信息:");
foreach (var institution in institutionList)
{ {
List<Institution> institutionList = res.ToObjectList<Institution>(); institution.No = count++.ToString();
int count = 1; institution.opBatch = opBatch;
Console.WriteLine("机构信息:");
foreach (var institution in institutionList)
{
institution.No = count++.ToString();
institution.opBatch = opBatch;
}
InstitutionList.ItemsSource = institutionList;
} }
InstitutionList.ItemsSource = institutionList;
} }
else else
{ {
@ -153,7 +150,7 @@ namespace SlnMesnac.RfidUpload.UI
//6.8 验证封发计划接口 //6.8 验证封发计划接口
CsbResult res = csbHandleBusiness.transferOrderFfjhCheckByCsb(_transferOrderInfo.ffjhNo, _transferOrderInfo.ffjhscrq); CsbResult res = csbHandleBusiness.transferOrderFfjhCheckByCsb(_transferOrderInfo.ffjhNo, _transferOrderInfo.ffjhscrq);
this.PageMessage.Content = $"验证封发计划接口:{res.GetMsg()}"; this.PageMessage.Content = $"验证封发计划接口:{res.GetMsg()}";
if (res.code == "200") if (res.IsSuccess)
{ {
//封发计划正常可封发 //封发计划正常可封发
RefreshSubmitVerifyEvent?.Invoke(BelongPage, res.GetMsg(), _transferOrderInfo,institution); RefreshSubmitVerifyEvent?.Invoke(BelongPage, res.GetMsg(), _transferOrderInfo,institution);

@ -193,21 +193,18 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
#region 正式启用 #region 正式启用
CsbResult res = csbHandleBusiness.transferOrderFfjhByCsb("", _startDate.Value.ToString(), _endDate.Value.ToString()); CsbResult res = csbHandleBusiness.transferOrderFfjhByCsb("", _startDate.Value.ToString(), _endDate.Value.ToString());
TransferMsg = "获取调拨单结果:" + res.GetMsg(); TransferMsg = "获取调拨单结果:" + res.GetMsg();
// MessageBox.Show("容器封发-获取调拨单和封发计划:"+res.message); // MessageBox.Show("容器封发-获取调拨单和封发计划:"+res.message);
if (res.code == "200") if (res.IsSuccess)
{ {
if (res.IsSuccess) List<TransferOrderInfo> institutionList = res.ToObjectList<TransferOrderInfo>();
{ TransferOrderInfoItems = new ObservableCollection<TransferOrderInfo>(institutionList);
List<TransferOrderInfo> institutionList = res.ToObjectList<TransferOrderInfo>(); TotalAmount = TransferOrderInfoItems.Count.ToString();
TransferOrderInfoItems = new ObservableCollection<TransferOrderInfo>(institutionList);
TotalAmount = TransferOrderInfoItems.Count.ToString();
}
} }
#endregion #endregion
} }

@ -450,32 +450,23 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
res = csbHandleBusiness.containerStorageBatchQueryByCsb(TrackNo,batchNo.ToString(), enumerable.ToList()); res = csbHandleBusiness.containerStorageBatchQueryByCsb(TrackNo,batchNo.ToString(), enumerable.ToList());
} }
MainPageTipMessage = $"新容器入库 [{res.GetMsg()}]"; MainPageTipMessage = $"新容器入库 [{res.GetMsg()}]";
Task.Run(() => if (res.IsSuccess)
{ {
Thread.Sleep(3000); Task.Run(() =>
CsbResult res = csbHandleBusiness.receContainerStorageByCsb(TrackNo, "1");
Application.Current.Dispatcher.Invoke(() =>
{ {
MainPageTipMessage = $"新容器入库反馈接口,[{res.GetMsg()}]";
});
}); Thread.Sleep(3000);
CsbResult res = csbHandleBusiness.receContainerStorageByCsb(TrackNo, "1");
Application.Current.Dispatcher.Invoke(() =>
{
MainPageTipMessage = $"新容器入库反馈接口,[{res.GetMsg()}]";
});
////取出托盘号并调用接口 });
//var palletInfo = labelItems.FirstOrDefault();
//if (palletInfo == null) }
//{
// MessageBox.Show("请先放包裹读条码!");
// return;
//}
//else
//{
// CsbResult res = csbHandleBusiness.scanAnyContainerCodeByCsb(palletInfo.result);
// MessageBox.Show("新容器入库" + res.message);
//}
} }
else if (workModelParam == 2) //封发-按调拨单 else if (workModelParam == 2) //封发-按调拨单
{ {
@ -497,20 +488,25 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
MainPageTipMessage = $"封发-按调拨单 [{res.GetMsg()}]"; MainPageTipMessage = $"封发-按调拨单 [{res.GetMsg()}]";
Task.Run(() => if (res.IsSuccess)
{ //若干秒以后调反馈接口,确认是否和实际相符 {
Thread.Sleep(3000); Task.Run(() =>
{ //若干秒以后调反馈接口,确认是否和实际相符
CsbResult res = csbHandleBusiness.containerScanSealResultByCsb(TransferOrderInfoItem.ffjhNo, opBatch); Thread.Sleep(3000);
CsbResult res = csbHandleBusiness.containerScanSealResultByCsb(TransferOrderInfoItem.ffjhNo, opBatch);
Application.Current.Dispatcher.Invoke(() =>
{
MainPageTipMessage = $"封发-按调拨单反馈接口,[{res.GetMsg()}]";
// 如果需要弹出消息框,也需要在 UI 线程调用 MessageBox
// MessageBox.Show($"封发-按调拨单反馈接口,[{res.GetMsg()}]");
});
Application.Current.Dispatcher.Invoke(() =>
{
MainPageTipMessage = $"封发-按调拨单反馈接口,[{res.GetMsg()}]";
// 如果需要弹出消息框,也需要在 UI 线程调用 MessageBox
// MessageBox.Show($"封发-按调拨单反馈接口,[{res.GetMsg()}]");
}); });
}); }
} }
@ -532,56 +528,61 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
} }
MainPageTipMessage = $"封发-按调拨单 [{res.GetMsg()}]"; MainPageTipMessage = $"封发-按调拨单 [{res.GetMsg()}]";
if (res.IsSuccess)
Task.Run(() =>
{ {
// 五、6.10反馈接收结果(利用上一步的opBatch) Task.Run(() =>
Thread.Sleep(3000);
CsbResult res1 = csbHandleBusiness.containerScanSealResultByCsb(TransferOrderInfoItem.ffjhNo, opBatch);
MainPageTipMessage = $"封发-按调拨单反馈接口,[{res1.GetMsg()}]";
//六、6.12 效验发运计划(利用上一步的opBatch)
string stationOrgCode = Institution != null ? Institution.stationOrgCode : "";
string stationOrgName = Institution != null ? Institution.stationOrgName : "";
CsbResult res2 = csbHandleBusiness.tranPlanCheckByCsb(_transferOrderInfo.ffjhNo, opBatch, stationOrgCode, stationOrgName);
MainPageTipMessage = "校验发运计划结果:" + res2.GetMsg();
if (res2.code == "200")
{ {
// 七、6.13.容器直连配发-开始配发 // 五、6.10反馈接收结果(利用上一步的opBatch)
Task.Delay(3000);
CsbResult res3 = csbHandleBusiness.containerAllotByCsb(TransferOrderInfoItem.ffjhNo, opBatch); CsbResult res1 = csbHandleBusiness.containerScanSealResultByCsb(TransferOrderInfoItem.ffjhNo, opBatch);
MainPageTipMessage = $"库存容器封发配发 -- 6.13.容器直连配发-开始配发 [{res3.GetMsg()}]"; MainPageTipMessage = $"封发-按调拨单反馈接口,[{res1.GetMsg()}]";
Task.Run(() =>
if(!res1.IsSuccess) return;
//六、6.12 效验发运计划(利用上一步的opBatch)
string stationOrgCode = Institution != null ? Institution.stationOrgCode : "";
string stationOrgName = Institution != null ? Institution.stationOrgName : "";
CsbResult res2 = csbHandleBusiness.tranPlanCheckByCsb(_transferOrderInfo.ffjhNo, opBatch, stationOrgCode, stationOrgName);
MainPageTipMessage = "校验发运计划结果:" + res2.GetMsg();
if (res2.IsSuccess)
{ {
Task.Delay(3000); // 七、6.13.容器直连配发-开始配发
// Thread.Sleep(3000);
//八、反馈接收接口,确认是否和实际相符
for (int i = 0; i < 3; i++) CsbResult res3 = csbHandleBusiness.containerAllotByCsb(TransferOrderInfoItem.ffjhNo, opBatch);
MainPageTipMessage = $"库存容器封发配发 -- 6.13.容器直连配发-开始配发 [{res3.GetMsg()}]";
if (res3.IsSuccess)
{ {
try Task.Delay(3000);
// Thread.Sleep(3000);
//八、反馈接收接口,确认是否和实际相符
for (int i = 0; i < 3; i++)
{ {
CsbResult res4 = csbHandleBusiness.containerAllotResultByCsb(TransferOrderInfoItem.ffjhNo, opBatch); try
MainPageTipMessage = $"八、反馈接收接口,确认是否和实际相符[{res4.GetMsg()}]"; {
if (res4.IsSuccess) CsbResult res4 = csbHandleBusiness.containerAllotResultByCsb(TransferOrderInfoItem.ffjhNo, opBatch);
MainPageTipMessage = $"八、反馈接收接口,确认是否和实际相符[{res4.GetMsg()}]";
if (res4.IsSuccess)
{
break;
};
}
catch (Exception ex)
{ {
break; logger.Info(ex.Message);
Task.Delay(3000);
}
};
}
catch (Exception ex)
{
logger.Info(ex.Message);
Task.Delay(3000);
}
}
} }
}
}); });
} }
});

@ -193,7 +193,7 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
CsbResult res = csbHandleBusiness.transferOrderFfjhByCsb(_drj, _startDate.Value.ToString(), _endDate.Value.ToString()); CsbResult res = csbHandleBusiness.transferOrderFfjhByCsb(_drj, _startDate.Value.ToString(), _endDate.Value.ToString());
TransferMsg = $"获取调拨单结果:{res.GetMsg()}"; TransferMsg = $"获取调拨单结果:{res.GetMsg()}";
// MessageBox.Show("容器封发-获取调拨单和封发计划:" + res.GetMsg()); // MessageBox.Show("容器封发-获取调拨单和封发计划:" + res.GetMsg());
if (res.code == "200") if (res.IsSuccess)
{ {
JObject job = JObject.Parse(res.body); JObject job = JObject.Parse(res.body);
@ -228,7 +228,7 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
CsbResult res = csbHandleBusiness.transferOrderFfjhCheckByCsb(transferOrderInfo.ffjhNo, transferOrderInfo.ffjhscrq); CsbResult res = csbHandleBusiness.transferOrderFfjhCheckByCsb(transferOrderInfo.ffjhNo, transferOrderInfo.ffjhscrq);
TransferMsg = $"验证调拨单结果:{res.GetMsg()}"; TransferMsg = $"验证调拨单结果:{res.GetMsg()}";
if (res.code== "200") if (res.IsSuccess)
{ //封发计划正常可封发 { //封发计划正常可封发
// MessageBox.Show($"验证调拨单结果,[{res.GetMsg()}];"); // MessageBox.Show($"验证调拨单结果,[{res.GetMsg()}];");
SuccessEvent?.Invoke(); SuccessEvent?.Invoke();

@ -136,7 +136,7 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
{ {
CsbResult res = csbHandleBusiness.containerStorageQueryByCsb(dbbh,rqtmStart,rqtmEnd); CsbResult res = csbHandleBusiness.containerStorageQueryByCsb(dbbh,rqtmStart,rqtmEnd);
if (res.code == "200") if (res.IsSuccess)
{ {
JObject job = JObject.Parse(res.body); JObject job = JObject.Parse(res.body);
string str = job["retBody"]?["object"]?.ToString(); string str = job["retBody"]?["object"]?.ToString();
@ -165,7 +165,7 @@ namespace SlnMesnac.RfidUpload.UI.viewModel
} }
else else
{ {
MessageBox.Show($"新容器入库-调拨单号验证失败,status:{res.code};msg:{res.GetMsg()};"); MessageBox.Show($"新容器入库-调拨单号验证失败,status:{res.status()};msg:{res.GetMsg()};");
} }
}catch (Exception ex) }catch (Exception ex)

Loading…
Cancel
Save