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
a099f45a
Commit
a099f45a
authored
Jun 21, 2020
by
luzhuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 分类 addnew 逻辑修改
parent
87016ae9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
65 additions
and
47 deletions
+65
-47
20.6.18.sql
dbscript/20.6.18.sql
+22
-2
BBanner.java
...ain/java/org/rcisoft/business/bbanner/entity/BBanner.java
+3
-0
BCourseRepository.java
...a/org/rcisoft/business/bcourse/dao/BCourseRepository.java
+1
-1
BCourseServiceImpl.java
...oft/business/bcourse/service/impl/BCourseServiceImpl.java
+29
-33
BLessonServiceImpl.java
...oft/business/blesson/service/impl/BLessonServiceImpl.java
+9
-11
BBannerMapper.xml
...esources/mapper/business/bbanner.mapper/BBannerMapper.xml
+1
-0
No files found.
dbscript/20.6.18.sql
View file @
a099f45a
-- 新建表 look
CREATE
TABLE
`b_user_lesson_look`
(
`business_id`
varchar
(
64
)
CHARACTER
SET
utf8
COLLATE
utf8_bin
NOT
NULL
COMMENT
'主键'
,
`user_id`
varchar
(
128
)
CHARACTER
SET
utf8
COLLATE
utf8_bin
NOT
NULL
DEFAULT
''
COMMENT
'用户id'
,
`lesson_id`
varchar
(
64
)
CHARACTER
SET
utf8
COLLATE
utf8_bin
NOT
NULL
DEFAULT
''
COMMENT
'课程、培训id'
,
`type`
varchar
(
64
)
CHARACTER
SET
utf8
COLLATE
utf8_bin
NOT
NULL
DEFAULT
''
COMMENT
'类型'
,
PRIMARY
KEY
(
`business_id`
)
USING
BTREE
)
ENGINE
=
InnoDB
CHARACTER
SET
=
utf8
COLLATE
=
utf8_bin
COMMENT
=
'用户课程是否查看表'
ROW_FORMAT
=
DYNAMIC
;
-- 添加 消息中字段
SET
FOREIGN_KEY_CHECKS
=
1
;
-- 添加 消息中字段(注意各企业)
INSERT
INTO
`b_message`
VALUES
(
uuid
(),
''
,
'2020-06-17 11:07:11'
,
'1049837872616415234'
,
'2020-06-19 09:24:39'
,
'0'
,
'1'
,
'发布新资源后,显示NEW标识的时间'
,
'NEWNOTICE'
,
'20'
,
'1'
,
'7'
,
7
);
-- 添加菜单表中 新消息设置
INSERT
INTO
`s_menu`
VALUES
(
'0055'
,
'0005'
,
NULL
,
'新消息管理'
,
'F-NEW-MANAGE'
,
'newManage'
,
NULL
,
NULL
,
4
,
'1'
,
'1'
,
'F-NEW-MANAGE'
,
NULL
,
'2019-11-25 10:45:07'
,
NULL
,
'2019-11-25 10:45:15'
,
NULL
,
'0'
,
'1'
,
'20'
,
2
);
-- 为 主管理员添加 新消息管理菜单 权限
update
tm_admin_role
set
r_privilege
=
'M-LESSON-MANAGE,F-ADD-LESSON,F-UPDATE-LESSON,F-CLOSE-LESSON,F-DELETE-LESSON,M-TRAIN-MANAGE,F-ADD-TRAIN,F-UPDATE-TRAIN,F-CLOSE-TRAIN,F-DELETE-TRAIN,M-PRESERVE,F-DOWNLOAD-PRESERVE,F-REPRINT-PRESERVE,F-DELETE-PRESERVE,M-UPLOAD,F-DOWNLOAD-UPLOAD,F-REPRINT-UPLOAD,F-DELETE-UPLOAD,M-CTS-B,F-ONLINE,P-ONLINE-ADD,P-ONLINE-UPDATE,P-ONLINE-APPOINT,P-ONLINE-TRACK,P-ONLINE-RECOMMEND,P-ONLINE-CLOSE,P-ONLINE-DEL,F-UNDERLINE,P-UNDER-ADD,P-UNDER-UPDATE,P-UNDER-APPOINT,P-UNDER-TRACK,P-UNDER-RECOMMEND,P-UNDER-CLOSE,P-UNDER-DEL,F-CATEGORY,P-CATEGORY-ADD,P-CATEGORY-UPDATE,P-CATEGORY-DEL,F-LABEL,P-LABEL-ADD,P-LABEL-UPDATE,P-LABEL-DEL,F-INTEGRAL-M,P-NULL-2,M-QDB,F-QDB,P-QDB-ADD,P-QDB-UPDATE,P-QDB-DELETE,P-QDB-ANALYSIS,F-QES,P-QES-ADD,P-QES-UPDATE,P-QES-DELETE,P-QES-IMPORT,M-PAPER,F-PAPER-CATE,P-PAPER-CATE-ADD,P-PAPER-CATE-UPDATE,P-PAPER-CATE-DELETE,F-PAPER,P-PAPER-ADD,P-PAPER-UPDATE,P-PAPER-DELETE,P-PAPER-CONFIG,P-PAPER-HISTORY-VIEW,P-PAPER-HISTORY-CHECK,M-ANALYSIS,P-ANA-PAPER,P-ANA-EXAM,P-ANA-SCORE,M-SYSTEM,F-MAIN-MANAGE,P-COLUMN,P-BANNER,P-OUTER-LINK,F-USER-MANAGE,P-STOP-START,P-ROLE-EDIT,P-SYNCHRO,F-ROLE-MANAGE,P-ROLE-MANAGE,P-OPERATION,P-DATALIMIT,P-PAPER-CLONE,P-ROLE-DEL,F-NOTICE-MANAGE,F-NEW-MANAGE'
where
r_type
=
0
;
-- banner 新增字段 is_push
-- 添加菜单表中 新消息设置
\ No newline at end of file
src/main/java/org/rcisoft/business/bbanner/entity/BBanner.java
View file @
a099f45a
...
...
@@ -57,6 +57,9 @@ public class BBanner extends IdEntity<BBanner> {
@ApiModelProperty
(
value
=
"排序"
)
private
Integer
bannerSort
;
@ApiModelProperty
(
value
=
"是否为平台推送"
)
private
String
isPush
;
@ApiModelProperty
(
value
=
"课程名"
)
@Transient
private
String
lessonName
;
...
...
src/main/java/org/rcisoft/business/bcourse/dao/BCourseRepository.java
View file @
a099f45a
...
...
@@ -57,7 +57,7 @@ public interface BCourseRepository extends BaseMapper<BCourse> {
" and corp_id = #{corpId} "
+
" ORDER BY sort limit #{num}"
)
@ResultMap
(
value
=
"
BaseResultMapDTO
"
)
@ResultMap
(
value
=
"
ChildListResultMap
"
)
List
<
QueryCourseResDTO
>
queryFirstLevel
(
@Param
(
"corpId"
)
String
corpId
,
@Param
(
"num"
)
int
num
);
@Select
(
"select DISTINCT IFNULL(("
+
...
...
src/main/java/org/rcisoft/business/bcourse/service/impl/BCourseServiceImpl.java
View file @
a099f45a
...
...
@@ -271,50 +271,46 @@ public class BCourseServiceImpl implements BCourseService {
*/
public
List
<
QueryCourseResDTO
>
addNewFolder
(
List
<
QueryCourseResDTO
>
resDTOS
){
log
.
info
(
"-----------addNewFolder----------当前接口查询的一级分类个数---------"
+
resDTOS
.
size
()+
"--------------------"
);
List
<
BLesson
>
lessons
=
bLessonService
.
queryHomeBLessons
(
UserUtil
.
getCurUser
());
//查询首页显示的所有 课程(isNew 已赋值)
List
<
BLesson
>
lessons
=
new
ArrayList
<>();
List
<
BLesson
>
oldLessons
=
bLessonService
.
queryHomeBLessons
(
UserUtil
.
getCurUser
());
//查询首页显示的所有 课程(isNew 已赋值)
//筛选有分类的 new 课程
for
(
BLesson
lesson
:
oldLessons
){
if
(
"1"
.
equals
(
lesson
.
getIsNew
())
&&
(
lesson
.
getCourseId
()
!=
null
||
!
""
.
equals
(
lesson
.
getCourseId
())))
lessons
.
add
(
lesson
);
}
for
(
QueryCourseResDTO
dto
:
resDTOS
){
//一级分类
int
num
=
0
;
//属于当前分类的课程数
int
secNum
=
0
;
//下层分类中的课程数
for
(
BLesson
b
:
lessons
){
if
(
b
.
getCourseId
().
equals
(
dto
.
getKey
())
&&
"1"
.
equals
(
b
.
getIsNew
())){
if
(
b
.
getCourseId
().
equals
(
dto
.
getKey
())
)
num
++;
}
else
{
continue
;
}
}
secNum
+=
num
;
//添加分类直属 new课程的数量
if
(
dto
.
getChildren
()
==
null
)
continue
;
for
(
QueryCourseResDTO
dto1
:
dto
.
getChildren
()){
//二级分类
int
num1
=
0
;
//二级分类下直属的课程
int
secNum1
=
0
;
//二级分类下 三级分类中的的 new课程数
for
(
BLesson
b
:
lessons
){
if
(
b
.
getCourseId
().
equals
(
dto1
.
getKey
())
&&
"1"
.
equals
(
b
.
getIsNew
())){
num1
++;
}
else
{
continue
;
}
}
secNum1
+=
num1
;
//将二级分类中的 直属课 添加到一级分类中
if
(
dto
.
getChildren
()
==
null
)
continue
;
for
(
QueryCourseResDTO
dto2
:
dto
.
getChildren
()){
//三级分类
int
num2
=
0
;
if
(
dto
.
getChildren
()
!=
null
){
for
(
QueryCourseResDTO
dto1
:
dto
.
getChildren
()){
//二级分类
int
num1
=
0
;
//二级分类下直属的课程
int
secNum1
=
0
;
//二级分类下 三级分类中的的 new课程数
for
(
BLesson
b
:
lessons
){
if
(
b
.
getCourseId
().
equals
(
dto2
.
getKey
())
&&
"1"
.
equals
(
b
.
getIsNew
())){
num2
++;
}
else
{
continue
;
if
(
b
.
getCourseId
().
equals
(
dto1
.
getKey
()))
num1
++;
}
secNum1
+=
num1
;
//将二级分类中的 直属课 添加到一级分类中
if
(
dto
.
getChildren
()
!=
null
){
for
(
QueryCourseResDTO
dto2
:
dto
.
getChildren
()){
//三级分类
int
num2
=
0
;
for
(
BLesson
b
:
lessons
){
if
(
b
.
getCourseId
().
equals
(
dto2
.
getKey
()))
num2
++;
}
log
.
info
(
"-----------addNewFolder----------三级分类--"
+
dto2
+
"--的new个数-------"
+
num2
+
"--------------------"
);
dto2
.
setNewCount
(
num2
);
//将三级分类包含的 new课数量添加到 分类中
secNum1
+=
num2
;
//将三级分类中的 new课数量添加到 二级分类中
}
}
log
.
info
(
"-----------addNewFolder---------
-三级分类--"
+
dto2
+
"--的new个数-------"
+
num2
+
"--------------------"
);
dto
2
.
setNewCount
(
num2
);
//将三级分类包含的 new课数量添加到 分类中
secNum
1
+=
num2
;
//将三级分类中的 new课
数量添加到 二级分类中
log
.
info
(
"-----------addNewFolder---------
二级分类--"
+
dto1
+
"--的new个数-------"
+
secNum1
+
"--------------------"
);
dto
1
.
setNewCount
(
secNum1
);
secNum
+=
secNum1
;
//将二级分类下三级分类中的
数量添加到 二级分类中
}
log
.
info
(
"-----------addNewFolder---------二级分类--"
+
dto1
+
"--的new个数-------"
+
secNum1
+
"--------------------"
);
dto1
.
setNewCount
(
secNum1
);
secNum
+=
secNum1
;
//将二级分类下三级分类中的数量添加到 二级分类中
}
log
.
info
(
"-----------addNewFolder----------一级分类--"
+
dto
+
"--的new个数-------"
+
secNum
+
"--------------------"
);
dto
.
setNewCount
(
secNum
);
...
...
src/main/java/org/rcisoft/business/blesson/service/impl/BLessonServiceImpl.java
View file @
a099f45a
...
...
@@ -1804,8 +1804,6 @@ public class BLessonServiceImpl implements BLessonService {
CurUser
curUser
=
UserUtil
.
getCurUser
();
String
userId
=
curUser
.
getUserId
();
String
corpId
=
curUser
.
getCorpId
();
// String userId = "1042237478105227265";
// String corpId = "6";
log
.
info
(
"-----------addNew---------当前登录人信息curUser----------"
+
curUser
+
"--------------------"
);
BMessage
bMessage
=
new
BMessage
();
bMessage
.
setName
(
MessageEnum
.
NEWNOTICE
.
getName
());
...
...
@@ -1852,16 +1850,16 @@ public class BLessonServiceImpl implements BLessonService {
mtUserGetsReqDTO
.
setCorpId
(
curUser
.
getCorpId
());
mtUserGetsReqDTO
.
setIds
(
ids
);
log
.
info
(
"------------mtUserGetsReqDTO--------"
+
mtUserGetsReqDTO
);
List
<
MTUserInfoRspDTO
>
mtUserInfoRspDTOList
=
cotactApiRequestClient
.
userGets
(
mtUserGetsReqDTO
);
log
.
info
(
"------------mtUserInfoRspDTOList--------"
+(
mtUserInfoRspDTOList
==
null
?
"null"
:
mtUserInfoRspDTOList
.
toString
()));
List
<
String
>
departs
=
new
ArrayList
<>();
if
(
mtUserInfoRspDTOList
!=
null
&&
mtUserInfoRspDTOList
.
size
()
>
0
)
{
departs
=
QueryDepart
.
queryDepart
(
mtUserInfoRspDTOList
);
departs
.
removeAll
(
Collections
.
singleton
(
null
));
departs
.
removeAll
(
Collections
.
singleton
(
""
));
}
//
List<MTUserInfoRspDTO> mtUserInfoRspDTOList = cotactApiRequestClient.userGets(mtUserGetsReqDTO);
//
log.info("------------mtUserInfoRspDTOList--------"+(mtUserInfoRspDTOList==null?"null":mtUserInfoRspDTOList.toString()));
//
List<String> departs = new ArrayList<>();
//
if (mtUserInfoRspDTOList != null && mtUserInfoRspDTOList.size() > 0) {
//
departs = QueryDepart.queryDepart(mtUserInfoRspDTOList);
//
departs.removeAll(Collections.singleton(null));
//
departs.removeAll(Collections.singleton(""));
//
}
FirstPageQueryDTO
firstPageQueryDTO
=
new
FirstPageQueryDTO
();
firstPageQueryDTO
.
setDeparts
(
departs
);
firstPageQueryDTO
.
setDeparts
(
null
);
firstPageQueryDTO
.
setCorpId
(
curUser
.
getCorpId
());
firstPageQueryDTO
.
setUserId
(
curUser
.
getUserId
());
List
<
String
>
courseIds
=
null
;
...
...
src/main/resources/mapper/business/bbanner.mapper/BBannerMapper.xml
View file @
a099f45a
...
...
@@ -18,6 +18,7 @@
<result
column=
"line_type"
jdbcType=
"VARCHAR"
property=
"lineType"
/>
<result
column=
"course_id"
jdbcType=
"VARCHAR"
property=
"courseId"
/>
<result
column=
"banner_sort"
jdbcType=
"LONGVARCHAR"
property=
"bannerSort"
/>
<result
column=
"is_push"
jdbcType=
"VARCHAR"
property=
"isPush"
/>
</resultMap>
</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