diff options
| author | wangxin <[email protected]> | 2018-12-16 16:50:06 +0600 |
|---|---|---|
| committer | wangxin <[email protected]> | 2018-12-16 16:50:06 +0600 |
| commit | 09900fa0eff45ca3267ffffd87970637ab307878 (patch) | |
| tree | abaed6f9d15b04a65aeea2162847161927ae08da | |
| parent | 4e30bea3dd8078f069acf790a7a99bc640445bbe (diff) | |
(1)来函表单页面title与letter number显示错位修复
(2)导入配置异常提示增加无数据与导入错误模板的提示
| -rw-r--r-- | src/main/java/com/nis/util/excel/ImportBigExcel.java | 7 | ||||
| -rw-r--r-- | src/main/java/com/nis/web/controller/BaseController.java | 2 | ||||
| -rw-r--r-- | src/main/webapp/WEB-INF/views/cfg/requestForm.jsp | 4 |
3 files changed, 10 insertions, 3 deletions
diff --git a/src/main/java/com/nis/util/excel/ImportBigExcel.java b/src/main/java/com/nis/util/excel/ImportBigExcel.java index a896313..046c144 100644 --- a/src/main/java/com/nis/util/excel/ImportBigExcel.java +++ b/src/main/java/com/nis/util/excel/ImportBigExcel.java @@ -24,6 +24,7 @@ import org.apache.commons.lang3.StringUtils; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.apache.poi.openxml4j.exceptions.OpenXML4JException; import org.apache.poi.ss.usermodel.DateUtil; +import org.jets3t.service.ServiceException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.web.multipart.MultipartFile; @@ -399,14 +400,18 @@ public class ImportBigExcel extends XLSXCovertCSVReader{ * @throws ParserConfigurationException * @throws OpenXML4JException * @throws IOException + * @throws ServiceException */ - public <E> BlockingQueue<E> getDataList(Class<E> cls) throws InstantiationException, IllegalAccessException, IOException, OpenXML4JException, ParserConfigurationException, SAXException, SQLException{ + public <E> BlockingQueue<E> getDataList(Class<E> cls) throws InstantiationException, IllegalAccessException, IOException, OpenXML4JException, ParserConfigurationException, SAXException, SQLException, ServiceException{ log.warn("start to load data..."); this.processOneSheet(uploadFile, this.sheetIndex); long start=System.currentTimeMillis(); if(regionDict==null) { throw new RuntimeException("regionDict is null!"); } + if(dataList.size()==0) { + throw new ServiceException(props.getProperty("noneData", "noneData")); + } // Get excel data BlockingQueue<E> _dataList =new ArrayBlockingQueue(dataList.size(),true); for (int i = 0; i < dataList.size(); i++) { diff --git a/src/main/java/com/nis/web/controller/BaseController.java b/src/main/java/com/nis/web/controller/BaseController.java index 5342c17..64491eb 100644 --- a/src/main/java/com/nis/web/controller/BaseController.java +++ b/src/main/java/com/nis/web/controller/BaseController.java @@ -1880,6 +1880,8 @@ public class BaseController { addMessage(redirectAttributes,"error", "request_service_failed"); }else if(e instanceof ServiceException) { addMessage(redirectAttributes,"error", e.getMessage()); + }else if(e instanceof IndexOutOfBoundsException){ + addMessage(redirectAttributes,"error", "template_error"); }else { addMessage(redirectAttributes,"error", "import_failed"); } diff --git a/src/main/webapp/WEB-INF/views/cfg/requestForm.jsp b/src/main/webapp/WEB-INF/views/cfg/requestForm.jsp index 049dd9f..830f8b6 100644 --- a/src/main/webapp/WEB-INF/views/cfg/requestForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/requestForm.jsp @@ -27,7 +27,7 @@ <input type="hidden" name="functionId" value="${requestInfo.functionId}"/> <div class="form-body"> <div class="form-group"> - <label class="col-md-3 control-label"><font color="red">*</font><spring:message code="request_number"></spring:message>:</label> + <label class="col-md-3 control-label"><font color="red">*</font><spring:message code="title"></spring:message>:</label> <div class="col-md-4"> <input type="text" class="form-control required" maxlength="512" name="requestTitle" value="${requestInfo.requestTitle}"><!--requestTitle当成来函函号使用 --> </div> @@ -46,7 +46,7 @@ </div> </div> <div class="form-group"> - <label class="col-md-3 control-label"><font color="red">*</font><spring:message code="title"></spring:message>:</label> + <label class="col-md-3 control-label"><font color="red">*</font><spring:message code="request_number"></spring:message>:</label> <div class="col-md-4"> <input type="text" class="form-control required" name="requestNumber" maxlength="512" value="${requestInfo.requestNumber}"><!--requestTitle当成来函标题使用 --> </div> |
