diff --git a/src/main/java/neatlogic/module/autoexec/api/combop/AutoexecCombopCopyApi.java b/src/main/java/neatlogic/module/autoexec/api/combop/AutoexecCombopCopyApi.java index ea817b0138deb5531d623c849f3599ddd08b6b8e..41e2b2dce32ba8646fa31ec2b2c6ab25d5badf23 100644 --- a/src/main/java/neatlogic/module/autoexec/api/combop/AutoexecCombopCopyApi.java +++ b/src/main/java/neatlogic/module/autoexec/api/combop/AutoexecCombopCopyApi.java @@ -134,19 +134,30 @@ public class AutoexecCombopCopyApi extends PrivateApiComponentBase { autoexecCombopVo.setIsActive(fromAutoexecCombopVo.getIsActive()); // autoexecCombopVo.setDescription(jsonObj.getString("description")); Long combopId = autoexecCombopVo.getId(); - List versionList = autoexecCombopVersionMapper.getAutoexecCombopVersionListByCombopId(id); - if (CollectionUtils.isNotEmpty(versionList)) { - for (AutoexecCombopVersionVo autoexecCombopVersionVo : versionList) { - autoexecCombopVersionVo.setId(null); - autoexecCombopVersionVo.setCombopId(combopId); - AutoexecCombopVersionConfigVo versionConfig = autoexecCombopVersionVo.getConfig(); - autoexecCombopService.resetIdAutoexecCombopVersionConfig(versionConfig); - autoexecCombopService.setAutoexecCombopPhaseGroupId(versionConfig); - autoexecCombopVersionVo.setConfigStr(null); - autoexecCombopVersionMapper.insertAutoexecCombopVersion(autoexecCombopVersionVo); - autoexecCombopService.saveDependency(autoexecCombopVersionVo); - } - } +// List versionList = autoexecCombopVersionMapper.getAutoexecCombopVersionListByCombopId(id); +// if (CollectionUtils.isNotEmpty(versionList)) { +// for (AutoexecCombopVersionVo autoexecCombopVersionVo : versionList) { +// autoexecCombopVersionVo.setId(null); +// autoexecCombopVersionVo.setCombopId(combopId); +// AutoexecCombopVersionConfigVo versionConfig = autoexecCombopVersionVo.getConfig(); +// autoexecCombopService.resetIdAutoexecCombopVersionConfig(versionConfig); +// autoexecCombopService.setAutoexecCombopPhaseGroupId(versionConfig); +// autoexecCombopVersionVo.setConfigStr(null); +// autoexecCombopVersionMapper.insertAutoexecCombopVersion(autoexecCombopVersionVo); +// autoexecCombopService.saveDependency(autoexecCombopVersionVo); +// } +// } + // 复制组合工具时,只复制激活版本,其他版本不需要复制 + AutoexecCombopVersionVo autoexecCombopVersionVo = autoexecCombopVersionMapper.getAutoexecCombopActiveVersionByCombopId(id); + autoexecCombopVersionVo.setId(null); + autoexecCombopVersionVo.setCombopId(combopId); + AutoexecCombopVersionConfigVo versionConfig = autoexecCombopVersionVo.getConfig(); + autoexecCombopService.resetIdAutoexecCombopVersionConfig(versionConfig); + autoexecCombopService.setAutoexecCombopPhaseGroupId(versionConfig); + autoexecCombopVersionVo.setConfigStr(null); + autoexecCombopVersionMapper.insertAutoexecCombopVersion(autoexecCombopVersionVo); + autoexecCombopService.saveDependency(autoexecCombopVersionVo); + autoexecCombopVo.setConfigStr(null); autoexecCombopMapper.insertAutoexecCombop(autoexecCombopVo); autoexecCombopService.saveDependency(autoexecCombopVo);