From f0610c371668b042d36d7772cb04b49a2afc69ea Mon Sep 17 00:00:00 2001 From: zhuguifei <zhuguifei@zhuguifeideiMac.local> Date: 星期四, 24 四月 2025 14:51:56 +0800 Subject: [PATCH] 完成移动端保养 --- eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/service/impl/EimsInspectStServiceImpl.java | 48 +++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 47 insertions(+), 1 deletions(-) diff --git a/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/service/impl/EimsInspectStServiceImpl.java b/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/service/impl/EimsInspectStServiceImpl.java index 6db24c0..c81fd16 100644 --- a/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/service/impl/EimsInspectStServiceImpl.java +++ b/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/service/impl/EimsInspectStServiceImpl.java @@ -49,7 +49,53 @@ */ @Override public EimsInspectStVo queryById(Long id){ - return baseMapper.selectVoById(id); + EimsInspectStVo stVo = baseMapper.selectVoById(id); + return stVo; + } + + + /** + * + * @param stVo + * @param type Day-鏃ヨ鍥� Month-鏈堣鍥� + */ + private void fillStDataSingle(EimsInspectStVo stVo,String type) { + + LambdaQueryWrapper<EimsInspectRecord> recordLqw = Wrappers.lambdaQuery(); + recordLqw.eq(EimsInspectRecord::getEquId, stVo.getEquId()); + LocalDate planTime = stVo.getPlanTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); + // 鏈堣鍥炬煡璇㈣寖鍥� + LocalDate startOfMonth = planTime.with(TemporalAdjusters.firstDayOfMonth()); + LocalDate endOfMonth = planTime.with(TemporalAdjusters.lastDayOfMonth()); + + // 鏃ヨ鍥炬煡璇㈣寖鍥� + if(type.equals("Day")){ + recordLqw.between(EimsInspectRecord::getPlanTime, planTime, planTime); + }else { + // 鏈堣鍥炬煡璇㈣寖鍥� + recordLqw.between(EimsInspectRecord::getPlanTime, startOfMonth, endOfMonth); + } + + + // 鎵ц鏌ヨ + List<EimsInspectRecordVo> recordList = recordMapper.selectVoList(recordLqw); + // TODO 鏍规嵁瀛楀吀eims_inspect_status + Map<String, Long> cMap = recordList.stream() + .filter(order -> List.of("0", "1").contains(order.getStatus())) + .collect(Collectors.groupingBy(EimsInspectRecordVo::getStatus, Collectors.counting())); + // TODO 鏍规嵁瀛楀吀eims_inspect_result + Map<String, Long> rMap = recordList.stream() + .filter(order ->order.getInspResult()!=null && List.of("1", "2").contains(order.getInspResult())) + .collect(Collectors.groupingBy(EimsInspectRecordVo::getInspResult, Collectors.counting())); + + stVo.setRecordCount(recordList.size()); + stVo.setUnCheckCount(cMap.getOrDefault("0", 0L).intValue()); + stVo.setCheckCount(cMap.getOrDefault("1", 0L).intValue()); + + stVo.setNormalNum(rMap.getOrDefault("1", 0L).intValue()); + stVo.setAbNormalNum(rMap.getOrDefault("2", 0L).intValue()); + + } /** -- Gitblit v1.9.3