src/main/java/com/ruoyi/procurementrecord/utils/StockUtils.java
@@ -118,13 +118,13 @@ .eq(StockInRecord::getRecordType, recordType)); if (ObjectUtils.isNotEmpty(one)) { stockInRecordService.batchDelete(Collections.singletonList(one.getId())); //将库存减回来 StockInventoryDto stockInventoryDto = new StockInventoryDto(); stockInventoryDto.setRecordId(recordId); stockInventoryDto.setRecordType(recordType); stockInventoryDto.setQualitity(one.getStockInNum()); stockInventoryMapper.updateSubtractStockInventory((stockInventoryDto)); } //将库存减回来 StockInventoryDto stockInventoryDto = new StockInventoryDto(); stockInventoryDto.setRecordId(recordId); stockInventoryDto.setRecordType(recordType); stockInventoryDto.setQualitity(one.getStockInNum()); stockInventoryMapper.updateSubtractStockInventory((stockInventoryDto)); } public void deleteStockOutRecord(Long recordId, String recordType) { StockOutRecord one = stockOutRecordService.getOne(new QueryWrapper<StockOutRecord>() @@ -132,12 +132,12 @@ .eq(StockOutRecord::getRecordType, recordType)); if (ObjectUtils.isNotEmpty(one)) { stockOutRecordService.batchDelete(Collections.singletonList(one.getId())); //将库存加回来 StockInventoryDto stockInventoryDto = new StockInventoryDto(); stockInventoryDto.setRecordId(recordId); stockInventoryDto.setRecordType(recordType); stockInventoryDto.setQualitity(one.getStockOutNum()); stockInventoryMapper.updateAddStockInventory((stockInventoryDto)); } //将库存加回来 StockInventoryDto stockInventoryDto = new StockInventoryDto(); stockInventoryDto.setRecordId(recordId); stockInventoryDto.setRecordType(recordType); stockInventoryDto.setQualitity(one.getStockOutNum()); stockInventoryMapper.updateAddStockInventory((stockInventoryDto)); } } src/main/java/com/ruoyi/production/service/impl/ProductionProductMainServiceImpl.java
@@ -347,7 +347,7 @@ public Boolean removeProductMain(Long id) { //判断该条报工是否不合格处理,如果不合格处理了,则不允许删除 List<QualityInspect> qualityInspects = qualityInspectMapper.selectList(Wrappers.<QualityInspect>lambdaQuery().eq(QualityInspect::getProductMainId, id)); if (qualityInspects.size() > 0) { if (!qualityInspects.isEmpty()) { List<QualityUnqualified> qualityUnqualifieds = qualityUnqualifiedMapper.selectList(Wrappers.<QualityUnqualified>lambdaQuery() .in(QualityUnqualified::getInspectId, qualityInspects.stream().map(QualityInspect::getId).collect(Collectors.toList()))); if (qualityUnqualifieds.size() > 0 && qualityUnqualifieds.get(0).getInspectState() == 1) { src/main/java/com/ruoyi/quality/service/impl/QualityUnqualifiedServiceImpl.java
@@ -67,15 +67,21 @@ QualityUnqualified unqualified = qualityUnqualifiedMapper.selectById(qualityUnqualified.getId()); QualityInspect qualityInspect = qualityInspectService.getById(unqualified.getInspectId()); String batchNo; String customer; if (qualityInspect.getProductMainId() != null) { ProductionProductMain productionProductMain = productionProductMainMapper.selectById(qualityInspect.getProductMainId()); ProductWorkOrder workOrder = productWorkOrderMapper.selectById(productionProductMain.getWorkOrderId()); ProductOrder orders = productOrderMapper.selectById(workOrder.getProductOrderId()); batchNo = orders.getBatchNo(); customer = "长治市轴承制造有限公司"; } else { batchNo = qualityInspect.getBatchNo(); if (qualityInspect.getSupplier() != null) { customer = qualityInspect.getCustomer(); } else { customer = "长治市轴承制造有限公司"; } } String customer = "长治市轴承制造有限公司"; if (ObjectUtils.isNotNull(qualityInspect) && qualityInspect.getInspectType() != 0) { switch (qualityUnqualified.getDealResult()) { case "返修": @@ -162,7 +168,6 @@ break; case "让步放行": //调用提交合格的接口 customer = "长治市轴承制造有限公司"; stockUtils.addStock(modelId, unqualified.getQuantity(), StockInQualifiedRecordTypeEnum.DEFECTIVE_PASS.getCode(), unqualified.getId(), batchNo, customer, qualityInspect.getProductionDate() != null ? qualityInspect.getProductionDate() : LocalDate.now()); break; default: