Commit c1eac3c7 authored by 吴泽佳's avatar 吴泽佳

基金行家 需求 提交27

parent 972d5b1c
...@@ -94,6 +94,10 @@ public interface ProductApi { ...@@ -94,6 +94,10 @@ public interface ProductApi {
@GetMapping("/fund/record") @GetMapping("/fund/record")
CommonResp<FundRecordVO> getFundRecordInfo(@ApiParam("产品id") @RequestParam("id") String id); CommonResp<FundRecordVO> getFundRecordInfo(@ApiParam("产品id") @RequestParam("id") String id);
@ApiOperation("基金档案 - 交易须知")
@GetMapping("/fund/notice")
CommonResp<FundNoticeVO> getFundNoticeInfo(@ApiParam("产品id") @RequestParam("id") String id);
@ApiOperation("基金公司") @ApiOperation("基金公司")
@GetMapping("/fund/company") @GetMapping("/fund/company")
CommonResp<FundCompanyVO> getFundCompanyInfo(@ApiParam("基金公司id") @RequestParam("id") String id); CommonResp<FundCompanyVO> getFundCompanyInfo(@ApiParam("基金公司id") @RequestParam("id") String id);
......
...@@ -108,6 +108,11 @@ public class ProductController implements ProductApi { ...@@ -108,6 +108,11 @@ public class ProductController implements ProductApi {
return CommonResp.success(this.productService.getFundRecord(id)); return CommonResp.success(this.productService.getFundRecord(id));
} }
@Override
public CommonResp<FundNoticeVO> getFundNoticeInfo(String id) {
return CommonResp.success(this.productService.getFundNoticeInfo(id));
}
@Override @Override
public CommonResp<FundCompanyVO> getFundCompanyInfo(String id) { public CommonResp<FundCompanyVO> getFundCompanyInfo(String id) {
return CommonResp.success(this.productService.getFundCompany(id)); return CommonResp.success(this.productService.getFundCompany(id));
......
...@@ -51,6 +51,8 @@ public interface ProductService { ...@@ -51,6 +51,8 @@ public interface ProductService {
FundRecordVO getFundRecord(String id); FundRecordVO getFundRecord(String id);
FundNoticeVO getFundNoticeInfo(String id);
FundCompanyVO getFundCompany(String id); FundCompanyVO getFundCompany(String id);
List<ProductInfoVO> getProductInfolist(ProductListReq req); List<ProductInfoVO> getProductInfolist(ProductListReq req);
......
...@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateField; ...@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.poi.excel.ExcelReader; import cn.hutool.poi.excel.ExcelReader;
import cn.hutool.poi.excel.ExcelUtil; import cn.hutool.poi.excel.ExcelUtil;
import com.github.pagehelper.page.PageMethod; import com.github.pagehelper.page.PageMethod;
...@@ -46,9 +47,9 @@ import org.springframework.stereotype.Service; ...@@ -46,9 +47,9 @@ import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -157,6 +158,8 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -157,6 +158,8 @@ public class ProductServiceImpl implements ProductService, Constant {
} }
FundInfo fundInfo = infos.get(0); FundInfo fundInfo = infos.get(0);
BeanUtils.copyProperties(fundInfo, vo); BeanUtils.copyProperties(fundInfo, vo);
vo.setStrategy(String.valueOf(fundInfo.getStrategy()));
vo.setSubstrategy(String.valueOf(fundInfo.getSubstrategy()));
vo.setOpenDay(fundInfo.getOpenDay()); vo.setOpenDay(fundInfo.getOpenDay());
vo.setProductName(fundInfo.getFundShortName()); vo.setProductName(fundInfo.getFundShortName());
vo.setDesc(fundInfo.getDescInfo()); vo.setDesc(fundInfo.getDescInfo());
...@@ -194,6 +197,33 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -194,6 +197,33 @@ public class ProductServiceImpl implements ProductService, Constant {
vo.setCumulativeProfit(BigDecimalUtil.toString(fundCount.getCumulativeNav())); vo.setCumulativeProfit(BigDecimalUtil.toString(fundCount.getCumulativeNav()));
vo.setRetYtd(multiply100(fundCount.getRetYtd())); vo.setRetYtd(multiply100(fundCount.getRetYtd()));
vo.setRetIncep(multiply100(fundCount.getRetIncep())); vo.setRetIncep(multiply100(fundCount.getRetIncep()));
vo.setSharperatioIncep(multiply100(fundCount.getSharperatioIncep()));
vo.setMaxdrawdownIncep(multiply100(fundCount.getMaxdrawdownIncep()));
vo.setRetIncepA(multiply100(fundCount.getRetIncepA()));
if (ObjectUtil.isNotNull(fundInfo.getInceptionDate())) {
long betweenMonth = DateUtil.betweenMonth(fundInfo.getInceptionDate(), new Date(), false);
BigDecimal bigDecimal = new BigDecimal(betweenMonth);
BigDecimal bigDecimal2 = new BigDecimal(12);
BigDecimal divide = bigDecimal.divide(bigDecimal2, 1, RoundingMode.HALF_UP);
vo.setInceptionDateYear(divide.toString());
if (betweenMonth < 1) {
vo.setMouth("1个月");
vo.setRetOfMouth("");
} else if (betweenMonth < 3) {
vo.setMouth("1个月");
vo.setRetOfMouth(multiply100(fundCount.getRet1m()));
} else if (betweenMonth < 6) {
vo.setMouth("3个月");
vo.setRetOfMouth(multiply100(fundCount.getRet3m()));
} else if (betweenMonth < 12) {
vo.setMouth("6个月");
vo.setRetOfMouth(multiply100(fundCount.getRet6m()));
} else {
vo.setMouth("1年");
vo.setRetOfMouth(multiply100(fundCount.getRet1y()));
}
}
} }
// 基金公司信息 // 基金公司信息
...@@ -220,13 +250,17 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -220,13 +250,17 @@ public class ProductServiceImpl implements ProductService, Constant {
//子策略名称 //子策略名称
if (vo.getSubstrategy() != null) { if (vo.getSubstrategy() != null) {
CommonResp<List<SysConstantResp>> listCommonResp = this.fatools.queryLabels(SysConstEnums.TAMPSUBSTRATEGY.getConstantGroup()); vo.setSubstrategyName(ProductEnums.FundSubStrategyEnum.getBySubStrategy(Integer.valueOf(vo.getSubstrategy())));
if (listCommonResp.isSuccess()) { // CommonResp<List<SysConstantResp>> listCommonResp = this.fatools.queryLabels(SysConstEnums.TAMPSUBSTRATEGY.getConstantGroup());
listCommonResp.getAttributes().stream() // if (listCommonResp.isSuccess()) {
.filter(item -> StringUtils.equals(String.valueOf(vo.getSubstrategy()), item.getConstantCode())) // listCommonResp.getAttributes().stream()
.findFirst() // .filter(item -> StringUtils.equals(String.valueOf(vo.getSubstrategy()), item.getConstantCode()))
.ifPresent(sysConstantResp -> vo.setStrategyName(sysConstantResp.getConstantName())); // .findFirst()
} // .ifPresent(sysConstantResp -> vo.setStrategyName(sysConstantResp.getConstantName()));
// }
}
if (vo.getStrategy() != null) {
vo.setStrategyName(ProductEnums.FundStrategyEnum.getByStrategy(Integer.valueOf(vo.getStrategy())));
} }
vo.setProductType(Constant.ONE_NUM); vo.setProductType(Constant.ONE_NUM);
...@@ -1028,6 +1062,32 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -1028,6 +1062,32 @@ public class ProductServiceImpl implements ProductService, Constant {
return vo; return vo;
} }
@Override
public FundNoticeVO getFundNoticeInfo(String id) {
FundNoticeVO fundNoticeVO = new FundNoticeVO();
FundInfo fundInfo = this.fundInfoMapper.selectByPrimaryKey(id);
fundNoticeVO.setOpenDay(fundInfo.getOpenDay());
fundNoticeVO.setCloseDay(fundInfo.getOpenDay());
FundRateMapping fundRateMapping = this.fundRateMappingMapper.selectByPrimaryKey(id);
if (fundRateMapping != null) {
fundNoticeVO.setMinInvestmentShare(fundRateMapping.getMinInvestmentShare());
fundNoticeVO.setSubsequentInvestmentShare(fundRateMapping.getSubsequentInvestmentShare());
fundNoticeVO.setPurchaseRates(BigDecimalUtil.multiply100(fundRateMapping.getSubscriptionFee()));
fundNoticeVO.setManagementRate(BigDecimalUtil.multiply100(fundRateMapping.getManagementfeeTrust()));
fundNoticeVO.setRedemptionFee(fundRateMapping.getRedemptionFeeNote());
fundNoticeVO.setPrecautiousLine(BigDecimalUtil.toString(fundRateMapping.getGuardLine()));
fundNoticeVO.setStopLossLine(BigDecimalUtil.toString(fundRateMapping.getStopLossLine()));
fundNoticeVO.setExPerformanceRewardMethod(fundRateMapping.getPerformanceFeeDeductionMethod());
fundNoticeVO.setExPerformanceRewardDate(BigDecimalUtil.toString(fundRateMapping.getPerformanceFee()));
}
fundNoticeVO.setLockupPeriodQuota(fundInfo.getLockupPeriod());
return fundNoticeVO;
}
@Override @Override
public List<ProductInfoVO> getProductInfolist(ProductListReq req) { public List<ProductInfoVO> getProductInfolist(ProductListReq req) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment