Commit ef608cce by shentao

Merge branch 'release' into 'master'

2024/06/17 ai标注接口 log日志修复、返回值为空修复

See merge request !103
parents ce81efc5 e87ed3e5
......@@ -13,6 +13,7 @@ import com.zhiwei.middleware.automatic.son.dao.AiApiResultDao;
import com.zhiwei.middleware.automatic.son.dubbo.DubboHandler;
import com.zhiwei.middleware.automatic.son.util.MarkInfoUtil;
import com.zhiwei.middleware.automatic.son.util.OkHttpUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Qualifier;
......@@ -99,14 +100,14 @@ public class TaskServiceAiMark implements TaskService {
long endTime = System.currentTimeMillis() - now;
AiApiResult aiRes = aiApiResultConversion(s);
if (Objects.isNull(aiRes)) {
log.info("数据url:{},耗时:{},ai接口返回信息不完整:{}", param.getString(GenericAttribute.URL), endTime, s);
log.info("数据url:{},耗时:{},ai接口返回信息不完整:{}", param.getJSONObject("data").getString(GenericAttribute.URL), endTime, s);
return null;
}
log.info("数据url:{},ai标签:{},耗时:{},具体数据:{}", param.getString(GenericAttribute.URL), aiRes.getSent(), endTime, aiRes.getResult());
log.info("数据url:{},ai标签:{},耗时:{},具体数据:{}", param.getJSONObject("data").getString(GenericAttribute.URL), aiRes.getSent(), endTime, aiRes.getResult());
List<AIMark.TagRelation> tagRelations = aiParam.getAiMark().getTagRelations();
AIMark.TagRelation tagRelation = tagRelations.stream().filter(e -> relateValueVerify(e, aiRes)).findFirst().orElse(null);
if (Objects.isNull(tagRelation)) {
log.info("数据url:{},ai标签:{},没有绑定关系,以过滤", param.getString(GenericAttribute.URL), aiRes.getSent());
log.info("数据url:{},ai标签:{},没有绑定关系,以过滤", param.getJSONObject("data").getString(GenericAttribute.URL), aiRes.getSent());
return null;
}
JSONObject json = aiParam.getJson();
......@@ -116,7 +117,7 @@ public class TaskServiceAiMark implements TaskService {
json.put(GenericAttribute.ES_M_GROUP, aiParam.getAiMark().getProject());
json.put(GenericAttribute.ES_M_GROUP_ID, aiParam.getAiMark().getProjectId());
MarkInfo markInfo = MarkInfoUtil.transformToMarkInfo(json);
log.info("数据url:{},ai标签:{},标注标签:{},成功标注", param.getString(GenericAttribute.URL), aiRes.getSent(), tagRelation.getName());
log.info("数据url:{},ai标签:{},标注标签:{},成功标注", param.getJSONObject("data").getString(GenericAttribute.URL), aiRes.getSent(), tagRelation.getName());
return markInfo;
}
......@@ -132,6 +133,9 @@ public class TaskServiceAiMark implements TaskService {
default:relateValue = "";
break;
}
if (StringUtils.isEmpty(relateValue)) {
return false;
}
return relateValue.equals(tagRelation.getRelateValue());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment