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
17350865
Commit
17350865
authored
May 08, 2026
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
出账检核-增加币种21
parent
2bf113c8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
63 additions
and
23 deletions
+63
-23
yd-csf-api/src/main/java/com/yd/csf/api/service/impl/ApiExpectedFortuneServiceImpl.java
+27
-10
yd-csf-feign/src/main/java/com/yd/csf/feign/request/expectedfortune/ExpectedFortuneAddRequest.java
+2
-1
yd-csf-service/src/main/java/com/yd/csf/service/service/IExpectedFortuneService.java
+13
-5
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/ExpectedFortuneServiceImpl.java
+20
-6
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneServiceImpl.java
+1
-1
No files found.
yd-csf-api/src/main/java/com/yd/csf/api/service/impl/ApiExpectedFortuneServiceImpl.java
View file @
17350865
...
...
@@ -702,7 +702,7 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
ExpectedFortune
updateObj
=
new
ExpectedFortune
();
updateObj
.
setId
(
expectedFortune
.
getId
());
updateObj
.
setPayableNo
(
this
.
createPayableNo
(
"R"
,
currentSeq
+
i
+
1
));
updateObj
.
setPayableNo
(
this
.
createPayableNo
(
"R"
,
expectedFortune
.
getPayoutDate
(),
policyNo
,
expectedFortune
.
getFortunePeriod
()
));
updateObj
.
setFortuneType
(
GetDictItemListByDictTypeResponse
.
getItemValue
(
dictTypeResponses
,
"csf_fortune_type"
,
expectedFortune
.
getFortuneName
()));
...
...
@@ -1048,7 +1048,7 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
}
// 查询最新一条有 payableNo 记录
int
currentSeq
=
iExpectedFortuneService
.
getPayableNoCurrentSeq
();
//
int currentSeq = iExpectedFortuneService.getPayableNoCurrentSeq();
List
<
ExpectedFortune
>
fortuneList
=
new
ArrayList
<>();
for
(
ExpectedFortuneAddRequest
expectedFortuneDto
:
fortuneAddRequestList
)
{
...
...
@@ -1073,7 +1073,7 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
// 预计发佣类型名称
expectedFortune
.
setFortuneName
(
queryByDict
(
expectedFortuneDto
.
getFortuneType
()));
// 应付款编号(序号递增)
expectedFortune
.
setPayableNo
(
this
.
createPayableNo
(
expectedFortune
.
getFortuneBizType
(),
++
currentSeq
));
expectedFortune
.
setPayableNo
(
this
.
createPayableNo
(
expectedFortune
.
getFortuneBizType
(),
expectedFortuneDto
.
getPayoutDate
(),
expectedFortuneDto
.
getPolicyNo
(),
expectedFortuneDto
.
getFortunePeriod
()
));
// 已出帐金额、待出帐金额、已出帐比例、待出帐比例
...
...
@@ -1238,17 +1238,34 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
}
/**
* 创建应付款编号 应付
款类型-CSF-年份后两位-6位数字(不重复)
* 创建应付款编号 应付
单类型(R/U)+预计年月+保单号后4位(如不够用0补齐)+出账期数(3位)
*
* @param fortuneBizType 预计发佣业务类型
* @param seq 序号
* @param payoutDate 预计出账日期
* @param policyNo 保单号
* @param fortunePeriod 预计出账期数
* @return
*/
private
String
createPayableNo
(
String
fortuneBizType
,
int
seq
)
{
return
String
.
format
(
"%s%s%s"
,
fortuneBizType
+
"-CSF"
,
LocalDate
.
now
().
getYear
()
%
100
,
String
.
format
(
"%06d"
,
seq
));
public
String
createPayableNo
(
String
fortuneBizType
,
LocalDate
payoutDate
,
String
policyNo
,
int
fortunePeriod
)
{
// 1. 安全获取保单号后4位
String
last4Chars
=
""
;
if
(
policyNo
!=
null
&&
!
policyNo
.
isEmpty
())
{
int
startIdx
=
Math
.
max
(
0
,
policyNo
.
length
()
-
4
);
last4Chars
=
policyNo
.
substring
(
startIdx
);
}
// 2. 字符串左补0至4位
// %4s 表示最小宽度为4,不足部分默认用空格填充在左侧
// replace(' ', '0') 将填充的空格替换为0,实现左补0效果
String
formattedPolicySuffix
=
String
.
format
(
"%4s"
,
last4Chars
).
replace
(
' '
,
'0'
);
// 3. 组装最终字符串
return
String
.
format
(
"%s%04d%02d%s%03d"
,
fortuneBizType
,
payoutDate
.
getYear
(),
payoutDate
.
getMonthValue
(),
formattedPolicySuffix
,
fortunePeriod
);
}
/**
...
...
yd-csf-feign/src/main/java/com/yd/csf/feign/request/expectedfortune/ExpectedFortuneAddRequest.java
View file @
17350865
...
...
@@ -5,6 +5,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.time.LocalDate
;
import
java.util.Date
;
@Data
...
...
@@ -98,7 +99,7 @@ public class ExpectedFortuneAddRequest {
*/
@Schema
(
description
=
"出账日 (估)"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
payoutDate
;
private
Local
Date
payoutDate
;
/**
* 出账日 (实)
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/IExpectedFortuneService.java
View file @
17350865
...
...
@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import
com.yd.csf.service.vo.ExpectedFortuneStatisticsVO
;
import
com.yd.csf.service.vo.PayableReportVO
;
import
java.time.LocalDate
;
import
java.util.List
;
/**
...
...
@@ -39,7 +40,8 @@ public interface IExpectedFortuneService extends IService<ExpectedFortune> {
/**
* 应付款报表 - 按保单号和期数维度统计(分页)
* @param page 分页参数
*
* @param page 分页参数
* @param expectedFortuneIds 预计发佣ID列表
* @return 应付款报表VO分页列表
*/
...
...
@@ -53,15 +55,20 @@ public interface IExpectedFortuneService extends IService<ExpectedFortune> {
/**
* 生成应付款编号(序号递增) 格式:发佣类型-CSF+年份+序号
* @param fortuneType 发佣类型
*
* @param fortuneBizType 应付款类型
* @param payoutDate 出账日期
* @param policyNo 保单号
* @param fortunePeriod 出账期数
* @return 应付款编号
*/
String
getPayableNo
(
String
fortune
Type
);
String
getPayableNo
(
String
fortune
BizType
,
LocalDate
payoutDate
,
String
policyNo
,
Integer
fortunePeriod
);
/**
* 查询预计发佣和实际发佣的分页列表(手动分页)
* @param pageNo 页码(从 1 开始)
* @param pageSize 每页大小
*
* @param pageNo 页码(从 1 开始)
* @param pageSize 每页大小
* @param queryWrapper 查询条件
* @return 分页结果
*/
...
...
@@ -69,6 +76,7 @@ public interface IExpectedFortuneService extends IService<ExpectedFortune> {
/**
* 查询预计发佣和实际发佣的统计数据(使用 SQL 聚合)
*
* @param queryWrapper 查询条件
* @return 统计信息
*/
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/ExpectedFortuneServiceImpl.java
View file @
17350865
...
...
@@ -232,12 +232,26 @@ public class ExpectedFortuneServiceImpl extends ServiceImpl<ExpectedFortuneMappe
}
@Override
public
String
getPayableNo
(
String
fortuneType
)
{
Integer
currentSeq
=
getPayableNoCurrentSeq
();
return
String
.
format
(
"%s%s%s"
,
fortuneType
+
"-CSF"
,
LocalDate
.
now
().
getYear
()
%
100
,
currentSeq
+
1
);
public
String
getPayableNo
(
String
fortuneBizType
,
LocalDate
payoutDate
,
String
policyNo
,
Integer
fortunePeriod
)
{
// 1. 安全获取保单号后4位
String
last4Chars
=
""
;
if
(
policyNo
!=
null
&&
!
policyNo
.
isEmpty
())
{
int
startIdx
=
Math
.
max
(
0
,
policyNo
.
length
()
-
4
);
last4Chars
=
policyNo
.
substring
(
startIdx
);
}
// 2. 字符串左补0至4位
// %4s 表示最小宽度为4,不足部分默认用空格填充在左侧
// replace(' ', '0') 将填充的空格替换为0,实现左补0效果
String
formattedPolicySuffix
=
String
.
format
(
"%4s"
,
last4Chars
).
replace
(
' '
,
'0'
);
// 3. 组装最终字符串
return
String
.
format
(
"%s%04d%02d%s%03d"
,
fortuneBizType
,
payoutDate
.
getYear
(),
payoutDate
.
getMonthValue
(),
formattedPolicySuffix
,
fortunePeriod
);
}
@Override
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneServiceImpl.java
View file @
17350865
...
...
@@ -815,7 +815,7 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
private
ExpectedFortune
createExpectedFortune
(
FortuneAddRequest
fortuneAddRequest
,
Policy
policy
,
String
fortuneName
)
{
// 应付款编号(序号递增)
String
payableNo
=
expectedFortuneService
.
getPayableNo
(
fortuneAddRequest
.
getFortune
Type
());
String
payableNo
=
expectedFortuneService
.
getPayableNo
(
fortuneAddRequest
.
getFortune
BizType
(),
fortuneAddRequest
.
getPayoutDate
(),
policy
.
getPolicyNo
(),
fortuneAddRequest
.
getFortunePeriod
());
// 创建 expectedFortune
ExpectedFortune
expectedFortune
=
new
ExpectedFortune
();
...
...
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