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);