Commit a53d553e authored by wujipeng's avatar wujipeng
Browse files

解析优化

parent 45676539
package com.platform.service.impl; package com.platform.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.platform.exception.BusinessException; import com.platform.exception.BusinessException;
import com.platform.model.entity.ExcelDataEntity; import com.platform.model.entity.ExcelDataEntity;
...@@ -148,14 +149,14 @@ public class AnalysisServiceImpl implements AnalysisService { ...@@ -148,14 +149,14 @@ public class AnalysisServiceImpl implements AnalysisService {
(key, excelDatum) -> afterDeduplication.add(excelDatum) (key, excelDatum) -> afterDeduplication.add(excelDatum)
); );
for (ExcelDataEntity excelDataEntity : afterDeduplication) { for (ExcelDataEntity excelDataEntity : afterDeduplication) {
if (StringUtils.isNotEmpty(excelDataEntity.getPayeeName()) && !"-".equals(excelDataEntity.getPayeeName())){ if (StringUtils.isNotEmpty(excelDataEntity.getPayeeName()) && !"-".equals(excelDataEntity.getPayeeName())) {
if(excelDataEntity.getPayeeName().contains("(个人)")){ if (excelDataEntity.getPayeeName().contains("(个人)")) {
excelDataEntity.setPayeeName(excelDataEntity.getPayeeName().replace("(个人)", "")); excelDataEntity.setPayeeName(excelDataEntity.getPayeeName().replace("(个人)", ""));
afterDeduplication1.add(excelDataEntity); afterDeduplication1.add(excelDataEntity);
}else if (excelDataEntity.getPayeeName().contains("(商户)")){ } else if (excelDataEntity.getPayeeName().contains("(商户)")) {
excelDataEntity.setPayeeName(excelDataEntity.getPayeeName().replace("(商户)", "")); excelDataEntity.setPayeeName(excelDataEntity.getPayeeName().replace("(商户)", ""));
afterDeduplication1.add(excelDataEntity); afterDeduplication1.add(excelDataEntity);
}else { } else {
afterDeduplication1.add(excelDataEntity); afterDeduplication1.add(excelDataEntity);
} }
} }
...@@ -175,14 +176,14 @@ public class AnalysisServiceImpl implements AnalysisService { ...@@ -175,14 +176,14 @@ public class AnalysisServiceImpl implements AnalysisService {
} else { } else {
List<ExcelDataEntity> excelData1 = Lists.newArrayList(); List<ExcelDataEntity> excelData1 = Lists.newArrayList();
for (ExcelDataEntity excelDataEntity : excelData) { for (ExcelDataEntity excelDataEntity : excelData) {
if (StringUtils.isNotEmpty(excelDataEntity.getPayeeName()) && !"-".equals(excelDataEntity.getPayeeName())){ if (StringUtils.isNotEmpty(excelDataEntity.getPayeeName()) && !"-".equals(excelDataEntity.getPayeeName())) {
if(excelDataEntity.getPayeeName().contains("(个人)")){ if (excelDataEntity.getPayeeName().contains("(个人)")) {
excelDataEntity.setPayeeName(excelDataEntity.getPayeeName().replace("(个人)", "")); excelDataEntity.setPayeeName(excelDataEntity.getPayeeName().replace("(个人)", ""));
excelData1.add(excelDataEntity); excelData1.add(excelDataEntity);
}else if (excelDataEntity.getPayeeName().contains("(商户)")){ } else if (excelDataEntity.getPayeeName().contains("(商户)")) {
excelDataEntity.setPayeeName(excelDataEntity.getPayeeName().replace("(商户)", "")); excelDataEntity.setPayeeName(excelDataEntity.getPayeeName().replace("(商户)", ""));
excelData1.add(excelDataEntity); excelData1.add(excelDataEntity);
}else { } else {
excelData1.add(excelDataEntity); excelData1.add(excelDataEntity);
} }
} }
...@@ -206,6 +207,10 @@ public class AnalysisServiceImpl implements AnalysisService { ...@@ -206,6 +207,10 @@ public class AnalysisServiceImpl implements AnalysisService {
//保存用户 //保存用户
if (StringUtils.isNotEmpty(folderName)) { if (StringUtils.isNotEmpty(folderName)) {
Map<String, String> idCardInfo = IdCardUtils.parseIdCardInfo(folderName); Map<String, String> idCardInfo = IdCardUtils.parseIdCardInfo(folderName);
//删除旧用户
userService.remove(new LambdaQueryWrapper<UserEntity>()
.eq(UserEntity::getUserName, folderName)
.eq(UserEntity::getCaseId, caseId));
if (!ObjectUtils.isEmpty(idCardInfo)) { if (!ObjectUtils.isEmpty(idCardInfo)) {
userService.save(UserEntity.builder() userService.save(UserEntity.builder()
.userName(folderName) .userName(folderName)
...@@ -215,7 +220,7 @@ public class AnalysisServiceImpl implements AnalysisService { ...@@ -215,7 +220,7 @@ public class AnalysisServiceImpl implements AnalysisService {
.idType("身份证") .idType("身份证")
.type("1") .type("1")
.caseId(caseId).build()); .caseId(caseId).build());
}else { } else {
userService.save(UserEntity.builder() userService.save(UserEntity.builder()
.userName(folderName) .userName(folderName)
.type("1") .type("1")
......
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