Commit 2819ef80 authored by zhuxiang's avatar zhuxiang
Browse files

画布接口优化

parent 5a5358b1
...@@ -44,5 +44,5 @@ public class CaseDTO extends CasesEntity { ...@@ -44,5 +44,5 @@ public class CaseDTO extends CasesEntity {
private String label; private String label;
private String accountType; private String nodeType;
} }
...@@ -38,6 +38,11 @@ public class UserEntity { ...@@ -38,6 +38,11 @@ public class UserEntity {
private String basicInfo; private String basicInfo;
/**
* 1、左边列表展示 2、不展示
*/
private String type;
@ApiModelProperty("标签") @ApiModelProperty("标签")
private String label; private String label;
......
...@@ -19,8 +19,9 @@ public class NodeVO { ...@@ -19,8 +19,9 @@ public class NodeVO {
private int degree; private int degree;
public NodeVO(String node) { public NodeVO(String node, String label) {
this.node = node; this.node = node;
this.label = label;
if (node.contains("公司")) { if (node.contains("公司")) {
this.nodeType = "对公"; this.nodeType = "对公";
} else { } else {
......
...@@ -133,6 +133,8 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem ...@@ -133,6 +133,8 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem
// 使用并查集管理团体关系 // 使用并查集管理团体关系
UnionFindVO uf = new UnionFindVO(); UnionFindVO uf = new UnionFindVO();
Set<String> uniqueUserName = new HashSet<>();
// 存储边信息,键为payer-payee组合 // 存储边信息,键为payer-payee组合
Map<String, EdgeVO> edgeMap = new HashMap<>(); Map<String, EdgeVO> edgeMap = new HashMap<>();
...@@ -161,6 +163,8 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem ...@@ -161,6 +163,8 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem
String mac = excelDataEntity.getMac(); String mac = excelDataEntity.getMac();
String account = excelDataEntity.getPaymentBankName(); String account = excelDataEntity.getPaymentBankName();
uniqueUserName.add(payee);
uniqueUserName.add(payer);
// 添加到并查集 // 添加到并查集
uf.makeSet(payer); uf.makeSet(payer);
uf.makeSet(payee); uf.makeSet(payee);
...@@ -181,13 +185,19 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem ...@@ -181,13 +185,19 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem
} }
} }
List<String> userNameList = new ArrayList<>(uniqueUserName);
List<ExcelDataVO> excelDataEntityListNew = userService.queryUserLabel(userNameList, caseDTO.getId());
Map<String, String> userAndLabel = new HashMap<>();
excelDataEntityListNew.forEach(excelDataVO -> userAndLabel.put(excelDataVO.getPayUserName(), excelDataVO.getLabel()));
// 第二步:过滤节点 // 第二步:过滤节点
Set<String> validNodes = new HashSet<>(); Set<String> validNodes = new HashSet<>();
for (String node : uf.getParent().keySet()) { for (String node : uf.getParent().keySet()) {
if (shouldIncludeNode(node, caseDTO)) { if (shouldIncludeNode(node, caseDTO)) {
validNodes.add(node); validNodes.add(node);
graph.addNode(new NodeVO(node)); String label = userAndLabel.get(node);
graph.addNode(new NodeVO(node,label));
} }
} }
...@@ -372,7 +382,7 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem ...@@ -372,7 +382,7 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem
//查看白名单 //查看白名单
List<String> whiteUser = whiteService.queryList(); List<String> whiteUser = whiteService.queryList();
// 如果 name 属性值存在于白名单中,则移除该元素 // 如果 name 属性值存在于白名单中,则移除该元素
excelDataEntityList.removeIf(entity -> whiteUser.contains(entity.getPayUserName())); excelDataEntityList.removeIf(entity -> whiteUser.contains(entity.getPayUserName()) || whiteUser.contains(entity.getPayeeName()));
} }
@Override @Override
...@@ -475,8 +485,8 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem ...@@ -475,8 +485,8 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem
iterator.remove(); // 安全移除元素 iterator.remove(); // 安全移除元素
} }
} }
if (StringUtils.isNotEmpty(caseDTO.getAccountType())) { if (StringUtils.isNotEmpty(caseDTO.getNodeType())) {
if (!excelDataVO.getAccountType().equals(caseDTO.getAccountType())) { if (!excelDataVO.getAccountType().equals(caseDTO.getNodeType())) {
iterator.remove(); // 安全移除元素 iterator.remove(); // 安全移除元素
} }
} }
......
...@@ -11,6 +11,7 @@ import com.platform.model.vo.*; ...@@ -11,6 +11,7 @@ import com.platform.model.vo.*;
import com.platform.service.ExcelDataService; import com.platform.service.ExcelDataService;
import com.platform.service.GroupDetailService; import com.platform.service.GroupDetailService;
import com.platform.service.GroupService; import com.platform.service.GroupService;
import com.platform.service.UserService;
import com.platform.utils.StringUtils; import com.platform.utils.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -20,6 +21,8 @@ import java.util.*; ...@@ -20,6 +21,8 @@ import java.util.*;
@Service @Service
public class GroupDetailServiceImpl extends ServiceImpl<GroupDetailMapper, GroupDetailEntity> implements GroupDetailService { public class GroupDetailServiceImpl extends ServiceImpl<GroupDetailMapper, GroupDetailEntity> implements GroupDetailService {
@Resource
private UserService userService;
@Resource @Resource
private GroupService groupService; private GroupService groupService;
@Resource @Resource
...@@ -30,7 +33,7 @@ public class GroupDetailServiceImpl extends ServiceImpl<GroupDetailMapper, Group ...@@ -30,7 +33,7 @@ public class GroupDetailServiceImpl extends ServiceImpl<GroupDetailMapper, Group
return baseMapper.selectList(new LambdaQueryWrapper<GroupDetailEntity>() return baseMapper.selectList(new LambdaQueryWrapper<GroupDetailEntity>()
.eq(GroupDetailEntity::getGroupId, groupDetailDTO.getGroupId()) .eq(GroupDetailEntity::getGroupId, groupDetailDTO.getGroupId())
.notLike(GroupDetailEntity::getUserName,"商户")); .notLike(GroupDetailEntity::getUserName, "商户"));
} }
@Override @Override
...@@ -106,9 +109,13 @@ public class GroupDetailServiceImpl extends ServiceImpl<GroupDetailMapper, Group ...@@ -106,9 +109,13 @@ public class GroupDetailServiceImpl extends ServiceImpl<GroupDetailMapper, Group
} }
} }
List<String> userNameList = new ArrayList<>(uniqueNodes);
List<ExcelDataVO> excelDataEntityListNew = userService.queryUserLabel(userNameList, groupEntity.getCaseId());
Map<String, String> userAndLabel = new HashMap<>();
excelDataEntityListNew.forEach(excelDataVO -> userAndLabel.put(excelDataVO.getPayUserName(), excelDataVO.getLabel()));
// 添加去重后的节点 // 添加去重后的节点
for (String node : uniqueNodes) { for (String node : uniqueNodes) {
graph.addNode(new NodeVO(node)); graph.addNode(new NodeVO(node, userAndLabel.get(node)));
} }
// 添加边 // 添加边
......
...@@ -277,7 +277,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme ...@@ -277,7 +277,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
@Override @Override
public List<String> queryListByCaseId(Integer id) { public List<String> queryListByCaseId(Integer id) {
List<UserEntity> userEntityList = baseMapper.selectList(new LambdaQueryWrapper<UserEntity>() List<UserEntity> userEntityList = baseMapper.selectList(new LambdaQueryWrapper<UserEntity>()
.eq(UserEntity::getCaseId, id)); .eq(UserEntity::getCaseId, id)
.eq(UserEntity::getType, 1));
Set<String> userNameList = new HashSet<>(); Set<String> userNameList = new HashSet<>();
userEntityList.forEach(userEntity -> userNameList.add(userEntity.getUserName())); userEntityList.forEach(userEntity -> userNameList.add(userEntity.getUserName()));
return new ArrayList<>(userNameList); return new ArrayList<>(userNameList);
......
package com.platform.service.impl; package com.platform.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Lists;
import com.platform.mapper.WhiteMapper; import com.platform.mapper.WhiteMapper;
import com.platform.model.dto.WhiteDTO; import com.platform.model.dto.WhiteDTO;
import com.platform.model.entity.WhiteEntity; import com.platform.model.entity.WhiteEntity;
...@@ -50,6 +52,9 @@ public class WhiteServiceImpl extends ServiceImpl<WhiteMapper, WhiteEntity> impl ...@@ -50,6 +52,9 @@ public class WhiteServiceImpl extends ServiceImpl<WhiteMapper, WhiteEntity> impl
@Override @Override
public List<WhiteEntity> queryByNameList(List<String> userNameList) { public List<WhiteEntity> queryByNameList(List<String> userNameList) {
if (CollUtil.isNotEmpty(userNameList)) {
return baseMapper.queryByNameList(userNameList); return baseMapper.queryByNameList(userNameList);
} }
return Lists.newArrayList();
}
} }
server: server:
port: 8730 port: 8730
#spring:
# datasource:
# username: root
# password: RZKJ_0415$
# driver-class-name: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://47.110.71.183:3306/relation?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
spring: spring:
datasource: datasource:
username: root username: root
password: ruzhoukj@2022 password: RZKJ_0415$
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.10.3:3307/relation?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true url: jdbc:mysql://47.110.71.183:3306/relation?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
#spring:
# datasource:
# username: root
# password: ruzhoukj@2022
# driver-class-name: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://192.168.10.3:3307/relation?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
servlet: servlet:
multipart: multipart:
...@@ -22,6 +22,12 @@ spring: ...@@ -22,6 +22,12 @@ spring:
max-request-size: 100MB # 整个请求的最大大小(默认 10MB) max-request-size: 100MB # 整个请求的最大大小(默认 10MB)
file-size-threshold: 1MB file-size-threshold: 1MB
mybatis: logging:
level:
org.apache.ibatis: DEBUG
java.sql.Connection: DEBUG
java.sql.Statement: DEBUG
java.sql.PreparedStatement: DEBUG
mybatis-plus:
configuration: configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
\ No newline at end of file
...@@ -176,7 +176,7 @@ ...@@ -176,7 +176,7 @@
and ed.amount BETWEEN #{minAmount} and #{maxAmount} and ed.amount BETWEEN #{minAmount} and #{maxAmount}
</if> </if>
<if test="nodeName != null and nodeName != ''"> <if test="nodeName != null and nodeName != ''">
and (ed.pay_user_name like concat('%',#{nodeName},'%') or payee_bank_card like concat('%',#{nodeName},'%')) and (ed.pay_user_name like concat('%',#{nodeName},'%') or payee_bank_card like concat('%',#{nodeName},'%') or u.id_type = #{nodeName})
</if> </if>
<if test="label != null and label != ''"> <if test="label != null and label != ''">
and u.label like concat('%',#{label},'%') and u.label like concat('%',#{label},'%')
......
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