whyclxw
2025-01-11 60748fea6ae6b317ad5dca8019bf8e17c106c4e9
操作日志修改
2个文件已修改
99 ■■■■ 已修改文件
src/main/java/com/whyc/aop/OperationLogAspect.java 84 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/constant/OperationLogEnum.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/aop/OperationLogAspect.java
@@ -110,55 +110,26 @@
                type2 = OperationLogEnum.TYPE_2_USER_UPDATE_PASSWORD.getType();
                operationTypeName = OperationLogEnum.TYPE_2_USER_UPDATE_PASSWORD.getName();
            }
        }else if(classNameTrue.contains("A200")){ //告警设置
        }else if(classNameTrue.contains("lockRt")){ //告警设置
            type1 = OperationLogEnum.TYPE_1_SERVICE.getType();
            if(methodName.startsWith("set")){
                if(methodName.contains("Pl")){
                    type2 = OperationLogEnum.TYPE_2_A200_SETPARAMPL.getType();
                    operationTypeName = OperationLogEnum.TYPE_2_A200_SETPARAMPL.getName();
                }else{
                    type2 = OperationLogEnum.TYPE_2_A200_SETPARAM.getType();
                    operationTypeName = OperationLogEnum.TYPE_2_A200_SETPARAM.getName();
            if(methodName.startsWith("cancle")){
                type2 = OperationLogEnum.TYPE_2_Cancle_SETPARAM.getType();
                operationTypeName = OperationLogEnum.TYPE_2_Cancle_SETPARAM.getName();
                }
            if(methodName.startsWith("open")){
                type2 = OperationLogEnum.TYPE_2_Open_SETPARAMPL.getType();
                operationTypeName = OperationLogEnum.TYPE_2_Open_SETPARAMPL.getName();
            }
            if(methodName.startsWith("start")){
                if(methodName.contains("Pl")){
                    type2 = OperationLogEnum.TYPE_2_A200_STARTPL.getType();
                    operationTypeName = OperationLogEnum.TYPE_2_A200_STARTPL.getName();
                }else{
                    type2 = OperationLogEnum.TYPE_2_A200_START.getType();
                    operationTypeName = OperationLogEnum.TYPE_2_A200_START.getName();
            if(methodName.startsWith("add")){
                type2 = OperationLogEnum.TYPE_2_Add_START.getType();
                operationTypeName = OperationLogEnum.TYPE_2_Add_START.getName();
                }
            if(methodName.startsWith("del")){
                type2 = OperationLogEnum.TYPE_2_Del_STARTPL.getType();
                operationTypeName = OperationLogEnum.TYPE_2_Del_STARTPL.getName();
            }
            if(methodName.startsWith("stop")){
                if(methodName.contains("Pl")){
                    type2 = OperationLogEnum.TYPE_2_A200_STOPPL.getType();
                    operationTypeName = OperationLogEnum.TYPE_2_A200_STOPPL.getName();
                }else{
                    type2 = OperationLogEnum.TYPE_2_A200_STOP.getType();
                    operationTypeName = OperationLogEnum.TYPE_2_A200_STOP.getName();
                }
            }
        }else if(classNameTrue.contains("Actm")){
            type1 = OperationLogEnum.TYPE_1_SERVICE.getType();
            if(methodName.startsWith("set")){
                if(methodName.contains("Pl")){
                    type2 = OperationLogEnum.TYPE_2_ACTM_SETPARAMPL.getType();
                    operationTypeName = OperationLogEnum.TYPE_2_ACTM_SETPARAMPL.getName();
                }else{
                    type2 = OperationLogEnum.TYPE_2_ACTM_SETPARAM.getType();
                    operationTypeName = OperationLogEnum.TYPE_2_ACTM_SETPARAM.getName();
                }
            }
            if(methodName.startsWith("controll")){
                if(methodName.contains("Pl")){
                    type2 = OperationLogEnum.TYPE_2_ACTM_CONTROLLPL.getType();
                    operationTypeName = OperationLogEnum.TYPE_2_ACTM_CONTROLLPL.getName();
                }else{
                    type2 = OperationLogEnum.TYPE_2_ACTM_CONTROLL.getType();
                    operationTypeName = OperationLogEnum.TYPE_2_ACTM_CONTROLL.getName();
                }
            }
        }
        // TODO else if()
@@ -193,31 +164,6 @@
                }catch (Exception e){
                    paramBuilder.append(args[i].toString());
                }
                /*String[] paramSetArr = param.split(",");
                int paramSetLength = paramSetArr.length;
                for (int j = 0; j < paramSetLength; j++) {
                    String paramSet = paramSetArr[j];
                    if(j == 0){ //首行,特殊情况,存在null但是要保留
                        if(paramSet.endsWith("=null")){
                            if(paramSet.contains("(")){
                                paramBuilder.append(paramSet.substring(0,paramSet.lastIndexOf("(")+1));
                                continue;
                            }
                        }
                    }else if(j == paramSetLength -1){ //末行,特殊情况,存在null但是要保留
                        if(paramSet.endsWith("=null)")){
                            paramBuilder.append(")");
                            continue;
                        }
                    }
                    //其他非null情况
                    if(!paramSet.endsWith("=null")){
                        paramBuilder.append(paramSet);
                    }
                }*/
                //map.put(parameterNames[i], args[i].toString());
                map.put(parameterNames[i], paramBuilder.toString());
            }
        }
src/main/java/com/whyc/constant/OperationLogEnum.java
@@ -20,17 +20,10 @@
    TYPE_2_EXCEPTION(110,"调用异常"),
    //子级别-业务级
    TYPE_2_A200_SETPARAM(201,"A200参数设置"),
    TYPE_2_A200_SETPARAMPL(202,"批量A200参数设置"),
    TYPE_2_A200_START(203,"启动A200"),
    TYPE_2_A200_STARTPL(204,"批量启动A200"),
    TYPE_2_A200_STOP(205,"停止A200"),
    TYPE_2_A200_STOPPL(206,"批量停止A200"),
    TYPE_2_ACTM_SETPARAM(207,"ACTM参数设置"),
    TYPE_2_ACTM_SETPARAMPL(208,"批量ACTM参数设置"),
    TYPE_2_ACTM_CONTROLL(209,"控制ACTM均衡仪"),
    TYPE_2_ACTM_CONTROLLPL(210,"批量控制ACTM"),
    TYPE_2_Cancle_SETPARAM(201,"清空所有授权ID卡"),
    TYPE_2_Open_SETPARAMPL(202,"远程开锁"),
    TYPE_2_Add_START(203,"添加授权卡"),
    TYPE_2_Del_STARTPL(204,"移除授权卡"),
    TYPE_EXCEPTION(21, "接口调用异常"),