Search in sources :

Example 6 with SystemLog

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;
}
Also used : SysUser(com.cdeledu.model.rbac.SysUser) AjaxJson(com.cdeledu.common.base.AjaxJson) SystemLog(com.cdeledu.core.annotation.SystemLog) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 7 with SystemLog

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;
}
Also used : SysUser(com.cdeledu.model.rbac.SysUser) AjaxJson(com.cdeledu.common.base.AjaxJson) SystemLog(com.cdeledu.core.annotation.SystemLog) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 8 with SystemLog

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;
}
Also used : AjaxJson(com.cdeledu.common.base.AjaxJson) SystemLog(com.cdeledu.core.annotation.SystemLog) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 9 with SystemLog

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;
}
Also used : AjaxJson(com.cdeledu.common.base.AjaxJson) SystemLog(com.cdeledu.core.annotation.SystemLog) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 10 with SystemLog

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;
}
Also used : AjaxJson(com.cdeledu.common.base.AjaxJson) SystemLog(com.cdeledu.core.annotation.SystemLog) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

SystemLog (com.cdeledu.core.annotation.SystemLog)26 AjaxJson (com.cdeledu.common.base.AjaxJson)25 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)25 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)25 SysUser (com.cdeledu.model.rbac.SysUser)7 SysRole (com.cdeledu.model.rbac.SysRole)4 SysMenu (com.cdeledu.model.rbac.SysMenu)3 SysUserRole (com.cdeledu.model.rbac.SysUserRole)1 SysLogEntity (com.cdeledu.model.system.SysLogEntity)1 Method (java.lang.reflect.Method)1 JoinPoint (org.aspectj.lang.JoinPoint)1 MethodSignature (org.aspectj.lang.reflect.MethodSignature)1