| | |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.entity.all.StaticData; |
| | | import com.lf.server.entity.ctrl.DownloadReqEntity; |
| | | import com.lf.server.entity.ctrl.IdNameEntity; |
| | | import com.lf.server.entity.data.DictEntity; |
| | | import com.lf.server.entity.data.DownloadEntity; |
| | | import com.lf.server.entity.data.MetaEntity; |
| | | import com.lf.server.entity.data.VerEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.ClassHelper; |
| | | import com.lf.server.helper.Md5Helper; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.helper.WebHelper; |
| | | import com.lf.server.helper.*; |
| | | import com.lf.server.mapper.all.BasicMapper; |
| | | import com.lf.server.service.all.BaseQueryService; |
| | | import com.lf.server.service.data.DownloadService; |
| | | import com.lf.server.service.data.MetaService; |
| | | import com.lf.server.service.data.VerService; |
| | | import com.lf.server.service.sys.DepService; |
| | | import com.lf.server.service.sys.DownlogService; |
| | | import com.lf.server.service.sys.TokenService; |
| | | import io.swagger.annotations.*; |
| | |
| | | import java.io.File; |
| | | import java.net.URLDecoder; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | @Autowired |
| | | VerService verService; |
| | | |
| | | @Autowired |
| | | DepService depService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "分页查询并返回记录数") |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询元数据中溢出的单位ID") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "reqEntity", value = "请求下载实体", dataType = "DownloadReqEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/selectMetaOverflowDep") |
| | | public ResponseMsg<Object> selectMetaOverflowDep(@RequestBody DownloadReqEntity dr, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | if (null == dr || null == dr.getIds() || dr.getIds().isEmpty()) { |
| | | return fail("请选择要下载的文件ID"); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (StaticData.ADMIN.equals(ue.getUid())) { |
| | | return success(new ArrayList<String>()); |
| | | } |
| | | |
| | | List<String> list = downloadService.selectMetaOverflowDep(ue, dr); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "根据单位编码数组查询单位") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "codes", value = "单位编码数组", dataType = "String", paramType = "query", allowMultiple = true, example = "00,0001") |
| | | }) |
| | | @GetMapping(value = "/selectDepsByCodes") |
| | | public ResponseMsg<Object> selectDepsByCodes(String[] codes) { |
| | | try { |
| | | if (null == codes || codes.length == 0) { |
| | | return fail("单位ID集合为空"); |
| | | } |
| | | |
| | | List<IdNameEntity> list = depService.selectDepsByCodes(codes); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "请求下载") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "dr", value = "请求下载实体类", dataType = "DownloadReqEntity", paramType = "body") |
| | |
| | | return fail("密码不能为空"); |
| | | } |
| | | if (null == dr.getIds() || dr.getIds().isEmpty()) { |
| | | return fail("请选择要下载的文件"); |
| | | return fail("请选择要下载的文件ID"); |
| | | } |
| | | if (!DownloadService.decryptPwd(dr)) { |
| | | return fail("密码解密失败", null); |