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
60d950e8
Commit
60d950e8
authored
Jan 23, 2026
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新单跟进v2
parent
c5a47f61
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
13 deletions
+20
-13
yd-csf-api/src/main/java/com/yd/csf/api/service/impl/ApiExpectedFortuneServiceImpl.java
+20
-13
No files found.
yd-csf-api/src/main/java/com/yd/csf/api/service/impl/ApiExpectedFortuneServiceImpl.java
View file @
60d950e8
...
...
@@ -250,9 +250,15 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
//查询当前保单号的所有预计发佣记录
List
<
ExpectedFortune
>
expectedFortuneList
=
iExpectedFortuneService
.
queryList
(
policyNo
);
//批量更新应付款编号
for
(
ExpectedFortune
expectedFortune
:
expectedFortuneList
)
{
expectedFortune
.
setPayableNo
(
this
.
createPayableNo
(
"R"
,
latest
));
//获取当前序号作为起点
int
currentSeq
=
0
;
if
(!
Objects
.
isNull
(
latest
))
{
currentSeq
=
Integer
.
parseInt
(
latest
.
getPayableNo
().
substring
(
12
));
}
//批量更新应付款编号,每个item递增
for
(
int
i
=
0
;
i
<
expectedFortuneList
.
size
();
i
++)
{
expectedFortuneList
.
get
(
i
).
setPayableNo
(
this
.
createPayableNo
(
"R"
,
currentSeq
+
i
+
1
));
}
iExpectedFortuneService
.
updateBatchById
(
expectedFortuneList
);
}
...
...
@@ -411,6 +417,7 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
// fortune.setAmount(algorithmResDto.getCalculatedValue());
//保单发佣批次ID
// fortune.setBatchBizId(fortuneDto.getBatchBizId());
fortune
.
setFortuneBizType
(
"R"
);
//转介人姓名 (获得积分的业务员)
fortune
.
setBroker
(
fortuneDto
.
getBroker
());
//转介人业务ID (获得积分的业务员)
...
...
@@ -499,6 +506,11 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
new
QueryWrapper
<
ExpectedFortune
>().
isNotNull
(
"payable_no"
).
orderByDesc
(
"id"
).
last
(
"LIMIT 1"
),
true
);
//获取当前序号作为起点
int
currentSeq
=
0
;
if
(!
Objects
.
isNull
(
latest
))
{
currentSeq
=
Integer
.
parseInt
(
latest
.
getPayableNo
().
substring
(
12
));
}
List
<
ExpectedFortune
>
fortuneList
=
new
ArrayList
<>();
for
(
ExpectedFortuneAddRequest
expectedFortuneDto
:
fortuneAddRequestList
)
{
...
...
@@ -507,8 +519,8 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
// 预计发佣业务id
expectedFortune
.
setExpectedFortuneBizId
(
RandomStringGenerator
.
generateBizId16
(
CommonEnum
.
UID_TYPE_EXPECTED_FORTUNE
.
getCode
()));
// 应付款编号
expectedFortune
.
setPayableNo
(
this
.
createPayableNo
(
expectedFortune
.
getFortuneBizType
(),
latest
));
// 应付款编号
(序号递增)
expectedFortune
.
setPayableNo
(
this
.
createPayableNo
(
expectedFortune
.
getFortuneBizType
(),
++
currentSeq
));
// 默认结算汇率
expectedFortune
.
setDefaultExchangeRate
(
queryDefaultExchangeRate
(
expectedFortune
.
getCurrency
()));
// 计算港币金额
...
...
@@ -601,19 +613,14 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
* 创建应付款编号 应付款类型-CSF-年份后两位-6位数字(不重复)
*
* @param fortuneBizType 预计发佣业务类型
* @param
latest 最新一条有 payableNo 记录
* @param
seq 序号
* @return
*/
private
String
createPayableNo
(
String
fortuneBizType
,
ExpectedFortune
latest
)
{
String
seq
=
"000001"
;
// 有最新记录,根据最新记录的序号生成下一个序号
if
(!
Objects
.
isNull
(
latest
))
{
seq
=
String
.
format
(
"%06d"
,
Integer
.
parseInt
(
latest
.
getPayableNo
().
substring
(
12
))
+
1
);
}
private
String
createPayableNo
(
String
fortuneBizType
,
int
seq
)
{
return
String
.
format
(
"%s%s%s"
,
fortuneBizType
+
"-CSF"
,
LocalDate
.
now
().
getYear
()
%
100
,
seq
);
String
.
format
(
"%06d"
,
seq
)
);
}
/**
...
...
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