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/InspectionSpecificationServiceImpl.java | 63 +++++++++++++++++++++++++++++++ 1 files changed, 63 insertions(+), 0 deletions(-) diff --git a/multi-system/src/main/java/com/gkhy/exam/system/service/impl/InspectionSpecificationServiceImpl.java b/multi-system/src/main/java/com/gkhy/exam/system/service/impl/InspectionSpecificationServiceImpl.java new file mode 100644 index 0000000..b5ac843 --- /dev/null +++ b/multi-system/src/main/java/com/gkhy/exam/system/service/impl/InspectionSpecificationServiceImpl.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.InspectionSpecification; +import com.gkhy.exam.system.mapper.InspectionSpecificationMapper; +import com.gkhy.exam.system.service.InspectionSpecificationService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.List; + +@Service +public class InspectionSpecificationServiceImpl extends ServiceImpl<InspectionSpecificationMapper, InspectionSpecification> implements InspectionSpecificationService { + + + @Autowired + private InspectionSpecificationMapper specificationMapper; + + @Override + public CommonPage selectSpecificationList(InspectionSpecification specification) { + if(!SecurityUtils.adminUser()){ + if (specification.getCompanyId()==null){ + throw new ApiException("非管理员操作,企业id不可为空"); + } + } + PageUtils.startPage(); + List<InspectionSpecification> inspectionSpecifications = specificationMapper.selectSpecificationList(specification); + return CommonPage.restPage(inspectionSpecifications); + } + + @Override + public CommonResult insertSpecification(InspectionSpecification specification) { + specification.setCreateBy(SecurityUtils.getUsername()); + specification.setCreateTime(LocalDateTime.now()); + specificationMapper.insert(specification); + return CommonResult.success(); + } + + @Override + public CommonResult updateSpecification(InspectionSpecification specification) { + specification.setUpdateBy(SecurityUtils.getUsername()); + specification.setUpdateTime(LocalDateTime.now()); + specificationMapper.updateById(specification); + return CommonResult.success(); + } + + @Override + public CommonResult deletedSpecification(Integer specificationId) { + InspectionSpecification inspectionSpecification = new InspectionSpecification(); + inspectionSpecification.setId(specificationId); + inspectionSpecification.setUpdateBy(SecurityUtils.getUsername()); + inspectionSpecification.setUpdateTime(LocalDateTime.now()); + inspectionSpecification.setDelFlag(2); + specificationMapper.updateById(inspectionSpecification); + return CommonResult.success(); + } +} -- Gitblit v1.9.2