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
8aceea52
Commit
8aceea52
authored
Jul 04, 2020
by
luzhuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 查询newCount
parent
5356397e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
87 additions
and
0 deletions
+87
-0
BLessonController.java
...cisoft/business/blesson/controller/BLessonController.java
+13
-0
NewCountDTO.java
...in/java/org/rcisoft/business/blesson/dto/NewCountDTO.java
+14
-0
BLessonService.java
.../org/rcisoft/business/blesson/service/BLessonService.java
+2
-0
BLessonServiceImpl.java
...oft/business/blesson/service/impl/BLessonServiceImpl.java
+58
-0
No files found.
src/main/java/org/rcisoft/business/blesson/controller/BLessonController.java
View file @
8aceea52
...
@@ -808,5 +808,18 @@ public class BLessonController extends PaginationController<BLesson> {
...
@@ -808,5 +808,18 @@ public class BLessonController extends PaginationController<BLesson> {
gridModel
);
gridModel
);
}
}
/**
* @param
* @return
*/
@ApiOperation
(
value
=
"647 返回首页模块角标数量"
,
notes
=
"返回首页模块角标数量"
,
response
=
BLesson
.
class
)
@GetMapping
(
value
=
"/queryNewCount"
)
public
Result
queryNewCount
(
CurUser
curUser
,
BindingResult
bindingResult
)
{
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
bLessonService
.
queryNewCount
(
curUser
));
}
}
}
src/main/java/org/rcisoft/business/blesson/dto/NewCountDTO.java
0 → 100644
View file @
8aceea52
package
org
.
rcisoft
.
business
.
blesson
.
dto
;
import
lombok.Data
;
@Data
public
class
NewCountDTO
{
public
int
recommend
;
public
int
collect
;
public
int
learn
;
public
int
interest
;
public
int
push
;
}
src/main/java/org/rcisoft/business/blesson/service/BLessonService.java
View file @
8aceea52
...
@@ -315,4 +315,6 @@ public interface BLessonService{
...
@@ -315,4 +315,6 @@ public interface BLessonService{
List
<
BLesson
>
queryHomeBLessons
(
CurUser
curUser
);
List
<
BLesson
>
queryHomeBLessons
(
CurUser
curUser
);
NewCountDTO
queryNewCount
(
CurUser
curUser
);
}
}
src/main/java/org/rcisoft/business/blesson/service/impl/BLessonServiceImpl.java
View file @
8aceea52
...
@@ -1935,4 +1935,62 @@ public class BLessonServiceImpl implements BLessonService {
...
@@ -1935,4 +1935,62 @@ public class BLessonServiceImpl implements BLessonService {
log
.
info
(
"-----------addNew---------首页查询课程或培训的总个数----------"
+
result
.
size
()+
"--------------------"
);
log
.
info
(
"-----------addNew---------首页查询课程或培训的总个数----------"
+
result
.
size
()+
"--------------------"
);
return
addNew
(
result
);
return
addNew
(
result
);
}
}
@Override
public
NewCountDTO
queryNewCount
(
CurUser
curUser
)
{
FindListLessonDTO
model
=
new
FindListLessonDTO
();
model
.
setCorpId
(
curUser
.
getCorpId
());
model
.
setUserId
(
curUser
.
getUserId
());
List
<
String
>
ids
=
Arrays
.
asList
(
new
String
[]{
model
.
getUserId
()});
MTUserGetsReqDTO
mtUserGetsReqDTO
=
new
MTUserGetsReqDTO
();
mtUserGetsReqDTO
.
setCorpId
(
model
.
getCorpId
());
mtUserGetsReqDTO
.
setIds
(
ids
);
List
<
MTUserInfoRspDTO
>
mtUserInfoRspDTOList
=
cotactApiRequestClient
.
userGets
(
mtUserGetsReqDTO
);
List
<
String
>
departs
=
new
ArrayList
<>();
if
(
mtUserInfoRspDTOList
!=
null
&&
mtUserInfoRspDTOList
.
size
()
>
0
)
{
departs
=
QueryDepart
.
queryDepart
(
mtUserInfoRspDTOList
);
departs
.
removeAll
(
Collections
.
singleton
(
null
));
departs
.
removeAll
(
Collections
.
singleton
(
""
));
}
model
.
setDeparts
(
departs
);
int
recommendCount
=
0
;
int
learnCount
=
0
;
int
collectCount
=
0
;
int
interestCount
=
0
;
int
pushCount
=
0
;
List
<
BLesson
>
recommend
=
addNew
(
bLessonRepository
.
queryRecommendListByPagination
(
model
));
List
<
BLesson
>
learn
=
addNew
(
bLessonRepository
.
queryLearnListByPagination
(
model
));
List
<
BLesson
>
collect
=
addNew
(
bLessonRepository
.
queryCollectListByPagination
(
model
));
List
<
BLesson
>
interest
=
addNew
(
bLessonRepository
.
queryInterestedListByPagination
(
model
));
List
<
BLesson
>
push
=
addNew
(
this
.
queryPush
(
model
));
for
(
BLesson
bLesson
:
recommend
){
if
(
"1"
.
equals
(
bLesson
.
getIsNew
())){
recommendCount
++;
}
}
for
(
BLesson
bLesson
:
learn
){
if
(
"1"
.
equals
(
bLesson
.
getIsNew
()))
learnCount
++;
}
for
(
BLesson
bLesson
:
collect
){
if
(
"1"
.
equals
(
bLesson
.
getIsNew
()))
collectCount
++;
}
for
(
BLesson
bLesson
:
interest
){
if
(
"1"
.
equals
(
bLesson
.
getIsNew
()))
interestCount
++;
}
for
(
BLesson
bLesson
:
push
){
if
(
"1"
.
equals
(
bLesson
.
getIsNew
()))
pushCount
++;
}
NewCountDTO
dto
=
new
NewCountDTO
();
dto
.
setRecommend
(
recommendCount
);
dto
.
setCollect
(
collectCount
);
dto
.
setLearn
(
learnCount
);
dto
.
setInterest
(
interestCount
);
dto
.
setPush
(
pushCount
);
return
dto
;
}
}
}
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