|
|
|
@ -9,9 +9,9 @@ import cn.jyjz.xiaoyao.ocr.api.entity.PictureSourceParameter;
|
|
|
|
|
import cn.jyjz.xiaoyao.ocr.api.entity.PictureSourceResult;
|
|
|
|
|
import cn.jyjz.xiaoyao.ocr.thread.TaskQueue;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.google.common.collect.Lists;
|
|
|
|
|
import com.google.common.collect.Maps;
|
|
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
|
|
import org.apache.commons.compress.utils.Lists;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
@ -87,6 +87,23 @@ public class PictureSourceTimerJob {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<PictureSourceResult> totalList = Lists.newArrayList();
|
|
|
|
|
totalList.addAll(this.pullData(departments, departmentMap, pictureSourceParameter));
|
|
|
|
|
|
|
|
|
|
int count = totalList.size();
|
|
|
|
|
int size = 0;
|
|
|
|
|
for (PictureSourceResult pictureSourceResult : totalList) {
|
|
|
|
|
if (pictureSourceResult.getLivePhoto() != null) {
|
|
|
|
|
size++;
|
|
|
|
|
// 将可以处理数据放入处理队列中
|
|
|
|
|
TaskQueue.pictureDisposePushData(pictureSourceResult);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
System.out.println("当前区间内图片总数:" + count + "条,可处理数据:" + size + "条");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<PictureSourceResult> pullData(List<Department> departments, Map<Long, Department> departmentMap, PictureSourceParameter pictureSourceParameter) {
|
|
|
|
|
List<PictureSourceResult> totalList = Lists.newArrayListWithCapacity(pictureSourceParameter.getPageSize());
|
|
|
|
|
for (Department department : departments) {
|
|
|
|
|
if (!departmentMap.containsKey(department.getParentid())) {
|
|
|
|
|
continue;
|
|
|
|
@ -105,16 +122,6 @@ public class PictureSourceTimerJob {
|
|
|
|
|
totalList.addAll(resultList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int count = totalList.size();
|
|
|
|
|
int size = 0;
|
|
|
|
|
for (PictureSourceResult pictureSourceResult : totalList) {
|
|
|
|
|
if (pictureSourceResult.getLivePhoto() != null) {
|
|
|
|
|
size++;
|
|
|
|
|
// 将可以处理数据放入处理队列中
|
|
|
|
|
TaskQueue.pictureDisposePushData(pictureSourceResult);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
System.out.println("当前区间内图片总数:" + count + "条,可处理数据:" + size + "条");
|
|
|
|
|
return totalList;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|