From d7f0900a83f9b61ae5533c3c2295c2011cdb5133 Mon Sep 17 00:00:00 2001 From: liuguijing <123456> Date: Mon, 15 May 2023 17:28:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A3=85=E7=BD=AE=E5=88=86=E8=BE=A8=E7=8E=87?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/TermSetController.java | 18 +++++++--- .../controller/TerminalPhotoController.java | 3 +- .../xymanager_common/entity/Resolution.java | 16 +++++++++ .../model/ResolutionModel.java | 31 ++++++++++++++++ .../dao/TerminalResolutionDao.java | 14 ++++++++ .../src/main/resources/generatorConfig.xml | 15 +++++--- .../mappers/TerminalResolutionDao.xml | 36 +++++++++++++++++++ .../impl/TermSetServiceImpl.java | 22 ++++++++++++ .../service/TermSetService.java | 10 +++--- 9 files changed, 152 insertions(+), 13 deletions(-) create mode 100644 xymanager_common/src/main/java/com/shxy/xymanager_common/entity/Resolution.java create mode 100644 xymanager_common/src/main/java/com/shxy/xymanager_common/model/ResolutionModel.java create mode 100644 xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalResolutionDao.java create mode 100644 xymanager_dao/src/main/resources/mappers/TerminalResolutionDao.xml diff --git a/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TermSetController.java b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TermSetController.java index 0c670aa..8082e2a 100644 --- a/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TermSetController.java +++ b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TermSetController.java @@ -5,10 +5,7 @@ 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.DyLineTreeAndChannelListModel; -import com.shxy.xymanager_common.model.TerminalAllChannelListModel; -import com.shxy.xymanager_common.model.TerminalChannelListModel; -import com.shxy.xymanager_common.model.TerminalChannelMapperListModel; +import com.shxy.xymanager_common.model.*; import com.shxy.xymanager_common.vo.*; import com.shxy.xymanager_service.service.TermSetService; import com.shxy.xymanager_service.service.TerminalChannelService; @@ -44,4 +41,17 @@ public class TermSetController 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("/getResolutionList") + @Log(title = "获取分辨率代码", type = "查询") + public ResponseReult getResolutionList() { + ServiceBody serviceBody = termSetService.getResolutionList(); + 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 index 0704d54..9613cb3 100644 --- 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 @@ -50,7 +50,8 @@ public class TerminalPhotoController extends BaseController { @RequestMapping("/getLatestPhoto") @Log(title = "获取最新图片", type = "查询") public ResponseReult getLatestPhoto(@RequestBody @Validated TerminalPhotoVo vo) { - ServiceBody serviceBody = terminalPhotoService.getLatestPhoto(vo); + ServiceBody latestPhoto = terminalPhotoService.getLatestPhoto(vo); + ServiceBody serviceBody = latestPhoto; if (serviceBody.getCode() == ServiceStatus.SUCCESS) { return ResponseReult.success(serviceBody.getData()); } else { diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/entity/Resolution.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/entity/Resolution.java new file mode 100644 index 0000000..6d1118f --- /dev/null +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/entity/Resolution.java @@ -0,0 +1,16 @@ +package com.shxy.xymanager_common.entity; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class Resolution implements Serializable { + + private Integer id; + + private String name; + + private static final long serialVersionUID = 1L; + +} \ No newline at end of file diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/model/ResolutionModel.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/model/ResolutionModel.java new file mode 100644 index 0000000..39526a9 --- /dev/null +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/model/ResolutionModel.java @@ -0,0 +1,31 @@ +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 ResolutionModel implements Serializable { + @ApiModelProperty(value = "分辨率列表", example = "[]") + private List list; + + @Data + public static class ResolutionBean { + + @ApiModelProperty(value = "编号", example = "120") + private Integer id; + @ApiModelProperty(value = "名称编号", example = "120") + private String name; + + } + + private static final long serialVersionUID = 1L; + +} \ No newline at end of file diff --git a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalResolutionDao.java b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalResolutionDao.java new file mode 100644 index 0000000..e9cfd52 --- /dev/null +++ b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalResolutionDao.java @@ -0,0 +1,14 @@ +package com.shxy.xymanager_dao.dao; + +import com.shxy.xymanager_common.entity.Resolution; + +import java.util.List; + +public interface TerminalResolutionDao { + + List selectAllList(); + + int insert(Resolution record); + + int insertSelective(Resolution 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 6d7baa8..488c64b 100644 --- a/xymanager_dao/src/main/resources/generatorConfig.xml +++ b/xymanager_dao/src/main/resources/generatorConfig.xml @@ -144,13 +144,20 @@ - + + + + + + + +
- \ No newline at end of file diff --git a/xymanager_dao/src/main/resources/mappers/TerminalResolutionDao.xml b/xymanager_dao/src/main/resources/mappers/TerminalResolutionDao.xml new file mode 100644 index 0000000..19bf807 --- /dev/null +++ b/xymanager_dao/src/main/resources/mappers/TerminalResolutionDao.xml @@ -0,0 +1,36 @@ + + + + + + + + + + insert into resolution (id, name) + values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}) + + + insert into resolution + + + id, + + + name, + + + + + #{id,jdbcType=INTEGER}, + + + #{name,jdbcType=VARCHAR}, + + + + \ No newline at end of file diff --git a/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TermSetServiceImpl.java b/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TermSetServiceImpl.java index ac9cfd3..e68c1fb 100644 --- a/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TermSetServiceImpl.java +++ b/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TermSetServiceImpl.java @@ -1,15 +1,22 @@ package com.shxy.xymanager_service.impl; +import cn.hutool.core.bean.BeanUtil; import com.shxy.xymanager_common.bean.ServiceBody; import com.shxy.xymanager_common.constant.Constants; +import com.shxy.xymanager_common.entity.Resolution; import com.shxy.xymanager_common.exception.Asserts; +import com.shxy.xymanager_common.model.ResolutionModel; import com.shxy.xymanager_common.util.ProcessExecUtils; import com.shxy.xymanager_common.vo.TerminalIdVo; import com.shxy.xymanager_common.vo.TerminalReqPhotoTimeVo; +import com.shxy.xymanager_dao.dao.TerminalResolutionDao; +import com.shxy.xymanager_dao.dao.TowerDao; import com.shxy.xymanager_service.service.TermSetService; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; /** @@ -21,6 +28,8 @@ import org.springframework.stereotype.Service; @Service public class TermSetServiceImpl implements TermSetService { + @Autowired + private TerminalResolutionDao terminalResolutionDao; @Override public ServiceBody alarmMark(TerminalIdVo vo) { @@ -37,5 +46,18 @@ public class TermSetServiceImpl implements TermSetService { return Asserts.success(Integer.parseInt(Constants.REQUEST_ID.toString())); } + /** + * 获取分辨率列表 + * @return + */ + @Override + public ServiceBody getResolutionList() { + ResolutionModel model = new ResolutionModel(); + List beans = terminalResolutionDao.selectAllList(); + List list = BeanUtil.copyToList(beans, ResolutionModel.ResolutionBean.class); + model.setList(list); + return Asserts.success(model); + } + } diff --git a/xymanager_service/src/main/java/com/shxy/xymanager_service/service/TermSetService.java b/xymanager_service/src/main/java/com/shxy/xymanager_service/service/TermSetService.java index 42bab6a..8ec13d9 100644 --- a/xymanager_service/src/main/java/com/shxy/xymanager_service/service/TermSetService.java +++ b/xymanager_service/src/main/java/com/shxy/xymanager_service/service/TermSetService.java @@ -1,10 +1,7 @@ package com.shxy.xymanager_service.service; import com.shxy.xymanager_common.bean.ServiceBody; -import com.shxy.xymanager_common.model.DyLineTreeAndChannelListModel; -import com.shxy.xymanager_common.model.TerminalAllChannelListModel; -import com.shxy.xymanager_common.model.TerminalChannelListModel; -import com.shxy.xymanager_common.model.TerminalChannelMapperListModel; +import com.shxy.xymanager_common.model.*; import com.shxy.xymanager_common.vo.*; /** @@ -24,4 +21,9 @@ public interface TermSetService { ServiceBody selectPhotoTimeGet(TerminalIdVo vo); + /** + * 获取所有分辨率列表 + * @return + */ + ServiceBody getResolutionList(); }