main-business/src/main/java/com/ruoyi/business/service/InputInventoryRecordService.java
@@ -19,4 +19,7 @@ // 添加入库记录 int insertInputInventoryRecord(PendingInventoryDto pendingInventoryDto, OfficialInventoryDto officialInventoryDto, BigDecimal quantity); // 删除入库记录 int deleteInputInventoryRecord(Long[] ids); } main-business/src/main/java/com/ruoyi/business/service/impl/InputInventoryRecordServiceImpl.java
@@ -6,9 +6,7 @@ import com.ruoyi.business.entity.InputInventoryRecord; import com.ruoyi.business.mapper.InputInventoryRecordMapper; import com.ruoyi.business.service.InputInventoryRecordService; import com.ruoyi.business.service.InventorySummaryService; import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.math.BigDecimal; @@ -27,10 +25,7 @@ @Service @RequiredArgsConstructor public class InputInventoryRecordServiceImpl extends ServiceImpl<InputInventoryRecordMapper, InputInventoryRecord> implements InputInventoryRecordService { @Autowired private InputInventoryRecordMapper inputInventoryRecordMapper; @Autowired private InventorySummaryService inventorySummaryService; private final InputInventoryRecordMapper inputInventoryRecordMapper; @Override public int insertInputInventoryRecord(PendingInventoryDto pendingInventoryDto, OfficialInventoryDto officialInventoryDto, BigDecimal quantity) { @@ -48,9 +43,18 @@ } inputInventoryRecord.setQuantity(quantity); inputInventoryRecordMapper.insert(inputInventoryRecord); return inputInventoryRecordMapper.insert(inputInventoryRecord); // 更新库存 return inventorySummaryService.updateInventory(pendingInventoryDto, officialInventoryDto); // inventorySummaryService.updateInventory(pendingInventoryDto, officialInventoryDto); } @Override public int deleteInputInventoryRecord(Long[] ids) { return 0; } } main-business/src/main/java/com/ruoyi/business/service/impl/InventorySummaryServiceImpl.java
@@ -12,7 +12,6 @@ import com.ruoyi.business.service.InventorySummaryService; import com.ruoyi.business.service.OutputInventoryRecordService; import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.math.BigDecimal; @@ -32,16 +31,11 @@ @Service @RequiredArgsConstructor public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMapper, InventorySummary> implements InventorySummaryService { @Autowired private InventorySummaryMapper inventorySummaryMapper; @Autowired private InputInventoryRecordService inputInventoryRecordService; @Autowired private OutputInventoryRecordService outputInventoryRecordService; @Autowired private PendingInventoryMapper pendingInventoryMapper; @Autowired private OfficialInventoryMapper officialInventoryMapper; private final InventorySummaryMapper inventorySummaryMapper; private final InputInventoryRecordService inputInventoryRecordService; private final OutputInventoryRecordService outputInventoryRecordService; private final PendingInventoryMapper pendingInventoryMapper; private final OfficialInventoryMapper officialInventoryMapper; @Override public int updateInventory(PendingInventoryDto pendingInventoryDto, OfficialInventoryDto officialInventoryDto) { main-business/src/main/java/com/ruoyi/business/service/impl/OfficialInventoryServiceImpl.java
@@ -216,4 +216,5 @@ } } } } main-business/src/main/java/com/ruoyi/business/service/impl/OutputInventoryRecordServiceImpl.java
@@ -5,10 +5,8 @@ import com.ruoyi.business.dto.PendingInventoryDto; import com.ruoyi.business.entity.OutputInventoryRecord; import com.ruoyi.business.mapper.OutputInventoryRecordMapper; import com.ruoyi.business.service.InventorySummaryService; import com.ruoyi.business.service.OutputInventoryRecordService; import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.math.BigDecimal; @@ -27,10 +25,7 @@ @Service @RequiredArgsConstructor public class OutputInventoryRecordServiceImpl extends ServiceImpl<OutputInventoryRecordMapper, OutputInventoryRecord> implements OutputInventoryRecordService { @Autowired private OutputInventoryRecordMapper outputInventoryRecordMapper; @Autowired private InventorySummaryService inventorySummaryService; private final OutputInventoryRecordMapper outputInventoryRecordMapper; @Override public int insertOutputInventoryRecord(PendingInventoryDto pendingInventoryDto, OfficialInventoryDto officialInventoryDto, BigDecimal quantity) { @@ -48,9 +43,9 @@ } outputInventoryRecord.setQuantity(quantity); outputInventoryRecordMapper.insert(outputInventoryRecord); return outputInventoryRecordMapper.insert(outputInventoryRecord); // 变更原库存信息 return inventorySummaryService.updateInventory(pendingInventoryDto, officialInventoryDto); // return inventorySummaryService.updateInventory(pendingInventoryDto, officialInventoryDto); } } main-business/src/main/java/com/ruoyi/business/service/impl/PendingInventoryServiceImpl.java
@@ -15,6 +15,8 @@ import com.ruoyi.business.entity.PendingInventory; import com.ruoyi.business.mapper.OfficialInventoryMapper; import com.ruoyi.business.mapper.PendingInventoryMapper; import com.ruoyi.business.service.InputInventoryRecordService; import com.ruoyi.business.service.InventorySummaryService; import com.ruoyi.business.service.PendingInventoryService; import com.ruoyi.common.exception.base.BaseException; import com.ruoyi.common.utils.bean.BeanUtils; @@ -45,6 +47,10 @@ private final CoalValueMapper coalValueMapper; private final CoalFieldMapper coalFieldMapper; private final InputInventoryRecordService inputInventoryRecordService; private final InventorySummaryService inventorySummaryService; @Override public IPage<PendingInventoryDto> selectPendingInventoryList(Page page, PendingInventoryDto pendingInventoryDto) { @@ -194,4 +200,10 @@ } return i; } // 处理明细和库存数量 private int handeInventoryQuantity(PendingInventoryDto pendingInventoryDto) { inputInventoryRecordService.insertInputInventoryRecord(pendingInventoryDto, null, pendingInventoryDto.getInventoryQuantity()); return inventorySummaryService.updateInventory(pendingInventoryDto, null); }; }