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

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

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