|
|
@ -12,7 +12,7 @@ import com.teamcenter.rac.kernel.TCSession;
|
|
|
|
import com.teamcenter.rac.kernel.TCUserService;
|
|
|
|
import com.teamcenter.rac.kernel.TCUserService;
|
|
|
|
import com.teamcenter.rac.util.MessageBox;
|
|
|
|
import com.teamcenter.rac.util.MessageBox;
|
|
|
|
|
|
|
|
|
|
|
|
public class PictureMaterialOperation extends AbstractAIFOperation{
|
|
|
|
public class PictureMaterialOperation{
|
|
|
|
private Map<Integer, TCComponent> tableMap;
|
|
|
|
private Map<Integer, TCComponent> tableMap;
|
|
|
|
private int row;
|
|
|
|
private int row;
|
|
|
|
private TCComponentItemRevision target;
|
|
|
|
private TCComponentItemRevision target;
|
|
|
@ -20,6 +20,7 @@ public class PictureMaterialOperation extends AbstractAIFOperation{
|
|
|
|
private String exec;
|
|
|
|
private String exec;
|
|
|
|
private String search;
|
|
|
|
private String search;
|
|
|
|
private TCSession session;
|
|
|
|
private TCSession session;
|
|
|
|
|
|
|
|
public String res;
|
|
|
|
public PictureMaterialOperation(Map<Integer, TCComponent> tableMap,int row,TCComponentItemRevision target,AbstractAIFDialog dialog,String search,String exec,TCSession session) {
|
|
|
|
public PictureMaterialOperation(Map<Integer, TCComponent> tableMap,int row,TCComponentItemRevision target,AbstractAIFDialog dialog,String search,String exec,TCSession session) {
|
|
|
|
this.tableMap=tableMap;
|
|
|
|
this.tableMap=tableMap;
|
|
|
|
this.row=row;
|
|
|
|
this.row=row;
|
|
|
@ -29,11 +30,10 @@ public class PictureMaterialOperation extends AbstractAIFOperation{
|
|
|
|
this.search = search;
|
|
|
|
this.search = search;
|
|
|
|
this.session = session;
|
|
|
|
this.session = session;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void executeOperation() throws Exception {
|
|
|
|
public void executeOperation() throws Exception {
|
|
|
|
switch (exec) {
|
|
|
|
switch (exec) {
|
|
|
|
case "µ¼³ö":
|
|
|
|
case "µ¼³ö":
|
|
|
|
export();
|
|
|
|
res = export();
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "²éѯ":
|
|
|
|
case "²éѯ":
|
|
|
@ -45,7 +45,7 @@ public class PictureMaterialOperation extends AbstractAIFOperation{
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
private void export() throws TCException {
|
|
|
|
private String export() throws TCException {
|
|
|
|
TCComponent comp = tableMap.get(row);
|
|
|
|
TCComponent comp = tableMap.get(row);
|
|
|
|
AIFComponentContext[] children = target.getChildren("ML8_ProjectRelation");
|
|
|
|
AIFComponentContext[] children = target.getChildren("ML8_ProjectRelation");
|
|
|
|
if(children.length>0) {
|
|
|
|
if(children.length>0) {
|
|
|
@ -57,16 +57,26 @@ public class PictureMaterialOperation extends AbstractAIFOperation{
|
|
|
|
TCUserService userservice = session.getUserService();
|
|
|
|
TCUserService userservice = session.getUserService();
|
|
|
|
Object[] obj = new Object[1];
|
|
|
|
Object[] obj = new Object[1];
|
|
|
|
obj[0] = target;
|
|
|
|
obj[0] = target;
|
|
|
|
Object res = userservice.call("updateFormChangeDesc", obj);
|
|
|
|
String res = "";
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
res= (String)userservice.call("updateFormChangeDesc", obj);
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
// TODO: handle exception
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// AIFComponentContext[] forms = comp.getChildren("ML8_ProjectRelation");
|
|
|
|
// AIFComponentContext[] forms = comp.getChildren("ML8_ProjectRelation");
|
|
|
|
// System.out.println("forms:"+forms.length);
|
|
|
|
// System.out.println("forms:"+forms.length);
|
|
|
|
// if(forms.length>0) {
|
|
|
|
// if(forms.length>0) {
|
|
|
|
// for(AIFComponentContext c : forms)
|
|
|
|
// for(AIFComponentContext c : forms)
|
|
|
|
// target.add("ML8_ProjectRelation", (TCComponent)c.getComponent());
|
|
|
|
// target.add("ML8_ProjectRelation", (TCComponent)c.getComponent());
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
MessageBox.post(dialog, "修改完成", "INFO", MessageBox.INFORMATION);
|
|
|
|
if(res != null && !res.isEmpty()) {
|
|
|
|
dialog.dispose();
|
|
|
|
res = "描述拼接报错:"+res;
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
res = "修改完成";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return res;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|