|
|
@ -2,6 +2,7 @@ package cn.jyjz.xiaoyao.ocr.service.impl;
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
import cn.jyjz.flowable.common.ProcessConstant;
|
|
|
|
import cn.jyjz.flowable.common.ProcessConstant;
|
|
|
|
|
|
|
|
import cn.jyjz.xiaoyao.common.base.util.StringUtils;
|
|
|
|
import cn.jyjz.xiaoyao.common.base.vo.ResultVoUtil;
|
|
|
|
import cn.jyjz.xiaoyao.common.base.vo.ResultVoUtil;
|
|
|
|
import cn.jyjz.xiaoyao.common.base.vo.UserToken;
|
|
|
|
import cn.jyjz.xiaoyao.common.base.vo.UserToken;
|
|
|
|
import cn.jyjz.xiaoyao.ocr.dataDao.OcrTaskchildDubiousFileMapper;
|
|
|
|
import cn.jyjz.xiaoyao.ocr.dataDao.OcrTaskchildDubiousFileMapper;
|
|
|
@ -47,13 +48,14 @@ public class OcrTaskchildDubiousFileServiceImpl extends ServiceImpl<OcrTaskchild
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param pageNo
|
|
|
|
* @param pageNo
|
|
|
|
* @param pageSize
|
|
|
|
* @param pageSize
|
|
|
|
* @param orderbyname
|
|
|
|
* @param orderByUptime
|
|
|
|
|
|
|
|
* @param orderBysimilarity
|
|
|
|
* @param userToken
|
|
|
|
* @param userToken
|
|
|
|
* @param tenantId
|
|
|
|
* @param tenantId
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public Page<OcrTaskChildPictureVo> dubiousfilelist(Integer pageNo, Integer pageSize, String orderbyname, UserToken userToken, String tenantId) {
|
|
|
|
public Page<OcrTaskChildPictureVo> dubiousfilelist(Integer pageNo, Integer pageSize,String orderByUptime,String orderBysimilarity,UserToken userToken, String tenantId) {
|
|
|
|
|
|
|
|
|
|
|
|
Page<OcrTaskChildPictureVo> objectPage = new Page<>(Integer.valueOf(pageNo), Integer.valueOf(pageSize));
|
|
|
|
Page<OcrTaskChildPictureVo> objectPage = new Page<>(Integer.valueOf(pageNo), Integer.valueOf(pageSize));
|
|
|
|
|
|
|
|
|
|
|
@ -74,13 +76,41 @@ public class OcrTaskchildDubiousFileServiceImpl extends ServiceImpl<OcrTaskchild
|
|
|
|
List<OcrTaskChildPictureVo> taskChildPictures = ocrTaskchildPictureService.getDubiousfileList(new ArrayList<>(pictureIdList), userNodeType);
|
|
|
|
List<OcrTaskChildPictureVo> taskChildPictures = ocrTaskchildPictureService.getDubiousfileList(new ArrayList<>(pictureIdList), userNodeType);
|
|
|
|
|
|
|
|
|
|
|
|
if (CollUtil.isNotEmpty(taskChildPictures)) {
|
|
|
|
if (CollUtil.isNotEmpty(taskChildPictures)) {
|
|
|
|
//按时间字段排序
|
|
|
|
|
|
|
|
if ("desc".equals(orderbyname)) {
|
|
|
|
Comparator<OcrTaskChildPictureVo> comparator = null;
|
|
|
|
taskChildPictures.sort(Comparator.comparing(OcrTaskChildPictureVo::getSubmitDateTimestamp).reversed());
|
|
|
|
|
|
|
|
} else {
|
|
|
|
// 判断 orderByUptime 是否不为空
|
|
|
|
taskChildPictures.sort(Comparator.comparing(OcrTaskChildPictureVo::getSubmitDateTimestamp));
|
|
|
|
if (orderByUptime != null && StringUtils.isNotEmpty(orderByUptime)) {
|
|
|
|
|
|
|
|
if ("asc".equals(orderByUptime)) {
|
|
|
|
|
|
|
|
comparator = Comparator.comparing(OcrTaskChildPictureVo::getSubmitDateTimestamp);
|
|
|
|
|
|
|
|
} else if ("desc".equals(orderByUptime)) {
|
|
|
|
|
|
|
|
comparator = Comparator.comparing(OcrTaskChildPictureVo::getSubmitDateTimestamp).reversed();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 判断 orderBysimilarity 是否不为空
|
|
|
|
|
|
|
|
if (orderBysimilarity != null && StringUtils.isNotEmpty(orderBysimilarity)) {
|
|
|
|
|
|
|
|
Comparator<OcrTaskChildPictureVo> similarityComparator = null;
|
|
|
|
|
|
|
|
if ("asc".equals(orderBysimilarity)) {
|
|
|
|
|
|
|
|
similarityComparator = Comparator.comparing(OcrTaskChildPictureVo::getSimilarityScore);
|
|
|
|
|
|
|
|
} else if ("desc".equals(orderBysimilarity)) {
|
|
|
|
|
|
|
|
similarityComparator = Comparator.comparing(OcrTaskChildPictureVo::getSimilarityScore).reversed();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 如果 orderByUptime 和 orderBysimilarity 都不为空,则先按照 orderBysimilarity 排序
|
|
|
|
|
|
|
|
if (comparator != null) {
|
|
|
|
|
|
|
|
comparator = comparator.thenComparing(similarityComparator);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
comparator = similarityComparator;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 进行排序
|
|
|
|
|
|
|
|
if (comparator != null) {
|
|
|
|
|
|
|
|
taskChildPictures.sort(comparator);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<OcrTaskChildPictureVo> records = taskChildPictures.stream().skip((pageNo - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
|
|
|
|
List<OcrTaskChildPictureVo> records = taskChildPictures.stream().skip((pageNo - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
|
|
|
|
objectPage.setRecords(records);
|
|
|
|
objectPage.setRecords(records);
|
|
|
|
objectPage.setTotal(taskChildPictures.size());
|
|
|
|
objectPage.setTotal(taskChildPictures.size());
|
|
|
|