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
cdb07feb
Commit
cdb07feb
authored
Mar 13, 2024
by
盖献康
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug(70558) - 车企管理,新增、编辑企业名称验重
parent
6791a9bc
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 @
cdb07feb
...
@@ -2,7 +2,9 @@ package com.ruoyi.service.impl;
...
@@ -2,7 +2,9 @@ package com.ruoyi.service.impl;
import
java.util.List
;
import
java.util.List
;
import
cn.hutool.core.util.ObjUtil
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
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.DateUtils
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.web.request.AutomobileEnterpriseListRequest
;
import
com.ruoyi.web.request.AutomobileEnterpriseListRequest
;
...
@@ -59,6 +61,14 @@ public class AutomobileEnterpriseServiceImpl extends ServiceImpl<AutomobileEnter
...
@@ -59,6 +61,14 @@ public class AutomobileEnterpriseServiceImpl extends ServiceImpl<AutomobileEnter
@Override
@Override
public
int
insertAutomobileEnterprise
(
AutomobileEnterprise
automobileEnterprise
)
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
.
setCreateTime
(
DateUtils
.
getNowDate
());
automobileEnterprise
.
setCreateBy
(
String
.
valueOf
(
SecurityUtils
.
getUserId
()));
automobileEnterprise
.
setCreateBy
(
String
.
valueOf
(
SecurityUtils
.
getUserId
()));
return
automobileEnterpriseMapper
.
insert
(
automobileEnterprise
);
return
automobileEnterpriseMapper
.
insert
(
automobileEnterprise
);
...
@@ -73,6 +83,14 @@ public class AutomobileEnterpriseServiceImpl extends ServiceImpl<AutomobileEnter
...
@@ -73,6 +83,14 @@ public class AutomobileEnterpriseServiceImpl extends ServiceImpl<AutomobileEnter
@Override
@Override
public
int
updateAutomobileEnterprise
(
AutomobileEnterprise
automobileEnterprise
)
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
.
setUpdateTime
(
DateUtils
.
getNowDate
());
automobileEnterprise
.
setUpdateBy
(
String
.
valueOf
(
SecurityUtils
.
getUserId
()));
automobileEnterprise
.
setUpdateBy
(
String
.
valueOf
(
SecurityUtils
.
getUserId
()));
return
automobileEnterpriseMapper
.
updateAutomobileEnterprise
(
automobileEnterprise
);
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