|
@@ -5,17 +5,16 @@ import cn.hfln.framework.extension.BizException;
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
+import com.hfln.portal.common.request.event.AlarmPlanDelReq;
|
|
|
import com.hfln.portal.common.request.web.AdminDealUnbindParam;
|
|
|
import com.hfln.portal.common.request.web.AdminQueryWxUserParam;
|
|
|
import com.hfln.portal.common.response.user.UserInfoDto;
|
|
|
import com.hfln.portal.domain.customer.OprLogType;
|
|
|
import com.hfln.portal.domain.customer.util.CopyUtils;
|
|
|
import com.hfln.portal.domain.exception.ErrorEnum;
|
|
|
+import com.hfln.portal.domain.gateway.AlarmGateway;
|
|
|
import com.hfln.portal.domain.gateway.WebAdminDealGateway;
|
|
|
-import com.hfln.portal.infrastructure.po.DevInfo;
|
|
|
-import com.hfln.portal.infrastructure.po.DevShare;
|
|
|
-import com.hfln.portal.infrastructure.po.GroupDevMap;
|
|
|
-import com.hfln.portal.infrastructure.po.UserInfo;
|
|
|
+import com.hfln.portal.infrastructure.po.*;
|
|
|
import com.hfln.portal.infrastructure.service.*;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -38,6 +37,10 @@ public class WebAdminDealGatewayImpl implements WebAdminDealGateway {
|
|
|
private TblOprLogService tblOprLogService;
|
|
|
@Autowired
|
|
|
private UserService userService;
|
|
|
+ @Autowired
|
|
|
+ private AlarmGateway alarmGateway;
|
|
|
+ @Autowired
|
|
|
+ private AlarmPlanService alarmPlanService;
|
|
|
|
|
|
@Override
|
|
|
@Transactional
|
|
@@ -48,6 +51,7 @@ public class WebAdminDealGatewayImpl implements WebAdminDealGateway {
|
|
|
// 3 设备所属租户 解绑
|
|
|
// 2 设备被分享者 逻辑删除
|
|
|
// 4 群组分享表 逻辑删除
|
|
|
+ // 5 设备下告警计划 物理删除
|
|
|
log.info("超管对设备devId:{}, 进行解绑", param.getDevId());
|
|
|
|
|
|
DevInfo devInfo = devInfoService.getById(param.getDevId());
|
|
@@ -76,6 +80,21 @@ public class WebAdminDealGatewayImpl implements WebAdminDealGateway {
|
|
|
.eq(GroupDevMap::getIsDeleted, 0)
|
|
|
.set(GroupDevMap::getIsDeleted, 1)
|
|
|
);
|
|
|
+ // 设备下告警计划 物理删除
|
|
|
+ List<AlarmPlan> alarmPlans = alarmPlanService.queryByClientId(devInfo.getClientId());
|
|
|
+
|
|
|
+ if (alarmPlans != null && !alarmPlans.isEmpty()) {
|
|
|
+ for (AlarmPlan plan : alarmPlans){
|
|
|
+ try {
|
|
|
+ AlarmPlanDelReq req = new AlarmPlanDelReq();
|
|
|
+ req.setId(plan.getId());
|
|
|
+ alarmGateway.delPlan(req);
|
|
|
+ log.info("已删除告警计划,planId={}", plan.getId());
|
|
|
+ }catch (Exception e){
|
|
|
+ log.error("删除告警计划失败,planId={}", plan.getId(), e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
// 对设备 绑定信息置空信息
|
|
|
devInfoService.resetDevInfo(devInfo.getDevId());
|