优化部分逻辑
This commit is contained in:
parent
1bf9a2d40a
commit
acbd0eae9e
@ -69,7 +69,9 @@ public class AlarmThresholdController {
|
||||
Set<String> ids =
|
||||
alarmThresholds.stream().map(AlarmThreshold::getDeviceId).collect(Collectors.toSet());
|
||||
// 删除之前的阈值
|
||||
if (ids.size() > 0) {
|
||||
alarmThresholdService.remove(new LambdaQueryWrapper<AlarmThreshold>().in(AlarmThreshold::getDeviceId, ids));
|
||||
}
|
||||
boolean ok = alarmThresholdService.saveOrUpdateBatch(alarmThresholds);
|
||||
if (ok) {
|
||||
return ResponseResult.success();
|
||||
|
@ -10,14 +10,8 @@ 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.modules.basedata.domain.SubstationComponent;
|
||||
import com.yfd.platform.modules.basedata.domain.SubstationDevice;
|
||||
import com.yfd.platform.modules.basedata.domain.SubstationMaindevice;
|
||||
import com.yfd.platform.modules.basedata.domain.TreeNode;
|
||||
import com.yfd.platform.modules.basedata.service.IDeviceChannelService;
|
||||
import com.yfd.platform.modules.basedata.service.ISubstationDeviceService;
|
||||
import com.yfd.platform.modules.basedata.service.ISubstationMaindeviceService;
|
||||
import com.yfd.platform.modules.basedata.service.ISubstationPatroldeviceService;
|
||||
import com.yfd.platform.modules.basedata.domain.*;
|
||||
import com.yfd.platform.modules.basedata.service.*;
|
||||
import com.yfd.platform.system.domain.SysDictionaryItems;
|
||||
import com.yfd.platform.system.domain.SysUser;
|
||||
import com.yfd.platform.system.service.ISysOrganizationService;
|
||||
@ -80,6 +74,12 @@ public class SubstationDeviceController {
|
||||
@Resource
|
||||
private ISysOrganizationService sysOrganizationService;
|
||||
|
||||
@Resource
|
||||
private ISubstationBayService substationBayService;
|
||||
@Resource
|
||||
private ISubstationComponentService substationComponentService;
|
||||
|
||||
|
||||
@PostMapping("/getSubstationDeviceList")
|
||||
@ApiOperation("分页查询巡视点位")
|
||||
@PreAuthorize("@el.check('select:device')")
|
||||
@ -567,7 +567,7 @@ public class SubstationDeviceController {
|
||||
|
||||
@PostMapping("/createDeviceByLine")
|
||||
@ApiOperation("根据航线生成点位")
|
||||
public void createDeviceByLine(String filePath,String bayId,String bayName) throws IOException {
|
||||
public void createDeviceByLine(String filePath,String bayId,String componentId,String bayName) throws IOException {
|
||||
try {
|
||||
List<String> labelList = new ArrayList<>();
|
||||
File file = new File(filePath);
|
||||
@ -598,92 +598,24 @@ public class SubstationDeviceController {
|
||||
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 变电站id
|
||||
*/
|
||||
SubstationComponent substationComponent = substationComponentService.getById(bayId);
|
||||
if (substationComponent == null) {
|
||||
return;
|
||||
}
|
||||
String stationId = "35c4e466ddd9809445d3f880f94b4a2f";
|
||||
|
||||
String stationName = "500kV庄周变电站";
|
||||
|
||||
/**
|
||||
* 和中台对应资源 ID 保持一致
|
||||
*/
|
||||
String stationCode = "7FE4BB37-F54A-4808-852B-6CAB43DD71B3-00001";
|
||||
|
||||
/**
|
||||
* 和中台对应资源 ID 保持一致
|
||||
*/
|
||||
String areaId = "f77421bca31a87c361e87e6ee107c5ed";
|
||||
|
||||
/**
|
||||
* 区域全名
|
||||
*/
|
||||
String areaName = "无人机巡检区域";
|
||||
|
||||
/**
|
||||
* 和中台对应资源 ID 保持一致
|
||||
*/
|
||||
// String bayId = "753befbf2a10ed3c684f2b4ddd1be8bd";
|
||||
|
||||
/**
|
||||
* 间隔全名
|
||||
*/
|
||||
// String bayName = "无人机巡检间隔";
|
||||
|
||||
/**
|
||||
* 主设备ID,和中台对应资源 ID 保持一致
|
||||
*/
|
||||
String mainDeviceId = "7f84eebefcf838f9419f433e5e740d68";
|
||||
|
||||
/**
|
||||
* 主设备全名
|
||||
*/
|
||||
String mainDeviceName = "无人机巡检主设备";
|
||||
|
||||
/**
|
||||
* 主设备类型,字典项,选择主设备列表的时候带过来
|
||||
*/
|
||||
String deviceType = "24";
|
||||
|
||||
/**
|
||||
* 和中台对应资源 ID 保持一致
|
||||
*/
|
||||
String componentId = "2ad2ceca3116b07a5f5689d302778f7d";
|
||||
|
||||
/**
|
||||
* 部件名称
|
||||
*/
|
||||
String componentName = "无人机巡检部件";
|
||||
|
||||
/**
|
||||
* 采集/保存文件类型列表,格式:多个采集文件类型,采用","分隔
|
||||
*/
|
||||
String stationName = substationComponent.getStationName();
|
||||
String stationCode = substationComponent.getStationCode();
|
||||
String areaId = substationComponent.getAreaId();
|
||||
String areaName =substationComponent.getAreaName();
|
||||
String mainDeviceId = substationComponent.getMainDeviceId();
|
||||
String mainDeviceName = substationComponent.getMainDeviceName();
|
||||
String deviceType = substationComponent.getDeviceType();
|
||||
String componentName = substationComponent.getComponentName();
|
||||
String saveTypeList = "2";
|
||||
|
||||
/**
|
||||
* 识别类型列表,格式:多个识别类型,采用","分隔
|
||||
*/
|
||||
String recognitionTypeList = "2";
|
||||
|
||||
/**
|
||||
* <1>:=A 相<2>:=B 相<3>:=C 相 多个相位,采用","分隔
|
||||
*/
|
||||
String phase = "1";
|
||||
|
||||
|
||||
/**
|
||||
* 按位定义数据来源,支持 32 位 1 为有效, 0 为无效,如下:第 0 位:摄像机第 1 位:机器人第 2 位:无人机第 3 位:声纹第 4 位:在线监测区域巡视主机上报上级系统填写
|
||||
*/
|
||||
String dataType = "0x03";
|
||||
|
||||
/**
|
||||
* 关联视频编码及预置位,json格式
|
||||
*/
|
||||
String videoPos = "{\"device_code\":\"\",\"device_pos\":\"\",\"robot_code\":\"\",\"robot_pos\":\"\",\"uav_code\":\"\"}";
|
||||
|
||||
/**
|
||||
* 0:不进行告警;1:进行告警
|
||||
*/
|
||||
String isAlarm = "0";
|
||||
|
||||
String deviceClass = "1";
|
||||
|
Loading…
Reference in New Issue
Block a user