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
7bdaf668
Commit
7bdaf668
authored
May 12, 2020
by
yao.xiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改-经纪人商机保存
parent
faaf84d4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
12 deletions
+21
-12
yd-api/src/main/java/com/yd/api/practitioner/service/impl/PractitionerServiceImpl.java
+19
-12
yd-api/src/main/resources/i18n/messages_zh_CN.properties
+2
-0
No files found.
yd-api/src/main/java/com/yd/api/practitioner/service/impl/PractitionerServiceImpl.java
View file @
7bdaf668
...
...
@@ -547,6 +547,15 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
String
mktCampaignId
=
mktCampaign
.
split
(
","
)[
0
];
MdMkCampaign
mdMkCampaign
=
mdMkCampaignDALService
.
findByMktCampaignId
(
Long
.
valueOf
(
mktCampaignId
));
info
.
setSourceChannel
(
mdMkCampaign
.
getName
());
}
else
{
MktLeadsPool
pool
=
mktLeadsPoolDALService
.
findByCustomerId
(
customerId
);
if
(
pool
!=
null
){
Integer
sourceFrom
=
pool
.
getSourceFrom
();
if
(!
CommonUtil
.
isNullOrZero
(
sourceFrom
)){
MdDropOptions
dropOption
=
mdDropOptionsDALService
.
findByDropOptionId
(
Long
.
valueOf
(
sourceFrom
));
info
.
setSourceChannel
(
dropOption
.
getDropOptionName
());
}
}
}
info
.
setAddress
(
customer
.
getAddress
());
MktLeadsAssignedTrack
mktLeadsAssignedTrack
=
new
MktLeadsAssignedTrack
();
...
...
@@ -792,11 +801,12 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
Long
customerId
=
requestVO
.
getOpportunityId
();
if
(
CommonUtil
.
isNullOrZero
(
leadsAssignedId
)){
//判断是否为经纪人自己创建商机
CommonResult
commonResult
=
isCreateOpportunity
(
requestVO
,
customerId
);
CommonResult
commonResult
=
isCreateOpportunity
(
requestVO
);
if
(!
commonResult
.
isSuccess
()){
resp
.
setCommonResult
(
commonResult
);
return
resp
;
}
customerId
=
requestVO
.
getOpportunityId
();
}
//保存基础信息
...
...
@@ -810,25 +820,19 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
return
resp
;
}
private
CommonResult
isCreateOpportunity
(
OwnOpportunityBasicInformationSaveRequestVO
requestVO
,
Long
customerId
)
{
private
CommonResult
isCreateOpportunity
(
OwnOpportunityBasicInformationSaveRequestVO
requestVO
)
{
Long
customerId
;
//当指派id为null时,认为是保存新的商机
//校验商机号码,手机号码对应的customer是否存在
String
mobileNo
=
requestVO
.
getMobileNo
();
AclCustomer
aclCustomer
=
aclCustomerDALService
.
findByMobileNo
(
mobileNo
);
//判断是否通过手机号码找到客户
if
(
aclCustomer
!=
null
){
//找到客户判断起身份,不是普通用户,则提示
Long
channelReferralRateId
=
aclCustomer
.
getChannelReferralRateId
();
if
(
channelReferralRateId
!=
3L
){
return
new
CommonResult
(
false
,
"此人不是普通客户"
);
}
//普通用户,在查询LeadsAssigneds,看是否已被分配
MktLeadsAssigneds
mktLeadsAssigneds
=
new
MktLeadsAssigneds
();
mktLeadsAssigneds
.
setCustomerId
(
aclCustomer
.
getId
());
List
<
MktLeadsAssigneds
>
mktLeadsAssignedsList
=
mktLeadsAssignedsDALService
.
findByMktLeadsAssigneds
(
mktLeadsAssigneds
);
if
(!
mktLeadsAssignedsList
.
isEmpty
()){
return
new
CommonResult
(
false
,
"此客户已是其他经纪人商机"
);
return
new
CommonResult
(
false
,
ZHBErrorConfig
.
getErrorInfo
(
"830014"
)
);
}
}
else
{
//此人为第一次进来
...
...
@@ -877,6 +881,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
assigneds
.
setUpdatedAt
(
new
Date
());
assigneds
.
setUpdatedBy
(-
1L
);
mktLeadsAssignedsDALService
.
save
(
assigneds
);
requestVO
.
setOpportunityId
(
customerId
);
requestVO
.
setLeadsAssignedId
(
assigneds
.
getId
());
return
new
CommonResult
(
true
,
ZHBErrorConfig
.
getErrorInfo
(
"800000"
));
}
...
...
@@ -892,17 +897,19 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
private
void
saveCustomerInfo
(
Long
customerId
,
OwnOpportunityBasicInformationSaveRequestVO
requestVO
)
{
AclCustomer
customer
=
aclCustomerDALService
.
findById
(
customerId
);
DESTypeHandler
jpaCryptoConverter
=
new
DESTypeHandler
();
String
mobileNo
=
customer
.
getMobileNo
();
customer
.
setMobileNo
(
jpaCryptoConverter
.
encode
(
mobileNo
));
customer
.
setName
(
requestVO
.
getName
());
customer
.
setBirthDate
(
CommonUtil
.
stringParseDate
(
requestVO
.
getBirthDate
(),
"yyyy-MM-dd"
));
customer
.
setGender
(
requestVO
.
getGender
());
customer
.
setSourceChannel
(
requestVO
.
getSourceChannel
());
customer
.
setAddress
(
requestVO
.
getAddress
());
customer
.
setAge
(
requestVO
.
getAge
());
customer
.
setWechatNo
(
requestVO
.
getWeChat
());
customer
.
setOtherContacts
(
requestVO
.
getOtherContacts
());
customer
.
setZodiacTypeId
(
requestVO
.
getZodiacTypeId
());
customer
.
setBloodTypeId
(
requestVO
.
getBloodTypeId
());
aclCustomerDALService
.
sav
e
(
customer
);
aclCustomerDALService
.
updat
e
(
customer
);
}
private
void
saveLeadsAssigneds
(
OwnOpportunityBasicInformationSaveRequestVO
requestVO
)
{
...
...
yd-api/src/main/resources/i18n/messages_zh_CN.properties
View file @
7bdaf668
...
...
@@ -25,4 +25,5 @@
830011
=
该增员已存在!
830012
=
请填写跟进时间!
830013
=
请填写备注!
830014
=
此客户已是其他经纪人商机
900003
=
保险公司响应报文为空!
\ No newline at end of file
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