From 23a02e06c4d0a7f1a3775ed2eaca18906bed1224 Mon Sep 17 00:00:00 2001 From: hjhan Date: Fri, 21 Aug 2026 15:41:56 +0800 Subject: [PATCH] =?UTF-8?q?fix(swap):=20EQD-5320=20=E5=8D=95=E8=A1=8C?= =?UTF-8?q?=E5=8F=91=E9=80=81Email=E6=8C=89=E9=92=AE=E6=8A=A5'=E5=B9=B3?= =?UTF-8?q?=E4=BB=93=E6=B5=81=E6=B0=B4id=E8=A7=A3=E6=9E=90=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA'=E2=80=94=E2=80=94=E5=90=8C=E4=BA=8Bfa927b21=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E7=9A=84=E5=8D=95=E8=A1=8C=E6=8C=89=E9=92=AE=E4=BC=A0?= =?UTF-8?q?swap=5Fflow=5Fevent.EncryptId(=E5=8A=A0=E5=AF=86=E4=B8=B2,?= =?UTF-8?q?=E5=85=A8=E7=AB=99enid=E6=83=AF=E4=BE=8B)=EF=BC=8C=E8=80=8C?= =?UTF-8?q?=E7=AB=AF=E7=82=B9=E5=8E=9F=E5=8F=AA=E6=8C=89=E9=80=97=E5=8F=B7?= =?UTF-8?q?=E5=88=86=E9=9A=94=E6=95=B0=E5=AD=97=E8=A7=A3=E6=9E=90long.TryP?= =?UTF-8?q?arse=E5=BF=85=E8=B4=A5=EF=BC=9B=E6=8E=A7=E5=88=B6=E5=99=A8?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=E5=8F=8C=E5=BD=A2=E6=80=81=E4=BB=A4=E7=89=8C?= =?UTF-8?q?=EF=BC=9A=E9=9D=9E=E6=95=B0=E5=AD=97=E5=8D=B3DecryptLong?= =?UTF-8?q?=E8=A7=A3=E5=AF=86(=E5=A4=B1=E8=B4=A5=E8=BF=940=E4=B8=8D?= =?UTF-8?q?=E6=8A=9B,=E9=9D=9E=E6=B3=95=E4=B8=B2=E5=BF=BD=E7=95=A5)?= =?UTF-8?q?=EF=BC=8C=E9=94=99=E8=AF=AF=E6=96=87=E6=A1=88=E9=99=84=E5=8E=9F?= =?UTF-8?q?=E5=A7=8B=E5=85=A5=E5=8F=82=E4=BE=BF=E4=BA=8E=E5=AE=9A=E4=BD=8D?= =?UTF-8?q?=EF=BC=9B=E6=89=B9=E9=87=8F=E6=8C=89=E9=92=AE(=E6=95=B0?= =?UTF-8?q?=E5=AD=97id)=E8=A1=8C=E4=B8=BA=E4=B8=8D=E5=8F=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YLErpWeb/Controllers/SwapTrade2Controller.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/YLErpWeb/Controllers/SwapTrade2Controller.cs b/YLErpWeb/Controllers/SwapTrade2Controller.cs index bafb8382..479e70ab 100644 --- a/YLErpWeb/Controllers/SwapTrade2Controller.cs +++ b/YLErpWeb/Controllers/SwapTrade2Controller.cs @@ -1237,7 +1237,8 @@ namespace YLErp.Web.Controllers /// EQD-5320 批量发送结算确认书邮件——经服务端代理 bond-oms(BondOmsInterface_BaseUrl 出口), /// 替代前端直连 /trs_hub_api 反向代理(未配 nginx 的环境 404)。 /// - /// 平仓流水id,逗号分隔 + /// 平仓流水id,逗号分隔;单个令牌兼容【数字】与【EncryptId 加密串】两种形态 + /// (批量按钮传网格数字id,单行按钮传 swap_flow_event.EncryptId——全站 enid 惯例) [HttpPost] public JsonResult BatchSendSettleEmail(string swapFlowEventIds) { @@ -1248,14 +1249,21 @@ namespace YLErp.Web.Controllers var ids = new List(); foreach (var s in swapFlowEventIds.Split(',', StringSplitOptions.RemoveEmptyEntries)) { - if (long.TryParse(s.Trim(), out var id)) + var token = s.Trim(); + long id; + if (!long.TryParse(token, out id) || id <= 0) + { + // 非数字令牌按 EncryptId 解密(解密失败/非法串返回0,不抛出) + try { id = DecryptLong(token); } catch { id = 0; } + } + if (id > 0) { ids.Add(id); } } if (ids.Count == 0) { - return JsonError("平仓流水id解析为空"); + return JsonError("平仓流水id解析为空(既非数字也非有效加密ID):" + swapFlowEventIds); } var result = new SwapEndConfirmService(CurUser).BatchSendSettleEmail(ids); return string.IsNullOrEmpty(result) ? JsonSuccess("发送成功") : JsonError(result);