main
李建辉 5 months ago
parent 0dfbaeede6
commit 04aff3093f

@ -28,6 +28,7 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map.Entry; import java.util.Map.Entry;
@ -501,9 +502,10 @@ public class MpartDialog extends JFrame implements ActionListener {
} else { } else {
AIFComponentContext[] children = topLine.getChildren(); AIFComponentContext[] children = topLine.getChildren();
ArrayList<TCComponentItemRevision> addList = new ArrayList<TCComponentItemRevision>();// mbomµÄ×Ó //ArrayList<TCComponentItemRevision> addList = new ArrayList<TCComponentItemRevision>();// mbomµÄ×Ó
LinkedHashMap<TCComponentItemRevision, String> addList = new LinkedHashMap<TCComponentItemRevision, String>();
ArrayList<String> childrenList = new ArrayList<String>();// 下拉框选中的值 ArrayList<String> childrenList = new ArrayList<String>();// 下拉框选中的值
HashMap<String, TCComponentItemRevision> revMap = new HashMap<String, TCComponentItemRevision>();// object_String HashMap<String, ArrayList<Object>> revMap = new HashMap<String, ArrayList<Object>>();// object_String
StringBuilder errMsg = new StringBuilder(); StringBuilder errMsg = new StringBuilder();
for (int j = 0; j < children.length; j++) { for (int j = 0; j < children.length; j++) {
@ -551,6 +553,11 @@ public class MpartDialog extends JFrame implements ActionListener {
for (int j = 0; j < children.length; j++) { for (int j = 0; j < children.length; j++) {
TCComponentBOMLine eLine = (TCComponentBOMLine) children[j].getComponent(); TCComponentBOMLine eLine = (TCComponentBOMLine) children[j].getComponent();
//»ñÈ¡ÊýÁ¿
String sl = eLine.getProperty("bl_quantity");
// 判断是否自制 // 判断是否自制
TCComponentItemRevision eRev = eLine.getItemRevision(); TCComponentItemRevision eRev = eLine.getItemRevision();
String tcProperty = eRev.getTCProperty("ly6_homemadeStatus").toString(); String tcProperty = eRev.getTCProperty("ly6_homemadeStatus").toString();
@ -577,7 +584,7 @@ public class MpartDialog extends JFrame implements ActionListener {
// } else // } else
if (tempMrevList.size() == 1) { if (tempMrevList.size() == 1) {
// 把M放bom下 // 把M放bom下
addList.add(tempMrevList.get(0)); addList.put(tempMrevList.get(0),sl);
} else if (tempMrevList.size() > 1) { } else if (tempMrevList.size() > 1) {
// 让用户选一个M放bom下 // 让用户选一个M放bom下
@ -585,7 +592,10 @@ public class MpartDialog extends JFrame implements ActionListener {
for (int k = 0; k < tempMrevList.size(); k++) { for (int k = 0; k < tempMrevList.size(); k++) {
String stringProperty = tempMrevList.get(k) String stringProperty = tempMrevList.get(k)
.getStringProperty("object_string"); .getStringProperty("object_string");
revMap.put(stringProperty, tempMrevList.get(k)); ArrayList<Object> tempList = new ArrayList<Object>();
tempList.add(tempMrevList.get(k));
tempList.add(sl);
revMap.put(stringProperty, tempList);
jComboBox.addItem(stringProperty); jComboBox.addItem(stringProperty);
} }
@ -605,7 +615,7 @@ public class MpartDialog extends JFrame implements ActionListener {
} else { } else {
// 不为自制则直接将EPart搭建进入MBOM中 // 不为自制则直接将EPart搭建进入MBOM中
addList.add(eRev); addList.put(eRev,sl);
} }
} }
@ -760,16 +770,30 @@ public class MpartDialog extends JFrame implements ActionListener {
System.out.println("childrenList.size()=======" + childrenList.size()); System.out.println("childrenList.size()=======" + childrenList.size());
for (int j = 0; j < childrenList.size(); j++) { for (int j = 0; j < childrenList.size(); j++) {
addList.add(revMap.get(childrenList.get(j))); ArrayList<Object> temp = revMap.get(childrenList.get(j));
TCComponentItemRevision object = (TCComponentItemRevision)temp.get(0);
String tempSl = (String)temp.get(1);
addList.put(object,tempSl);
} }
System.out.println("addList.size()============" + addList.size()); System.out.println("addList.size()============" + addList.size());
for (int j = 0; j < addList.size(); j++) {
mTopLine.add(addList.get(j).getItem(), addList.get(j), null, false, ""); for (Entry<TCComponentItemRevision, String> tempAddList : addList.entrySet()) {
TCComponentItemRevision key = tempAddList.getKey();
String value = tempAddList.getValue();
if(value != null && value.equals("1")) {
mTopLine.add(key.getItem(), key, null, false, "");
}else {
TCComponentBOMLine add = mTopLine.add(key.getItem(), key, null, false, "");
System.out.println("add=================="+add.getUid());
add.setProperty("bl_quantity", value);
}
} }
mTopLine.save(); mTopLine.save();
view.save(); view.save();
view.close(); view.close();

Loading…
Cancel
Save