Forráskód Böngészése

pms 日报 查询设备状态 判空

zhangcl 3 hete
szülő
commit
405fdc8c56

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

@@ -1,6 +1,7 @@
 package cn.iocoder.yudao.module.pms.controller.admin;
 
 import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.StrUtil;
 import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
 import cn.iocoder.yudao.framework.common.pojo.CommonResult;
 import cn.iocoder.yudao.framework.common.pojo.PageParam;
@@ -442,7 +443,9 @@ public class IotDeviceController {
         });
         // 2. 拼接数据
         return BeanUtils.toBean(devices, IotDeviceSimpleRespVO.class, (deviceVO) -> {
-            deviceVO.setDeviceStatusName(IotDeviceStatusEnum.nameOf(deviceVO.getDeviceStatus()).getMsg());
+            if (StrUtil.isNotBlank(deviceVO.getDeviceStatus())) {
+                deviceVO.setDeviceStatusName(IotDeviceStatusEnum.nameOf(deviceVO.getDeviceStatus()).getMsg());
+            }
             // 2.1 拼接部门信息
             findAndThen(deptMap.get(), deviceVO.getDeptId(), dept -> deviceVO.setDeptName(dept.getName()));
             // 2.2 设备关联的负责人姓名

+ 1 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrhdailyreport/IotRhDailyReportController.java

@@ -96,6 +96,7 @@ public class IotRhDailyReportController {
     @Operation(summary = "获得瑞恒日报分页")
     @PreAuthorize("@ss.hasPermission('pms:iot-rh-daily-report:query')")
     public CommonResult<PageResult<IotRhDailyReportRespVO>> getIotRhDailyReportPage(@Valid IotRhDailyReportPageReqVO pageReqVO) {
+        // 根据查询参数筛选出 符合条件 的记录id 再传入 颁布查询
         PageResult<IotRhDailyReportDO> pageResult = iotRhDailyReportService.getIotRhDailyReportPage(pageReqVO);
 
         // List<IotRhDailyReportRespVO> rhDailyReports = IotRhDailyReportConvert.INSTANCE.convertList(pageResult.getList(), deptMap);

+ 8 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrhdailyreport/vo/IotRhDailyReportPageReqVO.java

@@ -112,4 +112,12 @@ public class IotRhDailyReportPageReqVO extends PageParam {
     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
     private LocalDateTime[] createTime;
 
+    /**
+     * 扩展字段
+     */
+    @Schema(description = "项目/合同名称", example = "测试")
+    private String contractName;
+
+    @Schema(description = "任务标识", example = "#33 - 一厂")
+    private String taskName;
 }