Commit 1057211b authored by Đào Nhật Quang's avatar Đào Nhật Quang

quangdn

parent f7f1e07f
...@@ -1126,7 +1126,7 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1126,7 +1126,7 @@ public class CustomerServiceImpl implements CustomerService {
isMainPhoneNull = true; isMainPhoneNull = true;
} else { } else {
if (validateNumberOnly(rawDataList.get(i)[headerMap.get(BundleUtils.getLangString("customer.mainPhone", locale).split("#")[0])].toString().trim())) { if (validateNumberOnly(rawDataList.get(i)[headerMap.get(BundleUtils.getLangString("customer.mainPhone", locale).split("#")[0])].toString().trim())) {
sb.append(validateExistPhone(rawDataList.get(i)[headerMap.get(BundleUtils.getLangString("customer.mainPhone", locale).split("#")[0])].toString().trim(), locale)); sb.append(validateExistPhone(rawDataList.get(i)[headerMap.get(BundleUtils.getLangString("customer.mainPhone", locale).split("#")[0])].toString().trim(), locale, true));
} else { } else {
sb.append(BundleUtils.getLangString("customer.onlyNumber", locale)); sb.append(BundleUtils.getLangString("customer.onlyNumber", locale));
} }
...@@ -1135,7 +1135,7 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1135,7 +1135,7 @@ public class CustomerServiceImpl implements CustomerService {
isSecondPhoneNull = true; isSecondPhoneNull = true;
} else { } else {
if (validateNumberOnly(rawDataList.get(i)[headerMap.get(BundleUtils.getLangString("customer.secondPhone", locale).split("#")[0])].toString().trim())) { if (validateNumberOnly(rawDataList.get(i)[headerMap.get(BundleUtils.getLangString("customer.secondPhone", locale).split("#")[0])].toString().trim())) {
sb.append(validateLength(BundleUtils.getLangString("customer.secondPhone", locale).split("#")[0], rawDataList.get(i)[headerMap.get(BundleUtils.getLangString("customer.secondPhone", locale).split("#")[0])].toString(), 50, locale)); sb.append(validateExistPhone(rawDataList.get(i)[headerMap.get(BundleUtils.getLangString("customer.secondPhone", locale).split("#")[0])].toString(), locale, false));
} else { } else {
sb.append(BundleUtils.getLangString("customer.onlyNumber", locale)); sb.append(BundleUtils.getLangString("customer.onlyNumber", locale));
} }
...@@ -1380,7 +1380,7 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1380,7 +1380,7 @@ public class CustomerServiceImpl implements CustomerService {
} }
//<editor-fold desc="Validate Methods" defaultstate="collapsed"> //<editor-fold desc="Validate Methods" defaultstate="collapsed">
private String validateExistPhone(String str, Locale locale) { private String validateExistPhone(String str, Locale locale, boolean isCheckDuplicate) {
String result = ""; String result = "";
String[] arr = str.split(";"); String[] arr = str.split(";");
List<CustomerContact> contactList; List<CustomerContact> contactList;
...@@ -1397,6 +1397,7 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1397,6 +1397,7 @@ public class CustomerServiceImpl implements CustomerService {
} }
} }
} }
if (isCheckDuplicate) {
for (int i = 0; i < arr.length; i++) { for (int i = 0; i < arr.length; i++) {
contactList = customerContactRepository.findCustomerContactsByContactEquals(arr[i]); contactList = customerContactRepository.findCustomerContactsByContactEquals(arr[i]);
if (contactList.size() != 0) { if (contactList.size() != 0) {
...@@ -1404,6 +1405,7 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1404,6 +1405,7 @@ public class CustomerServiceImpl implements CustomerService {
break; break;
} }
} }
}
return result; return result;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment