Merge pull request #18 from Andy-Yin/develop1.0
Develop1.0
| | |
| | | import com.zhitan.basicdata.domain.FacilityArchives; |
| | | import com.zhitan.common.core.controller.BaseController; |
| | | import com.zhitan.common.core.domain.AjaxResult; |
| | | import com.zhitan.common.core.page.TableDataInfo; |
| | | import com.zhitan.keyequipment.domain.DailyKeyEquipment; |
| | | import com.zhitan.keyequipment.service.IDailyKeyEquipmentService; |
| | | import com.zhitan.model.domain.EnergyIndex; |
| | |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "éç¹è®¾å¤è½èåæï¼æ¥ï¼å表") |
| | | public TableDataInfo list(DataItem dataItem) throws ParseException { |
| | | public AjaxResult list(DataItem dataItem) throws ParseException { |
| | | List<ModelNode> nodeId = modelNodeService.getModelNodeByModelCode(dataItem.getIndexCode()); |
| | | if(CollectionUtils.isEmpty(nodeId)){ |
| | | return getDataTable(new ArrayList<>()); |
| | | return success(new ArrayList<>()); |
| | | } |
| | | List<EnergyIndex> energyList = modelNodeService.getSettingIndex(nodeId.get(0).getNodeId()); |
| | | if(CollectionUtils.isEmpty(energyList)){ |
| | | return getDataTable(new ArrayList<>()); |
| | | return success(new ArrayList<>()); |
| | | } |
| | | List<String> indexIds = energyList.stream().map(EnergyIndex::getIndexId).collect(Collectors.toList()); |
| | | List<DailyKeyEquipment> dataList=new ArrayList<>(); |
| | |
| | | dataList.add(report); |
| | | i++; |
| | | }; |
| | | startPage(); |
| | | |
| | | List<DailyKeyEquipment> list = dailykeyEquipment.getdailyKeyEquipmentList(indexIds, dataList,dataItem.getBeginTime(),dataItem.getEndTime(), dataItem.getTimeType(),dataItem.getEnergyType()); |
| | | return getDataTable(list); |
| | | |
| | | return success(list); |
| | | } |
| | | |
| | | @GetMapping("/listChart") |
| | |
| | | } |
| | | /*ææè®¾å¤*/ |
| | | @GetMapping("/getFacilityArchives") |
| | | @ApiOperation(value = "æ¥è¯¢ææè®¾å¤å表") |
| | | @ApiOperation(value = "æ¥è¯¢éç¹è®¾å¤å表") |
| | | public AjaxResult getFacilityArchives() { |
| | | try { |
| | | List<FacilityArchives> list=dailykeyEquipment.getFacilityArchives(); |
| | |
| | | package com.zhitan.web.controller.keyequipment; |
| | | |
| | | |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.zhitan.common.core.controller.BaseController; |
| | | import com.zhitan.common.core.domain.AjaxResult; |
| | | import com.zhitan.keyequipment.domain.MonthlyKeyEquipment; |
| | |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | *éç¹è®¾å¤è½èç»è®¡ æ |
| | | * éç¹è®¾å¤è½èç»è®¡ æ |
| | | * |
| | | * @author sys |
| | | * @date 2021-01-11 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/keyEquipment/MonthlyKeyEquipment") |
| | | @Api(value = "éç¹è®¾å¤è½èç»è®¡ï¼æï¼",tags = {"设å¤åèåæ"}) |
| | | @Api(value = "éç¹è®¾å¤è½èç»è®¡ï¼æï¼", tags = {"设å¤åèåæ"}) |
| | | public class MonthlyKeyEquipmentController extends BaseController { |
| | | |
| | | @Autowired |
| | |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "éç¹è®¾å¤è½èç»è®¡ï¼æï¼å表") |
| | | public AjaxResult list(DataItem dataItem) { |
| | | try { |
| | | List<MonthlyKeyEquipment> dataList=new ArrayList<>(); |
| | | public AjaxResult list(DataItem dataItem) throws ParseException { |
| | | List<MonthlyKeyEquipment> dataList = new ArrayList<>(); |
| | | |
| | | Map tableColumn =new HashMap<>();//è¡¨æ°æ® |
| | | DateFormat df = new SimpleDateFormat("yyyy-MM"); |
| | | SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String aa= df.format(dataItem.getDataTime()); |
| | | String bb=""; |
| | | int i = 1; |
| | | String beginTime=aa+"-01 00:00:00"; |
| | | dataItem.setBeginTime(sf.parse(beginTime)); |
| | | String endTime=aa+"-"+Integer.valueOf(getLastDayOfMonth(aa).substring(getLastDayOfMonth(aa).length()-2))+" 00:00:00"; |
| | | dataItem.setEndTime(sf.parse(endTime)); |
| | | while (i <= Integer.valueOf(getLastDayOfMonth(aa).substring(getLastDayOfMonth(aa).length()-2))) { |
| | | if(i>9){ |
| | | bb=aa+"-"+i+" 00:00:00"; |
| | | }else{ |
| | | bb=aa+"-0"+i+" 00:00:00"; |
| | | } |
| | | MonthlyKeyEquipment report=new MonthlyKeyEquipment(); |
| | | report.setDataTime(sf.parse(bb)); |
| | | report.setValue("value"+i); |
| | | dataList.add(report); |
| | | tableColumn.put("value"+i,String.valueOf(i)+"æ¥"); |
| | | i++; |
| | | Map tableColumn = new HashMap<>();//è¡¨æ°æ® |
| | | DateFormat df = new SimpleDateFormat("yyyy-MM"); |
| | | SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String aa = df.format(dataItem.getDataTime()); |
| | | String bb = ""; |
| | | int i = 1; |
| | | String beginTime = aa + "-01 00:00:00"; |
| | | dataItem.setBeginTime(sf.parse(beginTime)); |
| | | String endTime = aa + "-" + Integer.valueOf(getLastDayOfMonth(aa).substring(getLastDayOfMonth(aa).length() - 2)) + " 00:00:00"; |
| | | dataItem.setEndTime(sf.parse(endTime)); |
| | | while (i <= Integer.valueOf(getLastDayOfMonth(aa).substring(getLastDayOfMonth(aa).length() - 2))) { |
| | | if (i > 9) { |
| | | bb = aa + "-" + i + " 00:00:00"; |
| | | } else { |
| | | bb = aa + "-0" + i + " 00:00:00"; |
| | | } |
| | | List<Map> table=new ArrayList<>(); |
| | | MonthlyKeyEquipment reportList =new MonthlyKeyEquipment(); |
| | | table.add(tableColumn); |
| | | reportList.setTablehead(table); |
| | | List<ModelNode> nodeId = modelNodeService.getModelNodeByModelCode(dataItem.getIndexCode()); |
| | | if(CollectionUtils.isEmpty(nodeId)){ |
| | | return AjaxResult.success(reportList); |
| | | } |
| | | List<EnergyIndex> energyList = modelNodeService.getSettingIndex(nodeId.get(0).getNodeId()); |
| | | if(CollectionUtils.isEmpty(energyList)){ |
| | | return AjaxResult.success(reportList); |
| | | } |
| | | List<String> indexIds = energyList.stream().map(EnergyIndex::getIndexId).collect(Collectors.toList()); |
| | | |
| | | startPage(); |
| | | List<MonthlyKeyEquipment> list = monthlyKeyEquipmentService.getMonthlyKeyEquipmentList(indexIds, dataList,dataItem.getBeginTime(),dataItem.getEndTime(), dataItem.getTimeType(),dataItem.getEnergyType()); |
| | | int count=Integer.valueOf(getLastDayOfMonth(aa).substring(getLastDayOfMonth(aa).length()-2)); |
| | | list.forEach(monthlyReport -> monthlyReport.setCount(count)); |
| | | reportList.setTabledata(list); |
| | | reportList.setTotal(new PageInfo(list).getTotal()); |
| | | |
| | | return AjaxResult.success(reportList); |
| | | } catch (Exception ex) { |
| | | logger.error("è·ååºéï¼", ex); |
| | | return AjaxResult.error("è·ååºé!"); |
| | | MonthlyKeyEquipment report = new MonthlyKeyEquipment(); |
| | | report.setDataTime(sf.parse(bb)); |
| | | report.setValue("value" + i); |
| | | dataList.add(report); |
| | | tableColumn.put("value" + i, String.valueOf(i) + "æ¥"); |
| | | i++; |
| | | } |
| | | List<Map> table = new ArrayList<>(); |
| | | MonthlyKeyEquipment reportList = new MonthlyKeyEquipment(); |
| | | table.add(tableColumn); |
| | | reportList.setTablehead(table); |
| | | List<ModelNode> nodeId = modelNodeService.getModelNodeByModelCode(dataItem.getIndexCode()); |
| | | if (CollectionUtils.isEmpty(nodeId)) { |
| | | return success(new ArrayList<>()); |
| | | } |
| | | List<EnergyIndex> energyList = modelNodeService.getSettingIndex(nodeId.get(0).getNodeId()); |
| | | if (CollectionUtils.isEmpty(energyList)) { |
| | | return success(new ArrayList<>()); |
| | | } |
| | | List<String> indexIds = energyList.stream().map(EnergyIndex::getIndexId).collect(Collectors.toList()); |
| | | |
| | | List<MonthlyKeyEquipment> list = monthlyKeyEquipmentService.getMonthlyKeyEquipmentList(indexIds, dataList, dataItem.getBeginTime(), dataItem.getEndTime(), dataItem.getTimeType(), dataItem.getEnergyType()); |
| | | |
| | | return success(list); |
| | | } |
| | | |
| | | @GetMapping("/listChart") |
| | |
| | | public AjaxResult listChart(DataItem dataItem) throws ParseException { |
| | | DateFormat df = new SimpleDateFormat("yyyy-MM"); |
| | | SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String aa= df.format(dataItem.getDataTime()); |
| | | String beginTime=aa+"-01 00:00:00"; |
| | | String aa = df.format(dataItem.getDataTime()); |
| | | String beginTime = aa + "-01 00:00:00"; |
| | | dataItem.setBeginTime(sf.parse(beginTime)); |
| | | String endTime=aa+"-"+Integer.valueOf(getLastDayOfMonth(aa).substring(getLastDayOfMonth(aa).length()-2))+" 00:00:00"; |
| | | String endTime = aa + "-" + Integer.valueOf(getLastDayOfMonth(aa).substring(getLastDayOfMonth(aa).length() - 2)) + " 00:00:00"; |
| | | dataItem.setEndTime(sf.parse(endTime)); |
| | | List<MonthlyKeyEquipment> list = monthlyKeyEquipmentService.getListChart(dataItem.getIndexId(),dataItem.getBeginTime(),dataItem.getEndTime(), dataItem.getTimeType(),dataItem.getEnergyType()); |
| | | List<MonthlyKeyEquipment> list = monthlyKeyEquipmentService.getListChart(dataItem.getIndexId(), dataItem.getBeginTime(), dataItem.getEndTime(), dataItem.getTimeType(), dataItem.getEnergyType()); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | public static String getLastDayOfMonth(String yearMonth) { |
| | | int year = Integer.parseInt(yearMonth.split("-")[0]); //å¹´ |
| | | int month = Integer.parseInt(yearMonth.split("-")[1]); //æ |
| | |
| | | package com.zhitan.web.controller.keyequipment; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.zhitan.common.core.controller.BaseController; |
| | | import com.zhitan.common.core.domain.AjaxResult; |
| | | import com.zhitan.common.core.page.TableDataInfo; |
| | | import com.zhitan.common.utils.DateTimeUtil; |
| | | import com.zhitan.common.utils.TypeTime; |
| | | import com.zhitan.keyequipment.domain.YearKeyEquipment; |
| | | import com.zhitan.keyequipment.service.IYearKeyEquipmentService; |
| | | import com.zhitan.model.domain.EnergyIndex; |
| | | import com.zhitan.model.domain.ModelNode; |
| | | import com.zhitan.model.service.IModelNodeService; |
| | | import com.zhitan.realtimedata.domain.DataItem; |
| | | import com.zhitan.realtimedata.domain.dto.DataItemQueryDTO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.text.DateFormat; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | *éç¹è®¾å¤è½èç»è®¡ å¹´ |
| | | * |
| | |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "éç¹è®¾å¤è½èç»è®¡ï¼å¹´ï¼å表") |
| | | public TableDataInfo list(DataItem dataItem) throws ParseException { |
| | | public AjaxResult list(DataItem dataItem) throws ParseException { |
| | | List<ModelNode> nodeId = modelNodeService.getModelNodeByModelCode(dataItem.getIndexCode()); |
| | | if(CollectionUtils.isEmpty(nodeId)){ |
| | | return getDataTable(new ArrayList<>()); |
| | | return success(new ArrayList<>()); |
| | | } |
| | | List<EnergyIndex> energyList = modelNodeService.getSettingIndex(nodeId.get(0).getNodeId()); |
| | | if(CollectionUtils.isEmpty(energyList)){ |
| | | return getDataTable(new ArrayList<>()); |
| | | return success(new ArrayList<>()); |
| | | } |
| | | List<String> indexIds = energyList.stream().map(EnergyIndex::getIndexId).collect(Collectors.toList()); |
| | | List<YearKeyEquipment> dataList=new ArrayList<>(); |
| | | |
| | | dataItem.setBeginTime(DateUtil.beginOfYear(dataItem.getDataTime())); |
| | | dataItem.setEndTime(DateUtil.endOfYear(dataItem.getDataTime())); |
| | | |
| | | DateFormat df = new SimpleDateFormat("yyyy"); |
| | | SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String aa= df.format(dataItem.getDataTime()); |
| | | String bb=""; |
| | | int i = 1; |
| | | while (i <= 12) { |
| | | if(i>9){ |
| | | bb=aa+"-"+i+"-01 00:00:00"; |
| | | }else{ |
| | | bb=aa+"-0"+i+"-01 00:00:00"; |
| | | } |
| | | YearKeyEquipment report=new YearKeyEquipment(); |
| | | report.setDataTime(sf.parse(bb)); |
| | | report.setValue("value"+i); |
| | | dataList.add(report); |
| | | i++; |
| | | } |
| | | startPage(); |
| | | List<YearKeyEquipment> list = yearKeyEquipmentService.getYearKeyEquipmentList(indexIds, dataList,dataItem.getBeginTime(),dataItem.getEndTime(), dataItem.getTimeType(),dataItem.getEnergyType()); |
| | | return getDataTable(list); |
| | | Date convertTime = DateTimeUtil.getEndTimeByType(dataItem.getTimeType(),dataItem.getDataTime()); |
| | | DateTime beginTime = DateUtil.beginOfYear(convertTime); |
| | | DateTime endTime = DateUtil.endOfYear(convertTime); |
| | | List<TypeTime> typeTimeList = DateTimeUtil.getDateTimeList(dataItem.getTimeType(),convertTime); |
| | | List<YearKeyEquipment> list = yearKeyEquipmentService.getYearKeyEquipmentList(indexIds, typeTimeList,beginTime,endTime, dataItem.getTimeType(),dataItem.getEnergyType()); |
| | | return success(list); |
| | | } |
| | | |
| | | @GetMapping("/listChart") |
| | | @ApiOperation(value = "éç¹è®¾å¤è½èç»è®¡ï¼å¹´ï¼å¾è¡¨") |
| | | public AjaxResult listChart(DataItem dataItem){ |
| | | public AjaxResult listChart(DataItemQueryDTO queryDto){ |
| | | |
| | | List<YearKeyEquipment> list = yearKeyEquipmentService.getListChart(dataItem.getIndexId(),dataItem.getBeginTime(),dataItem.getEndTime(), dataItem.getTimeType(),dataItem.getEnergyType()); |
| | | List<YearKeyEquipment> list = yearKeyEquipmentService.getListChart(queryDto); |
| | | return AjaxResult.success(list); |
| | | } |
| | | } |
| | |
| | | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.GregorianCalendar; |
| | | |
| | | import java.util.*; |
| | | /** |
| | | * @Description: æ¶é´å·¥å
·ç±» |
| | | * @author: yxw |
| | |
| | | } |
| | | return momDate; |
| | | } |
| | | public static List<TypeTime> getDateTimeList(String timeType,Date dataTime){ |
| | | List<TypeTime> resultlist = new ArrayList<>(); |
| | | Date beginTime = DateUtil.beginOfDay(dataTime); |
| | | switch (timeType){ |
| | | case TimeTypeConst.TIME_TYPE_DAY: |
| | | for(int i = 0;i<24;i++){ |
| | | TypeTime typeTime = new TypeTime(); |
| | | typeTime.setDataTime(DateUtil.format(beginTime,COMMON_PATTERN)); |
| | | typeTime.setDateTime(DateTimeUtil.toDateTime(typeTime.getDataTime())); |
| | | typeTime.setTimeCode(CommonConst.WORD_H + DateUtil.format(beginTime,COMMON_PATTERN_HOUR)); |
| | | typeTime.setValue("value" + i); |
| | | resultlist.add(typeTime); |
| | | beginTime = addHours(beginTime,1); |
| | | } |
| | | break; |
| | | case TimeTypeConst.TIME_TYPE_MONTH: |
| | | for(int i = 0;i<31;i++){ |
| | | TypeTime typeTime = new TypeTime(); |
| | | typeTime.setDataTime(DateUtil.format(beginTime,COMMON_PATTERN)); |
| | | typeTime.setTimeCode(CommonConst.WORD_D + DateUtil.format(beginTime,COMMON_PATTERN_DAY)); |
| | | typeTime.setValue("value" + i); |
| | | resultlist.add(typeTime); |
| | | beginTime = addHours(beginTime,1); |
| | | } |
| | | break; |
| | | case TimeTypeConst.TIME_TYPE_YEAR: |
| | | for(int i = 0;i<12;i++){ |
| | | TypeTime typeTime = new TypeTime(); |
| | | typeTime.setDataTime(DateUtil.format(beginTime,COMMON_PATTERN)); |
| | | typeTime.setTimeCode(CommonConst.WORD_M + DateUtil.format(beginTime,COMMON_PATTERN_MONTH)); |
| | | typeTime.setValue("value" + i); |
| | | resultlist.add(typeTime); |
| | | beginTime = addHours(beginTime,1); |
| | | } |
| | | break; |
| | | } |
| | | return resultlist; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.common.utils; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * [ |
| | | * {"dataTime":"2025-01-01 00:00:00","value":"value0"} |
| | | * {"dataTime":"2025-02-01 00:00:00","value":"value1"} |
| | | * {"dataTime":"2025-03-01 00:00:00","value":"value2"} |
| | | * {"dataTime":"2025-04-01 00:00:00","value":"value3"} |
| | | * {"dataTime":"2025-05-01 00:00:00","value":"value4"} |
| | | * {"dataTime":"2025-06-01 00:00:00","value":"value5"} |
| | | * {"dataTime":"2025-07-01 00:00:00","value":"value6"} |
| | | * {"dataTime":"2025-08-01 00:00:00","value":"value7"} |
| | | * {"dataTime":"2025-09-01 00:00:00","value":"value8"} |
| | | * {"dataTime":"2025-10-01 00:00:00","value":"value9"} |
| | | * {"dataTime":"2025-11-01 00:00:00","value":"value10"} |
| | | * {"dataTime":"2025-12-01 00:00:00","value":"value11"} |
| | | * } |
| | | */ |
| | | @Data |
| | | public class TypeTime { |
| | | private String dataTime; |
| | | private String value; |
| | | private String timeCode; |
| | | |
| | | private Date dateTime; |
| | | } |
| | |
| | | package com.zhitan.comprehensivestatistics.mapper; |
| | | |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.comprehensivestatistics.domain.DailyComprehensive; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | @Param("dataList") List<DailyComprehensive> dataList, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") TimeType timeType, |
| | | @Param("timeType") String timeType, |
| | | @Param("indexStorageId") String indexStorageId); |
| | | |
| | | List<DailyComprehensive> getListChart(@Param("indexId") String indexId, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") TimeType timeType, |
| | | @Param("timeType") String timeType, |
| | | @Param("indexStorageId") String indexStorageId); |
| | | |
| | | } |
| | |
| | | package com.zhitan.comprehensivestatistics.mapper; |
| | | |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.comprehensivestatistics.domain.MonthlyComprehensive; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | @Param("dataList") List<MonthlyComprehensive> dataList, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") TimeType timeType, |
| | | @Param("timeType") String timeType, |
| | | @Param("indexStorageId") String indexStorageId); |
| | | |
| | | /** |
| | |
| | | List<MonthlyComprehensive> getListChart(@Param("indexId") String indexId, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") TimeType timeType, |
| | | @Param("timeType") String timeType, |
| | | @Param("indexStorageId") String indexStorageId); |
| | | |
| | | } |
| | |
| | | package com.zhitan.comprehensivestatistics.mapper; |
| | | |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.comprehensivestatistics.domain.YearComperhensive; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | @Param("dataList") List<YearComperhensive> dataList, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") TimeType timeType, |
| | | @Param("timeType") String timeType, |
| | | @Param("indexStorageId") String indexStorageId); |
| | | |
| | | /** |
| | |
| | | List<YearComperhensive> getListChart(@Param("indexId") String indexId, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") TimeType timeType, |
| | | @Param("timeType") String timeType, |
| | | @Param("indexStorageId") String indexStorageId); |
| | | |
| | | } |
| | |
| | | package com.zhitan.comprehensivestatistics.service; |
| | | |
| | | |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.comprehensivestatistics.domain.DailyComprehensive; |
| | | |
| | | import java.util.Date; |
| | |
| | | * @date 2020-03-25 |
| | | */ |
| | | public interface IDailyComprehensiveService { |
| | | public List<DailyComprehensive> getDailyComprehensiveList(String nodeId, List<DailyComprehensive> dataList, Date beginTime, Date endTime, TimeType timeType, String indexStorageId); |
| | | List<DailyComprehensive> getListChart(String indexId, Date beginTime, Date endTime, TimeType timeType, String indexStorageId); |
| | | public List<DailyComprehensive> getDailyComprehensiveList(String nodeId, List<DailyComprehensive> dataList, Date beginTime, Date endTime, String timeType, String indexStorageId); |
| | | List<DailyComprehensive> getListChart(String indexId, Date beginTime, Date endTime, String timeType, String indexStorageId); |
| | | } |
| | |
| | | package com.zhitan.comprehensivestatistics.service; |
| | | |
| | | |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.comprehensivestatistics.domain.MonthlyComprehensive; |
| | | |
| | | import java.util.Date; |
| | |
| | | * @param indexStorageId |
| | | * @return |
| | | */ |
| | | List<MonthlyComprehensive> getMonthlyComprehensiveList(String nodeId, List<MonthlyComprehensive> dataList, Date beginTime, Date endTime, TimeType timeType, String indexStorageId); |
| | | List<MonthlyComprehensive> getMonthlyComprehensiveList(String nodeId, List<MonthlyComprehensive> dataList, Date beginTime, Date endTime, String timeType, String indexStorageId); |
| | | |
| | | /** |
| | | * å
¨å综åè½èç»è®¡ æ |
| | |
| | | * @param indexStorageId |
| | | * @return |
| | | */ |
| | | List<MonthlyComprehensive> getListChart(String indexId, Date beginTime, Date endTime, TimeType timeType, String indexStorageId); |
| | | List<MonthlyComprehensive> getListChart(String indexId, Date beginTime, Date endTime, String timeType, String indexStorageId); |
| | | } |
| | |
| | | package com.zhitan.comprehensivestatistics.service; |
| | | |
| | | |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.comprehensivestatistics.domain.YearComperhensive; |
| | | |
| | | import java.util.Date; |
| | |
| | | * @return |
| | | */ |
| | | List<YearComperhensive> getYearComprehensiveList(String nodeId, List<YearComperhensive> dataList, |
| | | Date beginTime, Date endTime, TimeType timeType, String indexStorageId); |
| | | Date beginTime, Date endTime, String timeType, String indexStorageId); |
| | | |
| | | /** |
| | | * è·åç»¼åææ åæï¼å¹´ï¼å¾è¡¨æ°æ® |
| | |
| | | * @param indexStorageId |
| | | * @return |
| | | */ |
| | | List<YearComperhensive> getListChart(String indexId, Date beginTime, Date endTime, TimeType timeType, String indexStorageId); |
| | | List<YearComperhensive> getListChart(String indexId, Date beginTime, Date endTime, String timeType, String indexStorageId); |
| | | } |
| | |
| | | package com.zhitan.comprehensivestatistics.service.impl; |
| | | |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.comprehensivestatistics.domain.DailyComprehensive; |
| | | import com.zhitan.comprehensivestatistics.mapper.DailyComprehensiveMapper; |
| | | import com.zhitan.comprehensivestatistics.service.IDailyComprehensiveService; |
| | |
| | | private DailyComprehensiveMapper dailyMapper; |
| | | |
| | | public List<DailyComprehensive> getDailyComprehensiveList(String nodeId, List<DailyComprehensive> dataList, |
| | | Date beginTime, Date endTime, TimeType timeType, String indexStorageId){ |
| | | Date beginTime, Date endTime, String timeType, String indexStorageId){ |
| | | |
| | | if (StringUtils.isNotEmpty(nodeId)) { |
| | | return dailyMapper.getDailyComprehensiveList(nodeId, dataList, beginTime, endTime, timeType, indexStorageId); |
| | |
| | | return Collections.emptyList(); |
| | | } |
| | | @Override |
| | | public List<DailyComprehensive> getListChart(String indexId, Date beginTime, Date endTime, TimeType timeType, String indexStorageId){ |
| | | public List<DailyComprehensive> getListChart(String indexId, Date beginTime, Date endTime, String timeType, String indexStorageId){ |
| | | if (indexId != null && !indexId.isEmpty()) { |
| | | return dailyMapper.getListChart(indexId,beginTime,endTime,timeType,indexStorageId); |
| | | } |
| | |
| | | package com.zhitan.comprehensivestatistics.service.impl; |
| | | |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.comprehensivestatistics.domain.MonthlyComprehensive; |
| | | import com.zhitan.comprehensivestatistics.mapper.MonthlyComprehensiveMapper; |
| | | import com.zhitan.comprehensivestatistics.service.ImonthlyComprehensive; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | private MonthlyComprehensiveMapper monthMapper; |
| | | |
| | | public List<MonthlyComprehensive> getMonthlyComprehensiveList(String nodeId, List<MonthlyComprehensive> dataList, |
| | | Date beginTime, Date endTime, TimeType timeType, String indexStorageId){ |
| | | Date beginTime, Date endTime, String timeType, String indexStorageId){ |
| | | if (StringUtils.isNotEmpty(nodeId)) { |
| | | return monthMapper.getMonthlyComprehensiveList(nodeId, dataList, beginTime, endTime, timeType, indexStorageId); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<MonthlyComprehensive> getListChart(String indexId, Date beginTime, Date endTime, TimeType timeType, String indexStorageId){ |
| | | public List<MonthlyComprehensive> getListChart(String indexId, Date beginTime, Date endTime, String timeType, String indexStorageId){ |
| | | if (indexId != null && !indexId.isEmpty()) { |
| | | return monthMapper.getListChart(indexId,beginTime,endTime,timeType,indexStorageId); |
| | | } |
| | |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.zhitan.common.constant.CommonConst; |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.common.utils.DateTimeUtil; |
| | | import com.zhitan.comprehensivestatistics.domain.YearComperhensive; |
| | | import com.zhitan.comprehensivestatistics.mapper.YearComprehensiveMapper; |
| | |
| | | |
| | | @Override |
| | | public List<YearComperhensive> getYearComprehensiveList(String nodeId, List<YearComperhensive> dataList, |
| | | Date beginTime, Date endTime, TimeType timeType, String indexStorageId){ |
| | | Date beginTime, Date endTime, String timeType, String indexStorageId){ |
| | | if (StringUtils.isNotEmpty(nodeId)) { |
| | | return yearMapper.getYearComprehensiveList(nodeId, dataList, beginTime, endTime, timeType, indexStorageId); |
| | | } |
| | | return Collections.emptyList(); |
| | | } |
| | | @Override |
| | | public List<YearComperhensive> getListChart(String indexId, Date beginTime, Date endTime, TimeType timeType, String indexStorageId){ |
| | | public List<YearComperhensive> getListChart(String indexId, Date beginTime, Date endTime, String timeType, String indexStorageId){ |
| | | List<YearComperhensive> dataList = new ArrayList<>(); |
| | | if (StringUtils.isNotEmpty(indexId)) { |
| | | List<YearComperhensive> listChart = yearMapper.getListChart(indexId, beginTime, endTime, timeType, indexStorageId); |
| | |
| | | } else { |
| | | yearComperhensive.setTimeCode(format); |
| | | yearComperhensive.setIndexId(indexId); |
| | | yearComperhensive.setTimeType(timeType.name()); |
| | | yearComperhensive.setTimeType(timeType); |
| | | yearComperhensive.setUnitId(first.getUnitId()); |
| | | yearComperhensive.setIndexName(first.getIndexName()); |
| | | } |
| | |
| | | package com.zhitan.keyequipment.mapper; |
| | | |
| | | import com.zhitan.basicdata.domain.FacilityArchives; |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.keyequipment.domain.DailyKeyEquipment; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | @Param("dataList") List<DailyKeyEquipment> dataList, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") TimeType timeType, |
| | | @Param("timeType") String timeType, |
| | | @Param("indexStorageId") String indexStorageId); |
| | | List<DailyKeyEquipment> getListChart(@Param("indexId") String indexId, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") TimeType timeType, |
| | | @Param("timeType") String timeType, |
| | | @Param("indexStorageId") String indexStorageId); |
| | | List<FacilityArchives> getFacilityArchives(); |
| | | List<FacilityArchives> getPointFacility(); |
| | |
| | | package com.zhitan.keyequipment.mapper; |
| | | |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.keyequipment.domain.MonthlyKeyEquipment; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | @Param("dataList") List<MonthlyKeyEquipment> dataList, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") TimeType timeType, |
| | | @Param("timeType") String timeType, |
| | | @Param("indexStorageId") String indexStorageId); |
| | | List<MonthlyKeyEquipment> getListChart(@Param("indexId") String indexId, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") TimeType timeType, |
| | | @Param("timeType") String timeType, |
| | | @Param("indexStorageId") String indexStorageId); |
| | | |
| | | } |
| | |
| | | package com.zhitan.keyequipment.mapper; |
| | | |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.common.utils.TypeTime; |
| | | import com.zhitan.keyequipment.domain.YearKeyEquipment; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | */ |
| | | public interface YearKeyEquipmentMapper { |
| | | public List<YearKeyEquipment> getYearKeyEquipmentList(@Param("indexIds") List<String> indexIds, |
| | | @Param("dataList") List<YearKeyEquipment> dataList, |
| | | @Param("dataList") List<TypeTime> dataList, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") TimeType timeType, |
| | | @Param("timeType") String timeType, |
| | | @Param("indexStorageId") String indexStorageId); |
| | | List<YearKeyEquipment> getListChart(@Param("indexId") String indexId, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") TimeType timeType, |
| | | @Param("indexStorageId") String indexStorageId); |
| | | @Param("timeType") String timeType |
| | | ); |
| | | |
| | | } |
| | |
| | | package com.zhitan.keyequipment.service; |
| | | |
| | | import com.zhitan.basicdata.domain.FacilityArchives; |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.keyequipment.domain.DailyKeyEquipment; |
| | | |
| | | import java.util.Date; |
| | |
| | | * @date 2021-01-11 |
| | | */ |
| | | public interface IDailyKeyEquipmentService { |
| | | public List<DailyKeyEquipment> getdailyKeyEquipmentList(List<String> indexIds, List<DailyKeyEquipment> dataList, Date beginTime, Date endTime, TimeType timeType, String indexStorageId); |
| | | public List<DailyKeyEquipment> getListChart(String indexId, Date beginTime, Date endTime, TimeType timeType, String indexStorageId); |
| | | public List<DailyKeyEquipment> getdailyKeyEquipmentList(List<String> indexIds, List<DailyKeyEquipment> dataList, Date beginTime, Date endTime, String timeType, String indexStorageId); |
| | | public List<DailyKeyEquipment> getListChart(String indexId, Date beginTime, Date endTime, String timeType, String indexStorageId); |
| | | public List<FacilityArchives> getFacilityArchives(); |
| | | public List<FacilityArchives> getPointFacility(); |
| | | } |
| | |
| | | package com.zhitan.keyequipment.service; |
| | | |
| | | |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.keyequipment.domain.MonthlyKeyEquipment; |
| | | |
| | | import java.util.Date; |
| | |
| | | * @date 2021-01-11 |
| | | */ |
| | | public interface IMonthlyKeyEquipmentService { |
| | | public List<MonthlyKeyEquipment> getMonthlyKeyEquipmentList(List<String> indexIds, List<MonthlyKeyEquipment> dataList, Date beginTime, Date endTime, TimeType timeType, String indexStorageId); |
| | | List<MonthlyKeyEquipment> getListChart(String indexId, Date beginTime, Date endTime, TimeType timeType, String indexStorageId); |
| | | |
| | | List<MonthlyKeyEquipment> getMonthlyKeyEquipmentList(List<String> indexIds, List<MonthlyKeyEquipment> dataList, Date beginTime, Date endTime, String timeType, String indexStorageId); |
| | | |
| | | List<MonthlyKeyEquipment> getListChart(String indexId, Date beginTime, Date endTime, String timeType, String indexStorageId); |
| | | } |
| | |
| | | package com.zhitan.keyequipment.service; |
| | | |
| | | |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.common.utils.TypeTime; |
| | | import com.zhitan.keyequipment.domain.YearKeyEquipment; |
| | | import com.zhitan.realtimedata.domain.dto.DataItemQueryDTO; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | * @date 2021-01-11 |
| | | */ |
| | | public interface IYearKeyEquipmentService { |
| | | public List<YearKeyEquipment> getYearKeyEquipmentList(List<String> indexIds, List<YearKeyEquipment> dataList, Date beginTime, Date endTime, TimeType timeType, String indexStorageId); |
| | | List<YearKeyEquipment> getListChart(String indexId, Date beginTime, Date endTime, TimeType timeType, String indexStorageId); |
| | | public List<YearKeyEquipment> getYearKeyEquipmentList(List<String> indexIds, List<TypeTime> dataList, Date beginTime, Date endTime, String timeType, String indexStorageId); |
| | | List<YearKeyEquipment> getListChart(DataItemQueryDTO queryDto); |
| | | } |
| | |
| | | package com.zhitan.keyequipment.service.impl; |
| | | |
| | | import com.zhitan.basicdata.domain.FacilityArchives; |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.keyequipment.domain.DailyKeyEquipment; |
| | | import com.zhitan.keyequipment.mapper.DailyKeyEquipmentMapper; |
| | | import com.zhitan.keyequipment.service.IDailyKeyEquipmentService; |
| | |
| | | @Autowired |
| | | private DailyKeyEquipmentMapper dailyKeyEquipmentMapper; |
| | | |
| | | /** |
| | | * |
| | | * @param indexIds |
| | | * @param dataList |
| | | * @param beginTime |
| | | * @param endTime |
| | | * @param timeType |
| | | * @param indexStorageId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<DailyKeyEquipment> getdailyKeyEquipmentList(List<String> indexIds, List<DailyKeyEquipment> dataList, Date beginTime, Date endTime, TimeType timeType, String indexStorageId){ |
| | | public List<DailyKeyEquipment> getdailyKeyEquipmentList(List<String> indexIds, List<DailyKeyEquipment> dataList, Date beginTime, Date endTime, String timeType, String indexStorageId){ |
| | | if (indexIds != null && !indexIds.isEmpty()) { |
| | | return dailyKeyEquipmentMapper.getdailyKeyEquipmentList(indexIds, dataList, beginTime, endTime, timeType, indexStorageId); |
| | | } |
| | | return Collections.emptyList(); |
| | | } |
| | | @Override |
| | | public List<DailyKeyEquipment> getListChart(String indexId, Date beginTime, Date endTime, TimeType timeType, String indexStorageId){ |
| | | public List<DailyKeyEquipment> getListChart(String indexId, Date beginTime, Date endTime, String timeType, String indexStorageId){ |
| | | if (indexId != null && !indexId.isEmpty()) { |
| | | return dailyKeyEquipmentMapper.getListChart(indexId,beginTime,endTime,timeType,indexStorageId); |
| | | } |
| | |
| | | package com.zhitan.keyequipment.service.impl; |
| | | |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.keyequipment.domain.MonthlyKeyEquipment; |
| | | import com.zhitan.keyequipment.mapper.MonthlyKeyEquipmentMapper; |
| | | import com.zhitan.keyequipment.service.IMonthlyKeyEquipmentService; |
| | |
| | | private MonthlyKeyEquipmentMapper monthlyKeyEquipmentMapper; |
| | | |
| | | @Override |
| | | public List<MonthlyKeyEquipment> getMonthlyKeyEquipmentList(List<String> indexIds, List<MonthlyKeyEquipment> dataList, Date beginTime, Date endTime, TimeType timeType, String indexStorageId){ |
| | | public List<MonthlyKeyEquipment> getMonthlyKeyEquipmentList(List<String> indexIds, List<MonthlyKeyEquipment> dataList, Date beginTime, Date endTime, String timeType, String indexStorageId){ |
| | | if (indexIds != null && !indexIds.isEmpty()) { |
| | | return monthlyKeyEquipmentMapper.getMonthlyKeyEquipmentList(indexIds, dataList, beginTime, endTime, timeType, indexStorageId); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<MonthlyKeyEquipment> getListChart(String indexId, Date beginTime, Date endTime, TimeType timeType, String indexStorageId){ |
| | | public List<MonthlyKeyEquipment> getListChart(String indexId, Date beginTime, Date endTime, String timeType, String indexStorageId){ |
| | | if (indexId != null && !indexId.isEmpty()) { |
| | | return monthlyKeyEquipmentMapper.getListChart(indexId,beginTime,endTime,timeType,indexStorageId); |
| | | } |
| | |
| | | package com.zhitan.keyequipment.service.impl; |
| | | |
| | | import com.zhitan.common.enums.TimeType; |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.zhitan.common.utils.DateTimeUtil; |
| | | import com.zhitan.common.utils.TypeTime; |
| | | import com.zhitan.keyequipment.domain.YearKeyEquipment; |
| | | import com.zhitan.keyequipment.mapper.YearKeyEquipmentMapper; |
| | | import com.zhitan.keyequipment.service.IYearKeyEquipmentService; |
| | | import com.zhitan.realtimedata.domain.dto.DataItemQueryDTO; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | @Autowired |
| | | private YearKeyEquipmentMapper yearKeyEquipmentMapper; |
| | | |
| | | public List<YearKeyEquipment> getYearKeyEquipmentList(List<String> indexIds, List<YearKeyEquipment> dataList, Date beginTime, Date endTime, TimeType timeType, String indexStorageId){ |
| | | public List<YearKeyEquipment> getYearKeyEquipmentList(List<String> indexIds, List<TypeTime> dataList, Date beginTime, Date endTime, String timeType, String indexStorageId){ |
| | | if (indexIds != null && !indexIds.isEmpty()) { |
| | | return yearKeyEquipmentMapper.getYearKeyEquipmentList(indexIds, dataList, beginTime, endTime, timeType, indexStorageId); |
| | | } |
| | | return Collections.emptyList(); |
| | | } |
| | | @Override |
| | | public List<YearKeyEquipment> getListChart(String indexId, Date beginTime, Date endTime, TimeType timeType, String indexStorageId){ |
| | | if (indexId != null && !indexId.isEmpty()) { |
| | | return yearKeyEquipmentMapper.getListChart(indexId,beginTime,endTime,timeType,indexStorageId); |
| | | public List<YearKeyEquipment> getListChart(DataItemQueryDTO queryDto){ |
| | | if(ObjectUtils.isEmpty(queryDto.getIndexId())){ |
| | | return Collections.emptyList();} |
| | | Date convertTime = DateTimeUtil.getTime(queryDto.getTimeType(), queryDto.getDataTime()); |
| | | DateTime beginTime = DateUtil.beginOfYear(convertTime); |
| | | DateTime endTime = DateUtil.endOfYear(convertTime); |
| | | return yearKeyEquipmentMapper.getListChart(queryDto.getIndexId(),beginTime,endTime,queryDto.getTimeType()); |
| | | } |
| | | return Collections.emptyList(); |
| | | } |
| | | } |
| | |
| | | package com.zhitan.realtimedata.domain; |
| | | |
| | | import com.zhitan.common.enums.Quality; |
| | | import com.zhitan.common.enums.TimeType; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | |
| | | @ApiModelProperty(value = "æ¶é´ç±»åç¼ç ") |
| | | private String timeCode; |
| | | @ApiModelProperty(value = "æ¶é´ç±»å") |
| | | private TimeType timeType; |
| | | private String timeType; |
| | | @ApiModelProperty(value = "å¼") |
| | | private Double value; |
| | | @ApiModelProperty(value = "è´¨é") |
| | |
| | | this.timeCode = timeCode; |
| | | } |
| | | |
| | | public TimeType getTimeType() { |
| | | public String getTimeType() { |
| | | return timeType; |
| | | } |
| | | |
| | | public void setTimeType(TimeType timeType) { |
| | | public void setTimeType(String timeType) { |
| | | this.timeType = timeType; |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.realtimedata.domain.dto; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * å¨ææ°æ®é¡¹. |
| | | */ |
| | | @Data |
| | | public class DataItemQueryDTO { |
| | | @ApiModelProperty(value ="ææ id") |
| | | private String indexId; |
| | | |
| | | @ApiModelProperty(value="模åcode") |
| | | private String indexCode; |
| | | @ApiModelProperty(value ="æ¶é´å符串") |
| | | private String dataTime; |
| | | @ApiModelProperty(value ="æ¶é´ç±»å") |
| | | private String timeType; |
| | | @ApiModelProperty(value = "è½æºç±»å") |
| | | private String energyType; |
| | | } |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.zhitan.keyequipment.mapper.YearKeyEquipmentMapper"> |
| | | <resultMap id="dataItemMap" type="com.zhitan.keyequipment.domain.YearKeyEquipment"> |
| | | <result column="index_id" property="indexId"/> |
| | |
| | | aa.index_id, |
| | | aa.index_name, |
| | | <foreach item="item" index="index" collection="dataList"> |
| | | MAX ( CASE WHEN data_time = #{item.dataTime} THEN "value" END ) AS ${item.value}, |
| | | MAX ( CASE WHEN data_time = #{item.dateTime} THEN "value" END ) AS ${item.value}, |
| | | </foreach> |
| | | aa.time_type |
| | | FROM |
| | | ( |
| | | SELECT |
| | | ci.index_id, |
| | | ci.NAME AS "index_name", |
| | | ci.NAME AS "index_name", |
| | | di."value", |
| | | di.data_time, |
| | | di.time_type |
| | |
| | | data_item di LEFT JOIN energy_index ci ON di.index_id = ci.index_id |
| | | LEFT JOIN facility_archives f ON f."id"=ci.equipment |
| | | WHERE |
| | | di.data_time >= #{beginTime} |
| | | di.data_time >= #{beginTime} |
| | | AND di.data_time < #{endTime} |
| | | AND di.index_id IN <foreach item="indexId" index="index" collection="indexIds" open="(" separator="," close=")">#{indexId} </foreach> |
| | | AND di.index_id IN |
| | | <foreach item="indexId" index="index" collection="indexIds" open="(" separator="," close=")"> |
| | | #{indexId} |
| | | </foreach> |
| | | AND di.time_type = #{timeType} |
| | | <if test="indexStorageId !='' and indexStorageId !=null"> |
| | | and ci.equipment=#{indexStorageId} |
| | |
| | | |
| | | <select id="getListChart" resultMap="dataItemMap"> |
| | | SELECT |
| | | di.index_id, |
| | | ci.name AS "index_name", |
| | | ci.unit_id, |
| | | di."value", |
| | | di.data_time, |
| | | di.time_type, |
| | | di.time_code |
| | | di.index_id, |
| | | ci.name AS "index_name", |
| | | ci.unit_id, |
| | | di."value", |
| | | di.data_time, |
| | | di.time_type, |
| | | di.time_code |
| | | FROM |
| | | data_item di LEFT JOIN energy_index ci ON di.index_id = ci.index_id |
| | | WHERE |
| | | di.index_id =#{indexId} |
| | | AND di.data_time < #{endTime} |
| | | AND di.data_time >= #{beginTime} |
| | | di.index_id =#{indexId} |
| | | AND di.data_time < #{endTime} |
| | | <if test="endTime != null"> |
| | | AND di.data_time >= #{beginTime} |
| | | </if> |
| | | <if test="beginTime != null"> |
| | | AND di.time_type = #{timeType} |
| | | </if> |
| | | order by di.data_time |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from "@/utils/request" |
| | | export default { |
| | | // æ¥è¯¢ææè®¾å¤å表 |
| | | getFacilityArchives(data) { |
| | | return request({ |
| | | url: "/keyEquipment/dailyKeyEquipment/getFacilityArchives", |
| | | method: "GET", |
| | | params: data, |
| | | }) |
| | | }, |
| | | // æ¥è¯¢éç¹è®¾å¤å表 |
| | | getPointFacility(data) { |
| | | return request({ |
| | | url: "/keyEquipment/dailyKeyEquipment/getPointFacility", |
| | | method: "GET", |
| | | params: data, |
| | | }) |
| | | }, |
| | | // éç¹è®¾å¤è½èåæï¼æ¥ï¼å¾è¡¨ |
| | | dailyList(data) { |
| | | return request({ |
| | | url: "/keyEquipment/dailyKeyEquipment/list", |
| | | method: "GET", |
| | | params: data, |
| | | }) |
| | | }, |
| | | // éç¹è®¾å¤è½èåæï¼æ¥ï¼å¾è¡¨ |
| | | dailyChart(data) { |
| | | return request({ |
| | | url: "/keyEquipment/dailyKeyEquipment/listChart", |
| | | method: "GET", |
| | | params: data, |
| | | }) |
| | | }, |
| | | // éç¹è®¾å¤è½èç»è®¡ï¼æï¼å表 |
| | | monthlyList(data) { |
| | | return request({ |
| | | url: "/keyEquipment/MonthlyKeyEquipment/list", |
| | | method: "GET", |
| | | params: data, |
| | | }) |
| | | }, |
| | | // éç¹è®¾å¤è½èç»è®¡ï¼æï¼å¾è¡¨ |
| | | monthlyChart(data) { |
| | | return request({ |
| | | url: "/keyEquipment/MonthlyKeyEquipment/listChart", |
| | | method: "GET", |
| | | params: data, |
| | | }) |
| | | }, |
| | | // éç¹è®¾å¤è½èç»è®¡ï¼å¹´ï¼å表 |
| | | yearList(data) { |
| | | return request({ |
| | | url: "/keyEquipment/YearKeyEquipment/list", |
| | | method: "GET", |
| | | params: data, |
| | | }) |
| | | }, |
| | | // éç¹è®¾å¤è½èç»è®¡ï¼å¹´ï¼å¾è¡¨ |
| | | yearChart(data) { |
| | | return request({ |
| | | url: "/keyEquipment/YearKeyEquipment/listChart", |
| | | method: "GET", |
| | | params: data, |
| | | }) |
| | | }, |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from "@/utils/request" |
| | | export default { |
| | | // å·¥åºè½èåæï¼æ¥ï¼å¾è¡¨ |
| | | dailyList(data) { |
| | | return request({ |
| | | url: "/processEnergy/dailyProcessEnergy/list", |
| | | method: "GET", |
| | | params: data, |
| | | }) |
| | | }, |
| | | // å·¥åºè½èåæï¼æ¥ï¼å¾è¡¨ |
| | | dailyChart(data) { |
| | | return request({ |
| | | url: "/processEnergy/dailyProcessEnergy/listChart", |
| | | method: "GET", |
| | | params: data, |
| | | }) |
| | | }, |
| | | // å·¥åºè½èç»è®¡ï¼æï¼å表 |
| | | monthlyList(data) { |
| | | return request({ |
| | | url: "/processEnergy/monthlyProcessEnergy/list", |
| | | method: "GET", |
| | | params: data, |
| | | }) |
| | | }, |
| | | // å·¥åºè½èç»è®¡ï¼æï¼å¾è¡¨ |
| | | monthlyChart(data) { |
| | | return request({ |
| | | url: "/processEnergy/monthlyProcessEnergy/listChart", |
| | | method: "GET", |
| | | params: data, |
| | | }) |
| | | }, |
| | | // å·¥åºè½èç»è®¡ï¼å¹´ï¼å表 |
| | | yearList(data) { |
| | | return request({ |
| | | url: "/processEnergy/YearProcessEnergy/list", |
| | | method: "GET", |
| | | params: data, |
| | | }) |
| | | }, |
| | | // å·¥åºè½èç»è®¡ï¼å¹´ï¼å¾è¡¨ |
| | | yearChart(data) { |
| | | return request({ |
| | | url: "/processEnergy/YearProcessEnergy/listChart", |
| | | method: "GET", |
| | | params: data, |
| | | }) |
| | | }, |
| | | } |
| | |
| | | style="margin-right: 8px" |
| | | ></el-button> |
| | | <el-tooltip |
| | | v-if="scope.row.indexName.length > 9" |
| | | v-if="scope.row.indexName && scope.row.indexName.length > 9" |
| | | class="item" |
| | | effect="dark" |
| | | :content="scope.row.indexName" |
| | |
| | | v-model="queryParams.dataTime" |
| | | type="month" |
| | | :clearable="false" |
| | | value-format="yyyy-MM" |
| | | value-format="YYYY-MM" |
| | | placeholder="éæ©æ¥æ" |
| | | > |
| | | </el-date-picker> |
| | |
| | | |
| | | <div class="table-bg-style" style="padding-bottom: 12px"> |
| | | <div class="table-box"> |
| | | <el-table :data="energyList" v-loading="loading" border max-height="380px"> |
| | | <el-table :data="energyList" v-loading="loading" border max-height="380px" height="380"> |
| | | <el-table-column fixed prop="indexName" label="ææ åç§°" width="210px"> |
| | | <template #default="scope"> |
| | | <div style="width: 100%; text-align: left"> |
| | |
| | | style="margin-right: 8px" |
| | | ></el-button> |
| | | <el-tooltip |
| | | v-if="scope.row.indexName.length > 9" |
| | | v-if="scope.row.indexName && scope.row.indexName.length > 9" |
| | | class="item" |
| | | effect="dark" |
| | | :content="scope.row.indexName" |
| | |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column v-for="index in 31" :key="index" :label="index + 'æ¥'" align="center" min-width="100"> |
| | | <el-table-column v-for="index in 31" :key="index" :label="index + 'æ¥'" align="center" min-width="100px"> |
| | | <template #default="scope">{{ numFilter(scope.row[`value${index}`]) }}</template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | getDataList({ |
| | | ...queryParams.value, |
| | | }).then((response) => { |
| | | console.log("1111111111", response) |
| | | energyList.value = response.data.tabledata |
| | | if (energyList.value && energyList.value.length !== 0) { |
| | | selectChange(energyList.value[0]) |
| | |
| | | style="margin-right: 8px" |
| | | ></el-button> |
| | | <el-tooltip |
| | | v-if="scope.row.indexName.length > 9" |
| | | v-if="scope.row.indexName && scope.row.indexName.length > 9" |
| | | class="item" |
| | | effect="dark" |
| | | :content="scope.row.indexName" |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="chart-box"> |
| | | <div id="ChartDom" style="width: 100%; height: 100%"></div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import * as echarts from "echarts" |
| | | const { proxy } = getCurrentInstance() |
| | | import useSettingsStore from "@/store/modules/settings" |
| | | const settingsStore = useSettingsStore() |
| | | const emit = defineEmits() |
| | | const props = defineProps({ |
| | | chartData: { |
| | | type: Object, |
| | | default: () => {}, |
| | | }, |
| | | }) |
| | | |
| | | watch( |
| | | () => props.chartData, |
| | | (val) => { |
| | | console.log("watch", val) |
| | | initChart() |
| | | } |
| | | ) |
| | | watch( |
| | | () => settingsStore.sideTheme, |
| | | (val) => { |
| | | initChart() |
| | | } |
| | | ) |
| | | |
| | | onMounted(() => { |
| | | initChart() |
| | | }) |
| | | |
| | | function initChart(value) { |
| | | const chartDom = document.getElementById("ChartDom") |
| | | if (echarts.getInstanceByDom(chartDom)) { |
| | | echarts.dispose(chartDom) |
| | | } |
| | | const myChart = echarts.init(chartDom) |
| | | let option = { |
| | | title: { |
| | | text: props.chartData.title, |
| | | left: "40", |
| | | textStyle: { |
| | | color: "#2979ff", |
| | | }, |
| | | }, |
| | | color: ["#40c2ff", "#2979ff", "#ff9900", "#fa3534"], |
| | | tooltip: { |
| | | trigger: "axis", |
| | | axisPointer: { |
| | | type: "shadow", |
| | | }, |
| | | }, |
| | | legend: { |
| | | icon: "rect", |
| | | itemWidth: 14, |
| | | itemHeight: 10, |
| | | textStyle: { |
| | | color: settingsStore.sideTheme == "theme-dark" ? "#FFFFFF" : "#222222", |
| | | }, |
| | | }, |
| | | grid: { |
| | | top: "60", |
| | | left: "50", |
| | | right: "40", |
| | | bottom: "20", |
| | | containLabel: true, |
| | | }, |
| | | xAxis: { |
| | | type: "category", |
| | | axisPointer: { |
| | | type: "shadow", |
| | | }, |
| | | axisLine: { |
| | | show: true, |
| | | lineStyle: { |
| | | color: settingsStore.sideTheme == "theme-dark" ? "#FFFFFF" : "#222222", |
| | | }, |
| | | }, |
| | | axisTick: { |
| | | show: false, |
| | | }, |
| | | splitArea: { |
| | | show: false, |
| | | }, |
| | | splitLine: { |
| | | show: false, |
| | | }, |
| | | axisLabel: { |
| | | color: settingsStore.sideTheme == "theme-dark" ? "#FFFFFF" : "#222222", |
| | | fontSize: 14, |
| | | padding: [5, 0, 0, 0], |
| | | // formatter: '{value} ml' |
| | | }, |
| | | data: props.chartData.xData, |
| | | }, |
| | | yAxis: [ |
| | | { |
| | | type: "value", |
| | | nameTextStyle: { |
| | | color: settingsStore.sideTheme == "theme-dark" ? "#FFFFFF" : "#222222", |
| | | fontSize: 14, |
| | | padding: [0, 0, 5, 0], |
| | | }, |
| | | axisLine: { |
| | | show: false, |
| | | }, |
| | | splitLine: { |
| | | show: true, |
| | | lineStyle: { |
| | | type: "dashed", |
| | | color: settingsStore.sideTheme == "theme-dark" ? "#FFFFFF" : "#222222", |
| | | }, |
| | | }, |
| | | axisTick: { |
| | | show: false, |
| | | }, |
| | | splitArea: { |
| | | show: false, |
| | | }, |
| | | axisLabel: { |
| | | color: settingsStore.sideTheme == "theme-dark" ? "#FFFFFF" : "#222222", |
| | | fontSize: 14, |
| | | }, |
| | | }, |
| | | ], |
| | | series: [ |
| | | { |
| | | name: props.chartData.title, |
| | | type: "bar", |
| | | barWidth: "16", |
| | | // tooltip: { |
| | | // valueFormatter: function (value) { |
| | | // return value + "tce" |
| | | // }, |
| | | // }, |
| | | itemStyle: { |
| | | borderRadius: [15, 15, 0, 0], |
| | | }, |
| | | data: props.chartData.yData, |
| | | markPoint: { |
| | | data: [ |
| | | { type: "max", name: "Max" }, |
| | | { type: "min", name: "Min" }, |
| | | ], |
| | | }, |
| | | }, |
| | | ], |
| | | } |
| | | setTimeout(() => { |
| | | myChart.setOption(option) |
| | | }, 200) |
| | | |
| | | window.addEventListener( |
| | | "resize", |
| | | () => { |
| | | myChart.resize() |
| | | }, |
| | | { passive: true } |
| | | ) |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .chart-box { |
| | | width: 100%; |
| | | height: 400px; |
| | | border: 1px solid #eaeaea; |
| | | margin-top: 20px; |
| | | padding-top: 20px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="page"> |
| | | <div class="form-card"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" label-width="68px"> |
| | | <!-- <el-form-item label="éç¹è®¾å¤" prop="energyType"> |
| | | <el-select v-model="queryParams.energyType" placeholder="è¯·éæ©éç¹è®¾å¤"> |
| | | <el-option :label="item.name" :value="item.id" v-for="item in facilityList" :key="item.id" /> |
| | | </el-select> |
| | | </el-form-item> --> |
| | | <el-form-item label="è½æºç±»å" prop="energyType"> |
| | | <el-select v-model="queryParams.energyType" placeholder="è¯·éæ©è½æºç±»å"> |
| | | <el-option |
| | | :label="item.enername" |
| | | :value="item.enersno" |
| | | v-for="item in energyTypeList" |
| | | :key="item.enersno" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="ç»è®¡æ¶é´"> |
| | | <el-date-picker |
| | | v-model="queryParams.dataTime" |
| | | type="date" |
| | | format="YYYY-MM-DD" |
| | | value-format="YYYY-MM-DD" |
| | | placeholder="éæ©æ¥æ" |
| | | style="width: 100%" |
| | | :clearable="false" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="Refresh" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | <!-- <el-form-item> |
| | | <el-button type="warning" icon="Download" @click="handleExport"> å¯¼åº </el-button> |
| | | </el-form-item> --> |
| | | </el-form> |
| | | </div> |
| | | |
| | | <div class="table-bg-style" style="padding-bottom: 12px"> |
| | | <div class="table-box"> |
| | | <el-table :data="energyList" v-loading="loading" border max-height="380px"> |
| | | <el-table-column fixed prop="indexName" label="ææ åç§°" width="210px"> |
| | | <template #default="scope"> |
| | | <div style="width: 100%; text-align: left"> |
| | | <el-button |
| | | v-if="scope.row.indexId == queryParams.indexId" |
| | | icon="search" |
| | | circle |
| | | @click="selectChange(scope.row)" |
| | | style="color: #fff; background: #409eff; margin-right: 8px" |
| | | ></el-button> |
| | | <el-button |
| | | v-else |
| | | icon="search" |
| | | circle |
| | | @click="selectChange(scope.row)" |
| | | style="margin-right: 8px" |
| | | ></el-button> |
| | | <el-tooltip |
| | | v-if="scope.row.indexName && scope.row.indexName.length > 9" |
| | | class="item" |
| | | effect="dark" |
| | | :content="scope.row.indexName" |
| | | placement="top-end" |
| | | > |
| | | <span> |
| | | {{ scope.row.indexName.substr(0, 9) + "..." }} |
| | | </span> |
| | | </el-tooltip> |
| | | <span v-else>{{ scope.row.indexName }}</span> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column v-for="index in 24" :key="index" :label="index - 1 + 'æ¶'" align="center" min-width="100"> |
| | | <template #default="scope">{{ numFilter(scope.row[`value${index - 1}`]) }}</template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <div> |
| | | <line-chart ref="LineChartRef" :chartData="lineChartData" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { listEnergyTypeList } from "@/api/modelConfiguration/energyType" |
| | | import keyEquipmentApi from "@/api/keyEquipment/api" |
| | | import LineChart from "../comps/LineChart.vue" |
| | | let { proxy } = getCurrentInstance() |
| | | const facilityList = ref([]) |
| | | function getEquip() { |
| | | keyEquipmentApi.getPointFacility().then((res) => { |
| | | facilityList.value = res.data |
| | | }) |
| | | } |
| | | getEquip() |
| | | |
| | | const energyTypeList = ref() |
| | | function getEnergyTypeList() { |
| | | listEnergyTypeList().then((res) => { |
| | | energyTypeList.value = res.data |
| | | // form.value.indexType = alarm_record_category.value[0].value |
| | | // form.value.energyType = energyTypeList.value[0].enersno |
| | | getList() |
| | | }) |
| | | } |
| | | getEnergyTypeList() |
| | | function numFilter(value) { |
| | | // æªåå½åæ°æ®å°å°æ°ç¹åçå ä½ |
| | | let realVal = "" |
| | | if (!isNaN(value) && value !== "" && value !== null) { |
| | | realVal = parseFloat(value).toFixed(2) |
| | | } else { |
| | | realVal = "--" |
| | | } |
| | | return realVal |
| | | } |
| | | let loading = ref(false) |
| | | let total = ref(0) |
| | | let queryParams = ref({ |
| | | indexStorageId: "", |
| | | indexCode: "", |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | dataTime: "", |
| | | }) |
| | | |
| | | const energyList = ref([]) |
| | | const lineChartData = ref({}) |
| | | function getList() { |
| | | queryParams.value.indexCode = proxy.$route.query.modelCode |
| | | keyEquipmentApi |
| | | .dailyList({ |
| | | ...queryParams.value, |
| | | timeType: "HOUR", |
| | | }) |
| | | .then((response) => { |
| | | energyList.value = response.data |
| | | if (response.data && response.data.length !== 0) { |
| | | selectChange(response.data[0]) |
| | | } else { |
| | | lineChartData.value = {} |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const LineChartRef = ref() |
| | | function selectChange(row) { |
| | | queryParams.value.indexId = row ? row.indexId : undefined |
| | | queryParams.value.timeType = "HOUR" |
| | | keyEquipmentApi.dailyChart(queryParams.value).then((response) => { |
| | | let actualData = [] |
| | | let expectedData = [] |
| | | let title = "" |
| | | response.data.forEach((item) => { |
| | | expectedData.push(numFilter(item.value)) |
| | | actualData.push(item.timeCode.slice(item.timeCode.length - 2, item.timeCode.length) + "æ¶") |
| | | title = item.indexName + "(" + (item.unitId || "") + ")" |
| | | }) |
| | | |
| | | console.log(response) |
| | | console.log(actualData) |
| | | console.log(expectedData) |
| | | |
| | | lineChartData.value = { |
| | | xData: actualData, |
| | | yData: expectedData, |
| | | title, |
| | | } |
| | | // LineChartRef.value.initChart() |
| | | // this.lineChartData.actualData = actualData; |
| | | // this.lineChartData.expectedData = expectedData; |
| | | // this.lineChartData.title = title; |
| | | // this.$refs.LineChart.initChart(this.lineChartData); |
| | | // this.$refs.BarChart.initChart(this.lineChartData); |
| | | }) |
| | | } |
| | | |
| | | function getTime() { |
| | | var date = new Date() |
| | | var year = date.getFullYear() |
| | | var month = date.getMonth() + 1 |
| | | var date = date.getDate() |
| | | month = month < 10 ? "0" + month : month |
| | | date = date < 10 ? "0" + date : date |
| | | queryParams.value.dataTime = year + "-" + month + "-" + date |
| | | } |
| | | getTime() |
| | | |
| | | // å¯¼åºæé®æä½ |
| | | function handleExport() { |
| | | exportList(queryParams.value).then((response) => { |
| | | console.log(response) |
| | | // download(response.msg); |
| | | }) |
| | | } |
| | | |
| | | function handleQuery() { |
| | | queryParams.value.pageNum = 1 |
| | | getList() |
| | | } |
| | | |
| | | function resetQuery() { |
| | | queryParams.value = { |
| | | limitName: "", |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | dataTime: null, |
| | | } |
| | | getTime() |
| | | getList() |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @import "@/assets/styles/page.scss"; |
| | | |
| | | .header-box { |
| | | :deep .el-form-item__content { |
| | | color: #fff; |
| | | font-size: 16px; |
| | | } |
| | | } |
| | | |
| | | :deep .el-table--fit { |
| | | border-bottom: 1px solid #eaeaea; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="page"> |
| | | <div class="form-card"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" label-width="68px"> |
| | | <el-form-item label="è½æºç±»å" prop="energyType"> |
| | | <el-select v-model="queryParams.energyType" placeholder="è¯·éæ©è½æºç±»å"> |
| | | <el-option |
| | | :label="item.enername" |
| | | :value="item.enersno" |
| | | v-for="item in energyTypeList" |
| | | :key="item.enersno" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="ç»è®¡æ¶é´"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | | v-model="queryParams.dataTime" |
| | | type="month" |
| | | :clearable="false" |
| | | value-format="YYYY-MM" |
| | | placeholder="éæ©æ¥æ" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="Refresh" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | <!-- <el-form-item> |
| | | <el-button type="warning" icon="Download" @click="handleExport"> å¯¼åº </el-button> |
| | | </el-form-item> --> |
| | | </el-form> |
| | | </div> |
| | | |
| | | <div class="table-bg-style" style="padding-bottom: 12px"> |
| | | <div class="table-box"> |
| | | <el-table :data="energyList" v-loading="loading" border max-height="380px"> |
| | | <el-table-column fixed prop="indexName" label="ææ åç§°" width="210px"> |
| | | <template #default="scope"> |
| | | <div style="width: 100%; text-align: left"> |
| | | <el-button |
| | | v-if="scope.row.indexId == queryParams.indexId" |
| | | icon="search" |
| | | circle |
| | | @click="selectChange(scope.row)" |
| | | style="color: #fff; background: #409eff; margin-right: 8px" |
| | | ></el-button> |
| | | <el-button |
| | | v-else |
| | | icon="search" |
| | | circle |
| | | @click="selectChange(scope.row)" |
| | | style="margin-right: 8px" |
| | | ></el-button> |
| | | <el-tooltip |
| | | v-if="scope.row.indexName.length > 9" |
| | | class="item" |
| | | effect="dark" |
| | | :content="scope.row.indexName" |
| | | placement="top-end" |
| | | > |
| | | <span> |
| | | {{ scope.row.indexName.substr(0, 9) + "..." }} |
| | | </span> |
| | | </el-tooltip> |
| | | <span v-else>{{ scope.row.indexName }}</span> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column v-for="index in 31" :key="index" :label="index + 'æ¥'" align="center" min-width="100"> |
| | | <template #default="scope">{{ numFilter(scope.row[`value${index}`]) }}</template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div> |
| | | <line-chart ref="LineChartRef" :chartData="lineChartData" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { getDataList, getlistChart } from "@/api/comprehensiveStatistics/monthlyComprehensive/monthlyComprehensive" |
| | | import { listEnergyTypeList } from "@/api/modelConfiguration/energyType" |
| | | import keyEquipmentApi from "@/api/keyEquipment/api" |
| | | import LineChart from "../comps/LineChart.vue" |
| | | let { proxy } = getCurrentInstance() |
| | | const energyTypeList = ref() |
| | | function getEnergyTypeList() { |
| | | listEnergyTypeList().then((res) => { |
| | | energyTypeList.value = res.data |
| | | // form.value.indexType = alarm_record_category.value[0].value |
| | | // form.value.energyType = energyTypeList.value[0].enersno |
| | | getList() |
| | | }) |
| | | } |
| | | getEnergyTypeList() |
| | | function numFilter(value) { |
| | | // æªåå½åæ°æ®å°å°æ°ç¹åçå ä½ |
| | | let realVal = "" |
| | | if (!isNaN(value) && value !== "" && value !== null) { |
| | | realVal = parseFloat(value).toFixed(2) |
| | | } else { |
| | | realVal = "--" |
| | | } |
| | | return realVal |
| | | } |
| | | let loading = ref(false) |
| | | let total = ref(0) |
| | | let queryParams = ref({ |
| | | indexStorageId: "", |
| | | indexCode: "", |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | dataTime: "", |
| | | timeType: "DAY", |
| | | }) |
| | | |
| | | const energyList = ref([]) |
| | | const lineChartData = ref({}) |
| | | function getList() { |
| | | queryParams.value.indexCode = proxy.$route.query.modelCode |
| | | keyEquipmentApi |
| | | .monthlyList({ |
| | | ...queryParams.value, |
| | | }) |
| | | .then((response) => { |
| | | energyList.value = response.data |
| | | if (energyList.value && energyList.value.length !== 0) { |
| | | selectChange(energyList.value[0]) |
| | | } else { |
| | | lineChartData.value = {} |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const LineChartRef = ref() |
| | | function selectChange(row) { |
| | | queryParams.value.indexId = row ? row.indexId : undefined |
| | | keyEquipmentApi.monthlyChart(queryParams.value).then((response) => { |
| | | let actualData = [] |
| | | let expectedData = [] |
| | | let title = "" |
| | | response.data.forEach((item) => { |
| | | expectedData.push(numFilter(item.value)) |
| | | actualData.push(item.timeCode.slice(item.timeCode.length - 2, item.timeCode.length) + "æ¥") |
| | | title = item.indexName + "(" + (item.unitId || "") + ")" |
| | | }) |
| | | |
| | | console.log(response) |
| | | console.log(actualData) |
| | | console.log(expectedData) |
| | | |
| | | lineChartData.value = { |
| | | xData: actualData, |
| | | yData: expectedData, |
| | | title, |
| | | } |
| | | // LineChartRef.value.initChart() |
| | | // this.lineChartData.actualData = actualData; |
| | | // this.lineChartData.expectedData = expectedData; |
| | | // this.lineChartData.title = title; |
| | | // this.$refs.LineChart.initChart(this.lineChartData); |
| | | // this.$refs.BarChart.initChart(this.lineChartData); |
| | | }) |
| | | } |
| | | |
| | | function getTime() { |
| | | var date = new Date() |
| | | var year = date.getFullYear() |
| | | var month = date.getMonth() + 1 |
| | | var date = date.getDate() |
| | | month = month < 10 ? "0" + month : month |
| | | date = date < 10 ? "0" + date : date |
| | | queryParams.value.dataTime = year + "-" + month |
| | | } |
| | | getTime() |
| | | |
| | | // å¯¼åºæé®æä½ |
| | | function handleExport() { |
| | | exportList(queryParams.value).then((response) => { |
| | | console.log(response) |
| | | // download(response.msg); |
| | | }) |
| | | } |
| | | |
| | | function handleQuery() { |
| | | queryParams.value.pageNum = 1 |
| | | getList() |
| | | } |
| | | |
| | | function resetQuery() { |
| | | queryParams.value = { |
| | | limitName: "", |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | dataTime: null, |
| | | timeType: "DAY", |
| | | } |
| | | getTime() |
| | | getList() |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @import "@/assets/styles/page.scss"; |
| | | |
| | | .header-box { |
| | | :deep .el-form-item__content { |
| | | color: #fff; |
| | | font-size: 16px; |
| | | } |
| | | } |
| | | |
| | | :deep .el-table--fit { |
| | | border-bottom: 1px solid #eaeaea; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="page"> |
| | | <div class="form-card"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" label-width="68px"> |
| | | <el-form-item label="è½æºç±»å" prop="energyType"> |
| | | <el-select v-model="queryParams.energyType" placeholder="è¯·éæ©è½æºç±»å"> |
| | | <el-option |
| | | :label="item.enername" |
| | | :value="item.enersno" |
| | | v-for="item in energyTypeList" |
| | | :key="item.enersno" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="ç»è®¡æ¶é´"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | | v-model="queryParams.dataTime" |
| | | type="year" |
| | | :clearable="false" |
| | | value-format="YYYY" |
| | | placeholder="éæ©æ¥æ" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="Refresh" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | <!-- <el-form-item> |
| | | <el-button type="warning" icon="Download" @click="handleExport"> å¯¼åº </el-button> |
| | | </el-form-item> --> |
| | | </el-form> |
| | | </div> |
| | | |
| | | <div class="table-bg-style" style="padding-bottom: 12px"> |
| | | <div class="table-box"> |
| | | <el-table :data="energyList" v-loading="loading" border max-height="380px"> |
| | | <el-table-column fixed prop="indexName" label="ææ åç§°" width="210px"> |
| | | <template #default="scope"> |
| | | <div style="width: 100%; text-align: left"> |
| | | <el-button |
| | | v-if="scope.row.indexId == queryParams.indexId" |
| | | icon="search" |
| | | circle |
| | | @click="selectChange(scope.row)" |
| | | style="color: #fff; background: #409eff; margin-right: 8px" |
| | | ></el-button> |
| | | <el-button |
| | | v-else |
| | | icon="search" |
| | | circle |
| | | @click="selectChange(scope.row)" |
| | | style="margin-right: 8px" |
| | | ></el-button> |
| | | <el-tooltip |
| | | v-if="scope.row.indexName && scope.row.indexName.length > 9" |
| | | class="item" |
| | | effect="dark" |
| | | :content="scope.row.indexName" |
| | | placement="top-end" |
| | | > |
| | | <span> |
| | | {{ scope.row.indexName.substr(0, 9) + "..." }} |
| | | </span> |
| | | </el-tooltip> |
| | | <span v-else>{{ scope.row.indexName }}</span> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column v-for="index in 12" :key="index" :label="index + 'æ'" align="center" min-width="100"> |
| | | <template #default="scope">{{ numFilter(scope.row[`value${index}`]) }}</template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <div> |
| | | <line-chart ref="LineChartRef" :chartData="lineChartData" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { getDataList, getlistChart } from "@/api/comprehensiveStatistics/yearComprehensive/yearComprehensive" |
| | | import { listEnergyTypeList } from "@/api/modelConfiguration/energyType" |
| | | import keyEquipmentApi from "@/api/keyEquipment/api" |
| | | import LineChart from "../comps/LineChart.vue" |
| | | let { proxy } = getCurrentInstance() |
| | | const energyTypeList = ref() |
| | | function getEnergyTypeList() { |
| | | listEnergyTypeList().then((res) => { |
| | | energyTypeList.value = res.data |
| | | // form.value.indexType = alarm_record_category.value[0].value |
| | | // form.value.energyType = energyTypeList.value[0].enersno |
| | | getList() |
| | | }) |
| | | } |
| | | getEnergyTypeList() |
| | | function numFilter(value) { |
| | | // æªåå½åæ°æ®å°å°æ°ç¹åçå ä½ |
| | | let realVal = "" |
| | | if (!isNaN(value) && value !== "" && value !== null) { |
| | | realVal = parseFloat(value).toFixed(2) |
| | | } else { |
| | | realVal = "--" |
| | | } |
| | | return realVal |
| | | } |
| | | let loading = ref(false) |
| | | let queryParams = ref({ |
| | | indexStorageId: "", |
| | | indexCode: "", |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | dataTime: "2025-01-0", |
| | | timeType: "MONTH", |
| | | }) |
| | | |
| | | const energyList = ref([]) |
| | | const lineChartData = ref({}) |
| | | function getList() { |
| | | queryParams.value.indexCode = proxy.$route.query.modelCode |
| | | keyEquipmentApi |
| | | .yearList({ |
| | | ...queryParams.value, |
| | | dataTime: queryParams.value.dataTime ? queryParams.value.dataTime + "-01" : "", |
| | | }) |
| | | .then((response) => { |
| | | energyList.value = response.data |
| | | if (response.data && response.data.length !== 0) { |
| | | selectChange(response.data[0]) |
| | | } else { |
| | | lineChartData.value = {} |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const LineChartRef = ref() |
| | | function selectChange(row) { |
| | | queryParams.value.indexId = row ? row.indexId : undefined |
| | | keyEquipmentApi |
| | | .yearChart({ |
| | | ...queryParams.value, |
| | | dataTime: queryParams.value.dataTime ? queryParams.value.dataTime + "-01" : "", |
| | | }) |
| | | .then((response) => { |
| | | let actualData = [] |
| | | let expectedData = [] |
| | | let title = "" |
| | | response.data.forEach((item) => { |
| | | expectedData.push(numFilter(item.value)) |
| | | actualData.push(item.timeCode.slice(item.timeCode.length - 2, item.timeCode.length) + "æ") |
| | | title = item.indexName + "(" + (item.unitId || "") + ")" |
| | | }) |
| | | |
| | | console.log(response) |
| | | console.log(actualData) |
| | | console.log(expectedData) |
| | | |
| | | lineChartData.value = { |
| | | xData: actualData, |
| | | yData: expectedData, |
| | | title, |
| | | } |
| | | // LineChartRef.value.initChart() |
| | | // this.lineChartData.actualData = actualData; |
| | | // this.lineChartData.expectedData = expectedData; |
| | | // this.lineChartData.title = title; |
| | | // this.$refs.LineChart.initChart(this.lineChartData); |
| | | // this.$refs.BarChart.initChart(this.lineChartData); |
| | | }) |
| | | } |
| | | |
| | | function getTime() { |
| | | var date = new Date() |
| | | var year = date.getFullYear() |
| | | var month = date.getMonth() + 1 |
| | | var date = date.getDate() |
| | | month = month < 10 ? "0" + month : month |
| | | date = date < 10 ? "0" + date : date |
| | | queryParams.value.dataTime = year + "" |
| | | } |
| | | |
| | | // å¯¼åºæé®æä½ |
| | | function handleExport() { |
| | | exportList(queryParams.value).then((response) => { |
| | | console.log(response) |
| | | // download(response.msg); |
| | | }) |
| | | } |
| | | |
| | | function handleQuery() { |
| | | queryParams.value.pageNum = 1 |
| | | getList() |
| | | } |
| | | |
| | | function resetQuery() { |
| | | queryParams.value = { |
| | | limitName: "", |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | dataTime: null, |
| | | timeType: "MONTH", |
| | | } |
| | | getTime() |
| | | getList() |
| | | } |
| | | |
| | | getTime() |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @import "@/assets/styles/page.scss"; |
| | | |
| | | .header-box { |
| | | :deep .el-form-item__content { |
| | | color: #fff; |
| | | font-size: 16px; |
| | | } |
| | | } |
| | | |
| | | :deep .el-table--fit { |
| | | border-bottom: 1px solid #eaeaea; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="chart-box"> |
| | | <div id="ChartDom" style="width: 100%; height: 100%"></div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import * as echarts from "echarts" |
| | | const { proxy } = getCurrentInstance() |
| | | import useSettingsStore from "@/store/modules/settings" |
| | | const settingsStore = useSettingsStore() |
| | | const emit = defineEmits() |
| | | const props = defineProps({ |
| | | chartData: { |
| | | type: Object, |
| | | default: () => {}, |
| | | }, |
| | | }) |
| | | |
| | | watch( |
| | | () => props.chartData, |
| | | (val) => { |
| | | console.log("watch", val) |
| | | initChart() |
| | | } |
| | | ) |
| | | watch( |
| | | () => settingsStore.sideTheme, |
| | | (val) => { |
| | | initChart() |
| | | } |
| | | ) |
| | | |
| | | onMounted(() => { |
| | | initChart() |
| | | }) |
| | | |
| | | function initChart(value) { |
| | | const chartDom = document.getElementById("ChartDom") |
| | | if (echarts.getInstanceByDom(chartDom)) { |
| | | echarts.dispose(chartDom) |
| | | } |
| | | const myChart = echarts.init(chartDom) |
| | | let option = { |
| | | title: { |
| | | text: props.chartData.title, |
| | | left: "40", |
| | | textStyle: { |
| | | color: "#2979ff", |
| | | }, |
| | | }, |
| | | color: ["#40c2ff", "#2979ff", "#ff9900", "#fa3534"], |
| | | tooltip: { |
| | | trigger: "axis", |
| | | axisPointer: { |
| | | type: "shadow", |
| | | }, |
| | | }, |
| | | legend: { |
| | | icon: "rect", |
| | | itemWidth: 14, |
| | | itemHeight: 10, |
| | | textStyle: { |
| | | color: settingsStore.sideTheme == "theme-dark" ? "#FFFFFF" : "#222222", |
| | | }, |
| | | }, |
| | | grid: { |
| | | top: "60", |
| | | left: "50", |
| | | right: "40", |
| | | bottom: "20", |
| | | containLabel: true, |
| | | }, |
| | | xAxis: { |
| | | type: "category", |
| | | axisPointer: { |
| | | type: "shadow", |
| | | }, |
| | | axisLine: { |
| | | show: true, |
| | | lineStyle: { |
| | | color: settingsStore.sideTheme == "theme-dark" ? "#FFFFFF" : "#222222", |
| | | }, |
| | | }, |
| | | axisTick: { |
| | | show: false, |
| | | }, |
| | | splitArea: { |
| | | show: false, |
| | | }, |
| | | splitLine: { |
| | | show: false, |
| | | }, |
| | | axisLabel: { |
| | | color: settingsStore.sideTheme == "theme-dark" ? "#FFFFFF" : "#222222", |
| | | fontSize: 14, |
| | | padding: [5, 0, 0, 0], |
| | | // formatter: '{value} ml' |
| | | }, |
| | | data: props.chartData.xData, |
| | | }, |
| | | yAxis: [ |
| | | { |
| | | type: "value", |
| | | nameTextStyle: { |
| | | color: settingsStore.sideTheme == "theme-dark" ? "#FFFFFF" : "#222222", |
| | | fontSize: 14, |
| | | padding: [0, 0, 5, 0], |
| | | }, |
| | | axisLine: { |
| | | show: false, |
| | | }, |
| | | splitLine: { |
| | | show: true, |
| | | lineStyle: { |
| | | type: "dashed", |
| | | color: settingsStore.sideTheme == "theme-dark" ? "#FFFFFF" : "#222222", |
| | | }, |
| | | }, |
| | | axisTick: { |
| | | show: false, |
| | | }, |
| | | splitArea: { |
| | | show: false, |
| | | }, |
| | | axisLabel: { |
| | | color: settingsStore.sideTheme == "theme-dark" ? "#FFFFFF" : "#222222", |
| | | fontSize: 14, |
| | | }, |
| | | }, |
| | | ], |
| | | series: [ |
| | | { |
| | | name: props.chartData.title, |
| | | type: "bar", |
| | | barWidth: "16", |
| | | // tooltip: { |
| | | // valueFormatter: function (value) { |
| | | // return value + "tce" |
| | | // }, |
| | | // }, |
| | | itemStyle: { |
| | | borderRadius: [15, 15, 0, 0], |
| | | }, |
| | | data: props.chartData.yData, |
| | | markPoint: { |
| | | data: [ |
| | | { type: "max", name: "Max" }, |
| | | { type: "min", name: "Min" }, |
| | | ], |
| | | }, |
| | | }, |
| | | ], |
| | | } |
| | | setTimeout(() => { |
| | | myChart.setOption(option) |
| | | }, 200) |
| | | |
| | | window.addEventListener( |
| | | "resize", |
| | | () => { |
| | | myChart.resize() |
| | | }, |
| | | { passive: true } |
| | | ) |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .chart-box { |
| | | width: 100%; |
| | | height: 400px; |
| | | border: 1px solid #eaeaea; |
| | | margin-top: 20px; |
| | | padding-top: 20px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="page"> |
| | | <div class="form-card"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" label-width="68px"> |
| | | <el-form-item label="è½æºç±»å" prop="energyType"> |
| | | <el-select v-model="queryParams.energyType" placeholder="è¯·éæ©è½æºç±»å"> |
| | | <el-option |
| | | :label="item.enername" |
| | | :value="item.enersno" |
| | | v-for="item in energyTypeList" |
| | | :key="item.enersno" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="ç»è®¡æ¶é´"> |
| | | <el-date-picker |
| | | v-model="queryParams.dataTime" |
| | | type="date" |
| | | format="YYYY-MM-DD" |
| | | value-format="YYYY-MM-DD" |
| | | placeholder="éæ©æ¥æ" |
| | | style="width: 100%" |
| | | :clearable="false" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="Refresh" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | <!-- <el-form-item> |
| | | <el-button type="warning" icon="Download" @click="handleExport"> å¯¼åº </el-button> |
| | | </el-form-item> --> |
| | | </el-form> |
| | | </div> |
| | | |
| | | <div class="table-bg-style" style="padding-bottom: 12px"> |
| | | <div class="table-box"> |
| | | <el-table :data="energyList" v-loading="loading" border max-height="380px"> |
| | | <el-table-column fixed prop="indexName" label="ææ åç§°" width="210px"> |
| | | <template #default="scope"> |
| | | <div style="width: 100%; text-align: left"> |
| | | <el-button |
| | | v-if="scope.row.indexId == queryParams.indexId" |
| | | icon="search" |
| | | circle |
| | | @click="selectChange(scope.row)" |
| | | style="color: #fff; background: #409eff; margin-right: 8px" |
| | | ></el-button> |
| | | <el-button |
| | | v-else |
| | | icon="search" |
| | | circle |
| | | @click="selectChange(scope.row)" |
| | | style="margin-right: 8px" |
| | | ></el-button> |
| | | <el-tooltip |
| | | v-if="scope.row.indexName && scope.row.indexName.length > 9" |
| | | class="item" |
| | | effect="dark" |
| | | :content="scope.row.indexName" |
| | | placement="top-end" |
| | | > |
| | | <span> |
| | | {{ scope.row.indexName.substr(0, 9) + "..." }} |
| | | </span> |
| | | </el-tooltip> |
| | | <span v-else>{{ scope.row.indexName }}</span> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column v-for="index in 24" :key="index" :label="index - 1 + 'æ¶'" align="center" min-width="100"> |
| | | <template #default="scope">{{ numFilter(scope.row[`value${index - 1}`]) }}</template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <div> |
| | | <line-chart ref="LineChartRef" :chartData="lineChartData" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { listEnergyTypeList } from "@/api/modelConfiguration/energyType" |
| | | import processApi from "@/api/process/api" |
| | | import LineChart from "../comps/LineChart.vue" |
| | | let { proxy } = getCurrentInstance() |
| | | |
| | | const energyTypeList = ref() |
| | | function getEnergyTypeList() { |
| | | listEnergyTypeList().then((res) => { |
| | | energyTypeList.value = res.data |
| | | // form.value.indexType = alarm_record_category.value[0].value |
| | | // form.value.energyType = energyTypeList.value[0].enersno |
| | | getList() |
| | | }) |
| | | } |
| | | getEnergyTypeList() |
| | | function numFilter(value) { |
| | | // æªåå½åæ°æ®å°å°æ°ç¹åçå ä½ |
| | | let realVal = "" |
| | | if (!isNaN(value) && value !== "" && value !== null) { |
| | | realVal = parseFloat(value).toFixed(2) |
| | | } else { |
| | | realVal = "--" |
| | | } |
| | | return realVal |
| | | } |
| | | let loading = ref(false) |
| | | let total = ref(0) |
| | | let queryParams = ref({ |
| | | indexStorageId: "", |
| | | indexCode: "", |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | dataTime: "", |
| | | }) |
| | | |
| | | const energyList = ref([]) |
| | | const lineChartData = ref({}) |
| | | function getList() { |
| | | queryParams.value.indexCode = proxy.$route.query.modelCode |
| | | processApi |
| | | .dailyList({ |
| | | ...queryParams.value, |
| | | timeType: "HOUR", |
| | | }) |
| | | .then((response) => { |
| | | energyList.value = response.data |
| | | if (response.data && response.data.length !== 0) { |
| | | selectChange(response.data[0]) |
| | | } else { |
| | | lineChartData.value = {} |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const LineChartRef = ref() |
| | | function selectChange(row) { |
| | | queryParams.value.indexId = row ? row.indexId : undefined |
| | | queryParams.value.timeType = "HOUR" |
| | | processApi.dailyChart(queryParams.value).then((response) => { |
| | | let actualData = [] |
| | | let expectedData = [] |
| | | let title = "" |
| | | response.data.forEach((item) => { |
| | | expectedData.push(numFilter(item.value)) |
| | | actualData.push(item.timeCode.slice(item.timeCode.length - 2, item.timeCode.length) + "æ¶") |
| | | title = item.indexName + "(" + (item.unitId || "") + ")" |
| | | }) |
| | | |
| | | console.log(response) |
| | | console.log(actualData) |
| | | console.log(expectedData) |
| | | |
| | | lineChartData.value = { |
| | | xData: actualData, |
| | | yData: expectedData, |
| | | title, |
| | | } |
| | | // LineChartRef.value.initChart() |
| | | // this.lineChartData.actualData = actualData; |
| | | // this.lineChartData.expectedData = expectedData; |
| | | // this.lineChartData.title = title; |
| | | // this.$refs.LineChart.initChart(this.lineChartData); |
| | | // this.$refs.BarChart.initChart(this.lineChartData); |
| | | }) |
| | | } |
| | | |
| | | function getTime() { |
| | | var date = new Date() |
| | | var year = date.getFullYear() |
| | | var month = date.getMonth() + 1 |
| | | var date = date.getDate() |
| | | month = month < 10 ? "0" + month : month |
| | | date = date < 10 ? "0" + date : date |
| | | queryParams.value.dataTime = year + "-" + month + "-" + date |
| | | } |
| | | getTime() |
| | | |
| | | // å¯¼åºæé®æä½ |
| | | function handleExport() { |
| | | exportList(queryParams.value).then((response) => { |
| | | console.log(response) |
| | | // download(response.msg); |
| | | }) |
| | | } |
| | | |
| | | function handleQuery() { |
| | | queryParams.value.pageNum = 1 |
| | | getList() |
| | | } |
| | | |
| | | function resetQuery() { |
| | | queryParams.value = { |
| | | limitName: "", |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | dataTime: null, |
| | | } |
| | | getTime() |
| | | getList() |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @import "@/assets/styles/page.scss"; |
| | | |
| | | .header-box { |
| | | :deep .el-form-item__content { |
| | | color: #fff; |
| | | font-size: 16px; |
| | | } |
| | | } |
| | | |
| | | :deep .el-table--fit { |
| | | border-bottom: 1px solid #eaeaea; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="page"> |
| | | <div class="form-card"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" label-width="68px"> |
| | | <el-form-item label="è½æºç±»å" prop="energyType"> |
| | | <el-select v-model="queryParams.energyType" placeholder="è¯·éæ©è½æºç±»å"> |
| | | <el-option |
| | | :label="item.enername" |
| | | :value="item.enersno" |
| | | v-for="item in energyTypeList" |
| | | :key="item.enersno" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="ç»è®¡æ¶é´"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | | v-model="queryParams.dataTime" |
| | | type="month" |
| | | :clearable="false" |
| | | value-format="YYYY-MM" |
| | | placeholder="éæ©æ¥æ" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="Refresh" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | <!-- <el-form-item> |
| | | <el-button type="warning" icon="Download" @click="handleExport"> å¯¼åº </el-button> |
| | | </el-form-item> --> |
| | | </el-form> |
| | | </div> |
| | | |
| | | <div class="table-bg-style" style="padding-bottom: 12px"> |
| | | <div class="table-box"> |
| | | <el-table :data="energyList" v-loading="loading" border max-height="380px"> |
| | | <el-table-column fixed prop="indexName" label="ææ åç§°" width="210px"> |
| | | <template #default="scope"> |
| | | <div style="width: 100%; text-align: left"> |
| | | <el-button |
| | | v-if="scope.row.indexId == queryParams.indexId" |
| | | icon="search" |
| | | circle |
| | | @click="selectChange(scope.row)" |
| | | style="color: #fff; background: #409eff; margin-right: 8px" |
| | | ></el-button> |
| | | <el-button |
| | | v-else |
| | | icon="search" |
| | | circle |
| | | @click="selectChange(scope.row)" |
| | | style="margin-right: 8px" |
| | | ></el-button> |
| | | <el-tooltip |
| | | v-if="scope.row.indexName && scope.row.indexName.length > 9" |
| | | class="item" |
| | | effect="dark" |
| | | :content="scope.row.indexName" |
| | | placement="top-end" |
| | | > |
| | | <span> |
| | | {{ scope.row.indexName.substr(0, 9) + "..." }} |
| | | </span> |
| | | </el-tooltip> |
| | | <span v-else>{{ scope.row.indexName }}</span> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column v-for="index in 31" :key="index" :label="index + 'æ¥'" align="center" min-width="100"> |
| | | <template #default="scope">{{ numFilter(scope.row[`value${index}`]) }}</template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div> |
| | | <line-chart ref="LineChartRef" :chartData="lineChartData" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { getDataList, getlistChart } from "@/api/comprehensiveStatistics/monthlyComprehensive/monthlyComprehensive" |
| | | import { listEnergyTypeList } from "@/api/modelConfiguration/energyType" |
| | | import processApi from "@/api/process/api" |
| | | import LineChart from "../comps/LineChart.vue" |
| | | let { proxy } = getCurrentInstance() |
| | | const energyTypeList = ref() |
| | | function getEnergyTypeList() { |
| | | listEnergyTypeList().then((res) => { |
| | | energyTypeList.value = res.data |
| | | // form.value.indexType = alarm_record_category.value[0].value |
| | | // form.value.energyType = energyTypeList.value[0].enersno |
| | | getList() |
| | | }) |
| | | } |
| | | getEnergyTypeList() |
| | | function numFilter(value) { |
| | | // æªåå½åæ°æ®å°å°æ°ç¹åçå ä½ |
| | | let realVal = "" |
| | | if (!isNaN(value) && value !== "" && value !== null) { |
| | | realVal = parseFloat(value).toFixed(2) |
| | | } else { |
| | | realVal = "--" |
| | | } |
| | | return realVal |
| | | } |
| | | let loading = ref(false) |
| | | let total = ref(0) |
| | | let queryParams = ref({ |
| | | indexStorageId: "", |
| | | indexCode: "", |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | dataTime: "", |
| | | timeType: "DAY", |
| | | }) |
| | | |
| | | const energyList = ref([]) |
| | | const lineChartData = ref({}) |
| | | function getList() { |
| | | queryParams.value.indexCode = proxy.$route.query.modelCode |
| | | processApi |
| | | .monthlyList({ |
| | | ...queryParams.value, |
| | | dataTime: queryParams.value.dataTime ? queryParams.value.dataTime + "-01" : "", |
| | | }) |
| | | .then((response) => { |
| | | energyList.value = response.data |
| | | if (energyList.value && energyList.value.length !== 0) { |
| | | selectChange(energyList.value[0]) |
| | | } else { |
| | | lineChartData.value = {} |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const LineChartRef = ref() |
| | | function selectChange(row) { |
| | | queryParams.value.indexId = row ? row.indexId : undefined |
| | | processApi |
| | | .monthlyChart({ |
| | | ...queryParams.value, |
| | | dataTime: queryParams.value.dataTime ? queryParams.value.dataTime + "-01" : "", |
| | | }) |
| | | .then((response) => { |
| | | let actualData = [] |
| | | let expectedData = [] |
| | | let title = "" |
| | | response.data.forEach((item) => { |
| | | expectedData.push(numFilter(item.value)) |
| | | actualData.push(item.timeCode.slice(item.timeCode.length - 2, item.timeCode.length) + "æ¥") |
| | | title = item.indexName + "(" + (item.unitId || "") + ")" |
| | | }) |
| | | |
| | | console.log(response) |
| | | console.log(actualData) |
| | | console.log(expectedData) |
| | | |
| | | lineChartData.value = { |
| | | xData: actualData, |
| | | yData: expectedData, |
| | | title, |
| | | } |
| | | // LineChartRef.value.initChart() |
| | | // this.lineChartData.actualData = actualData; |
| | | // this.lineChartData.expectedData = expectedData; |
| | | // this.lineChartData.title = title; |
| | | // this.$refs.LineChart.initChart(this.lineChartData); |
| | | // this.$refs.BarChart.initChart(this.lineChartData); |
| | | }) |
| | | } |
| | | |
| | | function getTime() { |
| | | var date = new Date() |
| | | var year = date.getFullYear() |
| | | var month = date.getMonth() + 1 |
| | | var date = date.getDate() |
| | | month = month < 10 ? "0" + month : month |
| | | date = date < 10 ? "0" + date : date |
| | | queryParams.value.dataTime = year + "-" + month |
| | | console.log(queryParams.value.dataTime) |
| | | } |
| | | getTime() |
| | | |
| | | // å¯¼åºæé®æä½ |
| | | function handleExport() { |
| | | exportList(queryParams.value).then((response) => { |
| | | console.log(response) |
| | | // download(response.msg); |
| | | }) |
| | | } |
| | | |
| | | function handleQuery() { |
| | | queryParams.value.pageNum = 1 |
| | | getList() |
| | | } |
| | | |
| | | function resetQuery() { |
| | | queryParams.value = { |
| | | limitName: "", |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | dataTime: null, |
| | | timeType: "DAY", |
| | | } |
| | | getTime() |
| | | getList() |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @import "@/assets/styles/page.scss"; |
| | | |
| | | .header-box { |
| | | :deep .el-form-item__content { |
| | | color: #fff; |
| | | font-size: 16px; |
| | | } |
| | | } |
| | | |
| | | :deep .el-table--fit { |
| | | border-bottom: 1px solid #eaeaea; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="page"> |
| | | <div class="form-card"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" label-width="68px"> |
| | | <el-form-item label="è½æºç±»å" prop="energyType"> |
| | | <el-select v-model="queryParams.energyType" placeholder="è¯·éæ©è½æºç±»å"> |
| | | <el-option |
| | | :label="item.enername" |
| | | :value="item.enersno" |
| | | v-for="item in energyTypeList" |
| | | :key="item.enersno" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="ç»è®¡æ¶é´"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | | v-model="queryParams.dataTime" |
| | | type="year" |
| | | :clearable="false" |
| | | value-format="YYYY" |
| | | placeholder="éæ©æ¥æ" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="Refresh" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | <!-- <el-form-item> |
| | | <el-button type="warning" icon="Download" @click="handleExport"> å¯¼åº </el-button> |
| | | </el-form-item> --> |
| | | </el-form> |
| | | </div> |
| | | |
| | | <div class="table-bg-style" style="padding-bottom: 12px"> |
| | | <div class="table-box"> |
| | | <el-table :data="energyList" v-loading="loading" border max-height="380px"> |
| | | <el-table-column fixed prop="indexName" label="ææ åç§°" width="210px"> |
| | | <template #default="scope"> |
| | | <div style="width: 100%; text-align: left"> |
| | | <el-button |
| | | v-if="scope.row.indexId == queryParams.indexId" |
| | | icon="search" |
| | | circle |
| | | @click="selectChange(scope.row)" |
| | | style="color: #fff; background: #409eff; margin-right: 8px" |
| | | ></el-button> |
| | | <el-button |
| | | v-else |
| | | icon="search" |
| | | circle |
| | | @click="selectChange(scope.row)" |
| | | style="margin-right: 8px" |
| | | ></el-button> |
| | | <el-tooltip |
| | | v-if="scope.row.indexName && scope.row.indexName.length > 9" |
| | | class="item" |
| | | effect="dark" |
| | | :content="scope.row.indexName" |
| | | placement="top-end" |
| | | > |
| | | <span> |
| | | {{ scope.row.indexName.substr(0, 9) + "..." }} |
| | | </span> |
| | | </el-tooltip> |
| | | <span v-else>{{ scope.row.indexName }}</span> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column v-for="index in 12" :key="index" :label="index + 'æ'" align="center" min-width="100"> |
| | | <template #default="scope">{{ numFilter(scope.row[`value${index}`]) }}</template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <div> |
| | | <line-chart ref="LineChartRef" :chartData="lineChartData" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { getDataList, getlistChart } from "@/api/comprehensiveStatistics/yearComprehensive/yearComprehensive" |
| | | import { listEnergyTypeList } from "@/api/modelConfiguration/energyType" |
| | | import processApi from "@/api/process/api" |
| | | import LineChart from "../comps/LineChart.vue" |
| | | let { proxy } = getCurrentInstance() |
| | | const energyTypeList = ref() |
| | | function getEnergyTypeList() { |
| | | listEnergyTypeList().then((res) => { |
| | | energyTypeList.value = res.data |
| | | // form.value.indexType = alarm_record_category.value[0].value |
| | | // form.value.energyType = energyTypeList.value[0].enersno |
| | | getList() |
| | | }) |
| | | } |
| | | getEnergyTypeList() |
| | | function numFilter(value) { |
| | | // æªåå½åæ°æ®å°å°æ°ç¹åçå ä½ |
| | | let realVal = "" |
| | | if (!isNaN(value) && value !== "" && value !== null) { |
| | | realVal = parseFloat(value).toFixed(2) |
| | | } else { |
| | | realVal = "--" |
| | | } |
| | | return realVal |
| | | } |
| | | let loading = ref(false) |
| | | let queryParams = ref({ |
| | | indexStorageId: "", |
| | | indexCode: "", |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | dataTime: "2025-01-01", |
| | | timeType: "MONTH", |
| | | }) |
| | | |
| | | const energyList = ref([]) |
| | | const lineChartData = ref({}) |
| | | function getList() { |
| | | queryParams.value.indexCode = proxy.$route.query.modelCode |
| | | processApi |
| | | .yearList({ |
| | | ...queryParams.value, |
| | | dataTime: queryParams.value.dataTime ? queryParams.value.dataTime + "-01" : "", |
| | | }) |
| | | .then((response) => { |
| | | energyList.value = response.data |
| | | if (response.data && response.data.length !== 0) { |
| | | selectChange(response.data[0]) |
| | | } else { |
| | | lineChartData.value = {} |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const LineChartRef = ref() |
| | | function selectChange(row) { |
| | | queryParams.value.indexId = row ? row.indexId : undefined |
| | | processApi |
| | | .yearChart({ |
| | | ...queryParams.value, |
| | | // dataTime: queryParams.value.dataTime ? queryParams.value.dataTime + "-01-01" : "", |
| | | }) |
| | | .then((response) => { |
| | | let actualData = [] |
| | | let expectedData = [] |
| | | let title = "" |
| | | response.data.forEach((item) => { |
| | | expectedData.push(numFilter(item.value)) |
| | | actualData.push(item.timeCode.slice(item.timeCode.length - 2, item.timeCode.length) + "æ") |
| | | title = item.indexName + "(" + (item.unitId || "") + ")" |
| | | }) |
| | | |
| | | console.log(response) |
| | | console.log(actualData) |
| | | console.log(expectedData) |
| | | |
| | | lineChartData.value = { |
| | | xData: actualData, |
| | | yData: expectedData, |
| | | title, |
| | | } |
| | | // LineChartRef.value.initChart() |
| | | // this.lineChartData.actualData = actualData; |
| | | // this.lineChartData.expectedData = expectedData; |
| | | // this.lineChartData.title = title; |
| | | // this.$refs.LineChart.initChart(this.lineChartData); |
| | | // this.$refs.BarChart.initChart(this.lineChartData); |
| | | }) |
| | | } |
| | | |
| | | function getTime() { |
| | | var date = new Date() |
| | | var year = date.getFullYear() |
| | | var month = date.getMonth() + 1 |
| | | var date = date.getDate() |
| | | month = month < 10 ? "0" + month : month |
| | | date = date < 10 ? "0" + date : date |
| | | queryParams.value.dataTime = year + "" |
| | | } |
| | | |
| | | // å¯¼åºæé®æä½ |
| | | function handleExport() { |
| | | exportList(queryParams.value).then((response) => { |
| | | console.log(response) |
| | | // download(response.msg); |
| | | }) |
| | | } |
| | | |
| | | function handleQuery() { |
| | | queryParams.value.pageNum = 1 |
| | | getList() |
| | | } |
| | | |
| | | function resetQuery() { |
| | | queryParams.value = { |
| | | limitName: "", |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | dataTime: null, |
| | | timeType: "MONTH", |
| | | } |
| | | getTime() |
| | | getList() |
| | | } |
| | | |
| | | getTime() |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @import "@/assets/styles/page.scss"; |
| | | |
| | | .header-box { |
| | | :deep .el-form-item__content { |
| | | color: #fff; |
| | | font-size: 16px; |
| | | } |
| | | } |
| | | |
| | | :deep .el-table--fit { |
| | | border-bottom: 1px solid #eaeaea; |
| | | } |
| | | </style> |