|
@@ -7,11 +7,9 @@ import cn.afterturn.easypoi.excel.entity.TemplateExportParams; |
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
import cn.hutool.poi.excel.ExcelUtil; |
|
|
import cn.hutool.poi.excel.ExcelUtil; |
|
|
import com.alibaba.excel.EasyExcel; |
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
import com.alibaba.fastjson.JSON; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
import com.google.common.collect.Lists; |
|
|
import com.google.common.collect.Lists; |
|
@@ -21,15 +19,12 @@ import com.ningdatech.basic.util.CollUtils; |
|
|
import com.ningdatech.basic.util.StrPool; |
|
|
import com.ningdatech.basic.util.StrPool; |
|
|
import com.ningdatech.pmapi.common.constant.CommonConst; |
|
|
import com.ningdatech.pmapi.common.constant.CommonConst; |
|
|
import com.ningdatech.pmapi.common.enumeration.CommonEnum; |
|
|
import com.ningdatech.pmapi.common.enumeration.CommonEnum; |
|
|
import com.ningdatech.pmapi.common.helper.RegionCacheHelper; |
|
|
|
|
|
import com.ningdatech.pmapi.common.helper.UserInfoHelper; |
|
|
import com.ningdatech.pmapi.common.helper.UserInfoHelper; |
|
|
import com.ningdatech.pmapi.common.model.entity.ExcelExportWriter; |
|
|
import com.ningdatech.pmapi.common.model.entity.ExcelExportWriter; |
|
|
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; |
|
|
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; |
|
|
import com.ningdatech.pmapi.common.util.ExcelDownUtil; |
|
|
import com.ningdatech.pmapi.common.util.ExcelDownUtil; |
|
|
import com.ningdatech.pmapi.common.util.ExcelExportStyle; |
|
|
|
|
|
import com.ningdatech.pmapi.datascope.model.DataScopeDTO; |
|
|
import com.ningdatech.pmapi.datascope.model.DataScopeDTO; |
|
|
import com.ningdatech.pmapi.datascope.utils.DataScopeUtil; |
|
|
import com.ningdatech.pmapi.datascope.utils.DataScopeUtil; |
|
|
import com.ningdatech.pmapi.expert.constant.ExpertUserInfoSensitiveFieldEnum; |
|
|
|
|
|
import com.ningdatech.pmapi.projectlib.enumeration.ProjectLibFlagEnum; |
|
|
import com.ningdatech.pmapi.projectlib.enumeration.ProjectLibFlagEnum; |
|
|
import com.ningdatech.pmapi.projectlib.enumeration.ProjectRenewalApprovalStatusEnum; |
|
|
import com.ningdatech.pmapi.projectlib.enumeration.ProjectRenewalApprovalStatusEnum; |
|
|
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; |
|
|
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; |
|
@@ -44,11 +39,9 @@ import com.ningdatech.pmapi.projectlib.model.req.ProjectIdReq; |
|
|
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; |
|
|
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; |
|
|
import com.ningdatech.pmapi.projectlib.model.req.StartProjectDeclareReq; |
|
|
import com.ningdatech.pmapi.projectlib.model.req.StartProjectDeclareReq; |
|
|
import com.ningdatech.pmapi.projectlib.model.vo.AnnualPlanListItemVO; |
|
|
import com.ningdatech.pmapi.projectlib.model.vo.AnnualPlanListItemVO; |
|
|
import com.ningdatech.pmapi.projectlib.service.INdProjectStatusChangeService; |
|
|
|
|
|
import com.ningdatech.pmapi.projectlib.service.IProjectRenewalFundDeclarationService; |
|
|
import com.ningdatech.pmapi.projectlib.service.IProjectRenewalFundDeclarationService; |
|
|
import com.ningdatech.pmapi.projectlib.service.IProjectService; |
|
|
import com.ningdatech.pmapi.projectlib.service.IProjectService; |
|
|
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; |
|
|
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; |
|
|
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; |
|
|
|
|
|
import com.ningdatech.pmapi.user.util.LoginUserUtil; |
|
|
import com.ningdatech.pmapi.user.util.LoginUserUtil; |
|
|
import lombok.AllArgsConstructor; |
|
|
import lombok.AllArgsConstructor; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
@@ -58,20 +51,12 @@ import org.springframework.beans.BeanUtils; |
|
|
import org.springframework.stereotype.Component; |
|
|
import org.springframework.stereotype.Component; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
|
import javax.servlet.ServletOutputStream; |
|
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
import java.io.*; |
|
|
import java.io.*; |
|
|
import java.net.URLEncoder; |
|
|
import java.net.URLEncoder; |
|
|
import java.nio.charset.StandardCharsets; |
|
|
|
|
|
import java.nio.file.Files; |
|
|
|
|
|
import java.nio.file.Path; |
|
|
|
|
|
import java.nio.file.Paths; |
|
|
|
|
|
import java.time.LocalDateTime; |
|
|
import java.time.LocalDateTime; |
|
|
import java.util.*; |
|
|
import java.util.*; |
|
|
import java.util.stream.Collectors; |
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
import static com.ningdatech.pmapi.expert.constant.ExpertUserInfoSensitiveFieldEnum.UnitType.list; |
|
|
|
|
|
import static com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum.*; |
|
|
import static com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum.*; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@@ -89,10 +74,9 @@ public class AnnualPlanLibManage { |
|
|
|
|
|
|
|
|
private final IProjectService projectService; |
|
|
private final IProjectService projectService; |
|
|
private final StateMachineUtils stateMachine; |
|
|
private final StateMachineUtils stateMachine; |
|
|
private final INdProjectStatusChangeService statusChangeService; |
|
|
|
|
|
private final UserInfoHelper userInfoHelper; |
|
|
private final UserInfoHelper userInfoHelper; |
|
|
private final IProjectRenewalFundDeclarationService projectRenewalFundDeclarationService; |
|
|
private final IProjectRenewalFundDeclarationService projectRenewalFundDeclarationService; |
|
|
private final RegionCacheHelper regionCacheHelper; |
|
|
|
|
|
|
|
|
private final ProjectLibManage projectLibManage; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 年度计划查询状态 |
|
|
* 年度计划查询状态 |
|
@@ -159,25 +143,34 @@ public class AnnualPlanLibManage { |
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public void projectApproved(ProjectApprovedReq req) { |
|
|
public void projectApproved(ProjectApprovedReq req) { |
|
|
Project project = projectService.getById(req.getProjectId()); |
|
|
|
|
|
|
|
|
Project oldProject = projectService.getById(req.getProjectId()); |
|
|
|
|
|
Project project = BeanUtil.copyProperties(oldProject, Project.class); |
|
|
|
|
|
// 被撤回重新申报的项目,项目ID要置空 |
|
|
|
|
|
project.setId(null); |
|
|
|
|
|
project.setCreateOn(LocalDateTime.now()); |
|
|
|
|
|
project.setUpdateOn(LocalDateTime.now()); |
|
|
stateMachine.pass(project); |
|
|
stateMachine.pass(project); |
|
|
//计划出 计划验收时间 |
|
|
//计划出 计划验收时间 |
|
|
LocalDateTime planAcceptanceTime = getPlanAcceptanceTime(req); |
|
|
LocalDateTime planAcceptanceTime = getPlanAcceptanceTime(req); |
|
|
LambdaUpdateWrapper<Project> update = |
|
|
|
|
|
Wrappers.lambdaUpdate(Project.class) |
|
|
|
|
|
.set(Project::getApprovalAmount, req.getApprovedAmount()) |
|
|
|
|
|
.set(Project::getApprovedFile, req.getApprovedFileId()) |
|
|
|
|
|
.set(Project::getBuildCycle, req.getBuildCycle()) |
|
|
|
|
|
.set(Project::getOriginBuildCycle,req.getBuildCycle()) |
|
|
|
|
|
.set(Project::getApprovedConstructionPlanFile, req.getBuildPlanFileId()) |
|
|
|
|
|
.set(Project::getApprovalDate, req.getApprovedDate()) |
|
|
|
|
|
.set(Project::getStatus, project.getStatus()) |
|
|
|
|
|
.set(Project::getStage, project.getStage()) |
|
|
|
|
|
.set(Objects.nonNull(planAcceptanceTime),Project::getPlanAcceptanceTime,planAcceptanceTime) |
|
|
|
|
|
//记录原始的 计划验收时间 |
|
|
|
|
|
.set(Objects.nonNull(planAcceptanceTime),Project::getOriginPlanAcceptanceTime,planAcceptanceTime) |
|
|
|
|
|
.eq(Project::getId, req.getProjectId()); |
|
|
|
|
|
projectService.update(update); |
|
|
|
|
|
|
|
|
project.setApprovalAmount(req.getApprovedAmount()); |
|
|
|
|
|
project.setApprovedFile(String.valueOf(req.getApprovedFileId())); |
|
|
|
|
|
project.setBuildCycle(String.valueOf(req.getBuildCycle())); |
|
|
|
|
|
project.setOriginBuildCycle(req.getBuildCycle()); |
|
|
|
|
|
project.setApprovedConstructionPlanFile(String.valueOf(req.getBuildPlanFileId())); |
|
|
|
|
|
project.setApprovalDate(req.getApprovedDate()); |
|
|
|
|
|
project.setPlanAcceptanceTime(planAcceptanceTime); |
|
|
|
|
|
project.setOriginPlanAcceptanceTime(planAcceptanceTime); |
|
|
|
|
|
// 项目编号不变,版本号加1 |
|
|
|
|
|
project.setProjectCode(oldProject.getProjectCode()); |
|
|
|
|
|
project.setVersion(oldProject.getVersion() + 1); |
|
|
|
|
|
if(projectService.save(project)){ |
|
|
|
|
|
projectLibManage.saveApplication(project,oldProject,Boolean.TRUE); |
|
|
|
|
|
// 将旧的项目版本置为不是最新 |
|
|
|
|
|
projectService.update(Wrappers.lambdaUpdate(Project.class) |
|
|
|
|
|
.set(Project::getNewest, Boolean.FALSE) |
|
|
|
|
|
.ne(Project::getId, project.getId()) |
|
|
|
|
|
.eq(Project::getProjectCode, project.getProjectCode())); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public LocalDateTime getPlanAcceptanceTime(ProjectApprovedReq req){ |
|
|
public LocalDateTime getPlanAcceptanceTime(ProjectApprovedReq req){ |
|
|