From 99132a43bf344f2aafdd9894b0762d2eedd9767b Mon Sep 17 00:00:00 2001 From: “djh” <“3298565835@qq.com”> Date: 星期二, 01 七月 2025 17:15:25 +0800 Subject: [PATCH] 修改 --- multi-system/src/main/java/com/gkhy/exam/system/service/impl/SysIndustryTypeServiceImpl.java | 73 ++++++++++++++++++++++++++++++++++++ 1 files changed, 73 insertions(+), 0 deletions(-) diff --git a/multi-system/src/main/java/com/gkhy/exam/system/service/impl/SysIndustryTypeServiceImpl.java b/multi-system/src/main/java/com/gkhy/exam/system/service/impl/SysIndustryTypeServiceImpl.java new file mode 100644 index 0000000..8c80fc6 --- /dev/null +++ b/multi-system/src/main/java/com/gkhy/exam/system/service/impl/SysIndustryTypeServiceImpl.java @@ -0,0 +1,73 @@ +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.domain.model.LoginUserDetails; +import com.gkhy.exam.common.utils.PageUtils; +import com.gkhy.exam.common.utils.SecurityUtils; +import com.gkhy.exam.system.domain.CompanyIndustryType; +import com.gkhy.exam.system.mapper.SysIndustryTypeMapper; +import com.gkhy.exam.system.service.SysIndustryTypeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.List; + +@Service +public class SysIndustryTypeServiceImpl extends ServiceImpl<SysIndustryTypeMapper, CompanyIndustryType> implements SysIndustryTypeService { + + @Autowired + private SysIndustryTypeMapper sysIndustryTypeMapper; + + @Override + public CommonPage selectIndustryTypeList() { + PageUtils.startPage(); + List<CompanyIndustryType> companyIndustryTypes = sysIndustryTypeMapper.selectIndustryTypeList(); + return CommonPage.restPage(companyIndustryTypes); + } + + @Override + public CommonResult insertIndustryType(CompanyIndustryType companyIndustryType) { + LoginUserDetails loginUser = SecurityUtils.getLoginUser(); + companyIndustryType.setCreateBy(loginUser.getUsername()); + companyIndustryType.setCreateTime(LocalDateTime.now()); + int insert = sysIndustryTypeMapper.insert(companyIndustryType); + if (insert > 0){ + return CommonResult.success(); + } + return CommonResult.failed(); + } + + @Override + public CommonResult updateIndustryType(CompanyIndustryType companyIndustryType) { + companyIndustryType.setUpdateBy(SecurityUtils.getUsername()); + companyIndustryType.setUpdateTime(LocalDateTime.now()); + int i = sysIndustryTypeMapper.updateById(companyIndustryType); + if (i>=0){ + return CommonResult.success(); + } + return CommonResult.failed(); + } + + @Override + public CommonResult deletedIndustryType(Integer industryId) { + CompanyIndustryType companyIndustryType = new CompanyIndustryType(); + companyIndustryType.setId(industryId); + companyIndustryType.setDelFlag(2); + companyIndustryType.setUpdateBy(SecurityUtils.getUsername()); + companyIndustryType.setUpdateTime(LocalDateTime.now()); + int i = sysIndustryTypeMapper.updateById(companyIndustryType); + if (i>0){ + return CommonResult.success(); + } + return CommonResult.failed(); + } + + @Override + public CommonResult selectList() { + List<CompanyIndustryType> companyIndustryTypes = sysIndustryTypeMapper.selectIndustryTypeList(); + return CommonResult.success(companyIndustryTypes); + } +} -- Gitblit v1.9.2