Browse Source

Merge remote-tracking branch 'origin/master'

master
niohe·erbao 1 year ago
parent
commit
b585298569
1 changed files with 17 additions and 0 deletions
  1. +17
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java

+ 17
- 0
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java View File

@@ -1,6 +1,7 @@
package com.ningdatech.pmapi.todocenter.manage;

import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.file.service.FileService;
@@ -15,8 +16,10 @@ import com.ningdatech.pmapi.projectdeclared.manage.DefaultDeclaredProjectManage;
import com.ningdatech.pmapi.projectdeclared.model.dto.ProjectDraftSaveDTO;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum;
import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage;
import com.ningdatech.pmapi.projectlib.model.dto.ProjectApplicationDTO;
import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication;
import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService;
import com.ningdatech.pmapi.projectlib.service.IProjectInstService;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
@@ -47,8 +50,11 @@ import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;

import static com.ningdatech.pmapi.todocenter.constant.WorkNoticeContant.*;

@@ -198,6 +204,17 @@ public class HandlerManage {
ProjectDraftSaveDTO draftSaveDto = new ProjectDraftSaveDTO();
ProjectDTO projectInfo = new ProjectDTO();
BeanUtils.copyProperties(declaredProject,projectInfo);
// 查询出项目关联的应用信息
List<ProjectApplication> applicationList = projectApplicationService.list(Wrappers.lambdaQuery(ProjectApplication.class)
.eq(ProjectApplication::getProjectId, declaredProject.getId()));
List<ProjectApplicationDTO> applicationDTOList = applicationList.stream().map(a -> {
ProjectApplicationDTO applicationDTO = new ProjectApplicationDTO();
BeanUtils.copyProperties(a, applicationDTO);
return applicationDTO;
}).collect(Collectors.toList());
projectInfo.setApplicationList(applicationDTOList);
HashMap<String,Object> dynamicMap = JSON.parseObject(declaredProject.getDynamicForm(), HashMap.class);
projectInfo.setDynamicForm(dynamicMap);
draftSaveDto.setProjectInfo(projectInfo);
declaredProjectManage.saveToDraft(draftSaveDto);
// 并删除项目库中该项目信息


Loading…
Cancel
Save