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
fda39bfd
Commit
fda39bfd
authored
Mar 08, 2022
by
hongzhong
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
73664209
f829a8e2
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
1070 additions
and
227 deletions
+1070
-227
yd-api/src/main/java/com/yd/api/agms/AgmsController.java
+14
-0
yd-api/src/main/java/com/yd/api/agms/service/AgmsFortuneService.java
+2
-0
yd-api/src/main/java/com/yd/api/agms/service/impl/AgmsFortuneServiceImpl.java
+382
-147
yd-api/src/main/java/com/yd/api/agms/vo/fortune/CommissionPayoutStatusQueryRequestVO.java
+1
-1
yd-api/src/main/java/com/yd/api/agms/vo/fortune/CommissionPayoutStatusUpdateRequestVO.java
+1
-1
yd-api/src/main/java/com/yd/api/practitioner/service/impl/PractitionerServiceImpl.java
+18
-10
yd-api/src/main/java/com/yd/api/practitioner/service/impl/ScheduleTrackServiceImpl.java
+9
-5
yd-api/src/main/java/com/yd/dal/mapper/agms/AgmsFortuneMapper.java
+4
-1
yd-api/src/main/java/com/yd/dal/mapper/customer/AclPractitionerMapper.java
+2
-1
yd-api/src/main/java/com/yd/dal/service/agms/AgmsFortuneDALService.java
+5
-4
yd-api/src/main/java/com/yd/dal/service/agms/impl/AgmsFortuneDALServiceImpl.java
+15
-0
yd-api/src/main/java/com/yd/dal/service/customer/AclPractitionerDALService.java
+1
-1
yd-api/src/main/java/com/yd/dal/service/customer/impl/AclPractitionerDALServiceImpl.java
+1
-1
yd-api/src/main/java/com/yd/rmi/cache/SystemConfigService.java
+19
-0
yd-api/src/main/resources/i18n/messages_zh_CN.properties
+56
-55
yd-api/src/main/resources/mapper/agms/AgmsFortuneMapper.xml
+540
-0
No files found.
yd-api/src/main/java/com/yd/api/agms/AgmsController.java
View file @
fda39bfd
...
@@ -233,6 +233,20 @@ public class AgmsController {
...
@@ -233,6 +233,20 @@ public class AgmsController {
}
}
/**
/**
* AGMS -- 保单发佣清算明细报表导出
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping
(
value
=
"/exportCommissionPayoutStatusQuerySheet2"
)
public
Object
exportCommissionPayoutStatusQuerySheet2
(
@RequestBody
CommissionPayoutStatusQueryRequestVO
requestVO
,
HttpServletResponse
response
)
{
JsonResult
result
=
new
JsonResult
();
ExportCommissionPayoutStatusQueryResponseVO
responseVO
=
agmsFortuneService
.
exportCommissionPayoutStatusQuerySheet2
(
requestVO
,
response
);
result
.
setData
(
responseVO
);
result
.
addResult
(
responseVO
);
return
result
;
}
/**
* AGMS -- 导出财富文档
* AGMS -- 导出财富文档
* @param requestVO 请求数据
* @param requestVO 请求数据
* @return 响应数据
* @return 响应数据
...
...
yd-api/src/main/java/com/yd/api/agms/service/AgmsFortuneService.java
View file @
fda39bfd
...
@@ -66,4 +66,6 @@ public interface AgmsFortuneService {
...
@@ -66,4 +66,6 @@ public interface AgmsFortuneService {
FortunePayoutBatchQueryResponseVO
fortunePayoutBatchQuery
();
FortunePayoutBatchQueryResponseVO
fortunePayoutBatchQuery
();
ExportCommissionPayoutStatusQueryResponseVO
exportCommissionPayoutStatusQuery
(
CommissionPayoutStatusQueryRequestVO
requestVO
,
HttpServletResponse
response
);
ExportCommissionPayoutStatusQueryResponseVO
exportCommissionPayoutStatusQuery
(
CommissionPayoutStatusQueryRequestVO
requestVO
,
HttpServletResponse
response
);
ExportCommissionPayoutStatusQueryResponseVO
exportCommissionPayoutStatusQuerySheet2
(
CommissionPayoutStatusQueryRequestVO
requestVO
,
HttpServletResponse
response
);
}
}
yd-api/src/main/java/com/yd/api/agms/service/impl/AgmsFortuneServiceImpl.java
View file @
fda39bfd
...
@@ -2,6 +2,7 @@ package com.yd.api.agms.service.impl;
...
@@ -2,6 +2,7 @@ package com.yd.api.agms.service.impl;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.google.common.base.Joiner
;
import
com.yd.api.agms.service.AgmsFortuneService
;
import
com.yd.api.agms.service.AgmsFortuneService
;
import
com.yd.api.agms.vo.fortune.*
;
import
com.yd.api.agms.vo.fortune.*
;
import
com.yd.api.order.vo.SurrenderFortuneRequestVO
;
import
com.yd.api.order.vo.SurrenderFortuneRequestVO
;
...
@@ -10,6 +11,7 @@ import com.yd.api.result.CommonResult;
...
@@ -10,6 +11,7 @@ import com.yd.api.result.CommonResult;
import
com.yd.dal.entity.agms.fortune.*
;
import
com.yd.dal.entity.agms.fortune.*
;
import
com.yd.dal.entity.customer.*
;
import
com.yd.dal.entity.customer.*
;
import
com.yd.dal.entity.customer.practitioner.PractitionerSubordinateInfo
;
import
com.yd.dal.entity.customer.practitioner.PractitionerSubordinateInfo
;
import
com.yd.dal.entity.meta.MdDropOptions
;
import
com.yd.dal.entity.meta.MdIncometaxRate
;
import
com.yd.dal.entity.meta.MdIncometaxRate
;
import
com.yd.dal.entity.order.PoOrder
;
import
com.yd.dal.entity.order.PoOrder
;
import
com.yd.dal.entity.product.Product
;
import
com.yd.dal.entity.product.Product
;
...
@@ -27,6 +29,11 @@ import com.yd.util.CommonUtil;
...
@@ -27,6 +29,11 @@ import com.yd.util.CommonUtil;
import
com.yd.util.config.ZHBErrorConfig
;
import
com.yd.util.config.ZHBErrorConfig
;
import
org.apache.commons.beanutils.BeanPropertyValueEqualsPredicate
;
import
org.apache.commons.beanutils.BeanPropertyValueEqualsPredicate
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.poi.ss.usermodel.Workbook
;
import
org.apache.poi.xssf.usermodel.XSSFRow
;
import
org.apache.poi.xssf.usermodel.XSSFSheet
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -55,10 +62,12 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -55,10 +62,12 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
private
AclUserDALService
userDalService
;
private
AclUserDALService
userDalService
;
@Autowired
@Autowired
private
AclPractitionerSubordinateSystemDALService
aclPractitionerSubordinateSystemDalService
;
private
AclPractitionerSubordinateSystemDALService
aclPractitionerSubordinateSystemDalService
;
@Autowired
@Autowired
public
void
setAclCustomerFortuneDalService
(
AclCustomerFortuneDALService
customerFortuneDalService
)
{
public
void
setAclCustomerFortuneDalService
(
AclCustomerFortuneDALService
customerFortuneDalService
)
{
this
.
customerFortuneDalService
=
customerFortuneDalService
;
this
.
customerFortuneDalService
=
customerFortuneDalService
;
}
}
@Autowired
@Autowired
public
void
setAclCustomerFortuneWithdrawDalService
(
AclCustomerFortuneWithdrawDALService
customerFortuneWithdrawDalService
)
{
public
void
setAclCustomerFortuneWithdrawDalService
(
AclCustomerFortuneWithdrawDALService
customerFortuneWithdrawDalService
)
{
this
.
customerFortuneWithdrawDalService
=
customerFortuneWithdrawDalService
;
this
.
customerFortuneWithdrawDalService
=
customerFortuneWithdrawDalService
;
...
@@ -70,29 +79,30 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -70,29 +79,30 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
}
}
@Autowired
@Autowired
public
void
setAgmsFortuneDalService
(
AgmsFortuneDALService
agmsFortuneDalService
){
public
void
setAgmsFortuneDalService
(
AgmsFortuneDALService
agmsFortuneDalService
)
{
this
.
agmsFortuneDalService
=
agmsFortuneDalService
;
this
.
agmsFortuneDalService
=
agmsFortuneDalService
;
}
}
@Autowired
@Autowired
public
void
setSystemConfigService
(
SystemConfigService
systemConfigService
){
public
void
setSystemConfigService
(
SystemConfigService
systemConfigService
)
{
this
.
systemConfigService
=
systemConfigService
;
this
.
systemConfigService
=
systemConfigService
;
}
}
@Autowired
@Autowired
public
void
setAclCustomerFortunePayoutBatchDALService
(
AclCustomerFortunePayoutBatchDALService
customerFortunePayoutBatchDalService
){
public
void
setAclCustomerFortunePayoutBatchDALService
(
AclCustomerFortunePayoutBatchDALService
customerFortunePayoutBatchDalService
)
{
this
.
customerFortunePayoutBatchDalService
=
customerFortunePayoutBatchDalService
;
this
.
customerFortunePayoutBatchDalService
=
customerFortunePayoutBatchDalService
;
}
}
@Autowired
@Autowired
public
void
setAclUserDALService
(
AclUserDALService
userDalService
){
public
void
setAclUserDALService
(
AclUserDALService
userDalService
)
{
this
.
userDalService
=
userDalService
;
this
.
userDalService
=
userDalService
;
}
}
@Autowired
@Autowired
public
void
setAclCustomerFortuneStatisticDALService
(
AclCustomerFortuneStatisticDALService
customerFortuneStatisticDalService
){
public
void
setAclCustomerFortuneStatisticDALService
(
AclCustomerFortuneStatisticDALService
customerFortuneStatisticDalService
)
{
this
.
customerFortuneStatisticDalService
=
customerFortuneStatisticDalService
;
this
.
customerFortuneStatisticDalService
=
customerFortuneStatisticDalService
;
}
}
@Autowired
@Autowired
private
PoOrderDALService
poOrderDALService
;
private
PoOrderDALService
poOrderDALService
;
@Autowired
@Autowired
...
@@ -103,6 +113,8 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -103,6 +113,8 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
private
AclPolicyholderService
aclPolicyholderService
;
private
AclPolicyholderService
aclPolicyholderService
;
@Autowired
@Autowired
private
SendService
sendService
;
private
SendService
sendService
;
@Autowired
private
AclPractitionerDALService
aclPractitionerDALService
;
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
@@ -110,22 +122,20 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -110,22 +122,20 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
CommissionPayoutStatusUpdateResponseVO
responseVO
=
new
CommissionPayoutStatusUpdateResponseVO
();
CommissionPayoutStatusUpdateResponseVO
responseVO
=
new
CommissionPayoutStatusUpdateResponseVO
();
CommonResult
commonResult
=
check
(
requestVO
);
CommonResult
commonResult
=
check
(
requestVO
);
Long
[]
fortuneIds
=
requestVO
.
getFortuneIds
();
Long
[]
fortuneIds
=
requestVO
.
getFortuneIds
();
//2.
可发放
3.保留
//2.
0.作废 1.待来佣 2.可发放
3.保留
String
paymentStatus
=
requestVO
.
getPaymentStatus
();
String
paymentStatus
=
requestVO
.
getPaymentStatus
();
Long
loginId
=
requestVO
.
getLoginId
();
Long
loginId
=
requestVO
.
getLoginId
();
//查询出需修改的佣金发放状态的财富
//查询出需修改的佣金发放状态的财富
List
<
AclCustomerFortune
>
customerFortunes
=
customerFortuneDalService
.
findByIds
(
fortuneIds
);
List
<
AclCustomerFortune
>
customerFortunes
=
customerFortuneDalService
.
findByIds
(
fortuneIds
);
// List<String> commissionPayoutStatusList = new ArrayList<>();
// for (AclCustomerFortune customerFortune: customerFortunes) {
//已作废的记录不能修改状态
// commissionPayoutStatusList.add(customerFortune.getCommissionPayoutStatus());
for
(
AclCustomerFortune
customerFortune
:
customerFortunes
)
{
// }
if
(
"0"
.
equals
(
customerFortune
.
getStatus
()))
{
// if (commissionPayoutStatusList.contains("4")){
responseVO
.
setCommonResult
(
new
CommonResult
(
false
,
ZHBErrorConfig
.
getErrorInfo
(
"830039"
)));
// String message = ZHBErrorConfig.getErrorInfo("830023");
return
responseVO
;
// commonResult.setSuccess(false);
}
// commonResult.setMessage(message);
}
// responseVO.setCommonResult(commonResult);
// return responseVO;
// }
//佣金预计发放批次
//佣金预计发放批次
String
payoutBatch
=
requestVO
.
getPayoutBatch
();
String
payoutBatch
=
requestVO
.
getPayoutBatch
();
//通过payoutBatch查询此批次是否再库中,在库中直接获取id,不在进行保存,获取id
//通过payoutBatch查询此批次是否再库中,在库中直接获取id,不在进行保存,获取id
...
@@ -147,8 +157,8 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -147,8 +157,8 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
CommonResult
commonResult
=
new
CommonResult
();
CommonResult
commonResult
=
new
CommonResult
();
boolean
success
=
true
;
boolean
success
=
true
;
String
message
=
ZHBErrorConfig
.
getErrorInfo
(
"800000"
);
String
message
=
ZHBErrorConfig
.
getErrorInfo
(
"800000"
);
if
((
"2"
).
equals
(
requestVO
.
getPaymentStatus
())){
if
((
"2"
).
equals
(
requestVO
.
getPaymentStatus
()))
{
if
(
CommonUtil
.
isNullOrBlank
(
requestVO
.
getPayoutBatch
())){
if
(
CommonUtil
.
isNullOrBlank
(
requestVO
.
getPayoutBatch
()))
{
message
=
ZHBErrorConfig
.
getErrorInfo
(
"830021"
);
message
=
ZHBErrorConfig
.
getErrorInfo
(
"830021"
);
success
=
false
;
success
=
false
;
}
}
...
@@ -159,7 +169,7 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -159,7 +169,7 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
Long
[]
fortuneIds
=
requestVO
.
getFortuneIds
();
Long
[]
fortuneIds
=
requestVO
.
getFortuneIds
();
List
<
AclCustomerFortuneWithdraw
>
withdraws
=
customerFortuneWithdrawDalService
.
findByFortuneIds
(
fortuneIds
);
List
<
AclCustomerFortuneWithdraw
>
withdraws
=
customerFortuneWithdrawDalService
.
findByFortuneIds
(
fortuneIds
);
for
(
AclCustomerFortuneWithdraw
withdraw
:
withdraws
)
{
for
(
AclCustomerFortuneWithdraw
withdraw
:
withdraws
)
{
if
(
withdraw
.
getIsPaid
()
==
1
)
{
if
(
withdraw
.
getIsPaid
()
==
1
)
{
message
=
ZHBErrorConfig
.
getErrorInfo
(
"830024"
);
message
=
ZHBErrorConfig
.
getErrorInfo
(
"830024"
);
commonResult
.
setSuccess
(
false
);
commonResult
.
setSuccess
(
false
);
commonResult
.
setMessage
(
message
);
commonResult
.
setMessage
(
message
);
...
@@ -172,11 +182,11 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -172,11 +182,11 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
}
}
private
Long
findPayoutBatchIdByPayoutBatch
(
String
payoutBatch
,
Long
loginId
)
{
private
Long
findPayoutBatchIdByPayoutBatch
(
String
payoutBatch
,
Long
loginId
)
{
if
(
CommonUtil
.
isNullOrBlank
(
payoutBatch
)){
if
(
CommonUtil
.
isNullOrBlank
(
payoutBatch
))
{
return
null
;
return
null
;
}
}
AclCustomerFortunePayoutBatch
customerFortunePayoutBatch
=
customerFortunePayoutBatchDalService
.
findByPayoutYearmonth
(
payoutBatch
);
AclCustomerFortunePayoutBatch
customerFortunePayoutBatch
=
customerFortunePayoutBatchDalService
.
findByPayoutYearmonth
(
payoutBatch
);
if
(
customerFortunePayoutBatch
==
null
){
if
(
customerFortunePayoutBatch
==
null
)
{
customerFortunePayoutBatch
=
new
AclCustomerFortunePayoutBatch
();
customerFortunePayoutBatch
=
new
AclCustomerFortunePayoutBatch
();
customerFortunePayoutBatch
.
setPayoutYearmonth
(
payoutBatch
);
customerFortunePayoutBatch
.
setPayoutYearmonth
(
payoutBatch
);
customerFortunePayoutBatch
.
setCreatedBy
(
loginId
);
customerFortunePayoutBatch
.
setCreatedBy
(
loginId
);
...
@@ -189,23 +199,23 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -189,23 +199,23 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
}
}
@Override
@Override
public
void
canPaymentUpDate
(
String
paymentStatus
,
Long
payoutBatchId
,
Long
loginId
,
List
<
AclCustomerFortune
>
customerFortunes
)
{
public
void
canPaymentUpDate
(
String
paymentStatus
,
Long
payoutBatchId
,
Long
loginId
,
List
<
AclCustomerFortune
>
customerFortunes
)
{
System
.
out
.
println
(
"canPaymentUpDate"
);
System
.
out
.
println
(
"canPaymentUpDate"
);
//将查询出来的财富列表根据customerId经行分类
//将查询出来的财富列表根据customerId经行分类
Map
<
Long
,
List
<
AclCustomerFortune
>>
customerFortuneMap
=
changeCustomerFortunesByFieldName
(
customerFortunes
,
"customerId"
);
Map
<
Long
,
List
<
AclCustomerFortune
>>
customerFortuneMap
=
changeCustomerFortunesByFieldName
(
customerFortunes
,
"customerId"
);
//获得所有需要修改佣金发放状的customerIds
//获得所有需要修改佣金发放状的customerIds
Set
<
Long
>
customerIds
=
customerFortuneMap
.
keySet
();
Set
<
Long
>
customerIds
=
customerFortuneMap
.
keySet
();
//可直接修改的withdraw记录
//可直接修改的withdraw记录
Map
<
Long
,
Long
>
customerWithdrawMap
=
directModificationCustomerWithdrawMap
(
customerIds
,
payoutBatchId
);
Map
<
Long
,
Long
>
customerWithdrawMap
=
directModificationCustomerWithdrawMap
(
customerIds
,
payoutBatchId
);
//没有最后一笔提现 记录客户信息和此次提现的财富记录 customerId fortunes
//没有最后一笔提现 记录客户信息和此次提现的财富记录 customerId fortunes
Map
<
Long
,
List
<
AclCustomerFortune
>>
newCustomerWithdrawMap
=
new
HashMap
<>(
16
);
Map
<
Long
,
List
<
AclCustomerFortune
>>
newCustomerWithdrawMap
=
new
HashMap
<>(
16
);
//可直接修改的fortune记录(需修改佣金发放状态)
//可直接修改的fortune记录(需修改佣金发放状态)
List
<
AclCustomerFortune
>
fortuneUpdates
=
new
ArrayList
<>();
List
<
AclCustomerFortune
>
fortuneUpdates
=
new
ArrayList
<>();
//记录可直接修改的fortune对应的withdraw
//记录可直接修改的fortune对应的withdraw
List
<
Long
>
withdrawUpdateIds
=
new
ArrayList
<>();
List
<
Long
>
withdrawUpdateIds
=
new
ArrayList
<>();
for
(
Map
.
Entry
<
Long
,
List
<
AclCustomerFortune
>>
customerFortune:
customerFortuneMap
.
entrySet
())
{
for
(
Map
.
Entry
<
Long
,
List
<
AclCustomerFortune
>>
customerFortune
:
customerFortuneMap
.
entrySet
())
{
//获取需要修改佣金发放状态的经纪人
//获取需要修改佣金发放状态的经纪人
Long
customerId
=
customerFortune
.
getKey
();
Long
customerId
=
customerFortune
.
getKey
();
//此customer最后一笔提现记录id
//此customer最后一笔提现记录id
...
@@ -215,7 +225,7 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -215,7 +225,7 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
//获取休要修改的佣金发放状态的财富记录
//获取休要修改的佣金发放状态的财富记录
List
<
AclCustomerFortune
>
fortunes
=
customerFortune
.
getValue
();
List
<
AclCustomerFortune
>
fortunes
=
customerFortune
.
getValue
();
//判断这些财富记录中佣金发放状态和要修改的状态是否一致,如一致,则不需要修改
//判断这些财富记录中佣金发放状态和要修改的状态是否一致,如一致,则不需要修改
for
(
AclCustomerFortune
fortune
:
fortunes
)
{
for
(
AclCustomerFortune
fortune
:
fortunes
)
{
//不一致,进行修改,并保存需修改的fortune和记录需要新生成的fortune
//不一致,进行修改,并保存需修改的fortune和记录需要新生成的fortune
if
(!
paymentStatus
.
equals
(
fortune
.
getStatus
()))
{
if
(!
paymentStatus
.
equals
(
fortune
.
getStatus
()))
{
fortune
.
setCommissionPayoutStatus
(
paymentStatus
);
fortune
.
setCommissionPayoutStatus
(
paymentStatus
);
...
@@ -223,18 +233,18 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -223,18 +233,18 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
fortune
.
setCommissionPayoutBy
(
loginId
);
fortune
.
setCommissionPayoutBy
(
loginId
);
fortune
.
setCommissionPayoutAt
(
new
Date
());
fortune
.
setCommissionPayoutAt
(
new
Date
());
fortune
.
setPayoutBatchId
(
payoutBatchId
);
fortune
.
setPayoutBatchId
(
payoutBatchId
);
if
(
CommonUtil
.
isNullOrZero
(
withdrawId
)){
if
(
CommonUtil
.
isNullOrZero
(
withdrawId
))
{
//需生成新的withdraw
//需生成新的withdraw
newFortunes
.
add
(
fortune
);
newFortunes
.
add
(
fortune
);
}
else
{
}
else
{
//可直接修改fortune
//可直接修改fortune
fortune
.
setWithdrawedId
(
withdrawId
);
fortune
.
setWithdrawedId
(
withdrawId
);
fortuneUpdates
.
add
(
fortune
);
fortuneUpdates
.
add
(
fortune
);
withdrawUpdateIds
.
add
(
withdrawId
);
withdrawUpdateIds
.
add
(
withdrawId
);
}
}
}
else
{
}
else
{
//paymentStatus一致,都是可发放,判断其支付批次,是否一致,一致不需要修改,不一致需要修改两笔withdraw
//paymentStatus一致,都是可发放,判断其支付批次,是否一致,一致不需要修改,不一致需要修改两笔withdraw
if
(!
payoutBatchId
.
equals
(
fortune
.
getPayoutBatchId
())){
if
(!
payoutBatchId
.
equals
(
fortune
.
getPayoutBatchId
()))
{
//订单原来所属withdraw
//订单原来所属withdraw
withdrawUpdateIds
.
add
(
fortune
.
getWithdrawedId
());
withdrawUpdateIds
.
add
(
fortune
.
getWithdrawedId
());
fortune
.
setCommissionPayoutAt
(
new
Date
());
fortune
.
setCommissionPayoutAt
(
new
Date
());
...
@@ -242,12 +252,12 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -242,12 +252,12 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
fortune
.
setPayoutBatchId
(
payoutBatchId
);
fortune
.
setPayoutBatchId
(
payoutBatchId
);
fortune
.
setStatus
(
"2"
);
fortune
.
setStatus
(
"2"
);
fortune
.
setCommissionPayoutStatus
(
"2"
);
fortune
.
setCommissionPayoutStatus
(
"2"
);
if
(
CommonUtil
.
isNullOrZero
(
withdrawId
)){
if
(
CommonUtil
.
isNullOrZero
(
withdrawId
))
{
//需生成新的withdraw
//需生成新的withdraw
newFortunes
.
add
(
fortune
);
newFortunes
.
add
(
fortune
);
fortune
.
setWithdrawedId
(
null
);
fortune
.
setWithdrawedId
(
null
);
fortuneUpdates
.
add
(
fortune
);
fortuneUpdates
.
add
(
fortune
);
}
else
{
}
else
{
//可直接修改fortune
//可直接修改fortune
fortune
.
setWithdrawedId
(
withdrawId
);
fortune
.
setWithdrawedId
(
withdrawId
);
fortuneUpdates
.
add
(
fortune
);
fortuneUpdates
.
add
(
fortune
);
...
@@ -257,8 +267,8 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -257,8 +267,8 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
}
}
}
}
//记录客户信息和此次提现的财富记录
//记录客户信息和此次提现的财富记录
if
(!
newFortunes
.
isEmpty
()){
if
(!
newFortunes
.
isEmpty
())
{
newCustomerWithdrawMap
.
put
(
customerId
,
newFortunes
);
newCustomerWithdrawMap
.
put
(
customerId
,
newFortunes
);
}
}
}
}
...
@@ -271,26 +281,26 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -271,26 +281,26 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
}
}
//重新计算受到影响的withdraw
//重新计算受到影响的withdraw
withdrawUpdateIds
.
removeAll
(
Collections
.
singleton
(
null
));
withdrawUpdateIds
.
removeAll
(
Collections
.
singleton
(
null
));
if
(!
withdrawUpdateIds
.
isEmpty
()){
if
(!
withdrawUpdateIds
.
isEmpty
())
{
Collections
.
sort
(
withdrawUpdateIds
);
Collections
.
sort
(
withdrawUpdateIds
);
}
}
recalculateWithdraw
(
withdrawUpdateIds
,
customerIds
,
loginId
);
recalculateWithdraw
(
withdrawUpdateIds
,
customerIds
,
loginId
);
//更新生成新的提现记录,及支付记录,fortune中记录对应的withdraw.id
//更新生成新的提现记录,及支付记录,fortune中记录对应的withdraw.id
insertWithdraw
(
newCustomerWithdrawMap
,
loginId
);
insertWithdraw
(
newCustomerWithdrawMap
,
loginId
);
}
}
private
Map
<
Long
,
Long
>
directModificationCustomerWithdrawMap
(
Set
<
Long
>
customerIds
,
Long
payoutBatchId
)
{
private
Map
<
Long
,
Long
>
directModificationCustomerWithdrawMap
(
Set
<
Long
>
customerIds
,
Long
payoutBatchId
)
{
//查询这些customerId是这个批次的最后一笔未完成的提现记录(ag_acl_customer_fortune_withdraw)
//查询这些customerId是这个批次的最后一笔未完成的提现记录(ag_acl_customer_fortune_withdraw)
Map
<
Long
,
Long
>
customerWithdrawNoPayMap
=
customerFortuneWithdrawDalService
.
findFinalWithdrawNoPayByCustomerIds
(
customerIds
,
payoutBatchId
);
Map
<
Long
,
Long
>
customerWithdrawNoPayMap
=
customerFortuneWithdrawDalService
.
findFinalWithdrawNoPayByCustomerIds
(
customerIds
,
payoutBatchId
);
//查询这些customerId最后一笔已完成的提现记录(ag_acl_customer_fortune_withdraw)
//查询这些customerId最后一笔已完成的提现记录(ag_acl_customer_fortune_withdraw)
// Map<Long,Long> customerWithdrawPayMap = customerFortuneWithdrawDalService.findFinalWithdrawPayByCustomerIds(customerIds);
// Map<Long,Long> customerWithdrawPayMap = customerFortuneWithdrawDalService.findFinalWithdrawPayByCustomerIds(customerIds);
Map
<
Long
,
Long
>
customerWithdrawMap
=
new
HashMap
<>(
16
);
Map
<
Long
,
Long
>
customerWithdrawMap
=
new
HashMap
<>(
16
);
//循环未完成记录,并于已完成的记录经行比较,如果未完成的id大于已完成的,则可以直接修改withdraw;如果未完成的id小于已完成的id,则需要生成新的withdraw
//循环未完成记录,并于已完成的记录经行比较,如果未完成的id大于已完成的,则可以直接修改withdraw;如果未完成的id小于已完成的id,则需要生成新的withdraw
for
(
Map
.
Entry
<
Long
,
Long
>
customerWithdrawNoPay:
customerWithdrawNoPayMap
.
entrySet
())
{
for
(
Map
.
Entry
<
Long
,
Long
>
customerWithdrawNoPay
:
customerWithdrawNoPayMap
.
entrySet
())
{
// Long payWithdrewId = customerWithdrawPayMap.get(customerWithdrawNoPay.getKey());
// Long payWithdrewId = customerWithdrawPayMap.get(customerWithdrawNoPay.getKey());
// if (CommonUtil.isNullOrZero(payWithdrewId)){
// if (CommonUtil.isNullOrZero(payWithdrewId)){
customerWithdrawMap
.
put
(
customerWithdrawNoPay
.
getKey
(),
customerWithdrawNoPay
.
getValue
());
customerWithdrawMap
.
put
(
customerWithdrawNoPay
.
getKey
(),
customerWithdrawNoPay
.
getValue
());
continue
;
continue
;
// }
// }
// if (BigDecimal.valueOf(payWithdrewId).compareTo(BigDecimal.valueOf(customerWithdrawNoPay.getValue())) > 0){
// if (BigDecimal.valueOf(payWithdrewId).compareTo(BigDecimal.valueOf(customerWithdrawNoPay.getValue())) > 0){
// continue;
// continue;
...
@@ -300,20 +310,26 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -300,20 +310,26 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
return
customerWithdrawMap
;
return
customerWithdrawMap
;
}
}
private
void
noPaymentUpDate
(
String
paymentStatus
,
Long
payoutBatchId
,
Long
loginId
,
List
<
AclCustomerFortune
>
customerFortunes
)
{
private
void
noPaymentUpDate
(
String
paymentStatus
,
Long
payoutBatchId
,
Long
loginId
,
List
<
AclCustomerFortune
>
customerFortunes
)
{
System
.
out
.
println
(
"noPaymentUpDate"
);
System
.
out
.
println
(
"noPaymentUpDate"
);
//需要修改的fortune记录(需修改佣金发放状态)
//需要修改的fortune记录(需修改佣金发放状态)
List
<
AclCustomerFortune
>
fortuneUpdates
=
new
ArrayList
<>();
List
<
AclCustomerFortune
>
fortuneUpdates
=
new
ArrayList
<>();
//需要重新计算的withdraw.id
//需要重新计算的withdraw.id
List
<
Long
>
withdrawUpdateIds
=
new
ArrayList
<>();
List
<
Long
>
withdrawUpdateIds
=
new
ArrayList
<>();
for
(
AclCustomerFortune
fortune
:
customerFortunes
)
{
for
(
AclCustomerFortune
fortune
:
customerFortunes
)
{
//不一致,进行修改,并保存需修改的fortune和需重新计算的withdrawIds
//不一致,进行修改,并保存需修改的fortune和需重新计算的withdrawIds
if
(!
paymentStatus
.
equals
(
fortune
.
getStatus
())){
if
(!
paymentStatus
.
equals
(
fortune
.
getStatus
()))
{
fortune
.
setCommissionPayoutStatus
(
paymentStatus
);
if
(
"0"
.
equals
(
paymentStatus
))
{
fortune
.
setCommissionPayoutStatus
(
"5"
);
}
else
if
(
"1"
.
equals
(
paymentStatus
))
{
fortune
.
setCommissionPayoutStatus
(
"0"
);
}
else
{
fortune
.
setCommissionPayoutStatus
(
paymentStatus
);
}
fortune
.
setStatus
(
paymentStatus
);
fortune
.
setStatus
(
paymentStatus
);
fortune
.
setCommissionPayoutBy
(
loginId
);
fortune
.
setCommissionPayoutBy
(
loginId
);
fortune
.
setCommissionPayoutAt
(
new
Date
());
fortune
.
setCommissionPayoutAt
(
new
Date
());
if
(!
CommonUtil
.
isNullOrZero
(
payoutBatchId
)){
if
(!
CommonUtil
.
isNullOrZero
(
payoutBatchId
))
{
fortune
.
setPayoutBatchId
(
payoutBatchId
);
fortune
.
setPayoutBatchId
(
payoutBatchId
);
}
}
Long
withdrawId
=
fortune
.
getWithdrawedId
();
Long
withdrawId
=
fortune
.
getWithdrawedId
();
...
@@ -321,7 +337,7 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -321,7 +337,7 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
fortune
.
setFortunePayedId
(
null
);
fortune
.
setFortunePayedId
(
null
);
fortune
.
setFortunePayedId
(
null
);
fortune
.
setFortunePayedId
(
null
);
fortuneUpdates
.
add
(
fortune
);
fortuneUpdates
.
add
(
fortune
);
if
(!
CommonUtil
.
isNullOrZero
(
withdrawId
)){
if
(!
CommonUtil
.
isNullOrZero
(
withdrawId
))
{
withdrawUpdateIds
.
add
(
withdrawId
);
withdrawUpdateIds
.
add
(
withdrawId
);
}
}
}
}
...
@@ -329,15 +345,15 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -329,15 +345,15 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
//批量更新需要修改的fortune记录
//批量更新需要修改的fortune记录
customerFortuneDalService
.
updateBatch
(
fortuneUpdates
);
customerFortuneDalService
.
updateBatch
(
fortuneUpdates
);
//重新计算受到影响的withdraw
//重新计算受到影响的withdraw
if
(!
withdrawUpdateIds
.
isEmpty
()){
if
(!
withdrawUpdateIds
.
isEmpty
())
{
Collections
.
sort
(
withdrawUpdateIds
);
Collections
.
sort
(
withdrawUpdateIds
);
}
}
recalculateWithdraw
(
withdrawUpdateIds
,
null
,
loginId
);
recalculateWithdraw
(
withdrawUpdateIds
,
null
,
loginId
);
}
}
private
void
recalculateWithdraw
(
List
<
Long
>
withdrawUpdateIds
,
Set
<
Long
>
customerIds
,
Long
loginId
)
{
private
void
recalculateWithdraw
(
List
<
Long
>
withdrawUpdateIds
,
Set
<
Long
>
customerIds
,
Long
loginId
)
{
//重新统计提现记录
//重新统计提现记录
if
(
withdrawUpdateIds
.
isEmpty
()){
if
(
withdrawUpdateIds
.
isEmpty
())
{
return
;
return
;
}
}
System
.
out
.
println
(
"recalculateWithdraw"
);
System
.
out
.
println
(
"recalculateWithdraw"
);
...
@@ -352,20 +368,20 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -352,20 +368,20 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
// withdraws.forEach(p-> System.out.println(p.toString()));
// withdraws.forEach(p-> System.out.println(p.toString()));
//查询出修改withdraw的customerId
//查询出修改withdraw的customerId
if
(
customerIds
==
null
){
if
(
customerIds
==
null
)
{
Map
<
Long
,
List
<
AclCustomerFortune
>>
customerFortuneMap
=
changeCustomerFortunesByFieldName
(
fortunes
,
"customerId"
);
Map
<
Long
,
List
<
AclCustomerFortune
>>
customerFortuneMap
=
changeCustomerFortunesByFieldName
(
fortunes
,
"customerId"
);
customerIds
=
customerFortuneMap
.
keySet
();
customerIds
=
customerFortuneMap
.
keySet
();
}
}
//如果customerIds为null,则此次需修改的withdraw提现金额为0
//如果customerIds为null,则此次需修改的withdraw提现金额为0
if
(
customerIds
.
isEmpty
()){
if
(
customerIds
.
isEmpty
())
{
//修改withdraws/pays提现金额为0
//修改withdraws/pays提现金额为0
updateWithdrawAmountToZero
(
withdraws
,
pays
,
loginId
);
updateWithdrawAmountToZero
(
withdraws
,
pays
,
loginId
);
return
;
return
;
}
}
//查询customerIds的基本财富信息(历史累积财富 已退保财富 已提现财富 等) customerId CustomerFortuneStatisticalInfo
//查询customerIds的基本财富信息(历史累积财富 已退保财富 已提现财富 等) customerId CustomerFortuneStatisticalInfo
Map
<
Long
,
CustomerFortuneStatisticalInfo
>
customerFortuneStatisticalMap
=
agmsFortuneDalService
.
findFortuneStatisticalByCustomers
(
customerIds
);
Map
<
Long
,
CustomerFortuneStatisticalInfo
>
customerFortuneStatisticalMap
=
agmsFortuneDalService
.
findFortuneStatisticalByCustomers
(
customerIds
);
//按withdrawedId经行整理
//按withdrawedId经行整理
Map
<
Long
,
List
<
AclCustomerFortune
>>
withdrawsFortunes
=
changeCustomerFortunesByFieldName
(
fortunes
,
"withdrawedId"
);
Map
<
Long
,
List
<
AclCustomerFortune
>>
withdrawsFortunes
=
changeCustomerFortunesByFieldName
(
fortunes
,
"withdrawedId"
);
for
(
AclCustomerFortuneWithdraw
withdraw
:
withdraws
)
{
for
(
AclCustomerFortuneWithdraw
withdraw
:
withdraws
)
{
//withdrawId
//withdrawId
Long
withdrawId
=
withdraw
.
getId
();
Long
withdrawId
=
withdraw
.
getId
();
...
@@ -430,8 +446,8 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -430,8 +446,8 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
customerFortuneDalService
.
updateBatch
(
fortuneUpdates
);
customerFortuneDalService
.
updateBatch
(
fortuneUpdates
);
}
}
private
void
updateWithdrawAmountToZero
(
List
<
AclCustomerFortuneWithdraw
>
withdraws
,
List
<
AclCustomerFortunePay
>
pays
,
Long
loginId
)
{
private
void
updateWithdrawAmountToZero
(
List
<
AclCustomerFortuneWithdraw
>
withdraws
,
List
<
AclCustomerFortunePay
>
pays
,
Long
loginId
)
{
withdraws
.
forEach
(
w
->
{
withdraws
.
forEach
(
w
->
{
w
.
setWithdrawAmount
(
BigDecimal
.
ZERO
);
w
.
setWithdrawAmount
(
BigDecimal
.
ZERO
);
w
.
setWithdrawAfterAmount
(
w
.
getWithdrawBeforeAmount
());
w
.
setWithdrawAfterAmount
(
w
.
getWithdrawBeforeAmount
());
w
.
setCreatedAt
(
new
Date
());
w
.
setCreatedAt
(
new
Date
());
...
@@ -439,7 +455,7 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -439,7 +455,7 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
w
.
setTaxAmount
(
BigDecimal
.
ZERO
);
w
.
setTaxAmount
(
BigDecimal
.
ZERO
);
w
.
setPaidAmount
(
BigDecimal
.
ZERO
);
w
.
setPaidAmount
(
BigDecimal
.
ZERO
);
});
});
pays
.
forEach
(
pay
->
{
pays
.
forEach
(
pay
->
{
pay
.
setWithdrawAmount
(
BigDecimal
.
ZERO
);
pay
.
setWithdrawAmount
(
BigDecimal
.
ZERO
);
pay
.
setPayAmount
(
BigDecimal
.
ZERO
);
pay
.
setPayAmount
(
BigDecimal
.
ZERO
);
pay
.
setTaxAmount
(
BigDecimal
.
ZERO
);
pay
.
setTaxAmount
(
BigDecimal
.
ZERO
);
...
@@ -452,8 +468,8 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -452,8 +468,8 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
customerFortunePayDalService
.
updateAll
(
pays
);
customerFortunePayDalService
.
updateAll
(
pays
);
}
}
private
void
insertWithdraw
(
Map
<
Long
,
List
<
AclCustomerFortune
>>
newCustomerWithdrawMap
,
Long
loginId
)
{
private
void
insertWithdraw
(
Map
<
Long
,
List
<
AclCustomerFortune
>>
newCustomerWithdrawMap
,
Long
loginId
)
{
if
(
newCustomerWithdrawMap
.
isEmpty
()){
if
(
newCustomerWithdrawMap
.
isEmpty
())
{
return
;
return
;
}
}
System
.
out
.
println
(
"insertWithdraw"
);
System
.
out
.
println
(
"insertWithdraw"
);
...
@@ -461,8 +477,8 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -461,8 +477,8 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
List
<
AclCustomerFortune
>
fortuneList
=
new
ArrayList
<>();
List
<
AclCustomerFortune
>
fortuneList
=
new
ArrayList
<>();
//查询customerIds的基本财富信息(历史累积财富 已退保财富 已提现财富 等) customerId CustomerFortuneStatisticalInfo
//查询customerIds的基本财富信息(历史累积财富 已退保财富 已提现财富 等) customerId CustomerFortuneStatisticalInfo
Map
<
Long
,
CustomerFortuneStatisticalInfo
>
customerFortuneStatisticalMap
=
agmsFortuneDalService
.
findFortuneStatisticalByCustomers
(
newCustomerWithdrawMap
.
keySet
());
Map
<
Long
,
CustomerFortuneStatisticalInfo
>
customerFortuneStatisticalMap
=
agmsFortuneDalService
.
findFortuneStatisticalByCustomers
(
newCustomerWithdrawMap
.
keySet
());
for
(
Map
.
Entry
<
Long
,
List
<
AclCustomerFortune
>>
customerWithdraw
:
newCustomerWithdrawMap
.
entrySet
())
{
for
(
Map
.
Entry
<
Long
,
List
<
AclCustomerFortune
>>
customerWithdraw
:
newCustomerWithdrawMap
.
entrySet
())
{
Long
customerId
=
customerWithdraw
.
getKey
();
Long
customerId
=
customerWithdraw
.
getKey
();
List
<
AclCustomerFortune
>
fortunes
=
customerWithdraw
.
getValue
();
List
<
AclCustomerFortune
>
fortunes
=
customerWithdraw
.
getValue
();
//基本财富信息(历史累积财富 已退保财富 已提现财富 等)
//基本财富信息(历史累积财富 已退保财富 已提现财富 等)
...
@@ -478,7 +494,7 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -478,7 +494,7 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
BigDecimal
withdrawAfterAmount
=
withdrawBeforeAmount
.
subtract
(
withdrawAmount
);
BigDecimal
withdrawAfterAmount
=
withdrawBeforeAmount
.
subtract
(
withdrawAmount
);
//重新计算税额
//重新计算税额
BigDecimal
yearDrawnFortune
=
customerFortuneStatisticalInfo
.
getYearDrawnFortune
();
BigDecimal
yearDrawnFortune
=
customerFortuneStatisticalInfo
.
getYearDrawnFortune
();
BigDecimal
taxAmount
=
calcuPersonalTax
(
withdrawAmount
,
yearDrawnFortune
);
BigDecimal
taxAmount
=
calcuPersonalTax
(
withdrawAmount
,
yearDrawnFortune
);
//可提现金额
//可提现金额
BigDecimal
paidAmount
=
withdrawAmount
.
subtract
(
taxAmount
);
BigDecimal
paidAmount
=
withdrawAmount
.
subtract
(
taxAmount
);
//保存withdraw记录
//保存withdraw记录
...
@@ -493,7 +509,7 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -493,7 +509,7 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
withdraw
.
setRequestorName
(
customerFortuneStatisticalInfo
.
getCustomerName
());
withdraw
.
setRequestorName
(
customerFortuneStatisticalInfo
.
getCustomerName
());
withdraw
.
setRequestorIdTypeId
(
customerFortuneStatisticalInfo
.
getCustomerIdTypeId
());
withdraw
.
setRequestorIdTypeId
(
customerFortuneStatisticalInfo
.
getCustomerIdTypeId
());
withdraw
.
setRequestorId
(
customerFortuneStatisticalInfo
.
getCustomerIdNo
());
withdraw
.
setRequestorId
(
customerFortuneStatisticalInfo
.
getCustomerIdNo
());
withdraw
.
setRequestorBirthdate
(
CommonUtil
.
stringParseDate
(
"yyyy-MM-dd"
,
customerFortuneStatisticalInfo
.
getCustomerBirthdate
()));
withdraw
.
setRequestorBirthdate
(
CommonUtil
.
stringParseDate
(
"yyyy-MM-dd"
,
customerFortuneStatisticalInfo
.
getCustomerBirthdate
()));
withdraw
.
setRequestorGender
(
customerFortuneStatisticalInfo
.
getCustomerGender
());
withdraw
.
setRequestorGender
(
customerFortuneStatisticalInfo
.
getCustomerGender
());
withdraw
.
setStatus
(
0
);
withdraw
.
setStatus
(
0
);
withdraw
.
setCreatedAt
(
new
Date
());
withdraw
.
setCreatedAt
(
new
Date
());
...
@@ -531,7 +547,7 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -531,7 +547,7 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
//drawnFortune为此次提现额
//drawnFortune为此次提现额
//yearDrawnFortune今年已提现费用
//yearDrawnFortune今年已提现费用
//计算今年已交税额
//计算今年已交税额
if
(!
CommonUtil
.
isNullOrZero
(
yearDrawnFortune
)){
if
(!
CommonUtil
.
isNullOrZero
(
yearDrawnFortune
))
{
yearDrawnFortune
=
BigDecimal
.
ZERO
;
yearDrawnFortune
=
BigDecimal
.
ZERO
;
}
}
BigDecimal
yearTax
=
calculateTax
(
yearDrawnFortune
);
BigDecimal
yearTax
=
calculateTax
(
yearDrawnFortune
);
...
@@ -540,19 +556,19 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -540,19 +556,19 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
BigDecimal
tax
=
calculateTax
(
amount
);
BigDecimal
tax
=
calculateTax
(
amount
);
//总税额减去已交税额
//总税额减去已交税额
tax
=
tax
.
subtract
(
yearTax
);
tax
=
tax
.
subtract
(
yearTax
);
return
tax
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
return
tax
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
}
}
private
BigDecimal
calculateTax
(
BigDecimal
yearTax
)
{
private
BigDecimal
calculateTax
(
BigDecimal
yearTax
)
{
List
<
MdIncometaxRate
>
incometaxs
=
systemConfigService
.
findIncometax
();
List
<
MdIncometaxRate
>
incometaxs
=
systemConfigService
.
findIncometax
();
//累计提现金额 /1.06* (1-20%)*(1-25%) = 应纳税所得额
//累计提现金额 /1.06* (1-20%)*(1-25%) = 应纳税所得额
yearTax
=
yearTax
.
divide
(
BigDecimal
.
valueOf
(
1.06
),
3
,
BigDecimal
.
ROUND_HALF_UP
).
multiply
(
BigDecimal
.
valueOf
(
0.6
));
yearTax
=
yearTax
.
divide
(
BigDecimal
.
valueOf
(
1.06
),
3
,
BigDecimal
.
ROUND_HALF_UP
).
multiply
(
BigDecimal
.
valueOf
(
0.6
));
for
(
MdIncometaxRate
incometax
:
incometaxs
)
{
for
(
MdIncometaxRate
incometax
:
incometaxs
)
{
if
(
incometax
.
getTaxableFrom
().
compareTo
(
yearTax
)
<=
0
&&
yearTax
.
compareTo
(
incometax
.
getTaxableTo
())
<
0
)
{
if
(
incometax
.
getTaxableFrom
().
compareTo
(
yearTax
)
<=
0
&&
yearTax
.
compareTo
(
incometax
.
getTaxableTo
())
<
0
)
{
//已交税额
//已交税额
yearTax
=
yearTax
.
multiply
(
BigDecimal
.
valueOf
(
incometax
.
getTaxRate
()))
yearTax
=
yearTax
.
multiply
(
BigDecimal
.
valueOf
(
incometax
.
getTaxRate
()))
.
divide
(
BigDecimal
.
valueOf
(
100
),
3
,
BigDecimal
.
ROUND_HALF_UP
)
.
divide
(
BigDecimal
.
valueOf
(
100
),
3
,
BigDecimal
.
ROUND_HALF_UP
)
.
subtract
(
incometax
.
getEstDeductable
());
.
subtract
(
incometax
.
getEstDeductable
());
break
;
break
;
}
}
...
@@ -562,19 +578,20 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -562,19 +578,20 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
/**
/**
* 根据name(字段名整理fortune记录)
* 根据name(字段名整理fortune记录)
* @param customerFortunes 未整理的fortune记录
*
* @param fieldName 根据哪个字段名整理
* @param customerFortunes 未整理的fortune记录
* @return 整理后的fortune
* @param fieldName 根据哪个字段名整理
* @return 整理后的fortune
*/
*/
private
Map
<
Long
,
List
<
AclCustomerFortune
>>
changeCustomerFortunesByFieldName
(
List
<
AclCustomerFortune
>
customerFortunes
,
String
fieldName
)
{
private
Map
<
Long
,
List
<
AclCustomerFortune
>>
changeCustomerFortunesByFieldName
(
List
<
AclCustomerFortune
>
customerFortunes
,
String
fieldName
)
{
Map
<
Long
,
List
<
AclCustomerFortune
>>
map
=
new
HashMap
<>(
16
);
Map
<
Long
,
List
<
AclCustomerFortune
>>
map
=
new
HashMap
<>(
16
);
for
(
AclCustomerFortune
list:
customerFortunes
)
{
for
(
AclCustomerFortune
list
:
customerFortunes
)
{
List
<
AclCustomerFortune
>
customerFortuneList
=
map
.
get
(
getFieldValueByName
(
fieldName
,
list
));
List
<
AclCustomerFortune
>
customerFortuneList
=
map
.
get
(
getFieldValueByName
(
fieldName
,
list
));
customerFortuneList
=
Optional
.
ofNullable
(
customerFortuneList
).
orElse
(
new
ArrayList
<>());
customerFortuneList
=
Optional
.
ofNullable
(
customerFortuneList
).
orElse
(
new
ArrayList
<>());
if
(
customerFortuneList
.
isEmpty
()){
if
(
customerFortuneList
.
isEmpty
())
{
customerFortuneList
.
add
(
list
);
customerFortuneList
.
add
(
list
);
map
.
put
(
getFieldValueByName
(
fieldName
,
list
),
customerFortuneList
);
map
.
put
(
getFieldValueByName
(
fieldName
,
list
),
customerFortuneList
);
}
else
{
}
else
{
customerFortuneList
.
add
(
list
);
customerFortuneList
.
add
(
list
);
}
}
}
}
...
@@ -583,13 +600,13 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -583,13 +600,13 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
/**
/**
* 根据属性名获取属性值
* 根据属性名获取属性值
*
*
/
*/
private
Long
getFieldValueByName
(
String
fieldName
,
Object
o
)
{
private
Long
getFieldValueByName
(
String
fieldName
,
Object
o
)
{
try
{
try
{
String
firstLetter
=
fieldName
.
substring
(
0
,
1
).
toUpperCase
();
String
firstLetter
=
fieldName
.
substring
(
0
,
1
).
toUpperCase
();
String
getter
=
"get"
+
firstLetter
+
fieldName
.
substring
(
1
);
String
getter
=
"get"
+
firstLetter
+
fieldName
.
substring
(
1
);
Method
method
=
o
.
getClass
().
getMethod
(
getter
);
Method
method
=
o
.
getClass
().
getMethod
(
getter
);
return
(
Long
)
method
.
invoke
(
o
,
new
Object
[]
{});
return
(
Long
)
method
.
invoke
(
o
,
new
Object
[]{});
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
return
null
;
return
null
;
}
}
...
@@ -597,13 +614,13 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -597,13 +614,13 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
@Override
@Override
public
CommissionPayoutStatusQueryResponseVO
commissionPayoutStatusQuery
(
CommissionPayoutStatusQueryRequestVO
requestVO
){
public
CommissionPayoutStatusQueryResponseVO
commissionPayoutStatusQuery
(
CommissionPayoutStatusQueryRequestVO
requestVO
)
{
CommissionPayoutStatusQueryResponseVO
responseVO
=
new
CommissionPayoutStatusQueryResponseVO
();
CommissionPayoutStatusQueryResponseVO
responseVO
=
new
CommissionPayoutStatusQueryResponseVO
();
CommissionPayoutStatusQueryInfo
info
=
new
CommissionPayoutStatusQueryInfo
();
CommissionPayoutStatusQueryInfo
info
=
new
CommissionPayoutStatusQueryInfo
();
BeanUtils
.
copyProperties
(
requestVO
,
info
);
BeanUtils
.
copyProperties
(
requestVO
,
info
);
//体系查询调整,如果体系为S3,则需要查询它下面的所有子集
//体系查询调整,如果体系为S3,则需要查询它下面的所有子集
PractitionerSubordinateInfo
practitionerSubordinateInfo
=
new
PractitionerSubordinateInfo
();
PractitionerSubordinateInfo
practitionerSubordinateInfo
=
new
PractitionerSubordinateInfo
();
BeanUtils
.
copyProperties
(
requestVO
,
practitionerSubordinateInfo
);
BeanUtils
.
copyProperties
(
requestVO
,
practitionerSubordinateInfo
);
practitionerSubordinateInfo
.
setDeptId
(
requestVO
.
getInsurerBranchDeptId
());
practitionerSubordinateInfo
.
setDeptId
(
requestVO
.
getInsurerBranchDeptId
());
List
<
Long
>
subsystemIdList
=
aclPractitionerSubordinateSystemDalService
.
getLongs
(
practitionerSubordinateInfo
);
List
<
Long
>
subsystemIdList
=
aclPractitionerSubordinateSystemDalService
.
getLongs
(
practitionerSubordinateInfo
);
info
.
setSubsystemIdList
(
subsystemIdList
);
info
.
setSubsystemIdList
(
subsystemIdList
);
...
@@ -619,13 +636,13 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -619,13 +636,13 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
Long
orderId
=
commissionPayoutStatus
.
getOrderId
();
Long
orderId
=
commissionPayoutStatus
.
getOrderId
();
totalReferralAmount
=
totalReferralAmount
.
add
(
commissionPayoutStatus
.
getReferralAmount
()
==
null
?
BigDecimal
.
ZERO
:
commissionPayoutStatus
.
getReferralAmount
());
totalReferralAmount
=
totalReferralAmount
.
add
(
commissionPayoutStatus
.
getReferralAmount
()
==
null
?
BigDecimal
.
ZERO
:
commissionPayoutStatus
.
getReferralAmount
());
if
(
orderId
!=
null
)
{
if
(
orderId
!=
null
)
{
if
(
orderIdList
.
contains
(
orderId
))
{
if
(
orderIdList
.
contains
(
orderId
))
{
continue
;
continue
;
}
}
orderIdList
.
add
(
orderId
);
orderIdList
.
add
(
orderId
);
++
totalSingular
;
++
totalSingular
;
totalOrderPrice
=
totalOrderPrice
.
add
(
commissionPayoutStatus
.
getOrderPrice
()
==
null
?
BigDecimal
.
ZERO
:
commissionPayoutStatus
.
getOrderPrice
());
totalOrderPrice
=
totalOrderPrice
.
add
(
commissionPayoutStatus
.
getOrderPrice
()
==
null
?
BigDecimal
.
ZERO
:
commissionPayoutStatus
.
getOrderPrice
());
}
}
}
}
responseVO
.
setLifePractitionerCount
(
nameSet
.
size
());
responseVO
.
setLifePractitionerCount
(
nameSet
.
size
());
...
@@ -657,13 +674,13 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -657,13 +674,13 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
}
}
@Override
@Override
public
WithdrawQueryResponseVO
withdrawQuery
(
WithdrawQueryRequestVO
requestVO
){
public
WithdrawQueryResponseVO
withdrawQuery
(
WithdrawQueryRequestVO
requestVO
)
{
WithdrawQueryResponseVO
responseVO
=
new
WithdrawQueryResponseVO
();
WithdrawQueryResponseVO
responseVO
=
new
WithdrawQueryResponseVO
();
WithdrawQueryInfo
info
=
new
WithdrawQueryInfo
();
WithdrawQueryInfo
info
=
new
WithdrawQueryInfo
();
BeanUtils
.
copyProperties
(
requestVO
,
info
);
BeanUtils
.
copyProperties
(
requestVO
,
info
);
//体系查询调整,如果体系为S3,则需要查询它下面的所有子集
//体系查询调整,如果体系为S3,则需要查询它下面的所有子集
PractitionerSubordinateInfo
practitionerSubordinateInfo
=
new
PractitionerSubordinateInfo
();
PractitionerSubordinateInfo
practitionerSubordinateInfo
=
new
PractitionerSubordinateInfo
();
BeanUtils
.
copyProperties
(
requestVO
,
practitionerSubordinateInfo
);
BeanUtils
.
copyProperties
(
requestVO
,
practitionerSubordinateInfo
);
practitionerSubordinateInfo
.
setDeptId
(
requestVO
.
getInsurerBranchDeptId
());
practitionerSubordinateInfo
.
setDeptId
(
requestVO
.
getInsurerBranchDeptId
());
List
<
Long
>
subsystemIdList
=
aclPractitionerSubordinateSystemDalService
.
getLongs
(
practitionerSubordinateInfo
);
List
<
Long
>
subsystemIdList
=
aclPractitionerSubordinateSystemDalService
.
getLongs
(
practitionerSubordinateInfo
);
info
.
setSubsystemIdList
(
subsystemIdList
);
info
.
setSubsystemIdList
(
subsystemIdList
);
...
@@ -672,9 +689,9 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -672,9 +689,9 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
responseVO
.
setTotalPeople
(
withdraws
.
size
());
responseVO
.
setTotalPeople
(
withdraws
.
size
());
BigDecimal
totalReferralAmount
=
withdraws
.
stream
()
BigDecimal
totalReferralAmount
=
withdraws
.
stream
()
.
map
(
f
->
f
.
getReferralAmount
()
==
null
?
BigDecimal
.
ZERO
:
f
.
getReferralAmount
())
.
map
(
f
->
f
.
getReferralAmount
()
==
null
?
BigDecimal
.
ZERO
:
f
.
getReferralAmount
())
.
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
.
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
responseVO
.
setTotalReferralAmount
(
totalReferralAmount
);
responseVO
.
setTotalReferralAmount
(
totalReferralAmount
);
responseVO
.
setCommonResult
(
new
CommonResult
(
true
,
ZHBErrorConfig
.
getErrorInfo
(
"800000"
)));
responseVO
.
setCommonResult
(
new
CommonResult
(
true
,
ZHBErrorConfig
.
getErrorInfo
(
"800000"
)));
responseVO
.
setWithdraws
(
withdraws
);
responseVO
.
setWithdraws
(
withdraws
);
return
responseVO
;
return
responseVO
;
}
}
...
@@ -687,10 +704,10 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -687,10 +704,10 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
List
<
FortunePayToOrderInfo
>
fortunePayToOrderInfos
=
agmsFortuneDalService
.
fortunePayToOrder
(
new
Long
[]{
payId
});
List
<
FortunePayToOrderInfo
>
fortunePayToOrderInfos
=
agmsFortuneDalService
.
fortunePayToOrder
(
new
Long
[]{
payId
});
BigDecimal
totalOrderPrice
=
fortunePayToOrderInfos
.
stream
()
BigDecimal
totalOrderPrice
=
fortunePayToOrderInfos
.
stream
()
.
map
(
f
->
f
.
getOrderPrice
()
==
null
?
BigDecimal
.
ZERO
:
f
.
getOrderPrice
())
.
map
(
f
->
f
.
getOrderPrice
()
==
null
?
BigDecimal
.
ZERO
:
f
.
getOrderPrice
())
.
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
.
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
BigDecimal
totalReferralAmount
=
fortunePayToOrderInfos
.
stream
()
BigDecimal
totalReferralAmount
=
fortunePayToOrderInfos
.
stream
()
.
map
(
f
->
f
.
getReferralAmount
()
==
null
?
BigDecimal
.
ZERO
:
f
.
getReferralAmount
())
.
map
(
f
->
f
.
getReferralAmount
()
==
null
?
BigDecimal
.
ZERO
:
f
.
getReferralAmount
())
.
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
.
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
responseVO
.
setTotalSingular
(
fortunePayToOrderInfos
.
size
());
responseVO
.
setTotalSingular
(
fortunePayToOrderInfos
.
size
());
responseVO
.
setTotalOrderPrice
(
totalOrderPrice
);
responseVO
.
setTotalOrderPrice
(
totalOrderPrice
);
responseVO
.
setTotalReferralAmount
(
totalReferralAmount
);
responseVO
.
setTotalReferralAmount
(
totalReferralAmount
);
...
@@ -711,34 +728,34 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -711,34 +728,34 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
//查询所有pay记录和withdraw记录
//查询所有pay记录和withdraw记录
List
<
AclCustomerFortunePay
>
customerFortunePays
=
customerFortunePayDalService
.
findByIds
(
payIds
);
List
<
AclCustomerFortunePay
>
customerFortunePays
=
customerFortunePayDalService
.
findByIds
(
payIds
);
Long
[]
withdrawIds
=
new
Long
[
customerFortunePays
.
size
()];
Long
[]
withdrawIds
=
new
Long
[
customerFortunePays
.
size
()];
for
(
int
i
=
0
;
i
<
customerFortunePays
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
customerFortunePays
.
size
();
i
++)
{
withdrawIds
[
i
]
=
customerFortunePays
.
get
(
i
).
getWithdrawId
();
withdrawIds
[
i
]
=
customerFortunePays
.
get
(
i
).
getWithdrawId
();
}
}
List
<
AclCustomerFortuneWithdraw
>
customerFortuneWithdraws
=
customerFortuneWithdrawDalService
.
findByIds
(
Arrays
.
asList
(
withdrawIds
));
List
<
AclCustomerFortuneWithdraw
>
customerFortuneWithdraws
=
customerFortuneWithdrawDalService
.
findByIds
(
Arrays
.
asList
(
withdrawIds
));
//查询经纪人的静态记录
//查询经纪人的静态记录
Long
[]
customerIds
=
new
Long
[
customerFortunePays
.
size
()];
Long
[]
customerIds
=
new
Long
[
customerFortunePays
.
size
()];
for
(
int
i
=
0
;
i
<
customerFortunePays
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
customerFortunePays
.
size
();
i
++)
{
customerIds
[
i
]
=
customerFortunePays
.
get
(
i
).
getCustomerId
();
customerIds
[
i
]
=
customerFortunePays
.
get
(
i
).
getCustomerId
();
}
}
List
<
AclCustomerFortuneStatistic
>
customerFortuneStatistics
=
customerFortuneStatisticDalService
.
findByCustomerIds
(
customerIds
);
List
<
AclCustomerFortuneStatistic
>
customerFortuneStatistics
=
customerFortuneStatisticDalService
.
findByCustomerIds
(
customerIds
);
//fortune记录
//fortune记录
List
<
AclCustomerFortune
>
fortunes
=
customerFortuneDalService
.
findByWithdrawIds
(
Arrays
.
asList
(
withdrawIds
));
List
<
AclCustomerFortune
>
fortunes
=
customerFortuneDalService
.
findByWithdrawIds
(
Arrays
.
asList
(
withdrawIds
));
//更新静态表
//更新静态表
for
(
AclCustomerFortuneStatistic
statistic
:
customerFortuneStatistics
)
{
for
(
AclCustomerFortuneStatistic
statistic
:
customerFortuneStatistics
)
{
Long
customerId
=
statistic
.
getCustomerId
();
Long
customerId
=
statistic
.
getCustomerId
();
BeanPropertyValueEqualsPredicate
predicateClause
=
new
BeanPropertyValueEqualsPredicate
(
"customerId"
,
customerId
);
BeanPropertyValueEqualsPredicate
predicateClause
=
new
BeanPropertyValueEqualsPredicate
(
"customerId"
,
customerId
);
List
<
AclCustomerFortuneWithdraw
>
withdraws
=
(
List
<
AclCustomerFortuneWithdraw
>)
CollectionUtils
.
select
(
customerFortuneWithdraws
,
predicateClause
);
List
<
AclCustomerFortuneWithdraw
>
withdraws
=
(
List
<
AclCustomerFortuneWithdraw
>)
CollectionUtils
.
select
(
customerFortuneWithdraws
,
predicateClause
);
if
(
withdraws
.
isEmpty
()){
if
(
withdraws
.
isEmpty
())
{
continue
;
continue
;
}
}
for
(
AclCustomerFortuneWithdraw
withdraw:
withdraws
)
{
for
(
AclCustomerFortuneWithdraw
withdraw
:
withdraws
)
{
// if (CommonUtil.isNullOrZero(withdraw.getIsPaid())){
// if (CommonUtil.isNullOrZero(withdraw.getIsPaid())){
BigDecimal
drawnFortune
=
statistic
.
getDrawnFortune
();
BigDecimal
drawnFortune
=
statistic
.
getDrawnFortune
();
if
(
CommonUtil
.
isNullOrZero
(
drawnFortune
))
{
if
(
CommonUtil
.
isNullOrZero
(
drawnFortune
))
{
drawnFortune
=
BigDecimal
.
ZERO
;
drawnFortune
=
BigDecimal
.
ZERO
;
}
}
drawnFortune
=
drawnFortune
.
add
(
withdraw
.
getWithdrawAmount
());
drawnFortune
=
drawnFortune
.
add
(
withdraw
.
getWithdrawAmount
());
statistic
.
setDrawnFortune
(
drawnFortune
);
statistic
.
setDrawnFortune
(
drawnFortune
);
// }
// }
}
}
}
}
...
@@ -774,7 +791,7 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -774,7 +791,7 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
boolean
success
=
true
;
boolean
success
=
true
;
String
message
=
ZHBErrorConfig
.
getErrorInfo
(
"800000"
);
String
message
=
ZHBErrorConfig
.
getErrorInfo
(
"800000"
);
Long
[]
payIds
=
requestVO
.
getPayIds
();
Long
[]
payIds
=
requestVO
.
getPayIds
();
if
(
payIds
==
null
||
payIds
.
length
==
0
){
if
(
payIds
==
null
||
payIds
.
length
==
0
)
{
success
=
false
;
success
=
false
;
message
=
ZHBErrorConfig
.
getErrorInfo
(
"830022"
);
message
=
ZHBErrorConfig
.
getErrorInfo
(
"830022"
);
}
}
...
@@ -791,9 +808,9 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -791,9 +808,9 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
Long
orderId
=
requestVO
.
getOrderId
();
Long
orderId
=
requestVO
.
getOrderId
();
//判断此订单是否可以退保
//判断此订单是否可以退保
//保单财富以进行提现申请,无法进行退保
//保单财富以进行提现申请,无法进行退保
PoOrder
poOrder
=
poOrderDALService
.
findByIdAndStatus
(
orderId
,
3
);
PoOrder
poOrder
=
poOrderDALService
.
findByIdAndStatus
(
orderId
,
3
);
if
(
poOrder
==
null
)
{
if
(
poOrder
==
null
)
{
resp
.
setCommonResult
(
new
CommonResult
(
false
,
ZHBErrorConfig
.
getErrorInfo
(
"830065"
)));
resp
.
setCommonResult
(
new
CommonResult
(
false
,
ZHBErrorConfig
.
getErrorInfo
(
"830065"
)));
return
resp
;
return
resp
;
}
}
...
@@ -803,11 +820,11 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -803,11 +820,11 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
//财富此订单对应的财富
//财富此订单对应的财富
List
<
AclCustomerFortune
>
fortunes
=
customerFortuneDalService
.
findByOrderId
(
orderId
);
List
<
AclCustomerFortune
>
fortunes
=
customerFortuneDalService
.
findByOrderId
(
orderId
);
for
(
AclCustomerFortune
fortune
:
fortunes
){
for
(
AclCustomerFortune
fortune
:
fortunes
)
{
//查询财富对应的customer的statistic
//查询财富对应的customer的statistic
AclCustomerFortuneStatistic
statistic
=
customerFortuneStatisticDalService
.
findByCustomerId
(
fortune
.
getCustomerId
());
AclCustomerFortuneStatistic
statistic
=
customerFortuneStatisticDalService
.
findByCustomerId
(
fortune
.
getCustomerId
());
BigDecimal
cancelledFortune
=
statistic
.
getCancelledFortune
();
BigDecimal
cancelledFortune
=
statistic
.
getCancelledFortune
();
if
(
CommonUtil
.
isNullOrZero
(
cancelledFortune
)){
if
(
CommonUtil
.
isNullOrZero
(
cancelledFortune
))
{
cancelledFortune
=
BigDecimal
.
ZERO
;
cancelledFortune
=
BigDecimal
.
ZERO
;
}
}
cancelledFortune
=
cancelledFortune
cancelledFortune
=
cancelledFortune
...
@@ -817,7 +834,7 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -817,7 +834,7 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
//生成对应的负向记录 (commission_amount/fyc_amount/referral_amount)
//生成对应的负向记录 (commission_amount/fyc_amount/referral_amount)
AclCustomerFortune
fortuneNew
=
new
AclCustomerFortune
();
AclCustomerFortune
fortuneNew
=
new
AclCustomerFortune
();
org
.
springframework
.
beans
.
BeanUtils
.
copyProperties
(
fortune
,
fortuneNew
);
org
.
springframework
.
beans
.
BeanUtils
.
copyProperties
(
fortune
,
fortuneNew
);
Double
commissionAmount
=
-
fortune
.
getCommissionAmount
().
doubleValue
();
Double
commissionAmount
=
-
fortune
.
getCommissionAmount
().
doubleValue
();
fortuneNew
.
setCommissionAmount
(
BigDecimal
.
valueOf
(
commissionAmount
));
fortuneNew
.
setCommissionAmount
(
BigDecimal
.
valueOf
(
commissionAmount
));
...
@@ -842,11 +859,11 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -842,11 +859,11 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
PoOrder
order
=
poOrderDALService
.
findByOrderId
(
orderId
);
PoOrder
order
=
poOrderDALService
.
findByOrderId
(
orderId
);
Integer
configLevel
=
order
.
getConfigLevel
();
Integer
configLevel
=
order
.
getConfigLevel
();
String
name
=
""
;
String
name
=
""
;
if
(
configLevel
==
2
)
{
if
(
configLevel
==
2
)
{
Long
productId
=
order
.
getProductId
();
Long
productId
=
order
.
getProductId
();
Product
product
=
productDALService
.
findById
(
productId
);
Product
product
=
productDALService
.
findById
(
productId
);
name
=
product
.
getName
();
name
=
product
.
getName
();
}
else
if
(
configLevel
==
3
)
{
}
else
if
(
configLevel
==
3
)
{
Long
planId
=
order
.
getPlanId
();
Long
planId
=
order
.
getPlanId
();
ProductPlan
productPlan
=
productPlanDALService
.
findById
(
planId
);
ProductPlan
productPlan
=
productPlanDALService
.
findById
(
planId
);
name
=
productPlan
.
getName
();
name
=
productPlan
.
getName
();
...
@@ -854,15 +871,15 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -854,15 +871,15 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
String
messageText
=
"订单id:"
+
order
.
getId
()
+
"<br>"
+
String
messageText
=
"订单id:"
+
order
.
getId
()
+
"<br>"
+
"订单号:"
+
order
.
getOrderNo
()
+
"<br>"
+
"订单号:"
+
order
.
getOrderNo
()
+
"<br>"
+
"产品名称:"
+
name
+
"<br>"
+
"产品名称:"
+
name
+
"<br>"
+
"产品金额:"
+
order
.
getOrderPrice
()
+
"<br>"
;
"产品金额:"
+
order
.
getOrderPrice
()
+
"<br>"
;
List
<
AclPolicyholder
>
policyHolders
=
aclPolicyholderService
.
findByOrderId
(
orderId
);
List
<
AclPolicyholder
>
policyHolders
=
aclPolicyholderService
.
findByOrderId
(
orderId
);
for
(
AclPolicyholder
policyHolder
:
policyHolders
)
{
for
(
AclPolicyholder
policyHolder
:
policyHolders
)
{
Integer
type
=
policyHolder
.
getType
();
Integer
type
=
policyHolder
.
getType
();
if
(
type
==
2
){
if
(
type
==
2
)
{
messageText
+=
"投标人:<br>"
+
messageText
+=
"投标人:<br>"
+
" 姓名:"
+
policyHolder
.
getName
()
+
" 姓名:"
+
policyHolder
.
getName
()
+
" 电话"
+
policyHolder
.
getMobileNo
()
+
"<br>"
;
" 电话"
+
policyHolder
.
getMobileNo
()
+
"<br>"
;
}
else
if
(
type
==
3
)
{
}
else
if
(
type
==
3
)
{
messageText
+=
"被保人:<br>"
+
messageText
+=
"被保人:<br>"
+
" 姓名:"
+
policyHolder
.
getName
();
" 姓名:"
+
policyHolder
.
getName
();
if
(!
CommonUtil
.
isNullOrBlank
(
policyHolder
.
getMobileNo
()))
{
if
(!
CommonUtil
.
isNullOrBlank
(
policyHolder
.
getMobileNo
()))
{
...
@@ -873,7 +890,7 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -873,7 +890,7 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
String
subject
=
"回退财富"
;
String
subject
=
"回退财富"
;
sendService
.
sendEmailOrSMS
(
"email"
,
email
,
"3"
,
messageText
,
null
,
subject
,
ccAddresses
,
"回复财富"
,
99
,
null
);
sendService
.
sendEmailOrSMS
(
"email"
,
email
,
"3"
,
messageText
,
null
,
subject
,
ccAddresses
,
"回复财富"
,
99
,
null
);
resp
.
setCommonResult
(
new
CommonResult
(
true
,
ZHBErrorConfig
.
getErrorInfo
(
"800000"
)));
resp
.
setCommonResult
(
new
CommonResult
(
true
,
ZHBErrorConfig
.
getErrorInfo
(
"800000"
)));
return
resp
;
return
resp
;
}
}
...
@@ -881,21 +898,21 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -881,21 +898,21 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
public
ExportFortunePayResponseVO
exportFortunePay
(
ExportFortunePayRequestVO
requestVO
,
HttpServletResponse
response
)
{
public
ExportFortunePayResponseVO
exportFortunePay
(
ExportFortunePayRequestVO
requestVO
,
HttpServletResponse
response
)
{
ExportFortunePayResponseVO
responseVO
=
new
ExportFortunePayResponseVO
();
ExportFortunePayResponseVO
responseVO
=
new
ExportFortunePayResponseVO
();
WithdrawQueryInfo
info
=
new
WithdrawQueryInfo
();
WithdrawQueryInfo
info
=
new
WithdrawQueryInfo
();
BeanUtils
.
copyProperties
(
requestVO
,
info
);
BeanUtils
.
copyProperties
(
requestVO
,
info
);
//体系查询调整,如果体系为S3,则需要查询它下面的所有子集
//体系查询调整,如果体系为S3,则需要查询它下面的所有子集
PractitionerSubordinateInfo
practitionerSubordinateInfo
=
new
PractitionerSubordinateInfo
();
PractitionerSubordinateInfo
practitionerSubordinateInfo
=
new
PractitionerSubordinateInfo
();
BeanUtils
.
copyProperties
(
requestVO
,
practitionerSubordinateInfo
);
BeanUtils
.
copyProperties
(
requestVO
,
practitionerSubordinateInfo
);
practitionerSubordinateInfo
.
setDeptId
(
requestVO
.
getInsurerBranchDeptId
());
practitionerSubordinateInfo
.
setDeptId
(
requestVO
.
getInsurerBranchDeptId
());
List
<
Long
>
subsystemIdList
=
aclPractitionerSubordinateSystemDalService
.
getLongs
(
practitionerSubordinateInfo
);
List
<
Long
>
subsystemIdList
=
aclPractitionerSubordinateSystemDalService
.
getLongs
(
practitionerSubordinateInfo
);
info
.
setSubsystemIdList
(
subsystemIdList
);
info
.
setSubsystemIdList
(
subsystemIdList
);
List
<
WithdrawLabelInfo
>
withdraws
=
agmsFortuneDalService
.
transformForWithdrawLabel
(
info
);
List
<
WithdrawLabelInfo
>
withdraws
=
agmsFortuneDalService
.
transformForWithdrawLabel
(
info
);
Long
[]
payIds
=
new
Long
[
withdraws
.
size
()];
Long
[]
payIds
=
new
Long
[
withdraws
.
size
()];
for
(
int
i
=
0
;
i
<
withdraws
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
withdraws
.
size
();
i
++)
{
payIds
[
i
]
=
withdraws
.
get
(
i
).
getPayId
();
payIds
[
i
]
=
withdraws
.
get
(
i
).
getPayId
();
}
}
List
<
FortunePayToOrderInfo
>
fortunePayToOrderInfos
=
agmsFortuneDalService
.
fortunePayToOrder
(
payIds
);
List
<
FortunePayToOrderInfo
>
fortunePayToOrderInfos
=
agmsFortuneDalService
.
fortunePayToOrder
(
payIds
);
createCSV
(
fortunePayToOrderInfos
,
response
);
createCSV
(
fortunePayToOrderInfos
,
response
);
responseVO
.
setCommonResult
(
new
CommonResult
(
true
,
ZHBErrorConfig
.
getErrorInfo
(
"800000"
)));
responseVO
.
setCommonResult
(
new
CommonResult
(
true
,
ZHBErrorConfig
.
getErrorInfo
(
"800000"
)));
return
responseVO
;
return
responseVO
;
}
}
...
@@ -930,6 +947,200 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -930,6 +947,200 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
return
responseVO
;
return
responseVO
;
}
}
@Override
public
ExportCommissionPayoutStatusQueryResponseVO
exportCommissionPayoutStatusQuerySheet2
(
CommissionPayoutStatusQueryRequestVO
requestVO
,
HttpServletResponse
response
)
{
ExportCommissionPayoutStatusQueryResponseVO
responseVO
=
new
ExportCommissionPayoutStatusQueryResponseVO
();
CommissionPayoutStatusQueryInfo
info
=
new
CommissionPayoutStatusQueryInfo
();
BeanUtils
.
copyProperties
(
requestVO
,
info
);
//体系查询调整,如果体系为S3,则需要查询它下面的所有子集
PractitionerSubordinateInfo
practitionerSubordinateInfo
=
new
PractitionerSubordinateInfo
();
BeanUtils
.
copyProperties
(
requestVO
,
practitionerSubordinateInfo
);
practitionerSubordinateInfo
.
setDeptId
(
requestVO
.
getInsurerBranchDeptId
());
List
<
Long
>
subsystemIdList
=
aclPractitionerSubordinateSystemDalService
.
getLongs
(
practitionerSubordinateInfo
);
info
.
setSubsystemIdList
(
subsystemIdList
);
List
<
CommissionPayoutStatus
>
commissionPayoutStatusList
=
agmsFortuneDalService
.
commissionPayoutStatusQuery
(
info
);
List
<
Long
>
fortuneIdList
=
new
ArrayList
<>();
for
(
CommissionPayoutStatus
item
:
commissionPayoutStatusList
)
{
fortuneIdList
.
add
(
item
.
getFortuneId
());
}
// 查询销售经纪人所属s1,s2,s3的C08,C10记录
List
<
Long
>
fortuneIdList1
=
agmsFortuneDalService
.
querySalePractitionerFortune1
(
fortuneIdList
);
List
<
Long
>
fortuneIdList0
=
agmsFortuneDalService
.
querySalePractitionerFortune
(
fortuneIdList
);
List
<
Long
>
fortuneIdList2
=
new
ArrayList
<>();
// 非销售经纪人所属s1,s2,s3的C08,C10记录
for
(
Long
item
:
fortuneIdList0
)
{
if
(!
fortuneIdList1
.
contains
(
item
))
{
fortuneIdList2
.
add
(
item
);
}
}
// 导出xlsx
XSSFWorkbook
wkb
=
new
XSSFWorkbook
();
// 保单发佣清算明细报表Sheet页
generateSheet2
(
wkb
,
fortuneIdList
,
fortuneIdList2
);
// 设置响应
String
fn
=
"ZHB_SalaryReport_"
+
System
.
currentTimeMillis
()
+
".xlsx"
;
String
headStr
=
"attachment; filename=\""
+
fn
+
"\""
;
xlsxDownload
(
wkb
,
headStr
,
response
);
responseVO
.
setCommonResult
(
new
CommonResult
(
true
,
ZHBErrorConfig
.
getErrorInfo
(
"800000"
)));
return
responseVO
;
}
private
void
generateSheet2
(
XSSFWorkbook
wkb
,
List
<
Long
>
fortuneIdList
,
List
<
Long
>
fortuneIdList2
)
{
XSSFSheet
sheet2
=
wkb
.
createSheet
(
"保单发佣清算明细报表"
);
// 1.设置表头
String
[]
columnName
=
new
String
[]{
"序号"
,
"对账月"
,
"投保人"
,
"保单号"
,
"保司"
,
"保费"
,
"产品"
,
"承保时间"
,
"年期"
,
"FYC%"
,
"业绩折标率%"
,
"分佣%"
,
"业绩%"
,
"RYC%"
,
"保单FYC"
,
"佣金FYC"
,
"业绩FYC"
,
"保单RYC"
,
"佣金RYC"
,
"渠道"
,
"FYC体系"
,
"销售经纪人"
,
"销售经纪人职级"
,
"职级率"
,
"首年销售佣金"
,
"续年销售佣金"
,
"续期辅导人"
,
"续期辅导奖金率"
,
"续期辅导奖"
,
"经纪人月销售加码奖金%"
,
"经纪人月销售加码奖金"
,
"推荐人"
,
"个人推荐率"
,
"个人推荐奖¥"
,
"S1体系推荐率"
,
"S1体系推荐奖金¥"
,
"一代辅导人"
,
"一代辅导人职级"
,
"一代辅导人职级岗位津贴%"
,
"一代辅导人岗位津贴"
,
"二代辅导人"
,
"二代辅导人职级"
,
"二代辅导人职级岗位津贴%"
,
"二代辅导人岗位津贴"
,
"所属 S1分部"
,
"S1团队达标奖金率"
,
"S1团队达标奖金¥(季度)"
,
"S1团队长辅导津贴比率"
,
"S1团队长辅导津贴"
,
"S1续期绩效奖金"
,
"所属 S2体系"
,
"S2团队达标奖金率"
,
"S2团队达标奖金¥(季度)"
,
"S2团队长辅导津贴比率"
,
"S2团队长辅导津贴"
,
"S2续期绩效奖金"
,
"所属 S3纵队"
,
"S3团队达标奖金率"
,
"S3团队达标奖金¥(季度)"
,
"S3团队长辅导津贴比率"
,
"S3团队长辅导津贴"
,
"S1育成人"
,
"S1育成人职级"
,
"S1育成奖金率"
,
"S1育成金额"
,
"C14直接销售加码佣金率"
,
"C14直接销售加码佣金"
,
"基本法属性"
,
"S01-首年度销售佣金"
,
"S03-首年度辅导奖金"
,
"R01-首年度直接销售佣金(旧)"
,
"R02-续年度直接销售拥金(旧)"
,
"R03-续年度辅导佣金(旧)"
,
"R04-续年度绩效奖金(旧)"
,
"S1推荐人"
,
"S2推荐人"
,
"S2体系推荐率"
,
"S2体系推荐奖金¥"
,
"S3推荐人"
,
"S3体系推荐率"
,
"S3体系推荐奖金¥"
,
"S2育成人"
,
"S2育成人职级"
,
"S2育成奖金率"
,
"S2育成金额"
,
"S3育成人"
,
"S3育成人职级"
,
"S3育成奖金率"
,
"S3育成金额"
,
"其它税前加扣款1"
,
"其它税前加扣款2"
,
"其它税前加扣款3"
,
"其它税前加扣款4"
,
"其它"
};
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替换为中文
if
(
CollectionUtils
.
isNotEmpty
(
dataList
))
{
exportSalaryDetailsSheet2queryOrganization
(
dataList
);
}
// 3.遍历数据,产生数据行
if
(
null
!=
dataList
)
{
for
(
int
i
=
0
;
i
<
dataList
.
size
();
i
++)
{
Map
<
String
,
Object
>
values
=
dataList
.
get
(
i
);
rownum
=
sheet2
.
createRow
(
i
+
1
);
// 每行序号
rownum
.
createCell
(
0
).
setCellValue
(
i
+
1
);
for
(
int
j
=
0
;
j
<
columnName
.
length
;
j
++)
{
rownum
.
createCell
(
j
+
1
).
setCellValue
(
values
.
get
(
j
+
""
)
!=
null
?
values
.
get
(
j
+
""
).
toString
()
:
null
);
}
}
}
}
private
void
exportSalaryDetailsSheet2queryOrganization
(
List
<
Map
<
String
,
Object
>>
list
)
{
List
<
AclPractitioner
>
aclPractitionerList
=
aclPractitionerDALService
.
findAll
();
Map
<
Long
,
AclPractitioner
>
aclPractitionerMap
=
new
HashMap
<>();
if
(
aclPractitionerList
!=
null
&&
aclPractitionerList
.
size
()
>
0
)
{
for
(
AclPractitioner
item
:
aclPractitionerList
)
{
aclPractitionerMap
.
put
(
item
.
getId
(),
item
);
}
}
List
<
AclPractitionerSubordinateSystem
>
subordinateSystemList
=
aclPractitionerSubordinateSystemDalService
.
findAll
();
Map
<
Long
,
AclPractitionerSubordinateSystem
>
subordinateSystemMap
=
new
HashMap
<>();
if
(
subordinateSystemList
!=
null
&&
subordinateSystemList
.
size
()
>
0
)
{
for
(
AclPractitionerSubordinateSystem
item
:
subordinateSystemList
)
{
subordinateSystemMap
.
put
(
item
.
getId
(),
item
);
}
}
//经纪人
AclPractitioner
practitioner
=
null
;
//所属体系
AclPractitionerSubordinateSystem
subordinateSystem
=
null
;
//数据字典
MdDropOptions
dropOptions
=
null
;
Map
<
String
,
Object
>
item
=
null
;
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
item
=
list
.
get
(
i
);
//FYC体系 [19]
if
(
null
!=
item
.
get
(
"19"
)
&&
StringUtils
.
isNotBlank
(
item
.
get
(
"19"
).
toString
()))
{
subordinateSystem
=
subordinateSystemMap
.
get
(
Long
.
valueOf
(
item
.
get
(
"19"
).
toString
()));
item
.
put
(
"19"
,
subordinateSystem
!=
null
?
subordinateSystem
.
getName
()
:
null
);
}
//经纪人职级 [21]
if
(
null
!=
item
.
get
(
"21"
)
&&
StringUtils
.
isNotBlank
(
item
.
get
(
"21"
).
toString
()))
{
dropOptions
=
systemConfigService
.
getDropOptionInfo
(
"practitioner_level"
,
item
.
get
(
"21"
).
toString
(),
"practitioner_level"
);
item
.
put
(
"21"
,
dropOptions
!=
null
?
dropOptions
.
getDropOptionName
()
:
null
);
}
//续期辅导人 [25]
if
(
null
!=
item
.
get
(
"25"
)
&&
StringUtils
.
isNotBlank
(
item
.
get
(
"25"
).
toString
()))
{
String
[]
ids
=
item
.
get
(
"25"
).
toString
().
split
(
","
);
for
(
int
j
=
0
;
j
<
ids
.
length
;
j
++)
{
practitioner
=
aclPractitionerMap
.
get
(
Long
.
valueOf
(
ids
[
j
]));
if
(
practitioner
!=
null
)
{
ids
[
j
]
=
practitioner
.
getName
();
}
}
item
.
put
(
"25"
,
Joiner
.
on
(
","
).
join
(
Arrays
.
asList
(
ids
)));
}
//所属S1分部 [43]
if
(
null
!=
item
.
get
(
"43"
)
&&
StringUtils
.
isNotBlank
(
item
.
get
(
"43"
).
toString
()))
{
subordinateSystem
=
subordinateSystemMap
.
get
(
Long
.
valueOf
(
item
.
get
(
"43"
).
toString
()));
item
.
put
(
"43"
,
subordinateSystem
!=
null
?
subordinateSystem
.
getName
()
:
null
);
}
//所属S2体系 [49]
if
(
null
!=
item
.
get
(
"49"
)
&&
StringUtils
.
isNotBlank
(
item
.
get
(
"49"
).
toString
()))
{
subordinateSystem
=
subordinateSystemMap
.
get
(
Long
.
valueOf
(
item
.
get
(
"49"
).
toString
()));
item
.
put
(
"49"
,
subordinateSystem
!=
null
?
subordinateSystem
.
getName
()
:
null
);
}
//所属S3纵队 [55]
if
(
null
!=
item
.
get
(
"55"
)
&&
StringUtils
.
isNotBlank
(
item
.
get
(
"55"
).
toString
()))
{
subordinateSystem
=
subordinateSystemMap
.
get
(
Long
.
valueOf
(
item
.
get
(
"55"
).
toString
()));
item
.
put
(
"55"
,
subordinateSystem
!=
null
?
subordinateSystem
.
getName
()
:
null
);
}
//44-47
item
.
put
(
"44"
,
this
.
processMerge
(
item
.
get
(
"44"
),
aclPractitionerMap
));
item
.
put
(
"45"
,
this
.
processMerge
(
item
.
get
(
"45"
),
aclPractitionerMap
));
item
.
put
(
"46"
,
this
.
processMerge
(
item
.
get
(
"46"
),
aclPractitionerMap
));
item
.
put
(
"47"
,
this
.
processMerge
(
item
.
get
(
"47"
),
aclPractitionerMap
));
//50-53
item
.
put
(
"50"
,
this
.
processMerge
(
item
.
get
(
"50"
),
aclPractitionerMap
));
item
.
put
(
"51"
,
this
.
processMerge
(
item
.
get
(
"51"
),
aclPractitionerMap
));
item
.
put
(
"52"
,
this
.
processMerge
(
item
.
get
(
"52"
),
aclPractitionerMap
));
item
.
put
(
"53"
,
this
.
processMerge
(
item
.
get
(
"53"
),
aclPractitionerMap
));
//56-59
item
.
put
(
"56"
,
this
.
processMerge
(
item
.
get
(
"56"
),
aclPractitionerMap
));
item
.
put
(
"57"
,
this
.
processMerge
(
item
.
get
(
"57"
),
aclPractitionerMap
));
item
.
put
(
"58"
,
this
.
processMerge
(
item
.
get
(
"58"
),
aclPractitionerMap
));
item
.
put
(
"59"
,
this
.
processMerge
(
item
.
get
(
"59"
),
aclPractitionerMap
));
//71-72
item
.
put
(
"71"
,
this
.
processMerge
(
item
.
get
(
"71"
),
aclPractitionerMap
));
item
.
put
(
"72"
,
this
.
processMerge
(
item
.
get
(
"72"
),
aclPractitionerMap
));
}
}
private
String
processMerge
(
Object
o
,
Map
<
Long
,
AclPractitioner
>
aclPractitionerMap
)
{
if
(
null
!=
o
&&
StringUtils
.
isNotBlank
(
o
.
toString
()))
{
String
[]
practitionerId_values
=
o
.
toString
().
split
(
","
);
if
(
practitionerId_values
.
length
>
1
)
{
for
(
int
j
=
0
;
j
<
practitionerId_values
.
length
;
j
++)
{
String
[]
split
=
practitionerId_values
[
j
].
split
(
"-"
);
if
(
StringUtils
.
isNotBlank
(
split
[
0
])
&&
split
.
length
==
2
)
{
Long
practitionerId
=
Long
.
valueOf
(
split
[
0
]);
AclPractitioner
practitioner
=
aclPractitionerMap
.
get
(
practitionerId
);
if
(
practitioner
!=
null
)
{
String
strNew
=
practitioner
.
getName
()
+
"-"
+
split
[
1
];
practitionerId_values
[
j
]
=
strNew
;
}
}
}
return
Joiner
.
on
(
","
).
join
(
Arrays
.
asList
(
practitionerId_values
));
}
else
{
return
o
.
toString
();
}
}
return
null
;
}
private
void
exportCommissionPayoutStatusQueryCSV
(
List
<
CommissionPayoutStatus
>
commissionPayoutStatusList
,
HttpServletResponse
response
)
{
private
void
exportCommissionPayoutStatusQueryCSV
(
List
<
CommissionPayoutStatus
>
commissionPayoutStatusList
,
HttpServletResponse
response
)
{
String
[]
columnName
=
new
String
[]{
"序号"
,
"来佣检核年月"
,
"发佣状态"
,
"预计发佣年月"
,
"实际发佣年月"
,
"保险公司"
,
"保单号"
,
"保费"
,
"来佣金额"
,
"佣金类型"
,
"应发佣率"
,
"应发金额"
,
String
[]
columnName
=
new
String
[]{
"序号"
,
"来佣检核年月"
,
"发佣状态"
,
"预计发佣年月"
,
"实际发佣年月"
,
"保险公司"
,
"保单号"
,
"保费"
,
"来佣金额"
,
"佣金类型"
,
"应发佣率"
,
"应发金额"
,
"经纪人"
,
"经纪人职级"
,
"体系"
,
"营业部"
,
"购买方案"
,
"缴费年限"
,
"保障期间"
};
"经纪人"
,
"经纪人职级"
,
"体系"
,
"营业部"
,
"购买方案"
,
"缴费年限"
,
"保障期间"
};
...
@@ -951,10 +1162,10 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -951,10 +1162,10 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
buf
.
append
(
i
+
1
).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
i
+
1
).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getCommissionPayoutYearmonth
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getCommissionPayoutYearmonth
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getCommissionPayoutStatus
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getCommissionPayoutStatus
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getPredictMonthPeriod
(
)).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
CommonUtil
.
dateParseString
(
info
.
getPredictMonthPeriod
(),
"yyyy-MM-dd HH:mm:ss"
)).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getMonthPeriod
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getMonthPeriod
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getInsurerName
()
==
null
?
""
:
info
.
getInsurerName
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getInsurerName
()
==
null
?
""
:
info
.
getInsurerName
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getPolicyNo
()
==
null
?
""
:
info
.
getPolicyNo
()
).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
"\t"
).
append
(
info
.
getPolicyNo
()
==
null
?
""
:
info
.
getPolicyNo
()).
append
(
"\t"
).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getOrderPrice
()
==
null
?
0
:
info
.
getOrderPrice
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getOrderPrice
()
==
null
?
0
:
info
.
getOrderPrice
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getCommissionAmount
()
==
null
?
0
:
info
.
getCommissionAmount
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getCommissionAmount
()
==
null
?
0
:
info
.
getCommissionAmount
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getCommissionType
()
==
null
?
""
:
info
.
getCommissionType
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getCommissionType
()
==
null
?
""
:
info
.
getCommissionType
()).
append
(
CSV_COLUMN_SEPARATOR
);
...
@@ -993,8 +1204,8 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -993,8 +1204,8 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
os
.
flush
();
os
.
flush
();
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
finally
{
}
finally
{
if
(
os
!=
null
)
{
if
(
os
!=
null
)
{
try
{
try
{
os
.
close
();
os
.
close
();
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
...
@@ -1004,10 +1215,34 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -1004,10 +1215,34 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
}
}
}
}
public
static
void
xlsxDownload
(
Workbook
wkb
,
String
headStr
,
HttpServletResponse
response
)
{
response
.
setContentType
(
"application/vnd.ms-excel;charset=UTF-8"
);
response
.
setCharacterEncoding
(
"UTF-8"
);
response
.
setHeader
(
"Content-Disposition"
,
headStr
);
response
.
setHeader
(
"Cache-Control"
,
"max-age=30"
);
response
.
setHeader
(
"Access-Control-Expose-Headers"
,
"Content-Disposition"
);
response
.
setHeader
(
"Pragma"
,
"public"
);
OutputStream
os
=
null
;
try
{
os
=
response
.
getOutputStream
();
wkb
.
write
(
os
);
os
.
flush
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
finally
{
if
(
os
!=
null
)
{
try
{
os
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
}
private
void
createCSV
(
List
<
FortunePayToOrderInfo
>
fortunePayToOrderInfos
,
HttpServletResponse
response
)
{
private
void
createCSV
(
List
<
FortunePayToOrderInfo
>
fortunePayToOrderInfos
,
HttpServletResponse
response
)
{
String
charset
=
"UTF-8"
;
// 读取字符编码
String
charset
=
"UTF-8"
;
// 读取字符编码
String
[]
columnName
=
new
String
[]{
"序号"
,
"预计发佣年月"
,
"经纪人"
,
"佣金"
,
"应发佣金"
,
"首年销售佣金(fyc)"
,
"保单号"
,
"保费"
,
"佣金率"
,
"发佣状态"
,
"佣金类型"
,
"手机号"
,
"职级"
,
"分公司"
,
"营业部"
,
"体系"
,
"购买方案"
};
String
[]
columnName
=
new
String
[]{
"序号"
,
"预计发佣年月"
,
"经纪人"
,
"佣金"
,
"应发佣金"
,
"首年销售佣金(fyc)"
,
"保单号"
,
"保费"
,
"佣金率"
,
"发佣状态"
,
"佣金类型"
,
"手机号"
,
"职级"
,
"分公司"
,
"营业部"
,
"体系"
,
"购买方案"
};
String
tableName
=
"YD_Export_Fortune_Pay"
;
String
tableName
=
"YD_Export_Fortune_Pay"
;
String
CSV_COLUMN_SEPARATOR
=
","
;
//CSV文件列分隔符
String
CSV_COLUMN_SEPARATOR
=
","
;
//CSV文件列分隔符
String
CSV_ROW_SEPARATOR
=
"\r\n"
;
//CSV文件行分隔符
String
CSV_ROW_SEPARATOR
=
"\r\n"
;
//CSV文件行分隔符
...
@@ -1028,22 +1263,22 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -1028,22 +1263,22 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
buf
.
append
(
info
.
getCommissionAmount
()
==
null
?
0
:
info
.
getCommissionAmount
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getCommissionAmount
()
==
null
?
0
:
info
.
getCommissionAmount
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getReferralAmount
()
==
null
?
0
:
info
.
getReferralAmount
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getReferralAmount
()
==
null
?
0
:
info
.
getReferralAmount
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getFycAmount
()
==
null
?
0
:
info
.
getFycAmount
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getFycAmount
()
==
null
?
0
:
info
.
getFycAmount
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getPolicyNo
()
==
null
?
""
:
"P_"
+
info
.
getPolicyNo
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getPolicyNo
()
==
null
?
""
:
"P_"
+
info
.
getPolicyNo
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getOrderPrice
()
==
null
?
0
:
info
.
getOrderPrice
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getOrderPrice
()
==
null
?
0
:
info
.
getOrderPrice
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getCommissionRate
()
==
null
?
0
:
info
.
getCommissionRate
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getCommissionRate
()
==
null
?
0
:
info
.
getCommissionRate
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getCommissionPayoutStatus
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getCommissionPayoutStatus
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getCommissionType
()
==
null
?
""
:
info
.
getCommissionType
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getCommissionType
()
==
null
?
""
:
info
.
getCommissionType
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getMobileNo
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getMobileNo
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getPractitionerLevel
()
==
null
?
""
:
info
.
getPractitionerLevel
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getPractitionerLevel
()
==
null
?
""
:
info
.
getPractitionerLevel
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getInsurerBranchName
()
==
null
?
""
:
info
.
getInsurerBranchName
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getInsurerBranchName
()
==
null
?
""
:
info
.
getInsurerBranchName
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getInsurerBranchDeptName
()
==
null
?
""
:
info
.
getInsurerBranchDeptName
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getInsurerBranchDeptName
()
==
null
?
""
:
info
.
getInsurerBranchDeptName
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getSubordinateSystemName
()
==
null
?
""
:
info
.
getSubordinateSystemName
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getSubordinateSystemName
()
==
null
?
""
:
info
.
getSubordinateSystemName
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getProductName
()
==
null
?
""
:
info
.
getProductName
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
info
.
getProductName
()
==
null
?
""
:
info
.
getProductName
()).
append
(
CSV_COLUMN_SEPARATOR
);
buf
.
append
(
CSV_ROW_SEPARATOR
);
buf
.
append
(
CSV_ROW_SEPARATOR
);
}
}
}
}
// 设置文件后缀
// 设置文件后缀
String
fn
=
tableName
+
System
.
currentTimeMillis
()
+
".csv"
;
String
fn
=
tableName
+
System
.
currentTimeMillis
()
+
".csv"
;
String
headStr
=
"attachment; filename=\""
+
fn
+
"\""
;
String
headStr
=
"attachment; filename=\""
+
fn
+
"\""
;
// 设置响应
// 设置响应
response
.
setContentType
(
"APPLICATION/ms-csv.numberformat"
);
response
.
setContentType
(
"APPLICATION/ms-csv.numberformat"
);
...
@@ -1059,8 +1294,8 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
...
@@ -1059,8 +1294,8 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
os
.
flush
();
os
.
flush
();
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
finally
{
}
finally
{
if
(
os
!=
null
)
{
if
(
os
!=
null
)
{
try
{
try
{
os
.
close
();
os
.
close
();
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
...
...
yd-api/src/main/java/com/yd/api/agms/vo/fortune/CommissionPayoutStatusQueryRequestVO.java
View file @
fda39bfd
...
@@ -43,7 +43,7 @@ public class CommissionPayoutStatusQueryRequestVO {
...
@@ -43,7 +43,7 @@ public class CommissionPayoutStatusQueryRequestVO {
private
Long
practitionerId
;
private
Long
practitionerId
;
/**
/**
* 发佣状态
暂不开放 可发 保留
已发并关账
* 发佣状态
0-作废 1-待来佣 2-可发 3-保留 4-
已发并关账
*/
*/
private
Long
commissionPayoutStatus
;
private
Long
commissionPayoutStatus
;
...
...
yd-api/src/main/java/com/yd/api/agms/vo/fortune/CommissionPayoutStatusUpdateRequestVO.java
View file @
fda39bfd
...
@@ -15,7 +15,7 @@ public class CommissionPayoutStatusUpdateRequestVO {
...
@@ -15,7 +15,7 @@ public class CommissionPayoutStatusUpdateRequestVO {
/**
/**
* 佣金发放状态
* 佣金发放状态
*
2.可发放
3.保留
*
0.作废 1.待发佣 2.可发放
3.保留
*/
*/
private
String
paymentStatus
;
private
String
paymentStatus
;
...
...
yd-api/src/main/java/com/yd/api/practitioner/service/impl/PractitionerServiceImpl.java
View file @
fda39bfd
...
@@ -2541,11 +2541,15 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
...
@@ -2541,11 +2541,15 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
return
responseVO
;
return
responseVO
;
}
}
List
<
Long
>
practitionerIdList
=
this
.
getPractitionerIdList
(
practitionerId
,
1
);
List
<
Long
>
practitionerIdList
=
this
.
getPractitionerIdList
(
practitionerId
,
1
);
AclPractitioner
practitioner
=
aclPractitionerDALService
.
findPractitionerByRaise
(
practitionerId
);
List
<
AclPractitioner
>
practitionerRaises
=
aclPractitionerDALService
.
findPractitionerByRaise
(
practitionerId
);
if
(
null
!=
practitioner
&&
null
!=
practitioner
.
getRaiseId
())
{
if
(
practitionerRaises
!=
null
&&
practitionerRaises
.
size
()
>
0
){
practitionerIdList
.
add
(
practitioner
.
getId
());
for
(
AclPractitioner
practitioner
:
practitionerRaises
){
List
<
Long
>
practitionerRaiseIdList
=
this
.
getPractitionerIdList
(
practitioner
.
getId
(),
null
);
if
(
null
!=
practitioner
&&
null
!=
practitioner
.
getRaiseId
())
{
practitionerIdList
.
addAll
(
practitionerRaiseIdList
);
practitionerIdList
.
add
(
practitioner
.
getId
());
List
<
Long
>
practitionerRaiseIdList
=
this
.
getPractitionerIdList
(
practitioner
.
getId
(),
null
);
practitionerIdList
.
addAll
(
practitionerRaiseIdList
);
}
}
}
}
List
<
AclPractitioner
>
practitioners
=
aclPractitionerDALService
.
findByIds
(
practitionerIdList
);
List
<
AclPractitioner
>
practitioners
=
aclPractitionerDALService
.
findByIds
(
practitionerIdList
);
if
(
practitioners
.
isEmpty
())
{
if
(
practitioners
.
isEmpty
())
{
...
@@ -3285,11 +3289,15 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
...
@@ -3285,11 +3289,15 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
private
void
getMemberInfoForOnLine
(
Map
<
String
,
SubordinateSystemMemberInfo
>
memberInfoMap
,
Long
practitionerId
,
Integer
time
)
{
private
void
getMemberInfoForOnLine
(
Map
<
String
,
SubordinateSystemMemberInfo
>
memberInfoMap
,
Long
practitionerId
,
Integer
time
)
{
//1、查询该团队长所在体系的所有成员
//1、查询该团队长所在体系的所有成员
List
<
Long
>
practitionerIdList
=
this
.
getPractitionerIdList
(
practitionerId
,
null
);
List
<
Long
>
practitionerIdList
=
this
.
getPractitionerIdList
(
practitionerId
,
null
);
AclPractitioner
practitionerRaise
=
aclPractitionerDALService
.
findPractitionerByRaise
(
practitionerId
);
List
<
AclPractitioner
>
practitionerRaises
=
aclPractitionerDALService
.
findPractitionerByRaise
(
practitionerId
);
if
(
null
!=
practitionerRaise
&&
null
!=
practitionerRaise
.
getRaiseId
())
{
if
(
practitionerRaises
!=
null
&&
practitionerRaises
.
size
()
>
0
){
practitionerIdList
.
add
(
practitionerRaise
.
getId
());
for
(
AclPractitioner
practitionerRaise
:
practitionerRaises
){
List
<
Long
>
practitionerRaiseIdList
=
this
.
getPractitionerIdList
(
practitionerRaise
.
getId
(),
null
);
if
(
null
!=
practitionerRaise
&&
null
!=
practitionerRaise
.
getRaiseId
())
{
practitionerIdList
.
addAll
(
practitionerRaiseIdList
);
practitionerIdList
.
add
(
practitionerRaise
.
getId
());
List
<
Long
>
practitionerRaiseIdList
=
this
.
getPractitionerIdList
(
practitionerRaise
.
getId
(),
null
);
practitionerIdList
.
addAll
(
practitionerRaiseIdList
);
}
}
}
}
List
<
AclPractitioner
>
practitionerList
=
aclPractitionerDALService
.
findByIds
(
practitionerIdList
);
List
<
AclPractitioner
>
practitionerList
=
aclPractitionerDALService
.
findByIds
(
practitionerIdList
);
if
(!
practitionerList
.
isEmpty
()
&&
practitionerList
.
get
(
0
)
!=
null
)
{
if
(!
practitionerList
.
isEmpty
()
&&
practitionerList
.
get
(
0
)
!=
null
)
{
...
...
yd-api/src/main/java/com/yd/api/practitioner/service/impl/ScheduleTrackServiceImpl.java
View file @
fda39bfd
...
@@ -317,11 +317,15 @@ public class ScheduleTrackServiceImpl implements ScheduleTrackService {
...
@@ -317,11 +317,15 @@ public class ScheduleTrackServiceImpl implements ScheduleTrackService {
// 获取团队成员或被辅导人的practitionerId
// 获取团队成员或被辅导人的practitionerId
List
<
Long
>
practitionerIdList
=
practitionerService
.
getPractitionerIdList
(
practitionerId
,
null
);
List
<
Long
>
practitionerIdList
=
practitionerService
.
getPractitionerIdList
(
practitionerId
,
null
);
AclPractitioner
practitioner
=
aclPractitionerDALService
.
findPractitionerByRaise
(
practitionerId
);
List
<
AclPractitioner
>
practitionerRaises
=
aclPractitionerDALService
.
findPractitionerByRaise
(
practitionerId
);
if
(
null
!=
practitioner
&&
null
!=
practitioner
.
getRaiseId
()){
if
(
practitionerRaises
!=
null
&&
practitionerRaises
.
size
()
>
0
){
practitionerIdList
.
add
(
practitioner
.
getId
());
for
(
AclPractitioner
practitioner
:
practitionerRaises
){
List
<
Long
>
practitionerRaiseIdList
=
practitionerService
.
getPractitionerIdList
(
practitioner
.
getId
(),
null
);
if
(
null
!=
practitioner
&&
null
!=
practitioner
.
getRaiseId
()){
practitionerIdList
.
addAll
(
practitionerRaiseIdList
);
practitionerIdList
.
add
(
practitioner
.
getId
());
List
<
Long
>
practitionerRaiseIdList
=
practitionerService
.
getPractitionerIdList
(
practitioner
.
getId
(),
null
);
practitionerIdList
.
addAll
(
practitionerRaiseIdList
);
}
}
}
}
// 根据团队长经纪人id查询团队每个成员本日,本周,本月得分以及---线上本月FYC
// 根据团队长经纪人id查询团队每个成员本日,本周,本月得分以及---线上本月FYC
...
...
yd-api/src/main/java/com/yd/dal/mapper/agms/AgmsFortuneMapper.java
View file @
fda39bfd
package
com
.
yd
.
dal
.
mapper
.
agms
;
package
com
.
yd
.
dal
.
mapper
.
agms
;
import
com.yd.dal.entity.agms.fortune.*
;
import
com.yd.dal.entity.agms.fortune.*
;
import
com.yd.dal.entity.customer.AclCustomerFortune
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* @author xxy
* @author xxy
...
@@ -45,6 +45,9 @@ public interface AgmsFortuneMapper {
...
@@ -45,6 +45,9 @@ public interface AgmsFortuneMapper {
*/
*/
List
<
WithdrawLabelInfo
>
salaryPolicyNoDetails
(
@Param
(
"item"
)
WithdrawQueryInfo
info
);
List
<
WithdrawLabelInfo
>
salaryPolicyNoDetails
(
@Param
(
"item"
)
WithdrawQueryInfo
info
);
List
<
Map
<
String
,
Object
>>
querySheet2Data
(
@Param
(
"list1"
)
List
<
Long
>
fortuneIdList
,
@Param
(
"list2"
)
List
<
Long
>
fortuneIdList2
);
List
<
Long
>
querySalePractitionerFortune
(
List
<
Long
>
fortuneIdList
);
List
<
Long
>
querySalePractitionerFortune1
(
List
<
Long
>
fortuneIdList
);
}
}
yd-api/src/main/java/com/yd/dal/mapper/customer/AclPractitionerMapper.java
View file @
fda39bfd
...
@@ -100,7 +100,8 @@ public interface AclPractitionerMapper {
...
@@ -100,7 +100,8 @@ public interface AclPractitionerMapper {
List
<
PayScaleInfo
>
queryEGHistorySalaryPDFByPractitionerId
(
Long
practitionerId
);
List
<
PayScaleInfo
>
queryEGHistorySalaryPDFByPractitionerId
(
Long
practitionerId
);
public
List
<
TeamMemberDetail
>
queryTeamMemberDetailRaiseList
(
List
<
Long
>
practitionerIdList
);
public
List
<
TeamMemberDetail
>
queryTeamMemberDetailRaiseList
(
List
<
Long
>
practitionerIdList
);
public
AclPractitioner
findPractitionerByRaise
(
Long
practitionerId
);
public
List
<
AclPractitioner
>
findPractitionerByRaise
(
Long
practitionerId
);
/**
/**
* 通过联合销售ID查询联合销售经纪人信息列表
* 通过联合销售ID查询联合销售经纪人信息列表
...
...
yd-api/src/main/java/com/yd/dal/service/agms/AgmsFortuneDALService.java
View file @
fda39bfd
package
com
.
yd
.
dal
.
service
.
agms
;
package
com
.
yd
.
dal
.
service
.
agms
;
import
com.yd.dal.entity.agms.fortune.*
;
import
com.yd.dal.entity.agms.fortune.*
;
import
com.yd.dal.entity.agms.fortune.CommissionPayoutStatus
;
import
com.yd.dal.entity.agms.fortune.CommissionPayoutStatusQueryInfo
;
import
com.yd.dal.entity.agms.fortune.CustomerFortuneStatisticalInfo
;
import
com.yd.dal.entity.customer.AclCustomerFortune
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -49,4 +45,9 @@ public interface AgmsFortuneDALService {
...
@@ -49,4 +45,9 @@ public interface AgmsFortuneDALService {
*/
*/
List
<
WithdrawLabelInfo
>
salaryPolicyNoDetails
(
WithdrawQueryInfo
info
);
List
<
WithdrawLabelInfo
>
salaryPolicyNoDetails
(
WithdrawQueryInfo
info
);
List
<
Map
<
String
,
Object
>>
querySheet2Data
(
List
<
Long
>
fortuneIdList
,
List
<
Long
>
fortuneIdList2
);
List
<
Long
>
querySalePractitionerFortune
(
List
<
Long
>
fortuneIdList
);
List
<
Long
>
querySalePractitionerFortune1
(
List
<
Long
>
fortuneIdList
);
}
}
yd-api/src/main/java/com/yd/dal/service/agms/impl/AgmsFortuneDALServiceImpl.java
View file @
fda39bfd
...
@@ -72,4 +72,19 @@ public class AgmsFortuneDALServiceImpl implements AgmsFortuneDALService {
...
@@ -72,4 +72,19 @@ public class AgmsFortuneDALServiceImpl implements AgmsFortuneDALService {
public
List
<
WithdrawLabelInfo
>
salaryPolicyNoDetails
(
WithdrawQueryInfo
info
)
{
public
List
<
WithdrawLabelInfo
>
salaryPolicyNoDetails
(
WithdrawQueryInfo
info
)
{
return
agmsFortuneMapper
.
salaryPolicyNoDetails
(
info
);
return
agmsFortuneMapper
.
salaryPolicyNoDetails
(
info
);
}
}
@Override
public
List
<
Map
<
String
,
Object
>>
querySheet2Data
(
List
<
Long
>
fortuneIdList
,
List
<
Long
>
fortuneIdList2
)
{
return
agmsFortuneMapper
.
querySheet2Data
(
fortuneIdList
,
fortuneIdList2
);
}
@Override
public
List
<
Long
>
querySalePractitionerFortune
(
List
<
Long
>
fortuneIdList
)
{
return
agmsFortuneMapper
.
querySalePractitionerFortune
(
fortuneIdList
);
}
@Override
public
List
<
Long
>
querySalePractitionerFortune1
(
List
<
Long
>
fortuneIdList
)
{
return
agmsFortuneMapper
.
querySalePractitionerFortune1
(
fortuneIdList
);
}
}
}
yd-api/src/main/java/com/yd/dal/service/customer/AclPractitionerDALService.java
View file @
fda39bfd
...
@@ -229,7 +229,7 @@ public interface AclPractitionerDALService {
...
@@ -229,7 +229,7 @@ public interface AclPractitionerDALService {
* @param practitionerId
* @param practitionerId
* @return
* @return
*/
*/
AclPractitioner
findPractitionerByRaise
(
Long
practitionerId
);
List
<
AclPractitioner
>
findPractitionerByRaise
(
Long
practitionerId
);
/**
/**
* 通过联合销售ID查询联合销售经纪人信息列表
* 通过联合销售ID查询联合销售经纪人信息列表
...
...
yd-api/src/main/java/com/yd/dal/service/customer/impl/AclPractitionerDALServiceImpl.java
View file @
fda39bfd
...
@@ -334,7 +334,7 @@ public class AclPractitionerDALServiceImpl implements AclPractitionerDALService
...
@@ -334,7 +334,7 @@ public class AclPractitionerDALServiceImpl implements AclPractitionerDALService
}
}
@Override
@Override
public
AclPractitioner
findPractitionerByRaise
(
Long
practitionerId
)
{
public
List
<
AclPractitioner
>
findPractitionerByRaise
(
Long
practitionerId
)
{
return
aclPractitionerMapper
.
findPractitionerByRaise
(
practitionerId
);
return
aclPractitionerMapper
.
findPractitionerByRaise
(
practitionerId
);
}
}
...
...
yd-api/src/main/java/com/yd/rmi/cache/SystemConfigService.java
View file @
fda39bfd
...
@@ -13,6 +13,7 @@ import org.springframework.boot.CommandLineRunner;
...
@@ -13,6 +13,7 @@ import org.springframework.boot.CommandLineRunner;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -261,6 +262,24 @@ public class SystemConfigService implements CommandLineRunner{
...
@@ -261,6 +262,24 @@ public class SystemConfigService implements CommandLineRunner{
return
mdDropOption
;
return
mdDropOption
;
}
}
public
MdDropOptions
getDropOptionInfo
(
String
elementKey
,
String
dropOptionId
,
String
masterCode
)
{
if
(
CommonUtil
.
isNullOrBlank
(
elementKey
)
||
CommonUtil
.
isNullOrBlank
(
masterCode
)
||
CommonUtil
.
isNullOrBlank
(
dropOptionId
))
{
return
null
;
}
ConcurrentHashMap
<
String
,
MdDropOptions
>
mdDropOptionsMap
;
Element
element
=
systemConfigCache
.
get
(
elementKey
);
if
(
element
!=
null
&&
element
.
getObjectValue
()
!=
null
)
{
mdDropOptionsMap
=
(
ConcurrentHashMap
<
String
,
MdDropOptions
>)
element
.
getObjectValue
();
}
else
{
List
<
MdDropOptions
>
mdDropOptionsList
=
mdDropOptionsDALService
.
findByDropMasterCode
(
masterCode
);
mdDropOptionsMap
=
new
ConcurrentHashMap
<>();
mdDropOptionsList
.
forEach
(
i
->
mdDropOptionsMap
.
put
(
i
.
getId
()
+
""
,
i
));
element
=
new
Element
(
elementKey
,
mdDropOptionsMap
);
systemConfigCache
.
put
(
element
);
}
return
mdDropOptionsMap
.
get
(
dropOptionId
);
}
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
"unchecked"
)
public
List
<
MdPractitionerHiringApproveSteps
>
findHiringApproveStepsByPractitionerLevel
(
String
practitionerLevelCode
)
{
public
List
<
MdPractitionerHiringApproveSteps
>
findHiringApproveStepsByPractitionerLevel
(
String
practitionerLevelCode
)
{
List
<
MdPractitionerHiringApproveSteps
>
hiringApproveSteps
=
new
ArrayList
<>();
List
<
MdPractitionerHiringApproveSteps
>
hiringApproveSteps
=
new
ArrayList
<>();
...
...
yd-api/src/main/resources/i18n/messages_zh_CN.properties
View file @
fda39bfd
##
暂时不用更新
2019/10/10-water ##
##
\u6682\u65F6\u4E0D\u7528\u66F4\u65B0
2019/10/10-water ##
######################
参数信息校验
########################
######################
\u53C2\u6570\u4FE1\u606F\u6821\u9A8C
########################
600000
=
参数检验成功!
600000
=
\u
53C2
\u6570\u
68C0
\u
9A8C
\u6210\u
529F
\u
FF01
610001
=
入参中[{0}]不能为空!
610001
=
\u5165\u
53C2
\u
4E2D[{0}]
\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
\u
FF01
610002
=
入参中[{0}]不能同时为空!
610002
=
\u5165\u
53C2
\u
4E2D[{0}]
\u
4E0D
\u
80FD
\u
540C
\u
65F6
\u
4E3A
\u
7A7A
\u
FF01
##
用户信息校验
##
\u7528\u6237\u4FE1\u606F\u6821\u9A8C
630001
=
用户的手机号码[{0}]格式不正确!
630001
=
\u7528\u6237\u7684\u
624B
\u
673A
\u
53F7
\u7801
[{0}]
\u
683C
\u
5F0F
\u
4E0D
\u
6B63
\u
786E
\u
FF01
630002
=
手机号[{0}]已被注册,请勿重复注册!
630002
=
\u
624B
\u
673A
\u
53F7[{0}]
\u
5DF2
\u
88AB
\u
6CE8
\u
518C
\u
FF0C
\u
8BF7
\u
52FF
\u
91CD
\u
590D
\u
6CE8
\u
518C
\u
FF01
######################
用户提示信息
########################
######################
\u7528\u6237\u63D0\u793A\u4FE1\u606F
########################
800000
=
执行成功!
800000
=
\u6267\u
884C
\u6210\u
529F
\u
FF01
800001
=
执行失败!
800001
=
\u6267\u
884C
\u5931\u
8D25
\u
FF01
##
系统提示信息
##
\u7CFB\u7EDF\u63D0\u793A\u4FE1\u606F
810001
=
token
无效或者错误!
810001
=
token
\u
65E0
\u6548\u6216\u8005\u9519\u
8BEF
\u
FF01
820001
=
未查询到相应结果。
820001
=
\u
672A
\u
67E5
\u
8BE2
\u5230\u
76F8
\u
5E94
\u
7ED3
\u
679C
\u3002
830001
=
该用户非经纪人。
830001
=
\u
8BE5
\u7528\u6237\u
975E
\u
7ECF
\u
7EAA
\u
4EBA
\u3002
830002
=
只有寿险经纪人才有权限进入!
830002
=
\u
53EA
\u6709\u
5BFF
\u9669\u
7ECF
\u
7EAA
\u
4EBA
\u
624D
\u6709\u6743\u9650\u
8FDB
\u5165\u
FF01
830003
=
请上传图片格式
830003
=
\u
8BF7
\u
4E0A
\u
4F20
\u
56FE
\u7247\u
683C
\u
5F0F
830004
=
上传照片尺寸比例为4:3
830004
=
\u
4E0A
\u
4F20
\u7167\u7247\u
5C3A
\u
5BF8
\u
6BD4
\u
4F8B
\u
4E3A4
\u
FF1A3
830005
=
上传头像尺寸比例为1:1
830005
=
\u
4E0A
\u
4F20
\u5934\u
50CF
\u
5C3A
\u
5BF8
\u
6BD4
\u
4F8B
\u
4E3A1:1
830006
=
生活照只能有三张,请将之前的删除
830006
=
\u
751F
\u
6D3B
\u7167\u
53EA
\u
80FD
\u6709\u
4E09
\u
5F20,
\u
8BF7
\u
5C06
\u
4E4B
\u
524D
\u7684\u5220\u9664
830007
=
上传头像失败,请重新上传!
830007
=
\u
4E0A
\u
4F20
\u5934\u
50CF
\u5931\u
8D25
\u
FF0C
\u
8BF7
\u
91CD
\u
65B0
\u
4E0A
\u
4F20
\u
FF01
830008
=
上传生活照失败,请重新上传!
830008
=
\u
4E0A
\u
4F20
\u
751F
\u
6D3B
\u7167\u5931\u
8D25
\u
FF0C
\u
8BF7
\u
91CD
\u
65B0
\u
4E0A
\u
4F20
\u
FF01
830009
=
上传微信二维码失败,请重新上传!
830009
=
\u
4E0A
\u
4F20
\u
5FAE
\u
4FE1
\u
4E8C
\u
7EF4
\u7801\u5931\u
8D25
\u
FF0C
\u
8BF7
\u
91CD
\u
65B0
\u
4E0A
\u
4F20
\u
FF01
830010
=
该用户已经注册为银盾经纪人
830010
=
\u
8BE5
\u7528\u6237\u
5DF2
\u
7ECF
\u
6CE8
\u
518C
\u
4E3A
\u
94F6
\u
76FE
\u
7ECF
\u
7EAA
\u
4EBA
830011
=
该增员已存在!
830011
=
\u
8BE5
\u
589E
\u5458\u
5DF2
\u
5B58
\u5728\u
FF01
830012
=
请填写跟进时间!
830012
=
\u
8BF7
\u
586B
\u5199\u
8DDF
\u
8FDB
\u
65F6
\u
95F4
\u
FF01
830013
=
请填写备注!
830013
=
\u
8BF7
\u
586B
\u5199\u5907\u
6CE8
\u
FF01
830014
=
此客户已是其他经纪人商机
830014
=
\u
6B64
\u
5BA2
\u6237\u
5DF2
\u
662F
\u5176\u
4ED6
\u
7ECF
\u
7EAA
\u
4EBA
\u5546\u
673A
830015
=
每天同一个跟进状态只能对一个商机经行一次增加!
830015
=
\u
6BCF
\u5929\u
540C
\u
4E00
\u
4E2A
\u
8DDF
\u
8FDB
\u
72B6
\u6001\u
53EA
\u
80FD
\u
5BF9
\u
4E00
\u
4E2A
\u5546\u
673A
\u
7ECF
\u
884C
\u
4E00
\u
6B21
\u
589E
\u
52A0!
830016
=
您不是团队长,无法进行编辑保存
830016
=
\u
60A8
\u
4E0D
\u
662F
\u
56E2
\u
961F
\u
957F,
\u
65E0
\u
6CD5
\u
8FDB
\u
884C
\u
7F16
\u
8F91
\u
4FDD
\u
5B58
830017
=
您不是团队长,无法进行查看
830017
=
\u
60A8
\u
4E0D
\u
662F
\u
56E2
\u
961F
\u
957F,
\u
65E0
\u
6CD5
\u
8FDB
\u
884C
\u
67E5
\u
770B
830018
=
您暂无团队,无法设置
830018
=
\u
60A8
\u6682\u
65E0
\u
56E2
\u
961F,
\u
65E0
\u
6CD5
\u
8BBE
\u
7F6E
830019
=
已申请过专家支持!请等待
830019
=
\u
5DF2
\u7533\u
8BF7
\u
8FC7
\u
4E13
\u
5BB6
\u
652F
\u6301
!\u8BF7\u7B49\u5F85
830020
=
活动时间段冲突
830020=
\u
6D3B
\u
52A8
\u
65F6
\u
95F4
\u
6BB5
\u
51B2
\u
7A81
830021
=
请选择发佣日期
830021
=
\u
8BF7
\u9009\u
62E9
\u
53D1
\u
4F63
\u
65E5
\u
671F
830022
=
请选择关账记录
830022
=
\u
8BF7
\u9009\u
62E9
\u5173\u
8D26
\u
8BB0
\u
5F55
830023
=
已关账并发放的记录,不能修改
830023
=
\u
5DF2
\u5173\u
8D26
\u
5E76
\u
53D1
\u
653E
\u7684\u
8BB0
\u
5F55,
\u
4E0D
\u
80FD
\u
4FEE
\u6539
830024
=
存在已关账保单,禁止修改为非可发放状态
830024
=
\u
5B58
\u5728\u
5DF2
\u5173\u
8D26
\u
4FDD
\u5355
,
\u7981\u
6B62
\u
4FEE
\u6539\u
4E3A
\u
975E
\u
53EF
\u
53D1
\u
653E
\u
72B6
\u6001
830025
=
上传失败,请重新上传!
830025
=
\u
4E0A
\u
4F20
\u5931\u
8D25
\u
FF0C
\u
8BF7
\u
91CD
\u
65B0
\u
4E0A
\u
4F20
\u
FF01
830026
=
经纪人审批步骤出现问题,请联系it!
830026
=
\u
7ECF
\u
7EAA
\u
4EBA
\u
5BA1
\u6279\u
6B65
\u
9AA4
\u
51FA
\u
73B0
\u
95EE
\u9898
,
\u
8BF7
\u8054\u
7CFBit
\u
FF01
830027
=
标签级别不能为空!
830027
=
\u6807\u
7B7E
\u
7EA7
\u
522B
\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
\u
FF01
830028
=
此标签不是一级标签,上级标签id不能为空!
830028
=
\u
6B64
\u6807\u
7B7E
\u
4E0D
\u
662F
\u
4E00
\u
7EA7
\u6807\u
7B7E,
\u
4E0A
\u
7EA7
\u6807\u
7B7Eid
\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
\u
FF01
900003
=
保险公司响应报文为空!
900003
=
\u
4FDD
\u9669\u
516C
\u
53F8
\u
54CD
\u
5E94
\u
62A5
\u6587\u
4E3A
\u
7A7A
\u
FF01
830029
=
标签显示类别不能为空!
830029
=
\u6807\u
7B7E
\u
663E
\u
793A
\u
7C7B
\u
522B
\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
\u
FF01
830030
=
标签ID不能为空!
830030
=
\u6807\u
7B7EID
\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
\u
FF01
830031
=
标签是否有效不能为空!
830031
=
\u6807\u
7B7E
\u
662F
\u5426\u6709\u6548\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
\u
FF01
830032
=
上级显示标签不存在!
830032
=
\u
4E0A
\u
7EA7
\u
663E
\u
793A
\u6807\u
7B7E
\u
4E0D
\u
5B58
\u5728\u
FF01
830033
=
上级显示标签的标签显示类别与保存标签的显示类别不一致!
830033
=
\u
4E0A
\u
7EA7
\u
663E
\u
793A
\u6807\u
7B7E
\u7684\u6807\u
7B7E
\u
663E
\u
793A
\u
7C7B
\u
522B
\u
4E0E
\u
4FDD
\u
5B58
\u6807\u
7B7E
\u7684\u
663E
\u
793A
\u
7C7B
\u
522B
\u
4E0D
\u
4E00
\u
81F4
\u
FF01
830034
=
保存标签的标签级别与上级显示标签的标签级别不能相隔多级!
830034
=
\u
4FDD
\u
5B58
\u6807\u
7B7E
\u7684\u6807\u
7B7E
\u
7EA7
\u
522B
\u
4E0E
\u
4E0A
\u
7EA7
\u
663E
\u
793A
\u6807\u
7B7E
\u7684\u6807\u
7B7E
\u
7EA7
\u
522B
\u
4E0D
\u
80FD
\u
76F8
\u9694\u
591A
\u
7EA7
\u
FF01
830035
=
根据基础标签ID查找不到有效的基础标签!
830035
=
\u6839\u
636E
\u
57FA
\u7840\u6807\u
7B7EID
\u
67E5
\u
627E
\u
4E0D
\u5230\u6709\u6548\u7684\u
57FA
\u7840\u6807\u
7B7E
\u
FF01
830036
=
标签名称有值时标签级别不能为空!
830036
=
\u6807\u
7B7E
\u
540D
\u
79F0
\u6709\u
503C
\u
65F6
\u6807\u
7B7E
\u
7EA7
\u
522B
\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
\u
FF01
830037
=
该标签类别已经有一级标签!
830037
=
\u
8BE5
\u6807\u
7B7E
\u
7C7B
\u
522B
\u
5DF2
\u
7ECF
\u6709\u
4E00
\u
7EA7
\u6807\u
7B7E
\u
FF01
830038
=
该标签类别已存在相同的标签名称!
830038
=
\u
8BE5
\u6807\u
7B7E
\u
7C7B
\u
522B
\u
5DF2
\u
5B58
\u5728\u
76F8
\u
540C
\u7684\u6807\u
7B7E
\u
540D
\u
79F0
\u
FF01
##等保水平越权错误信息
830039
=
\u
5DF2
\u
4F5C
\u
5E9F
\u7684\u
8BB0
\u
5F55,
\u
4E0D
\u
80FD
\u
4FEE
\u6539
630028
=
该账户无权限访问此接口!
##\u7B49\u4FDD\u6C34\u5E73\u8D8A\u6743\u9519\u8BEF\u4FE1\u606F
630028
=
\u
8BE5
\u
8D26
\u6237\u
65E0
\u6743\u9650\u
8BBF
\u
95EE
\u
6B64
\u
63A5
\u
53E3
\u
FF01
yd-api/src/main/resources/mapper/agms/AgmsFortuneMapper.xml
View file @
fda39bfd
...
@@ -423,4 +423,544 @@
...
@@ -423,4 +423,544 @@
</select>
</select>
<sql
id=
"sheet2Data1"
>
select
pb.payout_yearmonth '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' ,
p.name '5' /*产品*/,
o.underwriting_date '6',
CONCAT(o.payment_term, (case o.payment_term_unit when 'Y' then '年' when 'M' then '月' else '年' END)) '7',
if(f.commission_period=1,f.fyc_rate,'') '8' /*'FYC%'*/,
if(f.order_id!=null, IFNULL(p.is_achievement_statistic,'100'), '') '9' /*'业绩折标率%'*/,
if(f.id=min(f.id),f.share_rate,'') '10' /*'分佣%'*/,
if(f.id=min(f.id),f.achievements_rate,'') '11' /*'业绩%'*/,
if(f.commission_period!=1,f.fyc_rate,'') '12' /*'RYC%'*/,
if(f.id=min(f.id),f.fyc_amount,'') '13'/*保单FYC*/,
if(f.id=min(f.id),f.referral_amount,'') '14' /*佣金FYC*/,
if(f.id=min(f.id),f.achievements,'') '15' /*业绩FYC*/,
if(f.commission_period!=1,f.fyc_amount,'') '16' /*保单RYC*/,
if(f.commission_period!=1,f.referral_amount,'') '17' /*佣金RYC*/,
(select name from ag_acl_channel where id = f.channel_id) '18' /*渠道*/,
coalesce(l.s1_id,l.s2_id,l.s3_id) as '19' /*FYC体系*/,
pra.name '20' /*销售经纪人*/,
ps.practitioner_level '21' /*经纪人职级*/,
if(f.id=min(f.id),f.grade_commission_rate,'') '22' /*职级率*/,
sum(case when drop_option_code ='C01' then f.referral_amount else null end) '23' /*首年销售佣金*/,
sum(case when drop_option_code ='C02' then f.referral_amount else null end) '24' /*续年销售佣金*/,
(SELECT group_concat(t.practitioner_id) from ag_acl_customer_fortune t
LEFT JOIN ag_po_order_commission c on c.id = t.commission_id
where t.drop_option_code ='R03' and t.order_id=f.order_id and t.sale_practitioner_id=l.practitioner_id and c.commission_status='2'
) '25' /*续期辅导人*/,
(SELECT group_concat(CONCAT_WS('-', t.practitioner_id, referral_amount))
from ag_acl_customer_fortune t
LEFT JOIN ag_po_order_commission c on c.id = t.commission_id
where t.drop_option_code ='R03' and t.order_id=f.order_id and t.sale_practitioner_id=l.practitioner_id and c.commission_status='2'
) '26' /*续期辅导奖金率*/,
(SELECT group_concat(CONCAT_WS('-', t.practitioner_id, referral_amount))
from ag_acl_customer_fortune t
LEFT JOIN ag_po_order_commission c on c.id = t.commission_id
where t.drop_option_code ='R03' and t.order_id=f.order_id and t.sale_practitioner_id=l.practitioner_id and c.commission_status='2'
) '27' /*续期辅导奖*/,
sum(case when drop_option_code ='C04' then f.calculation_rate else null end) '28' /*'经纪人月销售加码奖金%'*/,
sum(case when drop_option_code ='C04' then f.referral_amount else null end) '29' /*经纪人月销售加码奖金*/,
(SELECT group_concat(a.name)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where drop_option_code ='C05' and order_id=f.order_id and sale_practitioner_id = l.practitioner_id and a.id=l.introducer_id
) '30' /*推荐人*/,
(SELECT group_concat(calculation_rate)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where drop_option_code ='C05' and order_id=f.order_id and sale_practitioner_id = l.practitioner_id and a.id=l.introducer_id
) '31' /*个人推荐率*/,
(SELECT group_concat(referral_amount)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where drop_option_code ='C05' and order_id=f.order_id and sale_practitioner_id = l.practitioner_id and a.id=l.introducer_id
) '32' /*个人推荐奖¥*/,
(SELECT group_concat(calculation_rate)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where drop_option_code ='C15' and order_id=f.order_id and sale_practitioner_id = l.practitioner_id and a.id=l.s3_team_introducer_id
) '33' /*S1体系推荐率*/,
(SELECT group_concat(referral_amount)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where drop_option_code ='C15' and order_id=f.order_id and sale_practitioner_id = l.practitioner_id and a.id=l.s3_team_introducer_id
) '34' /*S1体系推荐奖金¥*/,
(SELECT group_concat(a.name)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where drop_option_code ='C06' and order_id=f.order_id and sale_practitioner_id = l.practitioner_id and a.id=l.mentor_id
) '35' /*一代辅导人*/,
(SELECT group_concat(op1.drop_option_name)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
LEFT JOIN ag_acl_practitioner_setting b on b.practitioner_id = a.id
LEFT JOIN ag_md_drop_options op1 ON op1.id = b.practitioner_level
where t.drop_option_code ='C06' and order_id=f.order_id and sale_practitioner_id = l.practitioner_id and a.id=l.mentor_id
) '36' /*一代辅导人职级*/,
(SELECT group_concat(calculation_rate)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where drop_option_code ='C06' and order_id=f.order_id and sale_practitioner_id = l.practitioner_id and a.id=l.mentor_id
) '37' /*'一代辅导人职级岗位津贴%'*/,
(SELECT group_concat(referral_amount)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where drop_option_code ='C06' and order_id=f.order_id and sale_practitioner_id = l.practitioner_id and a.id=l.mentor_id
) '38' /*一代辅导人岗位津贴*/,
(SELECT group_concat(op1.drop_option_name)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
LEFT JOIN ag_acl_practitioner_setting b on b.practitioner_id = a.id
LEFT JOIN ag_md_drop_options op1 ON op1.id = b.practitioner_level
where t.drop_option_code ='C07' and order_id=f.order_id and sale_practitioner_id = l.practitioner_id and a.id=l.in_mentor_id
) '39' /*二代辅导人*/,
(SELECT group_concat(op1.drop_option_name)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
LEFT JOIN ag_acl_practitioner_setting b on b.practitioner_id = a.id
LEFT JOIN ag_md_drop_options op1 ON op1.id = b.practitioner_level
where t.drop_option_code ='C07' and order_id=f.order_id and sale_practitioner_id = l.practitioner_id and a.id=l.in_mentor_id
) '40' /*二代辅导人职级*/,
(SELECT group_concat(calculation_rate)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where drop_option_code ='C07' and order_id=f.order_id and sale_practitioner_id = l.practitioner_id and a.id=l.in_mentor_id
) '41' /*'二代辅导人职级岗位津贴%'*/,
(SELECT group_concat(referral_amount)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where drop_option_code ='C06' and order_id=f.order_id and sale_practitioner_id = l.practitioner_id and a.id=l.in_mentor_id
) '42' /*二代辅导人岗位津贴*/,
l.s1_id '43' /*所属S1分部*/,
(case when l.s1_team_leader_id is not null then
(SELECT group_concat(calculation_rate)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where t.drop_option_code ='C08' and order_id=f.order_id and t.sale_practitioner_id=l.practitioner_id and a.id=l.s1_team_leader_id
) else null end) '44' /*S1团队达标奖金率*/,
(case when l.s1_team_leader_id is not null then
(SELECT group_concat(referral_amount)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where t.drop_option_code ='C08' and order_id=f.order_id and t.sale_practitioner_id=l.practitioner_id and a.id=l.s1_team_leader_id
) else null end) '45' /*'S1团队达标奖金¥(季度)'*/,
(case when l.s1_team_leader_id is not null then
(SELECT group_concat(calculation_rate)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where t.drop_option_code ='C10' and order_id=f.order_id and t.sale_practitioner_id=l.practitioner_id and a.id=l.s1_team_leader_id
) else null end) '46' /*S1团队长辅导津贴比率*/,
(case when l.s1_team_leader_id is not null then
(SELECT group_concat(referral_amount)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where t.drop_option_code ='C10' and order_id=f.order_id and t.sale_practitioner_id=l.practitioner_id and a.id=l.s1_team_leader_id
) else null end) '47' /*S1团队长辅导津贴*/,
if(f.commission_period!=1,
(SELECT group_concat(CONCAT_WS('-', t.practitioner_id, referral_amount))
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where t.drop_option_code ='C08' and order_id=f.order_id and t.sale_practitioner_id=l.practitioner_id and a.id=l.s1_team_leader_id
),
null) as '48' /*S1续期绩效奖金*/,
l.s2_id '49' /*所属S2体系*/,
(SELECT group_concat(calculation_rate)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where t.drop_option_code ='C08' and order_id=f.order_id and t.sale_practitioner_id=l.practitioner_id and a.id=l.s2_team_leader_id
) '50' /*S2团队达标奖金率*/,
(SELECT group_concat(referral_amount)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where t.drop_option_code ='C08' and order_id=f.order_id and t.sale_practitioner_id=l.practitioner_id and a.id=l.s2_team_leader_id
) '51' /*'S2团队达标奖金¥(季度)'*/,
(SELECT group_concat(calculation_rate)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where t.drop_option_code ='C10' and order_id=f.order_id and t.sale_practitioner_id=l.practitioner_id and a.id=l.s2_team_leader_id
) '52' /*S2团队长辅导津贴比率*/,
(SELECT group_concat(referral_amount)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where t.drop_option_code ='C10' and order_id=f.order_id and t.sale_practitioner_id=l.practitioner_id and a.id=l.s2_team_leader_id
) '53' /*S2团队长辅导津贴*/,
if(f.commission_period!=1,
(SELECT group_concat(referral_amount)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where t.drop_option_code ='C08' and order_id=f.order_id and t.sale_practitioner_id=l.practitioner_id and a.id=l.s2_team_leader_id
),
null) as '54' /*S2续期绩效奖金*/,
l.s3_id '55' /*所属S3纵队*/,
(SELECT group_concat(calculation_rate)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where t.drop_option_code ='C08' and order_id=f.order_id and t.sale_practitioner_id=l.practitioner_id and a.id=l.s3_team_leader_id
) '56' /*S3团队达标奖金率*/,
(SELECT group_concat(referral_amount)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where t.drop_option_code ='C08' and order_id=f.order_id and t.sale_practitioner_id=l.practitioner_id and a.id=l.s3_team_leader_id
) '57' /*'S3团队达标奖金¥(季度)'*/,
(SELECT group_concat(calculation_rate)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where t.drop_option_code ='C10' and order_id=f.order_id and t.sale_practitioner_id=l.practitioner_id and a.id=l.s3_team_leader_id
) '58' /*S3团队长辅导津贴比率*/,
(SELECT group_concat(referral_amount)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where t.drop_option_code ='C10' and order_id=f.order_id and t.sale_practitioner_id=l.practitioner_id and a.id=l.s3_team_leader_id
) '59' /*S3团队长辅导津贴*/,
(SELECT group_concat(a.name)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where drop_option_code ='C09' and order_id=f.order_id and sale_practitioner_id = l.practitioner_id and a.id=l.s1_raise_id
) '60' /*S1育成人*/,
(SELECT group_concat(op1.drop_option_name)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
LEFT JOIN ag_acl_practitioner_setting b on b.practitioner_id = a.id
LEFT JOIN ag_md_drop_options op1 ON op1.id = b.practitioner_level
where t.drop_option_code ='C09' and order_id=f.order_id and sale_practitioner_id = l.practitioner_id and a.id=l.s1_raise_id
) '61' /*S1育成人职级*/,
(SELECT group_concat(calculation_rate)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where drop_option_code ='C09' and order_id=f.order_id and sale_practitioner_id = l.practitioner_id and a.id=l.s1_raise_id
) '62' /*S1育成奖金率*/,
(SELECT group_concat(referral_amount)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where drop_option_code ='C09' and order_id=f.order_id and sale_practitioner_id = l.practitioner_id and a.id=l.s1_raise_id
) '63' /*S1育成金额*/,
sum(case when drop_option_code ='C14' then f.calculation_rate else null end) '64' /*C14直接销售加码佣金率*/,
sum(case when drop_option_code ='C14' then f.referral_amount else null end) '65' /*C14直接销售加码佣金*/,
if(o.settlement_rule_type=1,'简单基本法','标准基本法') '66' /*基本法属性*/,
sum(case when drop_option_code ='S01' then f.referral_amount else null end) '67' /*S01-首年度销售佣金*/,
(SELECT group_concat(CONCAT_WS('-', t.practitioner_id, referral_amount))
from ag_acl_customer_fortune t
LEFT JOIN ag_po_order_commission c on c.id = t.commission_id
where t.drop_option_code ='S03' and t.order_id=f.order_id and t.sale_practitioner_id=l.practitioner_id and c.commission_status='2'
) '68' /*S03-首年度辅导奖金*/,
null as '69' /*R01-首年度直接销售佣金(旧)*/,
sum(case when drop_option_code ='R02' then f.referral_amount else null end) '70' /*R02-续年度直接销售拥金(旧)*/,
(SELECT group_concat(CONCAT_WS('-', t.practitioner_id, referral_amount))
from ag_acl_customer_fortune t
LEFT JOIN ag_po_order_commission c on c.id = t.commission_id
where t.drop_option_code ='R03' and t.order_id=f.order_id and t.sale_practitioner_id=l.practitioner_id and c.commission_status='2'
) '71' /*R03-续年度辅导佣金(旧)*/,
(SELECT group_concat(CONCAT_WS('-', t.practitioner_id, referral_amount))
from ag_acl_customer_fortune t
LEFT JOIN ag_po_order_commission c on c.id = t.commission_id
where t.drop_option_code ='R04' and t.order_id=f.order_id and t.sale_practitioner_id=l.practitioner_id and c.commission_status='2'
) '72' /*R04-续年度绩效奖金(旧)*/,
(SELECT group_concat(a.name)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where drop_option_code ='C15' and order_id=f.order_id and sale_practitioner_id = l.practitioner_id and a.id=l.s1_team_introducer_id
) '73' /*S1推荐人*/,
(SELECT group_concat(a.name)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where drop_option_code ='C15' and order_id=f.order_id and sale_practitioner_id = l.practitioner_id and a.id=l.s2_team_introducer_id
) '74' /*S2推荐人*/,
(SELECT group_concat(calculation_rate)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where drop_option_code ='C15' and order_id=f.order_id and sale_practitioner_id = l.practitioner_id and a.id=l.s2_team_introducer_id
) '74' /*S2体系推荐率*/,
(SELECT group_concat(referral_amount)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where drop_option_code ='C15' and order_id=f.order_id and sale_practitioner_id = l.practitioner_id and a.id=l.s2_team_introducer_id
) '75' /*S2体系推荐奖金¥*/,
(SELECT group_concat(a.name)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where drop_option_code ='C15' and order_id=f.order_id and sale_practitioner_id = l.practitioner_id and a.id=l.s3_team_introducer_id
) '77' /*S3推荐人*/,
(SELECT group_concat(calculation_rate)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where drop_option_code ='C15' and order_id=f.order_id and sale_practitioner_id = l.practitioner_id and a.id=l.s3_team_introducer_id
) '78' /*S3体系推荐率*/,
(SELECT group_concat(referral_amount)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where drop_option_code ='C15' and order_id=f.order_id and sale_practitioner_id = l.practitioner_id and a.id=l.s3_team_introducer_id
) '79' /*S3体系推荐奖金¥*/,
(SELECT group_concat(a.name)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where drop_option_code ='C09' and order_id=f.order_id and sale_practitioner_id = l.practitioner_id and a.id=l.s2_raise_id
) '80' /*S2育成人*/,
(SELECT group_concat(op1.drop_option_name)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
LEFT JOIN ag_acl_practitioner_setting b on b.practitioner_id = a.id
LEFT JOIN ag_md_drop_options op1 ON op1.id = b.practitioner_level
where t.drop_option_code ='C09' and order_id=f.order_id and sale_practitioner_id = l.practitioner_id and a.id=l.s2_raise_id
) '81' /*S2育成人职级*/,
(SELECT group_concat(calculation_rate)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where drop_option_code ='C09' and order_id=f.order_id and sale_practitioner_id = l.practitioner_id and a.id=l.s2_raise_id
) '82' /*S2育成奖金率*/,
(SELECT group_concat(referral_amount)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where drop_option_code ='C09' and order_id=f.order_id and sale_practitioner_id = l.practitioner_id and a.id=l.s2_raise_id
) '83' /*S2育成金额*/,
(SELECT group_concat(a.name)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where drop_option_code ='C09' and order_id=f.order_id and sale_practitioner_id = l.practitioner_id and a.id=l.s3_raise_id
) '84' /*S3育成人*/,
(SELECT group_concat(op1.drop_option_name)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
LEFT JOIN ag_acl_practitioner_setting b on b.practitioner_id = a.id
LEFT JOIN ag_md_drop_options op1 ON op1.id = b.practitioner_level
where t.drop_option_code ='C09' and order_id=f.order_id and sale_practitioner_id = l.practitioner_id and a.id=l.s3_raise_id
) '85' /*S3育成人职级*/,
(SELECT group_concat(calculation_rate)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where drop_option_code ='C09' and order_id=f.order_id and sale_practitioner_id = l.practitioner_id and a.id=l.s3_raise_id
) '86' /*S3育成奖金率*/,
(SELECT group_concat(referral_amount)
from ag_acl_customer_fortune t
LEFT JOIN ag_acl_practitioner a on a.customer_id = t.customer_id
where drop_option_code ='C09' and order_id=f.order_id and sale_practitioner_id = l.practitioner_id and a.id=l.s3_raise_id
) '87' /*S3育成金额*/,
sum(case when drop_option_code ='C95' then f.referral_amount else null end) as '88' /*其它税前加扣款1*/,
sum(case when drop_option_code ='C96' then f.referral_amount else null end) as '89' /*其它税前加扣款2*/,
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' /*其它*/,
f.order_id,
l.customer_id
FROM ag_acl_customer_fortune f
INNER JOIN ag_acl_life_insurance_practitioner l on l.order_id = f.order_id and l.customer_id = f.customer_id
LEFT JOIN ag_acl_customer_fortune_payout_batch pb on pb.id = f.payout_batch_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_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.id in
<foreach
collection=
"list1"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item,jdbcType=BIGINT}
</foreach>
GROUP BY f.order_id, l.customer_id
</sql>
<select
id=
"querySheet2Data"
resultType=
"java.util.LinkedHashMap"
>
<include
refid=
"sheet2Data1"
/>
<if
test=
"list2.size() > 0"
>
UNION ALL
select
pb.payout_yearmonth '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' ,
p.name '5' /*产品*/,
o.underwriting_date '6',
CONCAT(o.payment_term, (case o.payment_term_unit when 'Y' then '年' when 'M' then '月' else '年' END)) '7',
ifnull(f.fyc_rate,'') '8' /*'FYC%'*/,
if(f.order_id!=null, IFNULL(p.is_achievement_statistic,'100'), '') '9' /*'业绩折标率%'*/,
ifnull( f.share_rate,'') '10' /*'分佣%'*/,
ifnull( f.achievements_rate,'') '11' /*'业绩%'*/,
if(f.commission_period!=1,f.fyc_rate,'') '12' /*'RYC%'*/,
ifnull( f.fyc_amount,'') '13'/*保单FYC*/,
ifnull( f.referral_amount,'') '14' /*佣金FYC*/,
ifnull( f.achievements,'') '15' /*业绩FYC*/,
if(f.commission_period!=1,f.fyc_amount,'') '16' /*保单RYC*/,
if(f.commission_period!=1,f.referral_amount,'') '17' /*佣金RYC*/,
(select name from ag_acl_channel where id = f.channel_id) '18' /*渠道*/,
null as '19' /*FYC体系*/,
(select name from ag_acl_practitioner where id = f.sale_practitioner_id) '20' /*销售经纪人*/,
(SELECT b.practitioner_level
from ag_acl_practitioner a
LEFT JOIN ag_acl_practitioner_setting b on b.practitioner_id = a.id
where a.id = f.sale_practitioner_id
) '21' /*经纪人职级*/,
ifnull(f.grade_commission_rate,'') '22' /*职级率*/,
null as '23' /*首年销售佣金*/,
null as '24' /*续年销售佣金*/,
null as '25' /*续期辅导人*/,
null as '26' /*续期辅导奖金率*/,
null as '27' /*续期辅导奖*/,
null as '28' /*'经纪人月销售加码奖金%'*/,
null as '29' /*经纪人月销售加码奖金*/,
null as '30' /*推荐人*/,
null as '31' /*个人推荐率*/,
null as '32' /*个人推荐奖¥*/,
null as '33' /*体系推荐率*/,
null as '34' /*体系推荐奖金¥*/,
null as '35' /*一代辅导人*/,
null as '36' /*一代辅导人职级*/,
null as '37' /*'一代辅导人职级岗位津贴%'*/,
null as '38' /*一代辅导人岗位津贴*/,
null as '39' /*二代辅导人*/,
null as '40' /*二代辅导人职级*/,
null as '41' /*'二代辅导人职级岗位津贴%'*/,
null as '42' /*二代辅导人岗位津贴*/,
(case when op1.drop_option_code='S1' then pra.subordinate_system_id else null end) as '43' /*所属S1分部*/,
(case when f.drop_option_code ='C08' and op1.drop_option_code='S1' then f.calculation_rate else null end) '44' /*S1团队达标奖金率*/,
(case when f.drop_option_code ='C08' and op1.drop_option_code='S1' then f.referral_amount else null end) '45' /*'S1团队达标奖金¥(季度)'*/,
(case when f.drop_option_code ='C10' and op1.drop_option_code='S1' then f.calculation_rate else null end) '46' /*S1团队长辅导津贴比率*/,
(case when f.drop_option_code ='C10' and op1.drop_option_code='S1' then f.referral_amount else null end) '47' /*S1团队长辅导津贴*/,
if(f.commission_period!=1,
(case when f.drop_option_code ='C08' and op1.drop_option_code='S1' then f.referral_amount else null end),
null) as '48' /*S1续期绩效奖金*/,
(case when op1.drop_option_code='S2' then pra.subordinate_system_id else null end) as '49' /*所属S2体系*/,
(case when f.drop_option_code ='C08' and op1.drop_option_code='S2' then f.calculation_rate else null end) '50' /*S2团队达标奖金率*/,
(case when f.drop_option_code ='C08' and op1.drop_option_code='S2' then f.referral_amount else null end) '51' /*'S2团队达标奖金¥(季度)'*/,
(case when f.drop_option_code ='C10' and op1.drop_option_code='S2' then f.calculation_rate else null end) '52' /*S2团队长辅导津贴比率*/,
(case when f.drop_option_code ='C10' and op1.drop_option_code='S2' then f.referral_amount else null end) '53' /*S2团队长辅导津贴*/,
if(f.commission_period!=1,
(case when f.drop_option_code ='C08' and op1.drop_option_code='S2' then f.referral_amount else null end),
null) as '54' /*S2续期绩效奖金*/,
(case when op1.drop_option_code='S3' then pra.subordinate_system_id else null end) as '55' /*所属S3纵队*/,
(case when f.drop_option_code ='C08' and op1.drop_option_code='S3' then f.calculation_rate else null end) '56' /*S3团队达标奖金率*/,
(case when f.drop_option_code ='C08' and op1.drop_option_code='S3' then f.referral_amount else null end) '57' /*'S3团队达标奖金¥(季度)'*/,
(case when f.drop_option_code ='C10' and op1.drop_option_code='S3' then f.calculation_rate else null end) '58' /*S3团队长辅导津贴比率*/,
(case when f.drop_option_code ='C10' and op1.drop_option_code='S3' then f.referral_amount else null end) '59' /*S3团队长辅导津贴*/,
null as '60' /*育成人*/,
null as '61' /*育成人职级*/,
null as '62' /*育成奖金率*/,
null as '63' /*育成金额*/,
null as '64' /*C14直接销售加码佣金率*/,
null as '65' /*C14直接销售加码佣金*/,
if(o.settlement_rule_type=1,'简单基本法','标准基本法') '66' /*基本法属性*/,
null as '67' /*S01-首年度销售佣金*/,
null as '68' /*S03-首年度辅导奖金*/,
null as '69' /*R01-首年度直接销售佣金(旧)*/,
null as '70' /*R02-续年度直接销售拥金(旧)*/,
null as '71' /*R03-续年度辅导佣金(旧)*/,
null as '72' /*R04-续年度绩效奖金(旧)*/,
null as '73' /*S1推荐人*/,
null as '74' /*S2推荐人*/,
null as '75' /*S2体系推荐率*/,
null as '76' /*S2体系推荐奖金¥*/,
null as '77' /*S3推荐人*/,
null as '78' /*S3体系推荐率*/,
null as '79' /*S3体系推荐奖金¥*/,
null as '80' /*S2育成人*/,
null as '81' /*S2育成人职级*/,
null as '82' /*S2育成奖金率*/,
null as '83' /*S2育成金额*/,
null as '84' /*S3育成人*/,
null as '85' /*S3育成人职级*/,
null as '86' /*S3育成奖金率*/,
null as '87' /*S3育成金额*/,
null as '88' /*其它税前加扣款1*/,
null as '89' /*其它税前加扣款2*/,
null as '90' /*其它税前加扣款3*/,
null as '91' /*其它税前加扣款4*/,
null as '92' /*其它*/,
f.order_id,
f.customer_id
FROM ag_acl_customer_fortune f
LEFT JOIN ag_acl_customer_fortune_payout_batch pb on pb.id = f.payout_batch_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.id in
<foreach
collection=
"list2"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item,jdbcType=BIGINT}
</foreach>
</if>
ORDER BY '2'
</select>
<select
id=
"querySalePractitionerFortune1"
parameterType=
"list"
resultType=
"Long"
>
SELECT f.id
FROM ag_acl_customer_fortune f
LEFT JOIN ag_acl_practitioner pra on pra.customer_id = f.customer_id
WHERE 1=1
and f.id in
<foreach
collection=
"list"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
and f.drop_option_code in ('C08', 'C10')
and pra.id in
(SELECT l.s1_team_leader_id
from ag_acl_life_insurance_practitioner l
where l.order_id = f.order_id
union all
SELECT l.s2_team_leader_id
from ag_acl_life_insurance_practitioner l
where l.order_id = f.order_id
union all
SELECT l.s3_team_leader_id
from ag_acl_life_insurance_practitioner l
where l.order_id = f.order_id
)
</select>
<select
id=
"querySalePractitionerFortune"
parameterType=
"list"
resultType=
"Long"
>
SELECT f.id
FROM ag_acl_customer_fortune f
LEFT JOIN ag_acl_practitioner pra on pra.customer_id = f.customer_id
WHERE 1=1
and f.id in
<foreach
collection=
"list"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
and f.drop_option_code in ('C08', 'C10')
</select>
</mapper>
</mapper>
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