| | |
| | | import com.iailab.module.model.api.mcs.dto.PreDataBarLineReqVO; |
| | | import com.iailab.module.model.api.mcs.dto.PreDataBarLineRespVO; |
| | | import com.iailab.module.model.common.enums.DataCategoryEnum; |
| | | import com.iailab.module.model.common.utils.DateUtils; |
| | | import com.iailab.module.model.mcs.sche.service.StSuggestSnapshotRecordService; |
| | | import com.iailab.module.model.mcs.sche.vo.StSuggestSnapshotRecordRespVO; |
| | | import com.mysql.cj.util.TimeUtil; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.text.DateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import static com.iailab.framework.common.pojo.CommonResult.success; |
| | | import static com.iailab.module.model.common.utils.DateUtils.DATE_TIME_PATTERN; |
| | | |
| | | /** |
| | | * @author Jay |
| | |
| | | queryDTO.setStart(item.getStartTime()); |
| | | queryDTO.setEnd(item.getEndTime()); |
| | | List<ApiPointValueDTO> valueList = dataPointApi.queryPointHistoryValue(queryDTO); |
| | | if (valueList != null && valueList.size() > 0){ |
| | | if (valueList != null && !valueList.isEmpty()){ |
| | | Object [][] data = new Object[valueList.size()][2]; |
| | | for (int i = 0; i < valueList.size(); i++){ |
| | | data[i][0] = valueList.get(i).getT(); |
| | | data[i][0] = DateUtils.format(new Date(String.valueOf(valueList.get(i).getT())),DATE_TIME_PATTERN); |
| | | data[i][1] = valueList.get(i).getV(); |
| | | } |
| | | dataList.add(data); |
| | |
| | | queryDTO.setStart(item.getStartTime()); |
| | | queryDTO.setEnd(item.getEndTime()); |
| | | List<ApiIndItemValueDTO> valueList = indItemApi.queryIndItemHistoryValue(queryDTO); |
| | | if (valueList != null && valueList.size() > 0){ |
| | | if (valueList != null && !valueList.isEmpty()){ |
| | | Object [][] data = new Object[valueList.size()][2]; |
| | | for (int i = 0; i < valueList.size(); i++){ |
| | | data[i][0] = valueList.get(i).getDataTime(); |
| | | data[i][0] = DateUtils.format(new Date(valueList.get(i).getDataTime()),DATE_TIME_PATTERN); |
| | | data[i][1] = valueList.get(i).getDataValue(); |
| | | } |
| | | dataList.add(data); |
| | |
| | | queryDTO.setStart(item.getStartTime()); |
| | | queryDTO.setEnd(item.getEndTime()); |
| | | List<ApiDataValueDTO> valueList = planItemApi.queryPlanItemHistoryValue(queryDTO); |
| | | if (valueList != null && valueList.size() > 0){ |
| | | if (valueList != null && !valueList.isEmpty()){ |
| | | Object [][] data = new Object[valueList.size()][2]; |
| | | for (int i = 0; i < valueList.size(); i++){ |
| | | data[i][0] = valueList.get(i).getDataTime(); |
| | | data[i][0] = DateUtils.format(valueList.get(i).getDataTime(),DATE_TIME_PATTERN); |
| | | data[i][1] = valueList.get(i).getDataValue(); |
| | | } |
| | | dataList.add(data); |
| | |
| | | } |
| | | List<String> xData = result.getCategories(); |
| | | List<Object[]> yData = new ArrayList<>(); |
| | | if ("N".equals(type)){ |
| | | if ("N".equals(type) && result.getDataViewList().get(0).getPreDataN()!=null){ |
| | | yData = result.getDataViewList().get(0).getPreDataN(); |
| | | }else if ("L".equals(type)){ |
| | | }else if ("L".equals(type) && result.getDataViewList().get(0).getPreDataL()!=null){ |
| | | yData = result.getDataViewList().get(0).getPreDataL(); |
| | | }else if ("C".equals(type)){ |
| | | }else if ("C".equals(type) && result.getDataViewList().get(0).getCurData()!=null){ |
| | | yData = result.getDataViewList().get(0).getCurData(); |
| | | } |
| | | Object [][] data = new Object[xData.size()][1]; |