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
f7891fc5
Commit
f7891fc5
authored
Feb 27, 2025
by
Lambertliu
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop_tzs_register' into develop_tzs_register
parents
5054b9e6
c198fe2c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
132 additions
and
76 deletions
+132
-76
DataHandlerServiceImpl.java
...ot/module/jg/biz/service/impl/DataHandlerServiceImpl.java
+132
-76
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 @
f7891fc5
...
@@ -11,7 +11,6 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
...
@@ -11,7 +11,6 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
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.bo.CompanyBo
;
import
com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper
;
import
com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.entity.DataDictionary
;
import
com.yeejoin.amos.boot.biz.common.entity.DataDictionary
;
...
@@ -21,7 +20,6 @@ import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
...
@@ -21,7 +20,6 @@ import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeEqDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeEqDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.PieLineEquipContraptionDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.PieLineEquipContraptionDto
;
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.CompanyTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.api.enums.PipelineEnum
;
import
com.yeejoin.amos.boot.module.jg.api.enums.PipelineEnum
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.DataHandlerMapper
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.DataHandlerMapper
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeEqMapper
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeEqMapper
;
...
@@ -31,7 +29,6 @@ import com.yeejoin.amos.boot.module.ymt.api.entity.*;
...
@@ -31,7 +29,6 @@ import com.yeejoin.amos.boot.module.ymt.api.entity.*;
import
com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum
;
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.*
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.*
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -47,7 +44,6 @@ import javax.annotation.Resource;
...
@@ -47,7 +44,6 @@ import javax.annotation.Resource;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.math.RoundingMode
;
import
java.sql.Timestamp
;
import
java.sql.Timestamp
;
import
java.time.LocalDateTime
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.concurrent.atomic.AtomicReference
;
...
@@ -62,36 +58,82 @@ import static com.yeejoin.amos.boot.module.jg.biz.service.impl.JgInstallationNot
...
@@ -62,36 +58,82 @@ import static com.yeejoin.amos.boot.module.jg.biz.service.impl.JgInstallationNot
*/
*/
@Slf4j
@Slf4j
@Service
@Service
@RequiredArgsConstructor
public
class
DataHandlerServiceImpl
{
public
class
DataHandlerServiceImpl
{
private
final
ObjectMapper
objectMapper
;
@Resource
private
final
JgRegistrationHistoryServiceImpl
registrationHistoryService
;
private
ObjectMapper
objectMapper
;
private
final
JgInstallationNoticeServiceImpl
installationNoticeService
;
private
final
JgUseRegistrationServiceImpl
useRegistrationService
;
@Resource
private
final
JgVehicleInformationServiceImpl
jgVehicleInformationService
;
private
JgRegistrationHistoryServiceImpl
registrationHistoryService
;
private
final
JgUseRegistrationEqServiceImpl
useRegistrationEqService
;
private
final
JgInstallationNoticeEqServiceImpl
installationNoticeEqService
;
@Resource
private
final
IdxBizJgUseInfoServiceImpl
useInfoService
;
private
JgInstallationNoticeServiceImpl
installationNoticeService
;
private
final
SnowflakeIdUtil
sequence
;
private
final
IdxBizJgProjectContraptionServiceImpl
projectContraptionService
;
@Resource
private
final
IdxBizJgProjectConstructionMapper
projectConstructionMapper
;
private
JgUseRegistrationServiceImpl
useRegistrationService
;
private
final
IdxBizJgTechParamsPipelineServiceImpl
techParamsPipelineService
;
private
final
EquipmentCategoryMapper
equipmentCategoryMapper
;
@Resource
private
final
IdxBizJgRegisterInfoServiceImpl
registerInfoService
;
private
JgUseRegistrationEqServiceImpl
useRegistrationEqService
;
private
final
IdxBizJgSupervisionInfoServiceImpl
supervisionInfoService
;
private
final
IdxBizJgFactoryInfoServiceImpl
factoryInfoService
;
@Resource
private
final
ESEquipmentCategory
esEquipmentCategory
;
private
JgInstallationNoticeEqServiceImpl
installationNoticeEqService
;
private
final
TzBaseEnterpriseInfoMapper
tzBaseEnterpriseInfoMapper
;
private
final
JgInstallationNoticeEqMapper
jgInstallationNoticeEqMapper
;
@Resource
private
final
DataDictionaryMapper
dataDictionaryMapper
;
private
IdxBizJgUseInfoServiceImpl
useInfoService
;
private
final
IdxBizJgProjectInspectionMapper
projectInspectionMapper
;
private
final
IIdxBizJgInspectionDetectionInfoService
iIdxBizJgInspectionDetectionInfoService
;
@Resource
private
final
IdxBizJgProjectContraptionMapper
idxBizJgProjectContraptionMapper
;
private
SnowflakeIdUtil
sequence
;
private
final
JgInstallationNoticeMapper
jgInstallationNoticeMapper
;
private
final
DataHandlerMapper
dataHandlerMapper
;
@Resource
private
final
CategoryOtherInfoMapper
categoryOtherInfoMapper
;
private
IdxBizJgProjectContraptionServiceImpl
projectContraptionService
;
;
@Resource
private
IdxBizJgProjectConstructionMapper
projectConstructionMapper
;
@Resource
private
IdxBizJgTechParamsPipelineServiceImpl
techParamsPipelineService
;
@Resource
private
EquipmentCategoryMapper
equipmentCategoryMapper
;
@Resource
private
IdxBizJgRegisterInfoServiceImpl
registerInfoService
;
@Resource
private
IdxBizJgSupervisionInfoServiceImpl
supervisionInfoService
;
@Resource
private
IdxBizJgFactoryInfoServiceImpl
factoryInfoService
;
@Resource
private
ESEquipmentCategory
esEquipmentCategory
;
@Resource
TzBaseEnterpriseInfoMapper
tzBaseEnterpriseInfoMapper
;
@Resource
private
JgInstallationNoticeEqMapper
jgInstallationNoticeEqMapper
;
@Resource
private
DataDictionaryMapper
dataDictionaryMapper
;
@Resource
IdxBizJgProjectInspectionMapper
projectInspectionMapper
;
@Resource
IIdxBizJgInspectionDetectionInfoService
iIdxBizJgInspectionDetectionInfoService
;
@Autowired
private
IdxBizJgProjectContraptionMapper
idxBizJgProjectContraptionMapper
;
@Autowired
private
JgInstallationNoticeMapper
jgInstallationNoticeMapper
;
@Resource
private
JgVehicleInformationServiceImpl
jgVehicleInformationService
;
@Resource
private
DataHandlerMapper
dataHandlerMapper
;
@Resource
private
CategoryOtherInfoMapper
categoryOtherInfoMapper
;
/**
/**
...
@@ -101,13 +143,13 @@ public class DataHandlerServiceImpl {
...
@@ -101,13 +143,13 @@ public class DataHandlerServiceImpl {
*/
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Boolean
deviceListInFormWithInstallNotice
()
{
public
Boolean
deviceListInFormWithInstallNotice
()
{
List
<
JgInstallationNotice
>
noticeList
=
installationNoticeService
.
list
(
new
LambdaQueryWrapper
<
JgInstallationNotice
>().
eq
(
JgInstallationNotice:
:
getEquCategoryCode
,
"8300"
));
List
<
JgInstallationNotice
>
noticeList
=
installationNoticeService
.
list
(
new
LambdaQueryWrapper
<
JgInstallationNotice
>()
.
eq
(
JgInstallationNotice:
:
getEquCategoryCode
,
"8300"
));
List
<
JgRegistrationHistory
>
jgRegistrationHistories
=
noticeList
.
stream
()
List
<
JgRegistrationHistory
>
jgRegistrationHistories
=
noticeList
.
stream
()
.
map
(
notice
->
{
.
map
(
notice
->
{
JgRegistrationHistory
history
=
getRegistrationHistory
(
String
.
valueOf
(
notice
.
getSequenceNbr
()));
JgRegistrationHistory
history
=
getRegistrationHistory
(
String
.
valueOf
(
notice
.
getSequenceNbr
()));
if
(
history
==
null
)
if
(
history
==
null
)
return
null
;
return
null
;
try
{
try
{
Map
<
String
,
Object
>
hisData
=
objectMapper
.
readValue
(
Map
<
String
,
Object
>
hisData
=
objectMapper
.
readValue
(
history
.
getChangeData
(),
history
.
getChangeData
(),
...
@@ -387,7 +429,7 @@ public class DataHandlerServiceImpl {
...
@@ -387,7 +429,7 @@ public class DataHandlerServiceImpl {
.
eq
(
IdxBizJgUseInfo:
:
getProjectContraption
,
projectContraption
)
.
eq
(
IdxBizJgUseInfo:
:
getProjectContraption
,
projectContraption
)
.
list
();
.
list
();
//
技术参数表
//技术参数表
List
<
IdxBizJgTechParamsPipeline
>
idxBizJgTechParamsPipelines
=
useInfos
.
isEmpty
()
?
new
ArrayList
<>()
:
techParamsPipelineService
List
<
IdxBizJgTechParamsPipeline
>
idxBizJgTechParamsPipelines
=
useInfos
.
isEmpty
()
?
new
ArrayList
<>()
:
techParamsPipelineService
.
lambdaQuery
()
.
lambdaQuery
()
.
in
(
IdxBizJgTechParamsPipeline:
:
getRecord
,
useInfos
.
stream
()
.
in
(
IdxBizJgTechParamsPipeline:
:
getRecord
,
useInfos
.
stream
()
...
@@ -487,34 +529,36 @@ public class DataHandlerServiceImpl {
...
@@ -487,34 +529,36 @@ public class DataHandlerServiceImpl {
}
}
private
void
filledHisRegCylinderByUnit
()
{
private
void
filledHisRegCylinderByUnit
()
{
List
<
JgUseRegistration
>
useRegistrations
=
useRegistrationService
.
list
(
new
LambdaQueryWrapper
<
JgUseRegistration
>().
isNull
(
JgUseRegistration:
:
getSupervisionOrgCode
).
eq
(
JgUseRegistration:
:
getManageType
,
"unit"
).
eq
(
JgUseRegistration:
:
getRegType
,
"1"
).
select
(
BaseEntity:
:
getSequenceNbr
,
JgUseRegistration:
:
getUseUnitCreditCode
));
List
<
JgUseRegistration
>
useRegistrations
=
useRegistrationService
.
list
(
new
LambdaQueryWrapper
<
JgUseRegistration
>()
.
isNull
(
JgUseRegistration:
:
getSupervisionOrgCode
).
eq
(
JgUseRegistration:
:
getManageType
,
"unit"
).
eq
(
JgUseRegistration:
:
getRegType
,
"1"
).
select
(
BaseEntity:
:
getSequenceNbr
,
JgUseRegistration:
:
getUseUnitCreditCode
));
Map
<
String
,
String
>
unitSuperOrgCodeMap
=
new
ConcurrentHashMap
<>();
Map
<
String
,
String
>
unitSuperOrgCodeMap
=
new
ConcurrentHashMap
<>();
useRegistrations
.
parallelStream
().
forEach
(
u
->
{
useRegistrations
.
parallelStream
().
forEach
(
u
->
{
LambdaUpdateWrapper
<
JgUseRegistration
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
LambdaUpdateWrapper
<
JgUseRegistration
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
JgUseRegistration:
:
getSequenceNbr
,
u
.
getSequenceNbr
());
updateWrapper
.
eq
(
JgUseRegistration:
:
getSequenceNbr
,
u
.
getSequenceNbr
());
if
(
unitSuperOrgCodeMap
.
get
(
u
.
getUseUnitCreditCode
())
!=
null
)
{
if
(
unitSuperOrgCodeMap
.
get
(
u
.
getUseUnitCreditCode
())
!=
null
)
{
updateWrapper
.
set
(
JgUseRegistration:
:
getSupervisionOrgCode
,
unitSuperOrgCodeMap
.
get
(
u
.
getUseUnitCreditCode
()));
updateWrapper
.
set
(
JgUseRegistration:
:
getSupervisionOrgCode
,
unitSuperOrgCodeMap
.
get
(
u
.
getUseUnitCreditCode
()));
}
else
{
}
else
{
TzBaseEnterpriseInfo
baseEnterpriseInfo
=
tzBaseEnterpriseInfoMapper
.
selectByUseUnitCode
(
u
.
getUseUnitCreditCode
());
TzBaseEnterpriseInfo
baseEnterpriseInfo
=
tzBaseEnterpriseInfoMapper
.
selectByUseUnitCode
(
u
.
getUseUnitCreditCode
());
if
(
baseEnterpriseInfo
!=
null
)
{
if
(
baseEnterpriseInfo
!=
null
)
{
unitSuperOrgCodeMap
.
put
(
u
.
getUseUnitCreditCode
(),
baseEnterpriseInfo
.
getSuperviseOrgCode
());
unitSuperOrgCodeMap
.
put
(
u
.
getUseUnitCreditCode
(),
baseEnterpriseInfo
.
getSuperviseOrgCode
());
updateWrapper
.
set
(
JgUseRegistration:
:
getSupervisionOrgCode
,
baseEnterpriseInfo
.
getSuperviseOrgCode
());
updateWrapper
.
set
(
JgUseRegistration:
:
getSupervisionOrgCode
,
baseEnterpriseInfo
.
getSuperviseOrgCode
());
}
else
{
}
else
{
updateWrapper
.
set
(
JgUseRegistration:
:
getSupervisionOrgCode
,
null
);
updateWrapper
.
set
(
JgUseRegistration:
:
getSupervisionOrgCode
,
null
);
}
}
}
}
useRegistrationService
.
update
(
null
,
updateWrapper
);
useRegistrationService
.
update
(
null
,
updateWrapper
);
});
});
}
}
private
void
filledDataFromHistory
()
{
private
void
filledDataFromHistory
()
{
List
<
JgUseRegistration
>
useRegistrations
=
useRegistrationService
.
list
(
new
LambdaQueryWrapper
<
JgUseRegistration
>().
isNull
(
JgUseRegistration:
:
getSupervisionOrgCode
).
select
(
BaseEntity:
:
getSequenceNbr
));
List
<
JgUseRegistration
>
useRegistrations
=
useRegistrationService
.
list
(
new
LambdaQueryWrapper
<
JgUseRegistration
>().
isNull
(
JgUseRegistration:
:
getSupervisionOrgCode
).
select
(
BaseEntity:
:
getSequenceNbr
));
useRegistrations
.
parallelStream
().
forEach
(
u
->
{
useRegistrations
.
parallelStream
().
forEach
(
u
->
{
JgRegistrationHistory
history
=
getRegistrationHistory
(
u
.
getSequenceNbr
()
+
""
);
JgRegistrationHistory
history
=
getRegistrationHistory
(
u
.
getSequenceNbr
()
+
""
);
if
(
history
!=
null
)
{
if
(
history
!=
null
)
{
JSONObject
jsonObject
=
JSON
.
parseObject
(
history
.
getChangeData
());
JSONObject
jsonObject
=
JSON
.
parseObject
(
history
.
getChangeData
());
String
orgBranchCodeWithName
=
jsonObject
.
getString
(
"orgBranchCode"
);
String
orgBranchCodeWithName
=
jsonObject
.
getString
(
"orgBranchCode"
);
if
(
orgBranchCodeWithName
!=
null
&&
!
orgBranchCodeWithName
.
isEmpty
())
{
if
(
orgBranchCodeWithName
!=
null
&&
!
orgBranchCodeWithName
.
isEmpty
())
{
u
.
setSupervisionOrgCode
(
orgBranchCodeWithName
.
split
(
"_"
)[
0
]);
u
.
setSupervisionOrgCode
(
orgBranchCodeWithName
.
split
(
"_"
)[
0
]);
LambdaUpdateWrapper
<
JgUseRegistration
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
LambdaUpdateWrapper
<
JgUseRegistration
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
set
(
JgUseRegistration:
:
getSupervisionOrgCode
,
u
.
getSupervisionOrgCode
());
updateWrapper
.
set
(
JgUseRegistration:
:
getSupervisionOrgCode
,
u
.
getSupervisionOrgCode
());
...
@@ -530,7 +574,7 @@ public class DataHandlerServiceImpl {
...
@@ -530,7 +574,7 @@ public class DataHandlerServiceImpl {
// 1.安装告知完成但是设备状态未非已纳管状态:设备的idx_biz_jg_use_info表的IS_INTO_MANAGEMENT刷为已纳管, es的IS_INTO_MANAGEMENT刷为已纳管
// 1.安装告知完成但是设备状态未非已纳管状态:设备的idx_biz_jg_use_info表的IS_INTO_MANAGEMENT刷为已纳管, es的IS_INTO_MANAGEMENT刷为已纳管
List
<
JgInstallationNoticeEq
>
eqs
=
jgInstallationNoticeEqMapper
.
selectErrorRecordOfInIntoManage
();
List
<
JgInstallationNoticeEq
>
eqs
=
jgInstallationNoticeEqMapper
.
selectErrorRecordOfInIntoManage
();
log
.
info
(
"处理前统计:1.安装告知完成但是设备状态未非已纳管状态的设备数量:{}"
,
eqs
.
size
());
log
.
info
(
"处理前统计:1.安装告知完成但是设备状态未非已纳管状态的设备数量:{}"
,
eqs
.
size
());
for
(
JgInstallationNoticeEq
eq
:
eqs
)
{
for
(
JgInstallationNoticeEq
eq
:
eqs
)
{
// 使用信息表刷已纳管
// 使用信息表刷已纳管
useInfoService
.
lambdaUpdate
()
useInfoService
.
lambdaUpdate
()
.
set
(
IdxBizJgUseInfo:
:
getIsIntoManagement
,
true
)
.
set
(
IdxBizJgUseInfo:
:
getIsIntoManagement
,
true
)
...
@@ -539,8 +583,8 @@ public class DataHandlerServiceImpl {
...
@@ -539,8 +583,8 @@ public class DataHandlerServiceImpl {
// es刷已纳管
// es刷已纳管
Optional
<
ESEquipmentCategoryDto
>
equInfosWithEs
=
esEquipmentCategory
.
findById
(
eq
.
getEquId
());
Optional
<
ESEquipmentCategoryDto
>
equInfosWithEs
=
esEquipmentCategory
.
findById
(
eq
.
getEquId
());
equInfosWithEs
.
ifPresent
(
equInfoEs
->
{
equInfosWithEs
.
ifPresent
(
equInfoEs
->
{
equInfoEs
.
setIS_INTO_MANAGEMENT
(
true
);
equInfoEs
.
setIS_INTO_MANAGEMENT
(
true
);
esEquipmentCategory
.
save
(
equInfoEs
);
esEquipmentCategory
.
save
(
equInfoEs
);
});
});
}
}
// 2.安装告知非已作废,但是缺少装置id的数据处理:创建装置、写入安装告知表project_contraption_id、写入设备es的装置id,设备使用信息表的projectContraptionId
// 2.安装告知非已作废,但是缺少装置id的数据处理:创建装置、写入安装告知表project_contraption_id、写入设备es的装置id,设备使用信息表的projectContraptionId
...
@@ -548,14 +592,16 @@ public class DataHandlerServiceImpl {
...
@@ -548,14 +592,16 @@ public class DataHandlerServiceImpl {
log
.
info
(
"处理前统计:2.安装告知非已作废,但是缺少装置id安装告知单据数量:{}"
,
noticeList
.
size
());
log
.
info
(
"处理前统计:2.安装告知非已作废,但是缺少装置id安装告知单据数量:{}"
,
noticeList
.
size
());
List
<
IdxBizJgProjectContraption
>
projectContraptionList
=
new
ArrayList
<>();
List
<
IdxBizJgProjectContraption
>
projectContraptionList
=
new
ArrayList
<>();
Map
<
Long
,
List
<
String
>>
projectContraptionIdRecordsMap
=
new
HashMap
<>();
Map
<
Long
,
List
<
String
>>
projectContraptionIdRecordsMap
=
new
HashMap
<>();
for
(
JgInstallationNotice
installationNotice
:
noticeList
)
{
for
(
JgInstallationNotice
installationNotice
:
noticeList
)
{
List
<
JgInstallationNoticeEq
>
noticeEqs
=
installationNoticeEqService
.
list
(
new
LambdaQueryWrapper
<
JgInstallationNoticeEq
>().
eq
(
JgInstallationNoticeEq:
:
getEquipTransferId
,
installationNotice
.
getSequenceNbr
()).
select
(
JgInstallationNoticeEq:
:
getEquId
,
JgInstallationNoticeEq:
:
getInformNumber
));
List
<
JgInstallationNoticeEq
>
noticeEqs
=
installationNoticeEqService
.
list
(
new
LambdaQueryWrapper
<
JgInstallationNoticeEq
>().
eq
(
JgInstallationNoticeEq:
:
getEquipTransferId
,
installationNotice
.
getSequenceNbr
()).
select
(
JgInstallationNoticeEq:
:
getEquId
,
JgInstallationNoticeEq:
:
getInformNumber
));
if
(
noticeEqs
.
isEmpty
())
{
if
(
noticeEqs
.
isEmpty
())
{
continue
;
continue
;
}
}
List
<
String
>
records
=
noticeEqs
.
stream
().
map
(
JgInstallationNoticeEq:
:
getEquId
).
collect
(
Collectors
.
toList
());
List
<
String
>
records
=
noticeEqs
.
stream
().
map
(
JgInstallationNoticeEq:
:
getEquId
).
collect
(
Collectors
.
toList
());
List
<
IdxBizJgUseInfo
>
useInfos
=
useInfoService
.
lambdaQuery
().
in
(
IdxBizJgUseInfo:
:
getRecord
,
records
).
list
();
List
<
IdxBizJgUseInfo
>
useInfos
=
useInfoService
.
lambdaQuery
()
// 技术参数表
.
in
(
IdxBizJgUseInfo:
:
getRecord
,
records
)
.
list
();
//技术参数表
List
<
IdxBizJgTechParamsPipeline
>
idxBizJgTechParamsPipelines
=
useInfos
.
isEmpty
()
?
new
ArrayList
<>()
:
techParamsPipelineService
List
<
IdxBizJgTechParamsPipeline
>
idxBizJgTechParamsPipelines
=
useInfos
.
isEmpty
()
?
new
ArrayList
<>()
:
techParamsPipelineService
.
lambdaQuery
()
.
lambdaQuery
()
.
in
(
IdxBizJgTechParamsPipeline:
:
getRecord
,
records
)
.
in
(
IdxBizJgTechParamsPipeline:
:
getRecord
,
records
)
...
@@ -629,7 +675,7 @@ public class DataHandlerServiceImpl {
...
@@ -629,7 +675,7 @@ public class DataHandlerServiceImpl {
projectContraptionList
.
add
(
idxBizJgProjectContraption
);
projectContraptionList
.
add
(
idxBizJgProjectContraption
);
}
}
// 创建装置
// 创建装置
if
(!
projectContraptionList
.
isEmpty
())
{
if
(!
projectContraptionList
.
isEmpty
())
{
projectContraptionService
.
saveBatch
(
projectContraptionList
);
projectContraptionService
.
saveBatch
(
projectContraptionList
);
}
}
// 更新设备es的装置id、使用信息的装置id
// 更新设备es的装置id、使用信息的装置id
...
@@ -661,7 +707,7 @@ public class DataHandlerServiceImpl {
...
@@ -661,7 +707,7 @@ public class DataHandlerServiceImpl {
}
}
private
void
saveProjectConstructionAfterFinish
(
JgInstallationNotice
installationNotice
,
boolean
isFinish
,
List
<
JgInstallationNoticeEq
>
eqs
,
Long
sequenceNbr
,
List
<
String
>
records
)
{
private
void
saveProjectConstructionAfterFinish
(
JgInstallationNotice
installationNotice
,
boolean
isFinish
,
List
<
JgInstallationNoticeEq
>
eqs
,
Long
sequenceNbr
,
List
<
String
>
records
)
{
if
(
isFinish
)
{
if
(
isFinish
)
{
IdxBizJgProjectConstruction
idxBizJgProjectConstruction
=
new
IdxBizJgProjectConstruction
();
IdxBizJgProjectConstruction
idxBizJgProjectConstruction
=
new
IdxBizJgProjectConstruction
();
idxBizJgProjectConstruction
.
setUscUnitCreditCode
(
installationNotice
.
getInstallUnitCreditCode
());
idxBizJgProjectConstruction
.
setUscUnitCreditCode
(
installationNotice
.
getInstallUnitCreditCode
());
idxBizJgProjectConstruction
.
setUscUnitName
(
installationNotice
.
getInstallUnitName
());
idxBizJgProjectConstruction
.
setUscUnitName
(
installationNotice
.
getInstallUnitName
());
...
@@ -699,26 +745,29 @@ public class DataHandlerServiceImpl {
...
@@ -699,26 +745,29 @@ public class DataHandlerServiceImpl {
}
}
private
List
<
JgInstallationNotice
>
getErrorInstallNoticeData
()
{
private
List
<
JgInstallationNotice
>
getErrorInstallNoticeData
()
{
return
installationNoticeService
.
list
(
new
LambdaQueryWrapper
<
JgInstallationNotice
>().
ne
(
JgInstallationNotice:
:
getNoticeStatus
,
FlowStatusEnum
.
TO_BE_DISCARD
.
getCode
()).
ne
(
JgInstallationNotice:
:
getProjectContraption
,
""
).
isNull
(
JgInstallationNotice:
:
getProjectContraptionId
));
return
installationNoticeService
.
list
(
new
LambdaQueryWrapper
<
JgInstallationNotice
>()
.
ne
(
JgInstallationNotice:
:
getNoticeStatus
,
FlowStatusEnum
.
TO_BE_DISCARD
.
getCode
())
.
ne
(
JgInstallationNotice:
:
getProjectContraption
,
""
)
.
isNull
(
JgInstallationNotice:
:
getProjectContraptionId
));
}
}
/**
/**
* 刷使用登记缺少装置id的管道的登记数据:1.填充装置id;2.已完成状状态清除装置表的安装单位信息字段,补充使用信息字段
* 刷使用登记缺少装置id的管道的登记数据:1.填充装置id;2.已完成状状态清除装置表的安装单位信息字段,补充使用信息字段
*/
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
projectContraptionUseRegisterDataDeal
()
{
public
void
projectContraptionUseRegisterDataDeal
(){
// 查询使用登记:非作废状态 有装置名称但是缺少装置id的使用登记单据进行数据处理
// 查询使用登记:非作废状态 有装置名称但是缺少装置id的使用登记单据进行数据处理
List
<
JgUseRegistration
>
useRegistrations
=
getUseRegisterOfError
();
List
<
JgUseRegistration
>
useRegistrations
=
getUseRegisterOfError
();
log
.
info
(
"处理前统计:1.使用登记装置id历史数据填充,存在缺少装置id的单据数量:{}"
,
useRegistrations
.
size
());
log
.
info
(
"处理前统计:1.使用登记装置id历史数据填充,存在缺少装置id的单据数量:{}"
,
useRegistrations
.
size
());
// 循环按照使用登记的eq表关联安装告知eq表,在安装告知主表查询装置id
// 循环按照使用登记的eq表关联安装告知eq表,在安装告知主表查询装置id
for
(
JgUseRegistration
useRegistration
:
useRegistrations
)
{
for
(
JgUseRegistration
useRegistration
:
useRegistrations
)
{
// 登记的关联的告知单据【逻辑按照eq进行关联】
// 登记的关联的告知单据【逻辑按照eq进行关联】
JgInstallationNotice
installationNotice
=
installationNoticeService
.
getBaseMapper
().
selectNoticeDataByUseRegisterId
(
useRegistration
.
getSequenceNbr
()
+
""
);
JgInstallationNotice
installationNotice
=
installationNoticeService
.
getBaseMapper
().
selectNoticeDataByUseRegisterId
(
useRegistration
.
getSequenceNbr
()
+
""
);
if
(
installationNotice
!=
null
&&
StringUtils
.
isNotEmpty
(
installationNotice
.
getProjectContraptionId
()))
{
if
(
installationNotice
!=
null
&&
StringUtils
.
isNotEmpty
(
installationNotice
.
getProjectContraptionId
()))
{
// 0.填充装置id
// 0.填充装置id
useRegistration
.
setProjectContraptionId
(
installationNotice
.
getProjectContraptionId
());
useRegistration
.
setProjectContraptionId
(
installationNotice
.
getProjectContraptionId
());
// 1.已完成状状态清除装置表的安装单位信息字段,填充使用信息数据,创建装置检验信息表
// 1.已完成状状态清除装置表的安装单位信息字段,填充使用信息数据,创建装置检验信息表
if
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
().
equals
(
useRegistration
.
getStatus
()))
{
if
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
().
equals
(
useRegistration
.
getStatus
()))
{
updateProjectContraptionAfter
(
useRegistration
,
installationNotice
);
updateProjectContraptionAfter
(
useRegistration
,
installationNotice
);
// 创建装置检验流水信息
// 创建装置检验流水信息
createProjectInspectInfoAfter
(
useRegistration
);
createProjectInspectInfoAfter
(
useRegistration
);
...
@@ -737,11 +786,11 @@ public class DataHandlerServiceImpl {
...
@@ -737,11 +786,11 @@ public class DataHandlerServiceImpl {
private
void
updateProjectContraptionAfter
(
JgUseRegistration
useRegistration
,
JgInstallationNotice
installationNotice
)
{
private
void
updateProjectContraptionAfter
(
JgUseRegistration
useRegistration
,
JgInstallationNotice
installationNotice
)
{
// 特殊处理 将任意一个的 record 放入到remark字段
// 特殊处理 将任意一个的 record 放入到remark字段
IdxBizJgUseInfo
useInfo
=
getIdxBizJgUseInfo
(
installationNotice
.
getRemark
());
IdxBizJgUseInfo
useInfo
=
getIdxBizJgUseInfo
(
installationNotice
.
getRemark
());
if
(
useInfo
!=
null
)
{
if
(
useInfo
!=
null
)
{
LambdaUpdateWrapper
<
IdxBizJgProjectContraption
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
LambdaUpdateWrapper
<
IdxBizJgProjectContraption
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
BaseEntity:
:
getSequenceNbr
,
installationNotice
.
getProjectContraptionId
());
updateWrapper
.
eq
(
BaseEntity:
:
getSequenceNbr
,
installationNotice
.
getProjectContraptionId
());
updateWrapper
.
set
(
IdxBizJgProjectContraption:
:
getUscUnitCreditCode
,
null
);
updateWrapper
.
set
(
IdxBizJgProjectContraption:
:
getUscUnitCreditCode
,
null
);
updateWrapper
.
set
(
IdxBizJgProjectContraption:
:
getUscUnitName
,
null
);
updateWrapper
.
set
(
IdxBizJgProjectContraption:
:
getUscUnitName
,
null
);
updateWrapper
.
set
(
IdxBizJgProjectContraption:
:
getUseRegistrationCode
,
useRegistration
.
getUseRegistrationCode
());
updateWrapper
.
set
(
IdxBizJgProjectContraption:
:
getUseRegistrationCode
,
useRegistration
.
getUseRegistrationCode
());
updateWrapper
.
set
(
IdxBizJgProjectContraption:
:
getProvince
,
useInfo
.
getProvince
());
updateWrapper
.
set
(
IdxBizJgProjectContraption:
:
getProvince
,
useInfo
.
getProvince
());
updateWrapper
.
set
(
IdxBizJgProjectContraption:
:
getProvinceName
,
useInfo
.
getProvinceName
());
updateWrapper
.
set
(
IdxBizJgProjectContraption:
:
getProvinceName
,
useInfo
.
getProvinceName
());
...
@@ -759,12 +808,12 @@ public class DataHandlerServiceImpl {
...
@@ -759,12 +808,12 @@ public class DataHandlerServiceImpl {
private
void
createProjectInspectInfoAfter
(
JgUseRegistration
useRegistration
)
{
private
void
createProjectInspectInfoAfter
(
JgUseRegistration
useRegistration
)
{
JgRegistrationHistory
jgRegistrationHistory
=
getRegistrationHistory
(
useRegistration
.
getSequenceNbr
()
+
""
);
JgRegistrationHistory
jgRegistrationHistory
=
getRegistrationHistory
(
useRegistration
.
getSequenceNbr
()
+
""
);
if
(
jgRegistrationHistory
!=
null
)
{
if
(
jgRegistrationHistory
!=
null
)
{
JSONObject
mapData
=
JSONObject
.
parseObject
(
jgRegistrationHistory
.
getChangeData
());
JSONObject
mapData
=
JSONObject
.
parseObject
(
jgRegistrationHistory
.
getChangeData
());
IdxBizJgProjectInspection
inspectionDetectionInfo
=
new
IdxBizJgProjectInspection
();
IdxBizJgProjectInspection
inspectionDetectionInfo
=
new
IdxBizJgProjectInspection
();
BeanUtil
.
copyProperties
(
mapData
,
inspectionDetectionInfo
);
BeanUtil
.
copyProperties
(
mapData
,
inspectionDetectionInfo
);
// 兼容最早的老数据,管道的检验信息单独维护
// 兼容最早的老数据,管道的检验信息单独维护
if
(
inspectionDetectionInfo
.
getInspectConclusion
()
==
null
&&
mapData
.
containsKey
(
"equipmentLists"
))
{
if
(
inspectionDetectionInfo
.
getInspectConclusion
()
==
null
&&
mapData
.
containsKey
(
"equipmentLists"
))
{
List
<
Map
<
String
,
Object
>>
equipmentLists
=
null
;
List
<
Map
<
String
,
Object
>>
equipmentLists
=
null
;
try
{
try
{
equipmentLists
=
objectMapper
.
readValue
(
equipmentLists
=
objectMapper
.
readValue
(
...
@@ -772,7 +821,7 @@ public class DataHandlerServiceImpl {
...
@@ -772,7 +821,7 @@ public class DataHandlerServiceImpl {
new
TypeReference
<
ArrayList
<
Map
<
String
,
Object
>>>()
{
new
TypeReference
<
ArrayList
<
Map
<
String
,
Object
>>>()
{
}
}
);
);
if
(!
equipmentLists
.
isEmpty
())
{
if
(!
equipmentLists
.
isEmpty
())
{
Object
record
=
equipmentLists
.
get
(
0
).
get
(
"record"
);
Object
record
=
equipmentLists
.
get
(
0
).
get
(
"record"
);
IdxBizJgInspectionDetectionInfo
idxBizJgInspectionDetectionInfo
=
iIdxBizJgInspectionDetectionInfoService
.
queryNewestDetailByRecord
(
String
.
valueOf
(
record
));
IdxBizJgInspectionDetectionInfo
idxBizJgInspectionDetectionInfo
=
iIdxBizJgInspectionDetectionInfoService
.
queryNewestDetailByRecord
(
String
.
valueOf
(
record
));
BeanUtil
.
copyProperties
(
idxBizJgInspectionDetectionInfo
,
inspectionDetectionInfo
);
BeanUtil
.
copyProperties
(
idxBizJgInspectionDetectionInfo
,
inspectionDetectionInfo
);
...
@@ -798,11 +847,14 @@ public class DataHandlerServiceImpl {
...
@@ -798,11 +847,14 @@ public class DataHandlerServiceImpl {
/**
/**
* 查询非作废状态的装置名称不为空,装置id为空或者null的使用登记数据
* 查询非作废状态的装置名称不为空,装置id为空或者null的使用登记数据
*
* @return 符合条件列表
* @return 符合条件列表
*/
*/
private
List
<
JgUseRegistration
>
getUseRegisterOfError
()
{
private
List
<
JgUseRegistration
>
getUseRegisterOfError
()
{
return
useRegistrationService
.
getBaseMapper
().
selectList
(
new
LambdaQueryWrapper
<
JgUseRegistration
>().
ne
(
JgUseRegistration:
:
getStatus
,
FlowStatusEnum
.
TO_BE_DISCARD
.
getName
()).
ne
(
JgUseRegistration:
:
getProjectContraption
,
""
).
isNull
(
JgUseRegistration:
:
getProjectContraptionId
).
select
(
BaseEntity:
:
getSequenceNbr
,
JgUseRegistration:
:
getProjectContraption
,
JgUseRegistration:
:
getUseRegistrationCode
,
JgUseRegistration:
:
getStatus
,
JgUseRegistration:
:
getAuditPassDate
));
return
useRegistrationService
.
getBaseMapper
().
selectList
(
new
LambdaQueryWrapper
<
JgUseRegistration
>()
.
ne
(
JgUseRegistration:
:
getStatus
,
FlowStatusEnum
.
TO_BE_DISCARD
.
getName
())
.
ne
(
JgUseRegistration:
:
getProjectContraption
,
""
)
.
isNull
(
JgUseRegistration:
:
getProjectContraptionId
)
.
select
(
BaseEntity:
:
getSequenceNbr
,
JgUseRegistration:
:
getProjectContraption
,
JgUseRegistration:
:
getUseRegistrationCode
,
JgUseRegistration:
:
getStatus
,
JgUseRegistration:
:
getAuditPassDate
));
}
}
/**
/**
...
@@ -812,7 +864,7 @@ public class DataHandlerServiceImpl {
...
@@ -812,7 +864,7 @@ public class DataHandlerServiceImpl {
public
void
projectContraptionInfoUpdateV2
()
{
public
void
projectContraptionInfoUpdateV2
()
{
List
<
IdxBizJgProjectContraption
>
projectConstructions
=
idxBizJgProjectContraptionMapper
.
selectErrorManagementProject
();
List
<
IdxBizJgProjectContraption
>
projectConstructions
=
idxBizJgProjectContraptionMapper
.
selectErrorManagementProject
();
log
.
info
(
"处理前:安装告知审批完成但是装置是否纳管状态不正确的数据量:{}"
,
projectConstructions
.
size
());
log
.
info
(
"处理前:安装告知审批完成但是装置是否纳管状态不正确的数据量:{}"
,
projectConstructions
.
size
());
projectConstructions
.
parallelStream
().
forEach
(
p
->
{
projectConstructions
.
parallelStream
().
forEach
(
p
->
{
LambdaUpdateWrapper
<
IdxBizJgProjectContraption
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
LambdaUpdateWrapper
<
IdxBizJgProjectContraption
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
BaseEntity:
:
getSequenceNbr
,
p
.
getSequenceNbr
());
updateWrapper
.
eq
(
BaseEntity:
:
getSequenceNbr
,
p
.
getSequenceNbr
());
updateWrapper
.
set
(
IdxBizJgProjectContraption:
:
getUscUnitName
,
p
.
getUscUnitName
());
updateWrapper
.
set
(
IdxBizJgProjectContraption:
:
getUscUnitName
,
p
.
getUscUnitName
());
...
@@ -831,7 +883,7 @@ public class DataHandlerServiceImpl {
...
@@ -831,7 +883,7 @@ public class DataHandlerServiceImpl {
public
void
projectUseInfoUpdateV3
()
{
public
void
projectUseInfoUpdateV3
()
{
List
<
JgInstallationNoticeEq
>
eqs
=
jgInstallationNoticeEqMapper
.
selectPCIdNeErrorPieLineInUseInfo
();
List
<
JgInstallationNoticeEq
>
eqs
=
jgInstallationNoticeEqMapper
.
selectPCIdNeErrorPieLineInUseInfo
();
log
.
info
(
"处理前:查询安装告知(非删除、已作废)的装置id和设备的使用信息装置id不一样的设备:{}"
,
eqs
.
size
());
log
.
info
(
"处理前:查询安装告知(非删除、已作废)的装置id和设备的使用信息装置id不一样的设备:{}"
,
eqs
.
size
());
eqs
.
forEach
(
eq
->
{
eqs
.
forEach
(
eq
->
{
Optional
<
ESEquipmentCategoryDto
>
equInfosWithEs
=
esEquipmentCategory
.
findById
(
eq
.
getEquId
());
Optional
<
ESEquipmentCategoryDto
>
equInfosWithEs
=
esEquipmentCategory
.
findById
(
eq
.
getEquId
());
equInfosWithEs
.
ifPresent
(
equInfoEs
->
{
equInfosWithEs
.
ifPresent
(
equInfoEs
->
{
if
(
StringUtils
.
isNotEmpty
(
equInfoEs
.
getProjectContraptionId
())){
if
(
StringUtils
.
isNotEmpty
(
equInfoEs
.
getProjectContraptionId
())){
...
@@ -853,9 +905,11 @@ public class DataHandlerServiceImpl {
...
@@ -853,9 +905,11 @@ public class DataHandlerServiceImpl {
// 1220上线时, 已完成安装告知管道未写入装置的施工信息表的告知单据查询
// 1220上线时, 已完成安装告知管道未写入装置的施工信息表的告知单据查询
List
<
JgInstallationNotice
>
noticeList
=
getNotInsertProjectConstructionInstallNotice
();
List
<
JgInstallationNotice
>
noticeList
=
getNotInsertProjectConstructionInstallNotice
();
log
.
info
(
"处理前统计:1.管道已完成安装告知,但是未写入装置的施工信息表的告知单据数量:{}"
,
noticeList
.
size
());
log
.
info
(
"处理前统计:1.管道已完成安装告知,但是未写入装置的施工信息表的告知单据数量:{}"
,
noticeList
.
size
());
for
(
JgInstallationNotice
installationNotice
:
noticeList
)
{
for
(
JgInstallationNotice
installationNotice
:
noticeList
){
List
<
JgInstallationNoticeEq
>
noticeEqs
=
installationNoticeEqService
.
list
(
new
LambdaQueryWrapper
<
JgInstallationNoticeEq
>().
eq
(
JgInstallationNoticeEq:
:
getEquipTransferId
,
installationNotice
.
getSequenceNbr
()).
select
(
JgInstallationNoticeEq:
:
getEquId
));
List
<
JgInstallationNoticeEq
>
noticeEqs
=
installationNoticeEqService
.
list
(
new
LambdaQueryWrapper
<
JgInstallationNoticeEq
>()
if
(
noticeEqs
.
isEmpty
())
{
.
eq
(
JgInstallationNoticeEq:
:
getEquipTransferId
,
installationNotice
.
getSequenceNbr
()).
select
(
JgInstallationNoticeEq:
:
getEquId
));
if
(
noticeEqs
.
isEmpty
()){
continue
;
continue
;
}
}
List
<
String
>
records
=
noticeEqs
.
stream
().
map
(
JgInstallationNoticeEq:
:
getEquId
).
collect
(
Collectors
.
toList
());
List
<
String
>
records
=
noticeEqs
.
stream
().
map
(
JgInstallationNoticeEq:
:
getEquId
).
collect
(
Collectors
.
toList
());
...
@@ -879,7 +933,7 @@ public class DataHandlerServiceImpl {
...
@@ -879,7 +933,7 @@ public class DataHandlerServiceImpl {
public
void
projectUseInfoUpdateV4
()
{
public
void
projectUseInfoUpdateV4
()
{
List
<
PieLineEquipContraptionDto
>
eqs
=
jgInstallationNoticeEqMapper
.
selectPCIdNeErrorPieLineInUseInfo2
();
List
<
PieLineEquipContraptionDto
>
eqs
=
jgInstallationNoticeEqMapper
.
selectPCIdNeErrorPieLineInUseInfo2
();
log
.
info
(
"处理前:查询管道的装置id与安装告知的装置id的不一样管道设备:{}"
,
eqs
.
size
());
log
.
info
(
"处理前:查询管道的装置id与安装告知的装置id的不一样管道设备:{}"
,
eqs
.
size
());
eqs
.
forEach
(
eq
->
{
eqs
.
forEach
(
eq
->
{
// 1.已安装告知单据为准更新es
// 1.已安装告知单据为准更新es
Optional
<
ESEquipmentCategoryDto
>
equInfosWithEs
=
esEquipmentCategory
.
findById
(
eq
.
getRecord
());
Optional
<
ESEquipmentCategoryDto
>
equInfosWithEs
=
esEquipmentCategory
.
findById
(
eq
.
getRecord
());
equInfosWithEs
.
ifPresent
(
equInfoEs
->
{
equInfosWithEs
.
ifPresent
(
equInfoEs
->
{
...
@@ -905,9 +959,11 @@ public class DataHandlerServiceImpl {
...
@@ -905,9 +959,11 @@ public class DataHandlerServiceImpl {
public
void
projectUseInfoUpdateV5
()
{
public
void
projectUseInfoUpdateV5
()
{
List
<
PieLineEquipContraptionDto
>
eqs
=
jgInstallationNoticeEqMapper
.
selectPCIdNeErrorPieLineInUseInfo3
();
List
<
PieLineEquipContraptionDto
>
eqs
=
jgInstallationNoticeEqMapper
.
selectPCIdNeErrorPieLineInUseInfo3
();
log
.
info
(
"处理前:一个管道在多个安装告知里,安装告知的装置id的不一样管道设备:{}"
,
eqs
.
size
());
log
.
info
(
"处理前:一个管道在多个安装告知里,安装告知的装置id的不一样管道设备:{}"
,
eqs
.
size
());
eqs
.
forEach
(
eq
->
{
eqs
.
forEach
(
eq
->
{
JgInstallationNoticeEqDto
jgInstallationNoticeEqDto
=
jgInstallationNoticeEqMapper
.
selectLatestNoticeByRecord
(
eq
.
getRecord
());
JgInstallationNoticeEqDto
jgInstallationNoticeEqDto
=
jgInstallationNoticeEqMapper
.
selectLatestNoticeByRecord
(
eq
.
getRecord
());
JgInstallationNotice
jgInstallationNotice
=
jgInstallationNoticeMapper
.
selectOne
(
new
LambdaQueryWrapper
<
JgInstallationNotice
>().
eq
(
BaseEntity:
:
getSequenceNbr
,
jgInstallationNoticeEqDto
.
getEquipTransferId
()).
select
(
JgInstallationNotice:
:
getProjectContraptionId
,
JgInstallationNotice:
:
getProjectContraption
));
JgInstallationNotice
jgInstallationNotice
=
jgInstallationNoticeMapper
.
selectOne
(
new
LambdaQueryWrapper
<
JgInstallationNotice
>()
.
eq
(
BaseEntity:
:
getSequenceNbr
,
jgInstallationNoticeEqDto
.
getEquipTransferId
())
.
select
(
JgInstallationNotice:
:
getProjectContraptionId
,
JgInstallationNotice:
:
getProjectContraption
));
// 1.已安装告知单据为准更新es
// 1.已安装告知单据为准更新es
Optional
<
ESEquipmentCategoryDto
>
equInfosWithEs
=
esEquipmentCategory
.
findById
(
eq
.
getRecord
());
Optional
<
ESEquipmentCategoryDto
>
equInfosWithEs
=
esEquipmentCategory
.
findById
(
eq
.
getRecord
());
equInfosWithEs
.
ifPresent
(
equInfoEs
->
{
equInfosWithEs
.
ifPresent
(
equInfoEs
->
{
...
...
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