|
@@ -25,6 +25,7 @@ import cn.iocoder.yudao.module.pms.dal.dataobject.IotDeviceDO;
|
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.IotProductClassifyDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.IotProductClassifyDO;
|
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.failure.IotFailureReportDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.failure.IotFailureReportDO;
|
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.yanfan.YfDeviceDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.yanfan.YfDeviceDO;
|
|
|
|
|
+import cn.iocoder.yudao.module.pms.dal.mysql.IotDeviceMapper;
|
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.TDDeviceMapper;
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.TDDeviceMapper;
|
|
|
import cn.iocoder.yudao.module.pms.enums.common.IotDeviceStatusEnum;
|
|
import cn.iocoder.yudao.module.pms.enums.common.IotDeviceStatusEnum;
|
|
|
import cn.iocoder.yudao.module.pms.oa.OaFlow;
|
|
import cn.iocoder.yudao.module.pms.oa.OaFlow;
|
|
@@ -108,6 +109,8 @@ public class IotDeviceController {
|
|
|
private DeptApi deptApi;
|
|
private DeptApi deptApi;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private DeptUtil deptUtil;
|
|
private DeptUtil deptUtil;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IotDeviceMapper iotDeviceMapper;
|
|
|
|
|
|
|
|
@GetMapping(value = {"/company"})
|
|
@GetMapping(value = {"/company"})
|
|
|
@Operation(summary = "获取设备属于哪个公司", description = "获取设备属于哪个公司")
|
|
@Operation(summary = "获取设备属于哪个公司", description = "获取设备属于哪个公司")
|
|
@@ -431,6 +434,28 @@ public class IotDeviceController {
|
|
|
return success(result);
|
|
return success(result);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @GetMapping("/ly/device")
|
|
|
|
|
+ @Operation(summary = "查询某部门下的连油设备")
|
|
|
|
|
+ public CommonResult<List<IotDeviceDO>> getDeptLyDevice(Long deptId) {
|
|
|
|
|
+ //获取数采yf里面的设备
|
|
|
|
|
+ DevicePageReqVO devicePageReqVO = new DevicePageReqVO();
|
|
|
|
|
+ devicePageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
|
|
+ //连油设备
|
|
|
|
|
+ devicePageReqVO.setProductId(649L);
|
|
|
|
|
+ List<String> codes = yfDeviceService.getDevicePage(devicePageReqVO).getList().stream().map(YfDeviceDO::getSerialNumber).collect(Collectors.toList());
|
|
|
|
|
+ List<IotDeviceDO> iotDeviceDOS;
|
|
|
|
|
+ if (Objects.isNull(deptId)) {
|
|
|
|
|
+ deptId = SecurityFrameworkUtils.getLoginUserDeptId();
|
|
|
|
|
+ }
|
|
|
|
|
+ Set<Long> ids;
|
|
|
|
|
+ ids = deptService.getChildDeptIdListFromCache(deptId);
|
|
|
|
|
+ ids.add(deptId);
|
|
|
|
|
+ IotDevicePageReqVO reqVO = new IotDevicePageReqVO();
|
|
|
|
|
+ reqVO.setDeptIds(new ArrayList<>(ids));
|
|
|
|
|
+ List<IotDeviceDO> devicesByDepts = iotDeviceService.getDevicesByDepts(reqVO);
|
|
|
|
|
+ iotDeviceDOS = devicesByDepts.stream().filter(e -> codes.contains(e.getDeviceCode())).collect(Collectors.toList());
|
|
|
|
|
+ return success(iotDeviceDOS);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
@GetMapping("/td/ly/page")
|
|
@GetMapping("/td/ly/page")
|
|
|
@Operation(summary = "获取包含数采的连油曲线")
|
|
@Operation(summary = "获取包含数采的连油曲线")
|
|
@@ -438,6 +463,7 @@ public class IotDeviceController {
|
|
|
public CommonResult<PageResult<IotDeviceRespVO>> getIotDeviceTdPageLy(@Valid IotDevicePageReqVO pageReqVO) {
|
|
public CommonResult<PageResult<IotDeviceRespVO>> getIotDeviceTdPageLy(@Valid IotDevicePageReqVO pageReqVO) {
|
|
|
DevicePageReqVO devicePageReqVO = new DevicePageReqVO();
|
|
DevicePageReqVO devicePageReqVO = new DevicePageReqVO();
|
|
|
devicePageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
devicePageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
|
|
+ //连油设备
|
|
|
devicePageReqVO.setProductId(649L);
|
|
devicePageReqVO.setProductId(649L);
|
|
|
List<String> codes = yfDeviceService.getDevicePage(devicePageReqVO).getList().stream().map(YfDeviceDO::getSerialNumber).collect(Collectors.toList());
|
|
List<String> codes = yfDeviceService.getDevicePage(devicePageReqVO).getList().stream().map(YfDeviceDO::getSerialNumber).collect(Collectors.toList());
|
|
|
PageResult<IotDeviceDO> pageResult = iotDeviceService.getIotDeviceTdPage(pageReqVO, codes);
|
|
PageResult<IotDeviceDO> pageResult = iotDeviceService.getIotDeviceTdPage(pageReqVO, codes);
|