Browse Source

fix:知识库入库状态

zhongwei
luyie 2 months ago
parent
commit
2cedb196ef
  1. 11
      hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/KnowledgeFileInfoServiceImpl.java

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

@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.gglm.bigmodel.configuration.BigModelInvokeApi;
import com.hnac.gglm.bigmodel.maintenance.constants.StoreStatus;
import com.hnac.gglm.bigmodel.maintenance.entity.KnowledgeFileFragment;
import com.hnac.gglm.bigmodel.maintenance.entity.KnowledgeFileInfo;
@ -17,7 +16,6 @@ import com.hnac.gglm.bigmodel.maintenance.service.KnowledgeFileFragmentService;
import com.hnac.gglm.bigmodel.maintenance.service.KnowledgeFileInfoService;
import com.hnac.gglm.bigmodel.maintenance.vo.IdRequest;
import com.hnac.gglm.bigmodel.maintenance.vo.IdsRequest;
import com.hnac.gglm.bigmodel.utils.RequestClientUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.oss.model.BladeFile;
@ -68,16 +66,17 @@ public class KnowledgeFileInfoServiceImpl extends ServiceImpl<KnowledgeFileInfoM
}
private Boolean store(KnowledgeFileInfo knowledgeFileInfo, String tenantId, Long createUser, String createDept) {
LambdaUpdateWrapper<KnowledgeFileInfo> wrapper = Wrappers.<KnowledgeFileInfo>lambdaUpdate()
.set(KnowledgeFileInfo::getFileStatus, StoreStatus.STORING.getCode())
.eq(KnowledgeFileInfo::getId, knowledgeFileInfo.getId());
this.update(wrapper);
HttpResponse response = HttpRequest.post(interactionUrl + SEGMENT_URL)
.body(getParamsJson(knowledgeFileInfo, tenantId, createUser, createDept), "application/json")
.execute();
if (!response.isOk()) {
return false;
}
LambdaUpdateWrapper<KnowledgeFileInfo> wrapper = Wrappers.<KnowledgeFileInfo>lambdaUpdate()
.set(KnowledgeFileInfo::getFileStatus, StoreStatus.STORING.getCode())
.eq(KnowledgeFileInfo::getId, knowledgeFileInfo.getId());
return this.update(wrapper);
return Boolean.TRUE;
}
@Override

Loading…
Cancel
Save