Sfoglia il codice sorgente

项目产值填报相关添加待审核数量

chenjun 10 mesi fa
parent
commit
0eb091196d

+ 12 - 1
zjugis-business/src/main/java/com/zjugis/business/controller/ProjectReportController.java

@@ -53,13 +53,24 @@ public class ProjectReportController {
         return CommonResult.success(projectReportService.getCheckList());
     }
 
+    /**
+     * 项目产值填报待审核数量
+     *
+     * @return
+     */
+    @GetMapping("/projectReport/check-num")
+    @Operation(summary = "项目产值填报待审核数量")
+    public CommonResult<Integer> getCheckNum() {
+        return CommonResult.success(projectReportService.getCheckNum());
+    }
+
     /**
      * 分页查询所有已审核数据
      *
      * @return 所有数据
      */
     @GetMapping("/projectReport/list-checked")
-    @Operation(summary = "项目产值填报审核列表")
+    @Operation(summary = "项目产值填报审核列表")
     public CommonResult<List<ProjectReportResp>> checkedList() {
         return CommonResult.success(projectReportService.getCheckedList());
     }

+ 17 - 1
zjugis-business/src/main/java/com/zjugis/business/service/ProjectReportService.java

@@ -1,6 +1,5 @@
 package com.zjugis.business.service;
 
-import com.zjugis.business.bean.entity.Project;
 import com.zjugis.business.bean.entity.ProjectReport;
 import com.zjugis.business.bean.request.ProjectReportAuditBatchPassRequest;
 import com.zjugis.business.bean.request.ProjectReportAuditPassRequest;
@@ -17,12 +16,14 @@ import java.util.List;
 public interface ProjectReportService {
     /**
      * 获取填报列表
+     *
      * @return
      */
     List<ProjectReportResp> getList();
 
     /**
      * 保存填报
+     *
      * @param entity
      * @return
      */
@@ -30,42 +31,49 @@ public interface ProjectReportService {
 
     /**
      * 项目产值填报提交审核
+     *
      * @param id
      */
     void commit(String id);
 
     /**
      * 项目产值填报审核通过
+     *
      * @param reqVO
      */
     void pass(ProjectReportAuditPassRequest reqVO);
 
     /**
      * 项目产值填报审核驳回
+     *
      * @param reqVO
      */
     void reject(ProjectReportAuditRejectRequest reqVO);
 
     /**
      * 项目产值填报审核列表
+     *
      * @return
      */
     List<ProjectReportResp> getCheckList();
 
     /**
      * 项目产值填报审核通过列表
+     *
      * @return
      */
     List<ProjectReportResp> getPassList();
 
     /**
      * 项目产值填报审核批量通过
+     *
      * @param reqVO
      */
     void batchPass(ProjectReportAuditBatchPassRequest reqVO);
 
     /**
      * 获取某期填报全部通过数据
+     *
      * @param periodId
      * @return
      */
@@ -73,7 +81,15 @@ public interface ProjectReportService {
 
     /**
      * 项目产值填报已审核列表
+     *
      * @return
      */
     List<ProjectReportResp> getCheckedList();
+
+    /**
+     * 项目产值填报待审核数量
+     *
+     * @return
+     */
+    Integer getCheckNum();
 }

+ 11 - 2
zjugis-business/src/main/java/com/zjugis/business/service/impl/ProjectReportServiceImpl.java

@@ -25,6 +25,8 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.time.LocalDateTime;
 import java.util.List;
 import java.util.Map;
@@ -114,7 +116,7 @@ public class ProjectReportServiceImpl implements ProjectReportService {
             throw exception(REPORT_IS_NOT_EXISTS);
         }
         //填报待审核或者已通过不允许修改
-        if (ProjectReportStatusEnum.AUDIT.getValue().equals(projectReport.getReportStatus()) || (ProjectReportStatusEnum.PASS.getValue().equals(projectReport.getReportStatus()))) {
+        if (ProjectReportStatusEnum.AUDIT.getValue().equals(projectReport.getReportStatus())) {
             throw exception(REPORT_IS_SUBMITTED);
         }
         String createWorker = projectReport.getCreateWorker();
@@ -156,7 +158,7 @@ public class ProjectReportServiceImpl implements ProjectReportService {
         } else {
             projectReport.setReportAuditorId("");
             projectReport.setReportStatus(ProjectReportStatusEnum.PASS.getValue());
-            projectReport.setPassProgress(projectReport.getReportProgress());
+            projectReport.setPassProgress(projectReport.getReportProgress().divide(new BigDecimal("100"), 2, RoundingMode.HALF_UP));
         }
         projectReport.setLatestModifyTime(null);
         projectReport.setLatestModifyWorker(null);
@@ -226,4 +228,11 @@ public class ProjectReportServiceImpl implements ProjectReportService {
         List<ProjectReport> checkedList = projectReportMapper.getListByIds(reportIds);
         return ProjectReportConvert.INSTANCE.convertList01(checkedList);
     }
+
+    @Override
+    public Integer getCheckNum() {
+        ProjectReportPeriod currentReportPeriod = projectReportPeriodService.getCurrentReportPeriod();
+        List<ProjectReport> checkList = projectReportMapper.getCheckList(SecurityFrameworkUtils.getLoginUserId(), currentReportPeriod.getId());
+        return checkList.size();
+    }
 }