Merge pull request 'master' (#10) from master into prod
All checks were successful
Build and Push to Target Registry / 构建并推送镜像到目标仓库 (push) Successful in 12m16s
All checks were successful
Build and Push to Target Registry / 构建并推送镜像到目标仓库 (push) Successful in 12m16s
合并分支
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package org.dromara.sis.api;
|
||||
|
||||
import org.dromara.sis.api.domain.DeviceStateInfo;
|
||||
import org.dromara.sis.api.domain.RemoteSdkChannel;
|
||||
import org.dromara.sis.api.domain.RemoteSisDeviceManage;
|
||||
|
||||
@@ -15,6 +16,15 @@ public interface RemoteHikSdkService {
|
||||
*/
|
||||
Boolean deviceLogin(RemoteSisDeviceManage item);
|
||||
|
||||
|
||||
/**
|
||||
* 海康sdk 登录操作
|
||||
*
|
||||
* @param item 登录参数
|
||||
* @return 是否登录成功
|
||||
*/
|
||||
DeviceStateInfo checkState(RemoteSisDeviceManage item);
|
||||
|
||||
/**
|
||||
* 获取nvr设备通道信息
|
||||
*
|
||||
|
@@ -0,0 +1,26 @@
|
||||
package org.dromara.sis.api.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class DeviceStateInfo {
|
||||
|
||||
|
||||
/**
|
||||
* 设备是否在线 0 在线,1离线
|
||||
*/
|
||||
private Integer online;
|
||||
|
||||
/**
|
||||
* 最新的心跳时间
|
||||
*/
|
||||
private Date heartbeat;
|
||||
|
||||
/**
|
||||
* 设备状态吗
|
||||
*/
|
||||
private Integer deviceState;
|
||||
|
||||
}
|
@@ -95,5 +95,7 @@ public class CostHouseChargeBo extends BaseEntity {
|
||||
private String remark;
|
||||
|
||||
|
||||
private String chargeTime;
|
||||
|
||||
|
||||
}
|
||||
|
@@ -9,6 +9,8 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.dromara.common.translation.annotation.Translation;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.dromara.common.translation.constant.TransConstant;
|
||||
@@ -60,7 +62,7 @@ public class InspectionTaskDetailBo extends BaseEntity {
|
||||
/**
|
||||
* 实际巡检时间
|
||||
*/
|
||||
private Date actualInspectionTime;
|
||||
private LocalDateTime actualInspectionTime;
|
||||
|
||||
/**
|
||||
* 实际签到状态(1已签到2.未签到)
|
||||
@@ -106,7 +108,7 @@ public class InspectionTaskDetailBo extends BaseEntity {
|
||||
/**
|
||||
* 实际巡检时间
|
||||
*/
|
||||
private Date inspectionTime;
|
||||
private LocalDateTime inspectionTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
|
@@ -1,6 +1,8 @@
|
||||
package org.dromara.property.domain.vo;
|
||||
|
||||
import org.dromara.common.translation.annotation.Translation;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.dromara.common.translation.constant.TransConstant;
|
||||
@@ -94,7 +96,7 @@ public class InspectionTaskDetailVo implements Serializable {
|
||||
* 实际巡检时间
|
||||
*/
|
||||
@ExcelProperty(value = "实际巡检时间")
|
||||
private Date actualInspectionTime;
|
||||
private LocalDateTime actualInspectionTime;
|
||||
|
||||
/**
|
||||
* 实际签到状态(1已签到2.未签到)
|
||||
|
@@ -2,7 +2,9 @@ package org.dromara.property.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.lang.TypeReference;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
@@ -25,6 +27,9 @@ import org.dromara.property.domain.vo.*;
|
||||
import org.dromara.property.domain.vo.residentVo.ResidentPersonVo;
|
||||
import org.dromara.property.domain.vo.residentVo.ResidentUnitVo;
|
||||
import org.dromara.property.mapper.*;
|
||||
import org.dromara.property.service.ITbFloorService;
|
||||
import org.dromara.property.service.ITbRoomService;
|
||||
import org.dromara.property.service.smartDevicesService.ITbMeterRecordService;
|
||||
import org.dromara.system.api.RemoteDictService;
|
||||
import org.dromara.system.api.RemoteUserService;
|
||||
import org.dromara.system.api.domain.vo.RemoteDictDataVo;
|
||||
@@ -62,6 +67,10 @@ public class CostHouseChargeServiceImpl implements ICostHouseChargeService {
|
||||
@DubboReference
|
||||
private RemoteDictService remoteDictService;
|
||||
|
||||
private final ITbRoomService tbRoomService;
|
||||
private final ITbFloorService tbFloorService;
|
||||
private final ITbMeterRecordService tbMeterRecordService;
|
||||
|
||||
/**
|
||||
* 查询房屋收费
|
||||
*
|
||||
@@ -185,7 +194,7 @@ public class CostHouseChargeServiceImpl implements ICostHouseChargeService {
|
||||
ResidentUnitVo residentUnitVo = residentUnitMapper.selectVoById(add.getResidentUnitId());
|
||||
add.setResidentUnitId(residentUnitVo.getId());
|
||||
add.setArea(residentUnitVo.getArea());
|
||||
BigDecimal area = new BigDecimal(add.getArea());
|
||||
BigDecimal area = BigDecimal.valueOf(add.getArea());
|
||||
CostItemsVo costItemsVo = costItemsMapper.selectVoById(add.getCostItemsId());
|
||||
BigDecimal unitPrice = costItemsVo.getUnitPrice();
|
||||
// //向上取整
|
||||
@@ -214,11 +223,11 @@ public class CostHouseChargeServiceImpl implements ICostHouseChargeService {
|
||||
}
|
||||
//类型为5,则为水费
|
||||
if (Objects.equals(remoteDictDataVo.getDictValue(), "5")) {
|
||||
|
||||
|
||||
add.setAmountReceivable(meterCharge(residentUnitVo.getLocation(), area, 2L, bo));
|
||||
}
|
||||
//类型为6,则为电费
|
||||
if (Objects.equals(remoteDictDataVo.getDictValue(), "6")) {
|
||||
add.setAmountReceivable(meterCharge(residentUnitVo.getLocation(), area, 1L, bo));
|
||||
}
|
||||
//类型为8,则为气费
|
||||
if (Objects.equals(remoteDictDataVo.getDictValue(), "8")) {
|
||||
@@ -250,8 +259,44 @@ public class CostHouseChargeServiceImpl implements ICostHouseChargeService {
|
||||
/**
|
||||
* 水电气费计算
|
||||
*/
|
||||
private void meterCharge(){
|
||||
private BigDecimal meterCharge(String location, BigDecimal roomArea, Long meterType, CostHouseChargeBo bo) {
|
||||
if (StringUtils.isNotBlank(location)) {
|
||||
String[] roomIds = location.split(",");
|
||||
Map<Long, TbFloorVo> floorData = new HashMap<>(); // 存储去重的楼层数据
|
||||
|
||||
for (String item : roomIds) {
|
||||
TbRoomVo roomVo = tbRoomService.queryById(Long.valueOf(item));
|
||||
if (roomVo != null) {
|
||||
Long floorId = roomVo.getFloorId();
|
||||
// 保存楼层数据(如果尚未存在)
|
||||
if (!floorData.containsKey(floorId)) {
|
||||
// 假设您有获取楼层信息的方法,这里需要根据实际情况调整
|
||||
TbFloorVo floorVo = tbFloorService.queryById(floorId);
|
||||
if (floorVo != null) {
|
||||
floorData.put(floorId, floorVo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Float floorArea = 0f;
|
||||
Float meterEnergy = 0f;
|
||||
for (Map.Entry<Long, TbFloorVo> entry : floorData.entrySet()) {
|
||||
floorArea += entry.getValue().getArea();
|
||||
Map<String, Object> meterRecord = tbMeterRecordService.getEnergyTrend(entry.getKey().toString(), null, meterType, null, bo.getChargeTime(), null);
|
||||
Map<String, Object> resultMap = Convert.convert(new TypeReference<>() {
|
||||
}, meterRecord.get("nowMonth"));
|
||||
meterEnergy += Convert.convert(Float.class, resultMap.get("total"));
|
||||
}
|
||||
|
||||
BigDecimal floorAreaBD = Convert.toBigDecimal(floorArea);
|
||||
BigDecimal meterEnergyBD = Convert.toBigDecimal(meterEnergy);
|
||||
|
||||
return roomArea.divide(floorAreaBD, 10, RoundingMode.HALF_UP)
|
||||
.multiply(meterEnergyBD)
|
||||
.multiply(Convert.toBigDecimal(0.9));
|
||||
}
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.property.domain.CustomerContingenPlan;
|
||||
import org.dromara.property.domain.CustomerContingenPlanRecord;
|
||||
import org.dromara.property.domain.entity.resident.ResidentPerson;
|
||||
@@ -21,12 +22,14 @@ import org.dromara.property.mapper.CustomerContingenPlanMapper;
|
||||
import org.dromara.property.mapper.CustomerContingenPlanRecordMapper;
|
||||
import org.dromara.property.mapper.ResidentPersonMapper;
|
||||
import org.dromara.property.service.ICustomerContingenPlanService;
|
||||
import org.dromara.system.api.model.LoginUser;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 客户服务-应急预案Service业务层处理
|
||||
@@ -102,7 +105,23 @@ public class CustomerContingenPlanServiceImpl implements ICustomerContingenPlanS
|
||||
@Override
|
||||
public List<CustomerContingenPlanVo> queryList(CustomerContingenPlanBo bo) {
|
||||
LambdaQueryWrapper<CustomerContingenPlan> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
List<CustomerContingenPlanVo> customerContingenPlanVos = baseMapper.selectVoList(lqw);
|
||||
customerContingenPlanVos.forEach(s -> {
|
||||
if (Objects.equals(s.getContingenPlanType(), "0")) {
|
||||
s.setContingenPlanType("自然灾害");
|
||||
}
|
||||
if (Objects.equals(s.getContingenPlanType(), "1")) {
|
||||
s.setContingenPlanType("事故灾难");
|
||||
}
|
||||
if (Objects.equals(s.getContingenPlanType(), "2")) {
|
||||
s.setContingenPlanType("公共卫生");
|
||||
}
|
||||
if (Objects.equals(s.getContingenPlanType(), "3")) {
|
||||
s.setContingenPlanType("社会安全");
|
||||
}
|
||||
});
|
||||
|
||||
return customerContingenPlanVos;
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<CustomerContingenPlan> buildQueryWrapper(CustomerContingenPlanBo bo) {
|
||||
|
@@ -26,6 +26,7 @@ import org.dromara.property.domain.enums.OrderReportingTypeEnum;
|
||||
import org.dromara.property.domain.enums.OrderTypeOperationEnum;
|
||||
import org.dromara.property.domain.enums.WorkOrderStatusEnum;
|
||||
import org.dromara.property.domain.vo.*;
|
||||
import org.dromara.property.domain.vo.attendanceVo.AttendanceArrangementVo;
|
||||
import org.dromara.property.domain.vo.mobile.MInspectionTaskDetailVo;
|
||||
import org.dromara.property.domain.vo.mobile.MServiceWorkOrdersRecordVo;
|
||||
import org.dromara.property.domain.vo.mobile.MServiceWorkOrdersVo;
|
||||
@@ -39,6 +40,7 @@ import org.dromara.property.service.IInspectionTaskDetailService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -113,7 +115,17 @@ public class InspectionTaskDetailServiceImpl implements IInspectionTaskDetailSer
|
||||
});
|
||||
}
|
||||
|
||||
return TableDataInfo.build(result);
|
||||
Page<InspectionTaskDetailVo> inspectionTaskDetailVoPage = result.setRecords(result.getRecords().stream().map(vo -> {
|
||||
LoginUser loginUser = LoginHelper.getLoginUser();
|
||||
vo.setActualInspectionPerson(loginUser.getNickname());
|
||||
vo.setPlanInspectionPerson(loginUser.getNickname());
|
||||
vo.setActualInspectionTime(LocalDateTime.now());
|
||||
// vo.setSignType();
|
||||
|
||||
return vo;
|
||||
}).collect(Collectors.toList()));
|
||||
|
||||
return TableDataInfo.build(inspectionTaskDetailVoPage);
|
||||
}
|
||||
|
||||
private void disposeData(InspectionTaskDetailVo vo, Map<Long, String> taskNameMap, Map<Long, String> routeNameMap, Map<Long, String> planNameMap, Map<Long, String> pointNameMap) {
|
||||
@@ -311,7 +323,9 @@ public class InspectionTaskDetailServiceImpl implements IInspectionTaskDetailSer
|
||||
//当前登录用户id
|
||||
LoginUser loginUser = LoginHelper.getLoginUser();
|
||||
Assert.isTrue(planInspectionPersonIds.contains(loginUser.getUserId()), "当前签到人不在计划巡检人列表内");
|
||||
bo.setActualInspectionPerson(loginUser.getUserId().toString());
|
||||
bo.setActualInspectionPerson(loginUser.getNickname());
|
||||
// bo.setActualInspectionTime(LocalDateTime.now());
|
||||
bo.setInspectionTime(LocalDateTime.now());
|
||||
InspectionTaskDetail update = MapstructUtils.convert(bo, InspectionTaskDetail.class);
|
||||
boolean flag = baseMapper.updateById(update) > 0;
|
||||
if (flag) {
|
||||
|
@@ -13,7 +13,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.property.domain.ServiceWorkOrders;
|
||||
import org.dromara.property.domain.bo.ServiceWorkOrdersBo;
|
||||
import org.dromara.property.domain.bo.smartDevicesBo.TbMeterInfoBo;
|
||||
import org.dromara.property.domain.enums.MeterRecordTypeEnum;
|
||||
@@ -258,6 +257,7 @@ public class TbMeterRecordServiceImpl implements ITbMeterRecordService {
|
||||
int hour = record.getReadingTime().toInstant().atZone(ZoneId.systemDefault()).getHour();
|
||||
ServiceWorkOrdersBo ordersBo = new ServiceWorkOrdersBo();
|
||||
ordersBo.setTenantId(info.getTenantId());
|
||||
ordersBo.setInitiatorName("超级管理员");
|
||||
|
||||
// 判断是白天还是夜间
|
||||
boolean isDaytime = hour > 8 && hour <= 20;
|
||||
|
@@ -14,7 +14,7 @@ import java.util.Map;
|
||||
* 抄记录Service接口
|
||||
*
|
||||
* @author lsm
|
||||
* @date 2025-07-19
|
||||
* @since 2025-07-19
|
||||
*/
|
||||
public interface ITbMeterRecordService {
|
||||
|
||||
|
@@ -126,4 +126,17 @@ public class SisAlarmEventsBo extends BaseEntity {
|
||||
private Date finishTime;
|
||||
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 0: 按id降序
|
||||
* 1:按id升序
|
||||
* 2:按创建时间降序
|
||||
* 3:按创建时间升序
|
||||
* 4:按指派时间降序
|
||||
* 5 按指派时间升序
|
||||
* 6 按完成时间升序
|
||||
* 7 按完成时间升序
|
||||
*/
|
||||
private Integer orderBy = 0;
|
||||
|
||||
}
|
||||
|
@@ -5,6 +5,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.dromara.sis.api.RemoteHikSdkService;
|
||||
import org.dromara.sis.api.domain.DeviceStateInfo;
|
||||
import org.dromara.sis.api.domain.RemoteSdkChannel;
|
||||
import org.dromara.sis.api.domain.RemoteSisDeviceManage;
|
||||
import org.dromara.sis.domain.covert.CommonBeanCovert;
|
||||
@@ -28,6 +29,14 @@ public class RemoteSdkServiceImpl implements RemoteHikSdkService {
|
||||
return hikApiService.login(item.getDeviceIp(), item.getDevicePort().shortValue(), item.getDeviceAccount(), item.getDevicePwd(), item.getDeviceType());
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceStateInfo checkState(RemoteSisDeviceManage item) {
|
||||
if (item == null) {
|
||||
throw new RuntimeException("设备信息为null");
|
||||
}
|
||||
return hikApiService.checkState(item.getDeviceIp(), item.getDevicePort().shortValue(), item.getDeviceAccount(), item.getDevicePwd(), item.getDeviceType());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RemoteSdkChannel> getDeviceChannel(String deviceIp) {
|
||||
DeviceInfo channelInfo = hikApiService.getChannelInfo(deviceIp);
|
||||
|
@@ -5,6 +5,7 @@ import com.alibaba.fastjson2.JSONObject;
|
||||
import com.alibaba.fastjson2.TypeReference;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.sis.api.domain.DeviceStateInfo;
|
||||
import org.dromara.sis.config.HikEqpConfig;
|
||||
import org.dromara.sis.sdk.zkmedia.model.R;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -23,6 +24,7 @@ public class HikApiService {
|
||||
private HikEqpConfig hikEqpConfig;
|
||||
|
||||
private static final String LOGIN_URI = "login";
|
||||
private static final String CHECK_STATE_URI = "check/state";
|
||||
private static final String LOGOUT_URI = "logout";
|
||||
private static final String CHANNEL_LIST = "channel/list";
|
||||
private static final String FACE_UPLOAD = "flib/add";
|
||||
@@ -69,6 +71,17 @@ public class HikApiService {
|
||||
return request(LOGIN_URI, params.toJSONString(), Boolean.class);
|
||||
}
|
||||
|
||||
public DeviceStateInfo checkState(String ip, short port, String user, String psw, Integer deviceType) {
|
||||
JSONObject params = new JSONObject();
|
||||
params.put("deviceIp", ip);
|
||||
params.put("devicePort", port);
|
||||
params.put("deviceAccount", user);
|
||||
params.put("devicePassword", psw);
|
||||
params.put("deviceType", deviceType);
|
||||
return request(CHECK_STATE_URI, params.toJSONString(), DeviceStateInfo.class);
|
||||
}
|
||||
|
||||
|
||||
public Boolean loginOut(String deviceIp) {
|
||||
JSONObject params = new JSONObject();
|
||||
params.put("deviceIp", deviceIp);
|
||||
|
@@ -99,6 +99,7 @@ public class SisAlarmEventsServiceImpl implements ISisAlarmEventsService {
|
||||
@Override
|
||||
public TableDataInfo<SisAlarmEventsVo> queryPageList(SisAlarmEventsBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<SisAlarmEvents> lqw = buildQueryWrapper(bo);
|
||||
|
||||
lqw.orderByDesc(SisAlarmEvents::getId);
|
||||
Page<SisAlarmEventsVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
@@ -137,6 +138,24 @@ public class SisAlarmEventsServiceImpl implements ISisAlarmEventsService {
|
||||
Date end = DateUtil.endOfDay(bo.getReportTime());
|
||||
lqw.between(SisAlarmEvents::getReportTime, start, end);
|
||||
}
|
||||
|
||||
if (bo.getOrderBy() == 0) {
|
||||
lqw.orderByDesc(SisAlarmEvents::getId);
|
||||
} else if (bo.getOrderBy() == 1) {
|
||||
lqw.orderByAsc(SisAlarmEvents::getId);
|
||||
} else if (bo.getOrderBy() == 2) {
|
||||
lqw.orderByDesc(SisAlarmEvents::getCreateTime);
|
||||
} else if (bo.getOrderBy() == 3) {
|
||||
lqw.orderByAsc(SisAlarmEvents::getCreateTime);
|
||||
} else if (bo.getOrderBy() == 4) {
|
||||
lqw.orderByDesc(SisAlarmEvents::getSolveTime);
|
||||
} else if (bo.getOrderBy() == 5) {
|
||||
lqw.orderByAsc(SisAlarmEvents::getSolveTime);
|
||||
} else if (bo.getOrderBy() == 6) {
|
||||
lqw.orderByAsc(SisAlarmEvents::getFinishTime);
|
||||
} else if (bo.getOrderBy() == 7) {
|
||||
lqw.orderByAsc(SisAlarmEvents::getFinishTime);
|
||||
}
|
||||
return lqw;
|
||||
}
|
||||
|
||||
|
@@ -13,6 +13,7 @@ import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.dromara.common.core.utils.SpringUtils;
|
||||
import org.dromara.sis.api.RemoteDeviceService;
|
||||
import org.dromara.sis.api.RemoteHikSdkService;
|
||||
import org.dromara.sis.api.domain.DeviceStateInfo;
|
||||
import org.dromara.sis.api.domain.RemoteSdkChannel;
|
||||
import org.dromara.sis.api.domain.RemoteSisDeviceChannel;
|
||||
import org.dromara.sis.api.domain.RemoteSisDeviceManage;
|
||||
@@ -170,18 +171,17 @@ public class HikDeviceCheckStateTask {
|
||||
public void updateDeviceStatus(RemoteSisDeviceManage item) {
|
||||
log.info("开始同步设备状态,params={}", item);
|
||||
// 调用设备登录验证次设备在线
|
||||
Boolean isLogin = remoteHikSdkService.deviceLogin(item);
|
||||
int onLineState = isLogin ? 1 : 0;
|
||||
if (!Objects.equals(item.getDeviceStatus(), onLineState)) {
|
||||
SnailJobLog.REMOTE.info("设备[{}]在线状态变更,开始更新状态。 old={},new ={} ", item.getDeviceIp(), item.getDeviceStatus(), onLineState);
|
||||
item.setDeviceStatus(onLineState);
|
||||
DeviceStateInfo stateInfo = remoteHikSdkService.checkState(item);
|
||||
if (!Objects.equals(item.getDeviceStatus(), stateInfo.getDeviceState())) {
|
||||
SnailJobLog.REMOTE.info("设备[{}]在线状态变更,开始更新状态。 old={},new ={} ", item.getDeviceIp(), item.getDeviceStatus(), stateInfo.getDeviceState());
|
||||
item.setDeviceStatus(stateInfo.getDeviceState());
|
||||
Boolean result = remoteDeviceService.updateDeviceState(item);
|
||||
SnailJobLog.REMOTE.info("设备[{}]在线状态变更,状态更新完成。 result={} ", item.getDeviceIp(), result);
|
||||
|
||||
// 监测当前设备是否存在通道,如果有则跟新通道信息
|
||||
List<RemoteSisDeviceChannel> ls = remoteDeviceService.queryDeviceChannels(item.getDeviceIp());
|
||||
if (CollUtil.isNotEmpty(ls)) {
|
||||
Boolean r1 = remoteDeviceService.updateDeviceChannelState(item.getDeviceIp(), onLineState);
|
||||
Boolean r1 = remoteDeviceService.updateDeviceChannelState(item.getDeviceIp(), stateInfo.getDeviceState());
|
||||
SnailJobLog.REMOTE.info("设备通道[{}]在线状态变更,状态更新完成。 result={} ", item.getDeviceIp(), r1);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user