| | |
| | | import com.iailab.framework.common.util.object.ConvertUtils; |
| | | import com.iailab.framework.excel.core.util.ExcelUtils; |
| | | import com.iailab.framework.tenant.core.context.TenantContextHolder; |
| | | import com.iailab.module.data.api.dto.DeviceValueDTO; |
| | | import com.iailab.module.data.api.dto.IndexQueryDTO; |
| | | import com.iailab.module.data.api.dto.echarts.BarLineDTO; |
| | | import com.iailab.module.data.api.dto.echarts.SeriesItem; |
| | |
| | | import com.iailab.module.data.api.point.dto.ApiPointsValueQueryDTO; |
| | | import com.iailab.module.data.common.ApiDataQueryDTO; |
| | | import com.iailab.module.data.common.ApiDataValueDTO; |
| | | import com.iailab.module.data.common.utils.ApiSecurityUtils; |
| | | import com.iailab.module.data.ind.collection.IndItemCollector; |
| | | import com.iailab.module.data.ind.item.vo.IndItemValueVO; |
| | | import com.iailab.module.data.plan.item.entity.PlanItemEntity; |
| | | import com.iailab.module.data.plan.item.service.PlanItemService; |
| | | import com.iailab.module.data.plan.item.vo.PlanItemValueExportVO; |
| | | import com.iailab.module.data.point.common.PointDataTypeEnum; |
| | | import com.iailab.module.data.point.dto.DaPointDTO; |
| | | import com.iailab.module.data.point.service.DaPointService; |
| | | import com.iailab.module.data.api.dto.DeviceValueDTO; |
| | | import com.iailab.module.data.common.utils.ApiSecurityUtils; |
| | | import com.iailab.module.data.plan.item.service.PlanItemService; |
| | | import com.iailab.module.data.point.vo.DaPointExcelVO; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.annotation.security.PermitAll; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | queryDto.setPointNo(item.getPointNo()); |
| | | List<ApiPointValueDTO> list = dataPointApi.queryPointHistoryValue(queryDto); |
| | | List<Object[]> sData = list.stream().map(dataItem -> { |
| | | Object[] valueArray = new Object[]{DateUtils.format(dataItem.getDataTime(), DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND), |
| | | getFormatValue(item.getDataType(), dataItem.getDataValue())}; |
| | | Object[] valueArray = new Object[]{DateUtils.format(dataItem.getT(), DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND), |
| | | getFormatValue(item.getDataType(), dataItem.getV())}; |
| | | return valueArray; |
| | | }).collect(Collectors.toList()); |
| | | seriesItem.setData(sData); |
| | |
| | | List<PlanItemValueExportVO> exportList = list.stream().map(item -> { |
| | | PlanItemValueExportVO exportVO = new PlanItemValueExportVO(); |
| | | exportVO.setDataTime(DateUtils.format(item.getDataTime(), DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)); |
| | | exportVO.setDataValue(new BigDecimal(item.getDataValue()).setScale(0, BigDecimal.ROUND_HALF_UP).toString()); |
| | | exportVO.setDataValue(BigDecimal.valueOf(item.getDataValue()).setScale(0, RoundingMode.HALF_UP).toString()); |
| | | return exportVO; |
| | | }).collect(Collectors.toList()); |
| | | ExcelUtils.write(response, "计划数据.xls", "计划数据", PlanItemValueExportVO.class, exportList); |