From b8f1a6ce74b7b6989fdcfe8383052d94c1931f24 Mon Sep 17 00:00:00 2001 From: lijh Date: Tue, 14 May 2024 14:50:05 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A3=85=E7=AE=B1=E9=9B=86=E6=88=90=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=B5=81=E6=B0=B4=E7=A0=81=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chint/plm/applyMatnr/ApplyMatnrOp2.java | 73 ++++++++++++++----- 1 file changed, 56 insertions(+), 17 deletions(-) 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 b0310a1..e4e1909 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 @@ -1118,28 +1118,67 @@ public class ApplyMatnrOp2 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"); // 非必填 - 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"); // 非必填 + 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 { + } + +// else if(stuf.equalsIgnoreCase("2ZD")){ +// partRevs.add(comps[0]); +// boolean needApply = true; +// for(TCComponent comp:comps) { +// String specs = comp.getProperty("zt2_Specifications"); // 非必填 +// 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); +// } +// } else { +// List specs = new ArrayList(); +// specs.add(spec); +// general_maps.put(rev, specs); +// } +// } +// } +// } + + + else { // 有通用件规格 Map field = new HashMap(); String value = "* " + zt2_TYJSpec;