@@ -126,9 +126,8 @@ public class ProjectRenewalFundManage { | |||||
query.eq(Project::getNewest, Boolean.TRUE); | query.eq(Project::getNewest, Boolean.TRUE); | ||||
//自己单位 | //自己单位 | ||||
query.eq(Project::getBuildOrgCode,user.getEmpPosUnitCode()); | query.eq(Project::getBuildOrgCode,user.getEmpPosUnitCode()); | ||||
//立项批复到初验 | |||||
//立项批复后 都可以 | |||||
query.gt(Project::getStatus,ProjectStatusEnum.APPROVED_AFTER_CHOICE.getCode()); | query.gt(Project::getStatus,ProjectStatusEnum.APPROVED_AFTER_CHOICE.getCode()); | ||||
query.le(Project::getStatus,ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); | |||||
Page<Project> page = projectService.page(req.page(), query); | Page<Project> page = projectService.page(req.page(), query); | ||||
if (CollUtil.isEmpty(page.getRecords())) { | if (CollUtil.isEmpty(page.getRecords())) { | ||||
return PageVo.empty(); | return PageVo.empty(); | ||||
@@ -419,9 +418,10 @@ public class ProjectRenewalFundManage { | |||||
int year = plan.getPaymentTime().getYear(); | int year = plan.getPaymentTime().getYear(); | ||||
if(Objects.nonNull(year) && projectYear.equals(year)){ | if(Objects.nonNull(year) && projectYear.equals(year)){ | ||||
hasYearPlan = Boolean.TRUE; | hasYearPlan = Boolean.TRUE; | ||||
//2 如果有 这一年的实际支付金额有没有填 | |||||
}else if(Objects.nonNull(year) && projectYear.compareTo(year) > 0){ | |||||
//2 如果有 这一年前的实际支付金额有没有填 | |||||
VUtils.isTrue(Objects.isNull(plan.getActualPaymentAmount())) | VUtils.isTrue(Objects.isNull(plan.getActualPaymentAmount())) | ||||
.throwMessage("未填写当年度的实际支付金额,请去合同备案补充"); | |||||
.throwMessage("有漏填写此年度之前年度的实际支付金额,请去合同备案补充"); | |||||
} | } | ||||
} | } | ||||
VUtils.isTrue(!hasYearPlan).throwMessage("未有所选年度的支付计划,无法提交"); | VUtils.isTrue(!hasYearPlan).throwMessage("未有所选年度的支付计划,无法提交"); | ||||
@@ -28,6 +28,9 @@ public class WarningListReq extends PagePo { | |||||
@ApiModelProperty("申报单位") | @ApiModelProperty("申报单位") | ||||
private String buildOrgName; | private String buildOrgName; | ||||
@ApiModelProperty("申报单位code") | |||||
private String buildOrgCode; | |||||
@ApiModelProperty("提醒开始时间") | @ApiModelProperty("提醒开始时间") | ||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||||
private LocalDateTime startTime; | private LocalDateTime startTime; | ||||
@@ -44,6 +44,7 @@ public class EarlyWarningRecordsServiceImpl extends ServiceImpl<EarlyWarningReco | |||||
.eq(StringUtils.isNotBlank(req.getAreaCode()),WflowEarlyWarningRecords::getAreaCode,req.getAreaCode()) | .eq(StringUtils.isNotBlank(req.getAreaCode()),WflowEarlyWarningRecords::getAreaCode,req.getAreaCode()) | ||||
.like(StringUtils.isNotBlank(req.getProjectName()), WflowEarlyWarningRecords::getProjectName, req.getProjectName()) | .like(StringUtils.isNotBlank(req.getProjectName()), WflowEarlyWarningRecords::getProjectName, req.getProjectName()) | ||||
.like(StringUtils.isNotBlank(req.getBuildOrgName()), WflowEarlyWarningRecords::getBuildOrgName, req.getBuildOrgName()) | .like(StringUtils.isNotBlank(req.getBuildOrgName()), WflowEarlyWarningRecords::getBuildOrgName, req.getBuildOrgName()) | ||||
.eq(StringUtils.isNotBlank(req.getBuildOrgCode()), WflowEarlyWarningRecords::getBuildOrgCode, req.getBuildOrgCode()) | |||||
.ge(Objects.nonNull(req.getStartTime()),WflowEarlyWarningRecords::getWarningTime,req.getStartTime()) | .ge(Objects.nonNull(req.getStartTime()),WflowEarlyWarningRecords::getWarningTime,req.getStartTime()) | ||||
.le(Objects.nonNull(req.getEndTime()),WflowEarlyWarningRecords::getWarningTime,req.getEndTime()) | .le(Objects.nonNull(req.getEndTime()),WflowEarlyWarningRecords::getWarningTime,req.getEndTime()) | ||||
.orderByDesc(WflowEarlyWarningRecords::getCreateOn); | .orderByDesc(WflowEarlyWarningRecords::getCreateOn); | ||||
@@ -11,6 +11,7 @@ import com.ningdatech.pmapi.workbench.model.vo.WorkbenchVO; | |||||
import java.util.Collections; | import java.util.Collections; | ||||
import java.util.List; | import java.util.List; | ||||
import java.util.Objects; | |||||
/** | /** | ||||
* @Classname WorkbenchConverter | * @Classname WorkbenchConverter | ||||
@@ -20,8 +21,12 @@ import java.util.List; | |||||
*/ | */ | ||||
public class WorkbenchConverter { | public class WorkbenchConverter { | ||||
public static WorkbenchVO.DeclaredStatistics convert(DeclaredProjectStatisticsPO po) { | |||||
public static WorkbenchVO.DeclaredStatistics convert(DeclaredProjectStatisticsPO po,DeclaredProjectStatisticsPO lastYearPo) { | |||||
WorkbenchVO.DeclaredStatistics res = BeanUtil.copyProperties(po,WorkbenchVO.DeclaredStatistics.class); | WorkbenchVO.DeclaredStatistics res = BeanUtil.copyProperties(po,WorkbenchVO.DeclaredStatistics.class); | ||||
if(Objects.nonNull(lastYearPo)){ | |||||
res.setDeclaredAmountLastYear(lastYearPo.getDeclaredAmount()); | |||||
res.setApprovalAmountLastYear(lastYearPo.getApprovalAmount()); | |||||
} | |||||
return res; | return res; | ||||
} | } | ||||
@@ -1,25 +1,28 @@ | |||||
package com.ningdatech.pmapi.workbench.manage; | package com.ningdatech.pmapi.workbench.manage; | ||||
import com.google.common.collect.Lists; | |||||
import com.ningdatech.basic.model.PageVo; | |||||
import com.ningdatech.pmapi.common.helper.UserInfoHelper; | import com.ningdatech.pmapi.common.helper.UserInfoHelper; | ||||
import com.ningdatech.pmapi.projectdeclared.manage.DeclaredProjectManage; | |||||
import com.ningdatech.pmapi.projectdeclared.manage.DefaultDeclaredProjectManage; | import com.ningdatech.pmapi.projectdeclared.manage.DefaultDeclaredProjectManage; | ||||
import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage; | import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage; | ||||
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; | import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; | ||||
import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; | |||||
import com.ningdatech.pmapi.sys.manage.NoticeManage; | import com.ningdatech.pmapi.sys.manage.NoticeManage; | ||||
import com.ningdatech.pmapi.sys.model.req.NoticeListReq; | import com.ningdatech.pmapi.sys.model.req.NoticeListReq; | ||||
import com.ningdatech.pmapi.sys.model.req.WarningListReq; | |||||
import com.ningdatech.pmapi.sys.model.vo.WflowEarlyWarningRecordsVO; | |||||
import com.ningdatech.pmapi.sys.service.IEarlyWarningRecordsService; | |||||
import com.ningdatech.pmapi.todocenter.manage.TodoCenterManage; | import com.ningdatech.pmapi.todocenter.manage.TodoCenterManage; | ||||
import com.ningdatech.pmapi.todocenter.model.req.ToBeProcessedReq; | import com.ningdatech.pmapi.todocenter.model.req.ToBeProcessedReq; | ||||
import com.ningdatech.pmapi.todocenter.model.vo.TodoCenterStatisticsVO; | import com.ningdatech.pmapi.todocenter.model.vo.TodoCenterStatisticsVO; | ||||
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; | import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; | ||||
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; | |||||
import com.ningdatech.pmapi.user.util.LoginUserUtil; | import com.ningdatech.pmapi.user.util.LoginUserUtil; | ||||
import com.ningdatech.pmapi.workbench.converter.WorkbenchConverter; | import com.ningdatech.pmapi.workbench.converter.WorkbenchConverter; | ||||
import com.ningdatech.pmapi.workbench.model.vo.WorkbenchVO; | import com.ningdatech.pmapi.workbench.model.vo.WorkbenchVO; | ||||
import com.wflow.enums.WarningRuleTypeEnum; | |||||
import lombok.AllArgsConstructor; | import lombok.AllArgsConstructor; | ||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
import java.util.ArrayList; | import java.util.ArrayList; | ||||
import java.util.List; | |||||
import java.util.concurrent.CompletableFuture; | import java.util.concurrent.CompletableFuture; | ||||
import java.util.concurrent.ForkJoinPool; | import java.util.concurrent.ForkJoinPool; | ||||
import java.util.stream.Collectors; | import java.util.stream.Collectors; | ||||
@@ -38,7 +41,7 @@ public class WorkbenchManage { | |||||
private final DefaultDeclaredProjectManage defaultDeclaredProjectManage; | private final DefaultDeclaredProjectManage defaultDeclaredProjectManage; | ||||
private final DeclaredProjectManage declaredProjectManage; | |||||
private final IEarlyWarningRecordsService earlyWarningRecordsService; | |||||
private final NoticeManage noticeManage; | private final NoticeManage noticeManage; | ||||
@@ -66,9 +69,11 @@ public class WorkbenchManage { | |||||
}, ForkJoinPool.commonPool()), | }, ForkJoinPool.commonPool()), | ||||
CompletableFuture.runAsync(() -> { | CompletableFuture.runAsync(() -> { | ||||
//2.项目统计数据 | //2.项目统计数据 | ||||
res.setOrgDeclared(WorkbenchConverter.convert(defaultDeclaredProjectManage.declaredProjectOrgStatistics(year, user))); | |||||
res.setOrgDeclared(WorkbenchConverter.convert(defaultDeclaredProjectManage | |||||
.declaredProjectOrgStatistics(year, user),defaultDeclaredProjectManage.declaredProjectOrgStatistics(year - 1, user))); | |||||
if (userInfoHelper.isSuperOrRegionAdmin(user.getUserId())) { | if (userInfoHelper.isSuperOrRegionAdmin(user.getUserId())) { | ||||
res.setRegionDeclared(WorkbenchConverter.convert(defaultDeclaredProjectManage.declaredProjectRegionStatistics(year, user))); | |||||
res.setRegionDeclared(WorkbenchConverter.convert(defaultDeclaredProjectManage | |||||
.declaredProjectRegionStatistics(year, user),defaultDeclaredProjectManage.declaredProjectRegionStatistics(year - 1, user))); | |||||
} | } | ||||
}, ForkJoinPool.commonPool()), | }, ForkJoinPool.commonPool()), | ||||
CompletableFuture.runAsync(() -> { | CompletableFuture.runAsync(() -> { | ||||
@@ -77,6 +82,45 @@ public class WorkbenchManage { | |||||
noticeListReq.setPageNumber(1); | noticeListReq.setPageNumber(1); | ||||
noticeListReq.setPageSize(1000); | noticeListReq.setPageSize(1000); | ||||
res.setNoticeList(noticeManage.listToMapByManager(noticeListReq,user)); | res.setNoticeList(noticeManage.listToMapByManager(noticeListReq,user)); | ||||
}, ForkJoinPool.commonPool()), | |||||
CompletableFuture.runAsync(() -> { | |||||
//4.预警记录 | |||||
List<WorkbenchVO.EarlyWarning> eaylies = Lists.newArrayList(); | |||||
WarningListReq req = new WarningListReq(); | |||||
// req.setBuildOrgCode(user.getEmpPosUnitCode()); | |||||
WorkbenchVO.EarlyWarning early1 = new WorkbenchVO.EarlyWarning(); | |||||
early1.setType(WarningRuleTypeEnum.PROCESS_WARNING.getCode()); | |||||
early1.setTypeName(WarningRuleTypeEnum.PROCESS_WARNING.getDesc()); | |||||
PageVo<WflowEarlyWarningRecordsVO> records1 = earlyWarningRecordsService | |||||
.records(WarningRuleTypeEnum.PROCESS_WARNING.getCode(), req); | |||||
early1.setTotal(records1.getTotal().intValue()); | |||||
early1.setRecords(Lists.newArrayList(records1.getRecords())); | |||||
eaylies.add(early1); | |||||
WorkbenchVO.EarlyWarning early2 = new WorkbenchVO.EarlyWarning(); | |||||
early2.setType(WarningRuleTypeEnum.DECLARED_WARNING.getCode()); | |||||
early1.setTypeName(WarningRuleTypeEnum.DECLARED_WARNING.getDesc()); | |||||
PageVo<WflowEarlyWarningRecordsVO> records2 = earlyWarningRecordsService | |||||
.records(WarningRuleTypeEnum.DECLARED_WARNING.getCode(), req); | |||||
early2.setRecords(Lists.newArrayList(records2.getRecords())); | |||||
early2.setTotal(records2.getTotal().intValue()); | |||||
eaylies.add(early2); | |||||
WorkbenchVO.EarlyWarning early3 = new WorkbenchVO.EarlyWarning(); | |||||
early3.setType(WarningRuleTypeEnum.OPERATION_WARNING.getCode()); | |||||
early3.setTypeName(WarningRuleTypeEnum.OPERATION_WARNING.getDesc()); | |||||
PageVo<WflowEarlyWarningRecordsVO> records3 = earlyWarningRecordsService | |||||
.records(WarningRuleTypeEnum.OPERATION_WARNING.getCode(), req); | |||||
early3.setRecords(Lists.newArrayList(records3.getRecords())); | |||||
early3.setTotal(records3.getTotal().intValue()); | |||||
eaylies.add(early3); | |||||
WorkbenchVO.EarlyWarning early4 = new WorkbenchVO.EarlyWarning(); | |||||
early4.setType(WarningRuleTypeEnum.RENEWAL_FUND.getCode()); | |||||
early4.setTypeName(WarningRuleTypeEnum.RENEWAL_FUND.getDesc()); | |||||
PageVo<WflowEarlyWarningRecordsVO> records4 = earlyWarningRecordsService | |||||
.records(WarningRuleTypeEnum.RENEWAL_FUND.getCode(), req); | |||||
early4.setRecords(Lists.newArrayList(records4.getRecords())); | |||||
early4.setTotal(records4.getTotal().intValue()); | |||||
eaylies.add(early4); | |||||
res.setEarlyWarning(eaylies); | |||||
}, ForkJoinPool.commonPool()) | }, ForkJoinPool.commonPool()) | ||||
).join(); | ).join(); | ||||
@@ -2,14 +2,17 @@ package com.ningdatech.pmapi.workbench.model.vo; | |||||
import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; | import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; | ||||
import com.ningdatech.pmapi.sys.model.vo.NoticeListItemVO; | import com.ningdatech.pmapi.sys.model.vo.NoticeListItemVO; | ||||
import com.ningdatech.pmapi.sys.model.vo.WflowEarlyWarningRecordsVO; | |||||
import com.ningdatech.pmapi.todocenter.model.vo.TodoCenterStatisticsVO; | import com.ningdatech.pmapi.todocenter.model.vo.TodoCenterStatisticsVO; | ||||
import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.ApiModelProperty; | ||||
import lombok.Data; | import lombok.Data; | ||||
import java.io.Serializable; | import java.io.Serializable; | ||||
import java.math.BigDecimal; | import java.math.BigDecimal; | ||||
import java.math.RoundingMode; | |||||
import java.util.List; | import java.util.List; | ||||
import java.util.Map; | import java.util.Map; | ||||
import java.util.Objects; | |||||
/** | /** | ||||
* @Classname WorkbenchVO | * @Classname WorkbenchVO | ||||
@@ -35,6 +38,24 @@ public class WorkbenchVO implements Serializable { | |||||
@ApiModelProperty("公告列表") | @ApiModelProperty("公告列表") | ||||
public Map<String,List<NoticeListItemVO>> noticeList; | public Map<String,List<NoticeListItemVO>> noticeList; | ||||
@ApiModelProperty("预警记录") | |||||
public List<EarlyWarning> earlyWarning; | |||||
@Data | |||||
public static class EarlyWarning { | |||||
@ApiModelProperty("类型") | |||||
private Integer type; | |||||
@ApiModelProperty("类型名称") | |||||
private String typeName; | |||||
@ApiModelProperty("总数") | |||||
private Integer total; | |||||
@ApiModelProperty("预警记录") | |||||
private List<WflowEarlyWarningRecordsVO> records; | |||||
} | |||||
@Data | @Data | ||||
public static class DeclaredStatistics { | public static class DeclaredStatistics { | ||||
@ApiModelProperty("总项目数") | @ApiModelProperty("总项目数") | ||||
@@ -56,8 +77,46 @@ public class WorkbenchVO implements Serializable { | |||||
private Integer archivedNum; | private Integer archivedNum; | ||||
@ApiModelProperty("申报总金额") | @ApiModelProperty("申报总金额") | ||||
private BigDecimal declaredAmount; | |||||
private BigDecimal declaredAmount = BigDecimal.ZERO; | |||||
@ApiModelProperty("立项总金额") | @ApiModelProperty("立项总金额") | ||||
private BigDecimal approvalAmount; | |||||
private BigDecimal approvalAmount = BigDecimal.ZERO; | |||||
@ApiModelProperty("申报总金额-去年") | |||||
private BigDecimal declaredAmountLastYear = BigDecimal.ZERO; | |||||
@ApiModelProperty("立项总金额-去年") | |||||
private BigDecimal approvalAmountLastYear = BigDecimal.ZERO; | |||||
@ApiModelProperty("申报总金额-较去年 增长") | |||||
private BigDecimal declaredAmountGrowthRate; | |||||
@ApiModelProperty("立项总金额-较去年 增长") | |||||
private BigDecimal approvalAmountGrowthRate; | |||||
public BigDecimal getDeclaredAmountGrowthRate(){ | |||||
// if((Objects.nonNull(declaredAmount)&&declaredAmount.compareTo(BigDecimal.ZERO) > 0) && (Objects.isNull(declaredAmountLastYear) || | |||||
// declaredAmountLastYear.compareTo(BigDecimal.ZERO) == 0)){ | |||||
// return BigDecimal.valueOf(100); | |||||
// } | |||||
if(Objects.nonNull(declaredAmountLastYear) && declaredAmountLastYear.compareTo(BigDecimal.ZERO) > 0){ | |||||
return declaredAmount.subtract(declaredAmountLastYear).multiply(BigDecimal.valueOf(100)) | |||||
.divide(declaredAmountLastYear,BigDecimal.ROUND_CEILING) | |||||
.setScale(BigDecimal.ROUND_CEILING, RoundingMode.CEILING); | |||||
} | |||||
return BigDecimal.ZERO; | |||||
} | |||||
public BigDecimal getDeclaredApprovalAmountGrowthRate(){ | |||||
// if((Objects.nonNull(approvalAmount)&&approvalAmount.compareTo(BigDecimal.ZERO) > 0) && (Objects.isNull(approvalAmountLastYear) || | |||||
// approvalAmountLastYear.compareTo(BigDecimal.ZERO) == 0)){ | |||||
// return BigDecimal.valueOf(100); | |||||
// } | |||||
if(Objects.nonNull(declaredAmountLastYear) && approvalAmountLastYear.compareTo(BigDecimal.ZERO) > 0){ | |||||
return approvalAmount.subtract(approvalAmountLastYear).multiply(BigDecimal.valueOf(100)) | |||||
.divide(approvalAmountLastYear,BigDecimal.ROUND_CEILING) | |||||
.setScale(BigDecimal.ROUND_CEILING, RoundingMode.CEILING); | |||||
} | |||||
return BigDecimal.ZERO; | |||||
} | |||||
} | } | ||||
} | } |