lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/dto/MdcEquipmentStatisticalInfoDto.java
ÎļþÒÑɾ³ý lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcHomeMapper.java
@@ -2,7 +2,6 @@ import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.jeecg.modules.mdc.dto.MdcEquipmentStatisticalInfoDto; import org.jeecg.modules.mdc.entity.MdcEquipment; import org.jeecg.modules.mdc.entity.MdcEquipmentStatisticalInfo; import org.jeecg.modules.mdc.entity.MdcOverallEquipmentEfficiency; @@ -87,7 +86,7 @@ /** * æ¥è¯¢åä¸å¤©å©ç¨ç */ List<MdcEquipmentStatisticalInfoDto> getEquipmentSevenUtilizationStatistics(@Param("equipmentIdList") List<String> equipmentIdList, @Param("start") String start, @Param("end") String end); List<MdcEquipmentStatisticalInfo> getEquipmentSevenUtilizationStatistics(@Param("equipmentIdList") List<String> equipmentIdList, @Param("start") String start, @Param("end") String end); List<MdcEquipment> getEquipmentList(@Param("productionId") String productionId); } lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcHomeMapper.xml
@@ -123,26 +123,24 @@ the_date </select> <select id="getEquipmentSevenUtilizationStatistics" resultType="org.jeecg.modules.mdc.dto.MdcEquipmentStatisticalInfoDto"> <select id="getEquipmentSevenUtilizationStatistics" resultType="org.jeecg.modules.mdc.entity.MdcEquipmentStatisticalInfo"> SELECT t1.equipment_id, t2.equipment_name, SUM ( t1.process_long ) processLong, SUM ( t1.open_long ) openLong equipment_id, SUM ( process_long ) processLong, SUM ( open_long ) openLong FROM mdc_equipment_statistical_info t1 LEFT JOIN mdc_equipment t2 ON t1.equipment_id = t2.equipment_id mdc_equipment_statistical_info <where> AND t1.the_date BETWEEN #{start} AND #{end} AND the_date BETWEEN #{start} AND #{end} <if test="equipmentIdList != null and equipmentIdList.size() > 0 "> AND t1.equipment_id IN AND equipment_id IN <foreach collection="equipmentIdList" index="index" item="id" open="(" separator="," close=")"> #{id} </foreach> </if> </where> GROUP BY t1.equipment_id,t2.equipment_name equipment_id </select> lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/IMdcHomeServiceImpl.java
@@ -1,7 +1,7 @@ package org.jeecg.modules.mdc.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.StringUtils; import org.jeecg.modules.mdc.dto.MdcEquipmentStatisticalInfoDto; import org.jeecg.modules.mdc.entity.EquipmentLog; import org.jeecg.modules.mdc.entity.MdcEquipment; import org.jeecg.modules.mdc.entity.MdcEquipmentStatisticalInfo; @@ -252,14 +252,14 @@ String start = DateUtils.format(DateUtils.toDate(LocalDate.now().plusDays(-7).toString(), DateUtils.STR_DATE), DateUtils.STRDATE); String end = DateUtils.format(DateUtils.toDate(LocalDate.now().plusDays(-1).toString(), DateUtils.STR_DATE), DateUtils.STRDATE); if (equipmentIdList != null && !equipmentIdList.isEmpty()) { result.put("equipmentIdList", equipmentIdList); List<MdcEquipmentStatisticalInfoDto> mdcEquipmentStatisticalInfoList = mdcHomeMapper.getEquipmentSevenUtilizationStatistics(equipmentIdList, start, end); List<MdcEquipment> mdcEquipmentList = mdcEquipmentService.list(new LambdaQueryWrapper<MdcEquipment>().in(MdcEquipment::getEquipmentId, equipmentIdList)); result.put("mdcEquipmentList", mdcEquipmentList); List<MdcEquipmentStatisticalInfo> mdcEquipmentStatisticalInfoList = mdcHomeMapper.getEquipmentSevenUtilizationStatistics(equipmentIdList, start, end); List<EquipmentDayUtilizationVo> dataList = new ArrayList<>(); if (mdcEquipmentStatisticalInfoList != null && !mdcEquipmentStatisticalInfoList.isEmpty()) { for (MdcEquipmentStatisticalInfoDto mdcEquipmentStatisticalInfo : mdcEquipmentStatisticalInfoList) { for (MdcEquipmentStatisticalInfo mdcEquipmentStatisticalInfo : mdcEquipmentStatisticalInfoList) { EquipmentDayUtilizationVo equipmentDayUtilizationVo = new EquipmentDayUtilizationVo(); equipmentDayUtilizationVo.setEquipmentId(mdcEquipmentStatisticalInfo.getEquipmentId()); equipmentDayUtilizationVo.setEquipmentName(mdcEquipmentStatisticalInfo.getEquipmentName()); equipmentDayUtilizationVo.setUtilizationRate(mdcEquipmentStatisticalInfo.getProcessLong().divide(new BigDecimal("864"), 4, RoundingMode.HALF_UP).divide(new BigDecimal(mdcEquipmentStatisticalInfoList.size()), 4, RoundingMode.HALF_UP).setScale(2, RoundingMode.HALF_UP)); if (BigDecimal.ZERO.compareTo(mdcEquipmentStatisticalInfo.getOpenLong()) == -1) { equipmentDayUtilizationVo.setOpenRate(mdcEquipmentStatisticalInfo.getProcessLong().divide(mdcEquipmentStatisticalInfo.getOpenLong(), 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP)); lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/EquipmentDayUtilizationVo.java
@@ -15,10 +15,6 @@ */ private String equipmentId; /** * 设å¤åç§° */ private String equipmentName; /** * å©ç¨ç */ private BigDecimal utilizationRate = BigDecimal.ZERO;