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
90a39a5d
Commit
90a39a5d
authored
Jan 18, 2018
by
curryft
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批量删除
parent
02db6bea
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
10 deletions
+33
-10
BLessonServiceImpl.java
...oft/business/blesson/service/impl/BLessonServiceImpl.java
+1
-0
TQuestionController.java
...ft/business/tquestion/controller/TQuestionController.java
+19
-5
TQuestionRepository.java
...g/rcisoft/business/tquestion/dao/TQuestionRepository.java
+7
-5
TQuestionService.java
.../rcisoft/business/tquestion/service/TQuestionService.java
+1
-0
TQuestionServiceImpl.java
...business/tquestion/service/impl/TQuestionServiceImpl.java
+5
-0
No files found.
src/main/java/org/rcisoft/business/blesson/service/impl/BLessonServiceImpl.java
View file @
90a39a5d
...
...
@@ -173,6 +173,7 @@ public class BLessonServiceImpl implements BLessonService {
}
BLesson
bLesson
=
new
BLesson
();
bLesson
.
setBusinessId
(
id
);
bLesson
.
setDeleted
();
UserUtil
.
setCurrentMergeOperation
(
bLesson
);
int
line
=
bLessonRepository
.
logicalDelete
(
bLesson
);
//int line = bLessonRepository.deleteByPrimaryKey(id);
...
...
src/main/java/org/rcisoft/business/tquestion/controller/TQuestionController.java
View file @
90a39a5d
...
...
@@ -40,7 +40,7 @@ public class TQuestionController extends PaginationController<TQuestion> {
@ApiOperation
(
value
=
"添加"
,
notes
=
"添加"
)
//@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")})
@PostMapping
@PreAuthorize
(
"hasRole('ROLE_100
1
')"
)
@PreAuthorize
(
"hasRole('ROLE_100
2
')"
)
public
Result
add
(
@Valid
TQuestion
tQuestion
,
BindingResult
bindingResult
)
{
if
(
bindingResult
.
hasErrors
())
{
throw
new
ServiceException
(
ResultServiceEnums
.
PARAMETER_ERROR
.
getCode
(),
...
...
@@ -55,9 +55,9 @@ public class TQuestionController extends PaginationController<TQuestion> {
}
@ApiOperation
(
value
=
"删除题目"
,
notes
=
"根据ID删除一个题"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"businessId"
,
required
=
fals
e
,
dataType
=
"varchar"
)})
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"businessId"
,
required
=
tru
e
,
dataType
=
"varchar"
)})
@PostMapping
(
"/remove"
)
@PreAuthorize
(
"hasRole('ROLE_100
1
')"
)
@PreAuthorize
(
"hasRole('ROLE_100
2
')"
)
public
Result
delete
(
@PathVariable
String
id
)
{
TQuestion
tQuestion
=
new
TQuestion
();
tQuestion
.
setBusinessId
(
id
);
...
...
@@ -69,10 +69,22 @@ public class TQuestionController extends PaginationController<TQuestion> {
id
);
}
@ApiOperation
(
value
=
"批量删除"
,
notes
=
"根据ID批量删除"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id数组"
,
value
=
"businessId数组"
,
required
=
true
,
dataType
=
"varchar"
)})
@PostMapping
(
"/removeByIds"
)
@PreAuthorize
(
"hasRole('ROLE_1002')"
)
public
Result
deletes
(
@PathVariable
String
idInfoList
)
{
PersistModel
data
=
new
PersistModel
(
tQuestionServiceImpl
.
removeByIds
(
idInfoList
));
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
idInfoList
);
}
@ApiOperation
(
value
=
"修改"
,
notes
=
"修改"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
false
,
dataType
=
"varchar"
)})
@PutMapping
(
"/{id:\\d+}"
)
@PreAuthorize
(
"hasRole('ROLE_100
1
')"
)
@PreAuthorize
(
"hasRole('ROLE_100
2
')"
)
public
Result
update
(
@Valid
TQuestion
tQuestion
,
BindingResult
bindingResult
)
{
if
(
bindingResult
.
hasErrors
())
{
throw
new
ServiceException
(
ResultServiceEnums
.
PARAMETER_ERROR
.
getCode
(),
...
...
@@ -88,7 +100,7 @@ public class TQuestionController extends PaginationController<TQuestion> {
@ApiOperation
(
value
=
"唯一查找"
,
notes
=
"根据ID查找一条记录"
)
@GetMapping
(
"/one"
)
@PreAuthorize
(
"hasRole('ROLE_100
1
')"
)
@PreAuthorize
(
"hasRole('ROLE_100
2
')"
)
public
Result
detail
(
@PathVariable
String
id
)
{
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
...
...
@@ -100,6 +112,7 @@ public class TQuestionController extends PaginationController<TQuestion> {
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"qtype"
,
value
=
"题目类型"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"qtitle"
,
value
=
"关键字"
,
required
=
false
,
dataType
=
"varchar"
)})
@GetMapping
(
value
=
"/queryTQuestionByPagination"
)
@PreAuthorize
(
"hasRole('ROLE_1002')"
)
public
GridModel
listByPagination
(
TQuestion
tQuestion
)
{
tQuestion
.
setCreateBy
(
UserUtil
.
getUserInfoProp
(
getToken
(),
UserUtil
.
USER_ID
));
tQuestionServiceImpl
.
findAllByPagination
(
getPaginationUtility
(),
tQuestion
);
...
...
@@ -109,6 +122,7 @@ public class TQuestionController extends PaginationController<TQuestion> {
@ApiOperation
(
value
=
"根据条件查询"
,
notes
=
"根据URL中的参数查询全部"
)
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
false
,
dataType
=
"varchar"
)
@GetMapping
(
value
=
"/queryTQestions"
)
@PreAuthorize
(
"hasRole('ROLE_1002')"
)
public
Result
queryTQestion
(
TQuestion
tQuestion
)
{
tQuestion
.
setCreateBy
(
UserUtil
.
getUserInfoProp
(
getToken
(),
UserUtil
.
USER_ID
));
return
Result
.
builder
(
new
PersistModel
(
1
),
...
...
src/main/java/org/rcisoft/business/tquestion/dao/TQuestionRepository.java
View file @
90a39a5d
package
org
.
rcisoft
.
business
.
tquestion
.
dao
;
import
org.apache.ibatis.annotations.
Insert
;
import
org.apache.ibatis.annotations.
*
;
import
org.rcisoft.business.tquestion.entity.TQuestionOptions
;
import
org.rcisoft.core.base.BaseMapper
;
import
org.rcisoft.business.tquestion.entity.TQuestion
;
import
org.apache.ibatis.annotations.ResultMap
;
import
org.apache.ibatis.annotations.Select
;
import
org.rcisoft.core.model.PersistModel
;
import
org.springframework.stereotype.Repository
;
...
...
@@ -39,11 +38,14 @@ public interface TQuestionRepository extends BaseMapper<TQuestion> {
@Select
(
"<script>select * "
+
"from t_question tq"
+
"left join t_question_options tqo on tqo.
business_
id = tq.business_id"
+
"left join t_question_options tqo on tqo.
q
id = tq.business_id"
+
"where 1=1"
+
"<if test=\"delFlag !=null and delFlag != '' \">and del_flag = #{delFlag} </if> "
+
"<if test=\"flag !=null and flag != '' \">and flag = #{flag} </if> "
+
"<if test=\"business_id != null and business_id != ''\">and business_id = #{business_id}</if>"
)
+
"<if test=\"business_id != null and business_id != ''\">and business_id = #{business_id}</if>
<script>
"
)
List
<
TQuestion
>
queryTQuestions
(
TQuestion
tQuestion
);
@Update
(
"<script> update t_question set del_flag = 1 and flag = 0 where FIND_IN_SET(business_id,idInfoList)<script>"
)
int
deleteByIds
(
String
idInfoList
);
}
src/main/java/org/rcisoft/business/tquestion/service/TQuestionService.java
View file @
90a39a5d
...
...
@@ -50,4 +50,5 @@ public interface TQuestionService {
List
<
TQuestion
>
queryTQuestions
(
TQuestion
tQuestion
);
int
removeByIds
(
String
idInfoList
);
}
src/main/java/org/rcisoft/business/tquestion/service/impl/TQuestionServiceImpl.java
View file @
90a39a5d
...
...
@@ -111,4 +111,9 @@ public class TQuestionServiceImpl implements TQuestionService {
return
tQuestionRepository
.
queryTQuestions
(
tQuestion
);
}
@Override
public
int
removeByIds
(
String
idInfoList
)
{
return
tQuestionRepository
.
deleteByIds
(
idInfoList
);
}
}
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