@@ -5,9 +5,12 @@ import com.ningdatech.log.annotation.WebLog; | |||
import com.ningdatech.pmapi.common.util.ExcelDownUtil; | |||
import com.ningdatech.pmapi.projectdeclared.manage.ConstructionManage; | |||
import com.ningdatech.pmapi.projectdeclared.model.dto.ContractSaveDTO; | |||
import com.ningdatech.pmapi.projectdeclared.model.dto.PaymentPlanSaveDTO; | |||
import com.ningdatech.pmapi.projectdeclared.model.dto.PaymentPlanSupplementDTO; | |||
import com.ningdatech.pmapi.projectdeclared.model.dto.PreInsSaveDTO; | |||
import com.ningdatech.pmapi.projectdeclared.model.vo.ContractVO; | |||
import com.ningdatech.pmapi.projectdeclared.model.vo.PreInsVO; | |||
import com.ningdatech.pmapi.projectdeclared.model.vo.ProjectContractListVO; | |||
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; | |||
import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; | |||
import io.swagger.annotations.Api; | |||
@@ -17,6 +20,7 @@ import lombok.extern.slf4j.Slf4j; | |||
import org.springframework.validation.annotation.Validated; | |||
import org.springframework.web.bind.annotation.*; | |||
import javax.servlet.http.HttpServletResponse; | |||
import java.util.List; | |||
/** | |||
* @Classname ConstructionController | |||
@@ -39,6 +43,12 @@ public class ConstructionController { | |||
return constructionManage.projectLibList(req); | |||
} | |||
@ApiOperation(value = "已经完善合同信息的项目列表", notes = "已经完善合同信息的项目列表") | |||
@GetMapping("/contract/project-list-perfect") | |||
public PageVo<ProjectContractListVO> projectlistPerfect(@ModelAttribute ProjectListReq req) { | |||
return constructionManage.projectlistPerfect(req); | |||
} | |||
@GetMapping("/contract/export") | |||
@ApiOperation("待合同备案的项目列表导出") | |||
@WebLog("待合同备案的项目列表导出") | |||
@@ -59,6 +69,13 @@ public class ConstructionController { | |||
return constructionManage.submitContract(dto); | |||
} | |||
@ApiOperation(value = "补充实际支付金额", notes = "补充实际支付金额") | |||
@WebLog("补充实际支付金额") | |||
@PostMapping("/supplement") | |||
public String supplement(@Validated @RequestBody List<PaymentPlanSupplementDTO> plans) { | |||
return constructionManage.supplement(plans); | |||
} | |||
@ApiOperation(value = "待初验备案的项目列表", notes = "待初验备案的项目列表") | |||
@GetMapping("/pre-ins/project-list") | |||
public PageVo<ProjectLibListItemVO> preProjectList(@ModelAttribute ProjectListReq req) { | |||
@@ -3,6 +3,7 @@ package com.ningdatech.pmapi.projectdeclared.controller; | |||
import javax.servlet.http.HttpServletResponse; | |||
import com.ningdatech.log.annotation.WebLog; | |||
import com.ningdatech.pmapi.gov.manage.GovProjectCollectionManage; | |||
import org.springframework.validation.annotation.Validated; | |||
import org.springframework.web.bind.annotation.*; | |||
import com.alibaba.fastjson.JSONObject; | |||
@@ -39,6 +40,8 @@ public class DeclaredProjectController { | |||
private final ProjectAdjustmentManage projectAdjustmentManage; | |||
private final GovProjectCollectionManage collectionManage; | |||
@ApiOperation(value = "申报项目已申报列表", notes = "申报项目已申报列表") | |||
@GetMapping("/list") | |||
public PageVo<ProjectLibListItemVO> list(@ModelAttribute ProjectListReq req) { | |||
@@ -94,4 +97,11 @@ public class DeclaredProjectController { | |||
public void exportList(ProjectListReq req, HttpServletResponse response){ | |||
ExcelDownUtil.downXls(response,req,declaredProjectManage::exportList); | |||
} | |||
@PostMapping("/remove/{projectCode}") | |||
@ApiOperation("申报项目删除-预审失败") | |||
@WebLog("申报项目删除-预审失败") | |||
public String remove(@PathVariable String projectCode){ | |||
return declaredProjectManage.removeProject(projectCode); | |||
} | |||
} |
@@ -7,6 +7,7 @@ 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.ningdatech.basic.exception.BizException; | |||
import com.ningdatech.basic.function.VUtils; | |||
import com.ningdatech.basic.model.PageVo; | |||
import com.ningdatech.basic.util.CollUtils; | |||
@@ -16,17 +17,12 @@ import com.ningdatech.pmapi.common.helper.UserInfoHelper; | |||
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; | |||
import com.ningdatech.pmapi.common.util.ExcelDownUtil; | |||
import com.ningdatech.pmapi.common.util.ExcelExportStyle; | |||
import com.ningdatech.pmapi.projectdeclared.model.dto.ContractSaveDTO; | |||
import com.ningdatech.pmapi.projectdeclared.model.dto.DeclaredProjectExportDTO; | |||
import com.ningdatech.pmapi.projectdeclared.model.dto.PreInsSaveDTO; | |||
import com.ningdatech.pmapi.projectdeclared.model.dto.*; | |||
import com.ningdatech.pmapi.projectdeclared.model.entity.Contract; | |||
import com.ningdatech.pmapi.projectdeclared.model.entity.PaymentPlan; | |||
import com.ningdatech.pmapi.projectdeclared.model.entity.PreInsAcceptancePerson; | |||
import com.ningdatech.pmapi.projectdeclared.model.entity.Purchase; | |||
import com.ningdatech.pmapi.projectdeclared.model.vo.ContractVO; | |||
import com.ningdatech.pmapi.projectdeclared.model.vo.PaymentPlanVO; | |||
import com.ningdatech.pmapi.projectdeclared.model.vo.PreInsAcceptancePersonVO; | |||
import com.ningdatech.pmapi.projectdeclared.model.vo.PreInsVO; | |||
import com.ningdatech.pmapi.projectdeclared.model.vo.*; | |||
import com.ningdatech.pmapi.projectdeclared.service.IContractService; | |||
import com.ningdatech.pmapi.projectdeclared.service.IPaymentPlanService; | |||
import com.ningdatech.pmapi.projectdeclared.service.IPreInsAcceptancePersonService; | |||
@@ -129,6 +125,66 @@ public class ConstructionManage { | |||
return PageVo.of(records, total); | |||
} | |||
/** | |||
* 已完善合同信息的列表 | |||
* @param req | |||
* @return | |||
*/ | |||
public PageVo<ProjectContractListVO> projectlistPerfect(ProjectListReq req) { | |||
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); | |||
VUtils.isTrue(Objects.isNull(user)).throwMessage("获取登录用户失败!"); | |||
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(req); | |||
//建设中状态以后的 都是 | |||
query.gt(Project::getStatus, ProjectStatusEnum.UNDER_CONSTRUCTION.getCode()); | |||
query.eq(Project::getNewest, Boolean.TRUE); | |||
//只能看自己单位的 | |||
query.eq(Project::getBuildOrgCode,user.getEmpPosUnitCode()); | |||
query.orderByAsc(Project::getTransactionTime); | |||
Page<Project> page = projectService.page(req.page(), query); | |||
if (CollUtil.isEmpty(page.getRecords())) { | |||
return PageVo.empty(); | |||
} | |||
List<Project> projects = page.getRecords(); | |||
List<String> projectCodes = projects.stream().map(Project::getProjectCode) | |||
.collect(Collectors.toList()); | |||
List<PaymentPlan> paymentPlans = paymentPlanService.list(Wrappers.lambdaQuery(PaymentPlan.class) | |||
.in(PaymentPlan::getProjectCode, projectCodes)); | |||
Map<String, List<PaymentPlan>> paymentMap = paymentPlans.stream() | |||
.collect(Collectors.groupingBy(PaymentPlan::getProjectCode)); | |||
List<ProjectContractListVO> records = CollUtils.convert(page.getRecords(), w -> { | |||
ProjectContractListVO item = BeanUtil.copyProperties(w,ProjectContractListVO.class); | |||
item.setBuildOrg(w.getBuildOrgName()); | |||
item.setSupplemented(checkIsSupplement(w,paymentMap)); | |||
return item; | |||
}); | |||
return PageVo.of(records, page.getTotal()); | |||
} | |||
/** | |||
* 判断 是否需要补充 | |||
* @param w | |||
* @param paymentMap | |||
* @return | |||
*/ | |||
private Boolean checkIsSupplement(Project w, Map<String, List<PaymentPlan>> paymentMap) { | |||
if(paymentMap.containsKey(w.getProjectCode())){ | |||
List<PaymentPlan> paymentPlans = paymentMap.get(w.getProjectCode()); | |||
if(CollUtil.isEmpty(paymentPlans)){ | |||
return Boolean.FALSE; | |||
} | |||
for (PaymentPlan plan : paymentPlans){ | |||
if(Objects.isNull(plan.getActualPaymentAmount())){ | |||
return Boolean.FALSE; | |||
} | |||
} | |||
return Boolean.TRUE; | |||
} | |||
return Boolean.FALSE; | |||
} | |||
public void exportList(HttpServletResponse response, ProjectListReq param) { | |||
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); | |||
VUtils.isTrue(Objects.isNull(user)).throwMessage("获取登录用户失败!"); | |||
@@ -266,6 +322,7 @@ public class ConstructionManage { | |||
List<PaymentPlan> payments = dto.getPayments().stream().map(d -> { | |||
PaymentPlan plan = BeanUtil.copyProperties(d, PaymentPlan.class); | |||
plan.setProjectId(projectId); | |||
plan.setProjectCode(project.getProjectCode()); | |||
plan.setCreateOn(LocalDateTime.now()); | |||
plan.setUpdateOn(LocalDateTime.now()); | |||
plan.setCreateBy(employeeCode); | |||
@@ -482,4 +539,27 @@ public class ConstructionManage { | |||
return "填写成功"; | |||
} | |||
/** | |||
* 补充项目 合同 实际支付信息 | |||
* @param plans | |||
* @return | |||
*/ | |||
public String supplement(List<PaymentPlanSupplementDTO> plans) { | |||
if(CollUtil.isEmpty(plans)){ | |||
throw new BizException("入参"); | |||
} | |||
for(PaymentPlanSupplementDTO plan : plans){ | |||
PaymentPlan paymentPlan = paymentPlanService.getById(plan.getId()); | |||
VUtils.isTrue(Objects.isNull(paymentPlan)) | |||
.throwMessage("保存失败 该支付信息不存在 :" + plan.getId()); | |||
VUtils.isTrue(Objects.nonNull(paymentPlan.getActualPaymentAmount())) | |||
.throwMessage("保存失败 该支付信息已经保存过 实际支付金额 :" + plan.getId() + "," + paymentPlan.getActualPaymentAmount()); | |||
paymentPlan.setActualPaymentAmount(plan.getActualPaymentAmount()); | |||
paymentPlanService.updateById(paymentPlan); | |||
} | |||
return "保存成功"; | |||
} | |||
} |
@@ -9,6 +9,7 @@ import com.alibaba.fastjson.TypeReference; | |||
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.ningdatech.basic.function.VUtils; | |||
import com.ningdatech.basic.model.PageVo; | |||
import com.ningdatech.basic.util.CollUtils; | |||
@@ -22,6 +23,7 @@ import com.ningdatech.pmapi.common.helper.RegionCacheHelper; | |||
import com.ningdatech.pmapi.common.helper.UserInfoHelper; | |||
import com.ningdatech.pmapi.common.util.ExcelDownUtil; | |||
import com.ningdatech.pmapi.common.util.ExcelExportStyle; | |||
import com.ningdatech.pmapi.gov.manage.GovProjectCollectionManage; | |||
import com.ningdatech.pmapi.irs.manage.ProjectIrsManage; | |||
import com.ningdatech.pmapi.irs.model.entity.ProjectCoreBiz; | |||
import com.ningdatech.pmapi.irs.service.IProjectCoreBizService; | |||
@@ -100,7 +102,7 @@ public class DeclaredProjectManage { | |||
private final ProjectIrsManage projectIrsManage; | |||
private final IProjectCoreBizService coreBizService; | |||
private final GovProjectCollectionManage collectionManage; | |||
@Value("${spring.profiles.active}") | |||
private String active; | |||
@@ -496,4 +498,20 @@ public class DeclaredProjectManage { | |||
} | |||
return jsonObject; | |||
} | |||
/** | |||
* 预审失败的时候 可以删除项目 | |||
* @param projectCode | |||
*/ | |||
@Transactional | |||
public String removeProject(String projectCode) { | |||
Project project = projectService.getProjectByCode(projectCode); | |||
VUtils.isTrue(Objects.isNull(project)) | |||
.throwMessage("该项目不存在"); | |||
VUtils.isTrue(Objects.isNull(project.getStatus()) || | |||
!ProjectStatusEnum.PREQUALIFICATION_FAILED.getCode().equals(project.getStatus())) | |||
.throwMessage("不是预审不通过 状态 不能删除!"); | |||
return collectionManage.removeProject(Lists.newArrayList(projectCode)); | |||
} | |||
} |
@@ -23,12 +23,18 @@ public class PaymentPlanSaveDTO { | |||
@ApiModelProperty("项目ID") | |||
private Long projectId; | |||
@ApiModelProperty("项目编号") | |||
private String projectCode; | |||
@ApiModelProperty("付款计划") | |||
private String planAmount; | |||
@ApiModelProperty("支付金额") | |||
private BigDecimal paymentAmount; | |||
@ApiModelProperty("实际支付金额") | |||
private BigDecimal actualPaymentAmount; | |||
@ApiModelProperty("支付时间") | |||
@JsonFormat(pattern = "yyyy-MM-dd") | |||
private LocalDateTime paymentTime; | |||
@@ -0,0 +1,34 @@ | |||
package com.ningdatech.pmapi.projectdeclared.model.dto; | |||
import com.fasterxml.jackson.annotation.JsonFormat; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
import javax.validation.constraints.NotNull; | |||
import java.math.BigDecimal; | |||
import java.time.LocalDateTime; | |||
/** | |||
* @Classname PaymentPlan | |||
* @Description | |||
* @Date 2023/5/30 16:11 | |||
* @Author PoffyZhang | |||
*/ | |||
@Data | |||
@ApiModel(value = "PaymentPlanSupplementDTO", description = "") | |||
public class PaymentPlanSupplementDTO { | |||
private static final long serialVersionUID = 1L; | |||
@ApiModelProperty("id") | |||
@NotNull(message = "id必传") | |||
private Long id; | |||
@ApiModelProperty("项目编号") | |||
private String projectCode; | |||
@ApiModelProperty("实际支付金额") | |||
private BigDecimal actualPaymentAmount; | |||
} |
@@ -44,9 +44,15 @@ public class PaymentPlan { | |||
@ApiModelProperty("付款计划") | |||
private String planAmount; | |||
@ApiModelProperty("支付金额") | |||
@ApiModelProperty("项目编号") | |||
private String projectCode; | |||
@ApiModelProperty("计划支付金额") | |||
private BigDecimal paymentAmount; | |||
@ApiModelProperty("实际支付金额") | |||
private BigDecimal actualPaymentAmount; | |||
@ApiModelProperty("支付时间") | |||
private LocalDateTime paymentTime; | |||
@@ -355,4 +355,7 @@ public class ProjectDraft implements Serializable { | |||
@ApiModelProperty("评审清单") | |||
private String reviewChecklist; | |||
@ApiModelProperty("是否推送省里") | |||
private Boolean push; | |||
} |
@@ -2,7 +2,6 @@ package com.ningdatech.pmapi.projectdeclared.model.vo; | |||
import com.alibaba.fastjson.annotation.JSONField; | |||
import com.baomidou.mybatisplus.annotation.*; | |||
import com.fasterxml.jackson.annotation.JsonFormat; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Data; | |||
@@ -45,9 +44,15 @@ public class PaymentPlanVO { | |||
@ApiModelProperty("付款计划") | |||
private String planAmount; | |||
@ApiModelProperty("支付金额") | |||
@ApiModelProperty("项目编号") | |||
private String projectCode; | |||
@ApiModelProperty("计划支付金额") | |||
private BigDecimal paymentAmount; | |||
@ApiModelProperty("实际支付金额") | |||
private BigDecimal actualPaymentAmount; | |||
@ApiModelProperty("支付比例") | |||
private String ratio; | |||
@@ -0,0 +1,95 @@ | |||
package com.ningdatech.pmapi.projectdeclared.model.vo; | |||
import com.fasterxml.jackson.annotation.JsonFormat; | |||
import com.ningdatech.pmapi.common.compare.Compare; | |||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeNewEnum; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Builder; | |||
import lombok.Data; | |||
import lombok.experimental.Tolerate; | |||
import java.math.BigDecimal; | |||
import java.time.LocalDateTime; | |||
import java.util.Objects; | |||
import java.util.Optional; | |||
/** | |||
* <p> | |||
* ProjectContractListVO | |||
* </p> | |||
* | |||
* @author ZPF | |||
* @since 15:13 2023/11/15 | |||
*/ | |||
@Data | |||
@Builder | |||
@ApiModel("合同项目库列表视图") | |||
public class ProjectContractListVO { | |||
@Tolerate | |||
public ProjectContractListVO() { | |||
} | |||
@ApiModelProperty("项目ID") | |||
private Long id; | |||
@ApiModelProperty("项目编号") | |||
private String projectCode; | |||
@ApiModelProperty("区域") | |||
private String area; | |||
@ApiModelProperty("区域Code") | |||
private String areaCode; | |||
@ApiModelProperty("项目名称") | |||
private String projectName; | |||
@ApiModelProperty("项目类型 01:首次建设 02:迭代升级 03:结转建设 04新运维 05续运维") | |||
@Compare("项目类型") | |||
private String projectType; | |||
@ApiModelProperty("项目阶段") | |||
private Integer stage; | |||
@ApiModelProperty("项目状态") | |||
private Integer status; | |||
@ApiModelProperty("申报年度") | |||
private Integer projectYear; | |||
@ApiModelProperty("申报单位") | |||
private String buildOrg; | |||
@ApiModelProperty("建设单位名称") | |||
private String buildOrgName; | |||
private String projectTypeName; | |||
@ApiModelProperty("合同总金额") | |||
private BigDecimal contractAmount; | |||
@ApiModelProperty("年度支付计划-年度支付计划(元)") | |||
private BigDecimal annualPlanAmount; | |||
public String getProjectTypeName() { | |||
if (Objects.nonNull(this.projectType)) { | |||
Optional.ofNullable(ProjectTypeNewEnum.getDesc(this.projectType)) | |||
.ifPresent(desc -> this.projectTypeName = desc); | |||
} | |||
return this.projectTypeName; | |||
} | |||
@ApiModelProperty("创建时间") | |||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm") | |||
private LocalDateTime createOn; | |||
@ApiModelProperty("修改时间") | |||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm") | |||
private LocalDateTime updateOn; | |||
@ApiModelProperty("能否能补充") | |||
private Boolean supplemented = Boolean.FALSE; | |||
} |
@@ -358,4 +358,7 @@ public class ProjectDraftVO implements Serializable { | |||
private Long createBy; | |||
private Long updateBy; | |||
@ApiModelProperty("是否推送省里") | |||
private Boolean push; | |||
} |
@@ -367,4 +367,7 @@ public class ProjectDTO implements Serializable { | |||
@ApiModelProperty("评审清单") | |||
private String reviewChecklist; | |||
@ApiModelProperty("是否推送省里") | |||
private Boolean push; | |||
} |
@@ -564,4 +564,7 @@ public class Project implements Serializable { | |||
@ApiModelProperty("是否完成清单合并") | |||
private Boolean reviewCheckFinish; | |||
@ApiModelProperty("是否推送省里") | |||
private Boolean push; | |||
} |
@@ -546,4 +546,7 @@ public class ProjectDetailVO { | |||
@ApiModelProperty("是否开启评审清单") | |||
private Boolean reviewCheckFinish; | |||
@ApiModelProperty("是否推送省里") | |||
private Boolean push; | |||
} |