| | |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.entity.sys.ResEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.service.all.PermsService; |
| | | import com.lf.server.service.all.UploadAttachService; |
| | | import com.lf.server.service.data.DownloadService; |
| | |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/downloadReq") |
| | | public ResponseMsg<Object> downloadReq(String[] guids, HttpServletRequest req, HttpServletResponse res) { |
| | | public ResponseMsg<Object> downloadReqForGuids(String[] guids, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | if (null == guids || guids.length == 0) { |
| | | return fail("附件Guid数组为空"); |
| | | return fail("Guid数组为空"); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | //String guid = downloadService.zipFiles(ue, list, reqEntity.getPwd()); |
| | | String guid = uploadAttachService.downloadReqForGuids(ue, guids); |
| | | |
| | | return success(""); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "请求下载") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "tab", value = "表名", dataType = "String", paramType = "body", example = "bd.b_borehole"), |
| | | @ApiImplicitParam(name = "guids", value = "附件Guid数组", dataType = "String", paramType = "body", allowMultiple = true, example = "08e5b4ad-93b8-46f6-adaa-46a6274af4ce,6f94f4f8-6e8d-44e7-8803-3d068d34983f") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/downloadReq") |
| | | public ResponseMsg<Object> downloadReqForTabGuids(String tab, String[] guids, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | if (StringHelper.isEmpty(tab)) { |
| | | return fail("表名为空"); |
| | | } |
| | | if (null != guids && guids.length == 0) { |
| | | guids = null; |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | String guid = uploadAttachService.downloadReqForTabGuids(ue, tab, guids); |
| | | |
| | | return success(guid); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | } |