whycxzp
2023-02-21 8db4d00b41728e5a25cbb7b661d502ecd570e88d
src/main/java/com/whyc/util/CommonUtil.java
@@ -71,16 +71,33 @@
    }
    /**手动记录特定日志*/
    public static void record(long uId, int operationType, String msg){
        docLogService.record(uId,operationType,msg);
    public static void record(long uId,String name, int operationType, String msg){
        docLogService.record(uId,name,operationType,msg);
    }
    /**手动记录特定日志*/
    public static void record(long uId, int operationType, String msg,String msgDetail){
        docLogService.record(uId,operationType,msg,msgDetail);
    public static void record(long uId,String name, int operationType, String msg,String msgDetail){
        docLogService.record(uId,name,operationType,msg,msgDetail);
    }
    /**手动记录特定日志*/
    public static void record2(HttpServletRequest request,long uId, int operationType, String msg,String msgDetail){
        docLogService.record2(request,uId,operationType,msg,msgDetail);
    public static void record2(HttpServletRequest request,long uId,String name, int operationType, String msg,String msgDetail){
        docLogService.record2(request,uId,name,operationType,msg,msgDetail);
    }
    public static String codeAutoFill(String code){
        int length = code.length();
        if (length == 9) {
            code = "0" + code;
        } else if (length < 9) {
            int centerZeroNum = 10 - length - 1;
            StringBuilder centerZeroStr = new StringBuilder();
            for (int j = 0; j < centerZeroNum; j++) {
                centerZeroStr.append("0");
            }
            String strFront = code.substring(0, 3);
            String strBehind = code.substring(3);
            code = "0" + strFront + centerZeroStr + strBehind;
        }
        return code;
    }
}