|
|
@ -25,6 +25,7 @@ import javax.swing.JDialog;
|
|
|
|
import javax.xml.bind.JAXBException;
|
|
|
|
import javax.xml.bind.JAXBException;
|
|
|
|
import javax.xml.transform.Source;
|
|
|
|
import javax.xml.transform.Source;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.apache.log4j.Logger;
|
|
|
|
import org.eclipse.jface.dialogs.Dialog;
|
|
|
|
import org.eclipse.jface.dialogs.Dialog;
|
|
|
|
import org.eclipse.jface.dialogs.IDialogConstants;
|
|
|
|
import org.eclipse.jface.dialogs.IDialogConstants;
|
|
|
|
import org.eclipse.jface.viewers.TreeViewer;
|
|
|
|
import org.eclipse.jface.viewers.TreeViewer;
|
|
|
@ -134,6 +135,8 @@ import com.teamcenter.soaictstubs.booleanSeq_tHolder;
|
|
|
|
import com.teamcenter.soaictstubs.stringSeq_tHolder;
|
|
|
|
import com.teamcenter.soaictstubs.stringSeq_tHolder;
|
|
|
|
|
|
|
|
|
|
|
|
public class NewCodeItemDialog extends Dialog {
|
|
|
|
public class NewCodeItemDialog extends Dialog {
|
|
|
|
|
|
|
|
private static final Logger log = Logger.getLogger(NewCodeItemDialog.class);
|
|
|
|
|
|
|
|
|
|
|
|
//是否为文档
|
|
|
|
//是否为文档
|
|
|
|
private boolean isDoc = false;
|
|
|
|
private boolean isDoc = false;
|
|
|
|
private String leftMostCodeRuleNameString = "";//选中的编码规则名称
|
|
|
|
private String leftMostCodeRuleNameString = "";//选中的编码规则名称
|
|
|
@ -474,6 +477,7 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
* 绘制分类属性界面
|
|
|
|
* 绘制分类属性界面
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public void addClassPropComosite(String classID) {
|
|
|
|
public void addClassPropComosite(String classID) {
|
|
|
|
|
|
|
|
log.info("classID:"+classID);
|
|
|
|
System.out.println("classID:"+classID);
|
|
|
|
System.out.println("classID:"+classID);
|
|
|
|
cId = classID;
|
|
|
|
cId = classID;
|
|
|
|
// classPropComposite.dispose();
|
|
|
|
// classPropComposite.dispose();
|
|
|
@ -522,9 +526,9 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
classLabelList.add(label);
|
|
|
|
classLabelList.add(label);
|
|
|
|
Widget widget = null;
|
|
|
|
Widget widget = null;
|
|
|
|
if (!bean.isLov) {
|
|
|
|
if (!bean.isLov) {
|
|
|
|
// System.out.println(ICSFormat.STRING +
|
|
|
|
// log.info(ICSFormat.STRING +
|
|
|
|
// "|"+ICSFormat.INTEGER +"|"+ICSFormat.REAL);
|
|
|
|
// "|"+ICSFormat.INTEGER +"|"+ICSFormat.REAL);
|
|
|
|
// System.out.println(bean.formate
|
|
|
|
// log.info(bean.formate
|
|
|
|
// +" | "+bean.propDisName +" | " + bean.attrType );
|
|
|
|
// +" | "+bean.propDisName +" | " + bean.attrType );
|
|
|
|
if (bean.attrType == ICSFormat.STRING) {
|
|
|
|
if (bean.attrType == ICSFormat.STRING) {
|
|
|
|
|
|
|
|
|
|
|
@ -648,6 +652,7 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
* 新建的 UI 组件-Label放在objPropComposite下,内容组件根据类型创建后放在
|
|
|
|
* 新建的 UI 组件-Label放在objPropComposite下,内容组件根据类型创建后放在
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public void addGeneralPropComosite() {
|
|
|
|
public void addGeneralPropComosite() {
|
|
|
|
|
|
|
|
log.info("addGeneralPropComosite");
|
|
|
|
System.out.println("addGeneralPropComosite");
|
|
|
|
System.out.println("addGeneralPropComosite");
|
|
|
|
boolean isDocType = false;//当前属性名称是否为文档类型?
|
|
|
|
boolean isDocType = false;//当前属性名称是否为文档类型?
|
|
|
|
for (int i = 0; i < generalPropLabelList.size(); i++) {
|
|
|
|
for (int i = 0; i < generalPropLabelList.size(); i++) {
|
|
|
@ -663,8 +668,12 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
for (CNProperty cnProp : this.cnpropList) {
|
|
|
|
for (CNProperty cnProp : this.cnpropList) {
|
|
|
|
//20250425新增 将最左侧选中的编码规则名称写入到最右侧的文档类别中
|
|
|
|
//20250425新增 将最左侧选中的编码规则名称写入到最右侧的文档类别中
|
|
|
|
String currentPropName = cnProp.getDisplayName();//当前遍历的对象or分类属性名称
|
|
|
|
String currentPropName = cnProp.getDisplayName();//当前遍历的对象or分类属性名称
|
|
|
|
|
|
|
|
log.info("当前创建的UI组件Label名称="+currentPropName);
|
|
|
|
|
|
|
|
log.info("即将写入“文档类别”组件的值="+docTypeValue);
|
|
|
|
System.out.println("当前创建的UI组件Label名称="+currentPropName);
|
|
|
|
System.out.println("当前创建的UI组件Label名称="+currentPropName);
|
|
|
|
|
|
|
|
System.out.println("即将写入“文档类别”组件的值="+docTypeValue);
|
|
|
|
if(currentPropName != null && currentPropName.equals("文档类别") && docTypeValue != null && !docTypeValue.equals("")){
|
|
|
|
if(currentPropName != null && currentPropName.equals("文档类别") && docTypeValue != null && !docTypeValue.equals("")){
|
|
|
|
|
|
|
|
log.info("“文档类别”匹配成功!属性值设置为最左侧选中编码名称="+docTypeValue);
|
|
|
|
System.out.println("“文档类别”匹配成功!属性值设置为最左侧选中编码名称="+docTypeValue);
|
|
|
|
System.out.println("“文档类别”匹配成功!属性值设置为最左侧选中编码名称="+docTypeValue);
|
|
|
|
isDocType = true;
|
|
|
|
isDocType = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -801,9 +810,10 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
isDocType = false;
|
|
|
|
generalPropTextList.add(widget);
|
|
|
|
generalPropTextList.add(widget);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
docTypeValue = "";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
objPropComposite.update();
|
|
|
|
objPropComposite.update();
|
|
|
|
objPropComposite.layout();
|
|
|
|
objPropComposite.layout();
|
|
|
@ -1007,7 +1017,7 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
TCComponentItemRevision rev = item.getLatestItemRevision();
|
|
|
|
TCComponentItemRevision rev = item.getLatestItemRevision();
|
|
|
|
List<ClassProperty> propList = new ArrayList<>();
|
|
|
|
List<ClassProperty> propList = new ArrayList<>();
|
|
|
|
for (int i = 0; i < classPropList.size(); i++) {
|
|
|
|
for (int i = 0; i < classPropList.size(); i++) {
|
|
|
|
// System.out.println(" CLASS ID = " + integers[i] + " =" +
|
|
|
|
// log.info(" CLASS ID = " + integers[i] + " =" +
|
|
|
|
// vals[i]);
|
|
|
|
// vals[i]);
|
|
|
|
CNClassPropBean bean = classPropList.get(i);
|
|
|
|
CNClassPropBean bean = classPropList.get(i);
|
|
|
|
String value = "";
|
|
|
|
String value = "";
|
|
|
@ -1054,7 +1064,7 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
ICSProperty icspro[] = new ICSProperty[classPropList.size()];
|
|
|
|
ICSProperty icspro[] = new ICSProperty[classPropList.size()];
|
|
|
|
// 设置分类属性
|
|
|
|
// 设置分类属性
|
|
|
|
for (int i = 0; i < icspro.length; i++) {
|
|
|
|
for (int i = 0; i < icspro.length; i++) {
|
|
|
|
// System.out.println(" CLASS ID = " + integers[i] + " =" +
|
|
|
|
// log.info(" CLASS ID = " + integers[i] + " =" +
|
|
|
|
// vals[i]);
|
|
|
|
// vals[i]);
|
|
|
|
CNClassPropBean bean = classPropList.get(i);
|
|
|
|
CNClassPropBean bean = classPropList.get(i);
|
|
|
|
String value = "";
|
|
|
|
String value = "";
|
|
|
@ -1211,7 +1221,7 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
// Dimension srcDim = Toolkit.getDefaultToolkit().getScreenSize();
|
|
|
|
// Dimension srcDim = Toolkit.getDefaultToolkit().getScreenSize();
|
|
|
|
// container1.getShell().setSize(srcDim.width, srcDim.height);
|
|
|
|
// container1.getShell().setSize(srcDim.width, srcDim.height);
|
|
|
|
// Point p =container1.getShell().getSize();
|
|
|
|
// Point p =container1.getShell().getSize();
|
|
|
|
// System.out.println("");
|
|
|
|
// log.info("");
|
|
|
|
// MessageBox.post(p.x+"|"+p.y,"P",1);
|
|
|
|
// MessageBox.post(p.x+"|"+p.y,"P",1);
|
|
|
|
return container;
|
|
|
|
return container;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1222,7 +1232,7 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
// if(item.getItemCount()>0){
|
|
|
|
// if(item.getItemCount()>0){
|
|
|
|
// childItem= getLastChild(item.getItem(0));
|
|
|
|
// childItem= getLastChild(item.getItem(0));
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// System.out.println("i am in getLastChild "+childItem.getText());
|
|
|
|
// log.info("i am in getLastChild "+childItem.getText());
|
|
|
|
// return childItem
|
|
|
|
// return childItem
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
@ -1407,13 +1417,6 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
DescText = CreateCompositeUtil.createTextArea(composite, "", 1, 300);
|
|
|
|
DescText = CreateCompositeUtil.createTextArea(composite, "", 1, 300);
|
|
|
|
DescText.setVisible(false);
|
|
|
|
DescText.setVisible(false);
|
|
|
|
|
|
|
|
|
|
|
|
// 进行扩展
|
|
|
|
|
|
|
|
// CreateCompositeUtil.createNewLabel(objPropComposite, "属性");
|
|
|
|
|
|
|
|
// 修改 20170626
|
|
|
|
|
|
|
|
// propTable = CreateCompositeUtil.createNewTable(objPropComposite, "",
|
|
|
|
|
|
|
|
// 170, 230);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// idText.setEnabled(false);
|
|
|
|
|
|
|
|
idLengthText.setEnabled(false);
|
|
|
|
idLengthText.setEnabled(false);
|
|
|
|
revText.setEnabled(false);
|
|
|
|
revText.setEnabled(false);
|
|
|
|
DescText.setEnabled(false);
|
|
|
|
DescText.setEnabled(false);
|
|
|
@ -1557,7 +1560,7 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// System.out.println("---->>>>>>> selectedSegmentNode
|
|
|
|
// log.info("---->>>>>>> selectedSegmentNode
|
|
|
|
// =111>"+selectedSegmentNode.getParentTreeData().getPackCodeNodeInfo());
|
|
|
|
// =111>"+selectedSegmentNode.getParentTreeData().getPackCodeNodeInfo());
|
|
|
|
getParentGroupNode(selectedSegmentNode);
|
|
|
|
getParentGroupNode(selectedSegmentNode);
|
|
|
|
selectedSegmentTCComponent = selectedSegmentNode.getPackCodeNodeInfo().getNodeComponent();
|
|
|
|
selectedSegmentTCComponent = selectedSegmentNode.getPackCodeNodeInfo().getNodeComponent();
|
|
|
@ -1569,9 +1572,10 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
|
|
|
|
|
|
|
|
if (selectedSegmentNode.getParentTreeData() != null) {
|
|
|
|
if (selectedSegmentNode.getParentTreeData() != null) {
|
|
|
|
//打印选中的编码分类名称
|
|
|
|
//打印选中的编码分类名称
|
|
|
|
|
|
|
|
log.info("LP RuleName>>>" + selectedSegmentNode.getPackCodeNodeInfo().rule_node);
|
|
|
|
System.out.println("LP RuleName>>>" + selectedSegmentNode.getPackCodeNodeInfo().rule_node);
|
|
|
|
System.out.println("LP RuleName>>>" + selectedSegmentNode.getPackCodeNodeInfo().rule_node);
|
|
|
|
connor_CurrentTypeNameString = selectedSegmentNode.getPackCodeNodeInfo().rule_node;
|
|
|
|
connor_CurrentTypeNameString = selectedSegmentNode.getPackCodeNodeInfo().rule_node;
|
|
|
|
// System.out.println("---->>>>>>> selectedSegmentNode
|
|
|
|
// log.info("---->>>>>>> selectedSegmentNode
|
|
|
|
// =222>"+selectedSegmentNode.getPackCodeNodeInfo().rule_node);
|
|
|
|
// =222>"+selectedSegmentNode.getPackCodeNodeInfo().rule_node);
|
|
|
|
if ("电子件".equals(selectedSegmentNode.getPackCodeNodeInfo().rule_node) && (isCanTeam != null)
|
|
|
|
if ("电子件".equals(selectedSegmentNode.getPackCodeNodeInfo().rule_node) && (isCanTeam != null)
|
|
|
|
&& (isCanTeam.trim().length() > 0) && isCanTeam.toLowerCase().equals("true")) {
|
|
|
|
&& (isCanTeam.trim().length() > 0) && isCanTeam.toLowerCase().equals("true")) {
|
|
|
@ -1616,8 +1620,9 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
if ((realType != null) && (realType.length() > 0)) {
|
|
|
|
if ((realType != null) && (realType.length() > 0)) {
|
|
|
|
tccomponentitemtype = (TCComponentItemType) (session.getTypeComponent(realType));
|
|
|
|
tccomponentitemtype = (TCComponentItemType) (session.getTypeComponent(realType));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// System.out.println("类型 realType = "+realType);
|
|
|
|
// log.info("类型 realType = "+realType);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
log.info("选中节点="+selectedSegmentNode.getPackCodeNodeInfo().getNode_name());
|
|
|
|
System.out.println("选中节点="+selectedSegmentNode.getPackCodeNodeInfo().getNode_name());
|
|
|
|
System.out.println("选中节点="+selectedSegmentNode.getPackCodeNodeInfo().getNode_name());
|
|
|
|
//选中“编码分类”下的节点对象-selectedSegmentNode.getPackCodeNodeInfo()
|
|
|
|
//选中“编码分类”下的节点对象-selectedSegmentNode.getPackCodeNodeInfo()
|
|
|
|
if (selectedSegmentNode.getPackCodeNodeInfo().getNode_type()
|
|
|
|
if (selectedSegmentNode.getPackCodeNodeInfo().getNode_type()
|
|
|
@ -1645,6 +1650,10 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
if (selectedData == null) {
|
|
|
|
if (selectedData == null) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
log.info("---->>>>>>> 编码树选中对象 =" + selectedData.getPackCodeNodeInfo().getNode_name());
|
|
|
|
|
|
|
|
log.info("type = "+ selectedData.getPackCodeNodeInfo().getNode_type());
|
|
|
|
|
|
|
|
log.info("value = "+ selectedData.getPackCodeNodeInfo().getNode_value());
|
|
|
|
|
|
|
|
log.info("desc = "+ selectedData.getPackCodeNodeInfo().getNode_desc());
|
|
|
|
System.out.println("---->>>>>>> 编码树选中对象 =" + selectedData.getPackCodeNodeInfo().getNode_name());
|
|
|
|
System.out.println("---->>>>>>> 编码树选中对象 =" + selectedData.getPackCodeNodeInfo().getNode_name());
|
|
|
|
System.out.println("type = "+ selectedData.getPackCodeNodeInfo().getNode_type());
|
|
|
|
System.out.println("type = "+ selectedData.getPackCodeNodeInfo().getNode_type());
|
|
|
|
System.out.println("value = "+ selectedData.getPackCodeNodeInfo().getNode_value());
|
|
|
|
System.out.println("value = "+ selectedData.getPackCodeNodeInfo().getNode_value());
|
|
|
@ -1661,12 +1670,15 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
* 选择分类的时候,需要选中最底层才允许创建
|
|
|
|
* 选择分类的时候,需要选中最底层才允许创建
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
if(selectedData.getChildrenTreeData() != null && selectedData.getChildrenTreeData().length>0) {
|
|
|
|
if(selectedData.getChildrenTreeData() != null && selectedData.getChildrenTreeData().length>0) {
|
|
|
|
System.out.println("不是最底层");
|
|
|
|
log.info("不是最底层");
|
|
|
|
|
|
|
|
System.out.println("不是最底层");
|
|
|
|
btFlg = true;
|
|
|
|
btFlg = true;
|
|
|
|
System.out.println("》》》nodeName:"+selectedData.getPackCodeNodeInfo().getNode_name());
|
|
|
|
log.info("》》》nodeName:"+selectedData.getPackCodeNodeInfo().getNode_name());
|
|
|
|
|
|
|
|
System.out.println("》》》nodeName:"+selectedData.getPackCodeNodeInfo().getNode_name());
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}else {
|
|
|
|
}else {
|
|
|
|
System.out.println("是最底层");
|
|
|
|
log.info("是最底层");
|
|
|
|
|
|
|
|
System.out.println("是最底层");
|
|
|
|
btFlg = false;
|
|
|
|
btFlg = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String currentNodeDesc = "";
|
|
|
|
String currentNodeDesc = "";
|
|
|
@ -1675,41 +1687,54 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
// 得到编码相关信息
|
|
|
|
// 得到编码相关信息
|
|
|
|
getCodeInfo(selectedData);
|
|
|
|
getCodeInfo(selectedData);
|
|
|
|
//KUMA 根据得到的编码信息,假设得到创建对象的类型为文档
|
|
|
|
//KUMA 根据得到的编码信息,假设得到创建对象的类型为文档
|
|
|
|
|
|
|
|
System.out.println("begin panduan!");
|
|
|
|
if(isDoc){//如果创建对象是文档,
|
|
|
|
if(isDoc){//如果创建对象是文档,
|
|
|
|
//1.获取最左侧区域选中的的编码规则名称
|
|
|
|
//1.获取最左侧区域选中的的编码规则名称
|
|
|
|
|
|
|
|
log.info("当前新建对象类型为“文档”");
|
|
|
|
System.out.println("当前新建对象类型为“文档”");
|
|
|
|
System.out.println("当前新建对象类型为“文档”");
|
|
|
|
AbstractTreeData leftTreeData = selectedData.getParentTreeData();
|
|
|
|
AbstractTreeData leftTreeData = selectedData.getParentTreeData();
|
|
|
|
if (leftTreeData != null) {
|
|
|
|
if (leftTreeData != null) {
|
|
|
|
leftMostCodeRuleNameString = leftTreeData.getPackCodeNodeInfo().getNode_name();
|
|
|
|
leftMostCodeRuleNameString = leftTreeData.getPackCodeNodeInfo().getNode_name();
|
|
|
|
//获取首选项SB6_AutoCode_SetDocType中的值
|
|
|
|
//获取首选项SB6_AutoCode_SetDocType中的值
|
|
|
|
String[] autocodeTypes = session.getPreferenceService().getStringValues("SB6_AutoCode_SetDocType");
|
|
|
|
String[] autocodeTypes = session.getPreferenceService().getStringValues("SB6_AutoCode_SetDocType");
|
|
|
|
if (autocodeTypes.length <= 0) {
|
|
|
|
if (autocodeTypes != null){
|
|
|
|
System.out.println("获取首选项SB6_AutoCode_SetDocType的信息获取失败,请检查配置!");
|
|
|
|
if (autocodeTypes.length <= 0) {
|
|
|
|
return;
|
|
|
|
log.info("获取首选项SB6_AutoCode_SetDocType的信息获取失败,请检查配置!");
|
|
|
|
}else {
|
|
|
|
System.out.println("获取首选项SB6_AutoCode_SetDocType的信息获取失败,请检查配置!");
|
|
|
|
for (int i = 0; i < autocodeTypes.length; i++) {
|
|
|
|
return;
|
|
|
|
String autocodeType = autocodeTypes[i];//key=value
|
|
|
|
}else {
|
|
|
|
int index = autocodeType.indexOf('=');
|
|
|
|
for (int i = 0; i < autocodeTypes.length; i++) {
|
|
|
|
if (index != -1) {
|
|
|
|
String autocodeType = autocodeTypes[i];//key=value
|
|
|
|
String firstPart = autocodeType.substring(0, index);
|
|
|
|
int index = autocodeType.indexOf('=');
|
|
|
|
String secondPart = autocodeType.substring(index + 1);
|
|
|
|
if (index != -1) {
|
|
|
|
System.out.println("第一部分: " + firstPart);
|
|
|
|
String firstPart = autocodeType.substring(0, index);
|
|
|
|
System.out.println("第二部分: " + secondPart);
|
|
|
|
String secondPart = autocodeType.substring(index + 1);
|
|
|
|
if (firstPart.equals(leftMostCodeRuleNameString)) {
|
|
|
|
log.info("第一部分: " + firstPart);
|
|
|
|
//将此secondPart赋值给全局变量docTypeValue,将在addGeneralPropComosite中填入最右侧区域中的属性“文档类别”下
|
|
|
|
log.info("第二部分: " + secondPart);
|
|
|
|
docTypeValue = secondPart;
|
|
|
|
System.out.println("第一部分: " + firstPart);
|
|
|
|
break;
|
|
|
|
System.out.println("第二部分: " + secondPart);
|
|
|
|
}else {
|
|
|
|
System.out.println("leftMostCodeRuleNameString:"+leftMostCodeRuleNameString);
|
|
|
|
continue;
|
|
|
|
if (firstPart.equals(leftMostCodeRuleNameString)) {
|
|
|
|
|
|
|
|
//将此secondPart赋值给全局变量docTypeValue,将在addGeneralPropComosite中填入最右侧区域中的属性“文档类别”下
|
|
|
|
|
|
|
|
docTypeValue = secondPart;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
log.info("字符串中未找到 = 符号。");
|
|
|
|
|
|
|
|
System.out.println("字符串中未找到 = 符号。");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
|
|
|
|
System.out.println("字符串中未找到 = 符号。");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
System.out.println("获取首选项SB6_AutoCode_SetDocType的信息获取失败,请检查配置!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
log.info(">>>>>>>><<<<<<<");
|
|
|
|
System.out.println(">>>>>>>><<<<<<<");
|
|
|
|
System.out.println(">>>>>>>><<<<<<<");
|
|
|
|
getClassANDPropertyInfo(selectedData);
|
|
|
|
getClassANDPropertyInfo(selectedData);
|
|
|
|
//这是编码树视图中选中的节点对象的名称,用来渲染到新建对象的“名称”属性上
|
|
|
|
//这是编码树视图中选中的节点对象的名称,用来渲染到新建对象的“名称”属性上
|
|
|
@ -1720,6 +1745,7 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
LPBIGString = "";
|
|
|
|
LPBIGString = "";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
log.info("LPBIGString="+LPBIGString);
|
|
|
|
System.out.println("LPBIGString="+LPBIGString);
|
|
|
|
System.out.println("LPBIGString="+LPBIGString);
|
|
|
|
LPSString = selectedData.getPackCodeNodeInfo().getNode_name();
|
|
|
|
LPSString = selectedData.getPackCodeNodeInfo().getNode_name();
|
|
|
|
currentNodeValue = replaceSpecialValue(selectedData.getPackCodeNodeInfo().node_value);
|
|
|
|
currentNodeValue = replaceSpecialValue(selectedData.getPackCodeNodeInfo().node_value);
|
|
|
@ -1748,11 +1774,6 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
idLengthText.setText(String.valueOf(idText.getText().replace(" ", "").trim().length()));
|
|
|
|
idLengthText.setText(String.valueOf(idText.getText().replace(" ", "").trim().length()));
|
|
|
|
DescText.setText(codeDesc);
|
|
|
|
DescText.setText(codeDesc);
|
|
|
|
setMidComposite();
|
|
|
|
setMidComposite();
|
|
|
|
// String msg =
|
|
|
|
|
|
|
|
// selectedData.getPackCodeNodeInfo().getRealTypeName();
|
|
|
|
|
|
|
|
// MessageBox.post("Info
|
|
|
|
|
|
|
|
// =
|
|
|
|
|
|
|
|
// >"+msg,"INFO",MessageBox.ERROR);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -1947,18 +1968,45 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
//判断当前新建对象是否属于“文档”这一类别
|
|
|
|
//判断当前新建对象是否属于“文档”这一类别
|
|
|
|
String nodeNameCurrent = treeData.getPackCodeNodeInfo().getNode_name();
|
|
|
|
String nodeNameCurrent = treeData.getPackCodeNodeInfo().getNode_name();
|
|
|
|
String nodetypeCurrent = treeData.getPackCodeNodeInfo().getNode_type();
|
|
|
|
String nodetypeCurrent = treeData.getPackCodeNodeInfo().getNode_type();
|
|
|
|
|
|
|
|
log.info("当前节点【"+nodeNameCurrent+"】属于【"+nodetypeCurrent+"】类别");
|
|
|
|
System.out.println("当前节点【"+nodeNameCurrent+"】属于【"+nodetypeCurrent+"】类别");
|
|
|
|
System.out.println("当前节点【"+nodeNameCurrent+"】属于【"+nodetypeCurrent+"】类别");
|
|
|
|
if (nodeNameCurrent.contains("文档")){
|
|
|
|
if (nodeNameCurrent.contains("文档")){
|
|
|
|
|
|
|
|
log.info("当前节点属于【文档】类别");
|
|
|
|
System.out.println("当前节点属于【文档】类别");
|
|
|
|
System.out.println("当前节点属于【文档】类别");
|
|
|
|
isDoc = true;
|
|
|
|
isDoc = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AbstractTreeData parentData = treeData.getParentTreeData();
|
|
|
|
AbstractTreeData parentData = treeData.getParentTreeData();
|
|
|
|
|
|
|
|
if (parentData != null){
|
|
|
|
|
|
|
|
log.info("parentData != null");
|
|
|
|
|
|
|
|
System.out.println("parentData != null");
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
log.info("parentData == null");
|
|
|
|
|
|
|
|
System.out.println("parentData == null");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (parentData.getParentTreeData() != null) {
|
|
|
|
|
|
|
|
String node_namesss = parentData.getParentTreeData().packCodeNodeInfo.getNode_name();
|
|
|
|
|
|
|
|
if (node_namesss != null && node_namesss.contains("文档")){
|
|
|
|
|
|
|
|
isDoc = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
System.out.println("node_namesss="+node_namesss);
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
System.out.println("node_namesss获取失败");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (parentData.getPackCodeNodeInfo().getNodeComponent() != null){
|
|
|
|
|
|
|
|
log.info("parentData.getPackCodeNodeInfo().getNodeComponent() != null");
|
|
|
|
|
|
|
|
System.out.println("parentData.getPackCodeNodeInfo().getNodeComponent() != null");
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
log.info("parentData.getPackCodeNodeInfo().getNodeComponent() == null");
|
|
|
|
|
|
|
|
System.out.println("parentData.getPackCodeNodeInfo().getNodeComponent() == null");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ((parentData != null) && (parentData.getPackCodeNodeInfo().getNodeComponent() != null)) {
|
|
|
|
if ((parentData != null) && (parentData.getPackCodeNodeInfo().getNodeComponent() != null)) {
|
|
|
|
parentType = parentData.getPackCodeNodeInfo().getNode_type();
|
|
|
|
parentType = parentData.getPackCodeNodeInfo().getNode_type();
|
|
|
|
parentName = parentData.getPackCodeNodeInfo().getNode_name();
|
|
|
|
parentName = parentData.getPackCodeNodeInfo().getNode_name();
|
|
|
|
|
|
|
|
log.info("编码树视图中选中节点的父节点 parentData = " + parentName+"\n type="+parentType);
|
|
|
|
System.out.println("编码树视图中选中节点的父节点 parentData = " + parentName+"\n type="+parentType);
|
|
|
|
System.out.println("编码树视图中选中节点的父节点 parentData = " + parentName+"\n type="+parentType);
|
|
|
|
getCodeInfo(parentData);
|
|
|
|
getCodeInfo(parentData);
|
|
|
|
String nodeValue = "";
|
|
|
|
String nodeValue = "";
|
|
|
@ -1976,13 +2024,15 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
codeDesc = codeDesc + "\n";
|
|
|
|
codeDesc = codeDesc + "\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
System.out.println("node_desc ===>" + treeData.getPackCodeNodeInfo().getNode_desc());
|
|
|
|
log.info("node_desc ===>" + treeData.getPackCodeNodeInfo().getNode_desc());
|
|
|
|
System.out.println("编码描述 codeDesc = "+codeDesc);
|
|
|
|
log.info("编码描述 codeDesc = "+codeDesc);
|
|
|
|
|
|
|
|
System.out.println("编码描述 ===>" + codeDesc);
|
|
|
|
}else {
|
|
|
|
}else {
|
|
|
|
originFatherData = treeData;
|
|
|
|
originFatherData = treeData;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (originFatherData != null) {
|
|
|
|
if (originFatherData != null) {
|
|
|
|
|
|
|
|
log.info("编码树视图选中对象的始祖对象="+originFatherData.getPackCodeNodeInfo().getNode_name()+"\n 类型="+originFatherData.getPackCodeNodeInfo().getNode_type());
|
|
|
|
System.out.println("编码树视图选中对象的始祖对象="+originFatherData.getPackCodeNodeInfo().getNode_name()+"\n 类型="+originFatherData.getPackCodeNodeInfo().getNode_type());
|
|
|
|
System.out.println("编码树视图选中对象的始祖对象="+originFatherData.getPackCodeNodeInfo().getNode_name()+"\n 类型="+originFatherData.getPackCodeNodeInfo().getNode_type());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -2695,7 +2745,7 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
if (prop == null) {
|
|
|
|
if (prop == null) {
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// System.out.println(
|
|
|
|
// log.info(
|
|
|
|
// "PROP MAP >>>>"+prop.getRealName()+"<===>"+prop.value);
|
|
|
|
// "PROP MAP >>>>"+prop.getRealName()+"<===>"+prop.value);
|
|
|
|
switch (prop.getPropertyType().toUpperCase()) {
|
|
|
|
switch (prop.getPropertyType().toUpperCase()) {
|
|
|
|
case "STRING":
|
|
|
|
case "STRING":
|
|
|
@ -2830,8 +2880,8 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 通过SOA创建对象
|
|
|
|
* 通过SOA创建对象
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param itemID
|
|
|
|
* @param itemID 特征码
|
|
|
|
* @param itemRev
|
|
|
|
* @param itemRev 版本输入框中的内容
|
|
|
|
* @param itemType
|
|
|
|
* @param itemType
|
|
|
|
* @param itemName
|
|
|
|
* @param itemName
|
|
|
|
* @param itemDesc
|
|
|
|
* @param itemDesc
|
|
|
@ -3172,7 +3222,7 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
// String[] split = string.split("=");
|
|
|
|
// String[] split = string.split("=");
|
|
|
|
// if (split.length == 3 && type.equals(split[0])) {
|
|
|
|
// if (split.length == 3 && type.equals(split[0])) {
|
|
|
|
// if(split[1].contains(".") && split[1].contains(":")) {
|
|
|
|
// if(split[1].contains(".") && split[1].contains(":")) {
|
|
|
|
// System.out.println("开始比较=====================");
|
|
|
|
// log.info("开始比较=====================");
|
|
|
|
// String[] center = split[1].split(":");
|
|
|
|
// String[] center = split[1].split(":");
|
|
|
|
// String[] split2 = center[0].split("\\.");
|
|
|
|
// String[] split2 = center[0].split("\\.");
|
|
|
|
// String preName = split2[1];
|
|
|
|
// String preName = split2[1];
|
|
|
@ -3189,7 +3239,7 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// if(centerCom != null) {
|
|
|
|
// if(centerCom != null) {
|
|
|
|
// String preValue = centerCom.getTCProperty(preName).getDisplayableValue();
|
|
|
|
// String preValue = centerCom.getTCProperty(preName).getDisplayableValue();
|
|
|
|
// System.out.println("得到的值为:========" + preValue);
|
|
|
|
// log.info("得到的值为:========" + preValue);
|
|
|
|
// if (center[1].equals(preValue)) {
|
|
|
|
// if (center[1].equals(preValue)) {
|
|
|
|
// TCComponent[] search = session.search("零组件 ID", new String[] {"零组件 ID"}, new String[] {split[2]});
|
|
|
|
// TCComponent[] search = session.search("零组件 ID", new String[] {"零组件 ID"}, new String[] {split[2]});
|
|
|
|
// TCComponentItemRevision modelRev = null;
|
|
|
|
// TCComponentItemRevision modelRev = null;
|
|
|
@ -3246,30 +3296,49 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
rev = ((TCComponentItem) newComp).getLatestItemRevision();
|
|
|
|
rev = ((TCComponentItem) newComp).getLatestItemRevision();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
System.out.println("开始挂载对象ID=【" + leftMostCodeRuleNameString+"】的数据集模板到新建对象下");
|
|
|
|
if (leftMostCodeRuleNameString != null && !leftMostCodeRuleNameString.isEmpty()){
|
|
|
|
if (leftMostCodeRuleNameString != null && !leftMostCodeRuleNameString.isEmpty()){
|
|
|
|
//1.KUMA 调用查询,获取版本对象,下载数据集到本地
|
|
|
|
//1.KUMA 调用查询,获取版本对象,下载数据集到本地
|
|
|
|
TCComponent[] searchs = session.search("零组件 ID",
|
|
|
|
TCComponent[] searchs = session.search("零组件 ID",
|
|
|
|
new String[] { "零组件 ID"},
|
|
|
|
new String[] { "零组件 ID"},
|
|
|
|
new String[] { leftMostCodeRuleNameString});
|
|
|
|
new String[] { leftMostCodeRuleNameString});
|
|
|
|
if (searchs.length > 0){
|
|
|
|
if (searchs.length > 0){
|
|
|
|
if (searchs[0] instanceof TCComponentItemRevision){
|
|
|
|
TCComponent component = searchs[0];
|
|
|
|
TCComponentItemRevision itemRevision = (TCComponentItemRevision) searchs[0];
|
|
|
|
TCComponentItemRevision componentItemRevision = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (component instanceof TCComponentItem){
|
|
|
|
|
|
|
|
componentItemRevision = ((TCComponentItem) component).getLatestItemRevision();
|
|
|
|
|
|
|
|
}else if (component instanceof TCComponentItemRevision) {
|
|
|
|
|
|
|
|
componentItemRevision = (TCComponentItemRevision) component;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (componentItemRevision != null) {
|
|
|
|
|
|
|
|
System.out.println("检索到的对象是版本对象,开始获取‘规范’关系下的数据集");
|
|
|
|
|
|
|
|
// TCComponentItemRevision itemRevision = (TCComponentItemRevision) searchs[0];
|
|
|
|
//将查询到的版本对象的"规范"关系下的数据集
|
|
|
|
//将查询到的版本对象的"规范"关系下的数据集
|
|
|
|
TCComponent[] referenceListProperty = itemRevision.getReferenceListProperty("IMAN_specification");
|
|
|
|
TCComponent[] referenceListProperty = componentItemRevision.getReferenceListProperty("IMAN_specification");
|
|
|
|
if (referenceListProperty != null && referenceListProperty.length > 0){
|
|
|
|
if (referenceListProperty != null && referenceListProperty.length > 0){
|
|
|
|
for (TCComponent tcComponent : referenceListProperty){
|
|
|
|
for (TCComponent tcComponent : referenceListProperty){
|
|
|
|
if (tcComponent instanceof TCComponentDataset) {
|
|
|
|
if (tcComponent instanceof TCComponentDataset) {
|
|
|
|
|
|
|
|
System.out.println("1");
|
|
|
|
TCComponentDataset dataset_old = (TCComponentDataset) tcComponent;
|
|
|
|
TCComponentDataset dataset_old = (TCComponentDataset) tcComponent;
|
|
|
|
|
|
|
|
System.out.println("2");
|
|
|
|
TCComponentDataset dataset_new = dataset_old.saveAs(null);
|
|
|
|
TCComponentDataset dataset_new = dataset_old.saveAs(null);
|
|
|
|
|
|
|
|
System.out.println("3");
|
|
|
|
//2.将数据集上传到新建版本对象中
|
|
|
|
//2.将数据集上传到新建版本对象中
|
|
|
|
rev.add("IMAN_specification", dataset_new);
|
|
|
|
rev.add("IMAN_specification", dataset_new);
|
|
|
|
|
|
|
|
rev.save();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
System.out.println("检索到的ID=【"+leftMostCodeRuleNameString+"】的版本对象下没有‘规范’关系下的数据集");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
System.out.println("检索到的ID=【"+leftMostCodeRuleNameString+"】的对象既不是Item对象也不是Rev对象!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
System.out.println("检索不到ID=【"+leftMostCodeRuleNameString+"】的对象");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -3325,6 +3394,7 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
Combo[] propCombos = listView.getPropertyComb();
|
|
|
|
Combo[] propCombos = listView.getPropertyComb();
|
|
|
|
Label[] propLabels = listView.getPropertyLabel();
|
|
|
|
Label[] propLabels = listView.getPropertyLabel();
|
|
|
|
List<PackCodeNodeInfo> lp_packCodeNodeInfos = listView.lp_packCodeNodeInfos;
|
|
|
|
List<PackCodeNodeInfo> lp_packCodeNodeInfos = listView.lp_packCodeNodeInfos;
|
|
|
|
|
|
|
|
|
|
|
|
if ((propCombos != null) && (propCombos.length > 0)) {
|
|
|
|
if ((propCombos != null) && (propCombos.length > 0)) {
|
|
|
|
for (int i = 0; i < propCombos.length; i++) {
|
|
|
|
for (int i = 0; i < propCombos.length; i++) {
|
|
|
|
if (propLabels[i].getText().equals("文件类型:")) {
|
|
|
|
if (propLabels[i].getText().equals("文件类型:")) {
|
|
|
|