init:微信账单下载到本地
This commit is contained in:
@@ -921,6 +921,23 @@ public class GetDateController {
|
||||
return responseMap;
|
||||
}
|
||||
|
||||
// 将原始账单内容落地,便于后续人工核对或重复导入
|
||||
try {
|
||||
File csvFile = FileUtil.file(localPath, trade_date + ".csv");
|
||||
File txtFile = FileUtil.file(localPath, trade_date + ".txt");
|
||||
FileUtil.mkParentDirs(csvFile);
|
||||
FileUtil.writeUtf8String(body1, csvFile);
|
||||
FileUtil.writeUtf8String(body1, txtFile);
|
||||
log.info("微信账单已保存到本地: {}, {}", csvFile.getAbsolutePath(), txtFile.getAbsolutePath());
|
||||
} catch (IORuntimeException e) {
|
||||
log.error("微信账单保存本地失败,路径: {}, 错误: {}", localPath, e.getMessage(), e);
|
||||
errCode = "999";
|
||||
errMsg = "微信账单保存本地失败:" + e.getMessage();
|
||||
responseMap.put("errCode", errCode);
|
||||
responseMap.put("errMsg", errMsg);
|
||||
return responseMap;
|
||||
}
|
||||
|
||||
String[] split = body1.split("\n");
|
||||
for (int i = 1; i < split.length - 2; i++) {
|
||||
String[] split1 = split[i].split(",");
|
||||
|
||||
Reference in New Issue
Block a user