| | |
| | | import com.iailab.framework.common.util.date.DateUtils; |
| | | 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 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.*; |
| | |
| | | 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); |
| | |
| | | @PostMapping("/export-plan/history-value") |
| | | @Operation(summary = "导出计划数据") |
| | | public void exportPlanHistoryValue(HttpServletResponse response, HttpServletRequest |
| | | request, @RequestBody ApiDataQueryDTO dto) throws IOException { |
| | | //apiSecurityUtils.validate(request); |
| | | request, @RequestBody ApiDataQueryDTO dto) throws Exception { |
| | | apiSecurityUtils.validate(request); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.set(Calendar.MILLISECOND, 0); |
| | | calendar.set(Calendar.SECOND, 0); |
| | |
| | | @PermitAll |
| | | @GetMapping("/query-ind/default-value") |
| | | @Operation(summary = "查询指标默认值") |
| | | public CommonResult<List<ApiIndItemValueDTO>> queryIndItemDefaultValue(@RequestParam String itemNo) { |
| | | TenantContextHolder.setTenantId(161L); |
| | | public CommonResult<List<ApiIndItemValueDTO>> queryIndItemDefaultValue(HttpServletResponse response, HttpServletRequest |
| | | request,@RequestParam String itemNo) throws Exception { |
| | | apiSecurityUtils.validate(request); |
| | | List<IndItemValueVO> list = indItemCollector.queryValue(itemNo); |
| | | List<ApiIndItemValueDTO> dtoList = new ArrayList<>(); |
| | | list.forEach(item -> { |