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
847c3e16
Commit
847c3e16
authored
Jun 17, 2020
by
luzhuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: lable 添加 newCount
parent
be46f5b5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
16 deletions
+48
-16
BCourseServiceImpl.java
...oft/business/bcourse/service/impl/BCourseServiceImpl.java
+2
-1
BLabel.java
src/main/java/org/rcisoft/business/blabel/entity/BLabel.java
+4
-0
BLabelServiceImpl.java
...isoft/business/blabel/service/impl/BLabelServiceImpl.java
+41
-14
BLessonController.java
...cisoft/business/blesson/controller/BLessonController.java
+1
-1
No files found.
src/main/java/org/rcisoft/business/bcourse/service/impl/BCourseServiceImpl.java
View file @
847c3e16
...
...
@@ -276,6 +276,7 @@ public class BCourseServiceImpl implements BCourseService {
continue
;
}
}
secNum
+=
num
;
//添加分类直属 new课程的数量
if
(
dto
.
getChildren
()
==
null
)
continue
;
for
(
QueryCourseResDTO
dto1
:
dto
.
getChildren
()){
//二级分类
...
...
@@ -307,9 +308,9 @@ public class BCourseServiceImpl implements BCourseService {
secNum
+=
secNum1
;
//将二级分类下三级分类中的数量添加到 二级分类中
}
dto
.
setNewCount
(
secNum
);
}
return
resDTOS
;
}
...
...
src/main/java/org/rcisoft/business/blabel/entity/BLabel.java
View file @
847c3e16
...
...
@@ -25,4 +25,8 @@ public class BLabel extends IdEntity<BLabel> {
@ApiModelProperty
(
value
=
"标签名"
)
private
String
lName
;
@Transient
@ApiModelProperty
(
value
=
"新消息的个数"
)
private
int
newCount
;
}
src/main/java/org/rcisoft/business/blabel/service/impl/BLabelServiceImpl.java
View file @
847c3e16
...
...
@@ -2,8 +2,11 @@ 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.dto.QueryLabelResDTO
;
import
org.rcisoft.business.blabel.entity.BLabel
;
import
org.rcisoft.business.blabel.service.BLabelService
;
import
org.rcisoft.business.blesson.entity.BLesson
;
import
org.rcisoft.business.blesson.service.impl.BLessonServiceImpl
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.constant.MessageConstant
;
import
org.rcisoft.core.exception.ServiceException
;
...
...
@@ -17,44 +20,68 @@ import org.springframework.transaction.annotation.Propagation;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.List
;
@Service
public
class
BLabelServiceImpl
implements
BLabelService
{
@Autowired
private
BLabelRepository
bLabelRepository
;
@Autowired
private
BLessonServiceImpl
bLessonService
;
@Override
public
List
<
BLabel
>
queryBlabelsByPagination
(
PageUtil
pageUtil
,
String
lName
,
String
corpId
)
{
return
bLabelRepository
.
queryBlabels
(
lName
,
corpId
);
public
List
<
BLabel
>
queryBlabelsByPagination
(
PageUtil
pageUtil
,
String
lName
,
String
corpId
)
{
return
bLabelRepository
.
queryBlabels
(
lName
,
corpId
);
}
@Override
public
List
<
BLabel
>
queryBlabels
(
String
lName
,
String
corpId
)
{
return
bLabelRepository
.
queryBlabels
(
lName
,
corpId
);
public
List
<
BLabel
>
queryBlabels
(
String
lName
,
String
corpId
)
{
List
<
BLabel
>
labels
=
bLabelRepository
.
queryBlabels
(
lName
,
corpId
);
List
<
BLesson
>
lessons
=
bLessonService
.
queryHomeBLessons
();
for
(
BLabel
label
:
labels
)
{
int
num
=
0
;
for
(
BLesson
lesson
:
lessons
)
{
List
<
QueryLabelResDTO
>
labelResDTOS
=
lesson
.
getLabelList
();
if
(
labelResDTOS
.
size
()
>
0
)
{
for
(
QueryLabelResDTO
dto
:
labelResDTOS
)
{
if
(
dto
.
getBusinessId
()
==
label
.
getBusinessId
())
{
num
++;
}
else
{
continue
;
}
}
}
}
label
.
setNewCount
(
num
);
}
return
labels
;
}
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
PersistModel
insertLabel
(
BLabel
bLabel
,
CurUser
curUser
)
{
if
(
StringUtils
.
isBlank
(
bLabel
.
getLName
()))
{
if
(
StringUtils
.
isBlank
(
bLabel
.
getLName
()))
{
throw
new
ServiceException
(
"标签名称不能为空"
);
}
int
line
=
bLabelRepository
.
checknameByName
(
bLabel
.
getLName
(),
bLabel
.
getBusinessId
(),
curUser
.
getCorpId
());
if
(
line
>
0
)
{
int
line
=
bLabelRepository
.
checknameByName
(
bLabel
.
getLName
(),
bLabel
.
getBusinessId
(),
curUser
.
getCorpId
());
if
(
line
>
0
)
{
throw
new
ServiceException
(
ResultServiceEnums
.
NAME_IS_EXISTS
);
}
UserUtil
.
setCurrentPersistOperation
(
bLabel
);
return
new
PersistModel
(
bLabelRepository
.
insert
(
bLabel
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
)
;
return
new
PersistModel
(
bLabelRepository
.
insert
(
bLabel
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
)
;
}
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
PersistModel
updateLabel
(
BLabel
bLabel
,
CurUser
curUser
)
{
if
(
StringUtils
.
isBlank
(
bLabel
.
getLName
()))
{
if
(
StringUtils
.
isBlank
(
bLabel
.
getLName
()))
{
throw
new
ServiceException
(
"标签名称不能为空"
);
}
int
line
=
bLabelRepository
.
checknameByName
(
bLabel
.
getLName
(),
bLabel
.
getBusinessId
(),
curUser
.
getCorpId
());
if
(
line
>
0
)
{
int
line
=
bLabelRepository
.
checknameByName
(
bLabel
.
getLName
(),
bLabel
.
getBusinessId
(),
curUser
.
getCorpId
());
if
(
line
>
0
)
{
throw
new
ServiceException
(
ResultServiceEnums
.
NAME_IS_EXISTS
);
}
UserUtil
.
setCurrentMergeOperation
(
bLabel
);
...
...
@@ -62,7 +89,7 @@ public class BLabelServiceImpl implements BLabelService {
}
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
PersistModel
removeLabel
(
String
id
)
{
int
line
=
bLabelRepository
.
removeLabel
(
id
);
return
new
PersistModel
(
line
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
);
...
...
src/main/java/org/rcisoft/business/blesson/controller/BLessonController.java
View file @
847c3e16
...
...
@@ -784,7 +784,7 @@ public class BLessonController extends PaginationController<BLesson> {
@ApiOperation
(
value
=
"645555 点击课程"
,
notes
=
"取消new显示"
)
@PostMapping
(
value
=
"/test"
)
public
Result
test
(
CurUser
curUser
)
{
public
Result
test
()
{
return
Result
.
builder
(
bLessonService
.
test
(),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
...
...
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