|
|
|
@ -2,7 +2,7 @@ package cn.estsh.i3plus.core.apiservice.serviceimpl.busi;
|
|
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.core.api.iservice.busi.IPersonnelService;
|
|
|
|
|
import cn.estsh.i3plus.core.apiservice.util.HqlModelPack;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.tool.TimeTool;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.util.CommonConstWords;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.common.Pager;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
|
|
@ -15,14 +15,18 @@ import cn.estsh.i3plus.pojo.platform.sqlpack.CoreHqlPack;
|
|
|
|
|
import cn.estsh.impp.framework.boot.auth.AuthUtil;
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionEnum;
|
|
|
|
|
import cn.estsh.impp.framework.boot.util.ImppRedis;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.apache.commons.lang3.time.DateFormatUtils;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -67,6 +71,8 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
@Autowired
|
|
|
|
|
private SysPositionRepository positionRDao;
|
|
|
|
|
|
|
|
|
|
@Resource(name="redisCore")
|
|
|
|
|
protected ImppRedis redisCore;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public SysUser saveSysUser(SysUser user) {
|
|
|
|
@ -334,6 +340,30 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@ApiOperation(value = "重置密码检查")
|
|
|
|
|
public Integer checkSysUserResetPassword(SysUser user) {
|
|
|
|
|
LOGGER.debug("平台用户岗位 SysUser user:{}", user);
|
|
|
|
|
Integer num = 0;
|
|
|
|
|
if(user != null){
|
|
|
|
|
String day = DateFormatUtils.ISO_8601_EXTENDED_DATE_FORMAT.format(new Date());
|
|
|
|
|
String redisKey = CommonConstWords.REDIS_PREFIX_USER_RESET_PASSWORD + "-" + day + "-" + user.getId();
|
|
|
|
|
Object redisValue = redisCore.getObject(redisKey);
|
|
|
|
|
num = redisValue == null ? 1 : Integer.parseInt(redisValue.toString()) + 1;
|
|
|
|
|
|
|
|
|
|
if(num > CommonConstWords.LOCK_USER_RESET_PASSWORD){
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.USER_PERMISSION_RUN_OUT.getCode())
|
|
|
|
|
.setErrorDetail("重置密码次数已使用完毕")
|
|
|
|
|
.setErrorSolution("请明日再次使用")
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
redisCore.putObject(redisKey,num,CommonConstWords.REDIS_TIME_DAY_ONE);
|
|
|
|
|
}
|
|
|
|
|
return num;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/************************************ 用户唯一检查 ****************************************/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|