From 4c8c44ae1899f58dfbc453e3841ffb412d257d44 Mon Sep 17 00:00:00 2001 From: liuguijing <123456> Date: Wed, 12 Apr 2023 10:40:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AC=A3=E5=BD=B1=E7=AE=A1=E7=90=86=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E7=BA=BF=E8=B7=AF=E5=92=8C=E8=A3=85=E7=BD=AE=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ChannelController.java | 40 ++++++ .../controller/LineController.java | 102 ++++++++++++++ .../controller/TerminalController.java | 45 ++++++ .../controller/TerminalPhotoController.java | 86 +++++++++++ .../src/main/resources/application-test.yml | 4 +- xymanager_admin/src/main/resources/log4j2.xml | 4 +- .../XymanagerAdminApplicationTests.java | 43 +++--- .../dto/LineAndTerminalDto.java | 21 +++ .../entity/TerminalChannels.java | 50 +------ .../xymanager_common/enums/CommonStatus.java | 29 ++++ .../xymanager_common/model/LineListModel.java | 37 +++++ .../model/LineTreeListModel.java | 60 ++++++++ .../shxy/xymanager_common/vo/LineIdVo.java | 23 +++ .../com/shxy/xymanager_common/vo/LineVo.java | 33 +++++ .../xymanager_common/vo/TerminalIdVo.java | 22 +++ .../shxy/xymanager_common/vo/TerminalVo.java | 95 +++++++------ .../xymanager_common/vo/UpdateLineVo.java | 31 ++++ .../xymanager_common/vo/UpdateTerminalVo.java | 77 ++++++++++ .../shxy/xymanager_dao/dao/TerminalsDao.java | 11 +- .../src/main/resources/generatorConfig.xml | 107 +++++++------- .../main/resources/mappers/TerminalsDao.xml | 81 ++++++----- .../impl/LineServiceImpl.java | 133 ++++++++++++++++++ .../impl/TerminalChannelServiceImpl.java | 28 ++++ .../impl/TerminalParamsServiceImpl.java | 28 ++++ .../impl/TerminalPhotoServiceImpl.java | 30 ++++ .../impl/TerminalPresetServiceImpl.java | 30 ++++ .../impl/TerminalScheduleServiceImpl.java | 29 ++++ .../impl/TerminalServiceImpl.java | 67 +++++---- .../impl/TerminalStatusServiceImpl.java | 93 ++++++++++++ .../service/LineService.java | 54 +++++++ .../service/TerminalChannelService.java | 6 +- .../service/TerminalPhotoService.java | 27 ++++ .../service/TerminalPresetsService.java | 27 ++++ .../service/TerminalScheduleService.java | 27 ++++ .../service/TerminalService.java | 20 ++- .../service/TerminalStatusService.java | 35 +++++ 36 files changed, 1410 insertions(+), 225 deletions(-) create mode 100644 xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/ChannelController.java create mode 100644 xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/LineController.java create mode 100644 xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalPhotoController.java create mode 100644 xymanager_common/src/main/java/com/shxy/xymanager_common/dto/LineAndTerminalDto.java create mode 100644 xymanager_common/src/main/java/com/shxy/xymanager_common/enums/CommonStatus.java create mode 100644 xymanager_common/src/main/java/com/shxy/xymanager_common/model/LineListModel.java create mode 100644 xymanager_common/src/main/java/com/shxy/xymanager_common/model/LineTreeListModel.java create mode 100644 xymanager_common/src/main/java/com/shxy/xymanager_common/vo/LineIdVo.java create mode 100644 xymanager_common/src/main/java/com/shxy/xymanager_common/vo/LineVo.java create mode 100644 xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalIdVo.java create mode 100644 xymanager_common/src/main/java/com/shxy/xymanager_common/vo/UpdateLineVo.java create mode 100644 xymanager_common/src/main/java/com/shxy/xymanager_common/vo/UpdateTerminalVo.java create mode 100644 xymanager_service/src/main/java/com/shxy/xymanager_service/impl/LineServiceImpl.java create mode 100644 xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalChannelServiceImpl.java create mode 100644 xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalParamsServiceImpl.java create mode 100644 xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalPhotoServiceImpl.java create mode 100644 xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalPresetServiceImpl.java create mode 100644 xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalScheduleServiceImpl.java create mode 100644 xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalStatusServiceImpl.java create mode 100644 xymanager_service/src/main/java/com/shxy/xymanager_service/service/LineService.java create mode 100644 xymanager_service/src/main/java/com/shxy/xymanager_service/service/TerminalPhotoService.java create mode 100644 xymanager_service/src/main/java/com/shxy/xymanager_service/service/TerminalPresetsService.java create mode 100644 xymanager_service/src/main/java/com/shxy/xymanager_service/service/TerminalScheduleService.java create mode 100644 xymanager_service/src/main/java/com/shxy/xymanager_service/service/TerminalStatusService.java diff --git a/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/ChannelController.java b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/ChannelController.java new file mode 100644 index 0000000..4120876 --- /dev/null +++ b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/ChannelController.java @@ -0,0 +1,40 @@ +package com.shxy.xymanager_admin.controller; + +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.bean.ServiceBody; +import com.shxy.xymanager_common.bean.ServiceStatus; +import com.shxy.xymanager_common.model.TerminalListModel; +import com.shxy.xymanager_service.service.TerminalService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +@Api(value = "通道接口", tags = "通道相关") +@RestController +@Slf4j +public class ChannelController extends BaseController { + + @Autowired + TerminalService terminalService; + + @ApiOperation(value = "获取通道接口", notes = "获取通道列表接口", httpMethod = "POST") + @ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")}) + @RequestMapping("/getChannelList") + @Log(title = "获取通道列表", type = "查询") + public ResponseReult getChannelList() { + ServiceBody serviceBody = terminalService.getTerminalList(); + if (serviceBody.getCode() == ServiceStatus.SUCCESS) { + return ResponseReult.success(serviceBody.getData()); + } else { + return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg()); + } + } +} 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 new file mode 100644 index 0000000..0ce7278 --- /dev/null +++ b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/LineController.java @@ -0,0 +1,102 @@ +package com.shxy.xymanager_admin.controller; + +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.bean.ServiceBody; +import com.shxy.xymanager_common.bean.ServiceStatus; +import com.shxy.xymanager_common.model.LineListModel; +import com.shxy.xymanager_common.model.LineTreeListModel; +import com.shxy.xymanager_common.model.TerminalListModel; +import com.shxy.xymanager_common.vo.LineIdVo; +import com.shxy.xymanager_common.vo.LineVo; +import com.shxy.xymanager_common.vo.UpdateLineVo; +import com.shxy.xymanager_service.service.LineService; +import com.shxy.xymanager_service.service.TerminalService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import lombok.extern.slf4j.Slf4j; +import org.omg.CosNaming.NamingContextExtPackage.StringNameHelper; +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; + + +@Api(value = "线路接口", tags = "线路相关") +@RestController +@Slf4j +public class LineController extends BaseController { + + @Autowired + LineService lineService; + + @ApiOperation(value = "获取线路树状图", notes = "获取线路树状图接口", httpMethod = "POST") + @ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")}) + @RequestMapping("/getLineTreeList") + @Log(title = "获取线路列表", type = "查询") + public ResponseReult getLineTreeList() { + ServiceBody serviceBody = lineService.getLineTreeList(); + if (serviceBody.getCode() == ServiceStatus.SUCCESS) { + return ResponseReult.success(serviceBody.getData()); + } else { + 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("/getLineList") + @Log(title = "获取线路列表", type = "查询") + public ResponseReult getLineList() { + ServiceBody serviceBody = lineService.getLineList(); + if (serviceBody.getCode() == ServiceStatus.SUCCESS) { + return ResponseReult.success(serviceBody.getData()); + } else { + 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("/addLine") + @Log(title = "添加线路", type = "新增") + public ResponseReult addLine(@RequestBody @Validated LineVo vo) { + ServiceBody serviceBody = lineService.addLine(vo); + if (serviceBody.getCode() == ServiceStatus.SUCCESS) { + return ResponseReult.success(serviceBody.getData()); + } else { + 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("/deleteLine") + @Log(title = "删除线路", type = "修改") + public ResponseReult deleteLine(@RequestBody @Validated LineIdVo vo) { + ServiceBody serviceBody = lineService.deleteLine(vo); + if (serviceBody.getCode() == ServiceStatus.SUCCESS) { + return ResponseReult.success(serviceBody.getData()); + } else { + 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("/updateLine") + @Log(title = "修改线路", type = "修改") + public ResponseReult updateLine(@RequestBody @Validated UpdateLineVo vo) { + ServiceBody serviceBody = lineService.updateLine(vo); + if (serviceBody.getCode() == ServiceStatus.SUCCESS) { + return ResponseReult.success(serviceBody.getData()); + } else { + return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg()); + } + } +} diff --git a/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalController.java b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalController.java index 9ac3273..0b5566e 100644 --- a/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalController.java +++ b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalController.java @@ -6,6 +6,9 @@ import com.shxy.xymanager_common.base.ResponseReult; import com.shxy.xymanager_common.bean.ServiceBody; import com.shxy.xymanager_common.bean.ServiceStatus; import com.shxy.xymanager_common.model.TerminalListModel; +import com.shxy.xymanager_common.vo.TerminalIdVo; +import com.shxy.xymanager_common.vo.TerminalVo; +import com.shxy.xymanager_common.vo.UpdateTerminalVo; import com.shxy.xymanager_service.service.TerminalService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -13,6 +16,7 @@ import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -36,4 +40,45 @@ public class TerminalController 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("/addTerminal") + @Log(title = "新增设备列表", type = "新增") + public ResponseReult addTerminal(@RequestBody @Validated TerminalVo vo) { + ServiceBody serviceBody = terminalService.addTerminal(vo); + if (serviceBody.getCode() == ServiceStatus.SUCCESS) { + return ResponseReult.success(serviceBody.getData()); + } else { + 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("/updateTerminal") + @Log(title = "修改设备", type = "修改") + public ResponseReult updateTerminal(@RequestBody @Validated UpdateTerminalVo vo) { + ServiceBody serviceBody = terminalService.updateTerminal(vo); + if (serviceBody.getCode() == ServiceStatus.SUCCESS) { + return ResponseReult.success(serviceBody.getData()); + } else { + 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("/deleteTerminal") + @Log(title = "删除装置列表", type = "修改") + public ResponseReult deleteTerminal(@RequestBody @Validated TerminalIdVo vo) { + ServiceBody serviceBody = terminalService.deleteTerminal(vo); + if (serviceBody.getCode() == ServiceStatus.SUCCESS) { + return ResponseReult.success(serviceBody.getData()); + } else { + return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg()); + } + } + } diff --git a/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalPhotoController.java b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalPhotoController.java new file mode 100644 index 0000000..5f31e3e --- /dev/null +++ b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalPhotoController.java @@ -0,0 +1,86 @@ +package com.shxy.xymanager_admin.controller; + +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.bean.ServiceBody; +import com.shxy.xymanager_common.bean.ServiceStatus; +import com.shxy.xymanager_common.model.TerminalListModel; +import com.shxy.xymanager_common.vo.TerminalIdVo; +import com.shxy.xymanager_common.vo.TerminalVo; +import com.shxy.xymanager_common.vo.UpdateTerminalVo; +import com.shxy.xymanager_service.service.TerminalService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +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; + + +@Api(value = "设备接口", tags = "设备接口相关") +@RestController +@Slf4j +public class TerminalPhotoController extends BaseController { + + @Autowired + TerminalService terminalService; + + @ApiOperation(value = "获取设备列表", notes = "获取设备列表接口", httpMethod = "POST") + @ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")}) + @RequestMapping("/getTerminalList") + @Log(title = "获取设备列表", type = "查询") + public ResponseReult getTerminalList() { + ServiceBody serviceBody = terminalService.getTerminalList(); + if (serviceBody.getCode() == ServiceStatus.SUCCESS) { + return ResponseReult.success(serviceBody.getData()); + } else { + 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("/addTerminal") + @Log(title = "新增设备列表", type = "新增") + public ResponseReult addTerminal(@RequestBody @Validated TerminalVo vo) { + ServiceBody serviceBody = terminalService.addTerminal(vo); + if (serviceBody.getCode() == ServiceStatus.SUCCESS) { + return ResponseReult.success(serviceBody.getData()); + } else { + 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("/updateTerminal") + @Log(title = "修改设备", type = "修改") + public ResponseReult updateTerminal(@RequestBody @Validated UpdateTerminalVo vo) { + ServiceBody serviceBody = terminalService.updateTerminal(vo); + if (serviceBody.getCode() == ServiceStatus.SUCCESS) { + return ResponseReult.success(serviceBody.getData()); + } else { + 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("/deleteTerminal") + @Log(title = "删除装置列表", type = "修改") + public ResponseReult deleteTerminal(@RequestBody @Validated TerminalIdVo vo) { + ServiceBody serviceBody = terminalService.deleteTerminal(vo); + if (serviceBody.getCode() == ServiceStatus.SUCCESS) { + return ResponseReult.success(serviceBody.getData()); + } else { + return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg()); + } + } + +} diff --git a/xymanager_admin/src/main/resources/application-test.yml b/xymanager_admin/src/main/resources/application-test.yml index e41e989..123236a 100644 --- a/xymanager_admin/src/main/resources/application-test.yml +++ b/xymanager_admin/src/main/resources/application-test.yml @@ -2,9 +2,9 @@ spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://192.168.200.63:3306/xymp?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + url: jdbc:mysql://47.96.238.157:3306/xymp?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 username: xymp - password: xymp@123 + password: Xymp@2023 type: com.alibaba.druid.pool.DruidDataSource #spring: # # 数据源配置 diff --git a/xymanager_admin/src/main/resources/log4j2.xml b/xymanager_admin/src/main/resources/log4j2.xml index dcb814e..401b3a7 100644 --- a/xymanager_admin/src/main/resources/log4j2.xml +++ b/xymanager_admin/src/main/resources/log4j2.xml @@ -21,8 +21,8 @@ value="%d{yyyy-MM-dd HH:mm:ss.SSS} %highlight{%-5level}[%thread] %style{%logger{36}}{cyan} : %msg%n"/> - - + + diff --git a/xymanager_admin/src/test/java/com/shxy/xymanager_admin/XymanagerAdminApplicationTests.java b/xymanager_admin/src/test/java/com/shxy/xymanager_admin/XymanagerAdminApplicationTests.java index 2f38242..174d210 100644 --- a/xymanager_admin/src/test/java/com/shxy/xymanager_admin/XymanagerAdminApplicationTests.java +++ b/xymanager_admin/src/test/java/com/shxy/xymanager_admin/XymanagerAdminApplicationTests.java @@ -1,6 +1,8 @@ package com.shxy.xymanager_admin; +import com.shxy.xymanager_common.entity.Lines; import com.shxy.xymanager_common.entity.Terminals; +import com.shxy.xymanager_dao.dao.LinesDao; import com.shxy.xymanager_dao.dao.TerminalsDao; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -14,27 +16,32 @@ class XymanagerAdminApplicationTests { @Autowired TerminalsDao terminalsDao; + @Autowired + LinesDao linesDao; + @Test void contextLoads() { - Terminals terminals = new Terminals(); - terminals.setBsIdentifier("dfsad"); - terminals.setBsManufacturer("dfsad"); - terminals.setBsProductionDate(new Date()); - terminals.setCmdid("38383993"); - terminals.setCreateTime(new Date()); - terminals.setUpdateTime(new Date()); - terminals.setDisplayName("uejejje"); - terminals.setEquipName("eisfsk"); - terminals.setEssentialInfoVersion("sfddjhfdshhsfd"); - terminals.setHasPan((byte) 0x01); - terminals.setLatitude((double) 200); - terminals.setModel("ewwrwe"); - terminals.setLongitude((double) 3003); - terminals.setOrgId((short) 1); - - int i = terminalsDao.insertSelective(terminals); - System.out.println(i +""); +// Terminals terminals = new Terminals(); +// terminals.setBsIdentifier("dfsad"); +// terminals.setBsManufacturer("dfsad"); +// terminals.setBsProductionDate(new Date()); +// terminals.setCmdid("38383993"); +// terminals.setCreateTime(new Date()); +// terminals.setUpdateTime(new Date()); +// terminals.setDisplayName("uejejje"); +// terminals.setEquipName("eisfsk"); +// terminals.setEssentialInfoVersion("sfddjhfdshhsfd"); +// terminals.setHasPan((byte) 0x01); +// terminals.setLatitude((double) 200); +// terminals.setModel("ewwrwe"); +// terminals.setLongitude((double) 3003); +// terminals.setOrgId((short) 1); +// +// int i = terminalsDao.insertSelective(terminals); +// System.out.println(i +""); + + } } diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/dto/LineAndTerminalDto.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/dto/LineAndTerminalDto.java new file mode 100644 index 0000000..08feea8 --- /dev/null +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/dto/LineAndTerminalDto.java @@ -0,0 +1,21 @@ +package com.shxy.xymanager_common.dto; + +import com.shxy.xymanager_common.entity.Terminals; +import lombok.Data; + +import java.util.List; + +@Data +public class LineAndTerminalDto { + + private Integer id; + + private String name; + + private String bsManufacturer; + + private Byte dyLevel; + + private List itemList; + +} diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/entity/TerminalChannels.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/entity/TerminalChannels.java index 97471ce..d7f47ca 100644 --- a/xymanager_common/src/main/java/com/shxy/xymanager_common/entity/TerminalChannels.java +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/entity/TerminalChannels.java @@ -1,7 +1,10 @@ package com.shxy.xymanager_common.entity; +import lombok.Data; + import java.io.Serializable; +@Data public class TerminalChannels implements Serializable { private Integer id; @@ -17,51 +20,4 @@ public class TerminalChannels implements Serializable { private static final long serialVersionUID = 1L; - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public Integer getTermId() { - return termId; - } - - public void setTermId(Integer termId) { - this.termId = termId; - } - - public Byte getChannelNo() { - return channelNo; - } - - public void setChannelNo(Byte channelNo) { - this.channelNo = channelNo; - } - - public String getChannelName() { - return channelName; - } - - public void setChannelName(String channelName) { - this.channelName = channelName == null ? null : channelName.trim(); - } - - public Integer getMaxResolutionWidth() { - return maxResolutionWidth; - } - - public void setMaxResolutionWidth(Integer maxResolutionWidth) { - this.maxResolutionWidth = maxResolutionWidth; - } - - public Integer getMaxResolutionHeight() { - return maxResolutionHeight; - } - - public void setMaxResolutionHeight(Integer maxResolutionHeight) { - this.maxResolutionHeight = maxResolutionHeight; - } } \ No newline at end of file diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/enums/CommonStatus.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/enums/CommonStatus.java new file mode 100644 index 0000000..8e6f7fe --- /dev/null +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/enums/CommonStatus.java @@ -0,0 +1,29 @@ +package com.shxy.xymanager_common.enums; + + +/** + * 常用状态 + * "0---删除 1---生效中" + * + * @author 晶晶 + */ +public enum CommonStatus { + DELETE("DELETE", 0), EFFECTIVE("EFFECTIVE", 1); + + private String name; + private Integer value; + + CommonStatus(String name, Integer value) { + this.name = name; + this.value = value; + } + + @Override + public String toString() { + return this.value + "_" + this.name; + } + + public Integer value() { + return this.value; + } +} diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/model/LineListModel.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/model/LineListModel.java new file mode 100644 index 0000000..918351d --- /dev/null +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/model/LineListModel.java @@ -0,0 +1,37 @@ +package com.shxy.xymanager_common.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 杆塔线路列表 + */ +@Data +@ApiModel(value = "获取杆塔线路列表", description = "获取杆塔线路列表信息") +public class LineListModel implements Serializable { + + @ApiModelProperty(value = "杆塔线路列表", example = "[]") + private List terminalBeanList; + + @Data + public static class LineBean { + + @ApiModelProperty(value = "线路编号", example = "123456") + private Integer id; + + @ApiModelProperty(value = "线路名称", example = "AAAA") + private String name; + + @ApiModelProperty(value = "单位", example = "123456") + private String bsManufacturer; + + @ApiModelProperty(value = "dyLevel", example = "123456") + private Byte dyLevel; + + } +} diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/model/LineTreeListModel.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/model/LineTreeListModel.java new file mode 100644 index 0000000..a7c7666 --- /dev/null +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/model/LineTreeListModel.java @@ -0,0 +1,60 @@ +package com.shxy.xymanager_common.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 线路树状图列表 + */ +@Data +@ApiModel(value = "获取线路树状图列表", description = "获取线路树状图列表信息") +public class LineTreeListModel implements Serializable { + + @ApiModelProperty(value = "杆塔线路列表", example = "[]") + private List linelist; + + @Data + public static class LineBean { + + @ApiModelProperty(value = "线路编号", example = "123456") + private Integer id; + + @ApiModelProperty(value = "线路名称", example = "AAAA") + private String name; + + @ApiModelProperty(value = "单位", example = "123456") + private String bsManufacturer; + + @ApiModelProperty(value = "dyLevel", example = "123456") + private Byte dyLevel; + + @ApiModelProperty(value = "装置信息", example = "123456") + private List itemList; + + } + + @Data + private static class TerminalBean { + + @ApiModelProperty(value = "杆塔编号", example = "123456") + private Integer towerid; + + @ApiModelProperty(value = "图像监测装置 ID(17 位编码)", example = "12345678") + private String cmdid; + + @ApiModelProperty(value = "装置名称", example = "名称名称") + private String equipName; + + @ApiModelProperty(value = "显示名", example = "名称名称") + private String displayName; + + @ApiModelProperty(value = "装置型号", example = "型号型号") + private String model; + + + } +} diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/LineIdVo.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/LineIdVo.java new file mode 100644 index 0000000..cd95081 --- /dev/null +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/LineIdVo.java @@ -0,0 +1,23 @@ +package com.shxy.xymanager_common.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import java.util.List; + +@Data +@ApiModel(value = "线路编号数组", description = "线路编号数组描述") +public class LineIdVo { + @NotEmpty(message = "不能传入空值") + @ApiModelProperty(value = "线路对象数组", required = true, example = "A0001") + private List list; + + @Data + private static class Item { + @ApiModelProperty(value = "线路名称", example = "名称名称") + private Integer id; + } +} diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/LineVo.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/LineVo.java new file mode 100644 index 0000000..5ea3bd1 --- /dev/null +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/LineVo.java @@ -0,0 +1,33 @@ +package com.shxy.xymanager_common.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import java.util.List; + +@Data +@ApiModel(value = "线路对象", description = "线路对象描述") +public class LineVo { + @NotEmpty(message = "不能传入空值") + @ApiModelProperty(value = "线路对象数组", required = true, example = "A0001") + private List list; + + @Data + public static class LineItem { + @ApiModelProperty(value = "线路名称", example = "名称名称") + @NotBlank(message = "线路名称不能缺少") + private String name; + + @ApiModelProperty(value = "单位", example = "单位") + @NotBlank(message = "单位不能缺少") + private String bsManufacturer; + + @ApiModelProperty(value = "dyLevel", example = "型号型号") + @NotBlank(message = "dyLevel不能缺少") + private Byte dyLevel; + } + +} diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalIdVo.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalIdVo.java new file mode 100644 index 0000000..1ecb54c --- /dev/null +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/TerminalIdVo.java @@ -0,0 +1,22 @@ +package com.shxy.xymanager_common.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotEmpty; +import java.util.List; + +@Data +@ApiModel(value = "装置编号数组", description = "装置编号数组描述") +public class TerminalIdVo { + @NotEmpty(message = "不能传入空值") + @ApiModelProperty(value = "装置对象数组", required = true, example = "A0001") + private List list; + + @Data + private static class Item { + @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 8bddf3b..de9c6ed 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 @@ -5,65 +5,74 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; import java.util.Date; +import java.util.List; @Data -@ApiModel(value = "设备信息对象", description = "设备信息对象描述") +@ApiModel(value = "装置信息对象", description = "设备信息对象描述") public class TerminalVo { + @NotEmpty(message = "不能传入空值") + @ApiModelProperty(value = "设备对象数组", example = "A0001") + private List list; - @ApiModelProperty(value = "线路编号", example = "123456") - @NotBlank(message = "线路编号不能缺少") - private Integer lineid; + @Data + private static class TerminalItem { + @ApiModelProperty(value = "线路编号", example = "123456") + @NotBlank(message = "线路编号不能缺少") + private Integer lineid; - @ApiModelProperty(value = "杆塔编号", example = "123456") - @NotBlank(message = "杆塔编号不能缺少") - private Integer towerid; + @ApiModelProperty(value = "杆塔编号", example = "123456") + @NotBlank(message = "杆塔编号不能缺少") + private Integer towerid; - @ApiModelProperty(value = "图像监测装置 ID(17 位编码)", example = "12345678") - @NotBlank(message = "图像监测装置不能缺少") - private String cmdid; + @ApiModelProperty(value = "图像监测装置 ID(17 位编码)", example = "12345678") + @NotBlank(message = "图像监测装置不能缺少") + private String cmdid; - @ApiModelProperty(value = "原始 ID,各厂家内部识别号", example = "12345678") - @NotBlank(message = "各厂家内部识别号不能缺少") - private Short orgId; + @ApiModelProperty(value = "原始 ID,各厂家内部识别号", example = "12345678") + @NotBlank(message = "各厂家内部识别号不能缺少") + private Short orgId; - @ApiModelProperty(value = "装置名称", example = "名称名称") - @NotBlank(message = "装置名称不能缺少") - private String equipName; + @ApiModelProperty(value = "装置名称", example = "名称名称") + @NotBlank(message = "装置名称不能缺少") + private String equipName; - @ApiModelProperty(value = "显示名", example = "名称名称") - @NotBlank(message = "显示名不能缺少") - private String displayName; + @ApiModelProperty(value = "显示名", example = "名称名称") + @NotBlank(message = "显示名不能缺少") + private String displayName; - @ApiModelProperty(value = "装置型号", example = "型号型号") - @NotBlank(message = "装置型号不能缺少") - private String model; + @ApiModelProperty(value = "装置型号", example = "型号型号") + @NotBlank(message = "装置型号不能缺少") + private String model; - @ApiModelProperty(value = "装置基本信息版本号", example = "型号型号") - @NotBlank(message = "装置基本信息版本号不能缺少") - private String essentialInfoVersion; + @ApiModelProperty(value = "装置基本信息版本号", example = "型号型号") + @NotBlank(message = "装置基本信息版本号不能缺少") + private String essentialInfoVersion; - @ApiModelProperty(value = "是否带云台", example = " 0: 不带云台 1:带云台") - @NotBlank(message = "是否带云台不能缺少") - private Byte hasPan; + @ApiModelProperty(value = "是否带云台", example = " 0: 不带云台 1:带云台") + @NotBlank(message = "是否带云台不能缺少") + private Byte hasPan; - @ApiModelProperty(value = "生产厂家", example = "生产厂家") - @NotBlank(message = "生产厂家不能缺少") - private String bsManufacturer; + @ApiModelProperty(value = "生产厂家", example = "生产厂家") + @NotBlank(message = "生产厂家不能缺少") + private String bsManufacturer; - @ApiModelProperty(value = "生产日期", example = "2022-06-12") - @NotBlank(message = "生产日期不能缺少") - private Date bsProductionDate; + @ApiModelProperty(value = "生产日期", example = "2022-06-12") + @NotBlank(message = "生产日期不能缺少") + private Date bsProductionDate; - @ApiModelProperty(value = "出厂编号", example = "123456") - @NotBlank(message = "出厂编号不能缺少") - private String bsIdentifier; + @ApiModelProperty(value = "出厂编号", example = "123456") + @NotBlank(message = "出厂编号不能缺少") + private String bsIdentifier; - @ApiModelProperty(value = "纬度", example = "21321") - @NotBlank(message = "纬度不能缺少") - private Double latitude; + @ApiModelProperty(value = "纬度", example = "21321") + @NotBlank(message = "纬度不能缺少") + private Double latitude; + + @ApiModelProperty(value = "经度", example = "213") + @NotBlank(message = "经度不能缺少") + private Double longitude; + } - @ApiModelProperty(value = "经度", example = "213") - @NotBlank(message = "经度不能缺少") - private Double longitude; } diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/UpdateLineVo.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/UpdateLineVo.java new file mode 100644 index 0000000..8c609df --- /dev/null +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/UpdateLineVo.java @@ -0,0 +1,31 @@ +package com.shxy.xymanager_common.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import java.util.List; + +@Data +@ApiModel(value = "修改线路对象", description = "修改线路对象描述") +public class UpdateLineVo { + + @ApiModelProperty(value = "线路编号", example = "123456") + @NotBlank(message = "线路编号不能缺少") + private Integer id; + + @ApiModelProperty(value = "线路名称", example = "名称名称") + @NotBlank(message = "线路名称不能缺少") + private String name; + + @ApiModelProperty(value = "单位", example = "单位") + @NotBlank(message = "单位不能缺少") + private String bsManufacturer; + + @ApiModelProperty(value = "dyLevel", example = "型号型号") + @NotBlank(message = "dyLevel不能缺少") + private Byte dyLevel; + +} diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/UpdateTerminalVo.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/UpdateTerminalVo.java new file mode 100644 index 0000000..79f0b46 --- /dev/null +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/UpdateTerminalVo.java @@ -0,0 +1,77 @@ +package com.shxy.xymanager_common.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import java.util.Date; +import java.util.List; + +@Data +@ApiModel(value = "修改装置信息对象", description = "修改设备信息对象描述") +public class UpdateTerminalVo { + + @ApiModelProperty(value = "装置编号", example = "123456") + @NotBlank(message = "装置编号不能缺少") + private Integer id; + + + @ApiModelProperty(value = "线路编号", example = "123456") + @NotBlank(message = "线路编号不能缺少") + private Integer lineid; + + @ApiModelProperty(value = "杆塔编号", example = "123456") + @NotBlank(message = "杆塔编号不能缺少") + private Integer towerid; + + @ApiModelProperty(value = "图像监测装置 ID(17 位编码)", example = "12345678") + @NotBlank(message = "图像监测装置不能缺少") + private String cmdid; + + @ApiModelProperty(value = "原始 ID,各厂家内部识别号", example = "12345678") + @NotBlank(message = "各厂家内部识别号不能缺少") + private Short orgId; + + @ApiModelProperty(value = "装置名称", example = "名称名称") + @NotBlank(message = "装置名称不能缺少") + private String equipName; + + @ApiModelProperty(value = "显示名", example = "名称名称") + @NotBlank(message = "显示名不能缺少") + private String displayName; + + @ApiModelProperty(value = "装置型号", example = "型号型号") + @NotBlank(message = "装置型号不能缺少") + private String model; + + @ApiModelProperty(value = "装置基本信息版本号", example = "型号型号") + @NotBlank(message = "装置基本信息版本号不能缺少") + private String essentialInfoVersion; + + @ApiModelProperty(value = "是否带云台", example = " 0: 不带云台 1:带云台") + @NotBlank(message = "是否带云台不能缺少") + private Byte hasPan; + + @ApiModelProperty(value = "生产厂家", example = "生产厂家") + @NotBlank(message = "生产厂家不能缺少") + private String bsManufacturer; + + @ApiModelProperty(value = "生产日期", example = "2022-06-12") + @NotBlank(message = "生产日期不能缺少") + private Date bsProductionDate; + + @ApiModelProperty(value = "出厂编号", example = "123456") + @NotBlank(message = "出厂编号不能缺少") + private String bsIdentifier; + + @ApiModelProperty(value = "纬度", example = "21321") + @NotBlank(message = "纬度不能缺少") + private Double latitude; + + @ApiModelProperty(value = "经度", example = "213") + @NotBlank(message = "经度不能缺少") + private Double longitude; + +} diff --git a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalsDao.java b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalsDao.java index 9345ef5..706678a 100644 --- a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalsDao.java +++ b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalsDao.java @@ -1,18 +1,23 @@ package com.shxy.xymanager_dao.dao; import com.shxy.xymanager_common.entity.Terminals; +import org.apache.ibatis.annotations.Param; +import java.util.Date; import java.util.List; public interface TerminalsDao { - int insertSelective(Terminals record); + List selectAll(@Param("status") Integer status); - List selectAll(); + int insertList(@Param("list") List record,@Param("status") Integer status,@Param("createat") Date create,@Param("updateat") Date update); + + int deleteById(@Param("list") List record, @Param("status") Integer status,@Param("updateat") Date update); Terminals selectByPrimaryKey(Integer id); - int updateByPrimaryKeySelective(Terminals record); + int updateByPrimaryKeySelective(@Param("data") Terminals record,@Param("updateat") Date update); int updateByPrimaryKey(Terminals record); + } \ No newline at end of file diff --git a/xymanager_dao/src/main/resources/generatorConfig.xml b/xymanager_dao/src/main/resources/generatorConfig.xml index 0ba1763..4f9cbde 100644 --- a/xymanager_dao/src/main/resources/generatorConfig.xml +++ b/xymanager_dao/src/main/resources/generatorConfig.xml @@ -17,9 +17,9 @@ + password="Xymp@2023"> - + @@ -52,54 +53,64 @@ - - -
- - -
- - -
- - -
- - -
- - -
- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + \ No newline at end of file diff --git a/xymanager_dao/src/main/resources/mappers/TerminalsDao.xml b/xymanager_dao/src/main/resources/mappers/TerminalsDao.xml index d0afa6d..7d91d04 100644 --- a/xymanager_dao/src/main/resources/mappers/TerminalsDao.xml +++ b/xymanager_dao/src/main/resources/mappers/TerminalsDao.xml @@ -17,6 +17,7 @@ + @@ -30,6 +31,7 @@ select from terminals + where status = #{status}