package com.point.strategy.docSimpleArrange.controller; import com.alibaba.druid.proxy.jdbc.NClobProxyImpl; import com.bstek.ureport.Utils; import com.bstek.ureport.export.ExportConfigure; import com.bstek.ureport.export.ExportConfigureImpl; import com.bstek.ureport.export.ExportManager; import com.github.pagehelper.PageInfo; import com.point.strategy.bean.Dict; import com.point.strategy.bean.TtableStructDescription; import com.point.strategy.common.AjaxJson; import com.point.strategy.common.PageUtil; import com.point.strategy.common.StringUtil; import com.point.strategy.docSimpleArrange.bean.DocOriginalEntity; import com.point.strategy.docSimpleArrange.bean.DocSimpleArrange; import com.point.strategy.docSimpleArrange.bean.PackSqlObject; import com.point.strategy.docSimpleArrange.service.DocSimpleService; import com.point.strategy.service.DictService; import com.point.strategy.service.TtableStructDescriptionService; import com.point.strategy.user.bean.UserRole; import com.point.strategy.user.service.UserService; import com.point.strategy.webSocket.WebSocket; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import net.sf.json.JsonConfig; import org.apache.poi.hssf.usermodel.HSSFCell; import org.apache.poi.hssf.usermodel.HSSFRow; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.*; import java.sql.Clob; import java.sql.SQLException; import java.text.SimpleDateFormat; import java.util.*; @RestController @RequestMapping("/v/docSimple") @Api(tags = "文书简化整理", value = "DocSimpleController") public class DocSimpleController { private static final Logger logger = LoggerFactory.getLogger(DocSimpleController.class); @Autowired private DocSimpleService docSimpleService; @Autowired private TtableStructDescriptionService ttableStructDescriptionService; @Autowired private UserService userService; @Autowired private WebSocket webSocket; @Autowired private DictService dictService; @RequestMapping(value="/getDocSimpleWithPage" , method= RequestMethod.POST) @ApiOperation(value = "分页查询简化方法整理信息") public AjaxJson getDocSimpleWithPage(String fondsNo,String fondsNoCode,Integer page,Integer limit) { AjaxJson json = null; try { DocSimpleArrange docSimpleArrange = new DocSimpleArrange(); docSimpleArrange.setFondsNo(fondsNo); docSimpleArrange.setFondsNoCode(fondsNoCode); if(page!=null) { docSimpleArrange.setPage(page); } if(limit!=null) { docSimpleArrange.setLimit(limit); } List list = docSimpleService.getDocSimpleWithPage(docSimpleArrange); PageInfo pageInfo = new PageInfo(list); long total = pageInfo.getTotal(); json = new AjaxJson(); json.put("list", list); json.put("total", total); }catch(Exception e) { json = AjaxJson.returnExceptionInfo("分页查询简化方法整理信息失败"+e); } return json; } @RequestMapping(value="/saveDocSimple" , method= RequestMethod.POST) @ApiOperation(value = "保存简化方法整理信息") public AjaxJson saveDocSimple(@RequestBody DocSimpleArrange docSimpleArrange) { AjaxJson json = null; try { int num = docSimpleService.saveDocSimple(docSimpleArrange); json = new AjaxJson(); }catch(Exception e) { json = AjaxJson.returnExceptionInfo("保存简化方法整理信息失败"+e); } return json; } @RequestMapping(value="/deleteDocSimple" , method= RequestMethod.POST) @ApiOperation(value = "删除简化方法整理信息,批量删除用逗号隔开id值") @ApiImplicitParams({ @ApiImplicitParam(paramType = "query", name = "ids", value = "逗号拼接的id字符串", required = true, dataType = "String"), }) public AjaxJson deleteDocSimple(String ids) { AjaxJson json = null; try { int num = docSimpleService.deleteDocSimple(ids); json = AjaxJson.returnInfo("成功删除"+num+"条记录"); }catch(Exception e) { json = AjaxJson.returnExceptionInfo("删除简化方法整理信息失败"+e); } return json; } @RequestMapping(value="/updateDocSimple" , method= RequestMethod.POST) @ApiOperation(value = "修改简化方法整理信息") public AjaxJson updateDocSimple(@RequestBody DocSimpleArrange docSimpleArrange) { AjaxJson json = null; try { docSimpleService.updateDocSimple(docSimpleArrange); json = new AjaxJson(); }catch(Exception e) { json = AjaxJson.returnExceptionInfo("修改简化方法整理信息失败"+e); } return json; } @RequestMapping(value="/downLoadPdf" , method= RequestMethod.POST) @ApiOperation(value = "导出文书简化pdf文件") public void downLoadPdf(HttpServletRequest request, HttpServletResponse response) throws Exception { request.setCharacterEncoding("UTF-8"); String fileName = "创建文书简化pdf文件.pdf"; String downLoadPath = "D:\\\\ureportfiles\\\\"+fileName; response.setContentType("application/pdf"); FileInputStream in = new FileInputStream(new File(downLoadPath)); OutputStream out = response.getOutputStream(); byte[] b = new byte[1024]; while ((in.read(b))!=-1) { out.write(b); } out.flush(); in.close(); out.close(); } @RequestMapping(value="/createArrangePdf" , method= RequestMethod.POST) @ApiOperation(value = "创建文书简化pdf文件") public AjaxJson createArrangePdf( // String fondsNo, String ids, String fileName, HttpServletRequest request) throws IOException { AjaxJson json = null; Map map = new HashMap(); map.put("ids",ids); // map.put("fondsNoCode",fondsNoCode); //System.out.println(request.getContextPath()); //System.out.println(request.getServletPath()); //System.out.println(request.getRequestURI()); //System.out.println(System.getProperty("user.dir")); //System.out.println(request.getRealPath("/")); //String relativelyPath = request.getRealPath("/")+"static"+File.separator+"images"; //String ss = request.getServletContext().getRealPath("/"+"fondscode"); String dir = request.getRealPath("/")+"pdffile"; File fileDir = new File(dir); if(!fileDir.exists()) { fileDir.mkdirs(); } OutputStream outputStream = null; try { // String fileName = "文书简化整理报表.pdf"; outputStream = new FileOutputStream(new File(dir+File.separator+fileName+".pdf")); ExportConfigure config = new ExportConfigureImpl("file:" + "wenshu_jianhua.ureport.xml", map, outputStream); ExportManager exportManager = (ExportManager) Utils.getApplicationContext().getBean(ExportManager.BEAN_ID); exportManager.exportPdf(config); json = new AjaxJson(); }catch (Exception e) { json = AjaxJson.returnExceptionInfo("创建文书文书简化pdf文件信息失败"+e); e.printStackTrace(); } return json; } /** * * @param response * @param ids * @throws Exception */ @RequestMapping(value="/downloadDocFileExcel" , method= RequestMethod.GET) @ApiOperation(value = "下载文书简化整理Excel") @ApiImplicitParams({ @ApiImplicitParam(paramType = "query", name = "ids", value = "简化id拼接", dataType = "String"), }) public void downloadExcel(HttpServletResponse response,String ids)throws Exception{ response.setHeader("Pragma", "No-cache"); response.setHeader("Cache-Control", "no-cache"); response.setDateHeader("Expires", 0); response.reset(); response.setContentType("application/x-msdownload; charset=utf-8"); SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); String fileName = new String("文书案卷目录".getBytes("utf-8"),"ISO-8859-1")+sdf.format(new Date())+".xls"; response.setHeader("Content-disposition", "attachment; filename=" + fileName); String[] columnsTitle = {"盒号","mlh","(文件级)档号","备注","归档日期","实体分类号","实体分类号代码","保管期限", "保管期限代码","归档年度","全宗名称","全宗代码","关键字","文号(文件编号)","档案馆","档案馆代码", "文件形成时间","份数","密级","密级代码","页数","件号","控制标识","控制标识代码", "存放位置","档案门类","档案门类代码","题名","责任者","录入人","录入日期","是否打eep包", "是否打eep包代码","加密代码","加密检测日期","batch_id","batch_name","back_to_update_state","is_process","testtest_code", "原文数量","部门名称","部门代码","类别","类别代码","lm","lm_code","主题词","目录号","案件级档号","案卷号","文件开始时间","文件结束时间","组卷标识"}; String fieldName = "case_no," + " mlh," + " archive_no," + " note ," + " pigeonhole_date," + " archive_ctg_no," + " archive_ctg_no_code," + " retention," + " retention_code," + " filing_year," + " fonds_no," + " fonds_no_code," + " sbt_word," + " doc_no," + " dagdm," + " dagdm_code," + " created_date," + " object_quantity," + " security_class," + " security_class_code," + " quantity," + " piece_no," + " kzbs," + " kzbs_code," + " folder_location," + " damldm," + " damldm_code," + " maintitle," + " responsibleby," + " create_person," + " create_date," + " is_packeep," + " is_packeep_code," + " md5_code," + " md5_check_date," + " batch_id," + " batch_name," + " back_to_update_state," + " is_process," + " testtest_code," + " archive_file_num," + " departname," + " departname_code," + " lb," + " lb_code," + " lm," + " lm_code," + " key_words," + " catalog_number," + " folder_no," + " file_number," + " file_start_time," + " file_end_time," + " archive_flag"; String cols[] = fieldName.split(","); HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet = wb.createSheet("文书简化整理"); HSSFRow row = sheet.createRow(0); for(int i=0;i> listTwo = list; //把clob类型的字段转换成String for(Map data:listTwo){ for(String key:data.keySet()){ if(data.get(key) instanceof Clob){ Clob clob = (Clob) data.get(key); try { data.put(key, clob.getSubString((long)1,(int)clob.length())); } catch (SQLException e) { e.printStackTrace(); } } } } json.put("list", listTwo); json.put("total", total); }catch(Exception e) { json = AjaxJson.returnExceptionInfo("动态查询文书简化失败"+e); } return json; } @RequestMapping(value="/selectDueArchive" , method= RequestMethod.POST) @ApiOperation(value = "档案到期查询接口") public AjaxJson selectDueArchive(@RequestBody PackSqlObject packSqlObject) { AjaxJson json = null; try { List msgs = docSimpleService.selectObject2(packSqlObject); List list = PageUtil.startPage(msgs, packSqlObject.getPage(), packSqlObject.getLimit()); PageInfo pageInfo = new PageInfo(msgs); list= StringUtil.formatMapKeytoLower(list); long total = pageInfo.getTotal(); json = new AjaxJson(); List> listTwo = list; //把clob类型的字段转换成String for(Map data:listTwo){ for(String key:data.keySet()){ if(data.get(key) instanceof Clob){ Clob clob = (Clob) data.get(key); try { data.put(key, clob.getSubString((long)1,(int)clob.length())); } catch (SQLException e) { e.printStackTrace(); } } } } Dict dict = new Dict(); dict.setType("expiration_reminder_color"); List list1 = dictService.findList(dict); json.put("list", listTwo); json.put("total", total); json.put("color",list1.get(0).getValue()); }catch(Exception e) { json = AjaxJson.returnExceptionInfo("动态查询文书简化失败"+e); } return json; } @RequestMapping(value="/electronicView" , method= RequestMethod.POST) @ApiOperation(value = "电子借阅查看") public AjaxJson electronicView(@RequestBody PackSqlObject packSqlObject) { AjaxJson json = null; try { List list = docSimpleService.electronicView(packSqlObject); PageInfo pageInfo = new PageInfo(list); list= StringUtil.formatMapKeytoLower(list); long total = pageInfo.getTotal(); json = new AjaxJson(); List> listTwo = list; //把clob类型的字段转换成String for(Map data:listTwo){ for(String key:data.keySet()){ if(data.get(key) instanceof Clob){ Clob clob = (Clob) data.get(key); try { data.put(key, clob.getSubString((long)1,(int)clob.length())); } catch (SQLException e) { e.printStackTrace(); } } } } json.put("list", listTwo); json.put("total", total); }catch(Exception e) { json = AjaxJson.returnExceptionInfo("动态查询文书简化失败"+e); } return json; } //动态删除 String funcType,Integer funcTypeCode,String tableName,输出列表,查询条件 @RequestMapping(value="/deleteObject" , method= RequestMethod.POST) @ApiOperation(value = "动态删除文书简化") public AjaxJson deleteObject(@RequestBody PackSqlObject packSqlObject) { AjaxJson json = null; try { docSimpleService.deleteObject(packSqlObject); json = new AjaxJson(); }catch(Exception e) { json = AjaxJson.returnExceptionInfo("动态查询文书简化失败"+e); } return json; } @RequestMapping(value="/deleteObjectAnjuan" , method= RequestMethod.POST) @ApiOperation(value = "动态删除案卷") @ApiImplicitParams({ @ApiImplicitParam(paramType = "query", name = "tableName1", value = "第一层的表名称", required = true, dataType = "String"), @ApiImplicitParam(paramType = "query", name = "tableName2", value = "第二层的表名称", required = false, dataType = "String"), @ApiImplicitParam(paramType = "query", name = "ids", value = "逗号拼接的id字符串", required = true, dataType = "String"), }) public AjaxJson deleteObjectAnjuan(String tableName1,String tableName2,String ids) { AjaxJson json = null; try { docSimpleService.deleteObjectAnjuan( tableName1, tableName2, ids); json = new AjaxJson(); }catch(Exception e) { json = AjaxJson.returnExceptionInfo("动态删除案卷失败"+e); } return json; } //动态保存 String funcType,Integer funcTypeCode,String tableName,输出列表,查询条件 @RequestMapping(value="/saveObject" , method= RequestMethod.POST) @ApiOperation(value = "动态保存文书简化") public AjaxJson saveObject(@RequestBody PackSqlObject packSqlObject) { AjaxJson json = null; try { json = docSimpleService.saveObject(packSqlObject); }catch(Exception e) { json = AjaxJson.returnExceptionInfo("动态保存文书简化失败"+e); } return json; } //动态修改 String funcType,Integer funcTypeCode,String tableName,输出列表,查询条件 @RequestMapping(value="/updateObject" , method= RequestMethod.POST) @ApiOperation(value = "动态修改文书简化") public AjaxJson updateObject(@RequestBody PackSqlObject packSqlObject) { AjaxJson json = null; try { json = docSimpleService.updateObject(packSqlObject); }catch(Exception e) { json = AjaxJson.returnExceptionInfo("动态修改文书简化失败"+e); } return json; } //动态修改 String funcType,Integer funcTypeCode,String tableName,输出列表,查询条件 @RequestMapping(value="/updateObject2" , method= RequestMethod.POST) @ApiOperation(value = "动态修改文书简化") public AjaxJson updateObject2(@RequestBody PackSqlObject packSqlObject) { AjaxJson json = null; try { json = docSimpleService.updateObject2(packSqlObject); }catch(Exception e) { json = AjaxJson.returnExceptionInfo("动态修改文书简化失败"+e); } return json; } //动态替换文书简化 @RequestMapping(value="/replaceObject" , method= RequestMethod.POST) @ApiOperation(value = "动态替换文书简化") public AjaxJson replaceObject(@RequestBody PackSqlObject packSqlObject){ AjaxJson json = null; try { docSimpleService.replaceObject(packSqlObject); json = new AjaxJson(); }catch(Exception e) { json = AjaxJson.returnExceptionInfo("动态替换文书简化失败"+e); } return json; } @RequestMapping(value="/updateAllObject" , method= RequestMethod.POST) @ApiOperation(value = "动态批量修改文书简化") public AjaxJson updateAllObject(@RequestBody PackSqlObject packSqlObject){ AjaxJson json = null; try { json=docSimpleService.updateAllObject(packSqlObject); }catch(Exception e) { json = AjaxJson.returnExceptionInfo("动态替换文书简化失败"+e); } return json; } //动态修改 String funcType,Integer funcTypeCode,String tableName,输出列表,查询条件 @RequestMapping(value="/updateTempArchiveFileNumObject" , method= RequestMethod.POST) @ApiOperation(value = "动态修改文书简化的档案原文数量archive_file_num字段") public AjaxJson updateTempArchiveFileNumObject(@RequestBody PackSqlObject packSqlObject) { AjaxJson json = null; try { docSimpleService.updateTempArchiveFileNumObject(packSqlObject); json = new AjaxJson(); }catch(Exception e) { json = AjaxJson.returnExceptionInfo("动态修改文书简化失败"+e); } return json; } //动态修改 String funcType,Integer funcTypeCode,String tableName,输出列表,查询条件 @RequestMapping(value="/updateTempFileObject" , method= RequestMethod.POST) @ApiOperation(value = "动态修改文书简化原文的file_status字段") public AjaxJson updateTempFileObject(@RequestBody PackSqlObject packSqlObject) { AjaxJson json = null; try { docSimpleService.updateTempFileObject(packSqlObject); json = new AjaxJson(); }catch(Exception e) { json = AjaxJson.returnExceptionInfo("动态修改文书简化失败"+e); } return json; } //动态查询 String funcType,Integer funcTypeCode,String tableName,输出列表,查询条件 @RequestMapping(value="/selectOriginalObject" , method= RequestMethod.POST) @ApiOperation(value = "动态查询文书简化原文") public AjaxJson selectOriginalObject(@RequestBody PackSqlObject packSqlObject) { AjaxJson json = null; try { List list = docSimpleService.selectOriginalObject(packSqlObject); json = new AjaxJson(); json.put("list", list); }catch(Exception e) { json = AjaxJson.returnExceptionInfo("动态查询文书简化失败"+e); } return json; } //原文入回收站 @RequestMapping(value="/updateOriginalObject" , method= RequestMethod.POST) @ApiOperation(value = "动态原文入回收站") public AjaxJson updateOriginalObject(@RequestBody PackSqlObject packSqlObject) { AjaxJson json = null; try { HashMap conditionMap = packSqlObject.getConditionMap(); String ids = (String)conditionMap.get("ids"); int recId = (int)conditionMap.get("recId"); HashMap fieldValueMap = packSqlObject.getFieldValueMap(); HashMap commonMap = packSqlObject.getCommonMap(); PackSqlObject packSqlObject1 = new PackSqlObject(); HashMap conditionMap1 = new HashMap(); conditionMap1.put("id in",ids); packSqlObject1.setCommonMap(commonMap); packSqlObject1.setConditionMap(conditionMap1); packSqlObject1.setFieldValueMap(fieldValueMap); docSimpleService.updateOriginalObject(packSqlObject1); PackSqlObject packSqlObject2 = new PackSqlObject(); HashMap conditionMap2 = new HashMap(); conditionMap2.put("recId",recId); packSqlObject2.setFieldName("cout(1) as number"); packSqlObject2.setCommonMap(commonMap); packSqlObject2.setConditionMap(conditionMap2); List list = docSimpleService.selectOriginalObject(packSqlObject2); int number = 0; for (Object obj : list) { HashMap hashMap = (HashMap) obj; number = (int)hashMap.get("number"); } // int archiveFileNum = number; //更新原文数量 PackSqlObject packSqlObject3 = new PackSqlObject(); HashMap conditionMap3 = new HashMap(); conditionMap3.put("id",recId); HashMap fieldValueMap3 = new HashMap(); fieldValueMap3.put("archive_file_num",number); packSqlObject3.setCommonMap(commonMap); packSqlObject3.setConditionMap(conditionMap3); packSqlObject3.setFieldValueMap(fieldValueMap3); docSimpleService.updateOriginalObject(packSqlObject3); json = AjaxJson.returnInfo("成功入回收站"+number+"条记录"); }catch(Exception e) { json = AjaxJson.returnExceptionInfo("动态修改文书简化失败"+e); } return json; } @RequestMapping(value="/updateOriginalObjectRecycle" , method= RequestMethod.POST) @ApiOperation(value = "动态原文回收站恢复") public AjaxJson updateOriginalObjectRecycle(@RequestBody PackSqlObject packSqlObject) { AjaxJson json = null; try { HashMap commonMap = packSqlObject.getCommonMap(); docSimpleService.updateOriginalObject(packSqlObject); List list = docSimpleService.selectOriginalObject(packSqlObject); if(null != list){ // Integer recId = docOriginalEntity.getRecid(); int recId = 0; for (Object obj : list) { HashMap hashMap = (HashMap) obj; recId = (int)hashMap.get("recid"); } PackSqlObject packSqlObject2 = new PackSqlObject(); HashMap conditionMap2 = new HashMap(); conditionMap2.put("recId",recId); packSqlObject2.setFieldName("cout(1) as number"); packSqlObject2.setCommonMap(commonMap); packSqlObject2.setConditionMap(conditionMap2); List list1 = docSimpleService.selectOriginalObject(packSqlObject2); int number = 0; for (Object obj : list1) { HashMap map = (HashMap) obj; number = (int)map.get("number"); } //更新原文数量 PackSqlObject packSqlObject3 = new PackSqlObject(); HashMap conditionMap3 = new HashMap(); conditionMap3.put("id",recId); HashMap fieldValueMap3 = new HashMap(); fieldValueMap3.put("archive_file_num",number); packSqlObject3.setCommonMap(commonMap); packSqlObject3.setConditionMap(conditionMap3); packSqlObject3.setFieldValueMap(fieldValueMap3); // DocSimpleArrange docSimpleArrange = new DocSimpleArrange(); // docSimpleArrange.setArchiveFileNum(archiveFileNum); // docSimpleArrange.setId(recId); docSimpleService.updateObject(packSqlObject3); } json = new AjaxJson(); }catch(Exception e) { json = AjaxJson.returnExceptionInfo("原文回收站恢复失败"+e); } return json; } //删除原文回收站 @RequestMapping(value="/deleteDocOriginalObjectRecycle" , method= RequestMethod.POST) @ApiOperation(value = "动态删除原文回收站") public AjaxJson deleteDocOriginalObjectRecycle(@RequestBody PackSqlObject packSqlObject) { AjaxJson json = null; try { docSimpleService.deleteOriginalObject(packSqlObject); json = AjaxJson.returnInfo("成功删除"); }catch(Exception e) { json = AjaxJson.returnExceptionInfo("删除原文回收站信息失败"+e); } return json; } @RequestMapping(value="/downloadDocObjectExcel" , method= RequestMethod.GET) @ApiOperation(value = "动态下载文书简化整理Excel") public void downloadDocObjectExcel(HttpServletResponse response,@RequestBody PackSqlObject packSqlObject)throws Exception{ response.setHeader("Pragma", "No-cache"); response.setHeader("Cache-Control", "no-cache"); response.setDateHeader("Expires", 0); response.reset(); response.setContentType("application/x-msdownload; charset=utf-8"); SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); String fileName = new String("文书案卷目录".getBytes("utf-8"),"ISO-8859-1")+sdf.format(new Date())+".xls"; response.setHeader("Content-disposition", "attachment; filename=" + fileName); //获取表名 HashMap commonMap = packSqlObject.getCommonMap(); String tableRoot = (String)commonMap.get("tableName"); //根据表名查询表字段和中文名 StringBuffer fieldName = new StringBuffer(); List columnsTitle = new ArrayList<>(); List ttableStructDescriptions = ttableStructDescriptionService.selectByTableName(tableRoot); for (TtableStructDescription ttableStructDescription : ttableStructDescriptions) { fileName += ttableStructDescription.getColumnName()+","; columnsTitle.add(ttableStructDescription.getColumnChnName()); } String file = fieldName.toString(); String cols[] = file.split(","); HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet = wb.createSheet("文书简化整理"); HSSFRow row = sheet.createRow(0); for(int i=0;i map = (HashMap) obj; HSSFRow rowi = sheet.createRow(i + 1); int index = 0; for (Map.Entry entry : map.entrySet()) { String mapKey = entry.getKey(); String mapValue = entry.getValue(); rowi.createCell(index).setCellValue(((DocSimpleArrange)list.get(i)).getCaseNo()); index++; System.out.println(mapKey + ":" + mapValue); } } ByteArrayOutputStream bos = new ByteArrayOutputStream(); wb.write(bos); response.setHeader("Content-Length", bos.toByteArray().length+""); bos.writeTo(response.getOutputStream()); response.flushBuffer(); } @RequestMapping(value="/saveObjectBatchDocSimple" , method= RequestMethod.POST) @ApiOperation(value = "动态批量上传文书简化excel数据") public AjaxJson saveObjectBatchDocSimple(MultipartFile file , @RequestBody PackSqlObject packSqlObject)throws Exception { AjaxJson json = null; try { docSimpleService.saveObjectBatchDocSimple(file,packSqlObject); json = new AjaxJson(); }catch(Exception e) { json = AjaxJson.returnExceptionInfo("批量上传文书简化整理失败"+e); } return json; } @RequestMapping(value="/createObjectArrangePdf" , method= RequestMethod.POST) @ApiOperation(value = "动态创建文书简化pdf文件") public AjaxJson createObjectArrangePdf( @RequestBody PackSqlObject packSqlObject, // String ids, // String fileName, HttpServletRequest request) throws IOException { AjaxJson json = null; Map map = new HashMap(); map.put("packSqlObject",packSqlObject); String dir = request.getRealPath("/")+"pdffile"; File fileDir = new File(dir); if(!fileDir.exists()) { fileDir.mkdirs(); } OutputStream outputStream = null; try { String fileName = "文书简化整理报表.pdf"; outputStream = new FileOutputStream(new File(dir+File.separator+fileName+".pdf")); ExportConfigure config = new ExportConfigureImpl("file:" + "wenshu_jianhua.ureport.xml", map, outputStream); ExportManager exportManager = (ExportManager) Utils.getApplicationContext().getBean(ExportManager.BEAN_ID); exportManager.exportPdf(config); json = new AjaxJson(); }catch (Exception e) { json = AjaxJson.returnExceptionInfo("创建文书文书简化pdf文件信息失败"+e); e.printStackTrace(); } return json; } @RequestMapping(value="/selectFileNameAndContentByFileContent" , method= RequestMethod.POST) @ApiOperation(value = "根据原文内容查询得到原文名称和原文内容列表") public AjaxJson selectFileNameAndContentByFileContent(String tableName,String fileContent,int recId) { AjaxJson json = null; try { List list = docSimpleService.selectFileNameAndContentByFileContent(tableName, fileContent,recId); PageInfo pageInfo = new PageInfo(list); long total = pageInfo.getTotal(); json = new AjaxJson(); json.put("list", list); json.put("total",total); }catch(Exception e) { json = AjaxJson.returnExceptionInfo("查询原文回收站信息失败"+e); } return json; } @RequestMapping(value="/secondaryQuery" , method= RequestMethod.POST) @ApiOperation(value = "二次查询") public AjaxJson secondaryQuery(@RequestBody PackSqlObject packSqlObject) { AjaxJson json = null; try { json = docSimpleService.secondaryQuery(packSqlObject); }catch(Exception e) { json = AjaxJson.returnExceptionInfo("二次查询失败"+e); } return json; } //向上移 @RequestMapping(value="/moveUp" , method= RequestMethod.POST) @ApiOperation(value = "向上移") public AjaxJson moveUp( Integer fileId, String funcTypeCode,String tableName ){ return docSimpleService.moveUp(fileId,funcTypeCode,tableName); } //向下移 @RequestMapping(value="/moveDown" , method= RequestMethod.POST) @ApiOperation(value = "向下移") public AjaxJson moveDown( Integer fileId, String funcTypeCode,String tableName ){ return docSimpleService.moveDown(fileId,funcTypeCode,tableName); } //重命名 @RequestMapping(value="/rename" , method= RequestMethod.POST) @ApiOperation(value = "重命名") public AjaxJson rename( Integer fileId, String funcTypeCode,String tableName,String name ){ return docSimpleService.rename(fileId,funcTypeCode,tableName,name); } }