zss
3 天以前 996c3fb89b185eedf2fd58a6c5bd5586e04cdccf
inspect-server/src/main/java/com/yuanchu/mom/service/impl/ReportServiceImpl.java
@@ -392,7 +392,10 @@
                .between(AuxiliaryOutputWorkingHours::getCreateTime, start, end));
        double sum = auxiliaryOutputWorkingHours.stream()
                .filter(auxiliaryOutputWorkingHours1 ->
                        insProductMapper.selectById(auxiliaryOutputWorkingHours1.getInsProductId()).getSonLaboratory().equals(sonLaboratory)
                        {
                            InsProduct insProduct = insProductMapper.selectById(auxiliaryOutputWorkingHours1.getInsProductId());
                            return ObjectUtils.isNotNull(insProduct)&&insProduct.getSonLaboratory().equals(sonLaboratory);
                        }
                ).mapToDouble(AuxiliaryOutputWorkingHours::getOutputWorkTime).sum();
        String num = String.format("%.2f", sum);
        return num;
@@ -410,7 +413,10 @@
        //根据检验项查出来的站点进行分类
        List<AuxiliaryOutputWorkingHours> outputWorkingHours = auxiliaryOutputWorkingHours.stream()
                .filter(auxiliaryOutputWorkingHours1 ->
                        insProductMapper.selectById(auxiliaryOutputWorkingHours1.getInsProductId()).getSonLaboratory().equals(sonLaboratory)
                        {
                            InsProduct insProduct = insProductMapper.selectById(auxiliaryOutputWorkingHours1.getInsProductId());
                            return ObjectUtils.isNotNull(insProduct)&&insProduct.getSonLaboratory().equals(sonLaboratory);
                        }
                ).collect(Collectors.toList());
        Map<Object, Double> mapMap = outputWorkingHours.stream()
                .collect(Collectors.groupingBy(
@@ -420,12 +426,25 @@
    }
    @Override
    public IPage<InsOrderUserDto> timeByStation(String startTime, String endTime, Page page, String sonLaboratory) {
    public Map<String, IPage<InsOrderUserDto>> timeByStation(String startTime, String endTime, Page page, String sonLaboratory) {
        DateTimeFormatter format = DateTimeFormatter.ofPattern("yyyy-MM-dd");
        LocalDateTime start = LocalDate.parse(startTime, format).atStartOfDay();
        LocalDateTime end = LocalDate.parse(endTime, format).atTime(23, 59, 59);
        Map<String, IPage<InsOrderUserDto>> map = new HashMap<>();
        //查询这个时间内所有检验任务
        IPage<InsOrderUserDto> insOrderUserDtoIPage = insOrderUserMapper.selectInsOrderUserDto(start,end,sonLaboratory, page);
        return insOrderUserDtoIPage;
        if (ObjectUtils.isNotEmpty(sonLaboratory)) {
            IPage<InsOrderUserDto> insOrderUserDtoIPage = insOrderUserMapper.selectInsOrderUserDto(start, end, sonLaboratory, page);
            map.put(sonLaboratory, insOrderUserDtoIPage);
        }else {
            List<InsOrderState> insOrderStates = insOrderStateMapper.selectList(Wrappers.<InsOrderState>lambdaQuery()
                    .between(InsOrderState::getCreateTime, start, end));
            Map<String, List<InsOrderState>> listMap = insOrderStates.stream().collect(Collectors.groupingBy(InsOrderState::getLaboratory));
            for (Map.Entry<String, List<InsOrderState>> entry : listMap.entrySet()) {
                List<Integer> ids = entry.getValue().stream().map(InsOrderState::getId).collect(Collectors.toList());
                IPage<InsOrderUserDto> insOrderUserDtoIPage = insOrderUserMapper.selectInsOrderUserDto2(ids, new Page(1,9));
                map.put(entry.getKey(), insOrderUserDtoIPage);
            }
        }
        return map;
    }
}