瀏覽代碼

工作台整改

master
PoffyZhang 11 月之前
父節點
當前提交
8fc6581792
共有 6 個文件被更改,包括 126 次插入14 次删除
  1. +4
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java
  2. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/sys/model/req/WarningListReq.java
  3. +1
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/EarlyWarningRecordsServiceImpl.java
  4. +6
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/workbench/converter/WorkbenchConverter.java
  5. +51
    -7
      pmapi/src/main/java/com/ningdatech/pmapi/workbench/manage/WorkbenchManage.java
  6. +61
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/workbench/model/vo/WorkbenchVO.java

+ 4
- 4
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java 查看文件

@@ -126,9 +126,8 @@ public class ProjectRenewalFundManage {
query.eq(Project::getNewest, Boolean.TRUE);
//自己单位
query.eq(Project::getBuildOrgCode,user.getEmpPosUnitCode());
//立项批复到初验
//立项批复后 都可以
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);
if (CollUtil.isEmpty(page.getRecords())) {
return PageVo.empty();
@@ -419,9 +418,10 @@ public class ProjectRenewalFundManage {
int year = plan.getPaymentTime().getYear();
if(Objects.nonNull(year) && projectYear.equals(year)){
hasYearPlan = Boolean.TRUE;
//2 如果有 这一年的实际支付金额有没有填
}else if(Objects.nonNull(year) && projectYear.compareTo(year) > 0){
//2 如果有 这一年前的实际支付金额有没有填
VUtils.isTrue(Objects.isNull(plan.getActualPaymentAmount()))
.throwMessage("未填写当年度的实际支付金额,请去合同备案补充");
.throwMessage("有漏填写此年度之前年度的实际支付金额,请去合同备案补充");
}
}
VUtils.isTrue(!hasYearPlan).throwMessage("未有所选年度的支付计划,无法提交");


+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/sys/model/req/WarningListReq.java 查看文件

@@ -28,6 +28,9 @@ public class WarningListReq extends PagePo {
@ApiModelProperty("申报单位")
private String buildOrgName;

@ApiModelProperty("申报单位code")
private String buildOrgCode;

@ApiModelProperty("提醒开始时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime startTime;


+ 1
- 0
pmapi/src/main/java/com/ningdatech/pmapi/sys/service/impl/EarlyWarningRecordsServiceImpl.java 查看文件

@@ -44,6 +44,7 @@ public class EarlyWarningRecordsServiceImpl extends ServiceImpl<EarlyWarningReco
.eq(StringUtils.isNotBlank(req.getAreaCode()),WflowEarlyWarningRecords::getAreaCode,req.getAreaCode())
.like(StringUtils.isNotBlank(req.getProjectName()), WflowEarlyWarningRecords::getProjectName, req.getProjectName())
.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())
.le(Objects.nonNull(req.getEndTime()),WflowEarlyWarningRecords::getWarningTime,req.getEndTime())
.orderByDesc(WflowEarlyWarningRecords::getCreateOn);


+ 6
- 1
pmapi/src/main/java/com/ningdatech/pmapi/workbench/converter/WorkbenchConverter.java 查看文件

@@ -11,6 +11,7 @@ import com.ningdatech.pmapi.workbench.model.vo.WorkbenchVO;

import java.util.Collections;
import java.util.List;
import java.util.Objects;

/**
* @Classname WorkbenchConverter
@@ -20,8 +21,12 @@ import java.util.List;
*/
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);
if(Objects.nonNull(lastYearPo)){
res.setDeclaredAmountLastYear(lastYearPo.getDeclaredAmount());
res.setApprovalAmountLastYear(lastYearPo.getApprovalAmount());
}
return res;
}



+ 51
- 7
pmapi/src/main/java/com/ningdatech/pmapi/workbench/manage/WorkbenchManage.java 查看文件

@@ -1,25 +1,28 @@
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.projectdeclared.manage.DeclaredProjectManage;
import com.ningdatech.pmapi.projectdeclared.manage.DefaultDeclaredProjectManage;
import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage;
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.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.model.req.ToBeProcessedReq;
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.UserInfoDetails;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import com.ningdatech.pmapi.workbench.converter.WorkbenchConverter;
import com.ningdatech.pmapi.workbench.model.vo.WorkbenchVO;
import com.wflow.enums.WarningRuleTypeEnum;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ForkJoinPool;
import java.util.stream.Collectors;
@@ -38,7 +41,7 @@ public class WorkbenchManage {

private final DefaultDeclaredProjectManage defaultDeclaredProjectManage;

private final DeclaredProjectManage declaredProjectManage;
private final IEarlyWarningRecordsService earlyWarningRecordsService;

private final NoticeManage noticeManage;

@@ -66,9 +69,11 @@ public class WorkbenchManage {
}, ForkJoinPool.commonPool()),
CompletableFuture.runAsync(() -> {
//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())) {
res.setRegionDeclared(WorkbenchConverter.convert(defaultDeclaredProjectManage.declaredProjectRegionStatistics(year, user)));
res.setRegionDeclared(WorkbenchConverter.convert(defaultDeclaredProjectManage
.declaredProjectRegionStatistics(year, user),defaultDeclaredProjectManage.declaredProjectRegionStatistics(year - 1, user)));
}
}, ForkJoinPool.commonPool()),
CompletableFuture.runAsync(() -> {
@@ -77,6 +82,45 @@ public class WorkbenchManage {
noticeListReq.setPageNumber(1);
noticeListReq.setPageSize(1000);
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())
).join();



+ 61
- 2
pmapi/src/main/java/com/ningdatech/pmapi/workbench/model/vo/WorkbenchVO.java 查看文件

@@ -2,14 +2,17 @@ package com.ningdatech.pmapi.workbench.model.vo;

import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO;
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 io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.List;
import java.util.Map;
import java.util.Objects;

/**
* @Classname WorkbenchVO
@@ -35,6 +38,24 @@ public class WorkbenchVO implements Serializable {
@ApiModelProperty("公告列表")
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
public static class DeclaredStatistics {
@ApiModelProperty("总项目数")
@@ -56,8 +77,46 @@ public class WorkbenchVO implements Serializable {
private Integer archivedNum;

@ApiModelProperty("申报总金额")
private BigDecimal declaredAmount;
private BigDecimal declaredAmount = BigDecimal.ZERO;
@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;
}
}
}

Loading…
取消
儲存