@ -3,7 +3,6 @@ package com.connor.chint.sap2.util;
import java.io.File ;
import java.io.FileInputStream ;
import java.io.IOException ;
import java.rmi.RemoteException ;
import java.sql.ResultSet ;
import java.sql.SQLException ;
import java.util.ArrayList ;
@ -20,8 +19,6 @@ import java.util.Map.Entry;
import java.util.Set ;
import java.util.concurrent.TimeUnit ;
import javax.xml.rpc.ServiceException ;
import com.connor.chint.sap2.bean.ApplyMeBean ;
import com.connor.chint.sap2.bom.core.BOMInfo ;
import com.connor.chint.sap2.bom.core.Component ;
@ -79,9 +76,6 @@ import com.teamcenter.rac.util.MessageBox;
import com.teamcenter.rac.util.Registry ;
import com.teamcenter.services.rac.cad._2007_01.StructureManagement.ExpandPSData ;
import nc.itf.chintwebservices.msg.ISendMsgServices.ISendMsgServices ;
import nc.itf.chintwebservices.msg.ISendMsgServices.ISendMsgServicesLocator ;
import nc.itf.chintwebservices.msg.ISendMsgServices.ISendMsgServicesPortType ;
import net.sf.json.JSONObject ;
import plm.xi.com.chintelectric.DT_BOM_PLM_REQLIST ;
import plm.xi.com.chintelectric.DT_BOM_PLM_REQLISTHEAD ;
@ -3395,21 +3389,73 @@ public class SAPUtil {
* @param logPath 推 送 AM 消 息
* @throws IOException
* /
public static void sendMsg ( String mess , String userID , String logPath ) throws IOException {
try {
// public static void sendMsg(String mess, String userID, String logPath) throws IOException {
// try {
// TXTUtil.writeTXT(logPath, "开始AM消息推送");
// TXTUtil.writeTXT(logPath, "用户:" + userID + ";信息:" + mess);
// ISendMsgServices service2 = new ISendMsgServicesLocator();
// ISendMsgServicesPortType stub2 = service2.getISendMsgServicesSOAP11port_http();
// String mess2 = stub2.chintSendMsgServices(userID, "", mess, "PLM");
// TXTUtil.writeTXT(logPath, "返回信息:" + mess2);
// System.out.println("返回信息:" + mess2);
// } catch (ServiceException e) {
// e.printStackTrace();
// } catch (RemoteException e) {
// e.printStackTrace();
// }
// TXTUtil.writeTXT(logPath, "AM消息推送结束");
// }
public static void sendMsg ( String mess , String userID , String logPath ) {
TXTUtil . writeTXT ( logPath , "开始AM消息推送" ) ;
TXTUtil . writeTXT ( logPath , "用户:" + userID + ";信息:" + mess ) ;
ISendMsgServices service2 = new ISendMsgServicesLocator ( ) ;
ISendMsgServicesPortType stub2 = service2 . getISendMsgServicesSOAP11port_http ( ) ;
String mess2 = stub2 . chintSendMsgServices ( userID , "" , mess , "PLM" ) ;
String mess2 = sendMsg ( mess , userID ) ;
TXTUtil . writeTXT ( logPath , "返回信息:" + mess2 ) ;
TXTUtil . writeTXT ( logPath , "AM消息推送结束" ) ;
}
public static String sendMsg ( String mess , String userID ) {
String mess2 = "" ;
try {
/ * ISendMsgServices service2 = new ISendMsgServicesLocator ( ) ;
ISendMsgServicesPortType stub2 = service2 . getISendMsgServicesSOAP11port_http ( ) ;
String mess2 = stub2 . chintSendMsgServices ( userID , "" , mess , "" ) ; //(userID, "", mess, "PLM");*/
//TODO lidy20240829新接口 先获取token, 再组织数据
String msgJson = "{\"emails\":[\"" + userID + "\"],\"mobiles\": [],\"content\": \"" + mess + "\"}" ;
OkHttpClient client = new OkHttpClient ( ) ;
RequestBody body = RequestBody . create ( null , new byte [ 0 ] ) ;
Request request = new Request . Builder ( )
. url ( "https://pub.chintelec.com/api/getToken?appId=zt_plm&appSecret=RA5KfdZtj37zpVsmgKeSxWncEIT8npVf" )
. post ( body )
. build ( ) ;
Response response = client . newCall ( request ) . execute ( ) ;
String res = response . body ( ) . string ( ) ;
org . json . JSONObject jsonObject = new org . json . JSONObject ( res ) ;
// System.out.println(res);
if ( ! jsonObject . getBoolean ( "success" ) ) {
System . out . println ( res ) ;
return res ;
}
String token = jsonObject . getString ( "data" ) ;
client = new OkHttpClient ( ) ;
MediaType mediaType = MediaType . parse ( "application/json" ) ;
body = RequestBody . create ( mediaType , msgJson ) ;
request = new Request . Builder ( )
. url ( "https://pub.chintelec.com/api/open/Feishu/sendMessages" )
. post ( body )
. addHeader ( "Authorization" , token )
. addHeader ( "Content-Type" , "application/json" )
. build ( ) ;
response = client . newCall ( request ) . execute ( ) ;
mess2 = response . body ( ) . string ( ) ;
System . out . println ( "返回信息:" + mess2 ) ;
} catch ( ServiceException e ) {
e . printStackTrace ( ) ;
} catch ( RemoteException e ) {
} catch ( Exception e ) {
// Auto-generated catch block
e . printStackTrace ( ) ;
}
TXTUtil . writeTXT ( logPath , "AM消息推送结束" ) ;
return mess2 ;
}
// 清楚为空的子项
@ -4034,8 +4080,7 @@ public class SAPUtil {
List < DT_BOM_PLM_REQLIST > list , List < DT_PROCESSROUTE_S4_REQLIST > proclist , String txtPath , String now ,
List < String > bomISExist , String codeRemark , int icsId , Map < String , TCComponentItemRevision > by_materials ,
StringBuffer errMess , StringBuffer buff , Map < String , TCComponentItemRevision > material_revs , String matr ,
List < String > kjBomIds , String projWbsNo )
throws Exception {
List < String > kjBomIds , String projWbsNo , HashMap < String , ArrayList < String [ ] > > flMap ) throws Exception {
// 若来源为外购, BOM不继续向下展开 20191227
try {
line . refresh ( ) ;
@ -4070,7 +4115,7 @@ public class SAPUtil {
boolean equals = rev . getProperty ( "zt2_Source" ) . equals ( "外购" ) ;
if ( partRev ! = null ) {
if ( meops . length = = 0 ) {
if ( ! equals & & line. getChildrenCount ( ) > 0 ) {
if ( ! equals & & rev. getType ( ) . equals ( "ZT2_Design3DRevision" ) ) { // && line.getChildrenCount() > 0
String groupID = SAPUtil . getGroupID ( session ) ;
TCComponentMEProcessRevision mrProcess = getMrProcess ( groupID , session ) ;
if ( mrProcess ! = null ) {
@ -4107,7 +4152,7 @@ public class SAPUtil {
TCComponentBOMLine componentbomline = win . getTopBOMLine ( ) ;
SAPUtil . recurBYBJSAP ( componentbomline , partRev , partRev , gy_meops , needTCM_meops , session , groupName ,
list , proclist , txtPath , now , bomISExist , codeRemark , icsId , by_materials , errMess , buff ,
material_revs , matr , kjBomIds , projWbsNo );
material_revs , matr , kjBomIds , projWbsNo , flMap );
win . refresh ( ) ;
win . close ( ) ;
@ -4125,17 +4170,20 @@ public class SAPUtil {
bomISExist . add ( zt2_MaterialNo ) ;
}
}
String idCut = "" ;
if ( item_id . indexOf ( "-" ) > 0 )
idCut = item_id . substring ( 0 , item_id . indexOf ( "-" ) ) ;
if ( contexts . length = = 0 ) {
if ( contexts . length = = 0 & & ! flMap . containsKey ( idCut ) ) {
if ( rev . getType ( ) . equals ( "ZT2_Design3DRevision" ) & & rev . getProperty ( "zt2_Source" ) . equals ( "自制" ) ) {
buff . setLength ( 0 ) ;
TCComponentItemRevision comp = null ;
String sortno = "" ;
Map < String , YCLMaterialBean > materials = new HashMap < String , YCLMaterialBean > ( ) ;
if ( matr ! = null & & matr . equals ( "DB" ) ) {
comp = SAPUtil . getClassPartDB ( rev , session , codeRemark , icsId , by_materials , buff , materials ) ;
comp = SAPUtil . getClassPartDB ( rev , session , codeRemark , icsId , by_materials , buff , materials ) ;
} else {
comp = SAPUtil . getClassPart ( rev , session , codeRemark , icsId , by_materials , buff , materials ) ;
comp = SAPUtil . getClassPart ( rev , session , codeRemark , icsId , by_materials , buff , materials ) ;
}
// 原材料展开时投料工序获取父项的工艺首工序改为获取父项的投料工序
sortno = line . getProperty ( "ZT2_ClassificationNo" ) ;
@ -4253,7 +4301,26 @@ public class SAPUtil {
head . setBMENG ( "1" ) ;
head . setWERKS ( groupName ) ;
head . setDATUV ( now ) ;
DT_BOM_PLM_REQLISTITEMSITEM [ ] items = new DT_BOM_PLM_REQLISTITEMSITEM [ contexts . length ] ;
int start = contexts . length ;
DT_BOM_PLM_REQLISTITEMSITEM [ ] items = new DT_BOM_PLM_REQLISTITEMSITEM [ start ] ;
ArrayList < AIFComponentContext > fls = new ArrayList < > ( ) ;
ArrayList < String > gxs = new ArrayList < > ( ) ;
if ( flMap . containsKey ( idCut ) ) {
for ( String [ ] fl : flMap . get ( idCut ) ) {
TCComponent [ ] flnoItem = session . search ( "零组件 ID" , new String [ ] { "零组件 ID" } ,
new String [ ] { fl [ 0 ] } ) ;
if ( flnoItem . length > 0 ) {
TCComponentItemRevision flno = ( ( TCComponentItem ) flnoItem [ 0 ] ) . getLatestItemRevision ( ) ;
TCComponentBOMLine flnoBOM = SAPUtil . getNewBOMLine ( flno , session ) ;
for ( AIFComponentContext c : flnoBOM . getChildren ( ) ) {
fls . add ( c ) ;
gxs . add ( fl [ 1 ] ) ;
}
}
}
items = new DT_BOM_PLM_REQLISTITEMSITEM [ start + fls . size ( ) ] ;
}
int seq = 0 ;
System . out . println ( "len:" + items . length ) ;
if ( buff . length ( ) > 0 & & ! errMess . toString ( ) . contains ( item_id + "-" + object_name + ":" + buff . toString ( ) ) ) {
errMess . append ( "\n" + item_id + "-" + object_name + ":" + buff . toString ( ) ) ;
@ -4286,13 +4353,17 @@ public class SAPUtil {
item . setIDNRK ( zt2_materialNo ) ;
item . setMEINS ( partRev2 . getItem ( ) . getTCProperty ( "zt2_unit" ) . getStringValue ( ) . toUpperCase ( ) ) ;
String zt2_State = partRev2 . getProperty ( "zt2_State" ) ;
if ( zt2_State . equals ( "封存" ) | | zt2_State . equals ( "D1" ) ) {
if ( zt2_State . equals ( "封存" ) | | zt2_State . equals ( "D1" ) ) {
buff . append ( "物料:" ) . append ( zt2_materialNo ) . append ( "已封存,无法传递SAP" ) ;
}
}
item . setDATUV ( now ) ;
item . setPOSTP ( "L" ) ;
item . setPOSNR ( line2 . getProperty ( "bl_sequence_no" ) ) ;
String seqs = line2 . getProperty ( "bl_sequence_no" ) ;
item . setPOSNR ( seqs ) ;
int bl_sequence_no = Integer . parseInt ( seqs . isEmpty ( ) ? "0" : seqs ) ;
if ( bl_sequence_no > seq )
seq = bl_sequence_no ;
String sortno = line2 . getProperty ( "ZT2_ClassificationNo" ) ;
item . setMENGE ( SAPUtil . getSAPMENGE ( rev2 , null , line2 , false , codeRemark , buff ) ) ;
item . setSORTF ( sortno ) ;
@ -4303,10 +4374,9 @@ public class SAPUtil {
items [ i ] = item ;
String item_id2 = rev2 . getProperty ( "item_id" ) ;
String object_name2 = rev2 . getProperty ( "object_name" ) ;
if ( buff . length ( ) > 0 & & ! errMess . toString ( ) . contains (
item_id2 + "-" + object_name2 + "(父项:" + item_id + "-" + object_name + "):" + buff . toString ( ) ) ) {
errMess . append ( "\n" + item_id2 + "-" + object_name2 + "(父项:" + item_id + "-" + object_name + "):"
+ buff . toString ( ) ) ;
String mess = item_id2 + "-" + object_name2 + "(父项:" + item_id + "-" + object_name + "):" + buff . toString ( ) ;
if ( buff . length ( ) > 0 & & ! errMess . toString ( ) . contains ( mess ) ) {
errMess . append ( "\n" + mess ) ;
}
if ( rev2 . getProperty ( "zt2_SapState" ) . equals ( "已传" ) & & isContinue )
continue ;
@ -4314,14 +4384,49 @@ public class SAPUtil {
material_revs . put ( zt2_materialNo , partRev2 ) ;
}
SAPUtil . recurBYBJSAP ( line2 , rev2 , partRev2 , gy_meops , needTCM_meops , session , groupName , list , proclist ,
txtPath , now , bomISExist , codeRemark , icsId , by_materials , errMess , buff , material_revs , matr ,
kjBomIds , projWbsNo ) ;
txtPath , now , bomISExist , codeRemark , icsId , by_materials , errMess , buff , material_revs , matr ,
kjBomIds , projWbsNo , flMap ) ;
}
//
if ( flMap . containsKey ( idCut ) ) {
for ( int i = 0 ; i < fls . size ( ) ; i + + ) {
DT_BOM_PLM_REQLISTITEMSITEM item = new DT_BOM_PLM_REQLISTITEMSITEM ( ) ;
TCComponentBOMLine line2 = ( TCComponentBOMLine ) fls . get ( i ) . getComponent ( ) ;
TCComponentItemRevision rev2 = line2 . getItemRevision ( ) ;
TCComponentItemRevision partRev2 = SAPUtil . getSAPPart ( line2 , session , groupName , buff ) ;
System . out . println ( "fl:" + item_id + ">>" + line2 ) ;
String zt2_MaterialNo = "" ;
if ( partRev2 ! = null ) {
zt2_MaterialNo = partRev2 . getProperty ( "zt2_MaterialNo" ) ;
item . setIDNRK ( zt2_MaterialNo ) ;
item . setMEINS ( partRev2 . getItem ( ) . getTCProperty ( "zt2_unit" ) . getStringValue ( ) . toUpperCase ( ) ) ;
String zt2_State = partRev2 . getProperty ( "zt2_State" ) ;
if ( zt2_State . equals ( "封存" ) | | zt2_State . equals ( "D1" ) ) {
buff . append ( "物料:" ) . append ( zt2_MaterialNo ) . append ( "已封存,无法传递SAP" ) ;
}
}
item . setDATUV ( now ) ;
item . setPOSTP ( "L" ) ;
seq + = 10 ;
item . setPOSNR ( "" + seq ) ;
item . setMENGE ( SAPUtil . getSAPMENGE ( rev2 , null , line2 , false , codeRemark , buff ) ) ;
item . setSORTF ( gxs . get ( i ) ) ;
item . setPOTX1 ( line2 . getProperty ( "ZT2_Remark" ) ) ;
items [ start + i ] = item ;
String item_id2 = rev2 . getProperty ( "item_id" ) ;
String object_name2 = rev2 . getProperty ( "object_name" ) ;
String mess = item_id2 + "-" + object_name2 + "(父项:" + item_id + "-" + object_name + "):" + buff . toString ( ) ;
if ( buff . length ( ) > 0 & & ! errMess . toString ( ) . contains ( mess ) ) {
errMess . append ( "\n" + mess ) ;
}
}
}
list . add ( new DT_BOM_PLM_REQLIST ( head , items ) ) ;
}
/ *
* 变 压 器 总 装 传 递 SAP 逻 辑
* TODO 变 压 器 总 装 传 递 SAP 逻 辑
* /
public static void recurBYZZSAP ( TCComponentBOMLine line , TCComponentItemRevision rev ,
TCComponentItemRevision partRev , Map < String , TCComponent > gy_meops ,
@ -4330,7 +4435,7 @@ public class SAPUtil {
List < String > bomISExist , String codeRemark , int icsId , Map < String , TCComponentItemRevision > by_materials ,
StringBuffer errMess , StringBuffer buff , List < String > dists , int level ,
Map < String , TCComponentItemRevision > material_revs , Set < TCComponent > set_meops , String type1 ,
List < String > kjBomIds , String projWbsNo ) throws Exception {
List < String > kjBomIds , String projWbsNo , HashMap < String , ArrayList < String [ ] > > flMap ) throws Exception {
try {
line . refresh ( ) ;
} catch ( Exception e ) {
@ -4352,7 +4457,7 @@ public class SAPUtil {
partRev = SAPUtil . getSAPPart ( line , session , groupName , buff ) ;
}
TCComponentMEProcessRevision meop = null ;
for ( int i = 0 ; i < meops . length ; i + + ) {
for ( int i = 0 ; i < meops . length ; i + + ) {
TCComponent comp = ( TCComponent ) meops [ i ] . getComponent ( ) ;
TCComponent mpComp = SAPUtil . getSameGroupProcYH ( comp , session ) ;
if ( mpComp ! = null ) {
@ -4366,7 +4471,8 @@ public class SAPUtil {
// if (meops.length > 0 && !KUtil.isTCM((TCComponent) meops[0].getComponent())) {
// set_meops.add((TCComponent) meops[0].getComponent());
// }
// 如果图纸下没有物料, 则, 判断此图纸版本上的属性zt2_Diagram属性, 如果此属性为是( LOV值, 真实值为Y),则不传递此图纸,物料检查也不要报错,跳过此图纸以及子件
// 如果图纸下没有物料, 则, 判断此图纸版本上的属性zt2_Diagram属性,
//如果此属性为是( LOV值, 真实值为Y),则不传递此图纸,物料检查也不要报错,跳过此图纸以及子件
if ( rev . getType ( ) . equals ( "ZT2_Design3DRevision" ) & & partRev = = null ) {
String zt2_Diagram = rev . getTCProperty ( "zt2_Diagram" ) . getStringValue ( ) ;
if ( zt2_Diagram . equals ( "Y" ) | | zt2_Diagram . equals ( "是" ) ) {
@ -4377,9 +4483,9 @@ public class SAPUtil {
System . out . println ( "rev:" + rev + " partRev:" + partRev + " length:" + contexts . length ) ;
if ( partRev ! = null ) {
System . out . println ( "查询工艺路线:" + rev ) ;
if ( partRev ! = null ) {
if ( meop = = null ) {
if ( ! equals & & ( type1 . equals ( "C" ) | | type1 . equals ( "E" ) & & line . getChildrenCount ( ) > 0 ) ) {
if ( ! equals & & rev . getType ( ) . equals ( "ZT2_Design3DRevision" ) ) {
//&& (type1.equals("C") || (type1.equals("B") || type1.equals("E")) && line.getChildrenCount() > 0)
String groupID = SAPUtil . getGroupID ( session ) ;
TCComponentMEProcessRevision mrProcess = getMrProcess ( groupID , session ) ;
if ( mrProcess ! = null ) {
@ -4394,7 +4500,6 @@ public class SAPUtil {
} else {
TXTUtil . writeTXT ( txtPath , "图纸[" + rev + "]无工艺信息" ) ;
}
} else {
TXTUtil . writeTXT ( txtPath , "图纸[" + rev + "]工艺信息:" + meop ) ;
if ( level = = 1 ) {
@ -4404,8 +4509,6 @@ public class SAPUtil {
SAPUtil . readBopInfo1 ( meop , partRev , session ,
now , txtPath , proclist , groupName , gy_meops , needTCM_meops , true ) ;
}
}
}
}
@ -4427,7 +4530,7 @@ public class SAPUtil {
TCComponentBOMLine componentbomline = win . getTopBOMLine ( ) ;
SAPUtil . recurBYZZSAP ( componentbomline , partRev , partRev , gy_meops , needTCM_meops , session , groupName ,
list , proclist , txtPath , now , bomISExist , codeRemark , icsId , by_materials , errMess , buff , dists ,
level , material_revs , set_meops , type1 , kjBomIds , projWbsNo ) ;
level , material_revs , set_meops , type1 , kjBomIds , projWbsNo , flMap ) ;
win . refresh ( ) ;
win . close ( ) ;
@ -4443,8 +4546,11 @@ public class SAPUtil {
bomISExist . add ( zt2_MaterialNo ) ;
}
}
String idCut = "" ;
if ( item_id . indexOf ( "-" ) > 0 )
idCut = item_id . substring ( 0 , item_id . indexOf ( "-" ) ) ;
if ( contexts . length = = 0 ) {
if ( contexts . length = = 0 & & ! flMap . containsKey ( idCut ) ) {
int index = item_id . lastIndexOf ( "-" ) ;
String item_id_cut = "" ;
if ( index ! = - 1 ) {
@ -4570,12 +4676,31 @@ public class SAPUtil {
head . setBMENG ( "1" ) ;
head . setWERKS ( groupName ) ;
head . setDATUV ( now ) ;
DT_BOM_PLM_REQLISTITEMSITEM [ ] items = new DT_BOM_PLM_REQLISTITEMSITEM [ contexts . length ] ;
int start = contexts . length ;
DT_BOM_PLM_REQLISTITEMSITEM [ ] items = new DT_BOM_PLM_REQLISTITEMSITEM [ start ] ;
ArrayList < AIFComponentContext > fls = new ArrayList < > ( ) ;
ArrayList < String > gxs = new ArrayList < > ( ) ;
if ( flMap . containsKey ( idCut ) ) {
for ( String [ ] fl : flMap . get ( idCut ) ) {
TCComponent [ ] flnoItem = session . search ( "零组件 ID" , new String [ ] { "零组件 ID" } ,
new String [ ] { fl [ 0 ] } ) ;
if ( flnoItem . length > 0 ) {
TCComponentItemRevision flno = ( ( TCComponentItem ) flnoItem [ 0 ] ) . getLatestItemRevision ( ) ;
TCComponentBOMLine flnoBOM = SAPUtil . getNewBOMLine ( flno , session ) ;
for ( AIFComponentContext c : flnoBOM . getChildren ( ) ) {
fls . add ( c ) ;
gxs . add ( fl [ 1 ] ) ;
}
}
}
items = new DT_BOM_PLM_REQLISTITEMSITEM [ start + fls . size ( ) ] ;
}
int seq = 0 ;
System . out . println ( "len:" + items . length ) ;
if ( buff . length ( ) > 0 & & ! errMess . toString ( ) . contains ( item_id + "-" + object_name + ":" + buff . toString ( ) ) ) {
errMess . append ( "\n" + item_id + "-" + object_name + ":" + buff . toString ( ) ) ;
}
for ( int i = 0 ; i < contexts . length ; i + + ) {
for ( int i = 0 ; i < start ; i + + ) {
buff . setLength ( 0 ) ;
DT_BOM_PLM_REQLISTITEMSITEM item = new DT_BOM_PLM_REQLISTITEMSITEM ( ) ;
TCComponentBOMLine line2 = ( TCComponentBOMLine ) contexts [ i ] . getComponent ( ) ;
@ -4605,13 +4730,17 @@ public class SAPUtil {
item . setIDNRK ( zt2_MaterialNo ) ;
item . setMEINS ( partRev2 . getItem ( ) . getTCProperty ( "zt2_unit" ) . getStringValue ( ) . toUpperCase ( ) ) ;
String zt2_State = partRev2 . getProperty ( "zt2_State" ) ;
if ( zt2_State . equals ( "封存" ) | | zt2_State . equals ( "D1" ) ) {
if ( zt2_State . equals ( "封存" ) | | zt2_State . equals ( "D1" ) ) {
buff . append ( "物料:" ) . append ( zt2_MaterialNo ) . append ( "已封存,无法传递SAP" ) ;
}
}
item . setDATUV ( now ) ;
item . setPOSTP ( "L" ) ;
item . setPOSNR ( line2 . getProperty ( "bl_sequence_no" ) ) ;
String seqs = line2 . getProperty ( "bl_sequence_no" ) ;
item . setPOSNR ( seqs ) ;
int bl_sequence_no = Integer . parseInt ( seqs . isEmpty ( ) ? "0" : seqs ) ;
if ( bl_sequence_no > seq )
seq = bl_sequence_no ;
String sortno = line2 . getProperty ( "ZT2_ClassificationNo" ) ;
item . setMENGE ( SAPUtil . getSAPMENGE ( rev2 , null , line2 , false , codeRemark , buff ) ) ;
item . setSORTF ( sortno ) ;
@ -4622,10 +4751,9 @@ public class SAPUtil {
items [ i ] = item ;
String item_id2 = rev2 . getProperty ( "item_id" ) ;
String object_name2 = rev2 . getProperty ( "object_name" ) ;
if ( buff . length ( ) > 0 & & ! errMess . toString ( ) . contains (
item_id2 + "-" + object_name2 + "(父项:" + item_id + "-" + object_name + "):" + buff . toString ( ) ) ) {
errMess . append ( "\n" + item_id2 + "-" + object_name2 + "(父项:" + item_id + "-" + object_name + "):"
+ buff . toString ( ) ) ;
String mess = item_id2 + "-" + object_name2 + "(父项:" + item_id + "-" + object_name + "):" + buff . toString ( ) ;
if ( buff . length ( ) > 0 & & ! errMess . toString ( ) . contains ( mess ) ) {
errMess . append ( "\n" + mess ) ;
}
if ( rev2 . getProperty ( "zt2_SapState" ) . equals ( "已传" ) & & isContinue )
continue ;
@ -4634,7 +4762,41 @@ public class SAPUtil {
}
SAPUtil . recurBYZZSAP ( line2 , rev2 , partRev2 , gy_meops , needTCM_meops , session , groupName , list , proclist ,
txtPath , now , bomISExist , codeRemark , icsId , by_materials , errMess , buff , dists , level + 1 ,
material_revs , set_meops , type1 , kjBomIds , projWbsNo ) ;
material_revs , set_meops , type1 , kjBomIds , projWbsNo , flMap ) ;
}
//
if ( flMap . containsKey ( idCut ) ) {
for ( int i = 0 ; i < fls . size ( ) ; i + + ) {
DT_BOM_PLM_REQLISTITEMSITEM item = new DT_BOM_PLM_REQLISTITEMSITEM ( ) ;
TCComponentBOMLine line2 = ( TCComponentBOMLine ) fls . get ( i ) . getComponent ( ) ;
TCComponentItemRevision rev2 = line2 . getItemRevision ( ) ;
TCComponentItemRevision partRev2 = SAPUtil . getSAPPart ( line2 , session , groupName , buff ) ;
String zt2_MaterialNo = "" ;
if ( partRev2 ! = null ) {
zt2_MaterialNo = partRev2 . getProperty ( "zt2_MaterialNo" ) ;
item . setIDNRK ( zt2_MaterialNo ) ;
item . setMEINS ( partRev2 . getItem ( ) . getTCProperty ( "zt2_unit" ) . getStringValue ( ) . toUpperCase ( ) ) ;
String zt2_State = partRev2 . getProperty ( "zt2_State" ) ;
if ( zt2_State . equals ( "封存" ) | | zt2_State . equals ( "D1" ) ) {
buff . append ( "物料:" ) . append ( zt2_MaterialNo ) . append ( "已封存,无法传递SAP" ) ;
}
}
item . setDATUV ( now ) ;
item . setPOSTP ( "L" ) ;
seq + = 10 ;
item . setPOSNR ( "" + seq ) ;
item . setMENGE ( SAPUtil . getSAPMENGE ( rev2 , null , line2 , false , codeRemark , buff ) ) ;
item . setSORTF ( gxs . get ( i ) ) ;
item . setPOTX1 ( line2 . getProperty ( "ZT2_Remark" ) ) ;
items [ start + i ] = item ;
String item_id2 = rev2 . getProperty ( "item_id" ) ;
String object_name2 = rev2 . getProperty ( "object_name" ) ;
String mess = item_id2 + "-" + object_name2 + "(父项:" + item_id + "-" + object_name + "):" + buff . toString ( ) ;
if ( buff . length ( ) > 0 & & ! errMess . toString ( ) . contains ( mess ) ) {
errMess . append ( "\n" + mess ) ;
}
}
}
list . add ( new DT_BOM_PLM_REQLIST ( head , items ) ) ;
}
@ -5645,6 +5807,7 @@ public class SAPUtil {
head . setBMENG ( "1" ) ;
head . setWERKS ( groupName ) ;
head . setDATUV ( now ) ;
head . setSTKTX ( partRev . getUid ( ) ) ;
DT_BOM_PLM_REQLISTITEMSITEM [ ] items = new DT_BOM_PLM_REQLISTITEMSITEM [ 1 ] ;
DT_BOM_PLM_REQLISTITEMSITEM item = new DT_BOM_PLM_REQLISTITEMSITEM ( ) ;
@ -5684,6 +5847,7 @@ public class SAPUtil {
head . setBMENG ( "1" ) ;
head . setWERKS ( groupName ) ;
head . setDATUV ( now ) ;
head . setSTKTX ( partRev . getUid ( ) ) ;
Composite Root = ( Composite ) root ;
int length = Root . getChildren ( ) . size ( ) ;
DT_BOM_PLM_REQLISTITEMSITEM [ ] items = new DT_BOM_PLM_REQLISTITEMSITEM [ length ] ;