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
f25ca85d
Commit
f25ca85d
authored
Jan 03, 2018
by
YangZhaoJun1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决bug,解决springBoot返回null值时前台获取不到对象的问题
parent
4b98f49b
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
108 additions
and
54 deletions
+108
-54
BChapterController.java
...soft/business/bchapter/controller/BChapterController.java
+4
-3
BChapterService.java
...rg/rcisoft/business/bchapter/service/BChapterService.java
+1
-1
BChapterServiceImpl.java
...t/business/bchapter/service/impl/BChapterServiceImpl.java
+11
-7
BSlController.java
...va/org/rcisoft/business/bsl/controller/BSlController.java
+4
-3
BSlRepository.java
...main/java/org/rcisoft/business/bsl/dao/BSlRepository.java
+24
-34
SlDetailDTO.java
src/main/java/org/rcisoft/business/bsl/dto/SlDetailDTO.java
+8
-3
BSlService.java
...ain/java/org/rcisoft/business/bsl/service/BSlService.java
+1
-1
BSlServiceImpl.java
...org/rcisoft/business/bsl/service/impl/BSlServiceImpl.java
+2
-2
NullSerializer.java
src/main/java/org/rcisoft/config/NullSerializer.java
+33
-0
NullSerializerConfig.java
src/main/java/org/rcisoft/config/NullSerializerConfig.java
+20
-0
No files found.
src/main/java/org/rcisoft/business/bchapter/controller/BChapterController.java
View file @
f25ca85d
...
@@ -90,11 +90,12 @@ public class BChapterController extends PaginationController<BChapter> {
...
@@ -90,11 +90,12 @@ public class BChapterController extends PaginationController<BChapter> {
@ApiOperation
(
value
=
"删除章节"
,
notes
=
"根据ID删除一条记录"
)
@ApiOperation
(
value
=
"删除章节"
,
notes
=
"根据ID删除一条记录"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"businessId"
,
required
=
true
,
dataType
=
"varchar"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"businessId"
,
required
=
true
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"lessonOrSl"
,
value
=
"区分课程开课 0开课,1课程"
,
required
=
true
,
dataType
=
"varchar"
)})
@PreAuthorize
(
"hasAnyRole('ROLE_1001','ROLE_1002')"
)
@PreAuthorize
(
"hasAnyRole('ROLE_1001','ROLE_1002')"
)
@PostMapping
(
value
=
"/remove"
)
@PostMapping
(
value
=
"/remove"
)
public
Result
remove
(
String
id
)
{
public
Result
remove
(
String
id
,
String
lessonOrSl
)
{
PersistModel
data
=
bChapterService
.
removeBChapter
(
id
,
getToken
()
);
PersistModel
data
=
bChapterService
.
removeBChapter
(
id
,
lessonOrSl
);
return
Result
.
builder
(
data
,
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
...
...
src/main/java/org/rcisoft/business/bchapter/service/BChapterService.java
View file @
f25ca85d
...
@@ -70,7 +70,7 @@ public interface BChapterService{
...
@@ -70,7 +70,7 @@ public interface BChapterService{
* @param scoreInfoDTOS
* @param scoreInfoDTOS
* @return
* @return
*/
*/
void
markScore
(
List
<
ScoreInfoDTO
>
scoreInfoDTOS
,
String
token
);
void
markScore
(
List
<
ScoreInfoDTO
>
scoreInfoDTOS
,
String
lessonOrSl
);
/**
/**
* 根据学生id和课程id获取该学生的课程章节分数列表
* 根据学生id和课程id获取该学生的课程章节分数列表
...
...
src/main/java/org/rcisoft/business/bchapter/service/impl/BChapterServiceImpl.java
View file @
f25ca85d
...
@@ -129,19 +129,22 @@ public class BChapterServiceImpl implements BChapterService {
...
@@ -129,19 +129,22 @@ public class BChapterServiceImpl implements BChapterService {
@Override
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
PersistModel
removeBChapter
(
String
id
,
String
token
)
{
public
PersistModel
removeBChapter
(
String
id
,
String
lessonOrSl
)
{
BChapter
bChapter
=
bChapterRepository
.
selectByPrimaryKey
(
id
);
BChapter
bChapter
=
bChapterRepository
.
selectByPrimaryKey
(
id
);
if
(
bChapter
==
null
)
if
(
bChapter
==
null
)
throw
new
ServiceException
(
ResultServiceEnums
.
CHAPTER_NOT_EXISTS
);
throw
new
ServiceException
(
ResultServiceEnums
.
CHAPTER_NOT_EXISTS
);
List
<
BChapter
>
childList
=
bChapterRepository
.
queryBChaptersByPid
(
id
);
List
<
BChapter
>
childList
=
bChapterRepository
.
queryBChaptersByPid
(
id
);
boolean
hasChild
=
childList
!=
null
&&
childList
.
size
()>
0
;
boolean
hasChild
=
childList
!=
null
&&
childList
.
size
()>
0
;
boolean
isChapter
=
bChapter
.
getChapterLevel
()==
ChapterLevelEnum
.
CHAPTER
.
getCode
();
boolean
isChapter
=
bChapter
.
getChapterLevel
()==
ChapterLevelEnum
.
CHAPTER
.
getCode
();
if
(
isChapter
&&
hasChild
)
if
(
isChapter
&&
hasChild
)
{
throw
new
ServiceException
(
ResultServiceEnums
.
CHAPTER_HAS_CHILD
);
throw
new
ServiceException
(
ResultServiceEnums
.
CHAPTER_HAS_CHILD
);
}
String
state
=
bSlRepository
.
queryStateById
(
bChapter
.
getSlId
());
String
state
;
if
(
state
.
equals
(
AuditStatusEnum
.
PUBLISHED
.
getCode
())){
if
(
lessonOrSl
.
equals
(
"0"
)){
throw
new
ServiceException
(
ResultServiceEnums
.
CHAPTER_IS_USED
);
state
=
bSlRepository
.
queryStateById
(
bChapter
.
getSlId
());
if
(
state
.
equals
(
AuditStatusEnum
.
PUBLISHED
.
getCode
())){
throw
new
ServiceException
(
ResultServiceEnums
.
CHAPTER_IS_USED
);
}
}
}
bChapterRepository
.
deleteStudentChapter
(
id
);
bChapterRepository
.
deleteStudentChapter
(
id
);
int
line
=
bChapterRepository
.
deleteByPrimaryKey
(
id
);
int
line
=
bChapterRepository
.
deleteByPrimaryKey
(
id
);
...
@@ -222,6 +225,7 @@ public class BChapterServiceImpl implements BChapterService {
...
@@ -222,6 +225,7 @@ public class BChapterServiceImpl implements BChapterService {
sl_chapter
.
setPid
(
lessonList
.
get
(
i
).
getPid
());
sl_chapter
.
setPid
(
lessonList
.
get
(
i
).
getPid
());
map
.
put
(
lessonList
.
get
(
i
).
getBusinessId
(),
sl_chapter
.
getBusinessId
());
map
.
put
(
lessonList
.
get
(
i
).
getBusinessId
(),
sl_chapter
.
getBusinessId
());
}
else
{
}
else
{
sl_chapter
.
setPid
(
"0"
);
sl_chapter
.
setLPid
(
lessonList
.
get
(
i
).
getPid
());
sl_chapter
.
setLPid
(
lessonList
.
get
(
i
).
getPid
());
}
}
//set老的章节ID后面比对用
//set老的章节ID后面比对用
...
@@ -267,10 +271,10 @@ public class BChapterServiceImpl implements BChapterService {
...
@@ -267,10 +271,10 @@ public class BChapterServiceImpl implements BChapterService {
BFile
bFile
=
bFileRepository
.
queryBVideoByChapterId
(
leBChapter
.
getBusinessId
());
BFile
bFile
=
bFileRepository
.
queryBVideoByChapterId
(
leBChapter
.
getBusinessId
());
BFile
newVideo
=
new
BFile
();
BFile
newVideo
=
new
BFile
();
newVideo
.
setChapterId
(
slChapter
.
getBusinessId
());
newVideo
.
setChapterId
(
slChapter
.
getBusinessId
());
newVideo
.
setVideoName
(
bFile
.
getVideoName
());
UserUtil
.
setCurrentPersistOperation
(
newVideo
);
UserUtil
.
setCurrentPersistOperation
(
newVideo
);
//将节的ID替换成新的
//将节的ID替换成新的
if
(
bFile
!=
null
){
if
(
bFile
!=
null
){
newVideo
.
setVideoName
(
bFile
.
getVideoName
());
if
(
bFile
.
getVideoUrl
()!=
null
&&!
bFile
.
getVideoUrl
().
equals
(
""
)){
if
(
bFile
.
getVideoUrl
()!=
null
&&!
bFile
.
getVideoUrl
().
equals
(
""
)){
String
newUrl
=
bFile
.
getVideoUrl
().
replace
(
bLessonId
,
slId
);
String
newUrl
=
bFile
.
getVideoUrl
().
replace
(
bLessonId
,
slId
);
String
path
=
newUrl
.
replace
(
leBChapter
.
getBusinessId
(),
slChapter
.
getBusinessId
());
String
path
=
newUrl
.
replace
(
leBChapter
.
getBusinessId
(),
slChapter
.
getBusinessId
());
...
...
src/main/java/org/rcisoft/business/bsl/controller/BSlController.java
View file @
f25ca85d
...
@@ -114,6 +114,7 @@ public class BSlController extends PaginationController<BSl> {
...
@@ -114,6 +114,7 @@ public class BSlController extends PaginationController<BSl> {
@ApiImplicitParam
(
name
=
"teacherName"
,
value
=
"教师姓名"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"teacherName"
,
value
=
"教师姓名"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"lessonName"
,
value
=
"课程名称"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"lessonName"
,
value
=
"课程名称"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"termName"
,
value
=
"学期名称"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"termName"
,
value
=
"学期名称"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"termCode"
,
value
=
"学期编号"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"auditStatus"
,
value
=
"审核状态 0:待发布,1审核中,2已发布,3已驳回"
,
required
=
false
,
dataType
=
"varchar"
)})
@ApiImplicitParam
(
name
=
"auditStatus"
,
value
=
"审核状态 0:待发布,1审核中,2已发布,3已驳回"
,
required
=
false
,
dataType
=
"varchar"
)})
@GetMapping
(
value
=
"/queryBSlsByPagination"
)
@GetMapping
(
value
=
"/queryBSlsByPagination"
)
public
GridModel
queryBSlsByPagination
(
BSl
param
)
{
public
GridModel
queryBSlsByPagination
(
BSl
param
)
{
...
@@ -285,15 +286,15 @@ public class BSlController extends PaginationController<BSl> {
...
@@ -285,15 +286,15 @@ public class BSlController extends PaginationController<BSl> {
@ApiOperation
(
value
=
"根据 学号/工号 分页获取 历史学习课程/历史授课"
,
notes
=
"传学号代表查学生历史学习,传教师工号代表查教师历史授课,不能同时传"
)
@ApiOperation
(
value
=
"根据 学号/工号 分页获取 历史学习课程/历史授课"
,
notes
=
"传学号代表查学生历史学习,传教师工号代表查教师历史授课,不能同时传"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"lessonName"
,
value
=
"课程名称关键字"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"lessonName"
,
value
=
"课程名称关键字"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"term
"
,
value
=
"学期名称关键字
"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"term
Code"
,
value
=
"学期编号
"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"studentCode"
,
value
=
"学生学号"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"studentCode"
,
value
=
"学生学号"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"teacherCode"
,
value
=
"教师工号"
,
required
=
false
,
dataType
=
"varchar"
)})
@ApiImplicitParam
(
name
=
"teacherCode"
,
value
=
"教师工号"
,
required
=
false
,
dataType
=
"varchar"
)})
@GetMapping
(
value
=
"/historySlByCode"
)
@GetMapping
(
value
=
"/historySlByCode"
)
public
GridModel
historySlByCode
(
String
lessonName
,
String
term
,
String
studentCode
,
String
teacherCode
)
{
public
GridModel
historySlByCode
(
String
lessonName
,
String
term
Code
,
String
studentCode
,
String
teacherCode
)
{
if
((
studentCode
!=
null
&&!
studentCode
.
equals
(
""
))&&(
teacherCode
!=
null
&&!
studentCode
.
equals
(
""
))){
if
((
studentCode
!=
null
&&!
studentCode
.
equals
(
""
))&&(
teacherCode
!=
null
&&!
studentCode
.
equals
(
""
))){
throw
new
ServiceException
(
ResultServiceEnums
.
PARAMER_ERROR
);
throw
new
ServiceException
(
ResultServiceEnums
.
PARAMER_ERROR
);
}
}
bSlService
.
historySlByCodeByPagination
(
getPaginationUtility
(),
lessonName
,
term
,
studentCode
,
teacherCode
);
bSlService
.
historySlByCodeByPagination
(
getPaginationUtility
(),
lessonName
,
term
Code
,
studentCode
,
teacherCode
);
GridModel
gridModel
=
getGridModelResponse
();
GridModel
gridModel
=
getGridModelResponse
();
return
gridModel
;
return
gridModel
;
}
}
...
...
src/main/java/org/rcisoft/business/bsl/dao/BSlRepository.java
View file @
f25ca85d
...
@@ -136,37 +136,27 @@ public interface BSlRepository extends BaseMapper<BSl> {
...
@@ -136,37 +136,27 @@ public interface BSlRepository extends BaseMapper<BSl> {
* @param id
* @param id
* @return
* @return
*/
*/
@Select
(
"<script>SELECT\n"
+
@Select
(
"<script>SELECT t1.business_id as businessId,t1.credits AS credits,t1.class_hour AS classHour,\n"
+
"\tt1.business_id as businessId,\n"
+
"t1.audit_status AS auditStatus,t8.`name` AS directionName,t9.`name` AS termName,\n"
+
"\tt1.`code` AS slCode,\n"
+
"t1.`code` AS slCode,t1.sl_notes as slNotes,t1.sl_cover_url as coverUrl,\n"
+
"\tt1.sl_notes as slNotes,\n"
+
"t6.lesson_name as lessonName,t5.head_pic as teaPic,t5.`name` AS teaName,\n"
+
"\tt1.sl_cover_url as coverUrl,\n"
+
"t5.t_num as teaSlNum,t5.`code` AS teaCode,\n"
+
"\tt6.lesson_name as lessonName,\n"
+
"(select count(*) from b_chapter bc where bc.sl_id=t1.business_id and bc.is_test like CONCAT('%','1','%' )) AS experiment,\n"
+
"\tt5.head_pic as teaPic,\n"
+
"(select count(*) from b_chapter bc where bc.sl_id=t1.business_id and bc.is_test like CONCAT('%','2','%' )) AS video,\n"
+
"\tt5.`name` AS teaName,\n"
+
"(select count(*) from b_chapter bc where bc.sl_id=t1.business_id and bc.is_test like CONCAT('%','3','%' )) AS ppt,\n"
+
"\tt5.t_num as teaSlNum,\n"
+
"(select count(*) from b_chapter bc where bc.sl_id=t1.business_id and bc.is_test like CONCAT('%','4','%' )) AS pdf\n"
+
"\tt5.`code` AS teaCode,\n"
+
"\t(select count(*) from b_chapter bc where bc.sl_id=t1.business_id and bc.is_test like CONCAT('%','1','%' )) AS isTest,\n"
+
"\t(select count(*) from b_chapter bc where bc.sl_id=t1.business_id and bc.is_test like CONCAT('%','2','%' )) AS video\n"
+
"FROM\n"
+
"FROM\n"
+
"\tb_sl t1\n"
+
"b_sl t1\n"
+
"LEFT JOIN b_lesson t6\n"
+
"LEFT JOIN b_lesson_direction t7 ON t1.business_id = t7.sl_id\n"
+
"ON t1.lesson_code = t6.`code`\n"
+
"LEFT JOIN b_direction t8 ON t7.direction_id = t8.business_id\n"
+
"LEFT JOIN (\n"
+
"LEFT JOIN b_term t9 ON t1.term_code = t9.`code`\n"
+
"\tSELECT\n"
+
"LEFT JOIN b_lesson t6 ON t1.lesson_code = t6.`code`\n"
+
"\t\tcount(t3.business_id) AS t_num,\n"
+
"LEFT JOIN (SELECT count(t3.business_id) AS t_num,t4.`name`,t2.`code`,t4.head_pic FROM b_teacher t2\n"
+
"\t\tt4.`name`,\n"
+
"LEFT JOIN b_sl t3 ON t2.`code` = t3.teacher_code\n"
+
"\t\tt2.`code`,\n"
+
"LEFT JOIN s_user t4 ON t4.login_name = t2.`code`\n"
+
"\t\tt4.head_pic\n"
+
"GROUP BY t3.teacher_code) t5 ON t5.`code` = t1.teacher_code\n"
+
"\tFROM\n"
+
"\t\tb_teacher t2\n"
+
"\tLEFT JOIN b_sl t3 ON t2.`code` = t3.teacher_code\n"
+
"\tLEFT JOIN s_user t4 ON t4.login_name = t2.`code`\n"
+
"\tGROUP BY\n"
+
"\t\tt3.teacher_code\n"
+
") t5 ON t5.`code` = t1.teacher_code\n"
+
"WHERE\n"
+
"WHERE\n"
+
"
\t
t1.business_id = #{id}</script>"
)
"t1.business_id = #{id}</script>"
)
SlDetailDTO
selectSlDetailDTOById
(
@Param
(
"id"
)
String
id
);
SlDetailDTO
selectSlDetailDTOById
(
@Param
(
"id"
)
String
id
);
/**
/**
...
@@ -224,12 +214,12 @@ public interface BSlRepository extends BaseMapper<BSl> {
...
@@ -224,12 +214,12 @@ public interface BSlRepository extends BaseMapper<BSl> {
@Select
(
"<script>select *, bl.lesson_name as lessonName from b_sl sl left join b_r_sl_student stu on sl.code = stu.sl_code "
+
@Select
(
"<script>select *, bl.lesson_name as lessonName from b_sl sl left join b_r_sl_student stu on sl.code = stu.sl_code "
+
"left join b_term bt on sl.term_code = bt.code "
+
"left join b_term bt on sl.term_code = bt.code "
+
"left join b_lesson bl on sl.lesson_code = bl.code "
+
"left join b_lesson bl on sl.lesson_code = bl.code "
+
"where sl.del_flag != '1' and sl.flag = '1' "
+
"where sl.del_flag != '1' and sl.flag = '1'
and sl.audit_status = '4'
"
+
"<if test=\"lessonName!=null and lessonName != ''\">"
+
"<if test=\"lessonName!=null and lessonName != ''\">"
+
" AND bl.lesson_name LIKE CONCAT('%',#{lessonName},'%') "
+
" AND bl.lesson_name LIKE CONCAT('%',#{lessonName},'%') "
+
"</if>"
+
"</if>"
+
"<if test=\"term
!=null and term
!= ''\">"
+
"<if test=\"term
Code!=null and termCode
!= ''\">"
+
" AND
bt.name LIKE CONCAT('%',#{term
},'%') "
+
" AND
sl.term_code LIKE CONCAT('%',#{termCode
},'%') "
+
"</if>"
+
"</if>"
+
"<if test=\"studentCode!=null and studentCode != ''\">"
+
"<if test=\"studentCode!=null and studentCode != ''\">"
+
" AND stu.student_code = #{studentCode} "
+
" AND stu.student_code = #{studentCode} "
+
...
@@ -240,7 +230,7 @@ public interface BSlRepository extends BaseMapper<BSl> {
...
@@ -240,7 +230,7 @@ public interface BSlRepository extends BaseMapper<BSl> {
"</script>"
)
"</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
@ResultMap
(
value
=
"BaseResultMap"
)
List
<
BSl
>
historySlByCodeByPagination
(
@Param
(
"lessonName"
)
String
lessonName
,
List
<
BSl
>
historySlByCodeByPagination
(
@Param
(
"lessonName"
)
String
lessonName
,
@Param
(
"term
"
)
String
term
,
@Param
(
"term
Code"
)
String
termCode
,
@Param
(
"studentCode"
)
String
studentCode
,
@Param
(
"studentCode"
)
String
studentCode
,
@Param
(
"teacherCode"
)
String
teacherCode
);
@Param
(
"teacherCode"
)
String
teacherCode
);
...
@@ -248,6 +238,6 @@ public interface BSlRepository extends BaseMapper<BSl> {
...
@@ -248,6 +238,6 @@ public interface BSlRepository extends BaseMapper<BSl> {
int
updateAuditStatus
(
@Param
(
"slId"
)
String
slId
,
@Param
(
"code"
)
String
code
);
int
updateAuditStatus
(
@Param
(
"slId"
)
String
slId
,
@Param
(
"code"
)
String
code
);
@Select
(
"select audit_status from b_sl where business_id = #{slId}"
)
@Select
(
"select audit_status from b_sl where business_id = #{slId}"
)
String
queryStateById
(
String
slId
);
String
queryStateById
(
@Param
(
"slId"
)
String
slId
);
}
}
src/main/java/org/rcisoft/business/bsl/dto/SlDetailDTO.java
View file @
f25ca85d
...
@@ -18,8 +18,13 @@ public class SlDetailDTO {
...
@@ -18,8 +18,13 @@ public class SlDetailDTO {
private
String
teaName
;
private
String
teaName
;
private
String
teaSlNum
;
private
String
teaSlNum
;
private
String
teaCode
;
private
String
teaCode
;
private
String
isTest
;
private
String
experiment
;
@Transient
private
String
video
;
private
String
video
;
private
String
ppt
;
private
String
pdf
;
private
String
credits
;
private
String
classHour
;
private
String
directionName
;
private
String
termName
;
private
String
auditStatus
;
}
}
src/main/java/org/rcisoft/business/bsl/service/BSlService.java
View file @
f25ca85d
...
@@ -118,7 +118,7 @@ public interface BSlService{
...
@@ -118,7 +118,7 @@ public interface BSlService{
int
queryBslTeacher
(
String
teacherCode
,
String
businessId
);
int
queryBslTeacher
(
String
teacherCode
,
String
businessId
);
List
<
BSl
>
historySlByCodeByPagination
(
PageUtil
pageUtil
,
String
lessonName
,
String
term
,
String
studentCode
,
String
teacherCode
);
List
<
BSl
>
historySlByCodeByPagination
(
PageUtil
pageUtil
,
String
lessonName
,
String
term
Code
,
String
studentCode
,
String
teacherCode
);
int
auditBsl
(
String
slId
,
String
status
,
String
opinion
);
int
auditBsl
(
String
slId
,
String
status
,
String
opinion
);
}
}
src/main/java/org/rcisoft/business/bsl/service/impl/BSlServiceImpl.java
View file @
f25ca85d
...
@@ -334,8 +334,8 @@ public class BSlServiceImpl implements BSlService {
...
@@ -334,8 +334,8 @@ public class BSlServiceImpl implements BSlService {
}
}
@Override
@Override
public
List
<
BSl
>
historySlByCodeByPagination
(
PageUtil
pageUtil
,
String
lessonName
,
String
term
,
String
studentCode
,
String
teacherCode
)
{
public
List
<
BSl
>
historySlByCodeByPagination
(
PageUtil
pageUtil
,
String
lessonName
,
String
term
Code
,
String
studentCode
,
String
teacherCode
)
{
return
bSlRepository
.
historySlByCodeByPagination
(
lessonName
,
term
,
studentCode
,
teacherCode
);
return
bSlRepository
.
historySlByCodeByPagination
(
lessonName
,
term
Code
,
studentCode
,
teacherCode
);
}
}
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
...
...
src/main/java/org/rcisoft/config/NullSerializer.java
0 → 100644
View file @
f25ca85d
package
org
.
rcisoft
.
config
;
import
com.fasterxml.jackson.core.JsonGenerator
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.databind.JsonSerializer
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.SerializerProvider
;
import
java.io.IOException
;
/**
* Created by YangZhaojun on 2018/1/3.
* 自定义ObjectMapper
* springBoot返回json数据时会将数据库为null的字段过滤,前台看不见返回值,这个类是null值转化为空字符串操作,便于前台判断
*/
public
class
NullSerializer
extends
ObjectMapper
{
private
static
final
long
serialVersionUID
=
-
2785650514571869859L
;
public
NullSerializer
(){
super
();
// null值处理为空字符串
this
.
getSerializerProvider
().
setNullValueSerializer
(
new
JsonSerializer
<
Object
>()
{
@Override
public
void
serialize
(
Object
value
,
JsonGenerator
jg
,
SerializerProvider
sp
)
throws
IOException
,
JsonProcessingException
{
jg
.
writeString
(
""
);
}
});
}
}
src/main/java/org/rcisoft/config/NullSerializerConfig.java
0 → 100644
View file @
f25ca85d
package
org
.
rcisoft
.
config
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.http.converter.json.MappingJackson2HttpMessageConverter
;
/**
* Created by YangZhaojun on 2018/1/3.
* 将自定义ObjectMapper加入到SpringBoot中
*/
@Configuration
public
class
NullSerializerConfig
{
@Bean
public
MappingJackson2HttpMessageConverter
mappingJacksonHttpMessageConverter
()
{
final
MappingJackson2HttpMessageConverter
converter
=
new
MappingJackson2HttpMessageConverter
();
NullSerializer
mapper
=
new
NullSerializer
();
converter
.
setObjectMapper
(
mapper
);
return
converter
;
}
}
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