|
@@ -1,13 +1,16 @@
|
|
|
package com.smppw.analysis.client;
|
|
|
|
|
|
+import com.smppw.analysis.application.dto.position.bond.BondSortAllocationParam;
|
|
|
+import com.smppw.analysis.application.dto.position.future.MarginalRiskContributionParams;
|
|
|
import com.smppw.analysis.application.dto.position.stock.*;
|
|
|
import com.smppw.analysis.application.dto.position.synthesize.*;
|
|
|
+import com.smppw.analysis.application.service.FundFuturesOptionService;
|
|
|
+import com.smppw.analysis.application.service.FuturePositionAnalysis;
|
|
|
import com.smppw.analysis.application.service.StockPositionAnalysis;
|
|
|
import com.smppw.analysis.application.service.SynthesizePositionAnalysis;
|
|
|
+import com.smppw.analysis.application.service.position.bond.BondPositionService;
|
|
|
import com.smppw.common.pojo.ResultVo;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -20,14 +23,21 @@ import java.util.Map;
|
|
|
@RestController
|
|
|
@RequestMapping("/v2/fund/position-analysis")
|
|
|
public class FundPositionApi {
|
|
|
- // private final BondPositionAnalysis bond;
|
|
|
- // private final FuturePositionAnalysis future;
|
|
|
- private final SynthesizePositionAnalysis synthesize;
|
|
|
+ // private final BondPositionAnalysis bond;
|
|
|
private final StockPositionAnalysis stock;
|
|
|
+ private final FuturePositionAnalysis future;
|
|
|
+ private final SynthesizePositionAnalysis synthesize;
|
|
|
+ private final BondPositionService bondPositionService;
|
|
|
+ private final FundFuturesOptionService fundFuturesOptionService;
|
|
|
|
|
|
- public FundPositionApi(StockPositionAnalysis stock, SynthesizePositionAnalysis synthesize) {
|
|
|
+ public FundPositionApi(StockPositionAnalysis stock, FuturePositionAnalysis future,
|
|
|
+ SynthesizePositionAnalysis synthesize, BondPositionService bondPositionService,
|
|
|
+ FundFuturesOptionService fundFuturesOptionService) {
|
|
|
this.stock = stock;
|
|
|
+ this.future = future;
|
|
|
this.synthesize = synthesize;
|
|
|
+ this.bondPositionService = bondPositionService;
|
|
|
+ this.fundFuturesOptionService = fundFuturesOptionService;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -195,6 +205,125 @@ public class FundPositionApi {
|
|
|
return ResultVo.ok(this.stock.getRiskExposure(params));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 债券分类配置及明细 公募私募
|
|
|
+ *
|
|
|
+ * @param param /
|
|
|
+ * @return /
|
|
|
+ */
|
|
|
+ @GetMapping("bond/sort-allocation")
|
|
|
+ public ResultVo<Map<String, Object>> getBondSortAllocation(BondSortAllocationParam param) {
|
|
|
+ return ResultVo.ok(bondPositionService.getBondSortAllocation(param));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 债券集中度
|
|
|
+ *
|
|
|
+ * @param param /
|
|
|
+ * @return /
|
|
|
+ */
|
|
|
+ @GetMapping("bond/crn")
|
|
|
+ public ResultVo<Map<String, Object>> getBondConcentration(BondSortAllocationParam param) {
|
|
|
+ return ResultVo.ok(bondPositionService.getBondConcentration(param));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 债券信用评级
|
|
|
+ *
|
|
|
+ * @param param /
|
|
|
+ * @return /
|
|
|
+ */
|
|
|
+ @GetMapping("/bond/credit-grading")
|
|
|
+ public ResultVo<Map<String, Object>> getBondCreditGrading(BondSortAllocationParam param) {
|
|
|
+ return ResultVo.ok(bondPositionService.getBondCreditGrading(param));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param fundId 基金ID
|
|
|
+ * @param optionType 板块类别
|
|
|
+ * @param shType 投机/套期 1-Speculation,2-Hedging
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/fund-futures-option", method = RequestMethod.GET)
|
|
|
+ public ResultVo<Map<String, Object>> fundFuturesOption(@RequestParam("userId") Integer userId, @RequestParam("fundId") String fundId, @RequestParam("optionType") Integer optionType, @RequestParam(value = "shType", defaultValue = "1") Integer shType,
|
|
|
+ @RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate) {
|
|
|
+ return fundFuturesOptionService.fundFuturesOption(userId, fundId, optionType, shType, startDate, endDate);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param fundId 基金ID
|
|
|
+ * @param optionType 板块类别
|
|
|
+ * @param shType 投机/套期 1-Speculation,2-Hedging
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/fund-futures-option-breed", method = RequestMethod.GET)
|
|
|
+ public ResultVo<Map<String, Object>> fundFuturesOptionForBreed(@RequestParam("userId") Integer userId, @RequestParam("fundId") String fundId, @RequestParam(value = "optionType", required = false) Integer optionType, @RequestParam(value = "shType", defaultValue = "1") Integer shType,
|
|
|
+ @RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate) {
|
|
|
+ return fundFuturesOptionService.fundFuturesOptionForBreed(userId, fundId, optionType, shType, startDate, endDate);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 板块持仓分析
|
|
|
+ *
|
|
|
+ * @param fundId
|
|
|
+ * @param optionType
|
|
|
+ * @param shType
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/fund-position-analysis", method = RequestMethod.GET)
|
|
|
+ public ResultVo<Map<String, Object>> fundPositionAnalysis(@RequestParam("userId") Integer userId, @RequestParam("fundId") String fundId, @RequestParam("optionType") Integer optionType, @RequestParam(value = "shType", defaultValue = "1") Integer shType,
|
|
|
+ @RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate) {
|
|
|
+ return fundFuturesOptionService.fundPositionAnalysis(userId, fundId, optionType, shType, startDate, endDate);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 板块持仓分析
|
|
|
+ *
|
|
|
+ * @param fundId
|
|
|
+ * @param optionType
|
|
|
+ * @param shType
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/fund-position-analysis-line", method = RequestMethod.GET)
|
|
|
+ public ResultVo<Map<String, Object>> fundPositionAnalysisLine(@RequestParam("userId") Integer userId, @RequestParam("fundId") String fundId, @RequestParam(value = "optionType", required = false, defaultValue = "0") Integer optionType, @RequestParam(value = "shType", defaultValue = "1", required = false) Integer shType,
|
|
|
+ @RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate) {
|
|
|
+ return fundFuturesOptionService.fundPositionAnalysisLine(userId, fundId, optionType, shType, startDate, endDate);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 衍生品杠杆与保证金
|
|
|
+ *
|
|
|
+ * @param fundId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/fund-derivative-leverage-margin", method = RequestMethod.GET)
|
|
|
+ public ResultVo<Map<String, Object>> fundDerivativeLeverageMargin(@RequestParam("userId") Integer userId, @RequestParam("fundId") String fundId, @RequestParam(value = "shType", required = false) Integer shType,
|
|
|
+ @RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate) {
|
|
|
+ return fundFuturesOptionService.fundDerivativeLeverageMargin(userId, fundId, shType, startDate, endDate);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 边际风险贡献
|
|
|
+ *
|
|
|
+ * @param params
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/fund-marginal-risk-contribution", method = RequestMethod.GET)
|
|
|
+ public ResultVo<Map<String, Object>> getFutureRiskCont(MarginalRiskContributionParams params) {
|
|
|
+ return ResultVo.ok(this.future.riskCont(params));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/fund-futures-option-view", method = RequestMethod.GET)
|
|
|
+ public ResultVo<Map<String, List<String>>> fundFuturesOptionView() {
|
|
|
+ return fundFuturesOptionService.fundFuturesOptionView();
|
|
|
+ }
|
|
|
+
|
|
|
// /**
|
|
|
// * 公募私募,债券-久期分析
|
|
|
// *
|