|
|
|
@ -1,9 +1,9 @@
|
|
|
|
|
package com.tz.platform.juejing;
|
|
|
|
|
package com.tz.platform.juejin;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
|
|
import com.tz.platform.common.core.base.BaseException;
|
|
|
|
|
import com.tz.platform.common.core.tools.HttpUtil;
|
|
|
|
|
import com.tz.platform.juejing.bo.AccountInfo;
|
|
|
|
|
import com.tz.platform.juejin.bo.AccountInfo;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
@ -63,13 +63,42 @@ public class JueJinApi {
|
|
|
|
|
return content;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 绩效报告
|
|
|
|
|
* @param accountId
|
|
|
|
|
* @param title
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public String createReport(String accountId,String title){
|
|
|
|
|
String url = "https://api.myquant.cn:9001/perfweb-rpcgw/api/v1/sim/detail/"+accountId+"?title="+title;
|
|
|
|
|
String url = baseUrl+ "/perfweb-rpcgw/api/v1/sim/detail/"+accountId+"?title="+title;
|
|
|
|
|
String content = HttpUtil.get(url,headers);
|
|
|
|
|
logger.info("报告生成请求: {}",content);
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取绩效报告
|
|
|
|
|
* @param reportId
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public String getReport(String reportId){
|
|
|
|
|
String url = baseUrl +"/perfweb-rpcgw/api/v1/report/summaries?report_ids="+reportId;
|
|
|
|
|
String content = HttpUtil.get(url,headers);
|
|
|
|
|
logger.info("报告获取:{}",content);
|
|
|
|
|
return content;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 基准收益率
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public String getBaseRatio(){
|
|
|
|
|
String url = baseUrl +"/ds-history-rpcgw/v3/data-history/benchmark-return?symbol=SHSE.000300&frequency=1d&start_time=2022-03-07&end_time=2022-03-09&adjust=0";
|
|
|
|
|
String content = HttpUtil.get(url,headers);
|
|
|
|
|
logger.info("基准收益率:{}",content);
|
|
|
|
|
return content;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String test(){
|
|
|
|
|
String url = "https://sim.sztzjy.com/sim?acc=2e41a913-9dc1-11ec-89b3-00163e0e6ad0";
|
|
|
|
@ -78,16 +107,24 @@ public class JueJinApi {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
JueJinApi api = new JueJinApi();
|
|
|
|
|
String accountId = "2e41a913-9dc1-11ec-89b3-00163e0e6ad0";
|
|
|
|
|
|
|
|
|
|
// AccountInfo info = api.createAccount("test2",1000000L,1);
|
|
|
|
|
String zhangSan1Qihuo = "0cfc7894-9f4e-11ec-bf20-00163e0e6ad0";
|
|
|
|
|
String zhangSan1GuPiao = "";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AccountInfo info = api.createAccount("张三1",1000000L,4);
|
|
|
|
|
// System.out.println(info.getAccount_id());
|
|
|
|
|
// api.deleteAccount("4811913f-9dba-11ec-89b3-00163e0e6ad0");
|
|
|
|
|
// api.getCashInfo("2e41a913-9dc1-11ec-89b3-00163e0e6ad0");
|
|
|
|
|
// api.test();
|
|
|
|
|
api.createReport(accountId,"report"+ System.currentTimeMillis());
|
|
|
|
|
// api.createReport(accountId,"report"+ System.currentTimeMillis());
|
|
|
|
|
// api.getReport("5");
|
|
|
|
|
api.getBaseRatio();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|