| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.Assert; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | |
| | | // 创建采购登记实体并复制属性 |
| | | PurchaseRegistration purchaseRegistration = new PurchaseRegistration(); |
| | | BeanUtils.copyProperties(purchaseRegistrationDto, purchaseRegistration); |
| | | |
| | | if (Objects.isNull(purchaseRegistrationDto.getId())) { |
| | | // 新增采购登记 |
| | | int insertCount = purchaseRegistrationMapper.insert(purchaseRegistration); |
| | |
| | | BeanUtils.copyProperties(purchaseRegistration, pendingInventory); |
| | | |
| | | // 设置待入库记录特有的属性(如果有) |
| | | // pendingInventory.setStatus(InventoryStatus.PENDING); |
| | | // pendingInventory.setCreateTime(LocalDateTime.now()); |
| | | |
| | | pendingInventory.setInventoryQuantity(purchaseRegistration.getPurchaseQuantity()); |
| | | pendingInventory.setCostPerUnit(new BigDecimal(22)); |
| | | return pendingInventory; |
| | | } |
| | | |