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
c2cab714
Commit
c2cab714
authored
Jul 31, 2023
by
wenyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
潜在客户功能调整为手机号与微信号填一个即可保存(律家保潜在客户只有微信号无手机号)
parent
1aa37e73
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
65 additions
and
17 deletions
+65
-17
yd-api/src/main/java/com/yd/api/practitioner/service/impl/PractitionerServiceImpl.java
+45
-10
yd-api/src/main/java/com/yd/dal/mapper/customer/AclCustomerMapper.java
+2
-0
yd-api/src/main/java/com/yd/dal/service/customer/AclCustomerDALService.java
+2
-0
yd-api/src/main/java/com/yd/dal/service/customer/impl/AclCustomerDALServiceImpl.java
+9
-7
yd-api/src/main/resources/mapper/customer/AclCustomerMapper.xml
+7
-0
No files found.
yd-api/src/main/java/com/yd/api/practitioner/service/impl/PractitionerServiceImpl.java
View file @
c2cab714
...
@@ -1577,6 +1577,11 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
...
@@ -1577,6 +1577,11 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
@Override
@Override
public
OwnOpportunityBasicInformationSaveResponseVO
ownOpportunityBasicInformationSave
(
OwnOpportunityBasicInformationSaveRequestVO
requestVO
)
{
public
OwnOpportunityBasicInformationSaveResponseVO
ownOpportunityBasicInformationSave
(
OwnOpportunityBasicInformationSaveRequestVO
requestVO
)
{
OwnOpportunityBasicInformationSaveResponseVO
resp
=
new
OwnOpportunityBasicInformationSaveResponseVO
();
OwnOpportunityBasicInformationSaveResponseVO
resp
=
new
OwnOpportunityBasicInformationSaveResponseVO
();
if
(
CommonUtil
.
isNullOrBlank
(
requestVO
.
getMobileNo
())
&&
CommonUtil
.
isNullOrBlank
(
requestVO
.
getWeChat
()))
{
CommonResult
commonResult
=
new
CommonResult
(
false
,
"手机号与微信号不能同时为空!"
);
resp
.
setCommonResult
(
commonResult
);
return
resp
;
}
Long
leadsAssignedId
=
requestVO
.
getLeadsAssignedId
();
Long
leadsAssignedId
=
requestVO
.
getLeadsAssignedId
();
Long
customerId
=
requestVO
.
getOpportunityId
();
Long
customerId
=
requestVO
.
getOpportunityId
();
if
(
CommonUtil
.
isNullOrZero
(
leadsAssignedId
))
{
if
(
CommonUtil
.
isNullOrZero
(
leadsAssignedId
))
{
...
@@ -1592,7 +1597,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
...
@@ -1592,7 +1597,7 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
//保存基础信息
//保存基础信息
saveCustomerInfo
(
customerId
,
requestVO
);
saveCustomerInfo
(
customerId
,
requestVO
);
//保存/激活新的标签
//保存/激活新的标签
saveCustomerTag
(
customerId
,
requestVO
.
getOpportunityCustomerTags
());
saveCustomerTag
(
customerId
,
requestVO
.
getOpportunityCustomerTags
()
,
requestVO
);
//更新预设值
//更新预设值
saveLeadsAssigneds
(
requestVO
);
saveLeadsAssigneds
(
requestVO
);
resp
.
setLeadsAssignedId
(
requestVO
.
getLeadsAssignedId
());
resp
.
setLeadsAssignedId
(
requestVO
.
getLeadsAssignedId
());
...
@@ -1607,7 +1612,12 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
...
@@ -1607,7 +1612,12 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
//当指派id为null时,认为是保存新的商机
//当指派id为null时,认为是保存新的商机
//校验商机号码,手机号码对应的customer是否存在
//校验商机号码,手机号码对应的customer是否存在
String
mobileNo
=
requestVO
.
getMobileNo
();
String
mobileNo
=
requestVO
.
getMobileNo
();
AclCustomer
aclCustomer
=
aclCustomerDALService
.
findByMobileNo
(
mobileNo
);
AclCustomer
aclCustomer
=
null
;
if
(
CommonUtil
.
isNullOrBlank
(
mobileNo
)
&&
!
CommonUtil
.
isNullOrBlank
(
requestVO
.
getWeChat
())){
aclCustomer
=
aclCustomerDALService
.
findByWeChatNo
(
requestVO
.
getWeChat
());
}
else
{
aclCustomer
=
aclCustomerDALService
.
findByMobileNo
(
mobileNo
);
}
Long
mdMkCampaignId
=
systemConfigService
.
getMdMkCampaignId
(
"leadaddedbypractioner"
);
Long
mdMkCampaignId
=
systemConfigService
.
getMdMkCampaignId
(
"leadaddedbypractioner"
);
//判断是否通过手机号码找到客户
//判断是否通过手机号码找到客户
...
@@ -1641,9 +1651,16 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
...
@@ -1641,9 +1651,16 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
//帮其经行注册
//帮其经行注册
aclCustomer
=
new
AclCustomer
();
aclCustomer
=
new
AclCustomer
();
aclCustomer
.
setRole
(
2
);
//1= Staff 2=Customer 3=Partner
aclCustomer
.
setRole
(
2
);
//1= Staff 2=Customer 3=Partner
aclCustomer
.
setAccountId
(
createAccountId
(
mobileNo
));
if
(
CommonUtil
.
isNullOrBlank
(
mobileNo
)
&&
!
CommonUtil
.
isNullOrBlank
(
requestVO
.
getWeChat
())){
aclCustomer
.
setLogin
(
mobileNo
);
aclCustomer
.
setAccountId
(
createAccountId
(
requestVO
.
getWeChat
(),
"W_"
));
aclCustomer
.
setMobileNo
(
mobileNo
);
aclCustomer
.
setLogin
(
requestVO
.
getWeChat
());
aclCustomer
.
setMobileNo
(
mobileNo
);
aclCustomer
.
setWechatNo
(
requestVO
.
getWeChat
());
}
else
{
aclCustomer
.
setAccountId
(
createAccountId
(
mobileNo
));
aclCustomer
.
setLogin
(
mobileNo
);
aclCustomer
.
setMobileNo
(
mobileNo
);
}
aclCustomer
.
setCusLevel
(
1
);
aclCustomer
.
setCusLevel
(
1
);
aclCustomer
.
setName
(
requestVO
.
getName
());
aclCustomer
.
setName
(
requestVO
.
getName
());
aclCustomer
.
setIsActive
(
1
);
aclCustomer
.
setIsActive
(
1
);
...
@@ -1707,13 +1724,21 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
...
@@ -1707,13 +1724,21 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
return
new
CommonResult
(
true
,
ZHBErrorConfig
.
getErrorInfo
(
"800000"
));
return
new
CommonResult
(
true
,
ZHBErrorConfig
.
getErrorInfo
(
"800000"
));
}
}
private
String
createAccountId
(
String
mobileNo
)
{
private
String
createAccountId
(
String
mobileNo
,
String
type
)
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyyMMddHHmmss"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyyMMddHHmmss"
);
String
sub
=
null
;
String
sub
=
null
;
if
(
mobileNo
!=
null
&&
!
""
.
equals
(
mobileNo
))
{
if
(
mobileNo
!=
null
&&
!
""
.
equals
(
mobileNo
))
{
sub
=
mobileNo
.
substring
(
mobileNo
.
length
()
-
6
);
if
(
mobileNo
.
length
()
>
6
){
sub
=
mobileNo
.
substring
(
mobileNo
.
length
()
-
6
);
}
else
{
sub
=
mobileNo
;
}
}
}
return
"C_"
+
sub
+
"_"
+
sdf
.
format
(
new
Date
());
return
type
+
sub
+
"_"
+
sdf
.
format
(
new
Date
());
}
private
String
createAccountId
(
String
mobileNo
)
{
return
createAccountId
(
mobileNo
,
"C_"
);
}
}
private
void
saveCustomerInfo
(
Long
customerId
,
OwnOpportunityBasicInformationSaveRequestVO
requestVO
)
{
private
void
saveCustomerInfo
(
Long
customerId
,
OwnOpportunityBasicInformationSaveRequestVO
requestVO
)
{
...
@@ -1745,7 +1770,17 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
...
@@ -1745,7 +1770,17 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
mktLeadsAssignedsDALService
.
updateMktLeadsAssigneds
(
mktLeadsAssigneds
);
mktLeadsAssignedsDALService
.
updateMktLeadsAssigneds
(
mktLeadsAssigneds
);
}
}
private
void
saveCustomerTag
(
Long
customerId
,
List
<
OpportunityCustomerTag
>
opportunityCustomerTags
)
{
private
void
saveCustomerTag
(
Long
customerId
,
List
<
OpportunityCustomerTag
>
opportunityCustomerTags
,
OwnOpportunityBasicInformationSaveRequestVO
requestVO
)
{
if
(
CommonUtil
.
isNullOrBlank
(
requestVO
.
getMobileNo
())
&&
!
CommonUtil
.
isNullOrBlank
(
requestVO
.
getWeChat
())){
if
(
opportunityCustomerTags
==
null
||
opportunityCustomerTags
.
size
()
==
0
){
String
ljbWechatTag
=
mdCodeDALService
.
findCodeByType
(
"LJB_Wechat_tag"
);
if
(!
Strings
.
isNullOrEmpty
(
ljbWechatTag
))
{
OpportunityCustomerTag
e
=
new
OpportunityCustomerTag
();
e
.
setTagId
(
Long
.
valueOf
(
ljbWechatTag
));
opportunityCustomerTags
.
add
(
e
);
}
}
}
//保存标签
//保存标签
//此人的原有标签全部至0
//此人的原有标签全部至0
ObjectCollectionTagged
tagged
=
new
ObjectCollectionTagged
();
ObjectCollectionTagged
tagged
=
new
ObjectCollectionTagged
();
...
...
yd-api/src/main/java/com/yd/dal/mapper/customer/AclCustomerMapper.java
View file @
c2cab714
...
@@ -22,6 +22,8 @@ public interface AclCustomerMapper {
...
@@ -22,6 +22,8 @@ public interface AclCustomerMapper {
AclCustomer
findByMobileNo
(
String
mobileNo
);
AclCustomer
findByMobileNo
(
String
mobileNo
);
AclCustomer
findByWeChatNo
(
String
weChatNo
);
List
<
AclCustomer
>
findByIds
(
@Param
(
"customerIds"
)
List
<
Long
>
customerIds
);
List
<
AclCustomer
>
findByIds
(
@Param
(
"customerIds"
)
List
<
Long
>
customerIds
);
List
<
AclCustomer
>
findByObj
(
AclCustomer
aclCustomer
);
List
<
AclCustomer
>
findByObj
(
AclCustomer
aclCustomer
);
...
...
yd-api/src/main/java/com/yd/dal/service/customer/AclCustomerDALService.java
View file @
c2cab714
...
@@ -32,6 +32,8 @@ public interface AclCustomerDALService {
...
@@ -32,6 +32,8 @@ public interface AclCustomerDALService {
AclCustomer
findByCustomerId
(
Long
customerId
);
AclCustomer
findByCustomerId
(
Long
customerId
);
AclCustomer
findByMobileNo
(
String
mobileNo
);
AclCustomer
findByMobileNo
(
String
mobileNo
);
AclCustomer
findByWeChatNo
(
String
weChatNo
);
List
<
AclCustomer
>
findByIds
(
List
<
Long
>
customerIds
);
List
<
AclCustomer
>
findByIds
(
List
<
Long
>
customerIds
);
...
...
yd-api/src/main/java/com/yd/dal/service/customer/impl/AclCustomerDALServiceImpl.java
View file @
c2cab714
package
com
.
yd
.
dal
.
service
.
customer
.
impl
;
package
com
.
yd
.
dal
.
service
.
customer
.
impl
;
import
com.yd.dal.entity.customer.AclCustomer
;
import
java.util.List
;
import
com.yd.dal.mapper.customer.AclCustomerMapper
;
import
com.yd.dal.service.customer.AclCustomerDALService
;
import
com.yd.util.deshandler.DESTypeHandler
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
com.yd.dal.entity.customer.AclCustomer
;
import
com.yd.dal.mapper.customer.AclCustomerMapper
;
import
com.yd.dal.service.customer.AclCustomerDALService
;
@Service
(
"aclCustomerDalService"
)
@Service
(
"aclCustomerDalService"
)
public
class
AclCustomerDALServiceImpl
implements
AclCustomerDALService
{
public
class
AclCustomerDALServiceImpl
implements
AclCustomerDALService
{
...
@@ -48,6 +45,11 @@ public class AclCustomerDALServiceImpl implements AclCustomerDALService {
...
@@ -48,6 +45,11 @@ public class AclCustomerDALServiceImpl implements AclCustomerDALService {
}
}
@Override
@Override
public
AclCustomer
findByWeChatNo
(
String
weChatNo
)
{
return
aclCustomerMapper
.
findByWeChatNo
(
weChatNo
);
}
@Override
public
List
<
AclCustomer
>
findByIds
(
List
<
Long
>
customerIds
)
{
public
List
<
AclCustomer
>
findByIds
(
List
<
Long
>
customerIds
)
{
return
aclCustomerMapper
.
findByIds
(
customerIds
);
return
aclCustomerMapper
.
findByIds
(
customerIds
);
}
}
...
...
yd-api/src/main/resources/mapper/customer/AclCustomerMapper.xml
View file @
c2cab714
...
@@ -772,6 +772,13 @@
...
@@ -772,6 +772,13 @@
where mobile_no = #{mobileNo,jdbcType=VARCHAR,typeHandler=com.yd.util.deshandler.DESTypeHandler}
where mobile_no = #{mobileNo,jdbcType=VARCHAR,typeHandler=com.yd.util.deshandler.DESTypeHandler}
and is_active=1
and is_active=1
</select>
</select>
<select
id=
"findByWeChatNo"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from ag_acl_customer
where wechat_no = #{wechatNo,jdbcType=VARCHAR}
and is_active=1 order by id desc limit 0,1
</select>
<select
id=
"findByIds"
resultMap=
"BaseResultMap"
>
<select
id=
"findByIds"
resultMap=
"BaseResultMap"
>
select
select
...
...
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