maven
2025-10-14 cf6b1cf6fa8f7784c6d7c64b7326d4662bc3d4b3
main-business/src/main/java/com/ruoyi/business/service/impl/PendingInventoryServiceImpl.java
@@ -19,6 +19,7 @@
import com.ruoyi.basic.service.CoalFieldService;
import com.ruoyi.basic.service.CoalPlanService;
import com.ruoyi.basic.service.CoalValueService;
import com.ruoyi.business.constant.InventoryRecordConstant;
import com.ruoyi.business.dto.PendingInventoryDto;
import com.ruoyi.business.entity.OfficialInventory;
import com.ruoyi.business.entity.PendingInventory;
@@ -285,12 +286,15 @@
            if (pendingInventoryDto.getOfficialId() == null) {
                OfficialInventory officialInventory = new OfficialInventory();
                BeanUtils.copyProperties(pendingInventory, officialInventory);
                officialInventory.setPurchaseNumber(pendingInventory.getPurchaseNumber());
                officialInventory.setId(null);
                officialInventory.setCoalPlanId(pendingInventoryDto.getCoalPlanId());
                officialInventory.setPendingId(pendingInventoryDto.getPId());
                officialInventory.setInventoryQuantity(quantity);
                officialInventory.setRegistrantId(1L);
                officialInventory.setType(pendingInventory.getType());
                officialInventory.setSupplierId(pendingInventoryDto.getSupplierId());
                officialInventory.setCode(pendingInventory.getCode());
                officialInventoryMapper.insert(officialInventory);
            } else {
                OfficialInventory officialInventory = officialInventoryMapper.selectById(pendingInventoryDto.getOfficialId());
@@ -316,7 +320,7 @@
            // 2. 准备待入库记录
            Long userId = SecurityUtils.getUserId();
            PendingInventory pendingInventory = new PendingInventory();
            pendingInventory.setUnit("t");
            pendingInventory.setUnit("吨");
            pendingInventory.setRegistrantId(userId);
            pendingInventory.setRegistrationDate(LocalDate.now());
            pendingInventory.setSupplierName("配煤计算器方案入库");
@@ -352,7 +356,7 @@
            // 5. 设置价格和数量
            BigDecimal cost = safeGetBigDecimal(map, "cost");
            BigDecimal tonnage = safeGetBigDecimal(map, "totalTonnage");
            BigDecimal tonnage = safeGetBigDecimal(map, "createCoalQuantity");
            if (cost == null || tonnage == null) {
                throw new BaseException("成本或吨位不能为空");