Commit 13e85afc authored by zp's avatar zp

add

parent c6e1f72f
...@@ -134,7 +134,8 @@ public interface ProductApi { ...@@ -134,7 +134,8 @@ public interface ProductApi {
@ApiOperation("基金公司 - 私有基金") @ApiOperation("基金公司 - 私有基金")
@GetMapping("/private/fund/company") @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("基金经理 - 私有基金") @ApiOperation("基金经理 - 私有基金")
@GetMapping("/private/fund/manager") @GetMapping("/private/fund/manager")
......
...@@ -105,7 +105,7 @@ public class ProductController implements ProductApi { ...@@ -105,7 +105,7 @@ public class ProductController implements ProductApi {
@Override @Override
public CommonResp<FundCompanyVO> getFundCompanyInfo(String id) { public CommonResp<FundCompanyVO> getFundCompanyInfo(String id) {
return CommonResp.success(this.productPrivateService.getFundCompany(id)); return CommonResp.success(this.productService.getFundCompany(id));
} }
@Override @Override
...@@ -179,8 +179,8 @@ public class ProductController implements ProductApi { ...@@ -179,8 +179,8 @@ public class ProductController implements ProductApi {
} }
@Override @Override
public CommonResp<FundCompanyVO> getPrivateFundCompanyInfo(String id) { public CommonResp<FundCompanyVO> getPrivateFundCompanyInfo(String id, Pageable page) {
return CommonResp.success(this.productPrivateService.getFundCompany(id)); return CommonResp.success(this.productPrivateService.getFundCompany(id, page));
} }
@Override @Override
......
...@@ -53,7 +53,7 @@ public interface ProductPrivateService { ...@@ -53,7 +53,7 @@ public interface ProductPrivateService {
FundRecordVO getFundRecord(String id); FundRecordVO getFundRecord(String id);
FundCompanyVO getFundCompany(String id); FundCompanyVO getFundCompany(String id, Pageable page);
FundCompanyVO getPrivateFundCompany(String id); FundCompanyVO getPrivateFundCompany(String id);
......
package com.tanpu.fund.service.impl; package com.tanpu.fund.service.impl;
import com.github.pagehelper.page.PageMethod;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.tanpu.common.enums.Constant; import com.tanpu.common.enums.Constant;
import com.tanpu.common.model.Page; import com.tanpu.common.model.Page;
...@@ -24,6 +25,7 @@ import com.tanpu.common.model.product.resp.TrackRecordVO; ...@@ -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.product.resp.UnitNetVO;
import com.tanpu.common.model.tanpuroom.Type; import com.tanpu.common.model.tanpuroom.Type;
import com.tanpu.common.utils.BigDecimalUtil; 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.CompanyInfo;
import com.tanpu.fund.entity.generator.CompanyTnaPersonnel; import com.tanpu.fund.entity.generator.CompanyTnaPersonnel;
import com.tanpu.fund.entity.generator.CompanyTnaPersonnelExample; import com.tanpu.fund.entity.generator.CompanyTnaPersonnelExample;
...@@ -313,7 +315,7 @@ public class ProductPrivateServiceImpl implements ProductPrivateService, Constan ...@@ -313,7 +315,7 @@ public class ProductPrivateServiceImpl implements ProductPrivateService, Constan
} }
@Override @Override
public FundCompanyVO getFundCompany(String id) { public FundCompanyVO getFundCompany(String id, Pageable page) {
CompanyInfo companyInfo = this.companyInfoMapper.selectByPrimaryKey(id); CompanyInfo companyInfo = this.companyInfoMapper.selectByPrimaryKey(id);
if (companyInfo == null) { if (companyInfo == null) {
return new FundCompanyVO(); return new FundCompanyVO();
...@@ -347,8 +349,7 @@ public class ProductPrivateServiceImpl implements ProductPrivateService, Constan ...@@ -347,8 +349,7 @@ public class ProductPrivateServiceImpl implements ProductPrivateService, Constan
} }
// 其他基金信息 // 其他基金信息
otherFundInfo(vo, id); otherFundInfo(vo, id, page);
return vo; return vo;
} }
...@@ -363,7 +364,7 @@ public class ProductPrivateServiceImpl implements ProductPrivateService, Constan ...@@ -363,7 +364,7 @@ public class ProductPrivateServiceImpl implements ProductPrivateService, Constan
return personnelInfos.stream().collect(Collectors.toMap(PersonnelInfo::getId, s -> s)); 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(); FundInfoExample example1 = new FundInfoExample();
example1.createCriteria().andTrustIdEqualTo(id).andDeleteTagEqualTo(ZERO_NUM); example1.createCriteria().andTrustIdEqualTo(id).andDeleteTagEqualTo(ZERO_NUM);
...@@ -373,8 +374,13 @@ public class ProductPrivateServiceImpl implements ProductPrivateService, Constan ...@@ -373,8 +374,13 @@ public class ProductPrivateServiceImpl implements ProductPrivateService, Constan
if (CollectionUtils.isNotEmpty(list)) { if (CollectionUtils.isNotEmpty(list)) {
FundCountExample example2 = new FundCountExample(); 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"); 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); List<FundCount> fundCounts = this.fundCountMapper.selectByExample(example2);
if (CollectionUtils.isNotEmpty(fundCounts)) { if (CollectionUtils.isNotEmpty(fundCounts)) {
...@@ -419,8 +425,10 @@ public class ProductPrivateServiceImpl implements ProductPrivateService, Constan ...@@ -419,8 +425,10 @@ public class ProductPrivateServiceImpl implements ProductPrivateService, Constan
vo1.setRet1y(multiply100(f.getRet1y())); vo1.setRet1y(multiply100(f.getRet1y()));
vo1.setRatioId(info.getPrimaryBenchmarkId()); vo1.setRatioId(info.getPrimaryBenchmarkId());
return vo1; return vo1;
}).collect(Collectors.toList())); }).collect(Collectors.toList()));
vo.setPage(new Page<>(objectPage, vo.getFundInfoVOS()));
} }
} }
} }
......
...@@ -12,7 +12,7 @@ management.endpoint.health.show-details=always ...@@ -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.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.username=root
spring.datasource.password='@imeng123' spring.datasource.password= @imeng123
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
company.oss.prefix = https://tamp-pro.oss-cn-shanghai.aliyuncs.com/ 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