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
4c299850
Commit
4c299850
authored
Nov 29, 2023
by
YG8999
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/main'
parents
9520f7e5
fd872aff
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
1 deletions
+50
-1
SConsumptionRecordsVo.java
...in/java/share/system/domain/vo/SConsumptionRecordsVo.java
+11
-0
SConsumptionRecordsServiceImpl.java
...e/system/service/impl/SConsumptionRecordsServiceImpl.java
+39
-1
No files found.
share-system/src/main/java/share/system/domain/vo/SConsumptionRecordsVo.java
0 → 100644
View file @
4c299850
package
share
.
system
.
domain
.
vo
;
import
lombok.Data
;
import
share.system.domain.SConsumptionRecords
;
@Data
public
class
SConsumptionRecordsVo
extends
SConsumptionRecords
{
private
String
orderNo
;
private
String
nickName
;
private
String
phone
;
}
share-system/src/main/java/share/system/service/impl/SConsumptionRecordsServiceImpl.java
View file @
4c299850
package
share
.
system
.
service
.
impl
;
package
share
.
system
.
service
.
impl
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
org.springframework.beans.BeanUtils
;
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.system.domain.SConsumer
;
import
share.system.domain.SOrder
;
import
share.system.domain.vo.SConsumptionRecordsVo
;
import
share.system.mapper.SConsumerMapper
;
import
share.system.mapper.SConsumptionRecordsMapper
;
import
share.system.mapper.SConsumptionRecordsMapper
;
import
share.system.domain.SConsumptionRecords
;
import
share.system.domain.SConsumptionRecords
;
import
share.system.mapper.SOrderMapper
;
import
share.system.service.ISConsumptionRecordsService
;
import
share.system.service.ISConsumptionRecordsService
;
import
share.system.service.SConsumerService
;
/**
/**
* 消费记录Service业务层处理
* 消费记录Service业务层处理
...
@@ -20,6 +30,12 @@ public class SConsumptionRecordsServiceImpl implements ISConsumptionRecordsServi
...
@@ -20,6 +30,12 @@ public class SConsumptionRecordsServiceImpl implements ISConsumptionRecordsServi
@Autowired
@Autowired
private
SConsumptionRecordsMapper
sConsumptionRecordsMapper
;
private
SConsumptionRecordsMapper
sConsumptionRecordsMapper
;
@Autowired
private
SConsumerMapper
sConsumerMapper
;
@Autowired
private
SOrderMapper
sOrderMapper
;
/**
/**
* 查询消费记录
* 查询消费记录
*
*
...
@@ -41,7 +57,29 @@ public class SConsumptionRecordsServiceImpl implements ISConsumptionRecordsServi
...
@@ -41,7 +57,29 @@ public class SConsumptionRecordsServiceImpl implements ISConsumptionRecordsServi
@Override
@Override
public
List
<
SConsumptionRecords
>
selectSConsumptionRecordsList
(
SConsumptionRecords
sConsumptionRecords
)
public
List
<
SConsumptionRecords
>
selectSConsumptionRecordsList
(
SConsumptionRecords
sConsumptionRecords
)
{
{
return
sConsumptionRecordsMapper
.
selectSConsumptionRecordsList
(
sConsumptionRecords
);
List
<
SConsumptionRecords
>
sConsumptionRecordsList
=
sConsumptionRecordsMapper
.
selectSConsumptionRecordsList
(
sConsumptionRecords
);
//获取消费记录的用户id集合
List
<
Long
>
collect
=
sConsumptionRecordsList
.
stream
().
map
(
SConsumptionRecords:
:
getConsumerId
).
collect
(
Collectors
.
toList
());
//获取用户id集合的用户信息
List
<
SConsumer
>
sConsumers
=
sConsumerMapper
.
selectBatchIds
(
collect
);
List
<
Long
>
oredrIds
=
sConsumptionRecordsList
.
stream
().
map
(
SConsumptionRecords:
:
getOrderId
).
collect
(
Collectors
.
toList
());
List
<
SOrder
>
sOrders
=
sOrderMapper
.
selectBatchIds
(
oredrIds
);
List
<
SConsumptionRecordsVo
>
sConsumptionRecordsVoList
=
new
ArrayList
<>();
BeanUtils
.
copyProperties
(
sConsumptionRecordsList
,
sConsumptionRecordsVoList
);
sConsumptionRecordsVoList
.
stream
().
forEach
(
item
->
{
sConsumers
.
stream
().
forEach
(
vo
->
{
if
(
item
.
getConsumerId
().
equals
(
vo
.
getId
()))
{
item
.
setNickName
(
vo
.
getNickName
());
item
.
setPhone
(
vo
.
getPhone
());
}
});
sOrders
.
stream
().
forEach
(
vo
->
{
if
(
item
.
getOrderId
().
equals
(
vo
.
getId
()))
{
item
.
setOrderNo
(
vo
.
getOrderNo
());
}
});
});
return
sConsumptionRecordsList
;
}
}
/**
/**
...
...
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