|
@@ -304,8 +304,8 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
|
|
|
|
|
|
// 修改客户表的信息
|
|
// 修改客户表的信息
|
|
this.updateById(customerDto);
|
|
this.updateById(customerDto);
|
|
- // 删除客户-用户表的信息
|
|
|
|
- customerUserService.remove(Wrappers.<CustomerUser>lambdaQuery().eq(CustomerUser::getCustomerId, customerDto.getId()));
|
|
|
|
|
|
+// // 删除客户-用户表的信息
|
|
|
|
+// customerUserService.remove(Wrappers.<CustomerUser>lambdaQuery().eq(CustomerUser::getCustomerId, customerDto.getId()));
|
|
// 添加客户-联系人表的信息
|
|
// 添加客户-联系人表的信息
|
|
saveCustomerUse(customerDto);
|
|
saveCustomerUse(customerDto);
|
|
}
|
|
}
|
|
@@ -352,8 +352,9 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
|
|
private void saveCustomerUse(CustomerDto customerDto) {
|
|
private void saveCustomerUse(CustomerDto customerDto) {
|
|
List<CustomerUser> customerUserDtoList = customerDto.getCustomerUserList();
|
|
List<CustomerUser> customerUserDtoList = customerDto.getCustomerUserList();
|
|
customerUserDtoList.forEach(customerUserDto -> customerUserDto.setCustomerId(customerDto.getId()));
|
|
customerUserDtoList.forEach(customerUserDto -> customerUserDto.setCustomerId(customerDto.getId()));
|
|
- customerUserDtoList.forEach(customerUserDto -> customerUserDto.setId(null));//防止传id过来导致key冲突
|
|
|
|
- customerUserService.saveBatch(customerUserDtoList);
|
|
|
|
|
|
+// customerUserDtoList.forEach(customerUserDto -> customerUserDto.setId(null));//防止传id过来导致key冲突
|
|
|
|
+// customerUserService.saveBatch(customerUserDtoList);
|
|
|
|
+ customerUserService.editLinked(customerUserDtoList, CustomerUser::getCustomerId, customerDto.getId());
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|