|
|
@ -16,8 +16,10 @@ import org.apache.http.util.EntityUtils;
|
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
|
import com.connor.chint.sap2.util.SAPUtil;
|
|
|
|
import com.connor.chint.sap2.util.SAPUtil;
|
|
|
|
|
|
|
|
|
|
|
|
import com.teamcenter.rac.aif.AbstractAIFOperation;
|
|
|
|
import com.teamcenter.rac.aif.AbstractAIFOperation;
|
|
|
|
import com.teamcenter.rac.kernel.TCComponent;
|
|
|
|
import com.teamcenter.rac.kernel.TCComponent;
|
|
|
|
|
|
|
|
import com.teamcenter.rac.kernel.TCComponentItem;
|
|
|
|
import com.teamcenter.rac.kernel.TCComponentItemRevision;
|
|
|
|
import com.teamcenter.rac.kernel.TCComponentItemRevision;
|
|
|
|
import com.teamcenter.rac.kernel.TCSession;
|
|
|
|
import com.teamcenter.rac.kernel.TCSession;
|
|
|
|
import com.teamcenter.rac.util.MessageBox;
|
|
|
|
import com.teamcenter.rac.util.MessageBox;
|
|
|
@ -71,13 +73,14 @@ public class sendGXToMOMOperation extends AbstractAIFOperation{
|
|
|
|
for(TCComponent component : referenceListProperty) {
|
|
|
|
for(TCComponent component : referenceListProperty) {
|
|
|
|
String gxType = component.getStringProperty("object_type");
|
|
|
|
String gxType = component.getStringProperty("object_type");
|
|
|
|
if("ZT2_ProcessRule".equals(gxType)) {
|
|
|
|
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) {
|
|
|
|
if(referenceListProperty2!=null && referenceListProperty2.length>0) {
|
|
|
|
for(TCComponent component2 : referenceListProperty2) {
|
|
|
|
for(TCComponent component2 : referenceListProperty2) {
|
|
|
|
String typePdf = component2.getStringProperty("object_type");
|
|
|
|
String typePdf = component2.getStringProperty("object_type");
|
|
|
|
if("PDF".equals(typePdf) || "pdf".equals(typePdf)) {
|
|
|
|
if("PDF".equals(typePdf) || "pdf".equals(typePdf)) {
|
|
|
|
FileJson fileJson = new FileJson();
|
|
|
|
FileJson fileJson = new FileJson();
|
|
|
|
fileJson.setName(component2.getStringProperty("object_type"));
|
|
|
|
fileJson.setName(component2.getStringProperty("object_name"));
|
|
|
|
fileJson.setUid(component2.getUid());
|
|
|
|
fileJson.setUid(component2.getUid());
|
|
|
|
fileJson.setNo((fileJsons.size()+1)*10+"");
|
|
|
|
fileJson.setNo((fileJsons.size()+1)*10+"");
|
|
|
|
fileJsons.add(fileJson);
|
|
|
|
fileJsons.add(fileJson);
|
|
|
@ -93,19 +96,20 @@ public class sendGXToMOMOperation extends AbstractAIFOperation{
|
|
|
|
process.setProcessRouteFiles(fileJsons);
|
|
|
|
process.setProcessRouteFiles(fileJsons);
|
|
|
|
|
|
|
|
|
|
|
|
System.out.println("开始获取file数组2");
|
|
|
|
System.out.println("开始获取file数组2");
|
|
|
|
TCComponent[] referenceListProperty1 = revision.getReferenceListProperty("ZT2_ProcGuidBookRuleRelation");
|
|
|
|
TCComponent[] referenceListProperty1 = revision.getReferenceListProperty("ZT2_ProcGuidBookRelation");
|
|
|
|
List<FileJson> fileJsons1 = new ArrayList<FileJson>();
|
|
|
|
List<FileJson> fileJsons1 = new ArrayList<FileJson>();
|
|
|
|
if(referenceListProperty1!=null && referenceListProperty1.length>0) {
|
|
|
|
if(referenceListProperty1!=null && referenceListProperty1.length>0) {
|
|
|
|
for(TCComponent component : referenceListProperty1) {
|
|
|
|
for(TCComponent component : referenceListProperty1) {
|
|
|
|
String gxType = component.getStringProperty("object_type");
|
|
|
|
String gxType = component.getStringProperty("object_type");
|
|
|
|
if("ZT2_ProcGuidBook".equals(gxType)) {
|
|
|
|
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) {
|
|
|
|
if(referenceListProperty2!=null && referenceListProperty2.length>0) {
|
|
|
|
for(TCComponent component2 : referenceListProperty2) {
|
|
|
|
for(TCComponent component2 : referenceListProperty2) {
|
|
|
|
String typePdf = component2.getStringProperty("object_type");
|
|
|
|
String typePdf = component2.getStringProperty("object_type");
|
|
|
|
if("PDF".equals(typePdf) || "pdf".equals(typePdf)) {
|
|
|
|
if("PDF".equals(typePdf) || "pdf".equals(typePdf)) {
|
|
|
|
FileJson fileJson = new FileJson();
|
|
|
|
FileJson fileJson = new FileJson();
|
|
|
|
fileJson.setName(component2.getStringProperty("object_type"));
|
|
|
|
fileJson.setName(component2.getStringProperty("object_name"));
|
|
|
|
fileJson.setUid(component2.getUid());
|
|
|
|
fileJson.setUid(component2.getUid());
|
|
|
|
fileJson.setNo((fileJsons1.size()+1)*10+"");
|
|
|
|
fileJson.setNo((fileJsons1.size()+1)*10+"");
|
|
|
|
fileJsons1.add(fileJson);
|
|
|
|
fileJsons1.add(fileJson);
|
|
|
@ -120,6 +124,8 @@ public class sendGXToMOMOperation extends AbstractAIFOperation{
|
|
|
|
System.out.println(fileJsons1.toString());
|
|
|
|
System.out.println(fileJsons1.toString());
|
|
|
|
process.setEsopFiles(fileJsons1);
|
|
|
|
process.setEsopFiles(fileJsons1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
System.out.println("要发送的数据"+process.toString());
|
|
|
|
System.out.println("要发送的数据"+process.toString());
|
|
|
|
|
|
|
|
|
|
|
|
String json = JSON.toJSONString(process);
|
|
|
|
String json = JSON.toJSONString(process);
|
|
|
|