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
88d4a185
Commit
88d4a185
authored
Jan 12, 2026
by
tianbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(jg): 新增工业管道设备报废注销功能支持
- 扩展报废注销逻辑支持工业管道设备类型 - 流程中实时查询气瓶和观点设备列表 - 报废管道后重新计算管道长度
parent
96de99d3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
6 deletions
+75
-6
JgScrapCancelServiceImpl.java
.../module/jg/biz/service/impl/JgScrapCancelServiceImpl.java
+75
-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/service/impl/JgScrapCancelServiceImpl.java
View file @
88d4a185
...
...
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.google.common.collect.Lists
;
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.entity.BaseEntity
;
...
...
@@ -16,16 +17,15 @@ import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil
;
import
com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory
;
import
com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.common.api.enums.CylinderTypeEnum
;
import
com.yeejoin.amos.boot.module.common.api.service.ICompensateFlowDataOfRedis
;
import
com.yeejoin.amos.boot.module.common.biz.refresh.DataRefreshEvent
;
import
com.yeejoin.amos.boot.module.jg.api.dto.*
;
import
com.yeejoin.amos.boot.module.jg.api.entity.*
;
import
com.yeejoin.amos.boot.module.jg.api.enums.*
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgRegistrationHistoryMapper
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgScrapCancelEqMapper
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgScrapCancelMapper
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationManageMapper
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.*
;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgScrapCancelService
;
import
com.yeejoin.amos.boot.module.jg.api.vo.SortVo
;
import
com.yeejoin.amos.boot.module.jg.api.vo.tableDataExportVo.ScrapCancelVo
;
...
...
@@ -34,6 +34,7 @@ import com.yeejoin.amos.boot.module.jg.biz.context.EquipUsedCheckStrategyContext
import
com.yeejoin.amos.boot.module.jg.biz.context.FlowingEquipRedisContext
;
import
com.yeejoin.amos.boot.module.jg.biz.edit.permission.FillingEditPermForCurrentUser
;
import
com.yeejoin.amos.boot.module.jg.biz.edit.process.equip.PieLineDataChangeServiceImpl
;
import
com.yeejoin.amos.boot.module.jg.biz.edit.utils.JsonDiffUtil
;
import
com.yeejoin.amos.boot.module.jg.biz.event.publisher.EventPublisher
;
import
com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgProjectContraptionDto
;
...
...
@@ -129,6 +130,14 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
@Autowired
private
PieLineDataChangeServiceImpl
pipelineDataChangeService
;
@Autowired
private
JgEnableDisableServiceImpl
jgEnableDisableService
;
@Autowired
private
JgEnableDisableMapper
jgEnableDisableMapper
;
@Autowired
private
ESEquipmentCategory
esEquipmentCategory
;
/**
* 移装移装注销/报废注销判断
...
...
@@ -708,6 +717,16 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
jgScrapCancelEq
.
setEquCode
(
equip
.
get
(
"EQU_CODE"
)
!=
null
?
equip
.
get
(
"EQU_CODE"
).
toString
()
:
""
);
JgScrapCancelEqList
.
add
(
jgScrapCancelEq
);
}
}
else
if
(
EquipmentClassifityEnum
.
YLGD
.
getCode
().
equals
(
pageData
.
get
(
"equListCode"
)))
{
List
<
Map
<
String
,
Object
>>
list
=
(
List
<
Map
<
String
,
Object
>>)
pageData
.
get
(
"equipments"
);
for
(
Map
<
String
,
Object
>
equip
:
list
)
{
JgScrapCancelEq
jgScrapCancelEq
=
new
JgScrapCancelEq
();
jgScrapCancelEq
.
setEquId
(
MapUtil
.
getStr
(
equip
,
"record"
));
jgScrapCancelEq
.
setUseRegistrationCode
(
MapUtil
.
getStr
(
equip
,
"useOrgCode"
));
jgScrapCancelEq
.
setEquipTransferId
(
String
.
valueOf
(
jgScrapCancel
.
getSequenceNbr
()));
jgScrapCancelEq
.
setEquCode
(
MapUtil
.
getStr
(
equip
,
"equCode"
));
JgScrapCancelEqList
.
add
(
jgScrapCancelEq
);
}
}
else
{
List
<
Map
<
String
,
Object
>>
certificates
;
// 证列表
...
...
@@ -828,9 +847,10 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
JgRegistrationHistory
jgRegistrationHistory
=
jgRegistrationHistoryMapper
.
selectOne
(
new
LambdaQueryWrapper
<
JgRegistrationHistory
>()
.
eq
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
sequenceNbr
)
.
eq
(
JgRegistrationHistory:
:
getIsDelete
,
false
));
// 根据不同类型返回不同的字段、用于台套设备、气瓶、车用气瓶
if
(
jgRegistrationHistory
!=
null
)
{
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
jgRegistrationHistory
.
getChangeData
());
resultMap
.
putAll
(
jsonObject
);
// 根据不同类型返回不同的字段、用于台套设备、气瓶、车用气瓶
if
(
CylinderTypeEnum
.
SPECIAL_CYLINDER
.
getCode
().
equals
(
jsonObject
.
get
(
"EQU_CATEGORY_CODE"
)))
{
beanMap
.
put
(
"cylCertificates"
,
JSONArray
.
parse
(
jsonObject
.
get
(
"cylCertificates"
).
toString
()));
beanMap
.
put
(
"EQU_CATEGORY_CODE"
,
CylinderTypeEnum
.
SPECIAL_CYLINDER
.
getCode
());
...
...
@@ -840,11 +860,25 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
beanMap
.
put
(
"sequenceNbrs"
,
jsonObject
.
get
(
"sequenceNbrs"
));
}
else
if
(
EquipmentClassifityEnum
.
YLGD
.
getCode
().
equals
(
jsonObject
.
get
(
"equListCode"
)))
{
beanMap
.
put
(
"projectContraptionNo"
,
jsonObject
.
get
(
"projectContraptionNo"
).
toString
());
beanMap
.
put
(
"projectContraption"
,
jsonObject
.
get
(
"projectContraption"
).
toString
());
beanMap
.
put
(
"equipments"
,
JSONArray
.
parse
(
jsonObject
.
get
(
"equipments"
).
toString
()));
beanMap
.
put
(
"EQU_CATEGORY_CODE"
,
PipelineEnum
.
INDUSTRIAL_PIPELINE
.
getCode
());
}
else
{
beanMap
.
put
(
"certificates"
,
JSONArray
.
parse
(
jsonObject
.
get
(
"certificates"
).
toString
()));
}
// 流程中实时显示设备信息(工业管道或者气瓶)
if
(!
scrapCancel
.
getAuditStatus
().
equals
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
())
&&
!
scrapCancel
.
getAuditStatus
().
equals
(
FlowStatusEnum
.
TO_BE_DISCARD
.
getName
()))
{
LambdaQueryWrapper
<
JgScrapCancelEq
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
JgScrapCancelEq:
:
getEquipTransferId
,
sequenceNbr
);
List
<
JgScrapCancelEq
>
jgScrapCancelEqs
=
jgScrapCancelEqService
.
list
(
queryWrapper
).
stream
().
filter
(
e
->
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotEmpty
(
e
.
getEquId
())).
collect
(
Collectors
.
toList
());
if
(!
ValidationUtil
.
isEmpty
(
jgScrapCancelEqs
))
{
if
(
CylinderTypeEnum
.
CYLINDER
.
getCode
().
equals
(
jsonObject
.
get
(
"EQU_CATEGORY_CODE"
)))
{
this
.
queryCylinderEquipments
(
jgScrapCancelEqs
,
beanMap
);
}
else
if
(
EquipmentClassifityEnum
.
YLGD
.
getCode
().
equals
(
jsonObject
.
get
(
"equListCode"
)))
{
this
.
queryProjectEquipments
(
scrapCancel
,
jgScrapCancelEqs
,
beanMap
);
}
}
}
}
resultMap
.
putAll
(
beanMap
);
resultMap
.
put
(
"receiveOrgCode"
,
scrapCancel
.
getReceiveCompanyCode
()
+
'_'
+
scrapCancel
.
getReceiveOrgName
());
...
...
@@ -855,6 +889,41 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
}};
}
private
void
queryCylinderEquipments
(
List
<
JgScrapCancelEq
>
jgScrapCancelEqs
,
Map
<
String
,
Object
>
beanMap
)
{
List
<
Map
<
String
,
Object
>>
equipments
=
Lists
.
newArrayList
();
Iterable
<
ESEquipmentCategoryDto
>
equipmentCategoryDtos
=
esEquipmentCategory
.
findAllById
(
jgScrapCancelEqs
.
stream
().
map
(
JgScrapCancelEq:
:
getEquId
).
collect
(
Collectors
.
toList
()));
equipmentCategoryDtos
.
forEach
(
dto
->
{
Map
<
String
,
Object
>
item
=
new
HashMap
<>();
BeanUtils
.
copyProperties
(
dto
,
item
);
BeanUtil
.
beanToMap
(
dto
,
item
,
true
,
false
);
item
.
replaceAll
((
k
,
v
)
->
v
==
null
?
""
:
v
);
item
.
put
(
"equipAddress"
,
concatWithSplit
(
trimNull2Empty
(
dto
.
getUSE_PLACE
()),
trimNull2Empty
(
dto
.
getADDRESS
())));
equipments
.
add
(
item
);
});
beanMap
.
put
(
"equipments"
,
equipments
);
}
private
String
concatWithSplit
(
String
...
strs
)
{
return
Arrays
.
stream
(
strs
).
filter
(
org
.
apache
.
commons
.
lang3
.
StringUtils
::
isNotEmpty
).
collect
(
Collectors
.
joining
(
"/"
));
}
private
String
trimNull2Empty
(
String
str
)
{
return
JsonDiffUtil
.
nullToEmpty
(
str
);
}
private
void
queryProjectEquipments
(
JgScrapCancel
scrapCancel
,
List
<
JgScrapCancelEq
>
jgScrapCancelEqs
,
Map
<
String
,
Object
>
beanMap
)
{
IdxBizJgProjectContraptionDto
idxBizJgProjectContraptionDto
=
jgEnableDisableService
.
findOneProjectContraption
(
Long
.
parseLong
(
scrapCancel
.
getProjectContraptionId
()));
beanMap
.
put
(
"projectContraption"
,
idxBizJgProjectContraptionDto
.
getProjectContraption
());
beanMap
.
put
(
"projectContraptionNo"
,
idxBizJgProjectContraptionDto
.
getProjectContraptionNo
());
List
<
Map
<
String
,
Object
>>
equipments
;
equipments
=
jgEnableDisableMapper
.
selectPipeLineByRecords
(
jgScrapCancelEqs
.
stream
().
map
(
JgScrapCancelEq:
:
getEquId
).
collect
(
Collectors
.
toList
()));
// 检验报告数据格式化 转json
equipments
.
stream
().
filter
(
e
->
e
.
get
(
"inspectReport"
)
!=
null
).
forEach
(
item
->
{
item
.
put
(
"inspectReport"
,
JSON
.
parse
(
item
.
get
(
"inspectReport"
).
toString
()));
});
beanMap
.
put
(
"equipments"
,
equipments
);
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
...
...
@@ -1097,7 +1166,7 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
jgUseRegistrationManageService
.
updateBatchById
(
jgUseRegistrationManageList
);
}
}
else
{
// 1.重新计算管道装置长度(
排除
作废的管道长度)
// 1.重新计算管道装置长度(
减去
作废的管道长度)
pipelineDataChangeService
.
updatePipelineLength
(
jgScrapCancel
.
getProjectContraptionId
());
// 查询管道装置使用登记证下所有非报废的管道
Integer
nonScrappedPipelineCount
=
jgScrapCancelEqMapper
.
selectNonScrappedPipelineCount
(
jgScrapCancel
.
getUseRegistrationCode
());
...
...
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