Commit 373a5a99 by jinfeng.wang

support idIosPkg、iosPkg

parent 088951b8
......@@ -9,9 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.*;
import java.util.regex.Pattern;
/**
......@@ -51,7 +49,7 @@ public class TreeTagServiceImpl implements TreeTagService {
InputStreamReader read = new InputStreamReader(new FileInputStream(file), encoding);
BufferedReader bufferedReader = new BufferedReader(read);
String lineTxt;
List<TreeTag> list = new ArrayList<>();
Set<TreeTag> set = new HashSet<>();
while ((lineTxt = bufferedReader.readLine()) != null) {
TreeTag treeTag = new TreeTag();
......@@ -85,19 +83,19 @@ public class TreeTagServiceImpl implements TreeTagService {
treeTag.setThirdTag("");
}
treeTag.setUpdateTime(new Date());
list.add(treeTag);
set.add(treeTag);
if (idIosPkgPtn.matcher(packageName).matches()) {
treeTag.setPackageName(packageName.replace("id", ""));
list.add(treeTag);
set.add(treeTag);
}
if (iosPkgPtn.matcher(packageName).matches()) {
treeTag.setPackageName("id" + packageName);
list.add(treeTag);
set.add(treeTag);
}
}
bufferedReader.close();
read.close();
if (batchInsert(list)) {
if (batchInsert(new ArrayList<>(set))) {
return true;
}
return false;
......
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