Browse Source

modify:

1. 资金下达增加结转资金;
tags/24102401
WendyYang 2 months ago
parent
commit
5f7177576e
4 changed files with 18 additions and 2 deletions
  1. +3
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/entity/ProjectApprovalAmount.java
  2. +9
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/AmountApprovalManage.java
  3. +3
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/dto/ProjectApprovalAmountDTO.java
  4. +3
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/req/SubmitAmountApprovalReq.java

+ 3
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/entity/ProjectApprovalAmount.java View File

@@ -30,6 +30,9 @@ public class ProjectApprovalAmount implements Serializable {
@ApiModelProperty("下达资金")
private BigDecimal approvalAmount;

@ApiModelProperty("上一年度结转资金")
private BigDecimal carryOverAmount;

@ApiModelProperty("年度")
private Integer approvalYear;



+ 9
- 2
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/AmountApprovalManage.java View File

@@ -166,6 +166,7 @@ public class AmountApprovalManage {
return stat;
}

@Transactional(rollbackFor = Exception.class)
public synchronized void submitAmountApproval(SubmitAmountApprovalReq req) {
Project project = projectService.getNewestNoNull(req.getProjectId());
if (ProjectStatus.STOPPED.eq(project.getStage())
@@ -181,6 +182,11 @@ public class AmountApprovalManage {
if (approved && NumberUtil.isGreater(currTotalApprovalAmount, project.getReviewAmount())) {
throw ReturnException.wrap("暂不允许下达资金");
}
ProjectApprovalAmount lastApprovalAmount = projectApprovalAmountService.getByProjectCode(project.getProjectCode());
if (lastApprovalAmount != null && req.getCarryOverAmount() != null
&& NumberUtil.isGreater(req.getCarryOverAmount(), lastApprovalAmount.getApprovalAmount())) {
throw ReturnException.wrap("结转资金不允许超过上一年度下达资金");
}
Wrapper<Project> wrapper = Wrappers.lambdaUpdate(Project.class)
.set(StrUtil.isNotBlank(req.getApprovalAmountFile()), Project::getApprovalAmountFile, req.getApprovalAmountFile())
.set(Project::getApprovalAmount, currTotalApprovalAmount)
@@ -195,6 +201,7 @@ public class AmountApprovalManage {
projectApprovalAmount.setApprovalAmount(req.getApprovalAmount());
projectApprovalAmount.setProjectId(project.getId());
projectApprovalAmount.setProjectCode(project.getProjectCode());
projectApprovalAmount.setCarryOverAmount(req.getApprovalAmount());
projectApprovalAmountService.save(projectApprovalAmount);
projectService.update(wrapper);
}
@@ -211,7 +218,7 @@ public class AmountApprovalManage {
}

@Transactional(rollbackFor = Exception.class)
public synchronized void initOldApprovalAmount(){
public synchronized void initOldApprovalAmount() {
LambdaQueryWrapper<Project> query = Wrappers.lambdaQuery(Project.class)
.gt(Project::getApprovalAmount, 0)
.isNotNull(Project::getApprovalAmount)
@@ -228,7 +235,7 @@ public class AmountApprovalManage {
projectApprovalAmountService.saveBatch(approvalAmounts);
}

public List<ProjectApprovalAmountDTO> listApprovalAmounts(String projectCode){
public List<ProjectApprovalAmountDTO> listApprovalAmounts(String projectCode) {
List<ProjectApprovalAmount> approvalAmounts = projectApprovalAmountService.listByProjectCode(projectCode);
return BeanUtil.copyToList(approvalAmounts, ProjectApprovalAmountDTO.class);
}


+ 3
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/dto/ProjectApprovalAmountDTO.java View File

@@ -21,6 +21,9 @@ public class ProjectApprovalAmountDTO {
@ApiModelProperty("下达资金")
private BigDecimal approvalAmount;

@ApiModelProperty("结转金额")
private BigDecimal carryOverAmount;

@ApiModelProperty("年度")
private Integer approvalYear;



+ 3
- 0
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/req/SubmitAmountApprovalReq.java View File

@@ -25,6 +25,9 @@ public class SubmitAmountApprovalReq {
@NotNull(message = "批复金额不能为空")
private BigDecimal approvalAmount;

@ApiModelProperty("上一年度结转金额")
private BigDecimal carryOverAmount;

@ApiModelProperty("评审总投资")
private BigDecimal reviewAmount;



Loading…
Cancel
Save