Răsfoiți Sursa

月报审批列表

Zimo 1 săptămână în urmă
părinte
comite
918dc1852e

+ 32 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/qhse/report/QhseMonthReportController.java

@@ -123,6 +123,38 @@ public class QhseMonthReportController {
         return success(new PageResult<>(collect, pageResult.getTotal()));
     }
 
+    @GetMapping("/approve/page")
+    @Operation(summary = "获得资料分页")
+    @PreAuthorize("@ss.hasPermission('rq:qhse-month-report:query')")
+    public CommonResult<PageResult<QhseMonthReportRespVO>> getApproveQhseMonthReportPage(@Valid QhseMonthReportPageReqVO pageReqVO) {
+        Long loginUserDeptId = SecurityFrameworkUtils.getLoginUserDeptId();
+        Set<Long> ids = new HashSet<>();
+        if (Objects.nonNull(loginUserDeptId)) {
+            ids = deptService.getChildDeptIdListFromCache(loginUserDeptId);
+            ids.add(loginUserDeptId);
+        }
+        pageReqVO.setDeptIds(ids);
+        PageResult<QhseMonthReportDO> pageResult = qhseMonthReportService.getApproveQhseMonthReportPage(pageReqVO);
+        List<QhseMonthReportRespVO> collect = pageResult.getList().stream().map(e -> {
+            QhseMonthReportRespVO qhseMonthReportRespVO = new QhseMonthReportRespVO();
+            BeanUtils.copyProperties(e, qhseMonthReportRespVO);
+            if (Objects.nonNull(qhseMonthReportRespVO.getDutyPerson())){
+                AdminUserRespDTO user = adminUserApi.getUser(qhseMonthReportRespVO.getDutyPerson());
+                if (Objects.nonNull(user)){
+                    qhseMonthReportRespVO.setPersonName(user.getNickname());
+                }
+            }
+            if (Objects.nonNull(qhseMonthReportRespVO.getDeptId())){
+                DeptRespDTO dept = deptApi.getDept(qhseMonthReportRespVO.getDeptId());
+                if (Objects.nonNull(dept)){
+                    qhseMonthReportRespVO.setDeptName(dept.getName());
+                }
+            }
+            return qhseMonthReportRespVO;
+        }).collect(Collectors.toList());
+        return success(new PageResult<>(collect, pageResult.getTotal()));
+    }
+
     @GetMapping("/page/year-month")
     @Operation(summary = "获得月报汇总信息")
     @PreAuthorize("@ss.hasPermission('rq:qhse-month-report:query')")

+ 3 - 1
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/qhse/report/vo/QhseMonthReportPageReqVO.java

