欣影管理平台线路和装置接口完善

jni
liuguijing 2 years ago
parent 242be37469
commit 4c8c44ae18

@ -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<TerminalListModel> getChannelList() {
ServiceBody<TerminalListModel> serviceBody = terminalService.getTerminalList();
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
}
}
}

@ -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<LineTreeListModel> getLineTreeList() {
ServiceBody<LineTreeListModel> 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<LineListModel> getLineList() {
ServiceBody<LineListModel> 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<String> addLine(@RequestBody @Validated LineVo vo) {
ServiceBody<String> 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<String> deleteLine(@RequestBody @Validated LineIdVo vo) {
ServiceBody<String> 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<String> updateLine(@RequestBody @Validated UpdateLineVo vo) {
ServiceBody<String> serviceBody = lineService.updateLine(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
}
}
}

@ -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<String> addTerminal(@RequestBody @Validated TerminalVo vo) {
ServiceBody<String> 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<String> updateTerminal(@RequestBody @Validated UpdateTerminalVo vo) {
ServiceBody<String> 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<String> deleteTerminal(@RequestBody @Validated TerminalIdVo vo) {
ServiceBody<String> serviceBody = terminalService.deleteTerminal(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
}
}
}

@ -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<TerminalListModel> getTerminalList() {
ServiceBody<TerminalListModel> 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<String> addTerminal(@RequestBody @Validated TerminalVo vo) {
ServiceBody<String> 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<String> updateTerminal(@RequestBody @Validated UpdateTerminalVo vo) {
ServiceBody<String> 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<String> deleteTerminal(@RequestBody @Validated TerminalIdVo vo) {
ServiceBody<String> serviceBody = terminalService.deleteTerminal(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
}
}
}

@ -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:
# # 数据源配置

@ -21,8 +21,8 @@
value="%d{yyyy-MM-dd HH:mm:ss.SSS} %highlight{%-5level}[%thread] %style{%logger{36}}{cyan} : %msg%n"/>
<!-- 定义日志存储的路径,不要配置相对路径 -->
<property name="FILE_PATH" value="/usr/local/home/xymanagerbackend/logs"/>
<property name="FILE_NAME" value="pigeon"/>
<property name="FILE_PATH" value="/usr/local/home/manager/logs"/>
<property name="FILE_NAME" value="xymanagerbackendlog"/>
</Properties>
<appenders>

@ -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 +"");
}
}

@ -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<Terminals> itemList;
}

@ -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;
}
}

@ -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;
}
}

@ -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<LineBean> 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;
}
}

@ -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<LineBean> 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<TerminalBean> itemList;
}
@Data
private static class TerminalBean {
@ApiModelProperty(value = "杆塔编号", example = "123456")
private Integer towerid;
@ApiModelProperty(value = "图像监测装置 ID17 位编码)", example = "12345678")
private String cmdid;
@ApiModelProperty(value = "装置名称", example = "名称名称")
private String equipName;
@ApiModelProperty(value = "显示名", example = "名称名称")
private String displayName;
@ApiModelProperty(value = "装置型号", example = "型号型号")
private String model;
}
}

@ -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<Item> list;
@Data
private static class Item {
@ApiModelProperty(value = "线路名称", example = "名称名称")
private Integer id;
}
}

@ -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<LineItem> 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;
}
}

@ -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<Item> list;
@Data
private static class Item {
@ApiModelProperty(value = "装置编号", example = "123455")
private Integer id;
}
}

@ -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<TerminalItem> 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 = "图像监测装置 ID17 位编码)", example = "12345678")
@NotBlank(message = "图像监测装置不能缺少")
private String cmdid;
@ApiModelProperty(value = "图像监测装置 ID17 位编码)", 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;
}

@ -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;
}

@ -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 = "图像监测装置 ID17 位编码)", 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;
}

@ -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<Terminals> selectAll(@Param("status") Integer status);
List<Terminals> selectAll();
int insertList(@Param("list") List<Terminals> record,@Param("status") Integer status,@Param("createat") Date create,@Param("updateat") Date update);
int deleteById(@Param("list") List<Terminals> 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);
}

