|
@@ -665,81 +665,11 @@ public class ReportTableTask {
|
|
String standby = t.getStandby();
|
|
String standby = t.getStandby();
|
|
String itemName = t.getItemName();
|
|
String itemName = t.getItemName();
|
|
Integer dataSourceId = t.getDataSourceId();
|
|
Integer dataSourceId = t.getDataSourceId();
|
|
- Integer itemType = t.getItemType();
|
|
|
|
Integer valueTakingMode = t.getValueTakingMode();
|
|
Integer valueTakingMode = t.getValueTakingMode();
|
|
Integer valueType = t.getValueType();
|
|
Integer valueType = t.getValueType();
|
|
Integer bucketType = t.getBucketType();
|
|
Integer bucketType = t.getBucketType();
|
|
Integer bucketValue = t.getBucketValue();
|
|
Integer bucketValue = t.getBucketValue();
|
|
boolean flage = valueType.equals(ConstantStr.CALCULATED_VALUE);
|
|
boolean flage = valueType.equals(ConstantStr.CALCULATED_VALUE);
|
|
- if (itemType.equals(ConstantStr.ATTACH_ATTRIBUTES)) {
|
|
|
|
- AttachRawData attachRawData = rawDataDao.getAttachRawData(itemGroupId, dataSourceId, itemName);
|
|
|
|
- String dataType = attachRawData.getDataType();
|
|
|
|
- String pattern = null;
|
|
|
|
- if (bucketType.equals(ConstantStr.PERIOD_TIME_DAY)) {
|
|
|
|
- pattern = ConstantStr.TIME_DAY_STR;
|
|
|
|
- } else if (bucketType.equals(ConstantStr.PERIOD_TIME_HOUR)) {
|
|
|
|
- pattern = ConstantStr.TIME_HOUR_STR;
|
|
|
|
- } else if (bucketType.equals(ConstantStr.PERIOD_TIME_MINUTE)) {
|
|
|
|
- pattern = ConstantStr.TIME_MINUTE_STR;
|
|
|
|
- } else if (bucketType.equals(ConstantStr.PERIOD_TIME_SECOND)) {
|
|
|
|
- pattern = ConstantStr.TIME_SECOND_STR;
|
|
|
|
- }
|
|
|
|
- int timeLength = DateUtil.timeDifference(startTime, endTime, pattern, bucketValue);
|
|
|
|
- String dataValueTime = attachRawData.getDataValueTime();
|
|
|
|
- if (dataType.toLowerCase().equals("boolean")) {
|
|
|
|
- List<Boolean> valueList = new ArrayList<>();
|
|
|
|
- List<Boolean> orgValueList = new ArrayList<>();
|
|
|
|
- List<String> valueTimeList = new ArrayList<>();
|
|
|
|
- Boolean dataBoolean = JSON.parseObject(attachRawData.getDataValue(), Boolean.class);
|
|
|
|
- Boolean orgBoolean = JSON.parseObject(attachRawData.getOrgDataValue(), Boolean.class);
|
|
|
|
- for (int i = 0; i < timeLength; i++) {
|
|
|
|
- valueList.add(dataBoolean);
|
|
|
|
- orgValueList.add(orgBoolean);
|
|
|
|
- valueTimeList.add(dataValueTime);
|
|
|
|
- }
|
|
|
|
- reportTableItemList.add(new ReportTableItem(
|
|
|
|
- reportTableId, itemId, valueType, xaxis, yaxis, standby,
|
|
|
|
- flage ? ArrayUtil.listToStr(valueList) : ArrayUtil.listToStr(orgValueList), ArrayUtil.listToStr(valueTimeList), null
|
|
|
|
- ));
|
|
|
|
- } else {
|
|
|
|
- try {
|
|
|
|
- List<BigDecimal> valueList = new ArrayList<>();
|
|
|
|
- List<BigDecimal> orgValueList = new ArrayList<>();
|
|
|
|
- List<String> valueTimeList = new ArrayList<>();
|
|
|
|
- BigDecimal dataBigDecimal = JSON.parseObject(attachRawData.getDataValue(), BigDecimal.class);
|
|
|
|
- BigDecimal orgBigDecimal = JSON.parseObject(attachRawData.getOrgDataValue(), BigDecimal.class);
|
|
|
|
- for (int i = 0; i < timeLength; i++) {
|
|
|
|
- valueList.add(dataBigDecimal);
|
|
|
|
- orgValueList.add(orgBigDecimal);
|
|
|
|
- valueTimeList.add(dataValueTime);
|
|
|
|
- }
|
|
|
|
- reportTableItemList.add(new ReportTableItem(
|
|
|
|
- reportTableId, itemId, valueType, xaxis, yaxis, standby,
|
|
|
|
- flage ? ArrayUtil.listToStr(valueList) : ArrayUtil.listToStr(orgValueList), ArrayUtil.listToStr(valueTimeList), null
|
|
|
|
- ));
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- List<String> valueList = new ArrayList<>();
|
|
|
|
- List<String> orgValueList = new ArrayList<>();
|
|
|
|
- List<String> valueTimeList = new ArrayList<>();
|
|
|
|
- String dataValue = attachRawData.getDataValue();
|
|
|
|
- String orgDataValue = attachRawData.getOrgDataValue();
|
|
|
|
- for (int i = 0; i < timeLength; i++) {
|
|
|
|
- valueList.add(dataValue);
|
|
|
|
- orgValueList.add(orgDataValue);
|
|
|
|
- valueTimeList.add(dataValueTime);
|
|
|
|
- }
|
|
|
|
- reportTableItemList.add(new ReportTableItem(
|
|
|
|
- reportTableId, itemId, valueType, xaxis, yaxis, standby,
|
|
|
|
- flage ? ArrayUtil.listToStr(valueList) : ArrayUtil.listToStr(orgValueList), ArrayUtil.listToStr(valueTimeList), null
|
|
|
|
- ));
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- reportTableItemList.add(new ReportTableItem(
|
|
|
|
- reportTableId, itemId, valueType, xaxis, yaxis, standby,
|
|
|
|
- flage ? attachRawData.getDataValue() : attachRawData.getOrgDataValue(), attachRawData.getDataValueTime(), null
|
|
|
|
- ));
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
String valueList = null;
|
|
String valueList = null;
|
|
String valueTimeList = null;
|
|
String valueTimeList = null;
|
|
String valueIndexList = null;
|
|
String valueIndexList = null;
|
|
@@ -817,72 +747,6 @@ public class ReportTableTask {
|
|
Integer itemId = ttci.getItemId();
|
|
Integer itemId = ttci.getItemId();
|
|
String itemName = ttci.getItemName();
|
|
String itemName = ttci.getItemName();
|
|
Integer dataSourceId = ttci.getDataSourceId();
|
|
Integer dataSourceId = ttci.getDataSourceId();
|
|
- Integer itemType = ttci.getItemType();
|
|
|
|
- if (itemType.equals(ConstantStr.ATTACH_ATTRIBUTES)) {
|
|
|
|
- AttachRawData attachRawData = rawDataDao.getAttachRawData(itemGroupId, dataSourceId, itemName);
|
|
|
|
- String dataType = attachRawData.getDataType();
|
|
|
|
- String pattern = null;
|
|
|
|
- if (bucketType.equals(ConstantStr.PERIOD_TIME_DAY)) {
|
|
|
|
- pattern = ConstantStr.TIME_DAY_STR;
|
|
|
|
- } else if (bucketType.equals(ConstantStr.PERIOD_TIME_HOUR)) {
|
|
|
|
- pattern = ConstantStr.TIME_HOUR_STR;
|
|
|
|
- } else if (bucketType.equals(ConstantStr.PERIOD_TIME_MINUTE)) {
|
|
|
|
- pattern = ConstantStr.TIME_MINUTE_STR;
|
|
|
|
- } else if (bucketType.equals(ConstantStr.PERIOD_TIME_SECOND)) {
|
|
|
|
- pattern = ConstantStr.TIME_SECOND_STR;
|
|
|
|
- }
|
|
|
|
- int timeLength = DateUtil.timeDifference(startTime, endTime, pattern, bucketValue);
|
|
|
|
- String dataValueTime = attachRawData.getDataValueTime();
|
|
|
|
- if (dataType.toLowerCase().equals("boolean")) {
|
|
|
|
- List<Boolean> valueList = new ArrayList<>();
|
|
|
|
- List<Boolean> orgValueList = new ArrayList<>();
|
|
|
|
- List<String> valueTimeList = new ArrayList<>();
|
|
|
|
- Boolean dataBoolean = JSON.parseObject(attachRawData.getDataValue(), Boolean.class);
|
|
|
|
- Boolean orgBoolean = JSON.parseObject(attachRawData.getOrgDataValue(), Boolean.class);
|
|
|
|
- for (int i = 0; i < timeLength; i++) {
|
|
|
|
- valueList.add(dataBoolean);
|
|
|
|
- orgValueList.add(orgBoolean);
|
|
|
|
- valueTimeList.add(dataValueTime);
|
|
|
|
- }
|
|
|
|
- reportChartItemList.add(new ReportChartItem(
|
|
|
|
- reportChartId, itemId, flage ? ArrayUtil.listToStr(valueList) : ArrayUtil.listToStr(orgValueList),
|
|
|
|
- ArrayUtil.listToStr(valueTimeList), null
|
|
|
|
- ));
|
|
|
|
- } else {
|
|
|
|
- try {
|
|
|
|
- List<BigDecimal> valueList = new ArrayList<>();
|
|
|
|
- List<BigDecimal> orgValueList = new ArrayList<>();
|
|
|
|
- List<String> valueTimeList = new ArrayList<>();
|
|
|
|
- BigDecimal dataBigDecimal = JSON.parseObject(attachRawData.getDataValue(), BigDecimal.class);
|
|
|
|
- BigDecimal orgBigDecimal = JSON.parseObject(attachRawData.getOrgDataValue(), BigDecimal.class);
|
|
|
|
- for (int i = 0; i < timeLength; i++) {
|
|
|
|
- valueList.add(dataBigDecimal);
|
|
|
|
- orgValueList.add(orgBigDecimal);
|
|
|
|
- valueTimeList.add(dataValueTime);
|
|
|
|
- }
|
|
|
|
- reportChartItemList.add(new ReportChartItem(
|
|
|
|
- reportChartId, itemId, flage ? ArrayUtil.listToStr(valueList) : ArrayUtil.listToStr(orgValueList),
|
|
|
|
- ArrayUtil.listToStr(valueTimeList), null
|
|
|
|
- ));
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- List<String> valueList = new ArrayList<>();
|
|
|
|
- List<String> orgValueList = new ArrayList<>();
|
|
|
|
- List<String> valueTimeList = new ArrayList<>();
|
|
|
|
- String dataValue = attachRawData.getDataValue();
|
|
|
|
- String orgDataValue = attachRawData.getOrgDataValue();
|
|
|
|
- for (int i = 0; i < timeLength; i++) {
|
|
|
|
- valueList.add(dataValue);
|
|
|
|
- orgValueList.add(orgDataValue);
|
|
|
|
- valueTimeList.add(dataValueTime);
|
|
|
|
- }
|
|
|
|
- reportChartItemList.add(new ReportChartItem(
|
|
|
|
- reportChartId, itemId, flage ? ArrayUtil.listToStr(valueList) : ArrayUtil.listToStr(orgValueList),
|
|
|
|
- ArrayUtil.listToStr(valueTimeList), null
|
|
|
|
- ));
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
String valueList = null;
|
|
String valueList = null;
|
|
String valueTimeList = null;
|
|
String valueTimeList = null;
|
|
String valueIndexList = null;
|
|
String valueIndexList = null;
|
|
@@ -1048,77 +912,11 @@ public class ReportTableTask {
|
|
String standby = t.getStandby();
|
|
String standby = t.getStandby();
|
|
String itemName = t.getItemName();
|
|
String itemName = t.getItemName();
|
|
Integer dataSourceId = t.getDataSourceId();
|
|
Integer dataSourceId = t.getDataSourceId();
|
|
- Integer itemType = t.getItemType();
|
|
|
|
Integer valueTakingMode = t.getValueTakingMode();
|
|
Integer valueTakingMode = t.getValueTakingMode();
|
|
Integer valueType = t.getValueType();
|
|
Integer valueType = t.getValueType();
|
|
Integer bucketType = t.getBucketType();
|
|
Integer bucketType = t.getBucketType();
|
|
Integer bucketValue = t.getBucketValue();
|
|
Integer bucketValue = t.getBucketValue();
|
|
boolean flage = valueType.equals(ConstantStr.CALCULATED_VALUE);
|
|
boolean flage = valueType.equals(ConstantStr.CALCULATED_VALUE);
|
|
- if (itemType.equals(ConstantStr.ATTACH_ATTRIBUTES)) {
|
|
|
|
- AttachRawData attachRawData = rawDataDao.getAttachRawData(itemGroupId, dataSourceId, itemName);
|
|
|
|
- String dataType = attachRawData.getDataType();
|
|
|
|
- String pattern = null;
|
|
|
|
- if (bucketType.equals(ConstantStr.PERIOD_TIME_DAY)) {
|
|
|
|
- pattern = ConstantStr.TIME_DAY_STR;
|
|
|
|
- } else if (bucketType.equals(ConstantStr.PERIOD_TIME_HOUR)) {
|
|
|
|
- pattern = ConstantStr.TIME_HOUR_STR;
|
|
|
|
- } else if (bucketType.equals(ConstantStr.PERIOD_TIME_MINUTE)) {
|
|
|
|
- pattern = ConstantStr.TIME_MINUTE_STR;
|
|
|
|
- } else if (bucketType.equals(ConstantStr.PERIOD_TIME_SECOND)) {
|
|
|
|
- pattern = ConstantStr.TIME_SECOND_STR;
|
|
|
|
- }
|
|
|
|
- int timeLength = DateUtil.timeDifference(startTime, endTime, pattern, bucketValue);
|
|
|
|
- String dataValueTime = attachRawData.getDataValueTime();
|
|
|
|
- if (dataType.toLowerCase().equals("boolean")) {
|
|
|
|
- List<Boolean> valueList = new ArrayList<>();
|
|
|
|
- List<Boolean> orgValueList = new ArrayList<>();
|
|
|
|
- List<String> valueTimeList = new ArrayList<>();
|
|
|
|
- Boolean dataBoolean = JSON.parseObject(attachRawData.getDataValue(), Boolean.class);
|
|
|
|
- Boolean orgBoolean = JSON.parseObject(attachRawData.getOrgDataValue(), Boolean.class);
|
|
|
|
- for (int i = 0; i < timeLength; i++) {
|
|
|
|
- valueList.add(dataBoolean);
|
|
|
|
- orgValueList.add(orgBoolean);
|
|
|
|
- valueTimeList.add(dataValueTime);
|
|
|
|
- }
|
|
|
|
- reportTableDao.addReportTableItem(new ReportTableItem(
|
|
|
|
- id, itemId, valueType, xaxis, yaxis, standby,
|
|
|
|
- flage ? ArrayUtil.listToStr(valueList) : ArrayUtil.listToStr(orgValueList), ArrayUtil.listToStr(valueTimeList), null
|
|
|
|
- ));
|
|
|
|
- } else {
|
|
|
|
- try {
|
|
|
|
- List<BigDecimal> valueList = new ArrayList<>();
|
|
|
|
- List<BigDecimal> orgValueList = new ArrayList<>();
|
|
|
|
- List<String> valueTimeList = new ArrayList<>();
|
|
|
|
- BigDecimal dataBigDecimal = JSON.parseObject(attachRawData.getDataValue(), BigDecimal.class);
|
|
|
|
- BigDecimal orgBigDecimal = JSON.parseObject(attachRawData.getOrgDataValue(), BigDecimal.class);
|
|
|
|
- for (int i = 0; i < timeLength; i++) {
|
|
|
|
- valueList.add(dataBigDecimal);
|
|
|
|
- orgValueList.add(orgBigDecimal);
|
|
|
|
- valueTimeList.add(dataValueTime);
|
|
|
|
- }
|
|
|
|
- reportTableDao.addReportTableItem(new ReportTableItem(
|
|
|
|
- id, itemId, valueType, xaxis, yaxis, standby,
|
|
|
|
- flage ? ArrayUtil.listToStr(valueList) : ArrayUtil.listToStr(orgValueList), ArrayUtil.listToStr(valueTimeList), null
|
|
|
|
- ));
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- List<String> valueList = new ArrayList<>();
|
|
|
|
- List<String> orgValueList = new ArrayList<>();
|
|
|
|
- List<String> valueTimeList = new ArrayList<>();
|
|
|
|
- String dataValue = attachRawData.getDataValue();
|
|
|
|
- String orgDataValue = attachRawData.getOrgDataValue();
|
|
|
|
- for (int i = 0; i < timeLength; i++) {
|
|
|
|
- valueList.add(dataValue);
|
|
|
|
- orgValueList.add(orgDataValue);
|
|
|
|
- valueTimeList.add(dataValueTime);
|
|
|
|
- }
|
|
|
|
- reportTableDao.addReportTableItem(new ReportTableItem(
|
|
|
|
- id, itemId, valueType, xaxis, yaxis, standby,
|
|
|
|
- flage ? ArrayUtil.listToStr(valueList) : ArrayUtil.listToStr(orgValueList), ArrayUtil.listToStr(valueTimeList), null
|
|
|
|
- ));
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
String valueList = null;
|
|
String valueList = null;
|
|
String valueTimeList = null;
|
|
String valueTimeList = null;
|
|
String valueIndexList = null;
|
|
String valueIndexList = null;
|
|
@@ -1194,72 +992,6 @@ public class ReportTableTask {
|
|
Integer itemId = ttci.getItemId();
|
|
Integer itemId = ttci.getItemId();
|
|
String itemName = ttci.getItemName();
|
|
String itemName = ttci.getItemName();
|
|
Integer dataSourceId = ttci.getDataSourceId();
|
|
Integer dataSourceId = ttci.getDataSourceId();
|
|
- Integer itemType = ttci.getItemType();
|
|
|
|
- if (itemType.equals(ConstantStr.ATTACH_ATTRIBUTES)) {
|
|
|
|
- AttachRawData attachRawData = rawDataDao.getAttachRawData(itemGroupId, dataSourceId, itemName);
|
|
|
|
- String dataType = attachRawData.getDataType();
|
|
|
|
- String pattern = null;
|
|
|
|
- if (bucketType.equals(ConstantStr.PERIOD_TIME_DAY)) {
|
|
|
|
- pattern = ConstantStr.TIME_DAY_STR;
|
|
|
|
- } else if (bucketType.equals(ConstantStr.PERIOD_TIME_HOUR)) {
|
|
|
|
- pattern = ConstantStr.TIME_HOUR_STR;
|
|
|
|
- } else if (bucketType.equals(ConstantStr.PERIOD_TIME_MINUTE)) {
|
|
|
|
- pattern = ConstantStr.TIME_MINUTE_STR;
|
|
|
|
- } else if (bucketType.equals(ConstantStr.PERIOD_TIME_SECOND)) {
|
|
|
|
- pattern = ConstantStr.TIME_SECOND_STR;
|
|
|
|
- }
|
|
|
|
- int timeLength = DateUtil.timeDifference(startTime, endTime, pattern, bucketValue);
|
|
|
|
- String dataValueTime = attachRawData.getDataValueTime();
|
|
|
|
- if (dataType.toLowerCase().equals("boolean")) {
|
|
|
|
- List<Boolean> valueList = new ArrayList<>();
|
|
|
|
- List<Boolean> orgValueList = new ArrayList<>();
|
|
|
|
- List<String> valueTimeList = new ArrayList<>();
|
|
|
|
- Boolean dataBoolean = JSON.parseObject(attachRawData.getDataValue(), Boolean.class);
|
|
|
|
- Boolean orgBoolean = JSON.parseObject(attachRawData.getOrgDataValue(), Boolean.class);
|
|
|
|
- for (int j = 0; j < timeLength; j++) {
|
|
|
|
- valueList.add(dataBoolean);
|
|
|
|
- orgValueList.add(orgBoolean);
|
|
|
|
- valueTimeList.add(dataValueTime);
|
|
|
|
- }
|
|
|
|
- reportChartItemList.add(new ReportChartItem(
|
|
|
|
- reportChartId, itemId, flage ? ArrayUtil.listToStr(valueList) : ArrayUtil.listToStr(orgValueList),
|
|
|
|
- ArrayUtil.listToStr(valueTimeList), null
|
|
|
|
- ));
|
|
|
|
- } else {
|
|
|
|
- try {
|
|
|
|
- List<BigDecimal> valueList = new ArrayList<>();
|
|
|
|
- List<BigDecimal> orgValueList = new ArrayList<>();
|
|
|
|
- List<String> valueTimeList = new ArrayList<>();
|
|
|
|
- BigDecimal dataBigDecimal = JSON.parseObject(attachRawData.getDataValue(), BigDecimal.class);
|
|
|
|
- BigDecimal orgBigDecimal = JSON.parseObject(attachRawData.getOrgDataValue(), BigDecimal.class);
|
|
|
|
- for (int j = 0; j < timeLength; j++) {
|
|
|
|
- valueList.add(dataBigDecimal);
|
|
|
|
- orgValueList.add(orgBigDecimal);
|
|
|
|
- valueTimeList.add(dataValueTime);
|
|
|
|
- }
|
|
|
|
- reportChartItemList.add(new ReportChartItem(
|
|
|
|
- reportChartId, itemId, flage ? ArrayUtil.listToStr(valueList) : ArrayUtil.listToStr(orgValueList),
|
|
|
|
- ArrayUtil.listToStr(valueTimeList), null
|
|
|
|
- ));
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- List<String> valueList = new ArrayList<>();
|
|
|
|
- List<String> orgValueList = new ArrayList<>();
|
|
|
|
- List<String> valueTimeList = new ArrayList<>();
|
|
|
|
- String dataValue = attachRawData.getDataValue();
|
|
|
|
- String orgDataValue = attachRawData.getOrgDataValue();
|
|
|
|
- for (int j = 0; j < timeLength; j++) {
|
|
|
|
- valueList.add(dataValue);
|
|
|
|
- orgValueList.add(orgDataValue);
|
|
|
|
- valueTimeList.add(dataValueTime);
|
|
|
|
- }
|
|
|
|
- reportChartItemList.add(new ReportChartItem(
|
|
|
|
- reportChartId, itemId, flage ? ArrayUtil.listToStr(valueList) : ArrayUtil.listToStr(orgValueList),
|
|
|
|
- ArrayUtil.listToStr(valueTimeList), null
|
|
|
|
- ));
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
String valueList = null;
|
|
String valueList = null;
|
|
String valueTimeList = null;
|
|
String valueTimeList = null;
|
|
String valueIndexList = null;
|
|
String valueIndexList = null;
|