From 7731fc5a25264616e422b92dab663d91a491f479 Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Wed, 10 May 2023 18:26:06 +0800 Subject: [PATCH] =?UTF-8?q?#=20=E7=AB=99=E7=82=B9=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=9B=86=E4=B8=AD=E7=9B=91=E6=8E=A7=E5=B1=9E?= =?UTF-8?q?=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../operational/station/service/IStationAttributeService.java | 6 ++++++ .../station/service/impl/StationAttributeServiceImpl.java | 9 +++++++++ .../operational/station/service/impl/StationServiceImpl.java | 5 +++++ 3 files changed, 20 insertions(+) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationAttributeService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationAttributeService.java index c9cee14..14121d5 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationAttributeService.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationAttributeService.java @@ -35,4 +35,10 @@ public interface IStationAttributeService extends BaseService getStationCodeList(); Map getPointUnit(); + + /** + * 根据站点编号删除站点属性配置 + * @param stationCode 站点编码 + */ + void removeByStationCode(String stationCode); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationAttributeServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationAttributeServiceImpl.java index 89f37a1..27a0ded 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationAttributeServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationAttributeServiceImpl.java @@ -183,4 +183,13 @@ public class StationAttributeServiceImpl extends BaseServiceImpl queryWrapper = Wrappers.lambdaQuery().eq(StationAttributeEntity::getStationId, stationCode); + List list = this.list(queryWrapper); + if(CollectionUtil.isNotEmpty(list)) { + this.deleteLogic(list.stream().map(StationAttributeEntity::getId).collect(Collectors.toList())); + } + } } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java index 6ab53ce..fe18a39 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java +++ b/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 { + stationAttributeService.removeByStationCode(stationEntity.getCode()); + },"删除站点集中监控属性").start(); return saveFlag; }