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 {
private String templateId;
private Boolean drawFlag;
@TableField("login_name")
private String loginName;
}
package com.platform.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.google.common.collect.Maps;
import com.platform.exception.BusinessException;
import com.platform.model.entity.ExcelDataEntity;
......@@ -141,15 +142,29 @@ public class AnalysisServiceImpl implements AnalysisService {
//保存excel数据,判断是否使用默认模板
if (!ObjectUtils.isEmpty(ExcelTemplate) && !filterIndex.isEmpty()) {
List<ExcelDataEntity> afterDeduplication = Lists.newArrayList();
List<ExcelDataEntity> afterDeduplication1 = Lists.newArrayList();
deduplicationData(excelDataMap, excelData, filterIndex);
//excelDataMap中的value传给afterDeduplication
excelDataMap.forEach(
(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的字符串集合并去重
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) {
userList.add(UserEntity.builder()
.userName(s)
......@@ -159,10 +174,24 @@ public class AnalysisServiceImpl implements AnalysisService {
}
userService.saveUserBatch(userList);
} 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的字符串集合并去重
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) {
userList.add(UserEntity.builder()
.userName(s)
......@@ -178,6 +207,10 @@ public class AnalysisServiceImpl implements AnalysisService {
//保存用户
if (StringUtils.isNotEmpty(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)) {
userService.save(UserEntity.builder()
.userName(folderName)
......@@ -187,7 +220,7 @@ public class AnalysisServiceImpl implements AnalysisService {
.idType("身份证")
.type("1")
.caseId(caseId).build());
}else {
} else {
userService.save(UserEntity.builder()
.userName(folderName)
.type("1")
......
......@@ -746,6 +746,8 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem
caseRuleConfig.setCaseId(caseDTO.getId());
caseRuleConfig.setWhiteFlag(true);
caseRuleConfig.setDirectionFlag(true);
caseRuleConfig.setMinAmount(100.0);
caseRuleConfig.setMinTransaction(2);
return caseRuleConfigService.save(caseRuleConfig);
} else {
caseDTO.setLastUpdateTime(new Date());
......
......@@ -52,6 +52,7 @@
template_id
from cases
<where>
login_name = #{loginName}
<if test="caseCode != null and caseCode != ''">
and case_code like concat('%', #{caseCode}, '%')
</if>
......@@ -59,6 +60,7 @@
and den_name like concat('%', #{denName}, '%')
</if>
</where>
order by create_time desc
</select>
<select id="getInfoById" resultType="com.platform.model.entity.CasesEntity">
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