| | |
| | | @GetMapping("/video_point") |
| | | public CommonResult<List<VideoPointVo>> videoPoint(@Validated CockpitVO params) { |
| | | checkApiUtil.cockpit(params); |
| | | |
| | | IPage<VideoPointVo> page = videoPointService.getList(null, null, 1, 500); |
| | | |
| | | return CommonResult.success(page.getRecords()); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ycl.api.CommonPage; |
| | | import com.ycl.api.CommonResult; |
| | | import com.ycl.controller.BaseController; |
| | | import com.ycl.entity.region.SccgRegion; |
| | |
| | | public CommonResult addRegion(@Validated @RequestBody SccgRegion sccgRegion) { |
| | | return CommonResult.success(iSccgRegionService.save(sccgRegion)); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取行政区域分页查询") |
| | | @RequestMapping(value = "/list", method = RequestMethod.POST) |
| | | @ResponseBody |
| | | public CommonResult<IPage<SccgRegion>> list(@Validated @RequestBody SccgRegion sccgRegion) { |
| | | return CommonResult.success(iSccgRegionService.list(sccgRegion)); |
| | | public CommonResult<CommonPage<SccgRegion>> list(@RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize, |
| | | @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) { |
| | | Page<SccgRegion> list = iSccgRegionService.list(pageSize, pageNum); |
| | | return CommonResult.success(CommonPage.restPage(list)); |
| | | } |
| | | |
| | | |
| | |
| | | @ApiOperation("获取子类") |
| | | @GetMapping("/getChildren/{parentId}") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "parentId",value = "顶级parentId=0") |
| | | @ApiImplicitParam(name = "parentId", value = "顶级parentId=0") |
| | | }) |
| | | public CommonResult<List<SccgRegion>> getChildren(@PathVariable Long parentId) { |
| | | List<SccgRegion> treeList = iSccgRegionService.getChildren(parentId); |
| | |
| | | public CommonResult<StoreInfo> getItem(@PathVariable Long id) { |
| | | StoreInfo storeInfo = storeInfoService.getById(id); |
| | | StoreInfoVO vo = new StoreInfoVO(); |
| | | BeanUtils.copyProperties(storeInfo,vo); |
| | | BeanUtils.copyProperties(storeInfo, vo); |
| | | vo.setVideoPoint(videoPointService.getById(storeInfo.getVideoId())); |
| | | return CommonResult.success(storeInfo); |
| | | } |
| | |
| | | @ApiOperation(value = "添加门店信息") |
| | | @RequestMapping(value = "/add", method = RequestMethod.POST) |
| | | @ResponseBody |
| | | @LogSave(operationType = "门店管理",contain = "添加门店") |
| | | @LogSave(operationType = "门店管理", contain = "添加门店") |
| | | public CommonResult<StoreInfo> add(@Validated @RequestBody UmsStoreInfoParam umsStoreInfoParam) { |
| | | StoreInfo storeInfo = StoreInfo.builder() |
| | | .owner(umsStoreInfoParam.getOwner()) |
New file |
| | |
| | | package com.ycl.controller.video; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ycl.api.CommonPage; |
| | | import com.ycl.api.CommonResult; |
| | | import com.ycl.entity.video.VideoPoint; |
| | | import com.ycl.service.video.IVideoInspectionService; |
| | | import com.ycl.service.video.impl.IVideoPointService; |
| | | import com.ycl.vo.equipment.VideoPointVo; |
| | | import io.swagger.annotations.Api; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * 视频巡查控制器 |
| | | * |
| | | * @author 安瑾然 |
| | | * @date 2022/11/08 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/video_inspection") |
| | | @Api(tags = "视频巡查") |
| | | public class VideoInspectionController { |
| | | |
| | | @Autowired |
| | | private IVideoInspectionService videoInspectionService; |
| | | |
| | | |
| | | @GetMapping("page") |
| | | public CommonResult page(@RequestParam(value = "size", required = false) Long size, |
| | | @RequestParam(value = "current", required = false) Long current, |
| | | @RequestParam(value = "regionId", required = false) Integer streetId, |
| | | @RequestParam(value = "regionId", required = false) Integer communityId) { |
| | | Page<VideoPointVo> list = videoInspectionService.page(size, current, streetId, communityId); |
| | | return CommonResult.success(CommonPage.restPage(list)); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.ycl.entity.video.VideoPoint; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ycl.vo.equipment.VideoPointVo; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | |
| | | * @author zhanghua |
| | | * @since 2022-09-26 |
| | | */ |
| | | @Mapper |
| | | public interface VideoPointMapper extends BaseMapper<VideoPoint> { |
| | | |
| | | IPage<VideoPointVo> search(Page<VideoPointVo> page, @Param("streetId") Integer streetId, @Param("communityId") Integer communityId); |
| | | |
| | | } |
| | |
| | | package com.ycl.service.region; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ycl.entity.region.SccgRegion; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | List<SccgRegion> getTree(); |
| | | IPage<SccgRegion> list(SccgRegion sccgRegion); |
| | | Page<SccgRegion> list(Integer pageSize, Integer pageNum); |
| | | |
| | | List<SccgRegion> getChildren(Long parentId); |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ycl.entity.region.SccgRegion; |
| | | import com.ycl.mapper.region.SccgRegionMapper; |
| | |
| | | if (StringUtils.isBlank(result)) { |
| | | // 1.查出所有网格 |
| | | List<SccgRegion> list = this.list(); |
| | | |
| | | // 2.组装成父子的树型结构 |
| | | // 2.1、找到所有的一级网格:使用jdk8的stream流进行过滤 |
| | | List<SccgRegion> collect = list.stream().filter(griddingEntity -> { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public IPage<SccgRegion> list(SccgRegion sccgRegion) { |
| | | return null; |
| | | public Page<SccgRegion> list(Integer pageSize, Integer pageNum) { |
| | | Page<SccgRegion> page = new Page<>(); |
| | | page.setSize(pageSize); |
| | | page.setCurrent(pageNum); |
| | | return page(page); |
| | | } |
| | | |
| | | @Override |
New file |
| | |
| | | package com.ycl.service.video; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ycl.vo.equipment.VideoPointVo; |
| | | |
| | | /** |
| | | * 视频巡查服务Service |
| | | * |
| | | * @author 安瑾然 |
| | | * @date 2022/11/08 |
| | | */ |
| | | public interface IVideoInspectionService { |
| | | Page<VideoPointVo> page(Long size, Long current, Integer streetId, Integer communityId); |
| | | } |
New file |
| | |
| | | package com.ycl.service.video.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ycl.common.util.CommonUtils; |
| | | import com.ycl.entity.video.VideoPoint; |
| | | import com.ycl.mapper.video.VideoPointMapper; |
| | | import com.ycl.service.video.IVideoInspectionService; |
| | | import com.ycl.vo.equipment.VideoPointVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * 视频巡查服务ServiceImpl |
| | | * |
| | | * @author 安瑾然 |
| | | * @date 2022/11/08 |
| | | */ |
| | | @Service |
| | | public class VideoInspectionServiceImpl implements IVideoInspectionService { |
| | | @Autowired |
| | | private VideoPointMapper videoPointMapper; |
| | | |
| | | @Override |
| | | public Page<VideoPointVo> page(Long size, Long current, Integer streetId, Integer communityId) { |
| | | Page<VideoPointVo> page = new Page<>(current, size); |
| | | return (Page<VideoPointVo>) videoPointMapper.search(page, streetId, communityId); |
| | | } |
| | | } |
| | |
| | | |
| | | @Override |
| | | public IPage<VideoPointVo> getList(Integer streetId, Integer communityId, Integer current, Integer size) { |
| | | |
| | | Page<VideoPointVo> page = new Page<>(current, size); |
| | | IPage<VideoPointVo> page1 = baseMapper.search(page, streetId, communityId); |
| | | return page1; |