补充设备工作状态接口并限制设备列表仅显示在线设备
This commit is contained in:
@@ -13,6 +13,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.system.domain.af.AfDevice;
|
||||
import com.ruoyi.system.domain.af.AfStatusConstants;
|
||||
import com.ruoyi.system.service.af.IAfDeviceService;
|
||||
|
||||
/**
|
||||
@@ -37,6 +38,8 @@ public class AfDeviceController extends BaseController
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(AfDevice device)
|
||||
{
|
||||
// PC 设备管理列表只展示当前在线设备,避免离线设备干扰日常调度。
|
||||
device.setOnlineStatus(AfStatusConstants.DEVICE_ONLINE);
|
||||
startPage();
|
||||
List<AfDevice> list = deviceService.selectAfDeviceList(device);
|
||||
return getDataTable(list);
|
||||
@@ -58,4 +61,20 @@ public class AfDeviceController extends BaseController
|
||||
String maintainReason = Convert.toStr(body.get("maintainReason"));
|
||||
return toAjax(deviceService.disableDispatch(deviceId, maintainReason, getUsername()));
|
||||
}
|
||||
|
||||
/**
|
||||
* PC 端调整设备工作状态,直接复用移动端相同的设备工作状态字段。
|
||||
*
|
||||
* @param body 请求体
|
||||
* @return 更新后的设备
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('af:device:edit')")
|
||||
@PostMapping("/work/status")
|
||||
public AjaxResult updateWorkStatus(@RequestBody java.util.Map<String, Object> body)
|
||||
{
|
||||
String userName = Convert.toStr(body.get("userName"));
|
||||
String deviceCode = Convert.toStr(body.get("deviceCode"));
|
||||
String workStatus = Convert.toStr(body.get("workStatus"));
|
||||
return success(deviceService.updateWorkStatus(userName, deviceCode, workStatus, getUsername()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user