欣影管理平台线路和装置接口完善
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());
|
||||
}
|
||||
}
|
||||
}
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
}
|
@ -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,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;
|
||||
}
|
||||
}
|
@ -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;
|
||||
|
||||
}
|
@ -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);
|
||||
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
@ -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);
|
||||
|
||||
}
|
@ -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…
Reference in New Issue