更新批量导入数据功能增加对异常捕获
This commit is contained in:
@@ -1123,6 +1123,7 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public ResultBean getExcelInfo3(String startDate, String endDate, MultipartFile file, HttpServletRequest request, HttpServletResponse response) throws IOException {
|
public ResultBean getExcelInfo3(String startDate, String endDate, MultipartFile file, HttpServletRequest request, HttpServletResponse response) throws IOException {
|
||||||
ResultBean rb = ResultBean.fireFail();
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
try {
|
||||||
String temp = request.getSession().getServletContext().getRealPath(File.separator) + "temp";// 临时目录
|
String temp = request.getSession().getServletContext().getRealPath(File.separator) + "temp";// 临时目录
|
||||||
File tempFile = new File(temp);
|
File tempFile = new File(temp);
|
||||||
if (!tempFile.exists()) {
|
if (!tempFile.exists()) {
|
||||||
@@ -1272,6 +1273,9 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
|
|||||||
}
|
}
|
||||||
return rb.success().setMsg("本次导入:" + importReturn.size() + "条数据,生成卡券共计" + importReturn.size() + "张;卡券序列号:" + startNo + "-" + endNo);
|
return rb.success().setMsg("本次导入:" + importReturn.size() + "条数据,生成卡券共计" + importReturn.size() + "张;卡券序列号:" + startNo + "-" + endNo);
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
return rb.success().setMsg("导入成功");
|
return rb.success().setMsg("导入成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user