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
4037015d
Commit
4037015d
authored
Sep 29, 2019
by
root
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改接口
parent
2d77a449
Changes
31
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
695 additions
and
213 deletions
+695
-213
BannerExceptMessage.java
.../rcisoft/business/bbanner/common/BannerExceptMessage.java
+0
-8
BBannerController.java
...cisoft/business/bbanner/controller/BBannerController.java
+2
-2
BBannerRepository.java
...a/org/rcisoft/business/bbanner/dao/BBannerRepository.java
+8
-1
FindBannerPaginDTO.java
.../org/rcisoft/business/bbanner/dto/FindBannerPaginDTO.java
+2
-0
BBannerServiceImpl.java
...oft/business/bbanner/service/impl/BBannerServiceImpl.java
+15
-5
BChapterController.java
...soft/business/bchapter/controller/BChapterController.java
+1
-1
BCourseController.java
...cisoft/business/bcourse/controller/BCourseController.java
+6
-3
BDiscussController.java
...soft/business/bdiscuss/controller/BDiscussController.java
+1
-1
BFileController.java
...rg/rcisoft/business/bfile/controller/BFileController.java
+1
-1
BLabelController.java
.../rcisoft/business/blabel/controller/BLabelController.java
+1
-1
BLessonController.java
...cisoft/business/blesson/controller/BLessonController.java
+28
-18
BLessonPersonRepository.java
...rcisoft/business/blesson/dao/BLessonPersonRepository.java
+3
-2
BLessonRepository.java
...a/org/rcisoft/business/blesson/dao/BLessonRepository.java
+128
-64
BViewrangeRepository.java
...rg/rcisoft/business/blesson/dao/BViewrangeRepository.java
+53
-0
FindAllLessonDTO.java
...va/org/rcisoft/business/blesson/dto/FindAllLessonDTO.java
+2
-0
FindListLessonDTO.java
...a/org/rcisoft/business/blesson/dto/FindListLessonDTO.java
+38
-0
FirstPageQueryDTO.java
...a/org/rcisoft/business/blesson/dto/FirstPageQueryDTO.java
+2
-0
QuitLessonDTO.java
.../java/org/rcisoft/business/blesson/dto/QuitLessonDTO.java
+24
-0
BLesson.java
...ain/java/org/rcisoft/business/blesson/entity/BLesson.java
+31
-0
BLessonPerson.java
...va/org/rcisoft/business/blesson/entity/BLessonPerson.java
+1
-1
BViewrange.java
.../java/org/rcisoft/business/blesson/entity/BViewrange.java
+13
-16
BViewrangeSon.java
...va/org/rcisoft/business/blesson/entity/BViewrangeSon.java
+29
-0
BLessonPersonService.java
...cisoft/business/blesson/service/BLessonPersonService.java
+4
-2
BLessonService.java
.../org/rcisoft/business/blesson/service/BLessonService.java
+14
-5
BLessonPersonServiceImpl.java
...siness/blesson/service/impl/BLessonPersonServiceImpl.java
+17
-2
BLessonServiceImpl.java
...oft/business/blesson/service/impl/BLessonServiceImpl.java
+151
-79
FileUploadController.java
...a/org/rcisoft/common/controller/FileUploadController.java
+84
-0
FileUpload.java
src/main/java/org/rcisoft/common/model/FileUpload.java
+13
-0
ResultExceptionEnum.java
...ain/java/org/rcisoft/core/result/ResultExceptionEnum.java
+4
-0
SysUserController.java
...va/org/rcisoft/sys/user/controller/SysUserController.java
+1
-1
BViewrangeMapper.xml
...urces/mapper/business/blesson/mapper/BViewrangeMapper.xml
+18
-0
No files found.
src/main/java/org/rcisoft/business/bbanner/common/BannerExceptMessage.java
deleted
100644 → 0
View file @
2d77a449
package
org
.
rcisoft
.
business
.
bbanner
.
common
;
public
class
BannerExceptMessage
{
public
static
final
String
NO_DATA
=
"该数据不存在"
;
public
static
final
String
MUST_NOT_FILLED
=
"必填未填写"
;
}
src/main/java/org/rcisoft/business/bbanner/controller/BBannerController.java
View file @
4037015d
...
...
@@ -32,7 +32,7 @@ import javax.validation.Valid;
* @date 2019/9/11
*/
@Api
(
tags
=
"1 Banner接口"
)
@Api
(
tags
=
"
0
1 Banner接口"
)
@RestController
@RequestMapping
(
"/Banner"
)
@Slf4j
...
...
@@ -107,7 +107,7 @@ public class BBannerController extends PaginationController<BBanner> {
topDownDTO);
}*/
@ApiOperation
(
value
=
"10
7
Banner重新排序"
,
notes
=
"Banner重新排序"
)
@ApiOperation
(
value
=
"10
5
Banner重新排序"
,
notes
=
"Banner重新排序"
)
@PostMapping
(
value
=
"/updateBannerOrder"
)
public
Result
updateBannerOrder
(
CurUser
curUser
,
@Param
(
"bannerOrderMap"
)
String
bannerOrderMap
,
BindingResult
bindingResult
){
int
data
=
bBannerService
.
updateBannerOrder
(
bannerOrderMap
);
...
...
src/main/java/org/rcisoft/business/bbanner/dao/BBannerRepository.java
View file @
4037015d
...
...
@@ -28,7 +28,7 @@ public interface BBannerRepository extends BaseMapper<BBanner> {
* @return
*/
@Select
(
"<script>select * from b_banner where del_flag='0' and flag = '1' "
+
" <if test=\"businessId!=null and businessId != ''\">and
title
business_id = #{businessId})</if>"
+
" <if test=\"businessId!=null and businessId != ''\">and business_id = #{businessId})</if>"
+
" <if test=\"title!=null and title != ''\">and title like CONCAT('%',#{title},'%')</if>"
+
" <if test=\"isExternalLink!=null and isExternalLink != ''\">and is_external_link=#{isExternalLink}</if>"
+
" <if test=\"lineType!=null and lineType != ''\">and line_type=#{lineType}</if>"
+
...
...
@@ -47,6 +47,13 @@ public interface BBannerRepository extends BaseMapper<BBanner> {
"</script>"
)
int
selectCountById
(
String
id
);
/**
* 查询Banner个数
* @return
*/
@Select
(
"<script>select count(1) from b_banner where "
+
" del_flag = 0 and flag = 1 </script>"
)
int
selectCountBanner
();
/**
* 获取sort最大值 +1
...
...
src/main/java/org/rcisoft/business/bbanner/dto/FindBannerPaginDTO.java
View file @
4037015d
...
...
@@ -19,4 +19,6 @@ public class FindBannerPaginDTO {
@ApiModelProperty
(
value
=
"类型(0:线下,1:线上)"
,
required
=
false
,
dataType
=
"varchar"
)
private
String
lineType
;
// private String corpId;
}
src/main/java/org/rcisoft/business/bbanner/service/impl/BBannerServiceImpl.java
View file @
4037015d
package
org
.
rcisoft
.
business
.
bbanner
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.rcisoft.business.bbanner.common.BannerExceptMessage
;
import
org.rcisoft.business.bbanner.dto.AddOrUpdateDTO
;
import
org.rcisoft.business.bbanner.dto.BannerInfoRspDTO
;
import
org.rcisoft.business.bbanner.dto.FindBannerPaginDTO
;
...
...
@@ -10,6 +10,7 @@ import org.rcisoft.business.bbanner.dto.TopDownDTO;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.exception.ServiceException
;
import
org.rcisoft.core.model.PersistModel
;
import
org.rcisoft.core.result.ResultExceptionEnum
;
import
org.rcisoft.core.util.UserUtil
;
import
org.rcisoft.business.bbanner.dao.BBannerRepository
;
import
org.rcisoft.business.bbanner.entity.BBanner
;
...
...
@@ -28,6 +29,7 @@ import java.util.Map;
* @author
* @date 2019/9/10
*/
@Slf4j
@Service
@Transactional
(
readOnly
=
true
,
propagation
=
Propagation
.
NOT_SUPPORTED
)
public
class
BBannerServiceImpl
implements
BBannerService
{
...
...
@@ -45,18 +47,25 @@ public class BBannerServiceImpl implements BBannerService {
int
line
=
0
;
//外部链接但外部URL为空或长度为0 抛异常
if
(
"1"
.
equals
(
model
.
getIsExternalLink
())
&&
StringUtils
.
isEmpty
(
model
.
getExternalUrl
()))
throw
new
ServiceException
(
BannerExceptMessage
.
MUST_NOT_FILLED
);
throw
new
ServiceException
(
ResultExceptionEnum
.
MUST_NOT_FILLED
);
//内部链接但类型或课程ID为空或长度为0 抛异常
if
(
"0"
.
equals
(
model
.
getIsExternalLink
())
&&
(
StringUtils
.
isEmpty
(
model
.
getLineType
())
||
StringUtils
.
isEmpty
(
model
.
getCourseId
())))
throw
new
ServiceException
(
BannerExceptMessage
.
MUST_NOT_FILLED
);
throw
new
ServiceException
(
ResultExceptionEnum
.
MUST_NOT_FILLED
);
if
(
model
.
getBusinessId
()
!=
null
)
{
//按ID查询Banner个数
if
(
bBannerRepository
.
selectCountById
(
model
.
getBusinessId
())
==
0
){
throw
new
ServiceException
(
BannerExceptMessage
.
NO_DATA
);
throw
new
ServiceException
(
ResultExceptionEnum
.
NO_DATA
);
}
UserUtil
.
setCurrentMergeOperation
(
model
);
line
=
bBannerRepository
.
updateById
(
model
);
}
else
{
UserUtil
.
setCurrentPersistOperation
(
model
);
//查询Banner是否大于等于5个,大于等于五个不允许添加
int
countBanner
=
bBannerRepository
.
selectCountBanner
();
if
(
countBanner
>=
5
){
throw
new
ServiceException
(
ResultExceptionEnum
.
NOT_MORE_COUNT
);
}
//查询最大排序值+1后放入Banner中
int
sort
=
bBannerRepository
.
selectMaxSort
();
model
.
setBannerSort
(
sort
);
line
=
bBannerRepository
.
insertSelective
(
model
);
...
...
@@ -68,7 +77,7 @@ public class BBannerServiceImpl implements BBannerService {
@Override
public
PersistModel
removeBanner
(
String
id
)
{
if
(
bBannerRepository
.
selectCountById
(
id
)
==
0
){
throw
new
ServiceException
(
BannerExceptMessage
.
NO_DATA
);
throw
new
ServiceException
(
ResultExceptionEnum
.
NO_DATA
);
}
return
new
PersistModel
(
1
,
bBannerRepository
.
deleteBanner
(
id
));
...
...
@@ -84,6 +93,7 @@ public class BBannerServiceImpl implements BBannerService {
@Override
public
List
<
BBanner
>
queryBannerByPagination
(
PageUtil
pageUtil
,
FindBannerPaginDTO
model
)
{
// log.info("------zql---------"+model.getCorpId());
return
bBannerRepository
.
queryBanners
(
model
);
}
...
...
src/main/java/org/rcisoft/business/bchapter/controller/BChapterController.java
View file @
4037015d
...
...
@@ -48,7 +48,7 @@ import java.util.Map;
/**
* Created by gwf on 2017-7-21 15:08:47.
*/
@Api
(
tags
=
"2 章节"
)
@Api
(
tags
=
"
0
2 章节"
)
@RestController
@RequestMapping
(
"/BChapter"
)
@Slf4j
...
...
src/main/java/org/rcisoft/business/bcourse/controller/BCourseController.java
View file @
4037015d
...
...
@@ -30,7 +30,7 @@ import java.util.ArrayList;
import
java.util.List
;
import
java.util.Map
;
@Api
(
tags
=
"3 课程分类"
)
@Api
(
tags
=
"
0
3 课程分类"
)
@RestController
@RequestMapping
(
"/BCourse"
)
public
class
BCourseController
extends
PaginationController
<
BCourse
>
{
...
...
@@ -58,12 +58,15 @@ public class BCourseController extends PaginationController<BCourse> {
@ApiOperation
(
value
=
"302 根据条件分页查询"
,
notes
=
"根据条件分页查询标签"
)
@ApiImplicitParam
(
name
=
"cName"
,
value
=
"(课程名)模糊查询"
,
required
=
false
,
dataType
=
"varchar"
)
@GetMapping
(
value
=
"/queryBCourseByPagination"
)
public
GridModel
queryBCourseByPagination
(
CurUser
curUser
,
@Valid
String
cName
,
BindingResult
br
)
{
public
Result
queryBCourseByPagination
(
CurUser
curUser
,
@Valid
String
cName
,
BindingResult
br
)
{
BCourse
bCourse
=
new
BCourse
();
bCourse
.
setCName
(
cName
);
bCourseServiceImpl
.
queryBCourseByPagination
(
getPaginationUtility
(),
bCourse
);
GridModel
gridModel
=
getGridModelResponse
();
return
gridModel
;
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
gridModel
);
}
@ApiOperation
(
value
=
"303 查询所有一级课程分类"
,
notes
=
"查询所有一级课程分类"
)
...
...
src/main/java/org/rcisoft/business/bdiscuss/controller/BDiscussController.java
View file @
4037015d
...
...
@@ -30,7 +30,7 @@ import java.util.List;
/**
* Created by on 2019-9-25 9:03:09.
*/
@Api
(
tags
=
"8 课程评论"
)
@Api
(
tags
=
"
0
8 课程评论"
)
@RestController
@RequestMapping
(
"bdiscuss"
)
public
class
BDiscussController
extends
PaginationController
<
BDiscuss
>
{
...
...
src/main/java/org/rcisoft/business/bfile/controller/BFileController.java
View file @
4037015d
...
...
@@ -29,7 +29,7 @@ import java.util.List;
/**
* Created by gaowenfneg on 2017-10-9 14:34:56.
*/
@Api
(
tags
=
"4 文件"
)
@Api
(
tags
=
"
0
4 文件"
)
@RestController
@RequestMapping
(
"/BVideo"
)
public
class
BFileController
extends
PaginationController
<
BFile
>
{
...
...
src/main/java/org/rcisoft/business/blabel/controller/BLabelController.java
View file @
4037015d
...
...
@@ -22,7 +22,7 @@ import org.springframework.web.bind.annotation.RestController;
import
javax.servlet.http.HttpServletRequest
;
import
javax.validation.Valid
;
@Api
(
tags
=
"5 标签"
)
@Api
(
tags
=
"
0
5 标签"
)
@RestController
@RequestMapping
(
"/BLabel"
)
public
class
BLabelController
extends
PaginationController
<
BLabel
>
{
...
...
src/main/java/org/rcisoft/business/blesson/controller/BLessonController.java
View file @
4037015d
...
...
@@ -34,7 +34,7 @@ import java.util.List;
/**
* Created by CodeGenerator on 2017/07/12.
*/
@Api
(
tags
=
"6 课程"
)
@Api
(
tags
=
"
0
6 课程"
)
@Slf4j
@RestController
@RequestMapping
(
"/BLesson"
)
...
...
@@ -93,7 +93,7 @@ public class BLessonController extends PaginationController<BLesson> {
@GetMapping
(
value
=
"/queryBLessonsByPagination"
)
public
Result
queryBLessonsByPagination
(
CurUser
curUser
,
String
releaseState
,
BindingResult
bindingResult
)
{
String
userId
=
curUser
.
getUserId
();
bLessonService
.
queryBLessonsByPagination
(
getPaginationUtility
(),
releaseState
,
userId
);
bLessonService
.
queryBLessonsByPagination
(
getPaginationUtility
(),
releaseState
,
curUser
);
GridModel
gridModel
=
getGridModelResponse
();
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
...
...
@@ -105,7 +105,8 @@ public class BLessonController extends PaginationController<BLesson> {
@ApiOperation
(
value
=
"605 根据条件分页查询全部课程"
,
notes
=
"根据条件分页查询全部课程"
)
@GetMapping
(
value
=
"/queryAllBLessonsByPagination"
)
public
Result
queryBLessonsByPagination
(
CurUser
curUser
,
@Valid
FindAllLessonDTO
findAllLessonDTO
,
BindingResult
bindingResult
)
{
public
Result
queryAllBLessonsByPagination
(
CurUser
curUser
,
@Valid
FindAllLessonDTO
findAllLessonDTO
,
BindingResult
bindingResult
)
{
findAllLessonDTO
.
setCropId
(
curUser
.
getCorpId
());
bLessonService
.
queryAllBLessonsByPagination
(
getPaginationUtility
(),
findAllLessonDTO
);
GridModel
gridModel
=
getGridModelResponse
();
return
Result
.
builder
(
new
PersistModel
(
1
),
...
...
@@ -117,8 +118,7 @@ public class BLessonController extends PaginationController<BLesson> {
@ApiOperation
(
value
=
"606 分页查询大家都在学"
,
notes
=
"分页查询大家都在学"
)
@GetMapping
(
value
=
"/queryPersonMoreByPagination"
)
public
Result
queryPersonMoreByPagination
(
CurUser
curUser
)
{
String
userId
=
curUser
.
getUserId
();
bLessonService
.
queryPersonMoreByPagination
(
getPaginationUtility
(),
userId
);
bLessonService
.
queryPersonMoreByPagination
(
getPaginationUtility
(),
curUser
);
GridModel
gridModel
=
getGridModelResponse
();
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
...
...
@@ -129,8 +129,7 @@ public class BLessonController extends PaginationController<BLesson> {
@ApiOperation
(
value
=
"607 分页查询企业推荐"
,
notes
=
"分页查询企业推荐"
)
@GetMapping
(
value
=
"/queryRecommendByPagination"
)
public
Result
queryRecommendByPagination
(
CurUser
curUser
)
{
String
userId
=
curUser
.
getUserId
();
bLessonService
.
queryRecommendByPagination
(
getPaginationUtility
(),
userId
);
bLessonService
.
queryRecommendByPagination
(
getPaginationUtility
(),
curUser
);
GridModel
gridModel
=
getGridModelResponse
();
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
...
...
@@ -141,8 +140,7 @@ public class BLessonController extends PaginationController<BLesson> {
@ApiOperation
(
value
=
"608 分页查询最受关注"
,
notes
=
"分页查询最受关注"
)
@GetMapping
(
value
=
"/queryConcernByPagination"
)
public
Result
queryConcernByPagination
(
CurUser
curUser
)
{
String
userId
=
curUser
.
getUserId
();
bLessonService
.
queryConcernByPagination
(
getPaginationUtility
(),
userId
);
bLessonService
.
queryConcernByPagination
(
getPaginationUtility
(),
curUser
);
GridModel
gridModel
=
getGridModelResponse
();
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
...
...
@@ -154,8 +152,7 @@ public class BLessonController extends PaginationController<BLesson> {
@ApiOperation
(
value
=
"609 分页查询可能感兴趣"
,
notes
=
"分页查询可能感兴趣"
)
@GetMapping
(
value
=
"/queryInterestedByPagination"
)
public
Result
queryInterestedByPagination
(
CurUser
curUser
)
{
String
userId
=
curUser
.
getUserId
();
bLessonService
.
queryInterestedByPagination
(
getPaginationUtility
(),
userId
);
bLessonService
.
queryInterestedByPagination
(
getPaginationUtility
(),
curUser
);
GridModel
gridModel
=
getGridModelResponse
();
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
...
...
@@ -201,7 +198,7 @@ public class BLessonController extends PaginationController<BLesson> {
gridModel
);
}
@ApiOperation
(
value
=
"613 我
发布的课程总数"
,
notes
=
"我发布
的课程总数"
)
@ApiOperation
(
value
=
"613 我
的课程总数(学习和发布)"
,
notes
=
"我
的课程总数"
)
@GetMapping
(
value
=
"/iLessonCount"
)
public
Result
ILessonCountDTO
(
CurUser
curUser
)
{
String
userId
=
curUser
.
getUserId
();
...
...
@@ -211,18 +208,15 @@ public class BLessonController extends PaginationController<BLesson> {
bLessonService
.
iLessonCount
(
userId
));
}
@ApiOperation
(
value
=
"614 退出课程"
,
notes
=
"根据ID停用一条记录"
)
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"退出课程的选课id"
,
required
=
true
,
dataType
=
"varchar"
)
@PostMapping
(
value
=
"/quit"
)
public
Result
quit
(
CurUser
curUser
,
String
businessId
,
BindingResult
bindingResult
)
{
PersistModel
data
=
bLessonPersonService
.
quit
(
businessId
);
public
Result
quit
(
CurUser
curUser
,
@Valid
QuitLessonDTO
quitLessonDTO
,
BindingResult
bindingResult
)
{
PersistModel
data
=
bLessonPersonService
.
quit
(
quitLessonDTO
);
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
businessId
);
quitLessonDTO
);
}
@ApiOperation
(
value
=
"615 分页查询我学习"
,
notes
=
"分页查询我学习"
)
...
...
@@ -237,4 +231,20 @@ public class BLessonController extends PaginationController<BLesson> {
gridModel
);
}
@ApiOperation
(
value
=
"616 分页查询列表页全部"
,
notes
=
"分页查询列表页全部"
)
@GetMapping
(
value
=
"/queryListAllLessonByPagination"
)
public
Result
queryListAllLessonByPagination
(
CurUser
curUser
,
@Valid
FindListLessonDTO
param
,
BindingResult
bindingResult
)
{
List
<
AllCourseDTO
>
allCourse
=
null
;
if
(
StringUtils
.
isNotEmpty
(
param
.
getCourse
())){
allCourse
=
bCourseService
.
findAllCourse
(
curUser
.
getCorpId
());
}
bLessonService
.
queryListAllLessonByPagination
(
getPaginationUtility
(),
param
,
allCourse
);
GridModel
gridModel
=
getGridModelResponse
();
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
gridModel
);
}
}
src/main/java/org/rcisoft/business/blesson/dao/BLessonPersonRepository.java
View file @
4037015d
...
...
@@ -4,13 +4,14 @@ import org.apache.ibatis.annotations.*;
import
org.rcisoft.business.blabel.entity.BLabel
;
import
org.rcisoft.business.blesson.entity.BLesson
;
import
org.rcisoft.business.blesson.dto.ILearnLessonDTO
;
import
org.rcisoft.business.blesson.entity.BLessonPerson
;
import
org.rcisoft.core.base.BaseMapper
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
@Repository
public
interface
BLessonPersonRepository
extends
BaseMapper
<
BL
abel
>
{
public
interface
BLessonPersonRepository
extends
BaseMapper
<
BL
essonPerson
>
{
//我学习的课程
@Select
(
"<script> select blp.*,bl.lesson_name lessonName,bl.default_url defaultUrl,bl.person_number personNumber, "
+
...
...
@@ -37,7 +38,7 @@ public interface BLessonPersonRepository extends BaseMapper<BLabel> {
// 退出课程
@Update
(
"update b_lesson_
label
set flag = 0 where business_id = #{id}"
)
@Update
(
"update b_lesson_
person
set flag = 0 where business_id = #{id}"
)
int
quit
(
String
id
);
...
...
src/main/java/org/rcisoft/business/blesson/dao/BLessonRepository.java
View file @
4037015d
This diff is collapsed.
Click to expand it.
src/main/java/org/rcisoft/business/blesson/dao/BViewrangeRepository.java
0 → 100644
View file @
4037015d
package
org
.
rcisoft
.
business
.
blesson
.
dao
;
import
org.apache.ibatis.annotations.*
;
import
org.rcisoft.business.blesson.entity.BViewrangeSon
;
import
org.rcisoft.core.base.BaseMapper
;
import
org.rcisoft.business.blesson.entity.BViewrange
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
/**
* Created with on 2019-9-28 14:19:05.
*/
@Repository
public
interface
BViewrangeRepository
extends
BaseMapper
<
BViewrange
>
{
/**
* 分页查询 bViewrange
*
*/
@Select
(
"<script>select * from b_viewrange where 1=1 "
+
"<if test=\"delFlag !=null and delFlag != '' \">and del_flag = #{delFlag} </if> "
+
"<if test=\"flag !=null and flag != '' \">and flag = #{flag} </if> "
+
"</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
List
<
BViewrange
>
queryBViewranges
(
BViewrange
bViewrange
);
@Update
({
"<script>"
,
"update b_banner"
,
" <set>"
,
" <if test='updateBy != null'>update_by=#{updateBy},</if>"
,
" <if test='updateDate != null'>update_date=#{updateDate},</if>"
,
" <if test='delFlag != null'>del_flag=#{delFlag},</if>"
,
" <if test='flag != null'>flag=#{flag},</if>"
,
" <if test='remarks != null'>remarks=#{remarks},</if>"
,
" <if test='type != null'>title=#{type},</if>"
,
" </set>"
,
"where lesson_id=#{lessonId}"
,
"</script>"
})
int
updateByLessonId
(
BViewrange
bViewrange
);
@Delete
(
"<script>DELETE from b_viewrange_son where viewrange_id=#{businessId}</script>"
)
int
deleteViewrangeSon
(
BViewrange
bViewrange
);
@Insert
(
"<script>INSERT INTO b_viewrange_son"
+
"(business_id,viewrange_id,type,target_id)VALUES"
+
"<foreach collection=\"list\" item=\"item\" separator=\",\">"
+
"(#{item.businessId},#{item.viewrangeId},#{item.type},#{item.targetId})"
+
"</foreach></script>"
)
int
insertBViewrangeSons
(
List
<
BViewrangeSon
>
bViewrangeSons
);
}
src/main/java/org/rcisoft/business/blesson/dto/FindAllLessonDTO.java
View file @
4037015d
...
...
@@ -44,4 +44,6 @@ public class FindAllLessonDTO {
@ApiModelProperty
(
value
=
"创建人姓名"
)
private
String
createByName
;
private
String
cropId
;
}
src/main/java/org/rcisoft/business/blesson/dto/FindListLessonDTO.java
0 → 100644
View file @
4037015d
package
org
.
rcisoft
.
business
.
blesson
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
org.hibernate.validator.constraints.Length
;
import
javax.validation.constraints.NotNull
;
import
java.util.List
;
@Data
public
class
FindListLessonDTO
{
@ApiModelProperty
(
value
=
"查询参数"
,
required
=
false
)
private
String
viewParam
;
@ApiModelProperty
(
value
=
"分类"
,
required
=
false
)
@Length
(
min
=
1
,
max
=
64
,
message
=
"长度最小为1,最大为50"
)
private
String
course
;
@ApiModelProperty
(
value
=
"接收标签id"
)
private
String
labelId
;
@ApiModelProperty
(
value
=
"发布时间排序(1升序 0降序)"
,
required
=
true
)
@NotNull
private
String
releaseDateSort
;
@ApiModelProperty
(
value
=
"课程类型"
,
required
=
true
)
private
String
lessonType
;
private
List
<
String
>
courseIds
;
private
String
userId
;
private
String
corpId
;
private
List
<
String
>
departs
;
}
src/main/java/org/rcisoft/business/blesson/dto/FirstPageQueryDTO.java
View file @
4037015d
...
...
@@ -19,6 +19,8 @@ public class FirstPageQueryDTO {
private
String
userId
;
private
String
corpId
;
//部门id
private
List
<
String
>
departs
;
...
...
src/main/java/org/rcisoft/business/blesson/dto/QuitLessonDTO.java
0 → 100644
View file @
4037015d
package
org
.
rcisoft
.
business
.
blesson
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
org.hibernate.validator.constraints.Length
;
import
javax.validation.constraints.NotNull
;
@Data
public
class
QuitLessonDTO
{
@Length
(
min
=
1
,
max
=
64
,
message
=
"长度最小为1,最大为50"
)
@ApiModelProperty
(
value
=
"选课主键id"
)
@NotNull
private
String
businessId
;
@Length
(
min
=
1
,
max
=
64
,
message
=
"长度最小为1,最大为50"
)
@ApiModelProperty
(
value
=
"课程id"
)
@NotNull
private
String
lessonId
;
private
String
cropId
;
}
src/main/java/org/rcisoft/business/blesson/entity/BLesson.java
View file @
4037015d
...
...
@@ -6,7 +6,10 @@ import lombok.Data;
import
lombok.NoArgsConstructor
;
import
org.hibernate.validator.constraints.Length
;
import
org.rcisoft.business.blabel.dto.QueryLabelResDTO
;
import
org.rcisoft.common.component.Global
;
import
org.rcisoft.core.entity.IdEntity
;
import
org.rcisoft.core.util.UserUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
javax.persistence.Entity
;
import
javax.persistence.Table
;
...
...
@@ -26,6 +29,11 @@ import java.util.List;
public
class
BLesson
extends
IdEntity
<
BLesson
>
{
private
static
final
long
serialVersionUID
=
-
4327021174023243830L
;
// @Transient
// @Autowired
// private Global global;
@Length
(
min
=
1
,
max
=
64
,
message
=
"长度最小为1,最大为50"
)
@ApiModelProperty
(
value
=
"课程编号"
)
private
String
code
;
...
...
@@ -129,5 +137,28 @@ public class BLesson extends IdEntity<BLesson> {
@ApiModelProperty
(
value
=
"可见范围(部门)多人之间用','隔开"
)
@Transient
private
String
viewRangeDepart
;
public
void
initModel
(){
// this.setDefaultUrl(global.getDEFAULT_COURSE_LOCATION());
UserUtil
.
setCurrentPersistOperation
(
this
);
//设置状态为待发布
this
.
setReleaseState
(
"0"
);
//设置讲师为登录人
this
.
setLecturerId
(
this
.
getCreateBy
());
//设置初始报名人数为0
this
.
setPersonNumber
(
"0"
);
//设置初始评论人数为0
this
.
setDiscussNumber
(
"0"
);
//设置初始课时数为0
this
.
setClassHour
(
"0"
);
//设置热度为0
this
.
setHotNumber
(
"0"
);
//设置初始不推荐
this
.
setRecommend
(
"0"
);
//设置初始关注数为0
this
.
setCollectNumber
(
"0"
);
}
}
src/main/java/org/rcisoft/business/blesson/entity/BLessonPerson.java
View file @
4037015d
...
...
@@ -15,7 +15,7 @@ import javax.persistence.Transient;
import
javax.validation.constraints.NotBlank
;
@Entity
@Table
(
name
=
"b_lesson_
label
"
)
@Table
(
name
=
"b_lesson_
person
"
)
@Data
@NoArgsConstructor
@AllArgsConstructor
...
...
src/main/java/org/rcisoft/business/blesson/entity/BViewrange.java
View file @
4037015d
package
org
.
rcisoft
.
business
.
blesson
.
entity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.hibernate.validator.constraints.Length
;
import
org.rcisoft.core.entity.IdEntity
;
import
lombok.*
;
import
javax.persistence.
Entity
;
import
javax.persistence.
Table
;
import
org.rcisoft.core.entity.Id
Entity
;
import
javax.persistence.
*
;
/**
* Created with on 2019-9-28 14:19:05.
*/
@Entity
@Table
(
name
=
"b_viewrange"
)
@Data
@NoArgsConstructor
@AllArgsConstructor
@Table
(
name
=
"b_viewrange"
)
public
class
BViewrange
extends
IdEntity
<
BViewrange
>
{
@ApiModelProperty
(
value
=
"课程id"
)
@Length
(
min
=
1
,
max
=
64
,
message
=
"长度最小为1,最大为50"
)
private
String
lessonId
;
@ApiModelProperty
(
value
=
"可视范围类型(0 人 1 部门 2 人和部门)"
)
@Length
(
min
=
1
,
max
=
1
,
message
=
"长度最小为1,最大为50"
)
private
String
type
;
}
src/main/java/org/rcisoft/business/blesson/entity/BViewrangeSon.java
0 → 100644
View file @
4037015d
package
org
.
rcisoft
.
business
.
blesson
.
entity
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.persistence.Entity
;
import
javax.persistence.Table
;
/**
* Created with on 2019-9-28 14:19:05.
*/
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Table
(
name
=
"b_viewrange_son"
)
public
class
BViewrangeSon
{
private
String
businessId
;
private
String
viewrangeId
;
private
String
type
;
private
String
targetId
;
}
src/main/java/org/rcisoft/business/blesson/service/BLessonPersonService.java
View file @
4037015d
package
org
.
rcisoft
.
business
.
blesson
.
service
;
import
org.rcisoft.business.blesson.dto.FindListLessonDTO
;
import
org.rcisoft.business.blesson.dto.QuitLessonDTO
;
import
org.rcisoft.business.blesson.entity.BLesson
;
import
org.rcisoft.business.blesson.dto.ILearnLessonDTO
;
import
org.rcisoft.core.aop.PageUtil
;
...
...
@@ -12,10 +14,10 @@ public interface BLessonPersonService {
/**
* 退出课程
* @param
id
* @param
quitLessonDTO
* @return
*/
PersistModel
quit
(
String
id
);
PersistModel
quit
(
QuitLessonDTO
quitLessonDTO
);
/**
...
...
src/main/java/org/rcisoft/business/blesson/service/BLessonService.java
View file @
4037015d
...
...
@@ -5,6 +5,7 @@ import org.rcisoft.business.blesson.dto.*;
import
org.rcisoft.business.blesson.entity.BLesson
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.model.PersistModel
;
import
org.rcisoft.sys.user.bean.CurUser
;
import
java.util.List
;
...
...
@@ -34,7 +35,7 @@ public interface BLessonService{
* @param releaseState
* @return
*/
List
<
BLesson
>
queryBLessonsByPagination
(
PageUtil
pageUtil
,
String
releaseState
,
String
userId
);
List
<
BLesson
>
queryBLessonsByPagination
(
PageUtil
pageUtil
,
String
releaseState
,
CurUser
curUser
);
/**
* 根据条件分页查找
...
...
@@ -50,7 +51,7 @@ public interface BLessonService{
* @param
* @return
*/
List
<
BLesson
>
queryPersonMoreByPagination
(
PageUtil
pageUtil
,
String
userId
);
List
<
BLesson
>
queryPersonMoreByPagination
(
PageUtil
pageUtil
,
CurUser
curUser
);
/**
* 分页查找推荐
...
...
@@ -58,7 +59,7 @@ public interface BLessonService{
* @param
* @return
*/
List
<
BLesson
>
queryRecommendByPagination
(
PageUtil
pageUtil
,
String
userId
);
List
<
BLesson
>
queryRecommendByPagination
(
PageUtil
pageUtil
,
CurUser
curUser
);
/**
* 分页查找最受关注
...
...
@@ -66,7 +67,7 @@ public interface BLessonService{
* @param
* @return
*/
List
<
BLesson
>
queryConcernByPagination
(
PageUtil
pageUtil
,
String
userId
);
List
<
BLesson
>
queryConcernByPagination
(
PageUtil
pageUtil
,
CurUser
curUser
);
/**
* 分页查找可能感兴趣的
...
...
@@ -74,7 +75,7 @@ public interface BLessonService{
* @param
* @return
*/
List
<
BLesson
>
queryInterestedByPagination
(
PageUtil
pageUtil
,
String
userId
);
List
<
BLesson
>
queryInterestedByPagination
(
PageUtil
pageUtil
,
CurUser
curUser
);
/**
* 插入
...
...
@@ -118,4 +119,12 @@ public interface BLessonService{
*/
ILessonCountDTO
iLessonCount
(
String
userId
);
/**
* 分页查询列表页全部
* @param pageUtil
* @param model
* @return
*/
List
<
BLesson
>
queryListAllLessonByPagination
(
PageUtil
pageUtil
,
FindListLessonDTO
model
,
List
<
AllCourseDTO
>
allCourse
);
}
src/main/java/org/rcisoft/business/blesson/service/impl/BLessonPersonServiceImpl.java
View file @
4037015d
package
org
.
rcisoft
.
business
.
blesson
.
service
.
impl
;
import
org.rcisoft.business.blesson.dao.BLessonRepository
;
import
org.rcisoft.business.blesson.dto.QuitLessonDTO
;
import
org.rcisoft.business.blesson.entity.BLesson
;
import
org.rcisoft.business.blesson.dao.BLessonPersonRepository
;
import
org.rcisoft.business.blesson.dto.ILearnLessonDTO
;
import
org.rcisoft.business.blesson.entity.BLessonPerson
;
import
org.rcisoft.business.blesson.service.BLessonPersonService
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.exception.ServiceException
;
import
org.rcisoft.core.model.PersistModel
;
import
org.rcisoft.core.result.ResultExceptionEnum
;
import
org.rcisoft.core.result.ResultServiceEnums
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
...
...
@@ -22,14 +28,23 @@ import java.util.List;
@Transactional
(
readOnly
=
true
,
propagation
=
Propagation
.
NOT_SUPPORTED
)
public
class
BLessonPersonServiceImpl
implements
BLessonPersonService
{
@Autowired
private
BLessonRepository
bLessonRepository
;
@Autowired
private
BLessonPersonRepository
bLessonPersonRepository
;
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
@Override
public
PersistModel
quit
(
String
id
)
{
return
new
PersistModel
(
1
,
bLessonPersonRepository
.
quit
(
id
));
public
PersistModel
quit
(
QuitLessonDTO
quitLessonDTO
)
{
BLessonPerson
bLessonPerson
=
bLessonPersonRepository
.
selectByPrimaryKey
(
quitLessonDTO
.
getBusinessId
());
if
(
"1"
.
equals
(
bLessonPerson
.
getIsAppoint
())){
throw
new
ServiceException
(
ResultExceptionEnum
.
APPOINT_NOT_CLOSE
);
}
//课程在学人数-1
bLessonRepository
.
personNumberMinusOne
(
quitLessonDTO
.
getLessonId
());
return
new
PersistModel
(
1
,
bLessonPersonRepository
.
quit
(
quitLessonDTO
.
getBusinessId
()));
}
@Override
...
...
src/main/java/org/rcisoft/business/blesson/service/impl/BLessonServiceImpl.java
View file @
4037015d
This diff is collapsed.
Click to expand it.
src/main/java/org/rcisoft/common/controller/FileUploadController.java
0 → 100644
View file @
4037015d
package
org
.
rcisoft
.
common
.
controller
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.rcisoft.business.blesson.entity.BLesson
;
import
org.rcisoft.common.component.Global
;
import
org.rcisoft.common.model.FileUpload
;
import
org.rcisoft.core.constant.MessageConstant
;
import
org.rcisoft.core.exception.ServiceException
;
import
org.rcisoft.core.model.PersistModel
;
import
org.rcisoft.core.result.Result
;
import
org.rcisoft.core.result.ResultServiceEnums
;
import
org.rcisoft.core.util.UploadUtil
;
import
org.rcisoft.sys.user.bean.CurUser
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.validation.Valid
;
import
java.util.Map
;
@Api
(
tags
=
"09 公共上传图片"
)
@RestController
@RequestMapping
(
"/file"
)
@Slf4j
public
class
FileUploadController
extends
FileController
{
@Autowired
private
Global
global
;
@ApiOperation
(
value
=
"上传图片"
,
notes
=
"上传图片到服务器"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"importFile"
,
value
=
"图片文件"
,
required
=
true
,
dataType
=
"MultipartFile"
),
// @ApiImplicitParam(name = "businessId", value = "课程id", required = true, dataType = "varchar")
})
@PostMapping
(
value
=
"upload"
)
public
Result
upload
(
CurUser
curUser
,
@Valid
MultipartFile
importFile
,
BindingResult
bindingResult
)
throws
Exception
{
Result
result
=
new
Result
();
//获取文件名称
String
originalName
=
importFile
.
getOriginalFilename
();
String
path
=
global
.
getBASE_UPLOAD_SERVER_LOCATION
();
String
course_logo_path
=
global
.
getIMAGE_LOCATION
()+
global
.
getCOURSE_LOGO_LOCATION
();
boolean
type
=
false
;
if
(
"1"
.
equals
(
global
.
getIS_SERVER_LINUX
())){
type
=
true
;
}
Map
<
String
,
Object
>
map
=
UploadUtil
.
picImport
(
path
,
course_logo_path
,
importFile
,
type
);
if
(
map
.
get
(
UploadUtil
.
IS_SUCCESSS
).
equals
(
true
))
{
// BLesson bL=new BLesson();
// bL.setCode(code);
// BLesson bLesson=bLessonService.selectOne(bL);
// if(bLesson!=null){
// bLesson.setDefaultUrl(map.get(UploadUtil.URL).toString());
// UserUtil.setCurrentMergeOperation(bLesson);
// int line = bLessonService.updateByPrimaryKeySelective(bLesson);
// return Result.builder(new PersistModel(line),
// MessageConstant.MESSAGE_ALERT_SUCCESS,
// MessageConstant.MESSAGE_ALERT_ERROR,
// bLessonService.selectOne(code));
// }else{
//
// throw new ServiceException(ResultServiceEnums.UPLOAD_FILE_ERROR);
// }
FileUpload
fileUpload
=
new
FileUpload
();
fileUpload
.
setFileName
(
originalName
);
fileUpload
.
setFilePath
(
"https://img.zcool.cn/community/01a949581aeb9fa84a0d304fd05eeb.jpg@1280w_1l_2o_100sh.jpg"
);
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
fileUpload
);
}
else
{
throw
new
ServiceException
(
ResultServiceEnums
.
ADD_ERROR
);
}
}
}
src/main/java/org/rcisoft/common/model/FileUpload.java
0 → 100644
View file @
4037015d
package
org
.
rcisoft
.
common
.
model
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@Data
@NoArgsConstructor
@AllArgsConstructor
public
class
FileUpload
{
private
String
fileName
;
private
String
filePath
;
}
src/main/java/org/rcisoft/core/result/ResultExceptionEnum.java
View file @
4037015d
...
...
@@ -24,6 +24,10 @@ public enum ResultExceptionEnum {
OS_HAS_SERVER
(
4008
,
"操作系统仍有关联服务器,不可删除"
),
START_LXC_SERVER
(
4009
,
"启动容器失败"
),
EXIST_LXC_SERVER
(
4010
,
"已开始其他课程实验,请先关闭其他课程实验"
),
NO_DATA
(
4011
,
"该数据不存在"
),
MUST_NOT_FILLED
(
4012
,
"必填未填写"
),
NOT_MORE_COUNT
(
4013
,
"添加超过规定个数"
),
APPOINT_NOT_CLOSE
(
4014
,
"必修不能退出"
)
;
private
Integer
code
;
...
...
src/main/java/org/rcisoft/sys/user/controller/SysUserController.java
View file @
4037015d
...
...
@@ -34,7 +34,7 @@ import java.util.List;
/**
* Created by Andrew on 2017/7/6.
*/
@Api
(
tags
=
"7 用户管理"
)
@Api
(
tags
=
"
0
7 用户管理"
)
@RestController
@RequestMapping
(
value
=
"/user"
)
public
class
SysUserController
extends
PaginationController
<
SysUser
>
{
...
...
src/main/resources/mapper/business/blesson/mapper/BViewrangeMapper.xml
0 → 100644
View file @
4037015d
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"org.rcisoft.business.blesson.dao.BViewrangeRepository"
>
<resultMap
id=
"BaseResultMap"
type=
"org.rcisoft.business.blesson.entity.BViewrange"
>
<id
column=
"business_id"
jdbcType=
"VARCHAR"
property=
"businessId"
/>
<result
column=
"create_by"
jdbcType=
"VARCHAR"
property=
"createBy"
/>
<result
column=
"create_date"
jdbcType=
"TIMESTAMP"
property=
"createDate"
/>
<result
column=
"update_by"
jdbcType=
"VARCHAR"
property=
"updateBy"
/>
<result
column=
"update_date"
jdbcType=
"TIMESTAMP"
property=
"updateDate"
/>
<result
column=
"del_flag"
jdbcType=
"VARCHAR"
property=
"delFlag"
/>
<result
column=
"flag"
jdbcType=
"VARCHAR"
property=
"flag"
/>
<result
column=
"remarks"
jdbcType=
"VARCHAR"
property=
"remarks"
/>
<result
column=
"lesson_id"
jdbcType=
"VARCHAR"
property=
"lessonId"
/>
<result
column=
"type"
jdbcType=
"VARCHAR"
property=
"type"
/>
</resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
</mapper>
\ No newline at end of file
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