* @throws Exception
*/
@RequestMapping(params = "saveFiles", method = RequestMethod.POST)
@ResponseBody
public AjaxJson saveFiles(HttpServletRequest request, HttpServletResponse response, TFinanceFilesEntity financeFile) {
AjaxJson j = new AjaxJson();
Map<String, Object> attributes = new HashMap<String, Object>();
String fileKey = oConvertUtils.getString(request.getParameter("fileKey"));// 文件ID
String financeId = oConvertUtils.getString(request.getParameter("financeId"));//资金ID
if (StringUtil.isNotEmpty(fileKey)) {
financeFile.setId(fileKey);
financeFile = systemService.getEntity(TFinanceFilesEntity.class, fileKey);
}
TFinanceEntity finance = systemService.getEntity(TFinanceEntity.class, financeId);
financeFile.setFinance(finance);
UploadFile uploadFile = new UploadFile(request, financeFile);
uploadFile.setCusPath("files");
uploadFile.setSwfpath("swfpath");
uploadFile.setByteField(null);//不存二进制内容
financeFile = systemService.uploadFile(uploadFile);
attributes.put("fileKey", financeFile.getId());
attributes.put("viewhref", "commonController.do?objfileList&fileKey=" + financeFile.getId());
attributes.put("delurl", "commonController.do?delObjFile&fileKey=" + financeFile.getId());
j.setMsg("文件添加成功");
j.setAttributes(attributes);
return j;
}