@ -17,9 +17,9 @@
<!-- 数据库链接URL、用户名、密码 -->
<!-- driverClass="com.mysql.jdbc.Driver"-->
<jdbcConnection driverClass="com.mysql.cj.jdbc.Driver"
connectionURL="jdbc:mysql://192.168.200.63:3306/xymp?userUnicode=true&amp;characterEncoding=utf8"
connectionURL="jdbc:mysql://47.96.238.157:3306/xymp?userUnicode=true&amp;characterEncoding=utf8"
userId="xymp"
password="xymp@123">
password="Xymp@2023">
</jdbcConnection>
<!--
@ -34,7 +34,8 @@
生成model模型对应的包路径以及文件存放路径(targetProject)targetProject可以指定具体的路径,如./src/main/java
也可以使用“MAVEN”来自动生成这样生成的代码会在target/generatord-source目录下
-->
<javaModelGenerator targetPackage="com.shxy.xymanager_common.entity" targetProject="D:/Project/JAVAProject/XyManagerBackend/xymanager_common/src/main/java">
<javaModelGenerator targetPackage="com.shxy.xymanager_common.entity"
targetProject="D:/Project/JAVAProject/XyManagerBackend/xymanager_common/src/main/java">
<property name="enableSubPackages" value="true"/>
<!-- 从数据库返回的值被清理前后的空格 -->
<property name="trimStrings" value="true"/>
@ -52,54 +53,64 @@
</javaClientGenerator>
<!-- &lt;!&ndash; 列出要生成代码的所有表这里配置的是不生成Example文件 &ndash;&gt;-->
<table tableName="terminals"
domainObjectName="Terminals"
mapperName="TerminalsDao"
enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
enableSelectByExample="false" selectByExampleQueryId="false">
<!-- <property name="useActualColumnNames" value="false"/>-->
</table>
<table tableName="terminal_channels"
domainObjectName="TerminalChannels"
mapperName="TerminalChannelsDao"
enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
enableSelectByExample="false" selectByExampleQueryId="false">
<!-- <property name="useActualColumnNames" value="false"/>-->
</table>
<table tableName="terminal_params"
domainObjectName="TerminalParams"
mapperName="TerminalParamsDao"
enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
enableSelectByExample="false" selectByExampleQueryId="false">
<!-- <property name="useActualColumnNames" value="false"/>-->
</table>
<table tableName="terminal_photos"
domainObjectName="TerminalPhoto"
mapperName="TerminalPhotoDao"
enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
enableSelectByExample="false" selectByExampleQueryId="false">
<!-- <property name="useActualColumnNames" value="false"/>-->
</table>
<table tableName="terminal_presets"
domainObjectName="TerminalPresets"
mapperName="TerminalPresetsDao"
enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
enableSelectByExample="false" selectByExampleQueryId="false">
<!-- <property name="useActualColumnNames" value="false"/>-->
</table>
<table tableName="terminal_schedule"
domainObjectName="TerminalSchedule"
mapperName="TerminalScheduleDao"
enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
enableSelectByExample="false" selectByExampleQueryId="false">
<!-- <property name="useActualColumnNames" value="false"/>-->
</table>
<table tableName="terminal_status"
domainObjectName="TerminalStatus"
mapperName="TerminalStatusDao"
<!-- <table tableName="terminals"-->
<!-- domainObjectName="Terminals"-->
<!-- mapperName="TerminalsDao"-->
<!-- enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
<!-- enableSelectByExample="false" selectByExampleQueryId="false">-->
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<!-- <table tableName="terminal_channels"-->
<!-- domainObjectName="TerminalChannels"-->
<!-- mapperName="TerminalChannelsDao"-->
<!-- enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
<!-- enableSelectByExample="false" selectByExampleQueryId="false">-->
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<!-- <table tableName="terminal_params"-->
<!-- domainObjectName="TerminalParams"-->
<!-- mapperName="TerminalParamsDao"-->
<!-- enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
<!-- enableSelectByExample="false" selectByExampleQueryId="false">-->
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<!-- <table tableName="terminal_photos"-->
<!-- domainObjectName="TerminalPhoto"-->
<!-- mapperName="TerminalPhotoDao"-->
<!-- enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
<!-- enableSelectByExample="false" selectByExampleQueryId="false">-->
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<!-- <table tableName="terminal_presets"-->
<!-- domainObjectName="TerminalPresets"-->
<!-- mapperName="TerminalPresetsDao"-->
<!-- enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
<!-- enableSelectByExample="false" selectByExampleQueryId="false">-->
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<!-- <table tableName="terminal_schedule"-->
<!-- domainObjectName="TerminalSchedule"-->
<!-- mapperName="TerminalScheduleDao"-->
<!-- enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
<!-- enableSelectByExample="false" selectByExampleQueryId="false">-->
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<!-- <table tableName="terminal_status"-->
<!-- domainObjectName="TerminalStatus"-->
<!-- mapperName="TerminalStatusDao"-->
<!-- enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
<!-- enableSelectByExample="false" selectByExampleQueryId="false">-->
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<table tableName="lines"
domainObjectName="Lines"
mapperName="LinesDao"
enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
enableSelectByExample="false" selectByExampleQueryId="false">
<!-- <property name="useActualColumnNames" value="false"/>-->
</table>
</context>
</generatorConfiguration>

