生产报工的报废未进入库存记录页面中+不合格处理后不能删除
| | |
| | | } |
| | | //如果报废数量>0,需要进入报废的库存 |
| | | if (ObjectUtils.isNotEmpty(dto.getScrapQty())) { |
| | | if (BigDecimal.ZERO.compareTo(dto.getScrapQty()) > 0) { |
| | | if (dto.getScrapQty().compareTo(BigDecimal.ZERO) > 0) { |
| | | stockUtils.addUnStock(productModel.getId(), dto.getScrapQty(), StockUnQualifiedRecordTypeEnum.PRODUCTION_SCRAP.getCode(), productionProductMain.getId()); |
| | | } |
| | | } |
| | |
| | | */ |
| | | @DeleteMapping("/del") |
| | | public AjaxResult delQualityUnqualified(@RequestBody List<Integer> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("请选择至少一条数据"); |
| | | } |
| | | qualityUnqualifiedService.listByIds(ids).stream().forEach(qualityUnqualified -> { |
| | | if (qualityUnqualified.getInspectState()==1){ |
| | | throw new RuntimeException("该不合格数据已经处理无法删除!"); |
| | | } |
| | | }); |
| | | return AjaxResult.success(qualityUnqualifiedService.removeBatchByIds(ids)); |
| | | } |
| | | |