| | |
| | | @ApiModelProperty(value = "不良数量") |
| | | private BigDecimal defectiveQuantity; |
| | | |
| | | // 投入数量 |
| | | @ApiModelProperty(value = "投入数量") |
| | | private BigDecimal inputQty; |
| | | |
| | | @ApiModelProperty(value = "工单类型 正常 /返工返修") |
| | | private String workOrderType; |
| | | |
| | |
| | | @Autowired |
| | | private ProductionProductOutputMapper productionProductOutputMapper; |
| | | @Autowired |
| | | private ProductionProductInputMapper productionProductInputMapper; |
| | | @Autowired |
| | | private QualityUnqualifiedMapper qualityUnqualifiedMapper; |
| | | @Autowired |
| | | private QualityInspectMapper qualityInspectMapper; |
| | |
| | | BigDecimal scrapQty = BigDecimal.ZERO; |
| | | // 查询不良数量 |
| | | BigDecimal defectiveQuantity = BigDecimal.ZERO; |
| | | // 查询投入数量 |
| | | BigDecimal inputQty = BigDecimal.ZERO; |
| | | if (CollectionUtils.isNotEmpty(productionProductMains)) { |
| | | // 计算报废数量 |
| | | List<Long> mainIds = productionProductMains.stream().map(ProductionProductMain::getId).collect(Collectors.toList()); |
| | |
| | | if (CollectionUtils.isNotEmpty(productionProductOutputs)) { |
| | | scrapQty = productionProductOutputs.stream().map(ProductionProductOutput::getScrapQty).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | } |
| | | List<ProductionProductInput> productionProductInputs = productionProductInputMapper.selectList(Wrappers.<ProductionProductInput>lambdaQuery().in(ProductionProductInput::getProductMainId, mainIds)); |
| | | if (CollectionUtils.isNotEmpty(productionProductInputs)) { |
| | | inputQty = productionProductInputs.stream().map(ProductionProductInput::getQuantity).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | } |
| | | if (CollectionUtils.isNotEmpty(qualityInspects)) { |
| | | defectiveQuantity = qualityInspects.stream().map(QualityInspect::getDefectiveQuantity).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | } |
| | |
| | | } else { |
| | | productWorkOrderDto.setDefectiveRate(defectiveQuantity.multiply(BigDecimal.valueOf(100))); |
| | | } |
| | | productWorkOrderDto.setInputQty(inputQty); |
| | | productWorkOrderDto.setScrapQty(scrapQty); |
| | | productWorkOrderDto.setTotalQty(totalQuantity); |
| | | productWorkOrderDto.setDefectiveQuantity(defectiveQuantity); |
| | |
| | | <if test="c.productOrderNpsNo != null and c.productOrderNpsNo != ''"> |
| | | and po.nps_no like concat('%',#{c.productOrderNpsNo},'%') |
| | | </if> |
| | | order by pwo.priority, ppri.drag_sort |
| | | order by pwo.priority, pwo.id desc, ppri.drag_sort |
| | | </select> |
| | | |
| | | <select id="getByProductOrderId" resultType="com.ruoyi.production.dto.ProductWorkOrderDto"> |