"...platform/git@gitlab.ruzhoukj.com:wujipeng/relation.git" did not exist on "598bbf5156dffe01355b6770f79560d7dd0785d8"
Commit 70945d51 authored by zhuxiang's avatar zhuxiang
Browse files

信息查询接口补充完整

parent acc846db
...@@ -82,8 +82,8 @@ public class CaseController extends BaseController { ...@@ -82,8 +82,8 @@ public class CaseController extends BaseController {
} }
@ApiOperation(value = "画布-信息查询") @ApiOperation(value = "画布-信息查询")
@GetMapping("/query/info/{caseId}") @PostMapping("/query/info")
public Result info(@PathVariable int caseId) { public Result info(@RequestBody CaseDTO caseDTO) {
return Result.data(caseService.info(caseId)); return Result.data(caseService.info(caseDTO));
} }
} }
...@@ -32,4 +32,6 @@ public interface ExcelDataMapper extends BaseMapper<ExcelDataEntity> { ...@@ -32,4 +32,6 @@ public interface ExcelDataMapper extends BaseMapper<ExcelDataEntity> {
List<ExcelDataEntity> cashFlow(UserDTO userDTO); List<ExcelDataEntity> cashFlow(UserDTO userDTO);
List<ExcelDataEntity> relationPage(@Param("oneselfAccountList") List<String> oneselfAccountList, @Param("otherAccountList") List<String> otherAccountList); List<ExcelDataEntity> relationPage(@Param("oneselfAccountList") List<String> oneselfAccountList, @Param("otherAccountList") List<String> otherAccountList);
List<ExcelDataEntity> queryInfoList(CaseDTO caseDTO);
} }
...@@ -42,4 +42,9 @@ public class CaseDTO extends CaseEntity { ...@@ -42,4 +42,9 @@ public class CaseDTO extends CaseEntity {
private String fileName; private String fileName;
private String nodeName;
private String label;
private String accountType;
} }
...@@ -58,7 +58,7 @@ public interface CaseService extends IService<CaseEntity> { ...@@ -58,7 +58,7 @@ public interface CaseService extends IService<CaseEntity> {
*/ */
GraphVO draw(CaseDTO caseDTO); GraphVO draw(CaseDTO caseDTO);
List<ExcelDataVO> info(int caseId); List<ExcelDataVO> info(CaseDTO caseDTO);
/** /**
* 新增编辑 * 新增编辑
......
...@@ -54,4 +54,6 @@ public interface ExcelDataService extends IService<ExcelDataEntity> { ...@@ -54,4 +54,6 @@ public interface ExcelDataService extends IService<ExcelDataEntity> {
List<ExcelDataEntity> cashFlow(UserDTO userDTO); List<ExcelDataEntity> cashFlow(UserDTO userDTO);
List<ExcelDataEntity> relationPage(List<String> oneselfAccountList, List<String> otherAccountList); List<ExcelDataEntity> relationPage(List<String> oneselfAccountList, List<String> otherAccountList);
List<ExcelDataEntity> queryInfoList(CaseDTO caseDTO);
} }
...@@ -370,15 +370,13 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CaseEntity> impleme ...@@ -370,15 +370,13 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CaseEntity> impleme
} }
@Override @Override
public List<ExcelDataVO> info(int caseId) { public List<ExcelDataVO> info(CaseDTO caseDTO) {
// 使用Set去重 // 使用Set去重
Set<String> uniqueNodes = new HashSet<>(); Set<String> uniqueNodes = new HashSet<>();
// 使用Map来统计每个人关联的节点数量 // 使用Map来统计每个人关联的节点数量
Map<String, Integer> nodeDegreeMap = new HashMap<>(); Map<String, Integer> nodeDegreeMap = new HashMap<>();
CaseDTO caseDTO = new CaseDTO(); List<ExcelDataEntity> excelDataEntityList = excelDataService.queryInfoList(caseDTO);
caseDTO.setId(caseId);
List<ExcelDataEntity> excelDataEntityList = excelDataService.queryList(caseDTO);
// 遍历结果集 // 遍历结果集
for (ExcelDataEntity excelDataEntity : excelDataEntityList) { for (ExcelDataEntity excelDataEntity : excelDataEntityList) {
...@@ -396,7 +394,7 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CaseEntity> impleme ...@@ -396,7 +394,7 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CaseEntity> impleme
} }
//查看每个人的账号类型 //查看每个人的账号类型
List<String> userNameList = new ArrayList<>(uniqueNodes); List<String> userNameList = new ArrayList<>(uniqueNodes);
List<ExcelDataVO> excelDataEntityListNew = excelDataService.queryListByPayUserList(userNameList, caseId); List<ExcelDataVO> excelDataEntityListNew = excelDataService.queryListByPayUserList(userNameList, caseDTO.getId());
//根据用户名分组 //根据用户名分组
List<ExcelDataVO> groupedObjects = excelDataEntityListNew.stream() List<ExcelDataVO> groupedObjects = excelDataEntityListNew.stream()
.collect(Collectors.groupingBy(ExcelDataVO::getPayUserName)) .collect(Collectors.groupingBy(ExcelDataVO::getPayUserName))
...@@ -408,12 +406,26 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CaseEntity> impleme ...@@ -408,12 +406,26 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CaseEntity> impleme
//获取节点数量 //获取节点数量
int nodeNum = nodeDegreeMap.get(excelDataVO.getPayUserName()); int nodeNum = nodeDegreeMap.get(excelDataVO.getPayUserName());
excelDataVO.setNodeNum(nodeNum); excelDataVO.setNodeNum(nodeNum);
if (excelDataVO.getRemark().contains("微信")) { if (StringUtils.isNotEmpty(excelDataVO.getExternalChannel())) {
excelDataVO.setAccountType("微信");
} else if (StringUtils.isNotEmpty(excelDataVO.getExternalChannel())) {
excelDataVO.setAccountType("银联"); excelDataVO.setAccountType("银联");
} else {
excelDataVO.setAccountType("个人");
} }
}); });
Iterator<ExcelDataVO> iterator = groupedObjects.iterator();
while (iterator.hasNext()) {
ExcelDataVO excelDataVO = iterator.next();
if (caseDTO.getMinTransaction() != null && caseDTO.getMaxTransaction() != null) {
if (excelDataVO.getNodeNum() < caseDTO.getMinTransaction() || excelDataVO.getNodeNum() > caseDTO.getMaxTransaction()) {
iterator.remove(); // 安全移除元素
}
}
if(StringUtils.isNotEmpty(caseDTO.getAccountType())){
if(!excelDataVO.getAccountType().equals(caseDTO.getAccountType())){
iterator.remove(); // 安全移除元素
}
}
}
return groupedObjects; return groupedObjects;
} }
......
package com.platform.service.impl; package com.platform.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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.ExcelDataMapper; import com.platform.mapper.ExcelDataMapper;
import com.platform.model.dto.CaseDTO; import com.platform.model.dto.CaseDTO;
import com.platform.model.dto.UserDTO; import com.platform.model.dto.UserDTO;
...@@ -64,6 +66,9 @@ public class ExcelDataServiceImpl extends ServiceImpl<ExcelDataMapper, ExcelData ...@@ -64,6 +66,9 @@ public class ExcelDataServiceImpl extends ServiceImpl<ExcelDataMapper, ExcelData
@Override @Override
public List<ExcelDataVO> queryListByPayUserList(List<String> userList, int caseId) { public List<ExcelDataVO> queryListByPayUserList(List<String> userList, int caseId) {
if (CollUtil.isEmpty(userList)) {
return Lists.newArrayList();
}
return baseMapper.queryListByPayUserList(userList, caseId); return baseMapper.queryListByPayUserList(userList, caseId);
} }
...@@ -79,6 +84,11 @@ public class ExcelDataServiceImpl extends ServiceImpl<ExcelDataMapper, ExcelData ...@@ -79,6 +84,11 @@ public class ExcelDataServiceImpl extends ServiceImpl<ExcelDataMapper, ExcelData
@Override @Override
public List<ExcelDataEntity> relationPage(List<String> oneselfAccountList, List<String> otherAccountList) { public List<ExcelDataEntity> relationPage(List<String> oneselfAccountList, List<String> otherAccountList) {
return baseMapper.relationPage(oneselfAccountList,otherAccountList); return baseMapper.relationPage(oneselfAccountList, otherAccountList);
}
@Override
public List<ExcelDataEntity> queryInfoList(CaseDTO caseDTO) {
return baseMapper.queryInfoList(caseDTO);
} }
} }
...@@ -17,6 +17,9 @@ ...@@ -17,6 +17,9 @@
on on
ed.file_id = fu.id ed.file_id = fu.id
<where> <where>
<if test="id != null and id != ''">
and ed.id = #{id}
</if>
<if test="payUserName != null and payUserName != ''"> <if test="payUserName != null and payUserName != ''">
and ed.pay_user_name like concat('%',#{payUserName},'%') and ed.pay_user_name like concat('%',#{payUserName},'%')
</if> </if>
...@@ -126,4 +129,36 @@ ...@@ -126,4 +129,36 @@
from excel_data from excel_data
where (payment_account in (#{oneselfAccountList}) and payment_account in (#{otherAccountList})) or (payment_account in (#{otherAccountList}) and payment_account in (#{oneselfAccountList})) where (payment_account in (#{oneselfAccountList}) and payment_account in (#{otherAccountList})) or (payment_account in (#{otherAccountList}) and payment_account in (#{oneselfAccountList}))
</select> </select>
<select id="queryInfoList" resultType="com.platform.model.entity.ExcelDataEntity">
select
ed.pay_user_name payUserName,
ed.payee_name payeeName,
ed.amount amount,
ed.ip ip,
ed.mac mac,
ed.payment_bank_name
from
excel_data ed
left join
user u
on
ed.pay_user_name = u.user_name
where
ed.use_flag = 1
and
ed.case_id = #{id}
<if test="startTime != null and endTime != ''">
and ed.time BETWEEN #{startTime} and #{endTime}
</if>
<if test="minAmount != null and maxAmount != ''">
and ed.amount BETWEEN #{minAmount} and #{maxAmount}
</if>
<if test="nodeName != null and nodeName != ''">
and (ed.pay_user_name like concat('%',#{nodeName},'%') or payee_bank_card like concat('%',#{nodeName},'%'))
</if>
<if test="label != null and label != ''">
and u.label like concat('%',#{label},'%')
</if>
</select>
</mapper> </mapper>
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