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
949389f6
Commit
949389f6
authored
Jul 02, 2021
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
来佣比对优化-查询
parent
bee321e6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
85 additions
and
16 deletions
+85
-16
yd-api/src/main/java/com/yd/api/commission/service/impl/LifeCommissionServiceImpl.java
+12
-0
yd-api/src/main/java/com/yd/api/commission/vo/lifecommission/CheckComeCommissionRequestVO.java
+9
-0
yd-api/src/main/java/com/yd/api/commission/vo/lifecommission/ComeCommissionVO.java
+7
-0
yd-api/src/main/java/com/yd/api/commission/vo/lifecommission/QueryComeCommissionListRequestVO.java
+2
-1
yd-api/src/main/resources/mapper/lifecommission/LifeCommissionMapper.xml
+55
-15
No files found.
yd-api/src/main/java/com/yd/api/commission/service/impl/LifeCommissionServiceImpl.java
View file @
949389f6
...
...
@@ -75,6 +75,8 @@ public class LifeCommissionServiceImpl implements LifeCommissionService {
String
status
=
requestVO
.
getCheckStatus
();
String
loginId
=
requestVO
.
getLoginId
();
String
checkBatch
=
requestVO
.
getCheckBatch
();
List
<
String
>
commissionNos
=
requestVO
.
getCommissionNos
();
if
(
StringUtils
.
isBlank
(
checkBatch
))
{
resp
.
setCommonResult
(
new
CommonResult
(
false
,
"检核日期不能为空"
));
return
resp
;
...
...
@@ -102,6 +104,9 @@ public class LifeCommissionServiceImpl implements LifeCommissionService {
}
this
.
updateOrderAndFortune
(
orderIds
,
fortuneList
,
status
,
fortuneCommissionPayoutStatus
,
loginId
,
checkBatch
);
// 更新多年期佣金
this
.
updateOrderCommission
(
commissionNos
,
status
,
loginId
,
checkBatch
);
// 订单已退保后发送邮件通知运营
if
(
"3"
.
equals
(
status
))
{
//已比对
this
.
orderCommissionCheckCancelSendMail
(
orders
);
...
...
@@ -116,6 +121,13 @@ public class LifeCommissionServiceImpl implements LifeCommissionService {
return
resp
;
}
private
void
updateOrderCommission
(
List
<
String
>
commissionNos
,
String
status
,
String
loginId
,
String
checkBatch
)
{
// 获取批次号(如2020-11的字符串)
Long
checkBatchId
=
this
.
getOrderCommissionCheckBatch
(
checkBatch
,
loginId
);
}
@Override
public
QuerycheckBatchListResponseVO
querycheckBatchList
()
{
QuerycheckBatchListResponseVO
resp
=
new
QuerycheckBatchListResponseVO
();
...
...
yd-api/src/main/java/com/yd/api/commission/vo/lifecommission/CheckComeCommissionRequestVO.java
View file @
949389f6
...
...
@@ -5,6 +5,7 @@ import java.util.List;
public
class
CheckComeCommissionRequestVO
{
private
List
<
Long
>
orderIds
;
private
String
checkStatus
;
private
List
<
String
>
commissionNos
;
private
String
loginId
;
/**
* 来佣比对批次
...
...
@@ -42,4 +43,12 @@ public class CheckComeCommissionRequestVO {
public
void
setCheckBatch
(
String
checkBatch
)
{
this
.
checkBatch
=
checkBatch
;
}
public
List
<
String
>
getCommissionNos
()
{
return
commissionNos
;
}
public
void
setCommissionNos
(
List
<
String
>
commissionNos
)
{
this
.
commissionNos
=
commissionNos
;
}
}
yd-api/src/main/java/com/yd/api/commission/vo/lifecommission/ComeCommissionVO.java
View file @
949389f6
...
...
@@ -38,4 +38,11 @@ public class ComeCommissionVO {
private
String
planCategoryName
;
private
String
name
;
private
String
practitionerTypeId
;
private
String
commissionNo
;
private
String
amount
;
private
String
commissionYear
;
private
String
commissionStatus
;
private
String
commissionTime
;
private
String
commissionPeriod
;
}
yd-api/src/main/java/com/yd/api/commission/vo/lifecommission/QueryComeCommissionListRequestVO.java
View file @
949389f6
...
...
@@ -5,7 +5,8 @@ import lombok.Data;
@Data
public
class
QueryComeCommissionListRequestVO
{
private
String
compareDate
;
private
String
startDate
;
private
String
endDate
;
private
String
historyDate
;
private
Long
insurerId
;
private
Long
practitionerTypeId
;
...
...
yd-api/src/main/resources/mapper/lifecommission/LifeCommissionMapper.xml
View file @
949389f6
...
...
@@ -15,19 +15,44 @@
o.commission_amount commissionAmount,
o.commission_check_status commissionCheckStatus,
o.order_date orderDate,
o.commission_no commissionNo,
o.amount ,
o.commissionYear,
o.commission_status commissionStatus,
o.commission_time commissionTime,
o.commission_period commissionPeriod,
IFNULL(o.coverageTerm,e.coverageTerm) coverageTerm,
IFNULL(o.payTerm,e.payTerm) payTerm,
f.name,
f.practitioner_type_id practitionerTypeId,
(case o.config_level when 2 then p2.pName2 else p3.pName3 END) categoryName,
(case o.config_level when 2 then p2.cName2 else p3.cName3 END) planCategoryName
from (SELECT id, policy_no, order_price, commission_rate, commission_amount, commission_check_status, commission_check_id, product_id,
from (SELECT o.*,
policyNo, commission_no, amount, commission_status, commission_time,
IFNULL(commission_year, o.order_date) commissionYear,
commission_period
from
(SELECT id, policy_no, order_price, commission_rate, commission_amount, commission_check_status, commission_check_id, product_id,
plan_id, insurer_id, order_date, commission_check_at, config_level,
CONCAT(payment_term, (case payment_term_unit when 'Y' then '年' when 'M' then '月' else '日' END)) payTerm,
CONCAT(cover_term, cover_term_type) coverageTerm
from ag_po_order t
where t.status in (3,4) and policy_no is not null
and (t.plan_id not in (424,453,464) or t.plan_id is null)
from ag_po_order t
where t.status in (3,4) and policy_no is not null
and (t.plan_id not in (424,453,464) or t.plan_id is null)
) o
LEFT JOIN
(SELECT policy_no policyNo, commission_no, commission_year, amount, commission_status, commission_time,
commission_period
from ag_po_order_commission t
) orderCommission
ON o.policy_no = orderCommission.policyNo
WHERE 1=1
<if
test=
"startDate != null "
>
and date_format(commission_year, '%Y-%m')
>
= #{startDate}
</if>
<if
test=
"endDate != null "
>
and date_format(commission_year, '%Y-%m')
<
= #{endDate}
</if>
) o
left join ag_po_order_commission_check c on o.commission_check_id = c.id
left join ag_product_plan a on o.plan_id = a.id
...
...
@@ -77,9 +102,6 @@
<when
test=
"historyDate != null "
>
and c.check_yearmonth = #{historyDate}
</when>
<when
test=
"compareDate != null "
>
and date_format(o.order_date, '%Y-%m')
<
#{compareDate}
</when>
</choose>
</select>
...
...
@@ -128,12 +150,33 @@
IFNULL(sum(CASE WHEN o.commission_check_status = '3' THEN 1 ELSE 0 END),0) totalYiTuiBao,
IFNULL(sum(o.order_price),0) totalOrderPrice,
IFNULL(sum(o.commission_amount),0) totalCommission
from (SELECT order_price, commission_amount, commission_check_status, commission_check_id, order_date,
insurer_id,id
from ag_po_order t
where t.status in (3,4) and policy_no is not null
and (t.plan_id not in (424,453,464) or t.plan_id is null)
from (SELECT o.*,
policyNo, commission_no, amount, commission_status, commission_time,
IFNULL(commission_year, o.order_date) commissionYear,
commission_period
from
(SELECT id, policy_no, order_price, commission_rate, commission_amount, commission_check_status, commission_check_id, product_id,
plan_id, insurer_id, order_date, commission_check_at, config_level,
CONCAT(payment_term, (case payment_term_unit when 'Y' then '年' when 'M' then '月' else '日' END)) payTerm,
CONCAT(cover_term, cover_term_type) coverageTerm
from ag_po_order t
where t.status in (3,4) and policy_no is not null
and (t.plan_id not in (424,453,464) or t.plan_id is null)
) o
LEFT JOIN
(SELECT policy_no policyNo, commission_no, commission_year, amount, commission_status, commission_time,
commission_period
from ag_po_order_commission t
) orderCommission
ON o.policy_no = orderCommission.policyNo
WHERE 1=1
<if
test=
"startDate != null "
>
and date_format(commission_year, '%Y-%m')
>
= #{startDate}
</if>
<if
test=
"endDate != null "
>
and date_format(commission_year, '%Y-%m')
<
= #{endDate}
</if>
) o
left join ag_po_order_commission_check c on o.commission_check_id = c.id
left join (SELECT order_id, name, practitioner_type_id, f.customer_id
from (
...
...
@@ -158,9 +201,6 @@
<when
test=
"historyDate != null "
>
and c.check_yearmonth = #{historyDate}
</when>
<when
test=
"compareDate != null "
>
and date_format(o.order_date, '%Y-%m')
<
#{compareDate}
</when>
</choose>
</select>
...
...
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