Commit 74bb6da3 authored by zhuxiang's avatar zhuxiang
Browse files

增加节点数量

parent ce67ec2e
......@@ -41,7 +41,7 @@ public interface ExcelDataMapper extends BaseMapper<ExcelDataEntity> {
List<ExcelDataEntity> accountCashFlow(UserDTO userDTO);
List<ExcelDataEntity> queryListByPayeeNameAndPayUserName(@Param("payeeName") String payeeName, @Param("caseId") int caseId);
List<ExcelDataVO> queryListByPayeeNameAndPayUserName(@Param("payeeName") String payeeName, @Param("caseId") int caseId);
List<ExcelDataVO> queryListByGroupId(CaseDTO caseDTO);
......
......@@ -68,7 +68,7 @@ public interface ExcelDataService extends IService<ExcelDataEntity> {
void deleteByPayeeName(String nodeName);
List<ExcelDataEntity> queryListByPayeeNameAndPayUserName(String payeeName, int caseId);
List<ExcelDataVO> queryListByPayeeNameAndPayUserName(String payeeName, int caseId);
List<ExcelDataVO> queryListByGroupId(CaseDTO caseDTO);
......
......@@ -120,7 +120,7 @@ public class ExcelDataServiceImpl extends ServiceImpl<ExcelDataMapper, ExcelData
}
@Override
public List<ExcelDataEntity> queryListByPayeeNameAndPayUserName(String payeeName, int caseId) {
public List<ExcelDataVO> queryListByPayeeNameAndPayUserName(String payeeName, int caseId) {
return baseMapper.queryListByPayeeNameAndPayUserName(payeeName, caseId);
}
......
......@@ -2,10 +2,8 @@ package com.platform.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Maps;
import com.platform.mapper.NodeMapper;
import com.platform.model.dto.NodeDTO;
import com.platform.model.entity.ExcelDataEntity;
import com.platform.model.entity.NodeEntity;
import com.platform.model.vo.ExcelDataVO;
import com.platform.model.vo.NodeVO;
......@@ -45,13 +43,18 @@ public class NodeServiceImpl extends ServiceImpl<NodeMapper, NodeEntity> impleme
// 使用Set去重
Set<String> uniqueNodes = new HashSet<>();
List<ExcelDataEntity> excelDataEntityList = excelDataService.queryListByPayeeNameAndPayUserName(nodeDTO.getPayeeName(), nodeDTO.getCaseId());
Map<String, Integer> nodeDegreeMap = new HashMap<>();
List<ExcelDataVO> excelDataEntityList = excelDataService.queryListByPayeeNameAndPayUserName(nodeDTO.getPayeeName(), nodeDTO.getCaseId());
excelDataEntityList.forEach(excelDataEntity -> {
String payer = excelDataEntity.getPayUserName();
String payee = excelDataEntity.getPayeeName();
// 添加节点
uniqueNodes.add(payer);
uniqueNodes.add(payee);
String key = payer + payee;
nodeDegreeMap.put(key, excelDataEntity.getNodeNum());
});
//查看每个人的账号类型
......@@ -62,9 +65,11 @@ public class NodeServiceImpl extends ServiceImpl<NodeMapper, NodeEntity> impleme
List<NodeVO> result = Lists.newArrayList();
excelDataEntityListNew.forEach(excelDataVO -> {
if (excelDataVO != null) {
String key = nodeDTO.getPayeeName() + excelDataVO.getPayUserName();
int nodeNum = nodeDegreeMap.getOrDefault(key, 0);
NodeVO person = new NodeVO();
person.setNode(excelDataVO.getPayUserName());
person.setNodeNum(excelDataVO.getNodeNum());
person.setNodeNum(nodeNum);
person.setLabel(excelDataVO.getLabel());
person.setNodeType("个人");
result.add(person);
......
......@@ -314,15 +314,11 @@
)
</select>
<select id="queryListByPayeeNameAndPayUserName" resultType="com.platform.model.entity.ExcelDataEntity">
<select id="queryListByPayeeNameAndPayUserName" resultType="com.platform.model.vo.ExcelDataVO">
select
ed.id,
ed.pay_user_name payUserName,
ed.payee_name payeeName,
ed.amount amount,
ed.ip ip,
ed.mac mac,
ed.payment_bank_name
count(ed.id) nodeNum
from
excel_data ed
where
......@@ -333,6 +329,9 @@
ed.case_id = #{caseId}
and
(ed.payee_name = #{payeeName} or ed.pay_user_name = #{payeeName})
GROUP BY
ed.pay_user_name,
ed.payee_name;
</select>
<select id="queryListByGroupId" resultType="com.platform.model.vo.ExcelDataVO">
......
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