Commit fd562a28 authored by zp's avatar zp

add

parent 3e44d07d
...@@ -1684,20 +1684,27 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -1684,20 +1684,27 @@ public class ProductServiceImpl implements ProductService, Constant {
ifaNavMap = getIfaNavMap(req.getFundId()); 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);
req.setFundNavMessages(req.getFundNavMessages()
.stream()
.peek(ls -> {
ls.setConfirmStatus(null);
ls.setMessage(null);
}).collect(Collectors.toList()));
List<List<Object>> read = req.getFundNavMessages().stream().map(ls -> { List<List<Object>> read = req.getFundNavMessages().stream().map(ls -> {
List<Object> linkedList = new LinkedList<>(); List<Object> linkedList = new LinkedList<>();
if (StringUtils.isNotEmpty(ls.getPrice_date())) { if (StringUtils.isNotEmpty(ls.getPrice_date())) {
linkedList.add(DateTime.of(ls.getPrice_date(), "yyyy-MM-dd").getTime()); linkedList.add(ls.getPrice_date());
} else { } else {
linkedList.add(""); linkedList.add("");
} }
linkedList.add(ls.getNav()); linkedList.add(ls.getNav());
linkedList.add(ls.getCumulative_nav()); linkedList.add(ls.getCumulative_nav());
linkedList.add(ls.getId());
linkedList.add(ls.getFund_id());
return linkedList; return linkedList;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
...@@ -1925,7 +1932,7 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -1925,7 +1932,7 @@ public class ProductServiceImpl implements ProductService, Constant {
AtomicBoolean errorStatus, AtomicBoolean errorStatus,
List<List<Object>> read) { List<List<Object>> read) {
List<FundNavMessage> newResultMessage = handlerNetImportCheck(ifaNavMap, resultMessage, errorStatus, read); List<FundNavMessage> newResultMessage = handlerNetImportCheck(ifaNavMap, resultMessage, errorStatus, read);
if (errorStatus.get()) { /* if (errorStatus.get()) {
//只做校验不入库 //只做校验不入库
// this.ifaImportedFundNavMapper.batchInsert(resultMessage.stream().map(ls -> { // this.ifaImportedFundNavMapper.batchInsert(resultMessage.stream().map(ls -> {
// IfaImportedFundNav nav = new IfaImportedFundNav(); // IfaImportedFundNav nav = new IfaImportedFundNav();
...@@ -1933,7 +1940,7 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -1933,7 +1940,7 @@ public class ProductServiceImpl implements ProductService, Constant {
// return nav; // return nav;
// }).collect(Collectors.toList())); // }).collect(Collectors.toList()));
return CommonResp.success(); return CommonResp.success();
} }*/
newResultMessage.sort(Comparator.comparing(FundNavMessage::getPriceDate).reversed()); newResultMessage.sort(Comparator.comparing(FundNavMessage::getPriceDate).reversed());
//return CommonResp.error("0003", "数据错误,请您重新核对", newResultMessage); //return CommonResp.error("0003", "数据错误,请您重新核对", newResultMessage);
...@@ -1994,13 +2001,22 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -1994,13 +2001,22 @@ public class ProductServiceImpl implements ProductService, Constant {
read.forEach(ls -> { read.forEach(ls -> {
boolean errorRow = false; boolean errorRow = false;
FundNavMessage message = new FundNavMessage(); FundNavMessage message = new FundNavMessage();
if (ls.size() > 3) {
if (ls.get(3) != null) {
message.setId(Long.parseLong(ls.get(3) + ""));
}
if (ls.get(4) != null) {
message.setFund_id(ls.get(4) + "");
}
}
String row1 = null, row2, row3; String row1 = null, row2, row3;
if (ls.get(0) == null) { if (ls.get(0) == null) {
errorRow = true; errorRow = true;
message.setMessage("[净值日期不能为空]"); message.setMessage("[净值日期不能为空]");
} else { } else {
row1 = (ls.get(0) + "").trim(); row1 = (ls.get(0) + "").trim().split(" ")[0];
Date date = null; Date date = null;
try { try {
date = DateUtil.parseDate(row1); date = DateUtil.parseDate(row1);
...@@ -2077,14 +2093,14 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -2077,14 +2093,14 @@ public class ProductServiceImpl implements ProductService, Constant {
if (compare02.compareTo(cumSubtract) < 0) { if (compare02.compareTo(cumSubtract) < 0) {
message.setConfirmStatus(2); message.setConfirmStatus(2);
if (StringUtils.isNotEmpty(message.getMessage())) { if (StringUtils.isNotEmpty(message.getMessage())) {
message.setMessage(",[累计分红再投净值]与上次对比相差超过20%"); message.setMessage(message.getMessage() + ",[累计分红再投净值]与上次对比相差超过20%");
} else { } else {
message.setMessage("[累计分红再投净值]与上次对比相差超过20%"); message.setMessage("[累计分红再投净值]与上次对比相差超过20%");
} }
} }
} }
newResultMessage.add(message); newResultMessage.add(message);
}else { } else {
newResultMessage.add(message); newResultMessage.add(message);
} }
...@@ -2113,7 +2129,11 @@ public class ProductServiceImpl implements ProductService, Constant { ...@@ -2113,7 +2129,11 @@ public class ProductServiceImpl implements ProductService, Constant {
if (StringUtils.isEmpty(message.getMessage())) { if (StringUtils.isEmpty(message.getMessage())) {
message.setMessage("[相同日期存在重复数据]"); message.setMessage("[相同日期存在重复数据]");
} else { } else {
message.setMessage(message.getMessage() + ",[累计分红再投净值为空或格式错误]"); if (StringUtils.isEmpty(message.getMessage())) {
message.setMessage("[累计分红再投净值为空或格式错误]");
} else {
message.setMessage(message.getMessage() + ",[累计分红再投净值为空或格式错误]");
}
} }
} }
}); });
......
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