From adf38443276ef2252fec6a0eea3a38339de464e7 Mon Sep 17 00:00:00 2001 From: hongcj Date: Tue, 19 Dec 2023 17:33:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plm/SendGXToMOM/sendGXToMOMOperation.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/com.connor.chint.wuhan/src/com/connor/plm/SendGXToMOM/sendGXToMOMOperation.java b/com.connor.chint.wuhan/src/com/connor/plm/SendGXToMOM/sendGXToMOMOperation.java index 5479da0..e6dff8c 100644 --- a/com.connor.chint.wuhan/src/com/connor/plm/SendGXToMOM/sendGXToMOMOperation.java +++ b/com.connor.chint.wuhan/src/com/connor/plm/SendGXToMOM/sendGXToMOMOperation.java @@ -16,8 +16,10 @@ import org.apache.http.util.EntityUtils; import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONObject; import com.connor.chint.sap2.util.SAPUtil; + import com.teamcenter.rac.aif.AbstractAIFOperation; import com.teamcenter.rac.kernel.TCComponent; +import com.teamcenter.rac.kernel.TCComponentItem; import com.teamcenter.rac.kernel.TCComponentItemRevision; import com.teamcenter.rac.kernel.TCSession; import com.teamcenter.rac.util.MessageBox; @@ -71,13 +73,14 @@ public class sendGXToMOMOperation extends AbstractAIFOperation{ for(TCComponent component : referenceListProperty) { String gxType = component.getStringProperty("object_type"); if("ZT2_ProcessRule".equals(gxType)) { - TCComponent[] referenceListProperty2 = component.getReferenceListProperty("IMAN_specification"); + TCComponentItemRevision latestItemRevision = ((TCComponentItem)component).getLatestItemRevision(); + TCComponent[] referenceListProperty2 = latestItemRevision.getReferenceListProperty("IMAN_specification"); if(referenceListProperty2!=null && referenceListProperty2.length>0) { for(TCComponent component2 : referenceListProperty2) { String typePdf = component2.getStringProperty("object_type"); if("PDF".equals(typePdf) || "pdf".equals(typePdf)) { FileJson fileJson = new FileJson(); - fileJson.setName(component2.getStringProperty("object_type")); + fileJson.setName(component2.getStringProperty("object_name")); fileJson.setUid(component2.getUid()); fileJson.setNo((fileJsons.size()+1)*10+""); fileJsons.add(fileJson); @@ -93,19 +96,20 @@ public class sendGXToMOMOperation extends AbstractAIFOperation{ process.setProcessRouteFiles(fileJsons); System.out.println("开始获取file数组2"); - TCComponent[] referenceListProperty1 = revision.getReferenceListProperty("ZT2_ProcGuidBookRuleRelation"); + TCComponent[] referenceListProperty1 = revision.getReferenceListProperty("ZT2_ProcGuidBookRelation"); List fileJsons1 = new ArrayList(); if(referenceListProperty1!=null && referenceListProperty1.length>0) { for(TCComponent component : referenceListProperty1) { String gxType = component.getStringProperty("object_type"); if("ZT2_ProcGuidBook".equals(gxType)) { - TCComponent[] referenceListProperty2 = component.getReferenceListProperty("IMAN_specification"); + TCComponentItemRevision latestItemRevision = ((TCComponentItem)component).getLatestItemRevision(); + TCComponent[] referenceListProperty2 = latestItemRevision.getReferenceListProperty("IMAN_specification"); if(referenceListProperty2!=null && referenceListProperty2.length>0) { for(TCComponent component2 : referenceListProperty2) { String typePdf = component2.getStringProperty("object_type"); if("PDF".equals(typePdf) || "pdf".equals(typePdf)) { FileJson fileJson = new FileJson(); - fileJson.setName(component2.getStringProperty("object_type")); + fileJson.setName(component2.getStringProperty("object_name")); fileJson.setUid(component2.getUid()); fileJson.setNo((fileJsons1.size()+1)*10+""); fileJsons1.add(fileJson); @@ -120,6 +124,8 @@ public class sendGXToMOMOperation extends AbstractAIFOperation{ System.out.println(fileJsons1.toString()); process.setEsopFiles(fileJsons1); } + + System.out.println("要发送的数据"+process.toString()); String json = JSON.toJSONString(process);