Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-api-boot-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lanbaoming
jiedao-api-boot-master
Commits
0368aedb
Commit
0368aedb
authored
Oct 26, 2024
by
yanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: 合并联系人是将联系人copy一份保存后关联到主客户。 被合并客户的联系人删除,以备以后数据追加查验。
parent
9efe9a18
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
+17
-7
CustomerMergeServiceImpl.java
...r/controller/admin/customer/CustomerMergeServiceImpl.java
+17
-7
No files found.
yudao-module-customer/yudao-module-customer-rest/src/main/java/cn/iocoder/yudao/module/customer/controller/admin/customer/CustomerMergeServiceImpl.java
View file @
0368aedb
...
@@ -7,7 +7,6 @@ import cn.iocoder.yudao.framework.security.core.LoginUser;
...
@@ -7,7 +7,6 @@ import cn.iocoder.yudao.framework.security.core.LoginUser;
import
cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils
;
import
cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils
;
import
cn.iocoder.yudao.module.customer.dal.dataobject.customer.CustomerDO
;
import
cn.iocoder.yudao.module.customer.dal.dataobject.customer.CustomerDO
;
import
cn.iocoder.yudao.module.customer.dal.dataobject.customer.complaint.CustomerComplaintDO
;
import
cn.iocoder.yudao.module.customer.dal.dataobject.customer.complaint.CustomerComplaintDO
;
import
cn.iocoder.yudao.module.customer.dal.dataobject.customer.follow.CustomerFollowDO
;
import
cn.iocoder.yudao.module.customer.dal.dataobject.customerContacts.CustomerContactsDO
;
import
cn.iocoder.yudao.module.customer.dal.dataobject.customerContacts.CustomerContactsDO
;
import
cn.iocoder.yudao.module.customer.dal.dataobject.customerFollowup.CustomerFollowupDO
;
import
cn.iocoder.yudao.module.customer.dal.dataobject.customerFollowup.CustomerFollowupDO
;
import
cn.iocoder.yudao.module.customer.service.customer.CustomerService
;
import
cn.iocoder.yudao.module.customer.service.customer.CustomerService
;
...
@@ -33,6 +32,7 @@ import cn.iocoder.yudao.module.wealth.service.commissionPayment.CommissionPaymen
...
@@ -33,6 +32,7 @@ import cn.iocoder.yudao.module.wealth.service.commissionPayment.CommissionPaymen
import
cn.iocoder.yudao.module.wealth.service.receipt.ReceiptServiceImpl
;
import
cn.iocoder.yudao.module.wealth.service.receipt.ReceiptServiceImpl
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
lombok.extern.log4j.Log4j2
;
import
lombok.extern.log4j.Log4j2
;
import
org.apache.commons.beanutils.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
...
@@ -338,12 +338,22 @@ public class CustomerMergeServiceImpl implements CustomerMergeService {
...
@@ -338,12 +338,22 @@ public class CustomerMergeServiceImpl implements CustomerMergeService {
if
(
CollectionUtil
.
isNotEmpty
(
cuscontactList2
))
{
if
(
CollectionUtil
.
isNotEmpty
(
cuscontactList2
))
{
for
(
CustomerContactsDO
d
:
cuscontactList2
for
(
CustomerContactsDO
d
:
cuscontactList2
)
{
)
{
d
.
setCustomerId
(
customerDOSaved
.
getId
());
try
{
//被合并的客户联系人,默认为非默认
// 1、联系人copy一份
d
.
setIsDefault
(
0
);
CustomerContactsDO
newCustomer
=
new
CustomerContactsDO
();
d
.
setUpdateTime
(
new
Date
());
BeanUtils
.
copyProperties
(
newCustomer
,
d
);
d
.
setUpdater
(
String
.
valueOf
(
loginUserId
));
newCustomer
.
setId
(
null
);
customerContactsService
.
updateById
(
d
);
//被合并的客户联系人,默认为非默认
newCustomer
.
setIsDefault
(
0
);
// 设置被合并客户的联系人
newCustomer
.
setCustomerId
(
customerDOSaved
.
getId
());
customerContactsService
.
save
(
newCustomer
);
// 2、删除被合并客户的联系人
customerContactsService
.
deleteCustomerContacts
(
d
.
getId
());
}
catch
(
Exception
e
)
{
log
.
error
(
"合并客户联系人失败"
,
e
);
}
}
}
}
}
}
}
...
...
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