feat: 增加线路查询接口

dev
huangfeng 11 months ago
parent 93ab91a546
commit a93d310b71

@ -0,0 +1,45 @@
package com.shxy.xymanager_admin.controller;
import com.github.pagehelper.PageInfo;
import com.shxy.xymanager_common.annotation.Log;
import com.shxy.xymanager_common.base.BaseController;
import com.shxy.xymanager_common.base.ResponseReult;
import com.shxy.xymanager_common.entity.Lines;
import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_service.service.LineService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@Api(tags = {"线路新接口"})
@RequestMapping("line")
@Slf4j
public class NewLineController extends BaseController {
@Autowired
LineService lineService;
@ApiOperation(value = "查询线路全量列表")
@RequestMapping("listFull")
@Log(title = "获取线路列表", type = "查询")
public ResponseReult<PageInfo<Lines>> listFull(@RequestBody @Validated SelectVo vo) {
PageInfo<Lines> list = lineService.listFull(vo);
return ResponseReult.success(list);
}
@ApiOperation(value = "查询线路超量列表")
@RequestMapping("listOver")
@Log(title = "获取线路列表", type = "查询")
public ResponseReult<PageInfo<Lines>> listOver(@RequestBody @Validated SelectVo vo) {
PageInfo<Lines> list = lineService.listOver(vo);
return ResponseReult.success(list);
}
}

@ -23,9 +23,11 @@ import com.shxy.xymanager_service.service.LineService;
import com.shxy.xymanager_service.service.NewCacheService;
import com.shxy.xymanager_service.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.*;
@ -152,6 +154,60 @@ public class LineServiceImpl implements LineService {
return Asserts.success(model);
}
@Override
public PageInfo<Lines> listFull(SelectVo vo) {
PermissionDetail permit = userService.getPermissionListFull();
LinesExample example = new LinesExample();
LinesExample.Criteria criteria = example.createCriteria();
if (permit.getIsSuper().equals(CommonStatus.DELETE.value())) {
if (CollectionUtils.isEmpty(permit.getLinepList())) {
criteria.andIdEqualTo(-1);
} else {
criteria.andIdIn(permit.getLinepList());
}
}
if (vo.getDyId() != null && vo.getDyId() > 0) {
criteria.andDyLevelIdEqualTo(vo.getDyId());
}
if (vo.getLineId() != null && vo.getLineId() > 0) {
criteria.andIdEqualTo(vo.getLineId());
}
if (StringUtils.isNotBlank(vo.getSearch())) {
criteria.andNameLike("%" + vo.getSearch() + "%");
}
PageUtils.SetPage(vo.getPageindex(), vo.getPagesize());
List<Lines> list = linesDao.selectByExample(example);
return new PageInfo<>(list);
}
@Override
public PageInfo<Lines> listOver(SelectVo vo) {
PermissionDetail permit = userService.getPermissionListOver();
LinesExample example = new LinesExample();
LinesExample.Criteria criteria = example.createCriteria();
if (permit.getIsSuper().equals(CommonStatus.DELETE.value())) {
if (CollectionUtils.isEmpty(permit.getLinepList())) {
criteria.andIdEqualTo(-1);
} else {
criteria.andIdIn(permit.getLinepList());
}
}
if (vo.getDyId() != null && vo.getDyId() > 0) {
criteria.andDyLevelIdEqualTo(vo.getDyId());
}
if (vo.getLineId() != null && vo.getLineId() > 0) {
criteria.andIdEqualTo(vo.getLineId());
}
if (StringUtils.isNotBlank(vo.getSearch())) {
criteria.andNameLike("%" + vo.getSearch() + "%");
}
PageUtils.SetPage(vo.getPageindex(), vo.getPagesize());
List<Lines> list = linesDao.selectByExample(example);
return new PageInfo<>(list);
}
/**
* 线
*

@ -1,11 +1,14 @@
package com.shxy.xymanager_service.service;
import com.github.pagehelper.PageInfo;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.entity.Lines;
import com.shxy.xymanager_common.model.LineAndGtAndChannelListModel;
import com.shxy.xymanager_common.page.TableDataInfo;
import com.shxy.xymanager_common.vo.*;
import java.util.List;
/**
* 线
*
@ -20,6 +23,10 @@ public interface LineService {
*/
ServiceBody<TableDataInfo<Lines>> getLineList(SelectVo vo);
PageInfo<Lines> listFull(SelectVo vo);
PageInfo<Lines> listOver(SelectVo vo);
/**
* 线
*

Loading…
Cancel
Save