feat(oa): 添加项目进度模板类型支持软件开发模板

- 在 OaProjectScheduleBo 中新增 templateType 字段用于区分模板类型
- 根据模板类型动态选择对应的表格数据插入逻辑
- 新增软件类项目进度表格模板数据
- 更新自动化设计表格模板方法名以明确用途
- 添加未知模板类型的异常处理机制
This commit is contained in:
2025-10-23 13:46:30 +08:00
parent 3ebe81fff2
commit ab9d7e55fe
3 changed files with 99 additions and 3 deletions

View File

@@ -31,6 +31,7 @@ import com.ruoyi.oa.mapper.OaProjectScheduleMapper;
import com.ruoyi.oa.service.IOaProjectScheduleService;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -226,7 +227,13 @@ public class OaProjectScheduleServiceImpl implements IOaProjectScheduleService {
if (scheduleId == null) {
throw new RuntimeException("插入项目进度表后未获取到主键");
}
projectScheduleStepService.batchInsertNodes(TableDataConstantUtil.getTableData(), scheduleId);
if (bo.getTemplateType().equals("automation")){
projectScheduleStepService.batchInsertNodes(TableDataConstantUtil.getAutomationTableData(), scheduleId);
}else if (bo.getTemplateType().equals("software")){
projectScheduleStepService.batchInsertNodes(TableDataConstantUtil.getSoftwareTableData(), scheduleId);
}else {
throw new RuntimeException("未知的模板类型,无法插入项目进度节点");
}
Log.info("项目进度节点批量插入成功");
return true;
}