Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-zx-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Jobs
Commits
Open sidebar
项目统一框架
一体化_户用光伏项目代码
amos-boot-zx-biz
Commits
d4c4fb37
Commit
d4c4fb37
authored
Jun 24, 2024
by
朱晨阳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改单位管理不能删除区域公司
parent
15a6f2c1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
13 deletions
+16
-13
UnitInfoServiceImpl.java
...oot/module/hygf/biz/service/impl/UnitInfoServiceImpl.java
+16
-13
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/UnitInfoServiceImpl.java
View file @
d4c4fb37
...
...
@@ -849,8 +849,21 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
//验证二维码
UnitInfo
unitInfo
=
new
UnitInfo
();
unitInfo
=
unitInfoMapper
.
selectById
(
unitDataDto
.
getUnitInformation
().
getSequenceNbr
());
List
<
String
>
lisk
=
new
ArrayList
<>();
UnitInformation
unitInformation
=
unitDataDto
.
getUnitInformation
();
List
<
Long
>
dis
=
unitInformation
.
getRegionalCompaniesSeq
();
//区域公司
LambdaQueryWrapper
<
RegionalCompanies
>
qu
=
new
LambdaQueryWrapper
<>();
qu
.
eq
(
RegionalCompanies:
:
getUnitId
,
unitInfo
.
getAmosCompanySeq
());
List
<
RegionalCompanies
>
oldList
=
regionalCompaniesMapper
.
selectList
(
qu
);
List
<
String
>
oldDisString
=
oldList
.
stream
().
map
((
regionalCompanies
)
->
regionalCompanies
.
getRegionalCompaniesSeq
().
toString
()).
collect
(
Collectors
.
toList
());
List
<
String
>
newDisString
=
dis
.
stream
().
map
((
regionalCompaniesSeq
)
->
regionalCompaniesSeq
.
toString
()).
collect
(
Collectors
.
toList
());
for
(
String
item:
oldDisString
){
if
(!
newDisString
.
contains
(
item
)){
throw
new
BadRequest
(
"所属区域公司只能增加, 不能删除"
);
}
}
List
<
String
>
lisk
=
new
ArrayList
<>();
JSONArray
regionName
=
getRegionName
();
List
<
RegionModel
>
list
=
JSONArray
.
parseArray
(
regionName
.
toJSONString
(),
RegionModel
.
class
);
List
<
Integer
>
regist
=
unitInformation
.
getRegisterPcdCodeList
();
...
...
@@ -891,7 +904,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
unitInformation
.
setRegisterPcdCodeList
(
unitInformation
.
getRegisterPcdCodeList
());
unitInformation
.
setWorkPcdCodeList
(
unitInformation
.
getWorkPcdCodeList
());
List
<
Long
>
dis
=
unitInformation
.
getRegionalCompaniesSeq
();
List
<
String
>
disST
=
dis
.
stream
().
map
(
x
->
x
+
""
).
collect
(
Collectors
.
toList
());
BeanUtils
.
copyProperties
(
unitInformation
,
unitInfo
);
CommerceInfo
commerceInfo
=
new
CommerceInfo
();
...
...
@@ -906,17 +919,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
unitInfoMapper
.
updateById
(
unitInfo
);
commerceInfoMapper
.
updateById
(
commerceInfo
);
//区域公司
LambdaQueryWrapper
<
RegionalCompanies
>
qu
=
new
LambdaQueryWrapper
<>();
qu
.
eq
(
RegionalCompanies:
:
getUnitId
,
unitInfo
.
getAmosCompanySeq
());
List
<
RegionalCompanies
>
oldList
=
regionalCompaniesMapper
.
selectList
(
qu
);
List
<
String
>
oldDisString
=
oldList
.
stream
().
map
((
regionalCompanies
)
->
regionalCompanies
.
getRegionalCompaniesSeq
().
toString
()).
collect
(
Collectors
.
toList
());
List
<
String
>
newDisString
=
dis
.
stream
().
map
((
regionalCompaniesSeq
)
->
regionalCompaniesSeq
.
toString
()).
collect
(
Collectors
.
toList
());
for
(
String
item:
oldDisString
){
if
(!
newDisString
.
contains
(
item
)){
throw
new
BadRequest
(
"所属区域公司只能增加, 不能删除"
);
}
}
regionalCompaniesMapper
.
delete
(
qu
);
...
...
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