|
|
|
@@ -54,7 +54,8 @@ public class KwBoxController extends BaseController { |
|
|
|
return new ResultData(ErrorCode.DEVICE_ALREADY_EXIST); |
|
|
|
kwBox.setTenantId(getTenantId()); |
|
|
|
kwBox.setStatus(EnumBoxStatus.VALID.getCode()); |
|
|
|
return kwBoxService.saveOrUpdate(kwBox); |
|
|
|
kwBoxService.saveOrUpdate(kwBox); |
|
|
|
return new ResultData(kwBox); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("更新设备") |
|
|
|
@@ -65,7 +66,8 @@ public class KwBoxController extends BaseController { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); |
|
|
|
if (kwBox.getId() == null) |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); |
|
|
|
return kwBoxService.saveOrUpdate(kwBox); |
|
|
|
kwBoxService.saveOrUpdate(kwBox); |
|
|
|
return new ResultData(kwBox); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("设备详情") |
|
|
|
@@ -76,7 +78,7 @@ public class KwBoxController extends BaseController { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); |
|
|
|
KwBox kwBox = kwBoxService.getById(id); |
|
|
|
if (kwBox == null) |
|
|
|
return new ResultData(ErrorCode.SCREENAD_NOT_FOUND); |
|
|
|
return new ResultData(ErrorCode.DEVICE_NOT_FOUND); |
|
|
|
|
|
|
|
kwBox.setMeters(kwBoxService.findMeters(kwBox)); |
|
|
|
return new ResultData(kwBox); |
|
|
|
@@ -91,6 +93,7 @@ public class KwBoxController extends BaseController { |
|
|
|
KwBox kwBox = new KwBox(); |
|
|
|
kwBox.setId(id); |
|
|
|
kwBox.setStatus(EnumBoxStatus.INVALID.getCode()); |
|
|
|
return kwBoxService.saveOrUpdate(kwBox); |
|
|
|
kwBoxService.saveOrUpdate(kwBox); |
|
|
|
return new ResultData(kwBox); |
|
|
|
} |
|
|
|
} |