Commit b3b178be authored by wzp's avatar wzp

修改bug

parent 77a43078
...@@ -22,6 +22,9 @@ public enum OperType { ...@@ -22,6 +22,9 @@ public enum OperType {
VIDEO_EXPORT(14,"视频汇出"), VIDEO_EXPORT(14,"视频汇出"),
UPLOAD(15,"上传"), UPLOAD(15,"上传"),
CHANGE_STYLE(16,"修改风格"), CHANGE_STYLE(16,"修改风格"),
DETAILS(17,"详情"),
ACTIVATION(18,"激活"),
FAULT(19,"故障")
; ;
// 错误编码 // 错误编码
......
...@@ -2,15 +2,17 @@ package cn.wisenergy.chnmuseum.party.common.log; ...@@ -2,15 +2,17 @@ package cn.wisenergy.chnmuseum.party.common.log;
import cn.wisenergy.chnmuseum.party.auth.util.JwtTokenUtil; import cn.wisenergy.chnmuseum.party.auth.util.JwtTokenUtil;
import cn.wisenergy.chnmuseum.party.common.enums.AuditStatusEnum;
import cn.wisenergy.chnmuseum.party.common.enums.AuditTypeEnum;
import cn.wisenergy.chnmuseum.party.common.enums.RESPONSE_CODE_ENUM; import cn.wisenergy.chnmuseum.party.common.enums.RESPONSE_CODE_ENUM;
import cn.wisenergy.chnmuseum.party.common.enums.RESULT_INFO_ENUM; import cn.wisenergy.chnmuseum.party.common.enums.RESULT_INFO_ENUM;
import cn.wisenergy.chnmuseum.party.common.util.DateUtil80; import cn.wisenergy.chnmuseum.party.common.util.DateUtil80;
import cn.wisenergy.chnmuseum.party.common.vo.AuditStatusParam;
import cn.wisenergy.chnmuseum.party.core.annotations.OperationLog; import cn.wisenergy.chnmuseum.party.core.annotations.OperationLog;
import cn.wisenergy.chnmuseum.party.mapper.SysLogMapper; import cn.wisenergy.chnmuseum.party.mapper.SysLogMapper;
import cn.wisenergy.chnmuseum.party.model.SysLog; import cn.wisenergy.chnmuseum.party.model.*;
import cn.wisenergy.chnmuseum.party.model.TOperationLog;
import cn.wisenergy.chnmuseum.party.model.TUser;
import cn.wisenergy.chnmuseum.party.service.TOperationLogService; import cn.wisenergy.chnmuseum.party.service.TOperationLogService;
import cn.wisenergy.chnmuseum.party.service.impl.AuditServiceImpl;
import cn.wisenergy.chnmuseum.party.service.impl.TUserServiceImpl; import cn.wisenergy.chnmuseum.party.service.impl.TUserServiceImpl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import javassist.util.HotSwapper; import javassist.util.HotSwapper;
...@@ -52,6 +54,9 @@ class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog> { ...@@ -52,6 +54,9 @@ class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog> {
@Autowired @Autowired
private TUserServiceImpl userService; private TUserServiceImpl userService;
@Autowired
private AuditServiceImpl auditService;
@Autowired @Autowired
private TOperationLogService operationLogService; private TOperationLogService operationLogService;
...@@ -118,32 +123,12 @@ class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog> { ...@@ -118,32 +123,12 @@ class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog> {
object = point.proceed(); object = point.proceed();
} catch (Exception e) { } catch (Exception e) {
// 异常处理记录日志.. // 异常处理记录日志..
// e.printStackTrace(); e.printStackTrace();
return getFailResult(); return getFailResult();
} }
//判断是哪个页面调的用户接口,返回不同日志操作对象 // getMethodLog(user,methodLog,method_param);
if (methodLog.operModule().getCode()==1){
TUser u = null;
if (methodLog.operType().getCode() == 2||methodLog.operType().getCode() == 3) {
u = (TUser) method_param[0];
} else if (methodLog.operType().getCode() == 13) {
u = user;
}else{
String s = (String) method_param[0];
u = userService.getById(s);
}
switch (u.getType()){
case "2": methodLog.operModule().setMsg(OperModule.UNITADMIN.getMsg());
break;
case "3": methodLog.operModule().setMsg(OperModule.STBBASE.getMsg());
break;
case "4": methodLog.operModule().setMsg(OperModule.STBACCOUNT.getMsg());
break;
case "5": methodLog.operModule().setMsg(OperModule.STATISTICALUSER.getMsg());
break;
}
}
if ("机顶盒运维信息管理".equals(methodLog.operModule().getMsg())) { if ("机顶盒运维信息管理".equals(methodLog.operModule().getMsg())) {
TOperationLog operationLog = new TOperationLog(); TOperationLog operationLog = new TOperationLog();
operationLog.setCreateTime(LocalDateTime.now()); operationLog.setCreateTime(LocalDateTime.now());
...@@ -164,7 +149,7 @@ class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog> { ...@@ -164,7 +149,7 @@ class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog> {
// sysLog.setOperationContent(methodName); // sysLog.setOperationContent(methodName);
sysLog.setOperationTime(DateUtil80.getDateTimeOfTimestamp(System.currentTimeMillis())); sysLog.setOperationTime(DateUtil80.getDateTimeOfTimestamp(System.currentTimeMillis()));
// 处理设置注解上的参数 // 处理设置注解上的参数
getControllerMethodDescription(methodLog, sysLog); getControllerMethodDescription(user,methodLog, sysLog,method_param);
int insert = sysLogMapper.insert(sysLog); int insert = sysLogMapper.insert(sysLog);
return object; return object;
...@@ -173,15 +158,80 @@ class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog> { ...@@ -173,15 +158,80 @@ class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog> {
/** /**
* 获取注解中对方法的描述信息 用于Controller层注解 * 获取注解中对方法的描述信息 用于Controller层注解
* *
* @param log 日志 * @param sysLog 日志
* @param * @param
* @throws Exception * @throws Exception
*/ */
public void getControllerMethodDescription(MethodLog log, SysLog sysLog) throws Exception { public void getControllerMethodDescription(TUser user,MethodLog methodLog, SysLog sysLog,Object[] method_param) throws Exception {
// 设置action动作 // 设置action动作
sysLog.setOperationType(log.operType().getMsg()); sysLog.setOperationType(methodLog.operType().getMsg());
sysLog.setOperationContent(methodLog.operType().getMsg());
sysLog.setOperationObject(methodLog.operModule().getMsg());
//判断是哪个页面调的用户接口,返回不同日志操作对象
if (methodLog.operModule().getCode() == OperModule.USER.getCode()) {
TUser u = null;
if (methodLog.operType().getCode() == OperType.ADD.getCode() || methodLog.operType().getCode() == OperType.UPDATE.getCode()) {
u = (TUser) method_param[0];
} else if (methodLog.operType().getCode() == OperType.CHANGE_PASSWORD.getCode()) {
u = user;
} else {
String s = (String) method_param[0];
u = userService.getById(s);
}
switch (u.getType()) {
case "1":
// 设置标题 // 设置标题
sysLog.setOperationObject(log.operModule().getMsg()); sysLog.setOperationObject(OperModule.USER.getMsg());
break;
case "2":
sysLog.setOperationObject(OperModule.UNITADMIN.getMsg());
break;
case "3":
sysLog.setOperationObject(OperModule.STBBASE.getMsg());
break;
case "4":
sysLog.setOperationObject(OperModule.STBACCOUNT.getMsg());
break;
case "5":
sysLog.setOperationObject(OperModule.STATISTICALUSER.getMsg());
break;
}
}
//判断是哪个页面调的审核接口,返回不同日志操作对象
else if (methodLog.operModule().getCode() == OperModule.CHECKVIDEO.getCode()) {
String type = null;
String status = null;
if (methodLog.operType().getCode() == OperType.AUDIT.getCode()) {
AuditStatusParam auditStatusParam = (AuditStatusParam) method_param[0];
Audit byId = auditService.getById(auditStatusParam.getId());
type = byId.getType();
status=auditStatusParam.getStatus();
if ("REFUSED".equals(status)){
sysLog.setOperationContent(AuditStatusEnum.REFUSED.getMsg());
}else {
sysLog.setOperationContent(AuditStatusEnum.APPROVED_FINAL.getMsg());
}
} else if (methodLog.operType().getCode() == OperType.DETAILS.getCode()) {
type = (String) method_param[1];
} else if (methodLog.operType().getCode() == OperType.SELECT.getCode()) {
type = (String) method_param[2];
}
if (AuditTypeEnum.EXHIBITION_BOARD.name().equals(type)) {
sysLog.setOperationObject(OperModule.CHECKDISPLAY.getMsg());
} else if (AuditTypeEnum.LEARNING_CONTENT.name().equals(type)) {
sysLog.setOperationObject(OperModule.CHECKLEARN.getMsg());
} else if (AuditTypeEnum.VIDEO_CONTENT.name().equals(type)) {
sysLog.setOperationObject(OperModule.CHECKVIDEO.getMsg());
}
}else if(methodLog.operModule().getCode() == OperModule.STBOPERATION.getCode()&&methodLog.operType().getCode()==OperType.ACTIVATION.getCode()){
TBoxOperation o = (TBoxOperation) method_param[0];
if (o.getStatus()==2){
sysLog.setOperationType(OperType.ACTIVATION.getMsg());
}else {
sysLog.setOperationType(OperType.FAULT.getMsg());
}
}
} }
/** /**
......
...@@ -3,6 +3,9 @@ package cn.wisenergy.chnmuseum.party.web.controller; ...@@ -3,6 +3,9 @@ package cn.wisenergy.chnmuseum.party.web.controller;
import cn.wisenergy.chnmuseum.party.common.enums.AuditOperationEnum; import cn.wisenergy.chnmuseum.party.common.enums.AuditOperationEnum;
import cn.wisenergy.chnmuseum.party.common.enums.AuditStatusEnum; import cn.wisenergy.chnmuseum.party.common.enums.AuditStatusEnum;
import cn.wisenergy.chnmuseum.party.common.enums.AuditTypeEnum; import cn.wisenergy.chnmuseum.party.common.enums.AuditTypeEnum;
import cn.wisenergy.chnmuseum.party.common.log.MethodLog;
import cn.wisenergy.chnmuseum.party.common.log.OperModule;
import cn.wisenergy.chnmuseum.party.common.log.OperType;
import cn.wisenergy.chnmuseum.party.common.validator.groups.Update; import cn.wisenergy.chnmuseum.party.common.validator.groups.Update;
import cn.wisenergy.chnmuseum.party.common.vo.AuditStatusParam; import cn.wisenergy.chnmuseum.party.common.vo.AuditStatusParam;
import cn.wisenergy.chnmuseum.party.model.Audit; import cn.wisenergy.chnmuseum.party.model.Audit;
...@@ -59,6 +62,7 @@ public class AuditController extends BaseController { ...@@ -59,6 +62,7 @@ public class AuditController extends BaseController {
@ApiImplicitParam(name = "status", value = "TBC,REFUSED,TBCA,APPROVED_FINAL", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "status", value = "TBC,REFUSED,TBCA,APPROVED_FINAL", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "level", value = "TBC,TBCA", paramType = "query", dataType = "String") @ApiImplicitParam(name = "level", value = "TBC,TBCA", paramType = "query", dataType = "String")
}) })
@MethodLog(operModule = OperModule.RECHECK,operType = OperType.SELECT)
public Map<String, Object> getUserList(String name, String status, String level) { public Map<String, Object> getUserList(String name, String status, String level) {
Page<Audit> auditList; Page<Audit> auditList;
try { try {
...@@ -93,6 +97,7 @@ public class AuditController extends BaseController { ...@@ -93,6 +97,7 @@ public class AuditController extends BaseController {
@PutMapping("/update") @PutMapping("/update")
@RequiresPermissions("/audit/update") @RequiresPermissions("/audit/update")
@ApiOperation(value = "修改禁用审核信息", notes = "修改禁用审核信息") @ApiOperation(value = "修改禁用审核信息", notes = "修改禁用审核信息")
@MethodLog(operModule = OperModule.RECHECK,operType = OperType.AUDIT)
public Map<String, Object> updateAudit(@RequestBody @Validated(value = {Update.class}) Audit audit) { public Map<String, Object> updateAudit(@RequestBody @Validated(value = {Update.class}) Audit audit) {
boolean flag; boolean flag;
//如果层级是初审,设置初审时间 //如果层级是初审,设置初审时间
...@@ -201,6 +206,7 @@ public class AuditController extends BaseController { ...@@ -201,6 +206,7 @@ public class AuditController extends BaseController {
@ApiOperation(value = "获取禁用审核详情", notes = "获取禁用审核详情") @ApiOperation(value = "获取禁用审核详情", notes = "获取禁用审核详情")
@GetMapping("/getById") @GetMapping("/getById")
@RequiresPermissions("/audit/getById") @RequiresPermissions("/audit/getById")
@MethodLog(operModule = OperModule.CHECKVIDEO,operType = OperType.DETAILS)
public Map<String, Object> getById(String id, String type) { public Map<String, Object> getById(String id, String type) {
HashMap<String, Object> resultMap = new HashMap<>(); HashMap<String, Object> resultMap = new HashMap<>();
try { try {
...@@ -281,6 +287,7 @@ public class AuditController extends BaseController { ...@@ -281,6 +287,7 @@ public class AuditController extends BaseController {
@PutMapping("/updateAuditAllById") @PutMapping("/updateAuditAllById")
@RequiresPermissions("/audit/update") @RequiresPermissions("/audit/update")
@ApiOperation(value = "审核管理===根据id修改审核信息", notes = "审核管理===根据id修改审核信息") @ApiOperation(value = "审核管理===根据id修改审核信息", notes = "审核管理===根据id修改审核信息")
@MethodLog(operModule = OperModule.CHECKVIDEO,operType = OperType.AUDIT)
public Map<String, Object> updateAuditAllById(@RequestBody @Validated AuditStatusParam auditStatusParam) { public Map<String, Object> updateAuditAllById(@RequestBody @Validated AuditStatusParam auditStatusParam) {
String id = auditStatusParam.getId(); String id = auditStatusParam.getId();
......
package cn.wisenergy.chnmuseum.party.web.controller; package cn.wisenergy.chnmuseum.party.web.controller;
import cn.wisenergy.chnmuseum.party.common.log.MethodLog;
import cn.wisenergy.chnmuseum.party.common.log.OperModule;
import cn.wisenergy.chnmuseum.party.common.log.OperType;
import cn.wisenergy.chnmuseum.party.common.util.RSAUtils; import cn.wisenergy.chnmuseum.party.common.util.RSAUtils;
import cn.wisenergy.chnmuseum.party.model.TBoxOperation; import cn.wisenergy.chnmuseum.party.model.TBoxOperation;
import cn.wisenergy.chnmuseum.party.model.TUser; import cn.wisenergy.chnmuseum.party.model.TUser;
...@@ -104,6 +107,7 @@ public class TBoxOperationController extends BaseController { ...@@ -104,6 +107,7 @@ public class TBoxOperationController extends BaseController {
@PutMapping("/update") @PutMapping("/update")
@RequiresPermissions("/boxOperation/update") @RequiresPermissions("/boxOperation/update")
@ApiOperation(value = "修改机顶盒运维信息", notes = "修改机顶盒运维信息") @ApiOperation(value = "修改机顶盒运维信息", notes = "修改机顶盒运维信息")
@MethodLog(operModule = OperModule.STBOPERATION,operType = OperType.ACTIVATION)
public Map<String, Object> updateTBoxOperation(TBoxOperation tBoxOperation) { public Map<String, Object> updateTBoxOperation(TBoxOperation tBoxOperation) {
try { try {
if (tBoxOperation != null && StringUtils.isNotBlank(tBoxOperation.getMac())) { if (tBoxOperation != null && StringUtils.isNotBlank(tBoxOperation.getMac())) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment