| | |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.warehouse.dto.DocumentationBorrowManagementDto; |
| | | import com.ruoyi.warehouse.dto.ReturnExportDto; |
| | | import com.ruoyi.warehouse.mapper.DocumentationBorrowManagementMapper; |
| | | import com.ruoyi.warehouse.mapper.DocumentationReturnManagementMapper; |
| | | import com.ruoyi.warehouse.pojo.Documentation; |
| | | import com.ruoyi.warehouse.pojo.DocumentationBorrowManagement; |
| | | import com.ruoyi.warehouse.pojo.DocumentationReturnManagement; |
| | | import com.ruoyi.warehouse.service.DocumentationBorrowManagementService; |
| | | import com.ruoyi.warehouse.mapper.DocumentationBorrowManagementMapper; |
| | | import com.ruoyi.warehouse.service.DocumentationService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author 86151 |
| | | * @description 针对表【documentation_borrow_management(文档借阅-归还表)】的数据库操作Service实现 |
| | | * @createDate 2025-08-14 15:55:45 |
| | | */ |
| | | * @author 86151 |
| | | * @description 针对表【documentation_borrow_management(文档借阅-归还表)】的数据库操作Service实现 |
| | | * @createDate 2025-08-14 15:55:45 |
| | | */ |
| | | @Service |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @RequiredArgsConstructor |
| | | public class DocumentationBorrowManagementServiceImpl extends ServiceImpl<DocumentationBorrowManagementMapper, DocumentationBorrowManagement> |
| | | implements DocumentationBorrowManagementService{ |
| | | @Autowired |
| | | private DocumentationBorrowManagementMapper documentationBorrowManagementMapper; |
| | | @Autowired |
| | | private DocumentationReturnManagementMapper documentationReturnManagementMapper; |
| | | @Autowired |
| | | private DocumentationService documentationService; |
| | | @Override |
| | | implements DocumentationBorrowManagementService { |
| | | |
| | | private final DocumentationBorrowManagementMapper documentationBorrowManagementMapper; |
| | | private final DocumentationReturnManagementMapper documentationReturnManagementMapper; |
| | | private final DocumentationService documentationService; |
| | | |
| | | public IPage<DocumentationBorrowManagement> listPage(Page page, DocumentationBorrowManagement documentationBorrowManagement) { |
| | | IPage<DocumentationBorrowManagement> listPage = documentationBorrowManagementMapper.listPage(page, documentationBorrowManagement); |
| | | return listPage; |
| | |
| | | documentationService.updateById(documentation); |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public boolean reventdbm(DocumentationReturnManagement documentationReturnManagement) { |
| | | // 更新借阅记录状态为归还 |
| | |
| | | List<DocumentationBorrowManagementDto> list = documentationBorrowManagementMapper.list(new LambdaQueryWrapper<DocumentationBorrowManagementDto>() |
| | | .eq(DocumentationBorrowManagementDto::getDocumentationId, id) |
| | | .eq(DocumentationBorrowManagementDto::getBorrowStatus, "借阅")); |
| | | if (list.isEmpty()){ |
| | | if (list.isEmpty()) { |
| | | throw new RuntimeException("文档未被借阅"); |
| | | } |
| | | return list; |
| | |
| | | Documentation documentation = documentationService.getById(documentationBorrowManagement.getDocumentationId()); |
| | | documentation.setDocStatus("正常"); |
| | | boolean b = documentationService.updateById(documentation); |
| | | if (!b){ |
| | | if (!b) { |
| | | throw new RuntimeException("更新文档状态失败"); |
| | | } |
| | | } |
| | | documentationBorrowManagementMapper.deleteBatchIds(ids); |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |