Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-backend
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
AutogeneralShanghai
yd-backend
Commits
c8ed327c
Commit
c8ed327c
authored
Dec 28, 2021
by
hongzhong
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev_20210330' into dev_20210330
parents
65a4e6a8
50e1c6ce
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
61 additions
and
39 deletions
+61
-39
yd-api/src/main/java/com/yd/api/agms/service/impl/AgmsFortuneServiceImpl.java
+2
-2
yd-api/src/main/java/com/yd/api/agms/vo/fortune/CommissionPayoutStatusQueryRequestVO.java
+13
-1
yd-api/src/main/java/com/yd/api/commission/service/impl/LifeCommissionServiceImpl.java
+21
-25
yd-api/src/main/java/com/yd/dal/entity/agms/fortune/CommissionPayoutStatusQueryInfo.java
+12
-0
yd-api/src/main/resources/mapper/agms/AgmsFortuneMapper.xml
+8
-2
yd-api/src/main/resources/mapper/lifecommission/LifeCommissionMapper.xml
+5
-9
No files found.
yd-api/src/main/java/com/yd/api/agms/service/impl/AgmsFortuneServiceImpl.java
View file @
c8ed327c
...
...
@@ -217,7 +217,7 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
//判断这些财富记录中佣金发放状态和要修改的状态是否一致,如一致,则不需要修改
for
(
AclCustomerFortune
fortune
:
fortunes
)
{
//不一致,进行修改,并保存需修改的fortune和记录需要新生成的fortune
if
(!
paymentStatus
.
equals
(
fortune
.
get
CommissionPayout
Status
()))
{
if
(!
paymentStatus
.
equals
(
fortune
.
getStatus
()))
{
fortune
.
setCommissionPayoutStatus
(
paymentStatus
);
fortune
.
setStatus
(
"2"
);
fortune
.
setCommissionPayoutBy
(
loginId
);
...
...
@@ -308,7 +308,7 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
List
<
Long
>
withdrawUpdateIds
=
new
ArrayList
<>();
for
(
AclCustomerFortune
fortune
:
customerFortunes
){
//不一致,进行修改,并保存需修改的fortune和需重新计算的withdrawIds
if
(!
paymentStatus
.
equals
(
fortune
.
get
CommissionPayout
Status
())){
if
(!
paymentStatus
.
equals
(
fortune
.
getStatus
())){
fortune
.
setCommissionPayoutStatus
(
paymentStatus
);
fortune
.
setStatus
(
paymentStatus
);
fortune
.
setCommissionPayoutBy
(
loginId
);
...
...
yd-api/src/main/java/com/yd/api/agms/vo/fortune/CommissionPayoutStatusQueryRequestVO.java
View file @
c8ed327c
...
...
@@ -43,9 +43,13 @@ public class CommissionPayoutStatusQueryRequestVO {
private
String
commissionPayoutYearmonth
;
/**
*
预计
发佣年月
*
实际
发佣年月
*/
private
String
payoutYearmonth
;
/**
* 预计发佣年月
*/
private
String
predictMonthPeriod
;
/**
* 系统标志,区分公司营业部和体系,1,分公司,2营业部,3,S1分部,4,S2体系,5,S3纵队
...
...
@@ -175,5 +179,13 @@ public class CommissionPayoutStatusQueryRequestVO {
public
void
setPage
(
PageInfo
<
CommissionPayoutStatus
>
page
)
{
this
.
page
=
page
;
}
public
String
getPredictMonthPeriod
()
{
return
predictMonthPeriod
;
}
public
void
setPredictMonthPeriod
(
String
predictMonthPeriod
)
{
this
.
predictMonthPeriod
=
predictMonthPeriod
;
}
}
yd-api/src/main/java/com/yd/api/commission/service/impl/LifeCommissionServiceImpl.java
View file @
c8ed327c
...
...
@@ -159,7 +159,7 @@ public class LifeCommissionServiceImpl implements LifeCommissionService {
try
{
// 1.检核续年佣金时先判断,前面期数的佣金是否检核过
this
.
validateContinuePremium
(
paramsList
);
//
this.validateContinuePremium(paramsList);
// 2.更新财富等信息
this
.
processOrderAndFortune
(
paramsList
,
status
,
loginId
,
checkBatch
);
...
...
@@ -218,14 +218,16 @@ public class LifeCommissionServiceImpl implements LifeCommissionService {
// 获取首年度佣金的orderId, 只有首年佣金才更新order记录和fortune记录
List
<
Long
>
orderIds
=
new
ArrayList
<>();
Long
orderId
;
for
(
ComeCommissionParams
params:
paramsList
)
{
for
(
ComeCommissionParams
params
:
paramsList
)
{
// 查询对应订单记录
orderId
=
params
.
getOrderId
();
PoOrder
order
=
poOrderDALService
.
findByOrderId
(
orderId
);
if
(
"1"
.
equals
(
params
.
getCommissionPeriod
()))
{
orderIds
.
add
(
orderId
);
// 只有首年记录更新order表
this
.
updateOrder
(
order
,
status
,
loginId
,
checkBatch
);
if
(
orderId
!=
null
)
{
PoOrder
order
=
poOrderDALService
.
findByOrderId
(
orderId
);
if
(
"1"
.
equals
(
params
.
getCommissionPeriod
()))
{
orderIds
.
add
(
orderId
);
// 只有首年记录更新order表
this
.
updateOrder
(
order
,
status
,
loginId
,
checkBatch
);
}
}
this
.
updateFortune
(
params
.
getCommissionId
(),
status
,
loginId
,
checkBatch
);
}
...
...
@@ -235,43 +237,37 @@ public class LifeCommissionServiceImpl implements LifeCommissionService {
List
<
PoOrder
>
orders
=
poOrderDALService
.
findByIds
(
orderIds
);
this
.
orderCommissionCheckCancelSendMail
(
orders
);
}
}
private
void
updateOrderCommission
(
List
<
ComeCommissionParams
>
paramsList
,
String
status
,
String
loginId
,
String
checkBatch
)
{
// 获取续年度来佣编号
List
<
String
>
commissionNos
=
new
ArrayList
<>();
for
(
ComeCommissionParams
params:
paramsList
)
{
if
(
StringUtils
.
isNotBlank
(
params
.
getCommissionNo
()))
{
commissionNos
.
add
(
params
.
getCommissionNo
());
}
}
// 获取批次号(如2020-11的字符串)
Long
checkBatchId
=
this
.
getOrderCommissionCheckBatch
(
checkBatch
,
loginId
);
Set
<
Long
>
commissionCancelorderIdSet
=
new
HashSet
<>();
// 更新检核状态
for
(
String
commissionNo:
commissionNos
)
{
Long
commissionId
=
null
;
for
(
ComeCommissionParams
params:
paramsList
)
{
commissionId
=
params
.
getCommissionId
();
if
(
"3"
.
equals
(
status
))
{
// 来佣比对进行“已退保”操作时,当前状态为待来佣时才修改
AgPoOrderCommission
agPoOrderCommission
=
orderCommissionMapper
.
selectBy
CommissionNo
(
commissionNo
);
AgPoOrderCommission
agPoOrderCommission
=
orderCommissionMapper
.
selectBy
PrimaryKey
(
commissionId
);
if
(
"1"
.
equals
(
agPoOrderCommission
.
getCommissionStatus
()))
{
AgPoOrderCommission
orderCommission
=
new
AgPoOrderCommission
();
orderCommission
.
set
CommissionNo
(
commissionNo
);
orderCommission
.
set
Id
(
commissionId
);
orderCommission
.
setCommissionCheckId
(
checkBatchId
);
orderCommission
.
setCommissionStatus
(
status
);
orderCommission
.
setCommissionTime
(
""
);
orderCommission
.
setUpdatedBy
(
Long
.
valueOf
(
loginId
));
orderCommission
.
setUpdatedAt
(
new
Date
());
orderCommissionMapper
.
updateBy
commissionNo
(
orderCommission
);
orderCommissionMapper
.
updateBy
PrimaryKeySelective
(
orderCommission
);
// 退保的orderId
commissionCancelorderIdSet
.
add
(
agPoOrderCommission
.
getOrderId
());
if
(
null
!=
agPoOrderCommission
.
getOrderId
())
{
commissionCancelorderIdSet
.
add
(
agPoOrderCommission
.
getOrderId
());
}
}
}
else
{
AgPoOrderCommission
orderCommission
=
new
AgPoOrderCommission
();
orderCommission
.
set
CommissionNo
(
commissionNo
);
orderCommission
.
set
Id
(
commissionId
);
orderCommission
.
setCommissionCheckId
(
checkBatchId
);
orderCommission
.
setCommissionStatus
(
status
);
if
(
"2"
.
equals
(
status
))
{
...
...
@@ -280,7 +276,7 @@ public class LifeCommissionServiceImpl implements LifeCommissionService {
orderCommission
.
setUpdatedBy
(
Long
.
valueOf
(
loginId
));
orderCommission
.
setUpdatedAt
(
new
Date
());
orderCommissionMapper
.
updateBy
commissionNo
(
orderCommission
);
orderCommissionMapper
.
updateBy
PrimaryKeySelective
(
orderCommission
);
}
}
// 如果是已退保,将后续期数的待来佣记录都改为已退保
...
...
@@ -297,7 +293,7 @@ public class LifeCommissionServiceImpl implements LifeCommissionService {
orderCommission
.
setUpdatedBy
(
Long
.
valueOf
(
loginId
));
orderCommission
.
setUpdatedAt
(
new
Date
());
orderCommissionMapper
.
updateBy
commissionNo
(
orderCommission
);
orderCommissionMapper
.
updateBy
PrimaryKeySelective
(
orderCommission
);
}
}
}
...
...
yd-api/src/main/java/com/yd/dal/entity/agms/fortune/CommissionPayoutStatusQueryInfo.java
View file @
c8ed327c
...
...
@@ -47,6 +47,10 @@ public class CommissionPayoutStatusQueryInfo {
* 预计发佣年月
*/
private
String
payoutYearmonth
;
/**
* 预计发佣年月
*/
private
String
predictMonthPeriod
;
/**
* 体系子集id
...
...
@@ -148,4 +152,12 @@ public class CommissionPayoutStatusQueryInfo {
public
void
setPage
(
PageInfo
<
CommissionPayoutStatus
>
page
)
{
this
.
page
=
page
;
}
public
String
getPredictMonthPeriod
()
{
return
predictMonthPeriod
;
}
public
void
setPredictMonthPeriod
(
String
predictMonthPeriod
)
{
this
.
predictMonthPeriod
=
predictMonthPeriod
;
}
}
yd-api/src/main/resources/mapper/agms/AgmsFortuneMapper.xml
View file @
c8ed327c
...
...
@@ -133,8 +133,11 @@
<if
test=
"item.commissionPayoutYearmonth != null"
>
and c.check_yearmonth = #{item.commissionPayoutYearmonth,jdbcType=VARCHAR}
</if>
<if
test=
"item.predictMonthPeriod != null"
>
and DATE_FORMAT(t.predict_month_period, '%Y-%m') = #{item.predictMonthPeriod,jdbcType=VARCHAR}
</if>
<if
test=
"item.payoutYearmonth != null"
>
and
DATE_FORMAT(t.predict_month_period, '%Y-%m')
= #{item.payoutYearmonth,jdbcType=VARCHAR}
and
pb.payout_yearmonth
= #{item.payoutYearmonth,jdbcType=VARCHAR}
</if>
UNION ALL
SELECT '' orderId,t.id fortuneId,'' commissionPayoutYearmonth,'' insurerName,'' productName,
...
...
@@ -192,8 +195,11 @@
<!-- <if test="item.commissionPayoutYearmonth != null"> -->
<!-- and c.check_yearmonth = #{item.commissionPayoutYearmonth,jdbcType=VARCHAR} -->
<!-- </if> -->
<if
test=
"item.predictMonthPeriod != null"
>
and DATE_FORMAT(t.predict_month_period, '%Y-%m') = #{item.predictMonthPeriod,jdbcType=VARCHAR}
</if>
<if
test=
"item.payoutYearmonth != null"
>
and
DATE_FORMAT(t.predict_month_period, '%Y-%m')
= #{item.payoutYearmonth,jdbcType=VARCHAR}
and
pb.payout_yearmonth
= #{item.payoutYearmonth,jdbcType=VARCHAR}
</if>
</select>
...
...
yd-api/src/main/resources/mapper/lifecommission/LifeCommissionMapper.xml
View file @
c8ed327c
...
...
@@ -83,7 +83,6 @@
) p3
on o.config_level = p3.config_level and o.plan_id = p3.plan_id
left join ag_acl_insurer i on o.insurer_id = i.id
left join ag_acl_insurer_branch b on p.insurer_branch_id = b.id
left join (SELECT order_id, name, practitioner_type_id, f.customer_id
from (
select *
...
...
@@ -105,7 +104,7 @@
and o.insurer_id = #{insurerId}
</if>
<if
test=
"insurerBranchId != null"
>
and
b.
id = #{insurerBranchId,jdbcType=BIGINT}
and
p.insurer_branch_
id = #{insurerBranchId,jdbcType=BIGINT}
</if>
<if
test=
"practitionerTypeId != null"
>
and f.practitioner_type_id = #{practitionerTypeId}
...
...
@@ -212,7 +211,8 @@
) o
left join ag_po_order_commission_check c on o.commission_check_id = c.id
left join ag_acl_insurer i on o.insurer_id = i.id
left join ag_acl_insurer_branch b on o.insurer_id = b.insurer_id
left join ag_product_plan a on o.plan_id = a.id
left join ag_product p on o.product_id = p.id
left join (SELECT order_id, name, practitioner_type_id, f.customer_id
from (
select *
...
...
@@ -227,7 +227,7 @@
and o.insurer_id = #{insurerId}
</if>
<if
test=
"insurerBranchId != null"
>
and
b.
id = #{insurerBranchId,jdbcType=BIGINT}
and
p.insurer_branch_
id = #{insurerBranchId,jdbcType=BIGINT}
</if>
<if
test=
"practitionerTypeId != null"
>
and f.practitioner_type_id = #{practitionerTypeId}
...
...
@@ -286,9 +286,6 @@
o.commission_type commissionType,
o.commission_item commissionItem,
b.id insurerBranchId,
b.branch_name insurerBranchName,
null as coverageTerm,
null as payTerm,
(case o.config_level when 2 then p2.pName2 else p3.pName3 END) categoryName,
...
...
@@ -324,13 +321,12 @@
) p3
on o.config_level = p3.config_level and o.plan_id = p3.plan_id
left join ag_acl_insurer i on o.insurer_id = i.id
LEFT JOIN ag_acl_insurer_branch b ON o.insurer_id = b.insurer_id
where 1=1
<if
test=
"insurerId != null"
>
and o.insurer_id = #{insurerId}
</if>
<if
test=
"insurerBranchId != null"
>
and
b.
id = #{insurerBranchId,jdbcType=BIGINT}
and
p.insurer_branch_
id = #{insurerBranchId,jdbcType=BIGINT}
</if>
<if
test=
"commissionType != null"
>
and o.commission_type = #{commissionType}
...
...
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