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
6f1fc61c
Commit
6f1fc61c
authored
Dec 21, 2022
by
xixinzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改新增编辑应急小组名称不可重复
parent
d535effe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
OrganizationImpl.java
...os/boot/module/jcs/biz/service/impl/OrganizationImpl.java
+15
-0
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/OrganizationImpl.java
View file @
6f1fc61c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.OrganizationExportDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.OrganizationUserExportDto
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.Organization
;
...
...
@@ -91,12 +93,25 @@ public class OrganizationImpl extends BaseService<Organization,Organization, Org
@Override
public
Organization
saveOrganization
(
Organization
organization
)
{
LambdaQueryWrapper
<
Organization
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
Organization:
:
getEmergencyTeamName
,
organization
.
getEmergencyTeamName
());
List
<
Organization
>
organizations
=
this
.
list
(
wrapper
);
if
(!
CollectionUtils
.
isEmpty
(
organizations
))
{
throw
new
BadRequest
(
"应急小组名称重复!"
);
}
organization
.
setSort
(
organizationMapper
.
selectMaxSort
()
+
1
);
return
this
.
createWithModel
(
organization
);
}
@Override
public
Organization
updateModelById
(
Organization
organization
)
{
LambdaQueryWrapper
<
Organization
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
ne
(
BaseEntity:
:
getSequenceNbr
,
organization
.
getSequenceNbr
());
queryWrapper
.
eq
(
Organization:
:
getEmergencyTeamName
,
organization
.
getEmergencyTeamName
());
List
<
Organization
>
organizations
=
this
.
list
(
queryWrapper
);
if
(!
CollectionUtils
.
isEmpty
(
organizations
))
{
throw
new
BadRequest
(
"应急小组名称重复!"
);
}
return
this
.
updateWithModel
(
organization
);
}
...
...
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