Browse Source

pms 瑞都日报 详情 返回 项目任务信息

zhangcl 1 tuần trước cách đây
mục cha
commit
9906c29f3d

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

@@ -118,10 +118,24 @@ public class IotRhDailyReportController {
     @PreAuthorize("@ss.hasPermission('pms:iot-rh-daily-report:query')")
     public CommonResult<IotRhDailyReportRespVO> getIotRhDailyReport(@RequestParam("id") Long id) {
         IotRhDailyReportDO iotRhDailyReport = iotRhDailyReportService.getIotRhDailyReport(id);
+        if (ObjUtil.isEmpty(iotRhDailyReport)) {
+            return success(null);
+        }
         // 查询当前日报关联的 部门下 增压机 的产能
         BigDecimal capacity = iotRhDailyReportService.queryCapacity(iotRhDailyReport.getDeptId());
         IotRhDailyReportRespVO result = BeanUtils.toBean(iotRhDailyReport, IotRhDailyReportRespVO.class);
         result.setCapacity(capacity);
+        // 查询日报关联的项目 任务信息
+        Long projectId = result.getProjectId();
+        Long taskId = result.getTaskId();
+        if (ObjUtil.isNotEmpty(projectId)) {
+            IotProjectInfoDO project = iotProjectInfoService.getIotProjectInfo(projectId);
+            result.setContractName(project.getContractName());
+        }
+        if (ObjUtil.isNotEmpty(taskId)) {
+            IotProjectTaskDO task = iotProjectTaskService.getIotProjectTask(taskId);
+            result.setTaskName(task.getWellName());
+        }
         // 查询日报关联油耗记录
         IotDailyReportFuelPageReqVO reqVO = new IotDailyReportFuelPageReqVO();
         reqVO.setReportId(result.getId());