Browse Source

queryYearBO

tags/24080901
niohe·erbao 1 year ago
parent
commit
09b56b653a
3 changed files with 75 additions and 0 deletions
  1. +41
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/manage/DashboardProjectManage.java
  2. +21
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/basic/QueryTimeYearBO.java
  3. +13
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/vo/DashboardProjectSummaryVO.java

+ 41
- 0
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/manage/DashboardProjectManage.java View File

@@ -1,5 +1,6 @@
package com.ningdatech.pmapi.dashboard.manage;

import com.ningdatech.pmapi.dashboard.model.basic.QueryTimeYearBO;
import com.ningdatech.pmapi.dashboard.model.po.QueryYearPO;
import com.ningdatech.pmapi.dashboard.model.vo.DashboardInvestmentSummaryVO;
import com.ningdatech.pmapi.dashboard.model.vo.DashboardProjectCntSummaryVO;
@@ -7,6 +8,12 @@ import com.ningdatech.pmapi.dashboard.model.vo.DashboardProjectSummaryVO;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAdjusters;

/**
* @author liuxinxin
* @date 2023/8/2 上午10:39
@@ -16,7 +23,41 @@ import org.springframework.stereotype.Component;
@RequiredArgsConstructor
public class DashboardProjectManage {

private static String timeFormat = "%s-01-01 00:00:00";


/**
* 查询年份BO 装配
*
* @param year
* @return
*/
private QueryTimeYearBO getQueryTimeYearBO(Integer year) {
QueryTimeYearBO queryTimeYearBO = new QueryTimeYearBO();
if (year == null) {
//获取今年第一天
LocalDate lastYearStrDay = LocalDate.of(LocalDate.now().minusYears(1).getYear(), 1, 1);
LocalDate firstDayOfYear = lastYearStrDay.with(TemporalAdjusters.firstDayOfYear());
LocalDate lastDayOfYear = lastYearStrDay.with(TemporalAdjusters.lastDayOfYear());
//获取今年第一天
LocalDateTime firstDateOfYear = LocalDateTime.of(firstDayOfYear, LocalTime.MIN);
//获取今年最后一天
LocalDateTime lastDateOfYear = LocalDateTime.of(lastDayOfYear, LocalTime.MAX);

queryTimeYearBO.setStartYearTime(firstDateOfYear);
queryTimeYearBO.setEndYearTime(lastDateOfYear);
} else {
String startTimeStr = String.format(timeFormat, year);
String endTimeStr = String.format(timeFormat, year + 1);
queryTimeYearBO.setStartYearTime(LocalDateTime.parse(startTimeStr, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
queryTimeYearBO.setEndYearTime(LocalDateTime.parse(endTimeStr, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
}
return queryTimeYearBO;
}

public DashboardInvestmentSummaryVO getInvestmentSummary(QueryYearPO queryYearPO) {
Integer year = queryYearPO.getYear();

return null;
}



+ 21
- 0
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/basic/QueryTimeYearBO.java View File

@@ -0,0 +1,21 @@
package com.ningdatech.pmapi.dashboard.model.basic;

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

import java.time.LocalDateTime;

/**
* @author liuxinxin
* @date 2023/7/27 下午3:24
*/

@Data
public class QueryTimeYearBO {

@ApiModelProperty("开始年份时间")
private LocalDateTime startYearTime;

@ApiModelProperty("截止年份时间")
private LocalDateTime endYearTime;
}

+ 13
- 0
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/vo/DashboardProjectSummaryVO.java View File

@@ -1,6 +1,7 @@
package com.ningdatech.pmapi.dashboard.model.vo;

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

/**
@@ -25,4 +26,16 @@ public class DashboardProjectSummaryVO {
* 项目变更数量
* 项目变更金额
*/

@ApiModelProperty("项目总数")
private Integer projectCnt;

@ApiModelProperty("待立项项目数")
private Integer toBeApprovedProjectCnt;

@ApiModelProperty("已立项项目数")
private Integer approvedProjectCnt;



}

Loading…
Cancel
Save