Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
education
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
李丛阳
education
Commits
ffdd5952
Commit
ffdd5952
authored
Nov 08, 2019
by
luzhuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改接口
parent
e86b7f8c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
12 deletions
+18
-12
BLabelController.java
.../rcisoft/business/blabel/controller/BLabelController.java
+2
-2
BLabelRepository.java
...ava/org/rcisoft/business/blabel/dao/BLabelRepository.java
+6
-2
BLabelService.java
...va/org/rcisoft/business/blabel/service/BLabelService.java
+3
-2
BLabelServiceImpl.java
...isoft/business/blabel/service/impl/BLabelServiceImpl.java
+7
-6
No files found.
src/main/java/org/rcisoft/business/blabel/controller/BLabelController.java
View file @
ffdd5952
...
...
@@ -57,7 +57,7 @@ public class BLabelController extends PaginationController<BLabel> {
@ApiImplicitParam
(
name
=
"lName"
,
value
=
"标签名"
,
required
=
true
,
dataType
=
"varchar"
)})
@PostMapping
(
value
=
"/update"
)
public
Result
update
(
CurUser
curUser
,
@Valid
BLabel
bLabel
,
BindingResult
br
){
PersistModel
data
=
bLabelService
.
updateLabel
(
bLabel
);
PersistModel
data
=
bLabelService
.
updateLabel
(
bLabel
,
curUser
);
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
...
...
@@ -69,7 +69,7 @@ public class BLabelController extends PaginationController<BLabel> {
@ApiImplicitParam
(
name
=
"lName"
,
value
=
"标签名"
,
required
=
true
,
dataType
=
"varchar"
)})
@PostMapping
(
value
=
"/add"
)
public
Result
insert
(
CurUser
curUser
,
@Valid
BLabel
bLabel
,
BindingResult
br
){
PersistModel
data
=
bLabelService
.
insertLabel
(
bLabel
);
PersistModel
data
=
bLabelService
.
insertLabel
(
bLabel
,
curUser
);
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
...
...
src/main/java/org/rcisoft/business/blabel/dao/BLabelRepository.java
View file @
ffdd5952
...
...
@@ -21,8 +21,12 @@ public interface BLabelRepository extends BaseMapper<BLabel> {
List
<
BLabel
>
queryBlabels
(
@Param
(
"lName"
)
String
lName
,
@Param
(
"corpId"
)
String
corpId
);
// 增加标签是检查标签名重复
@Select
(
"SELECT * from b_label where l_name=#{lName} AND del_flag='0' and flag='1'"
)
List
<
BLabel
>
checknameByName
(
BLabel
bLabel
);
@Select
(
"<script>select count(0) from b_label "
+
"where l_name = #{lName} "
+
"AND del_flag='0' and flag='1' "
+
"<if test=\"businessId!=null and businessId != ''\"> and business_id != #{businessId} </if>"
+
"and corp_id = #{corpId}</script>"
)
int
checknameByName
(
@Param
(
"lName"
)
String
lName
,
@Param
(
"businessId"
)
String
businessId
,
@Param
(
"corpId"
)
String
corpId
);
// 逻辑删除标签
@Update
(
"UPDATE b_label SET del_flag='1' where business_id = #{businessId}"
)
...
...
src/main/java/org/rcisoft/business/blabel/service/BLabelService.java
View file @
ffdd5952
...
...
@@ -3,6 +3,7 @@ package org.rcisoft.business.blabel.service;
import
org.rcisoft.business.blabel.entity.BLabel
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.model.PersistModel
;
import
org.rcisoft.sys.user.bean.CurUser
;
import
java.util.List
;
...
...
@@ -12,9 +13,9 @@ public interface BLabelService {
List
<
BLabel
>
queryBlabels
(
String
lName
,
String
corpId
);
PersistModel
insertLabel
(
BLabel
bLabel
);
PersistModel
insertLabel
(
BLabel
bLabel
,
CurUser
curUser
);
PersistModel
updateLabel
(
BLabel
bLabel
);
PersistModel
updateLabel
(
BLabel
bLabel
,
CurUser
curUser
);
PersistModel
removeLabel
(
String
id
);
}
src/main/java/org/rcisoft/business/blabel/service/impl/BLabelServiceImpl.java
View file @
ffdd5952
...
...
@@ -10,6 +10,7 @@ import org.rcisoft.core.exception.ServiceException;
import
org.rcisoft.core.model.PersistModel
;
import
org.rcisoft.core.result.ResultServiceEnums
;
import
org.rcisoft.core.util.UserUtil
;
import
org.rcisoft.sys.user.bean.CurUser
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
...
...
@@ -34,12 +35,12 @@ public class BLabelServiceImpl implements BLabelService {
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
PersistModel
insertLabel
(
BLabel
bLabel
)
{
public
PersistModel
insertLabel
(
BLabel
bLabel
,
CurUser
curUser
)
{
if
(
StringUtils
.
isBlank
(
bLabel
.
getLName
())){
throw
new
ServiceException
(
"标签名称不能为空"
);
}
List
<
BLabel
>
line
=
bLabelRepository
.
checknameByName
(
bLabel
);
if
(
line
.
size
()>
0
){
int
line
=
bLabelRepository
.
checknameByName
(
bLabel
.
getLName
(),
bLabel
.
getBusinessId
(),
curUser
.
getCorpId
()
);
if
(
line
>
0
){
throw
new
ServiceException
(
ResultServiceEnums
.
NAME_IS_EXISTS
);
}
UserUtil
.
setCurrentPersistOperation
(
bLabel
);
...
...
@@ -48,12 +49,12 @@ public class BLabelServiceImpl implements BLabelService {
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
PersistModel
updateLabel
(
BLabel
bLabel
)
{
public
PersistModel
updateLabel
(
BLabel
bLabel
,
CurUser
curUser
)
{
if
(
StringUtils
.
isBlank
(
bLabel
.
getLName
())){
throw
new
ServiceException
(
"标签名称不能为空"
);
}
List
<
BLabel
>
line
=
bLabelRepository
.
checknameByName
(
bLabel
);
if
(
line
.
size
()>
0
){
int
line
=
bLabelRepository
.
checknameByName
(
bLabel
.
getLName
(),
bLabel
.
getBusinessId
(),
curUser
.
getCorpId
()
);
if
(
line
>
0
){
throw
new
ServiceException
(
ResultServiceEnums
.
NAME_IS_EXISTS
);
}
UserUtil
.
setCurrentMergeOperation
(
bLabel
);
...
...
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