Browse Source

# 站点删除删除集中监控属性

zhongwei
haungxing 2 years ago
parent
commit
7731fc5a25
  1. 6
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationAttributeService.java
  2. 9
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationAttributeServiceImpl.java
  3. 5
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java

6
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationAttributeService.java

@ -35,4 +35,10 @@ public interface IStationAttributeService extends BaseService<StationAttributeEn
List<String> getStationCodeList();
Map<String,String> getPointUnit();
/**
* 根据站点编号删除站点属性配置
* @param stationCode 站点编码
*/
void removeByStationCode(String stationCode);
}

9
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationAttributeServiceImpl.java

@ -183,4 +183,13 @@ public class StationAttributeServiceImpl extends BaseServiceImpl<StationAttribut
}
return list.stream().collect(Collectors.toMap(StationAttributeEntity::getAttributes, StationAttributeEntity::getUnit));
}
@Override
public void removeByStationCode(String stationCode) {
LambdaQueryWrapper<StationAttributeEntity> queryWrapper = Wrappers.<StationAttributeEntity>lambdaQuery().eq(StationAttributeEntity::getStationId, stationCode);
List<StationAttributeEntity> list = this.list(queryWrapper);
if(CollectionUtil.isNotEmpty(list)) {
this.deleteLogic(list.stream().map(StationAttributeEntity::getId).collect(Collectors.toList()));
}
}
}

5
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java

@ -15,6 +15,7 @@ import com.hnac.hzims.operational.station.entity.ControlUsersEntity;
import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.mapper.ControlUsersMapper;
import com.hnac.hzims.operational.station.mapper.StationMapper;
import com.hnac.hzims.operational.station.service.IStationAttributeService;
import com.hnac.hzims.operational.station.service.IStationService;
import com.hnac.hzims.operational.station.vo.HzimsStationCountVo;
import com.hnac.hzims.operational.station.vo.StationAndDeptVo;
@ -69,6 +70,7 @@ public class StationServiceImpl extends BaseServiceImpl<StationMapper, StationEn
private final ProjectClient projectClient;
private final BladeLogger logger;
private final IQuestionClient questionClient;
private final IStationAttributeService stationAttributeService;
@Override
public void buildStation(StationEntity req) {
@ -146,6 +148,9 @@ public class StationServiceImpl extends BaseServiceImpl<StationMapper, StationEn
// 删除智能诊断站点
questionClient.deleteStationInfo(stationEntity.getCode());
}
new Thread(()-> {
stationAttributeService.removeByStationCode(stationEntity.getCode());
},"删除站点集中监控属性").start();
return saveFlag;
}

Loading…
Cancel
Save