Commit 74561bf4 by huangjy

fix:子女端修改wifi,生网生成token

parent 2110f403
ALTER TABLE `plat_device_other` ALTER TABLE `plat_device_other`
...@@ -20,4 +20,8 @@ ALTER TABLE `plat_elder_report_month` ...@@ -20,4 +20,8 @@ ALTER TABLE `plat_elder_report_month`
ALTER TABLE `sys_api_secret` ALTER TABLE `sys_api_secret`
CHANGE COLUMN `publicKey` `public_key` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '公钥' AFTER `platform`, CHANGE COLUMN `publicKey` `public_key` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '公钥' AFTER `platform`,
CHANGE COLUMN `privateKey` `private_key` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '私钥' AFTER `public_key`, CHANGE COLUMN `privateKey` `private_key` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '私钥' AFTER `public_key`,
CHANGE COLUMN `orgId` `org_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '机构id' AFTER `private_key`; CHANGE COLUMN `orgId` `org_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '机构id' AFTER `private_key`;
\ No newline at end of file
ALTER TABLE `dev_iot_yanglao_platform`.`plat_device_other`
ADD COLUMN `uuid` varchar(255) COMMENT '设备uuid' AFTER `secure_key`;
\ No newline at end of file
package com.makeit.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
@Data
@Configuration
@ConfigurationProperties(prefix = "shengwang")
public class ShengwangProperties {
private String appId;
private String appCertificate;
private String channelName;
private String account;
private String uid;
private int tokenExpirationInSeconds;
private int privilegeExpirationInSeconds;
}
...@@ -7,7 +7,9 @@ import com.makeit.common.page.PageVO; ...@@ -7,7 +7,9 @@ import com.makeit.common.page.PageVO;
import com.makeit.common.response.ApiResponseEntity; import com.makeit.common.response.ApiResponseEntity;
import com.makeit.common.response.ApiResponseUtils; import com.makeit.common.response.ApiResponseUtils;
import com.makeit.dto.platform.alarm.PlatAlarmRecordQueryDTO; import com.makeit.dto.platform.alarm.PlatAlarmRecordQueryDTO;
import com.makeit.global.annotation.AuthIgnore;
import com.makeit.service.platform.alarm.PlatAlarmRecordService; import com.makeit.service.platform.alarm.PlatAlarmRecordService;
import com.makeit.vo.platform.alarm.PlatAlarmCallDeviceVO;
import com.makeit.vo.platform.alarm.PlatAlarmRecordVO; import com.makeit.vo.platform.alarm.PlatAlarmRecordVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -62,6 +64,19 @@ public class PlatAlarmRecordController { ...@@ -62,6 +64,19 @@ public class PlatAlarmRecordController {
return ApiResponseUtils.success(count); return ApiResponseUtils.success(count);
} }
@ApiOperation("呼叫设备")
@PostMapping("callingDevice")
public ApiResponseEntity<PlatAlarmCallDeviceVO> callingDevice() {
return ApiResponseUtils.success(platAlarmRecordService.callingDevice());
}
@ApiOperation("呼叫设备")
@PostMapping("callingDeviceAuthIgnore")
@AuthIgnore
public ApiResponseEntity<PlatAlarmCallDeviceVO> callingDeviceAuthIgnore() {
return ApiResponseUtils.success(platAlarmRecordService.callingDevice());
}
// @Autowired // @Autowired
// private MailMsgSender mailMsgSender; // private MailMsgSender mailMsgSender;
// @Autowired // @Autowired
......
package com.makeit.module.controller.children.device;
import com.makeit.common.dto.BaseIdDTO;
import com.makeit.common.page.PageReqDTO;
import com.makeit.common.page.PageVO;
import com.makeit.common.response.ApiResponseEntity;
import com.makeit.common.response.ApiResponseUtils;
import com.makeit.dto.wechat.device.PlatChildDeviceDTO;
import com.makeit.dto.wechat.device.PlatDeviceSetupDTO;
import com.makeit.service.platform.device.PlatDeviceService;
import com.makeit.vo.platform.device.PlatChildDeviceListVO;
import com.makeit.vo.platform.device.PlatDeviceViewVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 设备 前端控制器
* </p>
*
* @author eugene young
* @since 2023-09-05
*/
@Api(tags = "平台端小程序-设备")
@RestController
@RequestMapping("/children/plat/device")
public class PlatDeviceChildrenController {
@Autowired
private PlatDeviceService platDeviceService;
@ApiOperation("分页列表")
@PostMapping("page")
public ApiResponseEntity<PageVO<PlatChildDeviceListVO>> page(@RequestBody PageReqDTO<PlatChildDeviceDTO> pageReqDTO) {
return ApiResponseUtils.success(platDeviceService.pageChild(pageReqDTO));
}
@ApiOperation("详情")
@PostMapping("view")
public ApiResponseEntity<PlatDeviceViewVO> view(@RequestBody BaseIdDTO baseIdDTO) {
return ApiResponseUtils.success(platDeviceService.view(baseIdDTO.getId()));
}
@ApiOperation("修改wifi信息")
@PostMapping("modifyWifiInfo")
public ApiResponseEntity<?> modifyWifiInfo(@Validated @RequestBody PlatDeviceSetupDTO dto) {
platDeviceService.modifyWifiInfo(dto);
return ApiResponseUtils.success();
}
}
...@@ -43,6 +43,7 @@ public class PlatDeviceQueryDTO extends BaseTenantDTO { ...@@ -43,6 +43,7 @@ public class PlatDeviceQueryDTO extends BaseTenantDTO {
private List<String> orgIds; private List<String> orgIds;
private String spaceId; private String spaceId;
private String elderId;
} }
package com.makeit.dto.wechat.device;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* <p>
* 设备
* </p>
*
* @author eugene young
* @since 2023-09-05
*/
@Data
@ApiModel(value = "子女端设备列表", description = "子女端设备列表DTO")
public class PlatChildDeviceDTO {
@ApiModelProperty(value = "长者id")
private String elderId;
}
...@@ -46,6 +46,8 @@ public class PlatDeviceSetupDTO extends BaseTenantDTO { ...@@ -46,6 +46,8 @@ public class PlatDeviceSetupDTO extends BaseTenantDTO {
private String secureId; private String secureId;
@ApiModelProperty(value = "密钥Key") @ApiModelProperty(value = "密钥Key")
private String secureKey; private String secureKey;
@ApiModelProperty(value = "设备uuid")
private String uuid;
@ApiModelProperty(value = "组织id") @ApiModelProperty(value = "组织id")
private String orgId; private String orgId;
......
...@@ -59,5 +59,7 @@ public class PlatDeviceOther extends BaseBusEntity { ...@@ -59,5 +59,7 @@ public class PlatDeviceOther extends BaseBusEntity {
private String secureId; private String secureId;
@ApiModelProperty(value = "密钥Key") @ApiModelProperty(value = "密钥Key")
private String secureKey; private String secureKey;
@ApiModelProperty(value = "设备uuid")
private String uuid;
} }
...@@ -9,6 +9,7 @@ import com.makeit.dto.platform.alarm.PlatAlarmRecordQueryDTO; ...@@ -9,6 +9,7 @@ import com.makeit.dto.platform.alarm.PlatAlarmRecordQueryDTO;
import com.makeit.entity.platform.alarm.PlatAlarmConfig; import com.makeit.entity.platform.alarm.PlatAlarmConfig;
import com.makeit.entity.platform.alarm.PlatAlarmRecord; import com.makeit.entity.platform.alarm.PlatAlarmRecord;
import com.makeit.entity.platform.elder.PlatElder; import com.makeit.entity.platform.elder.PlatElder;
import com.makeit.vo.platform.alarm.PlatAlarmCallDeviceVO;
import com.makeit.vo.platform.alarm.PlatAlarmRecordVO; import com.makeit.vo.platform.alarm.PlatAlarmRecordVO;
/** /**
...@@ -67,4 +68,6 @@ public interface PlatAlarmRecordService extends IService<PlatAlarmRecord> { ...@@ -67,4 +68,6 @@ public interface PlatAlarmRecordService extends IService<PlatAlarmRecord> {
Integer unreadCount(PlatAlarmRecordQueryDTO dto); Integer unreadCount(PlatAlarmRecordQueryDTO dto);
void misinformation(String id); void misinformation(String id);
PlatAlarmCallDeviceVO callingDevice();
} }
...@@ -14,6 +14,7 @@ import com.makeit.common.entity.BaseBusEntity; ...@@ -14,6 +14,7 @@ import com.makeit.common.entity.BaseBusEntity;
import com.makeit.common.entity.BaseEntity; import com.makeit.common.entity.BaseEntity;
import com.makeit.common.page.PageReqDTO; import com.makeit.common.page.PageReqDTO;
import com.makeit.common.page.PageVO; import com.makeit.common.page.PageVO;
import com.makeit.config.ShengwangProperties;
import com.makeit.dto.platform.alarm.PlatAlarmCheckDTO; import com.makeit.dto.platform.alarm.PlatAlarmCheckDTO;
import com.makeit.dto.platform.alarm.PlatAlarmRecordQueryDTO; import com.makeit.dto.platform.alarm.PlatAlarmRecordQueryDTO;
import com.makeit.entity.platform.alarm.PlatAlarmConfig; import com.makeit.entity.platform.alarm.PlatAlarmConfig;
...@@ -41,6 +42,7 @@ import com.makeit.service.platform.space.PlatRegionSettingService; ...@@ -41,6 +42,7 @@ import com.makeit.service.platform.space.PlatRegionSettingService;
import com.makeit.service.platform.space.PlatRoomBedDeviceService; import com.makeit.service.platform.space.PlatRoomBedDeviceService;
import com.makeit.service.platform.space.PlatRoomService; import com.makeit.service.platform.space.PlatRoomService;
import com.makeit.service.saas.PlatTenantService; import com.makeit.service.saas.PlatTenantService;
import com.makeit.shengwang.agora.media.RtcTokenBuilder2;
import com.makeit.utils.data.convert.BeanDtoVoUtils; import com.makeit.utils.data.convert.BeanDtoVoUtils;
import com.makeit.utils.data.convert.PageUtil; import com.makeit.utils.data.convert.PageUtil;
import com.makeit.utils.data.convert.StreamUtil; import com.makeit.utils.data.convert.StreamUtil;
...@@ -51,6 +53,7 @@ import com.makeit.utils.sql.join.JoinUtil; ...@@ -51,6 +53,7 @@ import com.makeit.utils.sql.join.JoinUtil;
import com.makeit.utils.user.common.CommonUserUtil; import com.makeit.utils.user.common.CommonUserUtil;
import com.makeit.utils.user.common.CommonUserVO; import com.makeit.utils.user.common.CommonUserVO;
import com.makeit.utils.user.wechat.WechatUserUtil; import com.makeit.utils.user.wechat.WechatUserUtil;
import com.makeit.vo.platform.alarm.PlatAlarmCallDeviceVO;
import com.makeit.vo.platform.alarm.PlatAlarmRecordVO; import com.makeit.vo.platform.alarm.PlatAlarmRecordVO;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
...@@ -60,6 +63,7 @@ import org.springframework.stereotype.Service; ...@@ -60,6 +63,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
...@@ -98,6 +102,8 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe ...@@ -98,6 +102,8 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
private PlatTenantService platTenantService; private PlatTenantService platTenantService;
@Autowired @Autowired
private PlatOrgService platOrgService; private PlatOrgService platOrgService;
@Autowired
private ShengwangProperties shengwangProperties;
@Override @Override
...@@ -567,4 +573,18 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe ...@@ -567,4 +573,18 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
// todo 误报结果写入设备 // todo 误报结果写入设备
} }
@Override
public PlatAlarmCallDeviceVO callingDevice() {
LocalDateTime now = LocalDateTime.now();
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
String format = now.format(dateTimeFormatter);
RtcTokenBuilder2 token = new RtcTokenBuilder2();
String result = token.buildTokenWithUid(shengwangProperties.getAppId(), shengwangProperties.getAppCertificate(), format, 0, RtcTokenBuilder2.Role.ROLE_SUBSCRIBER,
shengwangProperties.getTokenExpirationInSeconds(), shengwangProperties.getPrivilegeExpirationInSeconds());
PlatAlarmCallDeviceVO platAlarmCallDeviceVO = new PlatAlarmCallDeviceVO();
platAlarmCallDeviceVO.setAccessToken(result);
platAlarmCallDeviceVO.setChannelName(format);
return platAlarmCallDeviceVO;
}
} }
...@@ -10,12 +10,10 @@ import com.makeit.dto.platform.device.PlatDeviceDetailDTO; ...@@ -10,12 +10,10 @@ import com.makeit.dto.platform.device.PlatDeviceDetailDTO;
import com.makeit.dto.platform.device.PlatDeviceEditDTO; import com.makeit.dto.platform.device.PlatDeviceEditDTO;
import com.makeit.dto.platform.device.PlatDeviceQueryDTO; import com.makeit.dto.platform.device.PlatDeviceQueryDTO;
import com.makeit.dto.saas.device.PlatDeviceEditSaasDTO; import com.makeit.dto.saas.device.PlatDeviceEditSaasDTO;
import com.makeit.dto.wechat.device.PlatDeviceAttrWechatDTO; import com.makeit.dto.wechat.device.*;
import com.makeit.dto.wechat.device.PlatDeviceEditWechatDTO;
import com.makeit.dto.wechat.device.PlatDeviceNetAttrWechatDTO;
import com.makeit.dto.wechat.device.PlatDeviceSetupDTO;
import com.makeit.entity.platform.device.PlatDevice; import com.makeit.entity.platform.device.PlatDevice;
import com.makeit.module.iot.vo.DeviceProperties; import com.makeit.module.iot.vo.DeviceProperties;
import com.makeit.vo.platform.device.PlatChildDeviceListVO;
import com.makeit.vo.platform.device.PlatDeviceListVO; import com.makeit.vo.platform.device.PlatDeviceListVO;
import com.makeit.vo.platform.device.PlatDeviceViewVO; import com.makeit.vo.platform.device.PlatDeviceViewVO;
...@@ -78,4 +76,8 @@ public interface PlatDeviceService extends IService<PlatDevice> { ...@@ -78,4 +76,8 @@ public interface PlatDeviceService extends IService<PlatDevice> {
boolean updateDeviceStatus(String messageType, String deviceId, String iot_tenantId); boolean updateDeviceStatus(String messageType, String deviceId, String iot_tenantId);
void editDeviceNetInfo(PlatDeviceNetAttrWechatDTO dto); void editDeviceNetInfo(PlatDeviceNetAttrWechatDTO dto);
PageVO<PlatChildDeviceListVO> pageChild(PageReqDTO<PlatChildDeviceDTO> pageReqDTO);
void modifyWifiInfo(PlatDeviceSetupDTO dto);
} }
...@@ -17,14 +17,12 @@ import com.makeit.common.page.PageVO; ...@@ -17,14 +17,12 @@ import com.makeit.common.page.PageVO;
import com.makeit.dto.platform.dataScreen.PlatDataScreenQueryDTO; import com.makeit.dto.platform.dataScreen.PlatDataScreenQueryDTO;
import com.makeit.dto.platform.device.*; import com.makeit.dto.platform.device.*;
import com.makeit.dto.saas.device.PlatDeviceEditSaasDTO; import com.makeit.dto.saas.device.PlatDeviceEditSaasDTO;
import com.makeit.dto.wechat.device.PlatDeviceAttrWechatDTO; import com.makeit.dto.wechat.device.*;
import com.makeit.dto.wechat.device.PlatDeviceEditWechatDTO;
import com.makeit.dto.wechat.device.PlatDeviceNetAttrWechatDTO;
import com.makeit.dto.wechat.device.PlatDeviceSetupDTO;
import com.makeit.entity.platform.auth.PlatOrg; import com.makeit.entity.platform.auth.PlatOrg;
import com.makeit.entity.platform.auth.PlatRole; import com.makeit.entity.platform.auth.PlatRole;
import com.makeit.entity.platform.device.PlatDevice; import com.makeit.entity.platform.device.PlatDevice;
import com.makeit.entity.platform.device.PlatDeviceOther; import com.makeit.entity.platform.device.PlatDeviceOther;
import com.makeit.entity.platform.elder.PlatElder;
import com.makeit.entity.platform.space.PlatRegionSetting; import com.makeit.entity.platform.space.PlatRegionSetting;
import com.makeit.entity.platform.space.PlatRoomBedDevice; import com.makeit.entity.platform.space.PlatRoomBedDevice;
import com.makeit.entity.platform.space.PlatSpace; import com.makeit.entity.platform.space.PlatSpace;
...@@ -48,6 +46,7 @@ import com.makeit.service.platform.auth.PlatOrgService; ...@@ -48,6 +46,7 @@ import com.makeit.service.platform.auth.PlatOrgService;
import com.makeit.service.platform.auth.PlatRoleService; import com.makeit.service.platform.auth.PlatRoleService;
import com.makeit.service.platform.device.PlatDeviceOtherService; import com.makeit.service.platform.device.PlatDeviceOtherService;
import com.makeit.service.platform.device.PlatDeviceService; import com.makeit.service.platform.device.PlatDeviceService;
import com.makeit.service.platform.elder.PlatElderService;
import com.makeit.service.platform.space.PlatRegionSettingService; import com.makeit.service.platform.space.PlatRegionSettingService;
import com.makeit.service.platform.space.PlatRoomBedDeviceService; import com.makeit.service.platform.space.PlatRoomBedDeviceService;
import com.makeit.service.platform.space.PlatSpaceService; import com.makeit.service.platform.space.PlatSpaceService;
...@@ -60,6 +59,7 @@ import com.makeit.utils.data.convert.StreamUtil; ...@@ -60,6 +59,7 @@ import com.makeit.utils.data.convert.StreamUtil;
import com.makeit.utils.old.StringUtils; import com.makeit.utils.old.StringUtils;
import com.makeit.utils.request.RequestUtil; import com.makeit.utils.request.RequestUtil;
import com.makeit.utils.sql.join.JoinUtil; import com.makeit.utils.sql.join.JoinUtil;
import com.makeit.vo.platform.device.PlatChildDeviceListVO;
import com.makeit.vo.platform.device.PlatDeviceListVO; import com.makeit.vo.platform.device.PlatDeviceListVO;
import com.makeit.vo.platform.device.PlatDeviceViewVO; import com.makeit.vo.platform.device.PlatDeviceViewVO;
import lombok.Data; import lombok.Data;
...@@ -109,6 +109,8 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -109,6 +109,8 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
@Autowired @Autowired
private IotOrgService iotOrgService; private IotOrgService iotOrgService;
@Autowired @Autowired
private PlatElderService platElderService;
@Autowired
private SysDictionaryCategoryService sysDictionaryCategoryService; private SysDictionaryCategoryService sysDictionaryCategoryService;
@Autowired @Autowired
private PlatRoomBedDeviceService platRoomBedDeviceService; private PlatRoomBedDeviceService platRoomBedDeviceService;
...@@ -183,6 +185,46 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -183,6 +185,46 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
} }
@Override
public PageVO<PlatChildDeviceListVO> pageChild(PageReqDTO<PlatChildDeviceDTO> pageReqDTO) {
PlatChildDeviceDTO dto = pageReqDTO.getData();
Page<PlatDevice> p = PageUtil.toMpPage(pageReqDTO);
if (StringUtils.isEmpty(dto.getElderId())) {
throw new RuntimeException("长者id不能为空");
}
PlatElder platElder = platElderService.getById(dto.getElderId());
if (platElder == null || StringUtils.isEmpty(platElder.getRoomId())) {
return new PageVO<>();
}
List<PlatRoomBedDevice> platRoomBedDevices = platRoomBedDeviceService.list(new QueryWrapper<PlatRoomBedDevice>().lambda()
.eq(PlatRoomBedDevice::getRoomId, platElder.getRoomId()));
if (CollectionUtils.isEmpty(platRoomBedDevices)) {
return new PageVO<>();
}
List<String> deviceIdList = StreamUtil.map(platRoomBedDevices, PlatRoomBedDevice::getDeviceId);
Page<PlatDevice> platDevicePage = baseMapper.selectPage(p, new QueryWrapper<PlatDevice>().lambda().in(BaseEntity::getId, deviceIdList));
List<PlatDevice> platDeviceList = platDevicePage.getRecords();
if (CollectionUtils.isEmpty(platDeviceList)) {
return new PageVO<>();
}
List<PlatDeviceOther> platDeviceOtherList = platDeviceOtherService.list(new QueryWrapper<PlatDeviceOther>().lambda()
.eq(PlatDeviceOther::getDeviceId, deviceIdList));
Map<String, PlatDeviceOther> platDeviceOtherMap = StreamUtil.toMapDep(platDeviceOtherList, PlatDeviceOther::getDeviceId);
List<PlatChildDeviceListVO> voList = Lists.newArrayList();
PlatChildDeviceListVO vo;
for (PlatDevice platDevice : platDeviceList) {
vo = new PlatChildDeviceListVO();
BeanUtils.copyProperties(platDevice,vo);
PlatDeviceOther platDeviceOther = platDeviceOtherMap.get(platDevice.getId());
if (platDeviceOther != null) {
vo.setPlatDeviceOther(platDeviceOther);
}
voList.add(vo);
}
return PageUtil.toPageVO(voList,platDevicePage);
}
private void check(PlatDeviceEditDTO dto) { private void check(PlatDeviceEditDTO dto) {
PlatDevice old = getOne(new QueryWrapper<PlatDevice>().lambda() PlatDevice old = getOne(new QueryWrapper<PlatDevice>().lambda()
.eq(PlatDevice::getName, dto.getName())); .eq(PlatDevice::getName, dto.getName()));
...@@ -370,6 +412,18 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev ...@@ -370,6 +412,18 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
} }
} }
@Override
@Transactional(rollbackFor = Exception.class)
public void modifyWifiInfo(PlatDeviceSetupDTO dto) {
PlatDeviceOther other = platDeviceOtherService.getOne(new QueryWrapper<PlatDeviceOther>().lambda()
.eq(PlatDeviceOther::getDeviceId, dto.getId()));
other.setWifiName(dto.getWifiName());
other.setWifiPassword(dto.getWifiPassword());
platDeviceOtherService.updateById(other);
}
/** /**
* 设备信息 * 设备信息
* *
......
package com.makeit.vo.platform.alarm;
import io.swagger.annotations.ApiModel;
import lombok.Data;
@Data
@ApiModel(value="呼叫设备对象", description="呼叫设备")
public class PlatAlarmCallDeviceVO {
private String accessToken;
private String channelName;
}
package com.makeit.vo.platform.device;
import com.makeit.entity.platform.device.PlatDeviceOther;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* <p>
* 设备
* </p>
*
* @author eugene young
* @since 2023-09-05
*/
@Data
@ApiModel(value = "子女端设备对象", description = "子女端设备")
public class PlatChildDeviceListVO {
@ApiModelProperty(value = "id")
private String id;
@ApiModelProperty(value = "原始设备ID")
private String oriDeviceId;
@ApiModelProperty(value = "设备名称")
private String name;
@ApiModelProperty(value = "产品名称")
private String productName;
@ApiModelProperty(value = "产品id")
private String productId;
@ApiModelProperty(value = "说明")
private String description;
@ApiModelProperty(value = "状态 数据字典 1 在线 0离线")
private String status;
@ApiModelProperty(value = "设备类型 0-呼吸心率雷达 1-空间人体雷达 2-跌倒检测雷达")
private String category;
@ApiModelProperty(value = "组织id")
private String orgId;
@ApiModelProperty(value = "组织名称")
private String orgName;
private PlatDeviceOther platDeviceOther;
}
...@@ -2,6 +2,7 @@ package com.makeit.vo.platform.device; ...@@ -2,6 +2,7 @@ package com.makeit.vo.platform.device;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.makeit.common.dto.BaseTenantDTO; import com.makeit.common.dto.BaseTenantDTO;
import com.makeit.entity.platform.device.PlatDeviceOther;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
......
...@@ -149,6 +149,14 @@ voice-sms: ...@@ -149,6 +149,14 @@ voice-sms:
uid: 362 uid: 362
pwd: xmksyy123456 pwd: xmksyy123456
shengwang:
appId: 883078934ecd4193aa7a62a3cdacd810
appCertificate: b29be69c9c034120a68f1d5c199d2e74
channelName: 1
uid: 0
tokenExpirationInSeconds: 3600
privilegeExpirationInSeconds: 3600
......
...@@ -146,3 +146,11 @@ voice-sms: ...@@ -146,3 +146,11 @@ voice-sms:
uid: 362 uid: 362
pwd: xmksyy123456 pwd: xmksyy123456
shengwang:
appId: 883078934ecd4193aa7a62a3cdacd810
appCertificate: b29be69c9c034120a68f1d5c199d2e74
channelName: 1
uid: 0
tokenExpirationInSeconds: 3600
privilegeExpirationInSeconds: 3600
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