|
|
@ -15,22 +15,49 @@ import java.util.*;
|
|
|
|
import java.util.regex.Matcher;
|
|
|
|
import java.util.regex.Matcher;
|
|
|
|
import java.util.regex.Pattern;
|
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.mail.Folder;
|
|
|
|
import javax.swing.*;
|
|
|
|
import javax.swing.*;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.apache.log4j.LogManager;
|
|
|
|
|
|
|
|
import org.apache.log4j.Logger;
|
|
|
|
|
|
|
|
|
|
|
|
import com.teamcenter.rac.aif.AbstractAIFApplication;
|
|
|
|
import com.teamcenter.rac.aif.AbstractAIFApplication;
|
|
|
|
import com.teamcenter.rac.aif.AbstractAIFDialog;
|
|
|
|
import com.teamcenter.rac.aif.AbstractAIFDialog;
|
|
|
|
import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent;
|
|
|
|
import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent;
|
|
|
|
|
|
|
|
import com.teamcenter.rac.kernel.ListOfValuesInfo;
|
|
|
|
|
|
|
|
import com.teamcenter.rac.kernel.TCComponent;
|
|
|
|
import com.teamcenter.rac.kernel.TCComponentFolder;
|
|
|
|
import com.teamcenter.rac.kernel.TCComponentFolder;
|
|
|
|
|
|
|
|
import com.teamcenter.rac.kernel.TCComponentForm;
|
|
|
|
|
|
|
|
import com.teamcenter.rac.kernel.TCComponentItem;
|
|
|
|
import com.teamcenter.rac.kernel.TCComponentItemRevision;
|
|
|
|
import com.teamcenter.rac.kernel.TCComponentItemRevision;
|
|
|
|
|
|
|
|
import com.teamcenter.rac.kernel.TCComponentListOfValues;
|
|
|
|
import com.teamcenter.rac.kernel.TCException;
|
|
|
|
import com.teamcenter.rac.kernel.TCException;
|
|
|
|
import com.teamcenter.rac.kernel.TCPreferenceService;
|
|
|
|
import com.teamcenter.rac.kernel.TCPreferenceService;
|
|
|
|
|
|
|
|
import com.teamcenter.rac.kernel.TCProperty;
|
|
|
|
import com.teamcenter.rac.kernel.TCSession;
|
|
|
|
import com.teamcenter.rac.kernel.TCSession;
|
|
|
|
import com.teamcenter.rac.util.DateButton;
|
|
|
|
import com.teamcenter.rac.util.DateButton;
|
|
|
|
import com.teamcenter.rac.util.MessageBox;
|
|
|
|
import com.teamcenter.rac.util.MessageBox;
|
|
|
|
import com.teamcenter.rac.util.PropertyLayout;
|
|
|
|
import com.teamcenter.rac.util.PropertyLayout;
|
|
|
|
import com.teamcenter.rac.util.UIUtilities;
|
|
|
|
import com.teamcenter.rac.util.UIUtilities;
|
|
|
|
|
|
|
|
import com.teamcenter.schemas.soa._2006_03.exceptions.ServiceException;
|
|
|
|
|
|
|
|
import com.teamcenter.services.rac.core.DataManagementService;
|
|
|
|
|
|
|
|
//导入类
|
|
|
|
|
|
|
|
//import com.teamcenter.services.rac.core.DataManagementService;
|
|
|
|
|
|
|
|
//import com.teamcenter.services.rac.core._2008_06.DataManagement.CreateIn;
|
|
|
|
|
|
|
|
//import com.teamcenter.services.rac.core._2008_06.DataManagement.CreateInput;
|
|
|
|
|
|
|
|
//import com.teamcenter.services.rac.core._2008_06.DataManagement.CreateOut;
|
|
|
|
|
|
|
|
//import com.teamcenter.services.rac.core._2008_06.DataManagement.CreateResponse;
|
|
|
|
|
|
|
|
import com.teamcenter.services.rac.core._2008_06.DataManagement.CreateIn;
|
|
|
|
|
|
|
|
import com.teamcenter.services.rac.core._2008_06.DataManagement.CreateInput;
|
|
|
|
|
|
|
|
import com.teamcenter.services.rac.core._2008_06.DataManagement.CreateOut;
|
|
|
|
|
|
|
|
import com.teamcenter.services.rac.core._2008_06.DataManagement.CreateResponse;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.net.connor.createTempDrawings.pojo.LovProperty;
|
|
|
|
|
|
|
|
import cn.net.connor.createTempDrawings.utils.TCLOVUtil;
|
|
|
|
|
|
|
|
|
|
|
|
public class CreateTempDrawingDialog extends JFrame implements ActionListener{
|
|
|
|
public class CreateTempDrawingDialog extends JFrame implements ActionListener{
|
|
|
|
|
|
|
|
private static final Logger logger = LogManager.getLogger(CreateTempDrawingDialog.class);
|
|
|
|
|
|
|
|
|
|
|
|
private AbstractAIFApplication application;
|
|
|
|
private AbstractAIFApplication application;
|
|
|
|
private TCSession tcSession ;
|
|
|
|
private TCSession tcSession ;
|
|
|
|
private InterfaceAIFComponent selectComponent;
|
|
|
|
private InterfaceAIFComponent selectComponent;
|
|
|
@ -51,11 +78,22 @@ public class CreateTempDrawingDialog extends JFrame implements ActionListener{
|
|
|
|
private JButton buildButton;
|
|
|
|
private JButton buildButton;
|
|
|
|
// 添加日期格式化工具
|
|
|
|
// 添加日期格式化工具
|
|
|
|
private SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
private SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 根据选中的对象类型,获取对象类型对应的首选项配置的属性信息
|
|
|
|
|
|
|
|
* 例如:*名称=Item.object_name=string
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
private List<String> preferencePropList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 属性组件集合
|
|
|
|
* 属性组件集合
|
|
|
|
|
|
|
|
* 显示属性条目,属性组件
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private Map<String,JComponent> propComponentMap = new HashMap<>();
|
|
|
|
private Map<String,JComponent> propComponentMap = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 存放lov属性对象
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
private List<LovProperty> lovPropertyList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -64,12 +102,14 @@ public class CreateTempDrawingDialog extends JFrame implements ActionListener{
|
|
|
|
* @param selectComponent
|
|
|
|
* @param selectComponent
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public CreateTempDrawingDialog(AbstractAIFApplication application, InterfaceAIFComponent selectComponent) {
|
|
|
|
public CreateTempDrawingDialog(AbstractAIFApplication application, InterfaceAIFComponent selectComponent) {
|
|
|
|
|
|
|
|
logger.info("haihaihai");
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
this.application = application;
|
|
|
|
this.application = application;
|
|
|
|
this.tcSession = (TCSession) this.application.getSession();
|
|
|
|
this.tcSession = (TCSession) this.application.getSession();
|
|
|
|
this.selectComponent = selectComponent;
|
|
|
|
this.selectComponent = selectComponent;
|
|
|
|
|
|
|
|
|
|
|
|
System.out.println("开始加载创建临时图纸面板!");
|
|
|
|
System.out.println("开始加载创建临时图纸面板!");
|
|
|
|
|
|
|
|
logger.info("开始加载创建临时图纸面板!");
|
|
|
|
List<String> list1 = getPreferenceInfos("SB6_Create_LS_Design");
|
|
|
|
List<String> list1 = getPreferenceInfos("SB6_Create_LS_Design");
|
|
|
|
if (list1.isEmpty() || list1.size() <= 0) {
|
|
|
|
if (list1.isEmpty() || list1.size() <= 0) {
|
|
|
|
MessageBox.post("获取首选项SB6_Create_LS_Design配置信息失败,请检查配置是否正确!" , "提示", MessageBox.INFORMATION);
|
|
|
|
MessageBox.post("获取首选项SB6_Create_LS_Design配置信息失败,请检查配置是否正确!" , "提示", MessageBox.INFORMATION);
|
|
|
@ -167,6 +207,378 @@ public class CreateTempDrawingDialog extends JFrame implements ActionListener{
|
|
|
|
this.setVisible(true);
|
|
|
|
this.setVisible(true);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String getSourceValue(String[] split) throws TCException {
|
|
|
|
|
|
|
|
String value = null;
|
|
|
|
|
|
|
|
if (split.length == 4) {//配置信息中,存在继承属性来源
|
|
|
|
|
|
|
|
String propSource = split[3];
|
|
|
|
|
|
|
|
String[] sourceArr = propSource.split("\\.");
|
|
|
|
|
|
|
|
if (sourceArr.length > 0) {
|
|
|
|
|
|
|
|
String sourceLocation = sourceArr[0];
|
|
|
|
|
|
|
|
String sourceTrueName = sourceArr[1];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.selectComponent instanceof TCComponentItemRevision) {
|
|
|
|
|
|
|
|
TCComponentItemRevision itemRevision = (TCComponentItemRevision) selectComponent;
|
|
|
|
|
|
|
|
TCComponentItem item = itemRevision.getItem();
|
|
|
|
|
|
|
|
if (sourceLocation.equals("Item")) {
|
|
|
|
|
|
|
|
value = item.getStringProperty(sourceTrueName);
|
|
|
|
|
|
|
|
}else if (sourceLocation.equals("Rev")) {
|
|
|
|
|
|
|
|
value = itemRevision.getStringProperty(sourceTrueName);
|
|
|
|
|
|
|
|
}else if (sourceLocation.equals("Form")) {
|
|
|
|
|
|
|
|
// 获取版本表单
|
|
|
|
|
|
|
|
TCComponentForm form = (TCComponentForm) itemRevision.getRelatedComponent("IMAN_master_form_rev");
|
|
|
|
|
|
|
|
if (form != null) {
|
|
|
|
|
|
|
|
value = form.getStringProperty(sourceTrueName);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
System.out.println("选中对象是文件夹,无法获取继承值。");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return value;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 创建对象
|
|
|
|
|
|
|
|
* @throws Exception
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public void createItem() throws Exception {
|
|
|
|
|
|
|
|
// Map<String, String> formMap = new HashMap<String, String>();
|
|
|
|
|
|
|
|
//属性真实值,属性值,属性类型(string\date\lov:lovname)
|
|
|
|
|
|
|
|
List<String[]> formList = new ArrayList<String[]>();
|
|
|
|
|
|
|
|
CreateIn itemDef = new CreateIn();
|
|
|
|
|
|
|
|
CreateInput itemRevisionDef = new CreateInput();
|
|
|
|
|
|
|
|
//获取创建对象的类型
|
|
|
|
|
|
|
|
List<String> typeList = this.drawingObjTypeInfos;//首选项中配置的类型信息
|
|
|
|
|
|
|
|
if (typeList == null || typeList.size() <= 0) {
|
|
|
|
|
|
|
|
System.out.println("类型获取异常,临时图纸创建失败!");
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
String itemType = null;
|
|
|
|
|
|
|
|
String item_id = null;
|
|
|
|
|
|
|
|
String item_revision_id = null;
|
|
|
|
|
|
|
|
String chooseType = (String) this.drawingObjTypeComboBox.getSelectedItem();
|
|
|
|
|
|
|
|
for (String string : typeList){
|
|
|
|
|
|
|
|
String[] types = string.split("=");
|
|
|
|
|
|
|
|
if (chooseType.equals(types[0])) {
|
|
|
|
|
|
|
|
itemType = types[1];
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
System.out.println("新建图纸对象类型为:"+itemType);
|
|
|
|
|
|
|
|
//获取对象和版本id
|
|
|
|
|
|
|
|
for (Map.Entry<String, JComponent> entry : this.propComponentMap.entrySet()) {
|
|
|
|
|
|
|
|
String key = entry.getKey();
|
|
|
|
|
|
|
|
if (key.equals("ID*")){
|
|
|
|
|
|
|
|
item_id = getComponentValue(entry.getValue());
|
|
|
|
|
|
|
|
} else if (key.equals("版本")) {
|
|
|
|
|
|
|
|
item_revision_id = getComponentValue(entry.getValue());//item_revision_id
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//item类型
|
|
|
|
|
|
|
|
itemDef.data.boName = itemType;
|
|
|
|
|
|
|
|
itemDef.data.stringProps.put("item_id", item_id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//版本类型
|
|
|
|
|
|
|
|
itemRevisionDef.boName = itemType + "Revision";
|
|
|
|
|
|
|
|
if (item_revision_id != null) {
|
|
|
|
|
|
|
|
itemRevisionDef.stringProps.put("item_revision_id", item_revision_id);
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
System.out.println("获取版本id失败,对象创建失败!");
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
System.out.println("已有属性条目-组件数量="+this.propComponentMap.size());
|
|
|
|
|
|
|
|
for (Map.Entry<String, JComponent> entry : this.propComponentMap.entrySet()) {
|
|
|
|
|
|
|
|
String key = entry.getKey();//编辑的属性条目名称
|
|
|
|
|
|
|
|
String value = getComponentValue(entry.getValue());//根据组件获取选中、输入的值
|
|
|
|
|
|
|
|
int tag = 0;
|
|
|
|
|
|
|
|
//遍历首选项配置,获取属性真实值和位置、类型等信息
|
|
|
|
|
|
|
|
for (String prop : preferencePropList){
|
|
|
|
|
|
|
|
String[] split = prop.split("=");
|
|
|
|
|
|
|
|
if (split != null && split.length > 0) {
|
|
|
|
|
|
|
|
String propName = split[0];
|
|
|
|
|
|
|
|
String s1 = split[1];
|
|
|
|
|
|
|
|
String[] split2 = s1.split("\\.");
|
|
|
|
|
|
|
|
String location = null;
|
|
|
|
|
|
|
|
String trueName = null;
|
|
|
|
|
|
|
|
if (split2.length>0) {
|
|
|
|
|
|
|
|
location = split2[0];//Item/Rev/Form
|
|
|
|
|
|
|
|
trueName = split2[1];//属性真实名称
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
System.out.println("首选项中配置的属性信息【"+split[1]+"】异常!(不存在.符号)请检查配置");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
String typeString = split[2];
|
|
|
|
|
|
|
|
String configName = removeAsterisk(propName);
|
|
|
|
|
|
|
|
String showName = removeAsterisk(key);
|
|
|
|
|
|
|
|
if (configName.equals(showName)) {
|
|
|
|
|
|
|
|
tag++;
|
|
|
|
|
|
|
|
System.out.println("开始赋值属性:"+propName+",对应的属性值:"+value);
|
|
|
|
|
|
|
|
//判断是否需要继承,需要的话获取继承值
|
|
|
|
|
|
|
|
String sourceValue = getSourceValue(split);
|
|
|
|
|
|
|
|
if (sourceValue != null) {
|
|
|
|
|
|
|
|
System.out.println("需要获取继承值:"+sourceValue);
|
|
|
|
|
|
|
|
value = sourceValue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
System.out.println(propName+"=>"+value);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (location.equals("Item")) {
|
|
|
|
|
|
|
|
if (typeString.equals("string")) {
|
|
|
|
|
|
|
|
itemDef.data.stringProps.put(trueName, value);
|
|
|
|
|
|
|
|
}else if (typeString.equals("date")) {
|
|
|
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-M-dd HH:mm");
|
|
|
|
|
|
|
|
Date date = sdf.parse(value);
|
|
|
|
|
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
|
|
|
|
|
calendar.setTime(date);
|
|
|
|
|
|
|
|
itemDef.data.dateProps.put(trueName, calendar);
|
|
|
|
|
|
|
|
}else if (typeString.split(":")[0].equals("lov")) {
|
|
|
|
|
|
|
|
String trueValue = getLovTrueValue(trueName,value,this.lovPropertyList);
|
|
|
|
|
|
|
|
itemDef.data.stringProps.put(trueName, trueValue);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}else if (location.equals("Rev")) {
|
|
|
|
|
|
|
|
if (typeString.equals("string")) {
|
|
|
|
|
|
|
|
itemRevisionDef.stringProps.put(trueName, value);
|
|
|
|
|
|
|
|
}else if (typeString.equals("date")) {
|
|
|
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-M-dd HH:mm");
|
|
|
|
|
|
|
|
Date date = sdf.parse(value);
|
|
|
|
|
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
|
|
|
|
|
calendar.setTime(date);
|
|
|
|
|
|
|
|
itemRevisionDef.dateProps.put(trueName, calendar);
|
|
|
|
|
|
|
|
}else if (typeString.split(":")[0].equals("lov")) {
|
|
|
|
|
|
|
|
String trueValue = getLovTrueValue(trueName,value,this.lovPropertyList);
|
|
|
|
|
|
|
|
itemRevisionDef.stringProps.put(trueName, trueValue);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// itemRevisionDef.stringProps.put(trueName, value);
|
|
|
|
|
|
|
|
}else if (location.equals("Form")) {
|
|
|
|
|
|
|
|
//此处对表单属性暂时不做赋值,先暂存到一个Map集合中
|
|
|
|
|
|
|
|
// itemRevisionDef.stringProps.put(trueName, value);
|
|
|
|
|
|
|
|
String[] formPropInfos = {trueName, value, typeString};//属性真实名称,输入or选中的属性值,属性类型(string\date\lov:lovname)
|
|
|
|
|
|
|
|
formList.add(formPropInfos);
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
System.out.println("首选项中配置了意料之外的属性位置。");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
System.out.println("首选项中配置的属性信息【"+prop+"】异常!(不存在=符号)请检查配置");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (tag == 0) {
|
|
|
|
|
|
|
|
System.out.println("属性条目["+key+"]未在首选项配置中找到对应的配置");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
System.out.println("0");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
itemDef.data.compoundCreateInput.put("revision", new CreateInput[] { itemRevisionDef });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DataManagementService dmService = DataManagementService.getService(tcSession);
|
|
|
|
|
|
|
|
CreateResponse createObjResponse = dmService.createObjects(new CreateIn[] { itemDef });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (createObjResponse.serviceData.sizeOfPartialErrors() == 0) {
|
|
|
|
|
|
|
|
for (CreateOut out : createObjResponse.output) {
|
|
|
|
|
|
|
|
for (TCComponent obj : out.objects) {
|
|
|
|
|
|
|
|
TCComponentItem item;
|
|
|
|
|
|
|
|
TCComponentItemRevision itemRev;
|
|
|
|
|
|
|
|
TCComponentForm form;
|
|
|
|
|
|
|
|
if (obj instanceof TCComponentItem) {
|
|
|
|
|
|
|
|
item = (TCComponentItem) obj;
|
|
|
|
|
|
|
|
item.lock();
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
System.out.println("开始挂载新建临时图纸到选中对象下");
|
|
|
|
|
|
|
|
if (this.selectComponent instanceof TCComponentFolder) {
|
|
|
|
|
|
|
|
System.out.println("挂载对象到文件夹下");
|
|
|
|
|
|
|
|
TCComponentFolder folder = (TCComponentFolder) this.selectComponent;
|
|
|
|
|
|
|
|
folder.add("contents", item);
|
|
|
|
|
|
|
|
}else if (this.selectComponent instanceof TCComponentItemRevision) {
|
|
|
|
|
|
|
|
TCComponentItemRevision revision = (TCComponentItemRevision) this.selectComponent;
|
|
|
|
|
|
|
|
revision.add("SB6_LSSJRelation", item);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
System.out.println("item处理异常:");
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
}finally {
|
|
|
|
|
|
|
|
item.save();
|
|
|
|
|
|
|
|
item.unlock();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (obj instanceof TCComponentItemRevision) {
|
|
|
|
|
|
|
|
itemRev = (TCComponentItemRevision) obj;
|
|
|
|
|
|
|
|
if (!setFormProperty(itemRev,formList)) {
|
|
|
|
|
|
|
|
System.out.println("表单属性设置失败!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
itemRev.lock();
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
itemRev.setStringProperty("sb6_ifls", "是");
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
System.out.println("itemRev处理异常:");
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
}finally {
|
|
|
|
|
|
|
|
itemRev.save();
|
|
|
|
|
|
|
|
itemRev.unlock();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (obj instanceof TCComponentForm) {
|
|
|
|
|
|
|
|
form = (TCComponentForm) obj;
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
* form.lock(); try { if (formList.size()>0) { System.out.println("开始处理表单数据");
|
|
|
|
|
|
|
|
* for (String[] forms : formList) { if (forms.length == 3) { String tNameString
|
|
|
|
|
|
|
|
* = forms[0]; String tValueString = forms[1]; String tTypeString = forms[2];
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* setTCPropertyValue(form,tNameString,tValueString); } } } } catch (Exception
|
|
|
|
|
|
|
|
* e) { System.out.println("表单处理异常:"); e.printStackTrace(); }finally {
|
|
|
|
|
|
|
|
* form.save(); form.unlock(); }
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 根据属性真实名称在lov属性集合中get对应的lov集合,通过lov显示值获取lov对应的真实值
|
|
|
|
|
|
|
|
* @param configName 首选项中配置的属性真实名称
|
|
|
|
|
|
|
|
* @param lovShowName lov的显示值
|
|
|
|
|
|
|
|
* @param lovPropertyList2 lov属性集合
|
|
|
|
|
|
|
|
* @return lov的真实值
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
private String getLovTrueValue(String configName, String lovShowName, List<LovProperty> lovPropertyList2) {
|
|
|
|
|
|
|
|
String trueNameString = null;
|
|
|
|
|
|
|
|
for (LovProperty lovProperty : lovPropertyList2) {
|
|
|
|
|
|
|
|
String propName = lovProperty.getPropTrueName();
|
|
|
|
|
|
|
|
if (configName.equals(propName)) {
|
|
|
|
|
|
|
|
Map<String, String> lovMap = lovProperty.getLovMap();
|
|
|
|
|
|
|
|
return lovMap.get(lovShowName);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
System.out.println("未获取到lov-["+lovShowName+"]的真实值");
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param component
|
|
|
|
|
|
|
|
* @param formList
|
|
|
|
|
|
|
|
* @return
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
private boolean setFormProperty(TCComponent component, List<String[]> formList) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
TCComponentForm form = (TCComponentForm) component.getRelatedComponent("IMAN_master_form_rev");
|
|
|
|
|
|
|
|
form.lock();
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
if (formList.size()>0) {
|
|
|
|
|
|
|
|
System.out.println("开始处理表单数据");
|
|
|
|
|
|
|
|
for (String[] forms : formList) {
|
|
|
|
|
|
|
|
String finalPropValue = null;
|
|
|
|
|
|
|
|
if (forms.length == 3) {
|
|
|
|
|
|
|
|
String tNameString = forms[0];//属性真实名称
|
|
|
|
|
|
|
|
String tValueString = forms[1];//属性输入or选中值
|
|
|
|
|
|
|
|
String tTypeString = forms[2];//属性类型string/data/lov:*
|
|
|
|
|
|
|
|
if (tTypeString.contains("lov")) {
|
|
|
|
|
|
|
|
finalPropValue = getLovTrueValue(tNameString,tValueString,this.lovPropertyList);
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
finalPropValue = tValueString;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
System.out.println("设置表单属性["+tNameString+"]="+finalPropValue);
|
|
|
|
|
|
|
|
setTCPropertyValue(form,tNameString,finalPropValue);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
System.out.println("表单属性赋值完成!");
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
System.out.println("没有需要赋值的表单属性!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
System.out.println("表单处理异常:");
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
}finally {
|
|
|
|
|
|
|
|
form.save();
|
|
|
|
|
|
|
|
form.unlock();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (TCException e) {
|
|
|
|
|
|
|
|
// TODO 自动生成的 catch 块
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @Title: setTCPropertyValue
|
|
|
|
|
|
|
|
* @Description: 根据对象属性类别赋值
|
|
|
|
|
|
|
|
* @param @param item
|
|
|
|
|
|
|
|
* @param @param propertyName
|
|
|
|
|
|
|
|
* @param @param value 参数
|
|
|
|
|
|
|
|
* @return void 返回类型
|
|
|
|
|
|
|
|
* @throws
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public static void setTCPropertyValue(TCComponent item, String propertyName, Object value) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
String type2 = item.getType();
|
|
|
|
|
|
|
|
TCProperty tcProperty = item.getTCProperty(propertyName);
|
|
|
|
|
|
|
|
String name = item.getUid();
|
|
|
|
|
|
|
|
if (tcProperty == null) {
|
|
|
|
|
|
|
|
System.out.println("对象:"+name+",类型:"+type2+"中不存在属性:【"+propertyName);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (tcProperty.getPropertyType()) {
|
|
|
|
|
|
|
|
case TCProperty.PROP_double:
|
|
|
|
|
|
|
|
if (value instanceof Double) {
|
|
|
|
|
|
|
|
tcProperty.setDoubleValue((double) value);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
tcProperty.setDoubleValue(Double.parseDouble(value.toString()));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case TCProperty.PROP_int:
|
|
|
|
|
|
|
|
if (value instanceof Integer) {
|
|
|
|
|
|
|
|
tcProperty.setDoubleValue((int) value);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
tcProperty.setDoubleValue(Integer.parseInt(value.toString()));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case TCProperty.PROP_string:
|
|
|
|
|
|
|
|
tcProperty.setStringValue(value.toString());
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case TCProperty.PROP_long_string:
|
|
|
|
|
|
|
|
tcProperty.setStringValueArray((String[]) value);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case TCProperty.PROP_date:
|
|
|
|
|
|
|
|
if (value instanceof Date) {
|
|
|
|
|
|
|
|
tcProperty.setDateValue((Date) value);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-M-dd HH:mm");
|
|
|
|
|
|
|
|
tcProperty.setDateValue(sdf.parse(value.toString()));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 获取创建临时图纸对象时,选择类型界面的类型名称集合
|
|
|
|
* 获取创建临时图纸对象时,选择类型界面的类型名称集合
|
|
|
@ -233,7 +645,13 @@ public class CreateTempDrawingDialog extends JFrame implements ActionListener{
|
|
|
|
System.out.println("当前选中图纸对象类型="+chooseType);
|
|
|
|
System.out.println("当前选中图纸对象类型="+chooseType);
|
|
|
|
// 关闭当前窗口
|
|
|
|
// 关闭当前窗口
|
|
|
|
this.dispose();
|
|
|
|
this.dispose();
|
|
|
|
buildDrawingObjTypeFrame();
|
|
|
|
try {
|
|
|
|
|
|
|
|
buildDrawingObjTypeFrame();
|
|
|
|
|
|
|
|
} catch (Exception e2) {
|
|
|
|
|
|
|
|
// TODO: handle exception
|
|
|
|
|
|
|
|
e2.printStackTrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}else if (s.equals(this.closeButton)) {
|
|
|
|
}else if (s.equals(this.closeButton)) {
|
|
|
|
System.out.println("触发‘关闭’按钮");
|
|
|
|
System.out.println("触发‘关闭’按钮");
|
|
|
|
// 关闭新建窗口
|
|
|
|
// 关闭新建窗口
|
|
|
@ -244,14 +662,16 @@ public class CreateTempDrawingDialog extends JFrame implements ActionListener{
|
|
|
|
if(!checkRequiredProp()){
|
|
|
|
if(!checkRequiredProp()){
|
|
|
|
System.out.println("校验未通过!");
|
|
|
|
System.out.println("校验未通过!");
|
|
|
|
return ;
|
|
|
|
return ;
|
|
|
|
}else {
|
|
|
|
|
|
|
|
System.out.println("校验已通过!");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
System.out.println("校验已通过!");
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
createItem();
|
|
|
|
|
|
|
|
} catch (Exception e2) {
|
|
|
|
|
|
|
|
// TODO: handle exception
|
|
|
|
|
|
|
|
e2.printStackTrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
System.out.println("创建临时图纸完成!");
|
|
|
|
// 关闭新建窗口
|
|
|
|
// 关闭新建窗口
|
|
|
|
this.buildFram.dispose();
|
|
|
|
this.buildFram.dispose();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -271,20 +691,19 @@ public class CreateTempDrawingDialog extends JFrame implements ActionListener{
|
|
|
|
private boolean checkRequiredProp() {
|
|
|
|
private boolean checkRequiredProp() {
|
|
|
|
System.out.println("propComponentMap.size="+propComponentMap.size());
|
|
|
|
System.out.println("propComponentMap.size="+propComponentMap.size());
|
|
|
|
if (propComponentMap.size()>0) {
|
|
|
|
if (propComponentMap.size()>0) {
|
|
|
|
System.out.println("1");
|
|
|
|
|
|
|
|
for (Map.Entry<String, JComponent> entry : propComponentMap.entrySet()) {
|
|
|
|
for (Map.Entry<String, JComponent> entry : propComponentMap.entrySet()) {
|
|
|
|
String key = entry.getKey();
|
|
|
|
String key = entry.getKey();
|
|
|
|
Object value = getComponentValue(entry.getValue());
|
|
|
|
Object value = getComponentValue(entry.getValue());
|
|
|
|
System.out.println("开始校验属性:"+key);
|
|
|
|
// System.out.println("开始校验属性:"+key);
|
|
|
|
if (key.contains("*")) {
|
|
|
|
if (key.contains("*")) {
|
|
|
|
System.out.println("属性【"+key+"】包含必选项!");
|
|
|
|
// System.out.println("属性【"+key+"】包含必选项!");
|
|
|
|
if (value == null || value.equals("")) {
|
|
|
|
if (value == null || value.equals("")) {
|
|
|
|
MessageBox.post("必填项属性【"+key+"】不可为空!" , "提示", MessageBox.INFORMATION);
|
|
|
|
MessageBox.post("必填项属性【"+key+"】不可为空!" , "提示", MessageBox.INFORMATION);
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
System.out.println(key + ": " + value);
|
|
|
|
System.out.println(">>>"+key + ": " + value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -330,6 +749,8 @@ public class CreateTempDrawingDialog extends JFrame implements ActionListener{
|
|
|
|
public JFrame buildDrawingObjTypeFrame() throws TCException{
|
|
|
|
public JFrame buildDrawingObjTypeFrame() throws TCException{
|
|
|
|
System.out.println("创建新图纸界面!");
|
|
|
|
System.out.println("创建新图纸界面!");
|
|
|
|
this.propComponentMap.clear();
|
|
|
|
this.propComponentMap.clear();
|
|
|
|
|
|
|
|
this.lovPropertyList.clear();
|
|
|
|
|
|
|
|
this.preferencePropList.clear();
|
|
|
|
|
|
|
|
|
|
|
|
// 创建新界面
|
|
|
|
// 创建新界面
|
|
|
|
JFrame frame = new JFrame();
|
|
|
|
JFrame frame = new JFrame();
|
|
|
@ -398,17 +819,29 @@ public class CreateTempDrawingDialog extends JFrame implements ActionListener{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String preferenceName = getSelectTypePreferenceName();
|
|
|
|
String preferenceName = getSelectTypePreferenceName();
|
|
|
|
System.out.println("preferenceName = " + preferenceName);
|
|
|
|
|
|
|
|
int propIndex = 2;
|
|
|
|
int propIndex = 2;
|
|
|
|
if (preferenceName != null){
|
|
|
|
if (preferenceName != null){
|
|
|
|
List<String> propList = getPreferenceInfos(preferenceName);
|
|
|
|
List<String> preferenceInfoList = getPreferenceInfos(preferenceName);
|
|
|
|
System.out.println("propList.size = "+propList.size());
|
|
|
|
if (preferenceInfoList != null && preferenceInfoList.size()>0) {
|
|
|
|
for(String propInfo : propList){//propInfo格式为:*有效期=Form.sb6_validuntil=date=Form.sb6_validuntil
|
|
|
|
System.out.println("获取首选项["+preferenceName+"]中的属性配置成功!");
|
|
|
|
|
|
|
|
this.preferencePropList = preferenceInfoList;
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
MessageBox.post("获取首选项"+preferenceName+"配置信息失败,请检查配置是否正确!" , "提示", MessageBox.INFORMATION);
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
System.out.println("配置的属性数量 = "+this.preferencePropList.size());
|
|
|
|
|
|
|
|
for(String propInfo : this.preferencePropList){//propInfo格式为:*名称=Item.object_name=string
|
|
|
|
|
|
|
|
System.out.println("开始处理首选项配置的属性信息:"+propInfo);
|
|
|
|
String[] propConfigInfoArray= propInfo.split("=");
|
|
|
|
String[] propConfigInfoArray= propInfo.split("=");
|
|
|
|
String validPropName = null;
|
|
|
|
String validPropName = null;
|
|
|
|
if (propConfigInfoArray.length >= 3){
|
|
|
|
if (propConfigInfoArray.length >= 3){
|
|
|
|
String name = propConfigInfoArray[0];
|
|
|
|
String name = propConfigInfoArray[0];//“图纸类型”
|
|
|
|
String type = propConfigInfoArray[2];
|
|
|
|
System.out.println("开始获取首选项配置属性["+name+"]的信息");
|
|
|
|
|
|
|
|
String[] locationAndTruePropName = propConfigInfoArray[1].split("\\.");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String trueName = locationAndTruePropName[1];//sb6_DRM03
|
|
|
|
|
|
|
|
String type = propConfigInfoArray[2];//“lov:SB6_TZLXLOV”
|
|
|
|
|
|
|
|
|
|
|
|
// prop Label
|
|
|
|
// prop Label
|
|
|
|
if (name != null && name.contains("*")){
|
|
|
|
if (name != null && name.contains("*")){
|
|
|
@ -427,7 +860,12 @@ public class CreateTempDrawingDialog extends JFrame implements ActionListener{
|
|
|
|
|
|
|
|
|
|
|
|
// prop value组件
|
|
|
|
// prop value组件
|
|
|
|
if (type != null){
|
|
|
|
if (type != null){
|
|
|
|
String typeValue = type.split(":")[0];
|
|
|
|
String[] ss = type.split(":");//{"lov","SB6_TZLXLOV"}
|
|
|
|
|
|
|
|
String lovName = null;
|
|
|
|
|
|
|
|
String typeValue = ss[0];
|
|
|
|
|
|
|
|
if (ss.length == 2) {
|
|
|
|
|
|
|
|
lovName = ss[1];
|
|
|
|
|
|
|
|
}
|
|
|
|
if (typeValue.equals("string")){
|
|
|
|
if (typeValue.equals("string")){
|
|
|
|
JTextField propTextField = new JTextField();
|
|
|
|
JTextField propTextField = new JTextField();
|
|
|
|
|
|
|
|
|
|
|
@ -458,9 +896,20 @@ public class CreateTempDrawingDialog extends JFrame implements ActionListener{
|
|
|
|
propComponentMap.put(validPropName, dateButton);
|
|
|
|
propComponentMap.put(validPropName, dateButton);
|
|
|
|
} else if (typeValue.equals("lov")) {
|
|
|
|
} else if (typeValue.equals("lov")) {
|
|
|
|
//TODO 根据冒号后面的LOV名称获取多个lov值,封装成数组添加到propComboBox中
|
|
|
|
//TODO 根据冒号后面的LOV名称获取多个lov值,封装成数组添加到propComboBox中
|
|
|
|
//TODO 文档中的继承属性来源又是个啥???
|
|
|
|
if (lovName == null) {
|
|
|
|
String[] lovs = {"lov1","lov2","lov3"};//模拟多个lov值
|
|
|
|
System.out.println("未获取到属性["+name+"]配置的lov名称,请检查配置!");
|
|
|
|
JComboBox<String> propComboBox = new JComboBox<String>(lovs);
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Map<String, String> lovMap = getLOVDisplay_value(tcSession, lovName);
|
|
|
|
|
|
|
|
String[] displayLovName = lovMap.keySet().toArray(new String[0]);//lov显示值
|
|
|
|
|
|
|
|
LovProperty lovProperty = new LovProperty();
|
|
|
|
|
|
|
|
lovProperty.setPropName(name);
|
|
|
|
|
|
|
|
lovProperty.setPropTrueName(trueName);
|
|
|
|
|
|
|
|
lovProperty.setLov(true);
|
|
|
|
|
|
|
|
lovProperty.setLovMap(lovMap);
|
|
|
|
|
|
|
|
this.lovPropertyList.add(lovProperty);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JComboBox<String> propComboBox = new JComboBox<String>(displayLovName);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GridBagConstraints gbcPropCombo = new GridBagConstraints();
|
|
|
|
GridBagConstraints gbcPropCombo = new GridBagConstraints();
|
|
|
@ -476,8 +925,12 @@ public class CreateTempDrawingDialog extends JFrame implements ActionListener{
|
|
|
|
propComponentMap.put(validPropName, propComboBox);
|
|
|
|
propComponentMap.put(validPropName, propComboBox);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
System.out.println("首选项中配置的属性["+name+"]信息中,未正确配置属性类型!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
propIndex ++;
|
|
|
|
propIndex ++;
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
System.out.println("首选项["+preferenceName+"]配置格式不正确,请检查!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else {
|
|
|
|
}else {
|
|
|
@ -531,7 +984,7 @@ public class CreateTempDrawingDialog extends JFrame implements ActionListener{
|
|
|
|
}else {{
|
|
|
|
}else {{
|
|
|
|
return null;//获取版本对象的ID失败
|
|
|
|
return null;//获取版本对象的ID失败
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
}else if (selectComponent instanceof TCComponentFolder) {
|
|
|
|
}else if (selectComponent2 instanceof TCComponentFolder) {
|
|
|
|
System.out.println("当前选中对象是文件夹对象,创建界面的ID属性值置空");
|
|
|
|
System.out.println("当前选中对象是文件夹对象,创建界面的ID属性值置空");
|
|
|
|
return "";
|
|
|
|
return "";
|
|
|
|
}else {
|
|
|
|
}else {
|
|
|
@ -551,5 +1004,29 @@ public class CreateTempDrawingDialog extends JFrame implements ActionListener{
|
|
|
|
return str.replaceAll("\\*", "");
|
|
|
|
return str.replaceAll("\\*", "");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 获得TC LOV值的显示值-真实值集合
|
|
|
|
|
|
|
|
* @param seesion
|
|
|
|
|
|
|
|
* @return
|
|
|
|
|
|
|
|
* @throws TCException
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public static Map<String, String> getLOVDisplay_value(TCSession seesion,String lovProp) throws TCException
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Map<String, String> Display_values = new HashMap<String, String>();
|
|
|
|
|
|
|
|
TCComponentListOfValues unitLov = TCLOVUtil.findLOVByName(seesion, lovProp);
|
|
|
|
|
|
|
|
if(unitLov !=null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ListOfValuesInfo listOfValues = unitLov.getListOfValues();
|
|
|
|
|
|
|
|
String[] realval = listOfValues.getStringListOfValues();
|
|
|
|
|
|
|
|
String value="";
|
|
|
|
|
|
|
|
boolean flag = false;
|
|
|
|
|
|
|
|
for (int i = 0; i < realval.length; i++) {
|
|
|
|
|
|
|
|
String disval = listOfValues.getDisplayableValue(realval[i]);
|
|
|
|
|
|
|
|
Display_values.put(disval, realval[i]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return Display_values;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|