zss
2024-07-15 40c75db6d335a0335e944e5196a102d8837cad6b
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderServiceImpl.java
@@ -404,6 +404,21 @@
    }
    @Override
    public Map<String, Object> costStatistics2(CostStatisticsDto costStatisticsDto) {
        Map<String, Object> map = new HashMap<>();
        String dates = costStatisticsDto.getDates();
        String[] split = dates.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(",");
        costStatisticsDto.setDates(null);
        List<CostStatisticsDto> costStatisticsDtos = insOrderMapper.selectCostStatistics2(QueryWrappers.queryWrappers(costStatisticsDto).ge("create_time", split[0]).le("create_time", split[1] + " 23:59:59"));
        double totalPrice = costStatisticsDtos.stream()
                .filter(dto -> dto.getPrice() != null) // 过滤掉价格为 null 的对象
                .mapToDouble(value -> value.getPrice().doubleValue())
                .sum();
        map.put("total",totalPrice);
        return map;
    }
    @Override
    public Map<String, Object> selectSampleDefects(Page page, String inspectionItems, String orderNumber) {
        List<SampleDefectsFatherVo> sampleDefectsFatherVos = insOrderMapper.selectSampleDefects(page, inspectionItems, orderNumber);
        Map<String, Object> map = new HashMap<>();