| | |
| | | return baseDirPath; |
| | | } |
| | | |
| | | /**手动记录特定日志*/ |
| | | public static void record(long uId, int operationType, String msg){ |
| | | docLogService.record(uId,operationType,msg); |
| | | /** |
| | | * 获取项目所在文件夹路径 |
| | | * @return 获取项目所在文件夹路径 |
| | | */ |
| | | public static String getProjectDir(){ |
| | | ApplicationHome applicationHome = new ApplicationHome(CommonUtil.class); |
| | | File jarFile = applicationHome.getDir(); |
| | | String baseDirPath; |
| | | if(YamlProperties.runModel == 1) { |
| | | //开发路径 |
| | | baseDirPath = jarFile.getParentFile().toString(); |
| | | }else { |
| | | //打包路径 |
| | | baseDirPath = jarFile.toString(); |
| | | } |
| | | return baseDirPath; |
| | | } |
| | | |
| | | /**手动记录特定日志*/ |
| | | 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){ |
| | | docLogService.record(uId,name,operationType,msg); |
| | | } |
| | | |
| | | /**手动记录特定日志*/ |
| | | 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; |
| | | } |
| | | } |