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
50631ce3
Commit
50631ce3
authored
Jul 05, 2022
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
渠道发佣报表1
parent
a4de4f7e
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
104 additions
and
4 deletions
+104
-4
yd-api/src/main/java/com/yd/api/agms/service/impl/AgmsFortuneServiceImpl.java
+32
-4
yd-api/src/main/java/com/yd/dal/mapper/agms/AgmsFortuneMapper.java
+7
-0
yd-api/src/main/java/com/yd/dal/service/agms/AgmsFortuneDALService.java
+2
-0
yd-api/src/main/java/com/yd/dal/service/agms/impl/AgmsFortuneDALServiceImpl.java
+5
-0
yd-api/src/main/resources/mapper/agms/AgmsFortuneMapper.xml
+58
-0
No files found.
yd-api/src/main/java/com/yd/api/agms/service/impl/AgmsFortuneServiceImpl.java
View file @
50631ce3
...
...
@@ -979,6 +979,8 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
XSSFWorkbook
wkb
=
new
XSSFWorkbook
();
// 保单发佣清算明细报表Sheet页
generateSheet2
(
wkb
,
fortuneIdList
,
fortuneIdList2
);
// 对公渠道清算报表Sheet页
generateSheet3
(
wkb
,
info
);
// 设置响应
String
fn
=
"ZHB_SalaryReport_"
+
System
.
currentTimeMillis
()
+
".xlsx"
;
String
headStr
=
"attachment; filename=\""
+
fn
+
"\""
;
...
...
@@ -987,6 +989,23 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
return
responseVO
;
}
private
void
generateSheet3
(
XSSFWorkbook
wkb
,
CommissionPayoutStatusQueryInfo
info
)
{
XSSFSheet
sheet3
=
wkb
.
createSheet
(
"对公渠道清算报表"
);
// 1.设置表头
String
[]
columnName
=
new
String
[]{
"序号"
,
"对账月"
,
"投保人"
,
"保单号"
,
"保司"
,
"保费"
,
"产品"
,
"承保时间"
,
"年期"
,
"FYC%"
,
"RYC%"
,
"保单FYC"
,
"保单RYC"
,
"渠道"
,
"收款账户名称"
,
"D01首年渠道服务费"
,
"D02续年渠道服务费"
,
"基本法属性"
,
"D91渠道加扣款1"
,
"D92渠道加扣款2"
};
// 2.1 查询Sheet3数据
info
.
setChannelType
(
"1"
);
List
<
CommissionPayoutStatus
>
commissionPayoutStatusList
=
agmsFortuneDalService
.
commissionPayoutStatusQuery
(
info
);
List
<
Long
>
fortuneIdList
=
new
ArrayList
<>();
commissionPayoutStatusList
.
forEach
(
i
->
fortuneIdList
.
add
(
i
.
getFortuneId
()));
List
<
Map
<
String
,
Object
>>
dataList
=
agmsFortuneDalService
.
querySheet3Data
(
fortuneIdList
);
// 3.填充数据
generateSheet
(
sheet3
,
columnName
,
dataList
);
}
@Override
public
CommissionPayoutStatusUpdateResponseVO
commissionPayoutAddRemark
(
CommissionPayoutAddRemarkRequestVO
requestVO
)
{
CommissionPayoutStatusUpdateResponseVO
responseVO
=
new
CommissionPayoutStatusUpdateResponseVO
();
...
...
@@ -1027,14 +1046,22 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
"R01-首年度直接销售佣金(旧)"
,
"R02-续年度直接销售拥金(旧)"
,
"R03-续年度辅导佣金(旧)"
,
"R04-续年度绩效奖金(旧)"
,
"S1推荐人"
,
"S2推荐人"
,
"S2体系推荐率"
,
"S2体系推荐奖金¥"
,
"S3推荐人"
,
"S3体系推荐率"
,
"S3体系推荐奖金¥"
,
"S2育成人"
,
"S2育成人职级"
,
"S2育成奖金率"
,
"S2育成金额"
,
"S3育成人"
,
"S3育成人职级"
,
"S3育成奖金率"
,
"S3育成金额"
,
"其它税前加扣款1"
,
"其它税前加扣款2"
,
"其它税前加扣款3"
,
"其它税前加扣款4"
,
"其它"
};
"其它税前加扣款1"
,
"其它税前加扣款2"
,
"其它税前加扣款3"
,
"其它税前加扣款4"
,
"其它"
,
"C11-独立经纪人展业津贴"
,
"D01-首年渠道服务费"
,
"D02-续年渠道服务费"
,
"D91-渠道加扣款1"
,
"D92-渠道加扣款2"
};
// 2.1 查询Sheet2数据
List
<
Map
<
String
,
Object
>>
dataList
=
agmsFortuneDalService
.
querySheet2Data
(
fortuneIdList
,
fortuneIdList2
);
// 3.填充数据
generateSheet
(
sheet2
,
columnName
,
dataList
);
}
private
void
generateSheet
(
XSSFSheet
sheet2
,
String
[]
columnName
,
List
<
Map
<
String
,
Object
>>
dataList
)
{
// 1.创建表头
XSSFRow
rownum
=
sheet2
.
createRow
(
0
);
for
(
int
j
=
0
;
j
<
columnName
.
length
;
j
++)
{
rownum
.
createCell
(
j
).
setCellValue
(
columnName
[
j
]);
}
// 2.查询Sheet2数据
List
<
Map
<
String
,
Object
>>
dataList
=
agmsFortuneDalService
.
querySheet2Data
(
fortuneIdList
,
fortuneIdList2
);
// 将结果集中的推荐人、体系等id替换为中文
// 2.将结果集中的推荐人、体系等id替换为中文
if
(
CollectionUtils
.
isNotEmpty
(
dataList
))
{
exportSalaryDetailsSheet2queryOrganization
(
dataList
);
}
...
...
@@ -1052,6 +1079,7 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
}
}
private
void
exportSalaryDetailsSheet2queryOrganization
(
List
<
Map
<
String
,
Object
>>
list
)
{
List
<
AclPractitioner
>
aclPractitionerList
=
aclPractitionerDALService
.
findAll
();
...
...
yd-api/src/main/java/com/yd/dal/mapper/agms/AgmsFortuneMapper.java
View file @
50631ce3
...
...
@@ -53,4 +53,11 @@ public interface AgmsFortuneMapper {
List
<
Long
>
querySalePractitionerFortune1
(
List
<
Long
>
fortuneIdList
);
void
commissionPayoutAddRemark
(
CommissionPayoutAddRemarkRequestVO
requestVO
);
/**
* 对公渠道清算报表
* @param fortuneIdList
* @return
*/
List
<
Map
<
String
,
Object
>>
querySheet3Data
(
List
<
Long
>
fortuneIdList
);
}
yd-api/src/main/java/com/yd/dal/service/agms/AgmsFortuneDALService.java
View file @
50631ce3
...
...
@@ -53,4 +53,6 @@ public interface AgmsFortuneDALService {
List
<
Long
>
querySalePractitionerFortune1
(
List
<
Long
>
fortuneIdList
);
void
commissionPayoutAddRemark
(
CommissionPayoutAddRemarkRequestVO
requestVO
);
List
<
Map
<
String
,
Object
>>
querySheet3Data
(
List
<
Long
>
fortuneIdList
);
}
yd-api/src/main/java/com/yd/dal/service/agms/impl/AgmsFortuneDALServiceImpl.java
View file @
50631ce3
...
...
@@ -103,4 +103,9 @@ public class AgmsFortuneDALServiceImpl implements AgmsFortuneDALService {
fortune
.
setUpdatedAt
(
new
Date
());
aclCustomerFortuneMapper
.
updateByPrimaryKeySelective
(
fortune
);
}
@Override
public
List
<
Map
<
String
,
Object
>>
querySheet3Data
(
List
<
Long
>
fortuneIdList
)
{
return
agmsFortuneMapper
.
querySheet3Data
(
fortuneIdList
);
}
}
yd-api/src/main/resources/mapper/agms/AgmsFortuneMapper.xml
View file @
50631ce3
...
...
@@ -808,6 +808,13 @@
sum(case when drop_option_code ='C97' then f.referral_amount else null end) as '90' /*其它税前加扣款3*/,
sum(case when drop_option_code ='C98' then f.referral_amount else null end) as '91' /*其它税前加扣款4*/,
sum(case when drop_option_code ='C99' then f.referral_amount else null end) as '92' /*其它*/,
sum(case when drop_option_code ='C11' then f.referral_amount else null end) as '93' /*C11-独立经纪人展业津贴*/,
sum(case when drop_option_code ='D01' then f.referral_amount else null end) as '94' /*D01-首年渠道服务费*/,
sum(case when drop_option_code ='D02' then f.referral_amount else null end) as '95' /*D02-续年渠道服务费*/,
sum(case when drop_option_code ='D91' then f.referral_amount else null end) as '96' /*D91-渠道加扣款1*/,
sum(case when drop_option_code ='D92' then f.referral_amount else null end) as '97' /*D92-渠道加扣款2*/,
f.order_id,
l.customer_id
FROM ag_acl_customer_fortune f
...
...
@@ -944,6 +951,12 @@
null as '91' /*其它税前加扣款4*/,
null as '92' /*其它*/,
null as '93' /*C11-独立经纪人展业津贴*/,
null as '94' /*D01-首年渠道服务费*/,
null as '95' /*D02-续年渠道服务费*/,
null as '96' /*D91-渠道加扣款1*/,
null as '97' /*D92-渠道加扣款2*/,
f.order_id,
f.customer_id
...
...
@@ -961,6 +974,51 @@
ORDER BY '2'
</select>
<select
id=
"querySheet3Data"
resultType=
"java.util.LinkedHashMap"
>
select
(SELECT t.commission_time FROM ag_po_order_commission t WHERE
t.commission_status='2' and t.commission_type='1'
and t.order_id=f.order_id and t.commission_period=f.commission_period limit 1 ) '0' /*对账月*/,
(select name from ag_acl_policyholder where order_id = f.order_id and type=2) '1',
o.policy_no '2',
i.name '3' /*保司*/,
o.order_price '4' ,
if(p.name is not null, p.name, (select tp.name from ag_product_plan tp where tp.id = o.plan_id)) '5' /*产品*/,
o.underwriting_date '6',
CONCAT(o.payment_term, (case o.payment_term_unit when 'Y' then '年' when 'M' then '月' else '年' END)) '7',
if(o.fyc_rate,o.fyc_rate,'') '8' /*'FYC%'*/,
if(f.commission_period!=1,f.fyc_rate,'') '9' /*'RYC%'*/,
o.fyc_amount '10'/*保单FYC*/,
if(f.commission_period!=1,f.fyc_amount,'') '11' /*保单RYC*/,
cn.name '12' /*渠道*/,
cn.account_no as '13' /*收款账户名称*/,
sum(case when f.drop_option_code ='D01' then f.referral_amount else null end) '14' /*D01首年渠道服务费*/,
sum(case when f.drop_option_code ='D02' then f.referral_amount else null end) '15' /*D02续年渠道服务费*/,
if(o.settlement_rule_type=1,'简单基本法','标准基本法') '16' /*基本法属性*/,
sum(case when f.drop_option_code ='D91' then f.referral_amount else null end) as '17' /*D91渠道加扣款1*/,
sum(case when f.drop_option_code ='D92' then f.referral_amount else null end) as '18' /*D92渠道加扣款2*/,
f.order_id,
f.channel_id
FROM ag_acl_customer_fortune f
LEFT JOIN ag_acl_channel_new cn on cn.customer_id = f.customer_id
LEFT JOIN ag_acl_practitioner pra on pra.customer_id = f.customer_id
LEFT JOIN ag_acl_practitioner_setting ps on ps.practitioner_id = pra.id
LEFT JOIN ag_md_drop_options op1 ON op1.id = ps.practitioner_level
LEFT JOIN ag_po_order o on o.id = f.order_id
LEFT JOIN ag_acl_insurer i on i.id = o.insurer_id
LEFT JOIN ag_product p on p.id = o.product_id
WHERE
f.channel_type = '1'
AND f.id in
<foreach
collection=
"list"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item,jdbcType=BIGINT}
</foreach>
GROUP BY f.order_id, f.channel_id
ORDER BY '2'
</select>
<select
id=
"querySalePractitionerFortune1"
parameterType=
"list"
resultType=
"Long"
>
SELECT f.id
FROM ag_acl_customer_fortune f
...
...
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