yanite 3 years ago
parent
commit
a0177546ed

+ 3 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexBaseMonthDataServiceImpl.java

@@ -98,7 +98,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		if(Objects.nonNull(queryInfo.getStartDate())){
 			startDate = LocalDateTime.ofInstant(queryInfo.getStartDate().toInstant(), DateUtil.zoneId).toLocalDate();
 		}
-
+		startDate = startDate.plusDays(-180);
 		LocalDate endDate = nowDate.plusDays(-1);
 		if(Objects.nonNull(queryInfo.getEndDate())){
 			endDate = LocalDateTime.ofInstant(queryInfo.getEndDate().toInstant(), DateUtil.zoneId).toLocalDate();
@@ -289,6 +289,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			}
 			IndexBaseDto indexBaseData = new IndexBaseDto(typeDateMapEntry.getKey(),typeDateMapEntry.getKey().getMsg());
 			indexBaseData.setIndexMonthData(value, currentMonth);
+			indexBaseData.setPercent(value.stream().map(IndexBaseMonthData::getPercent).reduce(BigDecimal.ZERO, BigDecimal::add));
 			if(OTHER_AMOUNT.equals(typeDateMapEntry.getKey())){
 				List<IndexBaseMonthData> otherAmountDetails = new ArrayList<>();
 				if(value != null && value.size() > 0){
@@ -322,6 +323,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 					}
 				}
 			}
+
 			result.add(indexBaseData);
 		}
 		return result;