| | |
| | | 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.all.StaticData; |
| | | import com.lf.server.entity.ctrl.MarkJsonEntity; |
| | | import com.lf.server.entity.data.DownloadEntity; |
| | | import com.lf.server.entity.data.MetaEntity; |
| | | import com.lf.server.entity.show.MarkEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.helper.WebHelper; |
| | | import com.lf.server.service.data.DownloadService; |
| | | import com.lf.server.service.data.UploaderService; |
| | | 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; |
| | |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | UploaderService uploaderService; |
| | | |
| | | @Autowired |
| | | DownlogService downlogService; |
| | | |
| | | @Autowired |
| | | DownloadService downloadService; |
| | |
| | | @ApiOperation(value = "上传ShapeFile文件") |
| | | @ResponseBody |
| | | @PostMapping(value = "/uploadShp", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<List<MarkJsonEntity>> uploadShp(HttpServletRequest req, HttpServletResponse res) { |
| | | public ResponseMsg<Object> uploadShp(HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | List<MarkJsonEntity> list = null; |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue == null) { |
| | | return fail("用户未登录", null); |
| | | } |
| | | |
| | | List<MetaEntity> meList = uploaderService.uploadData(null, null, req, res); |
| | | if (meList == null || meList.size() < StaticData.FOUR) { |
| | | return fail("没有找到已上传的数据或不完整", null); |
| | | } |
| | | |
| | | List<MarkJsonEntity> list = markService.readShpForMarks(meList); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | |
| | | WebHelper.write2Page(res, WebHelper.getErrJson(HttpStatus.NOT_FOUND, "文件不存在")); |
| | | } |
| | | |
| | | de.setDcount(de.getDcount() + 1); |
| | | de.setDownloadUser(ue.getId()); |
| | | int rows = downloadService.update(de); |
| | | downlogService.updateInfos(ue, de, req); |
| | | |
| | | String filePath = markService.getDownloadFilePath(de); |
| | | WebHelper.download(filePath, de.getName(), res); |