mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
生产单板材造型新增大板等字段,ES板材造型数据压缩保存,标签Bug修改
This commit is contained in:
+5
-7
@@ -168,18 +168,16 @@ public class ESDocumentServiceImpl implements ESDocumentService {
|
||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||
Date date = new Date();
|
||||
documents.forEach(esDocument -> {
|
||||
// 假设esDocument有一个ID集。如果没有,则应该抛出异常或进行相应的处理。
|
||||
if (CharSequenceUtil.isBlank(esDocument.getId())) {
|
||||
throw new IllegalArgumentException("更新操作的文档ID不能为空");
|
||||
}
|
||||
|
||||
esDocument.setCreator(loginUser.getNickname());
|
||||
esDocument.setUpdater(loginUser.getNickname());
|
||||
esDocument.setOrganId(loginUser.getOrganId());
|
||||
esDocument.setUpdateTime(simpleDateFormat.format(date));
|
||||
|
||||
br.operations(op -> op.update(u -> u
|
||||
br.operations(op -> op.index(idx -> idx
|
||||
.index(idxName)
|
||||
.id(esDocument.getId())
|
||||
.action(a -> a
|
||||
.doc(esDocument))));
|
||||
.document(esDocument)));
|
||||
});
|
||||
return elasticsearchClient.bulk(br.build());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user