liding
4 天以前 c0cf736ff001bbaec59b7da6239f4670464952fd
main-business/src/main/java/com/ruoyi/business/service/impl/PurchaseRegistrationServiceImpl.java
@@ -17,6 +17,7 @@
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import java.time.LocalDate;
import java.util.Objects;
/**
@@ -52,9 +53,9 @@
        // 创建采购登记实体并复制属性
        PurchaseRegistration purchaseRegistration = new PurchaseRegistration();
        BeanUtils.copyProperties(purchaseRegistrationDto, purchaseRegistration);
        if (Objects.isNull(purchaseRegistrationDto.getId())) {
            // 新增采购登记
            purchaseRegistration.setRegistrationDate(LocalDate.now());
            int insertCount = purchaseRegistrationMapper.insert(purchaseRegistration);
            if (insertCount > 0) {
                // 采购登记成功,同步创建待入库记录
@@ -79,9 +80,7 @@
        BeanUtils.copyProperties(purchaseRegistration, pendingInventory);
        // 设置待入库记录特有的属性(如果有)
        // pendingInventory.setStatus(InventoryStatus.PENDING);
        // pendingInventory.setCreateTime(LocalDateTime.now());
         pendingInventory.setInventoryQuantity(purchaseRegistration.getPurchaseQuantity());
        return pendingInventory;
    }