Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-csf
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xingmin
yd-csf
Commits
3877843b
Commit
3877843b
authored
Nov 24, 2025
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新单跟进82
parent
39b0a42d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
101 additions
and
9 deletions
+101
-9
yd-csf-api/src/main/java/com/yd/csf/api/controller/ApiFortuneController.java
+35
-9
yd-csf-service/src/main/java/com/yd/csf/service/dto/FortuneAccountStatisticsQueryRequest.java
+15
-0
yd-csf-service/src/main/java/com/yd/csf/service/dto/FortuneAccountStatisticsVO.java
+21
-0
yd-csf-service/src/main/java/com/yd/csf/service/service/FortuneAccountService.java
+8
-0
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneAccountServiceImpl.java
+22
-0
No files found.
yd-csf-api/src/main/java/com/yd/csf/api/controller/ApiFortuneController.java
View file @
3877843b
package
com
.
yd
.
csf
.
api
.
controller
;
import
com.alibaba.excel.EasyExcel
;
import
com.baomidou.mybatisplus.core.conditions.Wrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.yd.auth.core.dto.AuthUserDto
;
...
...
@@ -17,8 +19,6 @@ import com.yd.csf.service.model.Fortune;
import
com.yd.csf.service.model.FortuneAccount
;
import
com.yd.csf.service.service.FortuneAccountService
;
import
com.yd.csf.service.service.FortuneService
;
import
com.yd.csf.service.vo.FortuneAccountVO
;
import
com.yd.csf.service.vo.FortuneVO
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
org.apache.commons.collections4.CollectionUtils
;
...
...
@@ -34,7 +34,6 @@ import javax.annotation.Resource;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.io.UnsupportedEncodingException
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -204,18 +203,42 @@ public class ApiFortuneController {
*/
@PostMapping
(
"/list/page/fortuneAccount"
)
@Operation
(
summary
=
"分页获取出账列表"
)
public
Result
<
Page
<
FortuneAccountVO
>>
listAccountByPage
(
@RequestBody
FortuneAccountQueryRequest
fortuneAccountQueryRequest
,
public
Result
<
Map
<
String
,
Object
>>
listAccountByPage
(
@RequestBody
FortuneAccountQueryRequest
fortuneAccountQueryRequest
,
HttpServletRequest
request
)
{
long
current
=
fortuneAccountQueryRequest
.
getPageNo
();
long
size
=
fortuneAccountQueryRequest
.
getPageSize
();
// 查询数据库
QueryWrapper
<
FortuneAccount
>
queryWrapper
=
fortuneAccountService
.
getQueryWrapper
(
fortuneAccountQueryRequest
);
Page
<
FortuneAccount
>
fortunePage
=
fortuneAccountService
.
page
(
new
Page
<>(
current
,
size
),
fortuneAccountService
.
getQueryWrapper
(
fortuneAccountQueryRequest
));
queryWrapper
);
// 统计数据 总金额、总人数
List
<
FortuneAccount
>
fortuneAccountList
=
fortuneAccountService
.
list
(
queryWrapper
);
FortuneAccountStatisticsVO
statisticsVO
=
fortuneAccountService
.
getFortuneAccountStatistics
(
fortuneAccountList
.
stream
()
.
map
(
FortuneAccount:
:
getId
)
.
collect
(
Collectors
.
toList
()));
// 获取封装类
return
Result
.
success
(
fortuneAccountService
.
getFortuneAccountVOPage
(
fortunePage
));
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
result
.
put
(
"page"
,
fortuneAccountService
.
getFortuneAccountVOPage
(
fortunePage
));
result
.
put
(
"statisticsVO"
,
statisticsVO
);
return
Result
.
success
(
result
);
}
/**
* 统计数据 总金额、总人数
*
* @param fortuneAccountQueryRequest
* @param request
* @return
*/
@PostMapping
(
"/fortuneAccount/statistics"
)
@Operation
(
summary
=
"统计数据 总金额、总人数"
)
public
Result
<
FortuneAccountStatisticsVO
>
getFortuneAccountStatistics
(
@RequestBody
FortuneAccountStatisticsQueryRequest
fortuneAccountQueryRequest
,
HttpServletRequest
request
)
{
return
Result
.
success
(
fortuneAccountService
.
getFortuneAccountStatistics
(
fortuneAccountQueryRequest
.
getFortuneAccountIdList
()));
}
/**
* 创建出账
*
...
...
@@ -417,12 +440,15 @@ public class ApiFortuneController {
long
current
=
fortuneQueryRequest
.
getPageNo
();
long
size
=
fortuneQueryRequest
.
getPageSize
();
// 查询数据库
// 查询条件
Wrapper
<
Fortune
>
queryWrapper
=
fortuneService
.
getQueryWrapper
(
fortuneQueryRequest
);
// 分页查询
Page
<
Fortune
>
fortunePage
=
fortuneService
.
page
(
new
Page
<>(
current
,
size
),
fortuneService
.
getQueryWrapper
(
fortuneQueryRequest
)
);
queryWrapper
);
// 查询统计数据
FortuneStatisticsVO
statisticsVO
=
fortuneService
.
getFortuneStatistics
(
fortunePage
.
getRecords
().
stream
().
map
(
Fortune:
:
getId
).
collect
(
Collectors
.
toList
()));
List
<
Fortune
>
fortuneList
=
fortuneService
.
list
(
queryWrapper
);
FortuneStatisticsVO
statisticsVO
=
fortuneService
.
getFortuneStatistics
(
fortuneList
.
stream
().
map
(
Fortune:
:
getId
).
collect
(
Collectors
.
toList
()));
// 组装返回结果
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
...
...
yd-csf-service/src/main/java/com/yd/csf/service/dto/FortuneAccountStatisticsQueryRequest.java
0 → 100644
View file @
3877843b
package
com
.
yd
.
csf
.
service
.
dto
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
FortuneAccountStatisticsQueryRequest
{
/**
* 薪资记录id列表
*/
@Schema
(
description
=
"薪资记录id列表"
)
private
List
<
Long
>
fortuneAccountIdList
;
}
yd-csf-service/src/main/java/com/yd/csf/service/dto/FortuneAccountStatisticsVO.java
0 → 100644
View file @
3877843b
package
com
.
yd
.
csf
.
service
.
dto
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.math.BigDecimal
;
@Data
public
class
FortuneAccountStatisticsVO
{
/**
* 总金额
*/
@Schema
(
description
=
"总金额"
)
private
BigDecimal
totalAmount
;
/**
* 总人数
*/
@Schema
(
description
=
"总人数"
)
private
Object
brokerCount
;
}
yd-csf-service/src/main/java/com/yd/csf/service/service/FortuneAccountService.java
View file @
3877843b
...
...
@@ -30,4 +30,12 @@ public interface FortuneAccountService extends IService<FortuneAccount> {
Boolean
updateFortuneAccount
(
FortuneAccountUpdateRequest
fortuneAccountUpdateRequest
);
Boolean
completeFortuneAccount
(
CompleteFortuneAccountRequest
completeFortuneAccountRequest
);
/**
* 统计数据 总金额、总人数
*
* @param fortuneAccountIdList
* @return
*/
FortuneAccountStatisticsVO
getFortuneAccountStatistics
(
List
<
Long
>
fortuneAccountIdList
);
}
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneAccountServiceImpl.java
View file @
3877843b
...
...
@@ -235,6 +235,28 @@ public class FortuneAccountServiceImpl extends ServiceImpl<FortuneAccountMapper,
return
true
;
}
@Override
public
FortuneAccountStatisticsVO
getFortuneAccountStatistics
(
List
<
Long
>
fortuneAccountIdList
)
{
if
(
CollectionUtils
.
isEmpty
(
fortuneAccountIdList
))
{
throw
new
BusinessException
(
ResultCode
.
NULL_ERROR
.
getCode
(),
"fortuneAccountIdList不能为空"
);
}
// 统计总金额和总人数
List
<
FortuneAccount
>
fortuneAccountList
=
this
.
baseMapper
.
selectBatchIds
(
fortuneAccountIdList
);
BigDecimal
totalAmount
=
fortuneAccountList
.
stream
()
.
map
(
FortuneAccount:
:
getAmount
)
.
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
int
brokerCount
=
fortuneAccountList
.
stream
()
.
map
(
FortuneAccount:
:
getBroker
)
.
collect
(
Collectors
.
toSet
()).
size
();
FortuneAccountStatisticsVO
vo
=
new
FortuneAccountStatisticsVO
();
vo
.
setTotalAmount
(
totalAmount
);
vo
.
setBrokerCount
(
brokerCount
);
return
vo
;
}
}
...
...
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