我的任务-BC比对

optimize
jianghaiqing 2 years ago
parent 9261b62d62
commit 4573b9aaca

@ -389,6 +389,7 @@ namespace Myshipping.Application
PK_ID = IDGen.NextID().ToString(),
TASK_PKID = taskInfo.PK_ID,
MSG_JSON = info.Main.SerialMsgInfo.SerialMsg,
MSG_TYPE = info.Main.SerialMsgInfo.SerialType,
CreatedTime = taskInfo.CreatedTime,
UpdatedTime = taskInfo.CreatedTime,
};
@ -3463,21 +3464,21 @@ namespace Myshipping.Application
taskList.ForEach(async tsk =>
{
var rlt = await InnerSingleManualReCompareBC(tsk);
list.Add(rlt);
});
result.succ = true;
if (list.Any(t => !t.succ))
{
result.msg = "失败";
result.succ = false;
}
else
{
result.msg = "成功";
result.succ = true;
}
}
catch (Exception ex)
@ -3510,9 +3511,19 @@ namespace Myshipping.Application
if(storeInfo == null)
throw Oops.Oh("MBL_NO={0},获取{1}报文失败", model.MBL_NO,TaskStoreMsgTypeEnum.BC_MSG.GetDescription());
var rtl = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(storeInfo.MSG_TYPE);
var rtl = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(storeInfo.MSG_JSON);
string msg = string.Empty;
//2023-02-02 测试过程中发现JSON数据格式有了变化这里增加兼容
if(rtl.mesage != null)
{
msg = JSON.Serialize(rtl.mesage);
}
else
{
msg = storeInfo.MSG_JSON;
}
var msg = rtl.mesage.ToString();
if (string.IsNullOrWhiteSpace(msg))
throw Oops.Oh("MBL_NO={0},解析{1}报文详情异常", model.MBL_NO, TaskStoreMsgTypeEnum.BC_MSG.GetDescription());
@ -3611,7 +3622,7 @@ namespace Myshipping.Application
}
catch (Exception ex)
{
result.succ = true;
result.succ = false;
result.msg = $"手工重新比对BC异常,{ex.Message}";
//throw Oops.Bah("手工重新比对BC异常,{0}", ex.Message);
@ -3644,14 +3655,17 @@ namespace Myshipping.Application
*/
//约号
if (string.IsNullOrEmpty(orderInfo.CONTRACTNO) &&
(!string.IsNullOrWhiteSpace(bcStoreInfo.BJH) || !string.IsNullOrWhiteSpace(bcStoreInfo.FWHT)))
if (!string.IsNullOrWhiteSpace(orderInfo.CONTRACTNO))
{
if ((string.IsNullOrWhiteSpace(bcStoreInfo.BJH) || !Regex.IsMatch(orderInfo.CONTRACTNO, $"\\b{bcStoreInfo.BJH.Trim()}\\b"))
&& (string.IsNullOrWhiteSpace(bcStoreInfo.FWHT) || !Regex.IsMatch(orderInfo.CONTRACTNO, $"\\b{bcStoreInfo.FWHT.Trim()}\\b")))
{
rltTupleList.Add(new Tuple<bool, string>(false, "约号不一致"));
}
}
else
{
if (!orderInfo.CONTRACTNO.Contains(bcStoreInfo.BJH) && !orderInfo.CONTRACTNO.Contains(bcStoreInfo.FWHT))
if (!string.IsNullOrWhiteSpace(bcStoreInfo.BJH) || !string.IsNullOrWhiteSpace(bcStoreInfo.FWHT))
{
rltTupleList.Add(new Tuple<bool, string>(false, "约号不一致"));
}

Loading…
Cancel
Save