|
|
@@ -22,15 +22,18 @@ import com.zksy.common.core.domain.AjaxResult2;
|
|
|
import com.zksy.manhole.dto.in.EquipmentStatusInDTO;
|
|
|
import com.zksy.manhole.dto.in.ManholeDeviceListInDTO;
|
|
|
import com.zksy.manhole.dto.in.ManholeDevicePageInDTO;
|
|
|
+import com.zksy.manhole.dto.in.WarningThresholdInDTO;
|
|
|
import com.zksy.manhole.dto.out.EquipmentBaseOutDTO;
|
|
|
import com.zksy.manhole.dto.out.EquipmentStatusOutDTO;
|
|
|
import com.zksy.manhole.dto.out.ManholeDataOutDTO;
|
|
|
import com.zksy.manhole.dto.out.WarningThresholdOutDTO;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import java.time.LocalDateTime;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
@@ -140,4 +143,22 @@ public class ManholeDeviceController extends BaseController
|
|
|
return updated ? AjaxResult.success("修改成功",updated)
|
|
|
: AjaxResult.error("修改失败",updated);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 保存设备预警阈值
|
|
|
+ * @param inDTO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Anonymous
|
|
|
+ @PostMapping("/saveWarningThreshold")
|
|
|
+ @ApiOperation(value = "保存设备预警阈值")
|
|
|
+ public AjaxResult saveWarningThreshold(@RequestBody WarningThresholdInDTO inDTO) {
|
|
|
+ WarningThreshold warningThreshold = BeanUtil.copyProperties(inDTO, WarningThreshold.class);
|
|
|
+ if(StringUtils.isNotEmpty(warningThreshold.getId())){
|
|
|
+ warningThreshold.setUpdateTime(LocalDateTime.now());
|
|
|
+ }
|
|
|
+ boolean result = warningThresholdService.saveOrUpdate(warningThreshold);
|
|
|
+ return result ? AjaxResult.success("保存成功",result)
|
|
|
+ : AjaxResult.error("保存失败",result);
|
|
|
+ }
|
|
|
}
|