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
bdbc9f4e
Commit
bdbc9f4e
authored
Oct 18, 2019
by
luzhuang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/meiteng' into meiteng
parents
c97e8310
c02afc9b
Changes
19
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
256 additions
and
127 deletions
+256
-127
BBannerServiceImpl.java
...oft/business/bbanner/service/impl/BBannerServiceImpl.java
+6
-5
BChapterRepository.java
...org/rcisoft/business/bchapter/dao/BChapterRepository.java
+76
-75
QueryChapterListResDTO.java
...rcisoft/business/bchapter/dto/QueryChapterListResDTO.java
+3
-0
BChapterServiceImpl.java
...t/business/bchapter/service/impl/BChapterServiceImpl.java
+1
-3
BLabel.java
src/main/java/org/rcisoft/business/blabel/entity/BLabel.java
+3
-1
BLabelServiceImpl.java
...isoft/business/blabel/service/impl/BLabelServiceImpl.java
+7
-1
BLessonController.java
...cisoft/business/blesson/controller/BLessonController.java
+22
-1
BLessonRepository.java
...a/org/rcisoft/business/blesson/dao/BLessonRepository.java
+19
-11
AddMyLearnLessonDTO.java
...org/rcisoft/business/blesson/dto/AddMyLearnLessonDTO.java
+4
-0
RoleTypeDepartDTO.java
...a/org/rcisoft/business/blesson/dto/RoleTypeDepartDTO.java
+16
-0
BLessonService.java
.../org/rcisoft/business/blesson/service/BLessonService.java
+10
-1
BLessonPersonServiceImpl.java
...siness/blesson/service/impl/BLessonPersonServiceImpl.java
+7
-6
BLessonServiceImpl.java
...oft/business/blesson/service/impl/BLessonServiceImpl.java
+39
-13
MTCotactApiRequestClient.java
...isoft/common/util/outClient/MTCotactApiRequestClient.java
+19
-0
ResultExceptionEnum.java
...ain/java/org/rcisoft/core/result/ResultExceptionEnum.java
+2
-8
ResultServiceEnums.java
...main/java/org/rcisoft/core/result/ResultServiceEnums.java
+9
-0
SysRoleService.java
...ain/java/org/rcisoft/sys/role/service/SysRoleService.java
+3
-0
SysRoleServiceImpl.java
...org/rcisoft/sys/role/service/impl/SysRoleServiceImpl.java
+6
-0
SysUserMapper.java
src/main/java/org/rcisoft/sys/user/dao/SysUserMapper.java
+4
-2
No files found.
src/main/java/org/rcisoft/business/bbanner/service/impl/BBannerServiceImpl.java
View file @
bdbc9f4e
...
...
@@ -11,6 +11,7 @@ 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.rcisoft.core.util.UserUtil
;
import
org.rcisoft.business.bbanner.dao.BBannerRepository
;
import
org.rcisoft.business.bbanner.entity.BBanner
;
...
...
@@ -47,14 +48,14 @@ public class BBannerServiceImpl implements BBannerService {
int
line
=
0
;
//外部链接但外部URL为空或长度为0 抛异常
if
(
"1"
.
equals
(
model
.
getIsExternalLink
())
&&
StringUtils
.
isEmpty
(
model
.
getExternalUrl
()))
throw
new
ServiceException
(
Result
ExceptionEnum
.
MUST_NOT_FILLED
);
throw
new
ServiceException
(
Result
ServiceEnums
.
MUST_NOT_FILLED
);
//内部链接但类型或课程ID为空或长度为0 抛异常
if
(
"0"
.
equals
(
model
.
getIsExternalLink
())
&&
(
StringUtils
.
isEmpty
(
model
.
getLineType
())
||
StringUtils
.
isEmpty
(
model
.
getCourseId
())))
throw
new
ServiceException
(
Result
ExceptionEnum
.
MUST_NOT_FILLED
);
throw
new
ServiceException
(
Result
ServiceEnums
.
MUST_NOT_FILLED
);
if
(
model
.
getBusinessId
()
!=
null
)
{
//按ID查询Banner个数
if
(
bBannerRepository
.
selectCountById
(
model
.
getBusinessId
())
==
0
){
throw
new
ServiceException
(
Result
ExceptionEnum
.
NO_DATA
);
throw
new
ServiceException
(
Result
ServiceEnums
.
NO_DATA
);
}
UserUtil
.
setCurrentMergeOperation
(
model
);
line
=
bBannerRepository
.
updateById
(
model
);
...
...
@@ -63,7 +64,7 @@ public class BBannerServiceImpl implements BBannerService {
//查询Banner是否大于等于5个,大于等于五个不允许添加
int
countBanner
=
bBannerRepository
.
selectCountBanner
(
addOrUpdateDTO
);
if
(
countBanner
>=
5
){
throw
new
ServiceException
(
Result
ExceptionEnum
.
NOT_MORE_COUNT
);
throw
new
ServiceException
(
Result
ServiceEnums
.
NOT_MORE_COUNT
);
}
//查询最大排序值+1后放入Banner中
int
sort
=
bBannerRepository
.
selectMaxSort
();
...
...
@@ -77,7 +78,7 @@ public class BBannerServiceImpl implements BBannerService {
@Override
public
PersistModel
removeBanner
(
String
id
)
{
if
(
bBannerRepository
.
selectCountById
(
id
)
==
0
){
throw
new
ServiceException
(
Result
ExceptionEnum
.
NO_DATA
);
throw
new
ServiceException
(
Result
ServiceEnums
.
NO_DATA
);
}
return
new
PersistModel
(
1
,
bBannerRepository
.
deleteBanner
(
id
));
...
...
src/main/java/org/rcisoft/business/bchapter/dao/BChapterRepository.java
View file @
bdbc9f4e
This diff is collapsed.
Click to expand it.
src/main/java/org/rcisoft/business/bchapter/dto/QueryChapterListResDTO.java
View file @
bdbc9f4e
...
...
@@ -49,6 +49,9 @@ public class QueryChapterListResDTO {
@ApiModelProperty
(
value
=
"进度"
)
private
String
progress
;
@ApiModelProperty
(
value
=
"最近进度"
)
private
int
currentLocation
;
@ApiModelProperty
(
value
=
"id"
)
private
String
businessId
;
...
...
src/main/java/org/rcisoft/business/bchapter/service/impl/BChapterServiceImpl.java
View file @
bdbc9f4e
...
...
@@ -111,6 +111,7 @@ public class BChapterServiceImpl implements BChapterService {
List
<
BRStudentChapter
>
brStudentChapterList
=
brStudentChapterRepository
.
queryByStuIdAndChapter
(
childList
.
getBusinessId
(),
curUser
.
getUserId
());
if
(
null
!=
brStudentChapterList
&&
brStudentChapterList
.
size
()
>
0
)
{
childList
.
setProgress
(
brStudentChapterList
.
get
(
0
).
getProgress
()*
100
+
"%"
);
childList
.
setCurrentLocation
(
brStudentChapterList
.
get
(
0
).
getCurrentLocation
());
percent
+=
brStudentChapterList
.
get
(
0
).
getProgress
();
}
i
++;
...
...
@@ -129,9 +130,6 @@ public class BChapterServiceImpl implements BChapterService {
map
.
put
(
"chapterList"
,
queryChapterListResDTOS
);
map
.
put
(
"totalProgress"
,
df
.
format
((
float
)
percent
/
i
)
+
"%"
);
map
.
put
(
"lessonInfo"
,
bLessonRepository
.
selectByPrimaryKey
(
lessonId
));
// 课程信息
BLessonPerson
bLessonPerson
=
bLessonPersonRepository
.
selectByPrimaryKey
(
lessonId
);
if
(
null
!=
bLessonPerson
){
}
map
.
put
(
"currentChapter"
,
bChapterRepository
.
getWithCurrentChapterBylessonId
(
lessonId
));
return
map
;
...
...
src/main/java/org/rcisoft/business/blabel/entity/BLabel.java
View file @
bdbc9f4e
...
...
@@ -9,6 +9,8 @@ import org.rcisoft.core.entity.IdEntity;
import
javax.persistence.Entity
;
import
javax.persistence.Table
;
import
javax.persistence.Transient
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
@Entity
@Table
(
name
=
"b_label"
)
...
...
@@ -18,7 +20,7 @@ import javax.persistence.Transient;
public
class
BLabel
extends
IdEntity
<
BLabel
>
{
/*标签名称*/
@Length
(
min
=
1
,
max
=
64
,
message
=
"
长度最小为1,最大为50
"
)
@Length
(
min
=
1
,
max
=
64
,
message
=
"
标签名称过长
"
)
private
String
lName
;
}
src/main/java/org/rcisoft/business/blabel/service/impl/BLabelServiceImpl.java
View file @
bdbc9f4e
package
org
.
rcisoft
.
business
.
blabel
.
service
.
impl
;
import
org.apache.commons.lang3.StringUtils
;
import
org.rcisoft.business.blabel.dao.BLabelRepository
;
import
org.rcisoft.business.blabel.entity.BLabel
;
import
org.rcisoft.business.blabel.service.BLabelService
;
...
...
@@ -34,7 +35,9 @@ public class BLabelServiceImpl implements BLabelService {
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
PersistModel
insertLabel
(
BLabel
bLabel
)
{
if
(
StringUtils
.
isBlank
(
bLabel
.
getLName
())){
throw
new
ServiceException
(
"标签名称不能为空"
);
}
List
<
BLabel
>
line
=
bLabelRepository
.
checknameByName
(
bLabel
);
if
(
line
.
size
()>
0
){
throw
new
ServiceException
(
ResultServiceEnums
.
NAME_IS_EXISTS
);
...
...
@@ -46,6 +49,9 @@ public class BLabelServiceImpl implements BLabelService {
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
PersistModel
updateLabel
(
BLabel
bLabel
)
{
if
(
StringUtils
.
isBlank
(
bLabel
.
getLName
())){
throw
new
ServiceException
(
"标签名称不能为空"
);
}
List
<
BLabel
>
line
=
bLabelRepository
.
checknameByName
(
bLabel
);
if
(
line
.
size
()>
0
){
throw
new
ServiceException
(
ResultServiceEnums
.
NAME_IS_EXISTS
);
...
...
src/main/java/org/rcisoft/business/blesson/controller/BLessonController.java
View file @
bdbc9f4e
...
...
@@ -17,6 +17,7 @@ import org.rcisoft.common.model.GridModel;
import
org.rcisoft.core.constant.MessageConstant
;
import
org.rcisoft.core.model.PersistModel
;
import
org.rcisoft.core.result.Result
;
import
org.rcisoft.sys.role.service.SysRoleService
;
import
org.rcisoft.sys.user.bean.CurUser
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.BindingResult
;
...
...
@@ -46,6 +47,9 @@ public class BLessonController extends PaginationController<BLesson> {
@Autowired
private
BLessonPersonService
bLessonPersonService
;
@Autowired
private
SysRoleService
sysRoleService
;
@Autowired
private
Global
global
;
...
...
@@ -332,7 +336,8 @@ public class BLessonController extends PaginationController<BLesson> {
@ApiOperation
(
value
=
"617课程管理显示的全部课程"
,
notes
=
"课程管理显示的全部课程"
,
response
=
BLesson
.
class
)
@GetMapping
(
value
=
"theLessonManage"
)
public
Result
theLessonManage
(
CurUser
curUser
,
@Valid
BLesson
bLesson
,
BindingResult
bindingResult
){
List
<
BLesson
>
bLessons
=
bLessonService
.
theLessonMangageByPagination
(
getPaginationUtility
(),
curUser
,
bLesson
);
List
<
RoleTypeDepartDTO
>
roleList
=
sysRoleService
.
queryRoleTypeByUserId
(
curUser
);
List
<
BLesson
>
bLessons
=
bLessonService
.
theLessonMangageByPagination
(
getPaginationUtility
(),
curUser
,
bLesson
,
roleList
);
GridModel
gridModel
=
getGridModelResponse
();
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
...
...
@@ -469,4 +474,20 @@ public class BLessonController extends PaginationController<BLesson> {
lessonId
);
}
// /**
// * @author: zhangqingle
// * @param
// * @return
// */
// @ApiOperation(value="626 收藏课程", notes="收藏课程")
// @ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")
// @PostMapping(value = "/addCollect")
// public Result addCollect(CurUser curUser, @Valid String lessonId, BindingResult bindingResult) {
// PersistModel data = bLessonService.addCollect(curUser,lessonId);
// return Result.builder(data,
// MessageConstant.MESSAGE_ALERT_SUCCESS,
// MessageConstant.MESSAGE_ALERT_ERROR,
// lessonId);
// }
}
src/main/java/org/rcisoft/business/blesson/dao/BLessonRepository.java
View file @
bdbc9f4e
...
...
@@ -509,20 +509,29 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
ILessonCountDTO
iLessonCount
(
String
userId
);
/**
*
在学人数加一
* @param
Business
Id
*
重新统计在学人数
* @param
lesson
Id
* @return
*/
@Update
(
"update b_lesson set person_number = person_number+1 where business_id = #{BusinessId}"
)
int
personNumberPlusOne
(
String
BusinessId
);
@Update
(
"<script>update b_lesson set person_number = "
+
"(select count(1) from b_lesson_person where 1=1 "
+
" and del_flag != 1 and flag = 1 "
+
" and lesson_id = #{lessonId})"
+
" where business_id = #{lessonId} </script>"
)
int
personNumberReCount
(
String
lessonId
);
/**
*
在学人数减一
* @param
Business
Id
*
重新统计收藏人数
* @param
lesson
Id
* @return
*/
@Update
(
"update b_lesson set person_number = person_number-1 where business_id = #{BusinessId}"
)
int
personNumberMinusOne
(
String
BusinessId
);
@Update
(
"<script>update b_lesson set collect_number = "
+
"(select count(1) from b_lesson_person where 1=1 "
+
" and del_flag != 1 and flag = 1 "
+
" and is_collect = '1' "
+
" and lesson_id = #{lessonId})"
+
" where business_id = #{lessonId} </script>"
)
int
collectNumberReCount
(
String
lessonId
);
/**
* 列表页分页查询全部课程
...
...
@@ -829,7 +838,7 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
"<if test='!isAdmin'>"
+
"AND les.lecturer_id IN"
+
"<foreach item='item' index='index' collection='CurUserSet' open='(' close=')' separator=','> "
+
"#{item
.userId
} "
+
"#{item} "
+
"</foreach>"
+
"</if> "
+
"<if test=\"bLesson.lessonName!=null and bLesson.lessonName!=''\">AND les.lesson_name like '%${bLesson.lessonName}%' </if>"
+
...
...
@@ -837,8 +846,7 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
"<if test=\"bLesson.releaseState!=null and bLesson.releaseState!=''\">AND les.release_state = #{bLesson.releaseState} </if>"
+
" order by les.release_date desc </script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
List
<
BLesson
>
selectAllManageLesson
(
@Param
(
"C"
+
"urUserSet"
)
Set
<
CurUser
>
CurUserSet
,
@Param
(
"bLesson"
)
BLesson
bLesson
,
@Param
(
"isAdmin"
)
boolean
isAdmin
,
@Param
(
"corpId"
)
String
corpId
)
;
List
<
BLesson
>
selectAllManageLesson
(
@Param
(
"CurUserSet"
)
Set
<
String
>
CurUserSet
,
@Param
(
"bLesson"
)
BLesson
bLesson
,
@Param
(
"isAdmin"
)
boolean
isAdmin
,
@Param
(
"corpId"
)
String
corpId
)
;
@Select
(
"<script>"
+
...
...
src/main/java/org/rcisoft/business/blesson/dto/AddMyLearnLessonDTO.java
View file @
bdbc9f4e
package
org
.
rcisoft
.
business
.
blesson
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
AddMyLearnLessonDTO
{
@ApiModelProperty
(
value
=
"课程Id"
,
required
=
true
)
...
...
src/main/java/org/rcisoft/business/blesson/dto/RoleTypeDepartDTO.java
0 → 100644
View file @
bdbc9f4e
package
org
.
rcisoft
.
business
.
blesson
.
dto
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
RoleTypeDepartDTO
{
private
String
type
;
private
String
departs
;
private
List
<
String
>
departList
;
}
src/main/java/org/rcisoft/business/blesson/service/BLessonService.java
View file @
bdbc9f4e
...
...
@@ -179,7 +179,7 @@ public interface BLessonService{
* @param
* @return
*/
List
<
BLesson
>
theLessonMangageByPagination
(
PageUtil
pageUtil
,
CurUser
curUser
,
BLesson
bLesson
);
List
<
BLesson
>
theLessonMangageByPagination
(
PageUtil
pageUtil
,
CurUser
curUser
,
BLesson
bLesson
,
List
<
RoleTypeDepartDTO
>
roleList
);
/**
* 分页查询列表页全部
...
...
@@ -189,4 +189,13 @@ public interface BLessonService{
*/
PersistModel
deleteRecommend
(
String
lessonId
);
/**
* 分页查询列表页全部
* @author: zhangqingle
* @param curUser
* @param lessonId
* @return
*/
PersistModel
addCollect
(
CurUser
curUser
,
String
lessonId
);
}
src/main/java/org/rcisoft/business/blesson/service/impl/BLessonPersonServiceImpl.java
View file @
bdbc9f4e
...
...
@@ -47,10 +47,10 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
public
PersistModel
quit
(
QuitLessonDTO
quitLessonDTO
)
{
BLessonPerson
bLessonPerson
=
bLessonPersonRepository
.
selectById
(
quitLessonDTO
.
getBusinessId
());
if
(
"1"
.
equals
(
bLessonPerson
.
getIsAppoint
())){
throw
new
ServiceException
(
Result
ExceptionEnum
.
APPOINT_NOT_CLOSE
);
throw
new
ServiceException
(
Result
ServiceEnums
.
APPOINT_NOT_CLOSE
);
}
//
课程在学人数-1
bLessonRepository
.
personNumber
MinusOne
(
quitLessonDTO
.
getLessonId
());
//
重新统计在学人数
bLessonRepository
.
personNumber
ReCount
(
quitLessonDTO
.
getLessonId
());
return
new
PersistModel
(
1
,
bLessonPersonRepository
.
quit
(
quitLessonDTO
.
getBusinessId
()));
}
...
...
@@ -74,7 +74,7 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
public
PersistModel
cancelAppoint
(
CancelAppointDTO
cancelAppointDTO
)
{
String
bAppointId
=
bLessonPersonRepository
.
selectAppointIdById
(
cancelAppointDTO
);
if
(
StringUtils
.
isEmpty
(
bAppointId
)){
throw
new
ServiceException
(
Result
ExceptionEnum
.
APPOINT_NOT_CANCEL
);
throw
new
ServiceException
(
Result
ServiceEnums
.
APPOINT_NOT_CANCEL
);
}
BAppoint
bAppoint
=
bAppointRepository
.
selectById
(
bAppointId
);
...
...
@@ -128,15 +128,16 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
bLessonPerson
.
setIsFinish
(
"1"
);
line
=
bLessonPersonRepository
.
updateByPrimaryKeySelective
(
bLessonPerson
);
//课程在学人数+1
bLessonRepository
.
personNumber
PlusOne
(
addMyLearnLessonDTO
.
getLessonId
());
bLessonRepository
.
personNumber
ReCount
(
addMyLearnLessonDTO
.
getLessonId
());
}
else
if
(
bLessonPersons
==
null
||
bLessonPersons
.
size
()
<
1
){
//未指派
bLessonPerson
=
new
BLessonPerson
();
bLessonPerson
.
initModel
();
bLessonPerson
.
setIsFinish
(
"1"
);
bLessonPerson
.
setLessonId
(
addMyLearnLessonDTO
.
getLessonId
());
bLessonPerson
.
setPersonId
(
addMyLearnLessonDTO
.
getUserId
());
line
=
bLessonPersonRepository
.
insertBLessonPerson
(
bLessonPerson
);
//课程在学人数+1
bLessonRepository
.
personNumber
PlusOne
(
addMyLearnLessonDTO
.
getLessonId
());
bLessonRepository
.
personNumber
ReCount
(
addMyLearnLessonDTO
.
getLessonId
());
}
else
if
(
bLessonPersons
!=
null
&&
bLessonPersons
.
size
()>
0
){
line
=
1
;
}
...
...
src/main/java/org/rcisoft/business/blesson/service/impl/BLessonServiceImpl.java
View file @
bdbc9f4e
...
...
@@ -11,6 +11,7 @@ import org.rcisoft.business.blesson.service.BLessonService;
import
org.rcisoft.business.blesson.util.recursion
;
import
org.rcisoft.business.blesson.dao.BViewrangeRepository
;
import
org.rcisoft.common.util.feignDto.DeptGetRspDTO
;
import
org.rcisoft.common.util.feignDto.GetAllRspDTO
;
import
org.rcisoft.common.util.feignDto.MTUserGetsReqDTO
;
import
org.rcisoft.common.util.feignDto.MTUserInfoRspDTO
;
import
org.rcisoft.common.util.outClient.MTCotactApiRequestClient
;
...
...
@@ -19,6 +20,7 @@ import org.rcisoft.core.constant.MessageConstant;
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.rcisoft.core.util.IdGen
;
import
org.rcisoft.core.util.UserUtil
;
import
org.rcisoft.sys.user.bean.CurUser
;
...
...
@@ -336,7 +338,7 @@ public class BLessonServiceImpl implements BLessonService {
int
state
=
bLessonRepository
.
findLessonReleaseState
(
id
);
if
(
state
!=
0
){
throw
new
ServiceException
(
Result
ExceptionEnum
.
STATE_NOT_RELEASE
);
throw
new
ServiceException
(
Result
ServiceEnums
.
STATE_NOT_RELEASE
);
}
BLesson
bLesson
=
new
BLesson
();
...
...
@@ -398,7 +400,7 @@ public class BLessonServiceImpl implements BLessonService {
int
line
=
bRecommendRepository
.
insertBRecommendSons
(
bRecommendSons
);
return
new
PersistModel
(
line
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
);
}
else
{
throw
new
ServiceException
(
Result
ExceptionEnum
.
INVALID_PARAMETER_VALUE
);
throw
new
ServiceException
(
Result
ServiceEnums
.
INVALID_PARAMETER_VALUE
);
}
}
...
...
@@ -435,7 +437,7 @@ public class BLessonServiceImpl implements BLessonService {
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
PersistModel
appointLessonToPerson
(
AppointLessonDTO
appointLessonDTO
)
{
if
(
StringUtils
.
isEmpty
(
appointLessonDTO
.
getAppointPerson
())){
throw
new
ServiceException
(
Result
ExceptionEnum
.
INVALID_PARAMETER_VALUE
);
throw
new
ServiceException
(
Result
ServiceEnums
.
INVALID_PARAMETER_VALUE
);
}
//按课程查询指派表是否为空
List
<
BAppoint
>
bAppoints
=
bAppointRepository
.
selectByLessonId
(
appointLessonDTO
);
...
...
@@ -563,7 +565,7 @@ public class BLessonServiceImpl implements BLessonService {
ListAllLesson
=
bLessonRepository
.
queryInterestedListByPagination
(
model
);
break
;
default
:
throw
new
ServiceException
(
Result
ExceptionEnum
.
INVALID_PARAMETER_VALUE
);
throw
new
ServiceException
(
Result
ServiceEnums
.
INVALID_PARAMETER_VALUE
);
}
return
ListAllLesson
;
...
...
@@ -571,25 +573,35 @@ public class BLessonServiceImpl implements BLessonService {
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
List
<
BLesson
>
theLessonMangageByPagination
(
PageUtil
pageUtil
,
CurUser
curUser
,
BLesson
bLesson
)
{
public
List
<
BLesson
>
theLessonMangageByPagination
(
PageUtil
pageUtil
,
CurUser
curUser
,
BLesson
bLesson
,
List
<
RoleTypeDepartDTO
>
roleList
)
{
//查询当前登录人所在的企业
String
corpId
=
curUser
.
getCorpId
();
String
userId
=
curUser
.
getUserId
();
//查询当前登录人有什么角色
List
<
String
>
roleList
=
sysUserMapper
.
queryRoleTypeByUserId
(
userId
);
// List<RoleTypeDepartDTO> roleList = sysUserMapper.queryRoleTypeByUserId(userId);
if
(
roleList
==
null
||
roleList
.
size
()<
1
){
return
new
ArrayList
<>();
}
boolean
isAdmin
=
false
;
Set
<
CurUser
>
uids
=
new
HashSet
<>();
for
(
String
role
:
roleList
)
{
if
(
"1"
.
equals
(
role
))
{
Set
<
String
>
uids
=
new
HashSet
<>();
Set
<
String
>
departIds
=
new
HashSet
<>();
for
(
RoleTypeDepartDTO
role
:
roleList
)
{
if
(
"1"
.
equals
(
role
.
getType
()))
{
isAdmin
=
true
;
break
;
}
else
if
(
"2"
.
equals
(
role
))
{
}
else
if
(
"2"
.
equals
(
role
.
getType
()))
{
List
<
String
>
departs
=
asList
(
StringUtils
.
split
(
role
.
getDeparts
(),
","
));
departIds
.
addAll
(
departs
);
// 调用 feign 获取当前部门及子部门 --->所有人
uids
.
addAll
(
Arrays
.
asList
(
new
CurUser
(),
new
CurUser
()));
//
uids.addAll(Arrays.asList(new CurUser(), new CurUser()));
}
}
List
<
GetAllRspDTO
>
GetAllRspDTOList
=
cotactApiRequestClient
.
getUserByDeptIdSet
(
corpId
,
departIds
);
for
(
GetAllRspDTO
getAllRspDTO
:
GetAllRspDTOList
)
{
uids
.
add
(
getAllRspDTO
.
getId
());
}
//自己
uids
.
add
(
curUser
);
uids
.
add
(
userId
);
//查讯课程的语句
List
<
BLesson
>
bLessons
=
bLessonRepository
.
selectAllManageLesson
(
uids
,
bLesson
,
isAdmin
,
corpId
);
return
bLessons
;
...
...
@@ -600,7 +612,7 @@ public class BLessonServiceImpl implements BLessonService {
List
<
String
>
recommendIds
=
bRecommendRepository
.
selectIdByLessonId
(
lessonId
);
if
(
recommendIds
==
null
||
recommendIds
.
size
()<
1
){
throw
new
ServiceException
(
Result
ExceptionEnum
.
NOT_RECOMMEND
);
throw
new
ServiceException
(
Result
ServiceEnums
.
NOT_RECOMMEND
);
}
//修改推荐表
BRecommend
bRecommend
=
new
BRecommend
();
...
...
@@ -613,6 +625,20 @@ public class BLessonServiceImpl implements BLessonService {
return
new
PersistModel
(
line
);
}
@Override
public
PersistModel
addCollect
(
CurUser
curUser
,
String
lessonId
)
{
AddMyLearnLessonDTO
param
=
new
AddMyLearnLessonDTO
(
lessonId
,
curUser
.
getCorpId
(),
curUser
.
getUserId
());
List
<
BLessonPerson
>
bLessonPersons
=
bLessonPersonRepository
.
selectByPersonAndLesson
(
param
);
if
(
bLessonPersons
==
null
||
bLessonPersons
.
size
()<
1
){
throw
new
ServiceException
(
ResultServiceEnums
.
B_R_SL_STUDENT_NOT_EXISTS
);
}
BLessonPerson
bLessonPerson
=
bLessonPersons
.
get
(
0
);
bLessonPerson
.
setIsCollect
(
"1"
);
int
line
=
bLessonPersonRepository
.
updateByPrimaryKeySelective
(
bLessonPerson
);
bLessonRepository
.
collectNumberReCount
(
lessonId
);
return
new
PersistModel
(
line
);
}
//遍历标签放入List中
List
<
BLessonLabel
>
addLabel
(
BLesson
model
){
//标签集合
...
...
src/main/java/org/rcisoft/common/util/outClient/MTCotactApiRequestClient.java
View file @
bdbc9f4e
...
...
@@ -476,6 +476,25 @@ public class MTCotactApiRequestClient {
return
contactFeignClient
.
getUserByDeptIds
(
getUserByDeptIdReqDTO
,
zxClientType
,
zxAccountId
).
getData
();
}
/**
* 根据多个部门id的Set集合获取部门内人员
* @param corpId
* @param deptIdSet
* @return
*/
public
List
<
GetAllRspDTO
>
getUserByDeptIdSet
(
String
corpId
,
Set
<
String
>
deptIdSet
){
if
(
deptIdSet
==
null
||
deptIdSet
.
size
()
<
1
){
return
new
ArrayList
<>();
}
GetUserByDeptIdReqDTO
getUserByDeptIdReqDTO
=
new
GetUserByDeptIdReqDTO
();
List
<
Long
>
deptIdList
=
new
ArrayList
<>();
for
(
String
deptId
:
deptIdSet
)
{
deptIdList
.
add
(
Long
.
parseLong
(
deptId
));
}
getUserByDeptIdReqDTO
.
setDeptIds
(
deptIdList
);
return
contactFeignClient
.
getUserByDeptIds
(
getUserByDeptIdReqDTO
,
zxClientType
,
zxAccountId
).
getData
();
}
public
List
<
DeptGetRspDTO
>
deptListDeptInfoByName
(
String
corpId
,
String
name
){
return
contactFeignClient
.
deptListDeptInfoByName
(
corpId
,
name
,
zxClientType
,
zxAccountId
).
getData
();
}
...
...
src/main/java/org/rcisoft/core/result/ResultExceptionEnum.java
View file @
bdbc9f4e
...
...
@@ -24,14 +24,8 @@ 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
,
"必修不能退出"
),
STATE_NOT_RELEASE
(
4015
,
"该课程状态不能发布"
),
APPOINT_NOT_CANCEL
(
4016
,
"该课程不能取消指派"
),
INVALID_PARAMETER_VALUE
(
4017
,
"参数值无效"
),
NOT_RECOMMEND
(
4018
,
"该课程未推荐"
)
;
private
Integer
code
;
...
...
src/main/java/org/rcisoft/core/result/ResultServiceEnums.java
View file @
bdbc9f4e
...
...
@@ -210,6 +210,15 @@ public enum ResultServiceEnums {
ZX_FAILED
(
111
,
"调用智信接口失败"
),
MUST_NOT_FILLED
(
112
,
"必填未填写"
),
NOT_MORE_COUNT
(
113
,
"添加超过规定个数"
),
APPOINT_NOT_CLOSE
(
114
,
"必修不能退出"
),
STATE_NOT_RELEASE
(
115
,
"该课程状态不能发布"
),
APPOINT_NOT_CANCEL
(
116
,
"该课程不能取消指派"
),
INVALID_PARAMETER_VALUE
(
117
,
"参数值无效"
),
NOT_RECOMMEND
(
118
,
"该课程未推荐"
),
NO_DATA
(
4011
,
"该数据不存在"
),
;
private
Integer
code
;
...
...
src/main/java/org/rcisoft/sys/role/service/SysRoleService.java
View file @
bdbc9f4e
...
...
@@ -2,6 +2,7 @@ package org.rcisoft.sys.role.service;
import
org.rcisoft.business.blesson.dto.RoleTypeDepartDTO
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.model.PersistModel
;
import
org.rcisoft.sys.dept.entity.DeptRole
;
...
...
@@ -82,4 +83,6 @@ public interface SysRoleService {
int
addAdminRoleMenuUser
(
InitAddAdminDTO
initAddAdminDTO
,
List
<
RoleMenuDTO
>
roleMenuDTOs
,
UserRoleDTO
userRoleDTO
);
List
<
RoleTypeDepartDTO
>
queryRoleTypeByUserId
(
CurUser
curUser
);
}
src/main/java/org/rcisoft/sys/role/service/impl/SysRoleServiceImpl.java
View file @
bdbc9f4e
...
...
@@ -2,6 +2,7 @@ package org.rcisoft.sys.role.service.impl;
import
lombok.extern.slf4j.Slf4j
;
import
org.rcisoft.business.blesson.dto.RoleTypeDepartDTO
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.exception.ServiceException
;
import
org.rcisoft.core.model.PersistModel
;
...
...
@@ -181,4 +182,9 @@ public class SysRoleServiceImpl implements SysRoleService {
sysRoleRepository
.
addRoleMenu
(
roleMenuDTOs
);
return
sysRoleRepository
.
addUserRole
(
userRoleDTO
);
}
@Override
public
List
<
RoleTypeDepartDTO
>
queryRoleTypeByUserId
(
CurUser
curUser
)
{
return
sysUserMapper
.
queryRoleTypeByUserId
(
curUser
.
getUserId
());
}
}
src/main/java/org/rcisoft/sys/user/dao/SysUserMapper.java
View file @
bdbc9f4e
...
...
@@ -2,6 +2,7 @@ package org.rcisoft.sys.user.dao;
import
org.apache.ibatis.annotations.*
;
import
org.rcisoft.business.blesson.dto.RoleTypeDepartDTO
;
import
org.rcisoft.core.base.BaseMapper
;
import
org.rcisoft.sys.user.bean.CurUser
;
import
org.rcisoft.sys.user.dto.MyInfoDTO
;
...
...
@@ -169,13 +170,14 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
int
deleteCompanyUserRole
(
List
<
SysUser
>
userCompanyList
);
@Select
(
"<script>SELECT sr.type AS
roleList
"
+
@Select
(
"<script>SELECT sr.type AS
type,sr.depart_ids departs
"
+
"FROM s_user AS su "
+
"LEFT JOIN s_r_user_role AS ru ON su.business_id = ru.user_id "
+
"LEFT JOIN tm_admin_role AS sr ON ru.role_id = sr.r_id "
+
"WHERE su.del_flag = 0 "
+
"and sr.r_status !=0 "
+
"AND su.business_id = #{userId}</script>"
)
List
<
String
>
queryRoleTypeByUserId
(
@Param
(
"userId"
)
String
userId
);
List
<
RoleTypeDepartDTO
>
queryRoleTypeByUserId
(
@Param
(
"userId"
)
String
userId
);
/**
* 查询用户 menu 19-09-30
...
...
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