Commit d8dab74c authored by liuxinben's avatar liuxinben

修改格口文件上传的返回

parent 74fcc101
......@@ -57,7 +57,7 @@ public class ReadExcelApi {
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(MediaType.APPLICATION_JSON)
@Transactional(rollbackFor = Exception.class)
public boolean ReadPersonPost(@RequestParam("formStartTime") String startDate, @RequestParam("formDeadLine") String endDate, HttpServletResponse resp, HttpServletRequest requ) {
public Map<String, String> ReadPersonPost(@RequestParam("formStartTime") String startDate, @RequestParam("formDeadLine") String endDate, HttpServletResponse resp, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
YXJSONResponse yxresp = new YXJSONResponse();
......@@ -158,19 +158,19 @@ public class ReadExcelApi {
e.printStackTrace();
logger.error("上传文件名" + filename + "起始时间" + startDate + "截止时间" + endDate);
logger.error("", e);
yxresp.outPutError("Exception", "上传文件时发生错误,非法XML文件:" + filename);
continue;
} finally {
yxresp.outPutError("Exception", "上传文件时发生错误,非法EXCEL文件:" + filename);
map.put("result","false");
map.put("msg","非法EXCEL文件");
return map;
}
} catch (Exception e) {
e.printStackTrace();
logger.error("上传文件名" + filename + "起始时间" + startDate + "截止时间" + endDate);
logger.error("", e);
yxresp.outPutError("FileUploadException", "文件上载发生异常:" + e.getMessage());
} finally {
return true;
map.put("result","false");
map.put("msg","文件上载发生异常");
return map;
}
}
}
......@@ -178,10 +178,13 @@ public class ReadExcelApi {
} catch (Exception e) {
logger.error("上传文件名" + filename + "起始时间" + startDate + "截止时间" + endDate);
logger.error("Exception 导入个人邮寄信息表异常", e);
} finally {
map.put("result","false");
map.put("msg","导入个人邮寄信息表异常");
return map;
}
return true;
map.put("result","true");
map.put("msg","上传成功");
return map;
}
/**
......
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