peter
2025-10-29 f3b9e9f5024c13c6e70711a3ec98b4538378bd85
src/main/java/com/nq/utils/task/stock/StockTask.java
@@ -14,6 +14,7 @@
import com.nq.service.IMandatoryLiquidationService;
import com.nq.service.IStockService;
import com.nq.service.IUserPositionService;
import com.nq.service.UserPendingorderService;
import com.nq.utils.http.HttpClientRequest;
import com.nq.utils.redis.RedisKeyUtil;
import org.slf4j.Logger;
@@ -39,6 +40,8 @@
    @Autowired
    IUserPositionService userPositionService;
    @Autowired
    UserPendingorderService userPendingorderService;
    @Autowired
    UserPositionMapper userPositionMapper;
@@ -69,7 +72,7 @@
        if (syncINStockDataLock.tryLock()) {
            try {
                syncINStockData.set(true); // 设置处理中标识为true
                loadAllStock(EStockType.IN);
                loadAllStock(EStockType.US);
            } finally {
                syncINStockDataLock.unlock();
                syncINStockData.set(false); // 设置处理中标识为false
@@ -77,6 +80,12 @@
        }
    }
//    @Scheduled(cron = "0 0/1 * * * ?")
    @Scheduled(cron = "0 30 21 * * ?")
    public void delUserPendingorder() {
        userPendingorderService.delUserPendingorderTask();
    }
    /**
     * 同步美国股票