Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_ht
Overview
Overview
Details
Activity
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
pseer
gxpt_ht
Commits
8f886aa4
Commit
8f886aa4
authored
Sep 19, 2024
by
YG8429
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
绑定关系查询,权益金日志查询修改查询方法,增加vo对象
parent
fa208304
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
159 additions
and
83 deletions
+159
-83
EquityFundLogController.java
.../share/web/controller/system/EquityFundLogController.java
+3
-3
SharingActivitiesController.java
...re/web/controller/system/SharingActivitiesController.java
+6
-5
EquityFundLogController.java
.../share/web/controller/system/EquityFundLogController.java
+9
-4
SharingActivitiesController.java
...re/web/controller/system/SharingActivitiesController.java
+13
-7
SharingActivitiesVo.java
...main/java/share/system/domain/vo/SharingActivitiesVo.java
+5
-0
EquityFundLogService.java
.../main/java/share/system/service/EquityFundLogService.java
+7
-1
SharingActivitiesService.java
...n/java/share/system/service/SharingActivitiesService.java
+4
-1
EquityFundLogServiceImpl.java
...a/share/system/service/impl/EquityFundLogServiceImpl.java
+53
-30
SharingActivitiesServiceImpl.java
...are/system/service/impl/SharingActivitiesServiceImpl.java
+59
-32
No files found.
share-admin/src/main/java/share/web/controller/system/EquityFundLogController.java
View file @
8f886aa4
...
@@ -43,7 +43,7 @@ public class EquityFundLogController extends BaseController
...
@@ -43,7 +43,7 @@ public class EquityFundLogController extends BaseController
public
TableDataInfo
list
(
EquityFundLog
equityFundLog
)
public
TableDataInfo
list
(
EquityFundLog
equityFundLog
)
{
{
startPage
();
startPage
();
List
<
EquityFundLog
Vo
>
list
=
equityFundLogService
.
selectEquityFundLogList
(
equityFundLog
);
List
<
EquityFundLog
>
list
=
equityFundLogService
.
selectEquityFundLogList
(
equityFundLog
);
return
getDataTable
(
list
);
return
getDataTable
(
list
);
}
}
...
@@ -55,8 +55,8 @@ public class EquityFundLogController extends BaseController
...
@@ -55,8 +55,8 @@ public class EquityFundLogController extends BaseController
@PostMapping
(
"/export"
)
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
EquityFundLog
equityFundLog
)
public
void
export
(
HttpServletResponse
response
,
EquityFundLog
equityFundLog
)
{
{
List
<
EquityFundLog
Vo
>
list
=
equityFundLogService
.
selectEquityFundLogList
(
equityFundLog
);
List
<
EquityFundLog
>
list
=
equityFundLogService
.
selectEquityFundLogList
(
equityFundLog
);
ExcelUtil
<
EquityFundLog
Vo
>
util
=
new
ExcelUtil
<
EquityFundLogVo
>(
EquityFundLogVo
.
class
);
ExcelUtil
<
EquityFundLog
>
util
=
new
ExcelUtil
<
EquityFundLog
>(
EquityFundLog
.
class
);
util
.
exportExcel
(
response
,
list
,
"权益金记录数据"
);
util
.
exportExcel
(
response
,
list
,
"权益金记录数据"
);
}
}
...
...
share-admin/src/main/java/share/web/controller/system/SharingActivitiesController.java
View file @
8f886aa4
...
@@ -40,10 +40,11 @@ public class SharingActivitiesController extends BaseController {
...
@@ -40,10 +40,11 @@ public class SharingActivitiesController extends BaseController {
*/
*/
@PreAuthorize
(
"@ss.hasPermi('system:activities:list')"
)
@PreAuthorize
(
"@ss.hasPermi('system:activities:list')"
)
@GetMapping
(
"/list"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
SharingActivities
sharingActivities
)
{
public
TableDataInfo
list
(
SharingActivities
Vo
sharingActivities
)
{
startPage
();
startPage
();
List
<
SharingActivitiesVo
>
list
=
sharingActivitiesService
.
selectSharingActivitiesList
(
sharingActivities
);
List
<
SharingActivities
>
list
=
sharingActivitiesService
.
selectSharingActivitiesList
(
sharingActivities
);
return
getDataTable
(
list
);
TableDataInfo
dataTable
=
getDataTable
(
list
);
return
sharingActivitiesService
.
pageList
(
dataTable
,
sharingActivities
);
}
}
/**
/**
...
@@ -53,8 +54,8 @@ public class SharingActivitiesController extends BaseController {
...
@@ -53,8 +54,8 @@ public class SharingActivitiesController extends BaseController {
@Log
(
title
=
"分享活动绑定关系"
,
businessType
=
BusinessType
.
EXPORT
)
@Log
(
title
=
"分享活动绑定关系"
,
businessType
=
BusinessType
.
EXPORT
)
@PostMapping
(
"/export"
)
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
SharingActivities
sharingActivities
)
{
public
void
export
(
HttpServletResponse
response
,
SharingActivities
sharingActivities
)
{
List
<
SharingActivities
Vo
>
list
=
sharingActivitiesService
.
selectSharingActivitiesList
(
sharingActivities
);
List
<
SharingActivities
>
list
=
sharingActivitiesService
.
selectSharingActivitiesList
(
sharingActivities
);
ExcelUtil
<
SharingActivities
Vo
>
util
=
new
ExcelUtil
<
SharingActivitiesVo
>(
SharingActivitiesVo
.
class
);
ExcelUtil
<
SharingActivities
>
util
=
new
ExcelUtil
<
SharingActivities
>(
SharingActivities
.
class
);
util
.
exportExcel
(
response
,
list
,
"分享活动绑定关系数据"
);
util
.
exportExcel
(
response
,
list
,
"分享活动绑定关系数据"
);
}
}
...
...
share-front/src/main/java/share/web/controller/system/EquityFundLogController.java
View file @
8f886aa4
...
@@ -11,6 +11,7 @@ import share.common.enums.BusinessType;
...
@@ -11,6 +11,7 @@ import share.common.enums.BusinessType;
import
share.common.utils.poi.ExcelUtil
;
import
share.common.utils.poi.ExcelUtil
;
import
share.system.domain.EquityFundLog
;
import
share.system.domain.EquityFundLog
;
import
share.system.domain.SConsumer
;
import
share.system.domain.SConsumer
;
import
share.system.domain.SharingActivities
;
import
share.system.domain.vo.DurationLogVo
;
import
share.system.domain.vo.DurationLogVo
;
import
share.system.domain.vo.EquityFundLogVo
;
import
share.system.domain.vo.EquityFundLogVo
;
import
share.system.domain.vo.FrontTokenComponent
;
import
share.system.domain.vo.FrontTokenComponent
;
...
@@ -35,12 +36,16 @@ public class EquityFundLogController extends BaseController {
...
@@ -35,12 +36,16 @@ public class EquityFundLogController extends BaseController {
* 查询本人权益金记录列表
* 查询本人权益金记录列表
*/
*/
@GetMapping
(
"/list"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
EquityFundLog
equityFundLog
)
{
public
TableDataInfo
list
(
EquityFundLogVo
equityFundLog
)
{
startPage
();
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
equityFundLog
.
setUid
(
user
.
getId
());
equityFundLog
.
setUid
(
user
.
getId
());
List
<
EquityFundLogVo
>
list
=
equityFundLogService
.
selectEquityFundLogList
(
equityFundLog
);
startPage
();
return
getDataTable
(
list
);
List
<
EquityFundLog
>
list
=
equityFundLogService
.
selectEquityFundLogList
(
equityFundLog
);
TableDataInfo
dataTable
=
getDataTable
(
list
);
return
equityFundLogService
.
pageList
(
dataTable
,
equityFundLog
);
}
}
...
...
share-front/src/main/java/share/web/controller/system/SharingActivitiesController.java
View file @
8f886aa4
...
@@ -36,19 +36,23 @@ public class SharingActivitiesController extends BaseController {
...
@@ -36,19 +36,23 @@ public class SharingActivitiesController extends BaseController {
*/
*/
@GetMapping
(
"/list"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
SharingActivitiesVo
sharingActivities
)
{
public
TableDataInfo
list
(
SharingActivitiesVo
sharingActivities
)
{
startPage
();
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
sharingActivities
.
setUid
(
user
.
getId
());
sharingActivities
.
setNewUid
(
user
.
getId
());
List
<
SharingActivitiesVo
>
list
=
sharingActivitiesService
.
selectSharingActivitiesList
(
sharingActivities
);
startPage
();
return
getDataTable
(
list
);
List
<
SharingActivities
>
list
=
sharingActivitiesService
.
selectSharingActivitiesList
(
sharingActivities
);
TableDataInfo
dataTable
=
getDataTable
(
list
);
return
sharingActivitiesService
.
pageList
(
dataTable
,
sharingActivities
);
}
}
@GetMapping
(
"/query"
)
@GetMapping
(
"/query"
)
public
AjaxResult
query
(
SharingActivities
sharingActivities
)
{
public
TableDataInfo
query
(
SharingActivitiesVo
sharingActivities
)
{
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
sharingActivities
.
setNewUid
(
user
.
getId
());
sharingActivities
.
setNewUid
(
user
.
getId
());
List
<
SharingActivitiesVo
>
list
=
sharingActivitiesService
.
selectSharingActivitiesList
(
sharingActivities
);
startPage
();
return
success
(
list
);
List
<
SharingActivities
>
list
=
sharingActivitiesService
.
selectSharingActivitiesList
(
sharingActivities
);
TableDataInfo
dataTable
=
getDataTable
(
list
);
return
sharingActivitiesService
.
pageList
(
dataTable
,
sharingActivities
);
}
}
/**
/**
...
@@ -65,4 +69,6 @@ public class SharingActivitiesController extends BaseController {
...
@@ -65,4 +69,6 @@ public class SharingActivitiesController extends BaseController {
}
}
share-system/src/main/java/share/system/domain/vo/SharingActivitiesVo.java
View file @
8f886aa4
...
@@ -30,4 +30,9 @@ public class SharingActivitiesVo extends SharingActivities {
...
@@ -30,4 +30,9 @@ public class SharingActivitiesVo extends SharingActivities {
private
String
newPhone
;
private
String
newPhone
;
private
Integer
pageNum
;
private
Integer
pageSize
;
}
}
share-system/src/main/java/share/system/service/EquityFundLogService.java
View file @
8f886aa4
...
@@ -2,8 +2,10 @@ package share.system.service;
...
@@ -2,8 +2,10 @@ package share.system.service;
import
java.util.List
;
import
java.util.List
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
share.common.core.page.TableDataInfo
;
import
share.system.domain.EquityFundLog
;
import
share.system.domain.EquityFundLog
;
import
share.system.domain.vo.EquityFundLogVo
;
import
share.system.domain.vo.EquityFundLogVo
;
import
share.system.domain.vo.SharingActivitiesVo
;
/**
/**
* 权益金记录Service接口
* 权益金记录Service接口
...
@@ -27,7 +29,7 @@ public interface EquityFundLogService extends IService<EquityFundLog>
...
@@ -27,7 +29,7 @@ public interface EquityFundLogService extends IService<EquityFundLog>
* @param equityFundLog 权益金记录
* @param equityFundLog 权益金记录
* @return 权益金记录集合
* @return 权益金记录集合
*/
*/
public
List
<
EquityFundLog
Vo
>
selectEquityFundLogList
(
EquityFundLog
equityFundLog
);
public
List
<
EquityFundLog
>
selectEquityFundLogList
(
EquityFundLog
equityFundLog
);
/**
/**
* 新增权益金记录
* 新增权益金记录
...
@@ -64,4 +66,8 @@ public interface EquityFundLogService extends IService<EquityFundLog>
...
@@ -64,4 +66,8 @@ public interface EquityFundLogService extends IService<EquityFundLog>
List
<
EquityFundLog
>
selectEquityFundLogByUid
(
Long
uid
);
List
<
EquityFundLog
>
selectEquityFundLogByUid
(
Long
uid
);
List
<
EquityFundLog
>
selectEquityFundLogByNewUid
(
Long
newUid
);
List
<
EquityFundLog
>
selectEquityFundLogByNewUid
(
Long
newUid
);
TableDataInfo
pageList
(
TableDataInfo
info
,
EquityFundLogVo
sharingActivities
);
}
}
share-system/src/main/java/share/system/service/SharingActivitiesService.java
View file @
8f886aa4
...
@@ -3,6 +3,7 @@ package share.system.service;
...
@@ -3,6 +3,7 @@ package share.system.service;
import
java.util.List
;
import
java.util.List
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
share.common.core.domain.AjaxResult
;
import
share.common.core.domain.AjaxResult
;
import
share.common.core.page.TableDataInfo
;
import
share.system.domain.SharingActivities
;
import
share.system.domain.SharingActivities
;
import
share.system.domain.vo.SharingActivitiesVo
;
import
share.system.domain.vo.SharingActivitiesVo
;
...
@@ -28,7 +29,7 @@ public interface SharingActivitiesService extends IService<SharingActivities>
...
@@ -28,7 +29,7 @@ public interface SharingActivitiesService extends IService<SharingActivities>
* @param sharingActivities 分享活动绑定关系
* @param sharingActivities 分享活动绑定关系
* @return 分享活动绑定关系集合
* @return 分享活动绑定关系集合
*/
*/
public
List
<
SharingActivities
Vo
>
selectSharingActivitiesList
(
SharingActivities
sharingActivities
);
public
List
<
SharingActivities
>
selectSharingActivitiesList
(
SharingActivities
sharingActivities
);
/**
/**
* 新增分享活动绑定关系
* 新增分享活动绑定关系
...
@@ -64,4 +65,6 @@ public interface SharingActivitiesService extends IService<SharingActivities>
...
@@ -64,4 +65,6 @@ public interface SharingActivitiesService extends IService<SharingActivities>
int
selectSharingActivitiesCount
(
SharingActivities
sharingActivities
);
int
selectSharingActivitiesCount
(
SharingActivities
sharingActivities
);
TableDataInfo
pageList
(
TableDataInfo
info
,
SharingActivitiesVo
sharingActivities
);
}
}
share-system/src/main/java/share/system/service/impl/EquityFundLogServiceImpl.java
View file @
8f886aa4
...
@@ -10,14 +10,13 @@ import cn.hutool.core.util.ObjectUtil;
...
@@ -10,14 +10,13 @@ import cn.hutool.core.util.ObjectUtil;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
share.common.core.page.TableDataInfo
;
import
share.common.utils.DateUtils
;
import
share.common.utils.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
share.common.utils.StringUtils
;
import
share.common.utils.StringUtils
;
import
share.system.domain.SConsumer
;
import
share.system.domain.SConsumer
;
import
share.system.domain.SharingActivities
;
import
share.system.domain.vo.EquityFundLogVo
;
import
share.system.domain.vo.EquityFundLogVo
;
import
share.system.domain.vo.SharingActivitiesVo
;
import
share.system.mapper.EquityFundLogMapper
;
import
share.system.mapper.EquityFundLogMapper
;
import
share.system.domain.EquityFundLog
;
import
share.system.domain.EquityFundLog
;
import
share.system.service.EquityFundLogService
;
import
share.system.service.EquityFundLogService
;
...
@@ -57,37 +56,11 @@ public class EquityFundLogServiceImpl extends ServiceImpl<EquityFundLogMapper, E
...
@@ -57,37 +56,11 @@ public class EquityFundLogServiceImpl extends ServiceImpl<EquityFundLogMapper, E
* @return 权益金记录
* @return 权益金记录
*/
*/
@Override
@Override
public
List
<
EquityFundLog
Vo
>
selectEquityFundLogList
(
EquityFundLog
equityFundLog
)
public
List
<
EquityFundLog
>
selectEquityFundLogList
(
EquityFundLog
equityFundLog
)
{
{
List
<
EquityFundLog
>
activities
=
equityFundLogMapper
.
selectEquityFundLogList
(
equityFundLog
);
List
<
EquityFundLogVo
>
voList
=
new
ArrayList
<>();
List
<
Long
>
collect
=
activities
.
stream
().
map
(
EquityFundLog:
:
getNewUid
).
collect
(
Collectors
.
toList
());
List
<
Long
>
uids
=
activities
.
stream
().
map
(
EquityFundLog:
:
getUid
).
collect
(
Collectors
.
toList
());
Map
<
Long
,
SConsumer
>
newUserMap
=
sConsumerService
.
list
(
new
LambdaQueryWrapper
<
SConsumer
>().
in
(
SConsumer:
:
getId
,
collect
))
.
stream
().
collect
(
Collectors
.
toMap
(
SConsumer:
:
getId
,
Function
.
identity
()));
Map
<
Long
,
SConsumer
>
userMap
=
sConsumerService
.
list
(
new
LambdaQueryWrapper
<
SConsumer
>().
in
(
SConsumer:
:
getId
,
uids
))
.
stream
().
collect
(
Collectors
.
toMap
(
SConsumer:
:
getId
,
Function
.
identity
()));
activities
.
stream
().
forEach
(
item
->{
EquityFundLogVo
vo
=
new
EquityFundLogVo
();
BeanUtils
.
copyProperties
(
item
,
vo
);
SConsumer
newConsumer
=
newUserMap
.
get
(
item
.
getNewUid
());
SConsumer
uConsumer
=
userMap
.
get
(
item
.
getUid
());
if
(
ObjectUtil
.
isNotEmpty
(
newConsumer
)){
vo
.
setNewAvatar
(
StringUtils
.
isNotEmpty
(
newConsumer
.
getAvatar
())
?
newConsumer
.
getAvatar
():
""
);
vo
.
setNewNickName
(
StringUtils
.
isNotEmpty
(
newConsumer
.
getNickName
())
?
newConsumer
.
getNickName
():
""
);
vo
.
setNewPhone
(
StringUtils
.
isNotEmpty
(
newConsumer
.
getPhone
())
?
newConsumer
.
getPhone
():
""
);
}
if
(
ObjectUtil
.
isNotEmpty
(
uConsumer
)){
vo
.
setAvatar
(
StringUtils
.
isNotEmpty
(
uConsumer
.
getAvatar
())
?
uConsumer
.
getAvatar
():
""
);
vo
.
setNickName
(
StringUtils
.
isNotEmpty
(
uConsumer
.
getNickName
())
?
uConsumer
.
getNickName
():
""
);
vo
.
setPhone
(
StringUtils
.
isNotEmpty
(
uConsumer
.
getPhone
())
?
uConsumer
.
getPhone
():
""
);
}
voList
.
add
(
vo
);
});
return
voList
;
return
equityFundLogMapper
.
selectEquityFundLogList
(
equityFundLog
)
;
}
}
/**
/**
...
@@ -151,4 +124,54 @@ public class EquityFundLogServiceImpl extends ServiceImpl<EquityFundLogMapper, E
...
@@ -151,4 +124,54 @@ public class EquityFundLogServiceImpl extends ServiceImpl<EquityFundLogMapper, E
return
equityFundLogMapper
.
selectList
(
new
LambdaQueryWrapper
<
EquityFundLog
>().
eq
(
EquityFundLog:
:
getNewUid
,
newUid
));
return
equityFundLogMapper
.
selectList
(
new
LambdaQueryWrapper
<
EquityFundLog
>().
eq
(
EquityFundLog:
:
getNewUid
,
newUid
));
}
}
@Override
public
TableDataInfo
pageList
(
TableDataInfo
info
,
EquityFundLogVo
equityFundLog
)
{
List
<
EquityFundLogVo
>
voList
=
new
ArrayList
<>();
List
<
EquityFundLog
>
activities
=(
List
<
EquityFundLog
>)
info
.
getRows
();
List
<
Long
>
collect
=
activities
.
stream
().
map
(
EquityFundLog:
:
getNewUid
).
collect
(
Collectors
.
toList
());
List
<
Long
>
uids
=
activities
.
stream
().
map
(
EquityFundLog:
:
getUid
).
collect
(
Collectors
.
toList
());
LambdaQueryWrapper
<
SConsumer
>
newSConsumer
=
new
LambdaQueryWrapper
<
SConsumer
>();
LambdaQueryWrapper
<
SConsumer
>
uSConsumer
=
new
LambdaQueryWrapper
<
SConsumer
>();
newSConsumer
.
in
(
SConsumer:
:
getId
,
collect
);
uSConsumer
.
in
(
SConsumer:
:
getId
,
uids
);
if
(
StringUtils
.
isNotEmpty
(
equityFundLog
.
getNewNickName
())){
newSConsumer
.
eq
(
SConsumer:
:
getNickName
,
equityFundLog
.
getNewNickName
());
}
if
(
StringUtils
.
isNotEmpty
(
equityFundLog
.
getNewPhone
())){
newSConsumer
.
eq
(
SConsumer:
:
getPhone
,
equityFundLog
.
getNewPhone
());
}
if
(
StringUtils
.
isNotEmpty
(
equityFundLog
.
getNickName
())){
uSConsumer
.
eq
(
SConsumer:
:
getNickName
,
equityFundLog
.
getNickName
());
}
if
(
StringUtils
.
isNotEmpty
(
equityFundLog
.
getPhone
())){
uSConsumer
.
eq
(
SConsumer:
:
getPhone
,
equityFundLog
.
getPhone
());
}
Map
<
Long
,
SConsumer
>
newUserMap
=
sConsumerService
.
list
(
newSConsumer
)
.
stream
().
collect
(
Collectors
.
toMap
(
SConsumer:
:
getId
,
Function
.
identity
()));
Map
<
Long
,
SConsumer
>
userMap
=
sConsumerService
.
list
(
uSConsumer
)
.
stream
().
collect
(
Collectors
.
toMap
(
SConsumer:
:
getId
,
Function
.
identity
()));
activities
.
stream
().
forEach
(
item
->{
EquityFundLogVo
vo
=
new
EquityFundLogVo
();
BeanUtils
.
copyProperties
(
item
,
vo
);
SConsumer
newConsumer
=
newUserMap
.
get
(
item
.
getNewUid
());
SConsumer
uConsumer
=
userMap
.
get
(
item
.
getUid
());
if
(
ObjectUtil
.
isNotEmpty
(
newConsumer
)){
vo
.
setNewAvatar
(
StringUtils
.
isNotEmpty
(
newConsumer
.
getAvatar
())
?
newConsumer
.
getAvatar
():
""
);
vo
.
setNewNickName
(
StringUtils
.
isNotEmpty
(
newConsumer
.
getNickName
())
?
newConsumer
.
getNickName
():
""
);
vo
.
setNewPhone
(
StringUtils
.
isNotEmpty
(
newConsumer
.
getPhone
())
?
newConsumer
.
getPhone
():
""
);
}
if
(
ObjectUtil
.
isNotEmpty
(
uConsumer
)){
vo
.
setAvatar
(
StringUtils
.
isNotEmpty
(
uConsumer
.
getAvatar
())
?
uConsumer
.
getAvatar
():
""
);
vo
.
setNickName
(
StringUtils
.
isNotEmpty
(
uConsumer
.
getNickName
())
?
uConsumer
.
getNickName
():
""
);
vo
.
setPhone
(
StringUtils
.
isNotEmpty
(
uConsumer
.
getPhone
())
?
uConsumer
.
getPhone
():
""
);
}
voList
.
add
(
vo
);
});
info
.
setRows
(
voList
);
return
info
;
}
}
}
share-system/src/main/java/share/system/service/impl/SharingActivitiesServiceImpl.java
View file @
8f886aa4
package
share
.
system
.
service
.
impl
;
package
share
.
system
.
service
.
impl
;
import
java.time.YearMonth
;
import
java.time.YearMonth
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.function.Function
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -15,6 +12,7 @@ import org.apache.poi.hssf.record.DVALRecord;
...
@@ -15,6 +12,7 @@ import org.apache.poi.hssf.record.DVALRecord;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
share.common.core.domain.AjaxResult
;
import
share.common.core.domain.AjaxResult
;
import
share.common.core.page.TableDataInfo
;
import
share.common.core.redis.RedisUtil
;
import
share.common.core.redis.RedisUtil
;
import
share.common.enums.ReceiptRdeisEnum
;
import
share.common.enums.ReceiptRdeisEnum
;
import
share.common.enums.YesNoEnum
;
import
share.common.enums.YesNoEnum
;
...
@@ -29,6 +27,8 @@ import share.system.domain.SharingActivities;
...
@@ -29,6 +27,8 @@ import share.system.domain.SharingActivities;
import
share.system.service.SConsumerService
;
import
share.system.service.SConsumerService
;
import
share.system.service.SharingActivitiesService
;
import
share.system.service.SharingActivitiesService
;
import
javax.annotation.Resource
;
/**
/**
* 分享活动绑定关系Service业务层处理
* 分享活动绑定关系Service业务层处理
*
*
...
@@ -38,7 +38,7 @@ import share.system.service.SharingActivitiesService;
...
@@ -38,7 +38,7 @@ import share.system.service.SharingActivitiesService;
@Service
@Service
public
class
SharingActivitiesServiceImpl
extends
ServiceImpl
<
SharingActivitiesMapper
,
SharingActivities
>
implements
SharingActivitiesService
public
class
SharingActivitiesServiceImpl
extends
ServiceImpl
<
SharingActivitiesMapper
,
SharingActivities
>
implements
SharingActivitiesService
{
{
@
Autowired
@
Resource
private
SharingActivitiesMapper
sharingActivitiesMapper
;
private
SharingActivitiesMapper
sharingActivitiesMapper
;
@Autowired
@Autowired
...
@@ -70,35 +70,11 @@ public class SharingActivitiesServiceImpl extends ServiceImpl<SharingActivitiesM
...
@@ -70,35 +70,11 @@ public class SharingActivitiesServiceImpl extends ServiceImpl<SharingActivitiesM
* @return 分享活动绑定关系
* @return 分享活动绑定关系
*/
*/
@Override
@Override
public
List
<
SharingActivities
Vo
>
selectSharingActivitiesList
(
SharingActivities
sharingActivities
)
public
List
<
SharingActivities
>
selectSharingActivitiesList
(
SharingActivities
sharingActivities
)
{
{
List
<
SharingActivities
>
activities
=
sharingActivitiesMapper
.
selectSharingActivitiesList
(
sharingActivities
);
List
<
SharingActivitiesVo
>
voList
=
new
ArrayList
<>();
List
<
Long
>
collect
=
activities
.
stream
().
map
(
SharingActivities:
:
getNewUid
).
collect
(
Collectors
.
toList
());
List
<
Long
>
uids
=
activities
.
stream
().
map
(
SharingActivities:
:
getUid
).
collect
(
Collectors
.
toList
());
Map
<
Long
,
SConsumer
>
newUserMap
=
sConsumerService
.
list
(
new
LambdaQueryWrapper
<
SConsumer
>().
in
(
SConsumer:
:
getId
,
collect
))
.
stream
().
collect
(
Collectors
.
toMap
(
SConsumer:
:
getId
,
Function
.
identity
()));
Map
<
Long
,
SConsumer
>
userMap
=
sConsumerService
.
list
(
new
LambdaQueryWrapper
<
SConsumer
>().
in
(
SConsumer:
:
getId
,
uids
))
.
stream
().
collect
(
Collectors
.
toMap
(
SConsumer:
:
getId
,
Function
.
identity
()));
activities
.
stream
().
forEach
(
item
->{
SharingActivitiesVo
vo
=
new
SharingActivitiesVo
();
BeanUtils
.
copyProperties
(
item
,
vo
);
SConsumer
newConsumer
=
newUserMap
.
get
(
item
.
getNewUid
());
SConsumer
uConsumer
=
userMap
.
get
(
item
.
getUid
());
if
(
ObjectUtil
.
isNotEmpty
(
newConsumer
)){
vo
.
setNewAvatar
(
StringUtils
.
isNotEmpty
(
newConsumer
.
getAvatar
())
?
newConsumer
.
getAvatar
():
""
);
vo
.
setNewNickName
(
StringUtils
.
isNotEmpty
(
newConsumer
.
getNickName
())
?
newConsumer
.
getNickName
():
""
);
vo
.
setNewPhone
(
StringUtils
.
isNotEmpty
(
newConsumer
.
getPhone
())
?
newConsumer
.
getPhone
():
""
);
}
if
(
ObjectUtil
.
isNotEmpty
(
uConsumer
)){
vo
.
setAvatar
(
StringUtils
.
isNotEmpty
(
uConsumer
.
getAvatar
())
?
uConsumer
.
getAvatar
():
""
);
vo
.
setNickName
(
StringUtils
.
isNotEmpty
(
uConsumer
.
getNickName
())
?
uConsumer
.
getNickName
():
""
);
vo
.
setPhone
(
StringUtils
.
isNotEmpty
(
uConsumer
.
getPhone
())
?
uConsumer
.
getPhone
():
""
);
}
voList
.
add
(
vo
);
});
return
voList
;
return
sharingActivitiesMapper
.
selectSharingActivitiesList
(
sharingActivities
);
}
}
/**
/**
...
@@ -164,5 +140,56 @@ public class SharingActivitiesServiceImpl extends ServiceImpl<SharingActivitiesM
...
@@ -164,5 +140,56 @@ public class SharingActivitiesServiceImpl extends ServiceImpl<SharingActivitiesM
.
eq
(
SharingActivities:
:
getIsDelete
,
YesNoEnum
.
no
.
getIndex
()));
.
eq
(
SharingActivities:
:
getIsDelete
,
YesNoEnum
.
no
.
getIndex
()));
}
}
@Override
public
TableDataInfo
pageList
(
TableDataInfo
info
,
SharingActivitiesVo
sharingActivities
)
{
List
<
SharingActivitiesVo
>
voList
=
new
ArrayList
<>();
List
<
SharingActivities
>
activities
=(
List
<
SharingActivities
>)
info
.
getRows
();
List
<
Long
>
collect
=
activities
.
stream
().
map
(
SharingActivities:
:
getNewUid
).
collect
(
Collectors
.
toList
());
List
<
Long
>
uids
=
activities
.
stream
().
map
(
SharingActivities:
:
getUid
).
collect
(
Collectors
.
toList
());
LambdaQueryWrapper
<
SConsumer
>
newSConsumer
=
new
LambdaQueryWrapper
<
SConsumer
>();
LambdaQueryWrapper
<
SConsumer
>
uSConsumer
=
new
LambdaQueryWrapper
<
SConsumer
>();
newSConsumer
.
in
(
SConsumer:
:
getId
,
collect
);
uSConsumer
.
in
(
SConsumer:
:
getId
,
uids
);
if
(
StringUtils
.
isNotEmpty
(
sharingActivities
.
getNewNickName
())){
newSConsumer
.
eq
(
SConsumer:
:
getNickName
,
sharingActivities
.
getNewNickName
());
}
if
(
StringUtils
.
isNotEmpty
(
sharingActivities
.
getNewPhone
())){
newSConsumer
.
eq
(
SConsumer:
:
getPhone
,
sharingActivities
.
getNewPhone
());
}
if
(
StringUtils
.
isNotEmpty
(
sharingActivities
.
getNickName
())){
uSConsumer
.
eq
(
SConsumer:
:
getNickName
,
sharingActivities
.
getNickName
());
}
if
(
StringUtils
.
isNotEmpty
(
sharingActivities
.
getPhone
())){
uSConsumer
.
eq
(
SConsumer:
:
getPhone
,
sharingActivities
.
getPhone
());
}
Map
<
Long
,
SConsumer
>
newUserMap
=
sConsumerService
.
list
(
newSConsumer
)
.
stream
().
collect
(
Collectors
.
toMap
(
SConsumer:
:
getId
,
Function
.
identity
()));
Map
<
Long
,
SConsumer
>
userMap
=
sConsumerService
.
list
(
uSConsumer
)
.
stream
().
collect
(
Collectors
.
toMap
(
SConsumer:
:
getId
,
Function
.
identity
()));
activities
.
stream
().
forEach
(
item
->{
SharingActivitiesVo
vo
=
new
SharingActivitiesVo
();
BeanUtils
.
copyProperties
(
item
,
vo
);
SConsumer
newConsumer
=
newUserMap
.
get
(
item
.
getNewUid
());
SConsumer
uConsumer
=
userMap
.
get
(
item
.
getUid
());
if
(
ObjectUtil
.
isNotEmpty
(
newConsumer
)){
vo
.
setNewAvatar
(
StringUtils
.
isNotEmpty
(
newConsumer
.
getAvatar
())
?
newConsumer
.
getAvatar
():
""
);
vo
.
setNewNickName
(
StringUtils
.
isNotEmpty
(
newConsumer
.
getNickName
())
?
newConsumer
.
getNickName
():
""
);
vo
.
setNewPhone
(
StringUtils
.
isNotEmpty
(
newConsumer
.
getPhone
())
?
newConsumer
.
getPhone
():
""
);
}
if
(
ObjectUtil
.
isNotEmpty
(
uConsumer
)){
vo
.
setAvatar
(
StringUtils
.
isNotEmpty
(
uConsumer
.
getAvatar
())
?
uConsumer
.
getAvatar
():
""
);
vo
.
setNickName
(
StringUtils
.
isNotEmpty
(
uConsumer
.
getNickName
())
?
uConsumer
.
getNickName
():
""
);
vo
.
setPhone
(
StringUtils
.
isNotEmpty
(
uConsumer
.
getPhone
())
?
uConsumer
.
getPhone
():
""
);
}
voList
.
add
(
vo
);
});
info
.
setRows
(
voList
);
return
info
;
}
}
}
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