| | |
| | | @ApiVersion(1) |
| | | public String openOffice(Model model, HttpServletRequest request) { |
| | | |
| | | try { |
| | | //获取参数 |
| | | FieldSetEntity fse = null; |
| | | Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA); |
| | |
| | | model.addAttribute("transportProtocols", "http"); |
| | | model.addAttribute("port", Global.getSystemConfig("server.port", "")); |
| | | return "webOffice"; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return "404"; |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public byte[] getFileContent(FieldSetEntity attachmentFse) throws BaseException { |
| | | if (attachmentFse == null || !CmnConst.PRODUCT_SYS_ATTACHMENTS.equals(attachmentFse.getTableName())) { |
| | | return new byte[16]; |
| | | //返回一个空的字节数组 |
| | | return new byte[0]; |
| | | } |
| | | try (ByteArrayOutputStream os = new ByteArrayOutputStream();) { |
| | | FTPService ftpService = new FTPService(); |
| | |
| | | //正在被编辑 |
| | | String existsKey = keys.toArray(new String[]{})[0]; |
| | | //这里会抛出正在编辑的异常 |
| | | throwBeingEditDocument(existsKey.substring(existsKey.lastIndexOf("-"))); |
| | | throwBeingEditDocument(existsKey.substring(existsKey.lastIndexOf("-")+1)); |
| | | } else if (remove) { |
| | | RedisUtil.setOutTime(key, getExpirationTime()); |
| | | return; |
| | |
| | | File outFile = null; |
| | | OfficeManager officeManager = null; |
| | | try { |
| | | if(Global.getPropertyToBoolean("open.office.isEnable", "true")) {//启用oepn office转换 |
| | | if(Global.getPropertyToBoolean("open.office.isEnable", "false")) {//启用oepn office转换 |
| | | officeManager = officeManagerQueue.take(); |
| | | inputFile = new File(input); |
| | | outFile = new File(output); |