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

quangdn

parent 54b93bfe
...@@ -898,18 +898,6 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -898,18 +898,6 @@ public class CustomerServiceImpl implements CustomerService {
//<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<CustomizeFields> header = new ArrayList<>(); List<CustomizeFields> header = new ArrayList<>();
// 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", "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", "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("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", "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 email"));
// 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.no", locale)));
header.add(new CustomizeFields("text", BundleUtils.getLangString("customer.fullname", 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.mainPhone", locale)));
...@@ -1278,18 +1266,6 @@ public class CustomerServiceImpl implements CustomerService { ...@@ -1278,18 +1266,6 @@ 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", "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 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", "Địa chỉ#Tối đa 500 ký tự"));
// 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", "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 email"));
// 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.no", locale)));
header.add(new CustomizeFields("text", BundleUtils.getLangString("customer.fullname", 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.mainPhone", locale)));
......
...@@ -11,7 +11,6 @@ import com.viettel.campaign.web.dto.request_dto.CustomerRequestDTO; ...@@ -11,7 +11,6 @@ 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;
...@@ -29,10 +28,7 @@ import java.nio.file.Files; ...@@ -29,10 +28,7 @@ import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@Controller @Controller
@RequestMapping("/ipcc/customer") @RequestMapping("/ipcc/customer")
...@@ -191,13 +187,14 @@ public class CustomerController { ...@@ -191,13 +187,14 @@ public class CustomerController {
@RequestParam("customerListId") Long customerListId, @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--------------");
Locale locale = new Locale("vi", "VN");
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<>(BundleUtils.getLangString("customer.fileNotSelected"), HttpStatus.OK);
} }
if (!Objects.equals(FilenameUtils.getExtension(file.getOriginalFilename()), Constants.FileType.xlsx)) { if (!Objects.equals(FilenameUtils.getExtension(file.getOriginalFilename()), Constants.FileType.xlsx)) {
return new ResponseEntity<>("File khong dung dinh dang", HttpStatus.OK); return new ResponseEntity<>(BundleUtils.getLangString("customer.invalidTemplate", locale), HttpStatus.OK);
} }
String path = saveUploadFile(file); String path = saveUploadFile(file);
List<CustomizeFields> dynamicHeaders = customerService.getDynamicHeader(userSession.getCompanySiteId()); List<CustomizeFields> dynamicHeaders = customerService.getDynamicHeader(userSession.getCompanySiteId());
......
...@@ -102,3 +102,4 @@ customer.notGreaterThan = not greater than ...@@ -102,3 +102,4 @@ customer.notGreaterThan = not greater than
customer.notLessThan = not less than 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
...@@ -75,7 +75,7 @@ customer.no = STT ...@@ -75,7 +75,7 @@ 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.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.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.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.email=Email#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.address = Địa chỉ#Tối đa 500 ký tự
customer.cusType = Loại khách hàng customer.cusType = Loại khách hàng
customer.companyName = Công ty#Tối đa 100 ký tự customer.companyName = Công ty#Tối đa 100 ký tự
...@@ -104,3 +104,4 @@ customer.notGreaterThan = không được lớn hơn ...@@ -104,3 +104,4 @@ customer.notGreaterThan = không được lớn hơn
customer.notLessThan = không được nhỏ hơn 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
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