zhangwencui
7 天以前 f76bf27bf93e523ae4572d9e10e9ca541c324185
src/main/java/com/ruoyi/projectManagement/service/impl/handle/InfoHandleService.java
@@ -9,6 +9,7 @@
import com.ruoyi.basic.service.CustomerFollowUpFileService;
import com.ruoyi.common.enums.PlanStageEnum;
import com.ruoyi.common.enums.ReviewStatusEnum;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.projectManagement.dto.InfoStageDto;
import com.ruoyi.projectManagement.dto.PlanStageDto;
import com.ruoyi.projectManagement.dto.SaveInfoDto;
@@ -58,13 +59,21 @@
        }
        info.setTeam(saveInfoDto.getTeamList());
        if (info.getId() == null) {
            // 生成对应的阶段关系数据
            info.setPlanStage(getPlanStageList(info.getProjectManagementPlanId()));
            // 新项目阶段由 project_management_phase 独立维护,不再生成旧计划模板阶段。
            info.setPlanStage(Collections.emptyList());
            if (StrUtil.isBlank(info.getCurrentPhase())) {
                info.setCurrentPhase("未开始");
            }
            // 插入默认状态
            info.setStatus(PlanStageEnum.TO_BEGIN.getCode());
            info.setReviewStatus(ReviewStatusEnum.PENDING_REVIEW.getCode());
            infoMapper.insert(info);
        } else {
            Info existing = infoMapper.selectById(info.getId());
            if (existing == null) throw new ServiceException("项目不存在");
            if (!StrUtil.isBlank(existing.getCurrentPhase()) && !"未开始".equals(existing.getCurrentPhase())) {
                throw new ServiceException("项目开始后基本信息和团队信息已锁定,仅可通过人员调整功能修改项目执行人");
            }
            infoMapper.updateById(info);
        }
        return info.getId();