添加图片最大相似值

pull/1/head
sunchenliang 2 years ago
parent 94b2cbec67
commit 4c0df12a73

@ -214,6 +214,14 @@ public class OcrPictureController extends BaseController {
QueryWrapper<OcrPicture> queryWrapper = new QueryWrapper<>();
String search_month = req.getParameter("search_month");
String ordertype = req.getParameter("ordertype");
if (StringUtils.isNotBlank(ordertype)) {
if (ordertype.equals("0")) {
queryWrapper.orderByAsc("similarity_score");
} else {
queryWrapper.orderByDesc("similarity_score");
}
}
if (StringUtils.isNotBlank(search_month) && Integer.parseInt(search_month) <= 12 && Integer.parseInt(search_month) > 0) {
queryWrapper.ge("create_time", DataUtil.afterDateByMonth(Integer.parseInt(search_month)));
}

@ -306,6 +306,11 @@ public class OcrPicture implements BaseDto, java.io.Serializable {
@TableField(value = "img_hash")
private String imgHash;
@ApiModelProperty(value = "相似度数值")
@Schema(description = "相似度数值")
@TableField(value = "similarity_score")
private Integer similarityscore;
@ApiModelProperty(value = "图片查重的比对图片集合")
@TableField(exist = false)
private List<OcrPicture> listCom;

@ -31,7 +31,6 @@ import java.util.stream.Stream;
import java.util.stream.Collectors;
@Data
@Builder
@NoArgsConstructor
@ -225,6 +224,10 @@ public class OcrTaskchildPicture implements BaseDto,java.io.Serializable {
@TableField(exist = false)
private String reporttime;
@ApiModelProperty(value = "相似度数值")
@TableField(exist = false)
private Integer similarityscore;
@ApiModelProperty(value = "本人审查日志")
@TableField(exist = false)
private Userapprove userapprove;
@ -302,6 +305,7 @@ public class OcrTaskchildPicture implements BaseDto,java.io.Serializable {
new SimpleEntry<>("TASKNAME", "taskname")
)
.collect(Collectors.toMap(SimpleEntry::getKey, SimpleEntry::getValue));
@Override
public String getQueryFiled(String filedname) {
String obj = null;

@ -82,6 +82,7 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
@Resource
private OcrPictureclassService ocrPictureclassService;
@Resource
private CategoryService categoryService;
@ -427,7 +428,13 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
ocrTaskchildPicture.setPackageid(packageid);
StringBuffer pcid = new StringBuffer();
StringBuffer result = new StringBuffer();
int max = 0;
for (OcrPicture comp : ocrPicture.getListCom()) {
double doubleValue = Double.parseDouble(comp.getResult());
int intValue = (int) doubleValue;
if (intValue > max) {
max = intValue;
}
if (null == pcid || pcid.toString().length() < 1) {
pcid.append(comp.getId());
result.append(comp.getResult());
@ -439,6 +446,8 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
ocrTaskchildPicture.setOcpictureid(pcid.toString());
ocrTaskchildPicture.setPictureresult(result.toString());
ocrTaskchildPicture.setPicturecompare(String.join(",", ocrPicture.getPicturecompareList()));
ocrPicture.setSimilarityscore(max);
this.updateById(ocrPicture);
return ocrTaskchildPictureService.updateById(ocrTaskchildPicture) ? ocrTaskchildPicture : null;
}

@ -167,7 +167,7 @@
</where>
</sql>
<select id="listFinal" resultType="cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPicture" parameterType="java.util.Map">
select tcp.*,pic.field11 reporttime from (
select tcp.*,pic.field11 reporttime,pic.similarity_score similarityscore from (
select
tc.*
from ocr_taskchild_picture tc,OA_USERFINAL_T uf

Loading…
Cancel
Save