Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-product
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-product
Commits
1054309f
Commit
1054309f
authored
Dec 12, 2025
by
zhangxingmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push
parent
dc01a705
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
24 deletions
+11
-24
yd-product-api/src/main/java/com/yd/product/api/service/impl/ApiAnnouncementCommissionRatioServiceImpl.java
+10
-24
yd-product-api/src/main/java/com/yd/product/api/service/impl/ApiExpectedCommissionRatioServiceImpl.java
+1
-0
No files found.
yd-product-api/src/main/java/com/yd/product/api/service/impl/ApiAnnouncementCommissionRatioServiceImpl.java
View file @
1054309f
...
...
@@ -56,10 +56,7 @@ public class ApiAnnouncementCommissionRatioServiceImpl implements ApiAnnouncemen
*/
@Override
public
Result
batchSave
(
ApiAnnouncementCommissionRatioBatchSaveRequest
request
)
{
Result
result
=
checkBatchSaveRequestPram
(
request
.
getRatioBatchSaveDtoList
());
if
(
result
.
getCode
()
!=
200
)
{
return
result
;
}
checkBatchSaveRequestPram
(
request
.
getRatioBatchSaveDtoList
());
List
<
String
>
announcementSpeciesBizIdList
=
new
ArrayList
<>();
announcementSpeciesBizIdList
.
add
(
request
.
getAnnouncementSpeciesBizId
());
//先删后新增
...
...
@@ -184,30 +181,19 @@ public class ApiAnnouncementCommissionRatioServiceImpl implements ApiAnnouncemen
* @return
*/
public
Result
checkBatchSaveRequestPram
(
List
<
ApiAnnouncementCommissionRatioBatchSaveDto
>
ratioBatchSaveDtoList
)
{
if
(
ratioBatchSaveDtoList
==
null
||
ratioBatchSaveDtoList
.
isEmpty
())
{
return
Result
.
success
(
"数据为空,无需校验"
);
}
try
{
// 1. 验证并准备数据
List
<
DtoWithParsedData
>
preparedDataList
=
prepareData
(
ratioBatchSaveDtoList
);
if
(
preparedDataList
==
null
)
{
return
Result
.
fail
(
"数据准备失败,请检查输入数据"
);
}
// 2. 检查所有数据对的年限重叠情况(考虑scope交集)
List
<
OverlapError
>
errors
=
checkAllDataPairs
(
preparedData
List
);
// 1. 验证并准备数据
List
<
DtoWithParsedData
>
preparedDataList
=
prepareData
(
ratioBatchSaveDto
List
);
// 3. 如果有错误,返回错误信息
if
(!
errors
.
isEmpty
())
{
String
errorMsg
=
buildErrorMessage
(
errors
,
ratioBatchSaveDtoList
);
return
Result
.
fail
(
errorMsg
);
}
// 2. 检查所有数据对的年限重叠情况(考虑scope交集)
List
<
OverlapError
>
errors
=
checkAllDataPairs
(
preparedDataList
);
return
Result
.
success
(
"校验通过,无重叠数据"
);
}
catch
(
Exception
e
)
{
return
Result
.
fail
(
"数据校验异常:"
+
e
.
getMessage
());
// 3. 如果有错误,返回错误信息
if
(!
errors
.
isEmpty
())
{
String
errorMsg
=
buildErrorMessage
(
errors
,
ratioBatchSaveDtoList
);
throw
new
BusinessException
(
1004
,
errorMsg
);
}
return
Result
.
success
();
}
/**
...
...
yd-product-api/src/main/java/com/yd/product/api/service/impl/ApiExpectedCommissionRatioServiceImpl.java
View file @
1054309f
...
...
@@ -70,6 +70,7 @@ public class ApiExpectedCommissionRatioServiceImpl implements ApiExpectedCommiss
.
map
(
dto
->
{
ExpectedCommissionRatio
ratio
=
new
ExpectedCommissionRatio
();
BeanUtils
.
copyProperties
(
dto
,
ratio
);
// ratio.setExpectedSpeciesBizId(request.getAnnouncementSpeciesBizId());
ratio
.
setExpectedCommissionRatioBizId
(
RandomStringGenerator
.
generateBizId16
(
CommonEnum
.
UID_TYPE_EXPECTED_COMMISSION_RATIO
.
getCode
()));
return
ratio
;
}).
collect
(
Collectors
.
toList
());
...
...
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