|
|
|
@ -11,7 +11,6 @@ import java.awt.Toolkit;
|
|
|
|
|
import java.awt.datatransfer.StringSelection;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.math.BigInteger;
|
|
|
|
|
import java.net.URLEncoder;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
@ -25,7 +24,6 @@ import java.util.Map;
|
|
|
|
|
import javax.swing.JDialog;
|
|
|
|
|
import javax.xml.bind.JAXBException;
|
|
|
|
|
|
|
|
|
|
import org.apache.james.mime4j.codec.EncoderUtil;
|
|
|
|
|
import org.eclipse.jface.dialogs.Dialog;
|
|
|
|
|
import org.eclipse.jface.dialogs.IDialogConstants;
|
|
|
|
|
import org.eclipse.jface.viewers.TreeViewer;
|
|
|
|
@ -103,7 +101,6 @@ import com.teamcenter.services.rac.core._2008_06.DataManagement.CreateInput;
|
|
|
|
|
import com.teamcenter.soa.client.model.LovValue;
|
|
|
|
|
|
|
|
|
|
import cn.com.origin.autocode.jfom.util.ClassProperty;
|
|
|
|
|
import cn.com.origin.autocode.jfom.util.HttpUtil;
|
|
|
|
|
import cn.com.origin.autocode.jfom.util.JFomBZJBean;
|
|
|
|
|
import cn.com.origin.autocode.jfom.util.JFomBean;
|
|
|
|
|
import cn.com.origin.autocode.jfom.util.JFomLovBean;
|
|
|
|
@ -249,6 +246,9 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
|
private Button isCreateTempItemButton = null;
|
|
|
|
|
private Boolean isCreateTempItem = false;
|
|
|
|
|
|
|
|
|
|
private String ksfl = null;
|
|
|
|
|
private String selectedType = null;
|
|
|
|
|
|
|
|
|
|
public Text getIdLengthText() {
|
|
|
|
|
return idLengthText;
|
|
|
|
|
}
|
|
|
|
@ -2213,6 +2213,8 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
|
codeDesc = codeDesc + "\n";
|
|
|
|
|
}
|
|
|
|
|
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());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -3249,7 +3251,21 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
|
type = targetObject.getType();
|
|
|
|
|
System.out.println("选中对象:" + targetObject + " 类型:" + type);
|
|
|
|
|
}
|
|
|
|
|
if (targetObject instanceof TCComponentFolder) {
|
|
|
|
|
|
|
|
|
|
if (ksfl != null) {
|
|
|
|
|
TCComponentItem newItem = (TCComponentItem) newComp;
|
|
|
|
|
TCComponentItemRevision rev = newItem.getLatestItemRevision();
|
|
|
|
|
TCComponentForm form = (TCComponentForm) rev.getRelatedComponents("IMAN_master_form_rev")[0];
|
|
|
|
|
if (ksfl.equals(form.getProperty("jd2_ksfl"))) {
|
|
|
|
|
TCComponent[] res = session.search("General...", new String[] { "名称", "类型" },
|
|
|
|
|
new String[] { ksfl, "文件夹" });
|
|
|
|
|
if (res.length > 0) {
|
|
|
|
|
TCComponentFolder folder = (TCComponentFolder) res[0];
|
|
|
|
|
folder.add("contents", newComp);
|
|
|
|
|
folder.refresh();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else if (targetObject instanceof TCComponentFolder) {
|
|
|
|
|
|
|
|
|
|
if (newComp != null) {
|
|
|
|
|
TCComponentFolder folder = (TCComponentFolder) targetObject;
|
|
|
|
@ -4028,6 +4044,37 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
|
MessageBox.post("请填写必填属性", "错误", MessageBox.ERROR);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
System.out.println("选中类型++++++++++++++++++++++++++++++++++++" + realItemType);
|
|
|
|
|
if (realItemType != null && realItemType.equals("JD2_BLXYJTZ")) {
|
|
|
|
|
// TableItem tableItems[] = this.propTable.getItems();
|
|
|
|
|
// tableItems[1].getText(1);
|
|
|
|
|
String[] folders = getPrefStrArray("jd2_bltz_folders");
|
|
|
|
|
if (folders == null) {
|
|
|
|
|
MessageBox.post("首选项未配置", "错误", MessageBox.ERROR);
|
|
|
|
|
System.out.println("首选项未配置");
|
|
|
|
|
return;
|
|
|
|
|
} else {
|
|
|
|
|
for (int i = 0; i < generalPropLabelList.size(); i++) {
|
|
|
|
|
String text = generalPropLabelList.get(i).getText();
|
|
|
|
|
System.out.println(text);
|
|
|
|
|
if (text.equals("款式分类:")) {
|
|
|
|
|
ksfl = ((Text) generalPropTextList.get(i)).getText();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
System.out.println("款式分类:" + ksfl);
|
|
|
|
|
List<String> ksFolder = Arrays.asList(folders);
|
|
|
|
|
for (String s : ksFolder) {
|
|
|
|
|
System.out.println(s);
|
|
|
|
|
}
|
|
|
|
|
if (!ksFolder.contains(ksfl)) {
|
|
|
|
|
MessageBox.post("填写的款式分类未包含在首选项中", "错误", MessageBox.ERROR);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TCComponentItem oldItem = tccomponentitemtype.find(getJYNewID(newID));
|
|
|
|
|
if (oldItem != null) {
|
|
|
|
|
MessageBox.post("ID为【" + getJYNewID(newID) + "】的物料已经存在!", "INFO", MessageBox.WARNING);
|
|
|
|
@ -4219,6 +4266,21 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
|
return strs;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取单值得首选项
|
|
|
|
|
*
|
|
|
|
|
* @param prefName
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public String getPrefStr(String prefName) {
|
|
|
|
|
TCPreferenceService service = session.getPreferenceService();
|
|
|
|
|
String str = service.getString(TCPreferenceService.TC_preference_site, prefName);
|
|
|
|
|
if (str == null) {
|
|
|
|
|
str = new String("");
|
|
|
|
|
}
|
|
|
|
|
return str;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 创建完成后发送到分类并填写描述属性合并
|
|
|
|
|
*
|
|
|
|
@ -4369,25 +4431,33 @@ public class NewCodeItemDialog extends Dialog {
|
|
|
|
|
ids[i] = idsList.get(i);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ClassificationBean cfb = new ClassificationBean(ids, values);
|
|
|
|
|
System.out.println(Arrays.toString(ids));
|
|
|
|
|
System.out.println(Arrays.toString(values));
|
|
|
|
|
System.out.println(cfb.getIds()[0]);
|
|
|
|
|
JSONObject obj = new JSONObject();
|
|
|
|
|
obj.put("ids", ids);
|
|
|
|
|
obj.put("values", values);
|
|
|
|
|
String url = EncoderUtil.encodeAddressDisplayName(obj.toString());
|
|
|
|
|
url = url.substring(1, url.length() - 1);
|
|
|
|
|
url = URLEncoder.encode(url);
|
|
|
|
|
url = "http://localhost:8080/classification?uid=" + uid + "&cid=" + cid + "&prop=" + url;
|
|
|
|
|
String prop = obj.toString();
|
|
|
|
|
prop = prop.replace("\"", "\\\"");
|
|
|
|
|
System.out.println(prop);
|
|
|
|
|
String server = getPrefStr("jd2_server_ip");
|
|
|
|
|
if (server == null || "".equals(server)) {
|
|
|
|
|
MessageBox.post("未配置jd2_server_ip首选项", "错误", MessageBox.ERROR);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
String url = "http://" + server + ":8080/classification";
|
|
|
|
|
Map<String, Object> paramMap = new HashMap<String, Object>();
|
|
|
|
|
paramMap.put("uid", uid);
|
|
|
|
|
paramMap.put("cid", cid);
|
|
|
|
|
paramMap.put("prop", prop);
|
|
|
|
|
System.out.println(url);
|
|
|
|
|
final String URL = url;
|
|
|
|
|
final Map<String, Object> PARAMMAP = paramMap;
|
|
|
|
|
|
|
|
|
|
new Thread(new Runnable() {
|
|
|
|
|
@Override
|
|
|
|
|
public void run() {
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
HttpUtil.doGet(URL);
|
|
|
|
|
cn.hutool.http.HttpUtil.post(URL, PARAMMAP);
|
|
|
|
|
System.out.println("success");
|
|
|
|
|
}
|
|
|
|
|
}).start();
|
|
|
|
|