|
@@ -514,11 +514,30 @@ public class EmailParseService {
|
|
|
BigDecimal amplitude = amplitudeNav(insertDO);
|
|
|
if(amplitude.compareTo(BigDecimal.valueOf(1)) >= 0){
|
|
|
//振幅超过100%不可以入库,要给出提示信息
|
|
|
- saveAmplitudeFundNav(insertDO,fileId,NavParseStatusConst.AMPLITUDE_ERROR,0);
|
|
|
+ saveEmailFundNav(insertDO,fileId,NavParseStatusConst.AMPLITUDE_ERROR,0);
|
|
|
}else{
|
|
|
+ //针对净值日期做校验,净值日期不能早于基金成立日,净值日期不能晚于基金清算日期,非成立日净值日期不能是周末
|
|
|
+ Date priceDate = insertDO.getPriceDate();
|
|
|
+ FundInfoDO fundInfoDO = fundInfoMapper.searchFundDetail(insertDO.getFundId());
|
|
|
+ String inceptionDate = fundInfoDO.getInceptionDate();
|
|
|
+ if(inceptionDate != null && DateUtils.parse(inceptionDate,DateUtils.YYYY_MM_DD).after(priceDate)){
|
|
|
+ saveEmailFundNav(insertDO,fileId,NavParseStatusConst.PRICE_DATE_BEFORE_INCEPTION,0);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ String liquidateDate = fundInfoDO.getLiquidateDate();
|
|
|
+ if(liquidateDate != null && DateUtils.parse(liquidateDate,DateUtils.YYYY_MM_DD).before(priceDate)){
|
|
|
+ saveEmailFundNav(insertDO,fileId,NavParseStatusConst.PRICE_DATE_AFTER_LIQUIDATE,0);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ //周日算每周第一天,非成立日净值日期不能是周末
|
|
|
+ Integer dayOfWeek = DateUtil.dayOfWeek(priceDate);
|
|
|
+ if((dayOfWeek == 1 || dayOfWeek==7) && !priceDate.equals(inceptionDate)){
|
|
|
+ saveEmailFundNav(insertDO,fileId,NavParseStatusConst.PRICE_DATE_NOT_WORK_DAY,0);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
//振幅超过20%可以入库,但要给出提示信息
|
|
|
if(amplitude.compareTo(BigDecimal.valueOf(0.2)) >= 0){
|
|
|
- saveAmplitudeFundNav(insertDO,fileId,NavParseStatusConst.AMPLITUDE_EXCEPTION,1);
|
|
|
+ saveEmailFundNav(insertDO,fileId,NavParseStatusConst.AMPLITUDE_EXCEPTION,1);
|
|
|
}
|
|
|
NavDO oldNavDO = navMapper.queryFundNav(insertDO);
|
|
|
if(oldNavDO != null){
|
|
@@ -534,7 +553,7 @@ public class EmailParseService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void saveAmplitudeFundNav(NavDO insertDO,Integer fileId,Integer exceptionStatus,Integer isStored) {
|
|
|
+ private void saveEmailFundNav(NavDO insertDO,Integer fileId,Integer exceptionStatus,Integer isStored) {
|
|
|
EmailFundNavDO fundNavDO = new EmailFundNavDO();
|
|
|
fundNavDO.setFundId(insertDO.getFundId());
|
|
|
fundNavDO.setNav(insertDO.getNav());
|
|
@@ -714,6 +733,13 @@ public class EmailParseService {
|
|
|
fundNavDTO.setParseStatus(NavParseStatusConst.ASSET_NET_NEGATIVE);
|
|
|
return;
|
|
|
}
|
|
|
+ //净值日期不能大于当前日期
|
|
|
+ if(StringUtil.isNotEmpty(fundNavDTO.getPriceDate())){
|
|
|
+ if(DateUtils.parse(fundNavDTO.getPriceDate(),DateUtils.YYYY_MM_DD).after(new Date())){
|
|
|
+ fundNavDTO.setParseStatus(NavParseStatusConst.PRICE_DATE_AFTER_NOW);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
// 4.匹配基金(考虑到解析估值表时已经匹配上基金的情况)
|
|
|
List<String> fundIdList = fundNavDTO.getFundIdList();
|
|
|
if (CollUtil.isEmpty(fundIdList)) {
|