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
cfbd8b6b
Commit
cfbd8b6b
authored
Jul 31, 2023
by
wenyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
潜在客户功能调整为手机号与微信号填一个即可保存(律家保潜在客户只有微信号无手机号)
parent
c2cab714
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
72 additions
and
7 deletions
+72
-7
yd-api/src/main/java/com/yd/api/practitioner/service/impl/PractitionerServiceImpl.java
+67
-4
yd-api/src/main/java/com/yd/dal/entity/practitioner/opportunity/OwnOpportunityInfo.java
+1
-0
yd-api/src/main/resources/mapper/customer/AclCustomerMapper.xml
+1
-1
yd-api/src/main/resources/mapper/customer/AclPractitionerMapper.xml
+3
-2
No files found.
yd-api/src/main/java/com/yd/api/practitioner/service/impl/PractitionerServiceImpl.java
View file @
cfbd8b6b
...
...
@@ -1595,7 +1595,11 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
}
//保存基础信息
saveCustomerInfo
(
customerId
,
requestVO
);
CommonResult
commonResult
=
saveCustomerInfo
(
customerId
,
requestVO
);
if
(!
commonResult
.
isSuccess
())
{
resp
.
setCommonResult
(
commonResult
);
return
resp
;
}
//保存/激活新的标签
saveCustomerTag
(
customerId
,
requestVO
.
getOpportunityCustomerTags
(),
requestVO
);
//更新预设值
...
...
@@ -1741,9 +1745,33 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
return
createAccountId
(
mobileNo
,
"C_"
);
}
private
void
saveCustomerInfo
(
Long
customerId
,
OwnOpportunityBasicInformationSaveRequestVO
requestVO
)
{
private
CommonResult
saveCustomerInfo
(
Long
customerId
,
OwnOpportunityBasicInformationSaveRequestVO
requestVO
)
{
CommonResult
commonResult
=
new
CommonResult
(
true
,
ZHBErrorConfig
.
getErrorInfo
(
"800000"
));
AclCustomer
customer
=
aclCustomerDALService
.
findById
(
customerId
);
String
mobileNo
=
customer
.
getMobileNo
();
String
mobileNo
=
requestVO
.
getMobileNo
();
String
weChat
=
requestVO
.
getWeChat
();
Long
leadsAssignedId
=
requestVO
.
getLeadsAssignedId
();
if
(!
CommonUtil
.
isNullOrZero
(
leadsAssignedId
))
{
AclCustomer
aclCustomer
=
null
;
//判断手机号是否有修改
if
(!
CommonUtil
.
isNullOrBlank
(
requestVO
.
getMobileNo
())
&&
!
requestVO
.
getMobileNo
().
equals
(
customer
.
getMobileNo
())){
aclCustomer
=
aclCustomerDALService
.
findByMobileNo
(
requestVO
.
getMobileNo
());
commonResult
=
checkMobileNoAndWechat
(
aclCustomer
,
customerId
,
requestVO
);
if
(!
commonResult
.
isSuccess
())
{
return
commonResult
;
}
}
//判断微信号是否有修改
if
(!
CommonUtil
.
isNullOrBlank
(
requestVO
.
getWeChat
())
&&
!
requestVO
.
getWeChat
().
equals
(
customer
.
getWechatNo
())){
aclCustomer
=
aclCustomerDALService
.
findByWeChatNo
(
requestVO
.
getWeChat
());
commonResult
=
checkMobileNoAndWechat
(
aclCustomer
,
customerId
,
requestVO
);
if
(!
commonResult
.
isSuccess
())
{
return
commonResult
;
}
}
}
String
idNo
=
customer
.
getIdNo
();
customer
.
setMobileNo
(
mobileNo
);
customer
.
setIdNo
(
idNo
);
...
...
@@ -1752,11 +1780,46 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
customer
.
setGender
(
requestVO
.
getGender
());
customer
.
setAddress
(
requestVO
.
getAddress
());
customer
.
setAge
(
requestVO
.
getAge
());
customer
.
setWechatNo
(
requestVO
.
getWeChat
()
);
customer
.
setWechatNo
(
weChat
);
customer
.
setOtherContacts
(
requestVO
.
getOtherContacts
());
customer
.
setZodiacTypeId
(
requestVO
.
getZodiacTypeId
());
customer
.
setBloodTypeId
(
requestVO
.
getBloodTypeId
());
aclCustomerDALService
.
update
(
customer
);
return
commonResult
;
}
private
CommonResult
checkMobileNoAndWechat
(
AclCustomer
aclCustomer
,
Long
customerId
,
OwnOpportunityBasicInformationSaveRequestVO
requestVO
){
CommonResult
commonResult
=
new
CommonResult
(
true
,
ZHBErrorConfig
.
getErrorInfo
(
"800000"
));
//判断是否通过手机号码找到客户
if
(
aclCustomer
!=
null
&&
aclCustomer
.
getId
().
longValue
()
!=
customerId
.
longValue
())
{
MktLeadsAssigneds
mktLeadsAssigneds
=
new
MktLeadsAssigneds
();
mktLeadsAssigneds
.
setCustomerId
(
aclCustomer
.
getId
());
mktLeadsAssigneds
.
setIsActive
(
1
);
List
<
MktLeadsAssigneds
>
mktLeadsAssignedsList
=
mktLeadsAssignedsDALService
.
findByMktLeadsAssigneds
(
mktLeadsAssigneds
);
if
(!
mktLeadsAssignedsList
.
isEmpty
())
{
MktLeadsAssignedTrack
leadsAssignedTrack
=
mktLeadsAssignedTrackDALService
.
findByListNotesForCustomerId
(
aclCustomer
.
getId
());
Long
mdDropOptionId
=
leadsAssignedTrack
.
getMdDropOptionId
();
//判断最后一条跟进状态是否为失败,是失败则无需判断经纪人id和之前是否一致
MdDropOptions
mdDropOption
=
mdDropOptionsDALService
.
findById
(
mdDropOptionId
);
if
(!
"refused"
.
equalsIgnoreCase
(
mdDropOption
.
getDropOptionCode
()))
{
Long
assignedPractitionerId
=
requestVO
.
getAssignedPractitionerId
();
//获取最新track对应的leads
for
(
MktLeadsAssigneds
item
:
mktLeadsAssignedsList
)
{
if
(
item
.
getId
().
equals
(
leadsAssignedTrack
.
getLeadsAssignedId
()))
{
//跳出错误
if
(
item
.
getAssignedPractitionerId
().
equals
(
assignedPractitionerId
))
{
return
new
CommonResult
(
false
,
"该商机已存在"
);
}
else
{
return
new
CommonResult
(
false
,
ZHBErrorConfig
.
getErrorInfo
(
"830014"
));
}
}
}
}
}
}
return
commonResult
;
}
private
void
saveLeadsAssigneds
(
OwnOpportunityBasicInformationSaveRequestVO
requestVO
)
{
...
...
yd-api/src/main/java/com/yd/dal/entity/practitioner/opportunity/OwnOpportunityInfo.java
View file @
cfbd8b6b
...
...
@@ -16,5 +16,6 @@ public class OwnOpportunityInfo {
private
Double
scoreTotal
;
private
Long
expertType
;
//0.经纪人指派 1.专家指派
private
Long
sfpMainId
;
private
String
wechatNo
;
}
yd-api/src/main/resources/mapper/customer/AclCustomerMapper.xml
View file @
cfbd8b6b
...
...
@@ -770,7 +770,7 @@
<include
refid=
"Base_Column_List"
/>
from ag_acl_customer
where mobile_no = #{mobileNo,jdbcType=VARCHAR,typeHandler=com.yd.util.deshandler.DESTypeHandler}
and is_active=1
and is_active=1
order by id desc limit 0,1
</select>
<select
id=
"findByWeChatNo"
resultMap=
"BaseResultMap"
>
select
...
...
yd-api/src/main/resources/mapper/customer/AclPractitionerMapper.xml
View file @
cfbd8b6b
...
...
@@ -1517,7 +1517,7 @@
<result
column=
"scoreTotal"
property=
"scoreTotal"
/>
<result
column=
"expertType"
property=
"expertType"
/>
<result
column=
"sfpMainId"
property=
"sfpMainId"
/>
<result
column=
"wechatNo"
property=
"wechatNo"
/>
</resultMap>
<select
id=
"ownOpportunityQuery"
resultMap=
"opportunityQuery"
>
SELECT
...
...
@@ -1533,7 +1533,8 @@
if(ass.id is null ,0,1) expertType ,
p.remark remark,
p.appointment_record_id appointmentRecordId,
p.sfp_main_id sfpMainId
p.sfp_main_id sfpMainId,
c.wechat_no wechatNo
FROM
ag_mkt_leads_assigneds a
left join ag_mkt_leads_expert_request r on r.customer_id = a.customer_id and r.is_active =1
...
...
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