package com.gkhy.exam.system.service.impl; import com.gkhy.exam.common.api.CommonPage; import com.gkhy.exam.common.api.CommonResult; import com.gkhy.exam.common.utils.PageUtils; import com.gkhy.exam.common.utils.SecurityUtils; import com.gkhy.exam.system.domain.Correction; import com.gkhy.exam.system.domain.StandingBook; import com.gkhy.exam.system.mapper.StandingBookMapper; import com.gkhy.exam.system.service.StandingBookService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.time.LocalDateTime; import java.util.List; /** *

* 台账 服务实现类 *

* * @author hh * @since 2025-07-31 16:12:02 */ @Service public class StandingBookServiceImpl extends ServiceImpl implements StandingBookService { @Autowired private StandingBookMapper standingBookMapper; @Override public CommonPage selectStandingBookList(StandingBook standingBook) { PageUtils.startPage(); List standingBooks = standingBookMapper.getStandingBooks(standingBook); return CommonPage.restPage(standingBooks); } @Override public CommonResult insertStandingBook(StandingBook standingBook) { standingBook.setCreateBy(SecurityUtils.getUsername()); standingBook.setCreateTime(LocalDateTime.now()); int insert = standingBookMapper.insert(standingBook); if (insert > 0){ return CommonResult.success(); } return CommonResult.failed(); } @Override public CommonResult updateStandingBook(StandingBook standingBook) { standingBook.setUpdateBy(SecurityUtils.getUsername()); standingBook.setUpdateTime(LocalDateTime.now()); int insert = standingBookMapper.updateById(standingBook); if (insert > 0){ return CommonResult.success(); } return CommonResult.failed(); } @Override public CommonResult deletedStandingBook(Integer id) { StandingBook standingBook = new StandingBook(); standingBook.setId(id.longValue()); standingBook.setDelFlag(1); standingBook.setUpdateBy(SecurityUtils.getUsername()); standingBook.setUpdateTime(LocalDateTime.now()); int update = standingBookMapper.updateById(standingBook); if (update > 0){ return CommonResult.success(); } return CommonResult.failed(); } }