Browse Source

修改事件预案查询中设备列表

develop
Mr.Wang 8 months ago
parent
commit
9155b08bd0
  1. 6
      zc-business/src/main/java/com/zc/business/domain/DcEmergencyPlans.java
  2. 15
      zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java

6
zc-business/src/main/java/com/zc/business/domain/DcEmergencyPlans.java

@ -69,6 +69,12 @@ public class DcEmergencyPlans {
@ApiModelProperty("可控设备")
private String controllableDevice;
/**
* 可控设备名称
*/
@ApiModelProperty("可控设备名称")
private String controllableDeviceName;
/**
* 控制指令
*/

15
zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java

@ -61,7 +61,20 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
*/
@Override
public List<DcEmergencyPlans> selectDcEmergencyPlansList(DcEmergencyPlans dcEmergencyPlans) {
return dcEmergencyPlansMapper.selectDcEmergencyPlansList(dcEmergencyPlans);
List<DcEmergencyPlans> dcEmergencyPlansList = dcEmergencyPlansMapper.selectDcEmergencyPlansList(dcEmergencyPlans);
dcEmergencyPlansList.stream()
.filter(dcEmergencyPlans1 -> StringUtils.isNotEmpty(dcEmergencyPlans1.getControllableDevice()))
.forEach(dcEmergencyPlans1 -> {
List<String> deviceIds = Arrays.asList(dcEmergencyPlans1.getControllableDevice().split(","));
List<DcDevice> deviceList = dcDeviceService.listByIds(deviceIds);
StringBuilder stringBuilder = new StringBuilder();
deviceList.forEach(dcDevice -> {
stringBuilder.append(",");
stringBuilder.append(dcDevice.getDeviceName());
});
dcEmergencyPlans1.setControllableDeviceName(stringBuilder.toString().replaceFirst(",",""));
});
return dcEmergencyPlansList;
}
/**

Loading…
Cancel
Save