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

quangdn

parent 4b201f38
...@@ -7,6 +7,7 @@ import com.viettel.campaign.model.ccms_full.CustomizeFields; ...@@ -7,6 +7,7 @@ import com.viettel.campaign.model.ccms_full.CustomizeFields;
import com.viettel.campaign.web.dto.*; import com.viettel.campaign.web.dto.*;
import com.viettel.campaign.web.dto.request_dto.CustomerRequestDTO; import com.viettel.campaign.web.dto.request_dto.CustomerRequestDTO;
import com.viettel.campaign.web.dto.request_dto.SearchCustomerRequestDTO; import com.viettel.campaign.web.dto.request_dto.SearchCustomerRequestDTO;
import com.viettel.econtact.filter.UserSession;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -66,7 +67,7 @@ public interface CustomerService { ...@@ -66,7 +67,7 @@ public interface CustomerService {
byte[] buildTemplate(Long companySiteId); byte[] buildTemplate(Long companySiteId);
Map<String, Object> readAndValidateCustomer(String path, List<CustomizeFields> headerDTOS, Long companySiteId); Map<String, Object> readAndValidateCustomer(String path, List<CustomizeFields> headerDTOS, UserSession userSession, Long customerListId);
List<CustomizeFieldObject> getCustomizeField(Long customerId); List<CustomizeFieldObject> getCustomizeField(Long customerId);
} }
...@@ -6,14 +6,12 @@ import com.viettel.campaign.mapper.CustomerMapper; ...@@ -6,14 +6,12 @@ import com.viettel.campaign.mapper.CustomerMapper;
import com.viettel.campaign.model.ccms_full.*; import com.viettel.campaign.model.ccms_full.*;
import com.viettel.campaign.repository.ccms_full.*; import com.viettel.campaign.repository.ccms_full.*;
import com.viettel.campaign.service.CustomerService; import com.viettel.campaign.service.CustomerService;
import com.viettel.campaign.utils.Constants; import com.viettel.campaign.utils.*;
import com.viettel.campaign.utils.DataUtil;
import com.viettel.campaign.utils.HibernateUtil;
import com.viettel.campaign.utils.SQLBuilder;
import com.viettel.campaign.web.dto.*; import com.viettel.campaign.web.dto.*;
import com.viettel.campaign.web.dto.request_dto.CustomerDetailRequestDTO; import com.viettel.campaign.web.dto.request_dto.CustomerDetailRequestDTO;
import com.viettel.campaign.web.dto.request_dto.CustomerRequestDTO; import com.viettel.campaign.web.dto.request_dto.CustomerRequestDTO;
import com.viettel.campaign.web.dto.request_dto.SearchCustomerRequestDTO; import com.viettel.campaign.web.dto.request_dto.SearchCustomerRequestDTO;
import com.viettel.econtact.filter.UserSession;
import org.apache.poi.ss.usermodel.*; import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress; import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.ss.util.CellRangeAddressList; import org.apache.poi.ss.util.CellRangeAddressList;
...@@ -888,8 +886,9 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -888,8 +886,9 @@ public class CustomerServiceImpl implements CustomerService {
} }
@Override @Override
public Map<String, Object> readAndValidateCustomer(String path, List<CustomizeFields> dynamicHeader, Long companySiteId) { public Map<String, Object> readAndValidateCustomer(String path, List<CustomizeFields> dynamicHeader, UserSession userSession, Long customerListId) {
LOGGER.info("------------READ AND VALIDATE--------------"); LOGGER.info("------------READ AND VALIDATE--------------");
Locale locale = new Locale("vi", "VN");
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
...@@ -897,33 +896,32 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -897,33 +896,32 @@ public class CustomerServiceImpl implements CustomerService {
try { try {
//<editor-fold desc="Khởi tạo mảng header tĩnh" defaultstate="collapsed"> //<editor-fold desc="Khởi tạo mảng header tĩnh" defaultstate="collapsed">
// List<String> staticHeader = new ArrayList<>();
// staticHeader.add("STT");
// staticHeader.add("Họ và tên#Bắt buộc\nĐịnh dạng chữ\ntối đa 1000 ký tự");
// staticHeader.add("Số điện thoại chính#Định dạng số\ncho phép nhập nhiều số điện thoại chính\ncác số cách nhau bởi dấu chấm phấy\ntối đa 50 ký tự");
// staticHeader.add("Số điện thoại phụ#Định dạng số\ncho phép nhập nhiều số điện thoại phụ\ncác số cách nhau bởi dấu chấm phấy\ntối đa 50 ký tự");
// staticHeader.add("Email chính#Cho phép nhập nhiều email\nmỗi email cách nhau bởi dấu \";\"\ntối đa 100 ký tự");
// staticHeader.add("Địa chỉ#Tối đa 500 ký tự");
// staticHeader.add("Loại khách hàng");
// staticHeader.add("Công ty#Tối đa 100 ký tự");
// staticHeader.add("Ghi chú#Tối đa 2000 ký tự");
// staticHeader.add("Cho phép gọi ra");
// staticHeader.add("Cho phép gửi email");
// staticHeader.add("Cho phép gửi sms");
List<CustomizeFields> header = new ArrayList<>(); List<CustomizeFields> header = new ArrayList<>();
header.add(new CustomizeFields("text", "STT")); // header.add(new CustomizeFields("text", "STT"));
header.add(new CustomizeFields("text", "Họ và tên#Bắt buộc\nĐịnh dạng chữ\ntối đa 1000 ký tự")); // header.add(new CustomizeFields("text", "Họ và tên#Bắt buộc\nĐịnh dạng chữ\ntối đa 1000 ký tự"));
header.add(new CustomizeFields("text", "Số điện thoại chính#Định dạng số\ncho phép nhập nhiều số điện thoại chính\ncác số cách nhau bởi dấu chấm phấy hoặc dấu phẩy\ntối đa 50 ký tự")); // header.add(new CustomizeFields("text", "Số điện thoại chính#Định dạng số\ncho phép nhập nhiều số điện thoại chính\ncác số cách nhau bởi dấu chấm phấy hoặc dấu phẩy\ntối đa 50 ký tự"));
header.add(new CustomizeFields("text", "Số điện thoại phụ#Định dạng số\ncho phép nhập nhiều số điện thoại phụ\ncác số cách nhau bởi dấu chấm phấy hoặc dấu phẩy\ntối đa 50 ký tự")); // header.add(new CustomizeFields("text", "Số điện thoại phụ#Định dạng số\ncho phép nhập nhiều số điện thoại phụ\ncác số cách nhau bởi dấu chấm phấy hoặc dấu phẩy\ntối đa 50 ký tự"));
header.add(new CustomizeFields("text", "Email chính#Cho phép nhập nhiều email\nmỗi email cách nhau bởi dấu \",\"\ntối đa 100 ký tự")); // header.add(new CustomizeFields("text", "Email chính#Cho phép nhập nhiều email\nmỗi email cách nhau bởi dấu \",\"\ntối đa 100 ký tự"));
header.add(new CustomizeFields("text", "Địa chỉ#Tối đa 500 ký tự")); // header.add(new CustomizeFields("text", "Địa chỉ#Tối đa 500 ký tự"));
header.add(new CustomizeFields("combobox", "Loại khách hàng")); // header.add(new CustomizeFields("combobox", "Loại khách hàng"));
header.add(new CustomizeFields("text", "Công ty#Tối đa 100 ký tự")); // header.add(new CustomizeFields("text", "Công ty#Tối đa 100 ký tự"));
header.add(new CustomizeFields("text", "Ghi chú#Tối đa 2000 ký tự")); // header.add(new CustomizeFields("text", "Ghi chú#Tối đa 2000 ký tự"));
header.add(new CustomizeFields("combobox", "Cho phép gọi ra")); // header.add(new CustomizeFields("combobox", "Cho phép gọi ra"));
header.add(new CustomizeFields("combobox", "Cho phép gửi email")); // header.add(new CustomizeFields("combobox", "Cho phép gửi email"));
header.add(new CustomizeFields("combobox", "Cho phép gửi sms")); // header.add(new CustomizeFields("combobox", "Cho phép gửi sms"));
header.add(new CustomizeFields("text", BundleUtils.getLangString("customer.no", locale)));
header.add(new CustomizeFields("text", BundleUtils.getLangString("customer.fullname", locale)));
header.add(new CustomizeFields("text", BundleUtils.getLangString("customer.mainPhone", locale)));
header.add(new CustomizeFields("text", BundleUtils.getLangString("customer.secondPhone", locale)));
header.add(new CustomizeFields("text", BundleUtils.getLangString("customer.email", locale)));
header.add(new CustomizeFields("text", BundleUtils.getLangString("customer.address", locale)));
header.add(new CustomizeFields("combobox", BundleUtils.getLangString("customer.cusType", locale)));
header.add(new CustomizeFields("text", BundleUtils.getLangString("customer.companyName", locale)));
header.add(new CustomizeFields("text", BundleUtils.getLangString("customer.description", locale)));
header.add(new CustomizeFields("combobox", BundleUtils.getLangString("customer.callAllowed", locale)));
header.add(new CustomizeFields("combobox", BundleUtils.getLangString("customer.emailAllowed", locale)));
header.add(new CustomizeFields("combobox", BundleUtils.getLangString("customer.smsAllowed", locale)));
header.addAll(dynamicHeader); header.addAll(dynamicHeader);
//</editor-fold> //</editor-fold>
...@@ -951,7 +949,7 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -951,7 +949,7 @@ public class CustomerServiceImpl implements CustomerService {
Cell cell = row.getCell(i); Cell cell = row.getCell(i);
if (!cell.getStringCellValue().equals(header.get(i).getTitle().split("#")[0])) { if (!cell.getStringCellValue().equals(header.get(i).getTitle().split("#")[0])) {
result.put("file", file); result.put("file", file);
result.put("message", "Template sai dinh dang"); result.put("message", BundleUtils.getLangString("customer.invalidTemplate", locale));
return result; return result;
} }
} }
...@@ -961,12 +959,12 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -961,12 +959,12 @@ public class CustomerServiceImpl implements CustomerService {
//<editor-fold desc="Kiểm tra file dữ liệu rỗng" defaultstate="collapsed"> //<editor-fold desc="Kiểm tra file dữ liệu rỗng" defaultstate="collapsed">
if (sheet.getPhysicalNumberOfRows() == 3) { if (sheet.getPhysicalNumberOfRows() == 3) {
result.put("message", "File khong co du lieu"); result.put("message", BundleUtils.getLangString("customer.noData", locale));
result.put("file", file); result.put("file", file);
return result; return result;
} else { } else {
Cell resultCell = sheet.getRow(3).createCell(sheet.getRow(3).getPhysicalNumberOfCells()); Cell resultCell = sheet.getRow(3).createCell(sheet.getRow(3).getPhysicalNumberOfCells());
resultCell.setCellValue("Kết quả"); resultCell.setCellValue(BundleUtils.getLangString("customer.result", locale));
resultCell.setCellStyle(resultStyle); resultCell.setCellStyle(resultStyle);
} }
//</editor-fold> //</editor-fold>
...@@ -989,11 +987,11 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -989,11 +987,11 @@ public class CustomerServiceImpl implements CustomerService {
} }
} else { } else {
Cell headerCell = row.getCell(j); Cell headerCell = row.getCell(j);
if (headerCell.getStringCellValue().equals("Loại khách hàng")) { if (headerCell.getStringCellValue().equals(BundleUtils.getLangString("customer.cusType", locale))) {
obj[j] = "Thường"; obj[j] = BundleUtils.getLangString("customer.cusType.normal", locale);
} else if (headerCell.getStringCellValue().equals("Cho phép gọi ra") || headerCell.getStringCellValue().equals("Cho phép gửi email") } else if (headerCell.getStringCellValue().equals(BundleUtils.getLangString("customer.callAllowed", locale)) || headerCell.getStringCellValue().equals(BundleUtils.getLangString("customer.emailAllowed", locale))
|| headerCell.getStringCellValue().equals("Cho phép gửi sms")) { || headerCell.getStringCellValue().equals(BundleUtils.getLangString("customer.smsAllowed", locale))) {
obj[j] = "Có"; obj[j] = BundleUtils.getLangString("customer.yes", locale);
break; break;
} else { } else {
obj[j] = null; obj[j] = null;
...@@ -1006,56 +1004,14 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1006,56 +1004,14 @@ public class CustomerServiceImpl implements CustomerService {
//</editor-fold> //</editor-fold>
//<editor-fold desc="Validate dữ liệu" defaultstate="collapsed"> //<editor-fold desc="Validate dữ liệu" defaultstate="collapsed">
// for (int i = 0; i < rawDataList.size(); i++) {
// sb.append(validateRecord(rawDataList.get(i)));
// sb.append(validateLength(row.getCell(1).getStringCellValue(), rawDataList.get(i)[1].toString(), 1000));
// if (rawDataList.get(i).length > 12 && rawDataList.get(i)[2] != null) {
// sb.append(validateLength(row.getCell(2).getStringCellValue(), rawDataList.get(i)[2].toString(), 50));
// }
// if (rawDataList.get(i).length > 12 && rawDataList.get(i)[3] != null) {
// sb.append(validateLength(row.getCell(3).getStringCellValue(), rawDataList.get(i)[3].toString(), 50));
// }
// if (rawDataList.get(i).length > 12 && rawDataList.get(i)[4] != null) {
// sb.append(validateLength(row.getCell(4).getStringCellValue(), rawDataList.get(i)[4].toString(), 100));
// String[] emails = rawDataList.get(i)[4].toString().split(";");
// boolean email = false;
// for (int j = 0; j < emails.length; j++) {
// if (!validateEmail(emails[j])) {
// email = true;
// }
// }
// if (email) {
// sb.append("Email khong dung dinh dang;");
// }
// }
// if (rawDataList.get(i).length > 12 && rawDataList.get(i)[5] != null) {
// sb.append(validateLength(row.getCell(5).getStringCellValue(), rawDataList.get(i)[5].toString(), 500));
// }
// if (rawDataList.get(i).length > 12 && rawDataList.get(i)[7] != null) {
// sb.append(validateLength(row.getCell(7).getStringCellValue(), rawDataList.get(i)[7].toString(), 100));
// }
// if (rawDataList.get(i).length > 12 && rawDataList.get(i)[8] != null) {
// sb.append(validateLength(row.getCell(8).getStringCellValue(), rawDataList.get(i)[8].toString(), 2000));
// }
// Row dataRow = sheet.getRow(4 + i);
// Cell resultCell = dataRow.createCell(row.getPhysicalNumberOfCells() - 1);
// if (sb.length() > 0) {
// resultCell.setCellValue(sb.toString());
// validateOk = false;
// } else {
// validateOk = true;
// resultCell.setCellValue("Ok");
// }
// sb = new StringBuilder();
// }
for (int i = 0; i < rawDataList.size(); i++) { for (int i = 0; i < rawDataList.size(); i++) {
if (rawDataList.get(i).length > 1 && rawDataList.get(i)[1] != null && !rawDataList.get(i)[1].toString().trim().equals("")) { if (rawDataList.get(i).length > 1 && rawDataList.get(i)[1] != null && !rawDataList.get(i)[1].toString().trim().equals("")) {
String str = validateLength("Họ và tên", rawDataList.get(i)[1].toString(), 1000); String str = validateLength(BundleUtils.getLangString("customer.fullname", locale).split("#")[0], rawDataList.get(i)[1].toString(), 1000, locale);
if (!str.equals("")) { if (!str.equals("")) {
sb.append(str); sb.append(str);
} }
} else sb.append("Họ và tên không được để trống;"); } else sb.append(BundleUtils.getLangString("customer.nameRequired"));
if (rawDataList.get(i).length > 4 if (rawDataList.get(i).length > 4
&& rawDataList.get(i)[2] != null && rawDataList.get(i)[2] != null
&& !rawDataList.get(i)[2].toString().trim().equals("") && !rawDataList.get(i)[2].toString().trim().equals("")
...@@ -1063,32 +1019,32 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1063,32 +1019,32 @@ public class CustomerServiceImpl implements CustomerService {
&& !rawDataList.get(i)[3].toString().trim().equals("") && !rawDataList.get(i)[3].toString().trim().equals("")
&& rawDataList.get(i)[4] != null && rawDataList.get(i)[4] != null
&& !rawDataList.get(i)[4].toString().trim().equals("")) { && !rawDataList.get(i)[4].toString().trim().equals("")) {
String str = validatePhone(rawDataList.get(i)[2].toString().trim()); String str = validatePhone(rawDataList.get(i)[2].toString().trim(), locale);
str.concat(validateLength("Số điện thoại phụ", rawDataList.get(i)[3].toString(), 50)); str.concat(validateLength(BundleUtils.getLangString("customer.secondPhone", locale).split("#")[0], rawDataList.get(i)[3].toString(), 50, locale));
if (validateEmail(rawDataList.get(i)[4].toString().trim())) { if (validateEmail(rawDataList.get(i)[4].toString().trim())) {
str.concat("Email không được quá 50 kí tự"); str.concat(BundleUtils.getLangString("customer.emailMax50", locale));
} }
sb.append(str); sb.append(str);
} else { } else {
sb.append("Cả 3 thông tin liên lạc không được để trống;"); sb.append(BundleUtils.getLangString("customer.invalidCustomer", locale));
} }
if (rawDataList.get(i).length > 5 && rawDataList.get(i)[5] != null) { if (rawDataList.get(i).length > 5 && rawDataList.get(i)[5] != null) {
sb.append(validateLength("Địa chỉ", rawDataList.get(i)[5].toString(), 500)); sb.append(validateLength(BundleUtils.getLangString("customer.address", locale).split("#")[0], rawDataList.get(i)[5].toString(), 500, locale));
} }
if (rawDataList.get(i).length > 7 && rawDataList.get(i)[7] != null) { if (rawDataList.get(i).length > 7 && rawDataList.get(i)[7] != null) {
sb.append(validateLength("Công ty", rawDataList.get(i)[7].toString(), 100)); sb.append(validateLength(BundleUtils.getLangString("customer.companyName", locale).split("#")[0], rawDataList.get(i)[7].toString(), 100, locale));
} }
if (rawDataList.get(i).length > 8 && rawDataList.get(i)[8] != null) { if (rawDataList.get(i).length > 8 && rawDataList.get(i)[8] != null) {
sb.append(validateLength("Ghi chú", rawDataList.get(i)[8].toString(), 2000)); sb.append(validateLength(BundleUtils.getLangString("customer.description", locale).split("#")[0], rawDataList.get(i)[8].toString(), 2000, locale));
} }
for (int j = 12; j < header.size(); j++) { for (int j = 12; j < header.size(); j++) {
if (rawDataList.get(i).length > j && rawDataList.get(i)[j] != null) { if (rawDataList.get(i).length > j && rawDataList.get(i)[j] != null) {
if (header.get(j).getType().equals("text")) { if (header.get(j).getType().equals("text")) {
sb.append(validateDynamicLength(header.get(j).getTitle(), rawDataList.get(i)[j].toString(), header.get(j).getMinLength(), header.get(j).getMaxLength())); sb.append(validateDynamicLength(header.get(j).getTitle(), rawDataList.get(i)[j].toString(), header.get(j).getMinLength(), header.get(j).getMaxLength(), locale));
} else if (header.get(j).getType().equals("date")) { } else if (header.get(j).getType().equals("date")) {
sb.append(validateUsingRegexp(header.get(j).getTitle(), rawDataList.get(i)[j].toString(), header.get(j).getRegexpForValidation())); sb.append(validateUsingRegexp(header.get(j).getTitle(), rawDataList.get(i)[j].toString(), header.get(j).getRegexpForValidation(), locale));
} else if (header.get(j).getType().equals("number")) { } else if (header.get(j).getType().equals("number")) {
sb.append(validateDynamicLength(header.get(j).getTitle(), rawDataList.get(i)[j].toString(), header.get(j).getMin(), header.get(j).getMax())); sb.append(validateDynamicLength(header.get(j).getTitle(), rawDataList.get(i)[j].toString(), header.get(j).getMin(), header.get(j).getMax(), locale));
} }
} }
} }
...@@ -1110,7 +1066,7 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1110,7 +1066,7 @@ public class CustomerServiceImpl implements CustomerService {
for (int i = 0; i < rawDataList.size(); i++) { for (int i = 0; i < rawDataList.size(); i++) {
Customer c = new Customer(); Customer c = new Customer();
c.setName(rawDataList.get(i)[1].toString()); c.setName(rawDataList.get(i)[1].toString());
c.setSiteId(companySiteId); c.setSiteId(userSession.getCompanySiteId());
c.setCode(null); c.setCode(null);
c.setDescription(rawDataList.get(i)[8].toString()); c.setDescription(rawDataList.get(i)[8].toString());
c.setCompanyName(rawDataList.get(i)[7].toString()); c.setCompanyName(rawDataList.get(i)[7].toString());
...@@ -1118,7 +1074,7 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1118,7 +1074,7 @@ public class CustomerServiceImpl implements CustomerService {
c.setCreateDate(new Date()); c.setCreateDate(new Date());
c.setUpdateDate(null); c.setUpdateDate(null);
c.setStatus(1L); c.setStatus(1L);
// c.setCreateBy(); c.setCreateBy(userSession.getUserName());
c.setUpdateBy(null); c.setUpdateBy(null);
c.setGender((short) 1); c.setGender((short) 1);
c.setCurrentAddress(rawDataList.get(i)[5].toString()); c.setCurrentAddress(rawDataList.get(i)[5].toString());
...@@ -1129,39 +1085,30 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1129,39 +1085,30 @@ public class CustomerServiceImpl implements CustomerService {
c.setUserName(null); c.setUserName(null);
c.setAreaCode(null); c.setAreaCode(null);
switch (rawDataList.get(i)[6].toString()) { switch (rawDataList.get(i)[6].toString()) {
case "Thường":
c.setCustomerType(1L);
break;
case "VIP": case "VIP":
c.setCustomerType(2L); c.setCustomerType(2L);
break; break;
case "Blacklist": case "Blacklist":
c.setCustomerType(3L); c.setCustomerType(3L);
break; break;
} default:
switch (rawDataList.get(i)[9].toString()) { c.setCustomerType(1L);
case "Có":
c.setCallAllowed(1L);
break;
case "Không":
c.setCallAllowed(0L);
break; break;
} }
switch (rawDataList.get(i)[10].toString()) { if (rawDataList.get(i)[9].toString().equals(BundleUtils.getLangString("customer.yes", locale))) {
case "Có": c.setCallAllowed(1L);
c.setEmailAllowed(1L); } else {
break; c.setCallAllowed(0L);
case "Không":
c.setEmailAllowed(0L);
break;
} }
switch (rawDataList.get(i)[11].toString()) { if (rawDataList.get(i)[10].toString().equals(BundleUtils.getLangString("customer.yes", locale))) {
case "Có": c.setEmailAllowed(1L);
c.setSmsAllowed(1L); } else {
break; c.setEmailAllowed(0L);
case "Không": }
c.setSmsAllowed(0L); if (rawDataList.get(i)[11].toString().equals(BundleUtils.getLangString("customer.yes", locale))) {
break; c.setSmsAllowed(1L);
} else {
c.setSmsAllowed(0L);
} }
c.setIpccStatus("active"); c.setIpccStatus("active");
Customer saved = customerRepository.save(c); Customer saved = customerRepository.save(c);
...@@ -1176,8 +1123,8 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1176,8 +1123,8 @@ public class CustomerServiceImpl implements CustomerService {
cc.setStatus((short) 1); cc.setStatus((short) 1);
cc.setCreateDate(new Date()); cc.setCreateDate(new Date());
cc.setUpdateDate(new Date()); cc.setUpdateDate(new Date());
// cc.setCreateBy(); cc.setCreateBy(userSession.getUserName());
// cc.setUpdateBy(); cc.setUpdateBy(userSession.getUserName());
customerContactRepository.save(cc); customerContactRepository.save(cc);
} }
} }
...@@ -1190,8 +1137,8 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1190,8 +1137,8 @@ public class CustomerServiceImpl implements CustomerService {
cc.setStatus((short) 1); cc.setStatus((short) 1);
cc.setCreateDate(new Date()); cc.setCreateDate(new Date());
cc.setUpdateDate(new Date()); cc.setUpdateDate(new Date());
// cc.setCreateBy(); cc.setCreateBy(userSession.getUserName());
// cc.setUpdateBy(); cc.setUpdateBy(userSession.getUserName());
customerContactRepository.save(cc); customerContactRepository.save(cc);
} }
} }
...@@ -1204,8 +1151,8 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1204,8 +1151,8 @@ public class CustomerServiceImpl implements CustomerService {
cc.setStatus((short) 1); cc.setStatus((short) 1);
cc.setCreateDate(new Date()); cc.setCreateDate(new Date());
cc.setUpdateDate(new Date()); cc.setUpdateDate(new Date());
// cc.setCreateBy(); cc.setCreateBy(userSession.getUserName());
// cc.setUpdateBy(); cc.setUpdateBy(userSession.getUserName());
customerContactRepository.save(cc); customerContactRepository.save(cc);
} }
} }
...@@ -1221,7 +1168,7 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1221,7 +1168,7 @@ public class CustomerServiceImpl implements CustomerService {
cfo.setFieldOptionValueId(cfov.getFieldOptionValueId()); cfo.setFieldOptionValueId(cfov.getFieldOptionValueId());
break; break;
case "checkbox": case "checkbox":
if (rawDataList.get(i)[12 + j].toString().equals("có")) { if (rawDataList.get(i)[12 + j].toString().equals(BundleUtils.getLangString("customer.yes", locale))) {
cfo.setValueCheckbox(1L); cfo.setValueCheckbox(1L);
} else { } else {
cfo.setValueCheckbox(0L); cfo.setValueCheckbox(0L);
...@@ -1239,7 +1186,7 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1239,7 +1186,7 @@ public class CustomerServiceImpl implements CustomerService {
break; break;
} }
} }
// cfo.setCreateBy(); cfo.setCreateBy(userSession.getUserName());
cfo.setCreateDate(new Date()); cfo.setCreateDate(new Date());
cfo.setStatus(1L); cfo.setStatus(1L);
cfo.setFunctionCode("CUSTOMER"); cfo.setFunctionCode("CUSTOMER");
...@@ -1248,62 +1195,62 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1248,62 +1195,62 @@ public class CustomerServiceImpl implements CustomerService {
} }
CustomerListMapping clm = new CustomerListMapping(); CustomerListMapping clm = new CustomerListMapping();
clm.setCustomerId(saved.getCustomerId()); clm.setCustomerId(saved.getCustomerId());
clm.setCompanySiteId(companySiteId); clm.setCompanySiteId(userSession.getCompanySiteId());
// clm.setCustomerListId(); clm.setCustomerListId(customerListId);
customerListMappingRepository.save(clm); customerListMappingRepository.save(clm);
} }
FileOutputStream fos = new FileOutputStream(file); FileOutputStream fos = new FileOutputStream(file);
workbook.write(fos); workbook.write(fos);
result.put("file", file); result.put("file", file);
result.put("message", "Import thanh cong"); result.put("message", BundleUtils.getLangString("customer.importSuccess", locale));
} else { } else {
FileOutputStream fos = new FileOutputStream(file); FileOutputStream fos = new FileOutputStream(file);
workbook.write(fos); workbook.write(fos);
result.put("file", file); result.put("file", file);
result.put("message", "Import du lieu loi"); result.put("message", BundleUtils.getLangString("customer.importFailed", locale));
} }
//</editor-fold> //</editor-fold>
return result; return result;
} catch (Exception e) { } catch (Exception e) {
LOGGER.info(e.getMessage()); LOGGER.info(e.getMessage());
result.put("message", "Error validate file"); result.put("message", BundleUtils.getLangString("customer.errorValidate", locale));
return result; return result;
} }
} }
//<editor-fold desc="Validate Methods" defaultstate="collapsed"> //<editor-fold desc="Validate Methods" defaultstate="collapsed">
private String validatePhone(String str) { private String validatePhone(String str, Locale locale) {
String result = ""; String result = "";
String[] arr = str.split(";"); String[] arr = str.split(";");
if (str.length() > 50) { if (str.length() > 50) {
result = "Số điện thoại chính không được quá 50 kí tự;"; result = BundleUtils.getLangString("customer.phoneMax50", locale);
} }
for (int i = 0; i < str.length(); i++) { for (int i = 0; i < str.length(); i++) {
CustomerContact cc = customerContactRepository.findCustomerContactByContactTypeAndContactAndIsDirectLine((short)5, arr[i], (short)1); CustomerContact cc = customerContactRepository.findCustomerContactByContactTypeAndContactAndIsDirectLine((short)5, arr[i], (short)1);
if (cc != null) { if (cc != null) {
return result.concat("Số điện thoại chính đã tồn tại"); return result.concat(BundleUtils.getLangString("customer.phoneExists", locale));
} }
} }
return result; return result;
} }
private String validateUsingRegexp(String header, String data, String regexp) { private String validateUsingRegexp(String header, String data, String regexp, Locale locale) {
if (data.matches(regexp)) { if (data.matches(regexp)) {
return header + " khong dung dinh dang"; return header + " " + BundleUtils.getLangString("customer.notMatch", locale);
}else return ""; } else return "";
} }
private String validateLength(String header, String str, int length) { private String validateLength(String header, String str, int length, Locale locale) {
if (str.trim().length() > length) { if (str.trim().length() > length) {
return header + " khong duoc vuot qua " + length + " ki tu;"; return header + " " + BundleUtils.getLangString("customer.notGreaterThan", locale) + " " + length;
} }
return ""; return "";
} }
private String validateDynamicLength(String header, String str, Long min, Long max) { private String validateDynamicLength(String header, String str, Long min, Long max, Locale locale) {
if (str.trim().length() < min || str.trim().length() > max) { if (str.trim().length() < min || str.trim().length() > max) {
return header + " khong duoc lon hon " + max + " hoac nho hon " + min; return header + " " + BundleUtils.getLangString("customer.notGreaterThan", locale) + " " + max + " " + BundleUtils.getLangString("customer.notLessThan", locale) + " " + min;
} }
return ""; return "";
} }
...@@ -1312,11 +1259,17 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1312,11 +1259,17 @@ public class CustomerServiceImpl implements CustomerService {
String regexp = "^[\\w-_\\.+]*[\\w-_\\.]\\@([\\w]+\\.)+[\\w]+[\\w]$"; String regexp = "^[\\w-_\\.+]*[\\w-_\\.]\\@([\\w]+\\.)+[\\w]+[\\w]$";
return str.matches(regexp); return str.matches(regexp);
} }
private boolean validateLetter(String str) {
String regexp = "@\"^\\p{L}+$\"";
return str.matches(regexp);
}
//</editor-fold> //</editor-fold>
@Override @Override
public byte[] buildTemplate(Long companySiteId) { public byte[] buildTemplate(Long companySiteId) {
LOGGER.info("-----------BUILD TEMPLATE-----------"); LOGGER.info("-----------BUILD TEMPLATE-----------");
Locale locale = new Locale("vi", "VN");
try { try {
XSSFWorkbook workbook = new XSSFWorkbook(); XSSFWorkbook workbook = new XSSFWorkbook();
CreationHelper creationHelper = workbook.getCreationHelper(); CreationHelper creationHelper = workbook.getCreationHelper();
...@@ -1325,18 +1278,30 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1325,18 +1278,30 @@ public class CustomerServiceImpl implements CustomerService {
//<editor-fold desc="Tạo array header" defaultstate="collapsed"> //<editor-fold desc="Tạo array header" defaultstate="collapsed">
List<CustomizeFields> header = new ArrayList<>(); List<CustomizeFields> header = new ArrayList<>();
header.add(new CustomizeFields("text", "STT")); // header.add(new CustomizeFields("text", "STT"));
header.add(new CustomizeFields("text", "Họ và tên#Bắt buộc\nĐịnh dạng chữ\ntối đa 1000 ký tự")); // header.add(new CustomizeFields("text", "Họ và tên#Bắt buộc\nĐịnh dạng chữ\ntối đa 1000 ký tự"));
header.add(new CustomizeFields("text", "Số điện thoại chính#Định dạng số\ncho phép nhập nhiều số điện thoại chính\ncác số cách nhau bởi dấu chấm phấy hoặc dấu phẩy\ntối đa 50 ký tự")); // header.add(new CustomizeFields("text", "Số điện thoại chính#Định dạng số\ncho phép nhập nhiều số điện thoại chính\ncác số cách nhau bởi dấu chấm phấy hoặc dấu phẩy\ntối đa 50 ký tự"));
header.add(new CustomizeFields("text", "Số điện thoại phụ#Định dạng số\ncho phép nhập nhiều số điện thoại phụ\ncác số cách nhau bởi dấu chấm phấy hoặc dấu phẩy\ntối đa 50 ký tự")); // header.add(new CustomizeFields("text", "Số điện thoại phụ#Định dạng số\ncho phép nhập nhiều số điện thoại phụ\ncác số cách nhau bởi dấu chấm phấy hoặc dấu phẩy\ntối đa 50 ký tự"));
header.add(new CustomizeFields("text", "Email chính#Cho phép nhập nhiều email\nmỗi email cách nhau bởi dấu \",\"\ntối đa 100 ký tự")); // header.add(new CustomizeFields("text", "Email chính#Cho phép nhập nhiều email\nmỗi email cách nhau bởi dấu \",\"\ntối đa 100 ký tự"));
header.add(new CustomizeFields("text", "Địa chỉ#Tối đa 500 ký tự")); // header.add(new CustomizeFields("text", "Địa chỉ#Tối đa 500 ký tự"));
header.add(new CustomizeFields("combobox", "Loại khách hàng")); // header.add(new CustomizeFields("combobox", "Loại khách hàng"));
header.add(new CustomizeFields("text", "Công ty#Tối đa 100 ký tự")); // header.add(new CustomizeFields("text", "Công ty#Tối đa 100 ký tự"));
header.add(new CustomizeFields("text", "Ghi chú#Tối đa 2000 ký tự")); // header.add(new CustomizeFields("text", "Ghi chú#Tối đa 2000 ký tự"));
header.add(new CustomizeFields("combobox", "Cho phép gọi ra")); // header.add(new CustomizeFields("combobox", "Cho phép gọi ra"));
header.add(new CustomizeFields("combobox", "Cho phép gửi email")); // header.add(new CustomizeFields("combobox", "Cho phép gửi email"));
header.add(new CustomizeFields("combobox", "Cho phép gửi sms")); // header.add(new CustomizeFields("combobox", "Cho phép gửi sms"));
header.add(new CustomizeFields("text", BundleUtils.getLangString("customer.no", locale)));
header.add(new CustomizeFields("text", BundleUtils.getLangString("customer.fullname", locale)));
header.add(new CustomizeFields("text", BundleUtils.getLangString("customer.mainPhone", locale)));
header.add(new CustomizeFields("text", BundleUtils.getLangString("customer.secondPhone", locale)));
header.add(new CustomizeFields("text", BundleUtils.getLangString("customer.email", locale)));
header.add(new CustomizeFields("text", BundleUtils.getLangString("customer.address", locale)));
header.add(new CustomizeFields("combobox", BundleUtils.getLangString("customer.cusType", locale)));
header.add(new CustomizeFields("text", BundleUtils.getLangString("customer.companyName", locale)));
header.add(new CustomizeFields("text", BundleUtils.getLangString("customer.description", locale)));
header.add(new CustomizeFields("combobox", BundleUtils.getLangString("customer.callAllowed", locale)));
header.add(new CustomizeFields("combobox", BundleUtils.getLangString("customer.emailAllowed", locale)));
header.add(new CustomizeFields("combobox", BundleUtils.getLangString("customer.smsAllowed", locale)));
List<CustomizeFields> dynamicHeader = getDynamicHeader(companySiteId); List<CustomizeFields> dynamicHeader = getDynamicHeader(companySiteId);
header.addAll(dynamicHeader); header.addAll(dynamicHeader);
...@@ -1375,7 +1340,7 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1375,7 +1340,7 @@ public class CustomerServiceImpl implements CustomerService {
comboboxValidation.setShowErrorBox(true); comboboxValidation.setShowErrorBox(true);
sheet.addValidationData(comboboxValidation); sheet.addValidationData(comboboxValidation);
} else if (dynamicHeader.get(i).getType().equals("checkbox")) { } else if (dynamicHeader.get(i).getType().equals("checkbox")) {
DataValidationConstraint yesNoConstraint = dataValidationHelper.createExplicitListConstraint(new String[]{"Có", "Không"}); DataValidationConstraint yesNoConstraint = dataValidationHelper.createExplicitListConstraint(new String[]{BundleUtils.getLangString("customer.yes", locale), BundleUtils.getLangString("customer.not", locale)});
CellRangeAddressList checkboxCellRange = new CellRangeAddressList(4,9999,12 + i,12 + i); CellRangeAddressList checkboxCellRange = new CellRangeAddressList(4,9999,12 + i,12 + i);
DataValidation yesNoValidation = dataValidationHelper.createValidation(yesNoConstraint, checkboxCellRange); DataValidation yesNoValidation = dataValidationHelper.createValidation(yesNoConstraint, checkboxCellRange);
yesNoValidation.setShowErrorBox(true); yesNoValidation.setShowErrorBox(true);
...@@ -1386,8 +1351,8 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1386,8 +1351,8 @@ public class CustomerServiceImpl implements CustomerService {
//</editor-fold> //</editor-fold>
//<editor-fold desc="Cho những trường tĩnh" defaultstate="collapsed"> //<editor-fold desc="Cho những trường tĩnh" defaultstate="collapsed">
DataValidationConstraint cusTypeConstraint = dataValidationHelper.createExplicitListConstraint(new String[]{"Thường", "VIP", "Blacklist"}); DataValidationConstraint cusTypeConstraint = dataValidationHelper.createExplicitListConstraint(new String[]{BundleUtils.getLangString("customer.cusType.normal", locale), BundleUtils.getLangString("customer.cusType.vip", locale), BundleUtils.getLangString("customer.cusType.blacklist", locale)});
DataValidationConstraint isAllowConstraint = dataValidationHelper.createExplicitListConstraint(new String[]{"Có", "Không"}); DataValidationConstraint isAllowConstraint = dataValidationHelper.createExplicitListConstraint(new String[]{BundleUtils.getLangString("customer.yes", locale), BundleUtils.getLangString("customer.not", locale)});
CellRangeAddressList cusTypeCellRangeAddressList = new CellRangeAddressList(3, 9999, 6, 6); CellRangeAddressList cusTypeCellRangeAddressList = new CellRangeAddressList(3, 9999, 6, 6);
CellRangeAddressList callCellRangeAddressList = new CellRangeAddressList(3, 9999, 9, 9); CellRangeAddressList callCellRangeAddressList = new CellRangeAddressList(3, 9999, 9, 9);
CellRangeAddressList emailCellRangeAddressList = new CellRangeAddressList(3, 9999, 10, 10); CellRangeAddressList emailCellRangeAddressList = new CellRangeAddressList(3, 9999, 10, 10);
...@@ -1420,11 +1385,10 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1420,11 +1385,10 @@ public class CustomerServiceImpl implements CustomerService {
Row row3 = sheet.createRow(3); Row row3 = sheet.createRow(3);
Cell cell0 = row0.createCell(0); Cell cell0 = row0.createCell(0);
cell0.setCellStyle(headerStyle); cell0.setCellStyle(headerStyle);
cell0.setCellValue("IMPORT KHÁCH HÀNG"); cell0.setCellValue(BundleUtils.getLangString("customer.importCustomer", locale));
Cell cell2 = row2.createCell(0); Cell cell2 = row2.createCell(0);
cell2.setCellStyle(importantStyle); cell2.setCellStyle(importantStyle);
cell2.setCellValue("Chú ý: 1 bản ghi được coi là hợp lệ bắt buộc phải có thông tin Họ và Tên và 1 trong 3 thông tin" + cell2.setCellValue(BundleUtils.getLangString("customer.notice", locale));
" liên lạc (số điện thoại chính, số điện thoại phụ hoặc email)");
for (int i = 0; i < header.size(); i++) { for (int i = 0; i < header.size(); i++) {
Cell headerCell = row3.createCell(i); Cell headerCell = row3.createCell(i);
headerCell.setCellValue(header.get(i).getTitle().split("#")[0]); headerCell.setCellValue(header.get(i).getTitle().split("#")[0]);
......
...@@ -11,6 +11,7 @@ import com.viettel.campaign.web.dto.request_dto.CustomerRequestDTO; ...@@ -11,6 +11,7 @@ import com.viettel.campaign.web.dto.request_dto.CustomerRequestDTO;
import com.viettel.campaign.web.dto.request_dto.SearchCustomerRequestDTO; import com.viettel.campaign.web.dto.request_dto.SearchCustomerRequestDTO;
import com.viettel.econtact.filter.UserSession; import com.viettel.econtact.filter.UserSession;
import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.FilenameUtils;
import org.eclipse.jetty.server.Authentication;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -187,11 +188,11 @@ public class CustomerController { ...@@ -187,11 +188,11 @@ public class CustomerController {
@PostMapping(value = "/importFile") @PostMapping(value = "/importFile")
public ResponseEntity<?> importFile(@RequestParam("file") MultipartFile file, public ResponseEntity<?> importFile(@RequestParam("file") MultipartFile file,
@RequestParam("companySiteId") Long companySiteId, @RequestParam("customerListId") Long customerListId,
@RequestHeader("X-Auth-Token") String authToken) { @RequestHeader("X-Auth-Token") String authToken) {
LOGGER.info("------------IMPORT FILE TEMPLATE--------------"); LOGGER.info("------------IMPORT FILE TEMPLATE--------------");
try { try {
// UserSession userSession = (UserSession) RedisUtil.getInstance().get(authToken); UserSession userSession = (UserSession) RedisUtil.getInstance().get(authToken);
if (file.isEmpty()) { if (file.isEmpty()) {
return new ResponseEntity<>("Please select a file", HttpStatus.OK); return new ResponseEntity<>("Please select a file", HttpStatus.OK);
} }
...@@ -199,8 +200,8 @@ public class CustomerController { ...@@ -199,8 +200,8 @@ public class CustomerController {
return new ResponseEntity<>("File khong dung dinh dang", HttpStatus.OK); return new ResponseEntity<>("File khong dung dinh dang", HttpStatus.OK);
} }
String path = saveUploadFile(file); String path = saveUploadFile(file);
List<CustomizeFields> dynamicHeaders = customerService.getDynamicHeader(companySiteId); List<CustomizeFields> dynamicHeaders = customerService.getDynamicHeader(userSession.getCompanySiteId());
Map<String, Object> map = customerService.readAndValidateCustomer(path, dynamicHeaders, companySiteId); Map<String, Object> map = customerService.readAndValidateCustomer(path, dynamicHeaders, userSession, customerListId);
File fileExport = (File) map.get("file"); File fileExport = (File) map.get("file");
String message = (String) map.get("message"); String message = (String) map.get("message");
return ResponseEntity.ok() return ResponseEntity.ok()
......
...@@ -67,3 +67,38 @@ IPCC_STATUS = IPCC_STATUS ...@@ -67,3 +67,38 @@ IPCC_STATUS = IPCC_STATUS
EMAIL = EMAIL EMAIL = EMAIL
CUSTOMER_TYPE = CUSTOMER_TYPE CUSTOMER_TYPE = CUSTOMER_TYPE
AVATAR_LINK = AVATAR_LINK AVATAR_LINK = AVATAR_LINK
#Customer Excel Header
customer.no = No
customer.fullname = Full Name#Required\nLetters only\nmaximum 1000 characters
customer.mainPhone = Main mobile phone#Number only\nmultiple numbers allowed\neach seperate by semicolon\nmaximum 50 characters
customer.secondPhone = Secondary phone#Number only\nmultiple numbers allowed\neach seperate by semicolon\nmaximum 50 characters
customer.email = Email#multiple emails allowed\neach seperate by semicolon\nmaximum 100 characters
customer.address = Address#maximum 500 characters
customer.cusType = Customer Type
customer.companyName = Company#maximum 100 characters
customer.description = Description#maximum 2000 characters
customer.callAllowed = Call Allowed
customer.emailAllowed = Email Allowed
customer.smsAllowed = Sms Allowed
customer.result = Result
customer.cusType.normal = Normal
customer.cusType.vip = VIP
customer.cusType.blacklist = Blacklist
customer.yes = Yes
customer.not = No
customer.invalidTemplate = Invalid Template
customer.noData = Template empty
customer.nameRequired = Full name required;
customer.emailMax50 = Email must less than 50 character;
customer.invalidCustomer = All 3 fields Main phone, second phone and email must not null;
customer.importSuccess = Import Successful
customer.importFailed = Import Failed
customer.errorValidate = Error while validating
customer.phoneMax50 = Mobile phone must less than 50 character;
customer.phoneExists = Mobile phone exists;
customer.notMatch = not match regexp validation
customer.notGreaterThan = not greater than
customer.notLessThan = not less than
customer.importCustomer = IMPORT CUSTOMER
customer.notice = Attention: A record is valid when Full Name is not null and one of three fields Main phone, secondary phone or email is not null
...@@ -69,3 +69,38 @@ IPCC_STATUS = IPCC_STATUS ...@@ -69,3 +69,38 @@ IPCC_STATUS = IPCC_STATUS
EMAIL = EMAIL EMAIL = EMAIL
CUSTOMER_TYPE = CUSTOMER_TYPE CUSTOMER_TYPE = CUSTOMER_TYPE
AVATAR_LINK = AVATAR_LINK AVATAR_LINK = AVATAR_LINK
#Customer Excel Header
customer.no = STT
customer.fullname = Họ và tên#Bắt buộc\nĐịnh dạng chữ\ntối đa 1000 kí tự
customer.mainPhone = Số điện thoại chính#Định dạng số\ncho phép nhập nhiều số điện thoại chính\ncác số cách nhau bởi dấu chấm phấy\ntối đa 50 ký tự
customer.secondPhone = Số điện thoại phụ#Định dạng số\ncho phép nhập nhiều số điện thoại phụ\ncác số cách nhau bởi dấu chấm phấy hoặc dấu phẩy\ntối đa 50 ký tự
customer.email = Email chính#Cho phép nhập nhiều email\nmỗi email cách nhau bởi dấu \";\"\ntối đa 100 ký tự
customer.address = Địa chỉ#Tối đa 500 ký tự
customer.cusType = Loại khách hàng
customer.companyName = Công ty#Tối đa 100 ký tự
customer.description = Ghi chú#Tối đa 2000 ký tự
customer.callAllowed = Cho phép gọi ra
customer.emailAllowed = Cho phép gửi email
customer.smsAllowed = Cho phép gửi sms
customer.result = Kết quả
customer.cusType.normal = Thường
customer.cusType.vip = VIP
customer.cusType.blacklist = Blacklist
customer.yes =
customer.not = Không
customer.invalidTemplate = Template sai định dạng
customer.noData = Template không có dữ liệu
customer.nameRequired = Họ và tên không được để trống;
customer.emailMax50 = Email không được quá 50 kí tự;
customer.invalidCustomer = Cả 3 thông tin số điện thoại chính, số điện phụ và email không được để trống;
customer.importSuccess = Import dữ liệu thành công
customer.importFailed = Import dữ liệu thất bại
customer.errorValidate = Validate dữ liệu lỗi
customer.phoneMax50 = Số điện thoại không được quá 50 kí tự;
customer.phoneExists = Số điện thoại chính đã tồn tại;
customer.notMatch = không đúng định dạng
customer.notGreaterThan = không được lớn hơn
customer.notLessThan = không được nhỏ hơn
customer.importCustomer = IMPORT KHÁCH HÀNG
customer.notice = Chú ý: 1 bản ghi được coi là hợp lệ bắt buộc phải có thông tin Họ và Tên và 1 trong 3 thông tin liên lạc (số điện thoại chính, số điện thoại phụ hoặc email)
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