Compare commits
No commits in common. "fca9fca0c216e2e3727d84ce3bd99aee2f704db7" and "93082132893d1daa6a1158ab8c04c9c64979d579" have entirely different histories.
fca9fca0c2
...
9308213289
@ -17,7 +17,9 @@ public class GlobalExceptionHandler {
|
|||||||
@ResponseBody
|
@ResponseBody
|
||||||
@ExceptionHandler(value = Throwable.class)
|
@ExceptionHandler(value = Throwable.class)
|
||||||
public ResponseResult handleException(Throwable e) {
|
public ResponseResult handleException(Throwable e) {
|
||||||
e.printStackTrace();
|
log.error(e.getMessage());;
|
||||||
|
String message = e.getMessage();
|
||||||
|
log.error("message:{}", message);
|
||||||
return ResponseResult.error(e.getMessage());
|
return ResponseResult.error(e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,9 +1,20 @@
|
|||||||
package com.yfd.platform.modules.auxcontrol.controller;
|
package com.yfd.platform.modules.auxcontrol.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.yfd.platform.config.ResponseResult;
|
||||||
|
import com.yfd.platform.modules.auxcontrol.domain.DeviceAlarmRecord;
|
||||||
|
import com.yfd.platform.modules.auxcontrol.service.IDeviceAlarmRecordService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 变电站-辅控设备-告警参数设置 前端控制器
|
* 变电站-辅控设备-告警参数设置 前端控制器
|
||||||
@ -17,5 +28,32 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
@Api(value = "DeviceAlarmParameterController", tags = "变电站辅控设备告警参数设置")
|
@Api(value = "DeviceAlarmParameterController", tags = "变电站辅控设备告警参数设置")
|
||||||
public class DeviceAlarmParameterController {
|
public class DeviceAlarmParameterController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IDeviceAlarmRecordService deviceAlarmRecordService;
|
||||||
|
|
||||||
|
/**********************************
|
||||||
|
* 用途说明: 分页查询变电站辅控设备告警记录
|
||||||
|
* 参数说明
|
||||||
|
* systemcode 所属系统
|
||||||
|
* deviceName 告警设备名称
|
||||||
|
* signalName 告警信号名称
|
||||||
|
* startDate (开始日期)
|
||||||
|
* endDate (结束日期)
|
||||||
|
* alarmLevel 告警等级
|
||||||
|
* status 告警状态
|
||||||
|
* page 分页对象
|
||||||
|
* 返回值说明: com.yfd.platform.config.ResponseResult 返回分页查询结果
|
||||||
|
***********************************/
|
||||||
|
@GetMapping("/page")
|
||||||
|
@ApiOperation("分页查询变电站辅控设备告警记录")
|
||||||
|
public ResponseResult getDeviceAlarmRecordPage(String systemcode, String deviceName, String signalName, String startDate, String endDate, String alarmLevel, String status, Page<DeviceAlarmRecord> page) {
|
||||||
|
//参数校验 所属系统不能为空
|
||||||
|
if (systemcode == null) {
|
||||||
|
return ResponseResult.error("参数为空");
|
||||||
|
}
|
||||||
|
//分页查询
|
||||||
|
Page<DeviceAlarmRecord> deviceAlarmRecordPage = deviceAlarmRecordService.getDeviceAlarmRecordPage(systemcode, deviceName, signalName, startDate,endDate,alarmLevel,status,page);
|
||||||
|
return ResponseResult.successData(deviceAlarmRecordPage);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,19 +1,11 @@
|
|||||||
package com.yfd.platform.modules.auxcontrol.controller;
|
package com.yfd.platform.modules.auxcontrol.controller;
|
||||||
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.yfd.platform.config.ResponseResult;
|
|
||||||
import com.yfd.platform.modules.auxcontrol.domain.DeviceAlarmRecord;
|
|
||||||
import com.yfd.platform.modules.auxcontrol.service.IDeviceAlarmRecordService;
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 变电站-辅控设备-告警记录 前端控制器
|
* 变电站-辅控设备-告警记录 前端控制器
|
||||||
@ -27,31 +19,4 @@ import javax.annotation.Resource;
|
|||||||
@Api(value = "DeviceAlarmRecordController", tags = "变电站辅控设备告警记录")
|
@Api(value = "DeviceAlarmRecordController", tags = "变电站辅控设备告警记录")
|
||||||
public class DeviceAlarmRecordController {
|
public class DeviceAlarmRecordController {
|
||||||
|
|
||||||
@Resource
|
|
||||||
private IDeviceAlarmRecordService deviceAlarmRecordService;
|
|
||||||
|
|
||||||
/**********************************
|
|
||||||
* 用途说明: 分页查询变电站辅控设备告警记录
|
|
||||||
* 参数说明
|
|
||||||
* systemcode 所属系统
|
|
||||||
* deviceName 告警设备名称
|
|
||||||
* signalName 告警信号名称
|
|
||||||
* startDate (开始日期)
|
|
||||||
* endDate (结束日期)
|
|
||||||
* alarmLevel 告警等级
|
|
||||||
* status 告警状态
|
|
||||||
* page 分页对象
|
|
||||||
* 返回值说明: com.yfd.platform.config.ResponseResult 返回分页查询结果
|
|
||||||
***********************************/
|
|
||||||
@GetMapping("/page")
|
|
||||||
@ApiOperation("分页查询变电站辅控设备告警记录")
|
|
||||||
public ResponseResult getDeviceAlarmRecordPage(String systemcode, String deviceName, String signalName, String startDate, String endDate, String alarmLevel, String status, Page<DeviceAlarmRecord> page) {
|
|
||||||
//参数校验 所属系统不能为空
|
|
||||||
if (systemcode == null) {
|
|
||||||
return ResponseResult.error("参数为空");
|
|
||||||
}
|
|
||||||
//分页查询
|
|
||||||
Page<DeviceAlarmRecord> deviceAlarmRecordPage = deviceAlarmRecordService.getDeviceAlarmRecordPage(systemcode, deviceName, signalName, startDate,endDate,alarmLevel,status,page);
|
|
||||||
return ResponseResult.successData(deviceAlarmRecordPage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,23 +1,19 @@
|
|||||||
package com.yfd.platform.modules.auxcontrol.controller;
|
package com.yfd.platform.modules.auxcontrol.controller;
|
||||||
|
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.yfd.platform.annotation.Log;
|
|
||||||
import com.yfd.platform.config.ResponseResult;
|
import com.yfd.platform.config.ResponseResult;
|
||||||
import com.yfd.platform.modules.auxcontrol.domain.DeviceSignal;
|
import com.yfd.platform.modules.auxcontrol.domain.DeviceSignal;
|
||||||
import com.yfd.platform.modules.auxcontrol.mapper.DeviceSignalMapper;
|
import com.yfd.platform.modules.auxcontrol.mapper.DeviceSignalMapper;
|
||||||
import com.yfd.platform.modules.auxcontrol.service.IDeviceSignalService;
|
|
||||||
import com.yfd.platform.modules.basedata.domain.SubstationModel;
|
import com.yfd.platform.modules.basedata.domain.SubstationModel;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -34,115 +30,13 @@ import java.util.Map;
|
|||||||
@Api(value = "DeviceSignalController", tags = "变电站辅控设备信号")
|
@Api(value = "DeviceSignalController", tags = "变电站辅控设备信号")
|
||||||
public class DeviceSignalController {
|
public class DeviceSignalController {
|
||||||
|
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private IDeviceSignalService deviceSignalService;
|
private DeviceSignalMapper deviceSignalMapper;
|
||||||
|
|
||||||
/**********************************
|
@GetMapping("/getDeviceSignal")
|
||||||
* 用途说明: 分页查询变电站辅控设备信号
|
@ApiOperation("查询信号")
|
||||||
* 参数说明
|
public ResponseResult getDeviceSignal(String type, String address) {
|
||||||
* deviceId 辅控设备ID
|
return ResponseResult.successData(deviceSignalMapper.selectDeviceSignalMap("", type, address));
|
||||||
* signalName 信号名称
|
|
||||||
* pageNum 当前页
|
|
||||||
* 返回值说明: com.yfd.platform.config.ResponseResult 返回分页查询结果
|
|
||||||
***********************************/
|
|
||||||
@GetMapping("/page")
|
|
||||||
@ApiOperation("分页查询变电站辅控设备信号")
|
|
||||||
@PreAuthorize("@el.check('select:devicesignal')")
|
|
||||||
public ResponseResult getDeviceSignalPage(String deviceId, String signalName, Page<DeviceSignal> page) {
|
|
||||||
//参数校验 辅控设备ID不能为空
|
|
||||||
if (StrUtil.isBlank(deviceId)) {
|
|
||||||
return ResponseResult.error("参数为空");
|
|
||||||
}
|
|
||||||
Page<DeviceSignal> deviceSignalPage = deviceSignalService.getDeviceSignalPage(deviceId, signalName, page);
|
|
||||||
return ResponseResult.successData(deviceSignalPage);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************
|
|
||||||
* 用途说明:新增变电站辅控设备信号
|
|
||||||
* 参数说明
|
|
||||||
* deviceSignal 变电站辅控设备信号
|
|
||||||
* 返回值说明: com.yfd.platform.config.ResponseResult 返回新增成功或者失败
|
|
||||||
***********************************/
|
|
||||||
@Log(module = "变电站辅控设备信号", value = "新增变电站辅控设备信号!",type = "1")
|
|
||||||
@PostMapping("/addDeviceSignal")
|
|
||||||
@ApiOperation("新增变电站辅控设备信号")
|
|
||||||
@ResponseBody
|
|
||||||
public ResponseResult addDeviceSignal(@RequestBody DeviceSignal deviceSignal) {
|
|
||||||
//对象不能为空
|
|
||||||
if (deviceSignal == null) {
|
|
||||||
return ResponseResult.error("参数为空");
|
|
||||||
}
|
}
|
||||||
boolean isOK = deviceSignalService.addDeviceSignal(deviceSignal);
|
|
||||||
if (isOK) {
|
|
||||||
return ResponseResult.success();
|
|
||||||
} else {
|
|
||||||
return ResponseResult.error();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**********************************
|
|
||||||
* 用途说明: 修改变电站辅控设备信号
|
|
||||||
* 参数说明 deviceSignal 变电站辅控设备信号
|
|
||||||
* 返回值说明: com.yfd.platform.config.ResponseResult 返回修改成功或者失败
|
|
||||||
***********************************/
|
|
||||||
@Log(module = "变电站辅控设备信号", value = "修改变电站辅控设备信号",type = "1")
|
|
||||||
@PostMapping("/updateDeviceSignal")
|
|
||||||
@ApiOperation("修改变电站辅控设备信号")
|
|
||||||
public ResponseResult updateDeviceSignal(@RequestBody DeviceSignal deviceSignal) {
|
|
||||||
if (ObjectUtil.isEmpty(deviceSignal)) {
|
|
||||||
return ResponseResult.error("参数为空");
|
|
||||||
}
|
|
||||||
boolean isOK = deviceSignalService.updateDeviceSignal(deviceSignal);
|
|
||||||
if (isOK) {
|
|
||||||
return ResponseResult.success();
|
|
||||||
} else {
|
|
||||||
return ResponseResult.error();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**********************************
|
|
||||||
* 用途说明: 根据ID删除变电站辅控设备信号
|
|
||||||
* 参数说明 id 变电站辅控设备信号ID
|
|
||||||
* 返回值说明: com.yfd.platform.config.ResponseResult 返回删除成功或者失败
|
|
||||||
***********************************/
|
|
||||||
@Log(module = "变电站辅控设备信号", value = "根据ID删除变电站辅控设备信号",type = "1")
|
|
||||||
@PostMapping("/deleteDeviceSignalById")
|
|
||||||
@ApiOperation("根据ID删除变电站辅控设备信号")
|
|
||||||
public ResponseResult deleteDeviceSignalById(@RequestParam String id) {
|
|
||||||
if (StrUtil.isBlank(id)) {
|
|
||||||
return ResponseResult.error("参数为空");
|
|
||||||
}
|
|
||||||
boolean isOK = deviceSignalService.removeById(id);
|
|
||||||
if (isOK) {
|
|
||||||
return ResponseResult.success();
|
|
||||||
} else {
|
|
||||||
return ResponseResult.error();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**********************************
|
|
||||||
* 用途说明: 批量删除变电站辅控设备信号
|
|
||||||
* 参数说明 ids 变电站辅控设备信号id数组
|
|
||||||
* 返回值说明: com.yfd.platform.config.ResponseResult 返回批量删除成功或失败
|
|
||||||
***********************************/
|
|
||||||
@Log(module = "变电站辅控设备信号", value = "批量删除变电站辅控设备信号",type = "1")
|
|
||||||
@PostMapping("/deleteDeviceSignalByIds")
|
|
||||||
@ApiOperation("批量删除变电站辅控设备信号")
|
|
||||||
public ResponseResult deleteDeviceByIds(@RequestParam String ids) {
|
|
||||||
if (StrUtil.isBlank(ids)) {
|
|
||||||
return ResponseResult.error("参数为空");
|
|
||||||
}
|
|
||||||
List<String> idList = StrUtil.split(ids, ",");
|
|
||||||
boolean isOK = deviceSignalService.removeByIds(idList);
|
|
||||||
if (isOK) {
|
|
||||||
return ResponseResult.success();
|
|
||||||
} else {
|
|
||||||
return ResponseResult.error();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,20 +1,10 @@
|
|||||||
package com.yfd.platform.modules.auxcontrol.controller;
|
package com.yfd.platform.modules.auxcontrol.controller;
|
||||||
|
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.yfd.platform.annotation.Log;
|
|
||||||
import com.yfd.platform.config.ResponseResult;
|
|
||||||
import com.yfd.platform.modules.auxcontrol.domain.GatewayDevice;
|
|
||||||
import com.yfd.platform.modules.auxcontrol.service.IGatewayDeviceService;
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@ -29,112 +19,4 @@ import java.util.List;
|
|||||||
@Api(value = "GatewayDeviceController", tags = "变电站通讯网关设备")
|
@Api(value = "GatewayDeviceController", tags = "变电站通讯网关设备")
|
||||||
public class GatewayDeviceController {
|
public class GatewayDeviceController {
|
||||||
|
|
||||||
@Resource
|
|
||||||
private IGatewayDeviceService gatewayDeviceService;
|
|
||||||
|
|
||||||
/**********************************
|
|
||||||
* 用途说明: 分页查询变电站网关设备
|
|
||||||
* 参数说明
|
|
||||||
* deviceName 设备名称
|
|
||||||
* deviceModel 设备型号
|
|
||||||
*deviceType 设备类型
|
|
||||||
*status 设备状态
|
|
||||||
* pageNum 当前页
|
|
||||||
* 返回值说明: com.yfd.platform.config.ResponseResult 返回分页查询结果
|
|
||||||
***********************************/
|
|
||||||
@GetMapping("/page")
|
|
||||||
@ApiOperation("分页查询变电站网关设备")
|
|
||||||
public ResponseResult getGatewayDevicePage(String deviceName, String deviceModel, String deviceType,
|
|
||||||
String status, Page<GatewayDevice> page) {
|
|
||||||
//分页查询
|
|
||||||
Page<GatewayDevice> deviceAlarmParameterPage = gatewayDeviceService.getGatewayDevicePage(deviceName,
|
|
||||||
deviceModel, deviceType, status, page);
|
|
||||||
return ResponseResult.successData(deviceAlarmParameterPage);
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************
|
|
||||||
* 用途说明:新增变电站网关设备
|
|
||||||
* 参数说明
|
|
||||||
* systemDevice 变电站网关
|
|
||||||
* 返回值说明: com.yfd.platform.config.ResponseResult 返回新增成功或者失败
|
|
||||||
***********************************/
|
|
||||||
@Log(module = "数据变电站网关设备", value = "新增变电站网关设备!", type = "1")
|
|
||||||
@PostMapping("/addGatewayDevice")
|
|
||||||
@ApiOperation("新增变电站网关设备")
|
|
||||||
@ResponseBody
|
|
||||||
public ResponseResult addGatewayDevice(@RequestBody GatewayDevice gatewayDevice) {
|
|
||||||
//对象不能为空
|
|
||||||
if (ObjectUtil.isEmpty(gatewayDevice)) {
|
|
||||||
return ResponseResult.error("参数为空");
|
|
||||||
}
|
|
||||||
boolean isOk = gatewayDeviceService.addGatewayDevice(gatewayDevice);
|
|
||||||
if (isOk) {
|
|
||||||
return ResponseResult.success();
|
|
||||||
} else {
|
|
||||||
return ResponseResult.error();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**********************************
|
|
||||||
* 用途说明: 修改变电站网关设备
|
|
||||||
* 参数说明
|
|
||||||
* systemDevice 变电站网关设备
|
|
||||||
* 返回值说明: com.yfd.platform.config.ResponseResult 返回修改成功或者失败
|
|
||||||
***********************************/
|
|
||||||
@Log(module = "数据变电站网关设备", value = "修改变电站网关设备", type = "1")
|
|
||||||
@PostMapping("/updateGatewayDevice")
|
|
||||||
@ApiOperation("修改变电站网关设备")
|
|
||||||
public ResponseResult updateGatewayDevice(@RequestBody GatewayDevice gatewayDevice) {
|
|
||||||
//对象不能为空
|
|
||||||
if (ObjectUtil.isEmpty(gatewayDevice)) {
|
|
||||||
return ResponseResult.error("参数为空");
|
|
||||||
}
|
|
||||||
boolean isOk = gatewayDeviceService.updateGatewayDevice(gatewayDevice);
|
|
||||||
if (isOk) {
|
|
||||||
return ResponseResult.success();
|
|
||||||
} else {
|
|
||||||
return ResponseResult.error();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**********************************
|
|
||||||
* 用途说明: 根据ID删除变电站网关设备
|
|
||||||
* 参数说明 id 变电站网关设备ID
|
|
||||||
* 返回值说明: com.yfd.platform.config.ResponseResult 返回删除成功或者失败
|
|
||||||
***********************************/
|
|
||||||
@Log(module = "数据变电站网关设备", value = "根据ID删除变电站网关设备", type = "1")
|
|
||||||
@PostMapping("/deleteGatewayDeviceById")
|
|
||||||
@ApiOperation("根据ID删除变电站网关设备")
|
|
||||||
public ResponseResult deleteGatewayDeviceById(@RequestParam String id) {
|
|
||||||
if (StrUtil.isBlank(id)) {
|
|
||||||
return ResponseResult.error("参数为空");
|
|
||||||
}
|
|
||||||
boolean isOk = gatewayDeviceService.removeById(id);
|
|
||||||
if (isOk) {
|
|
||||||
return ResponseResult.success();
|
|
||||||
} else {
|
|
||||||
return ResponseResult.error();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**********************************
|
|
||||||
* 用途说明: 根据ID删除变电站网关设备
|
|
||||||
* 参数说明 ids 变电站网关设备ID
|
|
||||||
* 返回值说明: com.yfd.platform.config.ResponseResult 返回删除成功或者失败
|
|
||||||
***********************************/
|
|
||||||
@Log(module = "数据变电站系统设备", value = "根据ID删除变电站网关设备", type = "1")
|
|
||||||
@PostMapping("/batchDeleteGateway")
|
|
||||||
@ApiOperation("根据ID批量删除变电站网关设备")
|
|
||||||
public ResponseResult batchDeleteGateway(@RequestBody List<String> ids) {
|
|
||||||
if (ids.size() <= 0) {
|
|
||||||
return ResponseResult.error("参数为空");
|
|
||||||
}
|
|
||||||
boolean isOk = gatewayDeviceService.removeByIds(ids);
|
|
||||||
if (isOk) {
|
|
||||||
return ResponseResult.success();
|
|
||||||
} else {
|
|
||||||
return ResponseResult.error();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,20 +1,10 @@
|
|||||||
package com.yfd.platform.modules.auxcontrol.controller;
|
package com.yfd.platform.modules.auxcontrol.controller;
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.yfd.platform.annotation.Log;
|
|
||||||
import com.yfd.platform.config.ResponseResult;
|
|
||||||
import com.yfd.platform.modules.auxcontrol.domain.MeterDevice;
|
|
||||||
import com.yfd.platform.modules.auxcontrol.service.IMeterDeviceService;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import io.swagger.annotations.Api;
|
||||||
import java.util.Arrays;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import java.util.List;
|
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@ -29,142 +19,4 @@ import java.util.List;
|
|||||||
@Api(value = "MeterDeviceController", tags = "变电站二次设备中的智能仪表监控设备")
|
@Api(value = "MeterDeviceController", tags = "变电站二次设备中的智能仪表监控设备")
|
||||||
public class MeterDeviceController {
|
public class MeterDeviceController {
|
||||||
|
|
||||||
@Resource
|
|
||||||
private IMeterDeviceService meterDeviceService;
|
|
||||||
|
|
||||||
/**********************************
|
|
||||||
* 用途说明: 分页查询变电站辅控设备
|
|
||||||
* 参数说明
|
|
||||||
* deviceName 设备名称
|
|
||||||
* deviceModel 设备型号
|
|
||||||
* deviceType 设备类型
|
|
||||||
* status 设备状态
|
|
||||||
* systemcode 系统编号
|
|
||||||
* pageNum 当前页
|
|
||||||
* 返回值说明: com.yfd.platform.config.ResponseResult 返回分页查询结果
|
|
||||||
***********************************/
|
|
||||||
@GetMapping("/page")
|
|
||||||
@ApiOperation("分页查询变电站辅控设备")
|
|
||||||
@PreAuthorize("@el.check('select:device')")
|
|
||||||
public ResponseResult getDevicePage(String deviceName, String deviceModel, String deviceType, String status,
|
|
||||||
String systemcode, Page<MeterDevice> page) {
|
|
||||||
//参数校验 系统编号不能为空
|
|
||||||
if (systemcode == null) {
|
|
||||||
return ResponseResult.error("参数为空");
|
|
||||||
}
|
|
||||||
//分页查询
|
|
||||||
Page<MeterDevice> devicePage = meterDeviceService.getDevicePage(deviceName, deviceModel, deviceType, status,
|
|
||||||
systemcode, page);
|
|
||||||
return ResponseResult.successData(devicePage);
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************
|
|
||||||
* 用途说明:新增变电站辅控设备信息
|
|
||||||
* 参数说明
|
|
||||||
* device 变电站辅控设备
|
|
||||||
* 返回值说明: com.yfd.platform.config.ResponseResult 返回新增成功或者失败
|
|
||||||
***********************************/
|
|
||||||
@Log(module = "综合辅控系统", value = "新增变电站辅控设备信息!", type = "1")
|
|
||||||
@PostMapping("/addMeterDevice")
|
|
||||||
@ApiOperation("新增变电站辅控设备信息")
|
|
||||||
@ResponseBody
|
|
||||||
public ResponseResult addMeterDevice(@RequestBody MeterDevice meterDevice) {
|
|
||||||
//对象不能为空
|
|
||||||
if (ObjectUtil.isEmpty(meterDevice)) {
|
|
||||||
return ResponseResult.error("参数为空");
|
|
||||||
}
|
|
||||||
//新增 通过boolean类型校验成功失败
|
|
||||||
boolean isOK = meterDeviceService.addMeterDevice(meterDevice);
|
|
||||||
if (isOK) {
|
|
||||||
return ResponseResult.success();
|
|
||||||
} else {
|
|
||||||
return ResponseResult.error();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**********************************
|
|
||||||
* 用途说明: 修改变电站辅控设备信息
|
|
||||||
* 参数说明 substation 变电站信息
|
|
||||||
* 返回值说明: com.yfd.platform.config.ResponseResult 返回修改成功或者失败
|
|
||||||
***********************************/
|
|
||||||
@Log(module = "数据变电站辅控设备", value = "修改变电站辅控设备信息", type = "1")
|
|
||||||
@PostMapping("/updateMeterDevice")
|
|
||||||
@ApiOperation("修改变电站辅控设备信息")
|
|
||||||
public ResponseResult updateMeterDevice(@RequestBody MeterDevice meterDevice) {
|
|
||||||
//对象不能为空 主键id不能为空
|
|
||||||
if (ObjectUtil.isEmpty(meterDevice)) {
|
|
||||||
return ResponseResult.error("参数为空");
|
|
||||||
}
|
|
||||||
boolean isOK = meterDeviceService.updateMeterDevice(meterDevice);
|
|
||||||
if (isOK) {
|
|
||||||
return ResponseResult.success();
|
|
||||||
} else {
|
|
||||||
return ResponseResult.error();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**********************************
|
|
||||||
* 用途说明: 批量修改变电站辅控设备信息
|
|
||||||
* 参数说明
|
|
||||||
* ids 变电站辅控设备id数组
|
|
||||||
* netdeviceIp 对应网关设备IP
|
|
||||||
* 返回值说明: com.yfd.platform.config.ResponseResult 返回修改成功或者失败
|
|
||||||
***********************************/
|
|
||||||
@Log(module = "数据变电站辅控设备", value = "批量修改变电站辅控设备信息", type = "1")
|
|
||||||
@PostMapping("/batchUpdateMeterDeviceIp")
|
|
||||||
@ApiOperation("批量修改变电站辅控设备信息")
|
|
||||||
public ResponseResult batchUpdateMeterDeviceIp(@RequestParam String ids, @RequestParam String ip) {
|
|
||||||
|
|
||||||
if (StrUtil.isBlank(ids) || StrUtil.isBlank(ip)) {
|
|
||||||
return ResponseResult.error("参数为空");
|
|
||||||
}
|
|
||||||
boolean isOk = meterDeviceService.batchUpdateDeviceIp(ids, ip);
|
|
||||||
if (isOk) {
|
|
||||||
return ResponseResult.success();
|
|
||||||
} else {
|
|
||||||
return ResponseResult.error();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**********************************
|
|
||||||
* 用途说明: 根据ID删除变电站信息
|
|
||||||
* 参数说明 id 变电站辅控设备ID
|
|
||||||
* 返回值说明: com.yfd.platform.config.ResponseResult 返回删除成功或者失败
|
|
||||||
***********************************/
|
|
||||||
@Log(module = "数据变电站辅控设备", value = "根据ID删除变电站辅控设备信息", type = "1")
|
|
||||||
@PostMapping("/deleteMeterDeviceById")
|
|
||||||
@ApiOperation("根据ID删除变电站辅控设备信息")
|
|
||||||
public ResponseResult deleteMeterDeviceById(@RequestParam String id) {
|
|
||||||
if (StrUtil.isBlank(id)) {
|
|
||||||
return ResponseResult.error("参数为空");
|
|
||||||
}
|
|
||||||
boolean isOK = meterDeviceService.removeById(id);
|
|
||||||
if (isOK) {
|
|
||||||
return ResponseResult.success();
|
|
||||||
} else {
|
|
||||||
return ResponseResult.error();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**********************************
|
|
||||||
* 用途说明: 批量删除变电站辅控设备信息
|
|
||||||
* 参数说明 ids 变电站辅控设备id数组
|
|
||||||
* 返回值说明: com.yfd.platform.config.ResponseResult 返回批量删除成功或失败
|
|
||||||
***********************************/
|
|
||||||
@Log(module = "数据变电站区域", value = "批量删除变电站辅控设备信息", type = "1")
|
|
||||||
@PostMapping("/deleteDeviceByIds")
|
|
||||||
@ApiOperation("批量删除变电站辅控设备信息")
|
|
||||||
public ResponseResult deleteDeviceByIds(@RequestParam String ids) {
|
|
||||||
if (StrUtil.isBlank(ids)) {
|
|
||||||
return ResponseResult.error("参数为空");
|
|
||||||
}
|
|
||||||
List<String> idList = StrUtil.split(ids, ",");
|
|
||||||
boolean isOk = meterDeviceService.removeByIds(idList);
|
|
||||||
if (isOk) {
|
|
||||||
return ResponseResult.success();
|
|
||||||
} else {
|
|
||||||
return ResponseResult.error();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package com.yfd.platform.modules.auxcontrol.service;
|
package com.yfd.platform.modules.auxcontrol.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.yfd.platform.modules.auxcontrol.domain.DeviceSignal;
|
import com.yfd.platform.modules.auxcontrol.domain.DeviceSignal;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
@ -27,27 +26,4 @@ public interface IDeviceSignalService extends IService<DeviceSignal> {
|
|||||||
* 返回值说明: bool 更新成功或者失败
|
* 返回值说明: bool 更新成功或者失败
|
||||||
***********************************/
|
***********************************/
|
||||||
boolean updateDeviceSignalValue(String slaveIp, String address, String type, String value, String dateTime) throws ParseException;
|
boolean updateDeviceSignalValue(String slaveIp, String address, String type, String value, String dateTime) throws ParseException;
|
||||||
|
|
||||||
/**********************************
|
|
||||||
* 用途说明: 新增变电站辅控设备信号
|
|
||||||
* 参数说明 deviceSignal 变电站辅控设备信号对象
|
|
||||||
* 返回值说明: boolean
|
|
||||||
***********************************/
|
|
||||||
boolean addDeviceSignal(DeviceSignal deviceSignal);
|
|
||||||
|
|
||||||
/**********************************
|
|
||||||
* 用途说明: 修改变电站辅控设备信号
|
|
||||||
* 参数说明 deviceSignal 变电站辅控设备信号对象
|
|
||||||
* 返回值说明: boolean
|
|
||||||
***********************************/
|
|
||||||
boolean updateDeviceSignal(DeviceSignal deviceSignal);
|
|
||||||
|
|
||||||
/**********************************
|
|
||||||
* 用途说明:
|
|
||||||
* 参数说明 deviceId 设备ID
|
|
||||||
* 参数说明 signalName 信号名称
|
|
||||||
* 参数说明 page
|
|
||||||
* 返回值说明: com.baomidou.mybatisplus.extension.plugins.pagination.Page<com.yfd.platform.modules.auxcontrol.domain.DeviceSignal>
|
|
||||||
***********************************/
|
|
||||||
Page<DeviceSignal> getDeviceSignalPage(String deviceId, String signalName, Page<DeviceSignal> page);
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package com.yfd.platform.modules.auxcontrol.service;
|
package com.yfd.platform.modules.auxcontrol.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.yfd.platform.modules.auxcontrol.domain.GatewayDevice;
|
import com.yfd.platform.modules.auxcontrol.domain.GatewayDevice;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
@ -21,29 +20,4 @@ public interface IGatewayDeviceService extends IService<GatewayDevice> {
|
|||||||
* 返回值说明: 无
|
* 返回值说明: 无
|
||||||
***********************************/
|
***********************************/
|
||||||
void updateKeepLiveTime(String ip);
|
void updateKeepLiveTime(String ip);
|
||||||
|
|
||||||
/**********************************
|
|
||||||
* 用途说明: 分页查询变电站网关设备
|
|
||||||
* 参数说明 deviceName 设备名称
|
|
||||||
* 参数说明 deviceModel 设备型号
|
|
||||||
* 参数说明 deviceType 设备类型
|
|
||||||
* 参数说明 status 状态
|
|
||||||
* 参数说明 page
|
|
||||||
* 返回值说明: com.baomidou.mybatisplus.extension.plugins.pagination.Page<com.yfd.platform.modules.auxcontrol.domain.GatewayDevice>
|
|
||||||
***********************************/
|
|
||||||
Page<GatewayDevice> getGatewayDevicePage(String deviceName, String deviceModel, String deviceType, String status, Page<GatewayDevice> page);
|
|
||||||
|
|
||||||
/**********************************
|
|
||||||
* 用途说明: 新增变电站网关设备
|
|
||||||
* 参数说明 gatewayDevice 网关设备对象
|
|
||||||
* 返回值说明: boolean
|
|
||||||
***********************************/
|
|
||||||
boolean addGatewayDevice(GatewayDevice gatewayDevice);
|
|
||||||
|
|
||||||
/**********************************
|
|
||||||
* 用途说明: 修改变变电站网关设备
|
|
||||||
* 参数说明 gatewayDevice 网关设备对象
|
|
||||||
* 返回值说明: boolean
|
|
||||||
***********************************/
|
|
||||||
boolean updateGatewayDevice(GatewayDevice gatewayDevice);
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package com.yfd.platform.modules.auxcontrol.service;
|
package com.yfd.platform.modules.auxcontrol.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.yfd.platform.modules.auxcontrol.domain.MeterDevice;
|
import com.yfd.platform.modules.auxcontrol.domain.MeterDevice;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
@ -14,38 +13,4 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||||||
*/
|
*/
|
||||||
public interface IMeterDeviceService extends IService<MeterDevice> {
|
public interface IMeterDeviceService extends IService<MeterDevice> {
|
||||||
|
|
||||||
/**********************************
|
|
||||||
* 用途说明: 分页查询变电站辅控设备
|
|
||||||
* 参数说明 deviceName 设备名称
|
|
||||||
* 参数说明 deviceModel设备型号
|
|
||||||
* 参数说明 deviceType设备类型
|
|
||||||
* 参数说明 status 状态
|
|
||||||
* 参数说明 systemcode 系统编码
|
|
||||||
* 参数说明 page
|
|
||||||
* 返回值说明: com.baomidou.mybatisplus.extension.plugins.pagination.Page<com.yfd.platform.modules.auxcontrol.domain.MeterDevice>
|
|
||||||
***********************************/
|
|
||||||
Page<MeterDevice> getDevicePage(String deviceName, String deviceModel, String deviceType, String status, String systemcode, Page<MeterDevice> page);
|
|
||||||
|
|
||||||
/**********************************
|
|
||||||
* 用途说明: 新增变电站辅控设备信息
|
|
||||||
* 参数说明 meterDevice 辅控设备信息
|
|
||||||
* 返回值说明: boolean
|
|
||||||
***********************************/
|
|
||||||
boolean addMeterDevice(MeterDevice meterDevice);
|
|
||||||
|
|
||||||
/**********************************
|
|
||||||
* 用途说明: 修改变电站辅控设备信息
|
|
||||||
* 参数说明 meterDevice 辅控设备信息
|
|
||||||
* 返回值说明: boolean
|
|
||||||
***********************************/
|
|
||||||
boolean updateMeterDevice(MeterDevice meterDevice);
|
|
||||||
|
|
||||||
/**********************************
|
|
||||||
* 用途说明: 批量修改变电站辅控设备信息
|
|
||||||
* 参数说明 ids 设备id集合
|
|
||||||
* 参数说明 ip 设备ip
|
|
||||||
* 返回值说明: boolean
|
|
||||||
***********************************/
|
|
||||||
boolean batchUpdateDeviceIp(String ids, String ip);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,14 +3,10 @@ package com.yfd.platform.modules.auxcontrol.service.impl;
|
|||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.yfd.platform.modules.auxcontrol.domain.DeviceSignal;
|
import com.yfd.platform.modules.auxcontrol.domain.DeviceSignal;
|
||||||
import com.yfd.platform.modules.auxcontrol.mapper.DeviceSignalMapper;
|
import com.yfd.platform.modules.auxcontrol.mapper.DeviceSignalMapper;
|
||||||
import com.yfd.platform.modules.auxcontrol.service.IDeviceSignalService;
|
import com.yfd.platform.modules.auxcontrol.service.IDeviceSignalService;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.yfd.platform.utils.SecurityUtils;
|
|
||||||
import com.yfd.platform.utils.StringUtils;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
@ -76,54 +72,4 @@ public class DeviceSignalServiceImpl extends ServiceImpl<DeviceSignalMapper, Dev
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************************
|
|
||||||
* 用途说明: 新增变电站辅控设备信号
|
|
||||||
* 参数说明 deviceSignal 变电站辅控设备信号对象
|
|
||||||
* 返回值说明: boolean
|
|
||||||
***********************************/
|
|
||||||
@Override
|
|
||||||
public boolean addDeviceSignal(DeviceSignal deviceSignal) {
|
|
||||||
deviceSignal.setLastmodifier(SecurityUtils.getCurrentUsername());
|
|
||||||
deviceSignal.setLastmodifydate(new Timestamp(System.currentTimeMillis()));
|
|
||||||
return this.saveOrUpdate(deviceSignal);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**********************************
|
|
||||||
* 用途说明: 修改变电站辅控设备信号
|
|
||||||
* 参数说明 deviceSignal 变电站辅控设备信号对象
|
|
||||||
* 返回值说明: boolean
|
|
||||||
***********************************/
|
|
||||||
@Override
|
|
||||||
public boolean updateDeviceSignal(DeviceSignal deviceSignal) {
|
|
||||||
deviceSignal.setLastmodifier(SecurityUtils.getCurrentUsername());
|
|
||||||
deviceSignal.setLastmodifydate(new Timestamp(System.currentTimeMillis()));
|
|
||||||
return this.saveOrUpdate(deviceSignal);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**********************************
|
|
||||||
* 用途说明:
|
|
||||||
* 参数说明 deviceId 设备ID
|
|
||||||
* 参数说明 signalName 信号名称
|
|
||||||
* 参数说明 page
|
|
||||||
* 返回值说明: com.baomidou.mybatisplus.extension.plugins.pagination.Page<com.yfd.platform.modules.auxcontrol.domain
|
|
||||||
* .DeviceSignal>
|
|
||||||
***********************************/
|
|
||||||
@Override
|
|
||||||
public Page<DeviceSignal> getDeviceSignalPage(String deviceId, String signalName, Page<DeviceSignal> page) {
|
|
||||||
LambdaQueryWrapper<DeviceSignal> queryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
//如果信号名称signalName不为空 模糊搜索
|
|
||||||
if (StrUtil.isNotBlank(signalName)) {
|
|
||||||
//查询条件拼接模糊
|
|
||||||
queryWrapper.like(DeviceSignal::getSignalName, signalName);
|
|
||||||
}
|
|
||||||
//如果辅控设备ID deviceId不为空
|
|
||||||
if (StrUtil.isNotBlank(deviceId)) {
|
|
||||||
queryWrapper.eq(DeviceSignal::getMeterDeviceId, deviceId);
|
|
||||||
}
|
|
||||||
//排序
|
|
||||||
queryWrapper.orderByDesc(DeviceSignal::getSignalCode);
|
|
||||||
return deviceSignalMapper.selectPage(page, queryWrapper);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,19 +1,16 @@
|
|||||||
package com.yfd.platform.modules.auxcontrol.service.impl;
|
package com.yfd.platform.modules.auxcontrol.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.yfd.platform.modules.auxcontrol.domain.GatewayDevice;
|
import com.yfd.platform.modules.auxcontrol.domain.GatewayDevice;
|
||||||
import com.yfd.platform.modules.auxcontrol.mapper.GatewayDeviceMapper;
|
import com.yfd.platform.modules.auxcontrol.mapper.GatewayDeviceMapper;
|
||||||
import com.yfd.platform.modules.auxcontrol.service.IGatewayDeviceService;
|
import com.yfd.platform.modules.auxcontrol.service.IGatewayDeviceService;
|
||||||
import com.yfd.platform.utils.StringUtils;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@ -26,9 +23,6 @@ import java.util.List;
|
|||||||
@Service
|
@Service
|
||||||
public class GatewayDeviceServiceImpl extends ServiceImpl<GatewayDeviceMapper, GatewayDevice> implements IGatewayDeviceService {
|
public class GatewayDeviceServiceImpl extends ServiceImpl<GatewayDeviceMapper, GatewayDevice> implements IGatewayDeviceService {
|
||||||
|
|
||||||
@Resource
|
|
||||||
private GatewayDeviceMapper gatewayDeviceMapper;
|
|
||||||
|
|
||||||
/**********************************
|
/**********************************
|
||||||
* 用途说明: 根据IP,更新心跳保持时间
|
* 用途说明: 根据IP,更新心跳保持时间
|
||||||
* 参数说明
|
* 参数说明
|
||||||
@ -41,50 +35,4 @@ public class GatewayDeviceServiceImpl extends ServiceImpl<GatewayDeviceMapper, G
|
|||||||
queryWrapper.eq(GatewayDevice::getIpAddr, ip).set(GatewayDevice::getStatus, "01").set(GatewayDevice::getKeepliveTime, new Timestamp(System.currentTimeMillis()));
|
queryWrapper.eq(GatewayDevice::getIpAddr, ip).set(GatewayDevice::getStatus, "01").set(GatewayDevice::getKeepliveTime, new Timestamp(System.currentTimeMillis()));
|
||||||
this.update(queryWrapper);
|
this.update(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Page<GatewayDevice> getGatewayDevicePage(String deviceName, String deviceModel, String deviceType,
|
|
||||||
String status, Page<GatewayDevice> page) {
|
|
||||||
//根据条件查询 变电站系统设备 分页查询变电站系统设备
|
|
||||||
LambdaQueryWrapper<GatewayDevice> queryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
//如果设备名称 deviceName不为空
|
|
||||||
if (StringUtils.isNotEmpty(deviceName)) {
|
|
||||||
queryWrapper.like(GatewayDevice::getDeviceName, deviceName);
|
|
||||||
}
|
|
||||||
//如果设备型号 deviceModel不为空
|
|
||||||
if (StringUtils.isNotEmpty(deviceModel)) {
|
|
||||||
queryWrapper.like(GatewayDevice::getDeviceModel, deviceModel);
|
|
||||||
}
|
|
||||||
//如果设备类型 deviceType不为空
|
|
||||||
if (StringUtils.isNotEmpty(deviceType)) {
|
|
||||||
queryWrapper.eq(GatewayDevice::getDeviceType, deviceType);
|
|
||||||
}
|
|
||||||
//如果设备状态 status不为空
|
|
||||||
if (StringUtils.isNotEmpty(status)) {
|
|
||||||
queryWrapper.eq(GatewayDevice::getStatus, status);
|
|
||||||
}
|
|
||||||
//根据设备编号排序
|
|
||||||
queryWrapper.orderByAsc(GatewayDevice::getDeviceCode);
|
|
||||||
return gatewayDeviceMapper.selectPage(page, queryWrapper);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**********************************
|
|
||||||
* 用途说明: 新增变电站网关设备
|
|
||||||
* 参数说明 gatewayDevice 网关设备对象
|
|
||||||
* 返回值说明: boolean
|
|
||||||
***********************************/
|
|
||||||
@Override
|
|
||||||
public boolean addGatewayDevice(GatewayDevice gatewayDevice) {
|
|
||||||
return this.saveOrUpdate(gatewayDevice);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**********************************
|
|
||||||
* 用途说明: 修改变电站网关设备
|
|
||||||
* 参数说明 gatewayDevice 网关设备对象
|
|
||||||
* 返回值说明: boolean
|
|
||||||
***********************************/
|
|
||||||
@Override
|
|
||||||
public boolean updateGatewayDevice(GatewayDevice gatewayDevice) {
|
|
||||||
return this.saveOrUpdate(gatewayDevice);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,19 +1,11 @@
|
|||||||
package com.yfd.platform.modules.auxcontrol.service.impl;
|
package com.yfd.platform.modules.auxcontrol.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.yfd.platform.modules.auxcontrol.domain.MeterDevice;
|
import com.yfd.platform.modules.auxcontrol.domain.MeterDevice;
|
||||||
import com.yfd.platform.modules.auxcontrol.mapper.MeterDeviceMapper;
|
import com.yfd.platform.modules.auxcontrol.mapper.MeterDeviceMapper;
|
||||||
import com.yfd.platform.modules.auxcontrol.service.IMeterDeviceService;
|
import com.yfd.platform.modules.auxcontrol.service.IMeterDeviceService;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.yfd.platform.utils.SecurityUtils;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.sql.Timestamp;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 变电站二次设备中的智能仪表监控设备 服务实现类
|
* 变电站二次设备中的智能仪表监控设备 服务实现类
|
||||||
@ -25,49 +17,4 @@ import java.util.List;
|
|||||||
@Service
|
@Service
|
||||||
public class MeterDeviceServiceImpl extends ServiceImpl<MeterDeviceMapper, MeterDevice> implements IMeterDeviceService {
|
public class MeterDeviceServiceImpl extends ServiceImpl<MeterDeviceMapper, MeterDevice> implements IMeterDeviceService {
|
||||||
|
|
||||||
@Override
|
|
||||||
public Page<MeterDevice> getDevicePage(String deviceName, String deviceModel, String deviceType, String status,
|
|
||||||
String systemcode, Page<MeterDevice> page) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**********************************
|
|
||||||
* 用途说明: 新增变电站辅控设备信息
|
|
||||||
* 参数说明 meterDevice 辅控设备信息
|
|
||||||
* 返回值说明: boolean
|
|
||||||
***********************************/
|
|
||||||
@Override
|
|
||||||
public boolean addMeterDevice(MeterDevice meterDevice) {
|
|
||||||
meterDevice.setLastmodifier(SecurityUtils.getCurrentUsername());
|
|
||||||
//当前操作时间 最近修改时间
|
|
||||||
meterDevice.setLastmodifydate(new Timestamp(System.currentTimeMillis()));
|
|
||||||
return this.saveOrUpdate(meterDevice);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**********************************
|
|
||||||
* 用途说明: 修改变电站辅控设备信息
|
|
||||||
* 参数说明 meterDevice 辅控设备信息
|
|
||||||
* 返回值说明: boolean
|
|
||||||
***********************************/
|
|
||||||
@Override
|
|
||||||
public boolean updateMeterDevice(MeterDevice meterDevice) {
|
|
||||||
meterDevice.setLastmodifier(SecurityUtils.getCurrentUsername());
|
|
||||||
//当前操作时间 最近修改时间
|
|
||||||
meterDevice.setLastmodifydate(new Timestamp(System.currentTimeMillis()));
|
|
||||||
return this.saveOrUpdate(meterDevice);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**********************************
|
|
||||||
* 用途说明: 批量修改变电站辅控设备信息
|
|
||||||
* 参数说明 ids 设备id集合
|
|
||||||
* 参数说明 ip 设备ip
|
|
||||||
* 返回值说明: boolean
|
|
||||||
***********************************/
|
|
||||||
@Override
|
|
||||||
public boolean batchUpdateDeviceIp(String ids, String ip) {
|
|
||||||
List<String> idList = StrUtil.split(ids, ",");
|
|
||||||
LambdaUpdateWrapper<MeterDevice> updateWrapper = new LambdaUpdateWrapper<>();
|
|
||||||
updateWrapper.in(MeterDevice::getDeviceId, idList).set(MeterDevice::getNetdeviceIp, ip);
|
|
||||||
return this.update(updateWrapper);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user