yzc 1 жил өмнө
parent
commit
3bd5d70d16

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

@@ -109,6 +109,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
             List<Long> cuIds = customerUserService.listObject(CustomerUser::getCustomerId, q -> q
                     .like(CustomerUser::getName, dto.getKeyword()).or()
                     .like(CustomerUser::getEmail, dto.getKeyword())
+                    .isNotNull(CustomerUser::getCustomerId)
                     .groupBy(CustomerUser::getCustomerId)
             );
             wrapper.and(q -> q
@@ -121,6 +122,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
         if (ObjectUtil.isNotEmpty(dto.getContactName())) {
             List<Long> cuIds = customerUserService.listObject(CustomerUser::getCustomerId, q -> q
                     .like(CustomerUser::getName, dto.getContactName())
+                    .isNotNull(CustomerUser::getCustomerId)
                     .groupBy(CustomerUser::getCustomerId)
             );
             cuIds.add(null);
@@ -130,6 +132,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
         if (ObjectUtil.isNotEmpty(dto.getContactEmail())) {
             List<Long> cuIds = customerUserService.listObject(CustomerUser::getCustomerId, q -> q
                     .like(CustomerUser::getEmail, dto.getContactEmail())
+                    .isNotNull(CustomerUser::getCustomerId)
                     .groupBy(CustomerUser::getCustomerId)
             );
             cuIds.add(null);