Commit b184e2d6 authored by Vu Duy Anh's avatar Vu Duy Anh

anhvd commit

parent 03ae6a62
[main] 22/08/2019 08:36:29 INFO RedisUtil: (38) : Start connect Redis: 10.60.156.82:8011,10.60.156.82:8012,10.60.156.82:8013,10.60.156.82:8014,10.60.156.82:8015,10.60.156.82:8016
[main] 22/08/2019 09:37:28 INFO RedisUtil: (38) : Start connect Redis: 10.60.156.82:8011,10.60.156.82:8012,10.60.156.82:8013,10.60.156.82:8014,10.60.156.82:8015,10.60.156.82:8016
[main] 22/08/2019 10:56:57 INFO RedisUtil: (38) : Start connect Redis: 10.60.156.82:8011,10.60.156.82:8012,10.60.156.82:8013,10.60.156.82:8014,10.60.156.82:8015,10.60.156.82:8016
[main] 22/08/2019 11:26:26 INFO RedisUtil: (38) : Start connect Redis: 10.60.156.82:8011,10.60.156.82:8012,10.60.156.82:8013,10.60.156.82:8014,10.60.156.82:8015,10.60.156.82:8016
[main] 22/08/2019 11:38:32 INFO RedisUtil: (38) : Start connect Redis: 10.60.156.82:8011,10.60.156.82:8012,10.60.156.82:8013,10.60.156.82:8014,10.60.156.82:8015,10.60.156.82:8016
[main] 22/08/2019 12:57:40 INFO RedisUtil: (38) : Start connect Redis: 10.60.156.82:8011,10.60.156.82:8012,10.60.156.82:8013,10.60.156.82:8014,10.60.156.82:8015,10.60.156.82:8016
[main] 22/08/2019 14:10:00 INFO RedisUtil: (38) : Start connect Redis: 10.60.156.82:8011,10.60.156.82:8012,10.60.156.82:8013,10.60.156.82:8014,10.60.156.82:8015,10.60.156.82:8016
[main] 22/08/2019 14:21:46 INFO RedisUtil: (38) : Start connect Redis: 10.60.156.82:8011,10.60.156.82:8012,10.60.156.82:8013,10.60.156.82:8014,10.60.156.82:8015,10.60.156.82:8016
[main] 22/08/2019 14:25:54 INFO RedisUtil: (38) : Start connect Redis: 10.60.156.82:8011,10.60.156.82:8012,10.60.156.82:8013,10.60.156.82:8014,10.60.156.82:8015,10.60.156.82:8016
[main] 22/08/2019 16:08:40 INFO RedisUtil: (38) : Start connect Redis: 10.60.156.82:8011,10.60.156.82:8012,10.60.156.82:8013,10.60.156.82:8014,10.60.156.82:8015,10.60.156.82:8016
[main] 25/08/2019 14:17:33 INFO RedisUtil: (38) : Start connect Redis: 10.60.156.82:8011,10.60.156.82:8012,10.60.156.82:8013,10.60.156.82:8014,10.60.156.82:8015,10.60.156.82:8016
[main] 25/08/2019 14:28:39 INFO RedisUtil: (38) : Start connect Redis: 10.60.156.82:8011,10.60.156.82:8012,10.60.156.82:8013,10.60.156.82:8014,10.60.156.82:8015,10.60.156.82:8016
[qtp789502290-24] 25/08/2019 14:29:02 ERROR RedisUtil: (111) :
java.lang.NullPointerException
at com.viettel.campaign.utils.RedisUtil.get(RedisUtil.java:106)
at com.viettel.campaign.web.rest.ScenarioController.importFile(ScenarioController.java:113)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:209)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:891)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:974)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:877)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:851)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:865)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1655)
at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:215)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at com.viettel.campaign.filter.CorsFilter.doFilter(CorsFilter.java:34)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1340)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1242)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.Server.handle(Server.java:503)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:364)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:132)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683)
at java.lang.Thread.run(Thread.java:748)
[qtp789502290-24] 25/08/2019 14:29:06 ERROR RedisUtil: (111) :
java.lang.NullPointerException
at com.viettel.campaign.utils.RedisUtil.get(RedisUtil.java:106)
at com.viettel.campaign.web.rest.ScenarioController.importFile(ScenarioController.java:113)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:209)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:891)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:974)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:877)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:851)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:865)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1655)
at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:215)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at com.viettel.campaign.filter.CorsFilter.doFilter(CorsFilter.java:34)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1340)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1242)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.Server.handle(Server.java:503)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:364)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:132)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683)
at java.lang.Thread.run(Thread.java:748)
[qtp789502290-27] 25/08/2019 14:30:48 ERROR RedisUtil: (111) :
java.lang.NullPointerException
at com.viettel.campaign.utils.RedisUtil.get(RedisUtil.java:106)
at com.viettel.campaign.web.rest.ScenarioController.importFile(ScenarioController.java:113)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:209)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:891)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:974)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:877)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:851)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:865)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1655)
at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:215)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at com.viettel.campaign.filter.CorsFilter.doFilter(CorsFilter.java:34)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1340)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1242)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.Server.handle(Server.java:503)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:364)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683)
at java.lang.Thread.run(Thread.java:748)
[main] 25/08/2019 14:31:15 INFO RedisUtil: (38) : Start connect Redis: 10.60.156.82:8011,10.60.156.82:8012,10.60.156.82:8013,10.60.156.82:8014,10.60.156.82:8015,10.60.156.82:8016
[main] 25/08/2019 14:39:36 INFO RedisUtil: (38) : Start connect Redis: 10.60.156.82:8011,10.60.156.82:8012,10.60.156.82:8013,10.60.156.82:8014,10.60.156.82:8015,10.60.156.82:8016
[main] 25/08/2019 14:41:10 INFO RedisUtil: (38) : Start connect Redis: 10.60.156.82:8011,10.60.156.82:8012,10.60.156.82:8013,10.60.156.82:8014,10.60.156.82:8015,10.60.156.82:8016
......@@ -2,8 +2,11 @@ package com.viettel.campaign.service;
import com.viettel.campaign.model.ccms_full.Scenario;
import com.viettel.campaign.web.dto.*;
import com.viettel.econtact.filter.UserSession;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import java.util.List;
import java.util.Map;
/**
* @author anhvd_itsol
......@@ -19,4 +22,8 @@ public interface ScenarioService {
Integer countDuplicateScenarioCode(Long companySiteId, String code, Long scenarioId);
ResultDTO saveContacQuestResult(ContactQuestResultDTO dto);
XSSFWorkbook buildTemplate();
Map<String, Object> readAndValidateCustomer(String path, UserSession userSession);
}
package com.viettel.campaign.service.impl;
import com.viettel.campaign.config.DataSourceQualify;
import com.viettel.campaign.model.ccms_full.ContactQuestResult;
import com.viettel.campaign.model.ccms_full.Scenario;
import com.viettel.campaign.model.ccms_full.ScenarioAnswer;
import com.viettel.campaign.model.ccms_full.ScenarioQuestion;
import com.viettel.campaign.model.ccms_full.*;
import com.viettel.campaign.repository.ccms_full.*;
import com.viettel.campaign.service.ScenarioService;
import com.viettel.campaign.utils.BundleUtils;
import com.viettel.campaign.utils.Constants;
import com.viettel.campaign.utils.WorkBookBuilder;
import com.viettel.campaign.web.dto.*;
import com.viettel.econtact.filter.UserSession;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.ss.util.CellRangeAddressList;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.modelmapper.ModelMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* @author anhvd_itsol
......@@ -126,6 +132,7 @@ public class ScenarioServiceImpl implements ScenarioService {
}
return null;
}
public ResultDTO saveContacQuestResult(ContactQuestResultDTO dto) {
ResultDTO resultDTO = new ResultDTO();
......@@ -141,4 +148,179 @@ public class ScenarioServiceImpl implements ScenarioService {
return resultDTO;
}
@Override
@Transactional(DataSourceQualify.CCMS_FULL)
public XSSFWorkbook buildTemplate() {
Locale locale = new Locale("vi", "VN");
try {
XSSFWorkbook workbook = new XSSFWorkbook();
Sheet sheet;
CellStyle styleTitle = WorkBookBuilder.buildDefaultStyleTitle(workbook);
CellStyle styleRowHeader = WorkBookBuilder.buildDefaultStyleRowHeader(workbook);
CellStyle styleRow = WorkBookBuilder.buildDefaultStyleRow(workbook);
// list header
List<String> fileHeaderList = new ArrayList<>();
fileHeaderList.add(BundleUtils.getLangString("scenario.template.questionCode", locale));
fileHeaderList.add(BundleUtils.getLangString("scenario.template.questionType", locale));
fileHeaderList.add(BundleUtils.getLangString("scenario.template.question", locale));
fileHeaderList.add(BundleUtils.getLangString("scenario.template.answer", locale));
fileHeaderList.add(BundleUtils.getLangString("scenario.template.hashInput", locale));
fileHeaderList.add(BundleUtils.getLangString("scenario.template.required", locale));
fileHeaderList.add(BundleUtils.getLangString("scenario.template.default", locale));
fileHeaderList.add(BundleUtils.getLangString("scenario.template.mappingQuestion", locale));
//
String sheetName = BundleUtils.getLangString("campaign", locale);
sheet = workbook.createSheet(sheetName);
// Title
String title = BundleUtils.getLangString("scenario.template.title", locale);
int rowTitleStart = 0;
Row rowTitle = sheet.createRow(rowTitleStart);
rowTitle.setHeight((short) 800);
sheet.addMergedRegion(new CellRangeAddress(rowTitleStart, rowTitleStart, 0, 7));
WorkBookBuilder.writeCellContent(rowTitle, styleTitle, 0, title);
// Header
int startRowTable = 2;
Row rowHeader = sheet.createRow(startRowTable);
for (int i = 0; i < fileHeaderList.size(); i++) {
sheet.setColumnWidth(i, 6000);
WorkBookBuilder.writeCellContent(rowHeader, styleRowHeader, i, fileHeaderList.get(i));
}
DataValidationHelper dataValidationHelper = sheet.getDataValidationHelper();
//QuestionType
DataValidationConstraint questionType = dataValidationHelper.createExplicitListConstraint(new String[]{BundleUtils.getLangString("scenario.template.singleChoice", locale),
BundleUtils.getLangString("scenario.template.multiChoice", locale), BundleUtils.getLangString("scenario.template.text", locale)});
CellRangeAddressList typeCellRangeAddressList = new CellRangeAddressList(3, 9999, 1, 1);
DataValidation typeValidation = dataValidationHelper.createValidation(questionType, typeCellRangeAddressList);
typeValidation.setSuppressDropDownArrow(true);
sheet.addValidationData(typeValidation);
//HashInputCombobox
DataValidationConstraint hasInput = dataValidationHelper.createExplicitListConstraint(new String[]{BundleUtils.getLangString("scenario.template.yes", locale), BundleUtils.getLangString("scenario.template.no", locale)});
CellRangeAddressList hasInputCellRangeAddressList = new CellRangeAddressList(3, 9999, 4, 4);
DataValidation hasInputValidation = dataValidationHelper.createValidation(hasInput, hasInputCellRangeAddressList);
hasInputValidation.setSuppressDropDownArrow(true);
sheet.addValidationData(hasInputValidation);
//Required
DataValidationConstraint required = dataValidationHelper.createExplicitListConstraint(new String[]{BundleUtils.getLangString("scenario.template.yes", locale), BundleUtils.getLangString("scenario.template.no", locale)});
CellRangeAddressList requiredCellRangeAddressList = new CellRangeAddressList(3, 9999, 5, 5);
DataValidation requiredValidation = dataValidationHelper.createValidation(required, requiredCellRangeAddressList);
requiredValidation.setSuppressDropDownArrow(true);
sheet.addValidationData(requiredValidation);
//Required
DataValidationConstraint defaultValue = dataValidationHelper.createExplicitListConstraint(new String[]{BundleUtils.getLangString("scenario.template.yes", locale), BundleUtils.getLangString("scenario.template.no", locale)});
CellRangeAddressList defaultValueCellRangeAddressList = new CellRangeAddressList(3, 9999, 6, 6);
DataValidation defaultValueValidation = dataValidationHelper.createValidation(defaultValue, defaultValueCellRangeAddressList);
defaultValueValidation.setSuppressDropDownArrow(true);
sheet.addValidationData(defaultValueValidation);
return workbook;
} catch (Exception e) {
logger.error(e.getMessage());
return null;
}
}
@Override
@Transactional(DataSourceQualify.CCMS_FULL)
public Map<String, Object> readAndValidateCustomer(String path, UserSession userSession) {
Locale locale = new Locale("vi", "VN");
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
Map<String, Object> result = new HashMap<>();
StringBuilder sb = new StringBuilder();
boolean isValid = false;
try {
List<String> fileHeaderList = new ArrayList<>();
fileHeaderList.add(BundleUtils.getLangString("scenario.template.questionCode", locale));
fileHeaderList.add(BundleUtils.getLangString("scenario.template.questionType", locale));
fileHeaderList.add(BundleUtils.getLangString("scenario.template.question", locale));
fileHeaderList.add(BundleUtils.getLangString("scenario.template.answer", locale));
fileHeaderList.add(BundleUtils.getLangString("scenario.template.hashInput", locale));
fileHeaderList.add(BundleUtils.getLangString("scenario.template.required", locale));
fileHeaderList.add(BundleUtils.getLangString("scenario.template.default", locale));
fileHeaderList.add(BundleUtils.getLangString("scenario.template.mappingQuestion", locale));
File file = new File(path);
FileInputStream fis = new FileInputStream(file);
XSSFWorkbook workbook = new XSSFWorkbook(fis);
Sheet sheet = workbook.getSheetAt(0);
Row row = sheet.getRow(3);
Font resultFont = workbook.createFont();
resultFont.setBold(true);
resultFont.setFontHeightInPoints((short) 11);
CellStyle resultStyle = workbook.createCellStyle();
resultStyle.setFont(resultFont);
resultStyle.setBorderLeft(BorderStyle.THIN);
resultStyle.setBorderRight(BorderStyle.THIN);
resultStyle.setBorderBottom(BorderStyle.THIN);
resultStyle.setBorderTop(BorderStyle.THIN);
//kt file du lieu rong
if (sheet.getPhysicalNumberOfRows() == 3) {
result.put("message", BundleUtils.getLangString("customer.noData", locale));
result.put("file", file);
return result;
} else {
Cell resultCell = sheet.getRow(3).createCell(sheet.getRow(3).getPhysicalNumberOfCells());
resultCell.setCellValue(BundleUtils.getLangString("customer.result", locale));
resultCell.setCellStyle(resultStyle);
}
List<Object[]> rawDataList = new ArrayList<>();
//validate row
for (int i = 4; i < sheet.getPhysicalNumberOfRows(); i++) {
Row dataRow = sheet.getRow(i);
if (dataRow != null) {
Object[] obj = new Object[row.getPhysicalNumberOfCells()];
for (int j = 0; j < row.getPhysicalNumberOfCells(); j++) {
Cell dataCell = dataRow.getCell(j);
if (dataCell != null) {
// switch (dataCell.getCellTypeEnum()) {
// case NUMERIC:
// obj[j] = dataCell.getNumericCellValue();
// break;
// default:
// obj[j] = dataCell.getStringCellValue();
// break;
// }
} else {
// Cell headerCell = row.getCell(j);
// if (headerCell.getStringCellValue().equals(BundleUtils.getLangString("customer.cusType", locale))) {
// obj[j] = BundleUtils.getLangString("customer.cusType.normal", locale);
// } else if (headerCell.getStringCellValue().equals(BundleUtils.getLangString("customer.callAllowed", locale)) || headerCell.getStringCellValue().equals(BundleUtils.getLangString("customer.emailAllowed", locale))
// || headerCell.getStringCellValue().equals(BundleUtils.getLangString("customer.smsAllowed", locale))) {
// obj[j] = BundleUtils.getLangString("customer.yes", locale);
// break;
// } else {
// obj[j] = null;
// }
}
}
rawDataList.add(obj);
}
}
//insert data
if (isValid) {
for (int i = 0; i < rawDataList.size(); i++) {
}
}
} catch (Exception ex) {
logger.info(ex.getMessage(), ex);
result.put("message", BundleUtils.getLangString("customer.errorValidate", locale));
}
return result;
}
}
......@@ -300,32 +300,4 @@ public class CampaignController {
return new ResponseEntity<>(result, HttpStatus.OK);
}
@RequestMapping(value = "/import-file", method = RequestMethod.POST)
public ResponseEntity<?> importFile(@RequestParam("file") MultipartFile file,
@RequestHeader("X-Auth-Token") String authToken) {
Locale locale = new Locale("vi", "VN");
try {
UserSession userSession = (UserSession) RedisUtil.getInstance().get(authToken);
if (file.isEmpty()) {
return new ResponseEntity<>(BundleUtils.getLangString("common.fileNotSelected"), HttpStatus.OK);
}
if (!Objects.equals(FilenameUtils.getExtension(file.getOriginalFilename()), Constants.FileType.xlsx)) {
return new ResponseEntity<>(BundleUtils.getLangString("common.fileInvalidFormat", locale), HttpStatus.OK);
}
//String path = saveUploadFile(file);
// List<CustomizeFields> dynamicHeaders = customerService.getDynamicHeader(userSession.getCompanySiteId());
// Map<String, Object> map = customerService.readAndValidateCustomer(path, dynamicHeaders, userSession, customerListId);
// File fileExport = (File) map.get("file");
// String message = (String) map.get("message");
// return ResponseEntity.ok()
// .header("Content-Type", Constants.MIME_TYPE.EXCEL_XLSX)
// .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=template_import_customer.xlsx")
// .header("Message", message)
// .body(Files.readAllBytes(fileExport.toPath()));
return new ResponseEntity<>(null,HttpStatus.OK);
} catch (Exception e) {
logger.error(e.getMessage(), e);
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
}
}
}
......@@ -2,15 +2,32 @@ package com.viettel.campaign.web.rest;
import com.viettel.campaign.model.ccms_full.Scenario;
import com.viettel.campaign.service.ScenarioService;
import com.viettel.campaign.utils.BundleUtils;
import com.viettel.campaign.utils.Constants;
import com.viettel.campaign.utils.RedisUtil;
import com.viettel.campaign.web.dto.ContactQuestResultDTO;
import com.viettel.campaign.web.dto.ResultDTO;
import com.viettel.campaign.web.dto.ScenarioDTO;
import com.viettel.econtact.filter.UserSession;
import org.apache.commons.io.FilenameUtils;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* @author anhvd_itsol
......@@ -54,4 +71,82 @@ public class ScenarioController {
ResultDTO resultDTO = scenarioService.saveContacQuestResult(dto);
return new ResponseEntity<>(resultDTO, HttpStatus.OK);
}
@RequestMapping(value = "/download-file-template", method = RequestMethod.GET)
public ResponseEntity<?> downloadFileTemplate(HttpServletResponse response) {
XSSFWorkbook workbook = null;
byte[] contentReturn = null;
try {
String fileName = "import_scenario_template.xlsx";
response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
OutputStream outputStream;
workbook = scenarioService.buildTemplate();
outputStream = response.getOutputStream();
workbook.write(outputStream);
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
workbook.write(byteArrayOutputStream);
contentReturn = byteArrayOutputStream.toByteArray();
} catch (Exception ex) {
logger.error(ex.getMessage(), ex);
return new ResponseEntity<byte[]>(null, null, HttpStatus.BAD_REQUEST);
} finally {
if (workbook != null) {
try {
workbook.close();
} catch (IOException e) {
logger.error(e.getMessage(), e);
}
}
}
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.parseMediaType("application/vnd.ms-excel"));
return new ResponseEntity<byte[]>(contentReturn, headers, HttpStatus.OK);
}
@RequestMapping(value = "/import-file", method = RequestMethod.POST)
public ResponseEntity<?> importFile(@RequestParam MultipartFile file) {
logger.info("------------IMPORT FILE TEMPLATE--------------");
Locale locale = new Locale("vi", "VN");
try {
UserSession userSession = new UserSession();
// UserSession userSession = (UserSession) RedisUtil.getInstance().get(authToken);
if (file.isEmpty()) {
return new ResponseEntity<>(BundleUtils.getLangString("common.fileNotSelected"), HttpStatus.OK);
}
if (!Objects.equals(FilenameUtils.getExtension(file.getOriginalFilename()), Constants.FileType.xlsx)) {
return new ResponseEntity<>(BundleUtils.getLangString("common.fileInvalidFormat", locale), HttpStatus.OK);
}
String path = saveUploadFile(file);
Map<String, Object> map = scenarioService.readAndValidateCustomer(path, userSession);
File fileExport = (File) map.get("file");
String message = (String) map.get("message");
return ResponseEntity.ok()
.header("Content-Type", Constants.MIME_TYPE.EXCEL_XLSX)
.header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=template_import_customer.xlsx")
.header("Message", message)
.body(Files.readAllBytes(fileExport.toPath()));
} catch (Exception e) {
logger.error(e.getMessage());
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
}
}
private String saveUploadFile(MultipartFile file) {
try {
String currentTime = new SimpleDateFormat("yyyy_MM_dd_hh_mm_ss").format(new Date());
String fileName = FilenameUtils.getBaseName(file.getOriginalFilename()) + "_" + currentTime + "." + FilenameUtils.getExtension(file.getOriginalFilename());
byte[] content = file.getBytes();
File uploadFolder = new File(System.getProperty("user.dir") + File.separator + "etc" + File.separator + "upload");
if (!uploadFolder.exists()) {
uploadFolder.mkdir();
}
Path path = Paths.get(System.getProperty("user.dir") + File.separator + "etc", fileName);
Files.write(path, content);
return path.toString();
} catch (Exception e) {
logger.error(e.getMessage());
}
return null;
}
}
......@@ -106,3 +106,20 @@ customer.fileNotSelected=Please select a file
common.fileNotSelected=Please select a file
common.fileInvalidFormat=File invalid
#IMPORT SCENARIO TEMPLATE
scenario.template.title=IMPORT QUESTIONS
scenario.template.questionCode=Question code
scenario.template.questionType=Question type
scenario.template.question=Question
scenario.template.answer=Answer
scenario.template.hashInput=Hash input?
scenario.template.required=Required?
scenario.template.default=Default?
scenario.template.mappingQuestion=Mapping question
scenario.template.yes=Yes
scenario.template.no=No
scenario.template.result=Result
scenario.template.singleChoice=SingleChoice
scenario.template.multiChoice=MultiChoice
scenario.template.text=Text
......@@ -108,3 +108,24 @@ customer.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ệ
#IMPORT SCENARIO TEMPLATE
scenario.template.title=IMPORT CÂU HỎI
scenario.template.questionCode=Mã câu hỏi
scenario.template.questionType=Loại câu hỏi
scenario.template.question=Câu hỏi
scenario.template.answer=Câu trả lời
scenario.template.hashInput=Nhập text?
scenario.template.required=Bắt buộc?
scenario.template.default=Mặc định?
scenario.template.mappingQuestion=Câu hỏi liên kết
scenario.template.yes=
scenario.template.no=Không
scenario.template.result=Kết quả
scenario.template.singleChoice=SingleChoice
scenario.template.multiChoice=MultiChoice
scenario.template.text=Text
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