场景
SpringBoot中使用POI实现Excel导入到数据库(图文教程已实践):
https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/88660466
在Excel导入到数据库后进行格式验证,如果有错误则将错误的Cell标红然后验证完成后
将标红的Excel下载到客户端。
实现
js中发送请求
//解析Excel操作
function parseExcel(){
var url = "/wmsReceiveOrder/parseExcel";
$.ajax({
type: 'POST',
url: url,
cache: false, //禁用缓存
contentType: false,
dataType: "json",
processData:false,
success: function (result) {
//250则为验证不通过则下载不正确的excel
if(result.statusCode=="250"){
alert(result.message)
window.location.href="/wmsReceiveOrder/downloadMistakeExcel";
}else{
alert(result.message)
if(result.statusCode=&#