| | |
| | | package com.gkhy.assess.system.service.impl; |
| | | package com.gkhy.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.gkhy.assess.common.enums.DeleteFlagEnum; |
| | | import com.gkhy.assess.common.exception.ApiException; |
| | | import com.gkhy.assess.common.utils.StringUtils; |
| | | import com.gkhy.assess.system.domain.SysExpertClassify; |
| | | import com.gkhy.assess.system.mapper.SysExpertClassifyMapper; |
| | | import com.gkhy.assess.system.service.SysExpertClassifyService; |
| | | import com.gkhy.assess.system.utils.ShiroUtils; |
| | | import com.gkhy.common.enums.DeleteFlagEnum; |
| | | import com.gkhy.common.exception.ServiceException; |
| | | import com.gkhy.common.utils.SecurityUtils; |
| | | import com.gkhy.common.utils.StringUtils; |
| | | import com.gkhy.system.domain.SysExpertClassify; |
| | | import com.gkhy.system.mapper.SysExpertClassifyMapper; |
| | | import com.gkhy.system.service.SysExpertClassifyService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | |
| | | if(StringUtils.isNotBlank(expertClassify.getClassifyName())){ |
| | | lambdaQueryWrapper.like(SysExpertClassify::getClassifyName,expertClassify.getClassifyName()); |
| | | } |
| | | lambdaQueryWrapper.eq(SysExpertClassify::getDelFlag,DeleteFlagEnum.UN_DELETE.getCode()); |
| | | lambdaQueryWrapper.eq(SysExpertClassify::getDelFlag, DeleteFlagEnum.UN_DELETE.getCode()); |
| | | List<SysExpertClassify> classifies= list(lambdaQueryWrapper); |
| | | //筛选出所有一级标签 |
| | | return classifies.stream() |
| | |
| | | |
| | | @Override |
| | | public int modClassify(SysExpertClassify expertClassify) { |
| | | expertClassify.setUpdateBy(ShiroUtils.getSysUser().getUsername()); |
| | | expertClassify.setUpdateBy(SecurityUtils.getUsername()); |
| | | boolean b=updateById(expertClassify); |
| | | if(!b){ |
| | | throw new ApiException("修改专家分类失败"); |
| | | throw new ServiceException("修改专家分类失败"); |
| | | } |
| | | return 1; |
| | | } |
| | |
| | | SysExpertClassify classify = new SysExpertClassify(); |
| | | classify.setId(classifyId); |
| | | classify.setDelFlag(DeleteFlagEnum.DELETED.getCode()); |
| | | classify.setUpdateBy(ShiroUtils.getSysUser().getUsername()); |
| | | classify.setUpdateBy(SecurityUtils.getUsername()); |
| | | boolean b=updateById(classify); |
| | | if(!b){ |
| | | throw new ApiException("删除专家分类失败"); |
| | | throw new ServiceException("删除专家分类失败"); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | @Override |
| | | public int addClassify(SysExpertClassify expertClassify) { |
| | | expertClassify.setCreateBy(ShiroUtils.getSysUser().getUsername()); |
| | | expertClassify.setCreateBy(SecurityUtils.getUsername()); |
| | | boolean b=save(expertClassify); |
| | | if(!b){ |
| | | throw new ApiException("新增专家分类失败"); |
| | | throw new ServiceException("新增专家分类失败"); |
| | | } |
| | | return 1; |
| | | } |