use of com.cdeledu.core.annotation.SystemLog in project wechat by dllwh.
the class SysUserOperateController method forbidUserById.
/**
* @方法描述: 禁止登录
* @param status
* 1:有效,0:禁止登录
* @return
*/
@ResponseBody
@RequestMapping(value = "forbidUserById", method = RequestMethod.POST)
@SystemLog(desc = "禁止登录/允许登录", opType = SysOpType.UPDATE, tableName = { "sys_user" })
public AjaxJson forbidUserById(@RequestParam(name = "id", required = true) int userId, @RequestParam(name = "status", required = true, defaultValue = "1") int status) {
AjaxJson resultMsg = new AjaxJson();
SysUser user = new SysUser();
user.setId(userId);
try {
SysUser sysUser = manageruserService.findOneForJdbc(user);
if (sysUser != null && sysUser.getUserType() != -1 && WebUtilHelper.getCurrentUserId() != userId) {
sysUser.setLoginFlag(status);
manageruserService.update(sysUser);
}
resultMsg.setMsg(MessageConstant.MSG_OPERATION_SUCCESS);
} catch (Exception e) {
e.printStackTrace();
resultMsg.setSuccess(false);
resultMsg.setMsg(MessageConstant.MSG_OPERATION_FAILED);
}
return resultMsg;
}
use of com.cdeledu.core.annotation.SystemLog in project wechat by dllwh.
the class SysUserOperateController method lockUser.
@ResponseBody
@RequestMapping(value = "lockUser", method = RequestMethod.POST)
@SystemLog(desc = "锁定用户", opType = SysOpType.UPDATE, tableName = { "sys_user" })
public AjaxJson lockUser(@RequestParam(name = "id", required = true) int userId) {
AjaxJson resultMsg = new AjaxJson();
SysUser user = new SysUser();
user.setId(userId);
try {
SysUser sysUser = manageruserService.findOneForJdbc(user);
if (sysUser != null && sysUser.getUserType() != -1 && WebUtilHelper.getCurrentUserId() != userId) {
sysUser.setIfLocked(0);
manageruserService.update(sysUser);
}
resultMsg.setMsg(MessageConstant.MSG_OPERATION_SUCCESS);
} catch (Exception e) {
e.printStackTrace();
resultMsg.setSuccess(false);
resultMsg.setMsg(MessageConstant.MSG_OPERATION_FAILED);
}
return resultMsg;
}
use of com.cdeledu.core.annotation.SystemLog in project wechat by dllwh.
the class ScheduledController method run.
@ResponseBody
@RequestMapping("run")
@SystemLog(desc = "创建定时任务", opType = SysOpType.UPDATE, tableName = "sys_schedule_job")
public AjaxJson run(@RequestBody Long[] jobIds) {
AjaxJson ajaxJson = new AjaxJson();
scheduleJobService.run(jobIds);
return ajaxJson;
}
use of com.cdeledu.core.annotation.SystemLog in project wechat by dllwh.
the class ScheduledController method delete.
@ResponseBody
@RequestMapping("delete")
@SystemLog(desc = "删除定时任务", opType = SysOpType.DEL, tableName = "sys_schedule_job")
public AjaxJson delete(@RequestBody Long[] jobIds) {
AjaxJson ajaxJson = new AjaxJson();
scheduleJobService.deleteBatch(jobIds);
return ajaxJson;
}
use of com.cdeledu.core.annotation.SystemLog in project wechat by dllwh.
the class ScheduledController method update.
@ResponseBody
@RequestMapping("update")
@SystemLog(desc = "修改定时任务", opType = SysOpType.UPDATE, tableName = "sys_schedule_job")
public AjaxJson update(@RequestBody ScheduleJob scheduleJob) {
AjaxJson ajaxJson = new AjaxJson();
scheduleJobService.update(scheduleJob);
return ajaxJson;
}
Aggregations