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
16db6e97
Commit
16db6e97
authored
May 21, 2026
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
应付明细4
parent
8e353d19
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
203 additions
and
17 deletions
+203
-17
yd-csf-api/src/main/java/com/yd/csf/api/service/impl/ApiExpectedFortuneServiceImpl.java
+2
-4
yd-csf-service/src/main/java/com/yd/csf/service/dao/ExpectedFortuneMapper.java
+7
-0
yd-csf-service/src/main/java/com/yd/csf/service/service/IExpectedFortuneService.java
+8
-1
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/ExpectedFortuneServiceImpl.java
+33
-0
yd-csf-service/src/main/java/com/yd/csf/service/vo/ExpectedFortuneExportDTO.java
+32
-12
yd-csf-service/src/main/resources/mappers/ExpectedFortuneMapper.xml
+121
-0
No files found.
yd-csf-api/src/main/java/com/yd/csf/api/service/impl/ApiExpectedFortuneServiceImpl.java
View file @
16db6e97
...
@@ -1213,11 +1213,9 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
...
@@ -1213,11 +1213,9 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
exportExpectedFortune
(
ApiExpectedFortunePageRequest
request
,
HttpServletResponse
response
)
{
public
void
exportExpectedFortune
(
ApiExpectedFortunePageRequest
request
,
HttpServletResponse
response
)
{
// 查询数据
// 查询数据
(复用 /list 的查询逻辑,UNION ALL 双表 + processData 排序 + 枚举补充)
QueryWrapper
<
ExpectedFortune
>
queryWrapper
=
this
.
getQueryWrapper
(
request
);
QueryWrapper
<
ExpectedFortune
>
queryWrapper
=
this
.
getQueryWrapper
(
request
);
List
<
ExpectedFortune
>
fortuneList
=
iExpectedFortuneService
.
list
(
queryWrapper
);
List
<
ApiExpectedFortunePageResponse
>
expectedFortuneVOList
=
iExpectedFortuneService
.
queryListAll
(
queryWrapper
);
// 先转换为VO, VO 补充了关联信息(产品计划、产品险种、保险公司、用户)
List
<
ApiExpectedFortunePageResponse
>
expectedFortuneVOList
=
iExpectedFortuneService
.
toVOList
(
fortuneList
);
// 转换为导出DTO
// 转换为导出DTO
List
<
ExpectedFortuneExportDTO
>
exportDataList
=
expectedFortuneVOList
.
stream
()
List
<
ExpectedFortuneExportDTO
>
exportDataList
=
expectedFortuneVOList
.
stream
()
.
map
(
ExpectedFortuneExportDTO:
:
convertToExportDTO
)
.
map
(
ExpectedFortuneExportDTO:
:
convertToExportDTO
)
...
...
yd-csf-service/src/main/java/com/yd/csf/service/dao/ExpectedFortuneMapper.java
View file @
16db6e97
...
@@ -68,4 +68,11 @@ public interface ExpectedFortuneMapper extends BaseMapper<ExpectedFortune> {
...
@@ -68,4 +68,11 @@ public interface ExpectedFortuneMapper extends BaseMapper<ExpectedFortune> {
* @return 统计信息
* @return 统计信息
*/
*/
ExpectedFortuneStatisticsVO
queryListStatistics
(
@Param
(
"ew"
)
QueryWrapper
<
ExpectedFortune
>
queryWrapper
);
ExpectedFortuneStatisticsVO
queryListStatistics
(
@Param
(
"ew"
)
QueryWrapper
<
ExpectedFortune
>
queryWrapper
);
/**
* 查询预计发佣和实际发佣的全部列表(无分页,用于导出)
* @param queryWrapper 查询条件
* @return 全部列表数据
*/
List
<
ApiExpectedFortunePageResponse
>
queryListAll
(
@Param
(
"ew"
)
QueryWrapper
<
ExpectedFortune
>
queryWrapper
);
}
}
yd-csf-service/src/main/java/com/yd/csf/service/service/IExpectedFortuneService.java
View file @
16db6e97
...
@@ -10,7 +10,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
...
@@ -10,7 +10,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
import
com.yd.csf.service.vo.ExpectedFortuneStatisticsVO
;
import
com.yd.csf.service.vo.ExpectedFortuneStatisticsVO
;
import
com.yd.csf.service.vo.PayableReportVO
;
import
com.yd.csf.service.vo.PayableReportVO
;
import
java.time.LocalDate
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -80,4 +79,12 @@ public interface IExpectedFortuneService extends IService<ExpectedFortune> {
...
@@ -80,4 +79,12 @@ public interface IExpectedFortuneService extends IService<ExpectedFortune> {
* @return 统计信息
* @return 统计信息
*/
*/
ExpectedFortuneStatisticsVO
queryListStatistics
(
QueryWrapper
<
ExpectedFortune
>
queryWrapper
);
ExpectedFortuneStatisticsVO
queryListStatistics
(
QueryWrapper
<
ExpectedFortune
>
queryWrapper
);
/**
* 查询预计发佣和实际发佣的全部列表(无分页,用于导出)
*
* @param queryWrapper 查询条件
* @return 全部列表数据
*/
List
<
ApiExpectedFortunePageResponse
>
queryListAll
(
QueryWrapper
<
ExpectedFortune
>
queryWrapper
);
}
}
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/ExpectedFortuneServiceImpl.java
View file @
16db6e97
...
@@ -348,4 +348,37 @@ public class ExpectedFortuneServiceImpl extends ServiceImpl<ExpectedFortuneMappe
...
@@ -348,4 +348,37 @@ public class ExpectedFortuneServiceImpl extends ServiceImpl<ExpectedFortuneMappe
return
statistics
;
return
statistics
;
}
}
@Override
public
List
<
ApiExpectedFortunePageResponse
>
queryListAll
(
QueryWrapper
<
ExpectedFortune
>
queryWrapper
)
{
// 1. 查询全量数据
List
<
ApiExpectedFortunePageResponse
>
records
=
this
.
baseMapper
.
queryListAll
(
queryWrapper
);
if
(
CollUtil
.
isEmpty
(
records
))
{
return
Collections
.
emptyList
();
}
// 2. 调整数据顺序、格式(与 /list 一致)
processData
(
records
);
// 3. 补充转介人职级信息
List
<
String
>
brokerBizIds
=
records
.
stream
().
map
(
ApiExpectedFortunePageResponse:
:
getBrokerBizId
).
collect
(
Collectors
.
toList
());
Map
<
String
,
UserGradeDto
>
userGradeMap
=
iAgentAccumulatedFycService
.
queryUserGradeMap
(
brokerBizIds
);
// 4. 补充产品计划信息
Set
<
String
>
policyNoList
=
records
.
stream
().
map
(
ApiExpectedFortunePageResponse:
:
getPolicyNo
).
collect
(
Collectors
.
toSet
());
Map
<
String
,
PolicyFollow
>
policyFollowMap
=
policyFollowService
.
queryPolicyFollowMap
(
policyNoList
);
for
(
ApiExpectedFortunePageResponse
vo
:
records
)
{
UserGradeDto
userGradeDto
=
userGradeMap
.
get
(
vo
.
getBrokerBizId
());
if
(
userGradeDto
!=
null
)
{
vo
.
setBrokerGradeName
(
userGradeDto
.
getGradeName
());
}
PolicyFollow
policyFollow
=
policyFollowMap
.
get
(
vo
.
getPolicyNo
());
if
(
policyFollow
!=
null
)
{
vo
.
setProductName
(
policyFollow
.
getProductName
());
}
}
return
records
;
}
}
}
yd-csf-service/src/main/java/com/yd/csf/service/vo/ExpectedFortuneExportDTO.java
View file @
16db6e97
...
@@ -8,7 +8,6 @@ import com.alibaba.excel.annotation.write.style.ContentRowHeight;
...
@@ -8,7 +8,6 @@ import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import
com.alibaba.excel.annotation.write.style.HeadRowHeight
;
import
com.alibaba.excel.annotation.write.style.HeadRowHeight
;
import
com.yd.csf.feign.response.expectedfortune.ApiExpectedFortunePageResponse
;
import
com.yd.csf.feign.response.expectedfortune.ApiExpectedFortunePageResponse
;
import
com.yd.csf.service.enums.FortuneStatusEnum
;
import
com.yd.csf.service.enums.FortuneStatusEnum
;
import
com.yd.csf.service.model.ExpectedFortune
;
import
lombok.Data
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
...
@@ -33,6 +32,9 @@ public class ExpectedFortuneExportDTO {
...
@@ -33,6 +32,9 @@ public class ExpectedFortuneExportDTO {
@ExcelProperty
(
"保单号"
)
@ExcelProperty
(
"保单号"
)
private
String
policyNo
;
private
String
policyNo
;
@ExcelProperty
(
"类型"
)
private
String
type
;
@ExcelProperty
(
"出账状态"
)
@ExcelProperty
(
"出账状态"
)
private
String
status
;
private
String
status
;
...
@@ -79,25 +81,36 @@ public class ExpectedFortuneExportDTO {
...
@@ -79,25 +81,36 @@ public class ExpectedFortuneExportDTO {
@ExcelProperty
(
"待出账比例(%)"
)
@ExcelProperty
(
"待出账比例(%)"
)
private
BigDecimal
unpaidRatio
;
private
BigDecimal
unpaidRatio
;
@ExcelProperty
(
"待出账金额"
)
@ExcelProperty
(
"本次发放保单记账金额"
)
private
BigDecimal
unpaidAmount
;
private
BigDecimal
currentPaymentRuleAmount
;
@ExcelProperty
(
"本次发放金额"
)
private
BigDecimal
currentPayoutAmount
;
@ExcelProperty
(
"本次发放折合港币金额"
)
private
BigDecimal
currentPaymentHkdAmount
;
@ExcelProperty
(
"本次发放比例"
)
private
BigDecimal
currentPaymentRatio
;
@ExcelProperty
(
"累积已发放保单记账金额"
)
private
BigDecimal
paidRuleAmount
;
@ExcelProperty
(
"剩余保单记账金额"
)
private
BigDecimal
unpaidRuleAmount
;
@ExcelProperty
(
"剩余发放折合港币金额"
)
private
BigDecimal
unpaidRuleAmounthHkd
;
@ExcelProperty
(
"持有比例"
)
@ExcelProperty
(
"持有比例"
)
private
String
brokerRatio
;
private
String
brokerRatio
;
@ExcelProperty
(
"保险公司"
)
private
String
insuranceCompany
;
@ExcelProperty
(
"产品计划"
)
@ExcelProperty
(
"产品计划"
)
private
String
productName
;
private
String
productName
;
@ExcelProperty
(
"期交保费"
)
@ExcelProperty
(
"期交保费"
)
private
BigDecimal
premium
;
private
BigDecimal
premium
;
@ExcelProperty
(
"出账状态-修改理由"
)
@ColumnWidth
(
30
)
private
String
statusDesc
;
@ExcelProperty
(
"备注"
)
@ExcelProperty
(
"备注"
)
@ColumnWidth
(
30
)
@ColumnWidth
(
30
)
private
String
remark
;
private
String
remark
;
...
@@ -121,6 +134,7 @@ public class ExpectedFortuneExportDTO {
...
@@ -121,6 +134,7 @@ public class ExpectedFortuneExportDTO {
dto
.
setPayableNo
(
vo
.
getPayableNo
());
dto
.
setPayableNo
(
vo
.
getPayableNo
());
dto
.
setFortuneBizType
(
"R"
.
equals
(
vo
.
getFortuneBizType
())
?
"关联保单应付款"
:
"非关联保单应付款"
);
dto
.
setFortuneBizType
(
"R"
.
equals
(
vo
.
getFortuneBizType
())
?
"关联保单应付款"
:
"非关联保单应付款"
);
dto
.
setPolicyNo
(
vo
.
getPolicyNo
());
dto
.
setPolicyNo
(
vo
.
getPolicyNo
());
dto
.
setType
(
vo
.
getType
()
!=
null
?
(
vo
.
getType
()
==
1
?
"预计出账"
:
"实际出账"
)
:
null
);
dto
.
setPremium
(
vo
.
getPremium
());
dto
.
setPremium
(
vo
.
getPremium
());
dto
.
setFortunePeriod
(
vo
.
getFortunePeriod
());
dto
.
setFortunePeriod
(
vo
.
getFortunePeriod
());
dto
.
setFortuneTotalPeriod
(
vo
.
getFortuneTotalPeriod
());
dto
.
setFortuneTotalPeriod
(
vo
.
getFortuneTotalPeriod
());
...
@@ -137,6 +151,13 @@ public class ExpectedFortuneExportDTO {
...
@@ -137,6 +151,13 @@ public class ExpectedFortuneExportDTO {
dto
.
setPaidAmount
(
vo
.
getPaidAmount
());
dto
.
setPaidAmount
(
vo
.
getPaidAmount
());
dto
.
setPaidRatio
(
vo
.
getPaidRatio
());
dto
.
setPaidRatio
(
vo
.
getPaidRatio
());
dto
.
setUnpaidRatio
(
vo
.
getUnpaidRatio
());
dto
.
setUnpaidRatio
(
vo
.
getUnpaidRatio
());
dto
.
setCurrentPaymentRuleAmount
(
vo
.
getCurrentPaymentRuleAmount
());
dto
.
setCurrentPayoutAmount
(
vo
.
getCurrentPayoutAmount
());
dto
.
setCurrentPaymentHkdAmount
(
vo
.
getCurrentPaymentHkdAmount
());
dto
.
setCurrentPaymentRatio
(
vo
.
getCurrentPaymentRatio
());
dto
.
setPaidRuleAmount
(
vo
.
getPaidRuleAmount
());
dto
.
setUnpaidRuleAmount
(
vo
.
getUnpaidRuleAmount
());
dto
.
setUnpaidRuleAmounthHkd
(
vo
.
getUnpaidRuleAmounthHkd
());
dto
.
setRemark
(
vo
.
getRemark
());
dto
.
setRemark
(
vo
.
getRemark
());
dto
.
setBrokerGradeName
(
vo
.
getBrokerGradeName
());
dto
.
setBrokerGradeName
(
vo
.
getBrokerGradeName
());
return
dto
;
return
dto
;
...
@@ -154,4 +175,4 @@ public class ExpectedFortuneExportDTO {
...
@@ -154,4 +175,4 @@ public class ExpectedFortuneExportDTO {
}
}
return
"未知"
;
return
"未知"
;
}
}
}
}
\ No newline at end of file
yd-csf-service/src/main/resources/mappers/ExpectedFortuneMapper.xml
View file @
16db6e97
...
@@ -263,6 +263,127 @@
...
@@ -263,6 +263,127 @@
LIMIT #{pageSize} OFFSET #{offset}
LIMIT #{pageSize} OFFSET #{offset}
</select>
</select>
<select
id=
"queryListAll"
resultType=
"com.yd.csf.feign.response.expectedfortune.ApiExpectedFortunePageResponse"
>
SELECT
ef.id,
ef.expected_fortune_biz_id,
ef.fortune_biz_type,
NULL as currentPaymentRuleAmount,
NULL as currentPayoutAmount,
NULL as currentPaymentRatio,
ef.payable_no,
ef.policy_no,
ef.premium,
ef.product_launch_biz_id,
ef.fortune_period,
ef.fortune_total_period,
ef.broker,
ef.broker_biz_id,
ef.team,
ef.team_biz_id,
ef.fortune_name,
ef.fortune_type,
ef.broker_ratio,
ef.rule_amount,
ef.rule_currency,
ef.status,
ef.payout_date,
ef.actual_payout_date,
ef.default_exchange_rate as exchangeRate,
ef.original_currency,
ef.original_amount,
ef.original_to_hkd_rate,
ef.payout_currency,
ef.payout_amount,
ef.hkd_to_payout_rate,
ef.hkd_amount,
ef.hkd_amount as current_payment_hkd_amount,
ef.paid_amount,
ef.paid_ratio,
ef.unpaid_ratio,
ef.paid_rule_amount as paidRuleAmount,
ef.unpaid_rule_amount as unpaidRuleAmount,
ef.unpaid_rule_amount_hkd as unpaidRuleAmounthHkd,
ef.remark,
ef.create_time,
ef.creator_name,
ef.update_time,
1 as type
FROM expected_fortune ef
<where>
ef.is_deleted = 0
AND ef.is_part IN (0, 1)
<if
test=
"ew != null"
>
<if
test=
"ew.sqlSegment != null and ew.sqlSegment != ''"
>
AND ${ew.sqlSegment}
</if>
</if>
</where>
UNION ALL
SELECT
f.id,
f.expected_fortune_biz_id,
f.fortune_biz_type,
f.rule_amount as currentPaymentRuleAmount,
f.current_payment_amount as currentPayoutAmount,
f.current_payment_ratio as currentPaymentRatio,
f.payable_no,
f.policy_no,
NULL as premium,
NULL as product_launch_biz_id,
f.fortune_period,
f.fortune_total_period,
f.broker,
f.broker_biz_id,
f.team,
f.team_biz_id,
f.fortune_name,
f.fortune_type,
NULL as broker_ratio,
f.rule_amount,
f.rule_currency,
f.status,
f.payout_date,
f.actual_payout_date,
NUll as default_exchange_rate,
f.original_currency,
f.original_amount,
f.original_to_hkd_rate,
f.payout_currency,
f.payout_amount,
f.hkd_to_payout_rate,
f.hkd_amount,
NULL as current_payment_hkd_amount,
f.exchange_rate,
NULL as paid_amount,
NULL as paid_ratio,
NULL as unpaid_ratio,
NULL as paidRuleAmount,
NULL as unpaidRuleAmount,
NULL as unpaidRuleAmounthHkd,
f.remark,
f.create_time,
f.reconciliation_operator as creator_name,
f.update_time,
2 as type
FROM fortune f
<where>
f.is_deleted = 0
AND f.is_part IN (0, 1)
<if
test=
"ew != null"
>
<if
test=
"ew.sqlSegment != null and ew.sqlSegment != ''"
>
AND ${ew.sqlSegment}
</if>
</if>
</where>
ORDER BY payable_no ASC, type ASC
</select>
<select
id=
"queryListStatistics"
resultType=
"com.yd.csf.service.vo.ExpectedFortuneStatisticsVO"
>
<select
id=
"queryListStatistics"
resultType=
"com.yd.csf.service.vo.ExpectedFortuneStatisticsVO"
>
SELECT
SELECT
COALESCE(SUM(hkd_amount), 0) AS totalExpectedAmount,
COALESCE(SUM(hkd_amount), 0) AS totalExpectedAmount,
...
...
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