From d3657c7e8b5e1cdb106e5c78351436cf7c834cec Mon Sep 17 00:00:00 2001 From: xiongcz Date: Fri, 25 Apr 2025 17:36:55 +0800 Subject: [PATCH] =?UTF-8?q?refactor(autocode):=20=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E6=8E=89=E6=96=87=E6=A1=A3=E5=88=9B=E5=BB=BA=E5=90=8E=E5=B8=A6?= =?UTF-8?q?=E5=87=BA=E6=95=B0=E6=8D=AE=E9=9B=86=E6=A8=A1=E6=9D=BF=E7=9A=84?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 注释掉了原有逻辑,暂时不执行文档创建后带出数据集模板的操作- 准备新增根据编码规则名称带出数据集模板的功能 --- .../generatcode/NewCodeItemDialog.java | 145 +++++++++--------- 1 file changed, 75 insertions(+), 70 deletions(-) diff --git a/src/cn/com/origin/autocode/newitem/generatcode/NewCodeItemDialog.java b/src/cn/com/origin/autocode/newitem/generatcode/NewCodeItemDialog.java index ab7a96b..03c4498 100644 --- a/src/cn/com/origin/autocode/newitem/generatcode/NewCodeItemDialog.java +++ b/src/cn/com/origin/autocode/newitem/generatcode/NewCodeItemDialog.java @@ -3154,76 +3154,81 @@ public class NewCodeItemDialog extends Dialog { } //ĵݼģ - if (newComp != null) { - String prefName = "connor_DocTemp"; - String[] preVals = session.getPreferenceService().getStringValues(prefName); - String type = newComp.getType(); - for (String string : preVals) { - String[] split = string.split("="); - if (split.length == 3 && type.equals(split[0])) { - if(split[1].contains(".") && split[1].contains(":")) { - System.out.println("ʼȽ====================="); - String[] center = split[1].split(":"); - String[] split2 = center[0].split("\\."); - String preName = split2[1]; - String proFrom = split2[0]; - TCComponent centerCom = null; - if("Rev".equals(proFrom)) { - centerCom = ((TCComponentItem) newComp).getLatestItemRevision(); - } - else if("item".equals(proFrom)) { - centerCom = newComp; - } - else if("Form".equals(proFrom)) { - centerCom = ((TCComponentItem) newComp).getLatestItemRevision().getRelatedComponent("IMAN_master_form_rev"); - } - if(centerCom != null) { - String preValue = centerCom.getTCProperty(preName).getDisplayableValue(); - System.out.println("õֵΪ========" + preValue); - if (center[1].equals(preValue)) { - TCComponent[] search = session.search(" ID", new String[] {" ID"}, new String[] {split[2]}); - TCComponentItemRevision modelRev = null; - if(search != null && search.length == 1) { - TCComponentItem item = (TCComponentItem) search[0]; - TCComponent[] relatedComponents = item.getRelatedComponents("revision_list"); - for (int i = relatedComponents.length - 1; i >= 0; i--) { - TCComponentItemRevision revision = (TCComponentItemRevision) relatedComponents[i]; - if (revision.getProperty("release_status_list") != null - && !revision.getProperty("release_status_list").isEmpty()) { - modelRev = revision; - break; - } - } - } - if (modelRev != null) { - TCComponent[] relatedComponents = modelRev.getRelatedComponents("IMAN_specification"); - if(relatedComponents != null) { - for (TCComponent com : relatedComponents) { - if (com instanceof TCComponentDataset) { - TCComponentDataset component = (TCComponentDataset) com; - TCComponentItemRevision rev = ((TCComponentItem) newComp) - .getLatestItemRevision(); - String rev_name = rev.getStringProperty("object_name"); - TCComponentDataset newDataset = component.saveAs(rev_name); - String oldName = component.getRelatedComponent("ref_list") - .getProperty("original_file_name"); - String[] split3 = oldName.split("\\."); - newDataset.getRelatedComponent("ref_list").setProperty( - "original_file_name", - newDataset.getStringProperty("object_name") + "." - + split3[split3.length - 1]); - rev.add("IMAN_specification", newDataset); - } - } - } - break; - } - } - } - - } - } - } +// if (newComp != null) { +// String prefName = "connor_DocTemp"; +// String[] preVals = session.getPreferenceService().getStringValues(prefName); +// String type = newComp.getType(); +// for (String string : preVals) { +// String[] split = string.split("="); +// if (split.length == 3 && type.equals(split[0])) { +// if(split[1].contains(".") && split[1].contains(":")) { +// System.out.println("ʼȽ====================="); +// String[] center = split[1].split(":"); +// String[] split2 = center[0].split("\\."); +// String preName = split2[1]; +// String proFrom = split2[0]; +// TCComponent centerCom = null; +// if("Rev".equals(proFrom)) { +// centerCom = ((TCComponentItem) newComp).getLatestItemRevision(); +// } +// else if("item".equals(proFrom)) { +// centerCom = newComp; +// } +// else if("Form".equals(proFrom)) { +// centerCom = ((TCComponentItem) newComp).getLatestItemRevision().getRelatedComponent("IMAN_master_form_rev"); +// } +// if(centerCom != null) { +// String preValue = centerCom.getTCProperty(preName).getDisplayableValue(); +// System.out.println("õֵΪ========" + preValue); +// if (center[1].equals(preValue)) { +// TCComponent[] search = session.search(" ID", new String[] {" ID"}, new String[] {split[2]}); +// TCComponentItemRevision modelRev = null; +// if(search != null && search.length == 1) { +// TCComponentItem item = (TCComponentItem) search[0]; +// TCComponent[] relatedComponents = item.getRelatedComponents("revision_list"); +// for (int i = relatedComponents.length - 1; i >= 0; i--) { +// TCComponentItemRevision revision = (TCComponentItemRevision) relatedComponents[i]; +// if (revision.getProperty("release_status_list") != null +// && !revision.getProperty("release_status_list").isEmpty()) { +// modelRev = revision; +// break; +// } +// } +// } +// if (modelRev != null) { +// TCComponent[] relatedComponents = modelRev.getRelatedComponents("IMAN_specification"); +// if(relatedComponents != null) { +// for (TCComponent com : relatedComponents) { +// if (com instanceof TCComponentDataset) { +// TCComponentDataset component = (TCComponentDataset) com; +// TCComponentItemRevision rev = ((TCComponentItem) newComp) +// .getLatestItemRevision(); +// String rev_name = rev.getStringProperty("object_name"); +// TCComponentDataset newDataset = component.saveAs(rev_name); +// String oldName = component.getRelatedComponent("ref_list") +// .getProperty("original_file_name"); +// String[] split3 = oldName.split("\\."); +// newDataset.getRelatedComponent("ref_list").setProperty( +// "original_file_name", +// newDataset.getStringProperty("object_name") + "." +// + split3[split3.length - 1]); +// rev.add("IMAN_specification", newDataset); +// } +// } +// } +// break; +// } +// } +// } +// +// } +// } +// } +// } + + //20250425 ĵ󣬸 ID= ݼģ + if (newComp != null){ + } if (targetObject != null) {