添加图片最大相似值

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

@ -214,8 +214,16 @@ public class OcrPictureController extends BaseController {
QueryWrapper<OcrPicture> queryWrapper = new QueryWrapper<>(); QueryWrapper<OcrPicture> queryWrapper = new QueryWrapper<>();
String search_month = req.getParameter("search_month"); String search_month = req.getParameter("search_month");
if(StringUtils.isNotBlank(search_month) && Integer.parseInt(search_month) <= 12 && Integer.parseInt(search_month) > 0){ String ordertype = req.getParameter("ordertype");
queryWrapper.ge("create_time",DataUtil.afterDateByMonth(Integer.parseInt(search_month))); 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)));
} }
//根据参数枚举获取检索参数并映射为数据库的字段的key-v map //根据参数枚举获取检索参数并映射为数据库的字段的key-v map

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

@ -31,160 +31,159 @@ import java.util.stream.Stream;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Data @Data
@Builder @Builder
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@ApiModel(value="任务信息", description="任务信息") @ApiModel(value = "任务信息", description = "任务信息")
@TableName(value = "ocr_taskchild_picture") @TableName(value = "ocr_taskchild_picture")
public class OcrTaskchildPicture implements BaseDto,java.io.Serializable { public class OcrTaskchildPicture implements BaseDto, java.io.Serializable {
private static final long serialVersionUID = -8018660053527763810L; private static final long serialVersionUID = -8018660053527763810L;
@ApiModelProperty(value = "主键") @ApiModelProperty(value = "主键")
@TableId(value = "id",type = IdType.ASSIGN_ID) @TableId(value = "id", type = IdType.ASSIGN_ID)
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
@TableField(value="ID") @TableField(value = "ID")
private Long id; private Long id;
@ApiModelProperty(value = "比对图片主键,多个数据使用英文逗号分隔") @ApiModelProperty(value = "比对图片主键,多个数据使用英文逗号分隔")
@TableField(value="OCPICTUREID") @TableField(value = "OCPICTUREID")
private String ocpictureid; private String ocpictureid;
@ApiModelProperty(value = "图片比对结果,与图片主键一一对应记录比对结果使用英文逗号分隔例如99.6,98.1,97.2") @ApiModelProperty(value = "图片比对结果,与图片主键一一对应记录比对结果使用英文逗号分隔例如99.6,98.1,97.2")
@TableField(value="PICTURERESULT") @TableField(value = "PICTURERESULT")
private String pictureresult; private String pictureresult;
@ApiModelProperty(value = "只记录主图,如果存在历史图片,不在这里记录") @ApiModelProperty(value = "只记录主图,如果存在历史图片,不在这里记录")
@TableField(value="PICTURECOMPARE") @TableField(value = "PICTURECOMPARE")
private String picturecompare; private String picturecompare;
@ApiModelProperty(value = "所属部门") @ApiModelProperty(value = "所属部门")
@TableField(value="DEPTID") @TableField(value = "DEPTID")
private String deptid; private String deptid;
@ApiModelProperty(value = "租户ID") @ApiModelProperty(value = "租户ID")
@TableField(value="TENANTID") @TableField(value = "TENANTID")
private Long tenantid; private Long tenantid;
@ApiModelProperty(value = "任务包主键") @ApiModelProperty(value = "任务包主键")
@TableField(value="PACKAGEID") @TableField(value = "PACKAGEID")
private Long packageid; private Long packageid;
@ApiModelProperty(value = "原图片主键") @ApiModelProperty(value = "原图片主键")
@TableField(value="PICTUREID") @TableField(value = "PICTUREID")
private Long pictureid; private Long pictureid;
@ApiModelProperty(value = "类型名称") @ApiModelProperty(value = "类型名称")
@TableField(value="CATEGORY") @TableField(value = "CATEGORY")
private String category; private String category;
@ApiModelProperty(value = "项目ID") @ApiModelProperty(value = "项目ID")
@TableField(value="CATEGORYID") @TableField(value = "CATEGORYID")
private Long categoryid; private Long categoryid;
@ApiModelProperty(value = "明细单") @ApiModelProperty(value = "明细单")
@TableField(value="SPECIFICATION") @TableField(value = "SPECIFICATION")
private String specification; private String specification;
@ApiModelProperty(value = "业务编码") @ApiModelProperty(value = "业务编码")
@TableField(value="BUESSINESSNO") @TableField(value = "BUESSINESSNO")
private String buessinessno; private String buessinessno;
@ApiModelProperty(value = "状态,审批状态 1:未提交 2:审批中 3:审批通过 5拒绝") @ApiModelProperty(value = "状态,审批状态 1:未提交 2:审批中 3:审批通过 5拒绝")
@TableField(value="STATES") @TableField(value = "STATES")
private Integer states; private Integer states;
@ApiModelProperty(value = "流程实例IdprocessInstanceId") @ApiModelProperty(value = "流程实例IdprocessInstanceId")
@TableField(value="PROCESSINSTANCEID") @TableField(value = "PROCESSINSTANCEID")
private String processinstanceid; private String processinstanceid;
@ApiModelProperty(value = "流程定义id") @ApiModelProperty(value = "流程定义id")
@TableField(value="PROCESSDEFINITIONID") @TableField(value = "PROCESSDEFINITIONID")
private String processdefinitionid; private String processdefinitionid;
@ApiModelProperty(value = "流程部署id") @ApiModelProperty(value = "流程部署id")
@TableField(value="DEPLOYMENTID") @TableField(value = "DEPLOYMENTID")
private String deploymentid; private String deploymentid;
@ApiModelProperty(value = "审批人姓名") @ApiModelProperty(value = "审批人姓名")
@TableField(value="ASSIGNEENAME") @TableField(value = "ASSIGNEENAME")
private String assigneename; private String assigneename;
@ApiModelProperty(value = "审批人") @ApiModelProperty(value = "审批人")
@TableField(value="ASSIGNEE") @TableField(value = "ASSIGNEE")
private String assignee; private String assignee;
@ApiModelProperty(value = "修改人,记录创建人的帐号") @ApiModelProperty(value = "修改人,记录创建人的帐号")
@TableField(value="UPDATEUSER") @TableField(value = "UPDATEUSER")
private String updateuser; private String updateuser;
@ApiModelProperty(value = "更新时间") @ApiModelProperty(value = "更新时间")
@TableField(value="UPDATETIME") @TableField(value = "UPDATETIME")
private Long updatetime; private Long updatetime;
@ApiModelProperty(value = "附件") @ApiModelProperty(value = "附件")
@TableField(value="FILEANNEX") @TableField(value = "FILEANNEX")
private String fileannex; private String fileannex;
@ApiModelProperty(value = "是否归档0未归档1归档") @ApiModelProperty(value = "是否归档0未归档1归档")
@TableField(value="GUIDANG") @TableField(value = "GUIDANG")
private Integer guidang; private Integer guidang;
@ApiModelProperty(value = "创建人") @ApiModelProperty(value = "创建人")
@TableField(value="CREATEUSER") @TableField(value = "CREATEUSER")
private String createuser; private String createuser;
@ApiModelProperty(value = "创建人姓名") @ApiModelProperty(value = "创建人姓名")
@TableField(value="CREATEUSERNAME") @TableField(value = "CREATEUSERNAME")
private String createusername; private String createusername;
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
@TableField(value="CREATEDATE") @TableField(value = "CREATEDATE")
private Long createdate; private Long createdate;
@ApiModelProperty(value = "员工主键") @ApiModelProperty(value = "员工主键")
@TableField(value="USERID") @TableField(value = "USERID")
private Long userid; private Long userid;
@ApiModelProperty(value = "员工姓名") @ApiModelProperty(value = "员工姓名")
@TableField(value="USERNAME") @TableField(value = "USERNAME")
private String username; private String username;
@ApiModelProperty(value = "任务id,来源于图片表") @ApiModelProperty(value = "任务id,来源于图片表")
@TableField(value="FROMTASKID") @TableField(value = "FROMTASKID")
private String fromtaskid; private String fromtaskid;
@ApiModelProperty(value = "任务名称,来源于图片表") @ApiModelProperty(value = "任务名称,来源于图片表")
@TableField(value="FROMTASKNAME") @TableField(value = "FROMTASKNAME")
private String fromtaskname; private String fromtaskname;
@ApiModelProperty(value = "提报人") @ApiModelProperty(value = "提报人")
@TableField(value="FROMUSERID") @TableField(value = "FROMUSERID")
private String fromuserid; private String fromuserid;
@ApiModelProperty(value = "所属项目") @ApiModelProperty(value = "所属项目")
@TableField(value="FROMPROJECTID") @TableField(value = "FROMPROJECTID")
private String fromprojectid; private String fromprojectid;
@ApiModelProperty(value = "所属计划") @ApiModelProperty(value = "所属计划")
@TableField(value="FROMPLANID") @TableField(value = "FROMPLANID")
private String fromplanid; private String fromplanid;
@ApiModelProperty(value = "提报时间") @ApiModelProperty(value = "提报时间")
@TableField(value="FROMUPTIME") @TableField(value = "FROMUPTIME")
private Long fromuptime; private Long fromuptime;
@ApiModelProperty(value = "任务来源") @ApiModelProperty(value = "任务来源")
@TableField(value="FROMSOURCEID") @TableField(value = "FROMSOURCEID")
private String fromsourceid; private String fromsourceid;
@ApiModelProperty(value = "是否为相似图片与其他图片对比为百分百的记录为10不相似1相似") @ApiModelProperty(value = "是否为相似图片与其他图片对比为百分百的记录为10不相似1相似")
@TableField(value="HAVEPOINTS") @TableField(value = "HAVEPOINTS")
private Integer havepoints; private Integer havepoints;
@Schema(description = "当前节点名称") @Schema(description = "当前节点名称")
@TableField(value="TASKNAME") @TableField(value = "TASKNAME")
private String taskname; private String taskname;
@ApiModelProperty(value = "项目对象") @ApiModelProperty(value = "项目对象")
@ -209,27 +208,31 @@ public class OcrTaskchildPicture implements BaseDto,java.io.Serializable {
@TableField(exist = false) @TableField(exist = false)
private boolean izHistory; private boolean izHistory;
@ApiModelProperty(value ="图片真假 0:假1其他表示没有设置") @ApiModelProperty(value = "图片真假 0:假1其他表示没有设置")
@TableField(exist = false) @TableField(exist = false)
private Integer iztrueorfalse; private Integer iztrueorfalse;
@ApiModelProperty(value ="是否已经审批0未审批1审批中2已审批") @ApiModelProperty(value = "是否已经审批0未审批1审批中2已审批")
@TableField(exist = false) @TableField(exist = false)
private String workStatus; private String workStatus;
@ApiModelProperty(value ="图片对象") @ApiModelProperty(value = "图片对象")
@TableField(exist = false) @TableField(exist = false)
private OcrPicture ocrPicture; private OcrPicture ocrPicture;
@ApiModelProperty(value ="提报时间") @ApiModelProperty(value = "提报时间")
@TableField(exist = false) @TableField(exist = false)
private String reporttime; private String reporttime;
@ApiModelProperty(value ="本人审查日志") @ApiModelProperty(value = "相似度数值")
@TableField(exist = false)
private Integer similarityscore;
@ApiModelProperty(value = "本人审查日志")
@TableField(exist = false) @TableField(exist = false)
private Userapprove userapprove; private Userapprove userapprove;
@ApiModelProperty(value ="审查日志") @ApiModelProperty(value = "审查日志")
@TableField(exist = false) @TableField(exist = false)
private List<Userapprove> userapproveList; private List<Userapprove> userapproveList;
@ -238,7 +241,7 @@ public class OcrTaskchildPicture implements BaseDto,java.io.Serializable {
@JsonIgnore @JsonIgnore
private SearchQuery searchQueryrolesShowleave; private SearchQuery searchQueryrolesShowleave;
public FlowModelVO getFlowModelVO(){ public FlowModelVO getFlowModelVO() {
FlowModelVO flowModelVO = new FlowModelVO(); FlowModelVO flowModelVO = new FlowModelVO();
flowModelVO.setFormid(this.getId()); flowModelVO.setFormid(this.getId());
flowModelVO.setAssignee(this.getAssignee()); flowModelVO.setAssignee(this.getAssignee());
@ -263,49 +266,50 @@ public class OcrTaskchildPicture implements BaseDto,java.io.Serializable {
@TableField(exist = false) @TableField(exist = false)
@JsonIgnore @JsonIgnore
private final Map<String,String> query = Stream.of( private final Map<String, String> query = Stream.of(
new SimpleEntry<>("ID","id"), new SimpleEntry<>("ID", "id"),
new SimpleEntry<>("OCPICTUREID","ocpictureid"), new SimpleEntry<>("OCPICTUREID", "ocpictureid"),
new SimpleEntry<>("PICTURERESULT","pictureresult"), new SimpleEntry<>("PICTURERESULT", "pictureresult"),
new SimpleEntry<>("PICTURECOMPARE","picturecompare"), new SimpleEntry<>("PICTURECOMPARE", "picturecompare"),
new SimpleEntry<>("DEPTID","deptid"), new SimpleEntry<>("DEPTID", "deptid"),
new SimpleEntry<>("TENANTID","tenantid"), new SimpleEntry<>("TENANTID", "tenantid"),
new SimpleEntry<>("PACKAGEID","packageid"), new SimpleEntry<>("PACKAGEID", "packageid"),
new SimpleEntry<>("PICTUREID","pictureid"), new SimpleEntry<>("PICTUREID", "pictureid"),
new SimpleEntry<>("CATEGORY","category"), new SimpleEntry<>("CATEGORY", "category"),
new SimpleEntry<>("CATEGORYID","categoryid"), new SimpleEntry<>("CATEGORYID", "categoryid"),
new SimpleEntry<>("SPECIFICATION","specification"), new SimpleEntry<>("SPECIFICATION", "specification"),
new SimpleEntry<>("BUESSINESSNO","buessinessno"), new SimpleEntry<>("BUESSINESSNO", "buessinessno"),
new SimpleEntry<>("STATES","states"), new SimpleEntry<>("STATES", "states"),
new SimpleEntry<>("PROCESSINSTANCEID","processinstanceid"), new SimpleEntry<>("PROCESSINSTANCEID", "processinstanceid"),
new SimpleEntry<>("PROCESSDEFINITIONID","processdefinitionid"), new SimpleEntry<>("PROCESSDEFINITIONID", "processdefinitionid"),
new SimpleEntry<>("DEPLOYMENTID","deploymentid"), new SimpleEntry<>("DEPLOYMENTID", "deploymentid"),
new SimpleEntry<>("ASSIGNEENAME","assigneename"), new SimpleEntry<>("ASSIGNEENAME", "assigneename"),
new SimpleEntry<>("ASSIGNEE","assignee"), new SimpleEntry<>("ASSIGNEE", "assignee"),
new SimpleEntry<>("UPDATEUSER","updateuser"), new SimpleEntry<>("UPDATEUSER", "updateuser"),
new SimpleEntry<>("UPDATETIME","updatetime"), new SimpleEntry<>("UPDATETIME", "updatetime"),
new SimpleEntry<>("FILEANNEX","fileannex"), new SimpleEntry<>("FILEANNEX", "fileannex"),
new SimpleEntry<>("GUIDANG","guidang"), new SimpleEntry<>("GUIDANG", "guidang"),
new SimpleEntry<>("CREATEUSER","createuser"), new SimpleEntry<>("CREATEUSER", "createuser"),
new SimpleEntry<>("CREATEUSERNAME","createusername"), new SimpleEntry<>("CREATEUSERNAME", "createusername"),
new SimpleEntry<>("CREATEDATE","createdate"), new SimpleEntry<>("CREATEDATE", "createdate"),
new SimpleEntry<>("USERID","userid"), new SimpleEntry<>("USERID", "userid"),
new SimpleEntry<>("USERNAME","username"), new SimpleEntry<>("USERNAME", "username"),
new SimpleEntry<>("FROMTASKID","fromtaskid"), new SimpleEntry<>("FROMTASKID", "fromtaskid"),
new SimpleEntry<>("FROMTASKNAME","fromtaskname"), new SimpleEntry<>("FROMTASKNAME", "fromtaskname"),
new SimpleEntry<>("FROMUSERID","fromuserid"), new SimpleEntry<>("FROMUSERID", "fromuserid"),
new SimpleEntry<>("FROMPROJECTID","fromprojectid"), new SimpleEntry<>("FROMPROJECTID", "fromprojectid"),
new SimpleEntry<>("FROMPLANID","fromplanid"), new SimpleEntry<>("FROMPLANID", "fromplanid"),
new SimpleEntry<>("FROMUPTIME","fromuptime"), new SimpleEntry<>("FROMUPTIME", "fromuptime"),
new SimpleEntry<>("FROMSOURCEID","fromsourceid"), new SimpleEntry<>("FROMSOURCEID", "fromsourceid"),
new SimpleEntry<>("HAVEPOINTS","havepoints"), new SimpleEntry<>("HAVEPOINTS", "havepoints"),
new SimpleEntry<>("TASKNAME","taskname") new SimpleEntry<>("TASKNAME", "taskname")
) )
.collect(Collectors.toMap(SimpleEntry::getKey, SimpleEntry::getValue)); .collect(Collectors.toMap(SimpleEntry::getKey, SimpleEntry::getValue));
@Override @Override
public String getQueryFiled(String filedname){ public String getQueryFiled(String filedname) {
String obj = null; String obj = null;
if(null != query && query.size() > 0){ if (null != query && query.size() > 0) {
obj = query.get(filedname); obj = query.get(filedname);
} }
return obj; return obj;

@ -82,6 +82,7 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
@Resource @Resource
private OcrPictureclassService ocrPictureclassService; private OcrPictureclassService ocrPictureclassService;
@Resource @Resource
private CategoryService categoryService; private CategoryService categoryService;
@ -323,25 +324,25 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
//分类不一致的也不需要进行比对 //分类不一致的也不需要进行比对
//TODO 接口请求判断重复情况 //TODO 接口请求判断重复情况
logService.addLog(103, "AI获取图片相似度接口", sysUser, "sendParams"); logService.addLog(103, "AI获取图片相似度接口", sysUser, "sendParams");
if(StringUtils.isBlank(ocrPicture.getImgHash())){ if (StringUtils.isBlank(ocrPicture.getImgHash())) {
Map<String,String> map = this.getOcrPictureClassifyAndHash(ocrPicture.getLocalpictrueurl()); Map<String, String> map = this.getOcrPictureClassifyAndHash(ocrPicture.getLocalpictrueurl());
if(map!=null){ if (map != null) {
ocrPicture.setImgHash(map.get("hash")); ocrPicture.setImgHash(map.get("hash"));
ocrPicture.setClassificationid(map.get("classId")); ocrPicture.setClassificationid(map.get("classId"));
} }
this.updateById(ocrPicture); this.updateById(ocrPicture);
} }
if(StringUtils.isBlank(ocrPictureNext.getImgHash())){ if (StringUtils.isBlank(ocrPictureNext.getImgHash())) {
Map<String,String> map = this.getOcrPictureClassifyAndHash(ocrPictureNext.getLocalpictrueurl()); Map<String, String> map = this.getOcrPictureClassifyAndHash(ocrPictureNext.getLocalpictrueurl());
if(map!=null){ if (map != null) {
ocrPictureNext.setImgHash(map.get("hash")); ocrPictureNext.setImgHash(map.get("hash"));
ocrPictureNext.setClassificationid(map.get("classId")); ocrPictureNext.setClassificationid(map.get("classId"));
} }
this.updateById(ocrPictureNext); this.updateById(ocrPictureNext);
} }
String img=StringUtils.isBlank(ocrPicture.getImgHash())?StringUtils.isBlank(ocrPicture.getLocalpictrueurl()) ? ocrPicture.getImgurl() : ocrPicture.getLocalpictrueurl():ocrPicture.getImgHash(); String img = StringUtils.isBlank(ocrPicture.getImgHash()) ? StringUtils.isBlank(ocrPicture.getLocalpictrueurl()) ? ocrPicture.getImgurl() : ocrPicture.getLocalpictrueurl() : ocrPicture.getImgHash();
String imgNext=StringUtils.isBlank(ocrPictureNext.getImgHash())?StringUtils.isBlank(ocrPictureNext.getLocalpictrueurl()) ? ocrPictureNext.getImgurl() : ocrPictureNext.getLocalpictrueurl():ocrPictureNext.getImgHash(); String imgNext = StringUtils.isBlank(ocrPictureNext.getImgHash()) ? StringUtils.isBlank(ocrPictureNext.getLocalpictrueurl()) ? ocrPictureNext.getImgurl() : ocrPictureNext.getLocalpictrueurl() : ocrPictureNext.getImgHash();
String resultValue = HashCompareUtil.cmpHash(img, imgNext); String resultValue = HashCompareUtil.cmpHash(img, imgNext);
ocrPictureNext.setResult(resultValue); ocrPictureNext.setResult(resultValue);
@ -403,15 +404,15 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
@Override @Override
public Map<String, String> getOcrPictureClassifyAndHash(String img) { public Map<String, String> getOcrPictureClassifyAndHash(String img) {
JSONObject jsonObjectSimi = ImageClassUtil.getClassify(img,"1",classifyPath); JSONObject jsonObjectSimi = ImageClassUtil.getClassify(img, "1", classifyPath);
//返回内容为零,表示成功,否则表示失败 //返回内容为零,表示成功,否则表示失败
if (null != jsonObjectSimi && jsonObjectSimi.getString("code").equals("0") && jsonObjectSimi.get("data")!=null&&jsonObjectSimi.getJSONArray("data").size()>0) { if (null != jsonObjectSimi && jsonObjectSimi.getString("code").equals("0") && jsonObjectSimi.get("data") != null && jsonObjectSimi.getJSONArray("data").size() > 0) {
JSONObject data = jsonObjectSimi.getJSONArray("data").getJSONObject(0); JSONObject data = jsonObjectSimi.getJSONArray("data").getJSONObject(0);
Map<String,String> map=new HashMap(); Map<String, String> map = new HashMap();
map.put("classId",data.getString("classId")); map.put("classId", data.getString("classId"));
map.put("hash",data.getString("hash")); map.put("hash", data.getString("hash"));
return map; return map;
}else{ } else {
return null; return null;
} }
} }
@ -427,7 +428,13 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
ocrTaskchildPicture.setPackageid(packageid); ocrTaskchildPicture.setPackageid(packageid);
StringBuffer pcid = new StringBuffer(); StringBuffer pcid = new StringBuffer();
StringBuffer result = new StringBuffer(); StringBuffer result = new StringBuffer();
int max = 0;
for (OcrPicture comp : ocrPicture.getListCom()) { 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) { if (null == pcid || pcid.toString().length() < 1) {
pcid.append(comp.getId()); pcid.append(comp.getId());
result.append(comp.getResult()); result.append(comp.getResult());
@ -439,6 +446,8 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
ocrTaskchildPicture.setOcpictureid(pcid.toString()); ocrTaskchildPicture.setOcpictureid(pcid.toString());
ocrTaskchildPicture.setPictureresult(result.toString()); ocrTaskchildPicture.setPictureresult(result.toString());
ocrTaskchildPicture.setPicturecompare(String.join(",", ocrPicture.getPicturecompareList())); ocrTaskchildPicture.setPicturecompare(String.join(",", ocrPicture.getPicturecompareList()));
ocrPicture.setSimilarityscore(max);
this.updateById(ocrPicture);
return ocrTaskchildPictureService.updateById(ocrTaskchildPicture) ? ocrTaskchildPicture : null; return ocrTaskchildPictureService.updateById(ocrTaskchildPicture) ? ocrTaskchildPicture : null;
} }

@ -167,7 +167,7 @@
</where> </where>
</sql> </sql>
<select id="listFinal" resultType="cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPicture" parameterType="java.util.Map"> <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 select
tc.* tc.*
from ocr_taskchild_picture tc,OA_USERFINAL_T uf from ocr_taskchild_picture tc,OA_USERFINAL_T uf

Loading…
Cancel
Save