Commit 3f2322e0 authored by 胡定国's avatar 胡定国

Merge branch 'master' of 47.100.44.39:zhoupeng/tamp_fund into dev

parents bb49b089 00602ecf
......@@ -94,6 +94,10 @@ public interface ProductApi {
@GetMapping("/fund/record")
CommonResp<FundRecordVO> getFundRecordInfo(@ApiParam("产品id") @RequestParam("id") String id);
@ApiOperation("基金档案 - 交易须知")
@GetMapping("/fund/notice")
CommonResp<FundNoticeVO> getFundNoticeInfo(@ApiParam("产品id") @RequestParam("id") String id);
@ApiOperation("基金公司")
@GetMapping("/fund/company")
CommonResp<FundCompanyVO> getFundCompanyInfo(@ApiParam("基金公司id") @RequestParam("id") String id);
......
package com.tanpu.fund.config;
import com.tanpu.common.auth.intercept.FaLoginIntercept;
import com.tanpu.common.log.LoggingFilter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
......@@ -27,4 +30,15 @@ public class WebConfig implements WebMvcConfigurer {
log.info("添加拦截器FaLoginIntercept");
registry.addInterceptor(faLoginIntercept).addPathPatterns("/**");
}
@Bean
public FilterRegistrationBean<LoggingFilter> logFilterRegistration() {
log.info("logFilter Registration");
FilterRegistrationBean<LoggingFilter> registration = new FilterRegistrationBean<>();
registration.setFilter(new LoggingFilter());
registration.addUrlPatterns("/*");
return registration;
}
}
......@@ -13,12 +13,13 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.cloud.context.environment.EnvironmentChangeEvent;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.Set;
/*动态刷新日志参数配置*/
// @Component
@Component
@Slf4j
@ConditionalOnProperty(PropertySourcesConstants.APOLLO_BOOTSTRAP_ENABLED)
@AutoConfigureAfter(ApolloAutoConfiguration.class)
......
......@@ -108,6 +108,11 @@ public class ProductController implements ProductApi {
return CommonResp.success(this.productService.getFundRecord(id));
}
@Override
public CommonResp<FundNoticeVO> getFundNoticeInfo(String id) {
return CommonResp.success(this.productService.getFundNoticeInfo(id));
}
@Override
public CommonResp<FundCompanyVO> getFundCompanyInfo(String id) {
return CommonResp.success(this.productService.getFundCompany(id));
......
package com.tanpu.fund.controller;
import com.tanpu.common.enums.BizEnums;
import com.tanpu.common.model.product.resp.FundCompanySimpleVO;
import com.tanpu.common.resp.CommonResp;
import com.tanpu.fund.api.ProductForCommunityApi;
......@@ -40,7 +41,7 @@ public class ProductForCommunityController implements ProductForCommunityApi {
@Override
public CommonResp<FundCompanySimpleVO> getCompanyFundCount(String id) {
FundInfoExample fundInfoExample = new FundInfoExample();
fundInfoExample.createCriteria().andTrustIdEqualTo(id);
fundInfoExample.createCriteria().andTrustIdEqualTo(id).andDeleteTagEqualTo(BizEnums.DeleteTag.tag_init);
long l = fundInfoMapper.countByExample(fundInfoExample);
FundCompanySimpleVO build = FundCompanySimpleVO.builder().fundCount(l).build();
return CommonResp.success(build);
......
......@@ -46,15 +46,15 @@ public interface FundInfoCustomMapper {
*/
List<FundNav> getPrivateFundInfoNewNet(@Param("list") List<String> fundIdList);
@Select("select t.id as fileId,t.logical_path as previewUrl from fund_file_record t where t.id in(${list})")
@Select("select t.id as fileId,t.logical_path as previewUrl from fund_file_record t where t.id in(${list}) and t.delete_tag=0")
List<FilePreviewResp> getFilePreviewUrl(@Param("list") String list);
@Select("select t.id as id, t.fund_short_name as `value` from fund_info t where t.id in(${list})")
@Select("select t.id as id, t.fund_short_name as `value` from fund_info t where t.id in(${list}) and t.delete_tag=0")
List<Type> getSimpleFundList(@Param("list") String list);
@Select("select t.id as id, t.fund_name as `value` from ifa_imported_fund_info t where t.id in(${list})")
@Select("select t.id as id, t.fund_name as `value` from ifa_imported_fund_info t where t.id in(${list}) and t.delete_tag=0")
List<Type> getSimplePrivateFundList(@Param("list") String list);
@Select("select t.id as id,t.fund_short_name as value from fund_info t where t.fund_short_name like #{productName}")
@Select("select t.id as id,t.fund_short_name as value from fund_info t where t.fund_short_name like #{productName} and t.delete_tag=0")
List<Type> getFundInfoLikeName(@Param("productName") String productName);
}
......@@ -51,6 +51,8 @@ public interface ProductService {
FundRecordVO getFundRecord(String id);
FundNoticeVO getFundNoticeInfo(String id);
FundCompanyVO getFundCompany(String id);
List<ProductInfoVO> getProductInfolist(ProductListReq req);
......
......@@ -24,6 +24,9 @@ public class ProductForPcServiceImpl implements ProductForPcService {
@Override
public List<Net> getFundNewnet(List<String> list) {
if (CollectionUtils.isEmpty(list)) {
return new ArrayList<>();
}
List<FundNav> fundInfoNewNet = fundInfoCustomMapper.getFundInfoNewNet(list);
if (CollectionUtils.isNotEmpty(fundInfoNewNet)) {
return fundInfoNewNet.stream().map(item -> Net.builder()
......@@ -38,13 +41,16 @@ public class ProductForPcServiceImpl implements ProductForPcService {
@Override
public List<Net> getPrivatefundNewnet(List<String> list) {
if (CollectionUtils.isEmpty(list)) {
return new ArrayList<>();
}
List<FundNav> fundInfoNewNet = fundInfoCustomMapper.getPrivateFundInfoNewNet(list);
if (CollectionUtils.isNotEmpty(fundInfoNewNet)) {
return fundInfoNewNet.stream().map(item -> Net.builder()
.fundId(item.getFundId())
.netDate(item.getPriceDate().getTime())
.netValue(BigDecimalUtil.toString(item.getNav(), 4))
.cumulativeNav(BigDecimalUtil.toString(item.getCumulativeNavWithdrawal(), 4))
.cumulativeNav(BigDecimalUtil.toString(item.getCumulativeNav(), 4))
.build()).collect(Collectors.toList());
}
return new ArrayList<>(0);
......
......@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.poi.excel.ExcelReader;
import cn.hutool.poi.excel.ExcelUtil;
import com.github.pagehelper.page.PageMethod;
......@@ -46,9 +47,9 @@ import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.stream.Collectors;
......@@ -157,6 +158,8 @@ public class ProductServiceImpl implements ProductService, Constant {
}
FundInfo fundInfo = infos.get(0);
BeanUtils.copyProperties(fundInfo, vo);
vo.setStrategy(String.valueOf(fundInfo.getStrategy()));
vo.setSubstrategy(String.valueOf(fundInfo.getSubstrategy()));
vo.setOpenDay(fundInfo.getOpenDay());
vo.setProductName(fundInfo.getFundShortName());
vo.setDesc(fundInfo.getDescInfo());
......@@ -194,6 +197,33 @@ public class ProductServiceImpl implements ProductService, Constant {
vo.setCumulativeProfit(BigDecimalUtil.toString(fundCount.getCumulativeNav()));
vo.setRetYtd(multiply100(fundCount.getRetYtd()));
vo.setRetIncep(multiply100(fundCount.getRetIncep()));
vo.setSharperatioIncep(BigDecimalUtil.toString(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 {
//子策略名称
if (vo.getSubstrategy() != null) {
CommonResp<List<SysConstantResp>> listCommonResp = this.fatools.queryLabels(SysConstEnums.TAMPSUBSTRATEGY.getConstantGroup());
if (listCommonResp.isSuccess()) {
listCommonResp.getAttributes().stream()
.filter(item -> StringUtils.equals(String.valueOf(vo.getSubstrategy()), item.getConstantCode()))
.findFirst()
.ifPresent(sysConstantResp -> vo.setStrategyName(sysConstantResp.getConstantName()));
}
vo.setSubstrategyName(ProductEnums.FundSubStrategyEnum.getBySubStrategy(Integer.valueOf(vo.getSubstrategy())));
// CommonResp<List<SysConstantResp>> listCommonResp = this.fatools.queryLabels(SysConstEnums.TAMPSUBSTRATEGY.getConstantGroup());
// if (listCommonResp.isSuccess()) {
// listCommonResp.getAttributes().stream()
// .filter(item -> StringUtils.equals(String.valueOf(vo.getSubstrategy()), item.getConstantCode()))
// .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);
......@@ -568,7 +602,7 @@ public class ProductServiceImpl implements ProductService, Constant {
BonusRatioVO vo = new BonusRatioVO();
vo.setType(l.getDistributeType());
vo.setTime(l.getDistributeDate().getTime());
vo.setDistribution(BigDecimalUtil.toString(l.getDistribution(), 2));
vo.setDistribution(BigDecimalUtil.toString(l.getDistribution(), 4));
return vo;
}).collect(Collectors.toList());
}
......@@ -1028,6 +1062,32 @@ public class ProductServiceImpl implements ProductService, Constant {
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.setExPerformanceRewardRatio(BigDecimalUtil.toString(fundRateMapping.getPerformanceFee()));
}
fundNoticeVO.setLockupPeriodQuota(fundInfo.getLockupPeriod());
return fundNoticeVO;
}
@Override
public List<ProductInfoVO> getProductInfolist(ProductListReq req) {
......@@ -1454,7 +1514,7 @@ public class ProductServiceImpl implements ProductService, Constant {
List<IfaImportedFundNav> navList = ifaImportedFundNavMapper.selectByExample(navExample);
if (CollectionUtils.isNotEmpty(navList)) {
detailResp.setNet(Net.builder().netDate(navList.get(0).getPriceDate().getTime())
.netValue(BigDecimalUtil.toString(navList.get(0).getCumulativeNav(), 4)).build());
.netValue(BigDecimalUtil.toString(navList.get(0).getNav(), 4)).build());
}
}
......
......@@ -95,6 +95,11 @@ tanpu.oss.ali.endpoint = https://oss-${tanpu.oss.ali.region-id}.aliyuncs.com
tanpu.oss.ali.bucket-domain = https://${tanpu.oss.ali.bucket-name}.oss-${tanpu.oss.ali.region-id}.aliyuncs.com
tanpu.oss.ali.oss-path = /upload
tanpu.oss.ali.access-key-id=LTAIAKEzVydP0Q9P
tanpu.oss.ali.secret-access-key=59V9ke9txaIFzWxHFKTb1eoOOpmKpJ
tanpu.oss.ali.project-name=faTools-sit
tanpu.oss.ali.doc-convert-output-path=/docConvertOutput
tanpu.userno.startstep = 10000000
shorterUrl.domain = http://shorturl:8086/shorter/get
......
......@@ -55,9 +55,7 @@
res.price_date as priceDate,
res.nav as nav,
res.cumulative_nav as cumulativeNav,
res.cumulative_nav_withdrawal as cumulativeNavWithdrawal,
res.ishigh_or_low as ishighOrLow,
res.tohigh_nav_ratio as tohighNavRatio
res.cumulative_nav as cumulativeNavWithdrawal
from
(SELECT fund_id, max(price_date) as price_date FROM ifa_imported_fund_nav WHERE fund_id in
<foreach close=")" collection="list" item="fundId" open="(" separator=",">
......
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