Commit 35752327 authored by 张亚辉's avatar 张亚辉

Merge branch 'v1.2.0' of 47.100.44.39:zhoupeng/tamp_fund into v1.2.0

parents 1911a79b 436c6194
......@@ -126,7 +126,8 @@ public interface ProductApi {
@ApiOperation("基金公司 - 私有基金")
@GetMapping("/private/fund/company")
CommonResp<FundCompanyVO> getPrivateFundCompanyInfo(@ApiParam("基金公司id") @RequestParam("id") String id);
CommonResp<FundCompanyVO> getPrivateFundCompanyInfo(@ApiParam("基金公司id") @RequestParam("id") String id,
@ApiParam("分页对象") Pageable page);
@ApiOperation("基金经理 - 私有基金")
@GetMapping("/private/fund/manager")
......
......@@ -100,7 +100,7 @@ public class ProductController implements ProductApi {
@Override
public CommonResp<FundCompanyVO> getFundCompanyInfo(String id) {
return CommonResp.success(this.productPrivateService.getFundCompany(id));
return CommonResp.success(this.productService.getFundCompany(id));
}
@Override
......@@ -168,8 +168,8 @@ public class ProductController implements ProductApi {
}
@Override
public CommonResp<FundCompanyVO> getPrivateFundCompanyInfo(String id) {
return CommonResp.success(this.productPrivateService.getFundCompany(id));
public CommonResp<FundCompanyVO> getPrivateFundCompanyInfo(String id, Pageable page) {
return CommonResp.success(this.productPrivateService.getFundCompany(id, page));
}
@Override
......
......@@ -53,7 +53,7 @@ public interface ProductPrivateService {
FundRecordVO getFundRecord(String id);
FundCompanyVO getFundCompany(String id);
FundCompanyVO getFundCompany(String id, Pageable page);
FundCompanyVO getPrivateFundCompany(String id);
......
package com.tanpu.fund.service.impl;
import com.github.pagehelper.page.PageMethod;
import com.google.common.collect.Lists;
import com.tanpu.common.enums.Constant;
import com.tanpu.common.model.Page;
......@@ -24,6 +25,7 @@ import com.tanpu.common.model.product.resp.TrackRecordVO;
import com.tanpu.common.model.product.resp.UnitNetVO;
import com.tanpu.common.model.tanpuroom.Type;
import com.tanpu.common.utils.BigDecimalUtil;
import com.tanpu.common.utils.PageUtils;
import com.tanpu.fund.entity.generator.CompanyInfo;
import com.tanpu.fund.entity.generator.CompanyTnaPersonnel;
import com.tanpu.fund.entity.generator.CompanyTnaPersonnelExample;
......@@ -184,7 +186,7 @@ public class ProductPrivateServiceImpl implements ProductPrivateService, Constan
@Override
public List<FundManagerVO> getFundManager(String id) {
FundManagerMappingExample example = new FundManagerMappingExample();
example.createCriteria().andFundIdEqualTo(id).andIsvisibleEqualTo(ONE_NUM).andDeleteTagEqualTo(ZERO_NUM);
example.createCriteria().andFundIdEqualTo(id).andDeleteTagEqualTo(ZERO_NUM);
example.setOrderByClause("update_time desc");
List<String> list = this.fundManagerMappingMapper.selectByExample(example).stream()
......@@ -201,7 +203,10 @@ public class ProductPrivateServiceImpl implements ProductPrivateService, Constan
.collect(Collectors.toList());
FundCountExample example2 = new FundCountExample();
example2.createCriteria().andFundIdIn(fundIds).andDeleteTagEqualTo(ZERO_NUM);
example2.createCriteria()
.andFundIdIn(fundIds)
.andRetIncepIsNotNull()
.andDeleteTagEqualTo(ZERO_NUM);
example2.setOrderByClause("ret_incep desc");
List<FundCount> fundCounts = this.fundCountMapper.selectByExample(example2);
Map<String, FundCount> fundCountMap = fundCounts.stream()
......@@ -313,7 +318,7 @@ public class ProductPrivateServiceImpl implements ProductPrivateService, Constan
}
@Override
public FundCompanyVO getFundCompany(String id) {
public FundCompanyVO getFundCompany(String id, Pageable page) {
CompanyInfo companyInfo = this.companyInfoMapper.selectByPrimaryKey(id);
if (companyInfo == null) {
return new FundCompanyVO();
......@@ -347,8 +352,7 @@ public class ProductPrivateServiceImpl implements ProductPrivateService, Constan
}
// 其他基金信息
otherFundInfo(vo, id);
otherFundInfo(vo, id, page);
return vo;
}
......@@ -363,7 +367,7 @@ public class ProductPrivateServiceImpl implements ProductPrivateService, Constan
return personnelInfos.stream().collect(Collectors.toMap(PersonnelInfo::getId, s -> s));
}
private void otherFundInfo(FundCompanyVO vo, String id) {
private void otherFundInfo(FundCompanyVO vo, String id, Pageable page) {
FundInfoExample example1 = new FundInfoExample();
example1.createCriteria().andTrustIdEqualTo(id).andDeleteTagEqualTo(ZERO_NUM);
......@@ -373,8 +377,13 @@ public class ProductPrivateServiceImpl implements ProductPrivateService, Constan
if (CollectionUtils.isNotEmpty(list)) {
FundCountExample example2 = new FundCountExample();
example2.createCriteria().andFundIdIn(list).andDeleteTagEqualTo(ZERO_NUM);
example2.createCriteria().andFundIdIn(list)
.andDeleteTagEqualTo(ZERO_NUM)
.andRet1yBm1IsNotNull();
example2.setOrderByClause("ret_incep desc,ret_incep_a desc");
com.github.pagehelper.Page<Object> objectPage = PageMethod.startPage(page.getPageNumber(), page.getPageSize());
List<FundCount> fundCounts = this.fundCountMapper.selectByExample(example2);
if (CollectionUtils.isNotEmpty(fundCounts)) {
......@@ -419,8 +428,10 @@ public class ProductPrivateServiceImpl implements ProductPrivateService, Constan
vo1.setRet1y(multiply100(f.getRet1y()));
vo1.setRatioId(info.getPrimaryBenchmarkId());
return vo1;
}).collect(Collectors.toList()));
vo.setPage(new Page<>(objectPage, vo.getFundInfoVOS()));
}
}
}
......
......@@ -12,7 +12,7 @@ management.endpoint.health.show-details=always
spring.datasource.url=jdbc:mysql://118.190.63.109:3306/tamp_fund?autoReconnect=true&characterEncoding=utf-8&serverTimezone=GMT%2B8&useSSL=false
spring.datasource.username=root
spring.datasource.password='@imeng123'
spring.datasource.password= @imeng123
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
company.oss.prefix = https://tamp-pro.oss-cn-shanghai.aliyuncs.com/
......
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