| | |
| | | import com.lf.server.controller.all.BaseController; |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.entity.bd.DlgAgnpEntity; |
| | | import com.lf.server.entity.ctrl.ShpRecord; |
| | | import com.lf.server.entity.data.MetaEntity; |
| | | import com.lf.server.entity.ctrl.ShpRecordEntity; |
| | | import com.lf.server.entity.data.MetaFileEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.AesHelper; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.service.data.UploaderService; |
| | | import com.lf.server.service.show.ComprehensiveService; |
| | | import com.lf.server.service.sys.TokenService; |
| | |
| | | |
| | | @Autowired |
| | | ComprehensiveService comprehensiveService; |
| | | |
| | | private final static int FOUR = 4; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "分页查询并返回记录数-地名地址") |
| | |
| | | @ApiOperation(value = "上传Shp文件获取第一条记录的WKT") |
| | | @ResponseBody |
| | | @PostMapping(value = "/uploadShp") |
| | | public ResponseMsg<ShpRecord> uploadShp(HttpServletRequest req, HttpServletResponse res) { |
| | | public ResponseMsg<ShpRecordEntity> uploadShp(HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue == null) { |
| | | return fail("用户未登录", null); |
| | | } |
| | | |
| | | MetaEntity me = new MetaEntity(); |
| | | List<MetaFileEntity> list = uploaderService.uploadData(me, ue, req, res); |
| | | if (list.size() == 0) { |
| | | return fail("没有找到上传数据", null); |
| | | List<MetaFileEntity> list = uploaderService.uploadData(null, ue, req, res); |
| | | if (list.size() < FOUR) { |
| | | return fail("没有找到已上传的数据或不完整", null); |
| | | } |
| | | |
| | | ShpRecord sr = comprehensiveService.readShpFirstRecord(list); |
| | | ShpRecordEntity sr = comprehensiveService.readShpFirstRecord(list); |
| | | if (sr != null && !StringHelper.isEmpty(sr.getWkt())) { |
| | | sr.setWkt(AesHelper.encrypt(sr.getWkt())); |
| | | } |
| | | |
| | | return success(sr); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |