Browse Source

解决--6、【工作日志】支部建设、联建共建近12月趋势图--接口返回横坐标包含当前月问题

master
sunyuchao 4 years ago
parent
commit
d22fc97262
  1. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenWorkRecordOrgDailyServiceImpl.java
  2. 15
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/utils/DateUtils.java

2
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenWorkRecordOrgDailyServiceImpl.java

@ -205,7 +205,7 @@ public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl<ScreenW
}
//2.查询当前月过去12个月份
Map<String, String> map = dateUtils.getXpro();
Map<String, String> map = dateUtils.getXproSub();
resultDTO.setXAxis(map.values().stream().collect(Collectors.toList()));
List<String> monthIdList = map.keySet().stream().collect(Collectors.toList());

15
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/utils/DateUtils.java

@ -75,6 +75,21 @@ public class DateUtils {
return result;
}
public Map<String,String> getXproSub(){
Map<String,String> xAxis = new HashMap<>();
LocalDate today = LocalDate.now();
for(int i = NumConstant.TWELVE;i > NumConstant.ZERO; i--){
LocalDate localDate = today.minusMonths(i);
String s = localDate.getMonth().getValue() + "月";
xAxis.put(localDate.format(fmt),s);
}
Map<String, String> result = Maps.newLinkedHashMap();
xAxis.entrySet().stream().sorted(Map.Entry.comparingByKey())
.forEachOrdered((e -> result.put(e.getKey(),e.getValue())));
return result;
}
public Map<String,String> getXproEndMonth(String monthId){
Map<String,String> xAxis = new HashMap<>();
for(int i=NumConstant.ZERO;i <= NumConstant.ELEVEN; i++){

Loading…
Cancel
Save