fix:1.提交日志/报告抽象类

This commit is contained in:
panbaolin 2023-10-11 16:26:55 +08:00
parent d9ba592743
commit b3e0a4fc73

View File

@ -0,0 +1,42 @@
package org.jeecg.modules.base.abstracts;
/**
* 日志/报告格式化抽象类
*/
public abstract class AbstractLogOrReport {
/**
* 行日志格式化
* @param source 需要格式化的字符串
* @param symbolNum 格式化的符号数量
* @param args 格式化替换参数数组
* @return
*/
public String titleFormat(String source, Integer symbolNum, String... args){
StringBuilder firstParam = new StringBuilder();
for (int i=0;i<symbolNum;i++){
firstParam.append(args[0]);
}
args[0] = firstParam.toString();
StringBuilder lastParam = new StringBuilder();
for (int i=0;i<symbolNum;i++){
lastParam.append(args[args.length-1]);
}
args[args.length-1] = lastParam.toString();
return String.format(source,args);
}
/**
* 行格式化
* @param source
* @param args
* @return
*/
public String rowFormat(String source, String... args){
return String.format(source,args);
}
}