Browse Source

add:向量同步增加时间和结果

zhongwei
luyie 2 months ago
parent
commit
87ef7fceb7
  1. 7
      hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/VectorParamServiceImpl.java

7
hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/VectorParamServiceImpl.java

@ -143,7 +143,9 @@ public class VectorParamServiceImpl extends ServiceImpl<VectorParamMapper, Vecto
} }
log.info("synchronization vector param id:{}", id); log.info("synchronization vector param id:{}", id);
VectorUrlResponse response = getUrlResponse(entity.getUrl(), bladeToken, hzinfoToken); VectorUrlResponse response = getUrlResponse(entity.getUrl(), bladeToken, hzinfoToken);
if (response != null) { if (response == null || response.getOriginalData() == null || response.getOriginalData().isEmpty()) {
return false;
}
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
JsonNode rootNode = null; JsonNode rootNode = null;
try { try {
@ -159,6 +161,7 @@ public class VectorParamServiceImpl extends ServiceImpl<VectorParamMapper, Vecto
} }
String tableName = entity.getTableName().replace(entity.getProjectPrefix() + "_", ""); String tableName = entity.getTableName().replace(entity.getProjectPrefix() + "_", "");
String syncResult = weaviateService.saveBatch(response.getOriginalData(), tableName, attrMap); String syncResult = weaviateService.saveBatch(response.getOriginalData(), tableName, attrMap);
log.info("synchronization vector param id:{}, result:{}", id, syncResult);
if (this.update(Wrappers.<VectorParamEntity>lambdaUpdate() if (this.update(Wrappers.<VectorParamEntity>lambdaUpdate()
.eq(VectorParamEntity::getId, id) .eq(VectorParamEntity::getId, id)
.set(VectorParamEntity::getSynchronizationRemark, syncResult) .set(VectorParamEntity::getSynchronizationRemark, syncResult)
@ -170,8 +173,6 @@ public class VectorParamServiceImpl extends ServiceImpl<VectorParamMapper, Vecto
return false; return false;
} }
} }
return true;
}
@Override @Override
public Boolean removeByIdsWithLog(List<Long> idList) { public Boolean removeByIdsWithLog(List<Long> idList) {

Loading…
Cancel
Save