@ -17,6 +17,7 @@
<result column="bs_identifier" jdbcType="VARCHAR" property="bsIdentifier"/>
<result column="latitude" jdbcType="DOUBLE" property="latitude"/>
<result column="longitude" jdbcType="DOUBLE" property="longitude"/>
<result column="status" jdbcType="INTEGER" property="status"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap>
@ -30,6 +31,7 @@
select
<include refid="Base_Column_List"/>
from terminals
where status = #{status}
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
@ -135,53 +137,67 @@
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.Terminals">
<insert id="insertList">
insert into terminals
(line_id,tower_id,cmdid, org_id, equip_name, display_name, model, essential_info_version, has_pan,
bs_manufacturer, bs_production_date, bs_identifier, latitude, longitude,status, create_time,
update_time)
VALUES
<foreach collection="list" item="item" separator=",">
(#{item.lineid},#{item.towerid},#{item.cmdid},
#{item.orgId},#{item.equipName},#{item.displayName},
#{item.model},#{item.essentialInfoVersion},#{item.hasPan},
#{item.bsManufacturer},#{item.bsProductionDate},#{item.bsIdentifier},
#{item.latitude},#{item.longitude},#{status},
#{createat},#{updateat})
</foreach>
</insert>
<update id="updateByPrimaryKeySelective">
update terminals
<set>
<if test="cmdid != null">
cmdid = #{cmdid,jdbcType=VARCHAR},
<if test="data.cmdid != null">
cmdid = #{data.cmdid},
</if>
<if test="orgId != null">
org_id = #{orgId,jdbcType=SMALLINT},
<if test="data.orgId != null">
org_id = #{data.orgId,jdbcType=SMALLINT},
</if>
<if test="equipName != null">
equip_name = #{equipName,jdbcType=VARCHAR},
<if test="data.equipName != null">
equip_name = #{data.equipName,jdbcType=VARCHAR},
</if>
<if test="displayName != null">
display_name = #{displayName,jdbcType=VARCHAR},
</if>
<if test="model != null">
model = #{model,jdbcType=VARCHAR},
<if test="data.displayName != null">
display_name = #{data.displayName,jdbcType=VARCHAR},
</if>
<if test="essentialInfoVersion != null">
essential_info_version = #{essentialInfoVersion,jdbcType=VARCHAR},
<if test="data.model != null">
model = #{data.model,jdbcType=VARCHAR},
</if>
<if test="hasPan != null">
has_pan = #{hasPan,jdbcType=TINYINT},
<if test="data.essentialInfoVersion != null">
essential_info_version = #{data.essentialInfoVersion,jdbcType=VARCHAR},
</if>
<if test="bsManufacturer != null">
bs_manufacturer = #{bsManufacturer,jdbcType=VARCHAR},
<if test="data.hasPan != null">
has_pan = #{data.hasPan,jdbcType=TINYINT},
</if>
<if test="bsProductionDate != null">
bs_production_date = #{bsProductionDate,jdbcType=DATE},
<if test="data.bsManufacturer != null">
bs_manufacturer = #{data.bsManufacturer,jdbcType=VARCHAR},
</if>
<if test="bsIdentifier != null">
bs_identifier = #{bsIdentifier,jdbcType=VARCHAR},
<if test="data.bsProductionDate != null">
bs_production_date = #{data.bsProductionDate,jdbcType=DATE},
</if>
<if test="latitude != null">
latitude = #{latitude,jdbcType=DOUBLE},
<if test="data.bsIdentifier != null">
bs_identifier = #{data.bsIdentifier,jdbcType=VARCHAR},
</if>
<if test="longitude != null">
longitude = #{longitude,jdbcType=DOUBLE},
<if test="data.latitude != null">
latitude = #{data.latitude,jdbcType=DOUBLE},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
<if test="data.longitude != null">
longitude = #{data.longitude,jdbcType=DOUBLE},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
<if test="updateat != null">
update_time = #{updateat,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
where id = #{data.id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.Terminals">
update terminals
@ -197,8 +213,7 @@
bs_identifier = #{bsIdentifier,jdbcType=VARCHAR},
latitude = #{latitude,jdbcType=DOUBLE},
longitude = #{longitude,jdbcType=DOUBLE},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
update_time = #{updateat}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

@ -0,0 +1,133 @@
package com.shxy.xymanager_service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.collection.CollectionUtil;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.dto.LineAndTerminalDto;
import com.shxy.xymanager_common.entity.Lines;
import com.shxy.xymanager_common.enums.CommonStatus;
import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.LineListModel;
import com.shxy.xymanager_common.model.LineTreeListModel;
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_dao.dao.LinesDao;
import com.shxy.xymanager_service.service.LineService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* 线
*
* @author
*/
@Slf4j
@Service
public class LineServiceImpl implements LineService {
@Autowired
private LinesDao linesDao;
/**
* 线
*
* @return
*/
@Override
public ServiceBody<LineTreeListModel> getLineTreeList() {
LineTreeListModel model = new LineTreeListModel();
List<LineAndTerminalDto> list = linesDao.selectLineAndTerminalList(CommonStatus.EFFECTIVE.value());
boolean empty = CollectionUtil.isEmpty(list);
if (empty) {
model.setLinelist(new ArrayList<>());
} else {
List<LineTreeListModel.LineBean> lineBeans = BeanUtil.copyToList(list, LineTreeListModel.LineBean.class, CopyOptions.create().ignoreCase());
model.setLinelist(lineBeans);
}
return Asserts.success(model);
}
/**
* 线
*
* @return
*/
@Override
public ServiceBody<LineListModel> getLineList() {
LineListModel model = new LineListModel();
List<Lines> terminals = linesDao.selectAll(CommonStatus.EFFECTIVE.value());
boolean empty = CollectionUtil.isEmpty(terminals);
if (empty) {
model.setTerminalBeanList(new ArrayList<>());
} else {
List<LineListModel.LineBean> list = BeanUtil.copyToList(terminals, LineListModel.LineBean.class, CopyOptions.create().ignoreCase());
model.setTerminalBeanList(list);
}
return Asserts.success(model);
}
/**
* 线
*
* @param vo
* @return
*/
@Override
public ServiceBody<String> addLine(LineVo vo) {
List<Lines> lines = BeanUtil.copyToList(vo.getList(), Lines.class);
Date date = new Date();
int i = linesDao.insertList(lines,CommonStatus.EFFECTIVE.value(), date,date);
if (i != 0) {
return Asserts.success("录入成功");
} else {
return Asserts.error("录入失败");
}
}
/**
* 线
*
* @param vo
* @return
*/
@Override
public ServiceBody<String> deleteLine(LineIdVo vo) {
List<Lines> lines = BeanUtil.copyToList(vo.getList(), Lines.class);
Date date = new Date();
int i = linesDao.deleteById(lines,CommonStatus.DELETE.value(), date);
if (i != 0) {
return Asserts.success("删除成功");
} else {
return Asserts.error("删除失败");
}
}
/**
* 线
*
* @param vo
* @return
*/
@Override
public ServiceBody<String> updateLine(UpdateLineVo vo) {
Lines lines = new Lines();
BeanUtil.copyProperties(vo, Lines.class);
int i = linesDao.updateByPrimaryKeySelective(lines,new Date());
if (i != 0) {
return Asserts.success("删除成功");
} else {
return Asserts.error("删除失败");
}
}
}

@ -0,0 +1,28 @@
package com.shxy.xymanager_service.impl;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.vo.TerminalVo;
import com.shxy.xymanager_service.service.TerminalChannelService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
*
*
*/
@Service
@Slf4j
public class TerminalChannelServiceImpl implements TerminalChannelService {
@Override
public ServiceBody<TerminalListModel> getChannelTreeList() {
return null;
}
@Override
public ServiceBody<String> addTerminal(TerminalVo terminalVo) {
return null;
}
}

@ -0,0 +1,28 @@
package com.shxy.xymanager_service.impl;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.vo.TerminalVo;
import com.shxy.xymanager_service.service.TerminalChannelService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
*
*
*/
@Service
@Slf4j
public class TerminalParamsServiceImpl implements TerminalChannelService {
@Override
public ServiceBody<TerminalListModel> getChannelTreeList() {
return null;
}
@Override
public ServiceBody<String> addTerminal(TerminalVo terminalVo) {
return null;
}
}

@ -0,0 +1,30 @@
package com.shxy.xymanager_service.impl;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.vo.TerminalVo;
import com.shxy.xymanager_service.service.TerminalChannelService;
import com.shxy.xymanager_service.service.TerminalPhotoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
*
*
*/
@Service
@Slf4j
public class TerminalPhotoServiceImpl implements TerminalPhotoService {
@Override
public ServiceBody<TerminalListModel> getTerminalList() {
return null;
}
@Override
public ServiceBody<String> addTerminal(TerminalVo terminalVo) {
return null;
}
}

@ -0,0 +1,30 @@
package com.shxy.xymanager_service.impl;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.vo.TerminalVo;
import com.shxy.xymanager_service.service.TerminalChannelService;
import com.shxy.xymanager_service.service.TerminalPresetsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
*
*
*/
@Service
@Slf4j
public class TerminalPresetServiceImpl implements TerminalPresetsService {
@Override
public ServiceBody<TerminalListModel> getTerminalList() {
return null;
}
@Override
public ServiceBody<String> addTerminal(TerminalVo terminalVo) {
return null;
}
}

@ -0,0 +1,29 @@
package com.shxy.xymanager_service.impl;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.vo.TerminalVo;
import com.shxy.xymanager_service.service.TerminalChannelService;
import com.shxy.xymanager_service.service.TerminalScheduleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
*
*
*/
@Service
@Slf4j
public class TerminalScheduleServiceImpl implements TerminalScheduleService {
@Override
public ServiceBody<TerminalListModel> getTerminalList() {
return null;
}
@Override
public ServiceBody<String> addTerminal(TerminalVo terminalVo) {
return null;
}
}

@ -5,9 +5,12 @@ import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.collection.CollectionUtil;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.entity.Terminals;
import com.shxy.xymanager_common.enums.CommonStatus;
import com.shxy.xymanager_common.exception.Asserts;
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_dao.dao.TerminalsDao;
import com.shxy.xymanager_service.service.TerminalService;
import lombok.extern.slf4j.Slf4j;
@ -15,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -38,7 +42,7 @@ public class TerminalServiceImpl implements TerminalService {
@Override
public ServiceBody<TerminalListModel> getTerminalList() {
TerminalListModel terminalListModel = new TerminalListModel();
List<Terminals> terminals = terminalsDao.selectAll();
List<Terminals> terminals = terminalsDao.selectAll(CommonStatus.EFFECTIVE.value());
boolean empty = CollectionUtil.isEmpty(terminals);
if (empty) {
terminalListModel.setTerminalBeanList(new ArrayList<>());
@ -52,15 +56,14 @@ public class TerminalServiceImpl implements TerminalService {
/**
*
*
* @param terminalVo
* @param vo
* @return
*/
@Override
public ServiceBody<String> addTerminal(TerminalVo terminalVo) {
Terminals terminals = new Terminals();
BeanUtil.copyProperties(terminalVo, terminals, true);
int i = terminalsDao.insertSelective(terminals);
public ServiceBody<String> addTerminal(TerminalVo vo) {
List<Terminals> list = BeanUtil.copyToList(vo.getList(), Terminals.class);
Date time = new Date();
int i = terminalsDao.insertList(list, CommonStatus.EFFECTIVE.value(), time,time);
if (i != 0) {
return Asserts.success("录入成功");
} else {
@ -68,25 +71,39 @@ public class TerminalServiceImpl implements TerminalService {
}
}
/**
*
* @param vo
* @return
*/
@Override
public ServiceBody<String> updateTerminal(UpdateTerminalVo vo) {
Terminals terminals = new Terminals();
BeanUtil.copyProperties(vo, terminals, true);
int i = terminalsDao.updateByPrimaryKeySelective(terminals,new Date());
if (i != 0) {
return Asserts.success("修改成功");
} else {
return Asserts.error("修改失败");
}
}
// /**
// * 查询单个设备信息
// *
// * @param terminalVo
// * @return
// */
// @Override
// public ServiceBody<String> add(TerminalVo terminalVo) {
//
// Terminals terminals = new Terminals();
// BeanUtil.copyProperties(terminalVo, terminals, true);
// int i = terminalsDao.insertSelective(terminals);
// if (i != 0) {
// return Asserts.success("录入成功");
// } else {
// return Asserts.error("录入失败");
// }
// }
/**
* 线
*
* @param vo
* @return
*/
@Override
public ServiceBody<String> deleteTerminal(TerminalIdVo vo) {
List<Terminals> list = BeanUtil.copyToList(vo.getList(), Terminals.class);
int i = terminalsDao.deleteById(list,CommonStatus.DELETE.value(),new Date());
if (i != 0) {
return Asserts.success("删除成功");
} else {
return Asserts.error("删除失败");
}
}
}

@ -0,0 +1,93 @@
package com.shxy.xymanager_service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.collection.CollectionUtil;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.entity.Lines;
import com.shxy.xymanager_common.entity.Terminals;
import com.shxy.xymanager_common.enums.CommonStatus;
import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.vo.LineIdVo;
import com.shxy.xymanager_common.vo.TerminalIdVo;
import com.shxy.xymanager_common.vo.TerminalVo;
import com.shxy.xymanager_dao.dao.TerminalsDao;
import com.shxy.xymanager_service.service.TerminalStatusService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
*
*
* @author
*/
@Slf4j
@Service
public class TerminalStatusServiceImpl implements TerminalStatusService {
@Autowired
private TerminalsDao terminalsDao;
/**
*
*
* @return
*/
@Override
public ServiceBody<TerminalListModel> getTerminalList() {
TerminalListModel terminalListModel = new TerminalListModel();
List<Terminals> terminals = terminalsDao.selectAll(CommonStatus.EFFECTIVE.value());
boolean empty = CollectionUtil.isEmpty(terminals);
if (empty) {
terminalListModel.setTerminalBeanList(new ArrayList<>());
} else {
List<TerminalListModel.TerminalBean> list = BeanUtil.copyToList(terminals, TerminalListModel.TerminalBean.class, CopyOptions.create().ignoreCase());
terminalListModel.setTerminalBeanList(list);
}
return Asserts.success(terminalListModel);
}
/**
*
*
* @param vo
* @return
*/
@Override
public ServiceBody<String> addTerminal(TerminalVo vo) {
List<Terminals> list = BeanUtil.copyToList(vo.getList(), Terminals.class);
Date date = new Date();
int i = terminalsDao.insertList(list, CommonStatus.EFFECTIVE.value(), date,date);
if (i != 0) {
return Asserts.success("录入成功");
} else {
return Asserts.error("录入失败");
}
}
/**
*
*
* @param vo
* @return
*/
@Override
public ServiceBody<String> deleteLine(TerminalIdVo vo) {
List<Terminals> list = BeanUtil.copyToList(vo.getList(), Terminals.class);
int i = terminalsDao.deleteById(list,CommonStatus.DELETE.value(),new Date());
if (i != 0) {
return Asserts.success("删除成功");
} else {
return Asserts.error("删除失败");
}
}
}

@ -0,0 +1,54 @@
package com.shxy.xymanager_service.service;
import com.shxy.xymanager_common.bean.ServiceBody;
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.TerminalVo;
import com.shxy.xymanager_common.vo.UpdateLineVo;
/**
* 线
*
* @author
*/
public interface LineService {
/**
* 线
*
* @return
*/
ServiceBody<LineTreeListModel> getLineTreeList();
/**
* 线
*
* @return
*/
ServiceBody<LineListModel> getLineList();
/**
* 线
*
* @return
*/
ServiceBody<String> addLine(LineVo vo);
/**
* 线
*
* @param vo
* @return
*/
ServiceBody<String> deleteLine(LineIdVo vo);
/**
* 线
*
* @param vo
* @return
*/
ServiceBody<String> updateLine(UpdateLineVo vo);
}

@ -5,17 +5,17 @@ import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.vo.TerminalVo;
/**
*
* 线
*
* @author
*/
public interface TerminalChannelService {
/**
*
* 线
*
* @return
*/
ServiceBody<TerminalListModel> getTerminalList();
ServiceBody<TerminalListModel> getChannelTreeList();
/**
*

@ -0,0 +1,27 @@
package com.shxy.xymanager_service.service;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.vo.TerminalVo;
/**
*
*
* @author
*/
public interface TerminalPhotoService {
/**
*
*
* @return
*/
ServiceBody<TerminalListModel> getTerminalList();
/**
*
*
* @return
*/
ServiceBody<String> addTerminal(TerminalVo terminalVo);
}

@ -0,0 +1,27 @@
package com.shxy.xymanager_service.service;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.vo.TerminalVo;
/**
*
*
* @author
*/
public interface TerminalPresetsService {
/**
*
*
* @return
*/
ServiceBody<TerminalListModel> getTerminalList();
/**
*
*
* @return
*/
ServiceBody<String> addTerminal(TerminalVo terminalVo);
}

@ -0,0 +1,27 @@
package com.shxy.xymanager_service.service;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.vo.TerminalVo;
/**
*
*
* @author
*/
public interface TerminalScheduleService {
/**
*
*
* @return
*/
ServiceBody<TerminalListModel> getTerminalList();
/**
*
*
* @return
*/
ServiceBody<String> addTerminal(TerminalVo terminalVo);
}

@ -2,7 +2,9 @@ package com.shxy.xymanager_service.service;
import com.shxy.xymanager_common.bean.ServiceBody;
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;
/**
*
@ -22,6 +24,22 @@ public interface TerminalService {
*
* @return
*/
ServiceBody<String> addTerminal(TerminalVo terminalVo);
ServiceBody<String> addTerminal(TerminalVo vo);
/**
*
*
* @return
*/
ServiceBody<String> updateTerminal(UpdateTerminalVo vo);
/**
*
*
* @param vo
* @return
*/
ServiceBody<String> deleteTerminal(TerminalIdVo vo);
}

@ -0,0 +1,35 @@
package com.shxy.xymanager_service.service;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.vo.LineIdVo;
import com.shxy.xymanager_common.vo.TerminalIdVo;
import com.shxy.xymanager_common.vo.TerminalVo;
/**
*
*
* @author
*/
public interface TerminalStatusService {
/**
*
*
* @return
*/
ServiceBody<TerminalListModel> getTerminalList();
/**
*
*
* @return
*/
ServiceBody<String> addTerminal(TerminalVo terminalVo);
/**
*
* @param vo
* @return
*/
ServiceBody<String> deleteLine(TerminalIdVo vo);
}
Loading…
Cancel
Save