Compare commits
2 Commits
d1cf7a1939
...
2f0a51b5c8
Author | SHA1 | Date | |
---|---|---|---|
![]() |
2f0a51b5c8 | ||
![]() |
439f1d9da2 |
|
@ -14,6 +14,8 @@ public class BriefKeys {
|
||||||
public static final String PROJECT_STATUS = "projectStatus";
|
public static final String PROJECT_STATUS = "projectStatus";
|
||||||
// 项目开发完成
|
// 项目开发完成
|
||||||
public static final String PROJECT_DEV_COMPLETED = "projectDevCompleted";
|
public static final String PROJECT_DEV_COMPLETED = "projectDevCompleted";
|
||||||
|
// 项目开发正常完成
|
||||||
|
public static final String PROJECT_DEV_ON_TIME_COMPLETED = "projectDevOnTimeCompleted";
|
||||||
// 项目逾期开发未完成
|
// 项目逾期开发未完成
|
||||||
public static final String PROJECT_OVERDUE_DEV_UNCOMPLETED = "projectOverdueDevUncompleted";
|
public static final String PROJECT_OVERDUE_DEV_UNCOMPLETED = "projectOverdueDevUncompleted";
|
||||||
// 项目逾期开发完成
|
// 项目逾期开发完成
|
||||||
|
|
|
@ -30,6 +30,9 @@ public class ProjectBriefVO {
|
||||||
@ApiModelProperty("开发已完成")
|
@ApiModelProperty("开发已完成")
|
||||||
private Integer devCompleted;
|
private Integer devCompleted;
|
||||||
|
|
||||||
|
@ApiModelProperty("开发正常完成")
|
||||||
|
private Integer devOnTimeCompleted;
|
||||||
|
|
||||||
@ApiModelProperty("开发逾期未完成")
|
@ApiModelProperty("开发逾期未完成")
|
||||||
private Integer devOverdueUncompleted;
|
private Integer devOverdueUncompleted;
|
||||||
|
|
||||||
|
|
|
@ -8,4 +8,7 @@ public class MonthProjectQuery {
|
||||||
|
|
||||||
@ApiModelProperty("年份")
|
@ApiModelProperty("年份")
|
||||||
private Integer year;
|
private Integer year;
|
||||||
|
|
||||||
|
@ApiModelProperty("数据隔离")
|
||||||
|
private Boolean scope;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,6 @@ import com.ruoyi.dashboard.index.domain.brief.BriefKeys;
|
||||||
import com.ruoyi.dashboard.index.domain.brief.ProjectBriefVO;
|
import com.ruoyi.dashboard.index.domain.brief.ProjectBriefVO;
|
||||||
import com.ruoyi.dashboard.project.domain.monthProject.MonthProjectQuery;
|
import com.ruoyi.dashboard.project.domain.monthProject.MonthProjectQuery;
|
||||||
import com.ruoyi.dashboard.project.domain.monthProject.MonthProjectVO;
|
import com.ruoyi.dashboard.project.domain.monthProject.MonthProjectVO;
|
||||||
import com.ruoyi.dashboard.project.domain.projectRate.ProjectRateVO;
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class DashboardProjectService {
|
public class DashboardProjectService {
|
||||||
|
@ -30,7 +29,7 @@ public class DashboardProjectService {
|
||||||
List<MonthProjectVO> result = new ArrayList<>();
|
List<MonthProjectVO> result = new ArrayList<>();
|
||||||
|
|
||||||
// 查询每月新增的项目数
|
// 查询每月新增的项目数
|
||||||
List<IntegerIntegerVO> startList = this.selectCoungGroupByStartMonth(query);
|
List<IntegerIntegerVO> startList = this.selectCountGroupByStartMonth(query);
|
||||||
|
|
||||||
// 查询每月完成的项目数
|
// 查询每月完成的项目数
|
||||||
List<IntegerIntegerVO> finishList = this.selectCountGroupByCompleteMonth(query);
|
List<IntegerIntegerVO> finishList = this.selectCountGroupByCompleteMonth(query);
|
||||||
|
@ -73,25 +72,23 @@ public class DashboardProjectService {
|
||||||
List<StringIntegerVO> projectMap = projectService.selectCountGroupByStatus(query);
|
List<StringIntegerVO> projectMap = projectService.selectCountGroupByStatus(query);
|
||||||
vo.setStatusGroup(projectMap);
|
vo.setStatusGroup(projectMap);
|
||||||
}
|
}
|
||||||
|
if (keyList.contains(BriefKeys.PROJECT_DEV_ON_TIME_COMPLETED)) {
|
||||||
|
vo.setDevOnTimeCompleted(this.selectDevOnTimeCompletedCount(query));
|
||||||
|
}
|
||||||
if (keyList.contains(BriefKeys.PROJECT_DEV_COMPLETED)) {
|
if (keyList.contains(BriefKeys.PROJECT_DEV_COMPLETED)) {
|
||||||
int devCompleted = this.selectDevCompletedCount(query);
|
vo.setDevCompleted(this.selectDevCompletedCount(query));
|
||||||
vo.setDevCompleted(devCompleted);
|
|
||||||
}
|
}
|
||||||
if (keyList.contains(BriefKeys.PROJECT_OVERDUE_DEV_UNCOMPLETED)) {
|
if (keyList.contains(BriefKeys.PROJECT_OVERDUE_DEV_UNCOMPLETED)) {
|
||||||
int devOverdueUncompleted = this.selectDevOverdueUncompletedCount(query);
|
vo.setDevOverdueUncompleted(this.selectDevOverdueUncompletedCount(query));
|
||||||
vo.setDevOverdueUncompleted(devOverdueUncompleted);
|
|
||||||
}
|
}
|
||||||
if (keyList.contains(BriefKeys.PROJECT_OVERDUE_DEV_COMPLETED)) {
|
if (keyList.contains(BriefKeys.PROJECT_OVERDUE_DEV_COMPLETED)) {
|
||||||
int devOverdueCompleted = this.selectDevOverdueCompletedCount(query);
|
vo.setDevOverdueCompleted(this.selectDevOverdueCompletedCount(query));
|
||||||
vo.setDevOverdueCompleted(devOverdueCompleted);
|
|
||||||
}
|
}
|
||||||
if (keyList.contains(BriefKeys.PROJECT_DEV_OVERDUE)) {
|
if (keyList.contains(BriefKeys.PROJECT_DEV_OVERDUE)) {
|
||||||
int devOverdue = this.selectDevOverdueCount(query);
|
vo.setDevOverdue(this.selectDevOverdueCount(query));
|
||||||
vo.setDevOverdue(devOverdue);
|
|
||||||
}
|
}
|
||||||
if (keyList.contains(BriefKeys.PROJECT_DEV_SOON_EXPIRE)) {
|
if (keyList.contains(BriefKeys.PROJECT_DEV_SOON_EXPIRE)) {
|
||||||
int soonExpire = this.selectDevSoonExpireCount(query);
|
vo.setDevSoonExpire(this.selectDevSoonExpireCount(query));
|
||||||
vo.setDevSoonExpire(soonExpire);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,64 +112,32 @@ public class DashboardProjectService {
|
||||||
return projectService.selectCount(query);
|
return projectService.selectCount(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 按月查询新增项目数
|
|
||||||
public List<IntegerIntegerVO> selectCountGroupByCreateMonth(MonthProjectQuery query) {
|
|
||||||
ProjectQuery projectQuery = new ProjectQuery();
|
|
||||||
projectQuery.setCreateYear(query.getYear());
|
|
||||||
return projectService.selectCountGroupByCreateMonth(projectQuery);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 按月查询完成项目数
|
// 按月查询完成项目数
|
||||||
public List<IntegerIntegerVO> selectCountGroupByCompleteMonth(MonthProjectQuery query) {
|
public List<IntegerIntegerVO> selectCountGroupByCompleteMonth(MonthProjectQuery query) {
|
||||||
ProjectQuery projectQuery = new ProjectQuery();
|
ProjectQuery projectQuery = new ProjectQuery();
|
||||||
projectQuery.setCompleteYear(query.getYear());
|
projectQuery.setCompleteYear(query.getYear());
|
||||||
|
projectQuery.setScope(query.getScope());
|
||||||
return projectService.selectCountGroupByCompleteMonth(projectQuery);
|
return projectService.selectCountGroupByCompleteMonth(projectQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 按月查询开始项目数
|
// 按月查询开始项目数
|
||||||
public List<IntegerIntegerVO> selectCoungGroupByStartMonth(MonthProjectQuery query) {
|
public List<IntegerIntegerVO> selectCountGroupByStartMonth(MonthProjectQuery query) {
|
||||||
ProjectQuery projectQuery = new ProjectQuery();
|
ProjectQuery projectQuery = new ProjectQuery();
|
||||||
projectQuery.setStartYear(query.getYear());
|
projectQuery.setStartYear(query.getYear());
|
||||||
|
projectQuery.setScope(query.getScope());
|
||||||
return projectService.selectCountGroupByStartMonth(projectQuery);
|
return projectService.selectCountGroupByStartMonth(projectQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取项目比率
|
|
||||||
public ProjectRateVO selectProjectRate() {
|
|
||||||
ProjectRateVO result = new ProjectRateVO();
|
|
||||||
|
|
||||||
// 查询总数
|
|
||||||
ProjectQuery query = new ProjectQuery();
|
|
||||||
query.setScope(true);
|
|
||||||
int total = projectService.selectCount(query);
|
|
||||||
result.setTotal(total);
|
|
||||||
|
|
||||||
// 查询完成数
|
// 查询完成数
|
||||||
result.setCompleted(this.selectCompletedCount());
|
private int selectDevCompletedCount(ProjectQuery projectQuery) {
|
||||||
|
|
||||||
// 查询超期数
|
|
||||||
result.setDevOverdue(this.selectDevOverdueCount());
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询完成数
|
|
||||||
private int selectCompletedCount() {
|
|
||||||
ProjectQuery query = new ProjectQuery();
|
ProjectQuery query = new ProjectQuery();
|
||||||
|
BeanUtils.copyBeanProp(query, projectQuery);
|
||||||
query.setStatusList(ProjectStatus.completedList());
|
query.setStatusList(ProjectStatus.completedList());
|
||||||
query.setScope(true);
|
|
||||||
return projectService.selectCount(query);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询开发超期数
|
|
||||||
private int selectDevOverdueCount() {
|
|
||||||
ProjectQuery query = new ProjectQuery();
|
|
||||||
query.setDevOverdue(true);
|
|
||||||
query.setScope(true);
|
|
||||||
return projectService.selectCount(query);
|
return projectService.selectCount(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询正常开发完成数
|
// 查询正常开发完成数
|
||||||
private int selectDevCompletedCount(ProjectQuery projectQuery) {
|
private int selectDevOnTimeCompletedCount(ProjectQuery projectQuery) {
|
||||||
ProjectQuery query = new ProjectQuery();
|
ProjectQuery query = new ProjectQuery();
|
||||||
BeanUtils.copyBeanProp(query, projectQuery);
|
BeanUtils.copyBeanProp(query, projectQuery);
|
||||||
query.setStatusList(ProjectStatus.completedList());
|
query.setStatusList(ProjectStatus.completedList());
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ruoyi.web.dashboard;
|
package com.ruoyi.web.dashboard;
|
||||||
|
|
||||||
|
import com.ruoyi.bst.project.domain.ProjectQuery;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
@ -23,15 +24,8 @@ public class DashboardProjectController {
|
||||||
@GetMapping("/month")
|
@GetMapping("/month")
|
||||||
@PreAuthorize("@ss.hasPermi('dashboard:project:month')")
|
@PreAuthorize("@ss.hasPermi('dashboard:project:month')")
|
||||||
public AjaxResult month(MonthProjectQuery query) {
|
public AjaxResult month(MonthProjectQuery query) {
|
||||||
|
query.setScope(true);
|
||||||
return AjaxResult.success(dashboardProjectService.selectMonthProject(query));
|
return AjaxResult.success(dashboardProjectService.selectMonthProject(query));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取项目比率
|
|
||||||
@GetMapping("/rate")
|
|
||||||
@PreAuthorize("@ss.hasPermi('dashboard:project:rate')")
|
|
||||||
public AjaxResult rate() {
|
|
||||||
return AjaxResult.success(dashboardProjectService.selectProjectRate());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user