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