更新批量导入数据功能增加对异常捕获

This commit is contained in:
fanzongzhe
2023-12-22 15:24:38 +08:00
parent 4b7d5cbfa0
commit ca0b2ade16

View File

@@ -1123,6 +1123,7 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
@Transactional(rollbackFor = Exception.class)
public ResultBean getExcelInfo3(String startDate, String endDate, MultipartFile file, HttpServletRequest request, HttpServletResponse response) throws IOException {
ResultBean rb = ResultBean.fireFail();
try {
String temp = request.getSession().getServletContext().getRealPath(File.separator) + "temp";// 临时目录
File tempFile = new File(temp);
if (!tempFile.exists()) {
@@ -1272,6 +1273,9 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
}
return rb.success().setMsg("本次导入:" + importReturn.size() + "条数据,生成卡券共计" + importReturn.size() + "张;卡券序列号:" + startNo + "-" + endNo);
}
} catch (Exception e) {
e.printStackTrace();
}
return rb.success().setMsg("导入成功");
}