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
8eac96bd
Commit
8eac96bd
authored
Jul 14, 2025
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refact(综合搜索):数据同步调整
1.设备同步改成批量查询 2.检验巡检依赖
parent
81426848
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
244 additions
and
88 deletions
+244
-88
ESEquipmentInfo.java
...n/amos/boot/module/common/api/entity/ESEquipmentInfo.java
+1
-1
EsBaseEnterpriseInfo.java
...s/boot/module/common/api/entity/EsBaseEnterpriseInfo.java
+1
-1
EsEntity.java
.../yeejoin/amos/boot/module/common/api/entity/EsEntity.java
+27
-0
EsUserInfo.java
...eejoin/amos/boot/module/common/api/entity/EsUserInfo.java
+1
-1
DataHandlerController.java
.../boot/module/jg/biz/controller/DataHandlerController.java
+1
-1
IIdxBizJgInspectionDetectionInfoService.java
.../biz/service/IIdxBizJgInspectionDetectionInfoService.java
+2
-1
DataHandlerServiceImpl.java
...ot/module/jg/biz/service/impl/DataHandlerServiceImpl.java
+52
-20
EsBulkService.java
...n/amos/boot/module/jg/biz/service/impl/EsBulkService.java
+40
-0
JyjcInspectionApplicationServiceImpl.java
...iz/service/impl/JyjcInspectionApplicationServiceImpl.java
+1
-0
JyjcInspectionResultServiceImpl.java
...yjc/biz/service/impl/JyjcInspectionResultServiceImpl.java
+2
-0
IdxBizJgInspectionDetectionInfoMapper.java
...ymt/api/mapper/IdxBizJgInspectionDetectionInfoMapper.java
+4
-1
IdxBizJgMaintenanceRecordInfoMapper.java
...e/ymt/api/mapper/IdxBizJgMaintenanceRecordInfoMapper.java
+4
-0
IdxBizJgUseInfoMapper.java
...mos/boot/module/ymt/api/mapper/IdxBizJgUseInfoMapper.java
+2
-0
IdxBizJgInspectionDetectionInfoMapper.xml
...esources/mapper/IdxBizJgInspectionDetectionInfoMapper.xml
+13
-0
IdxBizJgMaintenanceRecordInfoMapper.xml
.../resources/mapper/IdxBizJgMaintenanceRecordInfoMapper.xml
+17
-0
IdxBizJgUseInfoMapper.xml
...t-api/src/main/resources/mapper/IdxBizJgUseInfoMapper.xml
+76
-62
No files found.
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/entity/ESEquipmentInfo.java
View file @
8eac96bd
...
...
@@ -25,7 +25,7 @@ import java.util.List;
@Data
@Accessors
(
chain
=
true
)
@Slf4j
@Document
(
indexName
=
"idx_biz_equipment_info"
,
shards
=
3
,
replicas
=
2
)
@Document
(
indexName
=
"idx_biz_equipment_info"
,
shards
=
3
,
replicas
=
2
,
createIndex
=
false
)
public
class
ESEquipmentInfo
{
@Id
...
...
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/entity/EsBaseEnterpriseInfo.java
View file @
8eac96bd
...
...
@@ -15,7 +15,7 @@ import java.util.List;
* 企业
*/
@Data
@Document
(
indexName
=
"idx_biz_enterprise_info"
,
shards
=
3
,
replicas
=
2
)
@Document
(
indexName
=
"idx_biz_enterprise_info"
,
shards
=
3
,
replicas
=
2
,
createIndex
=
false
)
public
class
EsBaseEnterpriseInfo
{
@Id
private
String
sequenceNbr
;
...
...
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/entity/EsEntity.java
0 → 100644
View file @
8eac96bd
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
entity
;
import
lombok.Getter
;
import
lombok.Setter
;
/**
*
* @author LiuLin
* @date 2023年10月11日 09:31
*/
@Setter
@Getter
public
final
class
EsEntity
<
T
>
{
private
String
id
;
private
T
data
;
public
EsEntity
()
{
}
public
EsEntity
(
String
id
,
T
data
)
{
this
.
data
=
data
;
this
.
id
=
id
;
}
}
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/entity/EsUserInfo.java
View file @
8eac96bd
...
...
@@ -15,7 +15,7 @@ import java.util.List;
* 人员
*/
@Data
@Document
(
indexName
=
"idx_biz_user_info"
,
shards
=
3
,
replicas
=
2
)
@Document
(
indexName
=
"idx_biz_user_info"
,
shards
=
3
,
replicas
=
2
,
createIndex
=
false
)
public
class
EsUserInfo
{
@Id
private
String
sequenceNbr
;
...
...
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 @
8eac96bd
...
...
@@ -250,7 +250,7 @@ public class DataHandlerController extends BaseController {
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"初始化综合搜索数据-设备"
,
notes
=
"初始化综合搜索数据-设备"
)
@PutMapping
(
value
=
"/equip/initStatistData2Es"
)
public
ResponseModel
<
Integer
>
initEquipStatistData2Es
()
{
return
ResponseHelper
.
buildResponse
(
dataHandlerService
.
initEquipStatistData2Es
());
return
ResponseHelper
.
buildResponse
(
dataHandlerService
.
initEquipStatistData2Es
Batch
());
}
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/IIdxBizJgInspectionDetectionInfoService.java
View file @
8eac96bd
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgInspectionDetectionInfo
;
import
java.util.List
;
...
...
@@ -9,7 +10,7 @@ import java.util.List;
* @author system_generator
* @date 2023-08-17
*/
public
interface
IIdxBizJgInspectionDetectionInfoService
{
public
interface
IIdxBizJgInspectionDetectionInfoService
extends
IService
<
IdxBizJgInspectionDetectionInfo
>
{
boolean
saveOrUpdateData
(
IdxBizJgInspectionDetectionInfo
inspectionDetectionInfo
);
...
...
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 @
8eac96bd
...
...
@@ -42,7 +42,6 @@ import com.yeejoin.amos.boot.module.jg.api.mapper.*;
import
com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.boot.module.jg.biz.handler.strategy.ProblemHandleStrategy
;
import
com.yeejoin.amos.boot.module.jg.biz.refresh.StatisticsDataUpdateService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgInspectionDetectionInfoService
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.EquipWaitRefreshDataQualityScore
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.ProjectWaitRefreshDataQualityScore
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.RefreshDataDto
;
...
...
@@ -71,6 +70,7 @@ import java.util.concurrent.ConcurrentHashMap;
import
java.util.concurrent.atomic.AtomicInteger
;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.function.Function
;
import
java.util.stream.Collector
;
import
java.util.stream.Collectors
;
import
static
com
.
alibaba
.
fastjson
.
JSON
.
toJSONString
;
...
...
@@ -106,7 +106,7 @@ public class DataHandlerServiceImpl {
private
final
JgInstallationNoticeEqMapper
jgInstallationNoticeEqMapper
;
private
final
DataDictionaryMapper
dataDictionaryMapper
;
private
final
IdxBizJgProjectInspectionMapper
projectInspectionMapper
;
private
final
I
IdxBizJgInspectionDetectionInfoService
iI
dxBizJgInspectionDetectionInfoService
;
private
final
I
dxBizJgInspectionDetectionInfoServiceImpl
i
dxBizJgInspectionDetectionInfoService
;
private
final
IdxBizJgProjectContraptionMapper
idxBizJgProjectContraptionMapper
;
private
final
JgInstallationNoticeMapper
jgInstallationNoticeMapper
;
private
final
DataHandlerMapper
dataHandlerMapper
;
...
...
@@ -145,6 +145,8 @@ public class DataHandlerServiceImpl {
private
final
BaseEnterpriseUpdate
baseEnterpriseUpdate
;
private
final
EsBulkService
esBulkService
;
/**
* 安装告知压力管道历史数据修复-详情中的设备列表修改为汇总表格式
...
...
@@ -826,7 +828,7 @@ public class DataHandlerServiceImpl {
);
if
(!
equipmentLists
.
isEmpty
())
{
Object
record
=
equipmentLists
.
get
(
0
).
get
(
"record"
);
IdxBizJgInspectionDetectionInfo
idxBizJgInspectionDetectionInfo
=
i
I
dxBizJgInspectionDetectionInfoService
.
queryNewestDetailByRecord
(
String
.
valueOf
(
record
));
IdxBizJgInspectionDetectionInfo
idxBizJgInspectionDetectionInfo
=
idxBizJgInspectionDetectionInfoService
.
queryNewestDetailByRecord
(
String
.
valueOf
(
record
));
BeanUtil
.
copyProperties
(
idxBizJgInspectionDetectionInfo
,
inspectionDetectionInfo
);
inspectionDetectionInfo
.
setRecord
(
null
);
}
...
...
@@ -1508,7 +1510,7 @@ public class DataHandlerServiceImpl {
}).
collect
(
Collectors
.
toList
());
}
public
Integer
initEquipStatistData2Es
()
{
public
Integer
initEquipStatistData2Es
Batch
()
{
log
.
info
(
"综合统计设备信息入库开始"
);
StopWatch
watch
=
new
StopWatch
();
watch
.
start
();
...
...
@@ -1516,24 +1518,41 @@ public class DataHandlerServiceImpl {
Integer
nextVersion
=
maxVersion
+
1
;
List
<
String
>
refreshRecords
=
useInfoService
.
getBaseMapper
().
selectUseInfoOfOneVersionAll
(
nextVersion
);
while
(!
refreshRecords
.
isEmpty
())
{
StopWatch
watch0
=
new
StopWatch
();
watch0
.
start
();
List
<
Map
<
String
,
Object
>>
details
=
useInfoService
.
getBaseMapper
().
queryDetailBatch
(
refreshRecords
);
Map
<
String
,
Map
<
String
,
Object
>>
recordDetailMap
=
details
.
stream
().
collect
(
Collectors
.
toMap
(
e
->
(
String
)
e
.
get
(
"SEQUENCE_NBR"
),
Function
.
identity
(),
(
k1
,
k2
)
->
k2
));
// 设备最新的维保信息-维度:设备
List
<
IdxBizJgMaintenanceRecordInfo
>
lastMaintenanceRecordInfos
=
maintenanceRecordInfoService
.
getBaseMapper
().
selectLastedMainInfoBatch
(
refreshRecords
);
Map
<
String
,
List
<
IdxBizJgMaintenanceRecordInfo
>>
recordLastMaintMap
=
lastMaintenanceRecordInfos
.
stream
().
collect
(
Collectors
.
groupingBy
(
IdxBizJgMaintenanceRecordInfo:
:
getRecord
));
// 设备、各检验类型下最新的检验信息-维度:设备、检验类型
List
<
IdxBizJgInspectionDetectionInfo
>
lastedInspectInfosGroupByInspectType
=
idxBizJgInspectionDetectionInfoService
.
getBaseMapper
().
selectLastedGroupByInspectTypeBatch
(
refreshRecords
);
Map
<
String
,
List
<
IdxBizJgInspectionDetectionInfo
>>
recordInspectInfosGroupByInspectTypeMap
=
lastedInspectInfosGroupByInspectType
.
stream
().
collect
(
Collectors
.
groupingBy
(
IdxBizJgInspectionDetectionInfo:
:
getRecord
));
// 设备最新的检验信息-维度:设备
Map
<
String
,
Optional
<
IdxBizJgInspectionDetectionInfo
>>
recordLastInspectionMap
=
lastedInspectInfosGroupByInspectType
.
stream
().
filter
(
e
->
e
.
getInspectDate
()
!=
null
).
collect
(
Collectors
.
groupingBy
(
IdxBizJgInspectionDetectionInfo:
:
getRecord
,
Collectors
.
maxBy
(
Comparator
.
comparing
(
IdxBizJgInspectionDetectionInfo:
:
getInspectDate
))));
List
<
ESEquipmentInfo
>
esEquipmentInfos
=
refreshRecords
.
parallelStream
().
map
(
record
->
{
ESEquipmentInfo
esEquipmentInfo
=
null
;
try
{
esEquipmentInfo
=
new
ESEquipmentInfo
();
Map
<
String
,
Object
>
detail
=
useInfoService
.
getBaseMapper
().
queryDetail
(
record
);
Map
<
String
,
Object
>
detail
=
recordDetailMap
.
get
(
record
);
StatisticsDataUpdateService
.
formatUseDate
(
detail
);
BeanUtil
.
copyProperties
(
detail
,
esEquipmentInfo
,
true
);
Optional
<
ESEquipmentCategoryDto
>
esOptional
=
esEquipmentCategory
.
findById
(
record
);
if
(
esOptional
.
isPresent
())
{
if
(
esOptional
.
isPresent
())
{
ESEquipmentCategoryDto
dto
=
esOptional
.
get
();
esEquipmentInfo
.
setUSC_UNIT_CREDIT_CODE
(
dto
.
getUSC_UNIT_CREDIT_CODE
());
esEquipmentInfo
.
setUSC_UNIT_NAME
(
dto
.
getUSC_UNIT_NAME
());
esEquipmentInfo
.
setIS_DO_BUSINESS
(
dto
.
getIS_DO_BUSINESS
());
}
// 检验信息按照不同检验类型,存最新的一条
List
<
IdxBizJgInspectionDetectionInfo
>
inspectionDetectionInfos
=
iIdxBizJgInspectionDetectionInfoService
.
queryLastedGroupByInspectType
(
record
);
IdxBizJgInspectionDetectionInfo
inspectionDetectionInfo
=
iIdxBizJgInspectionDetectionInfoService
.
queryNewestDetailByRecord
(
record
);
IdxBizJgMaintenanceRecordInfo
lastMaintenanceRecordInfo
=
maintenanceRecordInfoService
.
queryNewestDetailByRecord
(
record
);
// 最新检验信息-维度record
IdxBizJgInspectionDetectionInfo
inspectionDetectionInfo
=
Optional
.
ofNullable
(
recordLastInspectionMap
.
get
(
record
)).
flatMap
(
i
->
i
).
orElse
(
new
IdxBizJgInspectionDetectionInfo
());
// 最新维保信息-维度record
IdxBizJgMaintenanceRecordInfo
lastMaintenanceRecordInfo
=
Optional
.
ofNullable
(
recordLastMaintMap
.
get
(
record
)).
filter
(
l
->
!
l
.
isEmpty
()).
map
(
list
->
list
.
get
(
0
)).
orElse
(
new
IdxBizJgMaintenanceRecordInfo
());
// 最新检验信息-维度record、检验类型,存最新的一条
List
<
IdxBizJgInspectionDetectionInfo
>
inspectionDetectionInfos
=
recordInspectInfosGroupByInspectTypeMap
.
getOrDefault
(
record
,
new
ArrayList
<>());
StatisticsDataUpdateService
.
formatInspectDate
(
esEquipmentInfo
,
inspectionDetectionInfo
,
record
);
esEquipmentInfo
.
setIssueDate
(
getIssueDate
(
esEquipmentInfo
.
getUSE_ORG_CODE
()));
esEquipmentInfo
.
setMAINTAIN_UNIT
(
lastMaintenanceRecordInfo
.
getMeUnitCreditCode
());
...
...
@@ -1547,12 +1566,26 @@ public class DataHandlerServiceImpl {
}
return
esEquipmentInfo
;
}).
collect
(
Collectors
.
toList
());
esEquipmentInfos
=
esEquipmentInfos
.
stream
().
filter
(
e
->
StringUtils
.
isNotEmpty
(
e
.
getSEQUENCE_NBR
())).
collect
(
Collectors
.
toList
());
if
(!
esEquipmentInfos
.
isEmpty
()){
watch0
.
stop
();
log
.
warn
(
"多线程处理查询设备详情耗时:{}"
,
watch0
.
getTotalTimeSeconds
());
esEquipmentInfos
=
esEquipmentInfos
.
stream
().
filter
(
e
->
StringUtils
.
isNotEmpty
(
e
.
getSEQUENCE_NBR
())).
collect
(
Collectors
.
toList
());
if
(!
esEquipmentInfos
.
isEmpty
())
{
StopWatch
watch1
=
new
StopWatch
();
watch1
.
start
();
esEquipmentDao
.
saveAll
(
esEquipmentInfos
);
watch1
.
stop
();
log
.
warn
(
"es批量入库条数:{},耗时:{}s"
,
esEquipmentInfos
.
size
(),
watch1
.
getTotalTimeSeconds
());
}
StopWatch
watch2
=
new
StopWatch
();
watch2
.
start
();
useInfoService
.
getBaseMapper
().
updateVersionBatch
(
refreshRecords
,
nextVersion
);
watch2
.
stop
();
log
.
warn
(
"批量更新条数:{} 使用信息版本号,耗时:{}s"
,
esEquipmentInfos
.
size
(),
watch2
.
getTotalTimeSeconds
());
StopWatch
watch3
=
new
StopWatch
();
watch3
.
start
();
refreshRecords
=
useInfoService
.
getBaseMapper
().
selectUseInfoOfOneVersionAll
(
nextVersion
);
watch3
.
stop
();
log
.
warn
(
"查询最多版本号耗时:{}s"
,
watch3
.
getTotalTimeSeconds
());
}
watch
.
stop
();
log
.
info
(
"综合统计设备信息入库结束,耗时:{}秒"
,
watch
.
getTotalTimeSeconds
());
...
...
@@ -1560,7 +1593,6 @@ public class DataHandlerServiceImpl {
}
private
List
<
ESEquipmentInfo
.
TechParam
>
buildTechParamByEquList
(
String
record
,
String
equListCode
)
{
return
StringUtils
.
isNotEmpty
(
equListCode
)
?
statisticsDataUpdateService
.
getTechParams
(
equListCode
,
record
)
:
new
ArrayList
<>();
}
...
...
@@ -1569,7 +1601,7 @@ public class DataHandlerServiceImpl {
List
<
IdxBizJgRegisterInfo
>
registerInfoList
=
registerInfoMapper
.
selectList
(
new
QueryWrapper
<
IdxBizJgRegisterInfo
>().
lambda
().
isNotNull
(
IdxBizJgRegisterInfo:
:
getCarNumber
));
Map
<
String
,
Map
<
String
,
Object
>>
resultMap
=
new
HashMap
<>();
if
(!
CollectionUtils
.
isEmpty
(
registerInfoList
))
{
registerInfoList
.
parallelStream
().
forEach
(
v
->
{
registerInfoList
.
parallelStream
().
forEach
(
v
->
{
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
param
.
put
(
"CAR_NUMBER"
,
v
.
getCarNumber
());
resultMap
.
put
(
v
.
getRecord
(),
param
);
...
...
@@ -1579,17 +1611,17 @@ public class DataHandlerServiceImpl {
return
registerInfoList
.
size
();
}
private
LocalDate
getIssueDate
(
String
useRegistrationCode
){
if
(
StringUtils
.
isEmpty
(
useRegistrationCode
))
{
return
null
;
private
LocalDate
getIssueDate
(
String
useRegistrationCode
)
{
if
(
StringUtils
.
isEmpty
(
useRegistrationCode
))
{
return
null
;
}
LambdaQueryWrapper
<
JgUseRegistrationManage
>
useRegistrationManageWrapper
=
new
LambdaQueryWrapper
<>();
useRegistrationManageWrapper
.
eq
(
JgUseRegistrationManage:
:
getUseRegistrationCode
,
useRegistrationCode
)
.
isNotNull
(
JgUseRegistrationManage:
:
getUseRegistrationCode
)
.
eq
(
JgUseRegistrationManage:
:
getCertificateStatus
,
"已登记"
)
.
eq
(
BaseEntity:
:
getIsDelete
,
false
).
select
(
BaseEntity:
:
getSequenceNbr
,
JgUseRegistrationManage:
:
getRegDate
);
JgUseRegistrationManage
manage
=
jgUseRegistrationManageServiceImpl
.
getBaseMapper
().
selectOne
(
useRegistrationManageWrapper
);
return
Optional
.
ofNullable
(
manage
).
map
(
JgUseRegistrationManage:
:
getRegDate
).
map
(
d
->
d
.
toInstant
().
atZone
(
ZoneId
.
systemDefault
()).
toLocalDate
()).
orElse
(
null
);
.
eq
(
BaseEntity:
:
getIsDelete
,
false
).
select
(
BaseEntity:
:
getSequenceNbr
,
JgUseRegistrationManage:
:
getRegDate
);
JgUseRegistrationManage
manage
=
jgUseRegistrationManageServiceImpl
.
getBaseMapper
().
selectOne
(
useRegistrationManageWrapper
);
return
Optional
.
ofNullable
(
manage
).
map
(
JgUseRegistrationManage:
:
getRegDate
).
map
(
d
->
d
.
toInstant
().
atZone
(
ZoneId
.
systemDefault
()).
toLocalDate
()).
orElse
(
null
);
}
}
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/EsBulkService.java
0 → 100644
View file @
8eac96bd
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.yeejoin.amos.boot.module.common.api.entity.EsEntity
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.elasticsearch.action.bulk.BulkRequest
;
import
org.elasticsearch.action.support.WriteRequest
;
import
org.elasticsearch.action.update.UpdateRequest
;
import
org.elasticsearch.client.RequestOptions
;
import
org.elasticsearch.client.RestHighLevelClient
;
import
org.elasticsearch.common.xcontent.XContentType
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
@Component
@RequiredArgsConstructor
@Slf4j
public
class
EsBulkService
{
private
final
RestHighLevelClient
restHighLevelClient
;
public
<
T
>
void
bulkUpsert
(
String
index
,
List
<
EsEntity
<
T
>>
list
)
{
BulkRequest
request
=
new
BulkRequest
();
list
.
forEach
(
item
->
{
request
.
add
(
new
UpdateRequest
(
index
,
item
.
getId
())
.
doc
(
JSON
.
toJSONString
(
item
.
getData
()),
XContentType
.
JSON
)
.
upsert
(
JSON
.
toJSONString
(
item
.
getData
()),
XContentType
.
JSON
));
});
try
{
// request.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE);
restHighLevelClient
.
bulk
(
request
,
RequestOptions
.
DEFAULT
);
}
catch
(
Exception
e
)
{
log
.
error
(
"批量写入数据失败:{}"
,
e
.
getMessage
(),
e
);
throw
new
RuntimeException
(
e
);
}
}
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/service/impl/JyjcInspectionApplicationServiceImpl.java
View file @
8eac96bd
...
...
@@ -148,6 +148,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
@Autowired
RestHighLevelClient
restHighLevelClient
;
@Autowired
@Lazy
private
JyjcInspectionResultServiceImpl
inspectionResultService
;
@Autowired
private
JyjcInspectionApplicationEquipServiceImpl
applicationEquipService
;
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/service/impl/JyjcInspectionResultServiceImpl.java
View file @
8eac96bd
...
...
@@ -53,6 +53,7 @@ import org.apache.commons.lang3.StringUtils;
import
org.eclipse.paho.client.mqttv3.MqttException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.core.io.Resource
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
...
...
@@ -135,6 +136,7 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
private
ESEquipmentCategory
esEquipmentCategory
;
@Autowired
@Lazy
JyjcInspectionApplicationServiceImpl
inspectionApplicationService
;
@Autowired
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/mapper/IdxBizJgInspectionDetectionInfoMapper.java
View file @
8eac96bd
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ymt
.
api
.
mapper
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgInspectionDetectionInfo
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgInspectionDetectionInfo
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
...
...
@@ -15,4 +15,7 @@ import java.util.List;
public
interface
IdxBizJgInspectionDetectionInfoMapper
extends
BaseMapper
<
IdxBizJgInspectionDetectionInfo
>
{
List
<
IdxBizJgInspectionDetectionInfo
>
selectLastedGroupByInspectType
(
@Param
(
"record"
)
String
record
);
List
<
IdxBizJgInspectionDetectionInfo
>
selectLastedGroupByInspectTypeBatch
(
@Param
(
"records"
)
List
<
String
>
records
);
}
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/mapper/IdxBizJgMaintenanceRecordInfoMapper.java
View file @
8eac96bd
...
...
@@ -2,6 +2,9 @@ package com.yeejoin.amos.boot.module.ymt.api.mapper;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgMaintenanceRecordInfo
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 安全追溯-维保备案信息表 Mapper 接口
...
...
@@ -11,4 +14,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public
interface
IdxBizJgMaintenanceRecordInfoMapper
extends
BaseMapper
<
IdxBizJgMaintenanceRecordInfo
>
{
List
<
IdxBizJgMaintenanceRecordInfo
>
selectLastedMainInfoBatch
(
@Param
(
"records"
)
List
<
String
>
records
);
}
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/mapper/IdxBizJgUseInfoMapper.java
View file @
8eac96bd
...
...
@@ -31,4 +31,6 @@ public interface IdxBizJgUseInfoMapper extends BaseMapper<IdxBizJgUseInfo> {
void
updateVersionBatch
(
@Param
(
"records"
)
List
<
String
>
records
,
@Param
(
"version"
)
int
version
);
Map
<
String
,
Object
>
queryDetail
(
@Param
(
"record"
)
String
record
);
List
<
Map
<
String
,
Object
>>
queryDetailBatch
(
@Param
(
"records"
)
List
<
String
>
records
);
}
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/resources/mapper/IdxBizJgInspectionDetectionInfoMapper.xml
View file @
8eac96bd
...
...
@@ -12,4 +12,17 @@
"RECORD" = #{record}
ORDER BY "INSPECT_TYPE", "INSPECT_DATE" DESC, "SEQUENCE_NBR" DESC
</select>
<select
id=
"selectLastedGroupByInspectTypeBatch"
resultType=
"com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgInspectionDetectionInfo"
>
SELECT
DISTINCT ON ("RECORD", "INSPECT_TYPE") *
FROM
idx_biz_jg_inspection_detection_info
WHERE
"RECORD" in
<foreach
collection=
"records"
item=
"record"
open=
"("
close=
")"
separator=
","
>
#{record}
</foreach>
ORDER BY "RECORD", "INSPECT_TYPE", "INSPECT_DATE" DESC, "SEQUENCE_NBR" DESC
</select>
</mapper>
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/resources/mapper/IdxBizJgMaintenanceRecordInfoMapper.xml
0 → 100644
View file @
8eac96bd
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgMaintenanceRecordInfoMapper"
>
<select
id=
"selectLastedMainInfoBatch"
resultType=
"com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgMaintenanceRecordInfo"
>
SELECT
DISTINCT ON ("RECORD") *
FROM
idx_biz_jg_maintenance_record_info
WHERE
"RECORD" IN
<foreach
collection=
"records"
item=
"record"
open=
"("
close=
")"
separator=
","
>
#{record}
</foreach>
ORDER BY "RECORD", "REC_DATE" DESC
</select>
</mapper>
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/resources/mapper/IdxBizJgUseInfoMapper.xml
View file @
8eac96bd
...
...
@@ -65,68 +65,7 @@
FROM "idx_biz_jg_use_info"
</select>
<select
id=
"queryDetail"
resultType=
"java.util.Map"
>
SELECT
ibjui."RECORD" AS "SEQUENCE_NBR",
ibjui."PROJECT_CONTRAPTION",
ibjui."PROJECT_CONTRAPTION_ID",
ibjsi."ORG_BRANCH_NAME",
ibjsi."ORG_BRANCH_CODE",
ibjui."REC_DATE",
ibjui."USE_UNIT_NAME",
ibjui."USE_UNIT_CREDIT_CODE",
ibjui."USC_UNIT_NAME",
ibjui."USC_UNIT_CREDIT_CODE",
ibjri."EQU_LIST" AS "EQU_LIST_CODE",
ibjri."EQU_DEFINE" AS "EQU_DEFINE_CODE",
ibjri."PRODUCT_NAME",
ibjri."BRAND_NAME",
ibjri."EQU_TYPE",
ibjri."EQU_CATEGORY" AS "EQU_CATEGORY_CODE",
tec2.NAME AS "EQU_DEFINE",
tec1.NAME AS "EQU_LIST",
tec.NAME AS "EQU_CATEGORY",
ibjri."USE_ORG_CODE",
ibjui."USE_INNER_CODE",
ibjui."DATA_SOURCE",
ibjoi."CODE96333",
ibjri."EQU_CODE",
ibjoi."SUPERVISORY_CODE",
ibjri."WHETHER_VEHICLE_CYLINDER",
ibjri."WHETHER_SKID_MOUNTED_PRESSURE_VESSEL",
ibjri."CYLINDER_CATEGORY",
ibjri."WHETHER_SPHERICAL_TANK",
ibjri."CAR_NUMBER",
ibjri."EQU_PRICE",
concat_ws ( '/', ibjui."PROVINCE_NAME", ibjui."CITY_NAME", ibjui."COUNTY_NAME", ibjui."STREET_NAME" ) AS "USE_PLACE",
concat_ws ( '#', ibjui."PROVINCE", ibjui."CITY", ibjui."COUNTY", ibjui."FACTORY_USE_SITE_STREET" ) AS "USE_PLACE_CODE",
ibjui."ADDRESS",
ibjui."EQU_STATE",
ibjui."IS_INTO_MANAGEMENT",
ibjoi."CLAIM_STATUS" AS "STATUS",
ibjfi."FACTORY_NUM",
ibjfi."PRODUCE_UNIT_NAME",
ibjfi."PRODUCE_UNIT_CREDIT_CODE",
ibjfi."PRODUCE_DATE",
ibjui."CREATE_DATE" ,
ibjui."SAFETY_MANAGER" ,
ibjui."PHONE",
ibjui."USE_DATE",
ibjui."USE_PLACE" as USE_SITE_CODE,
ibjui."DATA_QUALITY_SCORE",
ibjoi."INFORMATION_SITUATION",
di."DESIGN_UNIT_CREDIT_CODE",
di."DESIGN_UNIT_NAME",
di."DESIGN_DATE"
FROM
amos_tzs_biz.idx_biz_jg_use_info ibjui
LEFT JOIN amos_tzs_biz.idx_biz_jg_supervision_info ibjsi ON ibjui."RECORD" = ibjsi."RECORD"
LEFT JOIN amos_tzs_biz.idx_biz_jg_register_info ibjri ON ibjui."RECORD" = ibjri."RECORD"
LEFT JOIN amos_tzs_biz.idx_biz_jg_other_info ibjoi ON ibjui."RECORD" = ibjoi."RECORD"
LEFT JOIN amos_tzs_biz.idx_biz_jg_factory_info ibjfi ON ibjui."RECORD" = ibjfi."RECORD"
LEFT JOIN amos_tzs_biz.idx_biz_jg_design_info di ON di."RECORD" = ibjui."RECORD"
LEFT JOIN amos_tzs_biz.tz_equipment_category tec ON ibjri."EQU_CATEGORY" = tec.code
LEFT JOIN amos_tzs_biz.tz_equipment_category tec1 ON ibjri."EQU_LIST" = tec1.code
LEFT JOIN amos_tzs_biz.tz_equipment_category tec2 ON ibjri."EQU_DEFINE" = tec2.code
<include
refid=
"equip-detail-es"
/>
WHERE
ibjui."RECORD" = #{record}
</select>
...
...
@@ -135,4 +74,79 @@
UPDATE idx_biz_jg_use_info SET "VERSION"=#{version} WHERE record = #{record}
</foreach>
</update>
<sql
id=
"equip-detail-es"
>
SELECT
ibjui."RECORD" AS "SEQUENCE_NBR",
ibjui."PROJECT_CONTRAPTION",
ibjui."PROJECT_CONTRAPTION_ID",
ibjsi."ORG_BRANCH_NAME",
ibjsi."ORG_BRANCH_CODE",
ibjui."REC_DATE",
ibjui."USE_UNIT_NAME",
ibjui."USE_UNIT_CREDIT_CODE",
ibjui."USC_UNIT_NAME",
ibjui."USC_UNIT_CREDIT_CODE",
ibjri."EQU_LIST" AS "EQU_LIST_CODE",
ibjri."EQU_DEFINE" AS "EQU_DEFINE_CODE",
ibjri."PRODUCT_NAME",
ibjri."BRAND_NAME",
ibjri."EQU_TYPE",
ibjri."EQU_CATEGORY" AS "EQU_CATEGORY_CODE",
tec2.NAME AS "EQU_DEFINE",
tec1.NAME AS "EQU_LIST",
tec.NAME AS "EQU_CATEGORY",
ibjri."USE_ORG_CODE",
ibjui."USE_INNER_CODE",
ibjui."DATA_SOURCE",
ibjoi."CODE96333",
ibjri."EQU_CODE",
ibjoi."SUPERVISORY_CODE",
ibjri."WHETHER_VEHICLE_CYLINDER",
ibjri."WHETHER_SKID_MOUNTED_PRESSURE_VESSEL",
ibjri."CYLINDER_CATEGORY",
ibjri."WHETHER_SPHERICAL_TANK",
ibjri."CAR_NUMBER",
ibjri."EQU_PRICE",
concat_ws ( '/', ibjui."PROVINCE_NAME", ibjui."CITY_NAME", ibjui."COUNTY_NAME", ibjui."STREET_NAME" ) AS "USE_PLACE",
concat_ws ( '#', ibjui."PROVINCE", ibjui."CITY", ibjui."COUNTY", ibjui."FACTORY_USE_SITE_STREET" ) AS "USE_PLACE_CODE",
ibjui."ADDRESS",
ibjui."EQU_STATE",
ibjui."IS_INTO_MANAGEMENT",
ibjoi."CLAIM_STATUS" AS "STATUS",
ibjfi."FACTORY_NUM",
ibjfi."PRODUCE_UNIT_NAME",
ibjfi."PRODUCE_UNIT_CREDIT_CODE",
ibjfi."PRODUCE_DATE",
ibjui."CREATE_DATE" ,
ibjui."SAFETY_MANAGER" ,
ibjui."PHONE",
ibjui."USE_DATE",
ibjui."USE_PLACE" as USE_SITE_CODE,
ibjui."DATA_QUALITY_SCORE",
ibjoi."INFORMATION_SITUATION",
di."DESIGN_UNIT_CREDIT_CODE",
di."DESIGN_UNIT_NAME",
di."DESIGN_DATE"
FROM
idx_biz_jg_use_info ibjui
LEFT JOIN amos_tzs_biz.idx_biz_jg_supervision_info ibjsi ON ibjui."RECORD" = ibjsi."RECORD"
LEFT JOIN amos_tzs_biz.idx_biz_jg_register_info ibjri ON ibjui."RECORD" = ibjri."RECORD"
LEFT JOIN amos_tzs_biz.idx_biz_jg_other_info ibjoi ON ibjui."RECORD" = ibjoi."RECORD"
LEFT JOIN amos_tzs_biz.idx_biz_jg_factory_info ibjfi ON ibjui."RECORD" = ibjfi."RECORD"
LEFT JOIN amos_tzs_biz.idx_biz_jg_design_info di ON di."RECORD" = ibjui."RECORD"
LEFT JOIN amos_tzs_biz.tz_equipment_category tec ON ibjri."EQU_CATEGORY" = tec.code
LEFT JOIN amos_tzs_biz.tz_equipment_category tec1 ON ibjri."EQU_LIST" = tec1.code
LEFT JOIN amos_tzs_biz.tz_equipment_category tec2 ON ibjri."EQU_DEFINE" = tec2.code
</sql>
<select
id=
"queryDetailBatch"
resultType=
"java.util.Map"
>
<include
refid=
"equip-detail-es"
/>
WHERE
ibjui."RECORD" in
<foreach
item=
"record"
collection=
"records"
open=
"("
separator=
","
close=
")"
>
#{record}
</foreach>
</select>
</mapper>
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