Zimo hai 2 semanas
pai
achega
563946eacb

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

@@ -144,6 +144,14 @@ public class QhseMonthReportController {
                         BeanUtils.toBean(list, QhseMonthReportRespVO.class));
     }
 
+    @PostMapping("/approving/{id}")
+    public CommonResult<String> approvingMonthReport(@PathVariable Long id) {
+        assert Objects.nonNull(id);
+        QhseMonthReportDO qhseMonthReport = qhseMonthReportService.getQhseMonthReport(id);
+        qhseMonthReport.setStatus("approving");//审批通过
+        qhseMonthReportMapper.updateById(qhseMonthReport);
+        return success("提交完成");
+    }
 
     @PostMapping("/approval/{id}")
     public CommonResult<String> approvalMonthReport(@PathVariable Long id) {
@@ -162,7 +170,7 @@ public class QhseMonthReportController {
         qhseMonthReport.setStatus("reject");//审批拒绝
         qhseMonthReport.setRejectDesc(rejectDesc);
         qhseMonthReportMapper.updateById(qhseMonthReport);
-        return success("审批完成");
+        return success("审批不通过");
     }
 //
 //    @GetMapping("/company/page")

+ 29 - 28
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/job/qhse/MonthReportJob.java

@@ -19,7 +19,6 @@ import cn.iocoder.yudao.module.system.api.permission.RoleApi;
 import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
 import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
 import cn.iocoder.yudao.module.system.service.dept.DeptService;
-import com.google.common.collect.ImmutableList;
 import org.springframework.stereotype.Component;
 
 import java.time.LocalDateTime;
@@ -89,6 +88,7 @@ public class MonthReportJob implements JobHandler {
                 qhseMonthReportDO.setTitle(dept.getName()+yearMonth+"QHSE月报");
                 qhseMonthReportDO.setYearMonths(yearMonth);
                 qhseMonthReportDO.setDeleted(false);
+                qhseMonthReportDO.setStatus("unsubmit");//未提交
                 qhseMonthReportDO.setSocCards(String.valueOf(socCount));
                 qhseMonthReportDO.setJsa(String.valueOf(jsaCount));
                 qhseMonthReportDO.setPtwAudit(String.valueOf(ptwCount));
@@ -101,33 +101,34 @@ public class MonthReportJob implements JobHandler {
                 });
             });
         });
-        ImmutableList.of(156L,157L,158L,163L).forEach(e ->{
-            Set<Long> ids = new HashSet<>();
-            ids = deptService.getChildDeptIdListFromCache(e);
-            ids.add(e);
-            IotSocSummaryPageReqVO pageReqVO = new IotSocSummaryPageReqVO();
-            pageReqVO.setObservationDate(new LocalDateTime[]{firstDayOfLastMonth, lastDayOfLastMonth});
-            Long socCount = iotSocSummaryMapper.selectCountBySocClassAndTime(pageReqVO, ids);
-            QhseJsaPageReqVO qhseJsaPageReqVO = new QhseJsaPageReqVO();
-            qhseJsaPageReqVO.setJsaTime(new LocalDateTime[]{firstDayOfLastMonth, lastDayOfLastMonth});
-            Long jsaCount = qhseJsaMapper.selectCountByDeptAndTime(qhseJsaPageReqVO, ids);
-            QhsePtwPageReqVO qhsePtwPageReqVO = new QhsePtwPageReqVO();
-            qhsePtwPageReqVO.setPtwTime(new LocalDateTime[]{firstDayOfLastMonth, lastDayOfLastMonth});
-            Long ptwCount = qhsePtwMapper.selectCountByDeptAndTime(qhsePtwPageReqVO, ids);
-
-
-            QhseMonthReportDO reportDO = new QhseMonthReportDO();
-            DeptRespDTO dept = deptApi.getDept(e);
-            reportDO.setTitle(dept.getName()+yearMonth+"QHSE月报");
-            reportDO.setYearMonths(yearMonth);
-            reportDO.setDeleted(false);
-            reportDO.setSocCards(String.valueOf(socCount));
-            reportDO.setJsa(String.valueOf(jsaCount));
-            reportDO.setPtwAudit(String.valueOf(ptwCount));
-//            reportDO.setDutyPerson();
-            reportDO.setDeptId(e);
-            qhseMonthReportMapper.insert(reportDO);
-        });
+        //各专业公司生成
+//        ImmutableList.of(156L,157L,158L,163L).forEach(e ->{
+//            Set<Long> ids = new HashSet<>();
+//            ids = deptService.getChildDeptIdListFromCache(e);
+//            ids.add(e);
+//            IotSocSummaryPageReqVO pageReqVO = new IotSocSummaryPageReqVO();
+//            pageReqVO.setObservationDate(new LocalDateTime[]{firstDayOfLastMonth, lastDayOfLastMonth});
+//            Long socCount = iotSocSummaryMapper.selectCountBySocClassAndTime(pageReqVO, ids);
+//            QhseJsaPageReqVO qhseJsaPageReqVO = new QhseJsaPageReqVO();
+//            qhseJsaPageReqVO.setJsaTime(new LocalDateTime[]{firstDayOfLastMonth, lastDayOfLastMonth});
+//            Long jsaCount = qhseJsaMapper.selectCountByDeptAndTime(qhseJsaPageReqVO, ids);
+//            QhsePtwPageReqVO qhsePtwPageReqVO = new QhsePtwPageReqVO();
+//            qhsePtwPageReqVO.setPtwTime(new LocalDateTime[]{firstDayOfLastMonth, lastDayOfLastMonth});
+//            Long ptwCount = qhsePtwMapper.selectCountByDeptAndTime(qhsePtwPageReqVO, ids);
+//
+//
+//            QhseMonthReportDO reportDO = new QhseMonthReportDO();
+//            DeptRespDTO dept = deptApi.getDept(e);
+//            reportDO.setTitle(dept.getName()+yearMonth+"QHSE月报");
+//            reportDO.setYearMonths(yearMonth);
+//            reportDO.setDeleted(false);
+//            reportDO.setSocCards(String.valueOf(socCount));
+//            reportDO.setJsa(String.valueOf(jsaCount));
+//            reportDO.setPtwAudit(String.valueOf(ptwCount));
+////            reportDO.setDutyPerson();
+//            reportDO.setDeptId(e);
+//            qhseMonthReportMapper.insert(reportDO);
+//        });
         return "";
     }
 }