|
|
@ -108,6 +108,7 @@ import cn.com.origin.autocode.jfom.util.JFomLovBean;
|
|
|
|
import cn.com.origin.autocode.jfom.util.JFomMethodUtil;
|
|
|
|
import cn.com.origin.autocode.jfom.util.JFomMethodUtil;
|
|
|
|
import cn.com.origin.autocode.jfom.util.JFomUtil;
|
|
|
|
import cn.com.origin.autocode.jfom.util.JFomUtil;
|
|
|
|
import cn.com.origin.autocode.jfom.util.SoaServerUtil;
|
|
|
|
import cn.com.origin.autocode.jfom.util.SoaServerUtil;
|
|
|
|
|
|
|
|
import cn.com.origin.autocode.jfom.util.TCTableUtil;
|
|
|
|
import cn.com.origin.autocode.newitem.origin.ORAfterNewItemCustomization;
|
|
|
|
import cn.com.origin.autocode.newitem.origin.ORAfterNewItemCustomization;
|
|
|
|
import cn.com.origin.autocode.newitem.origin.ORCreateICOObject;
|
|
|
|
import cn.com.origin.autocode.newitem.origin.ORCreateICOObject;
|
|
|
|
import cn.com.origin.autocode.newitem.origin.ORSaveObjectDescOperation;
|
|
|
|
import cn.com.origin.autocode.newitem.origin.ORSaveObjectDescOperation;
|
|
|
@ -248,7 +249,13 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
private Boolean isCreateTempItem = false;
|
|
|
|
private Boolean isCreateTempItem = false;
|
|
|
|
|
|
|
|
|
|
|
|
private String ksfl = null;
|
|
|
|
private String ksfl = null;
|
|
|
|
private String selectedType = null;
|
|
|
|
private TCComponentItemRevision ysjtzRev = null;
|
|
|
|
|
|
|
|
private TCComponentForm ysdzbForm = null;
|
|
|
|
|
|
|
|
private String[][] ysjTable = null;
|
|
|
|
|
|
|
|
private String[] colNames = new String[] { "jd2_bjh", "jd2_cl", "jd2_ys", "jd2_xh" };
|
|
|
|
|
|
|
|
private String ys = null;
|
|
|
|
|
|
|
|
private String cz = null;
|
|
|
|
|
|
|
|
private String xh = null;
|
|
|
|
|
|
|
|
|
|
|
|
public Text getIdLengthText() {
|
|
|
|
public Text getIdLengthText() {
|
|
|
|
return idLengthText;
|
|
|
|
return idLengthText;
|
|
|
@ -2214,8 +2221,6 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
codeDesc = codeDesc + "\n";
|
|
|
|
codeDesc = codeDesc + "\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.codeRemark = treeData.getPackCodeNodeInfo().getNode_desc();
|
|
|
|
this.codeRemark = treeData.getPackCodeNodeInfo().getNode_desc();
|
|
|
|
this.selectedType = treeData.getPackCodeNodeInfo().getNodeComponent().getType();
|
|
|
|
|
|
|
|
System.out.println("selectType ===>" + selectedType);
|
|
|
|
|
|
|
|
System.out.println("node_desc ===>" + treeData.getPackCodeNodeInfo().getNode_desc());
|
|
|
|
System.out.println("node_desc ===>" + treeData.getPackCodeNodeInfo().getNode_desc());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -3214,6 +3219,7 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
return value;
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings("deprecation")
|
|
|
|
private void createNewItem(String itemID, String itemRev, String itemType, String itemName, String itemDesc) {
|
|
|
|
private void createNewItem(String itemID, String itemRev, String itemType, String itemName, String itemDesc) {
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
@ -3272,9 +3278,10 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
flag = true;
|
|
|
|
flag = true;
|
|
|
|
TCComponent cadTemplate = session.stringToComponent(uid);
|
|
|
|
TCComponent cadTemplate = session.stringToComponent(uid);
|
|
|
|
TCComponentDataset cadDataset = (TCComponentDataset) cadTemplate;
|
|
|
|
TCComponentDataset cadDataset = (TCComponentDataset) cadTemplate;
|
|
|
|
TCComponentDataset newCad = cadDataset.saveAs(null);
|
|
|
|
|
|
|
|
TCComponentItem item = (TCComponentItem) newComp;
|
|
|
|
TCComponentItem item = (TCComponentItem) newComp;
|
|
|
|
item.getLatestItemRevision().add("IMAN_specification", newCad);
|
|
|
|
TCComponentDataset newCad = cadDataset.saveAs(item.getProperty("item_id"));
|
|
|
|
|
|
|
|
item.getLatestItemRevision().add("TC_Attaches", newCad);
|
|
|
|
|
|
|
|
System.out.println("cad数据集创建成功");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!flag) {
|
|
|
|
if (!flag) {
|
|
|
@ -3293,12 +3300,43 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
new String[] { ksfl, "文件夹" });
|
|
|
|
new String[] { ksfl, "文件夹" });
|
|
|
|
if (res.length > 0) {
|
|
|
|
if (res.length > 0) {
|
|
|
|
TCComponentFolder folder = (TCComponentFolder) res[0];
|
|
|
|
TCComponentFolder folder = (TCComponentFolder) res[0];
|
|
|
|
|
|
|
|
session.getUserService().call("bs_bypass", new Object[] { true });
|
|
|
|
folder.add("contents", newComp);
|
|
|
|
folder.add("contents", newComp);
|
|
|
|
folder.refresh();
|
|
|
|
folder.refresh();
|
|
|
|
|
|
|
|
System.out.println("发送成功");
|
|
|
|
|
|
|
|
session.getUserService().call("bs_bypass", new Object[] { false });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ysjtzRev != null) {
|
|
|
|
|
|
|
|
TCComponentItem item = (TCComponentItem) newComp;
|
|
|
|
|
|
|
|
if (ysdzbForm != null) {
|
|
|
|
|
|
|
|
if (ysjTable != null) {
|
|
|
|
|
|
|
|
// String[][] ysjTable1 = new String[ysjTable.length + 1][colNames.length];
|
|
|
|
|
|
|
|
List<String[]> ysjTable1 = new ArrayList<String[]>();
|
|
|
|
|
|
|
|
for (String[] arr : ysjTable) {
|
|
|
|
|
|
|
|
ysjTable1.add(arr);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String[] newRow = new String[] { item.getProperty("item_id"), cz, ys, xh };
|
|
|
|
|
|
|
|
ysjTable1.add(newRow);
|
|
|
|
|
|
|
|
TCTableUtil.setTableRows(ysdzbForm, "jd2_ysdzb", "JD2_YSDZBTABLE", colNames,
|
|
|
|
|
|
|
|
ysjTable1.toArray(new String[ysjTable1.size()][colNames.length]));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
TCComponentFormType formType = (TCComponentFormType) session.getTypeComponent("Form");
|
|
|
|
|
|
|
|
ysdzbForm = formType.create("颜色对照表", "颜色对照表", "JD2_YSDZB");
|
|
|
|
|
|
|
|
ysjTable = new String[][] { { item.getProperty("item_id"), cz, ys, xh } };
|
|
|
|
|
|
|
|
TCTableUtil.setTableRows(ysdzbForm, "jd2_ysdzb", "JD2_YSDZBTABLE", colNames, ysjTable);
|
|
|
|
|
|
|
|
ysjtzRev.add("IMAN_specification", ysdzbForm);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
item.getLatestItemRevision().add("TC_Is_Represented_By", ysjtzRev);
|
|
|
|
|
|
|
|
ysjtzRev.refresh();
|
|
|
|
|
|
|
|
item.refresh();
|
|
|
|
|
|
|
|
System.out.println("颜色件创建成功");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (targetObject instanceof TCComponentFolder) {
|
|
|
|
if (targetObject instanceof TCComponentFolder) {
|
|
|
|
|
|
|
|
|
|
|
|
if (newComp != null) {
|
|
|
|
if (newComp != null) {
|
|
|
@ -4079,6 +4117,8 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 波轮图纸分类
|
|
|
|
|
|
|
|
ksfl = null;
|
|
|
|
System.out.println("选中类型++++++++++++++++++++++++++++++++++++" + realItemType);
|
|
|
|
System.out.println("选中类型++++++++++++++++++++++++++++++++++++" + realItemType);
|
|
|
|
if (realItemType != null && realItemType.equals("JD2_BLXYJTZ")) {
|
|
|
|
if (realItemType != null && realItemType.equals("JD2_BLXYJTZ")) {
|
|
|
|
// TableItem tableItems[] = this.propTable.getItems();
|
|
|
|
// TableItem tableItems[] = this.propTable.getItems();
|
|
|
@ -4094,6 +4134,7 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
System.out.println(text);
|
|
|
|
System.out.println(text);
|
|
|
|
if (text.equals("款式分类:")) {
|
|
|
|
if (text.equals("款式分类:")) {
|
|
|
|
ksfl = ((Text) generalPropTextList.get(i)).getText();
|
|
|
|
ksfl = ((Text) generalPropTextList.get(i)).getText();
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -4109,6 +4150,74 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 颜色件
|
|
|
|
|
|
|
|
String ysjth = null;
|
|
|
|
|
|
|
|
ys = null;
|
|
|
|
|
|
|
|
cz = null;
|
|
|
|
|
|
|
|
xh = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < generalPropLabelList.size(); i++) {
|
|
|
|
|
|
|
|
String text = generalPropLabelList.get(i).getText();
|
|
|
|
|
|
|
|
System.out.println(text);
|
|
|
|
|
|
|
|
if (text.equals("颜色件图号:")) {
|
|
|
|
|
|
|
|
ysjth = ((Text) generalPropTextList.get(i)).getText();
|
|
|
|
|
|
|
|
System.out.println("颜色件图号:" + ysjth);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
for (int i = 0; i < classPropList.size(); i++) {
|
|
|
|
|
|
|
|
// System.out.println(" CLASS ID = " + integers[i] + " =" +
|
|
|
|
|
|
|
|
// vals[i]);
|
|
|
|
|
|
|
|
CNClassPropBean bean = classPropList.get(i);
|
|
|
|
|
|
|
|
System.out.println(bean.propDisName);
|
|
|
|
|
|
|
|
if ("颜色".equals(bean.propDisName)) {
|
|
|
|
|
|
|
|
if (bean.isLov) {
|
|
|
|
|
|
|
|
ys = ((Combo) classTextList.get(i)).getText();
|
|
|
|
|
|
|
|
ys = bean.lovMapping.get(ys);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
ys = ((Text) classTextList.get(i)).getText();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// icspro[i] = new ICSProperty(bean.propID, value);
|
|
|
|
|
|
|
|
System.out.println("颜色:" + ys);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ysjth != null && ys == null) {
|
|
|
|
|
|
|
|
MessageBox.post("该物料不是颜色件", "错误", MessageBox.ERROR);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ysjth != null) {
|
|
|
|
|
|
|
|
TCComponent comp = null;
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
comp = session.search("Item ID", new String[] { "零组件 ID" }, new String[] { ysjth })[0];
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (comp != null) {
|
|
|
|
|
|
|
|
TCComponentItem item = (TCComponentItem) comp;
|
|
|
|
|
|
|
|
ysjtzRev = item.getLatestItemRevision();
|
|
|
|
|
|
|
|
TCComponent[] comps = ysjtzRev.getReferenceListProperty("IMAN_specification");
|
|
|
|
|
|
|
|
for (int i = 0; i < comps.length; i++) {
|
|
|
|
|
|
|
|
if (comps[i].getType().equals("JD2_YSDZB")) {
|
|
|
|
|
|
|
|
ysdzbForm = (TCComponentForm) comps[i];
|
|
|
|
|
|
|
|
ysjTable = TCTableUtil.getTableRows(ysdzbForm, "jd2_ysdzb", colNames);
|
|
|
|
|
|
|
|
for (String[] row : ysjTable) {
|
|
|
|
|
|
|
|
if (ys.equals(row[2])) {
|
|
|
|
|
|
|
|
MessageBox.post("图号为\"" + ysjth + "\"的颜色件已存在颜色\"" + ys + "\"", "错误",
|
|
|
|
|
|
|
|
MessageBox.ERROR);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
MessageBox.post("没有找到与\"" + ysjth + "\"对应的图纸信息", "错误", MessageBox.ERROR);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TCComponentItem oldItem = tccomponentitemtype.find(getJYNewID(newID));
|
|
|
|
TCComponentItem oldItem = tccomponentitemtype.find(getJYNewID(newID));
|
|
|
|
if (oldItem != null) {
|
|
|
|
if (oldItem != null) {
|
|
|
|
MessageBox.post("ID为【" + getJYNewID(newID) + "】的物料已经存在!", "INFO", MessageBox.WARNING);
|
|
|
|
MessageBox.post("ID为【" + getJYNewID(newID) + "】的物料已经存在!", "INFO", MessageBox.WARNING);
|
|
|
|