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
894f98fe
Commit
894f98fe
authored
Feb 02, 2026
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(设备创建) : 事务回滚
1.压力管道多证时报错,健壮处理
parent
a9806080
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
31 deletions
+16
-31
DataDockServiceImpl.java
.../boot/module/jg/biz/service/impl/DataDockServiceImpl.java
+16
-31
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/DataDockServiceImpl.java
View file @
894f98fe
...
...
@@ -20,6 +20,7 @@ import com.google.common.collect.Maps;
import
com.google.common.collect.Sets
;
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
;
import
com.yeejoin.amos.boot.biz.common.utils.*
;
import
com.yeejoin.amos.boot.module.common.api.converter.CommonCustomConverter
;
import
com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory
;
...
...
@@ -2003,10 +2004,10 @@ public class DataDockServiceImpl {
EquipRequestParamsDto
paramsDto
=
this
.
extractCommonData
(
dataSource
,
reginParams
,
equipInfo
,
equLists
);
// 是否工业管道
boolean
isGYGD
=
"8300"
.
equals
(
paramsDto
.
getEquCategoryCode
());
boolean
haveUseRegistration
=
false
;
List
<
JgUseRegistrationManage
>
jgUseRegistrationManages
=
new
ArrayList
<>()
;
// 确保使用登记证和工程装置在该单位下都是不存在的,方可导入数据
if
(
isGYGD
)
{
haveUseRegistration
=
this
.
checkTheUnitRegManageAlreadyExists
(
paramsDto
,
haveUseRegistration
);
jgUseRegistrationManages
=
this
.
checkTheUnitRegManageAlreadyExists
(
paramsDto
);
}
idxBizJgProjectContraptionServiceImpl
.
checkTheUnitProConMatching
(
paramsDto
);
this
.
checkTheUnitProConAlreadyExists
(
paramsDto
);
...
...
@@ -2018,25 +2019,21 @@ public class DataDockServiceImpl {
// 生成使用登记表信息 + 设备关系表 + 历史表
JgUseRegistration
useReg
=
this
.
saveUseRegAndEq
(
paramsDto
,
records
,
proCon
);
// 生成使用登记证表数据
if
(
!
haveUseRegistration
)
{
if
(
jgUseRegistrationManages
.
isEmpty
()
)
{
JgUseRegistrationManage
regManage
=
this
.
saveUseRegManage
(
paramsDto
,
useReg
);
// 流水表
this
.
saveCertChangeRecord
(
useReg
,
regManage
,
records
,
paramsDto
);
}
else
{
// 1.更新使用登记证信息
JgUseRegistrationManage
jgUseRegistrationManage
=
jgUseRegistrationManageService
.
lambdaQuery
()
.
eq
(
JgUseRegistrationManage:
:
getUseRegistrationCode
,
paramsDto
.
getUseOrgCode
())
.
eq
(
JgUseRegistrationManage:
:
getIsDelete
,
0
)
.
one
();
if
(
jgUseRegistrationManage
!=
null
)
{
jgUseRegistrationManage
.
setSuperviseOrgCode
(
paramsDto
.
getOrgBranchCode
());
jgUseRegistrationManage
.
setSuperviseOrgName
(
paramsDto
.
getOrgBranchName
());
jgUseRegistrationManage
.
setEquUseAddress
(
Stream
.
of
(
paramsDto
.
getProvinceName
(),
paramsDto
.
getCityName
(),
paramsDto
.
getCountyName
(),
paramsDto
.
getStreetName
(),
paramsDto
.
getAddress
())
.
map
(
value
->
value
==
null
||
"null"
.
equals
(
value
)
?
""
:
value
)
.
collect
(
Collectors
.
joining
()));
jgUseRegistrationManage
.
setRecDate
(
new
Date
());
jgUseRegistrationManageService
.
updateById
(
jgUseRegistrationManage
);
}
// 1.更新使用登记证信息,健壮处理,系统业务限制一个证号只能有一个证管理表
LambdaUpdateWrapper
<
JgUseRegistrationManage
>
manageLambdaUpdateWrapper
=
new
LambdaUpdateWrapper
<>();
manageLambdaUpdateWrapper
.
set
(
JgUseRegistrationManage:
:
getSuperviseOrgCode
,
paramsDto
.
getOrgBranchCode
());
manageLambdaUpdateWrapper
.
set
(
JgUseRegistrationManage:
:
getSuperviseOrgName
,
paramsDto
.
getOrgBranchName
());
manageLambdaUpdateWrapper
.
set
(
JgUseRegistrationManage:
:
getEquUseAddress
,
Stream
.
of
(
paramsDto
.
getProvinceName
(),
paramsDto
.
getCityName
(),
paramsDto
.
getCountyName
(),
paramsDto
.
getStreetName
(),
paramsDto
.
getAddress
())
.
map
(
value
->
value
==
null
||
"null"
.
equals
(
value
)
?
""
:
value
)
.
collect
(
Collectors
.
joining
()));
manageLambdaUpdateWrapper
.
set
(
JgUseRegistrationManage:
:
getRecDate
,
new
Date
());
manageLambdaUpdateWrapper
.
eq
(
BaseEntity:
:
getSequenceNbr
,
jgUseRegistrationManages
.
stream
().
map
(
BaseEntity:
:
getSequenceNbr
).
collect
(
Collectors
.
toList
()));
jgUseRegistrationManageService
.
update
(
manageLambdaUpdateWrapper
);
}
}
this
.
createResumePipeline
(
proCon
.
getSequenceNbr
(),
String
.
format
(
pipelineRoutePath
,
proCon
.
getSequenceNbr
()
+
""
),
reginParams
.
getCompany
());
...
...
@@ -2111,17 +2108,9 @@ public class DataDockServiceImpl {
*
* @param paramsDto 设备请求参数
*/
public
boolean
checkTheUnitRegManageAlreadyExists
(
EquipRequestParamsDto
paramsDto
,
boolean
haveUseRegistration
)
{
public
List
<
JgUseRegistrationManage
>
checkTheUnitRegManageAlreadyExists
(
EquipRequestParamsDto
paramsDto
)
{
// 1. 判断是否使用未来系统生成编号
idxBizJgRegisterInfoServiceImpl
.
checkUseRegistrationCode
(
paramsDto
.
getUseOrgCode
(),
"unit"
);
// 2. 获取使用登记管理列表
// List<JgUseRegistration> useRegistrationList = jgUseRegistrationMapper.selectList(
// new LambdaQueryWrapper<JgUseRegistration>()
// .eq(JgUseRegistration::getUseRegistrationCode, paramsDto.getUseOrgCode())
// .eq(JgUseRegistration::getIsDelete, 0)
// .eq(JgUseRegistration::getStatus, "已完成")
// .orderByDesc(JgUseRegistration::getRecDate)
// .last("limit 1"));
List
<
JgUseRegistrationManage
>
useRegistrationManageList
=
jgUseRegistrationManageMapper
.
selectList
(
new
LambdaQueryWrapper
<
JgUseRegistrationManage
>()
.
eq
(
JgUseRegistrationManage:
:
getUseRegistrationCode
,
paramsDto
.
getUseOrgCode
())
...
...
@@ -2130,15 +2119,11 @@ public class DataDockServiceImpl {
.
orderByDesc
(
JgUseRegistrationManage:
:
getRecDate
));
if
(!
useRegistrationManageList
.
isEmpty
())
{
// if (useRegistrationList.stream().filter(map -> !"1".equals(map.getRegType())).count() > 1) {
// throw new BadRequest("该使用登记证编号已由系统自动生成,不能导入,请确认使用登记证编号是否正确!");
// }
if
(
useRegistrationManageList
.
stream
().
anyMatch
(
map
->
!
paramsDto
.
getCompanyCode
().
equals
(
map
.
getUseUnitCreditCode
())))
{
throw
new
BadRequest
(
"该使用登记证编号在其他企业使用,不能导入,请确认使用登记证编号是否正确!"
);
}
haveUseRegistration
=
true
;
}
return
haveUseRegistration
;
return
useRegistrationManageList
;
}
/**
...
...
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