Commit 7d53644a by huangjy

feat:激活按钮要先可以写入设备

parent 396e53a5
......@@ -754,6 +754,12 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
@Transactional(rollbackFor = Exception.class)
public void active(BaseIdDTO dto) {
PlatDevice platDevice = getById(dto.getId());
Map<String, Object> resMap = new HashMap<>();
resMap.put("appid",shengwangProperties.getAppId());
String AttrResult = devicePropertiesOperateService.deviceWriteAttr(platDevice.getOriDeviceId(), resMap);
if (StringUtils.isNotEmpty(AttrResult)) {
throw new RuntimeException(AttrResult);
}
String active = shengwangHttpUtil.active(platDevice.getOriDeviceId());
ApiResponseEntity responseEntity = JSON.parseObject(active, ApiResponseEntity.class);
if (responseEntity.getCode() != 200) {
......@@ -771,7 +777,6 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
// 调用设备写入接口
Map<String, Object> map = new HashMap<>();
map.put("license",platDeviceActiveVO.getLicense());
map.put("appid",shengwangProperties.getAppId());
String result = devicePropertiesOperateService.deviceWriteAttr(platDevice.getOriDeviceId(), map);
if (StringUtils.isNotEmpty(result)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment