| | |
| | | import com.ruoyi.basic.mapper.ProductModelMapper; |
| | | import com.ruoyi.basic.pojo.Product; |
| | | import com.ruoyi.basic.pojo.ProductModel; |
| | | import com.ruoyi.common.enums.StockRecordTypeEnum; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.procurementrecord.mapper.ProcurementRecordOutMapper; |
| | |
| | | salesLedgerProductionAccountingMapper.insert(salesLedgerProductionAccounting); |
| | | } |
| | | //如果报废数量>0,需要进入报废的库存 |
| | | if (dto.getScrapQty().compareTo(BigDecimal.ZERO) > 0) { |
| | | stockUtils.addUnStock(productModel.getId(), dto.getScrapQty(), StockRecordTypeEnum.PRODUCTION_SCRAP.getCode(), productionProductMain.getId()); |
| | | } |
| | | return true; |
| | | } |
| | | |
| | |
| | | .eq(ProcurementRecordOut::getSalesLedgerProductId, productionProductMain.getId())); |
| | | productionProductInputMapper.delete(new LambdaQueryWrapper<ProductionProductInput>() |
| | | .eq(ProductionProductInput::getProductMainId, productionProductMain.getId())); |
| | | //删除报废的入库记录 |
| | | stockUtils.deleteStockRecord(productionProductMain.getId(), StockRecordTypeEnum.PRODUCTION_SCRAP.getCode()); |
| | | // 删除主表 |
| | | productionProductMainMapper.deleteById(productionProductMain.getId()); |
| | | return true; |