Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vehicle-quality-review
Project
Project
Details
Activity
Releases
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
王飞
vehicle-quality-review
Commits
cab1dfbc
Commit
cab1dfbc
authored
Mar 13, 2024
by
盖献康
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'gaixiankang' into 'dev'
车企管理,新增、编辑企业名称验重 See merge request
!176
parents
bcf58524
02dca69b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
AutomobileEnterpriseServiceImpl.java
...m/ruoyi/service/impl/AutomobileEnterpriseServiceImpl.java
+18
-0
No files found.
quality-review/src/main/java/com/ruoyi/service/impl/AutomobileEnterpriseServiceImpl.java
View file @
cab1dfbc
...
...
@@ -2,7 +2,9 @@ package com.ruoyi.service.impl;
import
java.util.List
;
import
cn.hutool.core.util.ObjUtil
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.ruoyi.common.exception.ServiceException
;
import
com.ruoyi.common.utils.DateUtils
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.web.request.AutomobileEnterpriseListRequest
;
...
...
@@ -59,6 +61,14 @@ public class AutomobileEnterpriseServiceImpl extends ServiceImpl<AutomobileEnter
@Override
public
int
insertAutomobileEnterprise
(
AutomobileEnterprise
automobileEnterprise
)
{
// 判断企业名称是否重复
if
(
lambdaQuery
()
.
eq
(
AutomobileEnterprise:
:
getEnterpriseName
,
automobileEnterprise
.
getEnterpriseName
())
.
ne
(
ObjUtil
.
isNotEmpty
(
automobileEnterprise
.
getId
()),
AutomobileEnterprise:
:
getId
,
automobileEnterprise
.
getId
())
.
exists
()
)
{
throw
new
ServiceException
(
"企业名称已存在"
);
}
automobileEnterprise
.
setCreateTime
(
DateUtils
.
getNowDate
());
automobileEnterprise
.
setCreateBy
(
String
.
valueOf
(
SecurityUtils
.
getUserId
()));
return
automobileEnterpriseMapper
.
insert
(
automobileEnterprise
);
...
...
@@ -73,6 +83,14 @@ public class AutomobileEnterpriseServiceImpl extends ServiceImpl<AutomobileEnter
@Override
public
int
updateAutomobileEnterprise
(
AutomobileEnterprise
automobileEnterprise
)
{
// 判断企业名称是否重复
if
(
lambdaQuery
()
.
eq
(
AutomobileEnterprise:
:
getEnterpriseName
,
automobileEnterprise
.
getEnterpriseName
())
.
ne
(
ObjUtil
.
isNotEmpty
(
automobileEnterprise
.
getId
()),
AutomobileEnterprise:
:
getId
,
automobileEnterprise
.
getId
())
.
exists
()
)
{
throw
new
ServiceException
(
"企业名称已存在"
);
}
automobileEnterprise
.
setUpdateTime
(
DateUtils
.
getNowDate
());
automobileEnterprise
.
setUpdateBy
(
String
.
valueOf
(
SecurityUtils
.
getUserId
()));
return
automobileEnterpriseMapper
.
updateAutomobileEnterprise
(
automobileEnterprise
);
...
...
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