From 1fb6e66f5b07cc00584f5897e06fe3386cb3b57a Mon Sep 17 00:00:00 2001 From: mmm8955405 Date: Sat, 16 Mar 2024 00:16:58 +0800 Subject: [PATCH] mm --- .../controller/GetFutDailyController.java | 56 ++++++++++--------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/src/main/java/jj/tech/finance/biz/webadmin/controller/GetFutDailyController.java b/src/main/java/jj/tech/finance/biz/webadmin/controller/GetFutDailyController.java index a901dbb..faa18b1 100644 --- a/src/main/java/jj/tech/finance/biz/webadmin/controller/GetFutDailyController.java +++ b/src/main/java/jj/tech/finance/biz/webadmin/controller/GetFutDailyController.java @@ -149,7 +149,7 @@ public class GetFutDailyController { @GetMapping("/getDateNow") public Object getDateNow() { - LocalDate d = LocalDate.of(2024, 02, 20); + LocalDate d = LocalDate.now(); var from = select(ContractInfoMapper.selectList) .from(ContractInfoDynamicSqlSupport.contractInfo) .where(ContractInfoDynamicSqlSupport.contractInfo.delist_date, isGreaterThan(d)) @@ -161,9 +161,11 @@ public class GetFutDailyController { DeleteStatementProvider delete = deleteFrom(FutDailyDynamicSqlSupport.futDaily) - .where(FutDailyDynamicSqlSupport.ts_code, isIn(select(ContractInfoDynamicSqlSupport.ts_code) - .from(ContractInfoDynamicSqlSupport.contractInfo) - .where(ContractInfoDynamicSqlSupport.contractInfo.delist_date, isGreaterThan(d)))) + .where(FutDailyDynamicSqlSupport.ts_code, isIn( + select(ContractInfoDynamicSqlSupport.ts_code) + .from(ContractInfoDynamicSqlSupport.contractInfo) + .where(ContractInfoDynamicSqlSupport.contractInfo.delist_date, isGreaterThan(d))) + ) .build() .render(RenderingStrategies.MYBATIS3); futDailyMapper.delete(delete); @@ -330,29 +332,29 @@ public class GetFutDailyController { -// @Operation(summary = "合约信息", description = "") -// @GetMapping("/init") -// public Object init() throws Exception { -// -// List exchanges = Arrays.asList(Exchange.values()); -// -// exchanges.forEach(i->{ -// HashMap h = new HashMap(); -// h.put("api_name", "fut_basic"); -// h.put("token", TushareConfig.TOKEN); -// HashMap params = new HashMap(); -// params.put("exchange", i); -// h.put("params", params); -// try { -// this.getExchangeDate(i, h); -// } catch (Exception e) { -// e.printStackTrace(); -// } -// -// }); -// return R.SUCCESS("ok"); -// -// } + @Operation(summary = "合约信息", description = "") + @GetMapping("/init") + public Object init() throws Exception { + + List exchanges = Arrays.asList(Exchange.values()); + + exchanges.forEach(i->{ + HashMap h = new HashMap(); + h.put("api_name", "fut_basic"); + h.put("token", TushareConfig.TOKEN); + HashMap params = new HashMap(); + params.put("exchange", i); + h.put("params", params); + try { + this.getExchangeDate(i, h); + } catch (Exception e) { + e.printStackTrace(); + } + + }); + return R.SUCCESS("ok"); + + } public void getExchangeDate(Exchange exchange, HashMap parm) throws Exception{ logger.debug("tushare:" + objectMapper.writeValueAsString(parm));