You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.7 KiB

package com.connor.plm.sb02;
import java.util.ArrayList;
import com.connor.plm.KCommand;
import com.connor.plm.KUtil;
import com.teamcenter.rac.aif.AbstractAIFApplication;
import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent;
import com.teamcenter.rac.kernel.TCComponentItemRevision;
import com.teamcenter.rac.kernel.TCSession;
import com.teamcenter.rac.util.MessageBox;
/**
* 派生更改请求ECR
* @author kuma
*
*/
public class DerivedChangeRequestCommand extends KCommand {
public DerivedChangeRequestCommand(AbstractAIFApplication app, String commandId, String actionInfo) {
super(app, commandId, actionInfo);
TCSession session = (TCSession) app.getSession();
String preName = "Connor_Derive_CR";
try {
String[] prefVals = KUtil.getPrefVals(session, preName);
InterfaceAIFComponent targetComponent = app.getTargetComponent();
StringBuffer newType = new StringBuffer();
if (prefVals == null) {
MessageBox.post(preName + "首选项未配置", "提示", MessageBox.INFORMATION);
return;
}
ArrayList<ControlBean> beanList = new ArrayList<ControlBean>();
KUtil.dealPref(prefVals, targetComponent, beanList, newType);
System.out.println("newType:" + newType);
if (newType.toString().isEmpty()) {
// MessageBox.post(preName + "首选项配置有误,不存在新建的对象类型", "提示", MessageBox.INFORMATION);
System.out.println("获取新建的对象类型失败,如果取消选择请忽略此条提醒!");
return;
}
if (beanList.size() == 0) {
MessageBox.post(preName + "首选项配置有误,不存在选中对象类型的配置", "提示", MessageBox.INFORMATION);
return;
}
this.setRunnable(
new DerivedChangeRequestDialog(app, beanList, newType, (TCComponentItemRevision) targetComponent));
} catch (Exception e) {
e.printStackTrace();
}
}
}