发送到分类、发送到文件夹、描述拼接

main
zouxk 6 years ago
parent 3a0c0dc2c6
commit 7f5faaf437

@ -44,7 +44,7 @@
<classpathentry exported="true" kind="lib" path="axis2_lib/jalopy-1.5rc3.jar"/>
<classpathentry exported="true" kind="lib" path="axis2_lib/jaxb-api-2.1.jar"/>
<classpathentry exported="true" kind="lib" path="axis2_lib/jaxb-impl-2.1.7.jar"/>
<classpathentry exported="true" kind="lib" path="axis2_lib/jaxb-xjc-2.1.7.jar"/>
<classpathentry exported="true" kind="lib" path="axis2_lib/jaxb-xjc-2.1.7.jar" sourcepath="C:/Users/5RKB5B~1/AppData/Local/Temp/.org.sf.feeling.decompiler1576806100550/source/jaxb-xjc-2.1.7-sources.jar"/>
<classpathentry exported="true" kind="lib" path="axis2_lib/jaxen-1.1.1.jar"/>
<classpathentry exported="true" kind="lib" path="axis2_lib/jaxws-tools-2.1.3.jar"/>
<classpathentry exported="true" kind="lib" path="axis2_lib/jettison-1.0-RC2.jar"/>
@ -78,6 +78,7 @@
<classpathentry kind="lib" path="json_lib/fastjson-1.2.9-javadoc.jar"/>
<classpathentry kind="lib" path="json_lib/fastjson-1.2.9-sources.jar"/>
<classpathentry kind="lib" path="json_lib/fastjson-1.2.9.jar"/>
<classpathentry kind="lib" path="axis2_lib/hutool-all-5.0.7.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>

@ -28,7 +28,7 @@ Require-Bundle: org.eclipse.ui;bundle-version="3.111.0",
org.eclipse.osgi.services;bundle-version="3.7.100",
org.eclipse.osgi.util;bundle-version="3.5.100"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: .,
antlr,
antlr.ASdebug,
@ -912,13 +912,5 @@ Bundle-ClassPath: json_lib/commons-beanutils-1.7.0.jar,
axis2_lib/XmlSchema-1.4.7.jar,
json_lib/fastjson-1.2.9-javadoc.jar,
json_lib/fastjson-1.2.9-sources.jar,
json_lib/fastjson-1.2.9.jar
Import-Package: com.alibaba.fastjson,
com.alibaba.fastjson.annotation,
com.alibaba.fastjson.asm,
com.alibaba.fastjson.parser,
com.alibaba.fastjson.parser.deserializer,
com.alibaba.fastjson.serializer,
com.alibaba.fastjson.support.jaxrs,
com.alibaba.fastjson.support.spring,
com.alibaba.fastjson.util
json_lib/fastjson-1.2.9.jar,
axis2_lib/hutool-all-5.0.7.jar

@ -80,4 +80,5 @@ bin.includes = META-INF/,\
axis2_lib/XmlSchema-1.4.7.jar,\
json_lib/fastjson-1.2.9-javadoc.jar,\
json_lib/fastjson-1.2.9-sources.jar,\
json_lib/fastjson-1.2.9.jar
json_lib/fastjson-1.2.9.jar,\
axis2_lib/hutool-all-5.0.7.jar

@ -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();

@ -2,10 +2,7 @@ package cn.com.origin.autocode.newitem.generatcode;
import java.net.URLDecoder;
import java.net.URLEncoder;
import org.apache.james.mime4j.codec.EncoderUtil;
import com.alibaba.fastjson.JSON;
import java.nio.charset.Charset;
import net.sf.json.JSONObject;
@ -16,19 +13,19 @@ public class Test {
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int[] ids = new int[] { 1006 };
String[] values = new String[] { "ZF01" };
ClassficationBean cfb = new ClassficationBean(ids, values);
// String str = com.alibaba.fastjson.JSONObject.toJSONString(cfb);
int[] ids = new int[] { 1003, 1042, 1005, 1004 };
String[] values = new String[] { "安安生生", "安安生生", "安安生生", "安安生生" };
JSONObject obj = new JSONObject();
obj.put("ids", ids);
obj.put("values", values);
String url = EncoderUtil.encodeAddressDisplayName(JSON.toJSONString(cfb));
url = url.substring(1, url.length() - 1);
String url = obj.toString();
url = url.replace("\"", "\\\"");
Charset charset_gbk = Charset.forName("gbk");
url = new String(url.getBytes(), charset_gbk);
url = URLEncoder.encode(url);
url = "http://localhost:8080/classification?prop=" + url;
System.out.println(url);
System.out.println(URLDecoder.decode(url));
url = URLDecoder.decode(url);
System.out.println(url);
}
static class ClassficationBean {

Loading…
Cancel
Save