|
|
@@ -278,12 +278,15 @@ public class DeviceInfoService {
|
|
|
// 更新设备权限
|
|
|
jmxSyncService.syncDevicesSecurity(List.of(deviceInfo));
|
|
|
|
|
|
- // 同步显示信息
|
|
|
+ // 同步设备信息(同步到业务平台)
|
|
|
deviceSyncFullCardService.noticeSyncDevice(List.of(deviceInfo));
|
|
|
|
|
|
// 设备信息改变时,更新 对应的物模型数据
|
|
|
iotThingService.updateThingByDevice(deviceInfo);
|
|
|
|
|
|
+ // 添加操作日志
|
|
|
+ String logContent = String.format("改变了设备%s状态为%s", deviceInfo.getDeviceId(), deviceInfo.getState().getRemark());
|
|
|
+ operationLogsService.addLogs(logContent, OperationLogBusType.Device, deviceInfo);
|
|
|
return ResultContent.buildSuccess();
|
|
|
}
|
|
|
|
|
|
@@ -349,7 +352,7 @@ public class DeviceInfoService {
|
|
|
deviceInfo.setIsDelete(Boolean.TRUE);
|
|
|
deviceInfoDao.save(deviceInfo);
|
|
|
|
|
|
- operationLogsService.addLogs(String.format("删除了设备;%s", deviceInfo.getDeviceName()), OperationLogBusType.Device, deviceInfo);
|
|
|
+ operationLogsService.addLogs(String.format("删除了设备;%s", deviceInfo.getDeviceId()), OperationLogBusType.Device, deviceInfo);
|
|
|
|
|
|
// 更新设备信息
|
|
|
deviceSyncFullCardService.noticeSyncDevice(List.of(deviceInfo));
|
|
|
@@ -413,7 +416,7 @@ public class DeviceInfoService {
|
|
|
if (StringUtils.isEmpty(productCode)) {
|
|
|
return 0L;
|
|
|
}
|
|
|
- return deviceInfoDao.countByProductCode(productCode);
|
|
|
+ return deviceInfoDao.countByProductCodeAndIsDelete(productCode, Boolean.FALSE);
|
|
|
}
|
|
|
|
|
|
public ResultContent<DeviceInfoModel> getDeviceById(String deviceId) {
|