|
|
@@ -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); |
|
|
|
} |
|
|
|