Commit 2c67fc51 authored by zp's avatar zp

importNav

parent 5010cb77
......@@ -197,12 +197,6 @@
<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>
......@@ -214,6 +208,12 @@
<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>
<artifactId>lombok</artifactId>
......
package com.tanpu.fund.api;
import cn.hutool.poi.excel.ExcelReader;
import cn.hutool.poi.excel.ExcelUtil;
import java.io.File;
import java.util.List;
import java.util.Map;
/**
* @author: zhoupeng
* <p>
* =========================================
* =========================================
* ======== ========
* ======= ========== ======= =======
* ====== ===== == ==== ======
* ===== ===== == === =====
* ===== ===== == === =====
* ===== ===== == === =====
* ====== ========== == ======
* ======= =======
* =========================================
* =========================================
* <p>
* @email: zhoupeng_08@163.com
*/
public class FileTest {
public static void main(String[] args) {
ExcelReader reader = ExcelUtil.getReader(new File("C:\\Users\\zhoup\\Downloads\\navImport.xlsx"));
List<Map<String, Object>> maps = reader.readAll();
System.out.println(maps);
}
}
......@@ -3,6 +3,7 @@ package com.tanpu.fund.api;
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.privatefund.resp.FundNavMessage;
import com.tanpu.common.model.product.req.NetReq;
import com.tanpu.common.model.product.req.ProductInfoReq;
......@@ -169,4 +170,8 @@ public interface ProductApi {
@GetMapping("/ifa/net/import")
CommonResp<List<FundNavMessage>> importNetInfo(@RequestParam("file") MultipartFile file,
@RequestParam("fundId") @Validated @NotEmpty String fundId);
@ApiOperation("理财师净值导入")
@PostMapping("/ifa/net/import/check/save")
CommonResp<List<FundNavMessage>> importNetCheckSaveInfo(@RequestBody IfaNetImportReq req);
}
......@@ -3,6 +3,7 @@ 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.privatefund.resp.FundNavMessage;
import com.tanpu.common.model.product.req.NetReq;
import com.tanpu.common.model.product.req.ProductInfoReq;
......@@ -215,4 +216,9 @@ public class ProductController implements ProductApi {
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);
}
}
......@@ -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 {
......
......@@ -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
......@@ -2,6 +2,7 @@ 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.privatefund.resp.FundNavMessage;
import com.tanpu.common.model.product.req.ProductListReq;
import com.tanpu.common.model.product.resp.DynamicRetreatVO;
......@@ -76,4 +77,6 @@ public interface ProductService {
CommonResp<List<FundNavMessage>> importNet(MultipartFile file, String fundId);
List<Type> getSimpleFundList(List<String> list);
CommonResp<List<FundNavMessage>> importNetCheckSave(IfaNetImportReq req);
}
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