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
9add810f
Commit
9add810f
authored
Dec 13, 2024
by
韩桐桐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jg):向新增的工程装置表刷入数据-完善逻辑
parent
3f13132e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
73 additions
and
32 deletions
+73
-32
DataHandlerServiceImpl.java
...ot/module/jg/biz/service/impl/DataHandlerServiceImpl.java
+73
-32
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/service/impl/DataHandlerServiceImpl.java
View file @
9add810f
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgRegistrationHistory
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration
;
import
com.yeejoin.amos.boot.module.jg.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.mapper.EquipmentCategoryMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
...
...
@@ -42,6 +40,12 @@ public class DataHandlerServiceImpl {
private
JgUseRegistrationServiceImpl
useRegistrationService
;
@Resource
private
JgUseRegistrationEqServiceImpl
useRegistrationEqService
;
@Resource
private
JgInstallationNoticeEqServiceImpl
installationNoticeEqService
;
@Resource
private
IdxBizJgUseInfoServiceImpl
useInfoService
;
@Resource
...
...
@@ -127,41 +131,68 @@ public class DataHandlerServiceImpl {
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Boolean
writeData2ProjectContraption
()
{
Set
<
String
>
projectContraptions
=
useInfoService
.
lambdaQuery
()
.
select
(
IdxBizJgUseInfo:
:
getProjectContraption
)
.
groupBy
(
IdxBizJgUseInfo:
:
getProjectContraption
)
projectContraptionService
.
getBaseMapper
().
delete
(
null
);
List
<
IdxBizJgUseInfo
>
collect
=
useInfoService
.
lambdaQuery
()
.
select
(
IdxBizJgUseInfo:
:
getRecord
,
IdxBizJgUseInfo:
:
getProjectContraption
,
IdxBizJgUseInfo:
:
getUseUnitCreditCode
,
IdxBizJgUseInfo:
:
getUseUnitName
,
IdxBizJgUseInfo:
:
getIsIntoManagement
)
.
isNotNull
(
IdxBizJgUseInfo:
:
getProjectContraption
)
.
ne
(
IdxBizJgUseInfo:
:
getProjectContraption
,
""
)
.
groupBy
(
IdxBizJgUseInfo:
:
getProjectContraption
,
IdxBizJgUseInfo:
:
getUseUnitCreditCode
)
.
list
().
stream
()
.
filter
(
Objects:
:
nonNull
)
.
map
(
IdxBizJgUseInfo:
:
getProjectContraption
)
.
filter
(
Objects:
:
nonNull
)
.
filter
(
StringUtils:
:
hasText
)
.
collect
(
Collectors
.
toSet
());
log
.
info
(
"查询到的工程装置集合: {}"
,
projectContraptions
);
.
collect
(
Collectors
.
toList
());
log
.
info
(
"查询到的工程装置集合: {}"
,
JSON
.
toJSONString
(
collect
));
List
<
IdxBizJgProjectContraption
>
projectContraptionList
=
new
ArrayList
<>();
Iterator
<
String
>
iterator
=
projectContraptions
.
iterator
();
Iterator
<
IdxBizJgUseInfo
>
iterator
=
collect
.
iterator
();
while
(
iterator
.
hasNext
())
{
String
projectContraption
=
iterator
.
next
();
IdxBizJgUseInfo
useInfo
=
iterator
.
next
();
boolean
isLast
=
!
iterator
.
hasNext
();
String
record
=
useInfo
.
getRecord
();
Boolean
isIntoManagement
=
useInfo
.
getIsIntoManagement
();
String
projectContraption
=
useInfo
.
getProjectContraption
();
String
useUnitCreditCode
=
useInfo
.
getUseUnitCreditCode
();
Long
sequenceNbr
=
sequence
.
nextId
();
JgInstallationNotice
installationNotice
=
installationNoticeService
.
lambdaQuery
()
.
eq
(
JgInstallationNotice:
:
getProjectContraption
,
projectContraption
)
List
<
String
>
installNotSeqs
=
installationNoticeEqService
.
lambdaQuery
()
.
eq
(
JgInstallationNoticeEq:
:
getEquId
,
record
)
.
list
().
stream
()
.
filter
(
Objects:
:
nonNull
)
.
map
(
JgInstallationNoticeEq:
:
getEquipTransferId
)
.
collect
(
Collectors
.
toList
());
JgInstallationNotice
installationNotice
=
installNotSeqs
.
isEmpty
()
?
null
:
installationNoticeService
.
lambdaQuery
()
.
in
(
JgInstallationNotice:
:
getSequenceNbr
,
installNotSeqs
)
.
eq
(
JgInstallationNotice:
:
getUseUnitCreditCode
,
useUnitCreditCode
)
.
eq
(
JgInstallationNotice:
:
getNoticeStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
())
.
list
().
stream
()
.
findFirst
().
orElse
(
null
);
JgUseRegistration
useRegistration
=
useRegistrationService
.
lambdaQuery
()
.
eq
(
JgUseRegistration:
:
getProjectContraption
,
projectContraption
)
List
<
String
>
useRegSeqs
=
useRegistrationEqService
.
lambdaQuery
()
.
eq
(
JgUseRegistrationEq:
:
getEquId
,
record
)
.
list
().
stream
()
.
filter
(
Objects:
:
nonNull
)
.
map
(
JgUseRegistrationEq:
:
getEquipTransferId
)
.
collect
(
Collectors
.
toList
());
JgUseRegistration
useRegistration
=
useRegSeqs
.
isEmpty
()
?
null
:
useRegistrationService
.
lambdaQuery
()
.
in
(
JgUseRegistration:
:
getSequenceNbr
,
useRegSeqs
)
.
eq
(
JgUseRegistration:
:
getUseUnitCreditCode
,
useUnitCreditCode
)
.
eq
(
JgUseRegistration:
:
getStatus
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
())
.
list
().
stream
()
.
findFirst
().
orElse
(
null
);
List
<
IdxBizJgUseInfo
>
useInfos
=
useInfoService
.
lambdaQuery
()
.
eq
(
IdxBizJgUseInfo:
:
getProjectContraption
,
projectContraption
)
.
eq
(
IdxBizJgUseInfo:
:
getUseUnitCreditCode
,
useUnitCreditCode
)
.
list
();
List
<
IdxBizJgTechParamsPipeline
>
idxBizJgTechParamsPipelines
=
techParamsPipelineService
.
lambdaQuery
()
List
<
IdxBizJgTechParamsPipeline
>
idxBizJgTechParamsPipelines
=
useInfos
.
isEmpty
()
?
new
ArrayList
<>()
:
techParamsPipelineService
.
lambdaQuery
()
.
in
(
IdxBizJgTechParamsPipeline:
:
getRecord
,
useInfos
.
stream
()
.
map
(
IdxBizJgUseInfo:
:
getRecord
)
.
collect
(
Collectors
.
toList
()))
...
...
@@ -196,10 +227,10 @@ public class DataHandlerServiceImpl {
IdxBizJgProjectContraption
idxBizJgProjectContraption
=
IdxBizJgProjectContraption
.
builder
()
.
projectContraption
(
projectContraption
)
.
projectContraptionNo
(
projectContraption
)
.
useUnitCreditCode
(
ObjectUtils
.
isEmpty
(
useRegistration
)
?
null
:
useRegistration
.
getUseUnitCreditCode
()
)
.
useUnitName
(
ObjectUtils
.
isEmpty
(
useRegistration
)
?
null
:
useRegistration
.
getUseUnitName
()
)
.
uscUnitCreditCode
(
ObjectUtils
.
isEmpty
(
useRegistration
)
?
(
ObjectUtils
.
isEmpty
(
installationNotice
)
?
null
:
installationNotice
.
getInstallUnitCreditCode
()
)
:
null
)
.
uscUnitName
(
ObjectUtils
.
isEmpty
(
useRegistration
)
?
(
ObjectUtils
.
isEmpty
(
installationNotice
)
?
null
:
installationNotice
.
getInstallUnitName
()
)
:
null
)
.
useUnitCreditCode
(
isIntoManagement
?
(
ObjectUtils
.
isEmpty
(
installationNotice
)
?
null
:
installationNotice
.
getUseUnitCreditCode
())
:
null
)
.
useUnitName
(
isIntoManagement
?
(
ObjectUtils
.
isEmpty
(
installationNotice
)
?
null
:
installationNotice
.
getUseUnitName
())
:
null
)
.
uscUnitCreditCode
(
isIntoManagement
?
(
ObjectUtils
.
isEmpty
(
useRegistration
)
?
(
ObjectUtils
.
isEmpty
(
installationNotice
)
?
null
:
installationNotice
.
getInstallUnitCreditCode
())
:
null
)
:
null
)
.
uscUnitName
(
isIntoManagement
?
(
ObjectUtils
.
isEmpty
(
useRegistration
)
?
(
ObjectUtils
.
isEmpty
(
installationNotice
)
?
null
:
installationNotice
.
getInstallUnitName
())
:
null
)
:
null
)
.
equList
(
ObjectUtils
.
isEmpty
(
installationNotice
)
?
null
:
installationNotice
.
getEquListCode
())
.
equListName
(
ObjectUtils
.
isEmpty
(
installationNotice
)
?
null
:
installationNotice
.
getEquList
())
.
equCategory
(
ObjectUtils
.
isEmpty
(
installationNotice
)
?
null
:
installationNotice
.
getEquCategoryCode
())
...
...
@@ -226,7 +257,7 @@ public class DataHandlerServiceImpl {
.
endLatitudeLongitude
(
ObjectUtils
.
isEmpty
(
idxBizJgTechParamsPipelines
)
?
null
:
idxBizJgTechParamsPipelines
.
get
(
0
).
getEndPosition
())
.
supervisoryCode
(
ObjectUtils
.
isEmpty
(
installationNotice
)
?
null
:
installationNotice
.
getSupervisoryCode
())
.
useRegistrationCode
(
ObjectUtils
.
isEmpty
(
useRegistration
)
?
null
:
useRegistration
.
getUseRegistrationCode
())
.
isIntoManagement
(
Boolean
.
TRUE
)
.
isIntoManagement
(
isIntoManagement
)
.
dataSource
(
"jg"
)
.
build
();
idxBizJgProjectContraption
.
setSequenceNbr
(
sequenceNbr
);
...
...
@@ -241,17 +272,27 @@ public class DataHandlerServiceImpl {
useInfoService
.
lambdaUpdate
()
.
set
(
IdxBizJgUseInfo:
:
getProjectContraptionId
,
sequenceNbr
)
.
eq
(
IdxBizJgUseInfo:
:
getProjectContraption
,
projectContraption
)
.
eq
(
IdxBizJgUseInfo:
:
getUseUnitCreditCode
,
useUnitCreditCode
)
.
update
();
installationNoticeService
.
lambdaUpdate
()
.
set
(
JgInstallationNotice:
:
getProjectContraptionId
,
sequenceNbr
)
.
eq
(
JgInstallationNotice:
:
getProjectContraption
,
projectContraption
)
.
update
();
if
(!
installNotSeqs
.
isEmpty
())
{
installationNoticeService
.
lambdaUpdate
()
.
set
(
JgInstallationNotice:
:
getProjectContraptionId
,
sequenceNbr
)
.
in
(
JgInstallationNotice:
:
getSequenceNbr
,
installNotSeqs
)
.
eq
(
JgInstallationNotice:
:
getProjectContraption
,
projectContraption
)
.
eq
(
JgInstallationNotice:
:
getUseUnitCreditCode
,
useUnitCreditCode
)
.
update
();
}
if
(!
useRegSeqs
.
isEmpty
())
{
useRegistrationService
.
lambdaUpdate
()
.
set
(
JgUseRegistration:
:
getProjectContraptionId
,
sequenceNbr
)
.
in
(
JgUseRegistration:
:
getSequenceNbr
,
useRegSeqs
)
.
eq
(
JgUseRegistration:
:
getProjectContraption
,
projectContraption
)
.
eq
(
JgUseRegistration:
:
getUseUnitCreditCode
,
useUnitCreditCode
)
.
update
();
}
useRegistrationService
.
lambdaUpdate
()
.
set
(
JgUseRegistration:
:
getProjectContraptionId
,
sequenceNbr
)
.
eq
(
JgUseRegistration:
:
getProjectContraption
,
projectContraption
)
.
update
();
}
return
Boolean
.
TRUE
;
}
...
...
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