| | |
| | | } |
| | | |
| | | @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<>(); |