Переглянути джерело

Merge branch 'dailyReport' into test

zhangcl 1 тиждень тому
батько
коміт
55e7686ec2

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

@@ -127,4 +127,7 @@ public class IotRhDailyReportPageReqVO extends PageParam {
 
     @Schema(description = "任务id集合", example = "测试")
     private Collection<Long> taskIds;
+
+    @Schema(description = "部门id集合", example = "[123,223]")
+    private Collection<Long> deptIds;
 }

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

@@ -73,7 +73,8 @@ public interface IotRhDailyReportMapper extends BaseMapperX<IotRhDailyReportDO>
 
         // 正常查询逻辑
         return selectPage(reqVO, new LambdaQueryWrapperX<IotRhDailyReportDO>()
-                .eqIfPresent(IotRhDailyReportDO::getDeptId, reqVO.getDeptId())
+                // .eqIfPresent(IotRhDailyReportDO::getDeptId, reqVO.getDeptId())
+                .inIfPresent(IotRhDailyReportDO::getDeptId, reqVO.getDeptIds())
                 .eqIfPresent(IotRhDailyReportDO::getProjectId, reqVO.getProjectId())
                 .inIfPresent(IotRhDailyReportDO::getProjectId, reqVO.getProjectIds())
                 .eqIfPresent(IotRhDailyReportDO::getTaskId, reqVO.getTaskId())

+ 7 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/iotrhdailyreport/IotRhDailyReportServiceImpl.java

@@ -337,6 +337,13 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
 
     @Override
     public PageResult<IotRhDailyReportDO> getIotRhDailyReportPage(IotRhDailyReportPageReqVO pageReqVO) {
+        // 查询选择部门下面所有子部门
+        Set<Long> ids = new HashSet<>();
+        if (Objects.nonNull(pageReqVO.getDeptId())) {
+            ids = deptService.getChildDeptIdListFromCache(pageReqVO.getDeptId());
+            ids.add(pageReqVO.getDeptId());
+            pageReqVO.setDeptIds(ids);
+        }
         return iotRhDailyReportMapper.selectPage(pageReqVO);
     }
 

+ 2 - 2
yudao-module-pms/yudao-module-pms-biz/src/main/resources/mapper/static/iotprojecttask/IotRhDailyReportMapper.xml

@@ -103,8 +103,8 @@
         SELECT
             dept_id,
             DATEDIFF(
-                    MIN(CASE WHEN construction_status = 3 THEN construction_start_date END),
-                    MIN(CASE WHEN construction_status = 1 THEN construction_start_date END)
+                    MIN(CASE WHEN construction_status = 'sg' THEN construction_start_date END),
+                    MIN(CASE WHEN construction_status = 'dq' THEN construction_start_date END)
             ) AS relocation_days
         FROM rq_iot_rh_daily_report
         WHERE construction_status IN ('dq', 'sg')