代理商修改设备
This commit is contained in:
parent
bac38cf247
commit
5b789179e4
|
@ -92,4 +92,15 @@ public class DeviceBO extends Device {
|
|||
bo.setSuitIds(getSuitIds());
|
||||
return bo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 过滤代理商更新字段
|
||||
* @return
|
||||
*/
|
||||
public DeviceBO filterUpdateByAgent() {
|
||||
DeviceBO bo = new DeviceBO();
|
||||
bo.setDeviceId(getDeviceId());
|
||||
bo.setAgentServiceRate(getAgentServiceRate());
|
||||
return bo;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.ruoyi.web.controller.agent;
|
|||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.ss.device.domain.DeviceBO;
|
||||
import com.ruoyi.ss.device.domain.DeviceQuery;
|
||||
import com.ruoyi.ss.device.domain.vo.DeviceVO;
|
||||
import com.ruoyi.ss.device.service.DeviceService;
|
||||
|
@ -44,4 +45,14 @@ public class AgentDeviceController extends BaseController {
|
|||
return toAjax(deviceService.unbind(deviceId));
|
||||
}
|
||||
|
||||
@ApiOperation("代理商修改设备")
|
||||
@PutMapping
|
||||
public AjaxResult update(@RequestBody DeviceBO data) {
|
||||
DeviceVO device = deviceService.selectById(data.getDeviceId());
|
||||
if (!deviceValidator.isAgent(device, getUserId())) {
|
||||
return error("您不是该设备的代理商,无权操作");
|
||||
}
|
||||
DeviceBO bo = data.filterUpdateByAgent();
|
||||
return toAjax(deviceService.updateSmDevice(bo));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user