| | |
| | | import com.ruoyi.common.utils.QueryWrappers; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.framework.exception.ErrorException; |
| | | import com.ruoyi.inspect.comparater.CustomComparator; |
| | | import com.ruoyi.inspect.dto.*; |
| | | import com.ruoyi.inspect.excel.FiberRibboGeometricalParameterExcelData; |
| | | import com.ruoyi.inspect.mapper.*; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> selectSampleAndProductByOrderId(SampleProductDto2 sampleProductDto) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | List<Map<String, Object>> headList = new ArrayList<>(); |
| | | public List<SampleProductDto2> selectSampleAndProductByOrderId(SampleProductDto2 sampleProductDto) { |
| | | List<SampleProductDto2> SampleProductDto2S = null; |
| | | if (!Objects.isNull(sampleProductDto.getId())) { |
| | | String laboratory = insOrderMapper.selectById(sampleProductDto.getId()).getLaboratory(); |
| | | if (laboratory.equals("电力产品实验室")) { |
| | | //电力试验室的数据查看,删除光纤配置相关字段 |
| | | // headList = PrintChina.printChina(SampleProductDTODL.class); |
| | | SampleProductDto2S = insOrderMapper.selectSampleAndProductByOrderId( |
| | | QueryWrappers.queryWrappers(sampleProductDto).orderByAsc("ins_product_id"), |
| | | sampleProductDto.getId()); |
| | | } else { |
| | | // headList = PrintChina.printChina(SampleProductDto2.class); |
| | | SampleProductDto2S = insOrderMapper.selectSampleAndProductByOrderId( |
| | | QueryWrappers.queryWrappers(sampleProductDto) |
| | | .orderByAsc("son_laboratory"), |
| | |
| | | } |
| | | collect2.addAll(list); |
| | | SampleProductDto2S = collect2; |
| | | // SampleProductDto2S.sort(new CustomComparator(enumService)); |
| | | SampleProductDto2S.sort(new CustomComparator(dictTypeService)); |
| | | } |
| | | } |
| | | for (SampleProductDto2 record : SampleProductDto2S) { |
| | |
| | | record.setLastValue(String.join(",", values)); |
| | | } |
| | | } |
| | | map.put("head", headList); |
| | | map.put("body", SampleProductDto2S); |
| | | return map; |
| | | return SampleProductDto2S; |
| | | } |
| | | |
| | | @Override |
| | |
| | | LocalDate today = LocalDate.parse(split[1]); |
| | | LocalTime end = LocalTime.of(23, 59, 59); |
| | | List<CostStatisticsDto> costStatisticsDtos = insOrderMapper.selectCostStatistics2(QueryWrappers.queryWrappers(costStatisticsDto), split[0], today.atTime(end).toString(), laboratory); |
| | | // double totalPrice = costStatisticsDtos.stream() |
| | | // .filter(dto -> dto.getPrice() != null) // 过滤掉价格为 null 的对象 |
| | | // .mapToDouble(value -> value.getPrice().doubleValue() * value.getNum()) |
| | | // .sum(); |
| | | BigDecimal total = BigDecimal.ZERO; |
| | | for (CostStatisticsDto dto : costStatisticsDtos) { |
| | | if (Objects.isNull(dto.getPrice()) || dto.getPrice().compareTo(BigDecimal.ZERO) == 0) { |