From dfe53eeed8937bc27ff9b4498bb58505c1bd49e8 Mon Sep 17 00:00:00 2001 From: liuguijing <123456> Date: Fri, 2 Jun 2023 16:55:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=AB=E5=90=8D=E7=9A=84=E7=BA=BF=E8=B7=AF?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/LineController.java | 13 ++++++++++ .../shxy/xymanager_common/vo/LineAndGtVo.java | 17 +++++++++++++ .../shxy/xymanager_common/vo/TerminalVo.java | 2 +- .../impl/LineServiceImpl.java | 25 +++++++++++++++++++ .../service/LineService.java | 8 ++++++ 5 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 xymanager_common/src/main/java/com/shxy/xymanager_common/vo/LineAndGtVo.java diff --git a/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/LineController.java b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/LineController.java index f5e6d33..f74fb4c 100644 --- a/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/LineController.java +++ b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/LineController.java @@ -95,4 +95,17 @@ public class LineController extends BaseController { return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg()); } } + + @ApiOperation(value = "线路和杆塔列表", notes = "线路和杆塔列表查询", httpMethod = "POST") + @ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")}) + @RequestMapping("/getLineAndGtList") + @Log(title = "线路和杆塔列表查询", type = "查询") + public ResponseReult getLineAndGtList(@RequestBody @Validated LineAndGtVo vo) { + ServiceBody serviceBody = lineService.getLineAndGtList(vo); + if (serviceBody.getCode() == ServiceStatus.SUCCESS) { + return ResponseReult.success(serviceBody.getData()); + } else { + return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg()); + } + } } diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/LineAndGtVo.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/LineAndGtVo.java new file mode 100644 index 0000000..277b146 --- /dev/null +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/LineAndGtVo.java @@ -0,0 +1,17 @@ +package com.shxy.xymanager_common.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "线路杆塔查询", description = "线路杆塔查询") +public class LineAndGtVo { + + @ApiModelProperty(value = "查询类型", example = "1--线路 2--杆塔") + private Integer type; + + @ApiModelProperty(value = "编号", example = "123455") + private Integer id; + +} diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalVo.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalVo.java index ad80dcf..28fdb4d 100644 --- a/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalVo.java +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalVo.java @@ -18,7 +18,7 @@ public class TerminalVo { @ApiModelProperty(value = "杆塔编号", example = "123456") private Integer towerid; - @ApiModelProperty(value = "通道编号", example = "123456") + @ApiModelProperty(value = "通道编号", example = "[{id:int , alias:dskafjl},{id,alias}]") private List channelid; @ApiModelProperty(value = "sim卡号", example = "123456") diff --git a/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/LineServiceImpl.java b/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/LineServiceImpl.java index dd4aaf0..e517b7c 100644 --- a/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/LineServiceImpl.java +++ b/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/LineServiceImpl.java @@ -195,5 +195,30 @@ public class LineServiceImpl implements LineService { return Asserts.success(model); } + /** + * 线路杆塔查询 + * + * @param vo + * @return + */ + @Override + public ServiceBody getLineAndGtList(LineAndGtVo vo) { + LineAndGtAndChannelListModel model = new LineAndGtAndChannelListModel(); + List beans = new ArrayList<>(); + Integer type = vo.getType(); + Integer id = vo.getId(); + if (type.intValue() == 1) { + List list = linesDao.selectLineByDyId(null, CommonStatus.EFFECTIVE.value()); + beans = BeanUtil.copyToList(list, LineAndGtAndChannelListModel.Bean.class); + } else { + if (id != null) { + List list = towerDao.selectAllByLineid(id, CommonStatus.EFFECTIVE.value()); + beans = BeanUtil.copyToList(list, LineAndGtAndChannelListModel.Bean.class); + } + } + model.setList(beans); + return Asserts.success(model); + } + } diff --git a/xymanager_service/src/main/java/com/shxy/xymanager_service/service/LineService.java b/xymanager_service/src/main/java/com/shxy/xymanager_service/service/LineService.java index bccbe45..f7705b0 100644 --- a/xymanager_service/src/main/java/com/shxy/xymanager_service/service/LineService.java +++ b/xymanager_service/src/main/java/com/shxy/xymanager_service/service/LineService.java @@ -51,4 +51,12 @@ public interface LineService { */ ServiceBody getLineAndGt(LineAndGtAndChannelVo vo); + /** + * 线路杆塔查询 + * + * @param vo + * @return + */ + ServiceBody getLineAndGtList(LineAndGtVo vo); + }