¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2023/12/14 10:27 |
| | | */ |
| | | @Data |
| | | public class MdcAlarmListDto { |
| | | private String equipmentId; |
| | | private String equipmentName; |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss ") |
| | | private Date startTime; |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date endTime; |
| | | private Long duration; |
| | | } |
| | |
| | | List<MdcAlarmDto> dateCountList; |
| | | |
| | | List<MdcAlarmDto> equipmentCountList; |
| | | |
| | | List<MdcAlarmListDto> alarmList; |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.mdc.dto.MdcAlarmListDto; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipmentRunningSection; |
| | | import org.jeecg.modules.mdc.vo.MdcAlarmAnalyzeQueryVo; |
| | | |
| | |
| | | * æ¥è¯¢æ¶é´æ®µå
è¿è¡æ°æ® |
| | | */ |
| | | List<MdcEquipmentRunningSection> selectRunningData(@Param("equipmentId") String equipmentId, @Param("startDate") Date startDate, @Param("endDate") Date endDate); |
| | | |
| | | List<MdcAlarmListDto> selectAlarmList(@Param("vo") MdcAlarmAnalyzeQueryVo mdcAlarmAnalyzeQueryVo, @Param("startDate") String startDate, @Param("endDate") String endDate); |
| | | } |
| | |
| | | start_time |
| | | </select> |
| | | |
| | | <!--æ¥è¯¢æ¥è¦å·æ¥è¦è¯¦ç»ä¿¡æ¯--> |
| | | <select id="selectAlarmList" resultType="org.jeecg.modules.mdc.dto.MdcAlarmListDto"> |
| | | SELECT |
| | | t1.equipment_id, |
| | | t2.equipment_name, |
| | | t1.start_time, |
| | | t1.end_time, |
| | | t1.duration |
| | | FROM |
| | | mdc_equipment_running_section t1 LEFT JOIN mdc_equipment t2 ON t1.equipment_id = t2.equipment_id |
| | | <where> |
| | | AND t1.status = '22' |
| | | AND t1.alarm = #{ vo.alarmCode } |
| | | <if test="vo.equipmentIdList != null and vo.equipmentIdList.size() > 0 "> |
| | | AND t1.equipment_id IN |
| | | <foreach collection="vo.equipmentIdList" item="id" index="index" open="(" close=")" separator=","> |
| | | #{ id } |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | package org.jeecg.modules.mdc.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.mdc.dto.MdcAlarmListDto; |
| | | import org.jeecg.modules.mdc.dto.MdcEquipmentRunningSectionDto; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipmentRunningSection; |
| | | import org.jeecg.modules.mdc.vo.MdcAlarmAnalyzeQueryVo; |
| | |
| | | * æ¥è¯¢æ¶é´æ®µå
è¿è¡æ°æ® |
| | | */ |
| | | List<MdcEquipmentRunningSection> selectRunningData(String equipmentId, Date startDate, Date endDate); |
| | | |
| | | List<MdcAlarmListDto> selectAlarmList(MdcAlarmAnalyzeQueryVo mdcAlarmAnalyzeQueryVo, String startDate, String endDate); |
| | | } |
| | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.jeecg.modules.mdc.dto.MdcAlarmAnalyzeDto; |
| | | import org.jeecg.modules.mdc.dto.MdcAlarmDto; |
| | | import org.jeecg.modules.mdc.dto.MdcAlarmListDto; |
| | | import org.jeecg.modules.mdc.dto.MdcAlarmTrendDto; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipmentRunningSection; |
| | | import org.jeecg.modules.mdc.service.IMdcEquipmentRunningSectionService; |
| | |
| | | List<MdcAlarmDto> equipmentCountList = new ArrayList<>(); |
| | | String startDate = DateUtils.format(DateUtils.toDate(vo.getStartDate(), DateUtils.STRDATE), DateUtils.STR_DATE) + " 00:00:00"; |
| | | String endDate = DateUtils.format(DateUtils.addDays(DateUtils.toDate(vo.getEndDate(), DateUtils.STRDATE), 1), DateUtils.STR_DATE) + " 00:00:00"; |
| | | List<MdcAlarmListDto> alarmList = mdcEquipmentRunningSectionService.selectAlarmList(vo, startDate, endDate); |
| | | result.setAlarmList(alarmList); |
| | | for (String equipmentId : result.getEquipmentList()) { |
| | | MdcAlarmDto mdcAlarmDto = new MdcAlarmDto(); |
| | | mdcAlarmDto.setKey(equipmentId); |
| | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.jeecg.common.system.vo.DictModel; |
| | | import org.jeecg.modules.mdc.dto.EquipmentMachingDto; |
| | | import org.jeecg.modules.mdc.dto.MdcAlarmListDto; |
| | | import org.jeecg.modules.mdc.dto.MdcEquipmentRunningSectionDto; |
| | | import org.jeecg.modules.mdc.entity.*; |
| | | import org.jeecg.modules.mdc.mapper.MdcEquipmentRunningSectionMapper; |
| | |
| | | return this.baseMapper.selectRunningData(equipmentId, startDate, endDate); |
| | | } |
| | | |
| | | @Override |
| | | public List<MdcAlarmListDto> selectAlarmList(MdcAlarmAnalyzeQueryVo mdcAlarmAnalyzeQueryVo, String startDate, String endDate) { |
| | | return this.baseMapper.selectAlarmList(mdcAlarmAnalyzeQueryVo, startDate, endDate); |
| | | } |
| | | |
| | | private Map<String, List<MdcEquipmentRunningSectionDto>> logCharts(MdcEquipmentRunningSectionVo equipmentRunningSectionVo, String date) { |
| | | Map<String, List<MdcEquipmentRunningSectionDto>> map = new HashMap<>(); |
| | | List<MdcEquipmentRunningSectionDto> normal = new ArrayList<>(); |