iot绑定异常

This commit is contained in:
sxu 2024-12-24 17:55:15 +08:00
parent 7fdd39a617
commit 94a8511f95
1 changed files with 2 additions and 1 deletions

View File

@ -11,6 +11,7 @@ import com.bonus.sgzb.material.service.IotMachineService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -53,7 +54,7 @@ public class IotMachineController extends BaseController {
@PostMapping("/addOrUpdate")
public AjaxResult addOrUpdate(@Validated @RequestBody IotDto iotDto) {
log.info("添加或者修改设备传参:{}", iotDto);
if (iotDto.getIotId() != null) {
if (!StringUtils.isEmpty(iotDto.getIotId())) {
return iotMachineService.update(iotDto);
}
return iotMachineService.add(iotDto);