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
7f2f8ec0
Commit
7f2f8ec0
authored
Jul 09, 2025
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(综合搜索):数据同步调整
1.日期格式化增加兼容业务错误数据
parent
a2c7d00a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
18 deletions
+48
-18
StatisticsDataUpdateService.java
...ot/module/jg/biz/refresh/StatisticsDataUpdateService.java
+41
-6
EquipmentRefreshHandler.java
...odule/jg/biz/refresh/handler/EquipmentRefreshHandler.java
+3
-6
DataHandlerServiceImpl.java
...ot/module/jg/biz/service/impl/DataHandlerServiceImpl.java
+4
-6
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/refresh/StatisticsDataUpdateService.java
View file @
7f2f8ec0
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
refresh
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.date.DateUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.yeejoin.amos.boot.module.common.api.dto.ITechParamDefine
;
import
com.yeejoin.amos.boot.module.common.api.dto.TechParamItem
;
import
com.yeejoin.amos.boot.module.common.api.entity.ESEquipmentInfo
;
import
com.yeejoin.amos.boot.module.common.biz.utils.TechParamUtil
;
import
com.yeejoin.amos.boot.module.jg.biz.edit.backup.TechParamsBackupService
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgInspectionDetectionInfo
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
java.time.ZoneId
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
@Service
@RequiredArgsConstructor
@Slf4j
public
class
StatisticsDataUpdateService
{
private
final
TechParamsBackupService
techParamsBackupService
;
public
static
final
String
USE_DATE_KEY
=
"USE_DATE"
;
public
List
<
ESEquipmentInfo
.
TechParam
>
getTechParams
(
String
equList
,
String
record
)
{
List
<
ESEquipmentInfo
.
TechParam
>
techParams
=
new
ArrayList
<>();
...
...
@@ -55,13 +62,10 @@ public class StatisticsDataUpdateService {
}
}
public
static
String
castList2String
(
List
<
String
>
posts
){
return
String
.
join
(
","
,
posts
);
}
public
static
String
castStrList2String
(
String
jsonTypesStr
){
if
(!
isNullOrEmpty
(
jsonTypesStr
))
{
if
(
isJSONValid
(
jsonTypesStr
))
{
public
static
String
castStrList2String
(
String
jsonTypesStr
)
{
if
(!
isNullOrEmpty
(
jsonTypesStr
))
{
if
(
isJSONValid
(
jsonTypesStr
))
{
List
<
String
>
posts
=
JSON
.
parseArray
(
jsonTypesStr
,
String
.
class
);
return
String
.
join
(
","
,
posts
);
}
...
...
@@ -74,4 +78,35 @@ public class StatisticsDataUpdateService {
return
str
==
null
||
str
.
trim
().
isEmpty
()
||
"null"
.
equals
(
str
);
}
public
static
void
formatUseDate
(
Map
<
String
,
Object
>
detail
)
{
if
(
detail
.
containsKey
(
USE_DATE_KEY
)
&&
detail
.
get
(
USE_DATE_KEY
)
!=
null
)
{
if
(
detail
.
get
(
USE_DATE_KEY
).
toString
().
isEmpty
()
||
detail
.
get
(
USE_DATE_KEY
).
toString
().
equals
(
"null"
))
{
detail
.
put
(
USE_DATE_KEY
,
null
);
}
else
{
String
useDateStr
=
""
;
try
{
useDateStr
=
detail
.
get
(
USE_DATE_KEY
).
toString
();
detail
.
put
(
USE_DATE_KEY
,
DateUtil
.
parse
(
useDateStr
));
}
catch
(
Exception
e
)
{
log
.
error
(
"非法的USE_DATE格式:{}"
,
useDateStr
);
detail
.
put
(
USE_DATE_KEY
,
null
);
}
}
}
}
public
static
void
formatInspectDate
(
ESEquipmentInfo
esEquipmentInfo
,
IdxBizJgInspectionDetectionInfo
inspectionDetectionInfo
,
String
record
)
{
try
{
esEquipmentInfo
.
setINSPECT_DATE
(
inspectionDetectionInfo
.
getSequenceNbr
()
!=
null
?
inspectionDetectionInfo
.
getInspectDate
()
!=
null
?
inspectionDetectionInfo
.
getInspectDate
().
toInstant
().
atZone
(
ZoneId
.
systemDefault
()).
toLocalDate
()
:
null
:
null
);
}
catch
(
Exception
e
)
{
log
.
error
(
"INSPECT_DATE时区转换失败:{}"
,
record
,
e
);
}
try
{
esEquipmentInfo
.
setNEXT_INSPECT_DATE
(
inspectionDetectionInfo
.
getSequenceNbr
()
!=
null
?
inspectionDetectionInfo
.
getNextInspectDate
()
!=
null
?
inspectionDetectionInfo
.
getNextInspectDate
().
toInstant
().
atZone
(
ZoneId
.
systemDefault
()).
toLocalDate
()
:
null
:
null
);
}
catch
(
Exception
e
)
{
log
.
error
(
"NEXT_INSPECT_DATE时区转换失败:{}"
,
record
,
e
);
}
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/refresh/handler/EquipmentRefreshHandler.java
View file @
7f2f8ec0
...
...
@@ -57,16 +57,12 @@ public class EquipmentRefreshHandler implements IDataRefreshHandler {
String
record
=
message
.
getDataId
();
ESEquipmentInfo
esEquipmentInfo
=
new
ESEquipmentInfo
();
Map
<
String
,
Object
>
detail
=
useInfoService
.
getBaseMapper
().
queryDetail
(
record
);
StatisticsDataUpdateService
.
formatUseDate
(
detail
);
BeanUtil
.
copyProperties
(
detail
,
esEquipmentInfo
,
true
);
List
<
IdxBizJgInspectionDetectionInfo
>
inspectionDetectionInfos
=
iIdxBizJgInspectionDetectionInfoService
.
queryLastedGroupByInspectType
(
record
);
IdxBizJgInspectionDetectionInfo
inspectionDetectionInfo
=
iIdxBizJgInspectionDetectionInfoService
.
queryNewestDetailByRecord
(
record
);
IdxBizJgMaintenanceRecordInfo
lastMaintenanceRecordInfo
=
maintenanceRecordInfoService
.
queryNewestDetailByRecord
(
record
);
try
{
esEquipmentInfo
.
setINSPECT_DATE
(
inspectionDetectionInfo
.
getSequenceNbr
()
!=
null
?
inspectionDetectionInfo
.
getInspectDate
()
!=
null
?
inspectionDetectionInfo
.
getInspectDate
().
toInstant
().
atZone
(
ZoneId
.
systemDefault
()).
toLocalDate
()
:
null
:
null
);
esEquipmentInfo
.
setNEXT_INSPECT_DATE
(
inspectionDetectionInfo
.
getSequenceNbr
()
!=
null
?
inspectionDetectionInfo
.
getNextInspectDate
()
!=
null
?
inspectionDetectionInfo
.
getNextInspectDate
().
toInstant
().
atZone
(
ZoneId
.
systemDefault
()).
toLocalDate
()
:
null
:
null
);
}
catch
(
Exception
e
)
{
log
.
error
(
"时区转换失败:{}"
,
record
,
e
);
}
StatisticsDataUpdateService
.
formatInspectDate
(
esEquipmentInfo
,
inspectionDetectionInfo
,
record
);
esEquipmentInfo
.
setIssueDate
(
getIssueDate
(
esEquipmentInfo
.
getUSE_ORG_CODE
()));
esEquipmentInfo
.
setMAINTAIN_UNIT
(
lastMaintenanceRecordInfo
.
getMeUnitCreditCode
());
esEquipmentInfo
.
setMAINTAIN_UNIT_NAME
(
lastMaintenanceRecordInfo
.
getMeUnitName
());
...
...
@@ -80,6 +76,7 @@ public class EquipmentRefreshHandler implements IDataRefreshHandler {
}
}
private
List
<
ESEquipmentInfo
.
TechParam
>
buildTechParamByEquList
(
String
record
,
String
equListCode
)
{
return
StringUtils
.
isNotEmpty
(
equListCode
)
?
statisticsDataUpdateService
.
getTechParams
(
equListCode
,
record
)
:
new
ArrayList
<>();
}
...
...
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 @
7f2f8ec0
...
...
@@ -1510,6 +1510,7 @@ public class DataHandlerServiceImpl {
try
{
esEquipmentInfo
=
new
ESEquipmentInfo
();
Map
<
String
,
Object
>
detail
=
useInfoService
.
getBaseMapper
().
queryDetail
(
record
);
StatisticsDataUpdateService
.
formatUseDate
(
detail
);
BeanUtil
.
copyProperties
(
detail
,
esEquipmentInfo
,
true
);
Optional
<
ESEquipmentCategoryDto
>
esOptional
=
esEquipmentCategory
.
findById
(
record
);
if
(
esOptional
.
isPresent
()){
...
...
@@ -1522,12 +1523,7 @@ public class DataHandlerServiceImpl {
List
<
IdxBizJgInspectionDetectionInfo
>
inspectionDetectionInfos
=
iIdxBizJgInspectionDetectionInfoService
.
queryLastedGroupByInspectType
(
record
);
IdxBizJgInspectionDetectionInfo
inspectionDetectionInfo
=
iIdxBizJgInspectionDetectionInfoService
.
queryNewestDetailByRecord
(
record
);
IdxBizJgMaintenanceRecordInfo
lastMaintenanceRecordInfo
=
maintenanceRecordInfoService
.
queryNewestDetailByRecord
(
record
);
try
{
esEquipmentInfo
.
setINSPECT_DATE
(
inspectionDetectionInfo
.
getSequenceNbr
()
!=
null
?
inspectionDetectionInfo
.
getInspectDate
()
!=
null
?
inspectionDetectionInfo
.
getInspectDate
().
toInstant
().
atZone
(
ZoneId
.
systemDefault
()).
toLocalDate
()
:
null
:
null
);
esEquipmentInfo
.
setNEXT_INSPECT_DATE
(
inspectionDetectionInfo
.
getSequenceNbr
()
!=
null
?
inspectionDetectionInfo
.
getNextInspectDate
()
!=
null
?
inspectionDetectionInfo
.
getNextInspectDate
().
toInstant
().
atZone
(
ZoneId
.
systemDefault
()).
toLocalDate
()
:
null
:
null
);
}
catch
(
Exception
e
)
{
log
.
error
(
"时区转换失败:{}"
,
record
,
e
);
}
StatisticsDataUpdateService
.
formatInspectDate
(
esEquipmentInfo
,
inspectionDetectionInfo
,
record
);
esEquipmentInfo
.
setIssueDate
(
getIssueDate
(
esEquipmentInfo
.
getUSE_ORG_CODE
()));
esEquipmentInfo
.
setMAINTAIN_UNIT
(
lastMaintenanceRecordInfo
.
getMeUnitCreditCode
());
esEquipmentInfo
.
setMAINTAIN_UNIT_NAME
(
lastMaintenanceRecordInfo
.
getMeUnitName
());
...
...
@@ -1552,6 +1548,8 @@ public class DataHandlerServiceImpl {
return
refreshRecords
.
size
();
}
private
List
<
ESEquipmentInfo
.
TechParam
>
buildTechParamByEquList
(
String
record
,
String
equListCode
)
{
return
StringUtils
.
isNotEmpty
(
equListCode
)
?
statisticsDataUpdateService
.
getTechParams
(
equListCode
,
record
)
:
new
ArrayList
<>();
}
...
...
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