Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
cddc9736
Commit
cddc9736
authored
Jun 07, 2023
by
曹盼盼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改设备列表
parent
d881e72a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
ESEquipmentCategoryDto.java
.../amos/boot/module/tzs/api/dto/ESEquipmentCategoryDto.java
+2
-2
EquipmentCategoryServiceImpl.java
...le/tzs/biz/service/impl/EquipmentCategoryServiceImpl.java
+7
-3
No files found.
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/dto/ESEquipmentCategoryDto.java
View file @
cddc9736
...
@@ -69,8 +69,8 @@ public class ESEquipmentCategoryDto {
...
@@ -69,8 +69,8 @@ public class ESEquipmentCategoryDto {
@Field
(
type
=
FieldType
.
Text
)
@Field
(
type
=
FieldType
.
Text
)
private
String
STATUS
;
private
String
STATUS
;
@Field
(
type
=
FieldType
.
Date
,
format
=
DateFormat
.
custom
,
pattern
=
"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_second"
)
@Field
(
type
=
FieldType
.
Long
)
private
Date
REC_DATE
;
private
Long
REC_DATE
;
}
}
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/EquipmentCategoryServiceImpl.java
View file @
cddc9736
...
@@ -40,6 +40,7 @@ import org.elasticsearch.client.RestHighLevelClient;
...
@@ -40,6 +40,7 @@ import org.elasticsearch.client.RestHighLevelClient;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.elasticsearch.search.builder.SearchSourceBuilder
;
import
org.elasticsearch.search.builder.SearchSourceBuilder
;
import
org.elasticsearch.search.sort.SortOrder
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.core.io.Resource
;
import
org.springframework.core.io.Resource
;
...
@@ -870,7 +871,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
...
@@ -870,7 +871,6 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
Long
count
=
bizJdbcTemplate
.
queryForObject
(
countSql
,
Long
.
class
);
Long
count
=
bizJdbcTemplate
.
queryForObject
(
countSql
,
Long
.
class
);
return
count
;
return
count
;
}
}
/**
/**
* es数据同步
* es数据同步
*
*
...
@@ -901,6 +901,9 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
...
@@ -901,6 +901,9 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
* es保存设备数据
* es保存设备数据
*/
*/
public
ESEquipmentCategoryDto
saveESEquipmentCategory
(
Map
<
String
,
Object
>
map
)
{
public
ESEquipmentCategoryDto
saveESEquipmentCategory
(
Map
<
String
,
Object
>
map
)
{
//处理时间问题
long
recDate
=
new
Date
(
map
.
get
(
"REC_DATE"
).
toString
()).
getTime
();
map
.
put
(
"REC_DATE"
,
recDate
);
ESEquipmentCategoryDto
dto
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
map
),
ESEquipmentCategoryDto
.
class
);
ESEquipmentCategoryDto
dto
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
map
),
ESEquipmentCategoryDto
.
class
);
ESEquipmentCategoryDto
save
=
esEquipmentCategory
.
save
(
dto
);
ESEquipmentCategoryDto
save
=
esEquipmentCategory
.
save
(
dto
);
if
(!
ObjectUtils
.
isEmpty
(
save
))
{
if
(!
ObjectUtils
.
isEmpty
(
save
))
{
...
@@ -958,7 +961,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
...
@@ -958,7 +961,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
}
}
if
(!
ObjectUtils
.
isEmpty
(
map
.
getString
(
"ORG_BRANCH_NAME"
)))
{
if
(!
ObjectUtils
.
isEmpty
(
map
.
getString
(
"ORG_BRANCH_NAME"
)))
{
BoolQueryBuilder
query
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
query
=
QueryBuilders
.
boolQuery
();
query
.
must
(
QueryBuilders
.
matchQuery
(
"ORG_BRANCH_NAME"
,
"*"
+
map
.
getString
(
"ORG_BRANCH_NAME"
)
+
"*"
));
query
.
must
(
QueryBuilders
.
matchQuery
(
"ORG_BRANCH_NAME"
,
map
.
getString
(
"ORG_BRANCH_NAME"
)
));
boolMust
.
must
(
query
);
boolMust
.
must
(
query
);
}
}
if
(!
ObjectUtils
.
isEmpty
(
map
.
getString
(
"ORG_BRANCH_CODE"
)))
{
if
(!
ObjectUtils
.
isEmpty
(
map
.
getString
(
"ORG_BRANCH_CODE"
)))
{
...
@@ -968,7 +971,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
...
@@ -968,7 +971,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
}
}
if
(!
ObjectUtils
.
isEmpty
(
map
.
getString
(
"USE_UNIT_NAME"
)))
{
if
(!
ObjectUtils
.
isEmpty
(
map
.
getString
(
"USE_UNIT_NAME"
)))
{
BoolQueryBuilder
query
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
query
=
QueryBuilders
.
boolQuery
();
query
.
must
(
QueryBuilders
.
matchQuery
(
"USE_UNIT_NAME"
,
"*"
+
map
.
getString
(
"USE_UNIT_NAME"
)
+
"*"
));
query
.
must
(
QueryBuilders
.
matchQuery
(
"USE_UNIT_NAME"
,
map
.
getString
(
"USE_UNIT_NAME"
)
));
boolMust
.
must
(
query
);
boolMust
.
must
(
query
);
}
}
if
(!
ObjectUtils
.
isEmpty
(
map
.
getString
(
"USE_UNIT_CREDIT_CODE"
)))
{
if
(!
ObjectUtils
.
isEmpty
(
map
.
getString
(
"USE_UNIT_CREDIT_CODE"
)))
{
...
@@ -1034,6 +1037,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
...
@@ -1034,6 +1037,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
boolMust
.
must
(
meBuilder
);
boolMust
.
must
(
meBuilder
);
}
}
builder
.
query
(
boolMust
);
builder
.
query
(
boolMust
);
builder
.
sort
(
"REC_DATE"
,
SortOrder
.
DESC
);
builder
.
from
((
map
.
getInteger
(
"number"
)
-
1
)
*
map
.
getInteger
(
"size"
));
builder
.
from
((
map
.
getInteger
(
"number"
)
-
1
)
*
map
.
getInteger
(
"size"
));
builder
.
size
(
map
.
getInteger
(
"size"
));
builder
.
size
(
map
.
getInteger
(
"size"
));
request
.
source
(
builder
);
request
.
source
(
builder
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment