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

quangdn

parent 01f97d3a
...@@ -5,15 +5,18 @@ import lombok.Setter; ...@@ -5,15 +5,18 @@ import lombok.Setter;
import javax.persistence.*; import javax.persistence.*;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date; import java.util.Date;
@Entity @Entity
@Table(name = "CUSTOMER_CONTACT") @Table(name = "CUSTOMER_CONTACT")
@Getter @Getter
@Setter @Setter
public class CustomerContact { public class CustomerContact implements Serializable {
@Id @Id
@Basic(optional = false) @Basic(optional = false)
@GeneratedValue(generator = "customer_contact_seq", strategy = GenerationType.IDENTITY)
@SequenceGenerator(name = "customer_contact_seq", sequenceName = "customer_contact_seq", allocationSize = 1)
@NotNull @NotNull
@Column(name = "CONTACT_ID") @Column(name = "CONTACT_ID")
private Long contactId; private Long contactId;
......
...@@ -12,5 +12,5 @@ public interface CustomerContactRepository extends JpaRepository<CustomerContact ...@@ -12,5 +12,5 @@ public interface CustomerContactRepository extends JpaRepository<CustomerContact
@Query("FROM CustomerContact WHERE status = 1 AND customerId = :customerId AND contactType = :contactType AND (contact IS NULL OR UPPER(contact) LIKE UPPER(concat('%', :contact, '%')))") @Query("FROM CustomerContact WHERE status = 1 AND customerId = :customerId AND contactType = :contactType AND (contact IS NULL OR UPPER(contact) LIKE UPPER(concat('%', :contact, '%')))")
List<CustomerContact> findByCustomerIdAndAndContactTypeAndContact(@Param("customerId") Long customerId, @Param("contactType") Short contactType, @Param("contact") String contact, Pageable pageable); List<CustomerContact> findByCustomerIdAndAndContactTypeAndContact(@Param("customerId") Long customerId, @Param("contactType") Short contactType, @Param("contact") String contact, Pageable pageable);
CustomerContact findCustomerContactByContactTypeAndContactAndIsDirectLine(Short contactType, String contact, Short isDirectLine); CustomerContact findCustomerContactByContactEquals(String contact);
} }
...@@ -33,7 +33,7 @@ public interface CustomerService { ...@@ -33,7 +33,7 @@ public interface CustomerService {
ResultDTO getAllCustomerList(int page, int pageSize, String sort, Long companySiteId); ResultDTO getAllCustomerList(int page, int pageSize, String sort, Long companySiteId);
ResultDTO createCustomerList(CustomerListDTO customerListDTO, String userName); CustomerList createCustomerList(CustomerListDTO customerListDTO, String userName);
ResultDTO updateCustomerList(CustomerListDTO customerListDTO); ResultDTO updateCustomerList(CustomerListDTO customerListDTO);
......
...@@ -50,7 +50,7 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -50,7 +50,7 @@ public class CustomerServiceImpl implements CustomerService {
private static final Logger LOGGER = LoggerFactory.getLogger(CustomerServiceImpl.class); private static final Logger LOGGER = LoggerFactory.getLogger(CustomerServiceImpl.class);
@Autowired @Autowired
@PersistenceContext( unitName= DataSourceQualify.JPA_UNIT_NAME_CCMS_FULL) @PersistenceContext(unitName = DataSourceQualify.JPA_UNIT_NAME_CCMS_FULL)
EntityManager entityManager; EntityManager entityManager;
@Autowired @Autowired
...@@ -595,37 +595,30 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -595,37 +595,30 @@ public class CustomerServiceImpl implements CustomerService {
} }
@Override @Override
@Transactional(DataSourceQualify.CCMS_FULL) public CustomerList createCustomerList(CustomerListDTO customerListDTO, String userName) {
public ResultDTO createCustomerList(CustomerListDTO customerListDTO, String userName) { LOGGER.info("-----------CREATE CUSTOMER LIST--------------");
ResultDTO resultDTO = new ResultDTO();
CustomerListMapper customerListMapper = new CustomerListMapper();
CustomerList customerList = new CustomerList();
try { try {
if (customerListDTO != null) { CustomerList cl = customerListRepository.findByCustomerListCode(customerListDTO.getCustomerListCode());
// insert if (cl == null) {
CustomerList findCustomer = customerListRepository.findByCustomerListCode(customerListDTO.getCustomerListCode()); cl = new CustomerList();
if (findCustomer == null) { cl.setCustomerListCode(customerListDTO.getCustomerListCode());
customerListDTO.setCreateBy(userName); cl.setCustomerListName(customerListDTO.getCustomerListName());
cl.setStatus((short) 1);
customerList = customerListMapper.toPersistenceBean(customerListDTO); cl.setCreateBy(userName);
customerListRepository.save(customerList); cl.setCreateAt(new Date());
cl.setUpdateBy(null);
resultDTO.setErrorCode(Constants.ApiErrorCode.SUCCESS); cl.setUpdateAt(null);
resultDTO.setDescription(Constants.ApiErrorDesc.SUCCESS); cl.setSource(null);
} else { cl.setDeptCreate(null);
resultDTO.setErrorCode(Constants.ApiErrorCode.ERROR); cl.setCompanySiteId(customerListDTO.getCompanySiteId());
resultDTO.setDescription(Constants.ApiErrorDesc.ERROR); return customerListRepository.save(cl);
}
} else { } else {
resultDTO.setErrorCode(Constants.ApiErrorCode.ERROR); return null;
resultDTO.setDescription(Constants.ApiErrorDesc.ERROR);
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); LOGGER.error(e.getMessage());
return null;
} }
return resultDTO;
} }
@Override @Override
...@@ -894,7 +887,8 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -894,7 +887,8 @@ public class CustomerServiceImpl implements CustomerService {
public Map<String, Object> readAndValidateCustomer(String path, List<CustomizeFields> dynamicHeader, UserSession userSession, Long customerListId) { 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"); Locale locale = new Locale("vi", "VN");
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); DataFormatter dataFormat = new DataFormatter();
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
boolean validateOk = false; boolean validateOk = false;
...@@ -970,14 +964,7 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -970,14 +964,7 @@ public class CustomerServiceImpl implements CustomerService {
for (int j = 0; j < row.getPhysicalNumberOfCells(); j++) { for (int j = 0; j < row.getPhysicalNumberOfCells(); j++) {
Cell dataCell = dataRow.getCell(j); Cell dataCell = dataRow.getCell(j);
if (dataCell != null) { if (dataCell != null) {
switch (dataCell.getCellTypeEnum()) { obj[j] = dataFormat.formatCellValue(dataCell);
case NUMERIC:
obj[j] = dataCell.getNumericCellValue();
break;
default:
obj[j] = dataCell.getStringCellValue();
break;
}
} else { } else {
Cell headerCell = row.getCell(j); Cell headerCell = row.getCell(j);
if (headerCell.getStringCellValue().equals(BundleUtils.getLangString("customer.cusType", locale))) { if (headerCell.getStringCellValue().equals(BundleUtils.getLangString("customer.cusType", locale))) {
...@@ -1014,9 +1001,12 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1014,9 +1001,12 @@ public class CustomerServiceImpl implements CustomerService {
&& !rawDataList.get(i)[4].toString().trim().equals("")) { && !rawDataList.get(i)[4].toString().trim().equals("")) {
String str = validatePhone(rawDataList.get(i)[2].toString().trim(), locale); String str = validatePhone(rawDataList.get(i)[2].toString().trim(), locale);
str.concat(validateLength(BundleUtils.getLangString("customer.secondPhone", locale).split("#")[0], rawDataList.get(i)[3].toString(), 50, locale)); 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(BundleUtils.getLangString("customer.emailMax50", locale)); str.concat(BundleUtils.getLangString("customer.emailInvalid", locale));
} else {
str.concat(validateDuplicateEmail(rawDataList.get(i)[4].toString().trim(), locale));
} }
sb.append(validateLength(BundleUtils.getLangString("customer.email", locale).split("#")[0], rawDataList.get(i)[4].toString(), 50, locale));
sb.append(str); sb.append(str);
} else { } else {
sb.append(BundleUtils.getLangString("customer.invalidCustomer", locale)); sb.append(BundleUtils.getLangString("customer.invalidCustomer", locale));
...@@ -1030,17 +1020,17 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1030,17 +1020,17 @@ public class CustomerServiceImpl implements CustomerService {
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(BundleUtils.getLangString("customer.description", locale).split("#")[0], rawDataList.get(i)[8].toString(), 2000, locale)); 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(), locale)); // 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(), locale)); // 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(), locale)); // sb.append(validateDynamicLength(header.get(j).getTitle(), rawDataList.get(i)[j].toString(), header.get(j).getMin(), header.get(j).getMax(), locale));
} // }
} // }
} // }
Row dataRow = sheet.getRow(4 + i); Row dataRow = sheet.getRow(4 + i);
Cell resultCell = dataRow.createCell(row.getPhysicalNumberOfCells() - 1); Cell resultCell = dataRow.createCell(row.getPhysicalNumberOfCells() - 1);
if (sb.length() > 0) { if (sb.length() > 0) {
...@@ -1105,11 +1095,12 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1105,11 +1095,12 @@ public class CustomerServiceImpl implements CustomerService {
} }
c.setIpccStatus("active"); c.setIpccStatus("active");
Customer saved = customerRepository.save(c); Customer saved = customerRepository.save(c);
CustomerContact cc = new CustomerContact();
cc.setCustomerId(saved.getCustomerId());
if (rawDataList.get(i).length > 2 && rawDataList.get(i)[2] != null) { if (rawDataList.get(i).length > 2 && rawDataList.get(i)[2] != null) {
String[] mainPhone = rawDataList.get(i)[2].toString().split(";"); String[] mainPhone = rawDataList.get(i)[2].toString().split(";");
for (int j = 0; j < mainPhone.length; j++) { for (int j = 0; j < mainPhone.length; j++) {
CustomerContact cc = new CustomerContact();
cc.setCustomerId(saved.getCustomerId());
cc.setSiteId(userSession.getSiteId());
cc.setContactType((short) 5); cc.setContactType((short) 5);
cc.setContact(mainPhone[j]); cc.setContact(mainPhone[j]);
cc.setIsDirectLine((short) 1); cc.setIsDirectLine((short) 1);
...@@ -1124,6 +1115,9 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1124,6 +1115,9 @@ public class CustomerServiceImpl implements CustomerService {
if (rawDataList.get(i).length > 3 && rawDataList.get(i)[3] != null) { if (rawDataList.get(i).length > 3 && rawDataList.get(i)[3] != null) {
String[] subPhone = rawDataList.get(i)[3].toString().split(";"); String[] subPhone = rawDataList.get(i)[3].toString().split(";");
for (int j = 0; j < subPhone.length; j++) { for (int j = 0; j < subPhone.length; j++) {
CustomerContact cc = new CustomerContact();
cc.setCustomerId(saved.getCustomerId());
cc.setSiteId(userSession.getSiteId());
cc.setContactType((short) 5); cc.setContactType((short) 5);
cc.setContact(subPhone[j]); cc.setContact(subPhone[j]);
cc.setIsDirectLine((short) 0); cc.setIsDirectLine((short) 0);
...@@ -1136,8 +1130,11 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1136,8 +1130,11 @@ public class CustomerServiceImpl implements CustomerService {
} }
} }
if (rawDataList.get(i).length > 4 && rawDataList.get(i)[4] != null) { if (rawDataList.get(i).length > 4 && rawDataList.get(i)[4] != null) {
String[] email = rawDataList.get(i)[3].toString().split(";"); String[] email = rawDataList.get(i)[4].toString().split(";");
for (int j = 0; j < email.length; j++) { for (int j = 0; j < email.length; j++) {
CustomerContact cc = new CustomerContact();
cc.setCustomerId(saved.getCustomerId());
cc.setSiteId(userSession.getSiteId());
cc.setContactType((short) 2); cc.setContactType((short) 2);
cc.setContact(email[j]); cc.setContact(email[j]);
cc.setIsDirectLine((short) 1); cc.setIsDirectLine((short) 1);
...@@ -1154,11 +1151,11 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1154,11 +1151,11 @@ public class CustomerServiceImpl implements CustomerService {
for (int j = 0; j < dynamicHeader.size(); j++) { for (int j = 0; j < dynamicHeader.size(); j++) {
cfo.setCustomizeFieldId(dynamicHeader.get(j).getCustomizeFieldId()); cfo.setCustomizeFieldId(dynamicHeader.get(j).getCustomizeFieldId());
if (rawDataList.get(i).length > (12 + j) && rawDataList.get(i)[12 + j] != null) { if (rawDataList.get(i).length > (12 + j) && rawDataList.get(i)[12 + j] != null) {
switch (dynamicHeader.get(i).getType()) { switch (dynamicHeader.get(j).getType()) {
case "combobox": case "combobox":
CustomizeFieldOptionValue cfov = CustomizeFieldOptionValue cfov =
customizeFieldOptionValueRepository.findCustomizeFieldOptionValueByNameEqualsAndStatus(rawDataList.get(i)[12 + j].toString(), 1L); customizeFieldOptionValueRepository.findCustomizeFieldOptionValueByNameEqualsAndStatus(rawDataList.get(i)[12 + j].toString(), 1L);
cfo.setFieldOptionValueId(cfov.getFieldOptionValueId()); cfo.setFieldOptionValueId(cfov.getFieldOptionValueId());
break; break;
case "checkbox": case "checkbox":
if (rawDataList.get(i)[12 + j].toString().equals(BundleUtils.getLangString("customer.yes", locale))) { if (rawDataList.get(i)[12 + j].toString().equals(BundleUtils.getLangString("customer.yes", locale))) {
...@@ -1219,8 +1216,8 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1219,8 +1216,8 @@ public class CustomerServiceImpl implements CustomerService {
if (str.length() > 50) { if (str.length() > 50) {
result = BundleUtils.getLangString("customer.phoneMax50", locale); result = BundleUtils.getLangString("customer.phoneMax50", locale);
} }
for (int i = 0; i < str.length(); i++) { for (int i = 0; i < arr.length; i++) {
CustomerContact cc = customerContactRepository.findCustomerContactByContactTypeAndContactAndIsDirectLine((short)5, arr[i], (short)1); CustomerContact cc = customerContactRepository.findCustomerContactByContactEquals(arr[i]);
if (cc != null) { if (cc != null) {
return result.concat(BundleUtils.getLangString("customer.phoneExists", locale)); return result.concat(BundleUtils.getLangString("customer.phoneExists", locale));
} }
...@@ -1228,6 +1225,18 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1228,6 +1225,18 @@ public class CustomerServiceImpl implements CustomerService {
return result; return result;
} }
private String validateDuplicateEmail(String str, Locale locale) {
String result = "";
String[] arr = str.split(";");
for (int i = 0; i < arr.length; i++) {
CustomerContact cc = customerContactRepository.findCustomerContactByContactEquals(arr[i]);
if (cc != null) {
return result.concat(BundleUtils.getLangString("customer.emailExists", locale));
}
}
return result;
}
private String validateUsingRegexp(String header, String data, String regexp, Locale locale) { private String validateUsingRegexp(String header, String data, String regexp, Locale locale) {
if (data.matches(regexp)) { if (data.matches(regexp)) {
return header + " " + BundleUtils.getLangString("customer.notMatch", locale); return header + " " + BundleUtils.getLangString("customer.notMatch", locale);
...@@ -1249,8 +1258,14 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1249,8 +1258,14 @@ public class CustomerServiceImpl implements CustomerService {
} }
private boolean validateEmail(String str) { private boolean validateEmail(String str) {
String[] arr = str.split(";");
String regexp = "^[\\w-_\\.+]*[\\w-_\\.]\\@([\\w]+\\.)+[\\w]+[\\w]$"; String regexp = "^[\\w-_\\.+]*[\\w-_\\.]\\@([\\w]+\\.)+[\\w]+[\\w]$";
return str.matches(regexp); for (int i = 0; i < arr.length; i++) {
if (!arr[i].matches(regexp)) {
return false;
}
}
return true;
} }
private boolean validateLetter(String str) { private boolean validateLetter(String str) {
...@@ -1315,14 +1330,14 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1315,14 +1330,14 @@ public class CustomerServiceImpl implements CustomerService {
constraint[j] = list.get(j).getName(); constraint[j] = list.get(j).getName();
} }
DataValidationConstraint comboboxConstraint = dataValidationHelper.createExplicitListConstraint(constraint); DataValidationConstraint comboboxConstraint = dataValidationHelper.createExplicitListConstraint(constraint);
CellRangeAddressList comboboxCellRange = new CellRangeAddressList(4,9999,12 + i, 12 + i); CellRangeAddressList comboboxCellRange = new CellRangeAddressList(4, 9999, 12 + i, 12 + i);
DataValidation comboboxValidation = dataValidationHelper.createValidation(comboboxConstraint,comboboxCellRange); DataValidation comboboxValidation = dataValidationHelper.createValidation(comboboxConstraint, comboboxCellRange);
comboboxValidation.setSuppressDropDownArrow(true); comboboxValidation.setSuppressDropDownArrow(true);
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[]{BundleUtils.getLangString("customer.yes", locale), BundleUtils.getLangString("customer.not", locale)}); 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);
yesNoValidation.setSuppressDropDownArrow(true); yesNoValidation.setSuppressDropDownArrow(true);
......
package com.viettel.campaign.web.rest; package com.viettel.campaign.web.rest;
import com.viettel.campaign.model.ccms_full.CustomerList;
import com.viettel.campaign.model.ccms_full.CustomizeFieldObject; import com.viettel.campaign.model.ccms_full.CustomizeFieldObject;
import com.viettel.campaign.model.ccms_full.CustomizeFields; import com.viettel.campaign.model.ccms_full.CustomizeFields;
import com.viettel.campaign.service.CustomerService; import com.viettel.campaign.service.CustomerService;
...@@ -103,15 +104,15 @@ public class CustomerController { ...@@ -103,15 +104,15 @@ public class CustomerController {
} }
@PostMapping("/createCustomerList") @PostMapping("/createCustomerList")
@ResponseBody public ResponseEntity<?> createCustomerList(@RequestBody @Valid CustomerListDTO customerListDTO, HttpServletRequest request) {
public ResultDTO createCustomerList(@RequestBody @Valid CustomerListDTO customerListDTO, HttpServletRequest request) {
ResultDTO result = new ResultDTO();
String xAuthToken = request.getHeader("X-Auth-Token"); String xAuthToken = request.getHeader("X-Auth-Token");
UserSession userSession = (UserSession) RedisUtil.getInstance().get(xAuthToken); UserSession userSession = (UserSession) RedisUtil.getInstance().get(xAuthToken);
result = customerService.createCustomerList(customerListDTO, userSession.getUserName()); CustomerList cl = customerService.createCustomerList(customerListDTO, userSession.getUserName());
return result; if (cl == null) {
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
}
return new ResponseEntity<>(cl, HttpStatus.OK);
} }
@PostMapping("/updateCustomerList") @PostMapping("/updateCustomerList")
...@@ -185,11 +186,11 @@ public class CustomerController { ...@@ -185,11 +186,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("customerListId") Long customerListId, @RequestParam("customerListId") Long customerListId,
@RequestHeader("X-Auth-Token") String authToken) { HttpServletRequest request) {
LOGGER.info("------------IMPORT FILE TEMPLATE--------------"); LOGGER.info("------------IMPORT FILE TEMPLATE--------------");
Locale locale = new Locale("vi", "VN"); Locale locale = new Locale("vi", "VN");
try { try {
UserSession userSession = (UserSession) RedisUtil.getInstance().get(authToken); UserSession userSession = (UserSession) RedisUtil.getInstance().get(request.getHeader("X-Auth-Token"));
if (file.isEmpty()) { if (file.isEmpty()) {
return new ResponseEntity<>(BundleUtils.getLangString("customer.fileNotSelected"), HttpStatus.OK); return new ResponseEntity<>(BundleUtils.getLangString("customer.fileNotSelected"), HttpStatus.OK);
} }
......
...@@ -103,6 +103,8 @@ customer.notLessThan = not less than ...@@ -103,6 +103,8 @@ customer.notLessThan = not less than
customer.importCustomer = IMPORT CUSTOMER 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 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
customer.fileNotSelected=Please select a file customer.fileNotSelected=Please select a file
customer.emailInvalid=Invalid email;
customer.emailExists=Email exists;
common.fileNotSelected=Please select a file common.fileNotSelected=Please select a file
common.fileInvalidFormat=File invalid common.fileInvalidFormat=File invalid
...@@ -105,6 +105,8 @@ customer.notLessThan = không được nhỏ hơn ...@@ -105,6 +105,8 @@ customer.notLessThan = không được nhỏ hơn
customer.importCustomer = IMPORT KHÁCH HÀNG 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) 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)
customer.fileNotSelected=Bạn chưa chọn file customer.fileNotSelected=Bạn chưa chọn file
customer.emailInvalid=Email không đúng định dạng;
customer.emailExists=Email đã tồn tại;
common.fileNotSelected=Bạn chưa chọn file common.fileNotSelected=Bạn chưa chọn file
common.fileInvalidFormat=File không hợp lệ common.fileInvalidFormat=File không hợp lệ
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