Commit 07ee83c2 authored by zp's avatar zp

Merge remote-tracking branch 'origin/v2.0.0' into dev

parents 3918c3ee b8a18a16
...@@ -170,7 +170,7 @@ public interface ProductApi { ...@@ -170,7 +170,7 @@ public interface ProductApi {
@ApiOperation("理财师净值导入") @ApiOperation("理财师净值导入")
@GetMapping("/ifa/net/import") @GetMapping("/ifa/net/import")
CommonResp<List<FundNavMessage>> importNetInfo(@RequestParam("file") MultipartFile file, CommonResp<List<FundNavMessage>> importNetInfo(@RequestParam("file") MultipartFile file,
@RequestParam("fundId") @Valid @NotEmpty(message = "请先确定需要导入的基金") String fundId); @RequestParam(value = "fundId", required = false) String fundId);
@ApiOperation("理财师净值导入") @ApiOperation("理财师净值导入")
@PostMapping("/ifa/net/import/check/save") @PostMapping("/ifa/net/import/check/save")
......
...@@ -38,7 +38,6 @@ import com.tanpu.fund.service.ProductService; ...@@ -38,7 +38,6 @@ import com.tanpu.fund.service.ProductService;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.validator.routines.BigDecimalValidator; import org.apache.commons.validator.routines.BigDecimalValidator;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -1707,7 +1706,13 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -1707,7 +1706,13 @@ public class ProductServiceImpl implements ProductService, Constant {
@Override @Override
public CommonResp<List<FundNavMessage>> importNetCheckSave(IfaNetImportReq req) { public CommonResp<List<FundNavMessage>> importNetCheckSave(IfaNetImportReq req) {
Map<Long, IfaImportedFundNav> ifaNavMap = getIfaNavMap(req.getFundId()); Map<Long, IfaImportedFundNav> ifaNavMap;
if (StringUtils.isEmpty(req.getFundId())) {
ifaNavMap = new HashMap<>(0);
} else {
ifaNavMap = getIfaNavMap(req.getFundId());
}
List<FundNavMessage> resultMessage = new ArrayList<>(req.getFundNavMessages().size() * 2); List<FundNavMessage> resultMessage = new ArrayList<>(req.getFundNavMessages().size() * 2);
AtomicBoolean errorStatus = new AtomicBoolean(false); AtomicBoolean errorStatus = new AtomicBoolean(false);
...@@ -1969,7 +1974,12 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -1969,7 +1974,12 @@ public class ProductServiceImpl implements ProductService, Constant {
return CommonResp.error("获取不到基金信息"); return CommonResp.error("获取不到基金信息");
} }
Map<Long, IfaImportedFundNav> ifaNavMap = getIfaNavMap(fundId); Map<Long, IfaImportedFundNav> ifaNavMap;
if (StringUtils.isEmpty(fundId)) {
ifaNavMap = new HashMap<>(0);
} else {
ifaNavMap = getIfaNavMap(fundId);
}
try (InputStream inputStream = file.getInputStream()) { try (InputStream inputStream = file.getInputStream()) {
ExcelReader reader = ExcelUtil.getReader(inputStream); ExcelReader reader = ExcelUtil.getReader(inputStream);
...@@ -1985,7 +1995,6 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -1985,7 +1995,6 @@ public class ProductServiceImpl implements ProductService, Constant {
} }
} }
@NotNull
private Map<Long, IfaImportedFundNav> getIfaNavMap(String fundId) { private Map<Long, IfaImportedFundNav> getIfaNavMap(String fundId) {
IfaImportedFundNavExample example = new IfaImportedFundNavExample(); IfaImportedFundNavExample example = new IfaImportedFundNavExample();
example.createCriteria().andFundIdEqualTo(fundId); example.createCriteria().andFundIdEqualTo(fundId);
......
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