Merge branch 'master' of https://github.com/Andy-Yin/zhitan-ems
| | |
| | | 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); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.web.controller.processenergy; |
| | | |
| | | import com.zhitan.basicdata.domain.FacilityArchives; |
| | | import com.zhitan.common.core.controller.BaseController; |
| | | import com.zhitan.common.core.domain.AjaxResult; |
| | | import com.zhitan.model.domain.EnergyIndex; |
| | | import com.zhitan.model.domain.ModelNode; |
| | | import com.zhitan.model.service.IModelNodeService; |
| | | import com.zhitan.processenergy.domain.DailyProcessEnergy; |
| | | import com.zhitan.processenergy.service.IDailyProcessEnergyService; |
| | | import com.zhitan.realtimedata.domain.DataItem; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | 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.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * å·¥åºè½è æ¥ |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/processEnergy/dailyProcessEnergy") |
| | | @Api(value = "å·¥åºè½èç»è®¡ï¼æ¥ï¼", tags = {"å·¥åºè½èç»è®¡"}) |
| | | public class DailyProcessEnergyController extends BaseController { |
| | | |
| | | @Autowired |
| | | private IModelNodeService modelNodeService; |
| | | |
| | | @Autowired |
| | | private IDailyProcessEnergyService dailyProcessEnergy; |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "å·¥åºè½èç»è®¡ï¼æ¥ï¼å表") |
| | | public AjaxResult list(DataItem dataItem) throws ParseException{ |
| | | 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<DailyProcessEnergy> dataList = new ArrayList<>(); |
| | | DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); |
| | | SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String aa= df.format(dataItem.getDataTime()); |
| | | String bb=""; |
| | | int i = 0; |
| | | dataItem.setBeginTime(dataItem.getDataTime()); |
| | | String endTime=aa+" 24:00:00"; |
| | | dataItem.setEndTime(sf.parse(endTime)); |
| | | while (i < 24) { |
| | | if(i>9){ |
| | | bb=aa+" "+i+":00:00"; |
| | | }else{ |
| | | bb=aa+" 0"+i+":00:00"; |
| | | } |
| | | DailyProcessEnergy report=new DailyProcessEnergy(); |
| | | report.setDataTime(sf.parse(bb)); |
| | | report.setValue("value"+i); |
| | | dataList.add(report); |
| | | i++; |
| | | } |
| | | List<DailyProcessEnergy> list = dailyProcessEnergy.getDailyProcessEnergyList(indexIds, dataList,dataItem.getBeginTime(),dataItem.getEndTime(), dataItem.getTimeType(),dataItem.getEnergyType()); |
| | | return success(list); |
| | | } |
| | | |
| | | @GetMapping("/listChart") |
| | | @ApiOperation(value = "å·¥åºè½èï¼æ¥ï¼å¾è¡¨") |
| | | public AjaxResult listChart(DataItem dataItem) throws ParseException { |
| | | DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); |
| | | SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String aa= df.format(dataItem.getDataTime()); |
| | | dataItem.setBeginTime(dataItem.getDataTime()); |
| | | String endTime=aa+" 24:00:00"; |
| | | dataItem.setEndTime(sf.parse(endTime)); |
| | | List<DailyProcessEnergy> list = dailyProcessEnergy.getListChart(dataItem.getIndexId(),dataItem.getBeginTime(),dataItem.getEndTime(), dataItem.getTimeType(),dataItem.getEnergyType()); |
| | | return AjaxResult.success(list); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.web.controller.processenergy; |
| | | |
| | | import com.zhitan.common.core.controller.BaseController; |
| | | import com.zhitan.common.core.domain.AjaxResult; |
| | | import com.zhitan.model.domain.EnergyIndex; |
| | | import com.zhitan.model.domain.ModelNode; |
| | | import com.zhitan.model.service.IModelNodeService; |
| | | import com.zhitan.processenergy.domain.MonthlyProcessEnergy; |
| | | import com.zhitan.processenergy.service.IMonthlyProcessEnergyService; |
| | | import com.zhitan.realtimedata.domain.DataItem; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | 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.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * å·¥åºè½è æ |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/processEnergy/monthlyProcessEnergy") |
| | | @Api(value = "å·¥åºè½èç»è®¡ï¼æï¼", tags = {"å·¥åºè½èç»è®¡"}) |
| | | public class MonthlyProcessEnergyController extends BaseController { |
| | | |
| | | @Autowired |
| | | private IModelNodeService modelNodeService; |
| | | @Autowired |
| | | private IMonthlyProcessEnergyService monthlyProcessEnergyService; |
| | | |
| | | /** |
| | | * |
| | | * @param dataItem |
| | | * @return |
| | | * @throws ParseException |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "å·¥åºè½èç»è®¡ï¼æï¼") |
| | | public AjaxResult list(DataItem dataItem) throws ParseException { |
| | | List<MonthlyProcessEnergy> 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"; |
| | | } |
| | | MonthlyProcessEnergy report = new MonthlyProcessEnergy(); |
| | | 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<>(); |
| | | MonthlyProcessEnergy reportList = new MonthlyProcessEnergy(); |
| | | 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<MonthlyProcessEnergy> list = monthlyProcessEnergyService.getMonthlyProcessEnergy(indexIds, dataList, dataItem.getBeginTime(), dataItem.getEndTime(), dataItem.getTimeType(), dataItem.getEnergyType()); |
| | | |
| | | return success(list); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param dataItem |
| | | * @return |
| | | * @throws ParseException |
| | | */ |
| | | @GetMapping("/listChart") |
| | | @ApiOperation(value = "éç¹è®¾å¤è½èç»è®¡ï¼æï¼å¾è¡¨") |
| | | 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"; |
| | | 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)); |
| | | List<MonthlyProcessEnergy> list = monthlyProcessEnergyService.getListChart(dataItem.getIndexId(), dataItem.getBeginTime(), dataItem.getEndTime(), dataItem.getTimeType(), dataItem.getEnergyType()); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param yearMonth |
| | | * @return |
| | | */ |
| | | public static String getLastDayOfMonth(String yearMonth) { |
| | | int year = Integer.parseInt(yearMonth.split("-")[0]); //å¹´ |
| | | int month = Integer.parseInt(yearMonth.split("-")[1]); //æ |
| | | Calendar cal = Calendar.getInstance(); |
| | | // 设置年份 |
| | | cal.set(Calendar.YEAR, year); |
| | | // 设置æä»½ |
| | | // cal.set(Calendar.MONTH, month - 1); |
| | | cal.set(Calendar.MONTH, month); //设置å½åæçä¸ä¸ä¸ªæ |
| | | // è·åæææå¤§å¤©æ° |
| | | //int lastDay = cal.getActualMaximum(Calendar.DATE); |
| | | int lastDay = cal.getMinimum(Calendar.DATE); //è·åæä»½ä¸çæå°å¼ï¼å³ç¬¬ä¸å¤© |
| | | // 设置æ¥å䏿份çæå¤§å¤©æ° |
| | | //cal.set(Calendar.DAY_OF_MONTH, lastDay); |
| | | cal.set(Calendar.DAY_OF_MONTH, lastDay - 1); //䏿ç第ä¸å¤©åå»1å°±æ¯å½æçæåä¸å¤© |
| | | // æ ¼å¼åæ¥æ |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | return sdf.format(cal.getTime()); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.web.controller.processenergy; |
| | | |
| | | 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.utils.DateTimeUtil; |
| | | import com.zhitan.common.utils.TypeTime; |
| | | import com.zhitan.model.domain.EnergyIndex; |
| | | import com.zhitan.model.domain.ModelNode; |
| | | import com.zhitan.model.service.IModelNodeService; |
| | | import com.zhitan.processenergy.domain.YearProcessEnergy; |
| | | import com.zhitan.processenergy.service.IYearProcessEnergyService; |
| | | 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.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.text.ParseException; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * å·¥åºè½è å¹´ |
| | | * |
| | | * |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/processEnergy/YearProcessEnergy") |
| | | @Api(value = "å·¥åºè½èç»è®¡ï¼å¹´ï¼", tags = {"å·¥åºè½èç»è®¡"}) |
| | | public class YearProcessEnergyController extends BaseController { |
| | | |
| | | @Autowired |
| | | private IModelNodeService modelNodeService; |
| | | |
| | | @Autowired |
| | | private IYearProcessEnergyService yearProcessEnergyService; |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "å·¥åºè½èç»è®¡ï¼å¹´ï¼å表") |
| | | private AjaxResult list(DataItemQueryDTO dataItem) throws ParseException{ |
| | | 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()); |
| | | |
| | | Date convertTime = DateTimeUtil.getTypeTime(dataItem.getTimeType(), dataItem.getDataTime()); |
| | | DateTime beginTime = DateUtil.beginOfYear(convertTime); |
| | | DateTime endTime = DateUtil.endOfYear(convertTime); |
| | | |
| | | List<TypeTime> typeTimeList = DateTimeUtil.getDateTimeList(dataItem.getTimeType(),convertTime); |
| | | |
| | | List<YearProcessEnergy> list = yearProcessEnergyService.getYearProcessEnergy(indexIds, typeTimeList,beginTime,endTime, dataItem.getTimeType(),dataItem.getEnergyType()); |
| | | return success(list); |
| | | } |
| | | |
| | | @GetMapping("/listChart") |
| | | @ApiOperation(value = "å·¥åºè½èï¼å¹´ï¼å¾è¡¨") |
| | | public AjaxResult listChart(DataItemQueryDTO queryDto) { |
| | | List<YearProcessEnergy> list = yearProcessEnergyService.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: æ¶é´å·¥å
·ç±» |
| | |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®æ¶é´ç±»åæå符串转æå¯¹åºçæ¶é´ |
| | | * timeType="HOUR",time="2025-02-01"ï¼è¿å"2025-02-01 01:00:00" |
| | | * timeType="DAY",time="2025-02"ï¼è¿å"2025-02-01 01:00:00" |
| | | * timeType="MONTH",time="2025"ï¼è¿å"2025-02-01 01:00:00" |
| | | * |
| | | * @param timeType æ¶é´ç±»å |
| | | * @param time æ¶é´å符串 |
| | | * @return |
| | | */ |
| | | public static Date getTypeTime(String timeType, String time) { |
| | | Date dt = null; |
| | | timeType = StringUtil.ifEmptyOrNullReturnValue(timeType).toUpperCase(); |
| | | switch (timeType) { |
| | | case TimeTypeConst.TIME_TYPE_HOUR: |
| | | dt = toDateTime(time, COMMON_PATTERN_TO_DAY); |
| | | break; |
| | | case TimeTypeConst.TIME_TYPE_DAY: |
| | | dt = toDateTime(time, COMMON_PATTERN_TO_MONTH); |
| | | break; |
| | | case TimeTypeConst.TIME_TYPE_MONTH: |
| | | dt = toDateTime(time, COMMON_PATTERN_YEAR); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | return dt; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®æ¶é´ç±»åæè¿ç»çæ¥æå符串转æå¯¹åºçæ¶é´ ï¼202303ã20230303ã2023030301ã202303030101ï¼ |
| | | * |
| | | * @param timeType æ¶é´ç±»å |
| | |
| | | * @param val 计ç®å¼ |
| | | * @return |
| | | */ |
| | | public static Date productionCycleCal(Date date, String cycleType,int val) { |
| | | public static Date productionCycleCal(Date date, String cycleType, int val) { |
| | | Date momDate = date; |
| | | switch (cycleType) { |
| | | case TimeTypeConst.TIME_TYPE_HOUR: |
| | |
| | | } |
| | | return momDate; |
| | | } |
| | | |
| | | /** |
| | | * éè¿æ¶é´ç±»åè¿å对åºçæ¶é´list |
| | | * <p> |
| | | * åæ°ï¼ |
| | | * timeType="YEAR",dataTime="2025-01-01 00:00:00" |
| | | * timeType="MONTH",dataTime="2025-01-01 00:00:00" |
| | | * timeType="DAY",dataTime="2025-01-01 00:00:00" |
| | | * è¿åæ ¼å¼ï¼ |
| | | * [ |
| | | * {"datatime":"2025-01-01 00:00:00","value":"value1"}, |
| | | * {"datatime":"2025-02-01 00:00:00","value":"value2"}, |
| | | * {"datatime":"2025-03-01 00:00:00","value":"value3"}, |
| | | * {"datatime":"2025-04-01 00:00:00","value":"value4"}, |
| | | * {"datatime":"2025-05-01 00:00:00","value":"value5"}, |
| | | * {"datatime":"2025-06-01 00:00:00","value":"value6"}, |
| | | * {"datatime":"2025-07-01 00:00:00","value":"value7"}, |
| | | * {"datatime":"2025-08-01 00:00:00","value":"value8"}, |
| | | * {"datatime":"2025-09-01 00:00:00","value":"value9"}, |
| | | * {"datatime":"2025-10-01 00:00:00","value":"value10"}, |
| | | * {"datatime":"2025-11-01 00:00:00","value":"value11"}, |
| | | * {"datatime":"2025-12-01 00:00:00","value":"value12"} |
| | | * ] |
| | | * |
| | | * @param timeType |
| | | * @param dataTime |
| | | * @return |
| | | */ |
| | | public static List<TypeTime> getDateTimeList(String timeType, Date dataTime) { |
| | | |
| | | List<TypeTime> resultList = new ArrayList<>(); |
| | | Date beginTime; |
| | | switch (timeType) { |
| | | case TimeTypeConst.TIME_TYPE_HOUR: |
| | | beginTime = DateUtil.beginOfDay(dataTime); |
| | | for (int i = 1; i <= 24; i++) { |
| | | TypeTime typeTime = new TypeTime(); |
| | | typeTime.setDataTime(DateUtil.format(beginTime, COMMON_PATTERN)); |
| | | typeTime.setTimeCode(CommonConst.WORD_H + DateUtil.format(beginTime, COMMON_PATTERN_HOUR)); |
| | | typeTime.setDateTime(beginTime); |
| | | typeTime.setValue("value" + i); |
| | | resultList.add(typeTime); |
| | | beginTime = addHours(beginTime, 1); |
| | | } |
| | | break; |
| | | case TimeTypeConst.TIME_TYPE_DAY: |
| | | beginTime = DateUtil.beginOfMonth(dataTime); |
| | | for (int i = 1; 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.setDateTime(beginTime); |
| | | typeTime.setValue("value" + i); |
| | | resultList.add(typeTime); |
| | | beginTime = addDays(beginTime, 1); |
| | | } |
| | | break; |
| | | case TimeTypeConst.TIME_TYPE_MONTH: |
| | | beginTime = DateUtil.beginOfYear(dataTime); |
| | | for (int i = 1; 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.setDateTime(beginTime); |
| | | typeTime.setValue("value" + i); |
| | | resultList.add(typeTime); |
| | | beginTime = addMonths(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; |
| | | |
| | | /** |
| | | *éç¹è®¾å¤è½èç»è®¡ å¹´ |
| | | * éç¹è®¾å¤è½èç»è®¡ å¹´ |
| | | * |
| | | * @author sys |
| | | * @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); |
| | | 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.processenergy.domain; |
| | | |
| | | import com.zhitan.common.annotation.Excel; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | *å·¥åºè½è æ¥ |
| | | * |
| | | * @author sys |
| | | * @date 2021-01-11 |
| | | */ |
| | | @Data |
| | | public class DailyProcessEnergy implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | private String indexId; |
| | | @Excel(name = "ææ åç§°") |
| | | private String indexName; |
| | | private String value; |
| | | private Date dataTime; |
| | | private String timeType; |
| | | private String timeCode; |
| | | private String unitId; |
| | | @Excel(name = "1æ¶") |
| | | private Double value1; |
| | | @Excel(name = "2æ¶") |
| | | private Double value2; |
| | | @Excel(name = "3æ¶") |
| | | private Double value3; |
| | | @Excel(name = "4æ¶") |
| | | private Double value4; |
| | | @Excel(name = "5æ¶") |
| | | private Double value5; |
| | | @Excel(name = "6æ¶") |
| | | private Double value6; |
| | | @Excel(name = "7æ¶") |
| | | private Double value7; |
| | | @Excel(name = "8æ¶") |
| | | private Double value8; |
| | | @Excel(name = "9æ¶") |
| | | private Double value9; |
| | | @Excel(name = "10æ¶") |
| | | private Double value10; |
| | | @Excel(name = "11æ¶") |
| | | private Double value11; |
| | | @Excel(name = "12æ¶") |
| | | private Double value12; |
| | | @Excel(name = "13æ¶") |
| | | private Double value13; |
| | | @Excel(name = "14æ¶") |
| | | private Double value14; |
| | | @Excel(name = "15æ¶") |
| | | private Double value15; |
| | | @Excel(name = "16æ¶") |
| | | private Double value16; |
| | | @Excel(name = "17æ¶") |
| | | private Double value17; |
| | | @Excel(name = "18æ¶") |
| | | private Double value18; |
| | | @Excel(name = "19æ¶") |
| | | private Double value19; |
| | | @Excel(name = "20æ¶") |
| | | private Double value20; |
| | | @Excel(name = "21æ¶") |
| | | private Double value21; |
| | | @Excel(name = "22æ¶") |
| | | private Double value22; |
| | | @Excel(name = "23æ¶") |
| | | private Double value23; |
| | | @Excel(name = "0æ¶") |
| | | private Double value0; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.processenergy.domain; |
| | | |
| | | import com.zhitan.common.annotation.Excel; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | *å·¥åºè½è æ |
| | | * |
| | | * @author sys |
| | | * @date 2021-01-11 |
| | | */ |
| | | public class MonthlyProcessEnergy implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | private String indexId; |
| | | @Excel(name = "ææ åç§°") |
| | | private String indexName; |
| | | private String value; |
| | | private Date dataTime; |
| | | private String timeType; |
| | | private String timeCode; |
| | | @Excel(name = "1æ¥") |
| | | private Double value1; |
| | | @Excel(name = "2æ¥") |
| | | private Double value2; |
| | | @Excel(name = "3æ¥") |
| | | private Double value3; |
| | | @Excel(name = "4æ¥") |
| | | private Double value4; |
| | | @Excel(name = "5æ¥") |
| | | private Double value5; |
| | | @Excel(name = "6æ¥") |
| | | private Double value6; |
| | | @Excel(name = "7æ¥") |
| | | private Double value7; |
| | | @Excel(name = "8æ¥") |
| | | private Double value8; |
| | | @Excel(name = "9æ¥") |
| | | private Double value9; |
| | | @Excel(name = "10æ¥") |
| | | private Double value10; |
| | | @Excel(name = "11æ¥") |
| | | private Double value11; |
| | | @Excel(name = "12æ¥") |
| | | private Double value12; |
| | | @Excel(name = "13æ¥") |
| | | private Double value13; |
| | | @Excel(name = "14æ¥") |
| | | private Double value14; |
| | | @Excel(name = "15æ¥") |
| | | private Double value15; |
| | | @Excel(name = "16æ¥") |
| | | private Double value16; |
| | | @Excel(name = "17æ¥") |
| | | private Double value17; |
| | | @Excel(name = "18æ¥") |
| | | private Double value18; |
| | | @Excel(name = "19æ¥") |
| | | private Double value19; |
| | | @Excel(name = "20æ¥") |
| | | private Double value20; |
| | | @Excel(name = "21æ¥") |
| | | private Double value21; |
| | | @Excel(name = "22æ¥") |
| | | private Double value22; |
| | | @Excel(name = "23æ¥") |
| | | private Double value23; |
| | | @Excel(name = "24æ¥") |
| | | private Double value24; |
| | | @Excel(name = "25æ¥") |
| | | private Double value25; |
| | | @Excel(name = "26æ¥") |
| | | private Double value26; |
| | | @Excel(name = "27æ¥") |
| | | private Double value27; |
| | | @Excel(name = "28æ¥") |
| | | private Double value28; |
| | | @Excel(name = "29æ¥") |
| | | private Double value29; |
| | | @Excel(name = "30æ¥") |
| | | private Double value30; |
| | | @Excel(name = "31æ¥") |
| | | private Double value31; |
| | | private Integer count; |
| | | private String unitId; |
| | | /** æ»è®°å½æ° */ |
| | | private long total; |
| | | private List<Map> tablehead =new ArrayList<>(); |
| | | private List<MonthlyProcessEnergy> tabledata =new ArrayList<MonthlyProcessEnergy>(); |
| | | public String getIndexId() { |
| | | return indexId; |
| | | } |
| | | |
| | | public void setIndexId(String indexId) { |
| | | this.indexId = indexId; |
| | | } |
| | | |
| | | public String getIndexName() { |
| | | return indexName; |
| | | } |
| | | |
| | | public void setIndexName(String indexName) { |
| | | this.indexName = indexName; |
| | | } |
| | | public String getUnitId() { |
| | | return unitId; |
| | | } |
| | | |
| | | public void setUnitId(String unitId) { |
| | | this.unitId = unitId; |
| | | } |
| | | |
| | | public String getTimeCode() { |
| | | return timeCode; |
| | | } |
| | | |
| | | public void setTimeCode(String timeCode) { |
| | | this.timeCode = timeCode; |
| | | } |
| | | |
| | | public String getValue() { |
| | | return value; |
| | | } |
| | | |
| | | public void setValue(String value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | public String getTimeType() { |
| | | return timeType; |
| | | } |
| | | |
| | | public void setTimeType(String timeType) { |
| | | this.timeType = timeType; |
| | | } |
| | | |
| | | public Date getDataTime() { |
| | | return dataTime; |
| | | } |
| | | |
| | | public void setDataTime(Date dataTime) { |
| | | this.dataTime = dataTime; |
| | | } |
| | | |
| | | public Double getValue1() { |
| | | return value1; |
| | | } |
| | | |
| | | public void setValue1(Double value1) { |
| | | this.value1 = value1; |
| | | } |
| | | |
| | | public Double getValue2() { |
| | | return value2; |
| | | } |
| | | |
| | | public void setValue2(Double value2) { |
| | | this.value2 = value2; |
| | | } |
| | | |
| | | public Double getValue3() { |
| | | return value3; |
| | | } |
| | | |
| | | public void setValue3(Double value3) { |
| | | this.value3 = value3; |
| | | } |
| | | |
| | | public Double getValue4() { |
| | | return value4; |
| | | } |
| | | |
| | | public void setValue4(Double value4) { |
| | | this.value4 = value4; |
| | | } |
| | | |
| | | public Double getValue5() { |
| | | return value5; |
| | | } |
| | | |
| | | public void setValue5(Double value5) { |
| | | this.value5 = value5; |
| | | } |
| | | |
| | | public Double getValue6() { |
| | | return value6; |
| | | } |
| | | |
| | | public void setValue6(Double value6) { |
| | | this.value6 = value6; |
| | | } |
| | | |
| | | public Double getValue7() { |
| | | return value7; |
| | | } |
| | | |
| | | public void setValue7(Double value7) { |
| | | this.value7 = value7; |
| | | } |
| | | |
| | | public Double getValue8() { |
| | | return value8; |
| | | } |
| | | |
| | | public void setValue8(Double value8) { |
| | | this.value8 = value8; |
| | | } |
| | | |
| | | public Double getValue9() { |
| | | return value9; |
| | | } |
| | | |
| | | public void setValue9(Double value9) { |
| | | this.value9 = value9; |
| | | } |
| | | |
| | | public Double getValue10() { |
| | | return value10; |
| | | } |
| | | |
| | | public void setValue10(Double value10) { |
| | | this.value10 = value10; |
| | | } |
| | | |
| | | public Double getValue11() { |
| | | return value11; |
| | | } |
| | | |
| | | public void setValue11(Double value11) { |
| | | this.value11 = value11; |
| | | } |
| | | |
| | | public Double getValue12() { |
| | | return value12; |
| | | } |
| | | |
| | | public void setValue12(Double value12) { |
| | | this.value12 = value12; |
| | | } |
| | | |
| | | public Double getValue13() { |
| | | return value13; |
| | | } |
| | | |
| | | public void setValue13(Double value13) { |
| | | this.value13 = value13; |
| | | } |
| | | |
| | | public Double getValue14() { |
| | | return value14; |
| | | } |
| | | |
| | | public void setValue14(Double value14) { |
| | | this.value14 = value14; |
| | | } |
| | | |
| | | public Double getValue15() { |
| | | return value15; |
| | | } |
| | | |
| | | public void setValue15(Double value15) { |
| | | this.value15 = value15; |
| | | } |
| | | |
| | | public Double getValue16() { |
| | | return value16; |
| | | } |
| | | |
| | | public void setValue16(Double value16) { |
| | | this.value16 = value16; |
| | | } |
| | | |
| | | public Double getValue17() { |
| | | return value17; |
| | | } |
| | | |
| | | public void setValue17(Double value17) { |
| | | this.value17 = value17; |
| | | } |
| | | |
| | | public Double getValue18() { |
| | | return value18; |
| | | } |
| | | |
| | | public void setValue18(Double value18) { |
| | | this.value18 = value18; |
| | | } |
| | | |
| | | public Double getValue19() { |
| | | return value19; |
| | | } |
| | | |
| | | public void setValue19(Double value19) { |
| | | this.value19 = value19; |
| | | } |
| | | |
| | | public Double getValue20() { |
| | | return value20; |
| | | } |
| | | |
| | | public void setValue20(Double value20) { |
| | | this.value20 = value20; |
| | | } |
| | | |
| | | public Double getValue21() { |
| | | return value21; |
| | | } |
| | | |
| | | public void setValue21(Double value21) { |
| | | this.value21 = value21; |
| | | } |
| | | |
| | | public Double getValue22() { |
| | | return value22; |
| | | } |
| | | |
| | | public void setValue22(Double value22) { |
| | | this.value22 = value22; |
| | | } |
| | | |
| | | public Double getValue23() { |
| | | return value23; |
| | | } |
| | | |
| | | public void setValue23(Double value23) { |
| | | this.value23 = value23; |
| | | } |
| | | |
| | | public Double getValue24() { |
| | | return value24; |
| | | } |
| | | |
| | | public void setValue24(Double value24) { |
| | | this.value24 = value24; |
| | | } |
| | | |
| | | public Double getValue25() { |
| | | return value25; |
| | | } |
| | | |
| | | public void setValue25(Double value25) { |
| | | this.value25 = value25; |
| | | } |
| | | |
| | | public Double getValue26() { |
| | | return value26; |
| | | } |
| | | |
| | | public void setValue26(Double value26) { |
| | | this.value26 = value26; |
| | | } |
| | | |
| | | public Double getValue27() { |
| | | return value27; |
| | | } |
| | | |
| | | public void setValue27(Double value27) { |
| | | this.value27 = value27; |
| | | } |
| | | |
| | | public Double getValue28() { |
| | | return value28; |
| | | } |
| | | |
| | | public void setValue28(Double value28) { |
| | | this.value28 = value28; |
| | | } |
| | | |
| | | public Double getValue29() { |
| | | return value29; |
| | | } |
| | | |
| | | public void setValue29(Double value29) { |
| | | this.value29 = value29; |
| | | } |
| | | |
| | | public Double getValue30() { |
| | | return value30; |
| | | } |
| | | |
| | | public void setValue30(Double value30) { |
| | | this.value30 = value30; |
| | | } |
| | | |
| | | public Double getValue31() { |
| | | return value31; |
| | | } |
| | | |
| | | public void setValue31(Double value31) { |
| | | this.value31 = value31; |
| | | } |
| | | |
| | | public List<Map> getTablehead() { |
| | | return tablehead; |
| | | } |
| | | |
| | | public void setTablehead(List<Map> tablehead) { |
| | | this.tablehead = tablehead; |
| | | } |
| | | public List<MonthlyProcessEnergy> getTabledata() { |
| | | return tabledata; |
| | | } |
| | | |
| | | public void setTabledata(List<MonthlyProcessEnergy> tabledata) { |
| | | this.tabledata = tabledata; |
| | | } |
| | | |
| | | public Integer getCount() { |
| | | return count; |
| | | } |
| | | |
| | | public void setCount(Integer count) { |
| | | this.count = count; |
| | | } |
| | | |
| | | public long getTotal() { |
| | | return total; |
| | | } |
| | | |
| | | public void setTotal(long total) { |
| | | this.total = total; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.processenergy.domain; |
| | | |
| | | import com.zhitan.common.annotation.Excel; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | *å·¥åºè½è æ |
| | | * |
| | | * @author sys |
| | | * @date 2021-01-11 |
| | | */ |
| | | public class YearProcessEnergy implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | private String indexId; |
| | | @Excel(name = "ææ åç§°") |
| | | private String indexName; |
| | | private String value; |
| | | private Date dataTime; |
| | | private String timeType; |
| | | private String timeCode; |
| | | @Excel(name = "1æ") |
| | | private Double value1; |
| | | @Excel(name = "2æ") |
| | | private Double value2; |
| | | @Excel(name = "3æ") |
| | | private Double value3; |
| | | @Excel(name = "4æ") |
| | | private Double value4; |
| | | @Excel(name = "5æ") |
| | | private Double value5; |
| | | @Excel(name = "6æ") |
| | | private Double value6; |
| | | @Excel(name = "7æ") |
| | | private Double value7; |
| | | @Excel(name = "8æ") |
| | | private Double value8; |
| | | @Excel(name = "9æ") |
| | | private Double value9; |
| | | @Excel(name = "10æ") |
| | | private Double value10; |
| | | @Excel(name = "11æ") |
| | | private Double value11; |
| | | @Excel(name = "12æ") |
| | | private Double value12; |
| | | private Integer count; |
| | | private String unitId; |
| | | /** æ»è®°å½æ° */ |
| | | private long total; |
| | | private List<Map> tablehead =new ArrayList<>(); |
| | | private List<YearProcessEnergy> tabledata =new ArrayList<YearProcessEnergy>(); |
| | | public String getIndexId() { |
| | | return indexId; |
| | | } |
| | | |
| | | public void setIndexId(String indexId) { |
| | | this.indexId = indexId; |
| | | } |
| | | |
| | | public String getIndexName() { |
| | | return indexName; |
| | | } |
| | | |
| | | public void setIndexName(String indexName) { |
| | | this.indexName = indexName; |
| | | } |
| | | public String getUnitId() { |
| | | return unitId; |
| | | } |
| | | |
| | | public void setUnitId(String unitId) { |
| | | this.unitId = unitId; |
| | | } |
| | | |
| | | public String getTimeCode() { |
| | | return timeCode; |
| | | } |
| | | |
| | | public void setTimeCode(String timeCode) { |
| | | this.timeCode = timeCode; |
| | | } |
| | | |
| | | public String getValue() { |
| | | return value; |
| | | } |
| | | |
| | | public void setValue(String value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | public String getTimeType() { |
| | | return timeType; |
| | | } |
| | | |
| | | public void setTimeType(String timeType) { |
| | | this.timeType = timeType; |
| | | } |
| | | |
| | | public Date getDataTime() { |
| | | return dataTime; |
| | | } |
| | | |
| | | public void setDataTime(Date dataTime) { |
| | | this.dataTime = dataTime; |
| | | } |
| | | |
| | | public Double getValue1() { |
| | | return value1; |
| | | } |
| | | |
| | | public void setValue1(Double value1) { |
| | | this.value1 = value1; |
| | | } |
| | | |
| | | public Double getValue2() { |
| | | return value2; |
| | | } |
| | | |
| | | public void setValue2(Double value2) { |
| | | this.value2 = value2; |
| | | } |
| | | |
| | | public Double getValue3() { |
| | | return value3; |
| | | } |
| | | |
| | | public void setValue3(Double value3) { |
| | | this.value3 = value3; |
| | | } |
| | | |
| | | public Double getValue4() { |
| | | return value4; |
| | | } |
| | | |
| | | public void setValue4(Double value4) { |
| | | this.value4 = value4; |
| | | } |
| | | |
| | | public Double getValue5() { |
| | | return value5; |
| | | } |
| | | |
| | | public void setValue5(Double value5) { |
| | | this.value5 = value5; |
| | | } |
| | | |
| | | public Double getValue6() { |
| | | return value6; |
| | | } |
| | | |
| | | public void setValue6(Double value6) { |
| | | this.value6 = value6; |
| | | } |
| | | |
| | | public Double getValue7() { |
| | | return value7; |
| | | } |
| | | |
| | | public void setValue7(Double value7) { |
| | | this.value7 = value7; |
| | | } |
| | | |
| | | public Double getValue8() { |
| | | return value8; |
| | | } |
| | | |
| | | public void setValue8(Double value8) { |
| | | this.value8 = value8; |
| | | } |
| | | |
| | | public Double getValue9() { |
| | | return value9; |
| | | } |
| | | |
| | | public void setValue9(Double value9) { |
| | | this.value9 = value9; |
| | | } |
| | | |
| | | public Double getValue10() { |
| | | return value10; |
| | | } |
| | | |
| | | public void setValue10(Double value10) { |
| | | this.value10 = value10; |
| | | } |
| | | |
| | | public Double getValue11() { |
| | | return value11; |
| | | } |
| | | |
| | | public void setValue11(Double value11) { |
| | | this.value11 = value11; |
| | | } |
| | | |
| | | public Double getValue12() { |
| | | return value12; |
| | | } |
| | | |
| | | public void setValue12(Double value12) { |
| | | this.value12 = value12; |
| | | } |
| | | |
| | | public List<Map> getTablehead() { |
| | | return tablehead; |
| | | } |
| | | |
| | | public void setTablehead(List<Map> tablehead) { |
| | | this.tablehead = tablehead; |
| | | } |
| | | public List<YearProcessEnergy> getTabledata() { |
| | | return tabledata; |
| | | } |
| | | |
| | | public void setTabledata(List<YearProcessEnergy> tabledata) { |
| | | this.tabledata = tabledata; |
| | | } |
| | | |
| | | public Integer getCount() { |
| | | return count; |
| | | } |
| | | |
| | | public void setCount(Integer count) { |
| | | this.count = count; |
| | | } |
| | | |
| | | public long getTotal() { |
| | | return total; |
| | | } |
| | | |
| | | public void setTotal(long total) { |
| | | this.total = total; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.processenergy.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; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.processenergy.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zhitan.processenergy.domain.DailyProcessEnergy; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | *å·¥åºè½è æ¥ |
| | | * |
| | | * @author sys |
| | | */ |
| | | public interface DailyProcessEnergyMapper extends BaseMapper<DailyProcessEnergy> { |
| | | |
| | | /** |
| | | * |
| | | * @param indexIds |
| | | * @param dataList |
| | | * @param beginTime |
| | | * @param endTime |
| | | * @param timeType |
| | | * @param indexStorageId |
| | | * @return |
| | | */ |
| | | List<DailyProcessEnergy> getDailyProcessEnergyList(@Param("indexIds") List<String> indexIds, |
| | | @Param("dataList") List<DailyProcessEnergy> dataList, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") String timeType, |
| | | @Param("indexStorageId") String indexStorageId); |
| | | |
| | | /** |
| | | * |
| | | * @param indexId |
| | | * @param beginTime |
| | | * @param endTime |
| | | * @param timeType |
| | | * @param indexStorageId |
| | | * @return |
| | | */ |
| | | List<DailyProcessEnergy> getListChart(@Param("indexId") String indexId, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") String timeType, |
| | | @Param("indexStorageId") String indexStorageId); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.processenergy.mapper; |
| | | |
| | | import com.zhitan.processenergy.domain.MonthlyProcessEnergy; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | *å·¥åºè½è æ¥ |
| | | * |
| | | * @author sys |
| | | */ |
| | | public interface MonthlyProcessEnergyMapper { |
| | | |
| | | /** |
| | | * |
| | | * @param indexIds |
| | | * @param dataList |
| | | * @param beginTime |
| | | * @param endTime |
| | | * @param timeType |
| | | * @param indexStorageId |
| | | * @return |
| | | */ |
| | | List<MonthlyProcessEnergy> getMonthlyProcessEnergy(@Param("indexIds") List<String> indexIds, |
| | | @Param("dataList") List<MonthlyProcessEnergy> dataList, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") String timeType, |
| | | @Param("indexStorageId") String indexStorageId); |
| | | |
| | | /** |
| | | * |
| | | * @param indexId |
| | | * @param beginTime |
| | | * @param endTime |
| | | * @param timeType |
| | | * @param indexStorageId |
| | | * @return |
| | | */ |
| | | List<MonthlyProcessEnergy> getListChart(@Param("indexId") String indexId, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") String timeType, |
| | | @Param("indexStorageId") String indexStorageId); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.processenergy.mapper; |
| | | |
| | | import com.zhitan.common.utils.TypeTime; |
| | | import com.zhitan.processenergy.domain.YearProcessEnergy; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | *å·¥åºè½è æ¥ |
| | | * |
| | | * @author sys |
| | | */ |
| | | public interface YearProcessEnergyMapper { |
| | | |
| | | /** |
| | | * |
| | | * @param indexIds |
| | | * @param dataList |
| | | * @param beginTime |
| | | * @param endTime |
| | | * @param timeType |
| | | * @param indexStorageId |
| | | * @return |
| | | */ |
| | | List<YearProcessEnergy> getYearProcessEnergy(@Param("indexIds") List<String> indexIds, |
| | | @Param("dataList") List<TypeTime> dataList, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") String timeType, |
| | | @Param("indexStorageId") String indexStorageId); |
| | | |
| | | /** |
| | | * |
| | | * @param indexId |
| | | * @param beginTime |
| | | * @param endTime |
| | | * @param timeType |
| | | * @return |
| | | */ |
| | | List<YearProcessEnergy> getListChart(@Param("indexId") String indexId, |
| | | @Param("beginTime") Date beginTime, |
| | | @Param("endTime") Date endTime, |
| | | @Param("timeType") String timeType); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.processenergy.service; |
| | | |
| | | import com.zhitan.processenergy.domain.DailyProcessEnergy; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | *å·¥åºè½è æ¥ |
| | | * |
| | | * @author sys |
| | | * @date 2021-01-11 |
| | | */ |
| | | public interface IDailyProcessEnergyService { |
| | | |
| | | /** |
| | | * |
| | | * @param indexIds |
| | | * @param dataList |
| | | * @param beginTime |
| | | * @param endTime |
| | | * @param timeType |
| | | * @param indexStorageId |
| | | * @return |
| | | */ |
| | | List<DailyProcessEnergy> getDailyProcessEnergyList(List<String> indexIds, List<DailyProcessEnergy> dataList, Date beginTime, Date endTime, String timeType, String indexStorageId); |
| | | |
| | | /** |
| | | * |
| | | * @param indexId |
| | | * @param beginTime |
| | | * @param endTime |
| | | * @param timeType |
| | | * @param indexStorageId |
| | | * @return |
| | | */ |
| | | List<DailyProcessEnergy> getListChart(String indexId, Date beginTime, Date endTime, String timeType, String indexStorageId); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.processenergy.service; |
| | | |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.processenergy.domain.MonthlyProcessEnergy; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | *å·¥åºè½è æ¥ |
| | | * |
| | | * @author sys |
| | | * @date 2021-01-11 |
| | | */ |
| | | public interface IMonthlyProcessEnergyService { |
| | | public List<MonthlyProcessEnergy> getMonthlyProcessEnergy(List<String> indexIds, List<MonthlyProcessEnergy> dataList, Date beginTime, Date endTime, String timeType, String indexStorageId); |
| | | |
| | | List<MonthlyProcessEnergy> getListChart(String indexId, Date beginTime, Date endTime, String timeType, String indexStorageId); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.processenergy.service; |
| | | |
| | | import com.zhitan.common.utils.TypeTime; |
| | | import com.zhitan.processenergy.domain.YearProcessEnergy; |
| | | import com.zhitan.realtimedata.domain.dto.DataItemQueryDTO; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | *å·¥åºè½è æ¥ |
| | | * |
| | | * @author sys |
| | | * @date 2021-01-11 |
| | | */ |
| | | public interface IYearProcessEnergyService { |
| | | |
| | | List<YearProcessEnergy> getYearProcessEnergy(List<String> indexIds, List<TypeTime> dataList, Date beginTime, Date endTime, String timeType, String indexStorageId); |
| | | |
| | | /** |
| | | * |
| | | * @param queryDto |
| | | * @return |
| | | */ |
| | | List<YearProcessEnergy> getListChart(DataItemQueryDTO queryDto); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.processenergy.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zhitan.processenergy.domain.DailyProcessEnergy; |
| | | import com.zhitan.processenergy.mapper.DailyProcessEnergyMapper; |
| | | import com.zhitan.processenergy.service.IDailyProcessEnergyService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | *éç¹è®¾å¤è½èç»è®¡ æ¥ |
| | | * |
| | | * @author sys |
| | | * @date 2021-01-11 |
| | | */ |
| | | @Service |
| | | public class DailyProcessEnergyServiceImpl extends ServiceImpl<DailyProcessEnergyMapper,DailyProcessEnergy> implements IDailyProcessEnergyService { |
| | | |
| | | |
| | | @Override |
| | | public List<DailyProcessEnergy> getDailyProcessEnergyList(List<String> indexIds, List<DailyProcessEnergy> dataList, Date beginTime, Date endTime, String timeType, String indexStorageId){ |
| | | if (indexIds != null && !indexIds.isEmpty()){ |
| | | return baseMapper.getDailyProcessEnergyList(indexIds, dataList, beginTime, endTime, timeType, indexStorageId); |
| | | } |
| | | return Collections.emptyList(); |
| | | } |
| | | |
| | | @Override |
| | | public List<DailyProcessEnergy> getListChart(String indexId, Date beginTime, Date endTime, String timeType, String indexStorageId){ |
| | | if (indexId != null && !indexId.isEmpty()) { |
| | | return baseMapper.getListChart(indexId,beginTime,endTime,timeType,indexStorageId); |
| | | } |
| | | return Collections.emptyList(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.processenergy.service.impl; |
| | | |
| | | import com.zhitan.common.enums.TimeType; |
| | | import com.zhitan.processenergy.domain.MonthlyProcessEnergy; |
| | | import com.zhitan.processenergy.mapper.MonthlyProcessEnergyMapper; |
| | | import com.zhitan.processenergy.service.IMonthlyProcessEnergyService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Collections; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | *éç¹è®¾å¤è½èç»è®¡ æ¥ |
| | | * |
| | | * @author sys |
| | | * @date 2021-01-11 |
| | | */ |
| | | @Service |
| | | public class MonthlyProcessEnergyServiceImpl implements IMonthlyProcessEnergyService { |
| | | |
| | | @Resource |
| | | private MonthlyProcessEnergyMapper monthlyProcessEnergyMapper; |
| | | |
| | | @Override |
| | | public List<MonthlyProcessEnergy> getMonthlyProcessEnergy(List<String> indexIds, List<MonthlyProcessEnergy> dataList, Date beginTime, Date endTime, String timeType, String indexStorageId){ |
| | | if (indexIds != null && !indexIds.isEmpty()){ |
| | | return monthlyProcessEnergyMapper.getMonthlyProcessEnergy(indexIds, dataList, beginTime, endTime, timeType, indexStorageId); |
| | | } |
| | | return Collections.emptyList(); |
| | | } |
| | | |
| | | @Override |
| | | public List<MonthlyProcessEnergy> getListChart(String indexId, Date beginTime, Date endTime, String timeType, String indexStorageId){ |
| | | if (indexId != null && !indexId.isEmpty()) { |
| | | return monthlyProcessEnergyMapper.getListChart(indexId,beginTime,endTime,timeType,indexStorageId); |
| | | } |
| | | return Collections.emptyList(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.zhitan.processenergy.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.zhitan.common.utils.DateTimeUtil; |
| | | import com.zhitan.common.utils.TypeTime; |
| | | import com.zhitan.processenergy.domain.YearProcessEnergy; |
| | | import com.zhitan.processenergy.mapper.YearProcessEnergyMapper; |
| | | import com.zhitan.processenergy.service.IYearProcessEnergyService; |
| | | import com.zhitan.realtimedata.domain.dto.DataItemQueryDTO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.annotation.Resources; |
| | | import java.util.Collections; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | *éç¹è®¾å¤è½èç»è®¡ å¹´ |
| | | * |
| | | * @author sys |
| | | * @date 2021-01-11 |
| | | */ |
| | | @Service |
| | | public class YearProcessEnergyServiceImpl implements IYearProcessEnergyService { |
| | | |
| | | @Resource |
| | | private YearProcessEnergyMapper yearProcessEnergyMapper; |
| | | |
| | | @Override |
| | | public List<YearProcessEnergy> getYearProcessEnergy(List<String> indexIds, List<TypeTime> dataList, Date beginTime, Date endTime, String timeType, String indexStorageId){ |
| | | if (indexIds != null && !indexIds.isEmpty()) { |
| | | return yearProcessEnergyMapper.getYearProcessEnergy(indexIds, dataList, beginTime, endTime, timeType, indexStorageId); |
| | | } |
| | | return Collections.emptyList(); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param queryDto |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<YearProcessEnergy> getListChart(DataItemQueryDTO queryDto) { |
| | | |
| | | if(ObjectUtil.isEmpty(queryDto.getIndexId())) { |
| | | return Collections.emptyList(); |
| | | } |
| | | |
| | | Date convertTime = DateTimeUtil.getTypeTime(queryDto.getTimeType(), queryDto.getDataTime()); |
| | | DateTime beginTime = DateUtil.beginOfYear(convertTime); |
| | | DateTime endTime = DateUtil.endOfYear(convertTime); |
| | | return yearProcessEnergyMapper.getListChart(queryDto.getIndexId(),beginTime,endTime,queryDto.getTimeType()); |
| | | } |
| | | } |
| | |
| | | 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"> |
| | | <mapper namespace="com.zhitan.processenergy.mapper.DailyProcessEnergyMapper"> |
| | | <resultMap id="dataItemMap" type="com.zhitan.processenergy.domain.DailyProcessEnergy"> |
| | | <result column="index_id" property="indexId"/> |
| | | <result column="index_name" property="indexName"/> |
| | | <result column="time_type" property="timeType"/> |
| | | <result column="time_code" property="timeCode"/> |
| | | <result column="unit_id" property="unitId"/> |
| | | <result column="value1" property="value1"/> |
| | | <result column="value2" property="value2"/> |
| | | <result column="value3" property="value3"/> |
| | | <result column="value4" property="value4"/> |
| | | <result column="value5" property="value5"/> |
| | | <result column="value6" property="value6"/> |
| | | <result column="value7" property="value7"/> |
| | | <result column="value8" property="value8"/> |
| | | <result column="value9" property="value9"/> |
| | | <result column="value10" property="value10"/> |
| | | <result column="value11" property="value11"/> |
| | | <result column="value12" property="value12"/> |
| | | <result column="value13" property="value13"/> |
| | | <result column="value14" property="value14"/> |
| | | <result column="value15" property="value15"/> |
| | | <result column="value16" property="value16"/> |
| | | <result column="value17" property="value17"/> |
| | | <result column="value18" property="value18"/> |
| | | <result column="value19" property="value19"/> |
| | | <result column="value20" property="value20"/> |
| | | <result column="value21" property="value21"/> |
| | | <result column="value22" property="value22"/> |
| | | <result column="value23" property="value23"/> |
| | | <result column="value0" property="value0"/> |
| | | </resultMap> |
| | | <select id="getDailyProcessEnergyList" resultMap="dataItemMap"> |
| | | SELECT |
| | | 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}, |
| | | </foreach> |
| | | aa.time_type |
| | | FROM |
| | | ( |
| | | SELECT |
| | | ci.index_id, |
| | | ci.NAME AS "index_name", |
| | | di."value", |
| | | di.data_time, |
| | | di.time_type |
| | | FROM |
| | | 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} |
| | | AND di.data_time < #{endTime} |
| | | 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.energy_id=#{indexStorageId} |
| | | </if> |
| | | ) aa |
| | | GROUP BY |
| | | aa.index_id,aa.index_name,aa.time_type |
| | | </select> |
| | | |
| | | <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 |
| | | 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} |
| | | AND di.time_type = #{timeType} |
| | | order by di.data_time |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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"> |
| | | <mapper namespace="com.zhitan.processenergy.mapper.MonthlyProcessEnergyMapper"> |
| | | <resultMap id="dataItemMap" type="com.zhitan.processenergy.domain.MonthlyProcessEnergy"> |
| | | <result column="index_id" property="indexId"/> |
| | | <result column="index_name" property="indexName"/> |
| | | <result column="time_type" property="timeType"/> |
| | | <result column="time_code" property="timeCode"/> |
| | | <result column="unit_id" property="unitId"/> |
| | | <result column="value1" property="value1"/> |
| | | <result column="value2" property="value2"/> |
| | | <result column="value3" property="value3"/> |
| | | <result column="value4" property="value4"/> |
| | | <result column="value5" property="value5"/> |
| | | <result column="value6" property="value6"/> |
| | | <result column="value7" property="value7"/> |
| | | <result column="value8" property="value8"/> |
| | | <result column="value9" property="value9"/> |
| | | <result column="value10" property="value10"/> |
| | | <result column="value11" property="value11"/> |
| | | <result column="value12" property="value12"/> |
| | | <result column="value13" property="value13"/> |
| | | <result column="value14" property="value14"/> |
| | | <result column="value15" property="value15"/> |
| | | <result column="value16" property="value16"/> |
| | | <result column="value17" property="value17"/> |
| | | <result column="value18" property="value18"/> |
| | | <result column="value19" property="value19"/> |
| | | <result column="value20" property="value20"/> |
| | | <result column="value21" property="value21"/> |
| | | <result column="value22" property="value22"/> |
| | | <result column="value23" property="value23"/> |
| | | <result column="value24" property="value24"/> |
| | | <result column="value25" property="value25"/> |
| | | <result column="value26" property="value26"/> |
| | | <result column="value27" property="value27"/> |
| | | <result column="value28" property="value28"/> |
| | | <result column="value29" property="value29"/> |
| | | <result column="value30" property="value30"/> |
| | | <result column="value31" property="value31"/> |
| | | </resultMap> |
| | | |
| | | <select id="getMonthlyProcessEnergy" resultMap="dataItemMap"> |
| | | SELECT |
| | | 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}, |
| | | </foreach> |
| | | aa.time_type |
| | | FROM |
| | | ( |
| | | SELECT |
| | | ci.index_id, |
| | | ci.NAME AS "index_name", |
| | | di."value", |
| | | di.data_time, |
| | | di.time_type |
| | | FROM |
| | | 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} |
| | | AND di.data_time < #{endTime} |
| | | 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.energy_id=#{indexStorageId} |
| | | </if> |
| | | ) aa |
| | | GROUP BY |
| | | aa.index_id,aa.index_name,aa.time_type |
| | | </select> |
| | | |
| | | <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 |
| | | 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 >= #{beginTime} |
| | | AND di.data_time < #{endTime} |
| | | AND di.time_type = #{timeType} |
| | | order by di.data_time |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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"> |
| | | <mapper namespace="com.zhitan.processenergy.mapper.YearProcessEnergyMapper"> |
| | | <resultMap id="dataItemMap" type="com.zhitan.processenergy.domain.YearProcessEnergy"> |
| | | <result column="index_id" property="indexId"/> |
| | | <result column="index_name" property="indexName"/> |
| | | <result column="time_type" property="timeType"/> |
| | | <result column="time_code" property="timeCode"/> |
| | | <result column="unit_id" property="unitId"/> |
| | | <result column="value1" property="value1"/> |
| | | <result column="value2" property="value2"/> |
| | | <result column="value3" property="value3"/> |
| | | <result column="value4" property="value4"/> |
| | | <result column="value5" property="value5"/> |
| | | <result column="value6" property="value6"/> |
| | | <result column="value7" property="value7"/> |
| | | <result column="value8" property="value8"/> |
| | | <result column="value9" property="value9"/> |
| | | <result column="value10" property="value10"/> |
| | | <result column="value11" property="value11"/> |
| | | <result column="value12" property="value12"/> |
| | | </resultMap> |
| | | |
| | | <select id="getYearProcessEnergy" resultMap="dataItemMap"> |
| | | SELECT |
| | | aa.index_id, |
| | | aa.index_name, |
| | | <foreach item="item" index="index" collection="dataList"> |
| | | 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", |
| | | di."value", |
| | | di.data_time, |
| | | di.time_type |
| | | FROM |
| | | 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} |
| | | AND di.data_time < #{endTime} |
| | | 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.energy_id=#{indexStorageId} |
| | | </if> |
| | | ) aa |
| | | GROUP BY |
| | | aa.index_id,aa.index_name,aa.time_type |
| | | </select> |
| | | |
| | | <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 |
| | | FROM |
| | | data_item di LEFT JOIN energy_index ci ON di.index_id = ci.index_id |
| | | WHERE |
| | | di.index_id = #{indexId} |
| | | AND di.time_type = #{timeType} |
| | | <if test="endTime != null"> |
| | | AND di.data_time < #{endTime} |
| | | </if> |
| | | <if test="beginTime != null"> |
| | | AND di.data_time >= #{beginTime} |
| | | </if> |
| | | order by di.data_time |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | 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} |
| | | and ci.energy_id=#{indexStorageId} |
| | | </if> |
| | | ) aa |
| | | GROUP BY |
| | |
| | | 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} |
| | | and ci.energy_id=#{indexStorageId} |
| | | </if> |
| | | ) aa |
| | | GROUP BY |
| | |
| | | <?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} |
| | | and ci.energy_id=#{indexStorageId} |
| | | </if> |
| | | ) aa |
| | | GROUP BY |
| | |
| | | |
| | | <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> |