fix[project]: 策划出的待办加上项目承接主体

This commit is contained in:
2026-04-02 11:04:00 +08:00
parent 4c9b512a62
commit fd8444e954

View File

@@ -44,6 +44,8 @@ import com.sdm.common.utils.PageUtils;
import com.sdm.common.utils.RandomUtil;
import com.sdm.common.utils.SystemOperate;
import com.sdm.common.utils.excel.ExcelUtil;
import com.sdm.outbridge.entity.LyricVProjectToDM;
import com.sdm.outbridge.service.lyric.LyricVProjectToDmService;
import com.sdm.project.bo.ExportOperate;
import com.sdm.project.common.*;
import com.sdm.project.dao.SimulationDemandMapper;
@@ -219,6 +221,9 @@ public class ProjectServiceImpl extends BaseService implements IProjectService {
@Autowired
private SimulationReportFeignClientImpl reportFeignClient;
@Autowired
private LyricVProjectToDmService lyricVProjectToDmService;
// @Override
// @Transactional
@@ -2554,12 +2559,20 @@ public class ProjectServiceImpl extends BaseService implements IProjectService {
// 查询项目的拓展属性
List<String> tag1Id = taskNodeList.get(0).getTag1();
List<SpdmNodeExtraVo> nodeExtraList = new ArrayList<>();
String projectCode = "";
log.info("tag1Id为{}",tag1Id);
if (CollectionUtils.isNotEmpty(tag1Id)) {
nodeExtraList = nodeMapper.getNodeExtraListByNodeIdList(tag1Id);
SpdmNodeVo projectNode = nodeMapper.getNodeById(tag1Id.get(0));
log.info("projectNode为{}",projectNode);
if (ObjectUtils.isNotEmpty(projectNode)) {
projectCode = projectNode.getNodeCode();
}
}
log.info("projectCode为{}",projectCode);
// 20260320 新增任务时,同步新增一个需求
try {
addDemandByTask(taskNodeList,nodeExtraList);
addDemandByTask(taskNodeList,nodeExtraList,projectCode);
}catch (Exception ex) {
log.error("新增任务时,同步新增需求时异常:{}",ex.getMessage());
}
@@ -2639,7 +2652,7 @@ public class ProjectServiceImpl extends BaseService implements IProjectService {
return response;
}
public void addDemandByTask(List<TaskNode> taskNodeList,List<SpdmNodeExtraVo> nodeExtraList) {
public void addDemandByTask(List<TaskNode> taskNodeList,List<SpdmNodeExtraVo> nodeExtraList,String projectCode) {
Long tenantId = ThreadLocalContext.getTenantId();
Long jobNumber = ThreadLocalContext.getUserId();
String curDateStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
@@ -2682,7 +2695,8 @@ public class ProjectServiceImpl extends BaseService implements IProjectService {
}
long demandId = req.getId();
List<SpdmDemandExtraReq> demandExtraList = new ArrayList<>();
// 项目承接主题
log.info("addDemandByTask的nodeExtraList为{}",nodeExtraList);
// 项目承接主体
SpdmNodeExtraVo projectUndertakerExtraVo = nodeExtraList.stream().filter(nodeExtra -> PROJECT_UNDERTAKER.equals(nodeExtra.getPropertyName())).findFirst().orElse(null);
if (projectUndertakerExtraVo != null) {
SpdmDemandExtraReq demandExtraReq = new SpdmDemandExtraReq();
@@ -2693,6 +2707,24 @@ public class ProjectServiceImpl extends BaseService implements IProjectService {
demandExtraReq.setCreator(jobNumber);
demandExtraReq.setCreateTime(curDateStr);
demandExtraList.add(demandExtraReq);
}else {
if (lyricFlag == 1) {
List<LyricVProjectToDM> lyricVProjectToDMList = lyricVProjectToDmService.lambdaQuery().in(LyricVProjectToDM::getProjectNum, Collections.singletonList(projectCode)).list();
log.info("lyricVProjectToDMList为{}",lyricVProjectToDMList);
if (CollectionUtils.isNotEmpty(lyricVProjectToDMList)) {
String projectUndertaker = lyricVProjectToDMList.get(0).getProjectUndertaker();
log.info("projectUndertaker为{}",projectUndertaker);
if (StringUtils.isNotBlank(projectUndertaker)) {
SpdmDemandExtraReq demandExtraReq = new SpdmDemandExtraReq();
demandExtraReq.setDemandId(req.getUuid());
demandExtraReq.setPropertyName(PROJECT_UNDERTAKER);
demandExtraReq.setPropertyValue(projectUndertaker);
demandExtraReq.setCreator(jobNumber);
demandExtraReq.setCreateTime(curDateStr);
demandExtraList.add(demandExtraReq);
}
}
}
}
// 产品线