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