Commit cab07481 authored by zhuxiang's avatar zhuxiang
Browse files

Merge remote-tracking branch 'origin/dev' into dev

parents e4591ddf a53d553e
...@@ -42,4 +42,7 @@ public class CasesEntity { ...@@ -42,4 +42,7 @@ public class CasesEntity {
private String templateId; private String templateId;
private Boolean drawFlag; private Boolean drawFlag;
@TableField("login_name")
private String loginName;
} }
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;
...@@ -141,15 +142,29 @@ public class AnalysisServiceImpl implements AnalysisService { ...@@ -141,15 +142,29 @@ public class AnalysisServiceImpl implements AnalysisService {
//保存excel数据,判断是否使用默认模板 //保存excel数据,判断是否使用默认模板
if (!ObjectUtils.isEmpty(ExcelTemplate) && !filterIndex.isEmpty()) { if (!ObjectUtils.isEmpty(ExcelTemplate) && !filterIndex.isEmpty()) {
List<ExcelDataEntity> afterDeduplication = Lists.newArrayList(); List<ExcelDataEntity> afterDeduplication = Lists.newArrayList();
List<ExcelDataEntity> afterDeduplication1 = Lists.newArrayList();
deduplicationData(excelDataMap, excelData, filterIndex); deduplicationData(excelDataMap, excelData, filterIndex);
//excelDataMap中的value传给afterDeduplication //excelDataMap中的value传给afterDeduplication
excelDataMap.forEach( excelDataMap.forEach(
(key, excelDatum) -> afterDeduplication.add(excelDatum) (key, excelDatum) -> afterDeduplication.add(excelDatum)
); );
excelDataService.saveBatch(afterDeduplication); for (ExcelDataEntity excelDataEntity : afterDeduplication) {
if (StringUtils.isNotEmpty(excelDataEntity.getPayeeName()) && !"-".equals(excelDataEntity.getPayeeName())) {
if (excelDataEntity.getPayeeName().contains("(个人)")) {
excelDataEntity.setPayeeName(excelDataEntity.getPayeeName().replace("(个人)", ""));
afterDeduplication1.add(excelDataEntity);
} else if (excelDataEntity.getPayeeName().contains("(商户)")) {
excelDataEntity.setPayeeName(excelDataEntity.getPayeeName().replace("(商户)", ""));
afterDeduplication1.add(excelDataEntity);
} else {
afterDeduplication1.add(excelDataEntity);
}
}
}
excelDataService.saveBatch(afterDeduplication1);
//保存无主用户 //保存无主用户
//afterDeduplication转换成payeeName的字符串集合并去重 //afterDeduplication转换成payeeName的字符串集合并去重
List<String> payeeNameList = afterDeduplication.stream().map(ExcelDataEntity::getPayeeName).distinct().collect(Collectors.toList()); List<String> payeeNameList = afterDeduplication1.stream().map(ExcelDataEntity::getPayeeName).distinct().collect(Collectors.toList());
for (String s : payeeNameList) { for (String s : payeeNameList) {
userList.add(UserEntity.builder() userList.add(UserEntity.builder()
.userName(s) .userName(s)
...@@ -159,10 +174,24 @@ public class AnalysisServiceImpl implements AnalysisService { ...@@ -159,10 +174,24 @@ public class AnalysisServiceImpl implements AnalysisService {
} }
userService.saveUserBatch(userList); userService.saveUserBatch(userList);
} else { } else {
excelDataService.saveBatch(excelData); List<ExcelDataEntity> excelData1 = Lists.newArrayList();
for (ExcelDataEntity excelDataEntity : excelData) {
if (StringUtils.isNotEmpty(excelDataEntity.getPayeeName()) && !"-".equals(excelDataEntity.getPayeeName())) {
if (excelDataEntity.getPayeeName().contains("(个人)")) {
excelDataEntity.setPayeeName(excelDataEntity.getPayeeName().replace("(个人)", ""));
excelData1.add(excelDataEntity);
} else if (excelDataEntity.getPayeeName().contains("(商户)")) {
excelDataEntity.setPayeeName(excelDataEntity.getPayeeName().replace("(商户)", ""));
excelData1.add(excelDataEntity);
} else {
excelData1.add(excelDataEntity);
}
}
}
excelDataService.saveBatch(excelData1);
//保存无主用户 //保存无主用户
//afterDeduplication转换成payeeName的字符串集合并去重 //afterDeduplication转换成payeeName的字符串集合并去重
List<String> payeeNameList = excelData.stream().map(ExcelDataEntity::getPayeeName).distinct().collect(Collectors.toList()); List<String> payeeNameList = excelData1.stream().map(ExcelDataEntity::getPayeeName).distinct().collect(Collectors.toList());
for (String s : payeeNameList) { for (String s : payeeNameList) {
userList.add(UserEntity.builder() userList.add(UserEntity.builder()
.userName(s) .userName(s)
...@@ -178,6 +207,10 @@ public class AnalysisServiceImpl implements AnalysisService { ...@@ -178,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)
...@@ -187,7 +220,7 @@ public class AnalysisServiceImpl implements AnalysisService { ...@@ -187,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")
......
...@@ -746,6 +746,8 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem ...@@ -746,6 +746,8 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem
caseRuleConfig.setCaseId(caseDTO.getId()); caseRuleConfig.setCaseId(caseDTO.getId());
caseRuleConfig.setWhiteFlag(true); caseRuleConfig.setWhiteFlag(true);
caseRuleConfig.setDirectionFlag(true); caseRuleConfig.setDirectionFlag(true);
caseRuleConfig.setMinAmount(100.0);
caseRuleConfig.setMinTransaction(2);
return caseRuleConfigService.save(caseRuleConfig); return caseRuleConfigService.save(caseRuleConfig);
} else { } else {
caseDTO.setLastUpdateTime(new Date()); caseDTO.setLastUpdateTime(new Date());
......
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
template_id template_id
from cases from cases
<where> <where>
login_name = #{loginName}
<if test="caseCode != null and caseCode != ''"> <if test="caseCode != null and caseCode != ''">
and case_code like concat('%', #{caseCode}, '%') and case_code like concat('%', #{caseCode}, '%')
</if> </if>
...@@ -59,6 +60,7 @@ ...@@ -59,6 +60,7 @@
and den_name like concat('%', #{denName}, '%') and den_name like concat('%', #{denName}, '%')
</if> </if>
</where> </where>
order by create_time desc
</select> </select>
<select id="getInfoById" resultType="com.platform.model.entity.CasesEntity"> <select id="getInfoById" resultType="com.platform.model.entity.CasesEntity">
select select
......
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