Commit 0540fb14 authored by 赵啸非's avatar 赵啸非

添加设备关联删除

parent 8663774f
......@@ -228,7 +228,7 @@ Content-Type: multipart/form-data
参数名称|类型|必填|描述
:---|:---|:---|:------
page|Integer|否|当前页
page|Integer|否|当前页
size|Integer|否|每页条数,值为-1,查询所有记录
**请求样例:**
......
......@@ -10,7 +10,9 @@ import com.mortals.xhx.common.pdu.LoginForm;
import com.mortals.xhx.common.pdu.device.DeviceReq;
import com.mortals.xhx.feign.device.IDeviceFeign;
import com.mortals.xhx.module.device.model.DeviceQuery;
import com.mortals.xhx.module.room.model.RoomDeviceEntity;
import com.mortals.xhx.module.room.model.RoomQuery;
import com.mortals.xhx.module.room.service.RoomDeviceService;
import com.mortals.xhx.module.room.service.RoomService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
......@@ -51,6 +53,8 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
@Autowired
private RoomService roomService;
@Autowired
private RoomDeviceService roomDeviceService;
@Autowired
private IDeviceFeign deviceFeign;
......@@ -179,6 +183,10 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
deviceReq.setDeviceCode(entity.getDeviceCode());
Rest<String> rest = deviceFeign.deviceCall(deviceReq, token);
log.info("删除结果:{}", JSON.toJSONString(rest));
//关联删除
RoomDeviceEntity condition = new RoomDeviceEntity();
condition.setDeviceId(entity.getId());
roomDeviceService.getDao().delete(condition);
}
......
......@@ -19,8 +19,7 @@ Content-Type: application/json
{
"page":1,
"size":1,
"deviceCode":"0E-B7-8C-0F-6E-9B"
"size":1
}
......@@ -44,7 +43,7 @@ client.global.set("Room_id", JSON.parse(response.body).data.id);
%}
###房间管理查看
GET {{baseUrl}}/room/info?id={{Room_id}}
GET {{baseUrl}}/room/info?id=4
Authorization: {{authToken}}
Accept: application/json
......
......@@ -20,7 +20,7 @@ Content-Type: application/json
{
"page":1,
"size":-1,
"deviceCode":"24-4C-B8-3D-56-B3"
"deviceCode":"a0-9f-10-5a-e0-10"
}
......@@ -48,8 +48,7 @@ client.global.set("Workman_id", JSON.parse(response.body).data.id);
%}
###工作人员查看
GET {{baseUrl}}/workman/info?id={{Workman_id}}
Authorization: {{authToken}}
GET {{baseUrl}}/workman/info?id=1
Accept: application/json
###工作人员编辑
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment