fix(项目管理-初始化项目): #5402 新建项目时,将负责人加入项目成员中

This commit is contained in:
wanjia 2024-08-22 11:26:04 +08:00
parent ffc88d721c
commit e8487aed64
2 changed files with 12 additions and 10 deletions

View File

@ -18,6 +18,7 @@ import com.microservices.pms.enums.ProjectIssueStatus;
import com.microservices.pms.product.domain.PmsProductRequirement;
import com.microservices.pms.product.service.IPmsProductRequirementService;
import com.microservices.pms.project.domain.*;
import com.microservices.pms.project.domain.vo.PmsProjectInputVo;
import com.microservices.pms.project.domain.vo.PmsProjectIssuesInputVo;
import com.microservices.pms.project.domain.vo.PmsProjectTestReportInputVo;
import com.microservices.pms.project.domain.vo.PmsProjectTestsheetCaseInputVo;
@ -82,6 +83,9 @@ public class PmsCommonAsyncServiceImpl implements IPmsCommonAsyncService {
@Autowired
@Lazy
private IPmsProductRequirementService pmsProductRequirementService;
@Autowired
@Lazy
private IPmsProjectService pmsProjectService;
private static final String INITIALIZE_NAME = "【示例%s】研发示例%s";
@ -423,14 +427,12 @@ public class PmsCommonAsyncServiceImpl implements IPmsCommonAsyncService {
}
private Long initializePmsProject(Long id, Long creatorGitLinkUserId) {
PmsEnterprise pmsEnterprise = pmsEnterpriseService.selectPmsEnterpriseById(id);
PmsProject pmsProject = new PmsProject();
pmsProject.setPmsEnterpriseId(id);
// 创建项目
PmsProjectInputVo pmsProjectInputVo = new PmsProjectInputVo();
pmsProjectInputVo.setPmsEnterpriseId(id);
String name = "项目";
pmsProject.setProjectName(String.format(INITIALIZE_NAME, name, name));
pmsProject.setProjectAssigneeId(creatorGitLinkUserId);
pmsProject.setDeptId(pmsEnterprise.getDeptId());
pmsProjectMapper.insertPmsProject(pmsProject);
return pmsProject.getId();
pmsProjectInputVo.setProjectName(String.format(INITIALIZE_NAME, name, name));
pmsProjectInputVo.setProjectAssigneeId(creatorGitLinkUserId);
return (long) pmsProjectService.insertPmsProject(pmsProjectInputVo);
}
}

View File

@ -183,7 +183,7 @@ public class PmsProjectServiceImpl implements IPmsProjectService
}
PmsProject pmsProject = pmsProjectInputVo.toPmsProject();
pmsProject.setDeptId(pmsEnterprise.getDeptId());
int count = pmsProjectMapper.insertPmsProject(pmsProject);
pmsProjectMapper.insertPmsProject(pmsProject);
//同步新增项目-仓库数据
if (StringUtils.isNotEmpty(pmsProjectInputVo.getProjectRepositoryIds())) {
List<String> repositoryIdList = Arrays.asList(pmsProjectInputVo.getProjectRepositoryIds().split(","));
@ -220,7 +220,7 @@ public class PmsProjectServiceImpl implements IPmsProjectService
}
}
}
return count;
return pmsProject.getId().intValue();
}
/**