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
f01cc1ec
Commit
f01cc1ec
authored
Jun 18, 2020
by
luzhuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加日志
parent
13fc7fdf
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
24 deletions
+63
-24
BLessonController.java
...cisoft/business/blesson/controller/BLessonController.java
+2
-2
BLessonService.java
.../org/rcisoft/business/blesson/service/BLessonService.java
+1
-1
BLessonServiceImpl.java
...oft/business/blesson/service/impl/BLessonServiceImpl.java
+60
-21
No files found.
src/main/java/org/rcisoft/business/blesson/controller/BLessonController.java
View file @
f01cc1ec
...
@@ -785,10 +785,10 @@ public class BLessonController extends PaginationController<BLesson> {
...
@@ -785,10 +785,10 @@ public class BLessonController extends PaginationController<BLesson> {
@ApiOperation
(
value
=
"645555 点击课程"
,
notes
=
"取消new显示"
)
@ApiOperation
(
value
=
"645555 点击课程"
,
notes
=
"取消new显示"
)
@PostMapping
(
value
=
"/test"
)
@PostMapping
(
value
=
"/test"
)
public
Result
test
()
{
public
Result
test
()
{
return
Result
.
builder
(
bLessonService
.
test
(
),
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
"lessonId"
);
bLessonService
.
test
()
);
}
}
...
...
src/main/java/org/rcisoft/business/blesson/service/BLessonService.java
View file @
f01cc1ec
...
@@ -303,6 +303,6 @@ public interface BLessonService{
...
@@ -303,6 +303,6 @@ public interface BLessonService{
PersistModel
look
(
CurUser
curUser
,
String
lessonId
);
PersistModel
look
(
CurUser
curUser
,
String
lessonId
);
PersistModel
test
();
List
<
BLesson
>
test
();
}
}
src/main/java/org/rcisoft/business/blesson/service/impl/BLessonServiceImpl.java
View file @
f01cc1ec
...
@@ -241,8 +241,9 @@ public class BLessonServiceImpl implements BLessonService {
...
@@ -241,8 +241,9 @@ public class BLessonServiceImpl implements BLessonService {
departs
.
removeAll
(
Collections
.
singleton
(
null
));
departs
.
removeAll
(
Collections
.
singleton
(
null
));
departs
.
removeAll
(
Collections
.
singleton
(
""
));
departs
.
removeAll
(
Collections
.
singleton
(
""
));
}
}
//------------------------------
List
<
BLesson
>
result
=
bLessonRepository
.
queryPersonMore
(
curUser
,
departs
);
return
addNew
(
bLessonRepository
.
queryPersonMore
(
curUser
,
departs
));
log
.
info
(
"-----------addNew---------大家都在学查询课程或培训的总个数----------"
+
result
.
size
()+
"--------------------"
);
return
addNew
(
result
);
}
}
@Override
@Override
...
@@ -260,7 +261,9 @@ public class BLessonServiceImpl implements BLessonService {
...
@@ -260,7 +261,9 @@ public class BLessonServiceImpl implements BLessonService {
departs
.
removeAll
(
Collections
.
singleton
(
null
));
departs
.
removeAll
(
Collections
.
singleton
(
null
));
departs
.
removeAll
(
Collections
.
singleton
(
""
));
departs
.
removeAll
(
Collections
.
singleton
(
""
));
}
}
return
addNew
(
bLessonRepository
.
queryRecommend
(
curUser
,
departs
));
List
<
BLesson
>
result
=
bLessonRepository
.
queryRecommend
(
curUser
,
departs
);
log
.
info
(
"-----------addNew---------企业推荐查询课程或培训的总个数----------"
+
result
.
size
()+
"--------------------"
);
return
addNew
(
result
);
}
}
@Override
@Override
...
@@ -279,8 +282,10 @@ public class BLessonServiceImpl implements BLessonService {
...
@@ -279,8 +282,10 @@ public class BLessonServiceImpl implements BLessonService {
departs
.
removeAll
(
Collections
.
singleton
(
null
));
departs
.
removeAll
(
Collections
.
singleton
(
null
));
departs
.
removeAll
(
Collections
.
singleton
(
""
));
departs
.
removeAll
(
Collections
.
singleton
(
""
));
}
}
//------------------------------
return
addNew
(
bLessonRepository
.
queryConcern
(
curUser
,
departs
));
List
<
BLesson
>
result
=
bLessonRepository
.
queryConcern
(
curUser
,
departs
);
log
.
info
(
"-----------addNew---------最受关注查询课程或培训的总个数----------"
+
result
.
size
()+
"--------------------"
);
return
addNew
(
result
);
}
}
@Override
@Override
...
@@ -299,8 +304,10 @@ public class BLessonServiceImpl implements BLessonService {
...
@@ -299,8 +304,10 @@ public class BLessonServiceImpl implements BLessonService {
departs
.
removeAll
(
Collections
.
singleton
(
null
));
departs
.
removeAll
(
Collections
.
singleton
(
null
));
departs
.
removeAll
(
Collections
.
singleton
(
""
));
departs
.
removeAll
(
Collections
.
singleton
(
""
));
}
}
//------------------------------
return
addNew
(
bLessonRepository
.
queryInterested
(
curUser
,
departs
));
List
<
BLesson
>
result
=
bLessonRepository
.
queryInterested
(
curUser
,
departs
);
log
.
info
(
"-----------addNew---------可能感兴趣查询课程或培训的总个数----------"
+
result
.
size
()+
"--------------------"
);
return
addNew
(
result
);
}
}
...
@@ -584,7 +591,9 @@ public class BLessonServiceImpl implements BLessonService {
...
@@ -584,7 +591,9 @@ public class BLessonServiceImpl implements BLessonService {
//将一级分类放入分类集合中
//将一级分类放入分类集合中
courseIds
.
add
(
firstPageQueryDTO
.
getCourseLevelOne
());
courseIds
.
add
(
firstPageQueryDTO
.
getCourseLevelOne
());
}
}
return
addNew
(
bLessonRepository
.
queryHomeBLesson
(
firstPageQueryDTO
,
courseIds
));
List
<
BLesson
>
result
=
bLessonRepository
.
queryHomeBLesson
(
firstPageQueryDTO
,
courseIds
);
log
.
info
(
"-----------addNew---------首页查询课程或培训的总个数----------"
+
result
.
size
()+
"--------------------"
);
return
addNew
(
result
);
}
}
@Override
@Override
...
@@ -1574,7 +1583,7 @@ public class BLessonServiceImpl implements BLessonService {
...
@@ -1574,7 +1583,7 @@ public class BLessonServiceImpl implements BLessonService {
}
}
@Override
@Override
public
PersistModel
test
()
{
public
List
<
BLesson
>
test
()
{
List
<
BLesson
>
re
=
new
ArrayList
<>();
List
<
BLesson
>
re
=
new
ArrayList
<>();
BLesson
b
=
new
BLesson
();
BLesson
b
=
new
BLesson
();
b
.
setBusinessId
(
"123456"
);
b
.
setBusinessId
(
"123456"
);
...
@@ -1584,8 +1593,7 @@ public class BLessonServiceImpl implements BLessonService {
...
@@ -1584,8 +1593,7 @@ public class BLessonServiceImpl implements BLessonService {
b2
.
setCreateDate
(
new
Date
());
b2
.
setCreateDate
(
new
Date
());
re
.
add
(
b
);
re
.
add
(
b
);
re
.
add
(
b2
);
re
.
add
(
b2
);
addNew
(
re
);
return
addNew
(
re
);
return
new
PersistModel
(
1
);
}
}
//遍历标签放入List中
//遍历标签放入List中
...
@@ -1792,11 +1800,12 @@ public class BLessonServiceImpl implements BLessonService {
...
@@ -1792,11 +1800,12 @@ public class BLessonServiceImpl implements BLessonService {
* @return
* @return
*/
*/
public
List
<
BLesson
>
addNew
(
List
<
BLesson
>
result
)
{
public
List
<
BLesson
>
addNew
(
List
<
BLesson
>
result
)
{
log
.
info
(
"-----------addNew---------当前查询课程或培训的总个数----------"
+
result
.
size
()+
"--------------------"
);
//获取当前登录人信息
//获取当前登录人信息
CurUser
curUser
=
UserUtil
.
getCurUser
();
CurUser
curUser
=
UserUtil
.
getCurUser
();
String
userId
=
curUser
.
getUserId
();
// String userId = curUser.getUserId();
String
corpId
=
curUser
.
getCorpId
();
// String corpId = curUser.getCorpId();
String
userId
=
"123"
;
String
corpId
=
"6"
;
log
.
info
(
"-----------addNew---------当前登录人信息curUser----------"
+
curUser
+
"--------------------"
);
log
.
info
(
"-----------addNew---------当前登录人信息curUser----------"
+
curUser
+
"--------------------"
);
BMessage
bMessage
=
new
BMessage
();
BMessage
bMessage
=
new
BMessage
();
bMessage
.
setName
(
MessageEnum
.
NEWNOTICE
.
getName
());
bMessage
.
setName
(
MessageEnum
.
NEWNOTICE
.
getName
());
...
@@ -1812,10 +1821,10 @@ public class BLessonServiceImpl implements BLessonService {
...
@@ -1812,10 +1821,10 @@ public class BLessonServiceImpl implements BLessonService {
for
(
BLesson
b
:
result
)
{
for
(
BLesson
b
:
result
)
{
//step 1 查询look表中是否有对应任何课程的点击记录
//step 1 查询look表中是否有对应任何课程的点击记录
int
flag
=
bLessonRepository
.
getCountByUserAndLesson
(
userId
,
b
.
getBusinessId
(),
"0"
);
int
flag
=
bLessonRepository
.
getCountByUserAndLesson
(
userId
,
b
.
getBusinessId
(),
"0"
);
//step 2 存在则返回,不存在则判断时间 满足条件 setIsNew()
//step 2 存在则返回,不存在则判断时间 满足条件 setIsNew()
flag <= 0 说明此用户未点击过该课程
if
(
flag
<=
0
)
{
if
(
flag
<=
0
)
{
//
flag <= 0 说明此用户未点击过该课程
//
获取课程的添加时间
Calendar
c1
=
Calendar
.
getInstance
(
);
Calendar
c1
=
DateUtil
.
calendar
(
b
.
getCreateDate
()
);
c1
.
setTime
(
b
.
getCreateDate
());
c1
.
setTime
(
b
.
getCreateDate
());
switch
(
newNotice
.
getValueType
()){
switch
(
newNotice
.
getValueType
()){
case
"1"
:
c1
.
add
(
Calendar
.
HOUR
,
time
);
break
;
case
"1"
:
c1
.
add
(
Calendar
.
HOUR
,
time
);
break
;
...
@@ -1823,11 +1832,11 @@ public class BLessonServiceImpl implements BLessonService {
...
@@ -1823,11 +1832,11 @@ public class BLessonServiceImpl implements BLessonService {
case
"3"
:
c1
.
add
(
Calendar
.
WEEK_OF_MONTH
,
time
);
break
;
case
"3"
:
c1
.
add
(
Calendar
.
WEEK_OF_MONTH
,
time
);
break
;
case
"4"
:
c1
.
add
(
Calendar
.
MONTH
,
time
);
break
;
case
"4"
:
c1
.
add
(
Calendar
.
MONTH
,
time
);
break
;
}
}
log
.
info
(
"-----------addNew-------当前时间--"
+
DateUtil
.
date
(
c
)+
"
new标志结束时间
"
+
DateUtil
.
date
(
c1
));
log
.
info
(
"-----------addNew-------当前时间--"
+
DateUtil
.
date
(
c
)+
"
--new标志结束时间--
"
+
DateUtil
.
date
(
c1
));
if
(
c1
.
after
(
c
))
if
(
c1
.
after
(
c
))
{
b
.
setIsNew
(
"1"
);
b
.
setIsNew
(
"1"
);
log
.
info
(
"-----------addNew---------当前课程已设置new-------"
+
b
);
log
.
info
(
"-----------addNew---------当前课程已设置new-------"
+
b
);
}
}
}
}
}
return
result
;
return
result
;
...
@@ -1836,11 +1845,14 @@ public class BLessonServiceImpl implements BLessonService {
...
@@ -1836,11 +1845,14 @@ public class BLessonServiceImpl implements BLessonService {
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
List
<
BLesson
>
queryHomeBLessons
()
{
public
List
<
BLesson
>
queryHomeBLessons
()
{
CurUser
curUser
=
UserUtil
.
getCurUser
();
CurUser
curUser
=
UserUtil
.
getCurUser
();
log
.
info
(
"--------获取当前用户人---"
+
curUser
);
List
<
String
>
ids
=
Arrays
.
asList
(
new
String
[]{
curUser
.
getUserId
()});
List
<
String
>
ids
=
Arrays
.
asList
(
new
String
[]{
curUser
.
getUserId
()});
MTUserGetsReqDTO
mtUserGetsReqDTO
=
new
MTUserGetsReqDTO
();
MTUserGetsReqDTO
mtUserGetsReqDTO
=
new
MTUserGetsReqDTO
();
mtUserGetsReqDTO
.
setCorpId
(
curUser
.
getCorpId
());
mtUserGetsReqDTO
.
setCorpId
(
curUser
.
getCorpId
());
mtUserGetsReqDTO
.
setIds
(
ids
);
mtUserGetsReqDTO
.
setIds
(
ids
);
log
.
info
(
"------------mtUserGetsReqDTO--------"
+
mtUserGetsReqDTO
);
List
<
MTUserInfoRspDTO
>
mtUserInfoRspDTOList
=
cotactApiRequestClient
.
userGets
(
mtUserGetsReqDTO
);
List
<
MTUserInfoRspDTO
>
mtUserInfoRspDTOList
=
cotactApiRequestClient
.
userGets
(
mtUserGetsReqDTO
);
log
.
info
(
"------------mtUserInfoRspDTOList--------"
+
mtUserInfoRspDTOList
);
List
<
String
>
departs
=
new
ArrayList
<>();
List
<
String
>
departs
=
new
ArrayList
<>();
if
(
mtUserInfoRspDTOList
!=
null
&&
mtUserInfoRspDTOList
.
size
()
>
0
)
{
if
(
mtUserInfoRspDTOList
!=
null
&&
mtUserInfoRspDTOList
.
size
()
>
0
)
{
departs
=
QueryDepart
.
queryDepart
(
mtUserInfoRspDTOList
);
departs
=
QueryDepart
.
queryDepart
(
mtUserInfoRspDTOList
);
...
@@ -1850,7 +1862,34 @@ public class BLessonServiceImpl implements BLessonService {
...
@@ -1850,7 +1862,34 @@ public class BLessonServiceImpl implements BLessonService {
FirstPageQueryDTO
firstPageQueryDTO
=
new
FirstPageQueryDTO
();
FirstPageQueryDTO
firstPageQueryDTO
=
new
FirstPageQueryDTO
();
firstPageQueryDTO
.
setDeparts
(
departs
);
firstPageQueryDTO
.
setDeparts
(
departs
);
List
<
String
>
courseIds
=
null
;
List
<
String
>
courseIds
=
null
;
return
addNew
(
bLessonRepository
.
queryHomeBLesson
(
firstPageQueryDTO
,
courseIds
));
log
.
info
(
"----------firstPageQueryDTO---------"
+
firstPageQueryDTO
);
List
<
BLesson
>
result
=
bLessonRepository
.
queryHomeBLesson
(
firstPageQueryDTO
,
courseIds
);
log
.
info
(
"-----------addNew---------首页查询课程或培训的总个数----------"
+
result
.
size
()+
"--------------------"
);
return
addNew
(
result
);
}
}
public
static
void
main
(
String
[]
args
)
{
//获取当前时间
Calendar
c
=
Calendar
.
getInstance
();
int
time
=
2
;
//step 1 查询look表中是否有对应任何课程的点击记录
int
flag
=
0
;
//step 2 存在则返回,不存在则判断时间 满足条件 setIsNew()
if
(
flag
<=
0
)
{
//flag <= 0 说明此用户未点击过该课程
Calendar
c1
=
Calendar
.
getInstance
();
switch
(
"3"
){
case
"1"
:
c1
.
add
(
Calendar
.
HOUR
,
time
);
break
;
case
"2"
:
c1
.
add
(
Calendar
.
DAY_OF_MONTH
,
time
);
break
;
case
"3"
:
c1
.
add
(
Calendar
.
WEEK_OF_MONTH
,
time
);
break
;
case
"4"
:
c1
.
add
(
Calendar
.
MONTH
,
time
);
break
;
}
log
.
info
(
"-----------addNew-------当前时间--"
+
DateUtil
.
date
(
c
)+
"--new标志结束时间--"
+
DateUtil
.
date
(
c1
));
log
.
info
(
c1
.
after
(
c
)+
""
);
log
.
info
(
DateUtil
.
date
(
c1
).
after
(
DateUtil
.
date
(
c
))+
""
);
}
}
}
}
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