1094 lines
48 KiB
Java
1094 lines
48 KiB
Java
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<String, Object> map = new HashMap<String, Object>();
|
||
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<cols.length;i++) {
|
||
HSSFCell cell = row.createCell(i);
|
||
sheet.setColumnWidth(i, 3766);
|
||
cell.setCellValue(columnsTitle[i]);
|
||
}
|
||
List list = docSimpleService.getDocSimples(ids);
|
||
for (int i = 0; i < list.size(); i++) {
|
||
HSSFRow rowi = sheet.createRow(i + 1);
|
||
rowi.createCell(0).setCellValue(((DocSimpleArrange)list.get(i)).getCaseNo());
|
||
rowi.createCell(1).setCellValue(((DocSimpleArrange)list.get(i)).getMlh());
|
||
rowi.createCell(2).setCellValue(((DocSimpleArrange)list.get(i)).getArchiveNo());
|
||
rowi.createCell(3).setCellValue(((DocSimpleArrange)list.get(i)).getNote());
|
||
|
||
rowi.createCell(4).setCellValue(((DocSimpleArrange)list.get(i)).getPigeonholeDate());
|
||
rowi.createCell(5).setCellValue(((DocSimpleArrange)list.get(i)).getArchiveCtgNo());
|
||
rowi.createCell(6).setCellValue(((DocSimpleArrange)list.get(i)).getArchiveCtgNoCode());
|
||
|
||
rowi.createCell(7).setCellValue(((DocSimpleArrange)list.get(i)).getRetention());
|
||
rowi.createCell(8).setCellValue(((DocSimpleArrange)list.get(i)).getRetentionCode());
|
||
rowi.createCell(9).setCellValue(((DocSimpleArrange)list.get(i)).getFilingYear());
|
||
|
||
rowi.createCell(10).setCellValue(((DocSimpleArrange)list.get(i)).getFondsNo());
|
||
rowi.createCell(11).setCellValue(((DocSimpleArrange)list.get(i)).getFondsNoCode());
|
||
|
||
rowi.createCell(12).setCellValue(((DocSimpleArrange)list.get(i)).getSbtWord());
|
||
rowi.createCell(13).setCellValue(((DocSimpleArrange)list.get(i)).getDocNo());
|
||
rowi.createCell(14).setCellValue(((DocSimpleArrange)list.get(i)).getDagdm());
|
||
rowi.createCell(15).setCellValue(((DocSimpleArrange)list.get(i)).getDagdmCode());
|
||
rowi.createCell(16).setCellValue(((DocSimpleArrange)list.get(i)).getMaintitle());
|
||
rowi.createCell(17).setCellValue(((DocSimpleArrange)list.get(i)).getResponsibleby());
|
||
rowi.createCell(18).setCellValue(((DocSimpleArrange)list.get(i)).getCreatePerson());
|
||
rowi.createCell(19).setCellValue(((DocSimpleArrange)list.get(i)).getCreateDate());
|
||
rowi.createCell(20).setCellValue(((DocSimpleArrange)list.get(i)).getIsPackeep());
|
||
rowi.createCell(21).setCellValue(((DocSimpleArrange)list.get(i)).getIsPackeepCode());
|
||
rowi.createCell(22).setCellValue(((DocSimpleArrange)list.get(i)).getMd5Code());
|
||
rowi.createCell(23).setCellValue(((DocSimpleArrange)list.get(i)).getMd5CheckDate());
|
||
rowi.createCell(24).setCellValue(((DocSimpleArrange)list.get(i)).getBatchId());
|
||
rowi.createCell(25).setCellValue(((DocSimpleArrange)list.get(i)).getBatchName());
|
||
rowi.createCell(26).setCellValue(((DocSimpleArrange)list.get(i)).getBackToUpdateState());
|
||
rowi.createCell(27).setCellValue(((DocSimpleArrange)list.get(i)).getIsProcess());
|
||
rowi.createCell(28).setCellValue(((DocSimpleArrange)list.get(i)).getTesttestCode());
|
||
rowi.createCell(29).setCellValue(((DocSimpleArrange)list.get(i)).getArchiveFileNum());
|
||
rowi.createCell(30).setCellValue(((DocSimpleArrange)list.get(i)).getDepartname());
|
||
rowi.createCell(31).setCellValue(((DocSimpleArrange)list.get(i)).getDepartnameCode());
|
||
rowi.createCell(32).setCellValue(((DocSimpleArrange)list.get(i)).getLb());
|
||
rowi.createCell(33).setCellValue(((DocSimpleArrange)list.get(i)).getLbCode());
|
||
rowi.createCell(34).setCellValue(((DocSimpleArrange)list.get(i)).getLm());
|
||
rowi.createCell(35).setCellValue(((DocSimpleArrange)list.get(i)).getLmCode());
|
||
rowi.createCell(36).setCellValue(((DocSimpleArrange)list.get(i)).getKeyWords());
|
||
rowi.createCell(37).setCellValue(((DocSimpleArrange)list.get(i)).getCatalogNumber());
|
||
rowi.createCell(38).setCellValue(((DocSimpleArrange)list.get(i)).getFolderNo());
|
||
rowi.createCell(39).setCellValue(((DocSimpleArrange)list.get(i)).getFileNumber());
|
||
rowi.createCell(40).setCellValue(((DocSimpleArrange)list.get(i)).getFileStartTime());
|
||
rowi.createCell(41).setCellValue(((DocSimpleArrange)list.get(i)).getFileEndTime());
|
||
rowi.createCell(42).setCellValue(((DocSimpleArrange)list.get(i)).getArchiveFlag());
|
||
}
|
||
|
||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||
wb.write(bos);
|
||
response.setHeader("Content-Length", bos.toByteArray().length+"");
|
||
bos.writeTo(response.getOutputStream());
|
||
response.flushBuffer();
|
||
}
|
||
|
||
@RequestMapping(value="/queryDocOriginalEntity" , method= RequestMethod.POST)
|
||
@ApiOperation(value = "查询原文信息")
|
||
public AjaxJson queryDocOriginalEntity(@RequestParam(value = "recId",required = true)Integer recId) {
|
||
AjaxJson json = null;
|
||
try {
|
||
List list = docSimpleService.queryDocOriginalEntity(recId);
|
||
json = new AjaxJson();
|
||
json.put("list", list);
|
||
}catch(Exception e) {
|
||
json = AjaxJson.returnExceptionInfo("查询原文信息失败"+e);
|
||
}
|
||
return json;
|
||
}
|
||
|
||
@RequestMapping(value="/updateDocOriginalEntity" , method= RequestMethod.POST)
|
||
@ApiOperation(value = "原文入回收站")
|
||
@ApiImplicitParams({
|
||
@ApiImplicitParam(paramType = "query", name = "ids", value = "逗号拼接的id字符串", required = true, dataType = "String"),
|
||
})
|
||
public AjaxJson updateDocOriginalEntity(String ids,Integer recId) {
|
||
AjaxJson json = null;
|
||
try {
|
||
DocSimpleArrange docSimpleArrange = new DocSimpleArrange();
|
||
int num =docSimpleService.updateDocOriginalEntity(ids);
|
||
int fileNumber = docSimpleService.getDocOriginalEntityCount(recId);
|
||
int archiveFileNum = fileNumber;
|
||
//更新原文数量
|
||
docSimpleArrange.setArchiveFileNum(archiveFileNum);
|
||
docSimpleArrange.setId(recId);
|
||
docSimpleService.updateDocSimple(docSimpleArrange);
|
||
|
||
json = AjaxJson.returnInfo("成功入回收站"+num+"条记录");
|
||
}catch(Exception e) {
|
||
json = AjaxJson.returnExceptionInfo("原文入回收站失败"+e);
|
||
}
|
||
return json;
|
||
}
|
||
|
||
@RequestMapping(value="/queryDocOriginalEntityRecycle" , method= RequestMethod.POST)
|
||
@ApiOperation(value = "查询原文回收站信息")
|
||
public AjaxJson queryDocOriginalEntityRecycle(@RequestParam(value = "recId",required = true)Integer recId) {
|
||
AjaxJson json = null;
|
||
try {
|
||
List list = docSimpleService.queryDocOriginalEntityRecycle(recId);
|
||
json = new AjaxJson();
|
||
json.put("list", list);
|
||
}catch(Exception e) {
|
||
json = AjaxJson.returnExceptionInfo("查询原文回收站信息失败"+e);
|
||
}
|
||
return json;
|
||
}
|
||
|
||
@RequestMapping(value="/updateDocOriginalEntityRecycle" , method= RequestMethod.POST)
|
||
@ApiOperation(value = "原文回收站恢复")
|
||
@ApiImplicitParams({
|
||
@ApiImplicitParam(paramType = "query", name = "id", value = "原文主键id", required = true, dataType = "String"),
|
||
})
|
||
public AjaxJson updateDocOriginalEntityRecycle(Integer id) {
|
||
AjaxJson json = null;
|
||
try {
|
||
docSimpleService.updateDocOriginalEntityRecycle(id);
|
||
DocOriginalEntity docOriginalEntity = docSimpleService.queryDocOriginalEntityById(id);
|
||
if(null != docOriginalEntity){
|
||
Integer recId = docOriginalEntity.getRecid();
|
||
int fileNumber = docSimpleService.getDocOriginalEntityCount(recId);
|
||
int archiveFileNum = fileNumber;
|
||
//更新原文数量
|
||
DocSimpleArrange docSimpleArrange = new DocSimpleArrange();
|
||
docSimpleArrange.setArchiveFileNum(archiveFileNum);
|
||
docSimpleArrange.setId(recId);
|
||
docSimpleService.updateDocSimple(docSimpleArrange);
|
||
}
|
||
|
||
json = new AjaxJson();
|
||
}catch(Exception e) {
|
||
json = AjaxJson.returnExceptionInfo("原文回收站恢复失败"+e);
|
||
}
|
||
return json;
|
||
}
|
||
|
||
@RequestMapping(value="/deleteDocOriginalEntityRecycle" , method= RequestMethod.POST)
|
||
@ApiOperation(value = "删除原文回收站,批量删除用逗号隔开id值")
|
||
@ApiImplicitParams({
|
||
@ApiImplicitParam(paramType = "query", name = "ids", value = "逗号拼接的id字符串", required = true, dataType = "String"),
|
||
})
|
||
public AjaxJson deleteDocOriginalEntityRecycle(String ids) {
|
||
AjaxJson json = null;
|
||
try {
|
||
int num = docSimpleService.deleteDocOriginalEntityRecycle(ids);
|
||
json = AjaxJson.returnInfo("成功删除"+num+"条记录");
|
||
}catch(Exception e) {
|
||
json = AjaxJson.returnExceptionInfo("删除原文回收站信息失败"+e);
|
||
}
|
||
return json;
|
||
}
|
||
|
||
@RequestMapping(value="/downloadExcel" , method= RequestMethod.GET)
|
||
@ApiOperation(value = "下载文书简化整理excel模板")
|
||
public void downloadExcel(HttpServletResponse response)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"),"GBK")+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," +
|
||
" archive_flag";
|
||
String cols[] = fieldName.split(",");
|
||
HSSFWorkbook wb = new HSSFWorkbook();
|
||
HSSFSheet sheet = wb.createSheet("文书简化整理");
|
||
HSSFRow row = sheet.createRow(0);
|
||
for(int i=0;i<cols.length;i++) {
|
||
HSSFCell cell = row.createCell(i);
|
||
sheet.setColumnWidth(i, 3766);
|
||
cell.setCellValue(columnsTitle[i]);
|
||
}
|
||
|
||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||
wb.write(bos);
|
||
response.setHeader("Content-Length", bos.toByteArray().length+"");
|
||
bos.writeTo(response.getOutputStream());
|
||
response.flushBuffer();
|
||
|
||
}
|
||
|
||
@RequestMapping(value="/saveBatchDocSimple" , method= RequestMethod.POST)
|
||
@ApiOperation(value = "批量上传文书简化excel数据")
|
||
public AjaxJson saveBatchDocSimple(@RequestParam("file") MultipartFile file)throws Exception {
|
||
AjaxJson json = null;
|
||
try {
|
||
docSimpleService.saveBatchDocSimple(file);
|
||
json = new AjaxJson();
|
||
}catch(Exception e) {
|
||
json = AjaxJson.returnExceptionInfo("批量上传文书简化整理失败"+e);
|
||
}
|
||
return json;
|
||
}
|
||
|
||
|
||
@RequestMapping(value="/aa" , method= RequestMethod.GET)
|
||
@ApiOperation(value = "测试连接是否通")
|
||
public AjaxJson aa()throws Exception {
|
||
AjaxJson json = new AjaxJson();
|
||
webSocket.sendMessage("webSocket,webSocket,webSocket,webSocket,webSocket,webSocket");
|
||
System.out.println(json);
|
||
return json;
|
||
}
|
||
|
||
@RequestMapping(value="/bb" , method= RequestMethod.GET)
|
||
@ApiOperation(value = "测试登录")
|
||
public AjaxJson bb(HttpServletRequest request)throws Exception {
|
||
//String token = request.getHeader("token");
|
||
UserRole userRole = userService.getUserRole(request);
|
||
AjaxJson json = new AjaxJson();
|
||
json.put("userRole", userRole);
|
||
return json;
|
||
}
|
||
|
||
//动态查询 String funcType,Integer funcTypeCode,String tableName,输出列表,查询条件
|
||
@RequestMapping(value="/selectObject" , method= RequestMethod.POST)
|
||
@ApiOperation(value = "动态查询文书简化")
|
||
public AjaxJson selectObject(@RequestBody PackSqlObject packSqlObject) {
|
||
AjaxJson json = null;
|
||
try {
|
||
List list = docSimpleService.selectObject(packSqlObject);
|
||
PageInfo pageInfo = new PageInfo(list);
|
||
list= StringUtil.formatMapKeytoLower(list);
|
||
long total = pageInfo.getTotal();
|
||
json = new AjaxJson();
|
||
List<Map<String,Object>> listTwo = list;
|
||
//把clob类型的字段转换成String
|
||
for(Map<String, Object> 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<Map<String,Object>> listTwo = list;
|
||
//把clob类型的字段转换成String
|
||
for(Map<String, Object> 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<Dict> 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<Map<String,Object>> listTwo = list;
|
||
//把clob类型的字段转换成String
|
||
for(Map<String, Object> 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<String> columnsTitle = new ArrayList<>();
|
||
List<TtableStructDescription> 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<cols.length;i++) {
|
||
HSSFCell cell = row.createCell(i);
|
||
sheet.setColumnWidth(i, 3766);
|
||
cell.setCellValue(columnsTitle.get(i));
|
||
}
|
||
// List list = docSimpleService.getDocSimples(ids);
|
||
List list = docSimpleService.selectObject(packSqlObject);
|
||
for (int i = 0; i < list.size(); i++) {
|
||
Object obj = list.get(i);
|
||
HashMap<String, String> map = (HashMap) obj;
|
||
HSSFRow rowi = sheet.createRow(i + 1);
|
||
int index = 0;
|
||
for (Map.Entry<String, String> 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<String, Object> map = new HashMap<String, Object>();
|
||
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);
|
||
}
|
||
|
||
|
||
|
||
}
|