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
71f6df76
Commit
71f6df76
authored
Apr 27, 2026
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
出账检核-1/2/4
parent
f77007ba
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
43 additions
and
14 deletions
+43
-14
yd-csf-api/src/main/java/com/yd/csf/api/controller/ApiFortuneController.java
+4
-1
yd-csf-service/src/main/java/com/yd/csf/service/dto/FortuneDownloadRequest.java
+3
-0
yd-csf-service/src/main/java/com/yd/csf/service/model/Fortune.java
+5
-0
yd-csf-service/src/main/java/com/yd/csf/service/service/FortuneAccountService.java
+2
-1
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneAccountServiceImpl.java
+17
-5
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneServiceImpl.java
+4
-6
yd-csf-service/src/main/java/com/yd/csf/service/vo/FortuneVO.java
+6
-0
yd-csf-service/src/main/resources/mappers/FortuneMapper.xml
+2
-1
No files found.
yd-csf-api/src/main/java/com/yd/csf/api/controller/ApiFortuneController.java
View file @
71f6df76
...
...
@@ -194,7 +194,10 @@ public class ApiFortuneController {
@PostMapping
(
"/download/account"
)
public
Result
<
Boolean
>
downloadAccount
(
@RequestBody
FortuneDownloadRequest
fortuneDownloadRequest
,
HttpServletResponse
response
)
throws
IOException
{
if
(
CollectionUtils
.
isEmpty
(
fortuneDownloadRequest
.
getFortuneBizIdList
()))
{
throw
new
BusinessException
(
ResultCode
.
PARAMS_ERROR
.
getCode
(),
"请选择要出账的发佣数据"
);
return
Result
.
fail
(
ErrorCode
.
PARAMS_ERROR
.
getCode
(),
"请选择要出账的发佣数据"
);
}
if
(
StringUtils
.
isBlank
(
fortuneDownloadRequest
.
getActualPayoutDate
()))
{
return
Result
.
fail
(
ErrorCode
.
PARAMS_ERROR
.
getCode
(),
"请输入出账年月(实)"
);
}
fortuneService
.
downloadAccount
(
fortuneDownloadRequest
,
response
);
...
...
yd-csf-service/src/main/java/com/yd/csf/service/dto/FortuneDownloadRequest.java
View file @
71f6df76
...
...
@@ -10,4 +10,7 @@ public class FortuneDownloadRequest {
@Schema
(
description
=
"发佣数据业务Id列表"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
private
List
<
String
>
fortuneBizIdList
;
@Schema
(
description
=
"出账年月(实),格式:yyyy-MM,例如:2026-04"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
private
String
actualPayoutDate
;
}
yd-csf-service/src/main/java/com/yd/csf/service/model/Fortune.java
View file @
71f6df76
...
...
@@ -28,6 +28,11 @@ public class Fortune implements Serializable {
private
String
expectedFortuneBizId
;
/**
* 应付账款编号
*/
private
String
payableNo
;
/**
* 检核年月
*/
private
String
reconciliationYearMonth
;
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/FortuneAccountService.java
View file @
71f6df76
...
...
@@ -7,6 +7,7 @@ import com.yd.csf.service.model.FortuneAccount;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yd.csf.service.vo.FortuneAccountVO
;
import
java.time.LocalDate
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -21,7 +22,7 @@ public interface FortuneAccountService extends IService<FortuneAccount> {
Page
<
FortuneAccountVO
>
getFortuneAccountVOPage
(
Page
<
FortuneAccount
>
fortunePage
);
void
saveFortuneAccount
(
List
<
FortuneAccountExportDTO
>
accountExportDTOList
);
void
saveFortuneAccount
(
List
<
FortuneAccountExportDTO
>
accountExportDTOList
,
LocalDate
actualPayoutDate
);
FortuneAccount
getByFortuneAccountBizId
(
String
fortuneAccountBizId
);
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneAccountServiceImpl.java
View file @
71f6df76
...
...
@@ -107,7 +107,7 @@ public class FortuneAccountServiceImpl extends ServiceImpl<FortuneAccountMapper,
@Override
@Transactional
(
rollbackFor
=
BusinessException
.
class
)
public
void
saveFortuneAccount
(
List
<
FortuneAccountExportDTO
>
accountExportDTOList
)
{
public
void
saveFortuneAccount
(
List
<
FortuneAccountExportDTO
>
accountExportDTOList
,
LocalDate
actualPayoutDate
)
{
if
(
CollectionUtils
.
isEmpty
(
accountExportDTOList
))
{
return
;
}
...
...
@@ -126,7 +126,7 @@ public class FortuneAccountServiceImpl extends ServiceImpl<FortuneAccountMapper,
fortuneAccount
.
setTeamBizId
(
accountExportDTO
.
getTeamBizId
());
fortuneAccount
.
setCurrency
(
accountExportDTO
.
getCurrency
());
fortuneAccount
.
setHkdAmount
(
accountExportDTO
.
getAmount
());
fortuneAccount
.
setFortuneAccountDate
(
this
.
getActualPayoutDate
(
ac
countExportDTO
));
fortuneAccount
.
setFortuneAccountDate
(
this
.
getActualPayoutDate
(
ac
tualPayoutDate
));
// 出账状态默认待出账
fortuneAccount
.
setStatus
(
FortuneStatusEnum
.
CHECKED
.
getItemValue
());
...
...
@@ -184,13 +184,25 @@ public class FortuneAccountServiceImpl extends ServiceImpl<FortuneAccountMapper,
}
// 更新预计发佣记录的出账状态
if
(
CollectionUtils
.
isNotEmpty
(
expectedFortuneBizIdList
))
{
expectedFortuneService
.
updateBatchByBizId
(
expectedFortuneBizIdList
,
FortuneStatusEnum
.
CHECKED
.
getItemValue
());
// 查询预计发佣记录
List
<
ExpectedFortune
>
expectedFortuneList
=
expectedFortuneService
.
list
(
new
QueryWrapper
<
ExpectedFortune
>()
.
in
(
"expected_fortune_biz_id"
,
expectedFortuneBizIdList
));
List
<
ExpectedFortune
>
updateExpectedFortuneList
=
new
ArrayList
<>();
for
(
ExpectedFortune
expectedFortune
:
expectedFortuneList
)
{
ExpectedFortune
updateExpectedFortune
=
new
ExpectedFortune
();
updateExpectedFortune
.
setId
(
expectedFortune
.
getId
());
updateExpectedFortune
.
setStatus
(
FortuneStatusEnum
.
CHECKED
.
getItemValue
());
updateExpectedFortune
.
setActualPayoutDate
(
actualPayoutDate
);
updateExpectedFortuneList
.
add
(
updateExpectedFortune
);
}
expectedFortuneService
.
updateBatchById
(
updateExpectedFortuneList
);
}
}
private
Date
getActualPayoutDate
(
FortuneAccountExportDTO
accountExportDTO
)
{
LocalDate
actualPayoutDate
=
accountExportDTO
.
getActualPayoutDate
();
private
Date
getActualPayoutDate
(
LocalDate
actualPayoutDate
)
{
if
(
actualPayoutDate
==
null
)
{
return
null
;
}
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneServiceImpl.java
View file @
71f6df76
...
...
@@ -367,11 +367,9 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
// 创建按人分组的导出DTO列表
List
<
FortuneAccountExportDTO
>
accountExportDTOList
=
new
ArrayList
<>();
// 收集所有不同的fortune项目名称
Set
<
String
>
allFortuneNames
=
fortuneList
.
stream
()
.
map
(
Fortune:
:
getFortuneName
)
.
filter
(
StringUtils:
:
isNotBlank
)
.
collect
(
Collectors
.
toSet
());
// 设置出账年月(实)
LocalDate
actualPayoutDate
=
LocalDate
.
parse
(
fortuneDownloadRequest
.
getActualPayoutDate
());
fortuneList
.
forEach
(
fortune
->
fortune
.
setActualPayoutDate
(
actualPayoutDate
));
// 处理每个分组的数据
for
(
Map
.
Entry
<
String
,
List
<
Fortune
>>
entry
:
fortuneMap
.
entrySet
())
{
...
...
@@ -444,7 +442,7 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
// }
// 写入数据库
fortuneAccountService
.
saveFortuneAccount
(
accountExportDTOList
);
fortuneAccountService
.
saveFortuneAccount
(
accountExportDTOList
,
actualPayoutDate
);
// // 使用try-with-resources确保流正确关闭
// try (ServletOutputStream outputStream = response.getOutputStream()) {
...
...
yd-csf-service/src/main/java/com/yd/csf/service/vo/FortuneVO.java
View file @
71f6df76
...
...
@@ -48,6 +48,12 @@ public class FortuneVO implements Serializable {
private
String
expectedFortuneBizId
;
/**
* 应付账款编号
*/
@Schema
(
description
=
"应付账款编号"
)
private
String
payableNo
;
/**
* 保单号
*/
@Schema
(
description
=
"保单号"
)
...
...
yd-csf-service/src/main/resources/mappers/FortuneMapper.xml
View file @
71f6df76
...
...
@@ -8,6 +8,7 @@
<id
property=
"id"
column=
"id"
/>
<result
property=
"fortuneBizId"
column=
"fortune_biz_id"
/>
<result
property=
"expectedFortuneBizId"
column=
"expected_fortune_biz_id"
/>
<result
property=
"payableNo"
column=
"payable_no"
/>
<result
property=
"reconciliationYearMonth"
column=
"reconciliation_year_month"
/>
<result
property=
"fortuneBizType"
column=
"fortune_biz_type"
/>
<result
property=
"isPart"
column=
"is_part"
/>
...
...
@@ -51,7 +52,7 @@
</resultMap>
<sql
id=
"Base_Column_List"
>
id,fortune_biz_id,expected_fortune_biz_id,reconciliation_year_month,fortune_biz_type,batch_biz_id,
id,fortune_biz_id,expected_fortune_biz_id,
payable_no,
reconciliation_year_month,fortune_biz_type,batch_biz_id,
commission_biz_id,commission_expected_biz_id,policy_no,policy_currency,fortune_period,fortune_total_period,broker_biz_id,
team_biz_id,grade_commission_rate,share_rate,fortune_name,fortune_type,is_part,
amount,currency,exchange_rate,hkd_amount,current_payment_amount,current_payment_hkd_amount,current_payment_ratio,status,payout_date,actual_payout_date,is_tax,
...
...
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