重置用户状态同时会重置用户登录错误次数

yun-zuoyi
nies 3 years ago
parent b51fa31e06
commit 38b024d8e4

@ -1,6 +1,7 @@
package cn.estsh.i3plus.core.apiservice.controller.busi; package cn.estsh.i3plus.core.apiservice.controller.busi;
import cn.estsh.i3plus.core.api.iservice.busi.*; import cn.estsh.i3plus.core.api.iservice.busi.*;
import cn.estsh.i3plus.ext.qms.icloud.sdk.IQmsScheduleJobCloud;
import cn.estsh.i3plus.icloud.andon.sdk.IAndonScheduleJobCloud; import cn.estsh.i3plus.icloud.andon.sdk.IAndonScheduleJobCloud;
import cn.estsh.i3plus.icloud.mes.pcn.sdk.IMesPcnScheduleJobCloud; import cn.estsh.i3plus.icloud.mes.pcn.sdk.IMesPcnScheduleJobCloud;
import cn.estsh.i3plus.icloud.mes.sdk.IMesScheduleJobCloud; import cn.estsh.i3plus.icloud.mes.sdk.IMesScheduleJobCloud;
@ -99,6 +100,9 @@ public class SysTaskCycleController extends CoreBaseController {
@Autowired @Autowired
private IAndonScheduleJobCloud andonScheduleJobCloud; private IAndonScheduleJobCloud andonScheduleJobCloud;
@Autowired
private IQmsScheduleJobCloud qmsScheduleJobCloud;
/** /**
* *
* *
@ -123,6 +127,8 @@ public class SysTaskCycleController extends CoreBaseController {
// ANDON // ANDON
} else if (source == CommonEnumUtil.SOFT_TYPE.ANDON.getValue()) { } else if (source == CommonEnumUtil.SOFT_TYPE.ANDON.getValue()) {
quartzJobService = andonScheduleJobCloud; quartzJobService = andonScheduleJobCloud;
}else if (source == CommonEnumUtil.SOFT_TYPE.QMS.getValue()) {
quartzJobService = qmsScheduleJobCloud;
} }
return quartzJobService; return quartzJobService;
} }

@ -4,6 +4,8 @@ import cn.estsh.i3plus.core.api.iservice.base.ISystemInitService;
import cn.estsh.i3plus.core.api.iservice.busi.ISysTaskCycleService; import cn.estsh.i3plus.core.api.iservice.busi.ISysTaskCycleService;
import cn.estsh.i3plus.core.api.iservice.busi.ISysTaskPlanService; import cn.estsh.i3plus.core.api.iservice.busi.ISysTaskPlanService;
import cn.estsh.i3plus.core.api.iservice.busi.ISysTaskService; import cn.estsh.i3plus.core.api.iservice.busi.ISysTaskService;
import cn.estsh.i3plus.ext.qms.icloud.sdk.IQmsCommonCloud;
import cn.estsh.i3plus.ext.qms.icloud.sdk.IQmsScheduleJobCloud;
import cn.estsh.i3plus.icloud.andon.sdk.IAndonScheduleJobCloud; import cn.estsh.i3plus.icloud.andon.sdk.IAndonScheduleJobCloud;
import cn.estsh.i3plus.icloud.mes.pcn.sdk.IMesPcnScheduleJobCloud; import cn.estsh.i3plus.icloud.mes.pcn.sdk.IMesPcnScheduleJobCloud;
import cn.estsh.i3plus.icloud.mes.sdk.IMesScheduleJobCloud; import cn.estsh.i3plus.icloud.mes.sdk.IMesScheduleJobCloud;
@ -123,6 +125,11 @@ public class SysTaskPlanController extends CoreBaseController {
@Autowired @Autowired
private IScreenScheduleJobCloud screenScheduleJobCloud; private IScreenScheduleJobCloud screenScheduleJobCloud;
@Autowired
private IQmsScheduleJobCloud qmsScheduleJobCloud;
/** /**
* *
* *
@ -155,6 +162,8 @@ public class SysTaskPlanController extends CoreBaseController {
quartzJobService = ptlScheduleJobCloud; quartzJobService = ptlScheduleJobCloud;
} else if (source == CommonEnumUtil.SOFT_TYPE.SCREEN.getValue()) { } else if (source == CommonEnumUtil.SOFT_TYPE.SCREEN.getValue()) {
quartzJobService = screenScheduleJobCloud; quartzJobService = screenScheduleJobCloud;
}else if (source == CommonEnumUtil.SOFT_TYPE.QMS.getValue()) {
quartzJobService = qmsScheduleJobCloud;
} }
return quartzJobService; return quartzJobService;
} }

@ -34,6 +34,7 @@ import cn.estsh.impp.framework.boot.util.ValidatorBean;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.text.StrBuilder;
import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.RandomStringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -100,6 +101,9 @@ public class SysUserController extends CoreBaseController {
@Resource(name = CommonConstWords.IMPP_REDIS_RES) @Resource(name = CommonConstWords.IMPP_REDIS_RES)
private ImppRedis redisRes; private ImppRedis redisRes;
@Resource(name = CommonConstWords.IMPP_REDIS_CORE)
protected ImppRedis redisCore;
/** /**
* *
* *
@ -277,7 +281,10 @@ public class SysUserController extends CoreBaseController {
ValidatorBean.checkNotZero(status, "功能状态不能为空"); ValidatorBean.checkNotZero(status, "功能状态不能为空");
sysUserService.updateBatchSysUserStatus(StringTool.getArrayLong(ids), status, AuthUtil.getSessionUser()); sysUserService.updateBatchSysUserStatus(StringTool.getArrayLong(ids), status, AuthUtil.getSessionUser());
//当解除锁定状态 重置当天登录错误次数上限
if (CommonEnumUtil.USER_STATUS.ENABLE.getValue() == status) {
deleteRedisLoginErrorKeys(ids);
}
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()); return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
} catch (ImppBusiException busExcep) { } catch (ImppBusiException busExcep) {
return ResultBean.fail(busExcep); return ResultBean.fail(busExcep);
@ -287,6 +294,22 @@ public class SysUserController extends CoreBaseController {
} }
/** /**
*
*
* @param ids
*/
private void deleteRedisLoginErrorKeys(String[] ids) {
String[] keys = new String[ids.length];
StringBuilder redisKey = new StringBuilder();
for (int i = 0; i < ids.length; i++) {
redisKey.append(CommonConstWords.USER_LOGIN_ERROR).append(":").append(TimeTool.getToday()).append(":").append(ids[i]);
keys[i] = redisKey.toString();
redisKey.setLength(0);
}
redisCore.deleteKey(keys);
}
/**
* *
* *
* @param userLoginNames * @param userLoginNames

Loading…
Cancel
Save