From 01830e44921b187b448d8cce9c9a46b9ad55af43 Mon Sep 17 00:00:00 2001
From: zj <1772600164@qq.com>
Date: Fri, 02 May 2025 19:48:32 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/bingx' into bingx

---
 src/main/java/project/futures/internal/FuturesOrderServiceImpl.java |   41 ++++++++++++++++++++++++++---------------
 1 files changed, 26 insertions(+), 15 deletions(-)

diff --git a/src/main/java/project/futures/internal/FuturesOrderServiceImpl.java b/src/main/java/project/futures/internal/FuturesOrderServiceImpl.java
index a7a9687..ac57e44 100644
--- a/src/main/java/project/futures/internal/FuturesOrderServiceImpl.java
+++ b/src/main/java/project/futures/internal/FuturesOrderServiceImpl.java
@@ -2,11 +2,8 @@
 
 import java.math.RoundingMode;
 import java.text.DecimalFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.text.SimpleDateFormat;
+import java.util.*;
 import java.util.concurrent.ConcurrentHashMap;
 
 import org.apache.commons.collections.CollectionUtils;
@@ -556,33 +553,38 @@
 		return data;
 	}
 
+	public static void main(String[] args) {
+		SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd  hh:mm:ss  a", Locale.ENGLISH);
+		System.out.println(simpleDateFormat.format(new Date()));
+	}
 	public Map<String, Object> bulidOne(FuturesOrder order) {
 		FuturesOrder order_cache = (FuturesOrder) redisHandler.get(FuturesRedisKeys.FUTURES_SUBMITTED_ORDERNO + order.getOrder_no());
 		if (order_cache != null) order = order_cache;
-		
+
 		Item item = this.itemService.cacheBySymbol(order.getSymbol(), false);
 		if (item == null) throw new BusinessException("参数错误");
 		String decimals = "#.";
-		
+
 		for (int i = 0; i < item.getDecimals(); i++) {
 			decimals = decimals + "#";
 		}
-		
+
 		if (item.getDecimals() == 0) {
 			decimals = "#";
 		}
-		
+
 		DecimalFormat df_symbol = new DecimalFormat(decimals);
 		df_symbol.setRoundingMode(RoundingMode.FLOOR);// 向下取整
-
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+		sdf.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
 		DecimalFormat df = new DecimalFormat("#.##");
 		Map<String, Object> map = new HashMap<String, Object>();
 		map.put("order_no", order.getOrder_no());
 		map.put("name", item.getName());
 		map.put("symbol", order.getSymbol());
-		map.put("open_time", DateUtils.format(order.getCreate_time(), DateUtils.DF_yyyyMMddHHmmss));
+		map.put("open_time", sdf.format(order.getCreate_time()));
 		if (order.getClose_time() != null) {
-			map.put("close_time", DateUtils.format(order.getClose_time(), "yyyy-MM-dd  hh:mm:ss"));
+			map.put("close_time", sdf.format(order.getClose_time()));
 		} else {
 			map.put("close_time", "--");
 		}
@@ -592,7 +594,7 @@
 		map.put("state", order.getState());
 		map.put("amount", order.getVolume());
 		map.put("fee", order.getFee());
-		
+
 		// 收益
 		if (order.getProfit() > 0) {
 			map.put("profit", df.format(order.getProfit()));
@@ -603,8 +605,7 @@
 		}
 
 		map.put("volume", order.getVolume());
-
-		map.put("settlement_time", DateUtils.format(order.getSettlement_time(),  "yyyy-MM-dd  hh:mm:ss"));// 交割时间
+		map.put("settlement_time", sdf.format(order.getSettlement_time()));// 交割时间
 		map.put("close_price", df_symbol.format(order.getClose_avg_price()));
 		map.put("remain_time", StringUtils.isEmptyString(order.getRemain_time()) ? "0:0:0" : order.getRemain_time());
 		map.put("time_num", order.getTimeNum());
@@ -706,6 +707,12 @@
 
 	public List<FuturesOrder> findByPartyIdAndToday(String partyId) {
 		return ApplicationUtil.executeSelect(FuturesOrder.class,"WHERE PARTY_ID=? AND DATEDIFF(CREATE_TIME,NOW())=0",new Object[] {partyId});
+	}
+
+	public List<FuturesOrder> findByPartyId(String partyId) {
+		String querySql="SELECT * FROM T_FUTURES_ORDER WHERE PARTY_ID=? ";
+		List<FuturesOrder> list = ApplicationUtil.executeSelect(FuturesOrder.class,"WHERE PARTY_ID=?",new Object[] {partyId});
+		return list;
 	}
 	
 	public List<FuturesOrder> findByHourAndSate(String state, String rolename) {
@@ -948,6 +955,10 @@
 		}
 	}
 
+	public void updateCache(String orderNo, FuturesOrder byOrderNo){
+		cache.put(byOrderNo.getOrder_no(), byOrderNo);
+	}
+
 	public void setWalletService(WalletService walletService) {
 		this.walletService = walletService;
 	}

--
Gitblit v1.9.3