Explorar el Código

连油设备接口

lipenghui hace 2 días
padre
commit
76a8de93b8

+ 27 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/IotDeviceController.java

@@ -20,6 +20,7 @@ import cn.iocoder.yudao.module.pms.controller.admin.vo.IotDeviceRespVO;
 import cn.iocoder.yudao.module.pms.controller.admin.vo.IotDeviceSaveReqVO;
 import cn.iocoder.yudao.module.pms.controller.admin.vo.IotDeviceSimpleRespVO;
 import cn.iocoder.yudao.module.pms.controller.admin.vo.excel.DeviceImportExcelVO;
+import cn.iocoder.yudao.module.pms.controller.admin.yanfan.vo.DevicePageReqVO;
 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.failure.IotFailureReportDO;
@@ -431,6 +432,32 @@ public class IotDeviceController {
         return success(result);
     }
 
+
+    @GetMapping("/td/ly/page")
+    @Operation(summary = "获取包含数采的连油曲线")
+    @PreAuthorize("@ss.hasPermission('rq:iot-device:query')")
+    public CommonResult<PageResult<IotDeviceRespVO>> getIotDeviceTdPageLy(@Valid IotDevicePageReqVO pageReqVO) {
+        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());
+        PageResult<IotDeviceDO> pageResult = iotDeviceService.getIotDeviceTdPage(pageReqVO, codes);
+        if (CollUtil.isEmpty(pageResult.getList())) {
+            return success(new PageResult<>(pageResult.getTotal()));
+        }
+        Map<Long, DeptDO> deptMap = deptService.getDeptMap(
+                convertList(pageResult.getList(), IotDeviceDO::getDeptId));
+        PageResult<IotDeviceRespVO> result = new PageResult<>(IotDeviceConvert.INSTANCE.convertList(pageResult.getList(), deptMap),
+                pageResult.getTotal());
+        for (IotDeviceRespVO iotDeviceRespVO : result.getList()) {
+            IotProductClassifyDO iotProductClassify = iotProductClassifyService.getIotProductClassify(iotDeviceRespVO.getAssetClass());
+            iotDeviceRespVO.setAssetClassName(iotProductClassify.getName());
+        }
+
+        return success(result);
+    }
+
+
     @GetMapping("/td/page/app")
     @Operation(summary = "获得设备台账包含数采信息")
     @PreAuthorize("@ss.hasPermission('rq:iot-device:query')")

+ 1 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/yanfan/YfDeviceDO.java

@@ -129,7 +129,7 @@ public class YfDeviceDO  {
     /**
      * clientId编号
      */
-    private String clientId;
+//    private String clientId;
     /**
      * 发布
      */

+ 2 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/IotDeviceMapper.java

@@ -205,7 +205,7 @@ public interface IotDeviceMapper extends BaseMapperX<IotDeviceDO> {
                 .inIfPresent(IotDeviceDO::getDeptId, deptIds));
     }
 
-    default PageResult<IotDeviceDO> selectTdPage(IotDevicePageReqVO reqVO, Collection<Long> deptIds) {
+    default PageResult<IotDeviceDO> selectTdPage(IotDevicePageReqVO reqVO, Collection<Long> deptIds, List<String> codes) {
         return selectPage(reqVO, new LambdaQueryWrapperX<IotDeviceDO>()
 //                .inIfPresent(IotDeviceDO::getDeviceCode, codes)
                 .likeIfPresent(IotDeviceDO::getDeviceName, reqVO.getDeviceName())
@@ -237,6 +237,7 @@ public interface IotDeviceMapper extends BaseMapperX<IotDeviceDO> {
                 .eqIfPresent(IotDeviceDO::getInfoUrl, reqVO.getInfoUrl())
                 .eqIfPresent(IotDeviceDO::getTemplateJson, reqVO.getTemplateJson())
                 .likeIfPresent(IotDeviceDO::getDeviceCode, reqVO.getDeviceCode())
+                .inIfPresent(IotDeviceDO::getDeviceCode, codes)
                 .eqIfPresent(IotDeviceDO::getBomSyncStatus, reqVO.getBomSyncStatus())
                 .eqIfPresent(IotDeviceDO::getIfInline, reqVO.getIfInline())
                 .isNotNull(IotDeviceDO::getIfInline)

+ 1 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/yanfan/YfDeviceMapper.java

@@ -43,7 +43,7 @@ public interface YfDeviceMapper extends BaseMapperX<YfDeviceDO> {
                 .eqIfPresent(YfDeviceDO::getRemark, reqVO.getRemark())
                 .eqIfPresent(YfDeviceDO::getIsSimulate, reqVO.getIsSimulate())
                 .eqIfPresent(YfDeviceDO::getSlaveId, reqVO.getSlaveId())
-                .eqIfPresent(YfDeviceDO::getClientId, reqVO.getClientId())
+//                .eqIfPresent(YfDeviceDO::getClientId, reqVO.getClientId())
                 .eqIfPresent(YfDeviceDO::getPostDev, reqVO.getPostDev())
                 .eqIfPresent(YfDeviceDO::getGetDev, reqVO.getGetDev())
                 .eqIfPresent(YfDeviceDO::getMqttstats, reqVO.getMqttstats())

+ 1 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/IotDeviceServiceImpl.java

@@ -732,7 +732,7 @@ public class IotDeviceServiceImpl implements IotDeviceService {
             ids = deptService.getChildDeptIdListFromCache(pageReqVO.getDeptId());
             ids.add(pageReqVO.getDeptId());
         }
-        return iotDeviceMapper.selectTdPage(pageReqVO,ids);
+        return iotDeviceMapper.selectTdPage(pageReqVO,ids, codes);
     }
 
     @Override

+ 2 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/yanfan/YfDeviceServiceImpl.java

@@ -31,6 +31,8 @@ public class YfDeviceServiceImpl implements YfDeviceService {
     }
 
     @Override
+    @Slave
+    @TenantIgnore
     public PageResult<YfDeviceDO> getDevicePage(DevicePageReqVO pageReqVO) {
         return yfDeviceMapper.selectPage(pageReqVO);
     }