|
@@ -50,12 +50,7 @@ public class ReportStaticServiceImpl implements ReportStaticService {
|
|
|
String gatherSql = info.getGatherSql() + " as value, t." + vo.getGroupColumn() + " ";
|
|
|
String sql = ReportUsedUtil.callSqlFormat(vo, info.getBaseSql(), gatherSql, vo.getGroupColumn(), vo.getGroupColumn());
|
|
|
List<Map<String, Object>> l = reportStaticMapper.selectReportRegList(sql);
|
|
|
- List<Object> vl = new ArrayList<>();
|
|
|
- for (Map<String, Object> m : l) {
|
|
|
- vl.add(ReportUsedUtil.formatDataForUse(vo.getGroupColumn(), m.get(vo.getGroupColumn())));
|
|
|
- }
|
|
|
resultMap.put(info.getReportId(), l);
|
|
|
- resultMap.put(vo.getGroupColumn(), vl);
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
@@ -73,14 +68,23 @@ public class ReportStaticServiceImpl implements ReportStaticService {
|
|
|
String gatherSql = info.getGatherSql() + " as value, t." + vo.getGroupColumn() + " ";
|
|
|
String sql = ReportUsedUtil.callSqlFormat(vo, info.getBaseSql(), gatherSql, vo.getGroupColumn(), vo.getGroupColumn());
|
|
|
List<Map<String, Object>> l = reportStaticMapper.selectReportRegList(sql);
|
|
|
- List<Object> vl = new ArrayList<>();
|
|
|
- for (Map<String, Object> m : l) {
|
|
|
- vl.add(ReportUsedUtil.formatDataForUse(vo.getGroupColumn(), m.get(vo.getGroupColumn())));
|
|
|
- }
|
|
|
resultMap.put(info.getReportId(), l);
|
|
|
- resultMap.put(vo.getGroupColumn(), vl);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ // 计算分组单元
|
|
|
+ if("2".equals(type)){
|
|
|
+ List<String> vl = new ArrayList<>();
|
|
|
+ String s = vo.getStartTime();
|
|
|
+ String e = vo.getEndTime();
|
|
|
+ List<String> yfList = ReportUsedUtil.getMonthBetweenDate(s, e);
|
|
|
+ for (String yf: yfList) {
|
|
|
+ String c_fy = ReportUsedUtil.formatDataForUse(vo.getGroupColumn(), yf);
|
|
|
+ vl.add(c_fy);
|
|
|
+ }
|
|
|
+ resultMap.put(vo.getGroupColumn(), vl);
|
|
|
+ }
|
|
|
+
|
|
|
return resultMap;
|
|
|
}
|
|
|
|