| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.jeecg.common.exception.JeecgBootException; |
| | | import org.jeecg.common.system.vo.DictModel; |
| | | import org.jeecg.modules.mdc.entity.*; |
| | | import org.jeecg.modules.mdc.mapper.MdcEquipmentStatisticalInfoMapper; |
| | |
| | | endDate = DateUtils.setTimeForDay(DateUtils.plusTime(now, -1), planTime); |
| | | } |
| | | List<MdcEquipmentRunningSection> equipmentRunningSectionList = mdcEquipmentRunningSectionService.listForEquipmentStatisticalInfo(equipment.getEquipmentid(), startDate, endDate); |
| | | return this.statisticsData(equipmentRunningSectionList, planTime, startDate, endDate, equipment); |
| | | try { |
| | | return this.statisticsData(equipmentRunningSectionList, planTime, startDate, endDate, equipment); |
| | | } catch (Exception e) { |
| | | throw new JeecgBootException("设备编号:" + equipment.getEquipmentid()); |
| | | } |
| | | |
| | | } else { |
| | | //待验证 |
| | | Date end = DateUtils.plusTime(initDate, 1); |
| | |
| | | long processingLong = 0L; |
| | | long closedLong = 0L; |
| | | long errorLong = 0L; |
| | | for (Map<String, Long> n : dayList) { |
| | | long du = n.get("duration"); |
| | | int status = new Long(n.get("status")).intValue(); |
| | | if (status == 2) { |
| | | waitingLong += du; |
| | | } |
| | | if (status == 3) { |
| | | processingLong += du; |
| | | } |
| | | if (status == 0) { |
| | | closedLong += du; |
| | | } |
| | | if (status == 22) { |
| | | errorLong += du; |
| | | if (dayList != null && !dayList.isEmpty()) { |
| | | for (Map<String, Long> n : dayList) { |
| | | long du = n.get("duration"); |
| | | int status = new Long(n.get("status")).intValue(); |
| | | if (status == 2) { |
| | | waitingLong += du; |
| | | } |
| | | if (status == 3) { |
| | | processingLong += du; |
| | | } |
| | | if (status == 0) { |
| | | closedLong += du; |
| | | } |
| | | if (status == 22) { |
| | | errorLong += du; |
| | | } |
| | | } |
| | | } |
| | | equipmentStatisticalInfo.setWaitLong(new BigDecimal(waitingLong)); |