From 4573b9aaca8916aeaf8b3e3b9214705336b987f8 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Thu, 2 Feb 2023 16:08:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=91=E7=9A=84=E4=BB=BB=E5=8A=A1-BC?= =?UTF-8?q?=E6=AF=94=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TaskManagePlat/TaskManageService.cs | 32 +++++++++++++------ 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs index 836be510..125ad612 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs @@ -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(storeInfo.MSG_TYPE); + var rtl = Newtonsoft.Json.JsonConvert.DeserializeObject(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)) { - rltTupleList.Add(new Tuple(false, "约号不一致")); + 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(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(false, "约号不一致")); }