Commit 4503a5b7 authored by 张亚辉's avatar 张亚辉

同类基金

parent 35752327
...@@ -15,8 +15,6 @@ import org.springframework.web.bind.annotation.PostMapping; ...@@ -15,8 +15,6 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import java.util.List; import java.util.List;
@Api(tags = "产品服务") @Api(tags = "产品服务")
...@@ -118,7 +116,7 @@ public interface ProductApi { ...@@ -118,7 +116,7 @@ public interface ProductApi {
@ApiOperation("推荐基金 - 私有基金") @ApiOperation("推荐基金 - 私有基金")
@GetMapping("/privatefund/query/samefund") @GetMapping("/privatefund/query/samefund")
CommonResp<List<FundSameResp>> getRemmendPrivateFundList(); CommonResp<List<FundSameResp>> getRemmendPrivateFundList(@RequestParam("fundId") String fundId);
@ApiOperation(value = "根据Id查询私有产品基本信息 - 私有基金") @ApiOperation(value = "根据Id查询私有产品基本信息 - 私有基金")
@PostMapping(value = "/privateFundInfo/simpleList", produces = {"application/json"}) @PostMapping(value = "/privateFundInfo/simpleList", produces = {"application/json"})
......
...@@ -17,8 +17,6 @@ import org.apache.commons.lang3.StringUtils; ...@@ -17,8 +17,6 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import java.util.List; import java.util.List;
@RestController @RestController
...@@ -153,8 +151,11 @@ public class ProductController implements ProductApi { ...@@ -153,8 +151,11 @@ public class ProductController implements ProductApi {
@TanpuInterfaceLoginAuth @TanpuInterfaceLoginAuth
@Override @Override
public CommonResp<List<FundSameResp>> getRemmendPrivateFundList() { public CommonResp<List<FundSameResp>> getRemmendPrivateFundList(String fundId) {
return CommonResp.success(this.productService.getRemmendPrivateFundList()); if (StringUtils.isEmpty(fundId)) {
return CommonResp.error(CommonResp.PARAMETER_INVALID_STATUS_CODE, CommonResp.PARAMETER_INVALID_MESSAGE);
}
return CommonResp.success(this.productService.getRemmendPrivateFundList(fundId));
} }
@Override @Override
...@@ -191,6 +192,9 @@ public class ProductController implements ProductApi { ...@@ -191,6 +192,9 @@ public class ProductController implements ProductApi {
@TanpuInterfaceLoginAuth @TanpuInterfaceLoginAuth
@Override @Override
public CommonResp<List<FundSameResp>> querySamefund(String fundId) { public CommonResp<List<FundSameResp>> querySamefund(String fundId) {
if (StringUtils.isEmpty(fundId)) {
return CommonResp.error(CommonResp.PARAMETER_INVALID_STATUS_CODE, CommonResp.PARAMETER_INVALID_MESSAGE);
}
return CommonResp.success(this.productService.querySamefund(fundId)); return CommonResp.success(this.productService.querySamefund(fundId));
} }
} }
...@@ -67,5 +67,5 @@ public interface ProductService { ...@@ -67,5 +67,5 @@ public interface ProductService {
List<FundSameResp> querySamefund(String fundId); List<FundSameResp> querySamefund(String fundId);
List<FundSameResp> getRemmendPrivateFundList(); List<FundSameResp> getRemmendPrivateFundList(String fundId);
} }
...@@ -1547,7 +1547,7 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -1547,7 +1547,7 @@ public class ProductServiceImpl implements ProductService, Constant {
PageMethod.startPage(1, 10); PageMethod.startPage(1, 10);
FundCountExample example = new FundCountExample(); FundCountExample example = new FundCountExample();
example.createCriteria().andSubstrategyEqualTo(fundInfo.getSubstrategy()) example.createCriteria().andSubstrategyEqualTo(fundInfo.getSubstrategy()).andIdNotEqualTo(fundId)
.andDataSourcesEqualTo(Constant.ONE_NUM).andDeleteTagEqualTo(BizEnums.DeleteTag.tag_init); .andDataSourcesEqualTo(Constant.ONE_NUM).andDeleteTagEqualTo(BizEnums.DeleteTag.tag_init);
example.setOrderByClause("ret_1y desc"); example.setOrderByClause("ret_1y desc");
...@@ -1573,9 +1573,11 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -1573,9 +1573,11 @@ public class ProductServiceImpl implements ProductService, Constant {
} }
@Override @Override
public List<FundSameResp> getRemmendPrivateFundList() { public List<FundSameResp> getRemmendPrivateFundList(String fundId) {
IfaImportedFundInfoExample example = new IfaImportedFundInfoExample(); IfaImportedFundInfoExample example = new IfaImportedFundInfoExample();
example.createCriteria().andIfaIdEqualTo(UserInfoThreadLocalHolder.getserInfo().getId()).andDeleteTagEqualTo(BizEnums.DeleteTag.tag_init); example.createCriteria().andIfaIdEqualTo(UserInfoThreadLocalHolder.getserInfo().getId())
.andIdNotEqualTo(fundId)
.andDeleteTagEqualTo(BizEnums.DeleteTag.tag_init);
List<IfaImportedFundInfo> importedFundInfoList = ifaImportedFundInfoMapper.selectByExample(example); List<IfaImportedFundInfo> importedFundInfoList = ifaImportedFundInfoMapper.selectByExample(example);
List<String> fundIdList = importedFundInfoList.stream().map(IfaImportedFundInfo::getId).collect(Collectors.toList()); List<String> fundIdList = importedFundInfoList.stream().map(IfaImportedFundInfo::getId).collect(Collectors.toList());
......
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