mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
修改es索引创建人、修改人字段类型
This commit is contained in:
+2
-2
@@ -19,11 +19,11 @@ public class ESDocument {
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
|
||||
private String createTime;
|
||||
private Long creator;
|
||||
private String creator;
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
|
||||
private String updateTime;
|
||||
private Long updater;
|
||||
private String updater;
|
||||
private Long organId;
|
||||
|
||||
}
|
||||
|
||||
+7
-7
@@ -48,8 +48,8 @@ public class ESDocumentServiceImpl implements ESDocumentService {
|
||||
public <T> IndexResponse createByFluentDSL(String idxName, String idxId, ESDocument document) throws Exception {
|
||||
Date date = new Date();
|
||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||
document.setCreator(loginUser.getId());
|
||||
document.setUpdater(loginUser.getId());
|
||||
document.setCreator(loginUser.getNickname());
|
||||
document.setUpdater(loginUser.getNickname());
|
||||
document.setOrganId(loginUser.getOrganId());
|
||||
document.setCreateTime(simpleDateFormat.format(date));
|
||||
document.setUpdateTime(simpleDateFormat.format(date));
|
||||
@@ -73,8 +73,8 @@ public class ESDocumentServiceImpl implements ESDocumentService {
|
||||
public <T> IndexResponse createByBuilderPattern(String idxName, String idxId, ESDocument document) throws Exception {
|
||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||
Date date = new Date();
|
||||
document.setCreator(loginUser.getId());
|
||||
document.setUpdater(loginUser.getId());
|
||||
document.setCreator(loginUser.getNickname());
|
||||
document.setUpdater(loginUser.getNickname());
|
||||
document.setOrganId(loginUser.getOrganId());
|
||||
document.setCreateTime(simpleDateFormat.format(date));
|
||||
document.setUpdateTime(simpleDateFormat.format(date));
|
||||
@@ -142,14 +142,14 @@ public class ESDocumentServiceImpl implements ESDocumentService {
|
||||
if (StrUtil.isBlank(esDocument.getId())) {
|
||||
esDocument.setId(snowflake.nextIdStr());
|
||||
}
|
||||
esDocument.setCreator(loginUser.getId());
|
||||
esDocument.setCreator(loginUser.getNickname());
|
||||
esDocument.setCreateTime(simpleDateFormat.format(date));
|
||||
esDocument.setUpdater(loginUser.getId());
|
||||
esDocument.setUpdater(loginUser.getNickname());
|
||||
|
||||
esDocument.setUpdateTime(simpleDateFormat.format(date));
|
||||
br.operations(op -> op.index(idx -> idx
|
||||
.index(idxName)
|
||||
.id(esDocument.getId().toString())
|
||||
.id(esDocument.getId())
|
||||
.document(esDocument)));
|
||||
});
|
||||
return elasticsearchClient.bulk(br.build());
|
||||
|
||||
+1
@@ -31,6 +31,7 @@ public interface PlanMapper extends BaseMapperX<PlanDO> {
|
||||
.betweenIfPresent(PlanDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(PlanDO::getOperator, reqVO.getOperator())
|
||||
.betweenIfPresent(PlanDO::getProduceTime, reqVO.getProduceTime())
|
||||
.orderByAsc(PlanDO::getSort)
|
||||
.orderByDesc(PlanDO::getId));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
PUT imes_order_plate_model
|
||||
{
|
||||
"settings": {},
|
||||
"mappings": {
|
||||
@@ -132,7 +133,7 @@
|
||||
"format": "strict_date_optional_time||yyyy-MM-dd HH:mm:ss||epoch_millis"
|
||||
},
|
||||
"creator": {
|
||||
"type": "long"
|
||||
"type": "keyword"
|
||||
},
|
||||
"holeDetail": {
|
||||
"properties": {
|
||||
@@ -385,7 +386,7 @@
|
||||
"format": "strict_date_optional_time||yyyy-MM-dd HH:mm:ss||epoch_millis"
|
||||
},
|
||||
"updater": {
|
||||
"type": "long"
|
||||
"type": "keyword"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user