|
@@ -89,9 +89,19 @@ public class WorkPackerServiceImpl implements WorkPackerService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public int update(WorkPacker workPacker) {
|
|
|
+ public int update() {
|
|
|
Set<String> files = new HashSet<>();
|
|
|
files.addAll(getFile(filepath));
|
|
|
+ for (String fileName : files) {
|
|
|
+ QueryWrapper<WorkPacker> queryWrapper = new QueryWrapper<WorkPacker>();
|
|
|
+ queryWrapper.eq("del_flag", 0);
|
|
|
+ queryWrapper.eq("file_path", fileName);
|
|
|
+ Integer count = workPackerMapper.selectCount(queryWrapper);
|
|
|
+ if ("0".equals(count.toString())) {
|
|
|
+ log.info("存在遗漏数据进行补录:{}",fileName);
|
|
|
+ EasyExcel.read(fileName, WorkPackerExcel.class, new WorkPackerListener(workPackerMapper, fileName)).sheet().doRead();
|
|
|
+ }
|
|
|
+ }
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
@@ -101,18 +111,17 @@ public class WorkPackerServiceImpl implements WorkPackerService {
|
|
|
|
|
|
File file = new File(path);
|
|
|
File[] array = file.listFiles();
|
|
|
-
|
|
|
for (int i = 0; i < array.length; i++) {
|
|
|
if (array[i].isFile()) {
|
|
|
|
|
|
- log.info("^^^^^" + array[i].getName());
|
|
|
+
|
|
|
|
|
|
- log.info("#####" + array[i]);
|
|
|
+
|
|
|
|
|
|
- log.info("*****" + array[i].getPath());
|
|
|
+
|
|
|
files.add(array[i].getPath());
|
|
|
} else if (array[i].isDirectory()) {
|
|
|
- getFile(array[i].getPath());
|
|
|
+ files.addAll(getFile(array[i].getPath()));
|
|
|
}
|
|
|
}
|
|
|
return files;
|