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
b3ea220d
Commit
b3ea220d
authored
May 18, 2026
by
zhangxingmin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/test' into test_zxm_salary
parents
a91242bf
89e949c7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
11 deletions
+48
-11
yd-csf-service/src/main/java/com/yd/csf/service/dao/FortuneMapper.java
+2
-0
yd-csf-service/src/main/java/com/yd/csf/service/service/FortuneService.java
+2
-0
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/CommissionServiceImpl.java
+29
-11
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneServiceImpl.java
+8
-0
yd-csf-service/src/main/resources/mappers/FortuneMapper.xml
+7
-0
No files found.
yd-csf-service/src/main/java/com/yd/csf/service/dao/FortuneMapper.java
View file @
b3ea220d
...
...
@@ -16,6 +16,8 @@ import java.util.List;
public
interface
FortuneMapper
extends
BaseMapper
<
Fortune
>
{
List
<
FortuneStatisticsVO
>
getFortuneStatistics
(
@Param
(
"fortuneIdList"
)
List
<
Long
>
fortuneIdList
);
void
removeByIdsPhysical
(
@Param
(
"fortuneIdList"
)
List
<
Long
>
fortuneIdList
);
}
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/FortuneService.java
View file @
b3ea220d
...
...
@@ -48,4 +48,6 @@ public interface FortuneService extends IService<Fortune> {
Boolean
editExchangeRate
(
EditExchangeRateRequest
editExchangeRateRequest
);
String
batchEditActualPayoutDate
(
BatchEditActualPayoutDateRequest
editBatchActualPayoutDateRequest
);
void
removeByIdsPhysical
(
List
<
Long
>
collect
);
}
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/CommissionServiceImpl.java
View file @
b3ea220d
...
...
@@ -646,21 +646,22 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
throw
new
BusinessException
(
ResultCode
.
NULL_ERROR
.
getCode
(),
"未找到保单对应的预计发佣记录,请先创建预计发佣记录"
);
}
// 2. 根据本次发佣期数,
查询是否有已
出账的记录
// 2. 根据本次发佣期数,
删除未
出账的记录
List
<
Fortune
>
fortuneList
=
fortuneService
.
lambdaQuery
()
.
eq
(
Fortune:
:
getStatus
,
FortuneStatusEnum
.
CAN_SEND
.
getItemValue
())
.
in
(
Fortune:
:
getExpectedFortuneBizId
,
filteredExpectedFortuneList1
.
stream
().
map
(
ExpectedFortune:
:
getExpectedFortuneBizId
).
collect
(
Collectors
.
toList
()))
.
list
();
// 2.1 已出帐的保单号和期数
Set
<
String
>
fortuneSet
=
fortuneList
.
stream
()
.
map
(
i
->
i
.
getPolicyNo
()
+
"_"
+
i
.
getFortunePeriod
())
.
collect
(
Collectors
.
toSet
());
// 2.2 校验是否有已出账的记录
// 2.1 物理删除
if
(
CollectionUtils
.
isNotEmpty
(
fortuneList
))
{
fortuneService
.
removeByIdsPhysical
(
fortuneList
.
stream
().
map
(
Fortune:
:
getId
).
collect
(
Collectors
.
toList
()));
}
// 2.2 筛选出未出账的记录
List
<
ExpectedFortune
>
filteredExpectedFortuneList2
=
new
ArrayList
<>();
for
(
ExpectedFortune
expectedFortune
:
filteredExpectedFortuneList1
)
{
String
policyNo
=
expectedFortune
.
getPolicyNo
();
Integer
fortunePeriod
=
expectedFortune
.
getFortunePeriod
();
// 如果有已出账记录,跳过,表示此次该预计出账已出账
if
(
fortuneSet
.
contains
(
policyNo
+
"_"
+
fortunePeriod
))
{
// 如果有已出账记录,跳过
if
(
FortuneStatusEnum
.
SENT
.
getItemValue
().
equals
(
expectedFortune
.
getStatus
()))
{
continue
;
}
filteredExpectedFortuneList2
.
add
(
expectedFortune
);
...
...
@@ -694,7 +695,7 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
.
in
(
Commission:
:
getPolicyNo
,
policyNoSet
)
.
in
(
Commission:
:
getCommissionPeriod
,
commissionPeriodSet
)
.
select
(
Commission:
:
getPolicyNo
,
Commission:
:
getCommissionPeriod
,
Commission:
:
getExchangeRate
,
Commission:
:
getCommissionDate
)
.
orderByDesc
(
Commission:
:
get
CommissionDate
)
.
orderByDesc
(
Commission:
:
get
Id
)
.
list
();
// 2. 按 policyNo + commissionPeriod 分组,取每组的第一条(最新的)
...
...
@@ -761,7 +762,12 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
List
<
Fortune
>
newFortuneList
=
new
ArrayList
<>();
// 更新预计发佣记录的港币金额
List
<
ExpectedFortune
>
updatedExpectedFortuneList
=
new
ArrayList
<>();
// 更新预计发佣记录的状态
List
<
Long
>
updatedExpectedFortuneIdList
=
new
ArrayList
<>();
for
(
ExpectedFortune
expectedFortune
:
expectedFortuneList
)
{
updatedExpectedFortuneIdList
.
add
(
expectedFortune
.
getId
());
Fortune
fortune
=
new
Fortune
();
BeanUtils
.
copyProperties
(
expectedFortune
,
fortune
);
...
...
@@ -834,6 +840,18 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
}
}
// 更新预计发佣记录的状态
if
(
CollectionUtils
.
isNotEmpty
(
updatedExpectedFortuneIdList
))
{
boolean
updateSuccess
=
iExpectedFortuneService
.
lambdaUpdate
()
.
set
(
ExpectedFortune:
:
getStatus
,
FortuneStatusEnum
.
CAN_SEND
.
getItemValue
())
.
in
(
ExpectedFortune:
:
getId
,
updatedExpectedFortuneIdList
)
.
update
();
if
(!
updateSuccess
)
{
throw
new
BusinessException
(
ResultCode
.
FAIL
.
getCode
(),
"更新预计发佣记录状态失败"
);
}
}
return
newFortuneList
;
}
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneServiceImpl.java
View file @
b3ea220d
...
...
@@ -1253,6 +1253,14 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
return
String
.
format
(
"设置成功。已更新 %d 条数据,跳过 %d 条(已有实际出账年月)"
,
updateCount
,
skipCount
);
}
@Override
public
void
removeByIdsPhysical
(
List
<
Long
>
collect
)
{
if
(
CollectionUtils
.
isEmpty
(
collect
))
{
return
;
}
this
.
baseMapper
.
removeByIdsPhysical
(
collect
);
}
private
void
validEditExchangeRate
(
EditExchangeRateRequest
editExchangeRateRequest
)
{
if
(
ObjectUtils
.
isEmpty
(
editExchangeRateRequest
.
getOriginalCurrency
()))
{
throw
new
BusinessException
(
ResultCode
.
PARAM_CHECK_ERROR
.
getCode
(),
"原币种不能为空"
);
...
...
yd-csf-service/src/main/resources/mappers/FortuneMapper.xml
View file @
b3ea220d
...
...
@@ -61,6 +61,13 @@
create_time,update_time
</sql>
<delete
id=
"removeByIdsPhysical"
>
DELETE FROM fortune WHERE id IN
<foreach
collection=
"fortuneIdList"
item=
"id"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
</delete>
<select
id=
"getFortuneStatistics"
resultType=
"com.yd.csf.service.dto.FortuneStatisticsVO"
>
SELECT
f.policy_no,
...
...
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