yzc преди 2 години
родител
ревизия
1e6b9edb16
променени са 1 файла, в които са добавени 1 реда и са изтрити 0 реда
  1. 1 0
      hx-customer/src/main/java/com/fjhx/customer/service/customer/impl/CustomerServiceImpl.java

+ 1 - 0
hx-customer/src/main/java/com/fjhx/customer/service/customer/impl/CustomerServiceImpl.java

@@ -206,6 +206,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
     private void saveCustomerUse(CustomerDto customerDto) {
         List<CustomerUser> customerUserDtoList = customerDto.getCustomerUserList();
         customerUserDtoList.forEach(customerUserDto -> customerUserDto.setCustomerId(customerDto.getId()));
+        customerUserDtoList.forEach(customerUserDto -> customerUserDto.setId(null));//防止传id过来导致key冲突
         customerUserService.saveBatch(customerUserDtoList);
     }