jiangqs
2023-07-15 b0b52cbabf7a4bc8e00fc328d14ac05336d0221e
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/staff/SysStaffServiceImpl.java
@@ -4,6 +4,7 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.exception.ServiceException;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.common.core.utils.uuid.IdUtils;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.system.api.constant.AppErrorConstant;
@@ -104,6 +105,9 @@
        queryWrapper.eq(SysStaff::getDelFlag,0);
        queryWrapper.eq(SysStaff::getStaffMobile,mgtStaffEditDto.getStaffMobile());
        SysStaff sysStaffSame = this.getOne(queryWrapper, false);
        if(StringUtils.isBlank(mgtStaffEditDto.getStaffAvatar())){
            mgtStaffEditDto.setStaffAvatar("https://hongruitang.oss-cn-beijing.aliyuncs.com/default.png");
        }
        if(mgtStaffEditDto.getSysUserId()!=null){
            if(sysStaffSame!=null&&!sysStaffSame.getUserId().equals(mgtStaffEditDto.getSysUserId())){
                throw new ServiceException(AppErrorConstant.STAFF_MOBILE_DOUBLE);
@@ -175,4 +179,19 @@
    public List<MgtStaffPageVo> pageMgtStaff(Page page, MgtStaffPageDto mgtStaffPageDto){
        return sysStaffMapper.pageMgtStaff(page, mgtStaffPageDto);
    }
    /**
     * @description
     * @author  jqs
     * @date    2023/7/14 9:52
     * @param mobile
     * @return  SysStaff
     */
    @Override
    public SysStaff getByMobile(String mobile){
        LambdaQueryWrapper<SysStaff> queryWrapper = new LambdaQueryWrapper();
        queryWrapper.eq(SysStaff::getDelFlag,0);
        queryWrapper.eq(SysStaff::getStaffMobile,mobile);
        return this.getOne(queryWrapper,false);
    }
}