@ -1,7 +1,6 @@
package com.connor.chint.sap2.sap_zy ;
package com.connor.chint.sap2.sap_zy ;
import java.io.IOException ;
import java.io.IOException ;
import java.math.BigDecimal ;
import java.rmi.RemoteException ;
import java.rmi.RemoteException ;
import java.sql.ResultSet ;
import java.sql.ResultSet ;
import java.sql.SQLException ;
import java.sql.SQLException ;
@ -20,35 +19,22 @@ import java.util.Set;
import javax.xml.rpc.ServiceException ;
import javax.xml.rpc.ServiceException ;
import com.alibaba.fastjson2.JSON ;
import com.alibaba.fastjson2.JSONArray ;
import com.alibaba.fastjson2.JSONArray ;
import com.alibaba.fastjson2.JSONObject ;
import com.alibaba.fastjson2.JSONObject ;
import com.chint.plm.common.pojo.EasyResponse ;
import com.chint.plm.common.pojo.EasyResponse ;
import com.chint.plm.common.service.BomPasscontrolService ;
import com.chint.plm.common.service.BomPasscontrolService ;
import com.chint.plm.common.util.ArrayUtils ;
import com.chint.plm.common.util.ArrayUtils ;
import com.chint.plm.common.util.CollectionUtils ;
import com.chint.plm.common.util.CollectionUtils ;
import com.chint.plm.common.util.StringUtils ;
import com.connor.chint.sap2.sap.SAPPushBOMBean ;
import com.connor.chint.sap2.sap.SAPPushBOMBean ;
import com.connor.chint.sap2.sap_by.SAPZZDialogController ;
import com.connor.chint.sap2.sap_by.SAPZZNewOp ;
import com.connor.chint.sap2.sap_by.SAPZZNewOp ;
import com.connor.chint.sap2.sap_by.SAPZZOperation ;
import com.connor.chint.sap2.sap_by.ZZPartBean ;
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.MyProgressBarCompent ;
import com.connor.chint.sap2.util.MyProgressBarCompent ;
import com.connor.chint.sap2.util.POIUtil ;
import com.connor.chint.sap2.util.POIUtil ;
import com.connor.chint.sap2.util.PartSqlUtil ;
import com.connor.chint.sap2.util.SAPMessageUtil ;
import com.connor.chint.sap2.util.SAPMessageUtil ;
import com.connor.chint.sap2.util.SAPUtil ;
import com.connor.chint.sap2.util.SAPUtil ;
import com.connor.chint.sap2.util.SqlUtil ;
import com.connor.chint.sap2.util.SqlUtil ;
import com.connor.chint.sap2.util.SqlUtil2 ;
import com.connor.chint.sap2.util.TXTUtil ;
import com.connor.chint.sap2.util.TXTUtil ;
import com.squareup.okhttp.MediaType ;
import com.squareup.okhttp.OkHttpClient ;
import com.squareup.okhttp.Request ;
import com.squareup.okhttp.RequestBody ;
import com.squareup.okhttp.Response ;
import com.teamcenter.rac.aif.AbstractAIFApplication ;
import com.teamcenter.rac.aif.AbstractAIFApplication ;
import com.teamcenter.rac.aif.kernel.AIFComponentContext ;
import com.teamcenter.rac.aif.kernel.AIFComponentContext ;
import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent ;
import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent ;
@ -73,8 +59,6 @@ import com.teamcenter.rac.kernel.TCPreferenceService;
import com.teamcenter.rac.kernel.TCSession ;
import com.teamcenter.rac.kernel.TCSession ;
import com.teamcenter.rac.kernel.TCUserService ;
import com.teamcenter.rac.kernel.TCUserService ;
import com.teamcenter.rac.util.MessageBox ;
import com.teamcenter.rac.util.MessageBox ;
//import com.teamcenter.schemas.cad._2007_01.structuremanagement.ExpandPSData;
import com.teamcenter.services.rac.cad._2007_01.StructureManagement.ExpandPSAllLevelsOutput ;
import com.teamcenter.services.rac.cad._2007_01.StructureManagement.ExpandPSData ;
import com.teamcenter.services.rac.cad._2007_01.StructureManagement.ExpandPSData ;
import nc.itf.chintwebservices.msg.ISendMsgServices.ISendMsgServices ;
import nc.itf.chintwebservices.msg.ISendMsgServices.ISendMsgServices ;
import nc.itf.chintwebservices.msg.ISendMsgServices.ISendMsgServicesLocator ;
import nc.itf.chintwebservices.msg.ISendMsgServices.ISendMsgServicesLocator ;
@ -111,6 +95,7 @@ import plm.xi.com.chintelectric.SI_PROCESSROUTE_PLM_OUT_SYNServiceLocator;
* PLM 到 ERP 工 艺 路 线 接 口 程 序 开 发 / SI_PROCESSROUTE_PLM_OUT_SYN
* PLM 到 ERP 工 艺 路 线 接 口 程 序 开 发 / SI_PROCESSROUTE_PLM_OUT_SYN
* PLM 到 ERP BOM 接 口 程 序 开 发 / SI_BOM_PLM_OUT_SYN
* PLM 到 ERP BOM 接 口 程 序 开 发 / SI_BOM_PLM_OUT_SYN
* /
* /
@SuppressWarnings ( "deprecation" )
public class SAPZYDialogControllerzt {
public class SAPZYDialogControllerzt {
public SAPZYDialogzt dialog ;
public SAPZYDialogzt dialog ;
@ -195,7 +180,7 @@ public class SAPZYDialogControllerzt {
try {
try {
itemType = ( TCComponentItemType ) session . getTypeService ( ) . getTypeComponent ( "Item" ) ;
itemType = ( TCComponentItemType ) session . getTypeService ( ) . getTypeComponent ( "Item" ) ;
} catch ( TCException e ) {
} catch ( TCException e ) {
// TODO Auto-generated catch block
// Auto-generated catch block
e . printStackTrace ( ) ;
e . printStackTrace ( ) ;
}
}
getMessageUsers ( ) ;
getMessageUsers ( ) ;
@ -594,8 +579,8 @@ public class SAPZYDialogControllerzt {
if ( isCheckProduct ) {
if ( isCheckProduct ) {
StringBuilder sBuilder = new StringBuilder ( ) ;
StringBuilder sBuilder = new StringBuilder ( ) ;
TCComponentItemRevision ccp ;
TCComponentItemRevision ccp ;
String zt2_MaterialNo ;
// String zt2_MaterialNo;
TCComponentContextList res2 ;
// TCComponentContextList res2;
AIFComponentContext [ ] meops ;
AIFComponentContext [ ] meops ;
TCComponent meopRev ;
TCComponent meopRev ;
StringBuilder noneBuilder = new StringBuilder ( ) ;
StringBuilder noneBuilder = new StringBuilder ( ) ;
@ -603,7 +588,7 @@ public class SAPZYDialogControllerzt {
for ( Entry < TCComponentItemRevision , List < TCComponentItemRevision > > entry : cPart_schemes . entrySet ( ) ) {
for ( Entry < TCComponentItemRevision , List < TCComponentItemRevision > > entry : cPart_schemes . entrySet ( ) ) {
ccp = entry . getKey ( ) ;
ccp = entry . getKey ( ) ;
zt2_MaterialNo = ccp . getProperty ( "zt2_MaterialNo" ) ;
// zt2_MaterialNo = ccp.getProperty("zt2_MaterialNo");
meopRev = null ;
meopRev = null ;
meopRev = ccp ;
meopRev = ccp ;
meops = meopRev . whereReferencedByTypeRelation ( new String [ ] { "MEProcessRevision" } ,
meops = meopRev . whereReferencedByTypeRelation ( new String [ ] { "MEProcessRevision" } ,
@ -611,7 +596,7 @@ public class SAPZYDialogControllerzt {
if ( meops = = null | | meops . length = = 0 ) {
if ( meops = = null | | meops . length = = 0 ) {
noneBuilder . append ( "\n " ) . append ( ccp ) ;
noneBuilder . append ( "\n " ) . append ( ccp ) ;
} else if ( meops . length > 1 ) {
} else if ( meops . length > 1 ) {
numsBuilder . append ( "\n " ) . append ( ccp ) ;
//numsBuilder.append("\n ").append(ccp);
}
}
}
}
@ -897,9 +882,9 @@ public class SAPZYDialogControllerzt {
new SAPMessageUtil ( dialog , "" , "BOM传递发生异常:\n" + endBuff . toString ( ) + "\n" + errMess . toString ( ) ) ;
new SAPMessageUtil ( dialog , "" , "BOM传递发生异常:\n" + endBuff . toString ( ) + "\n" + errMess . toString ( ) ) ;
} else {
} else {
String txtPath = TXTUtil . createTxt ( "中压BOM传递AM推送记录" ) ;
String txtPath = TXTUtil . createTxt ( "中压BOM传递AM推送记录" ) ;
String xmmc = "" ;
// String xmmc = "";
String wbs = "" ;
// String wbs = "";
String projectNo = "" ;
// String projectNo = "";
TCComponent released_comp = null ;
TCComponent released_comp = null ;
if ( ban . equals ( "一次" ) ) {
if ( ban . equals ( "一次" ) ) {
released_comp = released_Red ;
released_comp = released_Red ;
@ -920,9 +905,9 @@ public class SAPZYDialogControllerzt {
project . add ( "release_status_list" , released_comp ) ;
project . add ( "release_status_list" , released_comp ) ;
}
}
if ( project ! = null & & ! ( groupID . equals ( "M041" ) | | groupID . equals ( "M046" ) ) ) {
if ( project ! = null & & ! ( groupID . equals ( "M041" ) | | groupID . equals ( "M046" ) ) ) {
xmmc = project . getProperty ( "object_name" ) ;
// xmmc = project.getProperty("object_name");
wbs = project . getProperty ( "zt2_WBSNo" ) ;
wbs = project . getProperty ( "zt2_WBSNo" ) ;
projectNo = project . getProperty ( "zt2_ProjectNo" ) ;
// projectNo = project.getProperty("zt2_ProjectNo");
project . lock ( ) ;
project . lock ( ) ;
project . setProperty ( "zt2_ProjectPhase" , ban + "完成" ) ;
project . setProperty ( "zt2_ProjectPhase" , ban + "完成" ) ;
project . save ( ) ;
project . save ( ) ;
@ -1015,7 +1000,7 @@ public class SAPZYDialogControllerzt {
if ( ccp . getType ( ) . equals ( "Part Revision" ) & & ccp . getProperty ( "zt2_BOMScheme" ) . equals ( "汇总" ) ) {
if ( ccp . getType ( ) . equals ( "Part Revision" ) & & ccp . getProperty ( "zt2_BOMScheme" ) . equals ( "汇总" ) ) {
int quantity = POIUtil . getIntValue ( ccp . getProperty ( "zt2_Quantity" ) ) ;
int quantity = POIUtil . getIntValue ( ccp . getProperty ( "zt2_Quantity" ) ) ;
quantity = quantity = = 0 ? 1 : quantity ;
quantity = quantity = = 0 ? 1 : quantity ;
int size = list . size ( ) ;
// int size = list.size();
head . setBMENG ( quantity + "" ) ;
head . setBMENG ( quantity + "" ) ;
// 母线槽制造部特殊处理部分
// 母线槽制造部特殊处理部分
if ( "M041" . equals ( groupID ) ) {
if ( "M041" . equals ( groupID ) ) {
@ -1109,7 +1094,7 @@ public class SAPZYDialogControllerzt {
String ktSortno = SAPUtil . getFirstSORTFNo ( session , ( TCComponentItemRevision ) mpComp ) ;
String ktSortno = SAPUtil . getFirstSORTFNo ( session , ( TCComponentItemRevision ) mpComp ) ;
System . out . println ( "壳体:" + ktSortno ) ;
System . out . println ( "壳体:" + ktSortno ) ;
for ( int i = 0 ; i < schemes . size ( ) ; i + + ) {
for ( int i = 0 ; i < schemes . size ( ) ; i + + ) {
boolean isSturct = false ;
// boolean isSturct = false;
TCComponentItemRevision rev2 = schemes . get ( i ) ;
TCComponentItemRevision rev2 = schemes . get ( i ) ;
String zt2_MaterialNo2 = rev2 . getProperty ( "zt2_MaterialNo" ) ;
String zt2_MaterialNo2 = rev2 . getProperty ( "zt2_MaterialNo" ) ;
DT_BOM_PLM_REQLISTITEMSITEM item = new DT_BOM_PLM_REQLISTITEMSITEM ( ) ;
DT_BOM_PLM_REQLISTITEMSITEM item = new DT_BOM_PLM_REQLISTITEMSITEM ( ) ;
@ -1125,7 +1110,7 @@ public class SAPZYDialogControllerzt {
bl_seq_no = "0020" ;
bl_seq_no = "0020" ;
} else if ( cName . indexOf ( SAPZYDialogControllerzt . BOM_NAMES [ 2 ] ) ! = - 1 ) {
} else if ( cName . indexOf ( SAPZYDialogControllerzt . BOM_NAMES [ 2 ] ) ! = - 1 ) {
bl_seq_no = "0030" ;
bl_seq_no = "0030" ;
isSturct = true ;
// isSturct = true;
} else if ( cName . indexOf ( "壳体" ) ! = - 1 ) {
} else if ( cName . indexOf ( "壳体" ) ! = - 1 ) {
bl_seq_no = "0030" ;
bl_seq_no = "0030" ;
item . setSORTF ( ktSortno ) ;
item . setSORTF ( ktSortno ) ;
@ -1175,7 +1160,7 @@ public class SAPZYDialogControllerzt {
else
else
isSends . add ( rev2 ) ;
isSends . add ( rev2 ) ;
boolean isExist = false ;
// boolean isExist = false;
// sapRevs.add(rev2);
// sapRevs.add(rev2);
// if (!sapLists.contains(rev2))
// if (!sapLists.contains(rev2))
@ -1252,9 +1237,9 @@ public class SAPZYDialogControllerzt {
if ( revs = = null )
if ( revs = = null )
return ;
return ;
StringBuffer sb = new StringBuffer ( ) ;
StringBuffer sb = new StringBuffer ( ) ;
Set < TCComponentItemRevision > sets = new HashSet < > ( ) ;
// Set<TCComponentItemRevision> sets = new HashSet<>();
Set < TCComponent > set_meops = new HashSet < > ( ) ;
Set < TCComponent > set_meops = new HashSet < > ( ) ;
String bmeng = "1" ;
// String bmeng = "1";
System . out . println ( "ccp:" + ccp ) ;
System . out . println ( "ccp:" + ccp ) ;
String zt2_MaterialNo ;
String zt2_MaterialNo ;
for ( TCComponentItemRevision rev : revs ) {
for ( TCComponentItemRevision rev : revs ) {
@ -1325,7 +1310,7 @@ public class SAPZYDialogControllerzt {
String txtPath = TXTUtil . createTxt ( txtName ) ;
String txtPath = TXTUtil . createTxt ( txtName ) ;
System . out . println ( "日志:" + txtPath ) ;
System . out . println ( "日志:" + txtPath ) ;
List < String > bomISExist = new ArrayList < String > ( ) ;
List < String > bomISExist = new ArrayList < String > ( ) ;
bmeng = SAPUtil. getSAPBMENG ( rev ) ;
SAPUtil. getSAPBMENG ( rev ) ;
SAPUtil . recurZYZZSAP ( componentbomline , rev , null , isStruct , session , 1 , groupName , now , txtPath , list ,
SAPUtil . recurZYZZSAP ( componentbomline , rev , null , isStruct , session , 1 , groupName , now , txtPath , list ,
proclist , process_jg , errMess , gy_meops , needTCM_meops , bomISExist , codeMark , icsId , by_materiasls ,
proclist , process_jg , errMess , gy_meops , needTCM_meops , bomISExist , codeMark , icsId , by_materiasls ,
material_revs , set_meops ) ;
material_revs , set_meops ) ;
@ -1454,10 +1439,10 @@ public class SAPZYDialogControllerzt {
TXTUtil . writeTXT ( logPath , "返回信息:" + mess2 ) ;
TXTUtil . writeTXT ( logPath , "返回信息:" + mess2 ) ;
System . out . println ( "返回信息:" + mess2 ) ;
System . out . println ( "返回信息:" + mess2 ) ;
} catch ( ServiceException e ) {
} catch ( ServiceException e ) {
// TODO Auto-generated catch block
// Auto-generated catch block
e . printStackTrace ( ) ;
e . printStackTrace ( ) ;
} catch ( RemoteException e ) {
} catch ( RemoteException e ) {
// TODO Auto-generated catch block
// Auto-generated catch block
e . printStackTrace ( ) ;
e . printStackTrace ( ) ;
}
}
TXTUtil . writeTXT ( logPath , "AM消息推送结束" ) ;
TXTUtil . writeTXT ( logPath , "AM消息推送结束" ) ;
@ -1649,8 +1634,8 @@ public class SAPZYDialogControllerzt {
meops = meopRev . whereReferencedByTypeRelation ( new String [ ] { "MEProcessRevision" } ,
meops = meopRev . whereReferencedByTypeRelation ( new String [ ] { "MEProcessRevision" } ,
new String [ ] { "IMAN_METarget" } ) ;
new String [ ] { "IMAN_METarget" } ) ;
if ( meops ! = null & & meops . length = = 1 ) {
if ( meops ! = null & & meops . length = = 1 ) {
mpComp = ( TCComponent ) meops [ 0 ] . getComponent ( ) ;
mpComp = SAPUtil . getSameGroupProc ( meops , session ) ;
SAPUtil . readBopInfo1 ( ( TCComponentMEProcessRevision ) m eo ps[ 0 ] . get Component( ) , cPart ,
SAPUtil . readBopInfo1 ( ( TCComponentMEProcessRevision ) m pComp, cPart ,
session , now , txtPath , proclist , groupName , gy_meops , needTCM_meops , false ) ;
session , now , txtPath , proclist , groupName , gy_meops , needTCM_meops , false ) ;
}
}
} else {
} else {
@ -1669,14 +1654,14 @@ public class SAPZYDialogControllerzt {
new String [ ] { "IMAN_METarget" } ) ;
new String [ ] { "IMAN_METarget" } ) ;
if ( meops ! = null & & meops . length = = 1 ) {
if ( meops ! = null & & meops . length = = 1 ) {
mpComp = ( TCComponent ) meops [ 0 ] . getComponent ( ) ;
mpComp = SAPUtil . getSameGroupProc ( meops , session ) ;
SAPUtil . readBopInfo1 ( ( TCComponentMEProcessRevision ) m eo ps[ 0 ] . get Component( ) , cPart ,
SAPUtil . readBopInfo1 ( ( TCComponentMEProcessRevision ) m pComp, cPart ,
session , now , txtPath , proclist , groupName , gy_meops , needTCM_meops , false ) ;
session , now , txtPath , proclist , groupName , gy_meops , needTCM_meops , false ) ;
}
}
}
}
} else {
} else {
mpComp = ( TCComponent ) meops [ 0 ] . getComponent ( ) ;
mpComp = SAPUtil . getSameGroupProc ( meops , session ) ;
SAPUtil . readBopInfo1 ( ( TCComponentMEProcessRevision ) m eo ps[ 0 ] . get Component( ) , cPart , session ,
SAPUtil . readBopInfo1 ( ( TCComponentMEProcessRevision ) m pComp, cPart , session ,
now , txtPath , proclist , groupName , gy_meops , needTCM_meops , true ) ;
now , txtPath , proclist , groupName , gy_meops , needTCM_meops , true ) ;
}
}
}
}
@ -1687,7 +1672,7 @@ public class SAPZYDialogControllerzt {
try {
try {
return o1 . getProperty ( "zt2_MaterialNo" ) . compareTo ( o2 . getProperty ( "zt2_MaterialNo" ) ) ;
return o1 . getProperty ( "zt2_MaterialNo" ) . compareTo ( o2 . getProperty ( "zt2_MaterialNo" ) ) ;
} catch ( TCException e ) {
} catch ( TCException e ) {
// TODO Auto-generated catch block
// Auto-generated catch block
e . printStackTrace ( ) ;
e . printStackTrace ( ) ;
}
}
return 0 ;
return 0 ;
@ -1702,7 +1687,7 @@ public class SAPZYDialogControllerzt {
if ( cPart . getType ( ) . equals ( "Part Revision" ) & & cPart . getProperty ( "zt2_BOMScheme" ) . equals ( "汇总" ) ) {
if ( cPart . getType ( ) . equals ( "Part Revision" ) & & cPart . getProperty ( "zt2_BOMScheme" ) . equals ( "汇总" ) ) {
int quantity = POIUtil . getIntValue ( cPart . getProperty ( "zt2_Quantity" ) ) ;
int quantity = POIUtil . getIntValue ( cPart . getProperty ( "zt2_Quantity" ) ) ;
quantity = quantity = = 0 ? 1 : quantity ;
quantity = quantity = = 0 ? 1 : quantity ;
int size = list . size ( ) ;
// int size = list.size();
head . setBMENG ( quantity + "" ) ;
head . setBMENG ( quantity + "" ) ;
// 母线槽制造部特殊处理部分
// 母线槽制造部特殊处理部分
if ( "M041" . equals ( groupID ) ) {
if ( "M041" . equals ( groupID ) ) {
@ -1733,8 +1718,8 @@ public class SAPZYDialogControllerzt {
new String [ ] { "MEProcessRevision" } , new String [ ] { "IMAN_METarget" } ) ;
new String [ ] { "MEProcessRevision" } , new String [ ] { "IMAN_METarget" } ) ;
String sortno = "" ;
String sortno = "" ;
if ( meops ! = null & & meops . length > 0 ) {
if ( meops ! = null & & meops . length > 0 ) {
TCComponent temp = SAPUtil . getNewBOMLine ( ( TCComponentItemRevision ) meops [ 0 ] . getComponent ( ) ,
mpComp = SAPUtil . getSameGroupProc ( meops , session ) ;
session ) ;
TCComponent temp = SAPUtil . getNewBOMLine ( ( TCComponentItemRevision ) mpComp , session ) ;
AIFComponentContext [ ] contexts3 = temp . getChildren ( ) ;
AIFComponentContext [ ] contexts3 = temp . getChildren ( ) ;
for ( int k = 0 ; k < contexts3 . length ; k + + ) {
for ( int k = 0 ; k < contexts3 . length ; k + + ) {
if ( contexts3 [ k ] . getComponent ( ) . getProperty ( "bl_rev_object_name" ) . contains ( "二次元件装配" ) ) {
if ( contexts3 [ k ] . getComponent ( ) . getProperty ( "bl_rev_object_name" ) . contains ( "二次元件装配" ) ) {
@ -1865,11 +1850,11 @@ public class SAPZYDialogControllerzt {
@Override
@Override
public int compare ( TCComponentItemRevision o1 , TCComponentItemRevision o2 ) {
public int compare ( TCComponentItemRevision o1 , TCComponentItemRevision o2 ) {
// TODO Auto-generated method stub
// Auto-generated method stub
try {
try {
return o1 . getProperty ( "object_string" ) . compareTo ( o2 . getProperty ( "object_string" ) ) ;
return o1 . getProperty ( "object_string" ) . compareTo ( o2 . getProperty ( "object_string" ) ) ;
} catch ( TCException e ) {
} catch ( TCException e ) {
// TODO Auto-generated catch block
// Auto-generated catch block
e . printStackTrace ( ) ;
e . printStackTrace ( ) ;
}
}
return 0 ;
return 0 ;
@ -1886,11 +1871,11 @@ public class SAPZYDialogControllerzt {
@Override
@Override
public int compare ( TCComponentItemRevision o1 , TCComponentItemRevision o2 ) {
public int compare ( TCComponentItemRevision o1 , TCComponentItemRevision o2 ) {
// TODO Auto-generated method stub
// Auto-generated method stub
try {
try {
return o1 . getProperty ( "object_string" ) . compareTo ( o2 . getProperty ( "object_string" ) ) ;
return o1 . getProperty ( "object_string" ) . compareTo ( o2 . getProperty ( "object_string" ) ) ;
} catch ( TCException e ) {
} catch ( TCException e ) {
// TODO Auto-generated catch block
// Auto-generated catch block
e . printStackTrace ( ) ;
e . printStackTrace ( ) ;
}
}
return 0 ;
return 0 ;
@ -1910,10 +1895,10 @@ public class SAPZYDialogControllerzt {
"BOM传递发生异常:\n" + endBuff . toString ( ) + "\n" + errMess . toString ( ) + "\n,ERROR:" + errMess . toString ( ) ) ;
"BOM传递发生异常:\n" + endBuff . toString ( ) + "\n" + errMess . toString ( ) + "\n,ERROR:" + errMess . toString ( ) ) ;
} else {
} else {
String txtPath = TXTUtil. createTxt ( "ÖÐѹBOM´ «µÝAMÍÆËͼǼ" ) ;
TXTUtil. createTxt ( "ÖÐѹBOM´ «µÝAMÍÆËͼǼ" ) ;
String xmmc = "" ;
// String xmmc = "";
String wbs = "" ;
// String wbs = "";
String projectNo = "" ;
// String projectNo = "";
TCComponent released_comp = released_Green ;
TCComponent released_comp = released_Green ;
if ( released_comp ! = null ) {
if ( released_comp ! = null ) {
@ -1946,7 +1931,7 @@ public class SAPZYDialogControllerzt {
public int getCode ( ) throws SQLException {
public int getCode ( ) throws SQLException {
String sql = "select Tab_SendBom_Sequence.nextval as sid from dual" ;
String sql = "select Tab_SendBom_Sequence.nextval as sid from dual" ;
ResultSet rs = SqlUtil . read ( sql ) ;
ResultSet rs = SqlUtil . read ( sql ) ;
Object objs [ ] = new Object [ 1 ] ;
// Object objs[] = new Object[1];
int code = 0 ;
int code = 0 ;
if ( rs . next ( ) ) {
if ( rs . next ( ) ) {
code = rs . getInt ( 1 ) ;
code = rs . getInt ( 1 ) ;
@ -2134,6 +2119,7 @@ public class SAPZYDialogControllerzt {
// my.setVisible(false);
// my.setVisible(false);
// }
// }
}
}
/ *
private void sendSapYH ( String ban , MyProgressBarCompent my , boolean isCheckProduct ) throws Exception {
private void sendSapYH ( String ban , MyProgressBarCompent my , boolean isCheckProduct ) throws Exception {
process_boms . clear ( ) ;
process_boms . clear ( ) ;
// process_jg.clear();
// process_jg.clear();
@ -2316,7 +2302,7 @@ public class SAPZYDialogControllerzt {
List < DT_PROCESSROUTE_S4_REQLIST > proclist = new ArrayList < DT_PROCESSROUTE_S4_REQLIST > ( ) ;
List < DT_PROCESSROUTE_S4_REQLIST > proclist = new ArrayList < DT_PROCESSROUTE_S4_REQLIST > ( ) ;
List < TCComponentItemRevision > isSends = new ArrayList < TCComponentItemRevision > ( ) ;
List < TCComponentItemRevision > isSends = new ArrayList < TCComponentItemRevision > ( ) ;
StringBuffer errMess = new StringBuffer ( ) ;
// StringBuffer errMess = new StringBuffer();
// StringBuffer userIDs = new StringBuffer();
// StringBuffer userIDs = new StringBuffer();
my . setShowLabel ( "正在向SAP传递BOM、工艺信息。。。。。。" ) ;
my . setShowLabel ( "正在向SAP传递BOM、工艺信息。。。。。。" ) ;
@ -2349,7 +2335,7 @@ public class SAPZYDialogControllerzt {
// sapLists.clear();
// sapLists.clear();
//读BOM信息 产成品 电气BOM BOM信息 工艺信息 是否传递
//读BOM信息 产成品 电气BOM BOM信息 工艺信息 是否传递
readBomInfoYH ( ccp , schemes , list , proclist , isSends , txtPath ) ;
readBomInfoYH ( ccp , schemes , list , proclist , isSends , txtPath ) ;
List < String > matnrs = null ;
// List<String> matnrs = null;
TXTUtil . writeTXT ( txtPath , "-------------BOM数据传递开始--------" ) ;
TXTUtil . writeTXT ( txtPath , "-------------BOM数据传递开始--------" ) ;
System . out . println ( "-------------BOM数据传递开始----------" ) ;
System . out . println ( "-------------BOM数据传递开始----------" ) ;
StringBuffer errMessage = new StringBuffer ( ) ;
StringBuffer errMessage = new StringBuffer ( ) ;
@ -2357,9 +2343,9 @@ public class SAPZYDialogControllerzt {
try {
try {
TXTUtil . writeTXT ( txtPath , "BOM数据传递开始" ) ;
TXTUtil . writeTXT ( txtPath , "BOM数据传递开始" ) ;
SI_BOM_PLM_OUT_SYNService service = new SI_BOM_PLM_OUT_SYNServiceLocator ( ) ;
SI_BOM_PLM_OUT_SYNService service = new SI_BOM_PLM_OUT_SYNServiceLocator ( ) ;
SI_BOM_PLM_OUT_SYN stub = service. getHTTP_Port ( ) ;
service. getHTTP_Port ( ) ;
String REQ_TRACE_ID = "123456" ;
String REQ_TRACE_ID = "123456" ;
DT_BOM_PLM_REQBASEINFO baseInfo = new DT_BOM_PLM_REQBASEINFO ( REQ_TRACE_ID ) ;
new DT_BOM_PLM_REQBASEINFO ( REQ_TRACE_ID ) ;
for ( DT_BOM_PLM_REQLIST l : list ) {
for ( DT_BOM_PLM_REQLIST l : list ) {
System . out . println ( l ) ;
System . out . println ( l ) ;
TXTUtil . writeTXT ( txtPath , l . toString ( ) ) ;
TXTUtil . writeTXT ( txtPath , l . toString ( ) ) ;
@ -2390,10 +2376,10 @@ public class SAPZYDialogControllerzt {
if ( proclist . size ( ) > 0 ) {
if ( proclist . size ( ) > 0 ) {
try {
try {
SI_PROCESSROUTE_PLM_OUT_SYNService service = new SI_PROCESSROUTE_PLM_OUT_SYNServiceLocator ( ) ;
SI_PROCESSROUTE_PLM_OUT_SYNService service = new SI_PROCESSROUTE_PLM_OUT_SYNServiceLocator ( ) ;
SI_PROCESSROUTE_PLM_OUT_SYN stub = service. getHTTP_Port ( ) ;
service. getHTTP_Port ( ) ;
String REQ_TRACE_ID = "123456" ;
String REQ_TRACE_ID = "123456" ;
DT_PROCESSROUTE_S4_REQBASEINFO baseInfo = new DT_PROCESSROUTE_S4_REQBASEINFO ( REQ_TRACE_ID ) ;
new DT_PROCESSROUTE_S4_REQBASEINFO ( REQ_TRACE_ID ) ;
DT_PROCESSROUTE_S4_REQLIST [ ] request = proclist . toArray ( new DT_PROCESSROUTE_S4_REQLIST [ ] { } ) ;
DT_PROCESSROUTE_S4_REQLIST [ ] request = proclist . toArray ( new DT_PROCESSROUTE_S4_REQLIST [ ] { } ) ;
for ( DT_PROCESSROUTE_S4_REQLIST r : request ) {
for ( DT_PROCESSROUTE_S4_REQLIST r : request ) {
System . out . println ( r ) ;
System . out . println ( r ) ;
@ -2576,7 +2562,7 @@ public class SAPZYDialogControllerzt {
TCComponentItemRevision ccp ) {
TCComponentItemRevision ccp ) {
if ( revs = = null )
if ( revs = = null )
return ;
return ;
StringBuffer sb = new StringBuffer ( ) ;
// StringBuffer sb = new StringBuffer();
// Set<TCComponentItemRevision> sets = new HashSet<>();
// Set<TCComponentItemRevision> sets = new HashSet<>();
Set < TCComponent > set_meops = new HashSet < > ( ) ;
Set < TCComponent > set_meops = new HashSet < > ( ) ;
// String bmeng = "1";
// String bmeng = "1";
@ -2678,7 +2664,7 @@ public class SAPZYDialogControllerzt {
} finally {
} finally {
SqlUtil . freeAll ( ) ;
SqlUtil . freeAll ( ) ;
}
}
}
} * /
// 中压传递
// 中压传递
public void recurZYZZSAPYH ( TCComponentBOMLine line , TCComponentItemRevision rev , TCComponentItem part ,
public void recurZYZZSAPYH ( TCComponentBOMLine line , TCComponentItemRevision rev , TCComponentItem part ,
boolean isStruct , TCSession session , int level , String groupName , String now , String txtPath ,
boolean isStruct , TCSession session , int level , String groupName , String now , String txtPath ,
@ -2716,7 +2702,7 @@ public class SAPZYDialogControllerzt {
} else {
} else {
if ( meops . length > 0 & & partRev ! = null ) {
if ( meops . length > 0 & & partRev ! = null ) {
TCComponent mpComp = ( TCComponent ) meops [ 0 ] . getComponent ( ) ;
TCComponent mpComp = SAPUtil . getSameGroupProc ( meops , session ) ;
if ( ! KUtil . isTCM ( mpComp ) ) {
if ( ! KUtil . isTCM ( mpComp ) ) {
set_meops . add ( mpComp ) ;
set_meops . add ( mpComp ) ;
}
}
@ -2821,6 +2807,7 @@ public class SAPZYDialogControllerzt {
}
}
list . add ( new DT_BOM_PLM_REQLIST ( head , items ) ) ;
list . add ( new DT_BOM_PLM_REQLIST ( head , items ) ) ;
}
}
/ *
private void readBomInfoYH ( TCComponentItemRevision ccp , List < TCComponentItemRevision > schemes ,
private void readBomInfoYH ( TCComponentItemRevision ccp , List < TCComponentItemRevision > schemes ,
List < DT_BOM_PLM_REQLIST > list , List < DT_PROCESSROUTE_S4_REQLIST > proclist ,
List < DT_BOM_PLM_REQLIST > list , List < DT_PROCESSROUTE_S4_REQLIST > proclist ,
List < TCComponentItemRevision > isSends , String txtPath ) throws Exception {
List < TCComponentItemRevision > isSends , String txtPath ) throws Exception {
@ -3050,7 +3037,7 @@ public class SAPZYDialogControllerzt {
SqlUtil . free ( ) ;
SqlUtil . free ( ) ;
}
}
return wlflmMap ;
return wlflmMap ;
}
} * /
public static String getFLMDb2 ( String zt2_MaterialNo2 , TCSession session , String groupName ) {
public static String getFLMDb2 ( String zt2_MaterialNo2 , TCSession session , String groupName ) {
String mes = zt2_MaterialNo2 . split ( "-" ) [ 0 ] ;
String mes = zt2_MaterialNo2 . split ( "-" ) [ 0 ] ;
String sortno = "" ;
String sortno = "" ;