|
|
|
@@ -3,6 +3,7 @@ package com.adc.da.workFlow.controller;
|
|
|
|
|
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
|
|
|
|
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
|
|
|
|
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
|
|
|
|
import cn.hutool.core.lang.UUID;
|
|
|
|
|
import com.adc.da.FeignClientImpl.workFlowFeignClientImpl;
|
|
|
|
|
import com.adc.da.Timer.ProcessTimer;
|
|
|
|
|
import com.adc.da.common.*;
|
|
|
|
@@ -15,7 +16,11 @@ import com.adc.da.sys.common.EmailUtils;
|
|
|
|
|
import com.adc.da.sys.entity.UserEO;
|
|
|
|
|
import com.adc.da.sys.service.IUserEOService;
|
|
|
|
|
import com.adc.da.util.LoginUserUtil;
|
|
|
|
|
import com.adc.da.workFlow.dao.ExportExcelMapper;
|
|
|
|
|
import com.adc.da.workFlow.entity.ExportExcel;
|
|
|
|
|
import com.adc.da.workFlow.entity.ExportExcelEO;
|
|
|
|
|
import com.adc.da.workFlow.entity.ProcessDetailExport;
|
|
|
|
|
import com.adc.da.workFlow.service.WorkFlowService;
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
@@ -29,6 +34,7 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.io.OutputStream;
|
|
|
|
|
import java.io.UnsupportedEncodingException;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.List;
|
|
|
|
@@ -42,6 +48,46 @@ public class WorkFlowController {
|
|
|
|
|
@Autowired
|
|
|
|
|
private workFlowFeignClientImpl workFlowFeignClient;
|
|
|
|
|
|
|
|
|
|
// @Autowired
|
|
|
|
|
// private ExportExcelMapper exportExcelMapper;
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "导出excel")
|
|
|
|
|
@PostMapping("/export_excel")
|
|
|
|
|
public void exportExcel(@RequestBody ExportExcelEO exportExcelEO, HttpServletResponse response, HttpServletRequest request) throws IOException {
|
|
|
|
|
|
|
|
|
|
// ExportExcel exportExcel = exportExcelMapper.selectById(id);
|
|
|
|
|
// if(exportExcel==null||exportExcel.getJson()==null)return;
|
|
|
|
|
// ExportExcelEO exportExcelEO=JSON.parseObject(exportExcel.getJson(),ExportExcelEO.class);
|
|
|
|
|
|
|
|
|
|
if(exportExcelEO.getFileName()==null||exportExcelEO.getFileName().trim().length()==0){
|
|
|
|
|
exportExcelEO.setFileName(UUID.fastUUID().toString(true));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Workbook excel = TableToExcel.createExcel(exportExcelEO.getColumnName(), exportExcelEO.getDataList(), null, exportExcelEO.getFileName());
|
|
|
|
|
|
|
|
|
|
response.reset();
|
|
|
|
|
|
|
|
|
|
response.setContentType("application/vnd.ms-excel");
|
|
|
|
|
|
|
|
|
|
response.setHeader("Content-disposition", "attachment; filename=" + exportExcelEO.getFileName() + ".xls");
|
|
|
|
|
OutputStream outputStream = response.getOutputStream();
|
|
|
|
|
|
|
|
|
|
excel.write(outputStream);
|
|
|
|
|
outputStream.flush();
|
|
|
|
|
outputStream.close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// @ApiOperation(value = "导出excel数据暂留")
|
|
|
|
|
// @PostMapping("/save_excel")
|
|
|
|
|
// public ResponseMessage saveExcel(@RequestBody ExportExcel exportExcel){
|
|
|
|
|
//
|
|
|
|
|
// exportExcelMapper.insert(exportExcel);
|
|
|
|
|
// return Result.success(exportExcel);
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "启动流程-以流程定义id")
|
|
|
|
|
@GetMapping("/activiti_define_start")
|
|
|
|
|
public ResponseMessage activiti_define_start(@RequestParam("id") String id, @RequestParam("userId") String userId, @RequestParam(value = "bpnId",required = false) String bpnId){
|
|
|
|
|