| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void computeOee(MdcOeeComputeVo mdcOeeComputeVo) { |
| | | List<MdcOeeInfo> result = new ArrayList<>(); |
| | | String startDate = mdcOeeComputeVo.getStartDate(); |
| | | String endDate = mdcOeeComputeVo.getEndDate(); |
| | | String startDate = mdcOeeComputeVo.getStartTime(); |
| | | String endDate = mdcOeeComputeVo.getEndTime(); |
| | | List<String> dateList = DateUtils.getDatesStringList(DateUtils.getShortDate(startDate), DateUtils.getShortDate(endDate)); |
| | | if (!dateList.isEmpty()) { |
| | | //获取设备列表 |
| | |
| | | Integer passCount = mdcJcRcJobreportService.selectTotalPassCount(equipmentId, validDate); |
| | | mdcOeeInfo.setPassCount(passCount); |
| | | // 合格率 --- 合格数/加工数 |
| | | BigDecimal passRate = BigDecimal.ZERO; |
| | | BigDecimal passRate = new BigDecimal("100"); |
| | | if (processCount != 0 && passCount != 0) { |
| | | passRate = new BigDecimal(passCount).divide(new BigDecimal(processCount), 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP); |
| | | } |
| | |
| | | super.saveBatch(result); |
| | | } |
| | | |
| | | @Override |
| | | public List<MdcOeeInfo> findByEquIdsAndDate(List<String> equipmentIdList, String start, String end) { |
| | | return this.baseMapper.findByEquIdsAndDate(equipmentIdList, start, end); |
| | | } |
| | | |
| | | @Override |
| | | public List<MdcOeeInfo> findByEquIdAndDate(String equipmentId, String start, String end) { |
| | | return this.baseMapper.findByEquIdAndDate(equipmentId, start, end); |
| | | } |
| | | |
| | | @Override |
| | | public BigDecimal findByEquIdAndMonth(String equipmentId, String month) { |
| | | return this.baseMapper.findByEquIdAndMonth(equipmentId, month); |
| | | } |
| | | |
| | | } |