fix(device): 解决装置在线注册时项目验证缺失问题
- 添加了项目存在性检查逻辑 - 当未找到装置绑定的项目时抛出业务异常 - 提供了重新绑定的错误提示信息
This commit is contained in:
@@ -569,6 +569,10 @@ public class CsDeviceServiceImpl implements ICsDeviceService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String onlineRegister(String projectId,String nDid) {
|
||||
String result = "fail";
|
||||
CsLedger csLedger = csLedgerService.getById(projectId);
|
||||
if (csLedger == null) {
|
||||
throw new BusinessException("未找到装置绑定的项目,请重新绑定");
|
||||
}
|
||||
// 根据模板接入装置
|
||||
LogMessage logDto = new LogMessage();
|
||||
logDto.setUserIndex(RequestUtil.getUserNickname());
|
||||
|
||||
Reference in New Issue
Block a user