fix(controller): 禁止移动端解绑手表设备并优化异步处理
- 移动端解绑设备接口返回错误提示,需联系健康管理员解绑 - 设备绑定流程中的警告开关设置改为异步执行 - 防止外部系统异常影响主业务流程 - 解绑操作中移除对数据中心的通知调用
This commit is contained in:
+3
-1
@@ -207,7 +207,9 @@ public class WatchDeviceController extends JeecgController<WatchDevice, IWatchDe
|
||||
@Operation(summary = "移动端解绑设备(手表)", description = "移动端解绑设备(手表)")
|
||||
@GetMapping("/app/unbundleDevice")
|
||||
public Result unbundleDevice(@RequestParam(name = "watchNo") String watchNo) {
|
||||
return watchDeviceService.unbundleDevice(watchNo);
|
||||
//移动端暂不允许解绑手表
|
||||
return Result.error("请联系健康管理员解绑");
|
||||
// return watchDeviceService.unbundleDevice(watchNo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+3
@@ -507,6 +507,8 @@ public class WatchDeviceServiceImpl extends ServiceImpl<WatchDeviceMapper, Watch
|
||||
switchUpdateWrapper.eq(WatchDeviceSwitch::getWatchNo, dto.getWatchNo());
|
||||
watchDeviceSwitchService.update(switchUpdateWrapper);
|
||||
String[] wdTypes = {"heart_rate", "spo2", "stress", "temperature"};
|
||||
// 异步调用外部系统,防止外部系统异常导致功能异常,解绑这里非必要
|
||||
asyncTaskExecutor.execute(() -> {
|
||||
for (int i = 0; i < wdTypes.length; i++) {
|
||||
WarnSwitch warnSwitch = new WarnSwitch();
|
||||
warnSwitch.setWatchNo(dto.getWatchNo());
|
||||
@@ -516,6 +518,7 @@ public class WatchDeviceServiceImpl extends ServiceImpl<WatchDeviceMapper, Watch
|
||||
}
|
||||
//通知更新
|
||||
dataCenterExecutor.cmdUpdateSwitch(dto.getWatchNo());
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user