Browse Source

修改年度支付计划

tags/24080901
WendyYang 8 months ago
parent
commit
b79f45883b
11 changed files with 95 additions and 100 deletions
  1. +9
    -9
      hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ConstructionManage.java
  2. +10
    -10
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectLibManage.java
  3. +8
    -11
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectRenewalFundManage.java
  4. +2
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/mapper/ProjectAnnualPaymentPlanMapper.java
  5. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/mapper/ProjectAnnualPaymentPlanMapper.xml
  6. +2
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/entity/ProjectAnnualPaymentPlan.java
  7. +43
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/service/IProjectAnnualPaymentPlanService.java
  8. +0
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/service/IProjectApplicationService.java
  9. +0
    -44
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/service/IProjectPaymentPlanService.java
  10. +20
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/service/impl/ProjectAnnualPaymentPlanServiceImpl.java
  11. +0
    -20
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/service/impl/ProjectPaymentPlanServiceImpl.java

+ 9
- 9
hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ConstructionManage.java View File

@@ -30,14 +30,14 @@ import com.hz.pm.api.projectdeclared.service.*;
import com.hz.pm.api.projectlib.helper.ProjectHelper;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectInst;
import com.hz.pm.api.projectlib.model.entity.ProjectPaymentPlan;
import com.hz.pm.api.projectlib.model.entity.ProjectAnnualPaymentPlan;
import com.hz.pm.api.projectlib.model.enumeration.ProjectStatusEnum;
import com.hz.pm.api.projectlib.model.enumeration.ProjectTypeNewEnum;
import com.hz.pm.api.projectlib.model.enumeration.TenderStatusEnum;
import com.hz.pm.api.projectlib.model.req.ProjectListReq;
import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO;
import com.hz.pm.api.projectlib.service.IProjectInstService;
import com.hz.pm.api.projectlib.service.IProjectPaymentPlanService;
import com.hz.pm.api.projectlib.service.IProjectAnnualPaymentPlanService;
import com.hz.pm.api.projectlib.service.IProjectService;
import com.hz.pm.api.user.security.model.UserFullInfoDTO;
import com.hz.pm.api.user.security.model.UserInfoDetails;
@@ -89,7 +89,7 @@ public class ConstructionManage {
private final IPreInsAcceptancePersonService acceptancePersonService;
private final ProcessInstanceService processInstanceService;
private final StateMachineUtil stateMachineUtil;
private final IProjectPaymentPlanService projectPaymentPlanService;
private final IProjectAnnualPaymentPlanService projectPaymentPlanService;
private final TenderStateMachineUtil tenderStateMachineUtil;

/**
@@ -350,7 +350,7 @@ public class ConstructionManage {
projectCodes.add(project.getProjectCode());
}

Map<Long, List<ProjectPaymentPlan>> paymentPlansMap = projectPaymentPlanService.listByProjectIds(projectIds);
Map<Long, List<ProjectAnnualPaymentPlan>> paymentPlansMap = projectPaymentPlanService.listByProjectIds(projectIds);

List<ProjectLibListItemVO> records = CollUtils.convert(page.getRecords(), w -> {
ProjectLibListItemVO item = new ProjectLibListItemVO();
@@ -371,9 +371,9 @@ public class ConstructionManage {
item.setApprovalDate(w.getApprovalDate());
item.setDeliveryTime(w.getDeliveryTime());
item.setContractAmount(w.getContractAmount());
List<ProjectPaymentPlan> paymentPlans = paymentPlansMap.getOrDefault(w.getId(), Collections.emptyList());
List<ProjectAnnualPaymentPlan> paymentPlans = paymentPlansMap.getOrDefault(w.getId(), Collections.emptyList());
BigDecimal totalAnnualAmount = paymentPlans.stream()
.map(ProjectPaymentPlan::getAnnualPlanAmount)
.map(ProjectAnnualPaymentPlan::getAnnualPlanAmount)
.reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
item.setAnnualPlanAmount(totalAnnualAmount);
item.setTransactionTime(w.getTransactionTime());
@@ -405,7 +405,7 @@ public class ConstructionManage {
projectIds.add(project.getId());
}

Map<Long, List<ProjectPaymentPlan>> paymentPlansMap = projectPaymentPlanService.listByProjectIds(projectIds);
Map<Long, List<ProjectAnnualPaymentPlan>> paymentPlansMap = projectPaymentPlanService.listByProjectIds(projectIds);

AtomicInteger serialNumber = new AtomicInteger(0);
collect = records.stream().map(r -> {
@@ -419,9 +419,9 @@ public class ConstructionManage {
exportDTO.setDeliveryTime(r.getDeliveryTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
exportDTO.setContractAmount(r.getContractAmount());

List<ProjectPaymentPlan> paymentPlans = paymentPlansMap.getOrDefault(r.getId(), Collections.emptyList());
List<ProjectAnnualPaymentPlan> paymentPlans = paymentPlansMap.getOrDefault(r.getId(), Collections.emptyList());
BigDecimal totalAnnualAmount = paymentPlans.stream()
.map(ProjectPaymentPlan::getAnnualPlanAmount)
.map(ProjectAnnualPaymentPlan::getAnnualPlanAmount)
.reduce(BigDecimal::add).orElse(BigDecimal.ZERO);

exportDTO.setAnnualPlanAmount(totalAnnualAmount);


+ 10
- 10
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectLibManage.java View File

@@ -131,7 +131,7 @@ public class ProjectLibManage {
private final IPaymentPlanService paymentPlanService;
private final ITodoService todoService;
private final IProjectCoreBusinessIndicatorsService projectCoreBusinessIndicatorsService;
private final IProjectPaymentPlanService projectPaymentPlanService;
private final IProjectAnnualPaymentPlanService projectPaymentPlanService;
private final IOperationService operationService;
private final IProjectTagService projectTagService;
private final ITagService tagService;
@@ -158,7 +158,7 @@ public class ProjectLibManage {
projectCodes.add(project.getProjectCode());
}
Map<Long, List<ProjectRenewalFundDeclaration>> renewalMap = listRenewDeclarations(projectCodes);
Map<Long, List<ProjectPaymentPlan>> paymentPlansMap = projectPaymentPlanService.listByProjectIds(projectIds);
Map<Long, List<ProjectAnnualPaymentPlan>> paymentPlansMap = projectPaymentPlanService.listByProjectIds(projectIds);

List<ProjectLibListItemVO> records = CollUtils.convert(page.getRecords(), w -> {
ProjectLibListItemVO item = new ProjectLibListItemVO();
@@ -178,9 +178,9 @@ public class ProjectLibManage {
item.setProcessStatus(w.getProcessStatus());
item.setInstCode(w.getInstCode());
item.setIsHigherSuperOrg(w.getIsHigherSuperOrg());
List<ProjectPaymentPlan> paymentPlans = paymentPlansMap.getOrDefault(w.getId(), Collections.emptyList());
List<ProjectAnnualPaymentPlan> paymentPlans = paymentPlansMap.getOrDefault(w.getId(), Collections.emptyList());
BigDecimal totalAnnualPaymentAmount = paymentPlans.stream()
.map(ProjectPaymentPlan::getAnnualPlanAmount)
.map(ProjectAnnualPaymentPlan::getAnnualPlanAmount)
.reduce(BigDecimal::add).orElse(BigDecimal.ZERO);

List<ProjectRenewalFundDeclaration> fundDeclarations = renewalMap.get(w.getId());
@@ -214,7 +214,7 @@ public class ProjectLibManage {
projectCodes.add(project.getProjectCode());
}
Map<String, List<TagVO>> projectTagMap = getProjectTags(projectCodes);
Map<Long, List<ProjectPaymentPlan>> paymentPlansMap = projectPaymentPlanService.listByProjectIds(projectIds);
Map<Long, List<ProjectAnnualPaymentPlan>> paymentPlansMap = projectPaymentPlanService.listByProjectIds(projectIds);

Map<Long, List<ProjectRenewalFundDeclaration>> renewalMap = listRenewDeclarations(projectCodes);
List<ProjectLibListItemVO> records = CollUtils.convert(page.getRecords(), w -> {
@@ -241,9 +241,9 @@ public class ProjectLibManage {
item.setCanPreDeclared(Boolean.TRUE);
}
item.setApprovedAmount(w.getApprovalAmount());
List<ProjectPaymentPlan> paymentPlans = paymentPlansMap.getOrDefault(w.getId(), Collections.emptyList());
List<ProjectAnnualPaymentPlan> paymentPlans = paymentPlansMap.getOrDefault(w.getId(), Collections.emptyList());
BigDecimal totalAnnualPaymentAmount = paymentPlans.stream()
.map(ProjectPaymentPlan::getAnnualPlanAmount)
.map(ProjectAnnualPaymentPlan::getAnnualPlanAmount)
.reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
item.setAnnualPlanAmount(totalAnnualPaymentAmount);
item.setPrePlanProjectId(w.getPrePlanProjectId());
@@ -695,7 +695,7 @@ public class ProjectLibManage {
List<ContractVO> contracts = constructionManage.detailContractByProjectId(projectInfo.getId());
vo.setContract(contracts);

List<ProjectPaymentPlan> paymentPlans = projectPaymentPlanService.listByProjectId(projectInfo.getId());
List<ProjectAnnualPaymentPlan> paymentPlans = projectPaymentPlanService.listByProjectId(projectInfo.getId());
vo.setAnnualPaymentPlans(BeanUtil.copyToList(paymentPlans, ProjectPaymentPlanDTO.class));

//查询实施信息
@@ -882,8 +882,8 @@ public class ProjectLibManage {
private void savePaymentPlans(Project project, List<ProjectPaymentPlanDTO> paymentPlans) {
Integer version = Objects.nonNull(project.getVersion()) ? project.getVersion() : 1;
projectPaymentPlanService.remove(project.getProjectCode(), version);
List<ProjectPaymentPlan> plans = paymentPlans.stream().map(w -> {
ProjectPaymentPlan plan = BeanUtil.copyProperties(w, ProjectPaymentPlan.class);
List<ProjectAnnualPaymentPlan> plans = paymentPlans.stream().map(w -> {
ProjectAnnualPaymentPlan plan = BeanUtil.copyProperties(w, ProjectAnnualPaymentPlan.class);
plan.setProjectCode(project.getProjectCode());
plan.setProjectVersion(version);
return plan;


+ 8
- 11
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectRenewalFundManage.java View File

@@ -8,9 +8,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.hz.pm.api.projectlib.model.entity.ProjectPaymentPlan;
import com.hz.pm.api.projectlib.service.IProjectPaymentPlanService;
import com.hz.pm.api.projectlib.model.entity.ProjectAnnualPaymentPlan;
import com.hz.pm.api.projectlib.service.IProjectAnnualPaymentPlanService;
import com.hz.pm.api.user.security.model.UserInfoDetails;
import com.hz.pm.api.user.util.LoginUserUtil;
import com.ningdatech.basic.exception.BizException;
@@ -20,8 +19,6 @@ import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.basic.util.NdDateUtils;
import com.hz.pm.api.common.model.constant.BizConst;
import com.hz.pm.api.common.model.constant.CommonConst;
import com.hz.pm.api.common.model.constant.RegionConst;
import com.hz.pm.api.common.helper.RegionCacheHelper;
import com.hz.pm.api.common.util.ExcelDownUtil;
import com.hz.pm.api.common.util.ExcelExportStyle;
import com.hz.pm.api.datascope.model.DataScopeDTO;
@@ -94,7 +91,7 @@ public class ProjectRenewalFundManage {
private final IGovBizProjectApproveService approveService;

private final IPaymentPlanService paymentPlanService;
private final IProjectPaymentPlanService projectPaymentPlanService;
private final IProjectAnnualPaymentPlanService projectPaymentPlanService;

/**
* 项目续建资金库列表 分页
@@ -139,7 +136,7 @@ public class ProjectRenewalFundManage {
projectCodes.add(project.getProjectCode());
}

Map<Long, List<ProjectPaymentPlan>> paymentPlansMap = projectPaymentPlanService.listByProjectIds(projectIds);
Map<Long, List<ProjectAnnualPaymentPlan>> paymentPlansMap = projectPaymentPlanService.listByProjectIds(projectIds);

Map<Long, List<ProjectRenewalFundDeclaration>> renewalMap;
if (CollUtil.isNotEmpty(projectCodes)) {
@@ -180,9 +177,9 @@ public class ProjectRenewalFundManage {
item.setCanPreDeclared(Boolean.TRUE);
}
item.setApprovedAmount(w.getApprovalAmount());
List<ProjectPaymentPlan> paymentPlans = paymentPlansMap.getOrDefault(w.getId(), Collections.emptyList());
List<ProjectAnnualPaymentPlan> paymentPlans = paymentPlansMap.getOrDefault(w.getId(), Collections.emptyList());
BigDecimal totalAnnualPaymentAmount = paymentPlans.stream()
.map(ProjectPaymentPlan::getAnnualPlanAmount)
.map(ProjectAnnualPaymentPlan::getAnnualPlanAmount)
.reduce(BigDecimal::add).orElse(BigDecimal.ZERO);

item.setAnnualPlanAmount(totalAnnualPaymentAmount);
@@ -237,10 +234,10 @@ public class ProjectRenewalFundManage {
vo.setAnnualPaymentAmount(renewal.getAnnualPaymentAmount());
List<AnnualAmountVO> annualAmounts = Lists.newArrayList();

List<ProjectPaymentPlan> paymentPlans = projectPaymentPlanService.listByProjectId(project.getId());
List<ProjectAnnualPaymentPlan> paymentPlans = projectPaymentPlanService.listByProjectId(project.getId());

BigDecimal totalAnnualPaymentAmount = paymentPlans.stream()
.map(ProjectPaymentPlan::getAnnualPlanAmount)
.map(ProjectAnnualPaymentPlan::getAnnualPlanAmount)
.reduce(BigDecimal::add).orElse(BigDecimal.ZERO);

annualAmounts.add(AnnualAmountVO.builder()


hz-pm-api/src/main/java/com/hz/pm/api/projectlib/mapper/ProjectPaymentPlanMapper.java → hz-pm-api/src/main/java/com/hz/pm/api/projectlib/mapper/ProjectAnnualPaymentPlanMapper.java View File

@@ -1,6 +1,6 @@
package com.hz.pm.api.projectlib.mapper;

import com.hz.pm.api.projectlib.model.entity.ProjectPaymentPlan;
import com.hz.pm.api.projectlib.model.entity.ProjectAnnualPaymentPlan;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
@@ -11,6 +11,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @author WendyYang
* @since 2024-02-21
*/
public interface ProjectPaymentPlanMapper extends BaseMapper<ProjectPaymentPlan> {
public interface ProjectAnnualPaymentPlanMapper extends BaseMapper<ProjectAnnualPaymentPlan> {

}

hz-pm-api/src/main/java/com/hz/pm/api/projectlib/mapper/ProjectPaymentPlanMapper.xml → hz-pm-api/src/main/java/com/hz/pm/api/projectlib/mapper/ProjectAnnualPaymentPlanMapper.xml View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hz.pm.api.projectlib.mapper.ProjectPaymentPlanMapper">
<mapper namespace="com.hz.pm.api.projectlib.mapper.ProjectAnnualPaymentPlanMapper">

</mapper>

hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/entity/ProjectPaymentPlan.java → hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/entity/ProjectAnnualPaymentPlan.java View File

@@ -19,9 +19,9 @@ import java.math.BigDecimal;
* @since 2024-02-21
*/
@Data
@TableName("ND_PROJECT_PAYMENT_PLAN")
@TableName("ND_PROJECT_ANNUAL_PAYMENT_PLAN")
@ApiModel(value = "NdProjectPaymentPlan对象")
public class ProjectPaymentPlan implements Serializable {
public class ProjectAnnualPaymentPlan implements Serializable {

private static final long serialVersionUID = 1L;


+ 43
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/service/IProjectAnnualPaymentPlanService.java View File

@@ -0,0 +1,43 @@
package com.hz.pm.api.projectlib.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hz.pm.api.projectlib.model.entity.ProjectAnnualPaymentPlan;
import com.ningdatech.basic.util.CollUtils;

import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
* <p>
* 年度支付计划-服务类
* </p>
*
* @author WendyYang
* @since 2024-02-21
*/
public interface IProjectAnnualPaymentPlanService extends IService<ProjectAnnualPaymentPlan> {

default void remove(String projectCode, Integer projectVersion) {
remove(Wrappers.lambdaQuery(ProjectAnnualPaymentPlan.class)
.eq(ProjectAnnualPaymentPlan::getProjectCode, projectCode)
.eq(ProjectAnnualPaymentPlan::getProjectVersion, projectVersion));
}

default Map<Long, List<ProjectAnnualPaymentPlan>> listByProjectIds(Collection<Long> projectIds) {
LambdaQueryWrapper<ProjectAnnualPaymentPlan> query = Wrappers.lambdaQuery(ProjectAnnualPaymentPlan.class)
.in(ProjectAnnualPaymentPlan::getProjectId, projectIds)
.orderByAsc(ProjectAnnualPaymentPlan::getPaymentYear);
return CollUtils.group(list(query), ProjectAnnualPaymentPlan::getProjectId);
}

default List<ProjectAnnualPaymentPlan> listByProjectId(Long projectId) {
LambdaQueryWrapper<ProjectAnnualPaymentPlan> query = Wrappers.lambdaQuery(ProjectAnnualPaymentPlan.class)
.eq(ProjectAnnualPaymentPlan::getProjectId, projectId)
.orderByAsc(ProjectAnnualPaymentPlan::getPaymentYear);
return list(query);
}

}

+ 0
- 1
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/service/IProjectApplicationService.java View File

@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hz.pm.api.projectlib.model.entity.Project;
import com.hz.pm.api.projectlib.model.entity.ProjectApplication;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hz.pm.api.projectlib.model.entity.ProjectPaymentPlan;

import java.util.List;



+ 0
- 44
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/service/IProjectPaymentPlanService.java View File

@@ -1,44 +0,0 @@
package com.hz.pm.api.projectlib.service;

import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hz.pm.api.projectlib.model.entity.ProjectPaymentPlan;
import com.ningdatech.basic.util.CollUtils;

import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
* <p>
* 服务类
* </p>
*
* @author WendyYang
* @since 2024-02-21
*/
public interface IProjectPaymentPlanService extends IService<ProjectPaymentPlan> {

default void remove(String projectCode, Integer projectVersion) {
remove(Wrappers.lambdaQuery(ProjectPaymentPlan.class)
.eq(ProjectPaymentPlan::getProjectCode, projectCode)
.eq(ProjectPaymentPlan::getProjectVersion, projectVersion));
}

default Map<Long, List<ProjectPaymentPlan>> listByProjectIds(Collection<Long> projectIds) {
LambdaQueryWrapper<ProjectPaymentPlan> query = Wrappers.lambdaQuery(ProjectPaymentPlan.class)
.in(ProjectPaymentPlan::getProjectId, projectIds)
.orderByAsc(ProjectPaymentPlan::getPaymentYear);
return CollUtils.group(list(query), ProjectPaymentPlan::getProjectId);
}

default List<ProjectPaymentPlan> listByProjectId(Long projectId) {
LambdaQueryWrapper<ProjectPaymentPlan> query = Wrappers.lambdaQuery(ProjectPaymentPlan.class)
.eq(ProjectPaymentPlan::getProjectId, projectId)
.orderByAsc(ProjectPaymentPlan::getPaymentYear);
return list(query);
}

}

+ 20
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/service/impl/ProjectAnnualPaymentPlanServiceImpl.java View File

@@ -0,0 +1,20 @@
package com.hz.pm.api.projectlib.service.impl;

import com.hz.pm.api.projectlib.model.entity.ProjectAnnualPaymentPlan;
import com.hz.pm.api.projectlib.mapper.ProjectAnnualPaymentPlanMapper;
import com.hz.pm.api.projectlib.service.IProjectAnnualPaymentPlanService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
* <p>
* 服务实现类
* </p>
*
* @author WendyYang
* @since 2024-02-21
*/
@Service
public class ProjectAnnualPaymentPlanServiceImpl extends ServiceImpl<ProjectAnnualPaymentPlanMapper, ProjectAnnualPaymentPlan> implements IProjectAnnualPaymentPlanService {

}

+ 0
- 20
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/service/impl/ProjectPaymentPlanServiceImpl.java View File

@@ -1,20 +0,0 @@
package com.hz.pm.api.projectlib.service.impl;

import com.hz.pm.api.projectlib.model.entity.ProjectPaymentPlan;
import com.hz.pm.api.projectlib.mapper.ProjectPaymentPlanMapper;
import com.hz.pm.api.projectlib.service.IProjectPaymentPlanService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
* <p>
* 服务实现类
* </p>
*
* @author WendyYang
* @since 2024-02-21
*/
@Service
public class ProjectPaymentPlanServiceImpl extends ServiceImpl<ProjectPaymentPlanMapper, ProjectPaymentPlan> implements IProjectPaymentPlanService {

}

Loading…
Cancel
Save