Merge pull request #19 from Andy-Yin/zhangjw
工序能耗分析
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.*; |
| | | |
| | | /** |
| | | * @Description: æ¶é´å·¥å
·ç±» |
| | | * @author: yxw |
| | |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®æ¶é´ç±»åæå符串转æå¯¹åºçæ¶é´ |
| | | * 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; |
| | | } |
| | | public static List<TypeTime> getDateTimeList(String timeType,Date dataTime){ |
| | | List<TypeTime> resultlist = new ArrayList<>(); |
| | | |
| | | /** |
| | | * éè¿æ¶é´ç±»åè¿å对åºçæ¶é´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 = DateUtil.beginOfDay(dataTime); |
| | | switch (timeType){ |
| | | case TimeTypeConst.TIME_TYPE_DAY: |
| | | for(int i = 0;i<24;i++){ |
| | | switch (timeType) { |
| | | case TimeTypeConst.TIME_TYPE_HOUR: |
| | | for (int i = 1; i <= 24; i++) { |
| | | TypeTime typeTime = new TypeTime(); |
| | | typeTime.setDataTime(DateUtil.format(beginTime,COMMON_PATTERN)); |
| | | typeTime.setDateTime(DateTimeUtil.toDateTime(typeTime.getDataTime())); |
| | | typeTime.setTimeCode(CommonConst.WORD_H + DateUtil.format(beginTime,COMMON_PATTERN_HOUR)); |
| | | typeTime.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); |
| | | resultList.add(typeTime); |
| | | beginTime = addHours(beginTime, 1); |
| | | } |
| | | break; |
| | | case TimeTypeConst.TIME_TYPE_DAY: |
| | | 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: |
| | | for(int i = 0;i<31;i++){ |
| | | for (int i = 1; i <= 12; i++) { |
| | | TypeTime typeTime = new TypeTime(); |
| | | typeTime.setDataTime(DateUtil.format(beginTime,COMMON_PATTERN)); |
| | | typeTime.setTimeCode(CommonConst.WORD_D + DateUtil.format(beginTime,COMMON_PATTERN_DAY)); |
| | | 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 = addHours(beginTime,1); |
| | | } |
| | | break; |
| | | case TimeTypeConst.TIME_TYPE_YEAR: |
| | | for(int i = 0;i<12;i++){ |
| | | TypeTime typeTime = new TypeTime(); |
| | | typeTime.setDataTime(DateUtil.format(beginTime,COMMON_PATTERN)); |
| | | typeTime.setTimeCode(CommonConst.WORD_M + DateUtil.format(beginTime,COMMON_PATTERN_MONTH)); |
| | | typeTime.setValue("value" + i); |
| | | resultlist.add(typeTime); |
| | | beginTime = addHours(beginTime,1); |
| | | resultList.add(typeTime); |
| | | beginTime = addMonths(beginTime, 1); |
| | | } |
| | | break; |
| | | } |
| | | return resultlist; |
| | | } |
| | | return resultList; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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()); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.equipment=#{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.equipment=#{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.equipment=#{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> |