From fc68aa452e2fd56441128d1d5a4b32f254c6191d Mon Sep 17 00:00:00 2001
From: zj <1772600164@qq.com>
Date: Sun, 05 Oct 2025 00:45:32 +0800
Subject: [PATCH] 修改地址

---
 src/main/java/project/project/web/api/ContractOrderController.java |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/main/java/project/project/web/api/ContractOrderController.java b/src/main/java/project/project/web/api/ContractOrderController.java
index d5170d7..bfdd291 100644
--- a/src/main/java/project/project/web/api/ContractOrderController.java
+++ b/src/main/java/project/project/web/api/ContractOrderController.java
@@ -79,7 +79,8 @@
 		} catch (BusinessException e) {
 			resultObject.setCode("1");
 			resultObject.setMsg(e.getMessage());
-		} catch (Throwable t) {
+		} catch (Exception t) {
+			t.printStackTrace();
 			resultObject.setCode("1");
 			resultObject.setMsg("程序错误");
 			logger.error("error:", t);
@@ -213,7 +214,7 @@
 				profit = Arith.add(profit,totleMoney);
 
 
-				if (map.get("direction") != null) {
+				if (map.get("direction") != null && map.get("state").equals("submitted")) {
 					String direction = map.get("direction").toString();
 					double liquidationPrice;
 					double deposit =  profit;
@@ -231,6 +232,10 @@
 							liquidationPrice = tradeAvgPrice - priceDrop;
 						}
 					}
+					// 检查 liquidationPrice 是否为有效数字
+					if (Double.isInfinite(liquidationPrice) || Double.isNaN(liquidationPrice)) {
+						liquidationPrice = 0;  // 如果是无效结果,回退为 0
+					}
 					DecimalFormat dfs = new DecimalFormat("#.#####");
 					String formattedPrice = dfs.format(liquidationPrice);
 					// 检查是否为负数

--
Gitblit v1.9.3