【fix sonar】PmsUtil文件
This commit is contained in:
+3
-6
@@ -33,14 +33,12 @@ public class PmsUtil {
|
||||
}
|
||||
name += DateUtils.yyyymmddhhmmss.get().format(d) + Math.round(Math.random() * 10000);
|
||||
String saveFilePath = saveFullDir + name + ".txt";
|
||||
|
||||
try {
|
||||
//封装目的地
|
||||
BufferedWriter bw = new BufferedWriter(new FileWriter(saveFilePath));
|
||||
//封装目的地
|
||||
try (BufferedWriter bw = new BufferedWriter(new FileWriter(saveFilePath))) {
|
||||
//遍历集合
|
||||
for (String s : msg) {
|
||||
//写数据
|
||||
if (s.indexOf("_") > 0) {
|
||||
if (s.contains("_")) {
|
||||
String arr[] = s.split("_");
|
||||
bw.write("第" + arr[0] + "行:" + arr[1]);
|
||||
} else {
|
||||
@@ -51,7 +49,6 @@ public class PmsUtil {
|
||||
}
|
||||
//释放资源
|
||||
bw.flush();
|
||||
bw.close();
|
||||
} catch (Exception e) {
|
||||
log.info("excel导入生成错误日志文件异常:" + e.getMessage());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user