|
|
@@ -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; |
|
|
|
} |
|
|
|
|
|
|
|