diff --git a/com.connor.chint.wuhan/plugin.xml b/com.connor.chint.wuhan/plugin.xml index 06057e7..8c22fb6 100644 --- a/com.connor.chint.wuhan/plugin.xml +++ b/com.connor.chint.wuhan/plugin.xml @@ -12,6 +12,7 @@ + @@ -57,6 +58,7 @@ + @@ -461,6 +463,29 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/com.connor.chint.wuhan/src/com/chint/plm/applyMatnr/ApplyMatnrOp.java b/com.connor.chint.wuhan/src/com/chint/plm/applyMatnr/ApplyMatnrOp.java index 90688f9..8cc7aeb 100644 --- a/com.connor.chint.wuhan/src/com/chint/plm/applyMatnr/ApplyMatnrOp.java +++ b/com.connor.chint.wuhan/src/com/chint/plm/applyMatnr/ApplyMatnrOp.java @@ -348,7 +348,13 @@ public class ApplyMatnrOp extends AbstractAIFOperation { my = new MyProgressBarCompent("Ƽ", "ڶȡBOM......"); System.out.println("===============ʼȡ Ƽͨͼֽ==============="); long time33 = System.nanoTime(); + + long time1 = System.nanoTime(); Map listBOM = BomToSapUtil.getBomLineTreeNodeSOA(bomline); + System.out.println("listBOM.size=================="+listBOM.size()); + long time2 = System.nanoTime(); + System.out.println("===============soaȡbomlineʱ(ms) " + ((time2 - time1) / 1000000L)+"==============="); + gbBuff.setLength(0); xqErrBuff.setLength(0); readBom(listBOM, bomline, error); @@ -1082,7 +1088,10 @@ public class ApplyMatnrOp extends AbstractAIFOperation { System.out.println(rev); if (isNeedApply(rev)) { // boolean flag = true; - String item_id = rev.getProperty("item_id"); + //String item_id = rev.getProperty("item_id"); + //һԻȡ + String[] revProperties = rev.getProperties(new String[] {"item_id","zt2_Specifications","zt2_DrawingNo"}); + String item_id = revProperties[0]; if (item_id.length() >= 3) { String stuf = item_id.substring(0, 3); if (stuf.equalsIgnoreCase("2ZD") || stuf.equalsIgnoreCase("4ZD") || stuf.equalsIgnoreCase("1ZD")) { @@ -1093,7 +1102,8 @@ public class ApplyMatnrOp extends AbstractAIFOperation { // ͨü TCComponent[] comps = rev.getReferenceListProperty("representation_for"); System.out.println(comps.length); - String spec = rev.getProperty("zt2_Specifications"); // DZ + //String spec = rev.getProperty("zt2_Specifications"); // DZ + String spec = revProperties[1]; if (comps.length == 0) { if (general_maps.containsKey(rev)) { if (!general_maps.get(rev).contains(spec)) { @@ -1105,26 +1115,38 @@ public class ApplyMatnrOp extends AbstractAIFOperation { general_maps.put(rev, specs); } }else if(stuf.equalsIgnoreCase("2ZD")){ - partRevs.add(comps[0]); - boolean needApply = true; - for(TCComponent comp:comps) { - String specs = comp.getProperty("zt2_Specifications"); // DZ - if(specs.equals(spec)) { - needApply = false; - break; + //20240426 ӲѯĴ + Map field = new HashMap(); + String value = "* " + spec; + System.out.println("ѯֵ:" + value+"item_id==>"+item_id); + field.put("", value); + field.put("ͼ", item_id); + TCComponentContextList contxt = KUtil.query(session, "chint_query_material_test", field); + //"*"+item_id+"*"+zt2_TYJSpec+"*" + if(contxt == null || contxt.getListCount() == 0) { + partRevs.add(comps[0]); + boolean needApply = true; + for(TCComponent comp:comps) { + String specs = comp.getProperty("zt2_Specifications"); // DZ + if(specs.equals(spec)) { + needApply = false; + break; + } } - } - if(needApply) { - if (general_maps.containsKey(rev)) { - if (!general_maps.get(rev).contains(spec)) { - general_maps.get(rev).add(spec); + if(needApply) { + if (general_maps.containsKey(rev)) { + if (!general_maps.get(rev).contains(spec)) { + general_maps.get(rev).add(spec); + } + } else { + List specs = new ArrayList(); + specs.add(spec); + general_maps.put(rev, specs); } - } else { - List specs = new ArrayList(); - specs.add(spec); - general_maps.put(rev, specs); } } + + } } else { // ͨü @@ -1146,7 +1168,8 @@ public class ApplyMatnrOp extends AbstractAIFOperation { System.out.println("contxt:" + contxt.getListCount()); if (contxt == null || contxt.getListCount() == 0) { String bpNo = item_id; - String zt2_DrawingNo = rev.getProperty("zt2_DrawingNo"); + //String zt2_DrawingNo = rev.getProperty("zt2_DrawingNo"); + String zt2_DrawingNo = revProperties[2]; if (!KUtil.isEmpty(zt2_DrawingNo) && !stuf.equalsIgnoreCase("1ZD")) { if (!item_id.equals(zt2_DrawingNo)) bpNo = zt2_DrawingNo; @@ -1174,7 +1197,11 @@ public class ApplyMatnrOp extends AbstractAIFOperation { boolean flag2 = true; for (int i = 0, len = contxt.getListCount(); i < len; i++) { TCComponent component = (TCComponent) contxt.get(i).getComponent(); - String property = component.getProperty("object_desc"); + //һԻȡ + String[] tcProperties = component.getProperties(new String[] {"object_desc","zt2_MaterialNo"}); + String property = tcProperties[0]; + + //String property = component.getProperty("object_desc"); String[] split = property.split(" "); if(!zt2_TYJSpec.equals(split[split.length-1])) { if(split.length-2>=0) { @@ -1187,14 +1214,15 @@ public class ApplyMatnrOp extends AbstractAIFOperation { } ResultSet rs; - String zt2_MaterialNo; + String zt2_MaterialNo = ""; Object[] objs = new Object[1]; String featureList; String temp; String[] vals; if (!flag2) break; - zt2_MaterialNo = component.getProperty("zt2_MaterialNo"); + //zt2_MaterialNo = component.getProperty("zt2_MaterialNo"); + zt2_MaterialNo = tcProperties[1]; if(zt2_MaterialNo.equals("")||zt2_MaterialNo.isEmpty()) { flag2 = false; continue; diff --git a/com.connor.chint.wuhan/src/com/chint/plm/applyMatnr/ApplyMatnrOp2.java b/com.connor.chint.wuhan/src/com/chint/plm/applyMatnr/ApplyMatnrOp2.java index a499cc6..b0310a1 100644 --- a/com.connor.chint.wuhan/src/com/chint/plm/applyMatnr/ApplyMatnrOp2.java +++ b/com.connor.chint.wuhan/src/com/chint/plm/applyMatnr/ApplyMatnrOp2.java @@ -549,6 +549,7 @@ public class ApplyMatnrOp2 extends AbstractAIFOperation { List partRevs = new ArrayList<>(); String zt2_Source = ""; String type = itemRevision.getType(); + if(!type.equals("ZT2_XNZJB")) { getRevs(bomline, error,partRevs); zt2_Source = itemRevision.getProperty("zt2_Source"); @@ -1083,7 +1084,9 @@ public class ApplyMatnrOp2 extends AbstractAIFOperation { System.out.println(rev); if (isNeedApply(rev)) { boolean flag = true; - String item_id = rev.getProperty("item_id"); + //String item_id = rev.getProperty("item_id"); + String[] revProperties = rev.getProperties(new String[] {"item_id","zt2_Specifications","zt2_DrawingNo"}); + String item_id = revProperties[0]; if (item_id.length() >= 3) { String stuf = item_id.substring(0, 3); if (stuf.equalsIgnoreCase("2ZD") || stuf.equalsIgnoreCase("4ZD") || stuf.equalsIgnoreCase("1ZD")) { @@ -1102,7 +1105,8 @@ public class ApplyMatnrOp2 extends AbstractAIFOperation { // ͨü TCComponent[] comps = rev.getReferenceListProperty("representation_for"); System.out.println(comps.length); - String spec = rev.getProperty("zt2_Specifications"); // DZ + //String spec = rev.getProperty("zt2_Specifications"); // DZ + String spec = revProperties[1]; if (comps.length == 0) { if (general_maps.containsKey(rev)) { if (!general_maps.get(rev).contains(spec)) { @@ -1156,7 +1160,8 @@ public class ApplyMatnrOp2 extends AbstractAIFOperation { if (contxt == null || contxt.getListCount() == 0) { Map field2 = new HashMap(); String bpNo = item_id; - String zt2_DrawingNo = rev.getProperty("zt2_DrawingNo"); + //String zt2_DrawingNo = rev.getProperty("zt2_DrawingNo"); + String zt2_DrawingNo = revProperties[2]; if (!KUtil.isEmpty(zt2_DrawingNo) && !stuf.equalsIgnoreCase("1ZD")) { if (!item_id.equals(zt2_DrawingNo)) bpNo = zt2_DrawingNo; @@ -1187,7 +1192,9 @@ public class ApplyMatnrOp2 extends AbstractAIFOperation { boolean flag2 = true; for (int i = 0, len = contxt.getListCount(); i < len; i++) { TCComponent component = (TCComponent) contxt.get(i).getComponent(); - String property = component.getProperty("object_desc"); + //String property = component.getProperty("object_desc"); + String[] tcProperties = component.getProperties(new String[] {"object_desc","zt2_MaterialNo"}); + String property = tcProperties[0]; String[] split = property.split(" "); if(!zt2_TYJSpec.equals(split[split.length-1])) { if(split.length-2>=0) { @@ -1207,7 +1214,8 @@ public class ApplyMatnrOp2 extends AbstractAIFOperation { String[] vals; if (!flag2) break; - zt2_MaterialNo = contxt.get(i).getComponent().getProperty("zt2_MaterialNo"); + //zt2_MaterialNo = component.getProperty("zt2_MaterialNo"); + zt2_MaterialNo = tcProperties[1]; if(zt2_MaterialNo.equals("")||zt2_MaterialNo.isEmpty()) { flag2 = false; continue; diff --git a/com.connor.chint.wuhan/src/com/chint/plm/applyMatnr/RemarkUtil.java b/com.connor.chint.wuhan/src/com/chint/plm/applyMatnr/RemarkUtil.java index a0482dc..baf9742 100644 --- a/com.connor.chint.wuhan/src/com/chint/plm/applyMatnr/RemarkUtil.java +++ b/com.connor.chint.wuhan/src/com/chint/plm/applyMatnr/RemarkUtil.java @@ -4,6 +4,7 @@ import java.util.Map; import com.teamcenter.rac.kernel.TCComponentBOMLine; import com.teamcenter.rac.kernel.TCComponentItem; import com.teamcenter.rac.kernel.TCComponentItemType; +import com.teamcenter.rac.kernel.TCProperty; import com.teamcenter.rac.kernel.TCSession; public class RemarkUtil { @@ -40,7 +41,12 @@ public class RemarkUtil { try { String[] idss = new String[] {"A","B","C","D","E"}; - String remark = bomline.getProperty("ZT2_Remark"); + //String remark = bomline.getProperty("ZT2_Remark"); + //һԻȡ + String[] tcProperties = bomline.getProperties(new String[] {"ZT2_Remark","bl_quantity"}); + + String remark = tcProperties[0]; + String bl_quantity = tcProperties[1]; String markMsg = ""; for (int i = 0; i < len; i++) { if (remark.contains(idss[i])) { @@ -49,7 +55,7 @@ public class RemarkUtil { } String c_pId = bomline.getItemRevision().getProperty("item_id"); int xqlen = markMsg.length(); - String bl_quantity = bomline.getProperty("bl_quantity"); + //String bl_quantity = bomline.getProperty("bl_quantity"); if(bl_quantity.isEmpty()) { xqErrBuff.append("ͼֽ:").append(pId).append("Ӽ").append(c_pId) .append("޷.").append("\n"); diff --git a/com.connor.chint.wuhan/src/com/connor/chint/yunpi/command/AssignProcess.java b/com.connor.chint.wuhan/src/com/connor/chint/yunpi/command/AssignProcess.java index 0c39ff7..ce12486 100644 --- a/com.connor.chint.wuhan/src/com/connor/chint/yunpi/command/AssignProcess.java +++ b/com.connor.chint.wuhan/src/com/connor/chint/yunpi/command/AssignProcess.java @@ -29,99 +29,105 @@ public class AssignProcess extends KCommand { // private boolean top = true; private TCComponentItemRevision rev; - + public TCComponentItemRevision getPRevision(TCComponentItemRevision rev2) throws Exception { - + String zt2_MaterialNo = rev2.getStringProperty("zt2_MaterialNo"); - if(rev2.getType().equals("Part Revision")) { + if (rev2.getType().equals("Part Revision")) { String zt2_ifpbom = rev2.getProperty("zt2_ifpbom"); - if(zt2_ifpbom.equals("P")) { + if (zt2_ifpbom.equals("P")) { return rev2; - }else { + } else { TCComponent designRev = rev2.getRelatedComponent("TC_Is_Represented_By"); - if(designRev!=null) { + if (designRev != null) { TCComponent[] matnrs = designRev.getRelatedComponents("representation_for"); - for(TCComponent matnr:matnrs) { - String[] properties = matnr.getProperties(new String[]{"zt2_ifpbom","zt2_MaterialNo"}); - if(properties[1].equals(zt2_MaterialNo) && properties[0].equals("P")) { - return (TCComponentItemRevision)matnr; + for (TCComponent matnr : matnrs) { + String[] properties = matnr.getProperties(new String[] { "zt2_ifpbom", "zt2_MaterialNo" }); + if (properties[1].equals(zt2_MaterialNo) && properties[0].equals("P")) { + return (TCComponentItemRevision) matnr; } } } } - }else if(rev2.getType().equals("ZT2_Design3DRevision")) { + } else if (rev2.getType().equals("ZT2_Design3DRevision")) { TCComponent[] matnrs = rev2.getRelatedComponents("representation_for"); - for(TCComponent matnr:matnrs) { - String[] properties = matnr.getProperties(new String[]{"zt2_ifpbom","zt2_MaterialNo"}); - if(properties[0].equals("P")) { - return (TCComponentItemRevision)matnr; + for (TCComponent matnr : matnrs) { + String[] properties = matnr.getProperties(new String[] { "zt2_ifpbom", "zt2_MaterialNo" }); + if (properties[0].equals("P")) { + return (TCComponentItemRevision) matnr; } } - return (TCComponentItemRevision)matnrs[0]; + return (TCComponentItemRevision) matnrs[0]; } return rev2; - + } + private TCComponentItemRevision getTopZzItem(TCComponentItemRevision rev) { - // Auto-generated method stub + // Auto-generated method stub // item = null; try { - TCComponent[] whereUsed = rev.whereUsed((short)0); - if(whereUsed.length==0) { + TCComponent[] whereUsed = rev.whereUsed((short) 0); + if (whereUsed.length == 0) { // String property = rev.getProperty("item_id"); return rev; - }else { + } else { List revPs = new ArrayList(); - for(int i=0;i1) { + + for (TCComponentItemRevision revP : revPs) { + if (revPs.size() > 1) { // TCComponentItemRevision revP = (TCComponentItemRevision)whereUsed[i]; String property = revP.getProperty("zt2_ifpbom"); - if(property==null||!property.equals("P")) { + if (property == null || !property.equals("P")) { continue; } } TCComponentItemRevision item = getTopZzItem(revP); - if(item!=null) { + if (item != null) { return item; } } } } catch (Exception e) { - // Auto-generated catch block + // Auto-generated catch block e.printStackTrace(); } return null; } + public AssignProcess(AbstractAIFApplication app, String commandId, String actionInfo) { super(app, commandId, actionInfo); + + long time20 = System.nanoTime(); + + InterfaceAIFComponent targetComponent = app.getTargetComponent(); try { - TCSession session = (TCSession)app.getSession(); + TCSession session = (TCSession) app.getSession(); String groupID = SAPUtil.getGroupID(session); - if(!groupID.equals("M060")) { + if (!groupID.equals("M060")) { MessageBox.post("¼ȷ", "", MessageBox.ERROR); return; } - if(targetComponent instanceof TCComponentBOMLine) { - rev = ((TCComponentBOMLine)targetComponent).getItemRevision(); - }else if(targetComponent instanceof TCComponentItemRevision) { + if (targetComponent instanceof TCComponentBOMLine) { + rev = ((TCComponentBOMLine) targetComponent).getItemRevision(); + } else if (targetComponent instanceof TCComponentItemRevision) { TCComponentItemRevision rev = (TCComponentItemRevision) targetComponent; this.rev = rev; - }else { + } else { MessageBox.post("ѡBOMл߰汾", "", MessageBox.ERROR); return; } new Thread() { @Override public void run() { - if(!rev.getType().equals("Part Revision")) { + if (!rev.getType().equals("Part Revision")) { MessageBox.post("ѡPBOM", "", MessageBox.ERROR); return; } @@ -129,94 +135,133 @@ public class AssignProcess extends KCommand { try { TCPreferenceService service = session.getPreferenceService(); // TCComponentItemRevision pRevision = getPRevision(rev); + long time5 = System.nanoTime(); TCComponentItemRevision topZzItem = getTopZzItem(rev); + long time6 = System.nanoTime(); + System.out.println( + "getTopZzItem========================================= " + (time6 - time5) / 1000000L); + + + + long time7 = System.nanoTime(); + String name = rev.getProperty("object_name"); String property = topZzItem.getProperty("zt2_ifpbom"); - if(!property.equals("P") && topZzItem.getStringProperty("object_desc").contains("1ZDB300000P")) { + if (!property.equals("P") + && topZzItem.getStringProperty("object_desc").contains("1ZDB300000P")) { MessageBox.post("ѡPBOM", "", MessageBox.ERROR); return; } boolean isback = false; String[] rules = service.getStringValues("CHINT_PROCESS_RULE"); - for(String rule : rules) { + for (String rule : rules) { String[] split = rule.split(":"); - if(!split[0].equals(groupID)) + if (!split[0].equals(groupID)) continue; String[] backs = split[1].split(";"); - for(String back : backs) { + for (String back : backs) { System.out.println(name + "==" + back + ">>" + name.contains(back)); - if(name.contains(back)) { + if (name.contains(back)) { isback = true; break; } } - if(isback) + if (isback) break; } - TCComponentItemRevision desginRev = (TCComponentItemRevision) topZzItem.getRelatedComponent("TC_Is_Represented_By"); - System.out.println("topZzItem=="+topZzItem.toString()+">>"+isback); - if(isback) { + TCComponentItemRevision desginRev = (TCComponentItemRevision) topZzItem + .getRelatedComponent("TC_Is_Represented_By"); + System.out.println("topZzItem==" + topZzItem.toString() + ">>" + isback); + if (isback) { AIFComponentContext[] folders = topZzItem.getItem() - .whereReferencedByTypeRelation(new String[] { "ZT2_ProjectFolder" }, null);//new String[] { "contents" } - if(folders.length == 0) { + .whereReferencedByTypeRelation(new String[] { "ZT2_ProjectFolder" }, null);// new + // String[] + // { + // "contents" + // } + if (folders.length == 0) { MessageBox.post("δҵƷļ,.", "ʾ", MessageBox.WARNING); return; } AIFComponentContext[] ccps = folders[0].getComponent().getChildren(); System.out.println(folders[0].getComponent() + "==>" + ccps.length); - for(AIFComponentContext aifcc : ccps) { + for (AIFComponentContext aifcc : ccps) { TCComponentItem item = (TCComponentItem) aifcc.getComponent(); - desginRev = (TCComponentItemRevision) item.getLatestItemRevision().getRelatedComponent("TC_Is_Represented_By"); + desginRev = (TCComponentItemRevision) item.getLatestItemRevision() + .getRelatedComponent("TC_Is_Represented_By"); System.out.println(item + "==>" + desginRev); - if(desginRev != null) + if (desginRev != null) break; } } - if(desginRev == null) { + + + long time8 = System.nanoTime(); + System.out.println( + "߼========================================= " + (time8 - time7) / 1000000L); + + + + if (desginRev == null) { MessageBox.post("ڶPûйͼֽ,.", "ʾ", MessageBox.WARNING); return; } - Map classificationAttributes = desginRev.getItem().getClassificationAttributes(); + + + long time3 = System.nanoTime(); + Map classificationAttributes = desginRev.getItem() + .getClassificationAttributes(); System.out.println(classificationAttributes.toString()); - for(String key:classificationAttributes.keySet()) { - if(key.equals("Ʒͺ")) { + + + for (String key : classificationAttributes.keySet()) { + if (key.equals("Ʒͺ")) { String cphx = classificationAttributes.get(key); - String sql = "SELECT \"ProductZu\" FROM \"CHINT_WORKHOUR_WhProductXH\" where \"ProductXH\" = '"+cphx+"'"; + String sql = "SELECT \"ProductZu\" FROM \"CHINT_WORKHOUR_WhProductXH\" where \"ProductXH\" = '" + + cphx + "'"; String[] prefs = service.getStringValues("database_tc"); SqlUtil.getTCDataConnection(prefs); ResultSet read2 = SqlUtil.read(sql); - if(!read2.next()) { + if (!read2.next()) { String searchSql = "SELECT distinct \"ProductZu\" FROM \"CHINT_WORKHOUR_WhProductXH\" where \"COMPANYCODE\" = 'M060'"; ResultSet read = SqlUtil.read(searchSql); List productZuList = new ArrayList(); - while(read.next()){ + while (read.next()) { productZuList.add(read.getString(1)); } System.out.println(productZuList.toString()); String[] array = productZuList.toArray(new String[] {}); - Object showInputDialog = JOptionPane.showInputDialog(null,"ǰƷͺδά,ѡӦƷ.","ʾ",JOptionPane.QUESTION_MESSAGE,null,array,array[0]); - if(showInputDialog==null) { + Object showInputDialog = JOptionPane.showInputDialog(null, "ǰƷͺδά,ѡӦƷ.", + "ʾ", JOptionPane.QUESTION_MESSAGE, null, array, array[0]); + if (showInputDialog == null) { return; - }else { + } else { System.out.println("showInputDialog:" + showInputDialog.toString()); String insertSql = "INSERT INTO \"CHINT_WORKHOUR_WhProductXH\" " - + "(\"ProductXH\",\"ProductZu\",\"COMPANYCODE\") " - + "VALUES (?,?,?)"; - SqlUtil.write(insertSql, new Object[] {cphx,showInputDialog.toString(),"M060"}); + + "(\"ProductXH\",\"ProductZu\",\"COMPANYCODE\") " + "VALUES (?,?,?)"; + SqlUtil.write(insertSql, + new Object[] { cphx, showInputDialog.toString(), "M060" }); } } break; } } + long time4 = System.nanoTime(); + System.out.println( + "sql========================================== " + (time4 - time3) / 1000000L); comp = new MyProgressBarCompent("", "ڽһָɹ·......"); TCUserService userService = (TCUserService) session.getUserService(); - Object call = userService.call("CloneTempProcess", new Object[] {rev.getUid()}); + long time1 = System.nanoTime(); + Object call = userService.call("CloneTempProcess", new Object[] { rev.getUid() }); + long time2 = System.nanoTime(); + System.out.println( + "call========================================== " + (time2 - time1) / 1000000L); String string = call.toString(); comp.setVisible(false); System.out.println(string); - if(!string.equals("succ")) { + if (!string.equals("succ")) { // if(string.contains("ݿ޶ӦͲƷֵ")) { // String[] split = string.split("ǰѹƷͺ:"); // String[] split2 = split[1].split(",ݿ޶ӦͲƷֵ"); @@ -235,23 +280,28 @@ public class AssignProcess extends KCommand { // System.out.println(productZuList.toString()); // } new SAPMessageUtilFram("", "һָɹ·ߴ쳣,:\n" + string); - }else { - MessageBox.post("һָɹ·ɡ","ʾ",MessageBox.INFORMATION); + } else { + MessageBox.post("һָɹ·ɡ", "ʾ", MessageBox.INFORMATION); } } catch (Exception e1) { - // Auto-generated catch block + // Auto-generated catch block e1.printStackTrace(); - }finally { + } finally { SqlUtil.freeAll(); } - if(comp!=null) { + if (comp != null) { comp.setVisible(false); } - + } }.start(); - }catch(Exception e) { + } catch (Exception e) { e.printStackTrace(); } + + + long time21 = System.nanoTime(); + System.out.println( + "ʱ========================================== " + (time21 - time20) / 1000000L); } } diff --git a/com.connor.chint.wuhan/src/com/connor/chint/yunpi/command/PartBean.java b/com.connor.chint.wuhan/src/com/connor/chint/yunpi/command/PartBean.java index 9b01367..e6cc987 100644 --- a/com.connor.chint.wuhan/src/com/connor/chint/yunpi/command/PartBean.java +++ b/com.connor.chint.wuhan/src/com/connor/chint/yunpi/command/PartBean.java @@ -208,6 +208,29 @@ public class PartBean extends SAPPushBOMBean { getUserName(), getZDATE() }; } + public Object[] getRowDataZxjc() throws Exception { + String name = part.getStringProperty("object_name"); + TCComponent[] facts = part.getRelatedComponents(REL_PART_FACTNO); + int len = facts == null ? 0 : facts.length; + System.out.println("ȡţ" + part); + String factNo = ""; + for (int i = 0; i < len; i++) { + String type = facts[i].getType(); + System.out.println(">> ҵӶ" + facts[i] + "|" + type); + factoryNos = facts; + if (TYPE_FACTNO.equals(type)) { + factNo = facts[i].getStringProperty("item_id"); + this.factoryNo = (TCComponentItem) facts[i]; + break; + } + } + String zt2_site = part.getStringProperty("zt2_Site"); + String zt2_tankNo = part.getStringProperty("zt2_TankNo"); + // return new Object[] {true,index,zt2_site,zt2_tankNo,name,this,factNo}; + return new Object[] { true, index, zt2_site, zt2_tankNo, name, this, factNo,"",""}; + } + + public Object[] getZYKGRowData() throws Exception { String name = part.getStringProperty("object_name"); String zt2_site = part.getStringProperty("zt2_Site");