|
|
@@ -2,10 +2,13 @@ package com.yunfeiyun.agmp.iotm.device.service.impl;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
+import com.yunfeiyun.agmp.common.utils.SecurityUtils;
|
|
|
import com.yunfeiyun.agmp.iot.common.domain.IotDevice;
|
|
|
import com.yunfeiyun.agmp.iotm.device.mapper.IotDeviceMapper;
|
|
|
import com.yunfeiyun.agmp.iotm.device.service.IIotDeviceService;
|
|
|
+import com.yunfeiyun.agmp.iotm.mq.provider.IotMqProviderService;
|
|
|
import com.yunfeiyun.agmp.iotm.mq.service.AgmpTosMsgService;
|
|
|
+import com.yunfeiyun.agmp.iotm.mq.service.SendToIotsMsgService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -24,6 +27,8 @@ public class IotDeviceServiceImpl implements IIotDeviceService
|
|
|
private IotDeviceMapper iotDeviceMapper;
|
|
|
@Resource
|
|
|
private AgmpTosMsgService agmpTosMsgService;
|
|
|
+ @Resource
|
|
|
+ private SendToIotsMsgService sendToIotsMsgService;
|
|
|
|
|
|
/**
|
|
|
* 查询设备基础
|
|
|
@@ -58,9 +63,10 @@ public class IotDeviceServiceImpl implements IIotDeviceService
|
|
|
@Override
|
|
|
public int insertIotDevice(IotDevice iotDevice) {
|
|
|
iotDevice.setDevBid(iotDevice.getUUId());
|
|
|
- iotDevice.setTid(iotDevice.getTid());
|
|
|
+ iotDevice.setTid(SecurityUtils.getTid());
|
|
|
int result = iotDeviceMapper.insertIotDevice(iotDevice);
|
|
|
agmpTosMsgService.sendIotDeviceInsertMsg(iotDevice);
|
|
|
+ sendToIotsMsgService.sendIotDeviceInsertMsg(iotDevice);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
@@ -73,7 +79,7 @@ public class IotDeviceServiceImpl implements IIotDeviceService
|
|
|
@Override
|
|
|
public int updateIotDevice(IotDevice iotDevice) {
|
|
|
int result = iotDeviceMapper.updateIotDevice(iotDevice);
|
|
|
- agmpTosMsgService.sendIotDeviceInsertMsg(iotDevice);
|
|
|
+ agmpTosMsgService.sendIotDeviceUpdateMsg(iotDevice);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
@@ -82,7 +88,7 @@ public class IotDeviceServiceImpl implements IIotDeviceService
|
|
|
/**
|
|
|
* 删除设备基础信息
|
|
|
*
|
|
|
- * @param id 设备基础主键
|
|
|
+ * @param devBid 设备基础主键
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@Override
|