Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
chuanshan_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
廖旭伟
chuanshan_gov_platform
Commits
02231c0e
Commit
02231c0e
authored
Mar 13, 2023
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
站点事项增加是否已收藏字段
parent
ca401b5a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
7 deletions
+46
-7
knowledge-base/src/main/java/com/mortals/xhx/module/site/model/vo/SiteMatterVo.java
...va/com/mortals/xhx/module/site/model/vo/SiteMatterVo.java
+6
-7
knowledge-base/src/main/java/com/mortals/xhx/module/site/service/impl/SiteMatterServiceImpl.java
...s/xhx/module/site/service/impl/SiteMatterServiceImpl.java
+40
-0
No files found.
knowledge-base/src/main/java/com/mortals/xhx/module/site/model/vo/SiteMatterVo.java
View file @
02231c0e
package
com.mortals.xhx.module.site.model.vo
;
import
com.mortals.framework.model.BaseEntityLong
;
import
com.mortals.xhx.module.site.model.SiteMatterEntity
;
import
lombok.Data
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
...
...
@@ -9,16 +11,13 @@ import java.util.List;
* @author zxfei
* @date 2023-03-10
*/
@Data
public
class
SiteMatterVo
extends
BaseEntityLong
{
/** 材料数量 */
private
Integer
datumCount
;
private
Integer
datumCount
=
0
;
public
Integer
getDatumCount
()
{
return
datumCount
;
}
/** 是否已添加收藏 */
private
Integer
isCollect
=
0
;
public
void
setDatumCount
(
Integer
datumCount
)
{
this
.
datumCount
=
datumCount
;
}
}
\ No newline at end of file
knowledge-base/src/main/java/com/mortals/xhx/module/site/service/impl/SiteMatterServiceImpl.java
View file @
02231c0e
package
com.mortals.xhx.module.site.service.impl
;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.framework.util.DataUtil
;
import
com.mortals.xhx.module.matter.model.MatterDatumEntity
;
import
com.mortals.xhx.module.matter.model.MatterDatumFileEntity
;
import
com.mortals.xhx.module.matter.model.MatterDatumFileQuery
;
import
com.mortals.xhx.module.matter.model.MatterDatumQuery
;
import
com.mortals.xhx.module.matter.service.MatterDatumService
;
import
com.mortals.xhx.module.user.model.UserCollectEntity
;
import
com.mortals.xhx.module.user.model.UserCollectQuery
;
import
com.mortals.xhx.module.user.service.UserCollectService
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -31,6 +35,8 @@ public class SiteMatterServiceImpl extends AbstractCRUDServiceImpl<SiteMatterDao
@Autowired
private
MatterDatumService
matterDatumService
;
@Autowired
private
UserCollectService
userCollectService
;
@Override
protected
void
findAfter
(
SiteMatterEntity
params
,
PageInfo
pageInfo
,
Context
context
,
List
<
SiteMatterEntity
>
list
)
throws
AppException
{
...
...
@@ -42,6 +48,23 @@ public class SiteMatterServiceImpl extends AbstractCRUDServiceImpl<SiteMatterDao
item
.
setDatumCount
(
0
);
}
}).
count
();
if
(
context
!=
null
&&
context
.
getUser
()!=
null
){
List
<
UserCollectEntity
>
userCollectEntities
=
userCollectService
.
find
(
new
UserCollectQuery
().
userId
(
context
.
getUser
().
getId
()).
collectType
(
1
));
Map
<
Long
,
Long
>
matterMap
=
new
HashMap
<>();
if
(
CollectionUtils
.
isNotEmpty
(
userCollectEntities
)){
for
(
UserCollectEntity
userCollectEntity:
userCollectEntities
){
Long
matterId
=
DataUtil
.
converStr2Long
(
userCollectEntity
.
getBusinessId
(),
0
);
matterMap
.
put
(
matterId
,
matterId
);
}
}
else
{
matterMap
.
put
(
0
l
,
0
l
);
}
list
.
stream
().
peek
(
item
->{
if
(
matterMap
.
containsKey
(
item
.
getMatterId
())){
item
.
setIsCollect
(
1
);
}
}).
count
();
}
super
.
findAfter
(
params
,
context
,
list
);
}
...
...
@@ -55,6 +78,23 @@ public class SiteMatterServiceImpl extends AbstractCRUDServiceImpl<SiteMatterDao
item
.
setDatumCount
(
0
);
}
}).
count
();
if
(
context
!=
null
&&
context
.
getUser
()!=
null
){
List
<
UserCollectEntity
>
userCollectEntities
=
userCollectService
.
find
(
new
UserCollectQuery
().
userId
(
context
.
getUser
().
getId
()).
collectType
(
1
));
Map
<
Long
,
Long
>
matterMap
=
new
HashMap
<>();
if
(
CollectionUtils
.
isNotEmpty
(
userCollectEntities
)){
for
(
UserCollectEntity
userCollectEntity:
userCollectEntities
){
Long
matterId
=
DataUtil
.
converStr2Long
(
userCollectEntity
.
getBusinessId
(),
0
);
matterMap
.
put
(
matterId
,
matterId
);
}
}
else
{
matterMap
.
put
(
0
l
,
0
l
);
}
list
.
stream
().
peek
(
item
->{
if
(
matterMap
.
containsKey
(
item
.
getMatterId
())){
item
.
setIsCollect
(
1
);
}
}).
count
();
}
super
.
findAfter
(
params
,
context
,
list
);
}
...
...
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