@@ -25,6 +25,8 @@ public class QhseMonthReportPageReqVO extends PageParam {
     private String yearMonths;
     @Schema(description = "员工人数")
     private String employee;
+    @Schema(description = "审批状态")
+    private String status;
 
     @Schema(description = "分包商人数")
     private String subcontractors;
@@ -122,6 +124,6 @@ public class QhseMonthReportPageReqVO extends PageParam {
     @Schema(description = "创建时间")
     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
     private LocalDateTime[] createTime;
-
+    private Set<String> statuss;
     private Set<Long> deptIds;
 }

+ 42 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/qhse/report/QhseMonthReportMapper.java

@@ -23,6 +23,7 @@ public interface QhseMonthReportMapper extends BaseMapperX<QhseMonthReportDO> {
     default PageResult<QhseMonthReportDO> selectPage(QhseMonthReportPageReqVO reqVO) {
         return selectPage(reqVO, new LambdaQueryWrapperX<QhseMonthReportDO>()
                 .eqIfPresent(QhseMonthReportDO::getEmployee, reqVO.getEmployee())
+                .eqIfPresent(QhseMonthReportDO::getStatus, reqVO.getStatus())
                 .inIfPresent(QhseMonthReportDO::getDeptId, reqVO.getDeptIds())
                 .eqIfPresent(QhseMonthReportDO::getSubcontractors, reqVO.getSubcontractors())
                 .eqIfPresent(QhseMonthReportDO::getDrivingMileage, reqVO.getDrivingMileage())
@@ -60,6 +61,47 @@ public interface QhseMonthReportMapper extends BaseMapperX<QhseMonthReportDO> {
                 .orderByDesc(QhseMonthReportDO::getId));
     }
 
+    default PageResult<QhseMonthReportDO> selectApprovePage(QhseMonthReportPageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<QhseMonthReportDO>()
+                .eqIfPresent(QhseMonthReportDO::getEmployee, reqVO.getEmployee())
+                .inIfPresent(QhseMonthReportDO::getDeptId, reqVO.getDeptIds())
+                .inIfPresent(QhseMonthReportDO::getStatus, reqVO.getStatuss())
+                .eqIfPresent(QhseMonthReportDO::getSubcontractors, reqVO.getSubcontractors())
+                .eqIfPresent(QhseMonthReportDO::getDrivingMileage, reqVO.getDrivingMileage())
+                .eqIfPresent(QhseMonthReportDO::getTotalManHours, reqVO.getTotalManHours())
+                .eqIfPresent(QhseMonthReportDO::getWithoutAccident, reqVO.getWithoutAccident())
+                .eqIfPresent(QhseMonthReportDO::getFatality, reqVO.getFatality())
+                .eqIfPresent(QhseMonthReportDO::getInjury, reqVO.getInjury())
+                .eqIfPresent(QhseMonthReportDO::getRestrictedCase, reqVO.getRestrictedCase())
+                .eqIfPresent(QhseMonthReportDO::getMedicalCase, reqVO.getMedicalCase())
+                .eqIfPresent(QhseMonthReportDO::getFirstAidCase, reqVO.getFirstAidCase())
+                .eqIfPresent(QhseMonthReportDO::getVehicleAccident, reqVO.getVehicleAccident())
+                .eqIfPresent(QhseMonthReportDO::getNearMiss, reqVO.getNearMiss())
+                .eqIfPresent(QhseMonthReportDO::getSpill, reqVO.getSpill())
+                .eqIfPresent(QhseMonthReportDO::getLifeSavingRules, reqVO.getLifeSavingRules())
+                .eqIfPresent(QhseMonthReportDO::getToolboxTalk, reqVO.getToolboxTalk())
+                .eqIfPresent(QhseMonthReportDO::getCommitteeMeeting, reqVO.getCommitteeMeeting())
+                .eqIfPresent(QhseMonthReportDO::getMonthlyMeeting, reqVO.getMonthlyMeeting())
+                .eqIfPresent(QhseMonthReportDO::getCompanyHazard, reqVO.getCompanyHazard())
+                .eqIfPresent(QhseMonthReportDO::getQhseInspection, reqVO.getQhseInspection())
+                .eqIfPresent(QhseMonthReportDO::getSocCards, reqVO.getSocCards())
+                .eqIfPresent(QhseMonthReportDO::getPtwAudit, reqVO.getPtwAudit())
+                .eqIfPresent(QhseMonthReportDO::getJsa, reqVO.getJsa())
+                .eqIfPresent(QhseMonthReportDO::getDrills, reqVO.getDrills())
+                .eqIfPresent(QhseMonthReportDO::getTraining, reqVO.getTraining())
+                .eqIfPresent(QhseMonthReportDO::getParticipantsTraining, reqVO.getParticipantsTraining())
+                .eqIfPresent(QhseMonthReportDO::getTrainingsHours, reqVO.getTrainingsHours())
+                .eqIfPresent(QhseMonthReportDO::getWaterConsumption, reqVO.getWaterConsumption())
+                .eqIfPresent(QhseMonthReportDO::getDieselConsumption, reqVO.getDieselConsumption())
+                .eqIfPresent(QhseMonthReportDO::getElectricityConsumption, reqVO.getElectricityConsumption())
+                .eqIfPresent(QhseMonthReportDO::getNaturalGasConsumption, reqVO.getNaturalGasConsumption())
+                .eqIfPresent(QhseMonthReportDO::getRemark, reqVO.getRemark())
+                .eqIfPresent(QhseMonthReportDO::getTitle, reqVO.getTitle())
+                .betweenIfPresent(QhseMonthReportDO::getCreateTime, reqVO.getCreateTime())
+                .eqIfPresent(QhseMonthReportDO::getYearMonths, reqVO.getYearMonths())
+                .orderByDesc(QhseMonthReportDO::getId));
+    }
+
     IPage<QhseMonthReportRespVO> getDistinctYearMonths(IPage<QhseMonthReportPageReqVO> page, @Param("reqVO")  QhseMonthReportPageReqVO reqVO, @Param("deptIds") Collection<Long> deptIds);
 
 }

+ 2 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/qhse/report/QhseMonthReportService.java

@@ -53,5 +53,7 @@ public interface QhseMonthReportService {
      */
     PageResult<QhseMonthReportDO> getQhseMonthReportPage(QhseMonthReportPageReqVO pageReqVO);
 
+    PageResult<QhseMonthReportDO> getApproveQhseMonthReportPage(QhseMonthReportPageReqVO pageReqVO);
+
     PageResult<QhseMonthReportRespVO> getDistinctPage(QhseMonthReportPageReqVO pageReqVO);
 }

+ 5 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/service/qhse/report/QhseMonthReportServiceImpl.java

@@ -81,6 +81,11 @@ public class QhseMonthReportServiceImpl implements QhseMonthReportService {
         return qhseMonthReportMapper.selectPage(pageReqVO);
     }
 
+    @Override
+    public PageResult<QhseMonthReportDO> getApproveQhseMonthReportPage(QhseMonthReportPageReqVO pageReqVO) {
+        return qhseMonthReportMapper.selectApprovePage(pageReqVO);
+    }
+
 
     public PageResult<QhseMonthReportRespVO> getDistinctPage(QhseMonthReportPageReqVO pageReqVO) {
         IPage<QhseMonthReportRespVO> page;