From 640ccb9229224642515527daf87f308a7aa9bdf4 Mon Sep 17 00:00:00 2001
From: zj <1772600164@qq.com>
Date: Wed, 10 Jun 2026 11:47:26 +0800
Subject: [PATCH] 1
---
trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiContractApplyOrderController.java | 28 +++++++++++-----------------
1 files changed, 11 insertions(+), 17 deletions(-)
diff --git a/trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiContractApplyOrderController.java b/trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiContractApplyOrderController.java
index 07e7bf5..ea705da 100644
--- a/trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiContractApplyOrderController.java
+++ b/trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiContractApplyOrderController.java
@@ -28,7 +28,6 @@
import com.yami.trading.service.contract.ContractApplyOrderService;
import com.yami.trading.service.contract.ContractLockService;
import com.yami.trading.service.contract.ContractOrderService;
-import com.yami.trading.service.contract.ContractPositionModeService;
import com.yami.trading.service.data.DataService;
import com.yami.trading.service.item.ItemLeverageService;
import com.yami.trading.service.item.ItemService;
@@ -95,9 +94,6 @@
private ContractOrderService contractOrderService;
@Autowired
- private ContractPositionModeService contractPositionModeService;
-
- @Autowired
private ContractLockService contractLockService;
@Autowired
private SessionTokenService sessionTokenService;
@@ -132,8 +128,6 @@
data.put("contract_open_limit_min", contractOpenLimitMin);
BigDecimal contractOpenLimitMax = new BigDecimal(sysparaService.find("contract_open_limit_max").getSvalue());
data.put("contract_open_limit_max", contractOpenLimitMax);
- data.put("contract_position_mode", contractPositionModeService.getMode());
-
return Result.succeed(data);
@@ -209,7 +203,7 @@
lockAcquired = rLock.tryLock(5, TimeUnit.SECONDS);
if (!lockAcquired) {
log.warn("无法获取锁: contract_open_{}", partyId);
- throw new YamiShopBindException("请稍后再试");
+ throw new YamiShopBindException("Please try again later");
}
//判断下单金额是否符合最低金额 最低下单张数:0.01
//合约张数 张数=保证金*杠杆倍数/(面值*最新成交价)
@@ -218,7 +212,7 @@
if (amount.compareTo(new BigDecimal(faceValue)) < 0) {
double minimumAmount = minAmount * faceValue * openAction.getPrice().doubleValue() / openAction.getLever_rate().doubleValue();
double roundedAmount = Math.ceil(minimumAmount * 10000) / 10000;
- throw new YamiShopBindException("最低下单金额:"+roundedAmount);
+ throw new YamiShopBindException("Minimum order amount: " + roundedAmount);
}
// 校验当前用户订单状态
@@ -238,7 +232,7 @@
throw e; // 重新抛出自定义异常
} catch (Exception e) {
log.error("系统异常: {}", e.getMessage(), e);
- throw new YamiShopBindException("操作失败,请稍后再试");
+ throw new YamiShopBindException("Operation failed, please try again later");
} finally {
// 确保释放锁
if (lockAcquired && rLock.isHeldByCurrentThread()) {
@@ -282,7 +276,7 @@
String[] stopUsers = stopUserInternet.split(",");
User user = userService.getById(partyId);
if (Arrays.asList(stopUsers).contains(user.getUserName())) {
- throw new YamiShopBindException("无网络");
+ throw new YamiShopBindException("No network connection");
}
}
}
@@ -318,7 +312,7 @@
RLock rLock = redissonClient.getLock("contract_close_" + partyId);
boolean lockResult = rLock.tryLock(5, TimeUnit.SECONDS);
if (!lockResult) {
- throw new YamiShopBindException("请稍后再试");
+ throw new YamiShopBindException("Please try again later");
}
try {
User user = userService.getById(partyId);
@@ -335,7 +329,7 @@
System.out.println("stopUserInternet = " + stopUserInternet);
if(Arrays.asList(stopUsers).contains(user.getUserName())){
- throw new YamiShopBindException("无网络");
+ throw new YamiShopBindException("No network connection");
}
}
@@ -406,7 +400,7 @@
ContractApplyOrder order = this.contractApplyOrderService.findByOrderNo(order_no);
if (order == null) {
- throw new YamiShopBindException("委托单不存在");
+ throw new YamiShopBindException("Order does not exist");
}
Map<String, Object> map = new HashMap<String, Object>();
map.put("order_no", order.getOrderNo());
@@ -455,7 +449,7 @@
} catch (Exception e) {
log.error("执行撤单异常", e);
- throw new YamiShopBindException("执行撤单异常");
+ throw new YamiShopBindException("Failed to cancel order");
}
return Result.succeed(null,"success");
@@ -473,7 +467,7 @@
} catch (Exception e) {
log.error("执行撤单异常", e);
- throw new YamiShopBindException("执行撤单异常");
+ throw new YamiShopBindException("Failed to cancel order");
}
return Result.succeed(null,"success");
@@ -564,10 +558,10 @@
Page<ContractApplyOrder> result = contractApplyOrderService.findList(page, SecurityUtils.getUser().getUserId(), type, symbolType);
List<ContractApplyOrder> datas = result.getRecords();
if (!StringUtils.isInteger(page_no)) {
- throw new YamiShopBindException("页码不是整数");
+ throw new YamiShopBindException("Page number must be an integer");
}
if (Integer.valueOf(page_no).intValue() <= 0) {
- throw new YamiShopBindException("页码不能小于等于0");
+ throw new YamiShopBindException("Page number must be greater than 0");
}
Long count = 0L;
--
Gitblit v1.9.3