| | |
| | | package com.lf.server.controller.show; |
| | | |
| | | import com.lf.server.aspect.SysLog; |
| | | import com.lf.server.annotation.SysLog; |
| | | import com.lf.server.controller.all.BaseController; |
| | | import com.lf.server.entity.all.HttpStatus; |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.entity.ctrl.MarkJsonEntity; |
| | | import com.lf.server.entity.show.MarkEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.WebHelper; |
| | | import com.lf.server.service.all.BaseUploadService; |
| | | import com.lf.server.service.data.DownloadService; |
| | | import com.lf.server.service.show.MarkService; |
| | | import com.lf.server.service.sys.DownlogService; |
| | | import com.lf.server.service.sys.TokenService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | BaseUploadService baseUploadService; |
| | | |
| | | @Autowired |
| | | DownlogService downlogService; |
| | | |
| | | @Autowired |
| | | DownloadService downloadService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "分页查询并返回记录数") |
| | |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | return success(entity); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), -1); |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), -1); |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), -1); |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), -1); |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), -1); |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), -1); |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "上传ShapeFile文件") |
| | | @ResponseBody |
| | | @PostMapping(value = "/uploadShp", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<List<MarkJsonEntity>> uploadShp(HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | List<MarkJsonEntity> list = null; |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "下载ShapeFile文件") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "标绘JSON实体类集合", dataType = "MarkJsonEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/downloadShp", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<String> downloadShp(@RequestBody List<MarkJsonEntity> list, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue == null) { |
| | | return fail("用户未登录", null); |
| | | } |
| | | if (list == null || list.isEmpty()) { |
| | | return fail("找不到标绘数据", null); |
| | | } |
| | | |
| | | String str = markService.downloadShp(ue, list, req, res); |
| | | |
| | | return success(str); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | public void downloadFile(String guid) { |
| | | |
| | | } |
| | | } |