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
7fb38b44
Commit
7fb38b44
authored
Dec 26, 2024
by
刘林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jg):处理管道历史设备刷数据问题
parent
c943f153
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
141 additions
and
1 deletion
+141
-1
DataHandlerController.java
.../boot/module/jg/biz/controller/DataHandlerController.java
+10
-1
DataHandlerServiceImpl.java
...ot/module/jg/biz/service/impl/DataHandlerServiceImpl.java
+131
-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 @
7fb38b44
...
...
@@ -48,5 +48,14 @@ public class DataHandlerController extends BaseController {
return
ResponseHelper
.
buildResponse
(
dataHandlerService
.
writeProjectContraptionId
());
}
/**
* 向新增的工程装置表刷入数据(补充使用单位code为空的)
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"向新增的工程装置表刷入数据,条件是未做使用登记,使用单位code为空的"
,
notes
=
"向新增的工程装置表刷入数据,条件是未做使用登记,使用单位code为空的"
)
@GetMapping
(
value
=
"/projectContraption/writeDataUseCodeIsNull"
)
public
ResponseModel
<
Boolean
>
writeDataUseCodeIsNull2ProjectContraption
()
{
return
ResponseHelper
.
buildResponse
(
dataHandlerService
.
writeDataUseCodeIsNull2ProjectContraption
());
}
}
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 @
7fb38b44
...
...
@@ -331,4 +331,135 @@ public class DataHandlerServiceImpl {
stopWatch
.
stop
();
return
String
.
format
(
"接口调用成功,更新数据:%s条,耗时:%s s"
,
size
.
get
(),
stopWatch
.
getTotalTimeSeconds
());
}
public
Boolean
writeDataUseCodeIsNull2ProjectContraption
()
{
List
<
IdxBizJgUseInfo
>
collect
=
useInfoService
.
lambdaQuery
()
.
select
(
IdxBizJgUseInfo:
:
getRecord
,
IdxBizJgUseInfo:
:
getProjectContraption
,
IdxBizJgUseInfo:
:
getUseUnitCreditCode
,
IdxBizJgUseInfo:
:
getUseUnitName
,
IdxBizJgUseInfo:
:
getIsIntoManagement
)
.
isNotNull
(
IdxBizJgUseInfo:
:
getProjectContraption
)
.
ne
(
IdxBizJgUseInfo:
:
getProjectContraption
,
""
)
.
eq
(
IdxBizJgUseInfo:
:
getUseUnitCreditCode
,
null
)
.
groupBy
(
IdxBizJgUseInfo:
:
getProjectContraption
)
.
list
().
stream
()
.
filter
(
Objects:
:
nonNull
)
.
collect
(
Collectors
.
toList
());
log
.
info
(
"查询到的工程装置集合: {},总数:{}"
,
JSON
.
toJSONString
(
collect
),
collect
.
size
());
List
<
IdxBizJgProjectContraption
>
projectContraptionList
=
new
ArrayList
<>();
Iterator
<
IdxBizJgUseInfo
>
iterator
=
collect
.
iterator
();
while
(
iterator
.
hasNext
())
{
IdxBizJgUseInfo
useInfo
=
iterator
.
next
();
boolean
isLast
=
!
iterator
.
hasNext
();
String
record
=
useInfo
.
getRecord
();
Boolean
isIntoManagement
=
ObjectUtils
.
isEmpty
(
useInfo
.
getIsIntoManagement
())
?
Boolean
.
FALSE
:
useInfo
.
getIsIntoManagement
();
String
projectContraption
=
useInfo
.
getProjectContraption
();
Long
sequenceNbr
=
sequence
.
nextId
();
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
)
.
list
().
stream
()
.
findFirst
().
orElse
(
null
);
List
<
IdxBizJgUseInfo
>
useInfos
=
useInfoService
.
lambdaQuery
()
.
eq
(
IdxBizJgUseInfo:
:
getProjectContraption
,
projectContraption
)
.
list
();
//技术参数表
List
<
IdxBizJgTechParamsPipeline
>
idxBizJgTechParamsPipelines
=
useInfos
.
isEmpty
()
?
new
ArrayList
<>()
:
techParamsPipelineService
.
lambdaQuery
()
.
in
(
IdxBizJgTechParamsPipeline:
:
getRecord
,
useInfos
.
stream
()
.
map
(
IdxBizJgUseInfo:
:
getRecord
)
.
collect
(
Collectors
.
toList
()))
.
list
();
double
pipeLengthSum
=
idxBizJgTechParamsPipelines
.
stream
()
.
filter
(
Objects:
:
nonNull
)
.
filter
(
pip
->
Objects
.
nonNull
(
pip
.
getPipeLength
()))
.
mapToDouble
(
pipeline
->
Double
.
parseDouble
(
pipeline
.
getPipeLength
()))
.
sum
();
IdxBizJgRegisterInfo
registerInfo
=
registerInfoService
.
lambdaQuery
()
.
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
useInfos
.
stream
().
findFirst
().
orElse
(
new
IdxBizJgUseInfo
())
.
getRecord
())
.
one
();
IdxBizJgSupervisionInfo
supervisionInfo
=
supervisionInfoService
.
lambdaQuery
()
.
eq
(
IdxBizJgSupervisionInfo:
:
getRecord
,
useInfos
.
stream
()
.
findFirst
().
orElse
(
new
IdxBizJgUseInfo
())
.
getRecord
())
.
one
();
IdxBizJgFactoryInfo
factoryInfo
=
factoryInfoService
.
lambdaQuery
()
.
eq
(
IdxBizJgFactoryInfo:
:
getRecord
,
useInfos
.
stream
()
.
findFirst
().
orElse
(
new
IdxBizJgUseInfo
())
.
getRecord
())
.
one
();
IdxBizJgProjectContraption
idxBizJgProjectContraption
=
IdxBizJgProjectContraption
.
builder
()
.
projectContraption
(
projectContraption
)
.
projectContraptionNo
(
projectContraption
)
.
uscUnitCreditCode
(
ObjectUtils
.
isEmpty
(
installationNotice
)
?
null
:
installationNotice
.
getInstallUnitCreditCode
())
.
uscUnitName
(
ObjectUtils
.
isEmpty
(
installationNotice
)
?
null
:
installationNotice
.
getInstallUnitName
())
.
equList
(
ObjectUtils
.
isEmpty
(
installationNotice
)
?
null
:
installationNotice
.
getEquListCode
())
.
equListName
(
ObjectUtils
.
isEmpty
(
installationNotice
)
?
null
:
installationNotice
.
getEquList
())
.
equCategory
(
ObjectUtils
.
isEmpty
(
installationNotice
)
?
null
:
installationNotice
.
getEquCategoryCode
())
.
equCategoryName
(
ObjectUtils
.
isEmpty
(
ObjectUtils
.
isEmpty
(
installationNotice
)
?
null
:
installationNotice
.
getEquCategoryCode
())
?
null
:
equipmentCategoryMapper
.
selectOne
(
new
LambdaQueryWrapper
<
EquipmentCategory
>().
eq
(
EquipmentCategory:
:
getCode
,
(
ObjectUtils
.
isEmpty
(
installationNotice
)
?
null
:
installationNotice
.
getEquCategoryCode
()))).
getName
())
.
equDefine
(
ObjectUtils
.
isEmpty
(
registerInfo
)
?
null
:
registerInfo
.
getEquDefine
())
.
equDefineName
(
ObjectUtils
.
isEmpty
(
ObjectUtils
.
isEmpty
(
registerInfo
)
?
null
:
registerInfo
.
getEquDefine
())
?
null
:
equipmentCategoryMapper
.
selectOne
(
new
LambdaQueryWrapper
<
EquipmentCategory
>().
eq
(
EquipmentCategory:
:
getCode
,
(
ObjectUtils
.
isEmpty
(
registerInfo
)
?
null
:
registerInfo
.
getEquDefine
()))).
getName
())
.
content
(
null
)
.
pipelineLength
(
pipeLengthSum
)
.
productPhoto
(
ObjectUtils
.
isEmpty
(
registerInfo
)
?
null
:
registerInfo
.
getProductPhoto
())
.
otherAccessories
(
null
)
.
orgCode
(
ObjectUtils
.
isEmpty
(
supervisionInfo
)
?
null
:
supervisionInfo
.
getOrgBranchCode
())
.
orgName
(
ObjectUtils
.
isEmpty
(
supervisionInfo
)
?
null
:
supervisionInfo
.
getOrgBranchName
())
.
productQualificationCertificate
(
ObjectUtils
.
isEmpty
(
factoryInfo
)
?
null
:
factoryInfo
.
getProductQualityYieldProve
())
.
province
(
ObjectUtils
.
isEmpty
(
installationNotice
)
?
null
:
installationNotice
.
getProvince
())
.
provinceName
(
ObjectUtils
.
isEmpty
(
installationNotice
)
?
null
:
installationNotice
.
getProvinceName
())
.
city
(
ObjectUtils
.
isEmpty
(
installationNotice
)
?
null
:
installationNotice
.
getCity
())
.
cityName
(
ObjectUtils
.
isEmpty
(
installationNotice
)
?
null
:
installationNotice
.
getCityName
())
.
county
(
ObjectUtils
.
isEmpty
(
installationNotice
)
?
null
:
installationNotice
.
getCounty
())
.
countyName
(
ObjectUtils
.
isEmpty
(
installationNotice
)
?
null
:
installationNotice
.
getCountyName
())
.
street
(
ObjectUtils
.
isEmpty
(
installationNotice
)
?
null
:
installationNotice
.
getStreet
())
.
streetName
(
ObjectUtils
.
isEmpty
(
installationNotice
)
?
null
:
installationNotice
.
getStreetName
())
.
address
(
ObjectUtils
.
isEmpty
(
installationNotice
)
?
null
:
installationNotice
.
getAddress
())
.
startLatitudeLongitude
(
ObjectUtils
.
isEmpty
(
idxBizJgTechParamsPipelines
)
?
null
:
idxBizJgTechParamsPipelines
.
get
(
0
).
getStartePosition
())
.
endLatitudeLongitude
(
ObjectUtils
.
isEmpty
(
idxBizJgTechParamsPipelines
)
?
null
:
idxBizJgTechParamsPipelines
.
get
(
0
).
getEndPosition
())
.
supervisoryCode
(
ObjectUtils
.
isEmpty
(
installationNotice
)
?
null
:
installationNotice
.
getSupervisoryCode
())
.
isIntoManagement
(
isIntoManagement
)
.
dataSource
(
"jg"
)
.
build
();
idxBizJgProjectContraption
.
setSequenceNbr
(
sequenceNbr
);
idxBizJgProjectContraption
.
setRecDate
(
new
Date
());
idxBizJgProjectContraption
.
setIsDelete
(
Boolean
.
FALSE
);
projectContraptionList
.
add
(
idxBizJgProjectContraption
);
if
(
projectContraptionList
.
size
()
%
1000
==
0
||
isLast
)
{
projectContraptionService
.
saveBatch
(
projectContraptionList
);
projectContraptionList
.
clear
();
}
useInfoService
.
lambdaUpdate
()
.
set
(
IdxBizJgUseInfo:
:
getProjectContraptionId
,
sequenceNbr
)
.
eq
(
IdxBizJgUseInfo:
:
getProjectContraption
,
projectContraption
)
.
update
();
if
(!
installNotSeqs
.
isEmpty
())
{
installationNoticeService
.
lambdaUpdate
()
.
set
(
JgInstallationNotice:
:
getProjectContraptionId
,
sequenceNbr
)
.
in
(
JgInstallationNotice:
:
getSequenceNbr
,
installNotSeqs
)
.
eq
(
JgInstallationNotice:
:
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