From 8a3a1c0b838d3b532750dc7c69362c2f5b0e7132 Mon Sep 17 00:00:00 2001 From: heheng <475597332@qq.com> Date: 星期一, 18 八月 2025 10:35:59 +0800 Subject: [PATCH] 部分新功能 --- multi-system/src/main/java/com/gkhy/exam/system/service/impl/AnnualReportServiceImpl.java | 63 +++++++++++++++++++++++++++++++ 1 files changed, 63 insertions(+), 0 deletions(-) diff --git a/multi-system/src/main/java/com/gkhy/exam/system/service/impl/AnnualReportServiceImpl.java b/multi-system/src/main/java/com/gkhy/exam/system/service/impl/AnnualReportServiceImpl.java new file mode 100644 index 0000000..fac860d --- /dev/null +++ b/multi-system/src/main/java/com/gkhy/exam/system/service/impl/AnnualReportServiceImpl.java @@ -0,0 +1,63 @@ +package com.gkhy.exam.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gkhy.exam.common.api.CommonPage; +import com.gkhy.exam.common.api.CommonResult; +import com.gkhy.exam.common.exception.ApiException; +import com.gkhy.exam.common.utils.PageUtils; +import com.gkhy.exam.common.utils.SecurityUtils; +import com.gkhy.exam.system.domain.AnnualReport; +import com.gkhy.exam.system.mapper.AnnualReportMapper; +import com.gkhy.exam.system.service.AnnualReportService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.List; + +@Service +public class AnnualReportServiceImpl extends ServiceImpl<AnnualReportMapper, AnnualReport> implements AnnualReportService { + + @Autowired + private AnnualReportMapper annualReportMapper; + + + @Override + public CommonPage selectAnnualList(AnnualReport annualReport) { + if (!SecurityUtils.adminUser()){ + if (annualReport.getCompanyId()==null){ + throw new ApiException("非管理员操作,企业id不可为空"); + } + } + PageUtils.startPage(); + List<AnnualReport> annualReports = annualReportMapper.selectAnnualList(annualReport); + return CommonPage.restPage(annualReports); + } + + @Override + public CommonResult insertAnnual(AnnualReport annualReport) { + annualReport.setCreateBy(SecurityUtils.getUsername()); + annualReport.setCreateTime(LocalDateTime.now()); + annualReportMapper.insert(annualReport); + return CommonResult.success(); + } + + @Override + public CommonResult updateAnnual(AnnualReport annualReport) { + annualReport.setUpdateBy(SecurityUtils.getUsername()); + annualReport.setUpdateTime(LocalDateTime.now()); + annualReportMapper.updateById(annualReport); + return CommonResult.success(); + } + + @Override + public CommonResult deletedAnnual(Integer annualId) { + AnnualReport annualReport = new AnnualReport(); + annualReport.setId(annualId); + annualReport.setUpdateBy(SecurityUtils.getUsername()); + annualReport.setUpdateTime(LocalDateTime.now()); + annualReport.setDelFlag(2); + annualReportMapper.updateById(annualReport); + return CommonResult.success(); + } +} -- Gitblit v1.9.2