|
|
package com.connor.rb.plm.rb011;
|
|
|
|
|
|
import java.awt.Component;
|
|
|
import java.awt.Dimension;
|
|
|
import java.awt.FlowLayout;
|
|
|
import java.awt.event.ActionEvent;
|
|
|
import java.awt.event.ActionListener;
|
|
|
import java.awt.event.ComponentEvent;
|
|
|
import java.awt.event.ComponentListener;
|
|
|
import java.io.File;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Map.Entry;
|
|
|
|
|
|
import javax.swing.ComboBoxModel;
|
|
|
import javax.swing.DefaultComboBoxModel;
|
|
|
import javax.swing.JButton;
|
|
|
import javax.swing.JComboBox;
|
|
|
import javax.swing.JLabel;
|
|
|
import javax.swing.JPanel;
|
|
|
import javax.swing.JScrollPane;
|
|
|
import javax.swing.JTextField;
|
|
|
|
|
|
import org.eclipse.swt.widgets.Combo;
|
|
|
import org.eclipse.swt.widgets.Text;
|
|
|
|
|
|
import com.connor.rb.plm.entity.ZC_LBJ_list;
|
|
|
import com.connor.rb.plm.newcombox.RwJComboBox;
|
|
|
import com.connor.rb.plm.rb012.SearchJComItem;
|
|
|
import com.connor.rb.plm.util.ClassAttributeBean;
|
|
|
import com.connor.rb.plm.util.ClassProperty;
|
|
|
import com.connor.rb.plm.util.ParseXML;
|
|
|
import com.connor.rb.plm.util.PlmLocaleUtil;
|
|
|
import com.connor.rb.plm.util.SoaServerUtil;
|
|
|
import com.teamcenter.rac.aif.AbstractAIFApplication;
|
|
|
import com.teamcenter.rac.aif.AbstractAIFDialog;
|
|
|
import com.teamcenter.rac.aif.kernel.AIFComponentContext;
|
|
|
import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent;
|
|
|
import com.teamcenter.rac.kernel.TCClassificationService;
|
|
|
import com.teamcenter.rac.kernel.TCComponent;
|
|
|
import com.teamcenter.rac.kernel.TCComponentBOMLine;
|
|
|
import com.teamcenter.rac.kernel.TCComponentBOMWindow;
|
|
|
import com.teamcenter.rac.kernel.TCComponentBOMWindowType;
|
|
|
import com.teamcenter.rac.kernel.TCComponentICO;
|
|
|
import com.teamcenter.rac.kernel.TCComponentItem;
|
|
|
import com.teamcenter.rac.kernel.TCComponentItemRevision;
|
|
|
import com.teamcenter.rac.kernel.TCComponentItemType;
|
|
|
import com.teamcenter.rac.kernel.TCComponentListOfValues;
|
|
|
import com.teamcenter.rac.kernel.TCComponentQuery;
|
|
|
import com.teamcenter.rac.kernel.TCComponentQueryType;
|
|
|
import com.teamcenter.rac.kernel.TCException;
|
|
|
import com.teamcenter.rac.kernel.TCPreferenceService;
|
|
|
import com.teamcenter.rac.kernel.TCProperty;
|
|
|
import com.teamcenter.rac.kernel.TCSession;
|
|
|
import com.teamcenter.rac.kernel.TCTypeService;
|
|
|
import com.teamcenter.rac.kernel.TCUserService;
|
|
|
import com.teamcenter.rac.kernel.ics.ICSAdminClass;
|
|
|
import com.teamcenter.rac.kernel.ics.ICSAdminClassAttribute;
|
|
|
import com.teamcenter.rac.kernel.ics.ICSKeyLov;
|
|
|
import com.teamcenter.rac.kernel.ics.ICSProperty;
|
|
|
import com.teamcenter.rac.util.MessageBox;
|
|
|
import com.teamcenter.rac.util.PropertyLayout;
|
|
|
|
|
|
|
|
|
public class CreatDialog extends AbstractAIFDialog {
|
|
|
private AbstractAIFApplication app;
|
|
|
private TCSession session;
|
|
|
private TCPreferenceService service;
|
|
|
private List<ClassAttributeBean> classList = new ArrayList<ClassAttributeBean>();
|
|
|
private JLabel[] labels1 = null;
|
|
|
private JComboBox<String> comb = null;
|
|
|
private String className = "";
|
|
|
private Map<String,Object> map2;
|
|
|
private List<Map<String,Object>> values = new ArrayList<Map<String,Object>>();
|
|
|
private String type = "";
|
|
|
private String targetType = "";
|
|
|
private JScrollPane scr2;
|
|
|
private boolean flag = true;
|
|
|
private String url = "";
|
|
|
private TCComponentItemRevision targetRev = null;
|
|
|
private boolean classFlag = true;
|
|
|
private JTextField idField = null;
|
|
|
private JTextField nameField = null;
|
|
|
private JComboBox<String> revComb = null;
|
|
|
private List<Object> idList = new ArrayList<Object>();
|
|
|
private List<JComboBox> typeList = new ArrayList<JComboBox>();
|
|
|
private String productNumber = "";
|
|
|
private String drawingNumber = "";
|
|
|
private Map<String,List<String>> attrMap;
|
|
|
private Map<String,List<String>> attrMap2;
|
|
|
private Map<String,List<String>> attrMap3;
|
|
|
private Map<String,List<String>> attrMap4;
|
|
|
private Map<String,JComboBox<String>> boxMap = new HashMap<String, JComboBox<String>>();
|
|
|
private Map<String,Object> objMap = new HashMap<String, Object>();
|
|
|
private Map<String,Object> objMap2 = new HashMap<String, Object>();
|
|
|
private Map<String,Object> objMap3 = new HashMap<String, Object>();
|
|
|
private Map<String,Object> objMap4 = new HashMap<String, Object>();
|
|
|
private Map<String,String> lovMap = new HashMap<String, String>();
|
|
|
private Map<String,String> lovMap2 = new HashMap<String, String>();
|
|
|
private Map<String,String> lovMap3 = new HashMap<String, String>();
|
|
|
private Map<String,String> lovMap4 = new HashMap<String, String>();
|
|
|
private List<String> defaultValueList = new ArrayList<String>();
|
|
|
private List<String> isNList = new ArrayList<String>();
|
|
|
private List<String> isNList2 = new ArrayList<String>();
|
|
|
private List<String> isNList3 = new ArrayList<String>();
|
|
|
private List<String> isNList4 = new ArrayList<String>();
|
|
|
private List<String> markList = new ArrayList<String>();
|
|
|
private List<String> markList2 = new ArrayList<String>();
|
|
|
private List<String> markList3 = new ArrayList<String>();
|
|
|
private List<String> markList4 = new ArrayList<String>();
|
|
|
private List<String> attrList = new ArrayList<String>();
|
|
|
private List<String> esAttrList = new ArrayList<String>();
|
|
|
// private List<Object> objList = new ArrayList<Object>();
|
|
|
// private List<String> lovList = new ArrayList<String>();
|
|
|
private List<String> attrList2 = new ArrayList<String>();
|
|
|
private List<String> attrList3 = new ArrayList<String>();
|
|
|
private List<String> attrList4 = new ArrayList<String>();
|
|
|
private List<String> esAttrList2 = new ArrayList<String>();
|
|
|
private List<String> esAttrList3 = new ArrayList<String>();
|
|
|
private List<String> esAttrList4 = new ArrayList<String>();
|
|
|
private String bsNumber = "";
|
|
|
private String smNumber = "";
|
|
|
private List<String> asList = new ArrayList<String>();
|
|
|
private List<String> esList = new ArrayList<String>();
|
|
|
private InterfaceAIFComponent targetComp;
|
|
|
//<2F>Ż<EFBFBD>
|
|
|
private Map<String,String> zc_lbj_map=new HashMap<>();
|
|
|
private List<Object> fieldList=new ArrayList<>();
|
|
|
private List<Object> comboxList=new ArrayList<Object>();
|
|
|
private List<String> yylyList=new ArrayList<String>();
|
|
|
//private int h=4;
|
|
|
private boolean boflag=false;
|
|
|
private Map<String,String> fieldmap=new HashMap<>();
|
|
|
private Map<String,String> comboxmap=new HashMap<>();
|
|
|
//end<6E>Ż<EFBFBD>
|
|
|
// private List<Object> objList2 = new ArrayList<Object>();
|
|
|
// private List<String> lovList2 = new ArrayList<String>();
|
|
|
// private String[] lovVal = new String[] { "<22><>ǰ<EFBFBD><C7B0>", "<22><><EFBFBD><D7BC><EFBFBD><EFBFBD>", "<22>Ӵ<DEBD><D3B4><EFBFBD>", "<22><>ʽ", "<22><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>", "A:NBR", "0:<3A><>", "<22><>", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
|
|
// "SN:180<38><30><EFBFBD><EFBFBD>5<EFBFBD><35><EFBFBD>ػ<EFBFBD>", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȴ<EFBFBD><C8B4><EFBFBD>", "<22><><EFBFBD><EFBFBD>", "S:(25% to 35%)", "C0","V0","Z0","<22><>","PC:<3A>ﵽ<EFBFBD><EFB5BD><EFBFBD><EFBFBD>C&UƷ<55>ƾ<EFBFBD><C6BE><EFBFBD>Ҫ<EFBFBD><D2AA>"
|
|
|
// ,"P0:<3A>ﵽ<EFBFBD><EFB5BD><EFBFBD><EFBFBD>C&UƷ<55>ƾ<EFBFBD><C6BE><EFBFBD>Ҫ<EFBFBD><D2AA>","<22><><EFBFBD><EFBFBD><EFBFBD>ṹ<EFBFBD><E1B9B9>Ҫ<EFBFBD><D2AA><EFBFBD>ƹ<EFBFBD><C6B9><EFBFBD>","0:˫<>нǽӴ<C7BD><D3B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>","<22><><EFBFBD><EFBFBD>:SECC<43><43><EFBFBD><EFBFBD><EFBFBD>൱<EFBFBD><E0B5B1><EFBFBD><EFBFBD>","<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:<3A>벿<EFBFBD><EBB2BF><EFBFBD>Ŷ<EFBFBD>ȷ<EFBFBD><C8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>","BC:35<33><35>"};
|
|
|
// private String[] esLovVal = new String[] { "Non", "Standard ball", "Non", "Open", "Without vent hole", "A:NBR",
|
|
|
// "0:Black", "Non", "Ball", "SN:180<38><30><EFBFBD><EFBFBD>5<EFBFBD><35> temper","Conventional monolithic martensite quenching heat treatment",
|
|
|
// "Single", "S:(25% to 35%)", "C0","V0","Z0","Standard","PC:Meet the group C&U brand accuracy requirements"
|
|
|
// ,"P0:Meet the group C&U brand accuracy requirements","Other structures need to formulate rules","0:Double row angular contact ball bearing"
|
|
|
// ,"Not marked: SECC or equivalent","Other materials: confirm with department team for approval","BC:35<33><35>"};
|
|
|
|
|
|
public CreatDialog (AbstractAIFApplication app) {
|
|
|
super(false);
|
|
|
this.app = app;
|
|
|
this.targetComp = app.getTargetComponent();
|
|
|
this.session = (TCSession) app.getSession();
|
|
|
this.service = session.getPreferenceService();
|
|
|
this.url = service.getStringValue("Autocode_SendClassServer_URL");
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void run() {
|
|
|
String lovVal = service.getStringValue("RB3_lovVal_default");
|
|
|
String esLovVal = service.getStringValue("RB3_esLovVal_default");
|
|
|
if(lovVal.contains(";")) {
|
|
|
String[] vals = lovVal.split(";");
|
|
|
String[] esVals = esLovVal.split(";");
|
|
|
for (int i = 0; i < vals.length; i++) {
|
|
|
asList.add(vals[i]);
|
|
|
esList.add(esVals[i]);
|
|
|
}
|
|
|
}
|
|
|
ParseXML xml=new ParseXML();
|
|
|
File file=xml.getSXX("RB3_CPHPJFS", session);
|
|
|
|
|
|
attrMap =xml.parseXMLAttr(file);
|
|
|
if(attrMap == null || attrMap.size() <= 0) {
|
|
|
MessageBox.post("<22><>ѡ<EFBFBD><D1A1>RB3_CPHPJFSδ<53><CEB4><EFBFBD>ã<EFBFBD><C3A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>飡", "WARNING",
|
|
|
MessageBox.WARNING);
|
|
|
return;
|
|
|
}
|
|
|
File file2=xml.getSXX("RB3_THPJFS", session);
|
|
|
attrMap2 =xml.parseXMLAttr(file2);
|
|
|
if(attrMap2 == null || attrMap2.size() <= 0) {
|
|
|
MessageBox.post("<22><>ѡ<EFBFBD><D1A1>RB3_THPJFSδ<53><CEB4><EFBFBD>ã<EFBFBD><C3A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>飡", "WARNING",
|
|
|
MessageBox.WARNING);
|
|
|
return;
|
|
|
}
|
|
|
this.initUI();
|
|
|
|
|
|
}
|
|
|
|
|
|
public void initUI(){
|
|
|
setTitle("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ");
|
|
|
int i = 1;
|
|
|
Dimension dimension = new Dimension();
|
|
|
this.setLayout(new PropertyLayout());
|
|
|
dimension.setSize(650,800);
|
|
|
this.setMinimumSize(dimension);
|
|
|
this.setPreferredSize(dimension);
|
|
|
JPanel parentPanel = new JPanel(new PropertyLayout());
|
|
|
scr2 = new JScrollPane(parentPanel);
|
|
|
scr2.setPreferredSize(new Dimension(640, 700));
|
|
|
JPanel classJpanel = new JPanel(new PropertyLayout());// <20><><EFBFBD>Խ<EFBFBD><D4BD><EFBFBD>
|
|
|
classJpanel.add("1.1.center.top", scr2);
|
|
|
//<2F>Ż<EFBFBD><C5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><DABC><EFBFBD><EFBFBD><EFBFBD>
|
|
|
this.addComponentListener(new ComponentListener() {
|
|
|
|
|
|
|
|
|
@Override
|
|
|
public void componentResized(ComponentEvent e) {
|
|
|
// TODO Auto-generated method stub
|
|
|
Component component2=e.getComponent();
|
|
|
int h=component2.getHeight();
|
|
|
if(h>800) {
|
|
|
scr2.setPreferredSize(new Dimension(component2.getWidth()-10,h-100));
|
|
|
scr2.revalidate();
|
|
|
scr2.repaint();
|
|
|
classJpanel.setPreferredSize(new Dimension(component2.getWidth(),h-100));
|
|
|
classJpanel.revalidate();
|
|
|
classJpanel.repaint();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void componentMoved(ComponentEvent e) {
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void componentShown(ComponentEvent e) {
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void componentHidden(ComponentEvent e) {
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
//end<6E>Ż<EFBFBD>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(targetComp instanceof TCComponentItemRevision) {
|
|
|
targetRev = (TCComponentItemRevision) targetComp;
|
|
|
String revType = targetRev.getType();
|
|
|
try {
|
|
|
targetType = targetRev.getItem().getType();
|
|
|
System.out.println("revType============"+revType);
|
|
|
nameField = new JTextField(18);
|
|
|
parentPanel.add(i+".1.center.top", new JLabel(""));
|
|
|
i += 1;
|
|
|
if("RB3_ZCRevision".equals(revType)) {
|
|
|
type = targetRev.getStringProperty("rb3_zclx");
|
|
|
flag = false;
|
|
|
}else if("RB3_LBJRevision".equals(revType)){
|
|
|
idField = new JTextField(18);
|
|
|
|
|
|
parentPanel.add(i+".1.center.top", new JLabel("<22>ܳ<EFBFBD><DCB3><EFBFBD><EFBFBD>ϱ<EFBFBD><CFB1><EFBFBD>"));
|
|
|
parentPanel.add(i+".2.center.top", idField);
|
|
|
i += 1;
|
|
|
type = targetRev.getStringProperty("rb3_lbjlx");
|
|
|
}
|
|
|
parentPanel.add(i+".1.center.top", new JLabel("<22><><EFBFBD><EFBFBD>"));
|
|
|
parentPanel.add(i+".2.center.top", nameField);
|
|
|
i += 1;
|
|
|
String name = targetRev.getStringProperty("object_name");
|
|
|
nameField.setText(name);
|
|
|
className = targetRev.getClassificationClass();
|
|
|
String xmlClassName = "";
|
|
|
if(flag) {
|
|
|
xmlClassName = className;
|
|
|
JTextField idfield = new JTextField(18);
|
|
|
idList.add(idfield);
|
|
|
JComboBox<String> idbox = new JComboBox<String>();
|
|
|
idList.add(idbox);
|
|
|
idbox.addItem(" ");
|
|
|
String[] idstrs = new String[99];
|
|
|
for (int K = 0; K < 99; K++) {
|
|
|
if(K < 9) {
|
|
|
idstrs[K] = "0"+(K+1);
|
|
|
}else {
|
|
|
idstrs[K] = (K+1)+"";
|
|
|
}
|
|
|
}
|
|
|
for (int K = 0; K < idstrs.length; K++) {
|
|
|
idbox.addItem(idstrs[K]);
|
|
|
}
|
|
|
boxMap.put(PlmLocaleUtil.getString("PartNumber"), idbox);
|
|
|
parentPanel.add((i)+".1.center.top", new JLabel(PlmLocaleUtil.getString("PartNumber")));
|
|
|
parentPanel.add((i)+".2.center.top", idfield);
|
|
|
parentPanel.add((i)+".3.center.top", idbox);
|
|
|
i += 1;
|
|
|
}else {
|
|
|
xmlClassName = className.substring(0, 6);
|
|
|
ParseXML xml=new ParseXML();
|
|
|
File file3=xml.getSXX("RB3_BSHPJFS", session);
|
|
|
attrMap3 =xml.parseXMLAttr(file3);
|
|
|
if(attrMap3 == null || attrMap3.size() <= 0) {
|
|
|
MessageBox.post("<22><>ѡ<EFBFBD><D1A1>RB3_BSHPJFSδ<53><CEB4><EFBFBD>ã<EFBFBD><C3A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>飡", "WARNING",
|
|
|
MessageBox.WARNING);
|
|
|
return;
|
|
|
}
|
|
|
File file4=xml.getSXX("RB3_SMPJFS", session);
|
|
|
attrMap4 =xml.parseXMLAttr(file4);
|
|
|
if(attrMap4 == null || attrMap4.size() <= 0) {
|
|
|
MessageBox.post("<22><>ѡ<EFBFBD><D1A1>RB3_SMPJFSδ<53><CEB4><EFBFBD>ã<EFBFBD><C3A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>飡", "WARNING",
|
|
|
MessageBox.WARNING);
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
System.out.println("className==========="+className);
|
|
|
System.out.println("xmlClassName==========="+xmlClassName);
|
|
|
saveCOM2(xmlClassName,attrMap,attrList,esAttrList,markList,defaultValueList,isNList);
|
|
|
saveCOM(xmlClassName,attrMap2,attrList2,esAttrList2,markList2,isNList2);
|
|
|
if(attrMap3 != null) {
|
|
|
saveCOM(xmlClassName,attrMap3,attrList3,esAttrList3,markList3,isNList3);
|
|
|
saveCOM(xmlClassName,attrMap4,attrList4,esAttrList4,markList4,isNList4);
|
|
|
}
|
|
|
TCComponentICO[] icos = targetRev.getClassificationObjects();
|
|
|
if(icos == null || icos.length <= 0){
|
|
|
MessageBox.post("ѡ<>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>з<EFBFBD><D0B7>͵<EFBFBD><CDB5><EFBFBD><EFBFBD>࣬<EFBFBD>뷢<EFBFBD>ͣ<EFBFBD><CDA3><EFBFBD><EFBFBD><EFBFBD>","<22><>ʾ",MessageBox.INFORMATION);
|
|
|
return;
|
|
|
}
|
|
|
Map<Integer, String> claMap = new HashMap<Integer, String>();
|
|
|
if(icos != null && icos.length>0){
|
|
|
ICSProperty[] icss = icos[0].getICSProperties(true);
|
|
|
for (ICSProperty ics : icss) {
|
|
|
claMap.put(ics.getId(), ics.getValue());
|
|
|
}
|
|
|
}
|
|
|
TCClassificationService classificationService = session.getClassificationService();
|
|
|
ICSAdminClass c = classificationService.newICSAdminClass();
|
|
|
c.load(xmlClassName);
|
|
|
String cName = c.getName();
|
|
|
System.out.println("cName==="+cName);
|
|
|
if(PlmLocaleUtil.getString("BearingAccessories").equals(cName)) {
|
|
|
classFlag = false;
|
|
|
}
|
|
|
ICSAdminClassAttribute[] icsAttrS = c.getAttributes();
|
|
|
if (icsAttrS != null) {
|
|
|
for (ICSAdminClassAttribute attr : icsAttrS) {
|
|
|
ClassAttributeBean bean = new ClassAttributeBean();
|
|
|
if (attr.isReferenceAttribute()) {// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
continue;
|
|
|
}
|
|
|
if (attr.isReference()) {
|
|
|
continue;
|
|
|
}
|
|
|
int propID = attr.getAttributeId();
|
|
|
bean.setId(propID);
|
|
|
String propDisName = attr.getName();
|
|
|
bean.setName(propDisName);
|
|
|
System.out.print("propDisName:"+propDisName);
|
|
|
int attrType = attr.getFormat1().getType();
|
|
|
bean.setType(attrType);
|
|
|
|
|
|
if (claMap != null
|
|
|
&& claMap.containsKey(propID)) {
|
|
|
bean.setVal(claMap.get(propID));
|
|
|
} else {
|
|
|
bean.setVal("");
|
|
|
}
|
|
|
|
|
|
ICSKeyLov lov1 = attr.getFormat1().getKeyLov();
|
|
|
lov1 = (lov1 == null ? attr.getFormat2().getKeyLov() : lov1);
|
|
|
if (lov1 != null) {
|
|
|
bean.setIslov(true);
|
|
|
String[] keys = lov1.getKeys();
|
|
|
Map<String,String> map1 = new HashMap<String,String>();
|
|
|
for (String key : keys) {
|
|
|
String value = lov1.getValueOfKey(key);
|
|
|
map1.put(value, key);// <<3C><>ʾֵ,<2C><>ʵֵ>
|
|
|
if(key.equals(bean.getVal())&&(!bean.getVal().equals(""))){
|
|
|
bean.setVal(value);
|
|
|
}
|
|
|
}
|
|
|
bean.setLov(map1);
|
|
|
} else {
|
|
|
bean.setIslov(false);
|
|
|
}
|
|
|
|
|
|
classList.add(bean);
|
|
|
|
|
|
}
|
|
|
}
|
|
|
} catch (TCException e1) {
|
|
|
// TODO Auto-generated catch block
|
|
|
e1.printStackTrace();
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
String[] revs = service.getStringValues("RB_Revision_id");
|
|
|
if(revs == null || revs.length <= 0) {
|
|
|
MessageBox.post("<22><>ѡ<EFBFBD><D1A1>RB_Revision_idδ<64><CEB4><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD>Ա!!",
|
|
|
"<22><><EFBFBD><EFBFBD>", MessageBox.ERROR);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
revComb = new JComboBox<String>();
|
|
|
revComb.addItem("B1");
|
|
|
//<2F>Ż<EFBFBD>
|
|
|
revComb.setEditable(false);
|
|
|
//end
|
|
|
for (int j = 0; j < revs.length; j++) {
|
|
|
revComb.addItem(revs[j]);
|
|
|
}
|
|
|
|
|
|
parentPanel.add(i+".1.center.top", new JLabel("<22>汾"));
|
|
|
parentPanel.add(i+".2.center.top", revComb);
|
|
|
i += 1;
|
|
|
|
|
|
labels1 = new JLabel[classList.size()];
|
|
|
|
|
|
for (int j = 0; j<classList.size();j++,i++) {
|
|
|
ClassAttributeBean bean = classList.get(j);
|
|
|
labels1[j] = new JLabel(bean.getName());
|
|
|
parentPanel.add(i+".1.center.top", labels1[j]);
|
|
|
labels1[j].setBounds(5, 5, 5, 5);
|
|
|
String attrName = "";
|
|
|
if((bean.getName()).contains("\\")) {
|
|
|
attrName = (bean.getName()).split("\\\\")[0];
|
|
|
System.out.println("attrName============="+attrName);
|
|
|
}else {
|
|
|
attrName = bean.getName();
|
|
|
}
|
|
|
if(bean.isIslov()){
|
|
|
JComboBox<String> comb = new JComboBox<String>();
|
|
|
//<2F>Ż<EFBFBD>
|
|
|
JTextField jt=new JTextField(9);
|
|
|
JButton bu=new JButton("<22><><EFBFBD><EFBFBD>");
|
|
|
//end
|
|
|
comb.setEditable(false);
|
|
|
comb.setSize(new Dimension(60,40));
|
|
|
comb.addItem(bean.getVal());
|
|
|
for (Entry<String, String> entry : bean.getLov().entrySet()) {
|
|
|
if(!(bean.getVal().equals(entry.getKey()))) {
|
|
|
comb.addItem(entry.getKey());
|
|
|
}
|
|
|
}
|
|
|
//<2F>Ż<EFBFBD>
|
|
|
bu.addActionListener(new ActionListener() {
|
|
|
@Override
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
// TODO Auto-generated method stub
|
|
|
String tip=jt.getText();
|
|
|
System.out.println("<22><><EFBFBD><EFBFBD>"+tip);
|
|
|
if(tip.length()>0) {
|
|
|
SearchJComItem.changeBox(comb, tip);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
});
|
|
|
//end
|
|
|
map2 = new HashMap<String, Object>();
|
|
|
map2.put("JComboBox", comb);
|
|
|
values.add(map2);
|
|
|
parentPanel.add(i+".2.center.top", comb);
|
|
|
parentPanel.add(i+".3.center.top", jt);
|
|
|
parentPanel.add(i+".4.center.top", bu);
|
|
|
|
|
|
|
|
|
if(attrList.contains(attrName) || esAttrList.contains(attrName)) {
|
|
|
objMap.put(attrName, comb);
|
|
|
lovMap.put(attrName, "yes");
|
|
|
}
|
|
|
if(attrList2.contains(attrName) || esAttrList2.contains(attrName)) {
|
|
|
objMap2.put(attrName, comb);
|
|
|
lovMap2.put(attrName, "yes");
|
|
|
}
|
|
|
if(attrMap3 != null) {
|
|
|
if(attrList3.contains(attrName) || esAttrList3.contains(attrName)) {
|
|
|
objMap3.put(attrName, comb);
|
|
|
lovMap3.put(attrName, "yes");
|
|
|
}
|
|
|
if(attrList4.contains(attrName) || esAttrList4.contains(attrName)) {
|
|
|
objMap4.put(attrName, comb);
|
|
|
lovMap4.put(attrName, "yes");
|
|
|
}
|
|
|
}
|
|
|
if((PlmLocaleUtil.getString("Category")).equals(attrName)) {
|
|
|
typeList.add(comb);
|
|
|
}
|
|
|
}else{
|
|
|
JTextField field = new JTextField(18);
|
|
|
|
|
|
map2 = new HashMap<String, Object>();
|
|
|
map2.put("JTextField", field);
|
|
|
values.add(map2);
|
|
|
parentPanel.add(i+".2.center.top", field);
|
|
|
if(bean.getVal() != null && bean.getVal()!=""){
|
|
|
field.setText(bean.getVal());
|
|
|
}
|
|
|
if((PlmLocaleUtil.getString("RadialInternalClearance")).equals(attrName)) {
|
|
|
JComboBox<String> box = new JComboBox<String>();
|
|
|
//<2F>Ż<EFBFBD>
|
|
|
JTextField jt=new JTextField(9);
|
|
|
JButton bu=new JButton("<22><><EFBFBD><EFBFBD>");
|
|
|
//end
|
|
|
box.addItem(" ");
|
|
|
String[] strs = new String[] {"C0","C2","C3","C4","C5"};
|
|
|
for (int K = 0; K < strs.length; K++) {
|
|
|
box.addItem(strs[K]);
|
|
|
}
|
|
|
//<2F>Ż<EFBFBD>
|
|
|
bu.addActionListener(new ActionListener() {
|
|
|
@Override
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
// TODO Auto-generated method stub
|
|
|
String tip=jt.getText();
|
|
|
System.out.println("<22><><EFBFBD><EFBFBD>"+tip);
|
|
|
if(tip.length()>0) {
|
|
|
SearchJComItem.changeBox(comb, tip);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
});
|
|
|
//end
|
|
|
boxMap.put(attrName, box);
|
|
|
parentPanel.add((i)+".3.center.top", box);
|
|
|
parentPanel.add((i)+".3.center.top", jt);
|
|
|
parentPanel.add((i)+".3.center.top", bu);
|
|
|
}
|
|
|
if(attrList.contains(attrName) || esAttrList.contains(attrName)) {
|
|
|
objMap.put(attrName, field);
|
|
|
lovMap.put(attrName, "no");
|
|
|
}
|
|
|
if(attrList2.contains(attrName) || esAttrList2.contains(attrName)) {
|
|
|
objMap2.put(attrName, field);
|
|
|
lovMap2.put(attrName, "no");
|
|
|
}
|
|
|
if(attrMap3 != null) {
|
|
|
if(attrList3.contains(attrName) || esAttrList3.contains(attrName)) {
|
|
|
objMap3.put(attrName, field);
|
|
|
lovMap3.put(attrName, "no");
|
|
|
}
|
|
|
if(attrList4.contains(attrName) || esAttrList4.contains(attrName)) {
|
|
|
objMap4.put(attrName, field);
|
|
|
lovMap4.put(attrName, "no");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//<2F>Ż<EFBFBD>
|
|
|
if(targetComp instanceof TCComponentItemRevision) {
|
|
|
targetRev = (TCComponentItemRevision) targetComp;
|
|
|
String revType = targetRev.getType();
|
|
|
try {
|
|
|
zc_lbj_map = targetRev.getProperties();
|
|
|
} catch (Exception e2) {
|
|
|
// TODO Auto-generated catch block
|
|
|
e2.printStackTrace();
|
|
|
}
|
|
|
|
|
|
System.out.println("<22>汾<EFBFBD><E6B1BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:"+revType);
|
|
|
if(revType.equals("RB3_ZCRevision")) {
|
|
|
System.out.println(revType);
|
|
|
boflag=true;
|
|
|
|
|
|
}else {
|
|
|
System.out.println(revType);
|
|
|
|
|
|
}
|
|
|
parentPanel.add(i+".1.center.top",new JLabel(" "));
|
|
|
parentPanel.add(i+".2.center.top",new JLabel("***********<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>***********"));
|
|
|
i+=1;
|
|
|
if(boflag) {
|
|
|
// System.out.println("<22><><EFBFBD>ӵ<EFBFBD><D3B5><EFBFBD><EFBFBD>Ը<EFBFBD><D4B8><EFBFBD><EFBFBD><EFBFBD>:"+h);
|
|
|
for(int n=0;n<ZC_LBJ_list.ZCPros.size();n++) {
|
|
|
System.out.println("ѭ<><D1AD><EFBFBD><EFBFBD>"+n+"<22><>,<2C><>Ҫ<EFBFBD><D2AA><EFBFBD>ӵ<EFBFBD><D3B5><EFBFBD><EFBFBD><EFBFBD>Ϊ"+ZC_LBJ_list.ZCDisPros.get(n)+"("+ZC_LBJ_list.ZCPros.get(n)+")");
|
|
|
parentPanel.add((i+n)+".1.center.top",new JLabel(ZC_LBJ_list.ZCDisPros.get(n)));
|
|
|
|
|
|
boolean b = ZC_LBJ_list.map.containsKey(ZC_LBJ_list.ZCPros.get(n));
|
|
|
if(b) {
|
|
|
|
|
|
System.out.println("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Lov<6F><76><EFBFBD><EFBFBD>");
|
|
|
try {
|
|
|
if(ZC_LBJ_list.ZCPros.get(n).equals("rb3_scgc1") ||ZC_LBJ_list.ZCPros.get(n).equals("rb3_yyly")) {
|
|
|
String na=ZC_LBJ_list.ZCPros.get(n);
|
|
|
//System.out.println("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
String[] vals = ((TCComponentItemRevision) targetComp).getTCProperty(na).getStringValueArray();
|
|
|
JComboBox nbox=new RwJComboBox(new String[] {""});
|
|
|
nbox.setEditable(true);
|
|
|
TCProperty zclov = ((TCComponentItemRevision) targetComp).getTCProperty(ZC_LBJ_list.ZCPros.get(n));
|
|
|
TCComponentListOfValues zcprolov = zclov.getLOV();
|
|
|
String[] comboxitems;
|
|
|
List<String> disVal=new ArrayList<String>();
|
|
|
for(int a=0;a<vals.length;a++) {
|
|
|
if(vals[a]!=null && !vals[a].equals("")) {
|
|
|
String disname = zcprolov.getListOfValues().getDisplayableValue(vals[a]);
|
|
|
disVal.add(disname);
|
|
|
}
|
|
|
}
|
|
|
if(zcprolov!=null) {
|
|
|
comboxitems = zcprolov.getListOfValues().getLOVDisplayValues();
|
|
|
//ComboBoxModel model = new DefaultComboBoxModel(comboxitems);
|
|
|
|
|
|
nbox=new RwJComboBox(comboxitems);
|
|
|
nbox.setEditable(true);
|
|
|
nbox.setName(na);
|
|
|
nbox.setSize(new Dimension(60,40));
|
|
|
if(disVal.size()>0) {
|
|
|
StringBuilder sb=new StringBuilder();
|
|
|
for(int t=0;t<disVal.size();t++) {
|
|
|
if(t!=(vals.length-1)) {
|
|
|
|
|
|
sb.append(disVal.get(t));
|
|
|
sb.append(",");
|
|
|
}else {
|
|
|
sb.append(disVal.get(t));
|
|
|
}
|
|
|
}
|
|
|
JTextField ed=(JTextField)nbox.getEditor().getEditorComponent();
|
|
|
ed.setText(sb.toString());
|
|
|
}
|
|
|
comboxList.add(nbox);
|
|
|
}
|
|
|
|
|
|
parentPanel.add((n+i)+".2.center.top",nbox);
|
|
|
}else if(ZC_LBJ_list.ZCPros.get(n).equals("rb3_yyly")){
|
|
|
String na=ZC_LBJ_list.ZCPros.get(n);
|
|
|
String[] vals = ((TCComponentItemRevision) targetComp).getTCProperty(na).getStringValueArray();
|
|
|
JComboBox nbox=new RwJComboBox(new String[] {""});
|
|
|
nbox.setEditable(true);
|
|
|
TCProperty zclov = ((TCComponentItemRevision) targetComp).getTCProperty(ZC_LBJ_list.ZCPros.get(n));
|
|
|
TCComponentListOfValues zcprolov = zclov.getLOV();
|
|
|
TCComponentListOfValues[] listLov = zcprolov.getListOfFilters();
|
|
|
for(int p=0;p<listLov.length;p++) {
|
|
|
TCComponentListOfValues zilov = listLov[p];
|
|
|
String[] zilovDisName = zilov.getListOfValues().getLOVDisplayValues();
|
|
|
for(int q=0;q<zilovDisName.length;q++) {
|
|
|
yylyList.add(zilovDisName[q]);
|
|
|
}
|
|
|
}
|
|
|
List<String> disVal=new ArrayList<String>();
|
|
|
if(vals.length>0) {
|
|
|
for(int e=0;e<listLov.length;e++) {
|
|
|
TCComponentListOfValues elov = listLov[e];
|
|
|
String disname=null;
|
|
|
for(int a=0;a<vals.length;a++) {
|
|
|
try {
|
|
|
disname = elov.getListOfValues().getDisplayableValue(vals[a]);
|
|
|
} catch (Exception e1) {
|
|
|
// TODO Auto-generated catch block
|
|
|
e1.printStackTrace();
|
|
|
}
|
|
|
if(disname!=null) {
|
|
|
disVal.add(disname);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
String[] comboxitems;
|
|
|
if(zcprolov!=null) {
|
|
|
if(yylyList.size()>0) {
|
|
|
comboxitems=new String[yylyList.size()];
|
|
|
for(int g=0;g<yylyList.size();g++) {
|
|
|
comboxitems[g]=yylyList.get(g);
|
|
|
}
|
|
|
|
|
|
nbox=new RwJComboBox(comboxitems);
|
|
|
nbox.setEditable(true);
|
|
|
nbox.setName(na);
|
|
|
nbox.setSize(new Dimension(60,40));
|
|
|
if(disVal.size()>0) {
|
|
|
StringBuilder sb=new StringBuilder();
|
|
|
for(int t=0;t<disVal.size();t++) {
|
|
|
if(t!=(vals.length-1)) {
|
|
|
|
|
|
sb.append(disVal.get(t));
|
|
|
sb.append(",");
|
|
|
}else {
|
|
|
sb.append(disVal.get(t));
|
|
|
}
|
|
|
}
|
|
|
JTextField ed=(JTextField)nbox.getEditor().getEditorComponent();
|
|
|
ed.setText(sb.toString());
|
|
|
}
|
|
|
|
|
|
comboxList.add(nbox);
|
|
|
}
|
|
|
}
|
|
|
parentPanel.add((n+i)+".2.center.top",nbox);
|
|
|
}else {
|
|
|
JComboBox zcBox=new JComboBox<String>();
|
|
|
zcBox.setSize(new Dimension(60,40));
|
|
|
zcBox.setName(ZC_LBJ_list.ZCPros.get(n));
|
|
|
TCProperty zclov = ((TCComponentItemRevision) targetComp).getTCProperty(ZC_LBJ_list.ZCPros.get(n));
|
|
|
TCComponentListOfValues zcprolov = zclov.getLOV();
|
|
|
String[] comboxitems;
|
|
|
JTextField jt=new JTextField(9);
|
|
|
JButton bu=new JButton("<22><><EFBFBD><EFBFBD>");
|
|
|
if(zcprolov!=null) {
|
|
|
comboxitems = zcprolov.getListOfValues().getLOVDisplayValues();
|
|
|
ComboBoxModel model = new DefaultComboBoxModel(comboxitems);
|
|
|
zcBox.setModel(model);
|
|
|
|
|
|
|
|
|
bu.addActionListener(new ActionListener() {
|
|
|
@Override
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
// TODO Auto-generated method stub
|
|
|
String tip=jt.getText();
|
|
|
System.out.println("<22><><EFBFBD><EFBFBD>"+tip);
|
|
|
if(tip.length()>0) {
|
|
|
SearchJComItem.changeBox(zcBox, tip);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
comboxList.add(zcBox);
|
|
|
}
|
|
|
|
|
|
zcBox.setSelectedItem(zc_lbj_map.get(ZC_LBJ_list.ZCPros.get(n)));
|
|
|
if((ZC_LBJ_list.ZCDisPros.get(n)).equals("<22><>ʱ<EFBFBD><CAB1><EFBFBD>ϱ<EFBFBD>ʶ")) {
|
|
|
zcBox.setSelectedIndex(-1);
|
|
|
}
|
|
|
parentPanel.add((n+i)+".2.center.top",zcBox);
|
|
|
parentPanel.add((n+i)+".3.center.top",jt);
|
|
|
parentPanel.add((n+i)+".4.center.top",bu);
|
|
|
}
|
|
|
} catch (TCException e1) {
|
|
|
// TODO Auto-generated catch block
|
|
|
e1.printStackTrace();
|
|
|
}
|
|
|
|
|
|
}else {
|
|
|
JTextField field=new JTextField(18);
|
|
|
field.setName(ZC_LBJ_list.ZCPros.get(n));
|
|
|
field.setText(zc_lbj_map.get(ZC_LBJ_list.ZCPros.get(n)));
|
|
|
parentPanel.add((n+i)+".2.center.top",field);
|
|
|
fieldList.add(field);
|
|
|
}
|
|
|
}
|
|
|
}else {
|
|
|
for(int n=0;n<ZC_LBJ_list.LBJPros.size();n++) {
|
|
|
System.out.println("ѭ<><D1AD><EFBFBD><EFBFBD>"+n+"<22><>,<2C><>Ҫ<EFBFBD><D2AA><EFBFBD>ӵ<EFBFBD><D3B5><EFBFBD><EFBFBD><EFBFBD>Ϊ"+ZC_LBJ_list.LBJDisPros.get(n)+"("+ZC_LBJ_list.LBJPros.get(n)+")");
|
|
|
parentPanel.add((n+i)+".1.center.top",new JLabel(ZC_LBJ_list.LBJDisPros.get(n)));
|
|
|
boolean b = ZC_LBJ_list.map.containsKey(ZC_LBJ_list.LBJPros.get(n));
|
|
|
if(b) {
|
|
|
try {
|
|
|
System.out.println("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Lov<6F><76><EFBFBD><EFBFBD>");
|
|
|
if(ZC_LBJ_list.LBJPros.get(n).equals("rb3_scgc1") ||ZC_LBJ_list.LBJPros.get(n).equals("rb3_yyly")) {
|
|
|
//System.out.println("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
String na=ZC_LBJ_list.LBJPros.get(n);
|
|
|
String[] vals = ((TCComponentItemRevision) targetComp).getTCProperty(na).getStringValueArray();
|
|
|
JComboBox nbox=new RwJComboBox(new String[] {""});
|
|
|
nbox.setEditable(true);
|
|
|
TCProperty zclov = ((TCComponentItemRevision) targetComp).getTCProperty(ZC_LBJ_list.LBJPros.get(n));
|
|
|
TCComponentListOfValues zcprolov = zclov.getLOV();
|
|
|
String[] comboxitems;
|
|
|
List<String> disVal=new ArrayList<String>();
|
|
|
for(int a=0;a<vals.length;a++) {
|
|
|
if(vals[a]!=null && !vals[a].equals("")) {
|
|
|
String disname = zcprolov.getListOfValues().getDisplayableValue(vals[a]);
|
|
|
|
|
|
disVal.add(disname);
|
|
|
}
|
|
|
}
|
|
|
if(zcprolov!=null) {
|
|
|
comboxitems = zcprolov.getListOfValues().getLOVDisplayValues();
|
|
|
//ComboBoxModel model = new DefaultComboBoxModel(comboxitems);
|
|
|
|
|
|
nbox=new RwJComboBox(comboxitems);
|
|
|
nbox.setEditable(true);
|
|
|
nbox.setName(na);
|
|
|
nbox.setSize(new Dimension(60,40));
|
|
|
if(disVal.size()>0) {
|
|
|
StringBuilder sb=new StringBuilder();
|
|
|
for(int t=0;t<disVal.size();t++) {
|
|
|
if(t!=(vals.length-1)) {
|
|
|
|
|
|
sb.append(disVal.get(t));
|
|
|
sb.append(",");
|
|
|
}else {
|
|
|
sb.append(disVal.get(t));
|
|
|
}
|
|
|
}
|
|
|
JTextField ed=(JTextField)nbox.getEditor().getEditorComponent();
|
|
|
ed.setText(sb.toString());
|
|
|
}
|
|
|
comboxList.add(nbox);
|
|
|
}
|
|
|
|
|
|
parentPanel.add((n+i)+".2.center.top",nbox);
|
|
|
}else {
|
|
|
JComboBox zcBox=new JComboBox<String>();
|
|
|
zcBox.setSize(new Dimension(60,40));
|
|
|
zcBox.setName(ZC_LBJ_list.LBJPros.get(n));
|
|
|
TCProperty zclov = ((TCComponentItemRevision) targetComp).getTCProperty(ZC_LBJ_list.LBJPros.get(n));
|
|
|
TCComponentListOfValues zcprolov = zclov.getLOV();
|
|
|
String[] comboxitems;
|
|
|
JTextField jt=new JTextField(9);
|
|
|
JButton bu=new JButton("<22><><EFBFBD><EFBFBD>");
|
|
|
if(zcprolov!=null) {
|
|
|
comboxitems = zcprolov.getListOfValues().getLOVDisplayValues();
|
|
|
ComboBoxModel model = new DefaultComboBoxModel(comboxitems);
|
|
|
zcBox.setModel(model);
|
|
|
|
|
|
|
|
|
bu.addActionListener(new ActionListener() {
|
|
|
@Override
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
// TODO Auto-generated method stub
|
|
|
String tip=jt.getText();
|
|
|
System.out.println("<22><><EFBFBD><EFBFBD>"+tip);
|
|
|
if(tip.length()>0) {
|
|
|
SearchJComItem.changeBox(zcBox, tip);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
comboxList.add(zcBox);
|
|
|
}
|
|
|
|
|
|
zcBox.setSelectedItem(zc_lbj_map.get(ZC_LBJ_list.LBJPros.get(n)));
|
|
|
if((ZC_LBJ_list.LBJDisPros.get(n)).equals("<22><>ʱ<EFBFBD><CAB1><EFBFBD>ϱ<EFBFBD>ʶ")) {
|
|
|
zcBox.setSelectedIndex(-1);
|
|
|
}
|
|
|
parentPanel.add((n+i)+".2.center.top",zcBox);
|
|
|
parentPanel.add((n+i)+".3.center.top",jt);
|
|
|
parentPanel.add((n+i)+".4.center.top",bu);
|
|
|
}
|
|
|
} catch (TCException e1) {
|
|
|
// TODO Auto-generated catch block
|
|
|
e1.printStackTrace();
|
|
|
}
|
|
|
}else {
|
|
|
JTextField field=new JTextField(18);
|
|
|
field.setName(ZC_LBJ_list.LBJPros.get(n));
|
|
|
field.setText(zc_lbj_map.get(ZC_LBJ_list.LBJPros.get(n)));
|
|
|
parentPanel.add((n+i)+".2.center.top",field);
|
|
|
fieldList.add(field);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//end <20>Ż<EFBFBD>
|
|
|
|
|
|
|
|
|
|
|
|
JPanel southPanel = new JPanel(new FlowLayout());
|
|
|
southPanel.setPreferredSize(new Dimension(250, 80));
|
|
|
JButton button = new JButton("<22><><EFBFBD><EFBFBD>");
|
|
|
JButton button1 = new JButton("ȡ<><C8A1>");
|
|
|
button.addActionListener(new ActionListener() {
|
|
|
|
|
|
@Override
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
// objList.clear();
|
|
|
// objList2.clear();
|
|
|
// lovList.clear();
|
|
|
// lovList2.clear();
|
|
|
createItem();
|
|
|
//disposeDialog();
|
|
|
}
|
|
|
|
|
|
});
|
|
|
button1.addActionListener(new ActionListener() {
|
|
|
@Override
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
disposeDialog();
|
|
|
}
|
|
|
|
|
|
});
|
|
|
southPanel.add(button);
|
|
|
southPanel.add(button1);
|
|
|
this.add("1.1.center.top",new JLabel(" "));
|
|
|
this.add("2.1.center.top",classJpanel);
|
|
|
this.add("3.1.center.top",southPanel);
|
|
|
pack();
|
|
|
centerToScreen(1.0D, 0.75D);
|
|
|
this.showDialog();
|
|
|
}
|
|
|
private void saveCOM2(String xmlClassName, Map<String, List<String>> attrMap, List<String> attrList,
|
|
|
List<String> esAttrList, List<String> markList,List<String> defaultValueList,List<String> isNList) {
|
|
|
if(attrMap.containsKey(xmlClassName)) {
|
|
|
List<String> nameMarkList = attrMap.get(xmlClassName);
|
|
|
String attrNames = nameMarkList.get(0);
|
|
|
String marks = nameMarkList.get(1);
|
|
|
String values = nameMarkList.get(2);
|
|
|
String isN = nameMarkList.get(3);
|
|
|
if(attrNames.contains(";")) {
|
|
|
String[] attrs = attrNames.split(";");
|
|
|
String[] markss = marks.split(";");
|
|
|
String[] valuess = values.split(";");
|
|
|
String[] isNs = isN.split(";");
|
|
|
for (int i = 0; i < attrs.length; i++) {
|
|
|
if(attrs[i].contains("+")) {
|
|
|
String[] attrss = attrs[i].split("\\+");
|
|
|
attrList.add(attrss[0]);
|
|
|
esAttrList.add(attrss[1]);
|
|
|
markList.add(markss[i]);
|
|
|
defaultValueList.add(valuess[i]);
|
|
|
isNList.add(isNs[i]);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
private void saveCOM(String xmlClassName, Map<String, List<String>> attrMap, List<String> attrList,
|
|
|
List<String> esAttrList, List<String> markList,List<String> isNList) {
|
|
|
if(attrMap.containsKey(xmlClassName)) {
|
|
|
List<String> nameMarkList = attrMap.get(xmlClassName);
|
|
|
String attrNames = nameMarkList.get(0);
|
|
|
String marks = nameMarkList.get(1);
|
|
|
String isN = nameMarkList.get(3);
|
|
|
if(attrNames.contains(";")) {
|
|
|
String[] attrs = attrNames.split(";");
|
|
|
String[] markss = marks.split(";");
|
|
|
String[] isNs = isN.split(";");
|
|
|
for (int i = 0; i < attrs.length; i++) {
|
|
|
if(attrs[i].contains("+")) {
|
|
|
String[] attrss = attrs[i].split("\\+");
|
|
|
attrList.add(attrss[0]);
|
|
|
esAttrList.add(attrss[1]);
|
|
|
markList.add(markss[i]);
|
|
|
isNList.add(isNs[i]);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
protected void createItem() {
|
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
List<TCComponent> zcList = null;
|
|
|
String jhID = "";
|
|
|
// List<String> asList = Arrays.asList(lovVal);
|
|
|
// List<String> esList = Arrays.asList(esLovVal);
|
|
|
// StringBuilder sb = new StringBuilder();
|
|
|
// for (int i = 0; i < attrList.size(); i++) {
|
|
|
// String attr = attrList.get(i);
|
|
|
// String esAttr = esAttrList.get(i);
|
|
|
// if(!("".equals(attr.trim()))) {
|
|
|
// JComboBox<String> box = null;
|
|
|
// if((PlmLocale.getString("RadialInternalClearance")).equals(attr)
|
|
|
// || (PlmLocale.getString("PartNumber")).equals(attr)) {
|
|
|
// box = boxMap.get(attr);
|
|
|
// }
|
|
|
// Object obj = objMap.get(attr);
|
|
|
// if(obj == null) {
|
|
|
// JTextField field = (JTextField)objMap.get(esAttr);
|
|
|
// if(box != null) {
|
|
|
// String fieldText = field.getText();
|
|
|
// String boxText = (String) box.getSelectedItem();
|
|
|
// if(!("".equals(fieldText.trim())) && !("".equals(boxText.trim()))) {
|
|
|
// MessageBox.post(esAttr+"<22><><EFBFBD><EFBFBD>ͬʱ<CDAC><CAB1>д<EFBFBD><D0B4><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><>ʾ", MessageBox.INFORMATION);
|
|
|
// return;
|
|
|
// }
|
|
|
// if("".equals(fieldText.trim()) && "".equals(boxText.trim())) {
|
|
|
// MessageBox.post(esAttr+"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>дһ<D0B4><D2BB>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><>ʾ", MessageBox.INFORMATION);
|
|
|
// return;
|
|
|
// }
|
|
|
// if(!("".equals(fieldText.trim()))) {
|
|
|
// objList.add(field);
|
|
|
// lovList.add("no");
|
|
|
// }else {
|
|
|
// objList.add(box);
|
|
|
// lovList.add("yes");
|
|
|
// }
|
|
|
// }else {
|
|
|
// objList.add(field);
|
|
|
// lovList.add(lovMap.get(esAttr));
|
|
|
// }
|
|
|
// }else {
|
|
|
// if(box != null) {
|
|
|
// JTextField field = (JTextField)obj;
|
|
|
// String fieldText = field.getText();
|
|
|
// String boxText = (String) box.getSelectedItem();
|
|
|
// if(!("".equals(fieldText.trim())) && !("".equals(boxText.trim()))) {
|
|
|
// MessageBox.post(attr+"<22><><EFBFBD><EFBFBD>ͬʱ<CDAC><CAB1>д<EFBFBD><D0B4><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><>ʾ", MessageBox.INFORMATION);
|
|
|
// return;
|
|
|
// }
|
|
|
// if("".equals(fieldText.trim()) && "".equals(boxText.trim())) {
|
|
|
// MessageBox.post(attr+"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>дһ<D0B4><D2BB>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><>ʾ", MessageBox.INFORMATION);
|
|
|
// return;
|
|
|
// }
|
|
|
// if(!("".equals(fieldText.trim()))) {
|
|
|
// objList.add(field);
|
|
|
// lovList.add("no");
|
|
|
// }else {
|
|
|
// objList.add(box);
|
|
|
// lovList.add("yes");
|
|
|
// }
|
|
|
// }else {
|
|
|
// objList.add(obj);
|
|
|
// lovList.add(lovMap.get(attr));
|
|
|
// }
|
|
|
// }
|
|
|
// }
|
|
|
// }
|
|
|
// for (int i = 0; i < attrList2.size(); i++) {
|
|
|
// String attr = attrList2.get(i);
|
|
|
// String esAttr = esAttrList2.get(i);
|
|
|
// if(!("".equals(attr.trim()))) {
|
|
|
// JComboBox<String> box = null;
|
|
|
// if((PlmLocale.getString("RadialInternalClearance")).equals(attr)
|
|
|
// || (PlmLocale.getString("PartNumber")).equals(attr)) {
|
|
|
// box = boxMap.get(attr);
|
|
|
// }
|
|
|
// Object obj = objMap2.get(attr);
|
|
|
// if(obj == null) {
|
|
|
// JTextField field = (JTextField)objMap.get(esAttr);
|
|
|
// if(box != null) {
|
|
|
// String fieldText = field.getText();
|
|
|
// String boxText = (String) box.getSelectedItem();
|
|
|
// if(!("".equals(fieldText.trim())) && !("".equals(boxText.trim()))) {
|
|
|
// MessageBox.post(esAttr+"<22><><EFBFBD><EFBFBD>ͬʱ<CDAC><CAB1>д<EFBFBD><D0B4><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><>ʾ", MessageBox.INFORMATION);
|
|
|
// return;
|
|
|
// }
|
|
|
// if("".equals(fieldText.trim()) && "".equals(boxText.trim())) {
|
|
|
// MessageBox.post(esAttr+"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>дһ<D0B4><D2BB>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><>ʾ", MessageBox.INFORMATION);
|
|
|
// return;
|
|
|
// }
|
|
|
// if(!("".equals(fieldText.trim()))) {
|
|
|
// objList2.add(field);
|
|
|
// lovList2.add("no");
|
|
|
// }else {
|
|
|
// objList2.add(box);
|
|
|
// lovList2.add("yes");
|
|
|
// }
|
|
|
// }else {
|
|
|
// objList2.add(field);
|
|
|
// lovList2.add(lovMap2.get(esAttr));
|
|
|
// }
|
|
|
// }else {
|
|
|
// if(box != null) {
|
|
|
// JTextField field = (JTextField)obj;
|
|
|
// String fieldText = field.getText();
|
|
|
// String boxText = (String) box.getSelectedItem();
|
|
|
// if(!("".equals(fieldText.trim())) && !("".equals(boxText.trim()))) {
|
|
|
// MessageBox.post(attr+"<22><><EFBFBD><EFBFBD>ͬʱ<CDAC><CAB1>д<EFBFBD><D0B4><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><>ʾ", MessageBox.INFORMATION);
|
|
|
// return;
|
|
|
// }
|
|
|
// if("".equals(fieldText.trim()) && "".equals(boxText.trim())) {
|
|
|
// MessageBox.post(attr+"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>дһ<D0B4><D2BB>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><>ʾ", MessageBox.INFORMATION);
|
|
|
// return;
|
|
|
// }
|
|
|
// if(!("".equals(fieldText.trim()))) {
|
|
|
// objList2.add(field);
|
|
|
// lovList2.add("no");
|
|
|
// }else {
|
|
|
// objList2.add(box);
|
|
|
// lovList2.add("yes");
|
|
|
// }
|
|
|
// }else {
|
|
|
// objList2.add(obj);
|
|
|
// lovList2.add(lovMap2.get(attr));
|
|
|
// }
|
|
|
// }
|
|
|
// }
|
|
|
// }
|
|
|
// for (int i = 0; i < objList.size(); i++) {
|
|
|
// String attrValue = "";
|
|
|
// if("yes".equals(lovList.get(i))) {
|
|
|
// String value = (String) ((JComboBox<String>) objList.get(i)).getSelectedItem();
|
|
|
// if(asList.contains(value) || esList.contains(value)) {
|
|
|
// value = "";
|
|
|
// }else {
|
|
|
// if(value.contains(":")) {
|
|
|
// System.out.println("value============"+value);
|
|
|
// String[] values = value.split(":");
|
|
|
// value = values[0];
|
|
|
// }else if(value.contains("<22><>")) {
|
|
|
// System.out.println("value============"+value);
|
|
|
// String[] values = value.split("<22><>");
|
|
|
// value = values[0];
|
|
|
// }
|
|
|
// }
|
|
|
// if("<22><>Ʒ<EFBFBD><C6B7>".equals(value)) {
|
|
|
// value = "";
|
|
|
// }else if("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>".equals(value)) {
|
|
|
// value = "C";
|
|
|
// }else if("<22>ȴ<EFBFBD><C8B4><EFBFBD><EFBFBD><EFBFBD>".equals(value)) {
|
|
|
// value = "R";
|
|
|
// }else if("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>".equals(value)) {
|
|
|
// value = "L";
|
|
|
// }else if("<22>ͼ<EFBFBD>".equals(value)) {
|
|
|
// value = "D";
|
|
|
// }
|
|
|
// attrValue = value;
|
|
|
// }else {
|
|
|
// attrValue = ((JTextField) objList.get(i)).getText();
|
|
|
// }
|
|
|
// String mark = markList.get(i);
|
|
|
// sb.append(mark.trim());
|
|
|
// sb.append(attrValue);
|
|
|
// }
|
|
|
// productNumber = sb.toString();
|
|
|
// System.out.println("productNumber============"+productNumber);
|
|
|
// StringBuilder sb2 = new StringBuilder();
|
|
|
// for (int i = 0; i < objList2.size(); i++) {
|
|
|
// String attrValue = "";
|
|
|
// String lov = lovList2.get(i);
|
|
|
// System.out.println("lov============="+lov);
|
|
|
// if("yes".equals(lovList2.get(i))) {
|
|
|
// String value = (String) ((JComboBox<String>) objList2.get(i)).getSelectedItem();
|
|
|
// if(asList.contains(value) || esList.contains(value)) {
|
|
|
// value = "";
|
|
|
// }else {
|
|
|
// if(value.contains(":")) {
|
|
|
// String[] values = value.split(":");
|
|
|
// value = values[0];
|
|
|
// }else if(value.contains("<22><>")) {
|
|
|
// String[] values = value.split("<22><>");
|
|
|
// value = values[0];
|
|
|
// }
|
|
|
// }
|
|
|
// if("<22><>Ʒ<EFBFBD><C6B7>".equals(value)) {
|
|
|
// value = "";
|
|
|
// }else if("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>".equals(value)) {
|
|
|
// value = "C";
|
|
|
// }else if("<22>ȴ<EFBFBD><C8B4><EFBFBD><EFBFBD><EFBFBD>".equals(value)) {
|
|
|
// value = "R";
|
|
|
// }else if("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>".equals(value)) {
|
|
|
// value = "L";
|
|
|
// }else if("<22>ͼ<EFBFBD>".equals(value)) {
|
|
|
// value = "D";
|
|
|
// }
|
|
|
// attrValue = value;
|
|
|
// }else {
|
|
|
// attrValue = ((JTextField) objList2.get(i)).getText();
|
|
|
// }
|
|
|
// System.out.println("attrValue=================="+attrValue);
|
|
|
// String mark = markList2.get(i);
|
|
|
// sb2.append(mark.trim());
|
|
|
// sb2.append(attrValue);
|
|
|
// }
|
|
|
if(classFlag) {
|
|
|
productNumber = splicValue(attrList,esAttrList,objMap,markList,isNList,lovMap);
|
|
|
drawingNumber = splicValue(attrList2,esAttrList2,objMap2,markList2,isNList2,lovMap2);
|
|
|
|
|
|
System.out.println("productNumber============"+productNumber);
|
|
|
System.out.println("drawingNumber============"+drawingNumber);
|
|
|
if(productNumber == null || drawingNumber == null) {
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
TCComponentItemRevision newRev = null;
|
|
|
String newID = "";
|
|
|
try {
|
|
|
TCComponentItemType typeComponent = (TCComponentItemType) session
|
|
|
.getTypeComponent(targetType);
|
|
|
if(flag) {
|
|
|
StringBuilder idSb = new StringBuilder(idField.getText());
|
|
|
String id = "";
|
|
|
if(idList != null && idList.size() > 0) {
|
|
|
JTextField idField = (JTextField) idList.get(0);
|
|
|
JComboBox<String> idbox = (JComboBox<String>) idList.get(1);
|
|
|
id = idField.getText();
|
|
|
String boxID = (String) idbox.getSelectedItem();
|
|
|
// if("".equals(id.trim()) && "".equals(boxID.trim())) {
|
|
|
// MessageBox.post("<22><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><>ʾ", MessageBox.INFORMATION);
|
|
|
// return;
|
|
|
// }
|
|
|
if("".equals(id.trim())) {
|
|
|
id = boxID;
|
|
|
|
|
|
}
|
|
|
|
|
|
jhID = id;
|
|
|
idSb.append(id);
|
|
|
}
|
|
|
String typeID = "";
|
|
|
if(typeList != null && typeList.size() > 0) {
|
|
|
JComboBox idComb = typeList.get(0);
|
|
|
typeID = (String) idComb.getSelectedItem();
|
|
|
if(typeID.contains(":")) {
|
|
|
typeID = typeID.split(":")[1];
|
|
|
}else if(typeID.contains("<22><>")) {
|
|
|
typeID = typeID.split("<22><>")[1];
|
|
|
}
|
|
|
if("<22><>Ʒ<EFBFBD><C6B7>".equals(typeID) || "Finished product".equals(typeID)) {
|
|
|
typeID = "";
|
|
|
}else if("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>".equals(typeID) || "Turning workpiece".equals(typeID)) {
|
|
|
typeID = "C";
|
|
|
}else if("<22>ȴ<EFBFBD><C8B4><EFBFBD><EFBFBD><EFBFBD>".equals(typeID) || "Heat treatment parts".equals(typeID)) {
|
|
|
typeID = "R";
|
|
|
}else if("<22><>շ<EFBFBD><D5B7><EFBFBD><EFBFBD><EFBFBD>伷<EFBFBD><E4BCB7>".equals(typeID) || "Cold rolled parts or cold extrusion parts".equals(typeID)) {
|
|
|
typeID = "D";
|
|
|
}else if("<22>ͼ<EFBFBD>".equals(typeID) || "Forge piece".equals(typeID)) {
|
|
|
typeID = "D";
|
|
|
}
|
|
|
idSb.append(typeID);
|
|
|
}
|
|
|
|
|
|
newID = idSb.toString();
|
|
|
String[] keys = new String[]{"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ID"};
|
|
|
String[] values = new String[]{idField.getText()};
|
|
|
zcList = queryObject("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ID", keys, values);
|
|
|
if(zcList != null) {
|
|
|
if(zcList.size() > 0) {
|
|
|
if(zcList.get(0) instanceof TCComponentItem) {
|
|
|
TCComponentItem zcItem = (TCComponentItem) zcList.get(0);
|
|
|
TCComponentItemRevision zcRev = zcItem.getLatestItemRevision();
|
|
|
TCProperty tcProperty = zcRev.getTCProperty("release_status_list");
|
|
|
TCComponent[] targets = tcProperty.getReferenceValueArray();
|
|
|
if(targets != null && targets.length >0) {
|
|
|
MessageBox.post("û<>й<EFBFBD><D0B9><EFBFBD><EFBFBD>е<EFBFBD><D0B5>ܳɰ汾<C9B0><E6B1BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!!","<22><>ʾ", MessageBox.WARNING);
|
|
|
return;
|
|
|
}
|
|
|
if(!classFlag) {
|
|
|
productNumber = zcRev.getStringProperty("rb3_th") + id;
|
|
|
drawingNumber = zcRev.getStringProperty("rb3_th") + id;
|
|
|
System.out.println("productNumber============"+productNumber);
|
|
|
System.out.println("drawingNumber============"+drawingNumber);
|
|
|
}
|
|
|
if("RB3_ZC".equals(targetType)) {
|
|
|
List<TCComponent> compList = queryObject("RBSearchZCCPH",
|
|
|
new String[] {"<22><>Ʒ<EFBFBD><C6B7>"}, new String[] {productNumber});
|
|
|
if(compList != null ) {
|
|
|
if( compList.size() > 0) {
|
|
|
//<2F>Ż<EFBFBD>
|
|
|
String nID=newID.substring(0,2);
|
|
|
|
|
|
|
|
|
|
|
|
for(int j=0;j<compList.size();j++) {
|
|
|
System.out.println("<22>ж<EFBFBD>item_idǰ<64><C7B0>λ<EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>ͬ");
|
|
|
String compID = compList.get(j).getProperty("item_id");
|
|
|
String cID=compID.substring(0, 2);
|
|
|
if(nID.equals(cID)) {
|
|
|
MessageBox.post("ϵͳ<CFB5><CDB3><EFBFBD>Ѵ<EFBFBD><D1B4>ڲ<EFBFBD>Ʒ<EFBFBD><C6B7>Ϊ" + productNumber + "<22><><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD><CFA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룡<EFBFBD><EBA3A1><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD>", MessageBox.INFORMATION);
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
//end<6E>Ż<EFBFBD>
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}else if("RB3_LBJ".equals(targetType)) {
|
|
|
List<TCComponent> compList = queryObject("RBSearchLBJCPH",
|
|
|
new String[] {"<22><>Ʒ<EFBFBD><C6B7>"}, new String[] {productNumber});
|
|
|
if(compList != null ) {
|
|
|
if(compList.size() > 0) {
|
|
|
//<2F>Ż<EFBFBD>
|
|
|
String nID=newID.substring(0,2);
|
|
|
|
|
|
|
|
|
|
|
|
for(int j=0;j<compList.size();j++) {
|
|
|
System.out.println("<22>ж<EFBFBD>item_idǰ<64><C7B0>λ<EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>ͬ");
|
|
|
String compID = compList.get(j).getProperty("item_id");
|
|
|
String cID=compID.substring(0, 2);
|
|
|
if(nID.equals(cID)) {
|
|
|
MessageBox.post("ϵͳ<CFB5><CDB3><EFBFBD>Ѵ<EFBFBD><D1B4>ڲ<EFBFBD>Ʒ<EFBFBD><C6B7>Ϊ" + productNumber + "<22><><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD><CFA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룡<EFBFBD><EBA3A1><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD>", MessageBox.INFORMATION);
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
//end<6E>Ż<EFBFBD>
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}else {
|
|
|
MessageBox.post("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܳ<EFBFBD><DCB3><EFBFBD><EFBFBD><EFBFBD>ID<49><44>ϵͳ<CFB5><CDB3>δ<EFBFBD><CEB4><EFBFBD>ڣ<EFBFBD><DAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룡<EFBFBD><EBA3A1><EFBFBD><EFBFBD>",
|
|
|
"<22><><EFBFBD><EFBFBD>", MessageBox.INFORMATION);
|
|
|
return;
|
|
|
}
|
|
|
}else {
|
|
|
TCUserService userservice = session.getUserService();
|
|
|
Object[] params = { targetRev.getStringProperty("item_id").substring(0, 6), 4,
|
|
|
1, 9999, 1, "" };
|
|
|
try {
|
|
|
String str = "";// DM,8,400,99999999,1,""
|
|
|
newID = (String) userservice.call("queryPartNo", params);
|
|
|
System.out.println("newID==============="+newID);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
bsNumber = splicValue(attrList3,esAttrList3,objMap3,markList3,isNList3,lovMap3);
|
|
|
smNumber = splicValue(attrList4,esAttrList4,objMap4,markList4,isNList4,lovMap4);
|
|
|
System.out.println("bsNumber============"+bsNumber);
|
|
|
System.out.println("smNumber============"+smNumber);
|
|
|
if(bsNumber == null || smNumber == null) {
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
String[] keys = new String[]{"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ID"};
|
|
|
String[] values = new String[]{newID};
|
|
|
List<TCComponent> compList = queryObject("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ID", keys, values);
|
|
|
if(compList != null) {
|
|
|
if(compList.size() > 0) {
|
|
|
MessageBox.post("ϵͳ<CFB5><CDB3><EFBFBD>Ѵ<EFBFBD><D1B4><EFBFBD>idΪ"+newID+"<22><><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD><CFA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룡<EFBFBD><EBA3A1><EFBFBD><EFBFBD>",
|
|
|
"<22><><EFBFBD><EFBFBD>", MessageBox.INFORMATION);
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
String revID = (String) revComb.getSelectedItem();
|
|
|
String name = nameField.getText();
|
|
|
TCComponentItem newItem = typeComponent.create(newID,revID, targetType,
|
|
|
name, "", null);
|
|
|
if (newItem != null) {
|
|
|
session.getUser().getHomeFolder()
|
|
|
.add("contents", newItem);
|
|
|
session.getUser().getHomeFolder().refresh();
|
|
|
}
|
|
|
String statu = "";
|
|
|
if ("A1".equals(revID)) {
|
|
|
statu = "<22><>:Conceptual design";
|
|
|
} else if ("B1".equals(revID)) {
|
|
|
statu = "<22><>:Product design";
|
|
|
} else if ("R1".equals(revID)) {
|
|
|
statu = "<22><>:Process design/Sample delivery";
|
|
|
} else if ("P1".equals(revID)) {
|
|
|
statu = "P:Pilot production/small batch";
|
|
|
} else if ("M1".equals(revID)) {
|
|
|
statu = "M:Mass production";
|
|
|
}
|
|
|
newRev = newItem.getLatestItemRevision();
|
|
|
newRev.setStringProperty("rb3_th", drawingNumber);
|
|
|
newRev.setStringProperty("rb3_cph", productNumber);
|
|
|
newRev.setStringProperty("rb3_smzqzt", statu);
|
|
|
if(!("".equals(jhID))) {
|
|
|
newRev.setStringProperty("rb3_jh", jhID);
|
|
|
}
|
|
|
if(!("".equals(bsNumber))) {
|
|
|
newRev.setStringProperty("rb3_bsh", bsNumber);
|
|
|
newRev.setStringProperty("rb3_sm2", smNumber);
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//<2F>Ż<EFBFBD>
|
|
|
for(int k=0;k<fieldList.size();k++){
|
|
|
JTextField jt = (JTextField)fieldList.get(k);
|
|
|
String key=jt.getName();
|
|
|
String val=jt.getText();
|
|
|
fieldmap.put(key, val);
|
|
|
}
|
|
|
for(int m=0;m<comboxList.size();m++) {
|
|
|
JComboBox cbo=(JComboBox)comboxList.get(m);
|
|
|
String key=cbo.getName();
|
|
|
System.out.println("combox<6F><78>NameΪ:"+key);
|
|
|
if(key.equals("rb3_scgc1")||key.equals("rb3_yyly")) {
|
|
|
JTextField ed=(JTextField)cbo.getEditor().getEditorComponent();
|
|
|
String text = ed.getText();
|
|
|
|
|
|
if(!text.equals("") && text!=null) {
|
|
|
List<String> proList=new ArrayList<>();
|
|
|
String[] split = text.split(",");
|
|
|
TCProperty tclov = ((TCComponentItemRevision) targetComp).getTCProperty(key);
|
|
|
TCComponentListOfValues lov = tclov.getLOV();
|
|
|
for(int p=0;p<split.length;p++) {
|
|
|
String realVal=(String)lov.getListOfValues().getRealValue(split[p]);
|
|
|
proList.add(realVal);
|
|
|
}
|
|
|
Object[] array = proList.toArray();
|
|
|
String[] svals=new String[array.length];
|
|
|
for(int s=0;s<array.length;s++) {
|
|
|
svals[s]=(String)array[s];
|
|
|
}
|
|
|
newRev.getTCProperty(key).setStringValueArray(svals);
|
|
|
}
|
|
|
}else {
|
|
|
String val=(String) cbo.getSelectedItem();
|
|
|
TCProperty tclov = ((TCComponentItemRevision) targetComp).getTCProperty(key);
|
|
|
TCComponentListOfValues lov = tclov.getLOV();
|
|
|
String realVal = (String)lov.getListOfValues().getRealValue(val);
|
|
|
System.out.println("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD>е<EFBFBD>ֵΪ:"+val);
|
|
|
comboxmap.put(key,realVal);
|
|
|
}
|
|
|
}
|
|
|
newRev.setProperties(fieldmap);
|
|
|
newRev.setProperties(comboxmap);
|
|
|
//end<6E>Ż<EFBFBD>
|
|
|
|
|
|
|
|
|
|
|
|
TCTypeService typeService = session.getTypeService();
|
|
|
TCComponentBOMWindowType winType =
|
|
|
(TCComponentBOMWindowType) typeService.getTypeComponent("BOMWindow");
|
|
|
//<2F><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>µ<EFBFBD>window
|
|
|
TCComponentBOMWindow view = winType.create(null);
|
|
|
if(flag) {
|
|
|
newRev.setStringProperty("rb3_lbjlx", type);
|
|
|
if(zcList !=null) {
|
|
|
if(zcList.get(0) instanceof TCComponentItem) {
|
|
|
TCComponentItem zcItem = (TCComponentItem) zcList.get(0);
|
|
|
TCComponentItemRevision zcRev = zcItem.getLatestItemRevision();
|
|
|
//<2F><><EFBFBD><EFBFBD>
|
|
|
view.lock();
|
|
|
//<2F><><EFBFBD>ö<EFBFBD><C3B6><EFBFBD><EFBFBD><EFBFBD>bomline
|
|
|
TCComponentBOMLine line = view.setWindowTopLine(zcItem,
|
|
|
zcRev, null, null);
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>bomline
|
|
|
TCComponentBOMLine childBomline = line.add(newRev.getItem(), newRev, null, false, "");
|
|
|
//<2F><><EFBFBD><EFBFBD>
|
|
|
view.save();
|
|
|
//<2F><><EFBFBD><EFBFBD>
|
|
|
view.unlock();
|
|
|
//<2F>ر<EFBFBD>
|
|
|
view.close();
|
|
|
}
|
|
|
}
|
|
|
}else {
|
|
|
List<TCComponentItemRevision> revList = new ArrayList<TCComponentItemRevision>();
|
|
|
//<2F><><EFBFBD>ö<EFBFBD><C3B6><EFBFBD><EFBFBD><EFBFBD>bomline
|
|
|
TCComponentBOMLine line = view.setWindowTopLine(targetRev.getItem(),
|
|
|
targetRev, null, null);
|
|
|
//<2F><><EFBFBD><EFBFBD>BOMLINE<4E>µ<EFBFBD><C2B5><EFBFBD>bomline
|
|
|
AIFComponentContext[] contexts = line.getChildren();
|
|
|
for(AIFComponentContext context : contexts){
|
|
|
InterfaceAIFComponent child = context.getComponent();
|
|
|
if(child instanceof TCComponentBOMLine){
|
|
|
TCComponentBOMLine childLine = (TCComponentBOMLine) child;
|
|
|
TCComponentItemRevision itemRevision = childLine.getItemRevision();
|
|
|
revList.add(itemRevision);
|
|
|
}
|
|
|
}
|
|
|
//<2F>ر<EFBFBD>
|
|
|
view.close();
|
|
|
view = winType.create(null);
|
|
|
//<2F><><EFBFBD><EFBFBD>
|
|
|
view.lock();
|
|
|
//<2F><><EFBFBD>ö<EFBFBD><C3B6><EFBFBD><EFBFBD><EFBFBD>bomline
|
|
|
TCComponentBOMLine line1 = view.setWindowTopLine(newRev.getItem(),
|
|
|
newRev, null, null);
|
|
|
for(TCComponentItemRevision revComp : revList){
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>bomline
|
|
|
TCComponentBOMLine childBomline =
|
|
|
line1.add(revComp.getItem(), revComp, null, false, "");
|
|
|
}
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>
|
|
|
view.save();
|
|
|
//<2F><><EFBFBD><EFBFBD>
|
|
|
view.unlock();
|
|
|
//<2F>ر<EFBFBD>
|
|
|
view.close();
|
|
|
newRev.setStringProperty("rb3_zclx", type);
|
|
|
}
|
|
|
TCComponent[] references = targetRev.getReferenceListProperty("TC_Is_Represented_By");
|
|
|
for (int i = 0; i < references.length; i++) {
|
|
|
if(references[i] instanceof TCComponentItemRevision) {
|
|
|
TCComponentItemRevision pic = (TCComponentItemRevision) references[i];
|
|
|
newRev.add("TC_Is_Represented_By", pic);
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
// TODO Auto-generated catch block
|
|
|
MessageBox.post("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!!!!", "<22><>ʾ", MessageBox.INFORMATION);
|
|
|
e.printStackTrace();
|
|
|
return;
|
|
|
}
|
|
|
List<String> vals = new ArrayList<String>();
|
|
|
for (Map<String,Object> value : values) {
|
|
|
for (Map.Entry<String,Object> entry : value.entrySet()) {
|
|
|
String type = entry.getKey();
|
|
|
if(type.equals("JComboBox")){
|
|
|
JComboBox<String> comb1 = (JComboBox<String>) entry.getValue();
|
|
|
String val = (String) comb1.getSelectedItem();
|
|
|
vals.add(val);
|
|
|
}else{
|
|
|
JTextField field1 = (JTextField) entry.getValue();
|
|
|
String val = field1.getText();
|
|
|
vals.add(val);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
Integer[] classKeys = new Integer[classList.size()];
|
|
|
String[] classVals = new String[classList.size()];
|
|
|
System.out.println("size============================"+classList.size());
|
|
|
for(int i=0;i<labels1.length;i++){
|
|
|
String val = vals.get(i);
|
|
|
if(val == null || val.trim()==""){
|
|
|
continue;
|
|
|
}
|
|
|
String val2 = "";
|
|
|
if (classList.get(i).isIslov()) {
|
|
|
val2 = classList.get(i).getLov().get(val);// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵֵ
|
|
|
System.out.println("val2================"+val2);
|
|
|
System.out.println("val================"+val);
|
|
|
} else {
|
|
|
val2 = val;
|
|
|
}
|
|
|
classKeys[i] = classList.get(i).getId();
|
|
|
String attrName = classList.get(i).getName();
|
|
|
if((PlmLocaleUtil.getString("RadialInternalClearance")).equals(attrName)
|
|
|
|| (PlmLocaleUtil.getString("PartNumber")).equals(attrName)) {
|
|
|
if("".equals(val2.trim())) {
|
|
|
JComboBox<String> box = boxMap.get(attrName);
|
|
|
val2 = (String) box.getSelectedItem();
|
|
|
}
|
|
|
}
|
|
|
classVals[i] = val2;
|
|
|
}
|
|
|
sendObjToClassficationByWebService(className,newRev, classKeys, classVals);//<2F><><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD>
|
|
|
disposeDialog();
|
|
|
MessageBox.post("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>!!!!", "<22><><EFBFBD><EFBFBD>", MessageBox.INFORMATION);
|
|
|
|
|
|
}
|
|
|
/**
|
|
|
* <20><><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD>
|
|
|
*/
|
|
|
public void sendObjToClassficationByWebService(String class_id,
|
|
|
TCComponentItemRevision rev, Integer[] keys, String[] vals) {
|
|
|
try {
|
|
|
System.out.println("class_id-----dddddd----->" + class_id);
|
|
|
if (!class_id.replace(" ", "").equals("")) {
|
|
|
|
|
|
List<ClassProperty> propList = new ArrayList<ClassProperty>();
|
|
|
|
|
|
for (int i = 0; i < keys.length; i++) {
|
|
|
|
|
|
if(keys[i] != null && vals[i] != null) {
|
|
|
ClassProperty prop = new ClassProperty(keys[i], vals[i]);// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
propList.add(prop);
|
|
|
}
|
|
|
}
|
|
|
String json = SoaServerUtil.objectToJson(propList);// <20><>Java<76><61><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>Ϊjson<6F><6E><EFBFBD><EFBFBD>
|
|
|
SoaServerUtil.grantWritePrivilege(session, rev);// <20><><EFBFBD><EFBFBD>дȨ<D0B4><C8A8>
|
|
|
SoaServerUtil.sendToClass(rev.getUid(), class_id, json, url);// <20><><EFBFBD>͵<EFBFBD><CDB5><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
SoaServerUtil.grantReadPrivilege(session, rev);// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><C8A8>
|
|
|
}
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* ͨ<><CDA8><EFBFBD><EFBFBD>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ<EFBFBD><D1AF>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>
|
|
|
*
|
|
|
* @param queryName <20><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>
|
|
|
* @param keys <20><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>
|
|
|
* @param values <20><>ѯֵ
|
|
|
* @return
|
|
|
*/
|
|
|
public List<TCComponent> queryObject(String queryName, String[] keys, String[] values) {
|
|
|
TCComponent[] components = null;
|
|
|
try {
|
|
|
TCComponentQueryType queryType = (TCComponentQueryType) session.getTypeComponent("ImanQuery");
|
|
|
TCComponentQuery query = (TCComponentQuery) queryType.find(queryName);
|
|
|
if (query == null) {
|
|
|
MessageBox.post("û<><C3BB><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>ѯ:" + queryName, "<22><><EFBFBD><EFBFBD>", MessageBox.ERROR);
|
|
|
return null;
|
|
|
}
|
|
|
components = query.execute(keys, values);
|
|
|
} catch (TCException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
if (components != null && components.length > 0) {
|
|
|
List<TCComponent> compList = Arrays.asList(components);
|
|
|
return compList;
|
|
|
} else {
|
|
|
return null;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public String splicValue(List<String> attrList,List<String> esAttrList,
|
|
|
Map<String,Object> map,List<String> markList,List<String> isNList,Map<String,String> lovMap) {
|
|
|
// List<String> asList = Arrays.asList(lovVal);
|
|
|
// List<String> esList = Arrays.asList(esLovVal);
|
|
|
List<Object> objList = new ArrayList<Object>();
|
|
|
List<String> lovList = new ArrayList<String>();
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
for (int i = 0; i < attrList.size(); i++) {
|
|
|
String attr = attrList.get(i);
|
|
|
System.out.println("attr======112"+attr);
|
|
|
String esAttr = esAttrList.get(i);
|
|
|
if(map.get(attr) == null && map.get(esAttr) == null) {
|
|
|
if((PlmLocaleUtil.getString("PartNumber")).equals(attr) ||
|
|
|
(PlmLocaleUtil.getString("PartNumber")).equals(esAttr)) {
|
|
|
JComboBox<String> idbox = boxMap.get(PlmLocaleUtil.getString("PartNumber"));
|
|
|
JTextField idfield = (JTextField) idList.get(0);
|
|
|
String fieldText = idfield.getText();
|
|
|
String boxText = (String) idbox.getSelectedItem();
|
|
|
if(!("".equals(fieldText.trim())) && !("".equals(boxText.trim()))) {
|
|
|
MessageBox.post(PlmLocaleUtil.getString("PartNumber")+"<22><><EFBFBD><EFBFBD>ͬʱ<CDAC><CAB1>д<EFBFBD><D0B4><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><>ʾ", MessageBox.INFORMATION);
|
|
|
return null;
|
|
|
}
|
|
|
// if("".equals(fieldText.trim()) && "".equals(boxText.trim())) {
|
|
|
// MessageBox.post(PlmLocaleUtil.getString("PartNumber")+"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>дһ<D0B4><D2BB>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><>ʾ", MessageBox.INFORMATION);
|
|
|
// return null;
|
|
|
// }
|
|
|
if(!("".equals(fieldText.trim()))) {
|
|
|
objList.add(idfield);
|
|
|
lovList.add("no");
|
|
|
}else {
|
|
|
objList.add(idbox);
|
|
|
lovList.add("yes");
|
|
|
}
|
|
|
continue;
|
|
|
}
|
|
|
objList.add(defaultValueList.get(i));
|
|
|
lovList.add("string");
|
|
|
continue;
|
|
|
}
|
|
|
if(!("".equals(attr.trim()))) {
|
|
|
Object obj = map.get(attr);
|
|
|
JComboBox<String> box = null;
|
|
|
if((PlmLocaleUtil.getString("RadialInternalClearance")).equals(attr)) {
|
|
|
box = boxMap.get(attr);
|
|
|
}
|
|
|
if((PlmLocaleUtil.getString("RadialInternalClearance")).equals(esAttr)) {
|
|
|
box = boxMap.get(esAttr);
|
|
|
}
|
|
|
if(obj == null) {
|
|
|
obj = map.get(esAttr);
|
|
|
if(box != null) {
|
|
|
JTextField field = (JTextField)obj;
|
|
|
String fieldText = field.getText();
|
|
|
String boxText = (String) box.getSelectedItem();
|
|
|
if(!("".equals(fieldText.trim())) && !("".equals(boxText.trim()))) {
|
|
|
MessageBox.post(esAttr+"<22><><EFBFBD><EFBFBD>ͬʱ<CDAC><CAB1>д<EFBFBD><D0B4><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><>ʾ", MessageBox.INFORMATION);
|
|
|
return null;
|
|
|
}
|
|
|
if("".equals(fieldText.trim()) && "".equals(boxText.trim())) {
|
|
|
MessageBox.post(esAttr+"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>дһ<D0B4><D2BB>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><>ʾ", MessageBox.INFORMATION);
|
|
|
return null;
|
|
|
}
|
|
|
if(!("".equals(fieldText.trim()))) {
|
|
|
objList.add(field);
|
|
|
lovList.add("no");
|
|
|
}else {
|
|
|
objList.add(box);
|
|
|
lovList.add("yes");
|
|
|
}
|
|
|
}else {
|
|
|
objList.add(obj);
|
|
|
lovList.add(lovMap.get(esAttr));
|
|
|
}
|
|
|
}else {
|
|
|
if(box != null) {
|
|
|
JTextField field = (JTextField)obj;
|
|
|
String fieldText = field.getText();
|
|
|
String boxText = (String) box.getSelectedItem();
|
|
|
if(!("".equals(fieldText.trim())) && !("".equals(boxText.trim()))) {
|
|
|
MessageBox.post(attr+"<22><><EFBFBD><EFBFBD>ͬʱ<CDAC><CAB1>д<EFBFBD><D0B4><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><>ʾ", MessageBox.INFORMATION);
|
|
|
return null;
|
|
|
}
|
|
|
if("".equals(fieldText.trim()) && "".equals(boxText.trim())) {
|
|
|
MessageBox.post(attr+"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>дһ<D0B4><D2BB>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><>ʾ", MessageBox.INFORMATION);
|
|
|
return null;
|
|
|
}
|
|
|
if(!("".equals(fieldText.trim()))) {
|
|
|
objList.add(field);
|
|
|
lovList.add("no");
|
|
|
}else {
|
|
|
objList.add(box);
|
|
|
lovList.add("yes");
|
|
|
}
|
|
|
}else {
|
|
|
objList.add(obj);
|
|
|
lovList.add(lovMap.get(attr));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
for (int i = 0; i < objList.size(); i++) {
|
|
|
String attrValue = "";
|
|
|
Object obj = objList.get(i);
|
|
|
if(obj != null ) {
|
|
|
if("yes".equals(lovList.get(i))) {
|
|
|
String value = (String) ((JComboBox<String>) obj).getSelectedItem();
|
|
|
if(asList.contains(value) || esList.contains(value)) {
|
|
|
if(isNList.get(i).trim().contains(value)) {
|
|
|
if(value.contains(":")) {
|
|
|
System.out.println("value============"+value);
|
|
|
String[] values = value.split(":");
|
|
|
value = values[0];
|
|
|
}else if(value.contains("<22><>")) {
|
|
|
System.out.println("value============"+value);
|
|
|
String[] values = value.split("<22><>");
|
|
|
value = values[0];
|
|
|
}
|
|
|
}else {
|
|
|
value = "";
|
|
|
}
|
|
|
}else {
|
|
|
if(value.contains(":")) {
|
|
|
System.out.println("value============"+value);
|
|
|
String[] values = value.split(":");
|
|
|
value = values[0];
|
|
|
}else if(value.contains("<22><>")) {
|
|
|
System.out.println("value============"+value);
|
|
|
String[] values = value.split("<22><>");
|
|
|
value = values[0];
|
|
|
}
|
|
|
}
|
|
|
if("<22><>Ʒ<EFBFBD><C6B7>".equals(value) || "Finished product".equals(value)) {
|
|
|
value = "";
|
|
|
}else if("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>".equals(value) || "Turning workpiece".equals(value)) {
|
|
|
value = "C";
|
|
|
}else if("<22>ȴ<EFBFBD><C8B4><EFBFBD><EFBFBD><EFBFBD>".equals(value) || "Heat treatment parts".equals(value)) {
|
|
|
value = "R";
|
|
|
}else if("<22><>շ<EFBFBD><D5B7><EFBFBD><EFBFBD><EFBFBD>伷<EFBFBD><E4BCB7>".equals(value) || "Cold rolled parts or cold extrusion parts".equals(value)) {
|
|
|
value = "D";
|
|
|
}else if("<22>ͼ<EFBFBD>".equals(value) || "Forge piece".equals(value)) {
|
|
|
value = "D";
|
|
|
}
|
|
|
attrValue = value;
|
|
|
}else if("no".equals(lovList.get(i))){
|
|
|
attrValue = ((JTextField) obj).getText();
|
|
|
|
|
|
}else {
|
|
|
attrValue = (String) obj;
|
|
|
}
|
|
|
if(asList.contains(attrValue) || esList.contains(attrValue)) {
|
|
|
attrValue = "";
|
|
|
}else {
|
|
|
if(attrValue.contains(":")) {
|
|
|
System.out.println("attrValue============"+attrValue);
|
|
|
String[] values = attrValue.split(":");
|
|
|
attrValue = values[0];
|
|
|
}else if(attrValue.contains("<22><>")) {
|
|
|
System.out.println("attrValue============"+attrValue);
|
|
|
String[] values = attrValue.split("<22><>");
|
|
|
attrValue = values[0];
|
|
|
}
|
|
|
}
|
|
|
|
|
|
String mark = markList.get(i);
|
|
|
System.out.println("mark============"+mark);
|
|
|
if(!("".equals(attrValue.trim())) && mark != null) {
|
|
|
sb.append(mark.trim());
|
|
|
sb.append(attrValue);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return sb.toString();
|
|
|
}
|
|
|
}
|