Commit 9c66eeef authored by wujipeng's avatar wujipeng
Browse files

文件解析优化

parent 029e3e71
...@@ -188,7 +188,9 @@ public class AnalysisServiceImpl implements AnalysisService { ...@@ -188,7 +188,9 @@ public class AnalysisServiceImpl implements AnalysisService {
.type("2") .type("2")
.build()); .build());
} }
if(!userList.isEmpty()){
userService.saveUserBatch(userList); userService.saveUserBatch(userList);
}
} else { } else {
List<ExcelDataEntity> excelData1 = Lists.newArrayList(); List<ExcelDataEntity> excelData1 = Lists.newArrayList();
for (ExcelDataEntity excelDataEntity : excelData) { for (ExcelDataEntity excelDataEntity : excelData) {
...@@ -215,8 +217,10 @@ public class AnalysisServiceImpl implements AnalysisService { ...@@ -215,8 +217,10 @@ public class AnalysisServiceImpl implements AnalysisService {
.type("2") .type("2")
.build()); .build());
} }
if(!userList.isEmpty()){
userService.saveUserBatch(userList); userService.saveUserBatch(userList);
} }
}
//保存账户 //保存账户
groupedMap.forEach((paymentAccount, paymentBankName) -> userAccountList.add(UserAccountEntity.builder().userName(folderName).account(paymentBankName).caseId(caseId).code(paymentAccount).build())); groupedMap.forEach((paymentAccount, paymentBankName) -> userAccountList.add(UserAccountEntity.builder().userName(folderName).account(paymentBankName).caseId(caseId).code(paymentAccount).build()));
if (!userAccountList.isEmpty()) { if (!userAccountList.isEmpty()) {
...@@ -259,9 +263,11 @@ public class AnalysisServiceImpl implements AnalysisService { ...@@ -259,9 +263,11 @@ public class AnalysisServiceImpl implements AnalysisService {
} }
if (filterIndex.contains(2)) { if (filterIndex.contains(2)) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if(!ObjectUtils.isEmpty(excelDatum.getTime())){
String formattedDate = sdf.format(excelDatum.getTime()); String formattedDate = sdf.format(excelDatum.getTime());
key.append(formattedDate); key.append(formattedDate);
} }
}
if (filterIndex.contains(3)) { if (filterIndex.contains(3)) {
key.append(excelDatum.getAmount()); key.append(excelDatum.getAmount());
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment