mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-18 17:38:48 +08:00
修改日志
This commit is contained in:
parent
22335c8ca7
commit
a428bf8ef1
@ -18,12 +18,14 @@ public class CommonYmlConfig {
|
|||||||
public static String URL_IOT_TELEMETRY = "遥测";
|
public static String URL_IOT_TELEMETRY = "遥测";
|
||||||
public static String URL_IOT_OPERATE = "操作控制";
|
public static String URL_IOT_OPERATE = "操作控制";
|
||||||
public static String URL_IOT_DEVICE = "设备信息";
|
public static String URL_IOT_DEVICE = "设备信息";
|
||||||
|
public static String URL_IOT_DEVICE_BY_NAME = "设备名称查询设备信息";
|
||||||
|
|
||||||
public String baseurl = "";
|
public String baseurl = "";
|
||||||
public String scopeAttribute = "";
|
public String scopeAttribute = "";
|
||||||
public String telemetry = "";
|
public String telemetry = "";
|
||||||
public String operate = "";
|
public String operate = "";
|
||||||
public String device = "";
|
public String device = "";
|
||||||
|
public String deviceByName = "";
|
||||||
|
|
||||||
@Value("${iot.url.scopeAttribute}")
|
@Value("${iot.url.scopeAttribute}")
|
||||||
public String setScopeAttribute(String scopeAttribute) {
|
public String setScopeAttribute(String scopeAttribute) {
|
||||||
@ -49,4 +51,11 @@ public class CommonYmlConfig {
|
|||||||
public String setDevice(String device) {
|
public String setDevice(String device) {
|
||||||
return URL_IOT_DEVICE = device;
|
return URL_IOT_DEVICE = device;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Value("${iot.url.deviceByName}")
|
||||||
|
public String setDeviceByName(String deviceByName) {
|
||||||
|
return URL_IOT_DEVICE_BY_NAME = deviceByName;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,10 +22,7 @@ import org.dromara.web.domain.vo.*;
|
|||||||
import org.dromara.web.service.*;
|
import org.dromara.web.service.*;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
@ -179,8 +176,8 @@ public class EqDeviceController extends BaseController {
|
|||||||
* 保存日志(iot使用 设备状态变动时会触发该状态)
|
* 保存日志(iot使用 设备状态变动时会触发该状态)
|
||||||
* @param eqEquipmentLogBo
|
* @param eqEquipmentLogBo
|
||||||
*/
|
*/
|
||||||
@GetMapping("/saveDeviceLogs")
|
@PostMapping("/saveDeviceLogs")
|
||||||
public void saveDeviceLogs(EqEquipmentLogBo eqEquipmentLogBo){
|
public void saveDeviceLogs(@RequestBody EqEquipmentLogBo eqEquipmentLogBo){
|
||||||
|
|
||||||
EqEquipmentBo eqEquipmentBo = new EqEquipmentBo();
|
EqEquipmentBo eqEquipmentBo = new EqEquipmentBo();
|
||||||
eqEquipmentBo.setEquipmentCode(eqEquipmentLogBo.getEquipmentCode());
|
eqEquipmentBo.setEquipmentCode(eqEquipmentLogBo.getEquipmentCode());
|
||||||
|
|||||||
@ -31,7 +31,7 @@ public class EqEquipmentLogBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 用户id
|
* 用户id
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "用户id不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotNull(message = "用户id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -47,15 +47,20 @@ public class EqEquipmentLogBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 设备ID
|
* 设备ID
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "设备ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotNull(message = "设备ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private Long equipmentId;
|
private Long equipmentId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备编码
|
* 设备编码
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "设备编码不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotBlank(message = "设备编码不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private String equipmentCode;
|
private String equipmentCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备名称
|
||||||
|
*/
|
||||||
|
private String equipmentName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 状态 eq_status_log_type
|
* 状态 eq_status_log_type
|
||||||
* 0.停止中 stop
|
* 0.停止中 stop
|
||||||
@ -83,7 +88,7 @@ public class EqEquipmentLogBo extends BaseEntity {
|
|||||||
* 113.半开门运行提醒
|
* 113.半开门运行提醒
|
||||||
* 114.门体停止运行提醒
|
* 114.门体停止运行提醒
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "状态不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotNull(message = "状态不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -254,7 +254,9 @@ public class EqEquipmentServiceImpl implements IEqEquipmentService {
|
|||||||
@Override
|
@Override
|
||||||
public Boolean bindDevice(EqAppHomeBo bo) {
|
public Boolean bindDevice(EqAppHomeBo bo) {
|
||||||
|
|
||||||
String equipmentCode = bo.getEquipmentCode();
|
String equipmentCode = bo.getEquipmentCode(); //这里的设备编码改成了设备mac地址
|
||||||
|
//通过设备mac地址查询设备编码
|
||||||
|
final String macPrefix = "mock_";
|
||||||
|
|
||||||
LambdaQueryWrapper<EqEquipment> lqw = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<EqEquipment> lqw = Wrappers.lambdaQuery();
|
||||||
lqw.eq( EqEquipment::getEquipmentCode,equipmentCode);
|
lqw.eq( EqEquipment::getEquipmentCode,equipmentCode);
|
||||||
@ -264,6 +266,8 @@ public class EqEquipmentServiceImpl implements IEqEquipmentService {
|
|||||||
DeviceServerMsgDto deviceServerMsgDto = iotService.httpServerGetSend(equipmentCode);
|
DeviceServerMsgDto deviceServerMsgDto = iotService.httpServerGetSend(equipmentCode);
|
||||||
if (!deviceServerMsgDto.getLineStatus()) throw new RuntimeException("设备未连接 无法绑定");
|
if (!deviceServerMsgDto.getLineStatus()) throw new RuntimeException("设备未连接 无法绑定");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//从iot平台设置用户绑定 并获取设备信息
|
//从iot平台设置用户绑定 并获取设备信息
|
||||||
DeviceDto deviceDto = iotService.httpDeviceGetSend(equipmentCode);//无信息会抛异常 无需判断
|
DeviceDto deviceDto = iotService.httpDeviceGetSend(equipmentCode);//无信息会抛异常 无需判断
|
||||||
EqEquipmentBo eqEquipmentBo = new EqEquipmentBo();
|
EqEquipmentBo eqEquipmentBo = new EqEquipmentBo();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user