Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
enterprise-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
赵啸非
enterprise-platform
Commits
9008190b
Commit
9008190b
authored
Dec 12, 2024
by
姬鋆屾
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.scsmile.cn/zxf/enterprise-platform
parents
937271b3
dd030c75
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
11 deletions
+40
-11
enterprise-manager/src/main/java/com/mortals/xhx/daemon/task/StaffViewsByDayInitTaskImpl.java
.../mortals/xhx/daemon/task/StaffViewsByDayInitTaskImpl.java
+15
-0
enterprise-manager/src/main/java/com/mortals/xhx/module/bussinesscard/web/BussinesscardController.java
...xhx/module/bussinesscard/web/BussinesscardController.java
+9
-2
enterprise-manager/src/main/java/com/mortals/xhx/module/product/service/impl/ProductServiceImpl.java
...s/xhx/module/product/service/impl/ProductServiceImpl.java
+16
-9
No files found.
enterprise-manager/src/main/java/com/mortals/xhx/daemon/task/StaffViewsByDayInitTaskImpl.java
View file @
9008190b
...
@@ -3,6 +3,8 @@ package com.mortals.xhx.daemon.task;
...
@@ -3,6 +3,8 @@ package com.mortals.xhx.daemon.task;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.service.ITask
;
import
com.mortals.framework.service.ITask
;
import
com.mortals.framework.service.ITaskExcuteService
;
import
com.mortals.framework.service.ITaskExcuteService
;
import
com.mortals.xhx.module.bussinesscard.model.BussinesscardEntity
;
import
com.mortals.xhx.module.bussinesscard.service.BussinesscardService
;
import
com.mortals.xhx.module.staff.dao.StaffDao
;
import
com.mortals.xhx.module.staff.dao.StaffDao
;
import
com.mortals.xhx.module.staff.model.StaffEntity
;
import
com.mortals.xhx.module.staff.model.StaffEntity
;
import
com.mortals.xhx.module.staff.service.StaffService
;
import
com.mortals.xhx.module.staff.service.StaffService
;
...
@@ -21,6 +23,8 @@ import java.util.List;
...
@@ -21,6 +23,8 @@ import java.util.List;
public
class
StaffViewsByDayInitTaskImpl
implements
ITaskExcuteService
{
public
class
StaffViewsByDayInitTaskImpl
implements
ITaskExcuteService
{
@Autowired
@Autowired
private
StaffService
staffService
;
private
StaffService
staffService
;
@Autowired
private
BussinesscardService
bussinesscardService
;
@Override
@Override
public
void
excuteTask
(
ITask
task
)
throws
AppException
{
public
void
excuteTask
(
ITask
task
)
throws
AppException
{
...
@@ -35,6 +39,17 @@ public class StaffViewsByDayInitTaskImpl implements ITaskExcuteService {
...
@@ -35,6 +39,17 @@ public class StaffViewsByDayInitTaskImpl implements ITaskExcuteService {
if
(
updateList
.
size
()>
0
){
if
(
updateList
.
size
()>
0
){
staffService
.
update
(
updateList
);
staffService
.
update
(
updateList
);
}
}
List
<
BussinesscardEntity
>
bussinesscardList
=
bussinesscardService
.
getAllList
();
List
<
BussinesscardEntity
>
updateBussinesscard
=
new
ArrayList
<>();
for
(
BussinesscardEntity
entity:
bussinesscardList
){
BussinesscardEntity
update
=
new
BussinesscardEntity
();
update
.
setId
(
entity
.
getId
());
update
.
setViewsByDay
(
0
);
updateBussinesscard
.
add
(
update
);
}
if
(
updateBussinesscard
.
size
()>
0
){
bussinesscardService
.
update
(
updateBussinesscard
);
}
}
}
@Override
@Override
...
...
enterprise-manager/src/main/java/com/mortals/xhx/module/bussinesscard/web/BussinesscardController.java
View file @
9008190b
...
@@ -104,12 +104,19 @@ public class BussinesscardController extends BaseCRUDJsonBodyMappingController<B
...
@@ -104,12 +104,19 @@ public class BussinesscardController extends BaseCRUDJsonBodyMappingController<B
private
void
saveRecord
(
BussinesscardEntity
entity
,
Context
context
){
private
void
saveRecord
(
BussinesscardEntity
entity
,
Context
context
){
if
(
entity
!=
null
){
if
(
entity
!=
null
){
if
(
context
!=
null
&&
context
.
getUser
()!=
null
){
if
(
context
!=
null
&&
context
.
getUser
()!=
null
){
bussinesscardRecordService
.
saveRecord
(
entity
,
context
);
UserEntity
userEntity
=
userService
.
get
(
context
.
getUser
().
getId
());
UserEntity
userEntity
=
userService
.
get
(
context
.
getUser
().
getId
());
if
(
userEntity
!=
null
){
if
(
userEntity
!=
null
){
//非本人浏览时才增加浏览次数
//非本人浏览时才增加浏览次数
if
(!(
userEntity
.
getStaffId
()!=
null
&&
userEntity
.
getStaffId
().
longValue
()
==
entity
.
getStaffId
().
longValue
())){
if
(!(
userEntity
.
getStaffId
()!=
null
&&
userEntity
.
getStaffId
().
longValue
()==
entity
.
getStaffId
().
longValue
())){
staffService
.
saveView
(
entity
.
getStaffId
());
staffService
.
saveView
(
entity
.
getStaffId
());
Map
condition
=
new
HashMap
();
condition
.
put
(
"id"
,
entity
.
getId
());
Map
data
=
new
HashMap
();
data
.
put
(
"sumViewsIncrement"
,
1
);
data
.
put
(
"viewsByDayIncrement"
,
1
);
service
.
getDao
().
update
(
data
,
condition
);
bussinesscardRecordService
.
saveRecord
(
entity
,
context
);
}
}
}
}
}
}
...
...
enterprise-manager/src/main/java/com/mortals/xhx/module/product/service/impl/ProductServiceImpl.java
View file @
9008190b
...
@@ -133,15 +133,18 @@ public class ProductServiceImpl extends AbstractCRUDCacheServiceImpl<ProductDao,
...
@@ -133,15 +133,18 @@ public class ProductServiceImpl extends AbstractCRUDCacheServiceImpl<ProductDao,
@Override
@Override
public
List
<
ProductEntity
>
getProductEntitiesByCompanyId
(
ProductEntity
entity
,
List
<
CompanyProductEntity
>
companyProducList
)
{
public
List
<
ProductEntity
>
getProductEntitiesByCompanyId
(
ProductEntity
entity
,
List
<
CompanyProductEntity
>
companyProducList
)
{
List
<
ProductEntity
>
productList
=
companyProducList
.
stream
().
map
(
item
->
{
List
<
ProductEntity
>
productList
=
new
ArrayList
<>();
ProductEntity
productEntity
=
this
.
getCache
(
item
.
getProductId
().
toString
());
if
(
CollectionUtils
.
isNotEmpty
(
companyProducList
)){
if
(!
ObjectUtils
.
isEmpty
(
productEntity
))
{
companyProducList
.
forEach
(
item
->{
productEntity
.
setCompanyId
(
entity
.
getCompanyId
());
ProductEntity
productEntity
=
this
.
getCache
(
item
.
getProductId
().
toString
());
String
categoryIds
=
productCategoryService
.
find
(
new
ProductCategoryQuery
().
productId
(
item
.
getId
())).
stream
().
map
(
i
->
i
.
getCategoryId
().
toString
()).
collect
(
Collectors
.
joining
(
","
));
if
(!
ObjectUtils
.
isEmpty
(
productEntity
))
{
productEntity
.
setCategoryId
(
categoryIds
);
productEntity
.
setCompanyId
(
entity
.
getCompanyId
());
}
String
categoryIds
=
productCategoryService
.
find
(
new
ProductCategoryQuery
().
productId
(
item
.
getId
())).
stream
().
map
(
i
->
i
.
getCategoryId
().
toString
()).
collect
(
Collectors
.
joining
(
","
));
return
productEntity
;
productEntity
.
setCategoryId
(
categoryIds
);
}).
collect
(
Collectors
.
toList
());
productList
.
add
(
productEntity
);
}
});
}
return
productList
;
return
productList
;
}
}
...
@@ -331,6 +334,10 @@ public class ProductServiceImpl extends AbstractCRUDCacheServiceImpl<ProductDao,
...
@@ -331,6 +334,10 @@ public class ProductServiceImpl extends AbstractCRUDCacheServiceImpl<ProductDao,
}
else
{
}
else
{
entity
.
setFavoriteStatus
(
0
);
entity
.
setFavoriteStatus
(
0
);
}
}
String
categoryIds
=
productCategoryService
.
find
(
new
ProductCategoryQuery
().
productId
(
entity
.
getId
())).
stream
().
map
(
i
->
i
.
getCategoryId
().
toString
()).
distinct
().
collect
(
Collectors
.
joining
(
","
));
String
companyIds
=
companyProductService
.
find
(
new
CompanyProductQuery
().
productId
(
entity
.
getId
())).
stream
().
map
(
i
->
i
.
getCompanyId
().
toString
()).
distinct
().
collect
(
Collectors
.
joining
(
","
));
entity
.
setCompanyId
(
companyIds
);
entity
.
setCategoryId
(
categoryIds
);
}
}
return
entity
;
return
entity
;
}
}
...
...
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