@RequestMapping("/uploadInfos") public String uploadInfos(HttpServletRequest request) throws Exception { UploadFile uploadFile = FileUpDownUtils.getUploadFile(request); byte[] fileData = FileUpDownUtils.getFileContent(uploadFile.getFile()); String result = physicalReportManager.importInfo(fileData, FrameworkContextUtils.getCurrentLoginName()); request.setAttribute("result", result); return getFileBasePath() + "importResult"; }
/** * @Title: uploadPhysicalReport @Description: 上传体检报告 * * @param request * @return * @throws Exception * @throws * @author 陈传洞 */ @RequestMapping("/uploadPhysicalReport") public String uploadPhysicalReport(HttpServletRequest request) throws Exception { // 上传结果 String resMsg = ""; // 卡号 String cardNum = request.getParameter("cardNum"); String subOrderId = request.getParameter("subOrderId"); if (StringUtils.isNotBlank(cardNum) && StringUtils.isNotBlank(subOrderId)) { UploadFile uploadFile = FileUpDownUtils.getUploadFile(request); byte[] reportFileData = FileUpDownUtils.getFileContent(uploadFile.getFile()); PhysicalReportInfo physicalReportInfo = physicalReportManager.uploadPhysicalReport( reportFileData, cardNum, uploadFile.getFileName(), Long.valueOf(subOrderId)); if (physicalReportInfo.getObjectId() != null) { resMsg = "上传体检报告成功!"; } } if (resMsg.length() == 0) { resMsg = "上传体检报告失败!"; } request.setAttribute("resMsg", resMsg); return getFileBasePath() + "importPhysicalReportResult"; }