Commit 1dada8f1 authored by zhuxiang's avatar zhuxiang
Browse files

用户列表判断是否设为白名单

parent d6b94b5f
...@@ -5,6 +5,7 @@ import com.platform.model.dto.WhiteDTO; ...@@ -5,6 +5,7 @@ import com.platform.model.dto.WhiteDTO;
import com.platform.model.entity.WhiteEntity; import com.platform.model.entity.WhiteEntity;
import com.platform.model.vo.WhiteVO; import com.platform.model.vo.WhiteVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
...@@ -25,4 +26,6 @@ public interface WhiteMapper extends BaseMapper<WhiteEntity> { ...@@ -25,4 +26,6 @@ public interface WhiteMapper extends BaseMapper<WhiteEntity> {
List<WhiteVO> pageWhite(WhiteDTO whiteDTO); List<WhiteVO> pageWhite(WhiteDTO whiteDTO);
List<String> queryList(); List<String> queryList();
List<WhiteEntity> queryByNameList(@Param("userNameList") List<String> userNameList);
} }
...@@ -19,4 +19,6 @@ public class ExcelDataVO extends ExcelDataEntity { ...@@ -19,4 +19,6 @@ public class ExcelDataVO extends ExcelDataEntity {
private int nodeNum; private int nodeNum;
private String accountType; private String accountType;
private boolean whiteSetFlag;
} }
...@@ -15,6 +15,8 @@ public class NodeVO { ...@@ -15,6 +15,8 @@ public class NodeVO {
private String bankCode; private String bankCode;
private Boolean whiteSetFlag;
private int degree; private int degree;
public NodeVO(String node) { public NodeVO(String node) {
......
...@@ -47,4 +47,6 @@ public interface WhiteService extends IService<WhiteEntity> { ...@@ -47,4 +47,6 @@ public interface WhiteService extends IService<WhiteEntity> {
void importExcel(List<WhiteEntity> list); void importExcel(List<WhiteEntity> list);
List<String> queryList(); List<String> queryList();
List<WhiteEntity> queryByNameList(List<String> userNameList);
} }
...@@ -439,6 +439,9 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem ...@@ -439,6 +439,9 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem
//查看每个人的账号标签 //查看每个人的账号标签
List<ExcelDataVO> excelDataEntityListNew = userService.queryUserLabel(userNameList, caseDTO.getId()); List<ExcelDataVO> excelDataEntityListNew = userService.queryUserLabel(userNameList, caseDTO.getId());
//查看是否存在白名单
List<WhiteEntity> whiteEntityList = whiteService.queryByNameList(userNameList);
for (ExcelDataVO dataVO : excelDataEntityListNew) { for (ExcelDataVO dataVO : excelDataEntityListNew) {
for (Map.Entry<String, Integer> entry : nodeDegreeMap.entrySet()) { for (Map.Entry<String, Integer> entry : nodeDegreeMap.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
...@@ -452,6 +455,13 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem ...@@ -452,6 +455,13 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem
dataVO.setNodeNum(value); dataVO.setNodeNum(value);
} }
} }
whiteEntityList.forEach(whiteEntity -> {
if (whiteEntity.getId() != null && dataVO.getPayUserName().equals(whiteEntity.getName())) {
dataVO.setWhiteSetFlag(true);
}else {
dataVO.setWhiteSetFlag(false);
}
});
} }
Iterator<ExcelDataVO> iterator = excelDataEntityListNew.iterator(); Iterator<ExcelDataVO> iterator = excelDataEntityListNew.iterator();
...@@ -477,13 +487,15 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem ...@@ -477,13 +487,15 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem
org.setNode(excelDataVO.getPayUserName()); org.setNode(excelDataVO.getPayUserName());
org.setNodeNum(excelDataVO.getNodeNum()); org.setNodeNum(excelDataVO.getNodeNum());
org.setBankCode(excelDataVO.getPayeeBankCard()); org.setBankCode(excelDataVO.getPayeeBankCard());
org.setWhiteSetFlag(excelDataVO.isWhiteSetFlag());
org.setNodeType("银联"); org.setNodeType("银联");
result.add(org); result.add(org);
}else{ } else {
NodeVO person = new NodeVO(); NodeVO person = new NodeVO();
person.setNode(excelDataVO.getPayUserName()); person.setNode(excelDataVO.getPayUserName());
person.setNodeNum(excelDataVO.getNodeNum()); person.setNodeNum(excelDataVO.getNodeNum());
person.setLabel(excelDataVO.getLabel()); person.setLabel(excelDataVO.getLabel());
person.setWhiteSetFlag(excelDataVO.isWhiteSetFlag());
person.setNodeType("个人"); person.setNodeType("个人");
result.add(person); result.add(person);
} }
......
...@@ -47,4 +47,9 @@ public class WhiteServiceImpl extends ServiceImpl<WhiteMapper, WhiteEntity> impl ...@@ -47,4 +47,9 @@ public class WhiteServiceImpl extends ServiceImpl<WhiteMapper, WhiteEntity> impl
public List<String> queryList() { public List<String> queryList() {
return baseMapper.queryList(); return baseMapper.queryList();
} }
@Override
public List<WhiteEntity> queryByNameList(List<String> userNameList) {
return baseMapper.queryByNameList(userNameList);
}
} }
...@@ -24,4 +24,18 @@ ...@@ -24,4 +24,18 @@
from from
white white
</select> </select>
<select id="queryByNameList" resultType="com.platform.model.entity.WhiteEntity">
SELECT
v.name AS name,
w.id
FROM
(
<foreach collection="userNameList" item="userName" separator="UNION ALL">
SELECT #{userName} AS name
</foreach>
) AS v
LEFT JOIN
white w ON w.name = v.name
</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