@ -1,5 +1,6 @@
package com.connor.chint.sap2.proc_zy ;
package com.connor.chint.sap2.proc_zy ;
import java.sql.ResultSet ;
import java.util.ArrayList ;
import java.util.ArrayList ;
import java.util.HashMap ;
import java.util.HashMap ;
import java.util.LinkedHashMap ;
import java.util.LinkedHashMap ;
@ -18,6 +19,7 @@ import com.connor.chint.sap2.proc.CreateProcessController;
import com.connor.chint.sap2.proc_by.BomBean ;
import com.connor.chint.sap2.proc_by.BomBean ;
import com.connor.chint.sap2.proc_by.BYProcBean ;
import com.connor.chint.sap2.proc_by.BYProcBean ;
import com.connor.chint.sap2.proc_by.ProcCellEditor ;
import com.connor.chint.sap2.proc_by.ProcCellEditor ;
import com.connor.chint.sap2.util.BomToSapUtil ;
import com.connor.chint.sap2.util.ChintPreferenceUtil ;
import com.connor.chint.sap2.util.ChintPreferenceUtil ;
import com.connor.chint.sap2.util.KUtil ;
import com.connor.chint.sap2.util.KUtil ;
import com.connor.chint.sap2.util.ProgressBar ;
import com.connor.chint.sap2.util.ProgressBar ;
@ -30,12 +32,13 @@ import com.teamcenter.rac.kernel.TCComponentBOMLine;
import com.teamcenter.rac.kernel.TCComponentBOMWindow ;
import com.teamcenter.rac.kernel.TCComponentBOMWindow ;
import com.teamcenter.rac.kernel.TCComponentBOMWindowType ;
import com.teamcenter.rac.kernel.TCComponentBOMWindowType ;
import com.teamcenter.rac.kernel.TCComponentContextList ;
import com.teamcenter.rac.kernel.TCComponentContextList ;
import com.teamcenter.rac.kernel.TCComponentGroup ;
import com.teamcenter.rac.kernel.TCComponentItem ;
import com.teamcenter.rac.kernel.TCComponentItem ;
import com.teamcenter.rac.kernel.TCComponentItemRevision ;
import com.teamcenter.rac.kernel.TCComponentItemRevision ;
import com.teamcenter.rac.kernel.TCException ;
import com.teamcenter.rac.kernel.TCException ;
import com.teamcenter.rac.kernel.TCSession ;
import com.teamcenter.rac.kernel.TCSession ;
import com.teamcenter.rac.util.MessageBox ;
import com.teamcenter.rac.util.MessageBox ;
import com.teamcenter.services.rac.cad._2007_01.StructureManagement.ExpandPSData ;
import com.teamcenter.services.rac.core.DataManagementService ;
public class CreateProcZYDialogController {
public class CreateProcZYDialogController {
@ -45,14 +48,16 @@ public class CreateProcZYDialogController {
private TCSession session ;
private TCSession session ;
protected List < BYProcBean > procBeanList = new ArrayList < > ( ) ;
protected List < BYProcBean > procBeanList = new ArrayList < > ( ) ;
private ProcCellEditor procEditoe ;
private ProcCellEditor procEditoe ;
private String group ;
private TCComponentGroup login_group = null ;
// private TCComponentGroup login_group = null;
private Map < String , TCComponent > mepMap = new HashMap < > ( ) ;
public CreateProcZYDialogController ( CreateProcZYDialog createProcBYDialog , AbstractAIFApplication app ) {
public CreateProcZYDialogController ( CreateProcZYDialog createProcBYDialog , AbstractAIFApplication app ) {
this . dialog = createProcBYDialog ;
this . dialog = createProcBYDialog ;
this . app = app ;
this . app = app ;
this . session = ( TCSession ) app . getSession ( ) ;
this . session = ( TCSession ) app . getSession ( ) ;
this . login_group = session . getCurrentGroup ( ) ;
// this.login_group = session.getCurrentGroup();
}
}
public void readData ( ProgressBar pb ) throws Exception {
public void readData ( ProgressBar pb ) throws Exception {
@ -62,6 +67,7 @@ public class CreateProcZYDialogController {
if ( target = = null | | ! ( target instanceof TCComponentItemRevision ) ) {
if ( target = = null | | ! ( target instanceof TCComponentItemRevision ) ) {
return ;
return ;
}
}
group = session . getCurrentGroup ( ) . getUid ( ) ;
System . out . println ( "检查对象:" + target ) ;
System . out . println ( "检查对象:" + target ) ;
TCComponentItemRevision rev = ( TCComponentItemRevision ) target ;
TCComponentItemRevision rev = ( TCComponentItemRevision ) target ;
TCComponentBOMWindowType bomWinType = ( TCComponentBOMWindowType ) session . getTypeComponent ( "BOMWindow" ) ;
TCComponentBOMWindowType bomWinType = ( TCComponentBOMWindowType ) session . getTypeComponent ( "BOMWindow" ) ;
@ -71,7 +77,14 @@ public class CreateProcZYDialogController {
topBean = new BomBean ( rev , topLine , 1 ) ;
topBean = new BomBean ( rev , topLine , 1 ) ;
DefaultMutableTreeNode topTreeNode = new DefaultMutableTreeNode ( topBean ) ;
DefaultMutableTreeNode topTreeNode = new DefaultMutableTreeNode ( topBean ) ;
dialog . topNode . add ( topTreeNode ) ;
dialog . topNode . add ( topTreeNode ) ;
readBom ( topTreeNode , topLine , pb , rev , topBean , procBeanList ) ;
List < String > codeList = new ArrayList < > ( ) ;
List < String > noList = new ArrayList < > ( ) ;
// readTemplate(topLine, rev, topBean, procBeanList);
com . teamcenter . services . rac . cad . _2007_01 . StructureManagement structureService = com . teamcenter . services . rac . cad . StructureManagementService . getService ( session ) ;
Map < String , ExpandPSData [ ] > bomLineTree = BomToSapUtil . getBomLineTreeNodeSOA ( topLine , structureService ) ;
readBom ( topTreeNode , topLine , bomLineTree , pb , rev , topBean , procBeanList , codeList , noList ) ;
getGY ( procBeanList , codeList , noList ) ;
KUtil . expandTree ( dialog . tree , new TreePath ( dialog . topNode ) ) ;
KUtil . expandTree ( dialog . tree , new TreePath ( dialog . topNode ) ) ;
if ( procBeanList . size ( ) > 0 ) {
if ( procBeanList . size ( ) > 0 ) {
procEditoe = new ProcCellEditor ( procBeanList ) ;
procEditoe = new ProcCellEditor ( procBeanList ) ;
@ -81,33 +94,33 @@ public class CreateProcZYDialogController {
win . close ( ) ;
win . close ( ) ;
}
}
private void readBom ( DefaultMutableTreeNode treeNode , TCComponentBOMLine topLine , ProgressBar pb ,
private void readBom ( DefaultMutableTreeNode treeNode , TCComponentBOMLine topLine , Map< String , ExpandPSData [ ] > bomLineTree , ProgressBar pb ,
TCComponentItemRevision parentRev , BomBean parentBean , List < BYProcBean > procBeanList ) throws Exception {
TCComponentItemRevision parentRev , BomBean parentBean , List < BYProcBean > procBeanList , List < String > codeList , List < String > noList ) throws Exception { //TODO readBom
readTemplate ( topLine , parentRev , parentBean , procBeanList );
readTemplate ( topLine , parentRev , parentBean , procBeanList , codeList , noList );
BomBean pBean = ( BomBean ) treeNode . getUserObject ( ) ;
BomBean pBean = ( BomBean ) treeNode . getUserObject ( ) ;
pb . setText ( "加载数据 ... " + pBean ) ;
pb . setText ( "加载数据 : " + pBean ) ;
AIFComponentContext [ ] cLines = topLine . getChildren ( ) ;
// AIFComponentContext[] cLines = topLine.getChildren();
TCComponentItemRevision parentRev2 = topLine . getItemRevision ( ) ;
TCComponentItemRevision parentRev2 = topLine . getItemRevision ( ) ;
for ( int i = 0 ; i < cLines . length ; i + + ) {
for ( ExpandPSData data : bomLineTree . get ( topLine . getUid ( ) ) ) {
TCComponentBOMLine cLine = ( TCComponentBOMLine ) cLines [ i ] . getComponent ( ) ;
TCComponentBOMLine cLine = data . bomLine ;
if ( cLine . getProperty ( "zt2_Diagram" ) . equals ( "是" ) ) {
if ( cLine . getProperty ( "zt2_Diagram" ) . equals ( "是" ) ) {
System . out . println ( cLine . getProperty ( "object_string" ) + "为虚拟项,已过滤!" ) ;
System . out . println ( cLine . getProperty ( "object_string" ) + "为虚拟项,已过滤!" ) ;
continue ;
continue ;
}
}
TCComponentItemRevision cRev = cLine. getItemRevision ( ) ;
TCComponentItemRevision cRev = data. itemRevOfBOMLine ;
System . out . println ( "cRev:" + cRev ) ;
System . out . println ( "cRev:" + cRev ) ;
BomBean cBean = new BomBean ( cRev , cLine , procBeanList . size ( ) + 1 ) ;
BomBean cBean = new BomBean ( cRev , cLine , procBeanList . size ( ) + 1 ) ;
pBean . getChildren ( ) . add ( cBean ) ;
pBean . getChildren ( ) . add ( cBean ) ;
DefaultMutableTreeNode cNode = new DefaultMutableTreeNode ( cBean ) ;
DefaultMutableTreeNode cNode = new DefaultMutableTreeNode ( cBean ) ;
treeNode . add ( cNode ) ;
treeNode . add ( cNode ) ;
System . out . println ( "添加:" + cBean ) ;
System . out . println ( "添加:" + cBean ) ;
readBom ( cNode , cLine , pb, parentRev2 , cBean , procBean List) ;
readBom ( cNode , cLine , bomLineTree, pb, parentRev2 , cBean , procBean List, codeList , no List) ;
}
}
}
}
private void readBom2 ( DefaultMutableTreeNode treeNode , TCComponentBOMLine topLine , ProgressBar pb ,
private void readBom2 ( DefaultMutableTreeNode treeNode , TCComponentBOMLine topLine , ProgressBar pb ,
TCComponentItemRevision parentRev , BomBean parentBean , List < BYProcBean > procBeanList ) throws Exception {
TCComponentItemRevision parentRev , BomBean parentBean , List < BYProcBean > procBeanList , List < String > codeList , List < String > noList ) throws Exception {
readTemplate ( topLine , parentRev , parentBean , procBeanList );
readTemplate ( topLine , parentRev , parentBean , procBeanList , codeList , noList );
BomBean pBean = ( BomBean ) treeNode . getUserObject ( ) ;
BomBean pBean = ( BomBean ) treeNode . getUserObject ( ) ;
pb . setText ( "加载数据..." + pBean ) ;
pb . setText ( "加载数据..." + pBean ) ;
AIFComponentContext [ ] cLines = topLine . getChildren ( ) ;
AIFComponentContext [ ] cLines = topLine . getChildren ( ) ;
@ -127,23 +140,25 @@ public class CreateProcZYDialogController {
DefaultMutableTreeNode cNode = new DefaultMutableTreeNode ( cBean ) ;
DefaultMutableTreeNode cNode = new DefaultMutableTreeNode ( cBean ) ;
treeNode . add ( cNode ) ;
treeNode . add ( cNode ) ;
System . out . println ( "添加:" + cBean ) ;
System . out . println ( "添加:" + cBean ) ;
readBom2 ( cNode , cLine , pb , parentRev2 , cBean , procBeanList );
readBom2 ( cNode , cLine , pb , parentRev2 , cBean , procBeanList , codeList , noList );
}
}
}
}
private void readTemplate ( TCComponentBOMLine topLine , TCComponentItemRevision parentRev , BomBean parentBean ,
private void readTemplate ( TCComponentBOMLine topLine , TCComponentItemRevision parentRev , BomBean parentBean ,
List < BYProcBean > procBeanList ) throws Exception {
List < BYProcBean > procBeanList , List < String > codeList , List < String > noList ) throws Exception {
TCComponentItemRevision comp = topLine . getItemRevision ( ) ;
TCComponentItemRevision comp = topLine . getItemRevision ( ) ;
TCComponentItemRevision rev_standard = null ;
TCComponentItemRevision rev_standard = null ;
TCComponentItemRevision bzgy = null ;
// TCComponentItemRevision bzgy = null;
TCComponentItemRevision tlgx = null ;
TCComponentItemRevision tlgx = null ;
TCComponentItemRevision cptlgx = null ;
TCComponentItemRevision cptlgx = null ;
boolean flag = true ;
boolean flag = true ;
List < TCComponentItemRevision > bzgys = new ArrayList < TCComponentItemRevision > ( ) ;
List < TCComponentItemRevision > bzgys = new ArrayList < TCComponentItemRevision > ( ) ;
String zt2_MaterialMark = "" ;
String zt2_MaterialMark = "" ;
System . out . println ( "type:" + comp . getType ( ) ) ;
String type = comp . getType ( ) ;
System . out . println ( "type:" + type ) ;
zt2_MaterialMark = comp . getProperty ( "zt2_MaterialMark" ) ;
zt2_MaterialMark = comp . getProperty ( "zt2_MaterialMark" ) ;
if ( comp . getType ( ) . equals ( "ZT2_Design3DRevision" ) ) {
if ( type . equals ( "ZT2_Design3DRevision" ) ) {
String drawingNo = comp . getStringProperty ( "item_id" ) ;
String drawingNo = comp . getStringProperty ( "item_id" ) ;
System . out . println ( "查询标准工艺:" + comp + ", zt2_DrawingNo = " + drawingNo ) ;
System . out . println ( "查询标准工艺:" + comp + ", zt2_DrawingNo = " + drawingNo ) ;
if ( KUtil . isEmpty ( drawingNo ) ) {
if ( KUtil . isEmpty ( drawingNo ) ) {
@ -158,53 +173,9 @@ public class CreateProcZYDialogController {
drawingNo = drawingNo . substring ( 0 , ind ) ;
drawingNo = drawingNo . substring ( 0 , ind ) ;
}
}
}
}
System . out . println ( "查询图号:" + drawingNo ) ;
codeList . add ( drawingNo ) ;
// 查询标准图工艺
Map < String , String > fields = new LinkedHashMap < > ( ) ;
fields . put ( "DrawingNo" , drawingNo ) ;
TCComponentContextList res = KUtil . query ( session , "chint_query_TYDH" , fields ) ;
if ( res ! = null ) {
int len = res . getListCount ( ) ;
if ( len > 1 ) {
throw new Exception ( "通过 DrawingNo = " + drawingNo + " 查询到多个对象" ) ;
}
if ( len = = 1 ) {
TCComponentItemRevision rev = ( TCComponentItemRevision ) res . get ( 0 ) . getComponent ( ) ;
rev_standard = rev ;
String zt2_ClassificationCode = rev . getProperty ( "zt2_ClassificationCode" ) ;
if ( zt2_ClassificationCode . length ( ) > 0 ) {
flag = false ;
Map < String , String > fields2 = new LinkedHashMap < > ( ) ;
fields2 . put ( "ID" , zt2_ClassificationCode ) ;
TCComponentContextList res2 = KUtil . query ( session , "chint_query_item" , fields2 ) ;
if ( res2 ! = null ) {
int len2 = res2 . getListCount ( ) ;
if ( len2 > 1 ) {
throw new Exception ( "通过 ID = " + zt2_ClassificationCode + " 查询到多个对象" ) ;
}
if ( len2 = = 1 ) {
tlgx = ( TCComponentItemRevision ) res2 . get ( 0 ) . getComponent ( ) ;
System . out . println ( "tlgx type:[" + tlgx . getType ( ) + "]" ) ;
}
}
}
AIFComponentContext [ ] comps = rev . whereReferencedByTypeRelation (
new String [ ] { "MEProcessRevision" } , new String [ ] { "IMAN_METarget" } ) ;
System . out . println ( "查询到对象:" + rev + ", 引用数量:" + comps . length ) ;
for ( int i = 0 ; i < comps . length ; i + + ) {
InterfaceAIFComponent cc = comps [ i ] . getComponent ( ) ;
if ( KUtil . isSameGroup ( ( TCComponent ) cc , login_group ) ) {
// 添加到模板
bzgy = ( TCComponentItemRevision ) cc ;
System . out . println ( "找到标准工艺:" + bzgy ) ;
bzgys . add ( bzgy ) ;
}
}
}
}
} // 若未图纸,则取物料编码
} // 若未图纸,则取物料编码
else if ( comp. ge tT ype( ) . equals ( "Part Revision" ) ) {
else if ( type . equals ( "Part Revision" ) ) {
String drawingNo = comp . getStringProperty ( "zt2_MaterialNo" ) ;
String drawingNo = comp . getStringProperty ( "zt2_MaterialNo" ) ;
System . out . println ( "查询标准工艺:" + comp + ", zt2_MaterialNo = " + drawingNo ) ;
System . out . println ( "查询标准工艺:" + comp + ", zt2_MaterialNo = " + drawingNo ) ;
if ( KUtil . isEmpty ( drawingNo ) ) {
if ( KUtil . isEmpty ( drawingNo ) ) {
@ -216,82 +187,16 @@ public class CreateProcZYDialogController {
drawingNo = drawingNo . substring ( 0 , ind ) ;
drawingNo = drawingNo . substring ( 0 , ind ) ;
}
}
// 查询标准图工艺
// 查询标准图工艺
Map < String , String > fields = new LinkedHashMap < > ( ) ;
codeList . add ( drawingNo ) ;
fields . put ( "零组件 ID" , drawingNo ) ;
} else {
TCComponentContextList res = KUtil . query ( session , "零组件版本..." , fields ) ;
codeList . add ( "" ) ;
if ( res ! = null ) {
} /**/
int len = res . getListCount ( ) ;
if ( len > 1 ) {
throw new Exception ( "通过 DrawingNo = " + drawingNo + " 查询到多个对象" ) ;
}
if ( len = = 1 ) {
TCComponentItemRevision rev = ( TCComponentItemRevision ) res . get ( 0 ) . getComponent ( ) ;
rev_standard = rev ;
String zt2_ClassificationCode = rev . getProperty ( "zt2_ClassificationCode" ) ;
if ( zt2_ClassificationCode . length ( ) > 0 ) {
flag = false ;
Map < String , String > fields2 = new LinkedHashMap < > ( ) ;
fields2 . put ( "ID" , zt2_ClassificationCode ) ;
TCComponentContextList res2 = KUtil . query ( session , "chint_query_item" , fields2 ) ;
if ( res2 ! = null ) {
int len2 = res2 . getListCount ( ) ;
if ( len2 > 1 ) {
throw new Exception ( "通过 ID = " + zt2_ClassificationCode + " 查询到多个对象" ) ;
}
if ( len2 = = 1 ) {
tlgx = ( TCComponentItemRevision ) res2 . get ( 0 ) . getComponent ( ) ;
System . out . println ( "tlgx type:[" + tlgx . getType ( ) + "]" ) ;
}
}
}
AIFComponentContext [ ] comps = rev . whereReferencedByTypeRelation (
new String [ ] { "MEProcessRevision" } , new String [ ] { "IMAN_METarget" } ) ;
System . out . println ( "查询到对象:" + rev + ", 引用数量:" + comps . length ) ;
for ( int i = 0 ; i < comps . length ; i + + ) {
InterfaceAIFComponent cc = comps [ i ] . getComponent ( ) ;
if ( KUtil . isSameGroup ( ( TCComponent ) cc , login_group ) ) {
// 添加到模板
bzgy = ( TCComponentItemRevision ) cc ;
System . out . println ( "找到标准工艺:" + bzgy ) ;
bzgys . add ( bzgy ) ;
}
}
}
}
}
String zt2_ClassificationCode = topLine . getProperty ( "ZT2_ClassificationNo" ) ;
String zt2_ClassificationCode = topLine . getProperty ( "ZT2_ClassificationNo" ) ;
System . out . println ( "[ZT2_ClassificationNo=" + zt2_ClassificationCode + "]" ) ;
System . out . println ( "[ZT2_ClassificationNo=" + zt2_ClassificationCode + "]" ) ;
if ( zt2_ClassificationCode . length ( ) > 0 ) {
noList . add ( zt2_ClassificationCode ) ;
flag = false ;
Map < String , String > fields2 = new LinkedHashMap < > ( ) ;
fields2 . put ( "ID" , zt2_ClassificationCode ) ;
TCComponentContextList res2 = KUtil . query ( session , "chint_query_item" , fields2 ) ;
if ( res2 ! = null ) {
int len2 = res2 . getListCount ( ) ;
if ( len2 > 1 ) {
throw new Exception ( "通过 ID = " + zt2_ClassificationCode + " 查询到多个对象" ) ;
}
if ( len2 = = 1 ) {
cptlgx = ( TCComponentItemRevision ) res2 . get ( 0 ) . getComponent ( ) ;
}
}
}
// 查询产品工艺
// 查询产品工艺
TCComponentItemRevision cpgy = null ;
TCComponentItemRevision cpgy = ( TCComponentItemRevision ) getMeproces ( comp . getUid ( ) , session ) ;
AIFComponentContext [ ] refs = comp . whereReferencedByTypeRelation ( new String [ ] { "MEProcessRevision" } ,
new String [ ] { "IMAN_METarget" } ) ;
System . out . println ( "查询产品工艺、投料工序:" + comp + ", 引用数量:" + refs . length ) ;
for ( int i = 0 ; i < refs . length ; i + + ) {
InterfaceAIFComponent c = refs [ i ] . getComponent ( ) ;
if ( KUtil . isSameGroup ( ( TCComponent ) c , login_group ) ) {
// 添加到模板
System . out . println ( "找到产品工艺:" + c ) ;
cpgy = ( TCComponentItemRevision ) c ;
}
}
BYProcBean bean = new BYProcBean ( procBeanList . size ( ) + 1 , comp , bzgys , cpgy , tlgx , topLine , cptlgx , parentRev ) ;
BYProcBean bean = new BYProcBean ( procBeanList . size ( ) + 1 , comp , bzgys , cpgy , tlgx , topLine , cptlgx , parentRev ) ;
zt2_ClassificationCode = comp . getProperty ( "zt2_ClassificationCode" ) ;
zt2_ClassificationCode = comp . getProperty ( "zt2_ClassificationCode" ) ;
@ -374,6 +279,7 @@ public class CreateProcZYDialogController {
KUtil . info ( dialog , "二次自动投料完成" ) ;
KUtil . info ( dialog , "二次自动投料完成" ) ;
}
}
@SuppressWarnings ( "deprecation" )
public void oneAutoFeeding ( Map < String , CHINT_ClassificationCode > maps , ProgressBar pb ) throws Exception {
public void oneAutoFeeding ( Map < String , CHINT_ClassificationCode > maps , ProgressBar pb ) throws Exception {
KUtil . stopTableEditing ( dialog . t_part ) ;
KUtil . stopTableEditing ( dialog . t_part ) ;
pb . setText ( "一次自动投料..." ) ;
pb . setText ( "一次自动投料..." ) ;
@ -392,6 +298,7 @@ public class CreateProcZYDialogController {
pb . disposeDialog ( ) ;
pb . disposeDialog ( ) ;
}
}
@SuppressWarnings ( "deprecation" )
private void oneFeedingLine ( Map < String , CHINT_ClassificationCode > maps , TCComponentBOMLine line ) throws Exception {
private void oneFeedingLine ( Map < String , CHINT_ClassificationCode > maps , TCComponentBOMLine line ) throws Exception {
AIFComponentContext [ ] children = line . getChildren ( ) ;
AIFComponentContext [ ] children = line . getChildren ( ) ;
String zt2_ClassificationCode ;
String zt2_ClassificationCode ;
@ -411,7 +318,7 @@ public class CreateProcZYDialogController {
}
}
}
}
private void refushPros ( TCComponentBOMLine line , BYProcBean bean ) throws TC Exception {
private void refushPros ( TCComponentBOMLine line , BYProcBean bean ) throws Exception {
System . out . println ( "line:" + line . getItemRevision ( ) + "|子项:" + bean . getBomRev ( ) ) ;
System . out . println ( "line:" + line . getItemRevision ( ) + "|子项:" + bean . getBomRev ( ) ) ;
if ( line . getItemRevision ( ) . equals ( bean . getBomRev ( ) ) ) {
if ( line . getItemRevision ( ) . equals ( bean . getBomRev ( ) ) ) {
System . out . println ( "重新刷新子项可选工序" ) ;
System . out . println ( "重新刷新子项可选工序" ) ;
@ -592,13 +499,13 @@ public class CreateProcZYDialogController {
dialog . tm_part . setValueAt ( proc . getProperty ( "object_name" ) , procBean . getIndex ( ) - 1 , BYProcBean . INDEX_CPGY ) ;
dialog . tm_part . setValueAt ( proc . getProperty ( "object_name" ) , procBean . getIndex ( ) - 1 , BYProcBean . INDEX_CPGY ) ;
}
}
private void getGX ( TCComponentBOMLine line , List < TCComponentItemRevision > lists ) throws TC Exception {
private void getGX ( TCComponentBOMLine line , List < TCComponentItemRevision > lists ) throws Exception {
TCComponentBOMLine parent = line . parent ( ) ;
TCComponentBOMLine parent = line . parent ( ) ;
if ( parent = = null ) {
if ( parent = = null ) {
return ;
return ;
}
}
boolean flag = false ;
boolean flag = false ;
AIFComponentContext [ ] contexts22 = ( parent . getItemRevision ( ) ) . whereReferencedByTypeRelation ( null , null ) ;
/ * AIFComponentContext [ ] contexts22 = ( parent . getItemRevision ( ) ) . whereReferencedByTypeRelation ( null , null ) ;
for ( int i = 0 ; i < contexts22 . length ; i + + ) {
for ( int i = 0 ; i < contexts22 . length ; i + + ) {
String type = contexts22 [ i ] . getComponent ( ) . getType ( ) ;
String type = contexts22 [ i ] . getComponent ( ) . getType ( ) ;
System . out . println ( "type:" + type ) ;
System . out . println ( "type:" + type ) ;
@ -616,11 +523,49 @@ public class CreateProcZYDialogController {
}
}
}
}
} * /
TCComponent meop = getMeproces ( parent . getItemRevision ( ) . getUid ( ) , session ) ;
if ( meop ! = null ) {
flag = true ;
if ( ! lists . contains ( meop ) & & ( meop instanceof TCComponentItemRevision ) )
lists . add ( ( TCComponentItemRevision ) meop ) ;
}
}
if ( ! flag ) {
if ( ! flag ) {
getGX ( parent , lists ) ;
getGX ( parent , lists ) ;
}
}
}
private TCComponent getMeproces ( String uid , TCSession session ) throws Exception {
//TODO getMeproces
if ( mepMap . containsKey ( uid ) ) {
return mepMap . get ( uid ) ;
}
// String sql = SAPUtil.sqlRef.replace("\\?", "'" + uid + "'");
String sql = "select P.puid as supItemUID,V.puid as supRevUID,P.pitem_id as supItemID,ITRO.Pobject_Name as supItemName,"
+ "V.Pitem_Revision_Id as supRevID,cP.pitem_id as subItemID,cV.puid as subRevUID,RT.partifactname as 版本与版本关系 "
+ "from PWORKSPACEOBJECT ITRO,PIMANRELATION R,PIMANTYPE RT,PITEMREVISION V,PITEM P,PITEMREVISION cV,PITEM cP,PWORKSPACEOBJECT cITRO,PPOM_APPLICATION_OBJECT g "
+ "where g.puid=V.puid and V.Puid = R.Rprimary_Objectu and r.rrelation_typeu = RT.puid and P.Puid = V.Ritems_Tagu and ITRO.Puid = V.Puid "
+ "and R.Rsecondary_Objectu = cV.Puid and cP.Puid = cV.Ritems_Tagu and cV.Puid = cITRO.Puid and ITRO.Pactive_Seq<>0 "
+ "and cITRO.Pactive_Seq<>0 and RT.partifactname='IMAN_METarget' and g.ROWNING_GROUPU='" + group + "' and cV.PUID = '" + uid + "'" ;
try {
ResultSet read = SqlUtil . read ( sql ) ; //SAPUtil.sqlRef, new Object[] { uid }
// boolean next = read.next();
while ( read . next ( ) ) {
String string = read . getString ( "supRevUID" ) ;
TCComponent mpComp = session . stringToComponent ( string ) ;
// TCComponent mpComp = SAPUtil.getSameGroupProcYH(meops, session);
if ( mpComp ! = null ) {
mepMap . put ( uid , mpComp ) ;
// SqlUtil.free();
return mpComp ;
}
}
// SqlUtil.free();
} catch ( Exception e ) {
System . out . println ( "sql==>" + sql ) ;
e . printStackTrace ( ) ;
}
return null ;
}
}
public void assignProcess ( ProgressBar pb ) throws Exception {
public void assignProcess ( ProgressBar pb ) throws Exception {
@ -682,6 +627,7 @@ public class CreateProcZYDialogController {
}
}
// 创建工艺
// 创建工艺
@SuppressWarnings ( "deprecation" )
public void createProcess ( ProgressBar pb , MEProcessBean bean , TCSession session , List < TCComponentItemRevision > revs )
public void createProcess ( ProgressBar pb , MEProcessBean bean , TCSession session , List < TCComponentItemRevision > revs )
throws Exception {
throws Exception {
if ( revs . size ( ) = = 0 )
if ( revs . size ( ) = = 0 )
@ -725,8 +671,8 @@ public class CreateProcZYDialogController {
TCComponentItemRevision rev ;
TCComponentItemRevision rev ;
TCComponentItemRevision newProc = null ;
TCComponentItemRevision newProc = null ;
StringBuffer buff = new StringBuffer ( ) ;
StringBuffer buff = new StringBuffer ( ) ;
DefaultMutableTreeNode node ;
// DefaultMutableTreeNode node;
String object_name = proc . getProperty ( "object_name" ) ;
// String object_name = proc.getProperty("object_name");
// pb.setText("工艺路线创建......");
// pb.setText("工艺路线创建......");
int len = revs . size ( ) ;
int len = revs . size ( ) ;
List < BYProcBean > cout_beans = new ArrayList < > ( ) ;
List < BYProcBean > cout_beans = new ArrayList < > ( ) ;
@ -756,7 +702,8 @@ public class CreateProcZYDialogController {
BYProcBean . INDEX_CPGY ) ;
BYProcBean . INDEX_CPGY ) ;
}
}
if ( procBean . getRev_standard ( ) = = procBean . getBomRev ( ) ) {
if ( procBean . getRev_standard ( ) = = procBean . getBomRev ( ) ) {
procBean . getBzgys ( ) . add ( newProc ) ;
if ( ! procBean . getBzgys ( ) . contains ( newProc ) )
procBean . getBzgys ( ) . add ( newProc ) ;
procBean . setTemplate ( newProc ) ;
procBean . setTemplate ( newProc ) ;
if ( procBean . isVisible ) {
if ( procBean . isVisible ) {
dialog . tm_part . setValueAt ( newProc . getProperty ( "object_name" ) , procBean . getIndex ( ) - 1 ,
dialog . tm_part . setValueAt ( newProc . getProperty ( "object_name" ) , procBean . getIndex ( ) - 1 ,
@ -775,7 +722,8 @@ public class CreateProcZYDialogController {
procBean = beans . get ( j ) ;
procBean = beans . get ( j ) ;
procBean . setCpgy ( proc ) ;
procBean . setCpgy ( proc ) ;
if ( procBean . getRev_standard ( ) = = procBean . getBomRev ( ) ) {
if ( procBean . getRev_standard ( ) = = procBean . getBomRev ( ) ) {
procBean . getBzgys ( ) . add ( proc ) ;
if ( ! procBean . getBzgys ( ) . contains ( proc ) )
procBean . getBzgys ( ) . add ( proc ) ;
procBean . setTemplate ( proc ) ;
procBean . setTemplate ( proc ) ;
}
}
}
}
@ -805,14 +753,19 @@ public class CreateProcZYDialogController {
}
}
public void refushTable2 ( List < BYProcBean > list ) throws Exception {
public void refushTable2 ( List < BYProcBean > list ) throws Exception {
dialog . tm_part . getDataVector ( ) . clear ( ) ;
// dialog.tm_part.getDataVector().clear();
dialog . t_part . clearSelection ( ) ;
// dialog.t_part.clearSelection();
dialog . t_part . revalidate ( ) ;
// dialog.t_part.revalidate();
dialog . t_part . repaint ( ) ;
// dialog.t_part.repaint();
for ( int i = dialog . t_part . getRowCount ( ) - 1 ; i > = 0 ; i - - ) {
dialog . tm_part . removeRow ( i ) ;
}
for ( int i = 0 , len = list . size ( ) ; i < len ; i + + ) {
for ( int i = 0 , len = list . size ( ) ; i < len ; i + + ) {
// long startTime = System.currentTimeMillis();
list . get ( i ) . isVisible = true ;
list . get ( i ) . isVisible = true ;
dialog . tm_part . addRow ( list . get ( i ) . getRowData ( ) ) ;
dialog . tm_part . addRow ( list . get ( i ) . getRowData ( ) ) ;
// System.out.println("addRow:" + (System.currentTimeMillis() - startTime));
}
}
}
}
@ -875,10 +828,12 @@ public class CreateProcZYDialogController {
}
}
public void readData ( ProgressBar pb , DefaultMutableTreeNode topTreeNode ) throws Exception {
public void readData ( ProgressBar pb , DefaultMutableTreeNode topTreeNode ) throws Exception {
long startTime = System . currentTimeMillis ( ) ;
pb . startProgress ( ) ;
pb . startProgress ( ) ;
pb . setText ( "加载数据..." ) ;
pb . setText ( "加载数据..." ) ;
dialog . rev_Beans . clear ( ) ;
dialog . rev_Beans . clear ( ) ;
// 预先加入的假节点
// 预先加入的假节点
group = session . getCurrentGroup ( ) . getUid ( ) ;
int cout = topTreeNode . getChildCount ( ) ;
int cout = topTreeNode . getChildCount ( ) ;
TCComponentBOMWindowType bomWinType = ( TCComponentBOMWindowType ) session . getTypeComponent ( "BOMWindow" ) ;
TCComponentBOMWindowType bomWinType = ( TCComponentBOMWindowType ) session . getTypeComponent ( "BOMWindow" ) ;
TCComponentBOMWindow win = bomWinType . create ( null ) ;
TCComponentBOMWindow win = bomWinType . create ( null ) ;
@ -895,12 +850,53 @@ public class CreateProcZYDialogController {
win . setWindowTopLine ( rev . getItem ( ) , rev , null , null ) ;
win . setWindowTopLine ( rev . getItem ( ) , rev , null , null ) ;
TCComponentBOMLine topLine = win . getTopBOMLine ( ) ;
TCComponentBOMLine topLine = win . getTopBOMLine ( ) ;
List < BYProcBean > procBeanList2 = new ArrayList < > ( ) ;
List < BYProcBean > procBeanList2 = new ArrayList < > ( ) ;
List < String > codeList = new ArrayList < > ( ) ;
List < String > noList = new ArrayList < > ( ) ;
List < TCComponent > bomList = new ArrayList < > ( ) ;
List < TCComponent > bomRevList = new ArrayList < > ( ) ;
readBom ( topTreeNode , topLine , pb , rev , topBean , procBeanList2 ) ;
// getBomLineTreeNodeSOA
String [ ] prefs = ChintPreferenceUtil . getPreferences ( "database_tc" , session ) ;
if ( SqlUtil . getTCDataConnection ( prefs ) = = null ) {
MessageBox . post ( "数据库连接失败,请检查数据库连接配置!" , "" , 2 ) ;
return ;
}
//预加载BOM及版本属性, 优化速度
com . teamcenter . services . rac . cad . _2007_01 . StructureManagement structureService = com . teamcenter . services . rac . cad . StructureManagementService . getService ( session ) ;
Map < String , ExpandPSData [ ] > bomLineTree = BomToSapUtil . getBomLineTreeNodeSOA ( topLine , structureService ) ;
getBOMList ( topLine , bomLineTree , bomList , bomRevList ) ;
DataManagementService dmService = DataManagementService . getService ( session ) ;
dmService . getProperties ( bomList . toArray ( new TCComponent [ 0 ] ) , new String [ ] { "zt2_Diagram" , "object_string" , "ZT2_ClassificationNo" , "bl_sequence_no" } ) ;
dmService . getProperties ( bomRevList . toArray ( new TCComponent [ 0 ] ) , new String [ ] { "object_type" , "item_id" , "zt2_MaterialNo" , "zt2_MaterialMark" , "zt2_ClassificationCode" } ) ;
System . out . println ( "readData1:" + ( System . currentTimeMillis ( ) - startTime ) / 1000 ) ;
readBom ( topTreeNode , topLine , bomLineTree , pb , rev , topBean , procBeanList2 , codeList , noList ) ;
System . out . println ( "readData2:" + ( System . currentTimeMillis ( ) - startTime ) / 1000 ) ;
getGY ( procBeanList2 , codeList , noList ) ;
System . out . println ( "readData3:" + ( System . currentTimeMillis ( ) - startTime ) / 1000 ) ;
procBeanList . clear ( ) ;
procBeanList . clear ( ) ;
procBeanList . addAll ( procBeanList2 ) ;
procBeanList . addAll ( procBeanList2 ) ;
dialog . map_nodes . put ( topTreeNode , procBeanList2 ) ;
dialog . map_nodes . put ( topTreeNode , procBeanList2 ) ;
TCComponent [ ] revs = new TCComponent [ procBeanList2 . size ( ) ] ;
ArrayList < TCComponent > gyList = new ArrayList < > ( ) ;
for ( int i = 0 ; i < revs . length ; i + + ) {
BYProcBean bean = procBeanList2 . get ( i ) ;
revs [ i ] = bean . getBomRev ( ) ;
if ( bean . getTemplate ( ) ! = null )
gyList . add ( bean . getTemplate ( ) ) ;
if ( bean . getCpgy ( ) ! = null )
gyList . add ( bean . getCpgy ( ) ) ;
if ( bean . getCptlgx ( ) ! = null )
gyList . add ( bean . getCptlgx ( ) ) ;
if ( bean . getTlgx ( ) ! = null )
gyList . add ( bean . getTlgx ( ) ) ;
}
dmService . getProperties ( revs , new String [ ] { "object_type" , "item_id" , "zt2_MaterialNo" , "object_name" , "zt2_Source" } ) ;
dmService . getProperties ( gyList . toArray ( new TCComponent [ gyList . size ( ) ] ) , new String [ ] { "object_name" } ) ;
refushTable2 ( procBeanList2 ) ;
refushTable2 ( procBeanList2 ) ;
System . out . println ( "readData4:" + ( System . currentTimeMillis ( ) - startTime ) / 1000 ) ;
for ( int i = cout - 1 ; i > - 1 ; i - - ) {
for ( int i = cout - 1 ; i > - 1 ; i - - ) {
topTreeNode . remove ( i ) ;
topTreeNode . remove ( i ) ;
}
}
@ -910,7 +906,118 @@ public class CreateProcZYDialogController {
dialog . t_part . getColumnModel ( ) . getColumn ( 4 ) . setCellEditor ( procEditoe ) ;
dialog . t_part . getColumnModel ( ) . getColumn ( 4 ) . setCellEditor ( procEditoe ) ;
}
}
win . close ( ) ;
win . close ( ) ;
SqlUtil . free ( ) ;
System . out . println ( "readData5:" + ( System . currentTimeMillis ( ) - startTime ) / 1000 ) ;
}
private void getBOMList ( TCComponentBOMLine parentLine , Map < String , ExpandPSData [ ] > bomLineTree , List < TCComponent > bomList , List < TCComponent > bomRevList ) {
for ( ExpandPSData data : bomLineTree . get ( parentLine . getUid ( ) ) ) {
TCComponentBOMLine cLine = data . bomLine ;
bomList . add ( cLine ) ;
bomRevList . add ( data . itemRevOfBOMLine ) ;
getBOMList ( cLine , bomLineTree , bomList , bomRevList ) ;
}
}
private void getGY ( List < BYProcBean > procBeanList , List < String > codeList , List < String > noList ) throws Exception {
//TODO getGY
StringBuilder codes = new StringBuilder ( "" ) ;
ArrayList < String > noSet = new ArrayList < > ( ) ;
for ( String s : codeList ) {
if ( noSet . contains ( s ) )
continue ;
noSet . add ( s ) ;
codes . append ( "','" ) . append ( s ) ;
}
//查询标准图投料工序和标准图工艺
StringBuilder sql1 = new StringBuilder ( "select b.puid,a.pitem_id,b.PZT2_CLASSIFICATIONCODE,t1.puid as tlgx,t2.bzgy from pitem a,pitemrevision b0,PPOM_APPLICATION_OBJECT b1," ) ;
sql1 . append ( "(select puid,PZT2_CLASSIFICATIONCODE from PZT2_DESIGN3DREVISION union select puid,PZT2_CLASSIFICATIONCODE from PPART_0_REVISION_ALT) b " )
. append ( "left join (select a2.puid,a1.PITEM_ID from pitem a1,pitemrevision a2 where a2.ritems_tagu=a1.puid) t1 on t1.pitem_id=b.PZT2_CLASSIFICATIONCODE " )
. append ( "left join (select cV.puid,V.puid as bzgy,ITRO.Pobject_Name as supItemName " )
. append ( "from PWORKSPACEOBJECT ITRO,PIMANRELATION R,PIMANTYPE RT,PITEMREVISION V,PITEM P,PITEMREVISION cV,PITEM cP,PWORKSPACEOBJECT cITRO,PPOM_APPLICATION_OBJECT g " )
. append ( "where g.puid=V.puid and V.Puid=R.Rprimary_Objectu and r.rrelation_typeu=RT.puid and P.Puid=V.Ritems_Tagu and ITRO.Puid=V.Puid and R.Rsecondary_Objectu=cV.Puid " )
. append ( "and cP.Puid=cV.Ritems_Tagu and cV.Puid=cITRO.Puid and ITRO.Pactive_Seq<>0 and cITRO.Pactive_Seq<>0 and RT.partifactname='IMAN_METarget' and g.ROWNING_GROUPU='" + group + "') t2 on t2.puid=b.puid " )
. append ( "where b1.PCREATION_DATE in (select max(r3.PCREATION_DATE) from pitem r1,PITEMREVISION r2,PPOM_APPLICATION_OBJECT r3 where r1.puid=r2.ritems_tagu and r2.puid=r3.puid and r1.pitem_id=a.pitem_id) " )
. append ( "and b.puid=b1.puid and b.puid=b0.puid and b0.ritems_tagu=a.puid and a.pitem_id in (" )
. append ( codes . substring ( 2 ) )
. append ( "') order by b.puid" ) ;
System . out . println ( "sql1: \n" + sql1 ) ;
ResultSet read = SqlUtil . read ( sql1 . toString ( ) ) ;
String last = "" ;
HashMap < String , TCComponentItemRevision > uidMap = new HashMap < > ( ) ;
while ( read . next ( ) ) {
String uid = read . getString ( 1 ) ;
String code = read . getString ( 2 ) ;
String classification = read . getString ( 3 ) ;
if ( classification = = null )
classification = "" ;
// System.out.println("code: " + code);
String tlgx = read . getString ( 4 ) ;
String bzgy = read . getString ( 5 ) ;
String one = uid + bzgy ;
if ( one . equals ( last ) )
throw new Exception ( "通过 DrawingNo = " + code + " 查询到多个对象" ) ;
// BYProcBean bean = procBeanList.get(codeList.indexOf(code));
for ( int i = 0 ; i < codeList . size ( ) ; i + + ) {
if ( codeList . get ( i ) . equals ( code ) ) {
BYProcBean bean = procBeanList . get ( i ) ;
if ( tlgx ! = null & & ! tlgx . isEmpty ( ) ) {
if ( uidMap . containsKey ( tlgx ) )
bean . setTlgx ( uidMap . get ( tlgx ) ) ;
else {
TCComponentItemRevision tlgxRev = ( TCComponentItemRevision ) session . stringToComponent ( tlgx ) ;
bean . setTlgx ( tlgxRev ) ;
uidMap . put ( tlgx , tlgxRev ) ;
}
}
if ( bzgy ! = null & & ! bzgy . isEmpty ( ) ) {
TCComponentItemRevision bzgyRev ;
if ( uidMap . containsKey ( bzgy ) )
bzgyRev = uidMap . get ( bzgy ) ;
else {
bzgyRev = ( TCComponentItemRevision ) session . stringToComponent ( bzgy ) ;
uidMap . put ( bzgy , bzgyRev ) ;
}
bean . setTemplate ( bzgyRev ) ;
if ( ! bean . getBzgys ( ) . contains ( bzgyRev ) )
bean . getBzgys ( ) . add ( bzgyRev ) ;
}
bean . setFeeding ( classification . length ( ) < = 0 ) ;
bean . setRev_standard ( ( TCComponentItemRevision ) session . stringToComponent ( uid ) ) ;
}
}
last = one ;
}
// SqlUtil.free();
StringBuilder nos = new StringBuilder ( "" ) ;
noSet . clear ( ) ;
for ( String s : noList ) {
if ( noSet . contains ( s ) )
continue ;
noSet . add ( s ) ;
nos . append ( "','" ) . append ( s ) ;
}
//查询产品图投料工序
String sql2 = "select b.puid,a.pitem_id from pitem a,pitemrevision b where b.ritems_tagu=a.puid and a.PITEM_ID in (" + nos . substring ( 2 ) + "') order by a.pitem_id" ;
System . out . println ( "sql2: \n" + sql2 ) ;
read = SqlUtil . read ( sql2 . toString ( ) ) ;
last = "" ;
while ( read . next ( ) ) {
String id = read . getString ( 2 ) ;
if ( id . equals ( last ) )
throw new Exception ( "通过 ID = " + id + " 查询到多个对象" ) ;
String uid = read . getString ( 1 ) ;
for ( int i = 0 ; i < noList . size ( ) ; i + + ) {
if ( noList . get ( i ) . equals ( id ) ) {
BYProcBean bean = procBeanList . get ( i ) ;
bean . setCptlgx ( ( TCComponentItemRevision ) session . stringToComponent ( uid ) ) ;
}
}
last = id ;
}
// SqlUtil.free();
}
}
public void readData2 ( ProgressBar pb , DefaultMutableTreeNode topTreeNode ) throws Exception {
public void readData2 ( ProgressBar pb , DefaultMutableTreeNode topTreeNode ) throws Exception {
@ -923,6 +1030,7 @@ public class CreateProcZYDialogController {
TCComponentBOMWindow win = bomWinType . create ( null ) ;
TCComponentBOMWindow win = bomWinType . create ( null ) ;
BomBean topBean = ( BomBean ) topTreeNode . getUserObject ( ) ;
BomBean topBean = ( BomBean ) topTreeNode . getUserObject ( ) ;
TCComponentItemRevision rev = topBean . getRev ( ) ;
TCComponentItemRevision rev = topBean . getRev ( ) ;
group = session . getCurrentGroup ( ) . getUid ( ) ;
dialog . bomrev = rev ;
dialog . bomrev = rev ;
if ( dialog . bomrev . getType ( ) . equals ( "Part Revision" )
if ( dialog . bomrev . getType ( ) . equals ( "Part Revision" )
@ -934,8 +1042,11 @@ public class CreateProcZYDialogController {
win . setWindowTopLine ( rev . getItem ( ) , rev , null , null ) ;
win . setWindowTopLine ( rev . getItem ( ) , rev , null , null ) ;
TCComponentBOMLine topLine = win . getTopBOMLine ( ) ;
TCComponentBOMLine topLine = win . getTopBOMLine ( ) ;
List < BYProcBean > procBeanList2 = new ArrayList < > ( ) ;
List < BYProcBean > procBeanList2 = new ArrayList < > ( ) ;
List < String > codeList = new ArrayList < > ( ) ;
List < String > noList = new ArrayList < > ( ) ;
readBom2 ( topTreeNode , topLine , pb , rev , topBean , procBeanList2 ) ;
readBom2 ( topTreeNode , topLine , pb , rev , topBean , procBeanList2 , codeList , noList ) ;
getGY ( procBeanList2 , codeList , noList ) ;
procBeanList . clear ( ) ;
procBeanList . clear ( ) ;
procBeanList . addAll ( procBeanList2 ) ;
procBeanList . addAll ( procBeanList2 ) ;
dialog . map_nodes . put ( topTreeNode , procBeanList2 ) ;
dialog . map_nodes . put ( topTreeNode , procBeanList2 ) ;
@ -971,6 +1082,7 @@ public class CreateProcZYDialogController {
return nodes ;
return nodes ;
}
}
@SuppressWarnings ( "deprecation" )
public void createProcess ( ProgressBar pb , MEProcessBean bean , List < BomBean > beans ) throws Exception {
public void createProcess ( ProgressBar pb , MEProcessBean bean , List < BomBean > beans ) throws Exception {
TCComponentItemRevision template = bean . getMepRevision ( ) ;
TCComponentItemRevision template = bean . getMepRevision ( ) ;
TCComponentItemRevision proc = null ;
TCComponentItemRevision proc = null ;
@ -1011,8 +1123,8 @@ public class CreateProcZYDialogController {
TCComponentItemRevision newProc = null ;
TCComponentItemRevision newProc = null ;
StringBuffer buff = new StringBuffer ( ) ;
StringBuffer buff = new StringBuffer ( ) ;
DefaultMutableTreeNode node ;
// DefaultMutableTreeNode node;
String object_name = proc . getProperty ( "object_name" ) ;
// String object_name = proc.getProperty("object_name");
pb . setText ( "工艺路线创建......" ) ;
pb . setText ( "工艺路线创建......" ) ;
int len = beans . size ( ) ;
int len = beans . size ( ) ;
BYProcBean dyccBean ;
BYProcBean dyccBean ;
@ -1037,7 +1149,7 @@ public class CreateProcZYDialogController {
newProc . add ( "IMAN_METarget" , bomBean . getRev ( ) ) ;
newProc . add ( "IMAN_METarget" , bomBean . getRev ( ) ) ;
}
}
node = dialog . rev_nodes . get ( bomBean . getRev ( ) ) ;
// node = dialog.rev_nodes.get(bomBean.getRev());
if ( dialog . bomLink_maps . containsKey ( bomBean ) ) {
if ( dialog . bomLink_maps . containsKey ( bomBean ) ) {
dyccBean = dialog . bomLink_maps . get ( bomBean ) ;
dyccBean = dialog . bomLink_maps . get ( bomBean ) ;
dyccBean . setCpgy ( newProc ) ;
dyccBean . setCpgy ( newProc ) ;
@ -1048,7 +1160,8 @@ public class CreateProcZYDialogController {
BYProcBean . INDEX_CPGY ) ;
BYProcBean . INDEX_CPGY ) ;
}
}
if ( dyccBean . getRev_standard ( ) = = dyccBean . getBomRev ( ) ) {
if ( dyccBean . getRev_standard ( ) = = dyccBean . getBomRev ( ) ) {
dyccBean . getBzgys ( ) . add ( newProc ) ;
if ( ! dyccBean . getBzgys ( ) . contains ( newProc ) )
dyccBean . getBzgys ( ) . add ( newProc ) ;
dyccBean . setTemplate ( newProc ) ;
dyccBean . setTemplate ( newProc ) ;
if ( dyccBean . isVisible ) {
if ( dyccBean . isVisible ) {
dialog . tm_part . setValueAt ( newProc . getProperty ( "object_name" ) , dyccBean . getIndex ( ) - 1 ,
dialog . tm_part . setValueAt ( newProc . getProperty ( "object_name" ) , dyccBean . getIndex ( ) - 1 ,
@ -1062,7 +1175,7 @@ public class CreateProcZYDialogController {
System . out . println ( "正在为" + bomBean . getRev ( ) + "创建工艺路线" ) ;
System . out . println ( "正在为" + bomBean . getRev ( ) + "创建工艺路线" ) ;
pb . setText ( "正在为" + len + "/" + len + " " + bomBean . getRev ( ) + "创建工艺路线" ) ;
pb . setText ( "正在为" + len + "/" + len + " " + bomBean . getRev ( ) + "创建工艺路线" ) ;
proc . add ( "IMAN_METarget" , bomBean . getRev ( ) ) ;
proc . add ( "IMAN_METarget" , bomBean . getRev ( ) ) ;
node = dialog . rev_nodes . get ( bomBean . getRev ( ) ) ;
// node = dialog.rev_nodes.get(bomBean.getRev());
if ( dialog . bomLink_maps . containsKey ( bomBean ) ) {
if ( dialog . bomLink_maps . containsKey ( bomBean ) ) {
dyccBean = dialog . bomLink_maps . get ( bomBean ) ;
dyccBean = dialog . bomLink_maps . get ( bomBean ) ;
@ -1074,7 +1187,8 @@ public class CreateProcZYDialogController {
BYProcBean . INDEX_CPGY ) ;
BYProcBean . INDEX_CPGY ) ;
}
}
if ( dyccBean . getRev_standard ( ) = = dyccBean . getBomRev ( ) ) {
if ( dyccBean . getRev_standard ( ) = = dyccBean . getBomRev ( ) ) {
dyccBean . getBzgys ( ) . add ( proc ) ;
if ( ! dyccBean . getBzgys ( ) . contains ( proc ) )
dyccBean . getBzgys ( ) . add ( proc ) ;
dyccBean . setTemplate ( proc ) ;
dyccBean . setTemplate ( proc ) ;
if ( dyccBean . isVisible ) {
if ( dyccBean . isVisible ) {
dialog . tm_part . setValueAt ( proc . getProperty ( "object_name" ) , dyccBean . getIndex ( ) - 1 ,
dialog . tm_part . setValueAt ( proc . getProperty ( "object_name" ) , dyccBean . getIndex ( ) - 1 ,