|
|
@ -2,6 +2,9 @@ package com.docus.server.service.impl;
|
|
|
|
|
|
|
|
|
|
|
|
import com.docus.infrastructure.core.db.dao.IBaseDao;
|
|
|
|
import com.docus.infrastructure.core.db.dao.IBaseDao;
|
|
|
|
import com.docus.infrastructure.redis.service.IdService;
|
|
|
|
import com.docus.infrastructure.redis.service.IdService;
|
|
|
|
|
|
|
|
import com.docus.infrastructure.shiro.ShiroUtil;
|
|
|
|
|
|
|
|
import com.docus.infrastructure.web.exception.ApiException;
|
|
|
|
|
|
|
|
import com.docus.infrastructure.web.exception.ExceptionCode;
|
|
|
|
import com.docus.infrastructure.web.request.SearchDTO;
|
|
|
|
import com.docus.infrastructure.web.request.SearchDTO;
|
|
|
|
import com.docus.infrastructure.web.response.PageResult;
|
|
|
|
import com.docus.infrastructure.web.response.PageResult;
|
|
|
|
import com.docus.server.convert.RcvSysUserConvert;
|
|
|
|
import com.docus.server.convert.RcvSysUserConvert;
|
|
|
@ -9,9 +12,11 @@ import com.docus.server.dto.recovery.rcvsysuser.AddRcvSysUserDTO;
|
|
|
|
import com.docus.server.dto.recovery.rcvsysuser.DeleteRcvSysUserDTO;
|
|
|
|
import com.docus.server.dto.recovery.rcvsysuser.DeleteRcvSysUserDTO;
|
|
|
|
import com.docus.server.dto.recovery.rcvsysuser.EditRcvSysUserDTO;
|
|
|
|
import com.docus.server.dto.recovery.rcvsysuser.EditRcvSysUserDTO;
|
|
|
|
import com.docus.server.entity.recovery.RcvSysUser;
|
|
|
|
import com.docus.server.entity.recovery.RcvSysUser;
|
|
|
|
|
|
|
|
import com.docus.server.enums.EffectiveEnum;
|
|
|
|
import com.docus.server.infrastructure.dao.IRcvSysUserDao;
|
|
|
|
import com.docus.server.infrastructure.dao.IRcvSysUserDao;
|
|
|
|
import com.docus.server.service.IRcvSysUserService;
|
|
|
|
import com.docus.server.service.IRcvSysUserService;
|
|
|
|
import com.docus.server.vo.recovery.rcvsysuser.RcvSysUserVO;
|
|
|
|
import com.docus.server.vo.recovery.rcvsysuser.RcvSysUserVO;
|
|
|
|
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
|
@ -320,5 +325,23 @@ public class RcvSysUserServiceImpl implements IRcvSysUserService {
|
|
|
|
return iRcvSysUserDao.findByIdAndName(id, name);
|
|
|
|
return iRcvSysUserDao.findByIdAndName(id, name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void doLogin(String userName, String userPwd) {
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(userName) || StringUtils.isBlank(userPwd)) {
|
|
|
|
|
|
|
|
throw new ApiException(ExceptionCode.ParamIllegal.getCode(), "用户名或密码不能为空!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
RcvSysUser user = iRcvSysUserDao.findOneBy("userName", userName);
|
|
|
|
|
|
|
|
String md5Pwd = ShiroUtil.md5(userPwd, null);
|
|
|
|
|
|
|
|
if (user == null) {
|
|
|
|
|
|
|
|
throw new ApiException(ExceptionCode.ParamIllegal.getCode(), "登录失败,用户不存在!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!EffectiveEnum.EFFECTIVE.equals(user.getEffective())) {
|
|
|
|
|
|
|
|
throw new ApiException(ExceptionCode.ParamIllegal.getCode(), "登录失败,用户状态未启用!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!user.getUserPwd().equals(md5Pwd)) {
|
|
|
|
|
|
|
|
throw new ApiException(ExceptionCode.ParamIllegal.getCode(), "登录失败:密码错误!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|