瀏覽代碼

modify:

1. 年度计划进度统计;
tags/24090601
WendyYang 2 月之前
父節點
當前提交
8f8bac3610
共有 3 個文件被更改,包括 57 次插入0 次删除
  1. +7
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/controller/AnnualPlanController.java
  2. +24
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/AnnualPlanLibManage.java
  3. +26
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/vo/AnnualPlanProgressStatisticsVO.java

+ 7
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/controller/AnnualPlanController.java 查看文件

@@ -7,6 +7,7 @@ import com.hz.pm.api.projectlib.model.req.ProjectIdReq;
import com.hz.pm.api.projectlib.model.req.ProjectListReq;
import com.hz.pm.api.projectlib.model.req.StartProjectDeclareReq;
import com.hz.pm.api.projectlib.model.vo.AnnualPlanListItemVO;
import com.hz.pm.api.projectlib.model.vo.AnnualPlanProgressStatisticsVO;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.log.annotation.WebLog;
import io.swagger.annotations.Api;
@@ -39,6 +40,12 @@ public class AnnualPlanController {
return annualPlanLibManage.annulPlanLibList(req);
}

@GetMapping("/progressStatistics")
@ApiOperation("年度计划库列表进度统计")
public AnnualPlanProgressStatisticsVO progressStatistics(ProjectListReq req) {
return annualPlanLibManage.annualProgressStatistics(req);
}

@PostMapping("/startProjectDeclared")
@ApiOperation("开启项目申报")
@WebLog("开启项目申报")


+ 24
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/AnnualPlanLibManage.java 查看文件

@@ -1,6 +1,7 @@
package com.hz.pm.api.projectlib.manage;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hz.pm.api.common.enumeration.CommonEnum;
@@ -23,6 +24,7 @@ import com.hz.pm.api.projectlib.model.req.ProjectIdReq;
import com.hz.pm.api.projectlib.model.req.ProjectListReq;
import com.hz.pm.api.projectlib.model.req.StartProjectDeclareReq;
import com.hz.pm.api.projectlib.model.vo.AnnualPlanListItemVO;
import com.hz.pm.api.projectlib.model.vo.AnnualPlanProgressStatisticsVO;
import com.hz.pm.api.projectlib.service.IProjectApplicationService;
import com.hz.pm.api.projectlib.service.IProjectService;
import com.hz.pm.api.todocenter.constant.TodoCenterConst;
@@ -65,6 +67,28 @@ public class AnnualPlanLibManage {
private final ProjectStateMachineUtil stateMachine;
private final UserInfoHelper userInfoHelper;


public AnnualPlanProgressStatisticsVO annualProgressStatistics(ProjectListReq req) {
req.setIsStartDeclaredProject(null);
LambdaQueryWrapper<Project> query = ProjectManageUtil.initQuery();
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId());
if (!projectQueryPermission(query, user)) {
return null;
}
ProjectManageUtil.projectQuery(query, req);
query.select(Project::getId, Project::getAnnualPlanOpened)
.eq(Project::getNewest, Boolean.TRUE)
.and(q1 -> q1.in(Project::getStatus, ON_ANNUAL_PLAN.getCode())
.or(q2 -> q2.exists(ExistsSqlConst.PROJECT_EXISTS_STATUS_CHANGE + " and event = {0}",
ProjectStateChangeEvent.ANNUAL_PLAN_PASS)));
List<Project> projects = projectService.list(query);
AnnualPlanProgressStatisticsVO stat = new AnnualPlanProgressStatisticsVO();
stat.setTotalCount(projects.size());
stat.setOpenAnnualPlanCount(CollUtil.count(projects, w -> Boolean.TRUE.equals(w.getAnnualPlanOpened())));
stat.setNotOpenAnnualPlanCount(stat.getTotalCount() - stat.getOpenAnnualPlanCount());
return stat;
}

public PageVo<AnnualPlanListItemVO> annulPlanLibList(ProjectListReq req) {
LambdaQueryWrapper<Project> query = ProjectManageUtil.initQuery();
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId());


+ 26
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/vo/AnnualPlanProgressStatisticsVO.java 查看文件

@@ -0,0 +1,26 @@
package com.hz.pm.api.projectlib.model.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
* <p>
* AnnualPlanProgressStatisticsVO
* </p>
*
* @author WendyYang
* @since 16:41 2024/9/4
*/
@Data
public class AnnualPlanProgressStatisticsVO {

@ApiModelProperty("总数量")
private Integer totalCount;

@ApiModelProperty("已纳入总数量")
private Integer openAnnualPlanCount;

@ApiModelProperty("未纳入总数量")
private Integer notOpenAnnualPlanCount;

}

Loading…
取消
儲存