| | |
| | | import org.jeecg.modules.system.entity.MdcProduction; |
| | | import org.jeecg.modules.system.service.IMdcProductionService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | |
| | | * 计算设备综合效率OEE |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void runningOverallEquipmentEfficiency(String dateTime) { |
| | | /* |
| | | OEE = 时间开动率 × 性能开动率 × 合格品率 |
| | |
| | | String validDate = YearMonth.now().minusMonths(1).toString(); |
| | | if (StringUtils.isNotBlank(dateTime)) { |
| | | validDate = DateUtils.format(DateUtils.toDate(dateTime, "yyyyMM"), DateUtils.STR_YEAR_MONTH); |
| | | try { |
| | | if (validDate != null) { |
| | | this.remove(new LambdaQueryWrapper<MdcOverallEquipmentEfficiency>(). |
| | | eq(MdcOverallEquipmentEfficiency::getValidDate, validDate)); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("参数格式不对", e); |
| | | } |
| | | } |
| | | try { |
| | | this.remove(new LambdaQueryWrapper<MdcOverallEquipmentEfficiency>().eq(MdcOverallEquipmentEfficiency::getValidDate, validDate)); |
| | | } catch (Exception e) { |
| | | log.error("参数格式不对", e); |
| | | } |
| | | // 获取设备列表 |
| | | List<MdcEquipment> equipmentList = mdcEquipmentService.list(); |
| | |
| | | oeeStatisticsChartVo.setKey(mdcProduction.getProductionName()); |
| | | BigDecimal oee = this.baseMapper.findAvgOee(date, equipmentTypeList, mdcProduction.getId()); |
| | | if (oee != null) { |
| | | oeeStatisticsChartVo.setValue(oee); |
| | | oeeStatisticsChartVo.setValue(oee.multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP)); |
| | | } |
| | | result.add(oeeStatisticsChartVo); |
| | | } |