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
5b5c26e1
Commit
5b5c26e1
authored
Jan 13, 2022
by
wenyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
查询经纪人寿险销售保单,以前是通过N22接口获取,现在通过本地获取
parent
9ddb7538
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
108 additions
and
36 deletions
+108
-36
yd-api/src/main/java/com/yd/api/practitioner/service/impl/PractitionerBasicInfoServiceImpl.java
+48
-29
yd-api/src/main/java/com/yd/dal/mapper/order/PoOrderMapper.java
+2
-0
yd-api/src/main/java/com/yd/dal/service/order/Impl/PoOrderDALServiceImpl.java
+5
-0
yd-api/src/main/java/com/yd/dal/service/order/PoOrderDALService.java
+2
-0
yd-api/src/main/resources/mapper/order/PoOrderMapper.xml
+51
-7
No files found.
yd-api/src/main/java/com/yd/api/practitioner/service/impl/PractitionerBasicInfoServiceImpl.java
View file @
5b5c26e1
...
@@ -134,8 +134,8 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
...
@@ -134,8 +134,8 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
return
responseVO
;
return
responseVO
;
}
}
String
mobileNo
=
aclPractitionerDALService
.
findMobileNoByPractitionerId
(
practitionerId
);
//
String mobileNo = aclPractitionerDALService.findMobileNoByPractitionerId(practitionerId);
if
(!
Strings
.
isNullOrEmpty
(
mobileNo
)
&&
mobileNo
.
length
()
==
11
)
{
//
if (!Strings.isNullOrEmpty(mobileNo) && mobileNo.length() == 11) {
List
<
PolicyInfo
>
policyInfoList
=
new
ArrayList
<>();
List
<
PolicyInfo
>
policyInfoList
=
new
ArrayList
<>();
Integer
time
=
requestVO
.
getTime
();
Integer
time
=
requestVO
.
getTime
();
if
(
Integer
.
valueOf
(
"1"
).
equals
(
platform
))
{
if
(
Integer
.
valueOf
(
"1"
).
equals
(
platform
))
{
...
@@ -145,7 +145,8 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
...
@@ -145,7 +145,8 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
//2、线下
//2、线下
// getPolicyListForEGolden(policyInfoList, mobileNo, time);
// getPolicyListForEGolden(policyInfoList, mobileNo, time);
try
{
try
{
getPolicyListFromN22
(
policyInfoList
,
mobileNo
,
time
);
// getPolicyListFromN22(policyInfoList, mobileNo, time);
getPolicyListFrom
(
policyInfoList
,
practitionerId
,
time
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
responseVO
.
setCommonResult
(
new
CommonResult
(
false
,
e
.
getMessage
()));
responseVO
.
setCommonResult
(
new
CommonResult
(
false
,
e
.
getMessage
()));
...
@@ -156,9 +157,9 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
...
@@ -156,9 +157,9 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
responseVO
.
setPolicyInfoList
(
policyInfoList
);
responseVO
.
setPolicyInfoList
(
policyInfoList
);
Collections
.
sort
(
policyInfoList
);
Collections
.
sort
(
policyInfoList
);
responseVO
.
setCommonResult
(
new
CommonResult
(
true
,
ZHBErrorConfig
.
getErrorInfo
(
"800000"
)));
responseVO
.
setCommonResult
(
new
CommonResult
(
true
,
ZHBErrorConfig
.
getErrorInfo
(
"800000"
)));
}
else
{
//
} else {
responseVO
.
setCommonResult
(
new
CommonResult
(
false
,
ZHBErrorConfig
.
getErrorInfo
(
"820001"
)));
//
responseVO.setCommonResult(new CommonResult(false, ZHBErrorConfig.getErrorInfo("820001")));
}
//
}
}
else
{
}
else
{
String
[]
params
=
{
"practitionerId"
};
String
[]
params
=
{
"practitionerId"
};
responseVO
.
setCommonResult
(
new
CommonResult
(
false
,
ZHBErrorConfig
.
getErrorInfo
(
"610001"
,
params
)));
responseVO
.
setCommonResult
(
new
CommonResult
(
false
,
ZHBErrorConfig
.
getErrorInfo
(
"610001"
,
params
)));
...
@@ -1972,31 +1973,49 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
...
@@ -1972,31 +1973,49 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
Long
customerId
=
practitioner
.
getCustomerId
();
Long
customerId
=
practitioner
.
getCustomerId
();
if
(
customerId
!=
null
){
if
(
customerId
!=
null
){
List
<
CustomerPolicyInfo
>
policyInfos
=
poOrderDALService
.
findPolicyInfoByCustomerId
(
customerId
,
time
);
List
<
CustomerPolicyInfo
>
policyInfos
=
poOrderDALService
.
findPolicyInfoByCustomerId
(
customerId
,
time
);
if
(!
policyInfos
.
isEmpty
()){
policyInfoConvert
(
policyInfoList
,
policyInfos
);
PolicyInfo
policyInfo
;
}
Map
<
Long
,
String
>
planNameMap
=
new
HashMap
<>();
}
Map
<
Long
,
String
>
productNameMap
=
new
HashMap
<>();
}
List
<
ProductPlan
>
plans
=
productPlanDALService
.
findAll
();
List
<
Product
>
products
=
productDALService
.
findAll
();
/**
products
.
forEach
(
i
->
productNameMap
.
put
(
i
.
getId
(),
i
.
getName
()));
* 银盾保险寿险保单--查询经纪人寿险保单列表
plans
.
forEach
(
i
->
planNameMap
.
put
(
i
.
getId
(),
i
.
getName
()));
* @param policyInfoList 保单列表
Long
planId
;
* @param practitionerId 经纪人id
for
(
CustomerPolicyInfo
item
:
policyInfos
){
* @param time 时间段
planId
=
item
.
getPlanId
();
* @throws Exception
policyInfo
=
new
PolicyInfo
();
*/
BeanUtils
.
copyProperties
(
item
,
policyInfo
);
private
void
getPolicyListFrom
(
List
<
PolicyInfo
>
policyInfoList
,
Long
practitionerId
,
Integer
time
)
throws
Exception
{
if
(
planId
!=
null
){
if
(
practitionerId
!=
null
){
policyInfo
.
setPlanName
(
planNameMap
.
get
(
planId
));
AclPractitioner
practitioner
=
aclPractitionerDALService
.
findById
(
practitionerId
);
policyInfo
.
setNoPlanProduct
(
false
);
Long
customerId
=
practitioner
.
getCustomerId
();
}
else
{
if
(
customerId
!=
null
){
policyInfo
.
setProductName
(
productNameMap
.
get
(
item
.
getProductId
()));
List
<
CustomerPolicyInfo
>
policyInfos
=
poOrderDALService
.
findLifePolicyInfoByCustomerId
(
customerId
,
time
);
policyInfo
.
setNoPlanProduct
(
true
);
policyInfoConvert
(
policyInfoList
,
policyInfos
);
}
}
policyInfo
.
setPlatform
(
1
);
}
policyInfoList
.
add
(
policyInfo
);
}
}
/**
* 把查询结果集转换为保单显示列表
* @param policyInfoList 保单返回列表
* @param policyInfos 查询结果集列表
*/
private
void
policyInfoConvert
(
List
<
PolicyInfo
>
policyInfoList
,
List
<
CustomerPolicyInfo
>
policyInfos
)
{
if
(!
policyInfos
.
isEmpty
()){
PolicyInfo
policyInfo
;
for
(
CustomerPolicyInfo
item
:
policyInfos
){
policyInfo
=
new
PolicyInfo
();
BeanUtils
.
copyProperties
(
item
,
policyInfo
);
if
(!
Strings
.
isNullOrEmpty
(
policyInfo
.
getPlanName
())){
policyInfo
.
setNoPlanProduct
(
false
);
}
else
{
policyInfo
.
setNoPlanProduct
(
true
);
}
}
policyInfo
.
setPlatform
(
1
);
policyInfoList
.
add
(
policyInfo
);
}
}
}
}
}
}
}
}
yd-api/src/main/java/com/yd/dal/mapper/order/PoOrderMapper.java
View file @
5b5c26e1
...
@@ -19,6 +19,8 @@ public interface PoOrderMapper {
...
@@ -19,6 +19,8 @@ public interface PoOrderMapper {
List
<
CustomerPolicyInfo
>
findPolicyInfoByCustomerId
(
@Param
(
"customerId"
)
Long
customerId
,
@Param
(
"time"
)
Integer
time
);
List
<
CustomerPolicyInfo
>
findPolicyInfoByCustomerId
(
@Param
(
"customerId"
)
Long
customerId
,
@Param
(
"time"
)
Integer
time
);
List
<
CustomerPolicyInfo
>
findLifePolicyInfoByCustomerId
(
@Param
(
"customerId"
)
Long
customerId
,
@Param
(
"time"
)
Integer
time
);
List
<
CustomerPolicyInfo
>
findPolicyInfoByMobileNoE
(
@Param
(
"mobileNo"
)
String
mobileNo
,
@Param
(
"time"
)
Integer
time
);
List
<
CustomerPolicyInfo
>
findPolicyInfoByMobileNoE
(
@Param
(
"mobileNo"
)
String
mobileNo
,
@Param
(
"time"
)
Integer
time
);
String
findOrderNoByPolicyNo
(
@Param
(
"policyNo"
)
String
policyNo
);
String
findOrderNoByPolicyNo
(
@Param
(
"policyNo"
)
String
policyNo
);
...
...
yd-api/src/main/java/com/yd/dal/service/order/Impl/PoOrderDALServiceImpl.java
View file @
5b5c26e1
...
@@ -34,6 +34,11 @@ public class PoOrderDALServiceImpl implements PoOrderDALService {
...
@@ -34,6 +34,11 @@ public class PoOrderDALServiceImpl implements PoOrderDALService {
}
}
@Override
@Override
public
List
<
CustomerPolicyInfo
>
findLifePolicyInfoByCustomerId
(
Long
customerId
,
Integer
time
)
{
return
poOrderMapper
.
findLifePolicyInfoByCustomerId
(
customerId
,
time
);
}
@Override
@TargetDataSource
(
dataSourceKey
=
DataSourceKey
.
DB_EGOLDEN
)
@TargetDataSource
(
dataSourceKey
=
DataSourceKey
.
DB_EGOLDEN
)
public
List
<
CustomerPolicyInfo
>
findPolicyInfoByMobileNoE
(
String
mobileNo
,
Integer
time
)
{
public
List
<
CustomerPolicyInfo
>
findPolicyInfoByMobileNoE
(
String
mobileNo
,
Integer
time
)
{
return
poOrderMapper
.
findPolicyInfoByMobileNoE
(
mobileNo
,
time
);
return
poOrderMapper
.
findPolicyInfoByMobileNoE
(
mobileNo
,
time
);
...
...
yd-api/src/main/java/com/yd/dal/service/order/PoOrderDALService.java
View file @
5b5c26e1
...
@@ -13,6 +13,8 @@ public interface PoOrderDALService {
...
@@ -13,6 +13,8 @@ public interface PoOrderDALService {
PoOrder
findByOrderId
(
Long
orderId
);
PoOrder
findByOrderId
(
Long
orderId
);
List
<
CustomerPolicyInfo
>
findPolicyInfoByCustomerId
(
Long
customerId
,
Integer
time
);
List
<
CustomerPolicyInfo
>
findPolicyInfoByCustomerId
(
Long
customerId
,
Integer
time
);
List
<
CustomerPolicyInfo
>
findLifePolicyInfoByCustomerId
(
Long
customerId
,
Integer
time
);
List
<
CustomerPolicyInfo
>
findPolicyInfoByMobileNoE
(
String
mobileNo
,
Integer
time
);
List
<
CustomerPolicyInfo
>
findPolicyInfoByMobileNoE
(
String
mobileNo
,
Integer
time
);
...
...
yd-api/src/main/resources/mapper/order/PoOrderMapper.xml
View file @
5b5c26e1
...
@@ -1023,25 +1023,69 @@
...
@@ -1023,25 +1023,69 @@
f.order_price as orderPrice,
f.order_price as orderPrice,
o.plan_id as planId,
o.plan_id as planId,
o.product_id as productId ,
o.product_id as productId ,
f.id as fortuneId
f.id as fortuneId,
FROM ag_acl_customer_fortune f INNER JOIN ag_po_order o ON f.order_id = o.id and o.status = 3 and o.order_price
pr.name as productName,
>
0 and o.insurer_id != 888
pl.name as planName
inner JOIN ag_acl_policyholder p ON o.id = p.order_id and p.type = 2
FROM ag_acl_customer_fortune f
INNER JOIN ag_po_order o ON f.order_id = o.id and o.status = 3 AND o.payment_status=3 and o.order_price
>
0 and o.insurer_id != 888
INNER JOIN ag_acl_policyholder p ON o.id = p.order_id and p.type = 2
LEFT JOIN ag_product pr ON pr.id = o.product_id
LEFT JOIN ag_product_plan pl ON pl.id = o.plan_id
WHERE f.drop_option_code = 'S01' AND f.customer_id = #{customerId,jdbcType=BIGINT}
WHERE f.drop_option_code = 'S01' AND f.customer_id = #{customerId,jdbcType=BIGINT}
<choose>
<choose>
<when
test=
"time == 1"
>
<when
test=
"time == 1"
>
and DATE_FORMAT(
f
.order_date, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
and DATE_FORMAT(
o
.order_date, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</when>
</when>
<when
test=
"time == 3"
>
<when
test=
"time == 3"
>
and QUARTER(
f.order_date) = QUARTER(NOW()) AND year(f
.order_date)=year(now())
and QUARTER(
o.order_date) = QUARTER(NOW()) AND year(o
.order_date)=year(now())
</when>
</when>
<when
test=
"time == 2"
>
<when
test=
"time == 2"
>
and YEAR(
f
.order_date) = YEAR(now())
and YEAR(
o
.order_date) = YEAR(now())
</when>
</when>
<otherwise>
<otherwise>
</otherwise>
</otherwise>
</choose>
</choose>
</select>
</select>
<select
id=
"findLifePolicyInfoByCustomerId"
resultType=
"com.yd.dal.entity.order.CustomerPolicyInfo"
>
SELECT
o.id as orderId,
o.order_no as orderNo ,
o.policy_no as policyNo ,
p.name as holderName,
o.destination as destination,
date_format(o.order_date, '%Y-%m-%d %H:%i:%s') as orderDate,
date_format(o.effective_start_date, '%Y-%m-%d %H:%i:%s') as startDate,
date_format(o.effective_end_date, '%Y-%m-%d %H:%i:%s') as endDate,
f.referral_amount as referralAmount,
f.order_price as orderPrice,
o.plan_id as planId,
o.product_id as productId ,
f.id as fortuneId,
pr.name as productName,
pl.name as planName
FROM ag_acl_customer_fortune f
INNER JOIN ag_po_order o ON f.order_id = o.id AND o.status = 3 AND o.payment_status=3 AND o.order_price
>
0 AND o.insurer_id != 888
INNER JOIN ag_acl_policyholder p ON o.id = p.order_id AND p.type = 2
INNER JOIN ag_acl_policyholder ph ON o.id = ph.order_id AND f.customer_id = ph.customer_id AND ph.type = 7
LEFT JOIN ag_product pr ON pr.id = o.product_id
LEFT JOIN ag_product_plan pl ON pl.id = o.plan_id
WHERE f.drop_option_code IN('S01','C01') AND o.product_category_id ='8' AND f.customer_id = #{customerId,jdbcType=BIGINT}
<choose>
<when
test=
"time == 1"
>
and DATE_FORMAT(o.order_date, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
</when>
<when
test=
"time == 3"
>
and QUARTER(o.order_date) = QUARTER(NOW()) AND year(o.order_date)=year(now())
</when>
<when
test=
"time == 2"
>
and YEAR(o.order_date) = YEAR(now())
</when>
<otherwise>
</otherwise>
</choose>
</select>
<select
id=
"findPolicyInfoByMobileNoE"
resultType=
"com.yd.dal.entity.order.CustomerPolicyInfo"
>
<select
id=
"findPolicyInfoByMobileNoE"
resultType=
"com.yd.dal.entity.order.CustomerPolicyInfo"
>
SELECT
SELECT
policy.INS_MST_ID as orderNo ,
policy.INS_MST_ID as orderNo ,
...
...
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