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
40ca35e7
Commit
40ca35e7
authored
Dec 19, 2024
by
韩桐桐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(jg):刷入工程装置id到es的idx_biz_view_jg_all索引
parent
f6d1f7ff
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
0 deletions
+43
-0
DataHandlerController.java
.../boot/module/jg/biz/controller/DataHandlerController.java
+8
-0
DataHandlerServiceImpl.java
...ot/module/jg/biz/service/impl/DataHandlerServiceImpl.java
+35
-0
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/DataHandlerController.java
View file @
40ca35e7
...
@@ -41,4 +41,12 @@ public class DataHandlerController extends BaseController {
...
@@ -41,4 +41,12 @@ public class DataHandlerController extends BaseController {
return
ResponseHelper
.
buildResponse
(
dataHandlerService
.
writeData2ProjectContraption
());
return
ResponseHelper
.
buildResponse
(
dataHandlerService
.
writeData2ProjectContraption
());
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"刷入工程装置id到es的idx_biz_view_jg_all索引"
,
notes
=
"刷入工程装置id到es的idx_biz_view_jg_all索引"
)
@GetMapping
(
value
=
"/jgAllIndex/writeProjectContraptionId"
)
public
ResponseModel
<
String
>
writeProjectContraptionId
()
{
return
ResponseHelper
.
buildResponse
(
dataHandlerService
.
writeProjectContraptionId
());
}
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/DataHandlerServiceImpl.java
View file @
40ca35e7
...
@@ -6,7 +6,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...
@@ -6,7 +6,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil
;
import
com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil
;
import
com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory
;
import
com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.*
;
import
com.yeejoin.amos.boot.module.jg.api.entity.*
;
import
com.yeejoin.amos.boot.module.jg.api.enums.PipelineEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.*
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.*
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper
;
...
@@ -14,10 +17,12 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -14,10 +17,12 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StopWatch
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -69,6 +74,9 @@ public class DataHandlerServiceImpl {
...
@@ -69,6 +74,9 @@ public class DataHandlerServiceImpl {
@Resource
@Resource
private
IdxBizJgFactoryInfoServiceImpl
factoryInfoService
;
private
IdxBizJgFactoryInfoServiceImpl
factoryInfoService
;
@Resource
private
ESEquipmentCategory
esEquipmentCategory
;
/**
/**
* 安装告知压力管道历史数据修复-详情中的设备列表修改为汇总表格式
* 安装告知压力管道历史数据修复-详情中的设备列表修改为汇总表格式
...
@@ -296,4 +304,31 @@ public class DataHandlerServiceImpl {
...
@@ -296,4 +304,31 @@ public class DataHandlerServiceImpl {
}
}
return
Boolean
.
TRUE
;
return
Boolean
.
TRUE
;
}
}
/**
* 刷入工程装置id到es的idx_biz_view_jg_all索引
*
* @return result
*/
public
String
writeProjectContraptionId
()
{
AtomicReference
<
Long
>
size
=
new
AtomicReference
<>(
0L
);
StopWatch
stopWatch
=
new
StopWatch
(
"writeProjectContraptionId"
);
stopWatch
.
start
();
List
<
IdxBizJgUseInfo
>
useInfos
=
useInfoService
.
lambdaQuery
()
.
select
(
IdxBizJgUseInfo:
:
getRecord
,
IdxBizJgUseInfo:
:
getProjectContraptionId
)
.
isNotNull
(
IdxBizJgUseInfo:
:
getProjectContraptionId
)
.
list
();
for
(
IdxBizJgUseInfo
useInfo
:
useInfos
)
{
Optional
<
ESEquipmentCategoryDto
>
equInfosWithEs
=
esEquipmentCategory
.
findById
(
useInfo
.
getRecord
());
equInfosWithEs
.
ifPresent
(
equInfoEs
->
{
if
(
PipelineEnum
.
INDUSTRIAL_PIPELINE
.
getCode
().
equals
(
equInfoEs
.
getEQU_CATEGORY_CODE
()))
{
equInfoEs
.
setProjectContraptionId
(
useInfo
.
getProjectContraptionId
());
esEquipmentCategory
.
save
(
equInfoEs
);
size
.
getAndSet
(
size
.
get
()
+
1
);
}
});
}
stopWatch
.
stop
();
return
String
.
format
(
"接口调用成功,更新数据:%s条,耗时:%s s"
,
size
.
get
(),
stopWatch
.
getTotalTimeSeconds
());
}
}
}
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