|
@@ -4,11 +4,13 @@ import com.dao.ChartsConfigMapper;
|
|
|
import com.dao.UserMapper;
|
|
import com.dao.UserMapper;
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
|
+import com.github.pagehelper.PageInfo;
|
|
|
import com.model.bo.GroupUpdateId;
|
|
import com.model.bo.GroupUpdateId;
|
|
|
import com.model.po.ChartConfig;
|
|
import com.model.po.ChartConfig;
|
|
|
import com.model.po.ChartConfigList;
|
|
import com.model.po.ChartConfigList;
|
|
|
import com.model.pojo.RepCode;
|
|
import com.model.pojo.RepCode;
|
|
|
import com.model.pojo.RepEntity;
|
|
import com.model.pojo.RepEntity;
|
|
|
|
|
+import com.model.pojo.TestPage;
|
|
|
import com.model.vo.configVo.ChangeOrderInfo;
|
|
import com.model.vo.configVo.ChangeOrderInfo;
|
|
|
import com.model.vo.configVo.ChartConfigInfo;
|
|
import com.model.vo.configVo.ChartConfigInfo;
|
|
|
import com.model.vo.configVo.GroupInfo;
|
|
import com.model.vo.configVo.GroupInfo;
|
|
@@ -51,13 +53,6 @@ public class ChartsConfigService {
|
|
|
String groupBy = null;
|
|
String groupBy = null;
|
|
|
String accessAuthority = null;
|
|
String accessAuthority = null;
|
|
|
String updateAuthority = null;
|
|
String updateAuthority = null;
|
|
|
- String style = null;
|
|
|
|
|
-
|
|
|
|
|
- try {
|
|
|
|
|
- style = objectmapper.writeValueAsString(chartConfigInfo.getStyle());
|
|
|
|
|
- } catch (JsonProcessingException e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
groupBy = objectmapper.writeValueAsString(chartConfigInfo.getGroupBy());
|
|
groupBy = objectmapper.writeValueAsString(chartConfigInfo.getGroupBy());
|
|
@@ -77,14 +72,9 @@ public class ChartsConfigService {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if ("".equals(style) || style == null){
|
|
|
|
|
- chartConfig.setStyle("");
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
chartConfig.setGroupBy(groupBy);
|
|
chartConfig.setGroupBy(groupBy);
|
|
|
chartConfig.setAccessAuthority(accessAuthority);
|
|
chartConfig.setAccessAuthority(accessAuthority);
|
|
|
chartConfig.setUpdateAuthority(updateAuthority);
|
|
chartConfig.setUpdateAuthority(updateAuthority);
|
|
|
- chartConfig.setStyle(style);
|
|
|
|
|
chartConfig.setCreateDate(timeUtil.SystemTime());
|
|
chartConfig.setCreateDate(timeUtil.SystemTime());
|
|
|
chartConfig.setCreateId(userId);
|
|
chartConfig.setCreateId(userId);
|
|
|
chartConfig.setCreateBy(userName);
|
|
chartConfig.setCreateBy(userName);
|
|
@@ -94,11 +84,13 @@ public class ChartsConfigService {
|
|
|
}
|
|
}
|
|
|
if (chartConfig.getChartOption() == null ) {
|
|
if (chartConfig.getChartOption() == null ) {
|
|
|
chartConfig.setChartOption("");
|
|
chartConfig.setChartOption("");
|
|
|
- System.out.println("=======11111==================");
|
|
|
|
|
}
|
|
}
|
|
|
if (chartConfig.getFetchConfig() == null || "".equals(chartConfig.getFetchConfig())){
|
|
if (chartConfig.getFetchConfig() == null || "".equals(chartConfig.getFetchConfig())){
|
|
|
chartConfig.setFetchConfig("");
|
|
chartConfig.setFetchConfig("");
|
|
|
}
|
|
}
|
|
|
|
|
+ if (chartConfig.getStyle() == null){
|
|
|
|
|
+ chartConfig.setStyle("");
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
chartsConfigMapper.insertCharts(chartConfig);
|
|
chartsConfigMapper.insertCharts(chartConfig);
|
|
|
int id = chartConfig.getChartId();
|
|
int id = chartConfig.getChartId();
|
|
@@ -123,13 +115,6 @@ public class ChartsConfigService {
|
|
|
String groupBy = null;
|
|
String groupBy = null;
|
|
|
String accessAuthority = null;
|
|
String accessAuthority = null;
|
|
|
String updateAuthority = null;
|
|
String updateAuthority = null;
|
|
|
- String style = null;
|
|
|
|
|
-
|
|
|
|
|
- try {
|
|
|
|
|
- style = objectmapper.writeValueAsString(chartConfigInfo.getStyle());
|
|
|
|
|
- } catch (JsonProcessingException e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
groupBy = objectmapper.writeValueAsString(chartConfigInfo.getGroupBy());
|
|
groupBy = objectmapper.writeValueAsString(chartConfigInfo.getGroupBy());
|
|
@@ -155,7 +140,6 @@ public class ChartsConfigService {
|
|
|
chartConfig.setAccessAuthority(accessAuthority);
|
|
chartConfig.setAccessAuthority(accessAuthority);
|
|
|
chartConfig.setAccessAuthority(accessAuthority);
|
|
chartConfig.setAccessAuthority(accessAuthority);
|
|
|
chartConfig.setUpdateAuthority(updateAuthority);
|
|
chartConfig.setUpdateAuthority(updateAuthority);
|
|
|
- chartConfig.setStyle(style);
|
|
|
|
|
chartConfig.setCreateId(userId);
|
|
chartConfig.setCreateId(userId);
|
|
|
chartConfig.setCreateBy(userName);
|
|
chartConfig.setCreateBy(userName);
|
|
|
chartConfig.setUpdateDate(timeUtil.SystemTime());
|
|
chartConfig.setUpdateDate(timeUtil.SystemTime());
|
|
@@ -164,7 +148,9 @@ public class ChartsConfigService {
|
|
|
}
|
|
}
|
|
|
if (chartConfig.getChartOption() == null) {
|
|
if (chartConfig.getChartOption() == null) {
|
|
|
chartConfig.setChartOption("");
|
|
chartConfig.setChartOption("");
|
|
|
- System.out.println("=========================");
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ if (chartConfig.getStyle() == null){
|
|
|
|
|
+ chartConfig.setStyle("");
|
|
|
}
|
|
}
|
|
|
System.out.println("chartOption:"+chartConfig.getChartOption());
|
|
System.out.println("chartOption:"+chartConfig.getChartOption());
|
|
|
chartsConfigMapper.updateChartConfig(chartConfig);
|
|
chartsConfigMapper.updateChartConfig(chartConfig);
|
|
@@ -208,11 +194,12 @@ public class ChartsConfigService {
|
|
|
/*
|
|
/*
|
|
|
查询图表列表
|
|
查询图表列表
|
|
|
*/
|
|
*/
|
|
|
- public RepEntity getListCharts(String token){
|
|
|
|
|
|
|
+ public RepEntity getListCharts(String token, TestPage testPage){
|
|
|
Map<String, String> resMap = getTokenData.getTokenData(token);
|
|
Map<String, String> resMap = getTokenData.getTokenData(token);
|
|
|
int id = Integer.parseInt(resMap.get("id"));
|
|
int id = Integer.parseInt(resMap.get("id"));
|
|
|
- List<ChartConfigList> chartsList = chartsConfigMapper.getListByUser(id);
|
|
|
|
|
- return new RepEntity(RepCode.success, chartsList);
|
|
|
|
|
|
|
+ List<ChartConfigList> chartsList = chartsConfigMapper.getListByUser(id,testPage.enablePaging());
|
|
|
|
|
+ PageInfo<ChartConfigList> pageInfo = new PageInfo<>(chartsList);
|
|
|
|
|
+ return new RepEntity(RepCode.success, pageInfo);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
/*
|