feat: 智聪记账管理,期货同步功能修改。
This commit is contained in:
@@ -1,30 +1,25 @@
|
||||
package com.intc.invest.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.intc.common.core.utils.poi.ExcelUtil;
|
||||
import com.intc.common.core.web.controller.BaseController;
|
||||
import com.intc.common.core.web.domain.AjaxResult;
|
||||
import com.intc.common.core.web.page.TableDataInfo;
|
||||
import com.intc.common.log.annotation.Log;
|
||||
import com.intc.common.log.enums.BusinessType;
|
||||
import com.intc.common.security.annotation.RequiresPermissions;
|
||||
import com.intc.invest.domain.FuturesDailyHistory;
|
||||
import com.intc.invest.domain.vo.FuturesDailyHistoryVo;
|
||||
import com.intc.invest.domain.TuShare;
|
||||
import com.intc.invest.domain.TuShareParams;
|
||||
import com.intc.invest.domain.dto.FuturesDailyHistoryDto;
|
||||
import com.intc.invest.domain.vo.FuturesDailyHistoryVo;
|
||||
import com.intc.invest.service.IFuturesDailyHistoryService;
|
||||
import com.intc.common.core.web.controller.BaseController;
|
||||
import com.intc.common.core.web.domain.AjaxResult;
|
||||
import com.intc.common.core.utils.poi.ExcelUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import com.intc.common.core.web.page.TableDataInfo;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 期货日行情历史Controller
|
||||
@@ -113,4 +108,20 @@ public class FuturesDailyHistoryController extends BaseController
|
||||
{
|
||||
return toAjax(futuresDailyHistoryService.deleteFuturesDailyHistoryByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步期货日行情历史数据
|
||||
*/
|
||||
@ApiOperation(value="同步期货日行情历史数据",response = TuShareParams.class)
|
||||
// @RequiresPermissions("invest:stocksDailyHistory:list")
|
||||
@GetMapping("/synFuturesDailyHistory")
|
||||
public AjaxResult list(TuShareParams tuShareParams)
|
||||
{
|
||||
TuShare tuShare = new TuShare();
|
||||
tuShareParams.setEnd_date(tuShareParams.getEnd_date().replaceAll("-",""));
|
||||
tuShareParams.setStart_date(tuShareParams.getStart_date().replaceAll("-",""));
|
||||
tuShare.setParams(tuShareParams);
|
||||
futuresDailyHistoryService.synFuturesDailyHistory(tuShare);
|
||||
return success("同步成功!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.intc.invest.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.intc.common.core.annotation.Excel;
|
||||
import com.intc.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
@@ -7,6 +8,9 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 期货日行情历史对象 futures_daily_history
|
||||
*
|
||||
@@ -22,6 +26,9 @@ public class FuturesDailyHistory extends BaseEntity
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 股票 */
|
||||
private Long futureId;
|
||||
|
||||
/** TS合约代码 */
|
||||
@ApiModelProperty(value="TS合约代码")
|
||||
@Excel(name = "TS合约代码")
|
||||
@@ -29,78 +36,79 @@ public class FuturesDailyHistory extends BaseEntity
|
||||
|
||||
/** 交易日期 */
|
||||
@ApiModelProperty(value="交易日期")
|
||||
@Excel(name = "交易日期")
|
||||
private String tradeDate;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "交易日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date tradeDate;
|
||||
|
||||
/** 昨收盘价 */
|
||||
@ApiModelProperty(value="昨收盘价")
|
||||
@Excel(name = "昨收盘价")
|
||||
private String preClose;
|
||||
private Double preClose;
|
||||
|
||||
/** 昨结算价 */
|
||||
@ApiModelProperty(value="昨结算价")
|
||||
@Excel(name = "昨结算价")
|
||||
private String preSettle;
|
||||
private Double preSettle;
|
||||
|
||||
/** 开盘价 */
|
||||
@ApiModelProperty(value="开盘价")
|
||||
@Excel(name = "开盘价")
|
||||
private String open;
|
||||
private Double open;
|
||||
|
||||
/** 最高价 */
|
||||
@ApiModelProperty(value="最高价")
|
||||
@Excel(name = "最高价")
|
||||
private String high;
|
||||
private Double high;
|
||||
|
||||
/** 最低价 */
|
||||
@ApiModelProperty(value="最低价")
|
||||
@Excel(name = "最低价")
|
||||
private String low;
|
||||
private Double low;
|
||||
|
||||
/** 收盘价 */
|
||||
@ApiModelProperty(value="收盘价")
|
||||
@Excel(name = "收盘价")
|
||||
private String close;
|
||||
private Double close;
|
||||
|
||||
/** 结算价 */
|
||||
@ApiModelProperty(value="结算价")
|
||||
@Excel(name = "结算价")
|
||||
private String settle;
|
||||
private Double settle;
|
||||
|
||||
/** 收盘价涨跌 */
|
||||
@ApiModelProperty(value="收盘价涨跌")
|
||||
@Excel(name = "收盘价涨跌")
|
||||
private String change1;
|
||||
private Double change1;
|
||||
|
||||
/** 成交量(手) */
|
||||
@ApiModelProperty(value="成交量(手)")
|
||||
@Excel(name = "成交量(手)")
|
||||
private String vol;
|
||||
private Double vol;
|
||||
|
||||
/** 成交金额(万元) */
|
||||
@ApiModelProperty(value="成交金额(万元)")
|
||||
@Excel(name = "成交金额(万元)")
|
||||
private String amount;
|
||||
private Double amount;
|
||||
|
||||
/** 结算价涨跌 */
|
||||
@ApiModelProperty(value="结算价涨跌")
|
||||
@Excel(name = "结算价涨跌")
|
||||
private String change2;
|
||||
private Double change2;
|
||||
|
||||
/** 持仓量(手) */
|
||||
@ApiModelProperty(value="持仓量(手)")
|
||||
@Excel(name = "持仓量(手)")
|
||||
private String oi;
|
||||
private Double oi;
|
||||
|
||||
/** 持仓量变化 */
|
||||
@ApiModelProperty(value="持仓量变化")
|
||||
@Excel(name = "持仓量变化")
|
||||
private String oiChg;
|
||||
private Double oiChg;
|
||||
|
||||
/** 交割结算价 */
|
||||
@ApiModelProperty(value="交割结算价")
|
||||
@Excel(name = "交割结算价")
|
||||
private String delvSettle;
|
||||
private Double delvSettle;
|
||||
|
||||
/** 删除标志(0代表存在 1代表删除) */
|
||||
private String delFlag;
|
||||
@@ -131,6 +139,7 @@ public class FuturesDailyHistory extends BaseEntity
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("futureId", getFutureId())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.intc.invest.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 期货日行情历史Dto对象 futures_daily_history
|
||||
*
|
||||
@@ -22,7 +25,7 @@ public class FuturesDailyHistoryDto implements Serializable
|
||||
|
||||
/** 交易日期 */
|
||||
@ApiModelProperty(value="交易日期")
|
||||
private String tradeDate;
|
||||
private Date tradeDate;
|
||||
|
||||
/** 昨收盘价 */
|
||||
@ApiModelProperty(value="昨收盘价")
|
||||
@@ -80,4 +83,13 @@ public class FuturesDailyHistoryDto implements Serializable
|
||||
@ApiModelProperty(value="交割结算价")
|
||||
private String delvSettle;
|
||||
|
||||
|
||||
/** 交易类别 */
|
||||
@ApiModelProperty(value="开始日期")
|
||||
private String startTime;
|
||||
|
||||
/** 交易类别 */
|
||||
@ApiModelProperty(value="结束日期")
|
||||
private String endTime;
|
||||
|
||||
}
|
||||
|
||||
@@ -13,5 +13,9 @@ import io.swagger.annotations.ApiModel;
|
||||
@Data
|
||||
public class FuturesDailyHistoryVo extends FuturesDailyHistory
|
||||
{
|
||||
private String futureName;
|
||||
|
||||
private String pctChgName;
|
||||
|
||||
private String exchangeName;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package com.intc.invest.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.intc.invest.domain.FuturesDailyHistory;
|
||||
import com.intc.invest.domain.dto.FuturesDailyHistoryDto;
|
||||
import com.intc.invest.domain.vo.FuturesDailyHistoryVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 期货日行情历史Mapper接口
|
||||
*
|
||||
@@ -76,4 +77,12 @@ public interface FuturesDailyHistoryMapper
|
||||
* @return 结果
|
||||
*/
|
||||
public int removeFuturesDailyHistoryByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 批量插入信息
|
||||
*
|
||||
* @param futuresDailyHistory
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchInsertFuturesDailyHistory(List<FuturesDailyHistory> futuresDailyHistory);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package com.intc.invest.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.intc.invest.domain.FuturesDailyHistory;
|
||||
import com.intc.invest.domain.TuShare;
|
||||
import com.intc.invest.domain.dto.FuturesDailyHistoryDto;
|
||||
import com.intc.invest.domain.vo.FuturesDailyHistoryVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 期货日行情历史Service接口
|
||||
*
|
||||
@@ -60,4 +62,19 @@ public interface IFuturesDailyHistoryService
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFuturesDailyHistoryById(String id);
|
||||
|
||||
/**
|
||||
* 同步期货日行情历史信息
|
||||
*
|
||||
* @param tuShare 股票日行情历史
|
||||
* @return 结果
|
||||
*/
|
||||
public void synFuturesDailyHistory(TuShare tuShare);
|
||||
|
||||
/**
|
||||
* 同步当日期货日行情历史信息
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
public void synTodayFuturesDailyHistory();
|
||||
}
|
||||
|
||||
@@ -1,17 +1,32 @@
|
||||
package com.intc.invest.service.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.alibaba.nacos.shaded.com.google.gson.Gson;
|
||||
import com.alibaba.nacos.shaded.com.google.gson.JsonObject;
|
||||
import com.intc.common.core.utils.DateUtils;
|
||||
import com.intc.common.core.utils.IdWorker;
|
||||
import com.intc.common.core.utils.http.HttpUtils;
|
||||
import com.intc.common.security.utils.SecurityUtils;
|
||||
import com.intc.invest.domain.FuturesDailyHistory;
|
||||
import com.intc.invest.domain.TuShare;
|
||||
import com.intc.invest.domain.TuShareData;
|
||||
import com.intc.invest.domain.TuShareParams;
|
||||
import com.intc.invest.domain.dto.FutureBaseInforDto;
|
||||
import com.intc.invest.domain.dto.FuturesDailyHistoryDto;
|
||||
import com.intc.invest.domain.vo.FutureBaseInforVo;
|
||||
import com.intc.invest.domain.vo.FuturesDailyHistoryVo;
|
||||
import com.intc.invest.mapper.FutureBaseInforMapper;
|
||||
import com.intc.invest.mapper.FuturesDailyHistoryMapper;
|
||||
import com.intc.invest.service.IFuturesDailyHistoryService;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 期货日行情历史Service业务层处理
|
||||
@@ -24,6 +39,14 @@ public class FuturesDailyHistoryServiceImpl implements IFuturesDailyHistoryServi
|
||||
{
|
||||
@Resource
|
||||
private FuturesDailyHistoryMapper futuresDailyHistoryMapper;
|
||||
@Resource
|
||||
private FutureBaseInforMapper futureBaseInforMapper;
|
||||
|
||||
@Value("${config.tushareUrl}")
|
||||
private String tushareUrl;
|
||||
|
||||
@Value("${config.tushareToken}")
|
||||
private String tushareToken;
|
||||
|
||||
/**
|
||||
* 查询期货日行情历史
|
||||
@@ -46,7 +69,13 @@ public class FuturesDailyHistoryServiceImpl implements IFuturesDailyHistoryServi
|
||||
@Override
|
||||
public List<FuturesDailyHistoryVo> selectFuturesDailyHistoryList(FuturesDailyHistoryDto futuresDailyHistoryDto)
|
||||
{
|
||||
return futuresDailyHistoryMapper.selectFuturesDailyHistoryList(futuresDailyHistoryDto);
|
||||
List<FuturesDailyHistoryVo> list = futuresDailyHistoryMapper.selectFuturesDailyHistoryList(futuresDailyHistoryDto);
|
||||
DecimalFormat decimalFormat = new DecimalFormat("#.##");
|
||||
for (FuturesDailyHistoryVo vo: list) {
|
||||
String pctChgName=decimalFormat.format(vo.getChange1()*100/vo.getPreSettle());
|
||||
vo.setPctChgName(pctChgName+"%");
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -87,7 +116,7 @@ public class FuturesDailyHistoryServiceImpl implements IFuturesDailyHistoryServi
|
||||
@Override
|
||||
public int deleteFuturesDailyHistoryByIds(String[] ids)
|
||||
{
|
||||
return futuresDailyHistoryMapper.removeFuturesDailyHistoryByIds(ids);
|
||||
return futuresDailyHistoryMapper.deleteFuturesDailyHistoryByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -101,4 +130,132 @@ public class FuturesDailyHistoryServiceImpl implements IFuturesDailyHistoryServi
|
||||
{
|
||||
return futuresDailyHistoryMapper.removeFuturesDailyHistoryById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步股票日行情历史
|
||||
*
|
||||
* @param tuShare 需要删除的股票日行情历史主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public void synFuturesDailyHistory(TuShare tuShare) {
|
||||
|
||||
tuShare.setToken(tushareToken);
|
||||
tuShare.setApi_name("fut_daily");
|
||||
Gson gson = new Gson();
|
||||
JsonObject json = gson.toJsonTree(tuShare).getAsJsonObject();
|
||||
Map<String, String> headers = new HashMap<String, String>();
|
||||
headers.put("X-Ca-Signature-Headers", "x-ca-key,x-ca-timestamp");
|
||||
String returnString = HttpUtils.sendSSLPost(tushareUrl, null, JSONObject.parseObject(json.toString()), headers);
|
||||
com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(returnString);
|
||||
TuShareData data = JSON.parseObject(jsonObject.getString("data"), TuShareData.class);
|
||||
List<List<String>> itemList = data.getItems();
|
||||
List<FuturesDailyHistory> futuresDailyHistoryList = new ArrayList<>();
|
||||
for (List<String> item : itemList) {
|
||||
FuturesDailyHistory futuresDailyHistory = getFuturesDailyHistory(item,tuShare.getParams());
|
||||
futuresDailyHistoryList.add(futuresDailyHistory);
|
||||
}
|
||||
//批量插入数据
|
||||
if(futuresDailyHistoryList.size()>0){
|
||||
futuresDailyHistoryMapper.batchInsertFuturesDailyHistory(futuresDailyHistoryList);
|
||||
}
|
||||
}
|
||||
|
||||
private static FuturesDailyHistory getFuturesDailyHistory(List<String> item, TuShareParams tuShareParams) {
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||
FuturesDailyHistory futuresDailyHistory = new FuturesDailyHistory();
|
||||
futuresDailyHistory.setId(IdWorker.getId());
|
||||
futuresDailyHistory.setFutureId(tuShareParams.getTs_id());
|
||||
futuresDailyHistory.setCreateBy(SecurityUtils.getUsername());
|
||||
futuresDailyHistory.setCreateTime(DateUtils.getNowDate());
|
||||
futuresDailyHistory.setTsCode(item.get(0));
|
||||
try {
|
||||
futuresDailyHistory.setTradeDate(dateFormat.parse(item.get(1)));
|
||||
} catch (ParseException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
if(item.get(2)!=null){
|
||||
futuresDailyHistory.setPreClose(Double.parseDouble(item.get(2)));
|
||||
}
|
||||
if(item.get(3)!=null){
|
||||
futuresDailyHistory.setPreSettle(Double.parseDouble(item.get(3)));
|
||||
}
|
||||
if(item.get(4)!=null){
|
||||
futuresDailyHistory.setOpen(Double.parseDouble(item.get(4)));
|
||||
}
|
||||
if(item.get(5)!=null){
|
||||
futuresDailyHistory.setHigh(Double.parseDouble(item.get(5)));
|
||||
}
|
||||
if(item.get(6)!=null){
|
||||
futuresDailyHistory.setLow(Double.parseDouble(item.get(6)));
|
||||
}
|
||||
if(item.get(7)!=null){
|
||||
futuresDailyHistory.setClose(Double.parseDouble(item.get(7)));
|
||||
}
|
||||
if(item.get(8)!=null){
|
||||
futuresDailyHistory.setSettle(Double.parseDouble(item.get(8)));
|
||||
}
|
||||
if(item.get(9)!=null){
|
||||
futuresDailyHistory.setChange1(Double.parseDouble(item.get(9)));
|
||||
}
|
||||
if(item.get(10)!=null){
|
||||
futuresDailyHistory.setChange2(Double.parseDouble(item.get(10)));
|
||||
}
|
||||
|
||||
if(item.get(11)!=null){
|
||||
futuresDailyHistory.setVol(Double.parseDouble(item.get(11)));
|
||||
}
|
||||
if(item.get(12)!=null){
|
||||
futuresDailyHistory.setAmount(Double.parseDouble(item.get(12)));
|
||||
}
|
||||
if(item.get(13)!=null){
|
||||
futuresDailyHistory.setOi(Double.parseDouble(item.get(13)));
|
||||
}
|
||||
if(item.get(14)!=null){
|
||||
futuresDailyHistory.setOiChg(Double.parseDouble(item.get(14)));
|
||||
}
|
||||
return futuresDailyHistory;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 同步当天股票日行情历史
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public void synTodayFuturesDailyHistory() {
|
||||
List<FutureBaseInforVo> futureBaseInforVos=futureBaseInforMapper.selectFutureBaseInforList(new FutureBaseInforDto());
|
||||
//
|
||||
for (FutureBaseInforVo base : futureBaseInforVos) {
|
||||
TuShare tuShare = new TuShare();
|
||||
tuShare.setToken(tushareToken);
|
||||
tuShare.setApi_name("fut_daily");
|
||||
TuShareParams tuShareParams = new TuShareParams();
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||
tuShareParams.setTs_code(base.getTsCode());
|
||||
tuShareParams.setTs_id(base.getId());
|
||||
tuShareParams.setStart_date(dateFormat.format(new Date()));
|
||||
tuShareParams.setEnd_date(dateFormat.format(new Date()));
|
||||
tuShare.setParams(tuShareParams);
|
||||
Gson gson = new Gson();
|
||||
JsonObject json = gson.toJsonTree(tuShare).getAsJsonObject();
|
||||
Map<String, String> headers = new HashMap<String, String>();
|
||||
headers.put("X-Ca-Signature-Headers", "x-ca-key,x-ca-timestamp");
|
||||
String returnString = HttpUtils.sendSSLPost(tushareUrl, null, JSONObject.parseObject(json.toString()), headers);
|
||||
com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(returnString);
|
||||
TuShareData data = JSON.parseObject(jsonObject.getString("data"), TuShareData.class);
|
||||
List<List<String>> itemList = data.getItems();
|
||||
List<FuturesDailyHistory> futuresDailyHistoryList = new ArrayList<>();
|
||||
for (List<String> item : itemList) {
|
||||
FuturesDailyHistory futuresDailyHistory = getFuturesDailyHistory(item,tuShare.getParams());
|
||||
futuresDailyHistoryList.add(futuresDailyHistory);
|
||||
}
|
||||
//批量插入数据
|
||||
if(futuresDailyHistoryList.size()>0){
|
||||
futuresDailyHistoryMapper.batchInsertFuturesDailyHistory(futuresDailyHistoryList);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ public class StocksDailyHistoryServiceImpl implements IStocksDailyHistoryService
|
||||
*/
|
||||
@Override
|
||||
public int deleteStocksDailyHistoryByIds(Long[] ids) {
|
||||
return stocksDailyHistoryMapper.removeStocksDailyHistoryByIds(ids);
|
||||
return stocksDailyHistoryMapper.deleteStocksDailyHistoryByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.intc.job.controller;
|
||||
|
||||
import com.intc.common.core.utils.DateUtils;
|
||||
import com.intc.common.core.web.domain.AjaxResult;
|
||||
import com.intc.invest.service.IFuturesDailyHistoryService;
|
||||
import com.intc.invest.service.IMTService;
|
||||
import com.intc.invest.service.IStocksDailyHistoryService;
|
||||
import com.intc.invest.service.IUserService;
|
||||
@@ -34,6 +35,9 @@ public class InvestJob
|
||||
@Resource
|
||||
private IStocksDailyHistoryService stocksDailyHistoryService;
|
||||
|
||||
@Resource
|
||||
private IFuturesDailyHistoryService futuresDailyHistoryService;
|
||||
|
||||
@PostMapping("/generateUnpaidCreditBill")
|
||||
public AjaxResult generateUnpaidCreditBill()
|
||||
{
|
||||
@@ -134,6 +138,18 @@ public class InvestJob
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步当日期货日数据
|
||||
*/
|
||||
@PostMapping("/synFuturesDailyHistory")
|
||||
public AjaxResult synTodayFuturesDailyHistory()
|
||||
{
|
||||
System.out.println("================================开始同步当天期货日行情数据("+ DateUtils.getTime() +")=================================");
|
||||
futuresDailyHistoryService.synTodayFuturesDailyHistory();
|
||||
System.out.println("================================结束同步当天期货日行情数据("+ DateUtils.getTime() +")=================================");
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user