|
|
@@ -2,6 +2,7 @@ package com.hz.pm.api.projectlib.manage; |
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
|
import cn.hutool.core.lang.Assert; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
@@ -21,12 +22,14 @@ import com.hz.pm.api.projectlib.service.IProjectService; |
|
|
|
import com.hz.pm.api.user.helper.MhUnitCache; |
|
|
|
import com.hz.pm.api.user.security.model.UserFullInfoDTO; |
|
|
|
import com.hz.pm.api.user.util.LoginUserUtil; |
|
|
|
import com.ningdatech.basic.exception.BizException; |
|
|
|
import com.ningdatech.basic.model.PageVo; |
|
|
|
import com.ningdatech.basic.util.CollUtils; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Optional; |
|
|
|
|
|
|
@@ -153,11 +156,16 @@ public class AmountApprovalManage { |
|
|
|
|
|
|
|
public void submitAmountApproval(SubmitAmountApprovalReq req) { |
|
|
|
Project project = projectService.getNewestNoNull(req.getProjectId()); |
|
|
|
Assert.isTrue(ProjectStatus.STOPPED.eq(project.getStage()), "项目终止中"); |
|
|
|
LambdaUpdateWrapper<Project> wrapper = Wrappers.lambdaUpdate(Project.class) |
|
|
|
if (ProjectStatus.STOPPED.eq(project.getStage()) |
|
|
|
|| ProjectStatus.CHANGE.eq(project.getStage())) { |
|
|
|
throw BizException.wrap("暂不允许下达资金"); |
|
|
|
} |
|
|
|
Wrapper<Project> wrapper = Wrappers.lambdaUpdate(Project.class) |
|
|
|
.set(Project::getApprovalAmountFile, req.getApprovalAmountFile()) |
|
|
|
.set(Project::getApprovalAmount, req.getApprovalAmount()) |
|
|
|
.set(Project::getReviewAmount, req.getReviewAmount()) |
|
|
|
.set(Project::getUpdateOn, LocalDateTime.now()) |
|
|
|
.set(Project::getUpdateBy, LoginUserUtil.getUserId()) |
|
|
|
.eq(Project::getId, project.getId()); |
|
|
|
projectService.update(wrapper); |
|
|
|
} |
|
|
|