|
|
|
|
@ -18,8 +18,10 @@ import org.springblade.core.tool.utils.Func; |
|
|
|
|
import org.springblade.modules.business.pojo.dto.DeviceDTO; |
|
|
|
|
import org.springblade.modules.business.pojo.entity.Device; |
|
|
|
|
import org.springblade.modules.business.pojo.entity.DeviceAttach; |
|
|
|
|
import org.springblade.modules.business.pojo.entity.DeviceMaintenance; |
|
|
|
|
import org.springblade.modules.business.pojo.vo.DeviceVO; |
|
|
|
|
import org.springblade.modules.business.service.IDeviceAttachService; |
|
|
|
|
import org.springblade.modules.business.service.IDeviceMaintenanceService; |
|
|
|
|
import org.springblade.modules.business.service.IDeviceService; |
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
@ -40,6 +42,7 @@ public class DeviceController extends BladeController { |
|
|
|
|
|
|
|
|
|
private final IDeviceService deviceService; |
|
|
|
|
private final IDeviceAttachService deviceAttachService; |
|
|
|
|
private final IDeviceMaintenanceService maintenanceService; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 设备表 详情 |
|
|
|
|
@ -51,6 +54,7 @@ public class DeviceController extends BladeController { |
|
|
|
|
DeviceVO deviceVO = Objects.requireNonNull(BeanUtil.copy(detail, DeviceVO.class)); |
|
|
|
|
List<DeviceAttach> attaches = deviceAttachService.list(Wrappers.lambdaQuery(DeviceAttach.class).eq(DeviceAttach::getDeviceId, device.getId())); |
|
|
|
|
deviceVO.setAttaches(attaches); |
|
|
|
|
deviceVO.setMaintenances(maintenanceService.list(Wrappers.lambdaQuery(DeviceMaintenance.class).eq(DeviceMaintenance::getDeviceId, device.getId()))); |
|
|
|
|
return R.data(deviceVO); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|