| | |
| | | import com.ruoyi.production.service.ProductOrderService; |
| | | import com.ruoyi.production.service.ProductProcessService; |
| | | import com.ruoyi.production.service.ProductWorkOrderService; |
| | | import com.ruoyi.production.service.ProductionPrintOrderService; |
| | | import com.ruoyi.quality.mapper.QualityInspectMapper; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | |
| | | |
| | | private final ProductWorkOrderService productWorkOrderService; |
| | | private final ProductProcessService productProcessService; |
| | | |
| | | @Autowired |
| | | @Lazy |
| | | private ProductionPrintOrderService productionPrintOrderService; |
| | | @Autowired |
| | | private ProductOrderMapper productOrderMapper; |
| | | @Autowired |
| | |
| | | |
| | | @Override |
| | | public IPage<ProductOrderDto> pageProductOrder(Page page, ProductOrderDto productOrder) { |
| | | return productOrderMapper.pageProductOrder(page, productOrder); |
| | | IPage<ProductOrderDto> productOrderDtoIPage = productOrderMapper.pageProductOrder(page, productOrder); |
| | | // 填充印刷单信息 |
| | | List<ProductOrderDto> records = productOrderDtoIPage.getRecords(); |
| | | if (CollUtil.isNotEmpty(records)) { |
| | | List<Long> orderIds = records.stream().map(ProductOrderDto::getId).collect(Collectors.toList()); |
| | | Map<Long, ProductionPrintOrder> collect = productionPrintOrderService.getListByOrders(orderIds).stream().collect(Collectors.toMap(ProductionPrintOrder::getProductOrderId, Function.identity())); |
| | | records.forEach(record -> { |
| | | ProductionPrintOrder productionPrintOrder = collect.get(record.getId()); |
| | | if (productionPrintOrder != null) { |
| | | productionPrintOrder.convertProductOrderDto(record); |
| | | } |
| | | }); |
| | | |
| | | |
| | | } |
| | | |
| | | return productOrderDtoIPage; |
| | | } |
| | | |
| | | @Override |