| | |
| | | |
| | | import cn.afterturn.easypoi.excel.ExcelExportUtil; |
| | | import cn.afterturn.easypoi.excel.entity.ExportParams; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | |
| | | if (xpGeoFencingPolygonService.isInFence(pointAddDto.getPointLon(), pointAddDto.getPointLat(), pointAddDto.getFenceId(), "prohibited_area")) { |
| | | return R.ok("in_prohibited_area"); |
| | | } |
| | | xpPointService.validateAdd(pointAddDto); |
| | | return R.ok(xpPointService.addPointWithGeneratedNumber(pointAddDto)); |
| | | } |
| | | |
| | |
| | | if (xpPoint == null) { |
| | | throw new ServiceException("系统异常", I18nKeyConstant.SYSTEM_EXCEPTION); |
| | | } |
| | | xpPointService.validateUpdate(pointAddDto); |
| | | pointAddDto.setStationSortNo(xpPoint.getStationSortNo()); |
| | | xpPointService.validatePointNameUnique(pointAddDto.getPointName(), pointAddDto.getId()); |
| | | BeanUtils.copyProperties(pointAddDto, xpPoint); |
| | |
| | | .set(XpPoint::getCityName, xpPoint.getCityName()) |
| | | .set(XpPoint::getDistrictName, xpPoint.getDistrictName()) |
| | | .set(XpPoint::getDistrictCode, xpPoint.getDistrictCode()) |
| | | .set(XpPoint::getPointOnOff, xpPoint.getPointOnOff()) |
| | | .set(XpPoint::getStationId, stationId) |
| | | .set(XpPoint::getStationSortNo, stationSortNo) |
| | | .update(); |
| | |
| | | /** |
| | | * 点位详情 |
| | | */ |
| | | @GetMapping("/api/v1/point/queryById") |
| | | @GetMapping("/queryById") |
| | | @ApiOperation(value = "点位详情") |
| | | public R<XpPoint> queryById(@RequestParam Long id) { |
| | | return R.ok(xpPointService.getById(id)); |
| | | PointListQuery query = new PointListQuery(); |
| | | query.setId(id); |
| | | List<XpPoint> pointList = xpPointService.findList(query); |
| | | if(CollUtil.isNotEmpty(pointList)){ |
| | | return R.ok(pointList.get(0)); |
| | | } |
| | | return R.ok(new XpPoint()); |
| | | } |
| | | |
| | | /** |