辅控模块功能
This commit is contained in:
parent
faa8d48ccd
commit
fca9fca0c2
@ -1,19 +1,23 @@
|
|||||||
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.web.bind.annotation.GetMapping;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
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;
|
||||||
|
|
||||||
@ -30,13 +34,115 @@ import java.util.Map;
|
|||||||
@Api(value = "DeviceSignalController", tags = "变电站辅控设备信号")
|
@Api(value = "DeviceSignalController", tags = "变电站辅控设备信号")
|
||||||
public class DeviceSignalController {
|
public class DeviceSignalController {
|
||||||
|
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private DeviceSignalMapper deviceSignalMapper;
|
private IDeviceSignalService deviceSignalService;
|
||||||
|
|
||||||
@GetMapping("/getDeviceSignal")
|
|
||||||
@ApiOperation("查询信号")
|
|
||||||
public ResponseResult getDeviceSignal(String type, String address) {
|
|
||||||
return ResponseResult.successData(deviceSignalMapper.selectDeviceSignalMap("", type, address));
|
|
||||||
|
|
||||||
|
/**********************************
|
||||||
|
* 用途说明: 分页查询变电站辅控设备信号
|
||||||
|
* 参数说明
|
||||||
|
* deviceId 辅控设备ID
|
||||||
|
* 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -123,9 +123,9 @@ public class GatewayDeviceController {
|
|||||||
* 返回值说明: com.yfd.platform.config.ResponseResult 返回删除成功或者失败
|
* 返回值说明: com.yfd.platform.config.ResponseResult 返回删除成功或者失败
|
||||||
***********************************/
|
***********************************/
|
||||||
@Log(module = "数据变电站系统设备", value = "根据ID删除变电站网关设备", type = "1")
|
@Log(module = "数据变电站系统设备", value = "根据ID删除变电站网关设备", type = "1")
|
||||||
@PostMapping("/deleteBatchGateway")
|
@PostMapping("/batchDeleteGateway")
|
||||||
@ApiOperation("根据ID批量删除变电站网关设备")
|
@ApiOperation("根据ID批量删除变电站网关设备")
|
||||||
public ResponseResult deleteBatchGateway(@RequestBody List<String> ids) {
|
public ResponseResult batchDeleteGateway(@RequestBody List<String> ids) {
|
||||||
if (ids.size() <= 0) {
|
if (ids.size() <= 0) {
|
||||||
return ResponseResult.error("参数为空");
|
return ResponseResult.error("参数为空");
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,20 @@
|
|||||||
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.Api;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@ -19,4 +29,142 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
@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,5 +1,6 @@
|
|||||||
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;
|
||||||
|
|
||||||
@ -26,4 +27,27 @@ 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,5 +1,6 @@
|
|||||||
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;
|
||||||
|
|
||||||
@ -13,4 +14,38 @@ 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,10 +3,14 @@ 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;
|
||||||
@ -72,4 +76,54 @@ 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,11 +1,19 @@
|
|||||||
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>
|
||||||
* 变电站二次设备中的智能仪表监控设备 服务实现类
|
* 变电站二次设备中的智能仪表监控设备 服务实现类
|
||||||
@ -17,4 +25,49 @@ import org.springframework.stereotype.Service;
|
|||||||
@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