Commit 9bb55ab1 authored by data爬虫-冯 军凯's avatar data爬虫-冯 军凯

黑名单增加手机号/身份证号MD5查询功能mmm

parent 022034f8
......@@ -67,18 +67,18 @@ public class BlackListImportManagerController {
return GlobalResponse.success();
}
@RequestMapping("/import_blacklist_by_excel")
public GlobalResponse importBlacklistByExcel(@RequestParam("excelFile") MultipartFile file){
Map<String, Object> objectMap = null;
try {
objectMap = iBlackListManagerService.importBlacklistByExcel(file);
}catch (Exception e){
log.error("导入异常e:",e);
return GlobalResponse.error("导入异常"+e.getMessage());
}
return GlobalResponse.success(objectMap);
}
// @RequestMapping("/import_blacklist_by_excel")
// public GlobalResponse importBlacklistByExcel(@RequestParam("excelFile") MultipartFile file){
// Map<String, Object> objectMap = null;
// try {
// objectMap = iBlackListManagerService.importBlacklistByExcel(file);
// }catch (Exception e){
// log.error("导入异常e:",e);
// return GlobalResponse.error("导入异常"+e.getMessage());
//
// }
// return GlobalResponse.success(objectMap);
// }
@RequestMapping("/manual_import_black_list")
public GlobalResponse manualImport(String sourcePath){
return iBlackListManagerService.manualImportBlackList(sourcePath);
......
......@@ -17,7 +17,7 @@ public interface IBlackListManagerService {
public GlobalResponse manualImportBlackList(String sourcePath);
public Map<String,Object> importBlacklistByExcel(MultipartFile file) throws IOException;
// public Map<String,Object> importBlacklistByExcel(MultipartFile file) throws IOException;
@Deprecated
public void blackListPhoneHistoryManagerByMonth(String startTime, String endTime);
......
......@@ -49,6 +49,8 @@ public class BlackListManagerServiceImpl implements IBlackListManagerService {
private JdbcTemplate xyqbUserJdbcTemplate;
@Autowired
private IBlackListUpdateThreeEleService iBlackListUpdateThreeEleService;
@Autowired
private BlackListQueryTidbMapper blackListQueryMapper;
@Autowired
private ExcelUtil excelUtil;
......@@ -156,25 +158,30 @@ public class BlackListManagerServiceImpl implements IBlackListManagerService {
return GlobalResponse.error("手动导入发生异常");
}
@Override
public Map<String,Object> importBlacklistByExcel(MultipartFile file) throws IOException {
Map<String,Object> result = new HashMap<>();
List<BlackListQueryTidbVo0> failes = new ArrayList<>();
Map<String,Object> errMap = new HashMap<>();
List<BlackListQueryTidbVo0> read = excelUtil.read(file.getOriginalFilename(), file.getInputStream(), BlackListQueryTidbVo0.class);
for (BlackListQueryTidbVo0 blackListQueryTidbVo0 : read) {
int i = blackListQueryMapper.insertIgnore(blackListQueryTidbVo0);
if(i<=0){
failes.add(blackListQueryTidbVo0);
}
}
errMap.put("条数",failes.size());
errMap.put("未导入的数据",failes);
result.put("总条数",read.size());
result.put("导入成功条数",read.size()-failes.size());
result.put("未导入黑名单:",errMap);
return result;
}
/**
* 黑名单导入添加更新逻辑暂时先不使用该方法
* @param startTime
* @param endTime
*/
// @Override
// public Map<String,Object> importBlacklistByExcel(MultipartFile file) throws IOException {
// Map<String,Object> result = new HashMap<>();
// List<BlackListQueryTidbVo0> failes = new ArrayList<>();
// Map<String,Object> errMap = new HashMap<>();
// List<BlackListQueryTidbVo0> read = excelUtil.read(file.getOriginalFilename(), file.getInputStream(), BlackListQueryTidbVo0.class);
// for (BlackListQueryTidbVo0 blackListQueryTidbVo0 : read) {
// int i = blackListQueryMapper.insertIgnore(blackListQueryTidbVo0);
// if(i<=0){
// failes.add(blackListQueryTidbVo0);
// }
// }
// errMap.put("条数",failes.size());
// errMap.put("未导入的数据",failes);
// result.put("总条数",read.size());
// result.put("导入成功条数",read.size()-failes.size());
// result.put("未导入黑名单:",errMap);
// return result;
// }
@Override
public void blackListPhoneHistoryManagerByMonth(String startTime, String endTime) {
......
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