| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.annotation.excel.ExcelToPdfTool; |
| | | import com.doumee.core.annotation.trace.Trace; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.springframework.web.multipart.MultipartHttpServletRequest; |
| | |
| | | |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | |
| | | @ApiOperation("测试") |
| | | @PostMapping("/testPdf") |
| | | public String testPdf(@RequestParam Map<String,String> req, HttpServletResponse response) { |
| | | ExcelToPdfTool.excelToPdf(req.get("f1"),req.get("f2")); |
| | | return JSONObject.toJSONString(req); |
| | | } |
| | | |
| | | @ApiOperation(value = "上传", notes = "上传", httpMethod = "POST", position = 6) |
| | | @ApiImplicitParams({ |
| | |
| | | import com.alibaba.fastjson.TypeReference; |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.annotation.excel.ExcelToPdfTool; |
| | | import com.doumee.core.annotation.trace.Trace; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | |
| | | map.put("/common/captcha", "anon"); |
| | | map.put("/business/smsEmail/sendSms", "anon"); |
| | | map.put("/public/signNotify", "anon"); |
| | | map.put("/public/testPdf", "anon"); |
| | | map.put("/business/areas/*", "anon"); |
| | | // - 放行swagger |
| | | map.put("/doc.html", "anon"); |
| | |
| | | public class ExcelToPdfTool { |
| | | |
| | | public static void main(String[] args) { |
| | | String inputExcelPath = "D:\\1.xlsx"; |
| | | String outputPdfPath = "D:\\555.pdf"; |
| | | String inputExcelPath = "/temp/1.xlsx"; |
| | | String outputPdfPath = "/temp/1..pdf"; |
| | | /* Workbook workbook = new Workbook(); |
| | | workbook.loadFromFile(inputExcelPath); |
| | | |