Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zhny
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
王夏晖
zhny
Commits
ef5afa2e
Commit
ef5afa2e
authored
Sep 10, 2018
by
jichao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
项目维护--设备类型维护,验重的bug
parent
42f2dd98
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
BusDeviceTpServiceImpl.java
.../business/manage/service/impl/BusDeviceTpServiceImpl.java
+4
-3
No files found.
src/main/java/org/rcisoft/business/manage/service/impl/BusDeviceTpServiceImpl.java
View file @
ef5afa2e
...
...
@@ -51,7 +51,7 @@ public class BusDeviceTpServiceImpl implements BusDeviceTpService {
public
PersistModel
save
(
BusDeviceTp
busDeviceTp
){
int
line
=
0
;
// 验重
Integer
repeat
=
this
.
repeat
(
null
,
busDeviceTp
.
getDevTpNm
());
Integer
repeat
=
this
.
repeat
(
null
,
busDeviceTp
.
getDevTpNm
()
,
busDeviceTp
.
getProId
()
);
if
(
repeat
>
0
)
return
new
PersistModel
(
line
,
"设备类型名称不能重复"
);
//增加操作
...
...
@@ -93,7 +93,7 @@ public class BusDeviceTpServiceImpl implements BusDeviceTpService {
int
line
=
0
;
if
(
StringUtils
.
isNotEmpty
(
busDeviceTp
.
getDevTpNm
()))
{
// 验重
Integer
repeat
=
this
.
repeat
(
busDeviceTp
.
getDevTpId
(),
busDeviceTp
.
getDevTpNm
());
Integer
repeat
=
this
.
repeat
(
busDeviceTp
.
getDevTpId
(),
busDeviceTp
.
getDevTpNm
()
,
busDeviceTp
.
getProId
()
);
if
(
repeat
>
0
)
return
new
PersistModel
(
line
,
"设备类型名称不能重复"
);
}
...
...
@@ -152,10 +152,11 @@ public class BusDeviceTpServiceImpl implements BusDeviceTpService {
* @param devTpNm
* @return
*/
private
Integer
repeat
(
String
devTpId
,
String
devTpNm
)
{
private
Integer
repeat
(
String
devTpId
,
String
devTpNm
,
String
proId
)
{
Example
example
=
new
Example
(
BusDeviceTp
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEqualTo
(
"devTpNm"
,
devTpNm
);
criteria
.
andEqualTo
(
"proId"
,
proId
);
if
(
StringUtils
.
isNotEmpty
(
devTpId
))
criteria
.
andNotEqualTo
(
"devTpId"
,
devTpId
);
return
busDeviceTpRepository
.
selectCountByExample
(
example
);
...
...
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