|
@@ -50,6 +50,12 @@ public class ChartServiceImpl implements ChartService {
|
|
|
Integer id = chart.getId();
|
|
|
List<ChartItem> chartItemList = chart.getChartItemList();
|
|
|
if (Blank.isNotEmpty(chartItemList)) {
|
|
|
+ String chartType = chart.getChartType();
|
|
|
+ if (chartType.equals(ConstantStr.BAR_CHART)) {
|
|
|
+ if (chartItemList.size() != 1) {
|
|
|
+ return Result.no(ResultEnum.SERVER_ERROR.getRespCode(), "饼状图只能配置一个数据项");
|
|
|
+ }
|
|
|
+ }
|
|
|
chartDao.addChartItem(id, chartItemList);
|
|
|
}
|
|
|
List<UserGroup> userGroupList = chart.getUserGroupList();
|
|
@@ -69,6 +75,12 @@ public class ChartServiceImpl implements ChartService {
|
|
|
chartDao.delChartUserGroup(id);
|
|
|
List<ChartItem> chartItemList = chart.getChartItemList();
|
|
|
if (Blank.isNotEmpty(chartItemList)) {
|
|
|
+ String chartType = chart.getChartType();
|
|
|
+ if (chartType.equals(ConstantStr.BAR_CHART)) {
|
|
|
+ if (chartItemList.size() != 1) {
|
|
|
+ return Result.no(ResultEnum.SERVER_ERROR.getRespCode(), "饼状图只能配置一个数据项");
|
|
|
+ }
|
|
|
+ }
|
|
|
chartDao.addChartItem(id, chartItemList);
|
|
|
}
|
|
|
List<UserGroup> userGroupList = chart.getUserGroupList();
|