|
@@ -49,32 +49,12 @@ public class LtePmTask {
|
|
|
@Value("${lte.pm.distinct.targetDir:distinct/}")
|
|
|
private String distinctTargetDir;
|
|
|
|
|
|
-
|
|
|
-// @XxlJob("execHandler")
|
|
|
-// public void xxlJobCall(){
|
|
|
-// System.out.println("java-----------");
|
|
|
-// }
|
|
|
-
|
|
|
/**
|
|
|
* 扫描文件
|
|
|
*/
|
|
|
-// @XxlJob("")
|
|
|
-// public void scan() throws JSchException, SSHUtilException, IOException {
|
|
|
-// SSHUtil sshUtil = new SSHUtil(host, port, username, password);
|
|
|
-// String exec = sshUtil.exec(sourceDir);
|
|
|
-// File targetFile = new File(exec);
|
|
|
-// String[] list = targetFile.list();
|
|
|
-// for (String s : list) {
|
|
|
-// String[] split = s.split("\\.");
|
|
|
-// if (split[1].equals("csv")){
|
|
|
-// singleTask(split[0]);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
|
|
|
@XxlJob("execHandler")
|
|
|
public void cronTask() throws JSchException, SSHUtilException, IOException, SftpException {
|
|
|
- final Pattern p = Pattern.compile("(?<=" + filePrefix + ")\\d{10}(?=.csv)");
|
|
|
// 创建文件夹
|
|
|
Files.createDirectories(Paths.get(downloadTargetDir));
|
|
|
Files.createDirectories(Paths.get(distinctTargetDir));
|
|
@@ -84,13 +64,11 @@ public class LtePmTask {
|
|
|
if (CollectionUtils.isEmpty(list)) {
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
log.debug("扫描到的文件: {}", list);
|
|
|
- for (String t : list) {
|
|
|
- Matcher m = p.matcher(t);
|
|
|
- if (m.find()) {
|
|
|
- String hourString = m.group(0);
|
|
|
- singleTask(hourString);
|
|
|
+ for (String s : list) {
|
|
|
+ String[] split = s.split("\\.");
|
|
|
+ if (split[1].equals("csv")){
|
|
|
+ singleTask(split[0]);
|
|
|
}
|
|
|
}
|
|
|
}
|