Commit 6f790f03 authored by zp's avatar zp

Merge branch 'master' of 47.100.44.39:zhoupeng/tamp_fund

parents 6865f642 a64cc00a
This diff is collapsed.
......@@ -75,7 +75,12 @@ gen
.settings
# maven
target
.classpath
.factorypath
.project
.settings/
.vscode/
.history/
src/main/java/pm/Generator.java
prod-fz.sh
......
......@@ -197,17 +197,22 @@
<version>3.0.6</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>4.0</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.3.9</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.2</version>
</dependency>
<dependency>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
<version>1.7</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
......
......@@ -2,10 +2,15 @@ package com.tanpu.fund.api;
import com.tanpu.common.model.Page;
import com.tanpu.common.model.Pageable;
import com.tanpu.common.model.adm.req.IfaNetImportReq;
import com.tanpu.common.model.fund.req.FundRankReq;
import com.tanpu.common.model.fund.resq.FundRankResp;
import com.tanpu.common.model.privatefund.resp.FundNavMessage;
import com.tanpu.common.model.product.req.NetReq;
import com.tanpu.common.model.product.req.ProductInfoReq;
import com.tanpu.common.model.product.req.ProductListReq;
import com.tanpu.common.model.product.resp.*;
import com.tanpu.common.model.tanpuroom.Type;
import com.tanpu.common.resp.CommonResp;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -14,7 +19,10 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import java.util.List;
@Api(tags = "产品服务")
......@@ -93,6 +101,10 @@ public interface ProductApi {
@GetMapping("/dynamic/retreat")
CommonResp<DynamicRetreatVO> getDynamicRetreatInfo(@RequestParam("id") String id);
@ApiOperation("获取产品列表(只返回产品名称)")
@GetMapping("/get/fund/info/simple")
CommonResp<List<Type>> getSimpleFundList(@RequestParam("list") List<String> list);
//**********************************************************私有基金start**********************************************************
@ApiOperation("私有基金详情 - 私有基金")
@GetMapping("/privatefund/detail")
......@@ -137,6 +149,10 @@ public interface ProductApi {
@GetMapping("/private/bonus/ratio")
CommonResp<List<BonusRatioVO>> getPrivateBonusRatioInfo(@ApiParam("产品id") @RequestParam("id") String id);
@ApiOperation("获取产品列表(只返回产品名称)")
@GetMapping("/private/get/fund/info/simple")
CommonResp<List<Type>> getSimplePrivateFundList(@RequestParam("list") List<String> list);
//**********************************************************私有基金 end**********************************************************
@ApiOperation(value = "根据Id查询私募产品基本信息")
......@@ -150,4 +166,26 @@ public interface ProductApi {
@ApiOperation("查询同类基金")
@GetMapping("/query/samefund")
CommonResp<List<FundSameResp>> querySamefund(@RequestParam("fundId") String fundId);
@ApiOperation("理财师净值导入")
@PostMapping("/ifa/net/import")
CommonResp<List<FundNavMessage>> importNetInfo(@RequestParam("file") MultipartFile file,
@RequestParam(value = "fundId", required = false) String fundId);
@ApiOperation("理财师净值导入")
@PostMapping("/ifa/net/import/check/save")
CommonResp<List<FundNavMessage>> importNetCheckSaveInfo(@RequestBody @Valid @NotEmpty(message = "请确定需要修改的信息") IfaNetImportReq req);
@ApiOperation("私募排行")
@PostMapping("/private/rank")
CommonResp<Page<FundRankResp>> getFundRankInfo(@RequestBody FundRankReq req);
@ApiOperation("私募排行统计")
@PostMapping("/private/rank/count")
CommonResp<Long> getFundRankCountInfo(@RequestBody FundRankReq req);
@ApiOperation("公募基金模糊匹配")
@GetMapping("/private/like")
CommonResp<List<Type>> getFundLikeShortNameInfo(@Valid @NotEmpty(message = "产品名称不能为空") @RequestParam("productName") String productName,
Pageable page);
}
......@@ -30,7 +30,7 @@ public class Swagger2Config {
public Docket customImplementation(){
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.basePackage("com.tanpu.product"))
.apis(RequestHandlerSelectors.basePackage("com.tanpu.fund"))
.build()
.protocols(newHashSet("http", "https"))
// .protocols(newHashSet("ws", "wss"))
......
......@@ -3,10 +3,15 @@ package com.tanpu.fund.controller;
import com.tanpu.common.auth.mapping.TanpuInterfaceLoginAuth;
import com.tanpu.common.model.Page;
import com.tanpu.common.model.Pageable;
import com.tanpu.common.model.adm.req.IfaNetImportReq;
import com.tanpu.common.model.fund.req.FundRankReq;
import com.tanpu.common.model.fund.resq.FundRankResp;
import com.tanpu.common.model.privatefund.resp.FundNavMessage;
import com.tanpu.common.model.product.req.NetReq;
import com.tanpu.common.model.product.req.ProductInfoReq;
import com.tanpu.common.model.product.req.ProductListReq;
import com.tanpu.common.model.product.resp.*;
import com.tanpu.common.model.tanpuroom.Type;
import com.tanpu.common.resp.CommonResp;
import com.tanpu.fund.api.ProductApi;
import com.tanpu.fund.feign.publicfund.FeignClientForPublicfund;
......@@ -15,6 +20,7 @@ import com.tanpu.fund.service.ProductService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.util.List;
......@@ -112,6 +118,11 @@ public class ProductController implements ProductApi {
return CommonResp.success(this.productService.getDynamicRetreat(id));
}
@Override
public CommonResp<List<Type>> getSimpleFundList(List<String> list) {
return CommonResp.success(this.productService.getSimpleFundList(list));
}
@Override
public CommonResp<ProductInfoVO> getPrivateDetail(String id) {
if (StringUtils.isEmpty(id)) {
......@@ -178,6 +189,11 @@ public class ProductController implements ProductApi {
return CommonResp.success(this.productPrivateService.getBonusRatio(id));
}
@Override
public CommonResp<List<Type>> getSimplePrivateFundList(List<String> list) {
return CommonResp.success(this.productPrivateService.getSimplePrivateFundList(list));
}
@Override
public CommonResp<List<FundManagerVO>> getPrivateFundManagerInfo(String id, String ifaId) {
return CommonResp.success(this.productPrivateService.getFundManager(id, ifaId));
......@@ -197,4 +213,29 @@ public class ProductController implements ProductApi {
}
return CommonResp.success(this.productService.querySamefund(fundId));
}
@Override
public CommonResp<List<FundNavMessage>> importNetInfo(MultipartFile file, String fundId) {
return this.productService.importNet(file, fundId);
}
@Override
public CommonResp<List<FundNavMessage>> importNetCheckSaveInfo(IfaNetImportReq req) {
return this.productService.importNetCheckSave(req);
}
@Override
public CommonResp<Page<FundRankResp>> getFundRankInfo(FundRankReq req) {
return CommonResp.success(this.productService.getFundRank(req));
}
@Override
public CommonResp<Long> getFundRankCountInfo(FundRankReq req) {
return CommonResp.success(this.productService.getFundRankCountInfo(req));
}
@Override
public CommonResp<List<Type>> getFundLikeShortNameInfo(String productName, Pageable page) {
return CommonResp.success(this.productService.getFundLikeShortName(productName, page));
}
}
......@@ -7,6 +7,25 @@ import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author: zhoupeng
* <p>
* =========================================
* =========================================
* ======== ========
* ======= ========== ======= =======
* ====== ===== == ==== ======
* ===== ===== == === =====
* ===== ===== == === =====
* ===== ===== == === =====
* ====== ========== == ======
* ======= =======
* =========================================
* =========================================
* <p>
* @email: zhoupeng_08@163.com
*/
/**
* 基金历史业绩
*/
......@@ -32,6 +51,11 @@ public class FundCount {
*/
private Integer substrategy;
/**
* 基金成立日期
*/
private Date inceptionDate;
/**
* 是否可预约 0:不可预约 1:可预约
*/
......
......@@ -6,6 +6,24 @@ import java.util.Date;
import java.util.Iterator;
import java.util.List;
/**
* @author: zhoupeng
* <p>
* =========================================
* =========================================
* ======== ========
* ======= ========== ======= =======
* ====== ===== == ==== ======
* ===== ===== == === =====
* ===== ===== == === =====
* ===== ===== == === =====
* ====== ========== == ======
* ======= =======
* =========================================
* =========================================
* <p>
* @email: zhoupeng_08@163.com
*/
public class FundCountExample {
protected String orderByClause;
......@@ -393,6 +411,66 @@ public class FundCountExample {
return (Criteria) this;
}
public Criteria andInceptionDateIsNull() {
addCriterion("inception_date is null");
return (Criteria) this;
}
public Criteria andInceptionDateIsNotNull() {
addCriterion("inception_date is not null");
return (Criteria) this;
}
public Criteria andInceptionDateEqualTo(Date value) {
addCriterionForJDBCDate("inception_date =", value, "inceptionDate");
return (Criteria) this;
}
public Criteria andInceptionDateNotEqualTo(Date value) {
addCriterionForJDBCDate("inception_date <>", value, "inceptionDate");
return (Criteria) this;
}
public Criteria andInceptionDateGreaterThan(Date value) {
addCriterionForJDBCDate("inception_date >", value, "inceptionDate");
return (Criteria) this;
}
public Criteria andInceptionDateGreaterThanOrEqualTo(Date value) {
addCriterionForJDBCDate("inception_date >=", value, "inceptionDate");
return (Criteria) this;
}
public Criteria andInceptionDateLessThan(Date value) {
addCriterionForJDBCDate("inception_date <", value, "inceptionDate");
return (Criteria) this;
}
public Criteria andInceptionDateLessThanOrEqualTo(Date value) {
addCriterionForJDBCDate("inception_date <=", value, "inceptionDate");
return (Criteria) this;
}
public Criteria andInceptionDateIn(List<Date> values) {
addCriterionForJDBCDate("inception_date in", values, "inceptionDate");
return (Criteria) this;
}
public Criteria andInceptionDateNotIn(List<Date> values) {
addCriterionForJDBCDate("inception_date not in", values, "inceptionDate");
return (Criteria) this;
}
public Criteria andInceptionDateBetween(Date value1, Date value2) {
addCriterionForJDBCDate("inception_date between", value1, value2, "inceptionDate");
return (Criteria) this;
}
public Criteria andInceptionDateNotBetween(Date value1, Date value2) {
addCriterionForJDBCDate("inception_date not between", value1, value2, "inceptionDate");
return (Criteria) this;
}
public Criteria andTypeIsNull() {
addCriterion("`type` is null");
return (Criteria) this;
......
......@@ -7,12 +7,30 @@ import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author: zhoupeng
* <p>
* =========================================
* =========================================
* ======== ========
* ======= ========== ======= =======
* ====== ===== == ==== ======
* ===== ===== == === =====
* ===== ===== == === =====
* ===== ===== == === =====
* ====== ========== == ======
* ======= =======
* =========================================
* =========================================
* <p>
* @email: zhoupeng_08@163.com
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class IfaImportedFundNav {
private Integer id;
private Long id;
/**
* 基金id
......@@ -35,4 +53,9 @@ public class IfaImportedFundNav {
private BigDecimal cumulativeNav;
private Integer deleteTag;
/**
* 机构id
*/
private String orgId;
}
\ No newline at end of file
......@@ -3,8 +3,27 @@ package com.tanpu.fund.entity.generator;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
/**
* @author: zhoupeng
* <p>
* =========================================
* =========================================
* ======== ========
* ======= ========== ======= =======
* ====== ===== == ==== ======
* ===== ===== == === =====
* ===== ===== == === =====
* ===== ===== == === =====
* ====== ========== == ======
* ======= =======
* =========================================
* =========================================
* <p>
* @email: zhoupeng_08@163.com
*/
public class IfaImportedFundNavExample {
protected String orderByClause;
......@@ -106,6 +125,32 @@ public class IfaImportedFundNavExample {
criteria.add(new Criterion(condition, value1, value2));
}
protected void addCriterionForJDBCDate(String condition, Date value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
addCriterion(condition, new java.sql.Date(value.getTime()), property);
}
protected void addCriterionForJDBCDate(String condition, List<Date> values, String property) {
if (values == null || values.size() == 0) {
throw new RuntimeException("Value list for " + property + " cannot be null or empty");
}
List<java.sql.Date> dateList = new ArrayList<>();
Iterator<Date> iter = values.iterator();
while (iter.hasNext()) {
dateList.add(new java.sql.Date(iter.next().getTime()));
}
addCriterion(condition, dateList, property);
}
protected void addCriterionForJDBCDate(String condition, Date value1, Date value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
addCriterion(condition, new java.sql.Date(value1.getTime()), new java.sql.Date(value2.getTime()), property);
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
......@@ -116,52 +161,52 @@ public class IfaImportedFundNavExample {
return (Criteria) this;
}
public Criteria andIdEqualTo(Integer value) {
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Integer value) {
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Integer value) {
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Integer> values) {
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Integer> values) {
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
......@@ -247,52 +292,52 @@ public class IfaImportedFundNavExample {
}
public Criteria andPriceDateEqualTo(Date value) {
addCriterion("price_date =", value, "priceDate");
addCriterionForJDBCDate("price_date =", value, "priceDate");
return (Criteria) this;
}
public Criteria andPriceDateNotEqualTo(Date value) {
addCriterion("price_date <>", value, "priceDate");
addCriterionForJDBCDate("price_date <>", value, "priceDate");
return (Criteria) this;
}
public Criteria andPriceDateGreaterThan(Date value) {
addCriterion("price_date >", value, "priceDate");
addCriterionForJDBCDate("price_date >", value, "priceDate");
return (Criteria) this;
}
public Criteria andPriceDateGreaterThanOrEqualTo(Date value) {
addCriterion("price_date >=", value, "priceDate");
addCriterionForJDBCDate("price_date >=", value, "priceDate");
return (Criteria) this;
}
public Criteria andPriceDateLessThan(Date value) {
addCriterion("price_date <", value, "priceDate");
addCriterionForJDBCDate("price_date <", value, "priceDate");
return (Criteria) this;
}
public Criteria andPriceDateLessThanOrEqualTo(Date value) {
addCriterion("price_date <=", value, "priceDate");
addCriterionForJDBCDate("price_date <=", value, "priceDate");
return (Criteria) this;
}
public Criteria andPriceDateIn(List<Date> values) {
addCriterion("price_date in", values, "priceDate");
addCriterionForJDBCDate("price_date in", values, "priceDate");
return (Criteria) this;
}
public Criteria andPriceDateNotIn(List<Date> values) {
addCriterion("price_date not in", values, "priceDate");
addCriterionForJDBCDate("price_date not in", values, "priceDate");
return (Criteria) this;
}
public Criteria andPriceDateBetween(Date value1, Date value2) {
addCriterion("price_date between", value1, value2, "priceDate");
addCriterionForJDBCDate("price_date between", value1, value2, "priceDate");
return (Criteria) this;
}
public Criteria andPriceDateNotBetween(Date value1, Date value2) {
addCriterion("price_date not between", value1, value2, "priceDate");
addCriterionForJDBCDate("price_date not between", value1, value2, "priceDate");
return (Criteria) this;
}
......@@ -475,6 +520,76 @@ public class IfaImportedFundNavExample {
addCriterion("delete_tag not between", value1, value2, "deleteTag");
return (Criteria) this;
}
public Criteria andOrgIdIsNull() {
addCriterion("org_id is null");
return (Criteria) this;
}
public Criteria andOrgIdIsNotNull() {
addCriterion("org_id is not null");
return (Criteria) this;
}
public Criteria andOrgIdEqualTo(String value) {
addCriterion("org_id =", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdNotEqualTo(String value) {
addCriterion("org_id <>", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdGreaterThan(String value) {
addCriterion("org_id >", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdGreaterThanOrEqualTo(String value) {
addCriterion("org_id >=", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdLessThan(String value) {
addCriterion("org_id <", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdLessThanOrEqualTo(String value) {
addCriterion("org_id <=", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdLike(String value) {
addCriterion("org_id like", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdNotLike(String value) {
addCriterion("org_id not like", value, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdIn(List<String> values) {
addCriterion("org_id in", values, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdNotIn(List<String> values) {
addCriterion("org_id not in", values, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdBetween(String value1, String value2) {
addCriterion("org_id between", value1, value2, "orgId");
return (Criteria) this;
}
public Criteria andOrgIdNotBetween(String value1, String value2) {
addCriterion("org_id not between", value1, value2, "orgId");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
......
package com.tanpu.fund.feign.product;
import com.tanpu.common.model.tanpuroom.Type;
import com.tanpu.common.resp.CommonResp;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
//@FeignClient(value = "service-product", url = "http://127.0.0.1:8194/product")
@FeignClient(value = "service-product", path = "/product")
public interface FeignForProduct {
@ApiOperation("获取私募产品列表(只返回产品名称)")
@GetMapping("/get/fund/info/simple")
CommonResp<List<Type>> getSimpleFundList(@RequestParam("list") List<String> list);
}
package com.tanpu.fund.feign.product;
import com.alibaba.fastjson.JSON;
import com.tanpu.common.model.tanpuroom.Type;
import com.tanpu.common.resp.CommonResp;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import java.util.List;
@Slf4j
@Component
public class FeignbackForProduct implements FallbackFactory<FeignForProduct> {
@Override
public FeignForProduct create(Throwable throwable) {
return new FeignForProduct() {
@Override
public CommonResp<List<Type>> getSimpleFundList(List<String> list) {
log.error("FeignClientForFund.getSimpleFundList 获取私募产品列表(只返回产品名称参数: {}", JSON.toJSONString(list));
log.error("FeignClientForFund.getSimpleFundList 获取私募产品列表(只返回产品名称异常", throwable);
return CommonResp.error("基金信息查询异常");
}
};
}
}
......@@ -6,71 +6,55 @@ import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* @author: zhoupeng
* <p>
* =========================================
* =========================================
* ======== ========
* ======= ========== ======= =======
* ====== ===== == ==== ======
* ===== ===== == === =====
* ===== ===== == === =====
* ===== ===== == === =====
* ====== ========== == ======
* ======= =======
* =========================================
* =========================================
* <p>
* @email: zhoupeng_08@163.com
*/
@Mapper
public interface FundCountMapper {
long countByExample(FundCountExample example);
int deleteByExample(FundCountExample example);
/**
* delete by primary key
*
* @param id primaryKey
* @return deleteCount
*/
int deleteByPrimaryKey(String id);
/**
* insert record to table
*
* @param record the record
* @return insert count
*/
int insert(FundCount record);
int insertOrUpdate(FundCount record);
int insertOrUpdateSelective(FundCount record);
/**
* insert record to table selective
*
* @param record the record
* @return insert count
*/
int insertSelective(FundCount record);
List<FundCount> selectByExample(FundCountExample example);
/**
* select by primary key
*
* @param id primary key
* @return object by primary key
*/
FundCount selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") FundCount record, @Param("example") FundCountExample example);
int updateByExample(@Param("record") FundCount record, @Param("example") FundCountExample example);
/**
* update record selective
*
* @param record the updated record
* @return update count
*/
int updateByPrimaryKeySelective(FundCount record);
/**
* update record
*
* @param record the updated record
* @return update count
*/
int updateByPrimaryKey(FundCount record);
int updateBatch(List<FundCount> list);
int updateBatchSelective(List<FundCount> list);
int batchInsert(@Param("list") List<FundCount> list);
}
\ No newline at end of file
......@@ -6,71 +6,55 @@ import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* @author: zhoupeng
* <p>
* =========================================
* =========================================
* ======== ========
* ======= ========== ======= =======
* ====== ===== == ==== ======
* ===== ===== == === =====
* ===== ===== == === =====
* ===== ===== == === =====
* ====== ========== == ======
* ======= =======
* =========================================
* =========================================
* <p>
* @email: zhoupeng_08@163.com
*/
@Mapper
public interface IfaImportedFundNavMapper {
long countByExample(IfaImportedFundNavExample example);
int deleteByExample(IfaImportedFundNavExample example);
/**
* delete by primary key
*
* @param id primaryKey
* @return deleteCount
*/
int deleteByPrimaryKey(Integer id);
int deleteByPrimaryKey(Long id);
/**
* insert record to table
*
* @param record the record
* @return insert count
*/
int insert(IfaImportedFundNav record);
int insertOrUpdate(IfaImportedFundNav record);
int insertOrUpdateSelective(IfaImportedFundNav record);
/**
* insert record to table selective
*
* @param record the record
* @return insert count
*/
int insertSelective(IfaImportedFundNav record);
List<IfaImportedFundNav> selectByExample(IfaImportedFundNavExample example);
/**
* select by primary key
*
* @param id primary key
* @return object by primary key
*/
IfaImportedFundNav selectByPrimaryKey(Integer id);
IfaImportedFundNav selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") IfaImportedFundNav record, @Param("example") IfaImportedFundNavExample example);
int updateByExample(@Param("record") IfaImportedFundNav record, @Param("example") IfaImportedFundNavExample example);
/**
* update record selective
*
* @param record the updated record
* @return update count
*/
int updateByPrimaryKeySelective(IfaImportedFundNav record);
/**
* update record
*
* @param record the updated record
* @return update count
*/
int updateByPrimaryKey(IfaImportedFundNav record);
int updateBatch(List<IfaImportedFundNav> list);
int updateBatchSelective(List<IfaImportedFundNav> list);
int batchInsert(@Param("list") List<IfaImportedFundNav> list);
}
\ No newline at end of file
package com.tanpu.fund.mapper.generator.custom;
import com.tanpu.common.model.product.resp.FilePreviewResp;
import com.tanpu.common.model.tanpuroom.Type;
import com.tanpu.fund.entity.generator.FundNav;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
......@@ -47,4 +48,13 @@ public interface FundInfoCustomMapper {
@Select("select t.id as fileId,t.logical_path as previewUrl from fund_file_record t where t.id in(${list})")
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})")
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})")
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}")
List<Type> getFundInfoLikeName(@Param("productName") String productName);
}
......@@ -5,20 +5,8 @@ import com.tanpu.common.model.Pageable;
import com.tanpu.common.model.product.req.NetReq;
import com.tanpu.common.model.product.req.ProductInfoReq;
import com.tanpu.common.model.product.req.ProductListReq;
import com.tanpu.common.model.product.resp.BonusRatioVO;
import com.tanpu.common.model.product.resp.DynamicRetreatVO;
import com.tanpu.common.model.product.resp.FundCompanyVO;
import com.tanpu.common.model.product.resp.FundInfoSimpleListResp;
import com.tanpu.common.model.product.resp.FundManagerVO;
import com.tanpu.common.model.product.resp.FundRecordVO;
import com.tanpu.common.model.product.resp.FundSameResp;
import com.tanpu.common.model.product.resp.NetVO;
import com.tanpu.common.model.product.resp.ProductInfoVO;
import com.tanpu.common.model.product.resp.RiskRatingVO;
import com.tanpu.common.model.product.resp.TrackNetVO;
import com.tanpu.common.model.product.resp.TrackRecordVO;
import com.tanpu.common.model.product.resp.TradeNotesResp;
import com.tanpu.common.model.product.resp.UnitNetVO;
import com.tanpu.common.model.product.resp.*;
import com.tanpu.common.model.tanpuroom.Type;
import java.util.List;
......@@ -81,4 +69,5 @@ public interface ProductPrivateService {
List<FundSameResp> getRemmendPrivateFundList();
List<Type> getSimplePrivateFundList(List<String> list);
}
......@@ -2,6 +2,10 @@ package com.tanpu.fund.service;
import com.tanpu.common.model.Page;
import com.tanpu.common.model.Pageable;
import com.tanpu.common.model.adm.req.IfaNetImportReq;
import com.tanpu.common.model.fund.req.FundRankReq;
import com.tanpu.common.model.fund.resq.FundRankResp;
import com.tanpu.common.model.privatefund.resp.FundNavMessage;
import com.tanpu.common.model.product.req.ProductListReq;
import com.tanpu.common.model.product.resp.DynamicRetreatVO;
import com.tanpu.common.model.product.resp.FundInfoSimpleListResp;
......@@ -9,6 +13,9 @@ import com.tanpu.common.model.product.resp.ProductInfoVO;
import com.tanpu.common.model.product.req.NetReq;
import com.tanpu.common.model.product.req.ProductInfoReq;
import com.tanpu.common.model.product.resp.*;
import com.tanpu.common.resp.CommonResp;
import org.springframework.web.multipart.MultipartFile;
import com.tanpu.common.model.tanpuroom.Type;
import java.util.List;
......@@ -68,4 +75,16 @@ public interface ProductService {
List<FundSameResp> querySamefund(String fundId);
List<FundSameResp> getRemmendPrivateFundList(String fundId);
CommonResp<List<FundNavMessage>> importNet(MultipartFile file, String fundId);
List<Type> getSimpleFundList(List<String> list);
CommonResp<List<FundNavMessage>> importNetCheckSave(IfaNetImportReq req);
Page<FundRankResp> getFundRank(FundRankReq req);
Long getFundRankCountInfo(FundRankReq req);
List<Type> getFundLikeShortName(String productName, Pageable page);
}
......@@ -20,6 +20,7 @@ import com.tanpu.fund.entity.generator.*;
import com.tanpu.fund.enums.ProTypeEnums;
import com.tanpu.fund.feign.diagnose.FeignClientForDiagnose;
import com.tanpu.fund.mapper.generator.*;
import com.tanpu.fund.mapper.generator.custom.FundInfoCustomMapper;
import com.tanpu.fund.service.ProductPrivateService;
import com.tanpu.fund.utils.LongUtil;
import lombok.extern.slf4j.Slf4j;
......@@ -86,6 +87,9 @@ public class ProductPrivateServiceImpl implements ProductPrivateService, Constan
@Resource
private FeignClientForDiagnose diagnose;
@Resource
private FundInfoCustomMapper fundInfoCustomMapper;
@Override
public Page<ProductInfoVO> getProductList(ProductInfoReq req) {
return null;
......@@ -519,4 +523,8 @@ public class ProductPrivateServiceImpl implements ProductPrivateService, Constan
return null;
}
@Override
public List<Type> getSimplePrivateFundList(List<String> list) {
return fundInfoCustomMapper.getSimplePrivateFundList(list.stream().collect(Collectors.joining("','", "'", "'")));
}
}
......@@ -10,8 +10,8 @@ management.endpoints.web.base-path = /myhealth
management.endpoint.health.enabled=true
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.url=jdbc:mysql://rm-uf6r22t3d798q4kmkao.mysql.rds.aliyuncs.com:3306/tamp_fund?autoReconnect=true&characterEncoding=utf-8&serverTimezone=GMT%2B8&useSSL=false
spring.datasource.username=tamp_admin
spring.datasource.password= @imeng123
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
......
......@@ -41,12 +41,11 @@
res.ishigh_or_low as ishighOrLow,
res.tohigh_nav_ratio as tohighNavRatio
from
(SELECT * FROM fund_nav WHERE fund_id in
(SELECT fund_id, max(price_date) as price_date FROM fund_nav WHERE fund_id in
<foreach close=")" collection="list" item="fundId" open="(" separator=",">
#{fundId}
</foreach>
order BY price_date desc) res
GROUP BY res.fund_id
</foreach> GROUP by fund_id) t
left join fund_nav res on t.fund_id = res.fund_id and t.price_date = res.price_date
</select>
<select id="getPrivateFundInfoNewNet" parameterType="java.lang.String" resultType="com.tanpu.fund.entity.generator.FundNav">
......@@ -60,12 +59,11 @@
res.ishigh_or_low as ishighOrLow,
res.tohigh_nav_ratio as tohighNavRatio
from
(SELECT * FROM ifa_imported_fund_nav WHERE fund_id in
(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=",">
#{fundId}
</foreach>
order BY price_date desc) res
GROUP BY res.fund_id
</foreach> GROUP by fund_id) t
left join ifa_imported_fund_nav res on t.fund_id = res.fund_id and t.price_date = res.price_date
</select>
</mapper>
package com.tanpu.fund;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
/**
* @author: zhoupeng
* @email: zhoupeng_08@163.com
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = FundApplication.class)
@ActiveProfiles("dev")
public class BaseTest {
}
package com.tanpu.fund.excel;
import cn.hutool.poi.excel.ExcelReader;
import cn.hutool.poi.excel.ExcelUtil;
import com.tanpu.fund.BaseTest;
import org.junit.Test;
import java.util.List;
/**
* @author: zhoupeng
* @email: zhoupeng_08@163.com
*/
public class NetExcel extends BaseTest {
public static final String URL = "https://mylolis-my.sharepoint.com/personal/f3101_365up_site/Documents/工作簿2.xlsx";
@Test
public void productNetAnalysis() {
ExcelReader reader = ExcelUtil.getReader(URL);
List<List<Object>> read = reader.read();
System.out.println(read);
}
}
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