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
621ac8ae
Commit
621ac8ae
authored
Jan 20, 2025
by
Lambertliu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jg):管道使用登记功能监管码生成规则修改
parent
f6c1e8fc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
44 deletions
+56
-44
DataHandlerServiceImpl.java
...ot/module/jg/biz/service/impl/DataHandlerServiceImpl.java
+1
-0
IdxBizJgProjectContraptionServiceImpl.java
...z/service/impl/IdxBizJgProjectContraptionServiceImpl.java
+13
-8
JgUseRegistrationServiceImpl.java
...ule/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
+42
-36
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 @
621ac8ae
...
...
@@ -964,6 +964,7 @@ public class DataHandlerServiceImpl {
List
<
JgUseRegistration
>
useRegistrations
=
useRegistrationService
.
list
(
new
LambdaQueryWrapper
<
JgUseRegistration
>()
.
isNotNull
(
JgUseRegistration:
:
getProjectContraptionId
)
.
isNull
(
JgUseRegistration:
:
getOriginProjectContraptionIds
)
.
select
(
BaseEntity:
:
getSequenceNbr
,
JgUseRegistration:
:
getProjectContraptionId
)
);
...
...
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/IdxBizJgProjectContraptionServiceImpl.java
View file @
621ac8ae
...
...
@@ -11,6 +11,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.yeejoin.amos.boot.biz.common.bo.CompanyBo
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.entity.DataDictionary
;
import
com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl
;
import
com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory
;
import
com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.api.enums.EquipSourceEnum
;
...
...
@@ -108,6 +110,8 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
private
IdxBizJgConstructionInfoServiceImpl
idxBizJgConstructionInfoService
;
@Autowired
private
ESEquipmentCategory
esEquipmentCategory
;
@Autowired
private
DataDictionaryServiceImpl
dataDictionaryServiceImpl
;
@Override
public
boolean
saveOrUpdateData
(
IdxBizJgProjectContraption
projectContraption
)
{
...
...
@@ -598,13 +602,13 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
}
public
Map
<
String
,
Object
>
getNewInspectionDetailByRecord
(
String
record
)
{
// 检验检测【一对多,暂时只取最新一条数据】
IdxBizJgInspectionDetectionInfo
inspectionDetectionInfo
=
detectionInfoService
.
queryNewestDetailByRecord
(
record
);
Map
<
String
,
Object
>
inspectionDetectionInfoMap
=
Collections
.
emptyMap
(
);
if
(!
ValidationUtil
.
isEmpty
(
inspectionDetectionInfo
))
{
inspectionDetectionInfoMap
=
Bean
.
BeantoMap
(
inspectionDetectionInfo
);
inspectionDetectionInfoMap
.
put
(
"inspectReport"
,
JSON
.
parseArray
(
inspectionDetectionInfo
.
getInspectReport
()));
}
return
inspectionDetectionInfoMap
;
IdxBizJgInspectionDetectionInfo
info
=
detectionInfoService
.
queryNewestDetailByRecord
(
record
);
if
(
info
==
null
)
return
Collections
.
emptyMap
(
);
Map
<
String
,
Object
>
result
=
new
HashMap
<>(
Bean
.
BeantoMap
(
info
)
);
result
.
put
(
"inspectReport"
,
JSON
.
parseArray
(
info
.
getInspectReport
()));
result
.
put
(
"inspectConclusionCode"
,
info
.
getInspectConclusion
()
);
result
.
put
(
"inspectConclusion"
,
Optional
.
ofNullable
(
dataDictionaryServiceImpl
.
getByCode
(
info
.
getInspectConclusion
(),
"JYJL"
))
.
map
(
DataDictionary:
:
getName
).
orElse
(
""
));
return
result
;
}
}
\ No newline at end of file
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/JgUseRegistrationServiceImpl.java
View file @
621ac8ae
...
...
@@ -394,7 +394,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}
// 更新设备使用登记证
idxBizJgRegisterInfoMapper
.
updateUseOrgCodeByEquip
(
String
.
valueOf
(
map
.
get
(
"equipId"
)),
flag
?
useRegistrationCode
:
useOrgCode
);
// 生成监管码、96333码
// 生成监管码、96333码
(管道合并到有证不生成)
createCode
(
map
,
jgUseRegistration
,
registerInfo
,
useInfo
,
otherInfo
);
}
...
...
@@ -1030,6 +1030,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
String
useRegistrationCode
=
null
;
Long
useRegistrationManageSeq
=
null
;
Boolean
flag
=
Boolean
.
FALSE
;
boolean
isMerge
=
Boolean
.
FALSE
;
String
equCategoryCode
=
String
.
valueOf
(
mapData
.
get
(
"EQU_CATEGORY_CODE"
));
String
equDefineCode
=
String
.
valueOf
(
mapData
.
get
(
"EQU_DEFINE_CODE"
));
if
(
mapData
.
containsKey
(
"equipmentLists"
)
&&
!
ObjectUtils
.
isEmpty
(
mapData
.
get
(
"equipmentLists"
)))
{
...
...
@@ -1057,10 +1058,15 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
&&
Objects
.
nonNull
(
jgUseRegistration
.
getUseRegistrationCode
()))
{
useRegistrationCode
=
jgUseRegistration
.
getUseRegistrationCode
();
flag
=
true
;
isMerge
=
true
;
}
List
<
Map
<
String
,
Object
>>
equipmentLists
=
(
List
<
Map
<
String
,
Object
>>)
mapData
.
get
(
"equipmentLists"
);
// String inspectConclusionName = getInspectConclusionName(mapData);
IdxBizJgProjectContraption
jgProjectContraption
=
null
;
if
(!
StringUtils
.
isEmpty
(
jgUseRegistration
.
getProjectContraptionId
()))
{
jgProjectContraption
=
jgProjectContraptionService
.
getById
(
jgUseRegistration
.
getProjectContraptionId
());
}
if
(!
CollectionUtils
.
isEmpty
(
equipmentLists
))
{
for
(
int
i
=
0
;
i
<
equipmentLists
.
size
();
i
++)
{
Map
<
String
,
Object
>
equipment
=
equipmentLists
.
get
(
i
);
...
...
@@ -1072,13 +1078,21 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
LambdaQueryWrapper
<
IdxBizJgRegisterInfo
>
lambdaReg
=
new
QueryWrapper
<
IdxBizJgRegisterInfo
>().
lambda
();
lambdaReg
.
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
equId
);
IdxBizJgRegisterInfo
registerInfo
=
idxBizJgRegisterInfoMapper
.
selectOne
(
lambdaReg
);
// 其他信息
LambdaQueryWrapper
<
IdxBizJgOtherInfo
>
lambdaOth
=
new
QueryWrapper
<
IdxBizJgOtherInfo
>().
lambda
();
lambdaOth
.
eq
(
IdxBizJgOtherInfo:
:
getRecord
,
String
.
valueOf
(
mapData
.
get
(
"equipId"
)));
IdxBizJgOtherInfo
otherInfo
=
otherInfoMapper
.
selectOne
(
lambdaOth
);
if
(
isMerge
&&
jgProjectContraption
!=
null
)
{
otherInfo
.
setSupervisoryCode
(
jgProjectContraption
.
getSupervisoryCode
());
registerInfo
.
setEquCode
(
jgProjectContraption
.
getEquCode
());
}
// 压力管道:[更新的原始引用]更新检验日期-nextInspectDate、检验结论-inspectConclusion、检验机构名称-inspectOrgName
// equipment.put("nextInspectDate", mapData.getOrDefault("nextInspectDate", ""));
// equipment.put("inspectOrgName", mapData.getOrDefault("inspectOrgName", ""));
// equipment.put("inspectConclusion", inspectConclusionName);
// 更新设备信息 && 生成使用登记证编号 && 同步es
processMapData
(
sequenceNbr
,
mapData
,
jgUseRegistration
,
jgRegistrationHistory
,
registerInfo
,
taskV2Model
,
jsonObject
,
flag
,
useRegistrationCod
e
);
processMapData
(
sequenceNbr
,
mapData
,
jgUseRegistration
,
jgRegistrationHistory
,
registerInfo
,
otherInfo
,
taskV2Model
,
jsonObject
,
flag
,
useRegistrationCode
,
isMerg
e
);
// 查询设备制造信息
LambdaQueryWrapper
<
IdxBizJgFactoryInfo
>
factoryInfoWrapper
=
new
LambdaQueryWrapper
<>();
factoryInfoWrapper
.
eq
(
IdxBizJgFactoryInfo:
:
getRecord
,
equId
);
...
...
@@ -1107,16 +1121,15 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
jgRegistrationHistory
.
setChangeData
(
JSON
.
toJSONString
(
mapData
));
jgRegistrationHistoryService
.
updateById
(
jgRegistrationHistory
);
// 装置表写入使用登记证编号、将装置名称写入到使用登记表
updateRegAndProjectContraption
(
jgUseRegistration
,
mapData
);
updateRegAndProjectContraption
(
jgUseRegistration
,
mapData
,
jgProjectContraption
);
}
this
.
getBaseMapper
().
updateById
(
jgUseRegistration
);
commonServiceImpl
.
saveExecuteFlowData2Redis
(
jgUseRegistration
.
getInstanceId
(),
this
.
buildInstanceRuntimeData
(
jgUseRegistration
));
}
private
void
updateRegAndProjectContraption
(
JgUseRegistration
jgUseRegistration
,
JSONObject
mapData
)
{
private
void
updateRegAndProjectContraption
(
JgUseRegistration
jgUseRegistration
,
JSONObject
mapData
,
IdxBizJgProjectContraption
jgProjectContraption
)
{
//总工程装置
if
(!
StringUtils
.
isEmpty
(
jgUseRegistration
.
getProjectContraptionId
())){
IdxBizJgProjectContraption
jgProjectContraption
=
jgProjectContraptionService
.
getById
(
jgUseRegistration
.
getProjectContraptionId
());
if
(!
StringUtils
.
isEmpty
(
jgProjectContraption
)){
jgUseRegistration
.
setProjectContraption
(
jgProjectContraption
.
getProjectContraption
());
jgProjectContraption
.
setUseRegistrationCode
(
jgUseRegistration
.
getUseRegistrationCode
());
jgProjectContraption
.
setUseDate
(
String
.
valueOf
(
mapData
.
get
(
"useDate"
)));
...
...
@@ -1136,40 +1149,35 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
jgProjectContraption
.
setStartLatitudeLongitude
(
String
.
valueOf
(
mapData
.
get
(
"startLatitudeLongitude"
)));
jgProjectContraption
.
setEndLatitudeLongitude
(
String
.
valueOf
(
mapData
.
get
(
"endLatitudeLongitude"
)));
//装置进行合并
if
(!
jgUseRegistration
.
getOriginProjectContraptionIds
().
contains
(
jgUseRegistration
.
getProjectContraptionId
())){
//
1.修改所有原始工程id集合下的use_info表中的工程装置Id为总工程装置
ID
List
<
IdxBizJgUseInfo
>
useInfoList
=
idxBizJgUseInfoService
.
lambdaQuery
()
if
(!
jgUseRegistration
.
getOriginProjectContraptionIds
().
contains
(
jgUseRegistration
.
getProjectContraptionId
()))
{
//
1. 修改 use_info 表中的工程装置
ID
List
<
IdxBizJgUseInfo
>
useInfoList
=
idxBizJgUseInfoService
.
lambdaQuery
()
.
in
(
IdxBizJgUseInfo:
:
getProjectContraptionId
,
jgUseRegistration
.
getOriginProjectContraptionIds
())
.
list
();
for
(
IdxBizJgUseInfo
useInfo
:
useInfoList
)
{
Optional
<
ESEquipmentCategoryDto
>
equInfosWithEs
=
esEquipmentCategory
.
findById
(
useInfo
.
getRecord
());
e
quInfosWithEs
.
ifPresent
(
equInfoEs
->
{
useInfoList
.
forEach
(
useInfo
->
{
e
sEquipmentCategory
.
findById
(
useInfo
.
getRecord
())
.
ifPresent
(
equInfoEs
->
{
if
(
PipelineEnum
.
INDUSTRIAL_PIPELINE
.
getCode
().
equals
(
equInfoEs
.
getEQU_CATEGORY_CODE
()))
{
equInfoEs
.
setProjectContraptionId
(
useInfo
.
getProjectContraptionId
());
equInfoEs
.
setProjectContraptionId
(
jgUseRegistration
.
getProjectContraptionId
());
esEquipmentCategory
.
save
(
equInfoEs
);
}
});
useInfo
.
setProjectContraptionId
(
jgUseRegistration
.
getProjectContraptionId
());
useInfoMapper
.
updateById
(
useInfo
);
}
//2.修改原始工程装置表中的父级工程装置为总工程装置ID
List
<
IdxBizJgProjectContraption
>
projectContraptionList
=
jgProjectContraptionService
.
lambdaQuery
()
});
// 2. 修改原始工程装置表的父级工程装置 ID
List
<
IdxBizJgProjectContraption
>
originProjectContraptionList
=
jgProjectContraptionService
.
lambdaQuery
()
.
in
(
BaseEntity:
:
getSequenceNbr
,
jgUseRegistration
.
getOriginProjectContraptionIds
())
.
list
();
for
(
IdxBizJgProjectContraption
contraption
:
projectContraptionList
)
{
originProjectContraptionList
.
forEach
(
contraption
->
{
contraption
.
setProjectContraptionParentId
(
jgUseRegistration
.
getProjectContraptionId
());
jgProjectContraptionService
.
updateById
(
contraption
);
}
//计算合并后总长度
double
totalPipelineLength
=
Stream
.
concat
(
projectContraptionList
.
stream
()
.
map
(
IdxBizJgProjectContraption:
:
getPipelineLength
),
Stream
.
of
(
jgProjectContraption
.
getPipelineLength
()))
.
filter
(
Objects:
:
nonNull
)
.
mapToDouble
(
Double:
:
doubleValue
)
.
sum
();
jgProjectContraption
.
setPipelineLength
(
totalPipelineLength
);
});
jgProjectContraption
.
setPipelineLength
((
Double
.
parseDouble
((
String
)
mapData
.
get
(
"pipelineLength"
))));
}
// 更新 jgProjectContraption 数据
jgProjectContraptionService
.
updateById
(
jgProjectContraption
);
}
}
...
...
@@ -1453,11 +1461,15 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
LambdaQueryWrapper
<
IdxBizJgRegisterInfo
>
lambdaReg
=
new
QueryWrapper
<
IdxBizJgRegisterInfo
>().
lambda
();
lambdaReg
.
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
equId
);
IdxBizJgRegisterInfo
registerInfo
=
idxBizJgRegisterInfoMapper
.
selectOne
(
lambdaReg
);
// 其他信息
LambdaQueryWrapper
<
IdxBizJgOtherInfo
>
lambdaOth
=
new
QueryWrapper
<
IdxBizJgOtherInfo
>().
lambda
();
lambdaOth
.
eq
(
IdxBizJgOtherInfo:
:
getRecord
,
String
.
valueOf
(
mapData
.
get
(
"equipId"
)));
IdxBizJgOtherInfo
otherInfo
=
otherInfoMapper
.
selectOne
(
lambdaOth
);
// 更新代办
TaskV2Model
taskV2Model
=
updateAgency
(
jgUseRegistration
);
processMapData
(
sequenceNbr
,
mapData
,
jgUseRegistration
,
jgRegistrationHistory
,
registerInfo
,
taskV2Model
,
jsonObject
,
Boolean
.
FALSE
,
null
);
processMapData
(
sequenceNbr
,
mapData
,
jgUseRegistration
,
jgRegistrationHistory
,
registerInfo
,
otherInfo
,
taskV2Model
,
jsonObject
,
Boolean
.
FALSE
,
null
,
Boolean
.
FALSE
);
// 生成证书管理表记录
generateRegistrationManage
(
jgUseRegistration
,
registerInfo
,
Boolean
.
FALSE
,
null
);
...
...
@@ -1483,12 +1495,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}
private
void
processMapData
(
Long
sequenceNbr
,
JSONObject
mapData
,
JgUseRegistration
jgUseRegistration
,
JgRegistrationHistory
jgRegistrationHistory
,
IdxBizJgRegisterInfo
registerInfo
,
TaskV2Model
taskV2Model
,
JSONObject
jsonObject
,
Boolean
flag
,
String
useRegistrationCode
)
{
// 其他信息
LambdaQueryWrapper
<
IdxBizJgOtherInfo
>
lambdaOth
=
new
QueryWrapper
<
IdxBizJgOtherInfo
>().
lambda
();
lambdaOth
.
eq
(
IdxBizJgOtherInfo:
:
getRecord
,
String
.
valueOf
(
mapData
.
get
(
"equipId"
)));
IdxBizJgOtherInfo
otherInfo
=
otherInfoMapper
.
selectOne
(
lambdaOth
);
JgRegistrationHistory
jgRegistrationHistory
,
IdxBizJgRegisterInfo
registerInfo
,
IdxBizJgOtherInfo
otherInfo
,
TaskV2Model
taskV2Model
,
JSONObject
jsonObject
,
Boolean
flag
,
String
useRegistrationCode
,
Boolean
isMerge
)
{
jgUseRegistration
.
setSupervisoryCode
(
otherInfo
.
getSupervisoryCode
());
// 更新设备信息
...
...
@@ -2855,13 +2863,11 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 1.更新为已作废
JgUseRegistration
jgUseRegistration
=
this
.
getById
(
sequenceNbr
);
String
oldStatus
=
jgUseRegistration
.
getStatus
();
jgUseRegistration
.
setStatus
(
FlowStatusEnum
.
TO_BE_DISCARD
.
getName
());
jgUseRegistration
.
setCancelReason
(
cancelReason
);
jgUseRegistration
.
setCancelDate
(
new
Date
());
jgUseRegistration
.
setCancelUserId
(
RequestContext
.
getExeUserId
());
jgUseRegistration
.
setNextExecuteUserIds
(
""
);
jgUseRegistration
.
setPromoter
(
""
);
this
.
updateById
(
jgUseRegistration
);
List
<
JgUseRegistrationEq
>
eqList
=
getJgUseRegistrationEqs
(
jgUseRegistration
);
List
<
String
>
records
=
eqList
.
stream
().
map
(
JgUseRegistrationEq:
:
getEquId
).
collect
(
Collectors
.
toList
());
//判断是否为批量导入数据,作废后删除设备信息
...
...
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